You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6167 lines
2.2 MiB
6167 lines
2.2 MiB
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();/**
|
|
* @vue/shared v3.4.21
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/function Vx(e,t){const r=new Set(e.split(","));return t?n=>r.has(n.toLowerCase()):n=>r.has(n)}const Ja={},Wd=[],Wl=()=>{},vk=()=>!1,I_=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),jx=e=>e.startsWith("onUpdate:"),iu=Object.assign,Hx=(e,t)=>{const r=e.indexOf(t);r>-1&&e.splice(r,1)},mk=Object.prototype.hasOwnProperty,aa=(e,t)=>mk.call(e,t),wi=Array.isArray,Xd=e=>M_(e)==="[object Map]",oC=e=>M_(e)==="[object Set]",Bi=e=>typeof e=="function",ds=e=>typeof e=="string",b0=e=>typeof e=="symbol",Ao=e=>e!==null&&typeof e=="object",sC=e=>(Ao(e)||Bi(e))&&Bi(e.then)&&Bi(e.catch),uC=Object.prototype.toString,M_=e=>uC.call(e),gk=e=>M_(e).slice(8,-1),lC=e=>M_(e)==="[object Object]",Gx=e=>ds(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Jv=Vx(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),P_=e=>{const t=Object.create(null);return r=>t[r]||(t[r]=e(r))},_k=/-(\w)/g,i0=P_(e=>e.replace(_k,(t,r)=>r?r.toUpperCase():"")),yk=/\B([A-Z])/g,E0=P_(e=>e.replace(yk,"-$1").toLowerCase()),cC=P_(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ky=P_(e=>e?`on${cC(e)}`:""),xp=(e,t)=>!Object.is(e,t),Qy=(e,t)=>{for(let r=0;r<e.length;r++)e[r](t)},$g=(e,t,r)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:r})},xk=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let u7;const fC=()=>u7||(u7=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function O_(e){if(wi(e)){const t={};for(let r=0;r<e.length;r++){const n=e[r],i=ds(n)?Ak(n):O_(n);if(i)for(const o in i)t[o]=i[o]}return t}else if(ds(e)||Ao(e))return e}const bk=/;(?![^(]*\))/g,Ek=/:([^]+)/,Sk=/\/\*[^]*?\*\//g;function Ak(e){const t={};return e.replace(Sk,"").split(bk).forEach(r=>{if(r){const n=r.split(Ek);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function k_(e){let t="";if(ds(e))t=e;else if(wi(e))for(let r=0;r<e.length;r++){const n=k_(e[r]);n&&(t+=n+" ")}else if(Ao(e))for(const r in e)e[r]&&(t+=r+" ");return t.trim()}const Tk="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",wk=Vx(Tk);function hC(e){return!!e||e===""}const B2=e=>ds(e)?e:e==null?"":wi(e)||Ao(e)&&(e.toString===uC||!Bi(e.toString))?JSON.stringify(e,pC,2):String(e),pC=(e,t)=>t&&t.__v_isRef?pC(e,t.value):Xd(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((r,[n,i],o)=>(r[Jy(n,o)+" =>"]=i,r),{})}:oC(t)?{[`Set(${t.size})`]:[...t.values()].map(r=>Jy(r))}:b0(t)?Jy(t):Ao(t)&&!wi(t)&&!lC(t)?String(t):t,Jy=(e,t="")=>{var r;return b0(e)?`Symbol(${(r=e.description)!=null?r:t})`:e};/**
|
|
* @vue/reactivity v3.4.21
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/let vc;class Ck{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=vc,!t&&vc&&(this.index=(vc.scopes||(vc.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const r=vc;try{return vc=this,t()}finally{vc=r}}}on(){vc=this}off(){vc=this.parent}stop(t){if(this._active){let r,n;for(r=0,n=this.effects.length;r<n;r++)this.effects[r].stop();for(r=0,n=this.cleanups.length;r<n;r++)this.cleanups[r]();if(this.scopes)for(r=0,n=this.scopes.length;r<n;r++)this.scopes[r].stop(!0);if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0,this._active=!1}}}function Rk(e,t=vc){t&&t.active&&t.effects.push(e)}function Ik(){return vc}let _1;class Wx{constructor(t,r,n,i){this.fn=t,this.trigger=r,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,Rk(this,i)}get dirty(){if(this._dirtyLevel===2||this._dirtyLevel===3){this._dirtyLevel=1,I1();for(let t=0;t<this._depsLength;t++){const r=this.deps[t];if(r.computed&&(Mk(r.computed),this._dirtyLevel>=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),M1()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=pp,r=_1;try{return pp=!0,_1=this,this._runnings++,l7(this),this.fn()}finally{c7(this),this._runnings--,_1=r,pp=t}}stop(){var t;this.active&&(l7(this),c7(this),(t=this.onStop)==null||t.call(this),this.active=!1)}}function Mk(e){return e.value}function l7(e){e._trackId++,e._depsLength=0}function c7(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)dC(e.deps[t],e);e.deps.length=e._depsLength}}function dC(e,t){const r=e.get(t);r!==void 0&&t._trackId!==r&&(e.delete(t),e.size===0&&e.cleanup())}let pp=!0,v6=0;const vC=[];function I1(){vC.push(pp),pp=!1}function M1(){const e=vC.pop();pp=e===void 0?!0:e}function Xx(){v6++}function Yx(){for(v6--;!v6&&m6.length;)m6.shift()()}function mC(e,t,r){if(t.get(e)!==e._trackId){t.set(e,e._trackId);const n=e.deps[e._depsLength];n!==t?(n&&dC(n,e),e.deps[e._depsLength++]=t):e._depsLength++}}const m6=[];function gC(e,t,r){Xx();for(const n of e.keys()){let i;n._dirtyLevel<t&&(i??(i=e.get(n)===n._trackId))&&(n._shouldSchedule||(n._shouldSchedule=n._dirtyLevel===0),n._dirtyLevel=t),n._shouldSchedule&&(i??(i=e.get(n)===n._trackId))&&(n.trigger(),(!n._runnings||n.allowRecurse)&&n._dirtyLevel!==2&&(n._shouldSchedule=!1,n.scheduler&&m6.push(n.scheduler)))}Yx()}const _C=(e,t)=>{const r=new Map;return r.cleanup=e,r.computed=t,r},g6=new WeakMap,y1=Symbol(""),_6=Symbol("");function $u(e,t,r){if(pp&&_1){let n=g6.get(e);n||g6.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=_C(()=>n.delete(r))),mC(_1,i)}}function rh(e,t,r,n,i,o){const a=g6.get(e);if(!a)return;let u=[];if(t==="clear")u=[...a.values()];else if(r==="length"&&wi(e)){const c=Number(n);a.forEach((f,m)=>{(m==="length"||!b0(m)&&m>=c)&&u.push(f)})}else switch(r!==void 0&&u.push(a.get(r)),t){case"add":wi(e)?Gx(r)&&u.push(a.get("length")):(u.push(a.get(y1)),Xd(e)&&u.push(a.get(_6)));break;case"delete":wi(e)||(u.push(a.get(y1)),Xd(e)&&u.push(a.get(_6)));break;case"set":Xd(e)&&u.push(a.get(y1));break}Xx();for(const c of u)c&&gC(c,4);Yx()}const Pk=Vx("__proto__,__v_isRef,__isVue"),yC=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(b0)),f7=Ok();function Ok(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...r){const n=va(this);for(let o=0,a=this.length;o<a;o++)$u(n,"get",o+"");const i=n[t](...r);return i===-1||i===!1?n[t](...r.map(va)):i}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...r){I1(),Xx();const n=va(this)[t].apply(this,r);return Yx(),M1(),n}}),e}function kk(e){const t=va(this);return $u(t,"has",e),t.hasOwnProperty(e)}class xC{constructor(t=!1,r=!1){this._isReadonly=t,this._isShallow=r}get(t,r,n){const i=this._isReadonly,o=this._isShallow;if(r==="__v_isReactive")return!i;if(r==="__v_isReadonly")return i;if(r==="__v_isShallow")return o;if(r==="__v_raw")return n===(i?o?Wk:AC:o?SC:EC).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const a=wi(t);if(!i){if(a&&aa(f7,r))return Reflect.get(f7,r,n);if(r==="hasOwnProperty")return kk}const u=Reflect.get(t,r,n);return(b0(r)?yC.has(r):Pk(r))||(i||$u(t,"get",r),o)?u:Vu(u)?a&&Gx(r)?u:u.value:Ao(u)?i?TC(u):Kx(u):u}}class bC extends xC{constructor(t=!1){super(!1,t)}set(t,r,n,i){let o=t[r];if(!this._isShallow){const c=a0(o);if(!Vg(n)&&!a0(n)&&(o=va(o),n=va(n)),!wi(t)&&Vu(o)&&!Vu(n))return c?!1:(o.value=n,!0)}const a=wi(t)&&Gx(r)?Number(r)<t.length:aa(t,r),u=Reflect.set(t,r,n,i);return t===va(i)&&(a?xp(n,o)&&rh(t,"set",r,n):rh(t,"add",r,n)),u}deleteProperty(t,r){const n=aa(t,r);t[r];const i=Reflect.deleteProperty(t,r);return i&&n&&rh(t,"delete",r,void 0),i}has(t,r){const n=Reflect.has(t,r);return(!b0(r)||!yC.has(r))&&$u(t,"has",r),n}ownKeys(t){return $u(t,"iterate",wi(t)?"length":y1),Reflect.ownKeys(t)}}class Dk extends xC{constructor(t=!1){super(!0,t)}set(t,r){return!0}deleteProperty(t,r){return!0}}const Fk=new bC,Bk=new Dk,Lk=new bC(!0),Zx=e=>e,D_=e=>Reflect.getPrototypeOf(e);function L2(e,t,r=!1,n=!1){e=e.__v_raw;const i=va(e),o=va(t);r||(xp(t,o)&&$u(i,"get",t),$u(i,"get",o));const{has:a}=D_(i),u=n?Zx:r?Jx:lm;if(a.call(i,t))return u(e.get(t));if(a.call(i,o))return u(e.get(o));e!==i&&e.get(t)}function N2(e,t=!1){const r=this.__v_raw,n=va(r),i=va(e);return t||(xp(e,i)&&$u(n,"has",e),$u(n,"has",i)),e===i?r.has(e):r.has(e)||r.has(i)}function U2(e,t=!1){return e=e.__v_raw,!t&&$u(va(e),"iterate",y1),Reflect.get(e,"size",e)}function h7(e){e=va(e);const t=va(this);return D_(t).has.call(t,e)||(t.add(e),rh(t,"add",e,e)),this}function p7(e,t){t=va(t);const r=va(this),{has:n,get:i}=D_(r);let o=n.call(r,e);o||(e=va(e),o=n.call(r,e));const a=i.call(r,e);return r.set(e,t),o?xp(t,a)&&rh(r,"set",e,t):rh(r,"add",e,t),this}function d7(e){const t=va(this),{has:r,get:n}=D_(t);let i=r.call(t,e);i||(e=va(e),i=r.call(t,e)),n&&n.call(t,e);const o=t.delete(e);return i&&rh(t,"delete",e,void 0),o}function v7(){const e=va(this),t=e.size!==0,r=e.clear();return t&&rh(e,"clear",void 0,void 0),r}function z2(e,t){return function(n,i){const o=this,a=o.__v_raw,u=va(a),c=t?Zx:e?Jx:lm;return!e&&$u(u,"iterate",y1),a.forEach((f,m)=>n.call(i,c(f),c(m),o))}}function $2(e,t,r){return function(...n){const i=this.__v_raw,o=va(i),a=Xd(o),u=e==="entries"||e===Symbol.iterator&&a,c=e==="keys"&&a,f=i[e](...n),m=r?Zx:t?Jx:lm;return!t&&$u(o,"iterate",c?_6:y1),{next(){const{value:_,done:b}=f.next();return b?{value:_,done:b}:{value:u?[m(_[0]),m(_[1])]:m(_),done:b}},[Symbol.iterator](){return this}}}}function Hh(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Nk(){const e={get(o){return L2(this,o)},get size(){return U2(this)},has:N2,add:h7,set:p7,delete:d7,clear:v7,forEach:z2(!1,!1)},t={get(o){return L2(this,o,!1,!0)},get size(){return U2(this)},has:N2,add:h7,set:p7,delete:d7,clear:v7,forEach:z2(!1,!0)},r={get(o){return L2(this,o,!0)},get size(){return U2(this,!0)},has(o){return N2.call(this,o,!0)},add:Hh("add"),set:Hh("set"),delete:Hh("delete"),clear:Hh("clear"),forEach:z2(!0,!1)},n={get(o){return L2(this,o,!0,!0)},get size(){return U2(this,!0)},has(o){return N2.call(this,o,!0)},add:Hh("add"),set:Hh("set"),delete:Hh("delete"),clear:Hh("clear"),forEach:z2(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{e[o]=$2(o,!1,!1),r[o]=$2(o,!0,!1),t[o]=$2(o,!1,!0),n[o]=$2(o,!0,!0)}),[e,r,t,n]}const[Uk,zk,$k,Vk]=Nk();function qx(e,t){const r=t?e?Vk:$k:e?zk:Uk;return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(aa(r,i)&&i in n?r:n,i,o)}const jk={get:qx(!1,!1)},Hk={get:qx(!1,!0)},Gk={get:qx(!0,!1)},EC=new WeakMap,SC=new WeakMap,AC=new WeakMap,Wk=new WeakMap;function Xk(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Yk(e){return e.__v_skip||!Object.isExtensible(e)?0:Xk(gk(e))}function Kx(e){return a0(e)?e:Qx(e,!1,Fk,jk,EC)}function Zk(e){return Qx(e,!1,Lk,Hk,SC)}function TC(e){return Qx(e,!0,Bk,Gk,AC)}function Qx(e,t,r,n,i){if(!Ao(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=i.get(e);if(o)return o;const a=Yk(e);if(a===0)return e;const u=new Proxy(e,a===2?n:r);return i.set(e,u),u}function Yd(e){return a0(e)?Yd(e.__v_raw):!!(e&&e.__v_isReactive)}function a0(e){return!!(e&&e.__v_isReadonly)}function Vg(e){return!!(e&&e.__v_isShallow)}function wC(e){return Yd(e)||a0(e)}function va(e){const t=e&&e.__v_raw;return t?va(t):e}function CC(e){return Object.isExtensible(e)&&$g(e,"__v_skip",!0),e}const lm=e=>Ao(e)?Kx(e):e,Jx=e=>Ao(e)?TC(e):e;class RC{constructor(t,r,n,i){this.getter=t,this._setter=r,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new Wx(()=>t(this._value),()=>mg(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=n}get value(){const t=va(this);return(!t._cacheable||t.effect.dirty)&&xp(t._value,t._value=t.effect.run())&&mg(t,4),IC(t),t.effect._dirtyLevel>=2&&mg(t,2),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function qk(e,t,r=!1){let n,i;const o=Bi(e);return o?(n=e,i=Wl):(n=e.get,i=e.set),new RC(n,i,o||!i,r)}function IC(e){var t;pp&&_1&&(e=va(e),mC(_1,(t=e.dep)!=null?t:e.dep=_C(()=>e.dep=void 0,e instanceof RC?e:void 0)))}function mg(e,t=4,r){e=va(e);const n=e.dep;n&&gC(n,t)}function Vu(e){return!!(e&&e.__v_isRef===!0)}function zv(e){return Kk(e,!1)}function Kk(e,t){return Vu(e)?e:new Qk(e,t)}class Qk{constructor(t,r){this.__v_isShallow=r,this.dep=void 0,this.__v_isRef=!0,this._rawValue=r?t:va(t),this._value=r?t:lm(t)}get value(){return IC(this),this._value}set value(t){const r=this.__v_isShallow||Vg(t)||a0(t);t=r?t:va(t),xp(t,this._rawValue)&&(this._rawValue=t,this._value=r?t:lm(t),mg(this,4))}}function jl(e){return Vu(e)?e.value:e}const Jk={get:(e,t,r)=>jl(Reflect.get(e,t,r)),set:(e,t,r,n)=>{const i=e[t];return Vu(i)&&!Vu(r)?(i.value=r,!0):Reflect.set(e,t,r,n)}};function MC(e){return Yd(e)?e:new Proxy(e,Jk)}/**
|
|
* @vue/runtime-core v3.4.21
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/function dp(e,t,r,n){try{return n?e(...n):e()}catch(i){F_(i,t,r)}}function bc(e,t,r,n){if(Bi(e)){const o=dp(e,t,r,n);return o&&sC(o)&&o.catch(a=>{F_(a,t,r)}),o}const i=[];for(let o=0;o<e.length;o++)i.push(bc(e[o],t,r,n));return i}function F_(e,t,r,n=!0){const i=t?t.vnode:null;if(t){let o=t.parent;const a=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${r}`;for(;o;){const f=o.ec;if(f){for(let m=0;m<f.length;m++)if(f[m](e,a,u)===!1)return}o=o.parent}const c=t.appContext.config.errorHandler;if(c){dp(c,null,10,[e,a,u]);return}}eD(e,r,i,n)}function eD(e,t,r,n=!0){console.error(e)}let cm=!1,y6=!1;const tu=[];let sf=0;const Zd=[];let ap=null,p1=0;const PC=Promise.resolve();let e5=null;function tD(e){const t=e5||PC;return e?t.then(this?e.bind(this):e):t}function rD(e){let t=sf+1,r=tu.length;for(;t<r;){const n=t+r>>>1,i=tu[n],o=fm(i);o<e||o===e&&i.pre?t=n+1:r=n}return t}function t5(e){(!tu.length||!tu.includes(e,cm&&e.allowRecurse?sf+1:sf))&&(e.id==null?tu.push(e):tu.splice(rD(e.id),0,e),OC())}function OC(){!cm&&!y6&&(y6=!0,e5=PC.then(DC))}function nD(e){const t=tu.indexOf(e);t>sf&&tu.splice(t,1)}function iD(e){wi(e)?Zd.push(...e):(!ap||!ap.includes(e,e.allowRecurse?p1+1:p1))&&Zd.push(e),OC()}function m7(e,t,r=cm?sf+1:0){for(;r<tu.length;r++){const n=tu[r];if(n&&n.pre){if(e&&n.id!==e.uid)continue;tu.splice(r,1),r--,n()}}}function kC(e){if(Zd.length){const t=[...new Set(Zd)].sort((r,n)=>fm(r)-fm(n));if(Zd.length=0,ap){ap.push(...t);return}for(ap=t,p1=0;p1<ap.length;p1++)ap[p1]();ap=null,p1=0}}const fm=e=>e.id==null?1/0:e.id,aD=(e,t)=>{const r=fm(e)-fm(t);if(r===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return r};function DC(e){y6=!1,cm=!0,tu.sort(aD);try{for(sf=0;sf<tu.length;sf++){const t=tu[sf];t&&t.active!==!1&&dp(t,null,14)}}finally{sf=0,tu.length=0,kC(),cm=!1,e5=null,(tu.length||Zd.length)&&DC()}}function oD(e,t,...r){if(e.isUnmounted)return;const n=e.vnode.props||Ja;let i=r;const o=t.startsWith("update:"),a=o&&t.slice(7);if(a&&a in n){const m=`${a==="modelValue"?"model":a}Modifiers`,{number:_,trim:b}=n[m]||Ja;b&&(i=r.map(A=>ds(A)?A.trim():A)),_&&(i=r.map(xk))}let u,c=n[u=Ky(t)]||n[u=Ky(i0(t))];!c&&o&&(c=n[u=Ky(E0(t))]),c&&bc(c,e,6,i);const f=n[u+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,bc(f,e,6,i)}}function FC(e,t,r=!1){const n=t.emitsCache,i=n.get(e);if(i!==void 0)return i;const o=e.emits;let a={},u=!1;if(!Bi(e)){const c=f=>{const m=FC(f,t,!0);m&&(u=!0,iu(a,m))};!r&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!o&&!u?(Ao(e)&&n.set(e,null),null):(wi(o)?o.forEach(c=>a[c]=null):iu(a,o),Ao(e)&&n.set(e,a),a)}function B_(e,t){return!e||!I_(t)?!1:(t=t.slice(2).replace(/Once$/,""),aa(e,t[0].toLowerCase()+t.slice(1))||aa(e,E0(t))||aa(e,t))}let ll=null,BC=null;function jg(e){const t=ll;return ll=e,BC=e&&e.type.__scopeId||null,t}function sD(e,t=ll,r){if(!t||e._n)return e;const n=(...i)=>{n._d&&w7(-1);const o=jg(t);let a;try{a=e(...i)}finally{jg(o),n._d&&w7(1)}return a};return n._n=!0,n._c=!0,n._d=!0,n}function e3(e){const{type:t,vnode:r,proxy:n,withProxy:i,props:o,propsOptions:[a],slots:u,attrs:c,emit:f,render:m,renderCache:_,data:b,setupState:A,ctx:w,inheritAttrs:R}=e;let P,k;const L=jg(e);try{if(r.shapeFlag&4){const V=i||n,G=V;P=of(m.call(G,V,_,o,A,b,w)),k=c}else{const V=t;P=of(V.length>1?V(o,{attrs:c,slots:u,emit:f}):V(o,null)),k=t.props?c:uD(c)}}catch(V){rm.length=0,F_(V,e,1),P=vp(hm)}let B=P;if(k&&R!==!1){const V=Object.keys(k),{shapeFlag:G}=B;V.length&&G&7&&(a&&V.some(jx)&&(k=lD(k,a)),B=o0(B,k))}return r.dirs&&(B=o0(B),B.dirs=B.dirs?B.dirs.concat(r.dirs):r.dirs),r.transition&&(B.transition=r.transition),P=B,jg(L),P}const uD=e=>{let t;for(const r in e)(r==="class"||r==="style"||I_(r))&&((t||(t={}))[r]=e[r]);return t},lD=(e,t)=>{const r={};for(const n in e)(!jx(n)||!(n.slice(9)in t))&&(r[n]=e[n]);return r};function cD(e,t,r){const{props:n,children:i,component:o}=e,{props:a,children:u,patchFlag:c}=t,f=o.emitsOptions;if(t.dirs||t.transition)return!0;if(r&&c>=0){if(c&1024)return!0;if(c&16)return n?g7(n,a,f):!!a;if(c&8){const m=t.dynamicProps;for(let _=0;_<m.length;_++){const b=m[_];if(a[b]!==n[b]&&!B_(f,b))return!0}}}else return(i||u)&&(!u||!u.$stable)?!0:n===a?!1:n?a?g7(n,a,f):!0:!!a;return!1}function g7(e,t,r){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let i=0;i<n.length;i++){const o=n[i];if(t[o]!==e[o]&&!B_(r,o))return!0}return!1}function fD({vnode:e,parent:t},r){for(;t;){const n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.el=e.el),n===e)(e=t.vnode).el=r,t=t.parent;else break}}const hD=Symbol.for("v-ndc"),pD=e=>e.__isSuspense;function dD(e,t){t&&t.pendingBranch?wi(e)?t.effects.push(...e):t.effects.push(e):iD(e)}const vD=Symbol.for("v-scx"),mD=()=>_g(vD),V2={};function t3(e,t,r){return LC(e,t,r)}function LC(e,t,{immediate:r,deep:n,flush:i,once:o,onTrack:a,onTrigger:u}=Ja){if(t&&o){const K=t;t=(...Z)=>{K(...Z),G()}}const c=vu,f=K=>n===!0?K:d1(K,n===!1?1:void 0);let m,_=!1,b=!1;if(Vu(e)?(m=()=>e.value,_=Vg(e)):Yd(e)?(m=()=>f(e),_=!0):wi(e)?(b=!0,_=e.some(K=>Yd(K)||Vg(K)),m=()=>e.map(K=>{if(Vu(K))return K.value;if(Yd(K))return f(K);if(Bi(K))return dp(K,c,2)})):Bi(e)?t?m=()=>dp(e,c,2):m=()=>(A&&A(),bc(e,c,3,[w])):m=Wl,t&&n){const K=m;m=()=>d1(K())}let A,w=K=>{A=B.onStop=()=>{dp(K,c,4),A=B.onStop=void 0}},R;if(z_)if(w=Wl,t?r&&bc(t,c,3,[m(),b?[]:void 0,w]):m(),i==="sync"){const K=mD();R=K.__watcherHandles||(K.__watcherHandles=[])}else return Wl;let P=b?new Array(e.length).fill(V2):V2;const k=()=>{if(!(!B.active||!B.dirty))if(t){const K=B.run();(n||_||(b?K.some((Z,ve)=>xp(Z,P[ve])):xp(K,P)))&&(A&&A(),bc(t,c,3,[K,P===V2?void 0:b&&P[0]===V2?[]:P,w]),P=K)}else B.run()};k.allowRecurse=!!t;let L;i==="sync"?L=k:i==="post"?L=()=>Du(k,c&&c.suspense):(k.pre=!0,c&&(k.id=c.uid),L=()=>t5(k));const B=new Wx(m,Wl,L),V=Ik(),G=()=>{B.stop(),V&&Hx(V.effects,B)};return t?r?k():P=B.run():i==="post"?Du(B.run.bind(B),c&&c.suspense):B.run(),R&&R.push(G),G}function gD(e,t,r){const n=this.proxy,i=ds(e)?e.includes(".")?NC(n,e):()=>n[e]:e.bind(n,n);let o;Bi(t)?o=t:(o=t.handler,r=t);const a=Um(this),u=LC(i,o.bind(n),r);return a(),u}function NC(e,t){const r=t.split(".");return()=>{let n=e;for(let i=0;i<r.length&&n;i++)n=n[r[i]];return n}}function d1(e,t,r=0,n){if(!Ao(e)||e.__v_skip)return e;if(t&&t>0){if(r>=t)return e;r++}if(n=n||new Set,n.has(e))return e;if(n.add(e),Vu(e))d1(e.value,t,r,n);else if(wi(e))for(let i=0;i<e.length;i++)d1(e[i],t,r,n);else if(oC(e)||Xd(e))e.forEach(i=>{d1(i,t,r,n)});else if(lC(e))for(const i in e)d1(e[i],t,r,n);return e}function _D(e,t){if(ll===null)return e;const r=$_(ll)||ll.proxy,n=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[o,a,u,c=Ja]=t[i];o&&(Bi(o)&&(o={mounted:o,updated:o}),o.deep&&d1(a),n.push({dir:o,instance:r,value:a,oldValue:void 0,arg:u,modifiers:c}))}return e}function r1(e,t,r,n){const i=e.dirs,o=t&&t.dirs;for(let a=0;a<i.length;a++){const u=i[a];o&&(u.oldValue=o[a].value);let c=u.dir[n];c&&(I1(),bc(c,r,8,[e.el,u,e,t]),M1())}}const gg=e=>!!e.type.__asyncLoader,UC=e=>e.type.__isKeepAlive;function yD(e,t){zC(e,"a",t)}function xD(e,t){zC(e,"da",t)}function zC(e,t,r=vu){const n=e.__wdc||(e.__wdc=()=>{let i=r;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(L_(t,n,r),r){let i=r.parent;for(;i&&i.parent;)UC(i.parent.vnode)&&bD(n,t,r,i),i=i.parent}}function bD(e,t,r,n){const i=L_(t,e,n,!0);VC(()=>{Hx(n[t],i)},r)}function L_(e,t,r=vu,n=!1){if(r){const i=r[e]||(r[e]=[]),o=t.__weh||(t.__weh=(...a)=>{if(r.isUnmounted)return;I1();const u=Um(r),c=bc(t,r,e,a);return u(),M1(),c});return n?i.unshift(o):i.push(o),o}}const uh=e=>(t,r=vu)=>(!z_||e==="sp")&&L_(e,(...n)=>t(...n),r),ED=uh("bm"),$C=uh("m"),SD=uh("bu"),AD=uh("u"),TD=uh("bum"),VC=uh("um"),wD=uh("sp"),CD=uh("rtg"),RD=uh("rtc");function ID(e,t=vu){L_("ec",e,t)}function MD(e,t,r,n){let i;const o=r&&r[n];if(wi(e)||ds(e)){i=new Array(e.length);for(let a=0,u=e.length;a<u;a++)i[a]=t(e[a],a,void 0,o&&o[a])}else if(typeof e=="number"){i=new Array(e);for(let a=0;a<e;a++)i[a]=t(a+1,a,void 0,o&&o[a])}else if(Ao(e))if(e[Symbol.iterator])i=Array.from(e,(a,u)=>t(a,u,void 0,o&&o[u]));else{const a=Object.keys(e);i=new Array(a.length);for(let u=0,c=a.length;u<c;u++){const f=a[u];i[u]=t(e[f],f,u,o&&o[u])}}else i=[];return r&&(r[n]=i),i}const x6=e=>e?JC(e)?$_(e)||e.proxy:x6(e.parent):null,em=iu(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>x6(e.parent),$root:e=>x6(e.root),$emit:e=>e.emit,$options:e=>r5(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,t5(e.update)}),$nextTick:e=>e.n||(e.n=tD.bind(e.proxy)),$watch:e=>gD.bind(e)}),r3=(e,t)=>e!==Ja&&!e.__isScriptSetup&&aa(e,t),PD={get({_:e},t){const{ctx:r,setupState:n,data:i,props:o,accessCache:a,type:u,appContext:c}=e;let f;if(t[0]!=="$"){const A=a[t];if(A!==void 0)switch(A){case 1:return n[t];case 2:return i[t];case 4:return r[t];case 3:return o[t]}else{if(r3(n,t))return a[t]=1,n[t];if(i!==Ja&&aa(i,t))return a[t]=2,i[t];if((f=e.propsOptions[0])&&aa(f,t))return a[t]=3,o[t];if(r!==Ja&&aa(r,t))return a[t]=4,r[t];b6&&(a[t]=0)}}const m=em[t];let _,b;if(m)return t==="$attrs"&&$u(e,"get",t),m(e);if((_=u.__cssModules)&&(_=_[t]))return _;if(r!==Ja&&aa(r,t))return a[t]=4,r[t];if(b=c.config.globalProperties,aa(b,t))return b[t]},set({_:e},t,r){const{data:n,setupState:i,ctx:o}=e;return r3(i,t)?(i[t]=r,!0):n!==Ja&&aa(n,t)?(n[t]=r,!0):aa(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=r,!0)},has({_:{data:e,setupState:t,accessCache:r,ctx:n,appContext:i,propsOptions:o}},a){let u;return!!r[a]||e!==Ja&&aa(e,a)||r3(t,a)||(u=o[0])&&aa(u,a)||aa(n,a)||aa(em,a)||aa(i.config.globalProperties,a)},defineProperty(e,t,r){return r.get!=null?e._.accessCache[t]=0:aa(r,"value")&&this.set(e,t,r.value,null),Reflect.defineProperty(e,t,r)}};function _7(e){return wi(e)?e.reduce((t,r)=>(t[r]=null,t),{}):e}let b6=!0;function OD(e){const t=r5(e),r=e.proxy,n=e.ctx;b6=!1,t.beforeCreate&&y7(t.beforeCreate,e,"bc");const{data:i,computed:o,methods:a,watch:u,provide:c,inject:f,created:m,beforeMount:_,mounted:b,beforeUpdate:A,updated:w,activated:R,deactivated:P,beforeDestroy:k,beforeUnmount:L,destroyed:B,unmounted:V,render:G,renderTracked:K,renderTriggered:Z,errorCaptured:ve,serverPrefetch:Ie,expose:de,inheritAttrs:se,components:le,directives:ye,filters:ke}=t;if(f&&kD(f,n,null),a)for(const Gt in a){const Zt=a[Gt];Bi(Zt)&&(n[Gt]=Zt.bind(r))}if(i){const Gt=i.call(r,r);Ao(Gt)&&(e.data=Kx(Gt))}if(b6=!0,o)for(const Gt in o){const Zt=o[Gt],st=Bi(Zt)?Zt.bind(r,r):Bi(Zt.get)?Zt.get.bind(r,r):Wl,tt=!Bi(Zt)&&Bi(Zt.set)?Zt.set.bind(r):Wl,dt=fF({get:st,set:tt});Object.defineProperty(n,Gt,{enumerable:!0,configurable:!0,get:()=>dt.value,set:nt=>dt.value=nt})}if(u)for(const Gt in u)jC(u[Gt],n,r,Gt);if(c){const Gt=Bi(c)?c.call(r):c;Reflect.ownKeys(Gt).forEach(Zt=>{UD(Zt,Gt[Zt])})}m&&y7(m,e,"c");function Lt(Gt,Zt){wi(Zt)?Zt.forEach(st=>Gt(st.bind(r))):Zt&&Gt(Zt.bind(r))}if(Lt(ED,_),Lt($C,b),Lt(SD,A),Lt(AD,w),Lt(yD,R),Lt(xD,P),Lt(ID,ve),Lt(RD,K),Lt(CD,Z),Lt(TD,L),Lt(VC,V),Lt(wD,Ie),wi(de))if(de.length){const Gt=e.exposed||(e.exposed={});de.forEach(Zt=>{Object.defineProperty(Gt,Zt,{get:()=>r[Zt],set:st=>r[Zt]=st})})}else e.exposed||(e.exposed={});G&&e.render===Wl&&(e.render=G),se!=null&&(e.inheritAttrs=se),le&&(e.components=le),ye&&(e.directives=ye)}function kD(e,t,r=Wl){wi(e)&&(e=E6(e));for(const n in e){const i=e[n];let o;Ao(i)?"default"in i?o=_g(i.from||n,i.default,!0):o=_g(i.from||n):o=_g(i),Vu(o)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:a=>o.value=a}):t[n]=o}}function y7(e,t,r){bc(wi(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,r)}function jC(e,t,r,n){const i=n.includes(".")?NC(r,n):()=>r[n];if(ds(e)){const o=t[e];Bi(o)&&t3(i,o)}else if(Bi(e))t3(i,e.bind(r));else if(Ao(e))if(wi(e))e.forEach(o=>jC(o,t,r,n));else{const o=Bi(e.handler)?e.handler.bind(r):t[e.handler];Bi(o)&&t3(i,o,e)}}function r5(e){const t=e.type,{mixins:r,extends:n}=t,{mixins:i,optionsCache:o,config:{optionMergeStrategies:a}}=e.appContext,u=o.get(t);let c;return u?c=u:!i.length&&!r&&!n?c=t:(c={},i.length&&i.forEach(f=>Hg(c,f,a,!0)),Hg(c,t,a)),Ao(t)&&o.set(t,c),c}function Hg(e,t,r,n=!1){const{mixins:i,extends:o}=t;o&&Hg(e,o,r,!0),i&&i.forEach(a=>Hg(e,a,r,!0));for(const a in t)if(!(n&&a==="expose")){const u=DD[a]||r&&r[a];e[a]=u?u(e[a],t[a]):t[a]}return e}const DD={data:x7,props:b7,emits:b7,methods:$v,computed:$v,beforeCreate:du,created:du,beforeMount:du,mounted:du,beforeUpdate:du,updated:du,beforeDestroy:du,beforeUnmount:du,destroyed:du,unmounted:du,activated:du,deactivated:du,errorCaptured:du,serverPrefetch:du,components:$v,directives:$v,watch:BD,provide:x7,inject:FD};function x7(e,t){return t?e?function(){return iu(Bi(e)?e.call(this,this):e,Bi(t)?t.call(this,this):t)}:t:e}function FD(e,t){return $v(E6(e),E6(t))}function E6(e){if(wi(e)){const t={};for(let r=0;r<e.length;r++)t[e[r]]=e[r];return t}return e}function du(e,t){return e?[...new Set([].concat(e,t))]:t}function $v(e,t){return e?iu(Object.create(null),e,t):t}function b7(e,t){return e?wi(e)&&wi(t)?[...new Set([...e,...t])]:iu(Object.create(null),_7(e),_7(t??{})):t}function BD(e,t){if(!e)return t;if(!t)return e;const r=iu(Object.create(null),e);for(const n in t)r[n]=du(e[n],t[n]);return r}function HC(){return{app:null,config:{isNativeTag:vk,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let LD=0;function ND(e,t){return function(n,i=null){Bi(n)||(n=iu({},n)),i!=null&&!Ao(i)&&(i=null);const o=HC(),a=new WeakSet;let u=!1;const c=o.app={_uid:LD++,_component:n,_props:i,_container:null,_context:o,_instance:null,version:hF,get config(){return o.config},set config(f){},use(f,...m){return a.has(f)||(f&&Bi(f.install)?(a.add(f),f.install(c,...m)):Bi(f)&&(a.add(f),f(c,...m))),c},mixin(f){return o.mixins.includes(f)||o.mixins.push(f),c},component(f,m){return m?(o.components[f]=m,c):o.components[f]},directive(f,m){return m?(o.directives[f]=m,c):o.directives[f]},mount(f,m,_){if(!u){const b=vp(n,i);return b.appContext=o,_===!0?_="svg":_===!1&&(_=void 0),m&&t?t(b,f):e(b,f,_),u=!0,c._container=f,f.__vue_app__=c,$_(b.component)||b.component.proxy}},unmount(){u&&(e(null,c._container),delete c._container.__vue_app__)},provide(f,m){return o.provides[f]=m,c},runWithContext(f){const m=tm;tm=c;try{return f()}finally{tm=m}}};return c}}let tm=null;function UD(e,t){if(vu){let r=vu.provides;const n=vu.parent&&vu.parent.provides;n===r&&(r=vu.provides=Object.create(n)),r[e]=t}}function _g(e,t,r=!1){const n=vu||ll;if(n||tm){const i=n?n.parent==null?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:tm._context.provides;if(i&&e in i)return i[e];if(arguments.length>1)return r&&Bi(t)?t.call(n&&n.proxy):t}}function zD(e,t,r,n=!1){const i={},o={};$g(o,U_,1),e.propsDefaults=Object.create(null),GC(e,t,i,o);for(const a in e.propsOptions[0])a in i||(i[a]=void 0);r?e.props=n?i:Zk(i):e.type.props?e.props=i:e.props=o,e.attrs=o}function $D(e,t,r,n){const{props:i,attrs:o,vnode:{patchFlag:a}}=e,u=va(i),[c]=e.propsOptions;let f=!1;if((n||a>0)&&!(a&16)){if(a&8){const m=e.vnode.dynamicProps;for(let _=0;_<m.length;_++){let b=m[_];if(B_(e.emitsOptions,b))continue;const A=t[b];if(c)if(aa(o,b))A!==o[b]&&(o[b]=A,f=!0);else{const w=i0(b);i[w]=S6(c,u,w,A,e,!1)}else A!==o[b]&&(o[b]=A,f=!0)}}}else{GC(e,t,i,o)&&(f=!0);let m;for(const _ in u)(!t||!aa(t,_)&&((m=E0(_))===_||!aa(t,m)))&&(c?r&&(r[_]!==void 0||r[m]!==void 0)&&(i[_]=S6(c,u,_,void 0,e,!0)):delete i[_]);if(o!==u)for(const _ in o)(!t||!aa(t,_))&&(delete o[_],f=!0)}f&&rh(e,"set","$attrs")}function GC(e,t,r,n){const[i,o]=e.propsOptions;let a=!1,u;if(t)for(let c in t){if(Jv(c))continue;const f=t[c];let m;i&&aa(i,m=i0(c))?!o||!o.includes(m)?r[m]=f:(u||(u={}))[m]=f:B_(e.emitsOptions,c)||(!(c in n)||f!==n[c])&&(n[c]=f,a=!0)}if(o){const c=va(r),f=u||Ja;for(let m=0;m<o.length;m++){const _=o[m];r[_]=S6(i,c,_,f[_],e,!aa(f,_))}}return a}function S6(e,t,r,n,i,o){const a=e[r];if(a!=null){const u=aa(a,"default");if(u&&n===void 0){const c=a.default;if(a.type!==Function&&!a.skipFactory&&Bi(c)){const{propsDefaults:f}=i;if(r in f)n=f[r];else{const m=Um(i);n=f[r]=c.call(null,t),m()}}else n=c}a[0]&&(o&&!u?n=!1:a[1]&&(n===""||n===E0(r))&&(n=!0))}return n}function WC(e,t,r=!1){const n=t.propsCache,i=n.get(e);if(i)return i;const o=e.props,a={},u=[];let c=!1;if(!Bi(e)){const m=_=>{c=!0;const[b,A]=WC(_,t,!0);iu(a,b),A&&u.push(...A)};!r&&t.mixins.length&&t.mixins.forEach(m),e.extends&&m(e.extends),e.mixins&&e.mixins.forEach(m)}if(!o&&!c)return Ao(e)&&n.set(e,Wd),Wd;if(wi(o))for(let m=0;m<o.length;m++){const _=i0(o[m]);E7(_)&&(a[_]=Ja)}else if(o)for(const m in o){const _=i0(m);if(E7(_)){const b=o[m],A=a[_]=wi(b)||Bi(b)?{type:b}:iu({},b);if(A){const w=T7(Boolean,A.type),R=T7(String,A.type);A[0]=w>-1,A[1]=R<0||w<R,(w>-1||aa(A,"default"))&&u.push(_)}}}const f=[a,u];return Ao(e)&&n.set(e,f),f}function E7(e){return e[0]!=="$"&&!Jv(e)}function S7(e){return e===null?"null":typeof e=="function"?e.name||"":typeof e=="object"&&e.constructor&&e.constructor.name||""}function A7(e,t){return S7(e)===S7(t)}function T7(e,t){return wi(t)?t.findIndex(r=>A7(r,e)):Bi(t)&&A7(t,e)?0:-1}const XC=e=>e[0]==="_"||e==="$stable",n5=e=>wi(e)?e.map(of):[of(e)],VD=(e,t,r)=>{if(t._n)return t;const n=sD((...i)=>n5(t(...i)),r);return n._c=!1,n},YC=(e,t,r)=>{const n=e._ctx;for(const i in e){if(XC(i))continue;const o=e[i];if(Bi(o))t[i]=VD(i,o,n);else if(o!=null){const a=n5(o);t[i]=()=>a}}},ZC=(e,t)=>{const r=n5(t);e.slots.default=()=>r},jD=(e,t)=>{if(e.vnode.shapeFlag&32){const r=t._;r?(e.slots=va(t),$g(t,"_",r)):YC(t,e.slots={})}else e.slots={},t&&ZC(e,t);$g(e.slots,U_,1)},HD=(e,t,r)=>{const{vnode:n,slots:i}=e;let o=!0,a=Ja;if(n.shapeFlag&32){const u=t._;u?r&&u===1?o=!1:(iu(i,t),!r&&u===1&&delete i._):(o=!t.$stable,YC(t,i)),a=t}else t&&(ZC(e,t),a={default:1});if(o)for(const u in i)!XC(u)&&a[u]==null&&delete i[u]};function A6(e,t,r,n,i=!1){if(wi(e)){e.forEach((b,A)=>A6(b,t&&(wi(t)?t[A]:t),r,n,i));return}if(gg(n)&&!i)return;const o=n.shapeFlag&4?$_(n.component)||n.component.proxy:n.el,a=i?null:o,{i:u,r:c}=e,f=t&&t.r,m=u.refs===Ja?u.refs={}:u.refs,_=u.setupState;if(f!=null&&f!==c&&(ds(f)?(m[f]=null,aa(_,f)&&(_[f]=null)):Vu(f)&&(f.value=null)),Bi(c))dp(c,u,12,[a,m]);else{const b=ds(c),A=Vu(c);if(b||A){const w=()=>{if(e.f){const R=b?aa(_,c)?_[c]:m[c]:c.value;i?wi(R)&&Hx(R,o):wi(R)?R.includes(o)||R.push(o):b?(m[c]=[o],aa(_,c)&&(_[c]=m[c])):(c.value=[o],e.k&&(m[e.k]=c.value))}else b?(m[c]=a,aa(_,c)&&(_[c]=a)):A&&(c.value=a,e.k&&(m[e.k]=a))};a?(w.id=-1,Du(w,r)):w()}}}const Du=dD;function GD(e){return WD(e)}function WD(e,t){const r=fC();r.__VUE__=!0;const{insert:n,remove:i,patchProp:o,createElement:a,createText:u,createComment:c,setText:f,setElementText:m,parentNode:_,nextSibling:b,setScopeId:A=Wl,insertStaticContent:w}=e,R=(ge,Be,ft,At=null,bt=null,$t=null,Mr=void 0,tr=null,lr=!!Be.dynamicChildren)=>{if(ge===Be)return;ge&&!sv(ge,Be)&&(At=pn(ge),nt(ge,bt,$t,!0),ge=null),Be.patchFlag===-2&&(lr=!1,Be.dynamicChildren=null);const{type:or,ref:Q,shapeFlag:Ge}=Be;switch(or){case N_:P(ge,Be,ft,At);break;case hm:k(ge,Be,ft,At);break;case i3:ge==null&&L(Be,ft,At,Mr);break;case mc:le(ge,Be,ft,At,bt,$t,Mr,tr,lr);break;default:Ge&1?G(ge,Be,ft,At,bt,$t,Mr,tr,lr):Ge&6?ye(ge,Be,ft,At,bt,$t,Mr,tr,lr):(Ge&64||Ge&128)&&or.process(ge,Be,ft,At,bt,$t,Mr,tr,lr,Qt)}Q!=null&&bt&&A6(Q,ge&&ge.ref,$t,Be||ge,!Be)},P=(ge,Be,ft,At)=>{if(ge==null)n(Be.el=u(Be.children),ft,At);else{const bt=Be.el=ge.el;Be.children!==ge.children&&f(bt,Be.children)}},k=(ge,Be,ft,At)=>{ge==null?n(Be.el=c(Be.children||""),ft,At):Be.el=ge.el},L=(ge,Be,ft,At)=>{[ge.el,ge.anchor]=w(ge.children,Be,ft,At,ge.el,ge.anchor)},B=({el:ge,anchor:Be},ft,At)=>{let bt;for(;ge&&ge!==Be;)bt=b(ge),n(ge,ft,At),ge=bt;n(Be,ft,At)},V=({el:ge,anchor:Be})=>{let ft;for(;ge&&ge!==Be;)ft=b(ge),i(ge),ge=ft;i(Be)},G=(ge,Be,ft,At,bt,$t,Mr,tr,lr)=>{Be.type==="svg"?Mr="svg":Be.type==="math"&&(Mr="mathml"),ge==null?K(Be,ft,At,bt,$t,Mr,tr,lr):Ie(ge,Be,bt,$t,Mr,tr,lr)},K=(ge,Be,ft,At,bt,$t,Mr,tr)=>{let lr,or;const{props:Q,shapeFlag:Ge,transition:at,dirs:yt}=ge;if(lr=ge.el=a(ge.type,$t,Q&&Q.is,Q),Ge&8?m(lr,ge.children):Ge&16&&ve(ge.children,lr,null,At,bt,n3(ge,$t),Mr,tr),yt&&r1(ge,null,At,"created"),Z(lr,ge,ge.scopeId,Mr,At),Q){for(const hr in Q)hr!=="value"&&!Jv(hr)&&o(lr,hr,null,Q[hr],$t,ge.children,At,bt,Xn);"value"in Q&&o(lr,"value",null,Q.value,$t),(or=Q.onVnodeBeforeMount)&&qc(or,At,ge)}yt&&r1(ge,null,At,"beforeMount");const rr=XD(bt,at);rr&&at.beforeEnter(lr),n(lr,Be,ft),((or=Q&&Q.onVnodeMounted)||rr||yt)&&Du(()=>{or&&qc(or,At,ge),rr&&at.enter(lr),yt&&r1(ge,null,At,"mounted")},bt)},Z=(ge,Be,ft,At,bt)=>{if(ft&&A(ge,ft),At)for(let $t=0;$t<At.length;$t++)A(ge,At[$t]);if(bt){let $t=bt.subTree;if(Be===$t){const Mr=bt.vnode;Z(ge,Mr,Mr.scopeId,Mr.slotScopeIds,bt.parent)}}},ve=(ge,Be,ft,At,bt,$t,Mr,tr,lr=0)=>{for(let or=lr;or<ge.length;or++){const Q=ge[or]=tr?op(ge[or]):of(ge[or]);R(null,Q,Be,ft,At,bt,$t,Mr,tr)}},Ie=(ge,Be,ft,At,bt,$t,Mr)=>{const tr=Be.el=ge.el;let{patchFlag:lr,dynamicChildren:or,dirs:Q}=Be;lr|=ge.patchFlag&16;const Ge=ge.props||Ja,at=Be.props||Ja;let yt;if(ft&&n1(ft,!1),(yt=at.onVnodeBeforeUpdate)&&qc(yt,ft,Be,ge),Q&&r1(Be,ge,ft,"beforeUpdate"),ft&&n1(ft,!0),or?de(ge.dynamicChildren,or,tr,ft,At,n3(Be,bt),$t):Mr||Zt(ge,Be,tr,null,ft,At,n3(Be,bt),$t,!1),lr>0){if(lr&16)se(tr,Be,Ge,at,ft,At,bt);else if(lr&2&&Ge.class!==at.class&&o(tr,"class",null,at.class,bt),lr&4&&o(tr,"style",Ge.style,at.style,bt),lr&8){const rr=Be.dynamicProps;for(let hr=0;hr<rr.length;hr++){const Cn=rr[hr],rn=Ge[Cn],Ne=at[Cn];(Ne!==rn||Cn==="value")&&o(tr,Cn,rn,Ne,bt,ge.children,ft,At,Xn)}}lr&1&&ge.children!==Be.children&&m(tr,Be.children)}else!Mr&&or==null&&se(tr,Be,Ge,at,ft,At,bt);((yt=at.onVnodeUpdated)||Q)&&Du(()=>{yt&&qc(yt,ft,Be,ge),Q&&r1(Be,ge,ft,"updated")},At)},de=(ge,Be,ft,At,bt,$t,Mr)=>{for(let tr=0;tr<Be.length;tr++){const lr=ge[tr],or=Be[tr],Q=lr.el&&(lr.type===mc||!sv(lr,or)||lr.shapeFlag&70)?_(lr.el):ft;R(lr,or,Q,null,At,bt,$t,Mr,!0)}},se=(ge,Be,ft,At,bt,$t,Mr)=>{if(ft!==At){if(ft!==Ja)for(const tr in ft)!Jv(tr)&&!(tr in At)&&o(ge,tr,ft[tr],null,Mr,Be.children,bt,$t,Xn);for(const tr in At){if(Jv(tr))continue;const lr=At[tr],or=ft[tr];lr!==or&&tr!=="value"&&o(ge,tr,or,lr,Mr,Be.children,bt,$t,Xn)}"value"in At&&o(ge,"value",ft.value,At.value,Mr)}},le=(ge,Be,ft,At,bt,$t,Mr,tr,lr)=>{const or=Be.el=ge?ge.el:u(""),Q=Be.anchor=ge?ge.anchor:u("");let{patchFlag:Ge,dynamicChildren:at,slotScopeIds:yt}=Be;yt&&(tr=tr?tr.concat(yt):yt),ge==null?(n(or,ft,At),n(Q,ft,At),ve(Be.children||[],ft,Q,bt,$t,Mr,tr,lr)):Ge>0&&Ge&64&&at&&ge.dynamicChildren?(de(ge.dynamicChildren,at,ft,bt,$t,Mr,tr),(Be.key!=null||bt&&Be===bt.subTree)&&qC(ge,Be,!0)):Zt(ge,Be,ft,Q,bt,$t,Mr,tr,lr)},ye=(ge,Be,ft,At,bt,$t,Mr,tr,lr)=>{Be.slotScopeIds=tr,ge==null?Be.shapeFlag&512?bt.ctx.activate(Be,ft,At,Mr,lr):ke(Be,ft,At,bt,$t,Mr,lr):Rt(ge,Be,lr)},ke=(ge,Be,ft,At,bt,$t,Mr)=>{const tr=ge.component=aF(ge,At,bt);if(UC(ge)&&(tr.ctx.renderer=Qt),oF(tr),tr.asyncDep){if(bt&&bt.registerDep(tr,Lt),!ge.el){const lr=tr.subTree=vp(hm);k(null,lr,Be,ft)}}else Lt(tr,ge,Be,ft,bt,$t,Mr)},Rt=(ge,Be,ft)=>{const At=Be.component=ge.component;if(cD(ge,Be,ft))if(At.asyncDep&&!At.asyncResolved){Gt(At,Be,ft);return}else At.next=Be,nD(At.update),At.effect.dirty=!0,At.update();else Be.el=ge.el,At.vnode=Be},Lt=(ge,Be,ft,At,bt,$t,Mr)=>{const tr=()=>{if(ge.isMounted){let{next:Q,bu:Ge,u:at,parent:yt,vnode:rr}=ge;{const qe=KC(ge);if(qe){Q&&(Q.el=rr.el,Gt(ge,Q,Mr)),qe.asyncDep.then(()=>{ge.isUnmounted||tr()});return}}let hr=Q,Cn;n1(ge,!1),Q?(Q.el=rr.el,Gt(ge,Q,Mr)):Q=rr,Ge&&Qy(Ge),(Cn=Q.props&&Q.props.onVnodeBeforeUpdate)&&qc(Cn,yt,Q,rr),n1(ge,!0);const rn=e3(ge),Ne=ge.subTree;ge.subTree=rn,R(Ne,rn,_(Ne.el),pn(Ne),ge,bt,$t),Q.el=rn.el,hr===null&&fD(ge,rn.el),at&&Du(at,bt),(Cn=Q.props&&Q.props.onVnodeUpdated)&&Du(()=>qc(Cn,yt,Q,rr),bt)}else{let Q;const{el:Ge,props:at}=Be,{bm:yt,m:rr,parent:hr}=ge,Cn=gg(Be);if(n1(ge,!1),yt&&Qy(yt),!Cn&&(Q=at&&at.onVnodeBeforeMount)&&qc(Q,hr,Be),n1(ge,!0),Ge&&Ut){const rn=()=>{ge.subTree=e3(ge),Ut(Ge,ge.subTree,ge,bt,null)};Cn?Be.type.__asyncLoader().then(()=>!ge.isUnmounted&&rn()):rn()}else{const rn=ge.subTree=e3(ge);R(null,rn,ft,At,ge,bt,$t),Be.el=rn.el}if(rr&&Du(rr,bt),!Cn&&(Q=at&&at.onVnodeMounted)){const rn=Be;Du(()=>qc(Q,hr,rn),bt)}(Be.shapeFlag&256||hr&&gg(hr.vnode)&&hr.vnode.shapeFlag&256)&&ge.a&&Du(ge.a,bt),ge.isMounted=!0,Be=ft=At=null}},lr=ge.effect=new Wx(tr,Wl,()=>t5(or),ge.scope),or=ge.update=()=>{lr.dirty&&lr.run()};or.id=ge.uid,n1(ge,!0),or()},Gt=(ge,Be,ft)=>{Be.component=ge;const At=ge.vnode.props;ge.vnode=Be,ge.next=null,$D(ge,Be.props,At,ft),HD(ge,Be.children,ft),I1(),m7(ge),M1()},Zt=(ge,Be,ft,At,bt,$t,Mr,tr,lr=!1)=>{const or=ge&&ge.children,Q=ge?ge.shapeFlag:0,Ge=Be.children,{patchFlag:at,shapeFlag:yt}=Be;if(at>0){if(at&128){tt(or,Ge,ft,At,bt,$t,Mr,tr,lr);return}else if(at&256){st(or,Ge,ft,At,bt,$t,Mr,tr,lr);return}}yt&8?(Q&16&&Xn(or,bt,$t),Ge!==or&&m(ft,Ge)):Q&16?yt&16?tt(or,Ge,ft,At,bt,$t,Mr,tr,lr):Xn(or,bt,$t,!0):(Q&8&&m(ft,""),yt&16&&ve(Ge,ft,At,bt,$t,Mr,tr,lr))},st=(ge,Be,ft,At,bt,$t,Mr,tr,lr)=>{ge=ge||Wd,Be=Be||Wd;const or=ge.length,Q=Be.length,Ge=Math.min(or,Q);let at;for(at=0;at<Ge;at++){const yt=Be[at]=lr?op(Be[at]):of(Be[at]);R(ge[at],yt,ft,null,bt,$t,Mr,tr,lr)}or>Q?Xn(ge,bt,$t,!0,!1,Ge):ve(Be,ft,At,bt,$t,Mr,tr,lr,Ge)},tt=(ge,Be,ft,At,bt,$t,Mr,tr,lr)=>{let or=0;const Q=Be.length;let Ge=ge.length-1,at=Q-1;for(;or<=Ge&&or<=at;){const yt=ge[or],rr=Be[or]=lr?op(Be[or]):of(Be[or]);if(sv(yt,rr))R(yt,rr,ft,null,bt,$t,Mr,tr,lr);else break;or++}for(;or<=Ge&&or<=at;){const yt=ge[Ge],rr=Be[at]=lr?op(Be[at]):of(Be[at]);if(sv(yt,rr))R(yt,rr,ft,null,bt,$t,Mr,tr,lr);else break;Ge--,at--}if(or>Ge){if(or<=at){const yt=at+1,rr=yt<Q?Be[yt].el:At;for(;or<=at;)R(null,Be[or]=lr?op(Be[or]):of(Be[or]),ft,rr,bt,$t,Mr,tr,lr),or++}}else if(or>at)for(;or<=Ge;)nt(ge[or],bt,$t,!0),or++;else{const yt=or,rr=or,hr=new Map;for(or=rr;or<=at;or++){const Jn=Be[or]=lr?op(Be[or]):of(Be[or]);Jn.key!=null&&hr.set(Jn.key,or)}let Cn,rn=0;const Ne=at-rr+1;let qe=!1,ct=0;const Vt=new Array(Ne);for(or=0;or<Ne;or++)Vt[or]=0;for(or=yt;or<=Ge;or++){const Jn=ge[or];if(rn>=Ne){nt(Jn,bt,$t,!0);continue}let Ri;if(Jn.key!=null)Ri=hr.get(Jn.key);else for(Cn=rr;Cn<=at;Cn++)if(Vt[Cn-rr]===0&&sv(Jn,Be[Cn])){Ri=Cn;break}Ri===void 0?nt(Jn,bt,$t,!0):(Vt[Ri-rr]=or+1,Ri>=ct?ct=Ri:qe=!0,R(Jn,Be[Ri],ft,null,bt,$t,Mr,tr,lr),rn++)}const Qr=qe?YD(Vt):Wd;for(Cn=Qr.length-1,or=Ne-1;or>=0;or--){const Jn=rr+or,Ri=Be[Jn],qn=Jn+1<Q?Be[Jn+1].el:At;Vt[or]===0?R(null,Ri,ft,qn,bt,$t,Mr,tr,lr):qe&&(Cn<0||or!==Qr[Cn]?dt(Ri,ft,qn,2):Cn--)}}},dt=(ge,Be,ft,At,bt=null)=>{const{el:$t,type:Mr,transition:tr,children:lr,shapeFlag:or}=ge;if(or&6){dt(ge.component.subTree,Be,ft,At);return}if(or&128){ge.suspense.move(Be,ft,At);return}if(or&64){Mr.move(ge,Be,ft,Qt);return}if(Mr===mc){n($t,Be,ft);for(let Ge=0;Ge<lr.length;Ge++)dt(lr[Ge],Be,ft,At);n(ge.anchor,Be,ft);return}if(Mr===i3){B(ge,Be,ft);return}if(At!==2&&or&1&&tr)if(At===0)tr.beforeEnter($t),n($t,Be,ft),Du(()=>tr.enter($t),bt);else{const{leave:Ge,delayLeave:at,afterLeave:yt}=tr,rr=()=>n($t,Be,ft),hr=()=>{Ge($t,()=>{rr(),yt&&yt()})};at?at($t,rr,hr):hr()}else n($t,Be,ft)},nt=(ge,Be,ft,At=!1,bt=!1)=>{const{type:$t,props:Mr,ref:tr,children:lr,dynamicChildren:or,shapeFlag:Q,patchFlag:Ge,dirs:at}=ge;if(tr!=null&&A6(tr,null,ft,ge,!0),Q&256){Be.ctx.deactivate(ge);return}const yt=Q&1&&at,rr=!gg(ge);let hr;if(rr&&(hr=Mr&&Mr.onVnodeBeforeUnmount)&&qc(hr,Be,ge),Q&6)Ar(ge.component,ft,At);else{if(Q&128){ge.suspense.unmount(ft,At);return}yt&&r1(ge,null,Be,"beforeUnmount"),Q&64?ge.type.remove(ge,Be,ft,bt,Qt,At):or&&($t!==mc||Ge>0&&Ge&64)?Xn(or,Be,ft,!1,!0):($t===mc&&Ge&384||!bt&&Q&16)&&Xn(lr,Be,ft),At&&pr(ge)}(rr&&(hr=Mr&&Mr.onVnodeUnmounted)||yt)&&Du(()=>{hr&&qc(hr,Be,ge),yt&&r1(ge,null,Be,"unmounted")},ft)},pr=ge=>{const{type:Be,el:ft,anchor:At,transition:bt}=ge;if(Be===mc){ur(ft,At);return}if(Be===i3){V(ge);return}const $t=()=>{i(ft),bt&&!bt.persisted&&bt.afterLeave&&bt.afterLeave()};if(ge.shapeFlag&1&&bt&&!bt.persisted){const{leave:Mr,delayLeave:tr}=bt,lr=()=>Mr(ft,$t);tr?tr(ge.el,$t,lr):lr()}else $t()},ur=(ge,Be)=>{let ft;for(;ge!==Be;)ft=b(ge),i(ge),ge=ft;i(Be)},Ar=(ge,Be,ft)=>{const{bum:At,scope:bt,update:$t,subTree:Mr,um:tr}=ge;At&&Qy(At),bt.stop(),$t&&($t.active=!1,nt(Mr,ge,Be,ft)),tr&&Du(tr,Be),Du(()=>{ge.isUnmounted=!0},Be),Be&&Be.pendingBranch&&!Be.isUnmounted&&ge.asyncDep&&!ge.asyncResolved&&ge.suspenseId===Be.pendingId&&(Be.deps--,Be.deps===0&&Be.resolve())},Xn=(ge,Be,ft,At=!1,bt=!1,$t=0)=>{for(let Mr=$t;Mr<ge.length;Mr++)nt(ge[Mr],Be,ft,At,bt)},pn=ge=>ge.shapeFlag&6?pn(ge.component.subTree):ge.shapeFlag&128?ge.suspense.next():b(ge.anchor||ge.el);let gi=!1;const Je=(ge,Be,ft)=>{ge==null?Be._vnode&&nt(Be._vnode,null,null,!0):R(Be._vnode||null,ge,Be,null,null,null,ft),gi||(gi=!0,m7(),kC(),gi=!1),Be._vnode=ge},Qt={p:R,um:nt,m:dt,r:pr,mt:ke,mc:ve,pc:Zt,pbc:de,n:pn,o:e};let Xr,Ut;return t&&([Xr,Ut]=t(Qt)),{render:Je,hydrate:Xr,createApp:ND(Je,Xr)}}function n3({type:e,props:t},r){return r==="svg"&&e==="foreignObject"||r==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:r}function n1({effect:e,update:t},r){e.allowRecurse=t.allowRecurse=r}function XD(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function qC(e,t,r=!1){const n=e.children,i=t.children;if(wi(n)&&wi(i))for(let o=0;o<n.length;o++){const a=n[o];let u=i[o];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=i[o]=op(i[o]),u.el=a.el),r||qC(a,u)),u.type===N_&&(u.el=a.el)}}function YD(e){const t=e.slice(),r=[0];let n,i,o,a,u;const c=e.length;for(n=0;n<c;n++){const f=e[n];if(f!==0){if(i=r[r.length-1],e[i]<f){t[n]=i,r.push(n);continue}for(o=0,a=r.length-1;o<a;)u=o+a>>1,e[r[u]]<f?o=u+1:a=u;f<e[r[o]]&&(o>0&&(t[n]=r[o-1]),r[o]=n)}}for(o=r.length,a=r[o-1];o-- >0;)r[o]=a,a=t[a];return r}function KC(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:KC(t)}const ZD=e=>e.__isTeleport,mc=Symbol.for("v-fgt"),N_=Symbol.for("v-txt"),hm=Symbol.for("v-cmt"),i3=Symbol.for("v-stc"),rm=[];let gc=null;function yg(e=!1){rm.push(gc=e?null:[])}function qD(){rm.pop(),gc=rm[rm.length-1]||null}let pm=1;function w7(e){pm+=e}function KD(e){return e.dynamicChildren=pm>0?gc||Wd:null,qD(),pm>0&&gc&&gc.push(e),e}function xg(e,t,r,n,i,o){return KD(eu(e,t,r,n,i,o,!0))}function QD(e){return e?e.__v_isVNode===!0:!1}function sv(e,t){return e.type===t.type&&e.key===t.key}const U_="__vInternal",QC=({key:e})=>e??null,bg=({ref:e,ref_key:t,ref_for:r})=>(typeof e=="number"&&(e=""+e),e!=null?ds(e)||Vu(e)||Bi(e)?{i:ll,r:e,k:t,f:!!r}:e:null);function eu(e,t=null,r=null,n=0,i=null,o=e===mc?0:1,a=!1,u=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&QC(t),ref:t&&bg(t),scopeId:BC,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:n,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:ll};return u?(i5(c,r),o&128&&e.normalize(c)):r&&(c.shapeFlag|=ds(r)?8:16),pm>0&&!a&&gc&&(c.patchFlag>0||o&6)&&c.patchFlag!==32&&gc.push(c),c}const vp=JD;function JD(e,t=null,r=null,n=0,i=null,o=!1){if((!e||e===hD)&&(e=hm),QD(e)){const u=o0(e,t,!0);return r&&i5(u,r),pm>0&&!o&&gc&&(u.shapeFlag&6?gc[gc.indexOf(e)]=u:gc.push(u)),u.patchFlag|=-2,u}if(cF(e)&&(e=e.__vccOpts),t){t=eF(t);let{class:u,style:c}=t;u&&!ds(u)&&(t.class=k_(u)),Ao(c)&&(wC(c)&&!wi(c)&&(c=iu({},c)),t.style=O_(c))}const a=ds(e)?1:pD(e)?128:ZD(e)?64:Ao(e)?4:Bi(e)?2:0;return eu(e,t,r,n,i,a,o,!0)}function eF(e){return e?wC(e)||U_ in e?iu({},e):e:null}function o0(e,t,r=!1){const{props:n,ref:i,patchFlag:o,children:a}=e,u=t?rF(n||{},t):n;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&QC(u),ref:t&&t.ref?r&&i?wi(i)?i.concat(bg(t)):[i,bg(t)]:bg(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==mc?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&o0(e.ssContent),ssFallback:e.ssFallback&&o0(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function tF(e=" ",t=0){return vp(N_,null,e,t)}function of(e){return e==null||typeof e=="boolean"?vp(hm):wi(e)?vp(mc,null,e.slice()):typeof e=="object"?op(e):vp(N_,null,String(e))}function op(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:o0(e)}function i5(e,t){let r=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(wi(t))r=16;else if(typeof t=="object")if(n&65){const i=t.default;i&&(i._c&&(i._d=!1),i5(e,i()),i._c&&(i._d=!0));return}else{r=32;const i=t._;!i&&!(U_ in t)?t._ctx=ll:i===3&&ll&&(ll.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Bi(t)?(t={default:t,_ctx:ll},r=32):(t=String(t),n&64?(r=16,t=[tF(t)]):r=8);e.children=t,e.shapeFlag|=r}function rF(...e){const t={};for(let r=0;r<e.length;r++){const n=e[r];for(const i in n)if(i==="class")t.class!==n.class&&(t.class=k_([t.class,n.class]));else if(i==="style")t.style=O_([t.style,n.style]);else if(I_(i)){const o=t[i],a=n[i];a&&o!==a&&!(wi(o)&&o.includes(a))&&(t[i]=o?[].concat(o,a):a)}else i!==""&&(t[i]=n[i])}return t}function qc(e,t,r,n=null){bc(e,t,7,[r,n])}const nF=HC();let iF=0;function aF(e,t,r){const n=e.type,i=(t?t.appContext:e.appContext)||nF,o={uid:iF++,vnode:e,type:n,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new Ck(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:WC(n,i),emitsOptions:FC(n,i),emit:null,emitted:null,propsDefaults:Ja,inheritAttrs:n.inheritAttrs,ctx:Ja,data:Ja,props:Ja,attrs:Ja,slots:Ja,refs:Ja,setupState:Ja,setupContext:null,attrsProxy:null,slotsProxy:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=oD.bind(null,o),e.ce&&e.ce(o),o}let vu=null,Gg,T6;{const e=fC(),t=(r,n)=>{let i;return(i=e[r])||(i=e[r]=[]),i.push(n),o=>{i.length>1?i.forEach(a=>a(o)):i[0](o)}};Gg=t("__VUE_INSTANCE_SETTERS__",r=>vu=r),T6=t("__VUE_SSR_SETTERS__",r=>z_=r)}const Um=e=>{const t=vu;return Gg(e),e.scope.on(),()=>{e.scope.off(),Gg(t)}},C7=()=>{vu&&vu.scope.off(),Gg(null)};function JC(e){return e.vnode.shapeFlag&4}let z_=!1;function oF(e,t=!1){t&&T6(t);const{props:r,children:n}=e.vnode,i=JC(e);zD(e,r,i,t),jD(e,n);const o=i?sF(e,t):void 0;return t&&T6(!1),o}function sF(e,t){const r=e.type;e.accessCache=Object.create(null),e.proxy=CC(new Proxy(e.ctx,PD));const{setup:n}=r;if(n){const i=e.setupContext=n.length>1?lF(e):null,o=Um(e);I1();const a=dp(n,e,0,[e.props,i]);if(M1(),o(),sC(a)){if(a.then(C7,C7),t)return a.then(u=>{R7(e,u,t)}).catch(u=>{F_(u,e,0)});e.asyncDep=a}else R7(e,a,t)}else eR(e,t)}function R7(e,t,r){Bi(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ao(t)&&(e.setupState=MC(t)),eR(e,r)}let I7;function eR(e,t,r){const n=e.type;if(!e.render){if(!t&&I7&&!n.render){const i=n.template||r5(e).template;if(i){const{isCustomElement:o,compilerOptions:a}=e.appContext.config,{delimiters:u,compilerOptions:c}=n,f=iu(iu({isCustomElement:o,delimiters:u},a),c);n.render=I7(i,f)}}e.render=n.render||Wl}{const i=Um(e);I1();try{OD(e)}finally{M1(),i()}}}function uF(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,r){return $u(e,"get","$attrs"),t[r]}}))}function lF(e){const t=r=>{e.exposed=r||{}};return{get attrs(){return uF(e)},slots:e.slots,emit:e.emit,expose:t}}function $_(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(MC(CC(e.exposed)),{get(t,r){if(r in t)return t[r];if(r in em)return em[r](e)},has(t,r){return r in t||r in em}}))}function cF(e){return Bi(e)&&"__vccOpts"in e}const fF=(e,t)=>qk(e,t,z_),hF="3.4.21";/**
|
|
* @vue/runtime-dom v3.4.21
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/const pF="http://www.w3.org/2000/svg",dF="http://www.w3.org/1998/Math/MathML",sp=typeof document<"u"?document:null,M7=sp&&sp.createElement("template"),vF={insert:(e,t,r)=>{t.insertBefore(e,r||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,r,n)=>{const i=t==="svg"?sp.createElementNS(pF,e):t==="mathml"?sp.createElementNS(dF,e):sp.createElement(e,r?{is:r}:void 0);return e==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:e=>sp.createTextNode(e),createComment:e=>sp.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>sp.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,r,n,i,o){const a=r?r.previousSibling:t.lastChild;if(i&&(i===o||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),r),!(i===o||!(i=i.nextSibling)););else{M7.innerHTML=n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e;const u=M7.content;if(n==="svg"||n==="mathml"){const c=u.firstChild;for(;c.firstChild;)u.appendChild(c.firstChild);u.removeChild(c)}t.insertBefore(u,r)}return[a?a.nextSibling:t.firstChild,r?r.previousSibling:t.lastChild]}},mF=Symbol("_vtc");function gF(e,t,r){const n=e[mF];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):r?e.setAttribute("class",t):e.className=t}const Wg=Symbol("_vod"),tR=Symbol("_vsh"),_F={beforeMount(e,{value:t},{transition:r}){e[Wg]=e.style.display==="none"?"":e.style.display,r&&t?r.beforeEnter(e):uv(e,t)},mounted(e,{value:t},{transition:r}){r&&t&&r.enter(e)},updated(e,{value:t,oldValue:r},{transition:n}){!t!=!r&&(n?t?(n.beforeEnter(e),uv(e,!0),n.enter(e)):n.leave(e,()=>{uv(e,!1)}):uv(e,t))},beforeUnmount(e,{value:t}){uv(e,t)}};function uv(e,t){e.style.display=t?e[Wg]:"none",e[tR]=!t}const yF=Symbol(""),xF=/(^|;)\s*display\s*:/;function bF(e,t,r){const n=e.style,i=ds(r);let o=!1;if(r&&!i){if(t)if(ds(t))for(const a of t.split(";")){const u=a.slice(0,a.indexOf(":")).trim();r[u]==null&&Eg(n,u,"")}else for(const a in t)r[a]==null&&Eg(n,a,"");for(const a in r)a==="display"&&(o=!0),Eg(n,a,r[a])}else if(i){if(t!==r){const a=n[yF];a&&(r+=";"+a),n.cssText=r,o=xF.test(r)}}else t&&e.removeAttribute("style");Wg in e&&(e[Wg]=o?n.display:"",e[tR]&&(n.display="none"))}const P7=/\s*!important$/;function Eg(e,t,r){if(wi(r))r.forEach(n=>Eg(e,t,n));else if(r==null&&(r=""),t.startsWith("--"))e.setProperty(t,r);else{const n=EF(e,t);P7.test(r)?e.setProperty(E0(n),r.replace(P7,""),"important"):e[n]=r}}const O7=["Webkit","Moz","ms"],a3={};function EF(e,t){const r=a3[t];if(r)return r;let n=i0(t);if(n!=="filter"&&n in e)return a3[t]=n;n=cC(n);for(let i=0;i<O7.length;i++){const o=O7[i]+n;if(o in e)return a3[t]=o}return t}const k7="http://www.w3.org/1999/xlink";function SF(e,t,r,n,i){if(n&&t.startsWith("xlink:"))r==null?e.removeAttributeNS(k7,t.slice(6,t.length)):e.setAttributeNS(k7,t,r);else{const o=wk(t);r==null||o&&!hC(r)?e.removeAttribute(t):e.setAttribute(t,o?"":r)}}function AF(e,t,r,n,i,o,a){if(t==="innerHTML"||t==="textContent"){n&&a(n,i,o),e[t]=r??"";return}const u=e.tagName;if(t==="value"&&u!=="PROGRESS"&&!u.includes("-")){const f=u==="OPTION"?e.getAttribute("value")||"":e.value,m=r??"";(f!==m||!("_value"in e))&&(e.value=m),r==null&&e.removeAttribute(t),e._value=r;return}let c=!1;if(r===""||r==null){const f=typeof e[t];f==="boolean"?r=hC(r):r==null&&f==="string"?(r="",c=!0):f==="number"&&(r=0,c=!0)}try{e[t]=r}catch{}c&&e.removeAttribute(t)}function TF(e,t,r,n){e.addEventListener(t,r,n)}function wF(e,t,r,n){e.removeEventListener(t,r,n)}const D7=Symbol("_vei");function CF(e,t,r,n,i=null){const o=e[D7]||(e[D7]={}),a=o[t];if(n&&a)a.value=n;else{const[u,c]=RF(t);if(n){const f=o[t]=PF(n,i);TF(e,u,f,c)}else a&&(wF(e,u,a,c),o[t]=void 0)}}const F7=/(?:Once|Passive|Capture)$/;function RF(e){let t;if(F7.test(e)){t={};let n;for(;n=e.match(F7);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):E0(e.slice(2)),t]}let o3=0;const IF=Promise.resolve(),MF=()=>o3||(IF.then(()=>o3=0),o3=Date.now());function PF(e,t){const r=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=r.attached)return;bc(OF(n,r.value),t,5,[n])};return r.value=e,r.attached=MF(),r}function OF(e,t){if(wi(t)){const r=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{r.call(e),e._stopped=!0},t.map(n=>i=>!i._stopped&&n&&n(i))}else return t}const B7=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,kF=(e,t,r,n,i,o,a,u,c)=>{const f=i==="svg";t==="class"?gF(e,n,f):t==="style"?bF(e,r,n):I_(t)?jx(t)||CF(e,t,r,n,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):DF(e,t,n,f))?AF(e,t,n,o,a,u,c):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),SF(e,t,n,f))};function DF(e,t,r,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&B7(t)&&Bi(r));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return B7(t)&&ds(r)?!1:t in e}const FF=iu({patchProp:kF},vF);let L7;function BF(){return L7||(L7=GD(FF))}const LF=(...e)=>{const t=BF().createApp(...e),{mount:r}=t;return t.mount=n=>{const i=UF(n);if(!i)return;const o=t._component;!Bi(o)&&!o.render&&!o.template&&(o.template=i.innerHTML),i.innerHTML="";const a=r(i,!1,NF(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),a},t};function NF(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function UF(e){return ds(e)?document.querySelector(e):e}function rR(e,t){return function(){return e.apply(t,arguments)}}const{toString:zF}=Object.prototype,{getPrototypeOf:a5}=Object,V_=(e=>t=>{const r=zF.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),gf=e=>(e=e.toLowerCase(),t=>V_(t)===e),j_=e=>t=>typeof t===e,{isArray:S0}=Array,dm=j_("undefined");function $F(e){return e!==null&&!dm(e)&&e.constructor!==null&&!dm(e.constructor)&&Yl(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const nR=gf("ArrayBuffer");function VF(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&nR(e.buffer),t}const jF=j_("string"),Yl=j_("function"),iR=j_("number"),H_=e=>e!==null&&typeof e=="object",HF=e=>e===!0||e===!1,Sg=e=>{if(V_(e)!=="object")return!1;const t=a5(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},GF=gf("Date"),WF=gf("File"),XF=gf("Blob"),YF=gf("FileList"),ZF=e=>H_(e)&&Yl(e.pipe),qF=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Yl(e.append)&&((t=V_(e))==="formdata"||t==="object"&&Yl(e.toString)&&e.toString()==="[object FormData]"))},KF=gf("URLSearchParams"),QF=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function zm(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),S0(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let u;for(n=0;n<a;n++)u=o[n],t.call(null,e[u],u,e)}}function aR(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}const oR=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,sR=e=>!dm(e)&&e!==oR;function w6(){const{caseless:e}=sR(this)&&this||{},t={},r=(n,i)=>{const o=e&&aR(t,i)||i;Sg(t[o])&&Sg(n)?t[o]=w6(t[o],n):Sg(n)?t[o]=w6({},n):S0(n)?t[o]=n.slice():t[o]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&zm(arguments[n],r);return t}const JF=(e,t,r,{allOwnKeys:n}={})=>(zm(t,(i,o)=>{r&&Yl(i)?e[o]=rR(i,r):e[o]=i},{allOwnKeys:n}),e),eB=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),tB=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},rB=(e,t,r,n)=>{let i,o,a;const u={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],(!n||n(a,e,t))&&!u[a]&&(t[a]=e[a],u[a]=!0);e=r!==!1&&a5(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},nB=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},iB=e=>{if(!e)return null;if(S0(e))return e;let t=e.length;if(!iR(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},aB=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&a5(Uint8Array)),oB=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=n.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},sB=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},uB=gf("HTMLFormElement"),lB=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),N7=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),cB=gf("RegExp"),uR=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};zm(r,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(n[o]=a||i)}),Object.defineProperties(e,n)},fB=e=>{uR(e,(t,r)=>{if(Yl(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(Yl(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},hB=(e,t)=>{const r={},n=i=>{i.forEach(o=>{r[o]=!0})};return S0(e)?n(e):n(String(e).split(t)),r},pB=()=>{},dB=(e,t)=>(e=+e,Number.isFinite(e)?e:t),s3="abcdefghijklmnopqrstuvwxyz",U7="0123456789",lR={DIGIT:U7,ALPHA:s3,ALPHA_DIGIT:s3+s3.toUpperCase()+U7},vB=(e=16,t=lR.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function mB(e){return!!(e&&Yl(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const gB=e=>{const t=new Array(10),r=(n,i)=>{if(H_(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const o=S0(n)?[]:{};return zm(n,(a,u)=>{const c=r(a,i+1);!dm(c)&&(o[u]=c)}),t[i]=void 0,o}}return n};return r(e,0)},_B=gf("AsyncFunction"),yB=e=>e&&(H_(e)||Yl(e))&&Yl(e.then)&&Yl(e.catch),br={isArray:S0,isArrayBuffer:nR,isBuffer:$F,isFormData:qF,isArrayBufferView:VF,isString:jF,isNumber:iR,isBoolean:HF,isObject:H_,isPlainObject:Sg,isUndefined:dm,isDate:GF,isFile:WF,isBlob:XF,isRegExp:cB,isFunction:Yl,isStream:ZF,isURLSearchParams:KF,isTypedArray:aB,isFileList:YF,forEach:zm,merge:w6,extend:JF,trim:QF,stripBOM:eB,inherits:tB,toFlatObject:rB,kindOf:V_,kindOfTest:gf,endsWith:nB,toArray:iB,forEachEntry:oB,matchAll:sB,isHTMLForm:uB,hasOwnProperty:N7,hasOwnProp:N7,reduceDescriptors:uR,freezeMethods:fB,toObjectSet:hB,toCamelCase:lB,noop:pB,toFiniteNumber:dB,findKey:aR,global:oR,isContextDefined:sR,ALPHABET:lR,generateString:vB,isSpecCompliantForm:mB,toJSONObject:gB,isAsyncFn:_B,isThenable:yB};function ea(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}br.inherits(ea,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:br.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const cR=ea.prototype,fR={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{fR[e]={value:e}});Object.defineProperties(ea,fR);Object.defineProperty(cR,"isAxiosError",{value:!0});ea.from=(e,t,r,n,i,o)=>{const a=Object.create(cR);return br.toFlatObject(e,a,function(c){return c!==Error.prototype},u=>u!=="isAxiosError"),ea.call(a,e.message,t,r,n,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const xB=null;function C6(e){return br.isPlainObject(e)||br.isArray(e)}function hR(e){return br.endsWith(e,"[]")?e.slice(0,-2):e}function z7(e,t,r){return e?e.concat(t).map(function(i,o){return i=hR(i),!r&&o?"["+i+"]":i}).join(r?".":""):t}function bB(e){return br.isArray(e)&&!e.some(C6)}const EB=br.toFlatObject(br,{},null,function(t){return/^is[A-Z]/.test(t)});function G_(e,t,r){if(!br.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=br.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(R,P){return!br.isUndefined(P[R])});const n=r.metaTokens,i=r.visitor||m,o=r.dots,a=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&br.isSpecCompliantForm(t);if(!br.isFunction(i))throw new TypeError("visitor must be a function");function f(w){if(w===null)return"";if(br.isDate(w))return w.toISOString();if(!c&&br.isBlob(w))throw new ea("Blob is not supported. Use a Buffer instead.");return br.isArrayBuffer(w)||br.isTypedArray(w)?c&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function m(w,R,P){let k=w;if(w&&!P&&typeof w=="object"){if(br.endsWith(R,"{}"))R=n?R:R.slice(0,-2),w=JSON.stringify(w);else if(br.isArray(w)&&bB(w)||(br.isFileList(w)||br.endsWith(R,"[]"))&&(k=br.toArray(w)))return R=hR(R),k.forEach(function(B,V){!(br.isUndefined(B)||B===null)&&t.append(a===!0?z7([R],V,o):a===null?R:R+"[]",f(B))}),!1}return C6(w)?!0:(t.append(z7(P,R,o),f(w)),!1)}const _=[],b=Object.assign(EB,{defaultVisitor:m,convertValue:f,isVisitable:C6});function A(w,R){if(!br.isUndefined(w)){if(_.indexOf(w)!==-1)throw Error("Circular reference detected in "+R.join("."));_.push(w),br.forEach(w,function(k,L){(!(br.isUndefined(k)||k===null)&&i.call(t,k,br.isString(L)?L.trim():L,R,b))===!0&&A(k,R?R.concat(L):[L])}),_.pop()}}if(!br.isObject(e))throw new TypeError("data must be an object");return A(e),t}function $7(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function o5(e,t){this._pairs=[],e&&G_(e,this,t)}const pR=o5.prototype;pR.append=function(t,r){this._pairs.push([t,r])};pR.toString=function(t){const r=t?function(n){return t.call(this,n,$7)}:$7;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function SB(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function dR(e,t,r){if(!t)return e;const n=r&&r.encode||SB,i=r&&r.serialize;let o;if(i?o=i(t,r):o=br.isURLSearchParams(t)?t.toString():new o5(t,r).toString(n),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class V7{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){br.forEach(this.handlers,function(n){n!==null&&t(n)})}}const vR={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},AB=typeof URLSearchParams<"u"?URLSearchParams:o5,TB=typeof FormData<"u"?FormData:null,wB=typeof Blob<"u"?Blob:null,CB={isBrowser:!0,classes:{URLSearchParams:AB,FormData:TB,Blob:wB},protocols:["http","https","file","blob","url","data"]},mR=typeof window<"u"&&typeof document<"u",RB=(e=>mR&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),IB=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",MB=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:mR,hasStandardBrowserEnv:RB,hasStandardBrowserWebWorkerEnv:IB},Symbol.toStringTag,{value:"Module"})),cf={...MB,...CB};function PB(e,t){return G_(e,new cf.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,o){return cf.isNode&&br.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function OB(e){return br.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function kB(e){const t={},r=Object.keys(e);let n;const i=r.length;let o;for(n=0;n<i;n++)o=r[n],t[o]=e[o];return t}function gR(e){function t(r,n,i,o){let a=r[o++];if(a==="__proto__")return!0;const u=Number.isFinite(+a),c=o>=r.length;return a=!a&&br.isArray(i)?i.length:a,c?(br.hasOwnProp(i,a)?i[a]=[i[a],n]:i[a]=n,!u):((!i[a]||!br.isObject(i[a]))&&(i[a]=[]),t(r,n,i[a],o)&&br.isArray(i[a])&&(i[a]=kB(i[a])),!u)}if(br.isFormData(e)&&br.isFunction(e.entries)){const r={};return br.forEachEntry(e,(n,i)=>{t(OB(n),i,r,0)}),r}return null}function DB(e,t,r){if(br.isString(e))try{return(t||JSON.parse)(e),br.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const s5={transitional:vR,adapter:["xhr","http"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,o=br.isObject(t);if(o&&br.isHTMLForm(t)&&(t=new FormData(t)),br.isFormData(t))return i?JSON.stringify(gR(t)):t;if(br.isArrayBuffer(t)||br.isBuffer(t)||br.isStream(t)||br.isFile(t)||br.isBlob(t))return t;if(br.isArrayBufferView(t))return t.buffer;if(br.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return PB(t,this.formSerializer).toString();if((u=br.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return G_(u?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||i?(r.setContentType("application/json",!1),DB(t)):t}],transformResponse:[function(t){const r=this.transitional||s5.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(t&&br.isString(t)&&(n&&!this.responseType||i)){const a=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(u){if(a)throw u.name==="SyntaxError"?ea.from(u,ea.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:cf.classes.FormData,Blob:cf.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};br.forEach(["delete","get","head","post","put","patch"],e=>{s5.headers[e]={}});const u5=s5,FB=br.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),BB=e=>{const t={};let r,n,i;return e&&e.split(`
|
|
`).forEach(function(a){i=a.indexOf(":"),r=a.substring(0,i).trim().toLowerCase(),n=a.substring(i+1).trim(),!(!r||t[r]&&FB[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},j7=Symbol("internals");function lv(e){return e&&String(e).trim().toLowerCase()}function Ag(e){return e===!1||e==null?e:br.isArray(e)?e.map(Ag):String(e)}function LB(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const NB=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function u3(e,t,r,n,i){if(br.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!br.isString(t)){if(br.isString(n))return t.indexOf(n)!==-1;if(br.isRegExp(n))return n.test(t)}}function UB(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function zB(e,t){const r=br.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,o,a){return this[n].call(this,t,i,o,a)},configurable:!0})})}class W_{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function o(u,c,f){const m=lv(c);if(!m)throw new Error("header name must be a non-empty string");const _=br.findKey(i,m);(!_||i[_]===void 0||f===!0||f===void 0&&i[_]!==!1)&&(i[_||c]=Ag(u))}const a=(u,c)=>br.forEach(u,(f,m)=>o(f,m,c));return br.isPlainObject(t)||t instanceof this.constructor?a(t,r):br.isString(t)&&(t=t.trim())&&!NB(t)?a(BB(t),r):t!=null&&o(r,t,n),this}get(t,r){if(t=lv(t),t){const n=br.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return LB(i);if(br.isFunction(r))return r.call(this,i,n);if(br.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=lv(t),t){const n=br.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||u3(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function o(a){if(a=lv(a),a){const u=br.findKey(n,a);u&&(!r||u3(n,n[u],u,r))&&(delete n[u],i=!0)}}return br.isArray(t)?t.forEach(o):o(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const o=r[n];(!t||u3(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const r=this,n={};return br.forEach(this,(i,o)=>{const a=br.findKey(n,o);if(a){r[a]=Ag(i),delete r[o];return}const u=t?UB(o):String(o).trim();u!==o&&delete r[o],r[u]=Ag(i),n[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return br.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&br.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[j7]=this[j7]={accessors:{}}).accessors,i=this.prototype;function o(a){const u=lv(a);n[u]||(zB(i,a),n[u]=!0)}return br.isArray(t)?t.forEach(o):o(t),this}}W_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);br.reduceDescriptors(W_.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});br.freezeMethods(W_);const nh=W_;function l3(e,t){const r=this||u5,n=t||r,i=nh.from(n.headers);let o=n.data;return br.forEach(e,function(u){o=u.call(r,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function _R(e){return!!(e&&e.__CANCEL__)}function $m(e,t,r){ea.call(this,e??"canceled",ea.ERR_CANCELED,t,r),this.name="CanceledError"}br.inherits($m,ea,{__CANCEL__:!0});function $B(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new ea("Request failed with status code "+r.status,[ea.ERR_BAD_REQUEST,ea.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const VB=cf.hasStandardBrowserEnv?{write(e,t,r,n,i,o){const a=[e+"="+encodeURIComponent(t)];br.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),br.isString(n)&&a.push("path="+n),br.isString(i)&&a.push("domain="+i),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function jB(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function HB(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function yR(e,t){return e&&!jB(t)?HB(e,t):t}const GB=cf.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function i(o){let a=o;return t&&(r.setAttribute("href",a),a=r.href),r.setAttribute("href",a),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(a){const u=br.isString(a)?i(a):a;return u.protocol===n.protocol&&u.host===n.host}}():function(){return function(){return!0}}();function WB(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function XB(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(c){const f=Date.now(),m=n[o];a||(a=f),r[i]=c,n[i]=f;let _=o,b=0;for(;_!==i;)b+=r[_++],_=_%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),f-a<t)return;const A=m&&f-m;return A?Math.round(b*1e3/A):void 0}}function H7(e,t){let r=0;const n=XB(50,250);return i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,u=o-r,c=n(u),f=o<=a;r=o;const m={loaded:o,total:a,progress:a?o/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a&&f?(a-o)/c:void 0,event:i};m[t?"download":"upload"]=!0,e(m)}}const YB=typeof XMLHttpRequest<"u",ZB=YB&&function(e){return new Promise(function(r,n){let i=e.data;const o=nh.from(e.headers).normalize();let{responseType:a,withXSRFToken:u}=e,c;function f(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}let m;if(br.isFormData(i)){if(cf.hasStandardBrowserEnv||cf.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if((m=o.getContentType())!==!1){const[R,...P]=m?m.split(";").map(k=>k.trim()).filter(Boolean):[];o.setContentType([R||"multipart/form-data",...P].join("; "))}}let _=new XMLHttpRequest;if(e.auth){const R=e.auth.username||"",P=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(R+":"+P))}const b=yR(e.baseURL,e.url);_.open(e.method.toUpperCase(),dR(b,e.params,e.paramsSerializer),!0),_.timeout=e.timeout;function A(){if(!_)return;const R=nh.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),k={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:R,config:e,request:_};$B(function(B){r(B),f()},function(B){n(B),f()},k),_=null}if("onloadend"in _?_.onloadend=A:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(A)},_.onabort=function(){_&&(n(new ea("Request aborted",ea.ECONNABORTED,e,_)),_=null)},_.onerror=function(){n(new ea("Network Error",ea.ERR_NETWORK,e,_)),_=null},_.ontimeout=function(){let P=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const k=e.transitional||vR;e.timeoutErrorMessage&&(P=e.timeoutErrorMessage),n(new ea(P,k.clarifyTimeoutError?ea.ETIMEDOUT:ea.ECONNABORTED,e,_)),_=null},cf.hasStandardBrowserEnv&&(u&&br.isFunction(u)&&(u=u(e)),u||u!==!1&&GB(b))){const R=e.xsrfHeaderName&&e.xsrfCookieName&&VB.read(e.xsrfCookieName);R&&o.set(e.xsrfHeaderName,R)}i===void 0&&o.setContentType(null),"setRequestHeader"in _&&br.forEach(o.toJSON(),function(P,k){_.setRequestHeader(k,P)}),br.isUndefined(e.withCredentials)||(_.withCredentials=!!e.withCredentials),a&&a!=="json"&&(_.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&_.addEventListener("progress",H7(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&_.upload&&_.upload.addEventListener("progress",H7(e.onUploadProgress)),(e.cancelToken||e.signal)&&(c=R=>{_&&(n(!R||R.type?new $m(null,e,_):R),_.abort(),_=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));const w=WB(b);if(w&&cf.protocols.indexOf(w)===-1){n(new ea("Unsupported protocol "+w+":",ea.ERR_BAD_REQUEST,e));return}_.send(i||null)})},R6={http:xB,xhr:ZB};br.forEach(R6,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const G7=e=>`- ${e}`,qB=e=>br.isFunction(e)||e===null||e===!1,xR={getAdapter:e=>{e=br.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let o=0;o<t;o++){r=e[o];let a;if(n=r,!qB(r)&&(n=R6[(a=String(r)).toLowerCase()],n===void 0))throw new ea(`Unknown adapter '${a}'`);if(n)break;i[a||"#"+o]=n}if(!n){const o=Object.entries(i).map(([u,c])=>`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since :
|
|
`+o.map(G7).join(`
|
|
`):" "+G7(o[0]):"as no adapter specified";throw new ea("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:R6};function c3(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $m(null,e)}function W7(e){return c3(e),e.headers=nh.from(e.headers),e.data=l3.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),xR.getAdapter(e.adapter||u5.adapter)(e).then(function(n){return c3(e),n.data=l3.call(e,e.transformResponse,n),n.headers=nh.from(n.headers),n},function(n){return _R(n)||(c3(e),n&&n.response&&(n.response.data=l3.call(e,e.transformResponse,n.response),n.response.headers=nh.from(n.response.headers))),Promise.reject(n)})}const X7=e=>e instanceof nh?e.toJSON():e;function s0(e,t){t=t||{};const r={};function n(f,m,_){return br.isPlainObject(f)&&br.isPlainObject(m)?br.merge.call({caseless:_},f,m):br.isPlainObject(m)?br.merge({},m):br.isArray(m)?m.slice():m}function i(f,m,_){if(br.isUndefined(m)){if(!br.isUndefined(f))return n(void 0,f,_)}else return n(f,m,_)}function o(f,m){if(!br.isUndefined(m))return n(void 0,m)}function a(f,m){if(br.isUndefined(m)){if(!br.isUndefined(f))return n(void 0,f)}else return n(void 0,m)}function u(f,m,_){if(_ in t)return n(f,m);if(_ in e)return n(void 0,f)}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u,headers:(f,m)=>i(X7(f),X7(m),!0)};return br.forEach(Object.keys(Object.assign({},e,t)),function(m){const _=c[m]||i,b=_(e[m],t[m],m);br.isUndefined(b)&&_!==u||(r[m]=b)}),r}const bR="1.6.7",l5={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{l5[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Y7={};l5.transitional=function(t,r,n){function i(o,a){return"[Axios v"+bR+"] Transitional option '"+o+"'"+a+(n?". "+n:"")}return(o,a,u)=>{if(t===!1)throw new ea(i(a," has been removed"+(r?" in "+r:"")),ea.ERR_DEPRECATED);return r&&!Y7[a]&&(Y7[a]=!0,console.warn(i(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,a,u):!0}};function KB(e,t,r){if(typeof e!="object")throw new ea("options must be an object",ea.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],a=t[o];if(a){const u=e[o],c=u===void 0||a(u,o,e);if(c!==!0)throw new ea("option "+o+" must be "+c,ea.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new ea("Unknown option "+o,ea.ERR_BAD_OPTION)}}const I6={assertOptions:KB,validators:l5},Gh=I6.validators;class Xg{constructor(t){this.defaults=t,this.interceptors={request:new V7,response:new V7}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
`+o):n.stack=o}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=s0(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:o}=r;n!==void 0&&I6.assertOptions(n,{silentJSONParsing:Gh.transitional(Gh.boolean),forcedJSONParsing:Gh.transitional(Gh.boolean),clarifyTimeoutError:Gh.transitional(Gh.boolean)},!1),i!=null&&(br.isFunction(i)?r.paramsSerializer={serialize:i}:I6.assertOptions(i,{encode:Gh.function,serialize:Gh.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=o&&br.merge(o.common,o[r.method]);o&&br.forEach(["delete","get","head","post","put","patch","common"],w=>{delete o[w]}),r.headers=nh.concat(a,o);const u=[];let c=!0;this.interceptors.request.forEach(function(R){typeof R.runWhen=="function"&&R.runWhen(r)===!1||(c=c&&R.synchronous,u.unshift(R.fulfilled,R.rejected))});const f=[];this.interceptors.response.forEach(function(R){f.push(R.fulfilled,R.rejected)});let m,_=0,b;if(!c){const w=[W7.bind(this),void 0];for(w.unshift.apply(w,u),w.push.apply(w,f),b=w.length,m=Promise.resolve(r);_<b;)m=m.then(w[_++],w[_++]);return m}b=u.length;let A=r;for(_=0;_<b;){const w=u[_++],R=u[_++];try{A=w(A)}catch(P){R.call(this,P);break}}try{m=W7.call(this,A)}catch(w){return Promise.reject(w)}for(_=0,b=f.length;_<b;)m=m.then(f[_++],f[_++]);return m}getUri(t){t=s0(this.defaults,t);const r=yR(t.baseURL,t.url);return dR(r,t.params,t.paramsSerializer)}}br.forEach(["delete","get","head","options"],function(t){Xg.prototype[t]=function(r,n){return this.request(s0(n||{},{method:t,url:r,data:(n||{}).data}))}});br.forEach(["post","put","patch"],function(t){function r(n){return function(o,a,u){return this.request(s0(u||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}Xg.prototype[t]=r(),Xg.prototype[t+"Form"]=r(!0)});const Tg=Xg;class c5{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(i=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](i);n._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(u=>{n.subscribe(u),o=u}).then(i);return a.cancel=function(){n.unsubscribe(o)},a},t(function(o,a,u){n.reason||(n.reason=new $m(o,a,u),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new c5(function(i){t=i}),cancel:t}}}const QB=c5;function JB(e){return function(r){return e.apply(null,r)}}function eL(e){return br.isObject(e)&&e.isAxiosError===!0}const M6={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(M6).forEach(([e,t])=>{M6[t]=e});const tL=M6;function ER(e){const t=new Tg(e),r=rR(Tg.prototype.request,t);return br.extend(r,Tg.prototype,t,{allOwnKeys:!0}),br.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return ER(s0(e,i))},r}const rs=ER(u5);rs.Axios=Tg;rs.CanceledError=$m;rs.CancelToken=QB;rs.isCancel=_R;rs.VERSION=bR;rs.toFormData=G_;rs.AxiosError=ea;rs.Cancel=rs.CanceledError;rs.all=function(t){return Promise.all(t)};rs.spread=JB;rs.isAxiosError=eL;rs.mergeConfig=s0;rs.AxiosHeaders=nh;rs.formToJSON=e=>gR(br.isHTMLForm(e)?new FormData(e):e);rs.getAdapter=xR.getAdapter;rs.HttpStatusCode=tL;rs.default=rs;const Z7=rs,rL="FeatureCollection",nL="320581",iL={type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},aL=[{type:"Feature",properties:{id:"7331",name:"董浜镇",site:"www.poi86.com"},geometry:{type:"MultiPolygon",coordinates:[[[[120.936453,31.627662],[120.935708,31.627646],[120.934992,31.627093],[120.933876,31.626764],[120.933546,31.626409],[120.933236,31.626368],[120.93221,31.626698],[120.930804,31.626695],[120.930108,31.626829],[120.92976,31.626688],[120.929553,31.625363],[120.929235,31.624836],[120.928767,31.624372],[120.927352,31.623938],[120.92671,31.623824],[120.926161,31.624176],[120.925843,31.624713],[120.925464,31.624758],[120.925212,31.624689],[120.924803,31.624434],[120.924347,31.624008],[120.924372,31.623821],[120.925794,31.623119],[120.926761,31.622797],[120.928305,31.622681],[120.930747,31.622331],[120.931304,31.622038],[120.932349,31.621697],[120.933738,31.620565],[120.933953,31.620321],[120.93263,31.62023],[120.932259,31.619618],[120.931867,31.619618],[120.931137,31.618695],[120.93035,31.619202],[120.929594,31.619412],[120.927636,31.619894],[120.927364,31.6195],[120.926536,31.61983],[120.92446,31.620422],[120.923367,31.619321],[120.922383,31.619758],[120.92184,31.620156],[120.921414,31.620345],[120.920155,31.620281],[120.91923,31.620374],[120.918907,31.620112],[120.916451,31.621266],[120.916579,31.621513],[120.91487,31.622403],[120.913658,31.621801],[120.913108,31.621807],[120.912298,31.621339],[120.911908,31.621347],[120.910336,31.622188],[120.909875,31.622627],[120.909517,31.622494],[120.907267,31.621784],[120.906502,31.621391],[120.905627,31.620719],[120.902353,31.618701],[120.899064,31.616984],[120.898503,31.616848],[120.897461,31.617739],[120.897525,31.617895],[120.899938,31.620161],[120.898731,31.620881],[120.897972,31.621128],[120.897515,31.621422],[120.8968,31.621691],[120.895373,31.621911],[120.894938,31.622119],[120.894166,31.62206],[120.891783,31.622227],[120.889491,31.622515],[120.889068,31.622639],[120.886286,31.622669],[120.886058,31.622741],[120.885411,31.622552],[120.884966,31.622867],[120.884493,31.623414],[120.883892,31.623768],[120.882907,31.624669],[120.882664,31.624983],[120.881316,31.62552],[120.880817,31.625997],[120.88039,31.62613],[120.879157,31.626203],[120.878593,31.626449],[120.877623,31.62631],[120.877089,31.626395],[120.877384,31.627712],[120.878126,31.629646],[120.878138,31.630233],[120.87823,31.630625],[120.878581,31.631124],[120.878963,31.632257],[120.881232,31.632144],[120.882834,31.631926],[120.883992,31.631657],[120.88427,31.632284],[120.883,31.63252],[120.883122,31.632843],[120.883092,31.63301],[120.882715,31.633012],[120.882529,31.632696],[120.880845,31.632923],[120.881204,31.634396],[120.881506,31.634292],[120.882506,31.634166],[120.883489,31.633696],[120.884018,31.633561],[120.885044,31.636324],[120.88625,31.63609],[120.886634,31.636707],[120.887511,31.638614],[120.887729,31.639564],[120.887803,31.64037],[120.888931,31.639852],[120.889225,31.64037],[120.89163,31.639169],[120.891748,31.638773],[120.891931,31.638618],[120.89242,31.638458],[120.892891,31.639251],[120.893147,31.63925],[120.893564,31.639118],[120.893964,31.638852],[120.894829,31.640645],[120.895915,31.641697],[120.896109,31.642106],[120.896626,31.642504],[120.896309,31.642582],[120.895722,31.643058],[120.895479,31.643352],[120.894963,31.643603],[120.894509,31.643945],[120.895465,31.644673],[120.896232,31.645575],[120.894191,31.646916],[120.894653,31.647332],[120.895224,31.647037],[120.895432,31.647126],[120.895992,31.646746],[120.89616,31.646811],[120.896946,31.646257],[120.89745,31.646607],[120.89803,31.646406],[120.899141,31.647625],[120.900809,31.646497],[120.903489,31.649041],[120.90901,31.653979],[120.909956,31.653455],[120.910575,31.654316],[120.910596,31.654745],[120.910869,31.654981],[120.911226,31.655179],[120.912694,31.655476],[120.913994,31.656303],[120.911881,31.658498],[120.91327,31.659244],[120.91401,31.659976],[120.914933,31.660682],[120.915706,31.661403],[120.916604,31.661754],[120.916826,31.662039],[120.916817,31.663342],[120.917041,31.663559],[120.918443,31.663985],[120.918852,31.663868],[120.919413,31.663917],[120.920094,31.66431],[120.920489,31.664418],[120.921422,31.664375],[120.921657,31.664485],[120.92185,31.664855],[120.921656,31.665147],[120.921563,31.665452],[120.921652,31.665662],[120.92209,31.665892],[120.922428,31.666247],[120.922548,31.666529],[120.922538,31.666744],[120.922818,31.667142],[120.923261,31.667565],[120.92393,31.667961],[120.924721,31.668248],[120.925821,31.669043],[120.926178,31.669208],[120.92633,31.669841],[120.926782,31.670271],[120.927511,31.670702],[120.929001,31.671387],[120.928794,31.671423],[120.928387,31.671726],[120.927337,31.67264],[120.927047,31.673683],[120.926652,31.674423],[120.926206,31.674176],[120.92461,31.675459],[120.923931,31.675116],[120.92274,31.676244],[120.922447,31.676168],[120.921806,31.675697],[120.92168,31.675716],[120.919864,31.67701],[120.919117,31.676342],[120.915672,31.677978],[120.916344,31.678166],[120.917099,31.679177],[120.916288,31.679838],[120.916073,31.679636],[120.915247,31.6803],[120.913682,31.682047],[120.91317,31.682348],[120.91328,31.682884],[120.91293,31.683005],[120.911069,31.684106],[120.910725,31.684928],[120.910921,31.686079],[120.91111,31.686611],[120.911182,31.686646],[120.911522,31.686751],[120.913247,31.688944],[120.913334,31.689121],[120.913007,31.690028],[120.913168,31.690259],[120.913316,31.690303],[120.913691,31.690212],[120.913988,31.690231],[120.914316,31.690798],[120.914297,31.691428],[120.914564,31.691497],[120.915317,31.691217],[120.915847,31.690742],[120.916041,31.690886],[120.916119,31.691109],[120.916073,31.691402],[120.916302,31.691789],[120.917355,31.691631],[120.918617,31.691549],[120.919062,31.693237],[120.919447,31.693985],[120.919922,31.69382],[120.919504,31.693455],[120.919975,31.693035],[120.920048,31.69303],[120.920418,31.693772],[120.921091,31.693523],[120.920777,31.693065],[120.922033,31.692755],[120.92203,31.692437],[120.922266,31.692389],[120.922395,31.691795],[120.922842,31.691608],[120.922973,31.692205],[120.923311,31.692099],[120.923514,31.692261],[120.924092,31.692205],[120.924689,31.692466],[120.925229,31.691991],[120.929212,31.689186],[120.929556,31.689427],[120.930078,31.690653],[120.93042,31.691234],[120.930846,31.69163],[120.931064,31.69197],[120.929892,31.692727],[120.931738,31.695282],[120.932596,31.696793],[120.930474,31.697912],[120.9304,31.697951],[120.931072,31.69853],[120.931295,31.69897],[120.93207,31.699346],[120.932063,31.699632],[120.932265,31.699691],[120.932883,31.699577],[120.933436,31.699597],[120.9339,31.699713],[120.934483,31.699985],[120.93458,31.700142],[120.934522,31.70039],[120.933852,31.701205],[120.934041,31.701384],[120.93515,31.701137],[120.937463,31.701398],[120.938582,31.701809],[120.939304,31.700833],[120.940126,31.701017],[120.94064,31.701047],[120.942296,31.70145],[120.943183,31.701939],[120.943382,31.702282],[120.943805,31.702504],[120.943965,31.702573],[120.943766,31.702909],[120.942908,31.705016],[120.942125,31.706275],[120.943635,31.708177],[120.943188,31.708587],[120.944531,31.70945],[120.945757,31.708062],[120.94588,31.707555],[120.946983,31.70631],[120.947434,31.706964],[120.9477,31.706473],[120.94918,31.708175],[120.948311,31.70885],[120.949852,31.710594],[120.949086,31.711039],[120.950949,31.713106],[120.951359,31.713332],[120.95156,31.713316],[120.951888,31.713118],[120.952018,31.712711],[120.95232,31.712284],[120.952339,31.711945],[120.952533,31.711811],[120.953039,31.711687],[120.954496,31.711691],[120.956078,31.710986],[120.957102,31.710431],[120.958684,31.710147],[120.960252,31.710111],[120.961927,31.708958],[120.963629,31.708059],[120.965545,31.707541],[120.965813,31.707574],[120.966297,31.707223],[120.965013,31.706347],[120.964401,31.70563],[120.963505,31.704879],[120.963249,31.704542],[120.962407,31.703757],[120.961718,31.703262],[120.959978,31.701705],[120.961304,31.700755],[120.96189,31.700755],[120.962899,31.699932],[120.963076,31.700028],[120.963803,31.700885],[120.964269,31.700363],[120.965052,31.701277],[120.965115,31.701582],[120.96554,31.701264],[120.966222,31.700975],[120.966604,31.700623],[120.966656,31.700448],[120.966112,31.699927],[120.965808,31.69949],[120.967961,31.698171],[120.968209,31.697824],[120.968173,31.697669],[120.966894,31.695912],[120.966319,31.695358],[120.964862,31.693694],[120.96716,31.692009],[120.969215,31.690698],[120.96953,31.691099],[120.969177,31.691334],[120.970722,31.693305],[120.972685,31.691958],[120.97393,31.693547],[120.978448,31.691293],[120.980553,31.694289],[120.980754,31.694306],[120.980853,31.694044],[120.980902,31.693852],[120.981061,31.693707],[120.981731,31.693454],[120.981986,31.693111],[120.982302,31.692907],[120.983144,31.692618],[120.983344,31.69254],[120.983777,31.692176],[120.984965,31.69162],[120.985189,31.691678],[120.985346,31.691631],[120.985499,31.691482],[120.985505,31.691207],[120.985312,31.690778],[120.98548,31.690593],[120.985744,31.690514],[120.986373,31.689814],[120.987049,31.68952],[120.987573,31.689656],[120.987825,31.689571],[120.987996,31.689376],[120.988328,31.689214],[120.988609,31.688948],[120.989463,31.688465],[120.98955,31.688332],[120.989092,31.687911],[120.989458,31.687401],[120.989711,31.687216],[120.990377,31.687337],[120.990631,31.687503],[120.990895,31.687517],[120.99156,31.686919],[120.991592,31.686749],[120.991421,31.686349],[120.99158,31.686171],[120.991878,31.686082],[120.992159,31.686091],[120.992446,31.685827],[120.992634,31.685759],[120.99325,31.685961],[120.99349,31.685973],[120.993614,31.685826],[120.993592,31.685528],[120.993952,31.685353],[120.993969,31.685193],[120.993457,31.685038],[120.993392,31.684891],[120.993571,31.684523],[120.994028,31.684474],[120.994492,31.68429],[120.994967,31.68434],[120.995124,31.684274],[120.995205,31.684144],[120.995317,31.683742],[120.99593,31.683608],[120.99618,31.68344],[120.996503,31.683655],[120.996843,31.683574],[120.997025,31.683314],[120.997223,31.683197],[120.997145,31.682716],[120.997422,31.682409],[120.997554,31.682325],[120.99796,31.682319],[120.998153,31.682228],[120.998411,31.68186],[120.998861,31.681816],[120.999246,31.682225],[120.999594,31.682392],[120.999947,31.682378],[121.000018,31.682281],[120.999802,31.681709],[120.999869,31.681545],[121.000636,31.68118],[121.001276,31.681248],[121.001855,31.680947],[121.001784,31.68072],[121.001528,31.680629],[121.001463,31.680503],[121.001573,31.680131],[121.001679,31.680055],[121.002262,31.680416],[121.00336,31.680243],[121.003483,31.680321],[121.003688,31.680771],[121.003853,31.680724],[121.003912,31.680436],[121.004173,31.680121],[121.004963,31.679673],[121.005599,31.679185],[121.006051,31.679736],[121.006709,31.679849],[121.006758,31.679603],[121.006704,31.6792],[121.007168,31.679188],[121.007457,31.679093],[121.007649,31.678829],[121.007798,31.67875],[121.008344,31.678821],[121.008511,31.67853],[121.008448,31.678178],[121.008499,31.678077],[121.008945,31.677736],[121.009164,31.677645],[121.01003,31.677757],[121.01033,31.677698],[121.011428,31.677066],[121.011591,31.676928],[121.011665,31.676677],[121.011542,31.676462],[121.011354,31.676345],[121.011293,31.676187],[121.011827,31.675891],[121.011367,31.674597],[121.010925,31.672489],[121.010249,31.670272],[121.009708,31.669611],[121.009199,31.669237],[121.00638,31.667833],[121.005403,31.66782],[121.004078,31.668066],[121.003432,31.668107],[121.002267,31.667765],[121.000023,31.666589],[120.998541,31.665551],[120.99583,31.664185],[120.994885,31.663494],[120.994121,31.66249],[120.993883,31.66179],[120.99346,31.660666],[120.993113,31.659476],[120.992433,31.657883],[120.992094,31.657414],[120.991678,31.657047],[120.990741,31.655832],[120.990618,31.65538],[120.990376,31.653293],[120.989636,31.65234],[120.988957,31.651215],[120.988639,31.651033],[120.987563,31.650418],[120.986046,31.649809],[120.984693,31.649266],[120.982951,31.648837],[120.981699,31.648362],[120.980763,31.648441],[120.979125,31.648379],[120.97797,31.64809],[120.977172,31.647687],[120.974936,31.645722],[120.973553,31.644731],[120.972677,31.643983],[120.971442,31.642679],[120.971286,31.642357],[120.970979,31.641724],[120.970655,31.640778],[120.970481,31.639929],[120.968818,31.635474],[120.968869,31.635073],[120.969311,31.63464],[120.970191,31.633402],[120.970307,31.63279],[120.968418,31.633883],[120.968138,31.634045],[120.964576,31.637066],[120.96415,31.637918],[120.962485,31.636944],[120.9611,31.636018],[120.960621,31.635698],[120.956944,31.634027],[120.955554,31.633312],[120.953594,31.632572],[120.95285,31.631834],[120.952323,31.631513],[120.951987,31.631439],[120.951042,31.630645],[120.949965,31.630041],[120.949458,31.630675],[120.945974,31.629174],[120.943869,31.628378],[120.942144,31.627637],[120.939468,31.630524],[120.938253,31.629474],[120.937528,31.628993],[120.937218,31.628917],[120.937,31.628052],[120.936789,31.627781],[120.936453,31.627662]]]]}},{type:"Feature",properties:{id:"7332",name:"虞山镇",site:"www.poi86.com"},geometry:{type:"MultiPolygon",coordinates:[[[[120.671057,31.682624],[120.669268,31.681368],[120.660979,31.674664],[120.658852,31.672197],[120.658661,31.672287],[120.656721,31.670281],[120.656219,31.6705],[120.655499,31.670813],[120.649381,31.670972],[120.643654,31.669992],[120.641103,31.669787],[120.636759,31.673433],[120.63479,31.675085],[120.634972,31.675669],[120.635871,31.67854],[120.635675,31.679399],[120.63617,31.680191],[120.635349,31.680583],[120.636142,31.681311],[120.636496,31.681273],[120.636533,31.681469],[120.637326,31.681441],[120.637778,31.682092],[120.636725,31.682646],[120.637159,31.683251],[120.637783,31.683185],[120.637849,31.683838],[120.640189,31.683082],[120.640451,31.683474],[120.641933,31.682952],[120.64314,31.685302],[120.643183,31.685386],[120.641598,31.686701],[120.642717,31.689434],[120.639891,31.694531],[120.642456,31.694932],[120.642624,31.695361],[120.642484,31.697395],[120.640973,31.70023],[120.639789,31.700393],[120.639266,31.702296],[120.638511,31.703349],[120.638511,31.704441],[120.63824,31.705327],[120.639695,31.705196],[120.639891,31.707099],[120.641701,31.706679],[120.641664,31.708256],[120.640647,31.708489],[120.640574,31.708802],[120.640479,31.709207],[120.639891,31.709244],[120.639957,31.710424],[120.635582,31.711749],[120.635909,31.714472],[120.633773,31.714808],[120.633736,31.714276],[120.632225,31.714602],[120.632458,31.716123],[120.631927,31.716151],[120.631758,31.717102],[120.633568,31.716813],[120.634035,31.717009],[120.634128,31.718492],[120.634622,31.719737],[120.634958,31.719839],[120.634958,31.720362],[120.634193,31.720334],[120.635009,31.721279],[120.635352,31.721109],[120.635418,31.721464],[120.636075,31.721332],[120.636272,31.721924],[120.637916,31.721924],[120.638218,31.722481],[120.638731,31.722384],[120.639493,31.723633],[120.639624,31.72433],[120.640769,31.725539],[120.641925,31.72617],[120.642412,31.726696],[120.643332,31.726985],[120.644581,31.727024],[120.645041,31.726788],[120.645436,31.727222],[120.650234,31.726919],[120.651373,31.727366],[120.652574,31.728076],[120.653429,31.728234],[120.654875,31.72947],[120.654967,31.730482],[120.65619,31.731402],[120.656873,31.731534],[120.65803,31.732362],[120.658056,31.733111],[120.660216,31.73444],[120.660883,31.735083],[120.662197,31.735385],[120.663618,31.734689],[120.664603,31.734597],[120.66651,31.735083],[120.66789,31.733085],[120.667985,31.733201],[120.672846,31.739119],[120.674226,31.742274],[120.674463,31.742971],[120.674358,31.744509],[120.675084,31.744841],[120.675228,31.744907],[120.675739,31.74514],[120.678565,31.745824],[120.679419,31.748716],[120.680932,31.748584],[120.681128,31.749768],[120.681497,31.750333],[120.682154,31.750136],[120.682443,31.75099],[120.683403,31.751411],[120.683863,31.753028],[120.688162,31.751805],[120.690874,31.750741],[120.691008,31.750688],[120.691317,31.75145],[120.691607,31.751411],[120.691712,31.75174],[120.692076,31.751763],[120.692274,31.752709],[120.691962,31.752864],[120.6921,31.753422],[120.694466,31.753422],[120.694844,31.753268],[120.694985,31.753334],[120.695041,31.753547],[120.695002,31.753784],[120.69533,31.754047],[120.696185,31.754172],[120.69629,31.754441],[120.696891,31.754523],[120.697131,31.754415],[120.698669,31.754859],[120.700165,31.756338],[120.70147,31.757629],[120.705391,31.757994],[120.706291,31.758164],[120.707122,31.757719],[120.711244,31.757065],[120.711462,31.757319],[120.712919,31.757012],[120.725371,31.755064],[120.733233,31.753457],[120.733615,31.753279],[120.733899,31.753233],[120.734287,31.753171],[120.735017,31.753053],[120.735611,31.752794],[120.736145,31.753145],[120.745619,31.753846],[120.746447,31.753463],[120.748739,31.753176],[120.749635,31.753024],[120.749833,31.752933],[120.749895,31.752897],[120.751341,31.752028],[120.752189,31.751963],[120.753738,31.753082],[120.755053,31.753773],[120.755612,31.754687],[120.756172,31.75492],[120.758578,31.753866],[120.760481,31.753969],[120.761171,31.752812],[120.763279,31.751833],[120.763643,31.752784],[120.764231,31.753642],[120.76535,31.75311],[120.766208,31.752915],[120.766403,31.753435],[120.767087,31.753231],[120.767028,31.75311],[120.767756,31.752812],[120.768278,31.752877],[120.768387,31.752471],[120.768419,31.752355],[120.767794,31.751833],[120.767952,31.751497],[120.76756,31.750578],[120.769006,31.750046],[120.768278,31.749291],[120.765909,31.750513],[120.765686,31.750345],[120.765452,31.749422],[120.765583,31.749095],[120.765126,31.747715],[120.764632,31.747416],[120.76493,31.746987],[120.764865,31.746763],[120.764468,31.746642],[120.763876,31.746204],[120.763309,31.746594],[120.762425,31.745756],[120.763605,31.745243],[120.764463,31.744618],[120.765687,31.745393],[120.766586,31.745326],[120.767021,31.744755],[120.76664,31.741782],[120.767143,31.740475],[120.768815,31.740564],[120.770056,31.739818],[120.771529,31.738611],[120.772663,31.73736],[120.776013,31.735342],[120.776265,31.735088],[120.776291,31.734617],[120.776052,31.733219],[120.775345,31.73194],[120.775101,31.731041],[120.77507,31.730288],[120.774631,31.729368],[120.774554,31.728445],[120.774601,31.728064],[120.774259,31.727141],[120.774002,31.726703],[120.773055,31.723943],[120.77266,31.721866],[120.772471,31.72098],[120.771466,31.719548],[120.771288,31.71874],[120.771228,31.717941],[120.770143,31.716023],[120.770006,31.715383],[120.768807,31.712007],[120.76851,31.711471],[120.766797,31.706753],[120.764667,31.701551],[120.770372,31.699678],[120.771524,31.7026],[120.775482,31.701253],[120.776316,31.703103],[120.777969,31.70251],[120.777341,31.700168],[120.779378,31.699483],[120.779929,31.698816],[120.780329,31.698017],[120.783261,31.696189],[120.785428,31.697696],[120.787313,31.697087],[120.789436,31.696639],[120.792395,31.695659],[120.793271,31.695229],[120.794578,31.695143],[120.797732,31.694575],[120.799019,31.694492],[120.800867,31.694228],[120.801532,31.694046],[120.804441,31.693686],[120.804707,31.693419],[120.805443,31.691687],[120.805228,31.690243],[120.80485,31.688937],[120.804292,31.687614],[120.804008,31.686534],[120.803475,31.685058],[120.802971,31.683031],[120.802713,31.682422],[120.802419,31.678892],[120.79767,31.676745],[120.789742,31.673162],[120.789057,31.672382],[120.789266,31.671601],[120.793463,31.663131],[120.794542,31.661081],[120.792715,31.66019],[120.793092,31.659505],[120.793697,31.659825],[120.794445,31.658658],[120.793693,31.658344],[120.794273,31.65704],[120.796558,31.657563],[120.797328,31.656107],[120.797679,31.65395],[120.798332,31.650805],[120.79828,31.649052],[120.797779,31.647229],[120.795881,31.639842],[120.796462,31.639586],[120.79805,31.639163],[120.799317,31.638946],[120.801156,31.638455],[120.804034,31.637404],[120.80259,31.634163],[120.801972,31.634425],[120.801662,31.633664],[120.79926,31.63276],[120.798649,31.631053],[120.796758,31.625522],[120.795728,31.622577],[120.795149,31.620569],[120.795108,31.618806],[120.790483,31.618977],[120.78817,31.618806],[120.787085,31.618447],[120.784454,31.615271],[120.783403,31.613565],[120.782657,31.612682],[120.781162,31.610475],[120.780096,31.609699],[120.778755,31.609211],[120.772165,31.608723],[120.769252,31.608638],[120.767874,31.608221],[120.766944,31.607758],[120.765561,31.60768],[120.764241,31.608274],[120.762938,31.609215],[120.76176,31.610585],[120.758998,31.613904],[120.755789,31.61658],[120.754067,31.616432],[120.752125,31.616632],[120.749099,31.616232],[120.747785,31.616665],[120.739151,31.614473],[120.737278,31.612508],[120.738877,31.610955],[120.736547,31.60762],[120.737461,31.606341],[120.736273,31.604833],[120.734016,31.604389],[120.733349,31.602046],[120.73376,31.599762],[120.733577,31.59798],[120.733742,31.594544],[120.733819,31.590737],[120.733602,31.590207],[120.731991,31.586245],[120.73024,31.584341],[120.727983,31.579319],[120.726553,31.578254],[120.723984,31.577719],[120.721101,31.578547],[120.721338,31.576997],[120.72206,31.571913],[120.723145,31.569401],[120.724668,31.568815],[120.731772,31.568441],[120.735937,31.565917],[120.738679,31.563918],[120.740791,31.562776],[120.740631,31.561062],[120.741256,31.560475],[120.740239,31.558535],[120.738757,31.558964],[120.73787,31.557845],[120.736583,31.557975],[120.734558,31.557651],[120.733999,31.552094],[120.730586,31.551936],[120.730026,31.55105],[120.729467,31.550854],[120.725225,31.551414],[120.725355,31.553707],[120.725187,31.554369],[120.723677,31.5545],[120.723351,31.555554],[120.723509,31.557064],[120.722167,31.557465],[120.722101,31.558873],[120.71894,31.558845],[120.711444,31.559759],[120.709859,31.560747],[120.709141,31.560813],[120.708274,31.558669],[120.706219,31.555471],[120.704964,31.553773],[120.690782,31.556393],[120.687229,31.557316],[120.687528,31.558668],[120.68792,31.559917],[120.68792,31.562249],[120.685617,31.56209],[120.685486,31.562808],[120.684796,31.562808],[120.684498,31.56334],[120.682623,31.563274],[120.682703,31.562057],[120.677575,31.562114],[120.67763,31.561069],[120.668232,31.559894],[120.668111,31.560948],[120.666134,31.561042],[120.666134,31.562198],[120.662628,31.562499],[120.662348,31.562524],[120.662469,31.563854],[120.663137,31.571055],[120.663332,31.573072],[120.663263,31.577747],[120.663057,31.58139],[120.664251,31.585364],[120.666459,31.587268],[120.670064,31.591039],[120.679461,31.600788],[120.682305,31.603716],[120.686988,31.608085],[120.688503,31.609855],[120.689404,31.610907],[120.689871,31.611454],[120.695601,31.616258],[120.697295,31.617593],[120.698466,31.618621],[120.701041,31.619287],[120.705909,31.619947],[120.709892,31.620477],[120.712866,31.621167],[120.716867,31.621628],[120.719493,31.621922],[120.721959,31.623521],[120.724381,31.625394],[120.725523,31.626079],[120.726528,31.626216],[120.730959,31.619957],[120.733975,31.615526],[120.734278,31.615206],[120.738532,31.615697],[120.7407,31.616103],[120.74758,31.617281],[120.746552,31.619902],[120.74693,31.620503],[120.748081,31.620933],[120.748304,31.621345],[120.749043,31.62174],[120.749888,31.62165],[120.748974,31.622136],[120.748574,31.622878],[120.74826,31.623678],[120.749625,31.623747],[120.749812,31.628036],[120.747148,31.628105],[120.746878,31.629983],[120.746685,31.6329],[120.746318,31.634761],[120.745956,31.636133],[120.742577,31.635856],[120.741711,31.635666],[120.741444,31.635532],[120.741188,31.635113],[120.740675,31.634938],[120.73958,31.6347],[120.738018,31.634533],[120.734155,31.634177],[120.733334,31.634191],[120.731704,31.631821],[120.730871,31.631012],[120.729831,31.62936],[120.726326,31.626967],[120.725861,31.627033],[120.724391,31.628794],[120.725547,31.62968],[120.727907,31.633501],[120.73031,31.635811],[120.729456,31.636775],[120.726734,31.634605],[120.726391,31.634681],[120.725614,31.635207],[120.724937,31.635397],[120.723795,31.636113],[120.72295,31.63641],[120.722196,31.63571],[120.723528,31.634895],[120.722196,31.633859],[120.722568,31.633477],[120.723991,31.634271],[120.724152,31.634091],[120.724365,31.634147],[120.724923,31.633623],[120.724624,31.633363],[120.724727,31.633167],[120.724521,31.632961],[120.724923,31.63257],[120.723766,31.631647],[120.723934,31.631386],[120.722918,31.630565],[120.71932,31.634383],[120.719263,31.634444],[120.723012,31.637442],[120.725178,31.63992],[120.725286,31.640043],[120.726927,31.640798],[120.727981,31.641488],[120.730023,31.643558],[120.728753,31.644543],[120.728547,31.645353],[120.728634,31.646188],[120.728885,31.646667],[120.72745,31.647307],[120.728057,31.648221],[120.729878,31.647629],[120.730118,31.648632],[120.732204,31.648238],[120.734714,31.648255],[120.73627,31.649327],[120.736818,31.649449],[120.736349,31.651025],[120.735481,31.653192],[120.734896,31.65443],[120.734415,31.655907],[120.733698,31.655586],[120.732345,31.653945],[120.730634,31.654325],[120.729584,31.656959],[120.72937,31.657766],[120.729393,31.658827],[120.729446,31.66002],[120.730299,31.65999],[120.731472,31.659655],[120.73202,31.659655],[120.732535,31.659434],[120.733982,31.659952],[120.736571,31.660165],[120.736277,31.661579],[120.734961,31.66184],[120.734304,31.662768],[120.732816,31.662661],[120.732061,31.663948],[120.731818,31.66414],[120.727707,31.667387],[120.728739,31.667533],[120.728592,31.667912],[120.730517,31.668341],[120.73042,31.668952],[120.732086,31.669579],[120.731633,31.670588],[120.730375,31.670169],[120.7301,31.670805],[120.728553,31.670247],[120.727972,31.671528],[120.726372,31.670957],[120.727001,31.669615],[120.726316,31.669392],[120.726506,31.668935],[120.726035,31.668782],[120.723971,31.6705],[120.724651,31.670951],[120.724377,31.671654],[120.724736,31.671786],[120.724662,31.671968],[120.723467,31.671604],[120.722599,31.672515],[120.722201,31.672362],[120.719867,31.674735],[120.718604,31.676127],[120.71924,31.676617],[120.720284,31.677259],[120.72202,31.678043],[120.722514,31.677167],[120.724672,31.678129],[120.723958,31.679414],[120.724485,31.680837],[120.724628,31.681482],[120.7246,31.682406],[120.723835,31.683954],[120.723073,31.684091],[120.719992,31.684644],[120.719824,31.682704],[120.718742,31.680764],[120.71795,31.68178],[120.718163,31.684796],[120.716575,31.684733],[120.717134,31.686087],[120.715592,31.686607],[120.714719,31.684522],[120.716638,31.684568],[120.71664,31.684267],[120.716067,31.682951],[120.716797,31.682827],[120.716668,31.682277],[120.715551,31.682478],[120.715049,31.681417],[120.716924,31.680726],[120.71618,31.67942],[120.716167,31.679137],[120.716009,31.67906],[120.715927,31.678862],[120.714432,31.679921],[120.708728,31.683431],[120.707722,31.68423],[120.705233,31.684644],[120.700029,31.686612],[120.699547,31.686894],[120.696811,31.688496],[120.691019,31.690725],[120.685869,31.68969],[120.68477,31.69089],[120.674734,31.685036],[120.674859,31.685007],[120.674238,31.684855],[120.671057,31.682624]]]]}},{type:"Feature",properties:{id:"27522",name:"古里镇",site:"www.poi86.com"},geometry:{type:"MultiPolygon",coordinates:[[[[120.917705,31.574047],[120.917759,31.572637],[120.915652,31.572768],[120.915988,31.571854],[120.917834,31.571985],[120.917759,31.570866],[120.916323,31.570922],[120.916174,31.569672],[120.915056,31.569617],[120.914738,31.568945],[120.915205,31.568815],[120.917834,31.568945],[120.917703,31.567696],[120.915465,31.56764],[120.915465,31.566913],[120.914664,31.566987],[120.914664,31.56639],[120.91526,31.566391],[120.915652,31.565794],[120.915521,31.565402],[120.914738,31.565607],[120.914141,31.565607],[120.914272,31.56337],[120.914869,31.562512],[120.914663,31.561654],[120.915204,31.561132],[120.917833,31.561001],[120.91789,31.559882],[120.917498,31.559677],[120.917759,31.55882],[120.918301,31.558583],[120.917773,31.558007],[120.915963,31.556647],[120.915265,31.556576],[120.914743,31.555935],[120.913908,31.553913],[120.913284,31.553476],[120.912924,31.552971],[120.914032,31.551553],[120.915041,31.550598],[120.915513,31.549865],[120.915661,31.549635],[120.914752,31.549318],[120.912904,31.549342],[120.912236,31.54925],[120.911661,31.548339],[120.909564,31.54998],[120.908332,31.548707],[120.907776,31.548388],[120.905685,31.546873],[120.905219,31.54678],[120.90432,31.546129],[120.903457,31.545273],[120.902591,31.544159],[120.901587,31.543122],[120.900026,31.540332],[120.897395,31.542269],[120.895766,31.543201],[120.894357,31.544006],[120.893212,31.543213],[120.893226,31.542958],[120.894016,31.54122],[120.893863,31.540246],[120.892117,31.541085],[120.891117,31.541148],[120.88886,31.541864],[120.887313,31.541864],[120.888014,31.543069],[120.888396,31.543453],[120.888423,31.543572],[120.886987,31.544315],[120.88678,31.544051],[120.885898,31.544702],[120.885336,31.544059],[120.883679,31.544932],[120.883107,31.544616],[120.882789,31.545071],[120.882542,31.546032],[120.88252,31.546786],[120.881531,31.546749],[120.881348,31.547756],[120.881164,31.548285],[120.880735,31.550073],[120.880652,31.550713],[120.880382,31.551654],[120.88014,31.553003],[120.879725,31.554728],[120.879454,31.554944],[120.87946,31.55567],[120.879796,31.556851],[120.880356,31.557815],[120.880493,31.55838],[120.881165,31.559714],[120.881597,31.559964],[120.88289,31.560485],[120.885573,31.56196],[120.885765,31.562293],[120.88583,31.562607],[120.886237,31.563244],[120.886388,31.563858],[120.885542,31.564097],[120.880704,31.564365],[120.87933,31.564518],[120.878339,31.564697],[120.877676,31.565113],[120.876415,31.565505],[120.876313,31.564657],[120.874476,31.565505],[120.874335,31.566233],[120.873944,31.566494],[120.873169,31.566696],[120.872409,31.567071],[120.870198,31.567699],[120.869791,31.567912],[120.869475,31.569034],[120.869631,31.569609],[120.869808,31.57174],[120.869805,31.572747],[120.869413,31.57457],[120.869158,31.576312],[120.868814,31.576338],[120.867283,31.576195],[120.865889,31.575817],[120.862056,31.574168],[120.861576,31.574165],[120.861175,31.57466],[120.860159,31.57452],[120.85973,31.576105],[120.859273,31.576339],[120.859207,31.5766],[120.858909,31.576861],[120.858517,31.576823],[120.858583,31.577784],[120.858247,31.578045],[120.856566,31.57784],[120.856715,31.578477],[120.856998,31.579695],[120.857607,31.584317],[120.858211,31.58707],[120.859352,31.590757],[120.86087,31.593945],[120.862254,31.596475],[120.863428,31.598013],[120.861301,31.599554],[120.861447,31.600852],[120.859258,31.602966],[120.858858,31.603064],[120.855951,31.604668],[120.852709,31.606293],[120.850851,31.607348],[120.848874,31.608545],[120.845877,31.611129],[120.845107,31.612254],[120.847793,31.614218],[120.84735,31.615406],[120.84653,31.616553],[120.845506,31.617443],[120.84503,31.617705],[120.843684,31.616356],[120.840253,31.618296],[120.828452,31.624728],[120.826323,31.625829],[120.824822,31.626253],[120.824604,31.626314],[120.81165,31.626997],[120.808769,31.627552],[120.803847,31.629194],[120.80097,31.630286],[120.798649,31.631053],[120.79926,31.63276],[120.801662,31.633664],[120.801972,31.634425],[120.80259,31.634163],[120.804034,31.637404],[120.801156,31.638455],[120.799317,31.638946],[120.79805,31.639163],[120.796462,31.639586],[120.795881,31.639842],[120.797779,31.647229],[120.79828,31.649052],[120.798332,31.650805],[120.797679,31.65395],[120.797328,31.656107],[120.796558,31.657563],[120.794273,31.65704],[120.793693,31.658344],[120.794445,31.658658],[120.793697,31.659825],[120.793092,31.659505],[120.792715,31.66019],[120.794542,31.661081],[120.793463,31.663131],[120.789266,31.671601],[120.789057,31.672382],[120.789742,31.673162],[120.79767,31.676745],[120.802419,31.678892],[120.81417,31.684146],[120.817533,31.685515],[120.821832,31.687266],[120.83029,31.690898],[120.838828,31.694459],[120.839171,31.693304],[120.839607,31.69273],[120.839964,31.691888],[120.840262,31.691423],[120.840133,31.691025],[120.840078,31.69053],[120.839757,31.689821],[120.839221,31.689168],[120.839336,31.687907],[120.839683,31.68728],[120.83953,31.687012],[120.839162,31.686756],[120.83967,31.685869],[120.840797,31.686411],[120.842756,31.684405],[120.842224,31.684032],[120.842031,31.683678],[120.843428,31.682118],[120.844987,31.683152],[120.845393,31.682343],[120.845691,31.681964],[120.847242,31.678832],[120.850096,31.679658],[120.850369,31.679623],[120.850716,31.679688],[120.851449,31.679931],[120.853308,31.680017],[120.852741,31.677808],[120.852329,31.676727],[120.852101,31.675498],[120.851683,31.674389],[120.8514,31.672716],[120.850966,31.671673],[120.850939,31.671177],[120.8525,31.671019],[120.852474,31.670031],[120.852619,31.669992],[120.852646,31.669887],[120.852981,31.669842],[120.85305,31.669526],[120.854154,31.669462],[120.854041,31.668684],[120.856301,31.668039],[120.855698,31.665624],[120.857503,31.665302],[120.857644,31.666026],[120.857689,31.667286],[120.858035,31.667345],[120.858651,31.668133],[120.858819,31.668805],[120.859109,31.669406],[120.86486,31.669284],[120.865859,31.669327],[120.866972,31.669191],[120.867834,31.669235],[120.868296,31.669089],[120.868709,31.668865],[120.870344,31.668567],[120.870121,31.667984],[120.869805,31.667509],[120.869338,31.666567],[120.869192,31.665914],[120.868882,31.66553],[120.868518,31.66485],[120.867116,31.659844],[120.866476,31.658183],[120.866195,31.656806],[120.865725,31.655406],[120.865704,31.654986],[120.865444,31.654577],[120.865272,31.654087],[120.86493,31.652734],[120.865807,31.652734],[120.867717,31.652457],[120.868423,31.652233],[120.868655,31.651965],[120.869463,31.65169],[120.870615,31.651507],[120.871434,31.653254],[120.871935,31.653266],[120.874136,31.652874],[120.875186,31.652671],[120.873771,31.650789],[120.872374,31.649305],[120.871259,31.647614],[120.86965,31.646131],[120.870966,31.645559],[120.87193,31.645953],[120.872434,31.64563],[120.873044,31.646408],[120.874465,31.645683],[120.875055,31.646681],[120.878342,31.645666],[120.879089,31.647307],[120.880007,31.648828],[120.881084,31.648281],[120.882845,31.647577],[120.883698,31.646869],[120.884693,31.646428],[120.885154,31.646354],[120.885793,31.646063],[120.887058,31.645324],[120.887814,31.645056],[120.888524,31.644655],[120.889489,31.643975],[120.888975,31.642743],[120.888083,31.641065],[120.887803,31.64037],[120.887729,31.639564],[120.887511,31.638614],[120.886634,31.636707],[120.88625,31.63609],[120.885044,31.636324],[120.884018,31.633561],[120.883489,31.633696],[120.882506,31.634166],[120.881506,31.634292],[120.881204,31.634396],[120.880845,31.632923],[120.882529,31.632696],[120.882715,31.633012],[120.883092,31.63301],[120.883122,31.632843],[120.883,31.63252],[120.88427,31.632284],[120.883992,31.631657],[120.882834,31.631926],[120.881232,31.632144],[120.878963,31.632257],[120.878581,31.631124],[120.87823,31.630625],[120.878138,31.630233],[120.878126,31.629646],[120.877384,31.627712],[120.877089,31.626395],[120.877623,31.62631],[120.878593,31.626449],[120.879157,31.626203],[120.88039,31.62613],[120.880817,31.625997],[120.881316,31.62552],[120.882664,31.624983],[120.882907,31.624669],[120.883892,31.623768],[120.884493,31.623414],[120.884966,31.622867],[120.885411,31.622552],[120.886058,31.622741],[120.886286,31.622669],[120.889068,31.622639],[120.889491,31.622515],[120.891783,31.622227],[120.894166,31.62206],[120.894938,31.622119],[120.895373,31.621911],[120.8968,31.621691],[120.897515,31.621422],[120.897972,31.621128],[120.898731,31.620881],[120.899938,31.620161],[120.897525,31.617895],[120.897461,31.617739],[120.898503,31.616848],[120.899064,31.616984],[120.902353,31.618701],[120.905627,31.620719],[120.906502,31.621391],[120.907267,31.621784],[120.909517,31.622494],[120.909875,31.622627],[120.910336,31.622188],[120.911908,31.621347],[120.912298,31.621339],[120.913108,31.621807],[120.913658,31.621801],[120.91487,31.622403],[120.916579,31.621513],[120.916451,31.621266],[120.918907,31.620112],[120.91923,31.620374],[120.920155,31.620281],[120.921414,31.620345],[120.92184,31.620156],[120.922383,31.619758],[120.923367,31.619321],[120.92446,31.620422],[120.926536,31.61983],[120.927364,31.6195],[120.927636,31.619894],[120.929594,31.619412],[120.93035,31.619202],[120.931137,31.618695],[120.931867,31.619618],[120.932259,31.619618],[120.93263,31.62023],[120.933953,31.620321],[120.935634,31.620302],[120.935764,31.618847],[120.933187,31.618472],[120.932714,31.618308],[120.930238,31.616813],[120.92814,31.61595],[120.925655,31.614805],[120.927166,31.613422],[120.928623,31.612219],[120.930868,31.610621],[120.93121,31.610144],[120.931874,31.6098],[120.932278,31.609377],[120.932332,31.609102],[120.932489,31.609026],[120.932954,31.609012],[120.933223,31.608778],[120.933725,31.60809],[120.932704,31.607855],[120.931414,31.607202],[120.930368,31.606526],[120.928706,31.605159],[120.928267,31.604662],[120.926811,31.602486],[120.924383,31.599503],[120.924042,31.598708],[120.929384,31.598628],[120.932152,31.598596],[120.93207,31.596702],[120.931518,31.596786],[120.931346,31.596685],[120.930504,31.596681],[120.928135,31.596364],[120.92749,31.596126],[120.926614,31.59596],[120.926191,31.595753],[120.925266,31.593854],[120.924864,31.592712],[120.925797,31.592638],[120.925983,31.593421],[120.926067,31.593492],[120.929186,31.592651],[120.92963,31.592406],[120.929676,31.591877],[120.930439,31.592077],[120.932092,31.592015],[120.93255,31.593047],[120.934499,31.592936],[120.935093,31.593163],[120.936844,31.592143],[120.938291,31.593104],[120.938935,31.592278],[120.939019,31.592171],[120.931317,31.584358],[120.931578,31.583761],[120.927913,31.584814],[120.92749,31.584731],[120.926875,31.584159],[120.926635,31.583461],[120.926366,31.583037],[120.925956,31.582836],[120.925269,31.582087],[120.924863,31.58175],[120.924789,31.581277],[120.924857,31.581125],[120.92465,31.580551],[120.924677,31.580109],[120.924805,31.57971],[120.924669,31.578644],[120.924675,31.577384],[120.924624,31.57733],[120.923619,31.577419],[120.923102,31.577358],[120.919014,31.577398],[120.918904,31.577167],[120.918894,31.576779],[120.919427,31.574752],[120.919468,31.574141],[120.919341,31.574137],[120.917705,31.574047]]]]}},{type:"Feature",properties:{id:"27523",name:"支塘镇",site:"www.poi86.com"},geometry:{type:"MultiPolygon",coordinates:[[[[120.988587,31.507535],[120.984157,31.502868],[120.98421,31.501354],[120.984,31.501418],[120.980004,31.498344],[120.978522,31.497633],[120.975804,31.49604],[120.974935,31.497324],[120.974573,31.497126],[120.974403,31.497491],[120.974037,31.497418],[120.97215,31.497041],[120.970853,31.498094],[120.970814,31.498535],[120.969998,31.498272],[120.9698,31.498706],[120.969287,31.498272],[120.968154,31.497719],[120.96718,31.497482],[120.966428,31.497549],[120.965995,31.498522],[120.964731,31.49997],[120.964251,31.500872],[120.963678,31.502255],[120.962361,31.503775],[120.960018,31.503999],[120.960149,31.503341],[120.958318,31.503037],[120.957121,31.502748],[120.957121,31.502222],[120.956002,31.50209],[120.956331,31.501037],[120.956042,31.500971],[120.956107,31.500615],[120.955515,31.500418],[120.955212,31.502064],[120.954027,31.501932],[120.953896,31.502419],[120.951328,31.501866],[120.951131,31.502788],[120.953211,31.503538],[120.953342,31.505816],[120.951526,31.505777],[120.951065,31.507659],[120.951657,31.507423],[120.951368,31.509173],[120.950446,31.509397],[120.9488,31.514743],[120.944459,31.513874],[120.942402,31.521023],[120.940664,31.520299],[120.941414,31.518982],[120.940427,31.518522],[120.940624,31.518061],[120.940071,31.517797],[120.938583,31.520957],[120.937043,31.51993],[120.93595,31.524144],[120.934608,31.523722],[120.933883,31.524973],[120.936345,31.525197],[120.935397,31.528133],[120.935792,31.531293],[120.933751,31.531227],[120.933619,31.533196],[120.933605,31.533412],[120.930355,31.531911],[120.926049,31.529147],[120.923403,31.526777],[120.918663,31.525394],[120.914423,31.523116],[120.91333,31.521576],[120.908854,31.525421],[120.909684,31.525881],[120.907381,31.531849],[120.896357,31.52793],[120.895043,31.527462],[120.892173,31.530648],[120.893068,31.531701],[120.894214,31.533281],[120.89711,31.536243],[120.899415,31.539648],[120.900026,31.540332],[120.901587,31.543122],[120.902591,31.544159],[120.903457,31.545273],[120.90432,31.546129],[120.905219,31.54678],[120.905685,31.546873],[120.907776,31.548388],[120.908332,31.548707],[120.909564,31.54998],[120.911661,31.548339],[120.912236,31.54925],[120.912904,31.549342],[120.914752,31.549318],[120.915661,31.549635],[120.915513,31.549865],[120.915041,31.550598],[120.914032,31.551553],[120.912924,31.552971],[120.913284,31.553476],[120.913908,31.553913],[120.914743,31.555935],[120.915265,31.556576],[120.915963,31.556647],[120.917773,31.558007],[120.918301,31.558583],[120.917759,31.55882],[120.917498,31.559677],[120.91789,31.559882],[120.917833,31.561001],[120.915204,31.561132],[120.914663,31.561654],[120.914869,31.562512],[120.914272,31.56337],[120.914141,31.565607],[120.914738,31.565607],[120.915521,31.565402],[120.915652,31.565794],[120.91526,31.566391],[120.914664,31.56639],[120.914664,31.566987],[120.915465,31.566913],[120.915465,31.56764],[120.917703,31.567696],[120.917834,31.568945],[120.915205,31.568815],[120.914738,31.568945],[120.915056,31.569617],[120.916174,31.569672],[120.916323,31.570922],[120.917759,31.570866],[120.917834,31.571985],[120.915988,31.571854],[120.915652,31.572768],[120.917759,31.572637],[120.917705,31.574047],[120.919341,31.574137],[120.919468,31.574141],[120.919427,31.574752],[120.918894,31.576779],[120.918904,31.577167],[120.919014,31.577398],[120.923102,31.577358],[120.923619,31.577419],[120.924624,31.57733],[120.924675,31.577384],[120.924669,31.578644],[120.924805,31.57971],[120.924677,31.580109],[120.92465,31.580551],[120.924857,31.581125],[120.924789,31.581277],[120.924863,31.58175],[120.925269,31.582087],[120.925956,31.582836],[120.926366,31.583037],[120.926635,31.583461],[120.926875,31.584159],[120.92749,31.584731],[120.927913,31.584814],[120.931578,31.583761],[120.931317,31.584358],[120.939019,31.592171],[120.938935,31.592278],[120.938291,31.593104],[120.936844,31.592143],[120.935093,31.593163],[120.934499,31.592936],[120.93255,31.593047],[120.932092,31.592015],[120.930439,31.592077],[120.929676,31.591877],[120.92963,31.592406],[120.929186,31.592651],[120.926067,31.593492],[120.925983,31.593421],[120.925797,31.592638],[120.924864,31.592712],[120.925266,31.593854],[120.926191,31.595753],[120.926614,31.59596],[120.92749,31.596126],[120.928135,31.596364],[120.930504,31.596681],[120.931346,31.596685],[120.931518,31.596786],[120.93207,31.596702],[120.932152,31.598596],[120.929384,31.598628],[120.924042,31.598708],[120.924383,31.599503],[120.926811,31.602486],[120.928267,31.604662],[120.928706,31.605159],[120.930368,31.606526],[120.931414,31.607202],[120.932704,31.607855],[120.933725,31.60809],[120.933223,31.608778],[120.932954,31.609012],[120.932489,31.609026],[120.932332,31.609102],[120.932278,31.609377],[120.931874,31.6098],[120.93121,31.610144],[120.930868,31.610621],[120.928623,31.612219],[120.927166,31.613422],[120.925655,31.614805],[120.92814,31.61595],[120.930238,31.616813],[120.932714,31.618308],[120.933187,31.618472],[120.935764,31.618847],[120.935634,31.620302],[120.933953,31.620321],[120.933738,31.620565],[120.932349,31.621697],[120.931304,31.622038],[120.930747,31.622331],[120.928305,31.622681],[120.926761,31.622797],[120.925794,31.623119],[120.924372,31.623821],[120.924347,31.624008],[120.924803,31.624434],[120.925212,31.624689],[120.925464,31.624758],[120.925843,31.624713],[120.926161,31.624176],[120.92671,31.623824],[120.927352,31.623938],[120.928767,31.624372],[120.929235,31.624836],[120.929553,31.625363],[120.92976,31.626688],[120.930108,31.626829],[120.930804,31.626695],[120.93221,31.626698],[120.933236,31.626368],[120.933546,31.626409],[120.933876,31.626764],[120.934992,31.627093],[120.935708,31.627646],[120.936453,31.627662],[120.936789,31.627781],[120.937,31.628052],[120.937218,31.628917],[120.937528,31.628993],[120.938253,31.629474],[120.939468,31.630524],[120.942144,31.627637],[120.943869,31.628378],[120.945974,31.629174],[120.949458,31.630675],[120.949965,31.630041],[120.951042,31.630645],[120.951987,31.631439],[120.952323,31.631513],[120.95285,31.631834],[120.953594,31.632572],[120.955554,31.633312],[120.956944,31.634027],[120.960621,31.635698],[120.9611,31.636018],[120.962485,31.636944],[120.96415,31.637918],[120.964576,31.637066],[120.968138,31.634045],[120.968418,31.633883],[120.970307,31.63279],[120.970191,31.633402],[120.969311,31.63464],[120.968869,31.635073],[120.968818,31.635474],[120.970481,31.639929],[120.970655,31.640778],[120.970979,31.641724],[120.971286,31.642357],[120.971442,31.642679],[120.972677,31.643983],[120.973553,31.644731],[120.974936,31.645722],[120.977172,31.647687],[120.97797,31.64809],[120.979125,31.648379],[120.980763,31.648441],[120.981699,31.648362],[120.982951,31.648837],[120.984693,31.649266],[120.986046,31.649809],[120.987563,31.650418],[120.988639,31.651033],[120.988957,31.651215],[120.989636,31.65234],[120.990376,31.653293],[120.990618,31.65538],[120.990741,31.655832],[120.991678,31.657047],[120.992094,31.657414],[120.992433,31.657883],[120.993113,31.659476],[120.99346,31.660666],[120.993883,31.66179],[120.994121,31.66249],[120.994885,31.663494],[120.99583,31.664185],[120.998541,31.665551],[121.000023,31.666589],[121.002267,31.667765],[121.003432,31.668107],[121.004078,31.668066],[121.005403,31.66782],[121.00638,31.667833],[121.009199,31.669237],[121.009708,31.669611],[121.010249,31.670272],[121.010695,31.670201],[121.01361,31.671419],[121.014084,31.671854],[121.014724,31.672964],[121.015896,31.672124],[121.01584,31.671266],[121.017146,31.670614],[121.020067,31.668429],[121.020011,31.668194],[121.019551,31.667838],[121.018563,31.667799],[121.017312,31.666877],[121.016506,31.66568],[121.014653,31.664178],[121.011796,31.661479],[121.012875,31.660887],[121.013442,31.661716],[121.013968,31.661479],[121.013903,31.66086],[121.014612,31.660924],[121.015048,31.660491],[121.015888,31.660154],[121.016536,31.660228],[121.016825,31.659609],[121.017655,31.659307],[121.017918,31.659346],[121.018315,31.65869],[121.019761,31.659017],[121.019761,31.658385],[121.020288,31.658227],[121.021121,31.657526],[121.021708,31.657373],[121.022,31.657068],[121.022658,31.656937],[121.023053,31.656713],[121.023382,31.657332],[121.024172,31.656739],[121.024501,31.656344],[121.026476,31.655159],[121.026989,31.655265],[121.028056,31.654567],[121.029372,31.654277],[121.029381,31.653658],[121.03036,31.653513],[121.03115,31.653158],[121.031034,31.652547],[121.032329,31.652207],[121.033428,31.65246],[121.033686,31.65185],[121.033849,31.651143],[121.034349,31.651012],[121.035165,31.650577],[121.035758,31.65088],[121.036285,31.650248],[121.036061,31.649853],[121.036317,31.649639],[121.036456,31.649524],[121.036932,31.649769],[121.03726,31.649938],[121.038194,31.6493],[121.038984,31.648642],[121.038918,31.648141],[121.040537,31.647615],[121.040998,31.646733],[121.041303,31.646801],[121.042012,31.646101],[121.042512,31.646166],[121.043236,31.645376],[121.043131,31.645021],[121.043265,31.644887],[121.043657,31.644494],[121.043302,31.643928],[121.046093,31.64169],[121.050017,31.640044],[121.051426,31.639386],[121.052182,31.639432],[121.054691,31.63853],[121.05577,31.63857],[121.056139,31.638069],[121.057021,31.637911],[121.05735,31.638109],[121.057785,31.637845],[121.058904,31.637674],[121.059283,31.637535],[121.055435,31.630839],[121.052748,31.632059],[121.052011,31.631848],[121.048062,31.625265],[121.04693,31.624729],[121.043885,31.623284],[121.041541,31.621721],[121.0357,31.614507],[121.033368,31.611625],[121.030386,31.610307],[121.025152,31.607992],[121.021518,31.60728],[121.015857,31.601751],[121.011228,31.599644],[120.997635,31.593456],[120.997801,31.593219],[121.004626,31.583608],[120.991335,31.5754],[120.996994,31.569187],[120.992065,31.566834],[120.978151,31.556857],[120.978138,31.556768],[120.97778,31.554458],[120.977885,31.552417],[120.97907,31.551443],[120.979688,31.550021],[120.973013,31.547889],[120.976897,31.545979],[120.981098,31.547665],[120.982625,31.545611],[120.982059,31.545308],[120.982401,31.54327],[120.982414,31.543188],[120.993816,31.544899],[120.995395,31.53463],[120.997423,31.535288],[121.000033,31.527767],[121.001428,31.524407],[121.002453,31.521938],[120.998345,31.515881],[120.991762,31.510878],[120.988587,31.507535]]]]}},{type:"Feature",properties:{id:"27524",name:"梅李镇",site:"www.poi86.com"},geometry:{type:"MultiPolygon",coordinates:[[[[120.911881,31.658498],[120.913994,31.656303],[120.912694,31.655476],[120.911226,31.655179],[120.910869,31.654981],[120.910596,31.654745],[120.910575,31.654316],[120.909956,31.653455],[120.90901,31.653979],[120.903489,31.649041],[120.900809,31.646497],[120.899141,31.647625],[120.89803,31.646406],[120.89745,31.646607],[120.896946,31.646257],[120.89616,31.646811],[120.895992,31.646746],[120.895432,31.647126],[120.895224,31.647037],[120.894653,31.647332],[120.894191,31.646916],[120.896232,31.645575],[120.895465,31.644673],[120.894509,31.643945],[120.894963,31.643603],[120.895479,31.643352],[120.895722,31.643058],[120.896309,31.642582],[120.896626,31.642504],[120.896109,31.642106],[120.895915,31.641697],[120.894829,31.640645],[120.893964,31.638852],[120.893564,31.639118],[120.893147,31.63925],[120.892891,31.639251],[120.89242,31.638458],[120.891931,31.638618],[120.891748,31.638773],[120.89163,31.639169],[120.889225,31.64037],[120.888931,31.639852],[120.887803,31.64037],[120.888083,31.641065],[120.888975,31.642743],[120.889489,31.643975],[120.888524,31.644655],[120.887814,31.645056],[120.887058,31.645324],[120.885793,31.646063],[120.885154,31.646354],[120.884693,31.646428],[120.883698,31.646869],[120.882845,31.647577],[120.881084,31.648281],[120.880007,31.648828],[120.879089,31.647307],[120.878342,31.645666],[120.875055,31.646681],[120.874465,31.645683],[120.873044,31.646408],[120.872434,31.64563],[120.87193,31.645953],[120.870966,31.645559],[120.86965,31.646131],[120.871259,31.647614],[120.872374,31.649305],[120.873771,31.650789],[120.875186,31.652671],[120.874136,31.652874],[120.871935,31.653266],[120.871434,31.653254],[120.870615,31.651507],[120.869463,31.65169],[120.868655,31.651965],[120.868423,31.652233],[120.867717,31.652457],[120.865807,31.652734],[120.86493,31.652734],[120.865272,31.654087],[120.865444,31.654577],[120.865704,31.654986],[120.865725,31.655406],[120.866195,31.656806],[120.866476,31.658183],[120.867116,31.659844],[120.868518,31.66485],[120.868882,31.66553],[120.869192,31.665914],[120.869338,31.666567],[120.869805,31.667509],[120.870121,31.667984],[120.870344,31.668567],[120.868709,31.668865],[120.868296,31.669089],[120.867834,31.669235],[120.866972,31.669191],[120.865859,31.669327],[120.86486,31.669284],[120.859109,31.669406],[120.858819,31.668805],[120.858651,31.668133],[120.858035,31.667345],[120.857689,31.667286],[120.857644,31.666026],[120.857503,31.665302],[120.855698,31.665624],[120.856301,31.668039],[120.854041,31.668684],[120.854154,31.669462],[120.85305,31.669526],[120.852981,31.669842],[120.852646,31.669887],[120.852619,31.669992],[120.852474,31.670031],[120.8525,31.671019],[120.850939,31.671177],[120.850966,31.671673],[120.8514,31.672716],[120.851683,31.674389],[120.852101,31.675498],[120.852329,31.676727],[120.852741,31.677808],[120.853308,31.680017],[120.851449,31.679931],[120.850716,31.679688],[120.850369,31.679623],[120.850096,31.679658],[120.847242,31.678832],[120.845691,31.681964],[120.845393,31.682343],[120.844987,31.683152],[120.843428,31.682118],[120.842031,31.683678],[120.842224,31.684032],[120.842756,31.684405],[120.840797,31.686411],[120.83967,31.685869],[120.839162,31.686756],[120.83953,31.687012],[120.839683,31.68728],[120.839336,31.687907],[120.839221,31.689168],[120.839757,31.689821],[120.840078,31.69053],[120.840133,31.691025],[120.840262,31.691423],[120.839964,31.691888],[120.839607,31.69273],[120.839171,31.693304],[120.838828,31.694459],[120.838481,31.695032],[120.836857,31.696637],[120.834637,31.699074],[120.834024,31.699552],[120.83371,31.699619],[120.8337,31.699888],[120.833315,31.700548],[120.833609,31.701052],[120.833553,31.701774],[120.833207,31.702584],[120.832477,31.702632],[120.831521,31.702466],[120.829883,31.704168],[120.830408,31.70509],[120.830514,31.705736],[120.8313,31.70627],[120.831768,31.706471],[120.83477,31.709704],[120.830996,31.713287],[120.82966,31.714563],[120.827832,31.71591],[120.826703,31.716402],[120.823398,31.718729],[120.820597,31.720411],[120.8199,31.72083],[120.817196,31.722819],[120.816234,31.723708],[120.819055,31.726382],[120.820412,31.727397],[120.820837,31.727103],[120.823458,31.729919],[120.823082,31.73004],[120.823297,31.730265],[120.81985,31.732323],[120.819212,31.732801],[120.818938,31.732424],[120.817906,31.733025],[120.817766,31.733209],[120.8193,31.735697],[120.82049,31.734882],[120.821179,31.735793],[120.820283,31.737059],[120.819907,31.737442],[120.819713,31.738161],[120.819187,31.738574],[120.81763,31.740695],[120.814967,31.743092],[120.816007,31.743872],[120.815557,31.744241],[120.814746,31.743762],[120.81426,31.744422],[120.814831,31.744827],[120.814532,31.74526],[120.815304,31.745643],[120.815059,31.746377],[120.814564,31.746111],[120.814351,31.746166],[120.812888,31.746089],[120.812385,31.746306],[120.812175,31.746686],[120.812292,31.747094],[120.812219,31.747472],[120.812702,31.749375],[120.813429,31.750286],[120.812651,31.750733],[120.813166,31.751266],[120.813961,31.752081],[120.813421,31.752322],[120.813843,31.752965],[120.813291,31.753206],[120.815767,31.756745],[120.816739,31.758354],[120.818844,31.761238],[120.820618,31.764601],[120.818361,31.766236],[120.819257,31.767265],[120.820763,31.76704],[120.82203,31.768227],[120.82124,31.768948],[120.82691,31.77335],[120.831783,31.777591],[120.833879,31.779611],[120.838494,31.779686],[120.855352,31.779956],[120.872188,31.780227],[120.886307,31.783917],[120.884873,31.779009],[120.881865,31.768709],[120.882162,31.767414],[120.882518,31.76724],[120.883139,31.766816],[120.883958,31.766009],[120.882234,31.760829],[120.881576,31.759291],[120.881633,31.759112],[120.88154,31.758232],[120.878722,31.756075],[120.877677,31.755417],[120.87386,31.753975],[120.874325,31.753557],[120.873364,31.752912],[120.873018,31.752557],[120.874588,31.751171],[120.875329,31.75068],[120.875719,31.750333],[120.875111,31.749786],[120.876071,31.749484],[120.87439,31.747926],[120.87579,31.746759],[120.875198,31.746208],[120.876732,31.745303],[120.876098,31.744633],[120.874666,31.745353],[120.873458,31.744437],[120.874585,31.743403],[120.874045,31.743025],[120.872965,31.74404],[120.87205,31.743205],[120.871307,31.742882],[120.872505,31.741902],[120.872718,31.74156],[120.87082,31.74081],[120.87138,31.740281],[120.870066,31.73933],[120.870238,31.739066],[120.870564,31.738873],[120.871647,31.737464],[120.871921,31.736901],[120.872219,31.736702],[120.872295,31.736582],[120.872222,31.736237],[120.872951,31.735122],[120.873421,31.734564],[120.873866,31.733738],[120.875377,31.732558],[120.875871,31.732394],[120.876257,31.731914],[120.877086,31.731718],[120.87767,31.731439],[120.878928,31.730118],[120.879331,31.729966],[120.879606,31.730293],[120.879224,31.730522],[120.879866,31.731227],[120.880241,31.730998],[120.880015,31.730749],[120.880362,31.730496],[120.880024,31.730194],[120.881405,31.729355],[120.880798,31.728727],[120.881716,31.728321],[120.881814,31.727865],[120.882491,31.727618],[120.882286,31.72728],[120.882889,31.726977],[120.88325,31.727446],[120.883346,31.727412],[120.883716,31.727282],[120.883852,31.727579],[120.884102,31.7275],[120.884237,31.727773],[120.884815,31.727638],[120.884701,31.727364],[120.88603,31.726931],[120.885577,31.725551],[120.885234,31.724748],[120.884859,31.724112],[120.885838,31.723688],[120.885648,31.723438],[120.886183,31.723147],[120.887733,31.722613],[120.888389,31.722525],[120.888848,31.723148],[120.889892,31.722055],[120.890669,31.721572],[120.890372,31.721175],[120.891923,31.719899],[120.893872,31.71874],[120.894326,31.719459],[120.896278,31.718503],[120.896986,31.719577],[120.898874,31.718817],[120.897689,31.71724],[120.897433,31.716759],[120.897226,31.715484],[120.897042,31.715228],[120.896248,31.714644],[120.895599,31.713926],[120.89522,31.713672],[120.894694,31.713479],[120.894128,31.713394],[120.893077,31.713562],[120.892625,31.713703],[120.892102,31.713625],[120.891851,31.713117],[120.891761,31.711716],[120.891584,31.711479],[120.891447,31.711068],[120.891458,31.710668],[120.892235,31.709494],[120.892501,31.708902],[120.891731,31.707829],[120.891383,31.707825],[120.891101,31.706949],[120.891979,31.706794],[120.892284,31.707286],[120.892407,31.707835],[120.894906,31.707864],[120.895588,31.70777],[120.896239,31.707915],[120.896693,31.707936],[120.897374,31.707692],[120.897952,31.707623],[120.898595,31.707714],[120.899355,31.707636],[120.900176,31.707338],[120.900754,31.707293],[120.901397,31.707372],[120.901821,31.707177],[120.902138,31.706776],[120.90261,31.706564],[120.902973,31.706609],[120.903444,31.70691],[120.903711,31.707182],[120.904117,31.707281],[120.90463,31.706889],[120.905736,31.705784],[120.905923,31.705717],[120.907159,31.705702],[120.907401,31.705593],[120.907562,31.704864],[120.908071,31.703423],[120.910835,31.702079],[120.913858,31.700283],[120.91278,31.698497],[120.915026,31.697612],[120.915274,31.697811],[120.915919,31.697548],[120.91255,31.692046],[120.914297,31.691428],[120.914316,31.690798],[120.913988,31.690231],[120.913691,31.690212],[120.913316,31.690303],[120.913168,31.690259],[120.913007,31.690028],[120.913334,31.689121],[120.913247,31.688944],[120.911522,31.686751],[120.911182,31.686646],[120.91111,31.686611],[120.910921,31.686079],[120.910725,31.684928],[120.911069,31.684106],[120.91293,31.683005],[120.91328,31.682884],[120.91317,31.682348],[120.913682,31.682047],[120.915247,31.6803],[120.916073,31.679636],[120.916288,31.679838],[120.917099,31.679177],[120.916344,31.678166],[120.915672,31.677978],[120.919117,31.676342],[120.919864,31.67701],[120.92168,31.675716],[120.921806,31.675697],[120.922447,31.676168],[120.92274,31.676244],[120.923931,31.675116],[120.92461,31.675459],[120.926206,31.674176],[120.926652,31.674423],[120.927047,31.673683],[120.927337,31.67264],[120.928387,31.671726],[120.928794,31.671423],[120.929001,31.671387],[120.927511,31.670702],[120.926782,31.670271],[120.92633,31.669841],[120.926178,31.669208],[120.925821,31.669043],[120.924721,31.668248],[120.92393,31.667961],[120.923261,31.667565],[120.922818,31.667142],[120.922538,31.666744],[120.922548,31.666529],[120.922428,31.666247],[120.92209,31.665892],[120.921652,31.665662],[120.921563,31.665452],[120.921656,31.665147],[120.92185,31.664855],[120.921657,31.664485],[120.921422,31.664375],[120.920489,31.664418],[120.920094,31.66431],[120.919413,31.663917],[120.918852,31.663868],[120.918443,31.663985],[120.917041,31.663559],[120.916817,31.663342],[120.916826,31.662039],[120.916604,31.661754],[120.915706,31.661403],[120.914933,31.660682],[120.91401,31.659976],[120.91327,31.659244],[120.911881,31.658498]]]]}},{type:"Feature",properties:{id:"27525",name:"海虞镇",site:"www.poi86.com"},geometry:{type:"MultiPolygon",coordinates:[[[[120.83029,31.690898],[120.821832,31.687266],[120.817533,31.685515],[120.81417,31.684146],[120.802419,31.678892],[120.802713,31.682422],[120.802971,31.683031],[120.803475,31.685058],[120.804008,31.686534],[120.804292,31.687614],[120.80485,31.688937],[120.805228,31.690243],[120.805443,31.691687],[120.804707,31.693419],[120.804441,31.693686],[120.801532,31.694046],[120.800867,31.694228],[120.799019,31.694492],[120.797732,31.694575],[120.794578,31.695143],[120.793271,31.695229],[120.792395,31.695659],[120.789436,31.696639],[120.787313,31.697087],[120.785428,31.697696],[120.783261,31.696189],[120.780329,31.698017],[120.779929,31.698816],[120.779378,31.699483],[120.777341,31.700168],[120.777969,31.70251],[120.776316,31.703103],[120.775482,31.701253],[120.771524,31.7026],[120.770372,31.699678],[120.764667,31.701551],[120.766797,31.706753],[120.76851,31.711471],[120.768807,31.712007],[120.770006,31.715383],[120.770143,31.716023],[120.771228,31.717941],[120.771288,31.71874],[120.771466,31.719548],[120.772471,31.72098],[120.77266,31.721866],[120.773055,31.723943],[120.774002,31.726703],[120.774259,31.727141],[120.774601,31.728064],[120.774554,31.728445],[120.774631,31.729368],[120.77507,31.730288],[120.775101,31.731041],[120.775345,31.73194],[120.776052,31.733219],[120.776291,31.734617],[120.776265,31.735088],[120.776013,31.735342],[120.772663,31.73736],[120.771529,31.738611],[120.770056,31.739818],[120.768815,31.740564],[120.767143,31.740475],[120.76664,31.741782],[120.767021,31.744755],[120.766586,31.745326],[120.765687,31.745393],[120.764463,31.744618],[120.763605,31.745243],[120.762425,31.745756],[120.763309,31.746594],[120.763876,31.746204],[120.764468,31.746642],[120.764865,31.746763],[120.76493,31.746987],[120.764632,31.747416],[120.765126,31.747715],[120.765583,31.749095],[120.765452,31.749422],[120.765686,31.750345],[120.765909,31.750513],[120.768278,31.749291],[120.769006,31.750046],[120.76756,31.750578],[120.767952,31.751497],[120.767794,31.751833],[120.768419,31.752355],[120.768387,31.752471],[120.768278,31.752877],[120.767756,31.752812],[120.767028,31.75311],[120.767087,31.753231],[120.766403,31.753435],[120.766208,31.752915],[120.76535,31.75311],[120.764231,31.753642],[120.763643,31.752784],[120.763279,31.751833],[120.761171,31.752812],[120.760481,31.753969],[120.758578,31.753866],[120.756172,31.75492],[120.755612,31.754687],[120.755053,31.753773],[120.753738,31.753082],[120.752189,31.751963],[120.751341,31.752028],[120.749895,31.752897],[120.749833,31.752933],[120.749635,31.753024],[120.748739,31.753176],[120.746447,31.753463],[120.745619,31.753846],[120.736145,31.753145],[120.735611,31.752794],[120.735017,31.753053],[120.734287,31.753171],[120.733899,31.753233],[120.733615,31.753279],[120.733233,31.753457],[120.725371,31.755064],[120.712919,31.757012],[120.711462,31.757319],[120.71245,31.758467],[120.714725,31.760571],[120.714725,31.761754],[120.716631,31.762766],[120.718866,31.763489],[120.718538,31.764317],[120.717683,31.764975],[120.718537,31.766027],[120.717354,31.769182],[120.716789,31.769313],[120.716855,31.769799],[120.716592,31.770299],[120.716894,31.77043],[120.716829,31.770759],[120.71646,31.770667],[120.716329,31.771154],[120.716565,31.771193],[120.715711,31.774112],[120.715474,31.774243],[120.71554,31.774835],[120.715251,31.775597],[120.715316,31.776189],[120.715119,31.776583],[120.711767,31.778055],[120.711044,31.778056],[120.710873,31.778319],[120.711504,31.77845],[120.712227,31.77891],[120.712885,31.779502],[120.713634,31.779699],[120.71508,31.779765],[120.715738,31.780093],[120.715672,31.780553],[120.716921,31.781237],[120.717276,31.781802],[120.717867,31.782355],[120.717972,31.782986],[120.719024,31.783143],[120.720365,31.783998],[120.721022,31.78384],[120.721785,31.784103],[120.72214,31.783771],[120.723652,31.783446],[120.72356,31.7843],[120.723363,31.784892],[120.723099,31.785089],[120.722955,31.785313],[120.723389,31.785286],[120.723586,31.785641],[120.724467,31.785378],[120.724769,31.786535],[120.725624,31.786627],[120.72565,31.78689],[120.725913,31.786956],[120.726084,31.787482],[120.72703,31.78735],[120.727162,31.787718],[120.726872,31.787876],[120.72661,31.78831],[120.72661,31.788507],[120.726307,31.788533],[120.726281,31.78877],[120.72613,31.788704],[120.72613,31.789098],[120.725118,31.78919],[120.725092,31.790663],[120.725486,31.791425],[120.725617,31.792438],[120.725052,31.792701],[120.725288,31.793161],[120.726498,31.794015],[120.726367,31.795001],[120.726439,31.795725],[120.726334,31.795774],[120.726258,31.795994],[120.726653,31.797062],[120.725387,31.797236],[120.725798,31.797703],[120.725226,31.797949],[120.725151,31.799149],[120.724247,31.799721],[120.723491,31.799701],[120.722913,31.800445],[120.722669,31.800773],[120.722058,31.801134],[120.722123,31.801332],[120.723044,31.80118],[120.724227,31.801706],[120.724247,31.801956],[120.72495,31.80212],[120.724918,31.802462],[120.725312,31.802495],[120.725377,31.803612],[120.725608,31.804026],[120.725752,31.80452],[120.726081,31.805032],[120.72548,31.805318],[120.725666,31.805591],[120.725666,31.805867],[120.725552,31.805959],[120.725437,31.805851],[120.725315,31.805867],[120.72519,31.806238],[120.724625,31.806245],[120.723268,31.8059],[120.722275,31.807652],[120.722101,31.807668],[120.721772,31.808463],[120.720911,31.808375],[120.721331,31.809609],[120.722176,31.811727],[120.722709,31.813413],[120.722791,31.814094],[120.723277,31.815218],[120.720333,31.816016],[120.720112,31.816213],[120.722479,31.819655],[120.722426,31.819806],[120.719337,31.821167],[120.719501,31.822764],[120.719455,31.823158],[120.720718,31.824177],[120.722163,31.823388],[120.724819,31.826195],[120.725575,31.825965],[120.725757,31.826338],[120.726002,31.826839],[120.727764,31.829238],[120.728783,31.829271],[120.729815,31.828331],[120.731622,31.830336],[120.731134,31.830803],[120.729874,31.831749],[120.732832,31.833747],[120.735133,31.831881],[120.735556,31.832202],[120.738288,31.834273],[120.738512,31.834181],[120.739077,31.834904],[120.739865,31.835496],[120.740101,31.835799],[120.74239,31.838743],[120.752052,31.832669],[120.763464,31.825399],[120.784024,31.814724],[120.796224,31.823335],[120.800037,31.824952],[120.803692,31.819693],[120.804283,31.819719],[120.805598,31.819167],[120.805677,31.818852],[120.817998,31.814346],[120.83193,31.809254],[120.839493,31.805748],[120.850275,31.803224],[120.8528,31.803908],[120.855693,31.807169],[120.887446,31.835822],[120.888128,31.835279],[120.888428,31.834649],[120.888708,31.830799],[120.888827,31.830249],[120.889318,31.829149],[120.890478,31.827449],[120.891988,31.825889],[120.893817,31.824219],[120.898777,31.820019],[120.903908,31.816219],[120.910847,31.811879],[120.917499,31.808764],[120.903801,31.791426],[120.900878,31.787725],[120.886307,31.783917],[120.872188,31.780227],[120.855352,31.779956],[120.838494,31.779686],[120.833879,31.779611],[120.831783,31.777591],[120.82691,31.77335],[120.82124,31.768948],[120.82203,31.768227],[120.820763,31.76704],[120.819257,31.767265],[120.818361,31.766236],[120.820618,31.764601],[120.818844,31.761238],[120.816739,31.758354],[120.815767,31.756745],[120.813291,31.753206],[120.813843,31.752965],[120.813421,31.752322],[120.813961,31.752081],[120.813166,31.751266],[120.812651,31.750733],[120.813429,31.750286],[120.812702,31.749375],[120.812219,31.747472],[120.812292,31.747094],[120.812175,31.746686],[120.812385,31.746306],[120.812888,31.746089],[120.814351,31.746166],[120.814564,31.746111],[120.815059,31.746377],[120.815304,31.745643],[120.814532,31.74526],[120.814831,31.744827],[120.81426,31.744422],[120.814746,31.743762],[120.815557,31.744241],[120.816007,31.743872],[120.814967,31.743092],[120.81763,31.740695],[120.819187,31.738574],[120.819713,31.738161],[120.819907,31.737442],[120.820283,31.737059],[120.821179,31.735793],[120.82049,31.734882],[120.8193,31.735697],[120.817766,31.733209],[120.817906,31.733025],[120.818938,31.732424],[120.819212,31.732801],[120.81985,31.732323],[120.823297,31.730265],[120.823082,31.73004],[120.823458,31.729919],[120.820837,31.727103],[120.820412,31.727397],[120.819055,31.726382],[120.816234,31.723708],[120.817196,31.722819],[120.8199,31.72083],[120.820597,31.720411],[120.823398,31.718729],[120.826703,31.716402],[120.827832,31.71591],[120.82966,31.714563],[120.830996,31.713287],[120.83477,31.709704],[120.831768,31.706471],[120.8313,31.70627],[120.830514,31.705736],[120.830408,31.70509],[120.829883,31.704168],[120.831521,31.702466],[120.832477,31.702632],[120.833207,31.702584],[120.833553,31.701774],[120.833609,31.701052],[120.833315,31.700548],[120.8337,31.699888],[120.83371,31.699619],[120.834024,31.699552],[120.834637,31.699074],[120.836857,31.696637],[120.838481,31.695032],[120.838828,31.694459],[120.83029,31.690898]]]]}},{type:"Feature",properties:{id:"27526",name:"辛庄镇",site:"www.poi86.com"},geometry:{type:"MultiPolygon",coordinates:[[[[120.707629,31.521279],[120.70616,31.521334],[120.704585,31.521491],[120.702616,31.517002],[120.701985,31.51582],[120.700804,31.512039],[120.698834,31.511881],[120.697889,31.509124],[120.697259,31.508888],[120.697101,31.507549],[120.695132,31.504555],[120.694344,31.504555],[120.692374,31.502034],[120.69395,31.500065],[120.691587,31.498647],[120.689223,31.499278],[120.688436,31.49849],[120.685442,31.49786],[120.685048,31.495103],[120.683079,31.496678],[120.683316,31.499278],[120.68174,31.497702],[120.680952,31.499278],[120.679928,31.500065],[120.680165,31.501405],[120.677066,31.502244],[120.676384,31.502429],[120.674651,31.499829],[120.669294,31.500223],[120.664454,31.500247],[120.658896,31.501405],[120.658266,31.498648],[120.65732,31.49786],[120.6522,31.49849],[120.6522,31.500617],[120.652097,31.50069],[120.649994,31.502193],[120.650782,31.504556],[120.651806,31.50495],[120.649837,31.507313],[120.648813,31.506367],[120.646686,31.506919],[120.646056,31.506131],[120.643692,31.506762],[120.644086,31.509282],[120.642904,31.509282],[120.643535,31.510858],[120.645111,31.511488],[120.644717,31.512827],[120.642117,31.513221],[120.641172,31.512433],[120.63999,31.513221],[120.640778,31.514009],[120.641565,31.515427],[120.640541,31.515584],[120.639754,31.514796],[120.638809,31.515427],[120.63936,31.518735],[120.633452,31.518972],[120.632113,31.518735],[120.630143,31.518735],[120.632113,31.522516],[120.632867,31.527189],[120.632901,31.5274],[120.621636,31.5274],[120.622266,31.530157],[120.621478,31.530787],[120.623448,31.533545],[120.624629,31.533151],[120.625181,31.53512],[120.623448,31.536066],[120.623999,31.541028],[120.622661,31.54158],[120.621478,31.543943],[120.622661,31.54733],[120.622561,31.547354],[120.618871,31.54824],[120.616753,31.548669],[120.616122,31.551032],[120.613995,31.552451],[120.612026,31.551269],[120.608875,31.55182],[120.608875,31.547488],[120.605094,31.547488],[120.599628,31.548823],[120.595374,31.549901],[120.594763,31.554692],[120.594433,31.558731],[120.594163,31.560923],[120.594121,31.561262],[120.593736,31.5646],[120.593644,31.565421],[120.593214,31.567672],[120.592349,31.571448],[120.591364,31.576132],[120.590854,31.577732],[120.589053,31.578802],[120.586864,31.580586],[120.583434,31.583292],[120.582674,31.584972],[120.581144,31.587692],[120.577774,31.587452],[120.575364,31.587564],[120.571323,31.587832],[120.566774,31.587892],[120.565924,31.587962],[120.565404,31.587822],[120.565074,31.587602],[120.564334,31.586872],[120.563234,31.586102],[120.564894,31.583282],[120.565604,31.582342],[120.565484,31.582252],[120.564404,31.581982],[120.564244,31.581812],[120.564564,31.580952],[120.565454,31.579732],[120.56411,31.579239],[120.555554,31.576352],[120.555499,31.576511],[120.555345,31.576458],[120.554854,31.576316],[120.554734,31.576566],[120.554854,31.576626],[120.553584,31.578906],[120.549433,31.577476],[120.547734,31.577026],[120.546144,31.576716],[120.544904,31.577116],[120.540634,31.578756],[120.540728,31.579107],[120.541894,31.582542],[120.542304,31.583292],[120.543014,31.584022],[120.543474,31.585842],[120.543454,31.585952],[120.541854,31.587432],[120.541523,31.587542],[120.541164,31.588182],[120.540894,31.589262],[120.540794,31.589982],[120.540774,31.591022],[120.540454,31.591602],[120.540674,31.592012],[120.540394,31.593112],[120.539884,31.596522],[120.539854,31.596592],[120.539634,31.596652],[120.539574,31.596772],[120.539554,31.597792],[120.539464,31.597882],[120.538664,31.597992],[120.538594,31.598162],[120.538704,31.602762],[120.538844,31.605092],[120.538964,31.605752],[120.538534,31.606522],[120.538638,31.606799],[120.538934,31.607582],[120.539205,31.607562],[120.539774,31.607302],[120.540464,31.607142],[120.540574,31.607262],[120.540574,31.607592],[120.540934,31.607652],[120.541084,31.607372],[120.541434,31.608062],[120.543854,31.607342],[120.543794,31.606762],[120.544114,31.606712],[120.544404,31.607472],[120.545604,31.607072],[120.548334,31.606652],[120.549124,31.606252],[120.549204,31.606252],[120.549524,31.606682],[120.551765,31.604322],[120.552754,31.603562],[120.556444,31.603862],[120.557244,31.604032],[120.558554,31.604462],[120.560544,31.605392],[120.560814,31.605352],[120.560904,31.605252],[120.561234,31.604552],[120.562735,31.604852],[120.562705,31.605142],[120.563674,31.605442],[120.562414,31.607512],[120.561724,31.607132],[120.561294,31.607592],[120.561064,31.607742],[120.559664,31.608222],[120.559654,31.608602],[120.559384,31.608592],[120.559354,31.608772],[120.561384,31.609742],[120.561294,31.609872],[120.561624,31.610022],[120.561234,31.610662],[120.561884,31.611042],[120.561614,31.611432],[120.562654,31.611912],[120.564274,31.611922],[120.565974,31.610252],[120.566784,31.610792],[120.566834,31.610742],[120.567092,31.610835],[120.567154,31.610862],[120.566904,31.611212],[120.567334,31.611332],[120.567394,31.611542],[120.567354,31.611732],[120.568864,31.611642],[120.568604,31.611932],[120.568824,31.612132],[120.568584,31.612722],[120.569484,31.613492],[120.569094,31.613822],[120.568735,31.613672],[120.568474,31.613852],[120.568734,31.614132],[120.568414,31.614422],[120.568784,31.615102],[120.569015,31.615802],[120.569134,31.616522],[120.568984,31.616922],[120.568664,31.617152],[120.569174,31.617782],[120.5699,31.618292],[120.570644,31.617702],[120.572114,31.616712],[120.573144,31.616112],[120.573584,31.616022],[120.575044,31.615922],[120.576944,31.615872],[120.577944,31.615682],[120.579454,31.615542],[120.580394,31.615532],[120.581924,31.615092],[120.584234,31.614742],[120.586125,31.613852],[120.586454,31.613762],[120.587484,31.613682],[120.588614,31.613812],[120.589324,31.614202],[120.592094,31.615442],[120.592664,31.615812],[120.593464,31.616592],[120.594394,31.617322],[120.594621,31.617613],[120.59558,31.61741],[120.597323,31.616851],[120.599036,31.616439],[120.599094,31.616426],[120.599496,31.616329],[120.599598,31.616124],[120.601239,31.616124],[120.601836,31.616459],[120.60578,31.61672],[120.607487,31.614809],[120.608577,31.612972],[120.613207,31.606313],[120.614396,31.604562],[120.617696,31.601459],[120.618668,31.60041],[120.619193,31.59976],[120.619528,31.598697],[120.619267,31.597914],[120.620642,31.597126],[120.621761,31.595671],[120.622321,31.595317],[120.624624,31.595112],[120.625677,31.594888],[120.626824,31.593965],[120.628307,31.59321],[120.631656,31.592356],[120.641275,31.59348],[120.641857,31.593555],[120.6448,31.59341],[120.647397,31.594001],[120.648811,31.594704],[120.649974,31.595582],[120.651556,31.5974],[120.652397,31.598205],[120.654255,31.598375],[120.656037,31.59844],[120.657286,31.598729],[120.657864,31.59914],[120.659017,31.598844],[120.659467,31.598909],[120.660568,31.599699],[120.661845,31.599569],[120.662703,31.599177],[120.66372,31.599177],[120.663981,31.599466],[120.663132,31.601144],[120.66454,31.601769],[120.664615,31.602598],[120.666088,31.601834],[120.666778,31.601704],[120.667767,31.601389],[120.66882,31.603481],[120.670767,31.602776],[120.679461,31.600788],[120.670064,31.591039],[120.666459,31.587268],[120.664251,31.585364],[120.663057,31.58139],[120.663263,31.577747],[120.663332,31.573072],[120.663137,31.571055],[120.662469,31.563854],[120.662348,31.562524],[120.662628,31.562499],[120.666134,31.562198],[120.666134,31.561042],[120.668111,31.560948],[120.668232,31.559894],[120.67763,31.561069],[120.677575,31.562114],[120.682703,31.562057],[120.682623,31.563274],[120.684498,31.56334],[120.684796,31.562808],[120.685486,31.562808],[120.685617,31.56209],[120.68792,31.562249],[120.68792,31.559917],[120.687528,31.558668],[120.687229,31.557316],[120.690782,31.556393],[120.704964,31.553773],[120.706219,31.555471],[120.708274,31.558669],[120.709141,31.560813],[120.709859,31.560747],[120.711444,31.559759],[120.71894,31.558845],[120.722101,31.558873],[120.722167,31.557465],[120.723509,31.557064],[120.723351,31.555554],[120.723677,31.5545],[120.725187,31.554369],[120.725355,31.553707],[120.725225,31.551414],[120.729467,31.550854],[120.730026,31.55105],[120.730586,31.551936],[120.733999,31.552094],[120.734558,31.557651],[120.736583,31.557975],[120.736407,31.557385],[120.736628,31.556999],[120.736469,31.556309],[120.739034,31.555451],[120.738642,31.554369],[120.735976,31.555152],[120.734297,31.549894],[120.733971,31.548216],[120.733933,31.54733],[120.736339,31.546537],[120.736992,31.548318],[120.738605,31.54802],[120.738343,31.547293],[120.738983,31.547187],[120.739137,31.547162],[120.738735,31.546015],[120.738017,31.546015],[120.737653,31.543386],[120.737952,31.542556],[120.737812,31.542136],[120.735155,31.54236],[120.734959,31.542295],[120.734922,31.541605],[120.73501,31.541448],[120.73509,31.541306],[120.736432,31.541278],[120.736171,31.5396],[120.737318,31.539208],[120.737057,31.538313],[120.736432,31.537884],[120.73608,31.53755],[120.735748,31.537028],[120.734773,31.537662],[120.731131,31.537876],[120.729399,31.53764],[120.729399,31.535671],[120.731132,31.535119],[120.73114,31.534929],[120.731368,31.529605],[120.726011,31.528581],[120.720891,31.528187],[120.722309,31.523697],[120.716952,31.520704],[120.715881,31.520798],[120.712462,31.521098],[120.707629,31.521279]]]]}},{type:"Feature",properties:{id:"27527",name:"沙家浜镇",site:"www.poi86.com"},geometry:{type:"MultiPolygon",coordinates:[[[[120.881555,31.53556],[120.881508,31.535414],[120.882522,31.535243],[120.881798,31.533861],[120.881995,31.533768],[120.881337,31.532478],[120.880325,31.532776],[120.879336,31.532386],[120.879033,31.531991],[120.876795,31.53232],[120.876637,31.532742],[120.875676,31.532913],[120.875412,31.532452],[120.875083,31.532281],[120.874991,31.531557],[120.874491,31.531491],[120.87403,31.528199],[120.872753,31.528304],[120.872555,31.527146],[120.870475,31.526856],[120.870475,31.525737],[120.87087,31.525698],[120.870909,31.524947],[120.86874,31.524903],[120.868566,31.52234],[120.869224,31.521392],[120.868434,31.521326],[120.868013,31.520076],[120.869092,31.519641],[120.868803,31.51872],[120.869066,31.518496],[120.868539,31.517377],[120.868171,31.517443],[120.867842,31.516745],[120.869066,31.516218],[120.868605,31.515362],[120.87004,31.515007],[120.868908,31.514691],[120.866749,31.515481],[120.866406,31.513111],[120.869514,31.511926],[120.869434,31.511452],[120.862851,31.514085],[120.862612,31.512864],[120.862535,31.51053],[120.864036,31.510135],[120.863589,31.50587],[120.863378,31.504685],[120.862588,31.504869],[120.861798,31.507186],[120.858717,31.507318],[120.857269,31.508687],[120.855454,31.508839],[120.852706,31.508442],[120.852582,31.508424],[120.852582,31.506265],[120.850212,31.506528],[120.850245,31.509273],[120.8485,31.509293],[120.845551,31.508898],[120.845551,31.50824],[120.844814,31.508029],[120.844366,31.509477],[120.842921,31.50938],[120.840943,31.508819],[120.840811,31.509741],[120.841522,31.509952],[120.84147,31.510609],[120.843181,31.510926],[120.843122,31.511577],[120.841575,31.5114],[120.841378,31.512203],[120.838909,31.511827],[120.838856,31.512124],[120.83935,31.512203],[120.839238,31.512815],[120.841147,31.513091],[120.841245,31.512664],[120.842839,31.512696],[120.842826,31.513375],[120.843036,31.513473],[120.843089,31.513025],[120.844386,31.51321],[120.844485,31.512815],[120.843583,31.512532],[120.843715,31.512203],[120.844768,31.512387],[120.845538,31.512697],[120.846052,31.512486],[120.844814,31.517772],[120.842918,31.517719],[120.843102,31.516324],[120.842049,31.516139],[120.842128,31.519694],[120.844235,31.519299],[120.845034,31.521256],[120.844551,31.52159],[120.845077,31.523512],[120.841822,31.524035],[120.839918,31.523149],[120.839284,31.522854],[120.829838,31.52169],[120.825353,31.52163],[120.822458,31.534388],[120.821141,31.537179],[120.82075,31.536035],[120.820457,31.535178],[120.81756,31.535178],[120.815085,31.535336],[120.810609,31.534546],[120.810345,31.535178],[120.806132,31.536231],[120.805415,31.538742],[120.804627,31.534803],[120.805711,31.534019],[120.801476,31.527241],[120.801161,31.5222],[120.797223,31.522199],[120.797223,31.526138],[120.794072,31.526454],[120.794124,31.525067],[120.789543,31.525435],[120.786909,31.525172],[120.786119,31.529016],[120.785066,31.529648],[120.786225,31.532545],[120.78599,31.532683],[120.785329,31.533072],[120.783331,31.530168],[120.782538,31.529016],[120.780958,31.52978],[120.776588,31.530851],[120.776297,31.531966],[120.774322,31.532413],[120.774375,31.532887],[120.77319,31.533203],[120.773928,31.534783],[120.767792,31.538944],[120.766274,31.539808],[120.761683,31.54242],[120.760669,31.542276],[120.760199,31.542208],[120.758181,31.534784],[120.758839,31.533204],[120.758181,31.532098],[120.756943,31.53136],[120.754757,31.531887],[120.752256,31.530965],[120.749886,31.531045],[120.746726,31.532229],[120.743363,31.533138],[120.740933,31.534073],[120.738646,31.535447],[120.736852,31.536311],[120.735748,31.537028],[120.73608,31.53755],[120.736432,31.537884],[120.737057,31.538313],[120.737318,31.539208],[120.736171,31.5396],[120.736432,31.541278],[120.73509,31.541306],[120.73501,31.541448],[120.734922,31.541605],[120.734959,31.542295],[120.735155,31.54236],[120.737812,31.542136],[120.737952,31.542556],[120.737653,31.543386],[120.738017,31.546015],[120.738735,31.546015],[120.739137,31.547162],[120.738983,31.547187],[120.738343,31.547293],[120.738605,31.54802],[120.736992,31.548318],[120.736339,31.546537],[120.733933,31.54733],[120.733971,31.548216],[120.734297,31.549894],[120.735976,31.555152],[120.738642,31.554369],[120.739034,31.555451],[120.736469,31.556309],[120.736628,31.556999],[120.736407,31.557385],[120.736583,31.557975],[120.73787,31.557845],[120.738757,31.558964],[120.740239,31.558535],[120.741256,31.560475],[120.740631,31.561062],[120.740791,31.562776],[120.742155,31.562781],[120.743085,31.562689],[120.743912,31.562232],[120.745651,31.562609],[120.748345,31.562874],[120.750252,31.562238],[120.753878,31.56254],[120.755411,31.562466],[120.758237,31.563526],[120.759447,31.563756],[120.760986,31.564242],[120.761967,31.564323],[120.763337,31.565629],[120.764201,31.566679],[120.765464,31.567318],[120.765403,31.569085],[120.76484,31.571048],[120.763237,31.574935],[120.763373,31.576205],[120.765111,31.576518],[120.767495,31.576825],[120.769898,31.577243],[120.771762,31.577383],[120.773551,31.577717],[120.775488,31.574624],[120.777824,31.571099],[120.77881,31.56868],[120.779394,31.566243],[120.779483,31.564885],[120.782049,31.564783],[120.78766,31.564835],[120.788742,31.564893],[120.789391,31.565115],[120.794245,31.567035],[120.800361,31.567341],[120.804969,31.5677],[120.806787,31.568225],[120.806324,31.570471],[120.805036,31.573002],[120.807055,31.573352],[120.830451,31.578118],[120.833174,31.574008],[120.839507,31.579217],[120.842037,31.58166],[120.842667,31.581412],[120.843262,31.579344],[120.843413,31.579129],[120.84636,31.576771],[120.846894,31.574178],[120.847586,31.572074],[120.854704,31.573351],[120.855436,31.575613],[120.856214,31.57854],[120.856715,31.578477],[120.856566,31.57784],[120.858247,31.578045],[120.858583,31.577784],[120.858517,31.576823],[120.858909,31.576861],[120.859207,31.5766],[120.859273,31.576339],[120.85973,31.576105],[120.860159,31.57452],[120.861175,31.57466],[120.861576,31.574165],[120.862056,31.574168],[120.865889,31.575817],[120.867283,31.576195],[120.868814,31.576338],[120.869158,31.576312],[120.869413,31.57457],[120.869805,31.572747],[120.869808,31.57174],[120.869631,31.569609],[120.869475,31.569034],[120.869791,31.567912],[120.870198,31.567699],[120.872409,31.567071],[120.873169,31.566696],[120.873944,31.566494],[120.874335,31.566233],[120.874476,31.565505],[120.876313,31.564657],[120.876415,31.565505],[120.877676,31.565113],[120.878339,31.564697],[120.87933,31.564518],[120.880704,31.564365],[120.885542,31.564097],[120.886388,31.563858],[120.886237,31.563244],[120.88583,31.562607],[120.885765,31.562293],[120.885573,31.56196],[120.88289,31.560485],[120.881597,31.559964],[120.881165,31.559714],[120.880493,31.55838],[120.880356,31.557815],[120.879796,31.556851],[120.87946,31.55567],[120.879454,31.554944],[120.879725,31.554728],[120.88014,31.553003],[120.880382,31.551654],[120.880652,31.550713],[120.880735,31.550073],[120.881164,31.548285],[120.881348,31.547756],[120.881531,31.546749],[120.88252,31.546786],[120.882542,31.546032],[120.882789,31.545071],[120.883107,31.544616],[120.883679,31.544932],[120.885336,31.544059],[120.885898,31.544702],[120.88678,31.544051],[120.886987,31.544315],[120.888423,31.543572],[120.888396,31.543453],[120.888014,31.543069],[120.887313,31.541864],[120.88886,31.541864],[120.891117,31.541148],[120.892117,31.541085],[120.893863,31.540246],[120.895398,31.539057],[120.893424,31.536217],[120.889645,31.538061],[120.888987,31.537495],[120.8885,31.53757],[120.888025,31.537205],[120.887591,31.53735],[120.886775,31.536467],[120.886577,31.536599],[120.886011,31.535901],[120.882127,31.53735],[120.881555,31.53556]]]]}},{type:"Feature",properties:{id:"27530",name:"常熟虞山尚湖旅游度假区",site:"www.poi86.com"},geometry:{type:"MultiPolygon",coordinates:[[[[120.73031,31.635811],[120.727907,31.633501],[120.725547,31.62968],[120.724391,31.628794],[120.725861,31.627033],[120.726326,31.626967],[120.726528,31.626216],[120.725523,31.626079],[120.724381,31.625394],[120.721959,31.623521],[120.719493,31.621922],[120.716867,31.621628],[120.712866,31.621167],[120.709892,31.620477],[120.705909,31.619947],[120.701041,31.619287],[120.698466,31.618621],[120.69529,31.621071],[120.685801,31.627349],[120.676844,31.633241],[120.672123,31.636338],[120.669904,31.637953],[120.668297,31.639412],[120.66719,31.640735],[120.666064,31.64243],[120.665273,31.644114],[120.66466,31.645807],[120.664218,31.647937],[120.664095,31.649475],[120.664107,31.650511],[120.664299,31.663461],[120.66426,31.669407],[120.664257,31.669661],[120.658852,31.672197],[120.660979,31.674664],[120.669268,31.681368],[120.671057,31.682624],[120.674238,31.684855],[120.674859,31.685007],[120.67815,31.684232],[120.680321,31.683721],[120.678913,31.683521],[120.678287,31.680723],[120.679071,31.680629],[120.678511,31.679743],[120.677196,31.680266],[120.676506,31.67882],[120.677169,31.677244],[120.678679,31.677701],[120.67894,31.676479],[120.676049,31.674604],[120.674463,31.674147],[120.674034,31.671186],[120.674617,31.671033],[120.675424,31.670822],[120.677952,31.669246],[120.679761,31.670626],[120.681869,31.668947],[120.682792,31.66974],[120.684042,31.669311],[120.689106,31.66628],[120.688976,31.665916],[120.689209,31.665329],[120.688351,31.664377],[120.69298,31.660961],[120.694686,31.662806],[120.695266,31.662463],[120.697761,31.660129],[120.69875,31.65983],[120.70069,31.658413],[120.701758,31.658254],[120.707457,31.656939],[120.707697,31.656773],[120.711989,31.653814],[120.716191,31.652434],[120.719941,31.650849],[120.723932,31.650705],[120.72814,31.649378],[120.728416,31.649714],[120.728834,31.649711],[120.729368,31.649465],[120.729765,31.648933],[120.730118,31.648632],[120.729878,31.647629],[120.728057,31.648221],[120.72745,31.647307],[120.728885,31.646667],[120.728634,31.646188],[120.728547,31.645353],[120.728753,31.644543],[120.730023,31.643558],[120.727981,31.641488],[120.726927,31.640798],[120.725286,31.640043],[120.725178,31.63992],[120.723012,31.637442],[120.719263,31.634444],[120.71932,31.634383],[120.722918,31.630565],[120.723934,31.631386],[120.723766,31.631647],[120.724923,31.63257],[120.724521,31.632961],[120.724727,31.633167],[120.724624,31.633363],[120.724923,31.633623],[120.724365,31.634147],[120.724152,31.634091],[120.723991,31.634271],[120.722568,31.633477],[120.722196,31.633859],[120.723528,31.634895],[120.722196,31.63571],[120.72295,31.63641],[120.723795,31.636113],[120.724937,31.635397],[120.725614,31.635207],[120.726391,31.634681],[120.726734,31.634605],[120.729456,31.636775],[120.73031,31.635811]]]]}},{type:"Feature",properties:{id:"27534",name:"虞山林场",site:"www.poi86.com"},geometry:{type:"MultiPolygon",coordinates:[[[[120.717134,31.686087],[120.716575,31.684733],[120.718163,31.684796],[120.71795,31.68178],[120.718742,31.680764],[120.719824,31.682704],[120.719992,31.684644],[120.723073,31.684091],[120.723835,31.683954],[120.7246,31.682406],[120.724628,31.681482],[120.724485,31.680837],[120.723958,31.679414],[120.724672,31.678129],[120.722514,31.677167],[120.72202,31.678043],[120.720284,31.677259],[120.71924,31.676617],[120.718604,31.676127],[120.719867,31.674735],[120.722201,31.672362],[120.722599,31.672515],[120.723467,31.671604],[120.724662,31.671968],[120.724736,31.671786],[120.724377,31.671654],[120.724651,31.670951],[120.723971,31.6705],[120.726035,31.668782],[120.726506,31.668935],[120.726316,31.669392],[120.727001,31.669615],[120.726372,31.670957],[120.727972,31.671528],[120.728553,31.670247],[120.7301,31.670805],[120.730375,31.670169],[120.731633,31.670588],[120.732086,31.669579],[120.73042,31.668952],[120.730517,31.668341],[120.728592,31.667912],[120.728739,31.667533],[120.727707,31.667387],[120.731818,31.66414],[120.732061,31.663948],[120.732816,31.662661],[120.734304,31.662768],[120.734961,31.66184],[120.736277,31.661579],[120.736571,31.660165],[120.733982,31.659952],[120.732535,31.659434],[120.73202,31.659655],[120.731472,31.659655],[120.730299,31.65999],[120.729446,31.66002],[120.729393,31.658827],[120.72937,31.657766],[120.729584,31.656959],[120.730634,31.654325],[120.732345,31.653945],[120.733698,31.655586],[120.734415,31.655907],[120.734896,31.65443],[120.735481,31.653192],[120.736349,31.651025],[120.736818,31.649449],[120.73627,31.649327],[120.734714,31.648255],[120.732204,31.648238],[120.730118,31.648632],[120.729765,31.648933],[120.729368,31.649465],[120.728834,31.649711],[120.728416,31.649714],[120.72814,31.649378],[120.723932,31.650705],[120.719941,31.650849],[120.716191,31.652434],[120.711989,31.653814],[120.707697,31.656773],[120.707457,31.656939],[120.701758,31.658254],[120.70069,31.658413],[120.69875,31.65983],[120.697761,31.660129],[120.695266,31.662463],[120.694686,31.662806],[120.69298,31.660961],[120.688351,31.664377],[120.689209,31.665329],[120.688976,31.665916],[120.689106,31.66628],[120.684042,31.669311],[120.682792,31.66974],[120.681869,31.668947],[120.679761,31.670626],[120.677952,31.669246],[120.675424,31.670822],[120.674617,31.671033],[120.674034,31.671186],[120.674463,31.674147],[120.676049,31.674604],[120.67894,31.676479],[120.678679,31.677701],[120.677169,31.677244],[120.676506,31.67882],[120.677196,31.680266],[120.678511,31.679743],[120.679071,31.680629],[120.678287,31.680723],[120.678913,31.683521],[120.680321,31.683721],[120.67815,31.684232],[120.674859,31.685007],[120.674734,31.685036],[120.68477,31.69089],[120.685869,31.68969],[120.691019,31.690725],[120.696811,31.688496],[120.699547,31.686894],[120.700029,31.686612],[120.705233,31.684644],[120.707722,31.68423],[120.708728,31.683431],[120.714432,31.679921],[120.715927,31.678862],[120.716009,31.67906],[120.716167,31.679137],[120.71618,31.67942],[120.716924,31.680726],[120.715049,31.681417],[120.715551,31.682478],[120.716668,31.682277],[120.716797,31.682827],[120.716067,31.682951],[120.71664,31.684267],[120.716638,31.684568],[120.714719,31.684522],[120.715592,31.686607],[120.717134,31.686087]]]]}},{type:"Feature",properties:{id:"27535",name:"江苏省常熟高新技术产业开发区",site:"www.poi86.com"},geometry:{type:"MultiPolygon",coordinates:[[[[120.80097,31.630286],[120.803847,31.629194],[120.808769,31.627552],[120.81165,31.626997],[120.824604,31.626314],[120.824822,31.626253],[120.826323,31.625829],[120.828452,31.624728],[120.840253,31.618296],[120.843684,31.616356],[120.84503,31.617705],[120.845506,31.617443],[120.84653,31.616553],[120.84735,31.615406],[120.847793,31.614218],[120.845107,31.612254],[120.845877,31.611129],[120.848874,31.608545],[120.850851,31.607348],[120.852709,31.606293],[120.855951,31.604668],[120.858858,31.603064],[120.859258,31.602966],[120.861447,31.600852],[120.861301,31.599554],[120.863428,31.598013],[120.862254,31.596475],[120.86087,31.593945],[120.859352,31.590757],[120.858211,31.58707],[120.857607,31.584317],[120.856998,31.579695],[120.856715,31.578477],[120.856214,31.57854],[120.855436,31.575613],[120.854704,31.573351],[120.847586,31.572074],[120.846894,31.574178],[120.84636,31.576771],[120.843413,31.579129],[120.843262,31.579344],[120.842667,31.581412],[120.842037,31.58166],[120.839507,31.579217],[120.833174,31.574008],[120.830451,31.578118],[120.807055,31.573352],[120.805036,31.573002],[120.806324,31.570471],[120.806787,31.568225],[120.804969,31.5677],[120.800361,31.567341],[120.794245,31.567035],[120.789391,31.565115],[120.788742,31.564893],[120.78766,31.564835],[120.782049,31.564783],[120.779483,31.564885],[120.779394,31.566243],[120.77881,31.56868],[120.777824,31.571099],[120.775488,31.574624],[120.773551,31.577717],[120.771762,31.577383],[120.769898,31.577243],[120.767495,31.576825],[120.765111,31.576518],[120.763373,31.576205],[120.763237,31.574935],[120.76484,31.571048],[120.765403,31.569085],[120.765464,31.567318],[120.764201,31.566679],[120.763337,31.565629],[120.761967,31.564323],[120.760986,31.564242],[120.759447,31.563756],[120.758237,31.563526],[120.755411,31.562466],[120.753878,31.56254],[120.750252,31.562238],[120.748345,31.562874],[120.745651,31.562609],[120.743912,31.562232],[120.743085,31.562689],[120.742155,31.562781],[120.740791,31.562776],[120.738679,31.563918],[120.735937,31.565917],[120.731772,31.568441],[120.724668,31.568815],[120.723145,31.569401],[120.72206,31.571913],[120.721338,31.576997],[120.721101,31.578547],[120.723984,31.577719],[120.726553,31.578254],[120.727983,31.579319],[120.73024,31.584341],[120.731991,31.586245],[120.733602,31.590207],[120.733819,31.590737],[120.733742,31.594544],[120.733577,31.59798],[120.73376,31.599762],[120.733349,31.602046],[120.734016,31.604389],[120.736273,31.604833],[120.737461,31.606341],[120.736547,31.60762],[120.738877,31.610955],[120.737278,31.612508],[120.739151,31.614473],[120.747785,31.616665],[120.749099,31.616232],[120.752125,31.616632],[120.754067,31.616432],[120.755789,31.61658],[120.758998,31.613904],[120.76176,31.610585],[120.762938,31.609215],[120.764241,31.608274],[120.765561,31.60768],[120.766944,31.607758],[120.767874,31.608221],[120.769252,31.608638],[120.772165,31.608723],[120.778755,31.609211],[120.780096,31.609699],[120.781162,31.610475],[120.782657,31.612682],[120.783403,31.613565],[120.784454,31.615271],[120.787085,31.618447],[120.78817,31.618806],[120.790483,31.618977],[120.795108,31.618806],[120.795149,31.620569],[120.795728,31.622577],[120.796758,31.625522],[120.798649,31.631053],[120.80097,31.630286]]]]}},{type:"Feature",properties:{id:"26913",name:"常熟经济技术开发区",site:"www.poi86.com"},geometry:{type:"MultiPolygon",coordinates:[[[[120.937024,31.801115],[120.938748,31.800559],[120.978421,31.791935],[120.987047,31.789879],[120.997448,31.787378],[121.002737,31.785458],[121.006037,31.785438],[121.009668,31.785809],[121.010247,31.785868],[121.028638,31.785839],[121.034407,31.785828],[121.054917,31.786287],[121.063747,31.785337],[121.067567,31.784447],[121.078097,31.779807],[121.087022,31.774079],[121.102042,31.763334],[121.080792,31.749975],[121.072256,31.737076],[121.062901,31.726103],[121.061303,31.725516],[121.059438,31.725472],[121.055628,31.726219],[121.053193,31.726172],[121.051319,31.725357],[121.049676,31.724235],[121.036754,31.710893],[121.003192,31.729458],[121.003152,31.729479],[120.988831,31.737312],[120.987332,31.738132],[120.98102,31.741581],[120.97729,31.737373],[120.970554,31.730509],[120.963788,31.73486],[120.959536,31.737485],[120.958594,31.738061],[120.953675,31.741062],[120.950996,31.742885],[120.948152,31.744606],[120.950025,31.746919],[120.951614,31.748696],[120.952493,31.749286],[120.947611,31.74974],[120.943596,31.749621],[120.941165,31.748761],[120.937063,31.744946],[120.929636,31.739833],[120.924768,31.735959],[120.919999,31.732019],[120.91815,31.730369],[120.914848,31.732308],[120.908934,31.735632],[120.908694,31.735767],[120.914513,31.742225],[120.915738,31.741579],[120.91951,31.744343],[120.919966,31.744726],[120.920931,31.745801],[120.924618,31.743372],[120.931255,31.750947],[120.928296,31.752958],[120.926291,31.754534],[120.92607,31.754855],[120.925993,31.754968],[120.934487,31.765289],[120.935992,31.801448],[120.937024,31.801115]]]]}},{type:"Feature",properties:{id:"10711",name:"江苏常熟服装城",site:"www.poi86.com"},geometry:{type:"MultiPolygon",coordinates:[[[[120.7407,31.616103],[120.738532,31.615697],[120.734278,31.615206],[120.733975,31.615526],[120.730959,31.619957],[120.726528,31.626216],[120.726326,31.626967],[120.729831,31.62936],[120.730871,31.631012],[120.731704,31.631821],[120.733334,31.634191],[120.734155,31.634177],[120.738018,31.634533],[120.73958,31.6347],[120.740675,31.634938],[120.741188,31.635113],[120.741444,31.635532],[120.741711,31.635666],[120.742577,31.635856],[120.745956,31.636133],[120.746318,31.634761],[120.746685,31.6329],[120.746878,31.629983],[120.747148,31.628105],[120.749812,31.628036],[120.749625,31.623747],[120.74826,31.623678],[120.748574,31.622878],[120.748974,31.622136],[120.749888,31.62165],[120.749043,31.62174],[120.748304,31.621345],[120.748081,31.620933],[120.74693,31.620503],[120.746552,31.619902],[120.74758,31.617281],[120.7407,31.616103]]]]}},{type:"Feature",properties:{id:"37788",name:"尚湖镇",site:"www.poi86.com"},geometry:{type:"MultiPolygon",coordinates:[[[[120.688503,31.609855],[120.686988,31.608085],[120.682305,31.603716],[120.679461,31.600788],[120.670767,31.602776],[120.66882,31.603481],[120.667767,31.601389],[120.666778,31.601704],[120.666088,31.601834],[120.664615,31.602598],[120.66454,31.601769],[120.663132,31.601144],[120.663981,31.599466],[120.66372,31.599177],[120.662703,31.599177],[120.661845,31.599569],[120.660568,31.599699],[120.659467,31.598909],[120.659017,31.598844],[120.657864,31.59914],[120.657286,31.598729],[120.656037,31.59844],[120.654255,31.598375],[120.652397,31.598205],[120.651556,31.5974],[120.649974,31.595582],[120.648811,31.594704],[120.647397,31.594001],[120.6448,31.59341],[120.641857,31.593555],[120.641275,31.59348],[120.631656,31.592356],[120.628307,31.59321],[120.626824,31.593965],[120.625677,31.594888],[120.624624,31.595112],[120.622321,31.595317],[120.621761,31.595671],[120.620642,31.597126],[120.619267,31.597914],[120.619528,31.598697],[120.619193,31.59976],[120.618668,31.60041],[120.617696,31.601459],[120.614396,31.604562],[120.613207,31.606313],[120.608577,31.612972],[120.607487,31.614809],[120.60578,31.61672],[120.601836,31.616459],[120.601239,31.616124],[120.599598,31.616124],[120.599496,31.616329],[120.599094,31.616426],[120.599036,31.616439],[120.597323,31.616851],[120.59558,31.61741],[120.594621,31.617613],[120.594744,31.618022],[120.594745,31.618892],[120.594574,31.619092],[120.593354,31.619802],[120.593294,31.620052],[120.592814,31.620332],[120.593115,31.620922],[120.593304,31.620832],[120.593384,31.620992],[120.593634,31.620862],[120.594114,31.622192],[120.593304,31.622402],[120.593295,31.622702],[120.593054,31.622742],[120.593034,31.623292],[120.592854,31.623352],[120.593034,31.624022],[120.591424,31.624952],[120.588325,31.627172],[120.586344,31.628462],[120.585685,31.628742],[120.584284,31.628752],[120.584414,31.629162],[120.584275,31.629212],[120.584534,31.629932],[120.585065,31.630652],[120.585004,31.630742],[120.585944,31.632052],[120.587374,31.631272],[120.587604,31.631532],[120.587814,31.631422],[120.587945,31.631552],[120.588195,31.631402],[120.588004,31.631112],[120.588774,31.630642],[120.589065,31.631152],[120.589035,31.631272],[120.589464,31.631962],[120.589594,31.631922],[120.589665,31.631752],[120.589864,31.631612],[120.590185,31.632142],[120.590305,31.632232],[120.589984,31.632532],[120.590995,31.634072],[120.587045,31.636792],[120.585037,31.638933],[120.584665,31.639432],[120.585935,31.640462],[120.586415,31.640012],[120.586845,31.639762],[120.588175,31.640782],[120.587875,31.641142],[120.587614,31.641292],[120.586935,31.640902],[120.586835,31.640932],[120.587235,31.641692],[120.587605,31.642692],[120.587775,31.643702],[120.588204,31.643782],[120.588835,31.643092],[120.589955,31.642872],[120.590245,31.643212],[120.590755,31.644112],[120.590555,31.644242],[120.590625,31.644462],[120.590355,31.645072],[120.590395,31.645132],[120.591725,31.644772],[120.591825,31.645392],[120.591625,31.645472],[120.591895,31.646142],[120.592804,31.645802],[120.593135,31.646644],[120.593205,31.646822],[120.589035,31.650052],[120.588435,31.653652],[120.588315,31.654152],[120.588245,31.654169],[120.587585,31.654332],[120.586435,31.654772],[120.585685,31.654952],[120.585445,31.653782],[120.585285,31.653702],[120.582335,31.654362],[120.581024,31.652202],[120.578595,31.652622],[120.577995,31.654052],[120.577385,31.653972],[120.577455,31.653262],[120.572355,31.656642],[120.572245,31.655612],[120.571105,31.656162],[120.570535,31.656542],[120.570275,31.656142],[120.569895,31.656262],[120.569515,31.655862],[120.567305,31.657622],[120.566295,31.657042],[120.565805,31.657662],[120.565235,31.658222],[120.565135,31.658142],[120.565195,31.658062],[120.565245,31.657402],[120.565025,31.657262],[120.564945,31.657602],[120.564965,31.658182],[120.564285,31.657872],[120.563745,31.657762],[120.562825,31.657832],[120.561765,31.658202],[120.561985,31.658652],[120.562215,31.659412],[120.561515,31.659552],[120.561145,31.658562],[120.560895,31.658712],[120.560835,31.658452],[120.560055,31.658492],[120.560005,31.657782],[120.558935,31.657772],[120.558865,31.656732],[120.559465,31.656732],[120.559475,31.656162],[120.558005,31.656212],[120.557493,31.656103],[120.557185,31.655732],[120.557075,31.655402],[120.556695,31.655562],[120.556265,31.655382],[120.555565,31.655882],[120.554995,31.655482],[120.553704,31.656622],[120.553175,31.657352],[120.552185,31.658382],[120.552995,31.658952],[120.552375,31.659652],[120.552915,31.660002],[120.552315,31.660682],[120.552735,31.660943],[120.552722,31.661202],[120.553185,31.661512],[120.553535,31.661232],[120.553365,31.661042],[120.553515,31.660782],[120.553585,31.660782],[120.554315,31.661402],[120.554455,31.661062],[120.555075,31.661662],[120.555685,31.661192],[120.556055,31.661402],[120.556575,31.660982],[120.557035,31.661352],[120.557495,31.661012],[120.558135,31.661582],[120.558615,31.661202],[120.559455,31.662372],[120.560105,31.662272],[120.560445,31.663032],[120.561435,31.662972],[120.562015,31.662862],[120.564295,31.661782],[120.564745,31.661732],[120.564845,31.661832],[120.564825,31.662812],[120.564385,31.665032],[120.564955,31.665382],[120.564265,31.666622],[120.563935,31.667702],[120.564045,31.669062],[120.564195,31.669702],[120.564165,31.669792],[120.563525,31.669792],[120.563445,31.670412],[120.564025,31.670462],[120.564115,31.670062],[120.564365,31.670042],[120.564525,31.670692],[120.563035,31.670652],[120.562305,31.671622],[120.562845,31.671702],[120.562845,31.672192],[120.563655,31.672322],[120.562695,31.673842],[120.562735,31.673982],[120.562925,31.674092],[120.562915,31.674232],[120.563745,31.674642],[120.564925,31.674422],[120.565185,31.675222],[120.565145,31.675292],[120.564105,31.675502],[120.563425,31.675362],[120.563375,31.675492],[120.563485,31.676452],[120.562935,31.676632],[120.563095,31.677692],[120.562135,31.678242],[120.562695,31.679422],[120.562325,31.679592],[120.562365,31.679662],[120.562125,31.679782],[120.562135,31.680412],[120.562285,31.680472],[120.562382,31.680772],[120.560775,31.681112],[120.559675,31.680592],[120.559545,31.680742],[120.559915,31.681002],[120.559395,31.682402],[120.559125,31.682542],[120.558735,31.682522],[120.558605,31.682602],[120.55877,31.682771],[120.559075,31.683032],[120.559145,31.683282],[120.559276,31.683412],[120.559895,31.683392],[120.560076,31.683502],[120.560615,31.683932],[120.561845,31.685212],[120.561965,31.686242],[120.561986,31.687492],[120.562605,31.687362],[120.563805,31.687302],[120.563815,31.687892],[120.563566,31.687962],[120.563935,31.689232],[120.564075,31.689292],[120.564935,31.688892],[120.565395,31.689482],[120.566265,31.690352],[120.566155,31.690632],[120.565815,31.691012],[120.565875,31.691072],[120.566415,31.691392],[120.568175,31.691802],[120.572616,31.691572],[120.572645,31.692012],[120.572385,31.692102],[120.572336,31.691922],[120.572155,31.691932],[120.572155,31.692132],[120.571916,31.692162],[120.571896,31.692592],[120.571465,31.692642],[120.571465,31.693052],[120.571586,31.693062],[120.571595,31.693272],[120.571085,31.693362],[120.571025,31.693612],[120.571245,31.693622],[120.571365,31.693932],[120.572445,31.693202],[120.573305,31.692362],[120.573815,31.692142],[120.574146,31.692062],[120.574172,31.692121],[120.574575,31.693592],[120.574055,31.693772],[120.574246,31.694722],[120.573715,31.694832],[120.573746,31.695682],[120.573786,31.695812],[120.573891,31.695818],[120.576115,31.695402],[120.580706,31.694932],[120.580925,31.695712],[120.581296,31.695692],[120.582215,31.697492],[120.582435,31.697512],[120.582815,31.698292],[120.582995,31.698352],[120.583966,31.698052],[120.584106,31.698142],[120.584865,31.699512],[120.584856,31.699592],[120.584105,31.699872],[120.584186,31.700082],[120.585015,31.700012],[120.585165,31.700482],[120.583775,31.701082],[120.584016,31.701472],[120.585616,31.700992],[120.587176,31.702402],[120.587315,31.702452],[120.587646,31.702252],[120.587775,31.702282],[120.588595,31.702942],[120.589695,31.704412],[120.589626,31.704782],[120.590956,31.706842],[120.591085,31.707172],[120.591526,31.707732],[120.591956,31.707832],[120.592015,31.707662],[120.591606,31.707472],[120.591526,31.707192],[120.592296,31.707352],[120.592275,31.707752],[120.593616,31.708132],[120.593805,31.708442],[120.593816,31.708692],[120.59515,31.708986],[120.596385,31.709152],[120.596786,31.709282],[120.596866,31.709762],[120.597235,31.710072],[120.5972,31.710237],[120.596976,31.710462],[120.596965,31.711042],[120.596856,31.711172],[120.595595,31.711832],[120.596006,31.712532],[120.595975,31.712672],[120.595586,31.713042],[120.594895,31.713452],[120.591766,31.714362],[120.591326,31.714352],[120.589585,31.713452],[120.589356,31.713442],[120.588325,31.713702],[120.588286,31.713762],[120.588516,31.714272],[120.588216,31.714412],[120.588226,31.714462],[120.588486,31.715162],[120.588726,31.715572],[120.587806,31.717402],[120.587686,31.717502],[120.586726,31.717152],[120.586346,31.717092],[120.586266,31.716922],[120.586156,31.716902],[120.585826,31.717032],[120.585456,31.717052],[120.583686,31.717522],[120.583556,31.717462],[120.582025,31.715642],[120.580226,31.715752],[120.579696,31.715672],[120.579576,31.715532],[120.579286,31.714722],[120.579126,31.714472],[120.578835,31.714412],[120.578826,31.714492],[120.578866,31.714762],[120.578565,31.714862],[120.578636,31.715512],[120.578356,31.715552],[120.578445,31.715922],[120.578016,31.716022],[120.578096,31.717182],[120.578146,31.717252],[120.578646,31.717272],[120.578676,31.716882],[120.579186,31.716872],[120.579266,31.716782],[120.579316,31.716172],[120.579536,31.716132],[120.579465,31.716682],[120.579666,31.717052],[120.579585,31.719812],[120.579816,31.720222],[120.579006,31.720572],[120.578686,31.720502],[120.578296,31.720592],[120.578216,31.720712],[120.578336,31.721082],[120.578266,31.721172],[120.577656,31.721422],[120.577406,31.721772],[120.577366,31.721912],[120.577516,31.723232],[120.576796,31.723292],[120.576746,31.723352],[120.576806,31.724002],[120.576916,31.724082],[120.576916,31.724412],[120.576676,31.724572],[120.576586,31.724742],[120.576496,31.725672],[120.576526,31.726012],[120.576626,31.726132],[120.577426,31.726362],[120.577586,31.726532],[120.577636,31.726652],[120.577576,31.726922],[120.577276,31.727132],[120.576346,31.727212],[120.576026,31.727302],[120.575874,31.727444],[120.575806,31.727632],[120.576056,31.728072],[120.576036,31.728242],[120.575845,31.728492],[120.575446,31.728762],[120.574869,31.728979],[120.574816,31.729032],[120.574872,31.729078],[120.575336,31.729342],[120.578016,31.729902],[120.578515,31.730132],[120.578936,31.730062],[120.579136,31.730102],[120.579166,31.730242],[120.578746,31.730462],[120.578666,31.730572],[120.579176,31.731392],[120.578986,31.731542],[120.579016,31.731612],[120.579256,31.731912],[120.579896,31.731632],[120.580036,31.731632],[120.580356,31.732272],[120.580316,31.732342],[120.579416,31.732692],[120.579696,31.733372],[120.579726,31.733612],[120.579666,31.733722],[120.579846,31.733872],[120.579806,31.734002],[120.579566,31.734072],[120.579166,31.733752],[120.578896,31.733852],[120.578896,31.734012],[120.579776,31.734742],[120.579816,31.734852],[120.579416,31.735332],[120.579366,31.735562],[120.579106,31.735822],[120.579226,31.736582],[120.579586,31.736682],[120.579586,31.737122],[120.579696,31.737272],[120.580876,31.736932],[120.581466,31.737462],[120.581816,31.737652],[120.582546,31.738412],[120.582566,31.738512],[120.582026,31.738712],[120.581886,31.738882],[120.581966,31.739052],[120.582166,31.739082],[120.583276,31.738692],[120.584836,31.737892],[120.584986,31.737692],[120.585166,31.737692],[120.585636,31.738082],[120.586656,31.738092],[120.586876,31.738222],[120.587606,31.739012],[120.587896,31.739852],[120.588056,31.739912],[120.588766,31.739872],[120.588756,31.740162],[120.589916,31.740232],[120.590076,31.740292],[120.590236,31.740512],[120.590636,31.740552],[120.590506,31.739987],[120.591072,31.739763],[120.590966,31.739238],[120.591689,31.738936],[120.591229,31.737661],[120.592478,31.737293],[120.592149,31.736833],[120.593108,31.736413],[120.592517,31.735099],[120.593056,31.735015],[120.595303,31.734665],[120.595408,31.735033],[120.596222,31.734836],[120.596485,31.735519],[120.597865,31.734928],[120.600204,31.734731],[120.60023,31.73523],[120.599771,31.735256],[120.600007,31.736439],[120.601282,31.736347],[120.601282,31.737162],[120.602136,31.73703],[120.602044,31.735953],[120.602924,31.735585],[120.604212,31.735361],[120.604475,31.734271],[120.605805,31.734049],[120.606209,31.733981],[120.605749,31.732825],[120.606538,31.732536],[120.606407,31.732234],[120.607195,31.731288],[120.607721,31.731182],[120.607392,31.730328],[120.608115,31.730394],[120.608667,31.731643],[120.608864,31.731117],[120.60956,31.73138],[120.609718,31.731091],[120.611202,31.731616],[120.611334,31.731182],[120.610178,31.730696],[120.610743,31.729711],[120.610809,31.729251],[120.611689,31.72908],[120.611558,31.728292],[120.6137,31.728002],[120.613463,31.726846],[120.615539,31.72636],[120.615434,31.726031],[120.617642,31.725663],[120.617773,31.726255],[120.618457,31.72636],[120.618588,31.725729],[120.619179,31.725795],[120.619245,31.726162],[120.619744,31.726058],[120.619704,31.725506],[120.620467,31.725308],[120.620624,31.726097],[120.621452,31.725992],[120.621518,31.726951],[120.621978,31.726649],[120.622005,31.725965],[120.622307,31.725992],[120.622727,31.725861],[120.622596,31.725598],[120.622963,31.725466],[120.622661,31.724743],[120.623449,31.72452],[120.623647,31.724783],[120.625394,31.724323],[120.624935,31.723692],[120.626314,31.723535],[120.626286,31.722802],[120.626281,31.722686],[120.626767,31.722713],[120.626872,31.722161],[120.628411,31.722581],[120.629068,31.722292],[120.62966,31.722752],[120.630251,31.722621],[120.630422,31.722778],[120.632157,31.722318],[120.633249,31.723606],[120.634169,31.723212],[120.63384,31.722581],[120.63413,31.722384],[120.63384,31.721858],[120.635009,31.721279],[120.634193,31.720334],[120.634958,31.720362],[120.634958,31.719839],[120.634622,31.719737],[120.634128,31.718492],[120.634035,31.717009],[120.633568,31.716813],[120.631758,31.717102],[120.631927,31.716151],[120.632458,31.716123],[120.632225,31.714602],[120.633736,31.714276],[120.633773,31.714808],[120.635909,31.714472],[120.635582,31.711749],[120.639957,31.710424],[120.639891,31.709244],[120.640479,31.709207],[120.640574,31.708802],[120.640647,31.708489],[120.641664,31.708256],[120.641701,31.706679],[120.639891,31.707099],[120.639695,31.705196],[120.63824,31.705327],[120.638511,31.704441],[120.638511,31.703349],[120.639266,31.702296],[120.639789,31.700393],[120.640973,31.70023],[120.642484,31.697395],[120.642624,31.695361],[120.642456,31.694932],[120.639891,31.694531],[120.642717,31.689434],[120.641598,31.686701],[120.643183,31.685386],[120.64314,31.685302],[120.641933,31.682952],[120.640451,31.683474],[120.640189,31.683082],[120.637849,31.683838],[120.637783,31.683185],[120.637159,31.683251],[120.636725,31.682646],[120.637778,31.682092],[120.637326,31.681441],[120.636533,31.681469],[120.636496,31.681273],[120.636142,31.681311],[120.635349,31.680583],[120.63617,31.680191],[120.635675,31.679399],[120.635871,31.67854],[120.634972,31.675669],[120.63479,31.675085],[120.636759,31.673433],[120.641103,31.669787],[120.643654,31.669992],[120.649381,31.670972],[120.655499,31.670813],[120.656219,31.6705],[120.656721,31.670281],[120.658661,31.672287],[120.658852,31.672197],[120.664257,31.669661],[120.66426,31.669407],[120.664299,31.663461],[120.664107,31.650511],[120.664095,31.649475],[120.664218,31.647937],[120.66466,31.645807],[120.665273,31.644114],[120.666064,31.64243],[120.66719,31.640735],[120.668297,31.639412],[120.669904,31.637953],[120.672123,31.636338],[120.676844,31.633241],[120.685801,31.627349],[120.69529,31.621071],[120.698466,31.618621],[120.697295,31.617593],[120.695601,31.616258],[120.689871,31.611454],[120.689404,31.610907],[120.688503,31.609855]]]]}},{type:"Feature",properties:{id:"37789",name:"碧溪街道",site:"www.poi86.com"},geometry:{type:"MultiPolygon",coordinates:[[[[120.950996,31.742885],[120.953675,31.741062],[120.958594,31.738061],[120.959536,31.737485],[120.963788,31.73486],[120.970554,31.730509],[120.97729,31.737373],[120.98102,31.741581],[120.987332,31.738132],[120.988831,31.737312],[121.003152,31.729479],[121.003192,31.729458],[121.036754,31.710893],[121.049676,31.724235],[121.051319,31.725357],[121.053193,31.726172],[121.055628,31.726219],[121.059438,31.725472],[121.061303,31.725516],[121.062901,31.726103],[121.072256,31.737076],[121.065161,31.726356],[121.060819,31.724793],[121.060819,31.723491],[121.057954,31.721754],[121.055609,31.718715],[121.055349,31.715675],[121.053004,31.713331],[121.052744,31.711768],[121.051268,31.708989],[121.04976,31.704968],[121.04538,31.696016],[121.044929,31.695096],[121.045623,31.694835],[121.047794,31.695096],[121.04953,31.692491],[121.051441,31.689191],[121.048006,31.684039],[121.047968,31.683981],[121.046926,31.683981],[121.043886,31.685718],[121.04215,31.686413],[121.041281,31.685978],[121.039544,31.682679],[121.037309,31.679847],[121.035637,31.677729],[121.028864,31.670956],[121.025976,31.67267],[121.02508,31.671854],[121.024198,31.671814],[121.024132,31.671327],[121.02387,31.670761],[121.023303,31.670669],[121.023039,31.670274],[121.022224,31.670103],[121.020875,31.669219],[121.020209,31.669023],[121.020067,31.668429],[121.017146,31.670614],[121.01584,31.671266],[121.015896,31.672124],[121.014724,31.672964],[121.014084,31.671854],[121.01361,31.671419],[121.010695,31.670201],[121.010249,31.670272],[121.010925,31.672489],[121.011367,31.674597],[121.011827,31.675891],[121.011293,31.676187],[121.011354,31.676345],[121.011542,31.676462],[121.011665,31.676677],[121.011591,31.676928],[121.011428,31.677066],[121.01033,31.677698],[121.01003,31.677757],[121.009164,31.677645],[121.008945,31.677736],[121.008499,31.678077],[121.008448,31.678178],[121.008511,31.67853],[121.008344,31.678821],[121.007798,31.67875],[121.007649,31.678829],[121.007457,31.679093],[121.007168,31.679188],[121.006704,31.6792],[121.006758,31.679603],[121.006709,31.679849],[121.006051,31.679736],[121.005599,31.679185],[121.004963,31.679673],[121.004173,31.680121],[121.003912,31.680436],[121.003853,31.680724],[121.003688,31.680771],[121.003483,31.680321],[121.00336,31.680243],[121.002262,31.680416],[121.001679,31.680055],[121.001573,31.680131],[121.001463,31.680503],[121.001528,31.680629],[121.001784,31.68072],[121.001855,31.680947],[121.001276,31.681248],[121.000636,31.68118],[120.999869,31.681545],[120.999802,31.681709],[121.000018,31.682281],[120.999947,31.682378],[120.999594,31.682392],[120.999246,31.682225],[120.998861,31.681816],[120.998411,31.68186],[120.998153,31.682228],[120.99796,31.682319],[120.997554,31.682325],[120.997422,31.682409],[120.997145,31.682716],[120.997223,31.683197],[120.997025,31.683314],[120.996843,31.683574],[120.996503,31.683655],[120.99618,31.68344],[120.99593,31.683608],[120.995317,31.683742],[120.995205,31.684144],[120.995124,31.684274],[120.994967,31.68434],[120.994492,31.68429],[120.994028,31.684474],[120.993571,31.684523],[120.993392,31.684891],[120.993457,31.685038],[120.993969,31.685193],[120.993952,31.685353],[120.993592,31.685528],[120.993614,31.685826],[120.99349,31.685973],[120.99325,31.685961],[120.992634,31.685759],[120.992446,31.685827],[120.992159,31.686091],[120.991878,31.686082],[120.99158,31.686171],[120.991421,31.686349],[120.991592,31.686749],[120.99156,31.686919],[120.990895,31.687517],[120.990631,31.687503],[120.990377,31.687337],[120.989711,31.687216],[120.989458,31.687401],[120.989092,31.687911],[120.98955,31.688332],[120.989463,31.688465],[120.988609,31.688948],[120.988328,31.689214],[120.987996,31.689376],[120.987825,31.689571],[120.987573,31.689656],[120.987049,31.68952],[120.986373,31.689814],[120.985744,31.690514],[120.98548,31.690593],[120.985312,31.690778],[120.985505,31.691207],[120.985499,31.691482],[120.985346,31.691631],[120.985189,31.691678],[120.984965,31.69162],[120.983777,31.692176],[120.983344,31.69254],[120.983144,31.692618],[120.982302,31.692907],[120.981986,31.693111],[120.981731,31.693454],[120.981061,31.693707],[120.980902,31.693852],[120.980853,31.694044],[120.980754,31.694306],[120.980553,31.694289],[120.978448,31.691293],[120.97393,31.693547],[120.972685,31.691958],[120.970722,31.693305],[120.969177,31.691334],[120.96953,31.691099],[120.969215,31.690698],[120.96716,31.692009],[120.964862,31.693694],[120.966319,31.695358],[120.966894,31.695912],[120.968173,31.697669],[120.968209,31.697824],[120.967961,31.698171],[120.965808,31.69949],[120.966112,31.699927],[120.966656,31.700448],[120.966604,31.700623],[120.966222,31.700975],[120.96554,31.701264],[120.965115,31.701582],[120.965052,31.701277],[120.964269,31.700363],[120.963803,31.700885],[120.963076,31.700028],[120.962899,31.699932],[120.96189,31.700755],[120.961304,31.700755],[120.959978,31.701705],[120.961718,31.703262],[120.962407,31.703757],[120.963249,31.704542],[120.963505,31.704879],[120.964401,31.70563],[120.965013,31.706347],[120.966297,31.707223],[120.965813,31.707574],[120.965545,31.707541],[120.963629,31.708059],[120.961927,31.708958],[120.960252,31.710111],[120.958684,31.710147],[120.957102,31.710431],[120.956078,31.710986],[120.954496,31.711691],[120.953039,31.711687],[120.952533,31.711811],[120.952339,31.711945],[120.95232,31.712284],[120.952018,31.712711],[120.951888,31.713118],[120.95156,31.713316],[120.951359,31.713332],[120.950949,31.713106],[120.949086,31.711039],[120.949852,31.710594],[120.948311,31.70885],[120.94918,31.708175],[120.9477,31.706473],[120.947434,31.706964],[120.946983,31.70631],[120.94588,31.707555],[120.945757,31.708062],[120.944531,31.70945],[120.943188,31.708587],[120.943635,31.708177],[120.942125,31.706275],[120.942908,31.705016],[120.943766,31.702909],[120.943965,31.702573],[120.943805,31.702504],[120.943382,31.702282],[120.943183,31.701939],[120.942296,31.70145],[120.94064,31.701047],[120.940126,31.701017],[120.939304,31.700833],[120.938582,31.701809],[120.937463,31.701398],[120.93515,31.701137],[120.934041,31.701384],[120.933852,31.701205],[120.934522,31.70039],[120.93458,31.700142],[120.934483,31.699985],[120.9339,31.699713],[120.933436,31.699597],[120.932883,31.699577],[120.932265,31.699691],[120.932063,31.699632],[120.93207,31.699346],[120.931295,31.69897],[120.931072,31.69853],[120.9304,31.697951],[120.930474,31.697912],[120.932596,31.696793],[120.931738,31.695282],[120.929892,31.692727],[120.931064,31.69197],[120.930846,31.69163],[120.93042,31.691234],[120.930078,31.690653],[120.929556,31.689427],[120.929212,31.689186],[120.925229,31.691991],[120.924689,31.692466],[120.924092,31.692205],[120.923514,31.692261],[120.923311,31.692099],[120.922973,31.692205],[120.922842,31.691608],[120.922395,31.691795],[120.922266,31.692389],[120.92203,31.692437],[120.922033,31.692755],[120.920777,31.693065],[120.921091,31.693523],[120.920418,31.693772],[120.920048,31.69303],[120.919975,31.693035],[120.919504,31.693455],[120.919922,31.69382],[120.919447,31.693985],[120.919062,31.693237],[120.918617,31.691549],[120.917355,31.691631],[120.916302,31.691789],[120.916073,31.691402],[120.916119,31.691109],[120.916041,31.690886],[120.915847,31.690742],[120.915317,31.691217],[120.914564,31.691497],[120.914297,31.691428],[120.91255,31.692046],[120.915919,31.697548],[120.915274,31.697811],[120.915026,31.697612],[120.91278,31.698497],[120.913858,31.700283],[120.910835,31.702079],[120.908071,31.703423],[120.907562,31.704864],[120.907401,31.705593],[120.907159,31.705702],[120.905923,31.705717],[120.905736,31.705784],[120.90463,31.706889],[120.904117,31.707281],[120.903711,31.707182],[120.903444,31.70691],[120.902973,31.706609],[120.90261,31.706564],[120.902138,31.706776],[120.901821,31.707177],[120.901397,31.707372],[120.900754,31.707293],[120.900176,31.707338],[120.899355,31.707636],[120.898595,31.707714],[120.897952,31.707623],[120.897374,31.707692],[120.896693,31.707936],[120.896239,31.707915],[120.895588,31.70777],[120.894906,31.707864],[120.892407,31.707835],[120.892284,31.707286],[120.891979,31.706794],[120.891101,31.706949],[120.891383,31.707825],[120.891731,31.707829],[120.892501,31.708902],[120.892235,31.709494],[120.891458,31.710668],[120.891447,31.711068],[120.891584,31.711479],[120.891761,31.711716],[120.891851,31.713117],[120.892102,31.713625],[120.892625,31.713703],[120.893077,31.713562],[120.894128,31.713394],[120.894694,31.713479],[120.89522,31.713672],[120.895599,31.713926],[120.896248,31.714644],[120.897042,31.715228],[120.897226,31.715484],[120.897433,31.716759],[120.897689,31.71724],[120.898874,31.718817],[120.896986,31.719577],[120.896278,31.718503],[120.894326,31.719459],[120.893872,31.71874],[120.891923,31.719899],[120.890372,31.721175],[120.890669,31.721572],[120.889892,31.722055],[120.888848,31.723148],[120.888389,31.722525],[120.887733,31.722613],[120.886183,31.723147],[120.885648,31.723438],[120.885838,31.723688],[120.884859,31.724112],[120.885234,31.724748],[120.885577,31.725551],[120.88603,31.726931],[120.884701,31.727364],[120.884815,31.727638],[120.884237,31.727773],[120.884102,31.7275],[120.883852,31.727579],[120.883716,31.727282],[120.883346,31.727412],[120.88325,31.727446],[120.882889,31.726977],[120.882286,31.72728],[120.882491,31.727618],[120.881814,31.727865],[120.881716,31.728321],[120.880798,31.728727],[120.881405,31.729355],[120.880024,31.730194],[120.880362,31.730496],[120.880015,31.730749],[120.880241,31.730998],[120.879866,31.731227],[120.879224,31.730522],[120.879606,31.730293],[120.879331,31.729966],[120.878928,31.730118],[120.87767,31.731439],[120.877086,31.731718],[120.876257,31.731914],[120.875871,31.732394],[120.875377,31.732558],[120.873866,31.733738],[120.873421,31.734564],[120.872951,31.735122],[120.872222,31.736237],[120.872295,31.736582],[120.872219,31.736702],[120.871921,31.736901],[120.871647,31.737464],[120.870564,31.738873],[120.870238,31.739066],[120.870066,31.73933],[120.87138,31.740281],[120.87082,31.74081],[120.872718,31.74156],[120.872505,31.741902],[120.871307,31.742882],[120.87205,31.743205],[120.872965,31.74404],[120.874045,31.743025],[120.874585,31.743403],[120.873458,31.744437],[120.874666,31.745353],[120.876098,31.744633],[120.876732,31.745303],[120.875198,31.746208],[120.87579,31.746759],[120.87439,31.747926],[120.876071,31.749484],[120.875111,31.749786],[120.875719,31.750333],[120.875329,31.75068],[120.874588,31.751171],[120.873018,31.752557],[120.873364,31.752912],[120.874325,31.753557],[120.87386,31.753975],[120.877677,31.755417],[120.878722,31.756075],[120.88154,31.758232],[120.881633,31.759112],[120.881576,31.759291],[120.882234,31.760829],[120.883958,31.766009],[120.883139,31.766816],[120.882518,31.76724],[120.882162,31.767414],[120.881865,31.768709],[120.884873,31.779009],[120.886307,31.783917],[120.900878,31.787725],[120.903801,31.791426],[120.917499,31.808764],[120.925418,31.805232],[120.926627,31.804711],[120.932764,31.802503],[120.935992,31.801448],[120.934487,31.765289],[120.925993,31.754968],[120.92607,31.754855],[120.926291,31.754534],[120.928296,31.752958],[120.931255,31.750947],[120.924618,31.743372],[120.920931,31.745801],[120.919966,31.744726],[120.91951,31.744343],[120.915738,31.741579],[120.914513,31.742225],[120.908694,31.735767],[120.908934,31.735632],[120.914848,31.732308],[120.91815,31.730369],[120.919999,31.732019],[120.924768,31.735959],[120.929636,31.739833],[120.937063,31.744946],[120.941165,31.748761],[120.943596,31.749621],[120.947611,31.74974],[120.952493,31.749286],[120.951614,31.748696],[120.950025,31.746919],[120.948152,31.744606],[120.950996,31.742885]]]]}}],oL={type:rL,name:nL,crs:iL,features:aL},sL="FeatureCollection",uL=[{type:"Feature",properties:{id:"B020002193",name:"董浜镇",district:"江苏省苏州市常熟市",adcode:"320581",location:"120.933271,31.647432",address:[],typecode:"130105",city:[],longitude:120.933271,latitude:31.647432},geometry:{type:"Point",coordinates:[120.933271,31.647432]}},{type:"Feature",properties:{id:"B0FFM6CYQN",name:"常熟服装城",district:"江苏省苏州市常熟市",adcode:"320581",location:"120.734638,31.624103",address:"商城西路与新湖路交叉口西120米",typecode:"061100",city:[],longitude:120.734638,latitude:31.624103},geometry:{type:"Point",coordinates:[120.734638,31.624103]}},{type:"Feature",properties:{id:"B0FFH1WUDU",name:"经济技术开发区",district:"江苏省苏州市常熟市",adcode:"320581",location:"120.943260,31.746748",address:"永嘉路与金茂路交叉口东140米",typecode:"120100",city:[],longitude:120.94326,latitude:31.746748},geometry:{type:"Point",coordinates:[120.94326,31.746748]}},{type:"Feature",properties:{id:"B0FFGCV7LQ",name:"古里镇",district:"江苏省苏州市常熟市",adcode:"320581",location:"120.842154,31.633566",address:"文学街",typecode:"130105",city:[],longitude:120.842154,latitude:31.633566},geometry:{type:"Point",coordinates:[120.842154,31.633566]}},{type:"Feature",properties:{id:"B02000JTTQ",name:"支塘镇",district:"江苏省苏州市常熟市",adcode:"320581",location:"120.964049,31.609770",address:"中心街",typecode:"130105",city:[],longitude:120.964049,latitude:31.60977},geometry:{type:"Point",coordinates:[120.964049,31.60977]}},{type:"Feature",properties:{id:"B02001HI2S",name:"梅李镇",district:"江苏省苏州市常熟市",adcode:"320581",location:"120.862938,31.709310",address:"人民路18号",typecode:"130105",city:[],longitude:120.862938,latitude:31.70931},geometry:{type:"Point",coordinates:[120.862938,31.70931]}},{type:"Feature",properties:{id:"B020001FLI",name:"海虞镇",district:"江苏省苏州市常熟市",adcode:"320581",location:"120.803813,31.746609",address:"府前路68号",typecode:"130105",city:[],longitude:120.803813,latitude:31.746609},geometry:{type:"Point",coordinates:[120.803813,31.746609]}},{type:"Feature",properties:{id:"B020015VAY",name:"辛庄镇",district:"江苏省苏州市常熟市",adcode:"320581",location:"120.676973,31.539263",address:"新阳大道100号",typecode:"130105",city:[],longitude:120.676973,latitude:31.539263},geometry:{type:"Point",coordinates:[120.676973,31.539263]}},{type:"Feature",properties:{id:"B0FFG4WCLV",name:"沙家浜镇",district:"江苏省苏州市常熟市",adcode:"320581",location:"120.846952,31.544784",address:"中环路145号",typecode:"130105",city:[],longitude:120.846952,latitude:31.544784},geometry:{type:"Point",coordinates:[120.846952,31.544784]}},{type:"Feature",properties:{id:"B02001CKNK",name:"尚湖旅游度假区",district:"江苏省苏州市常熟市",adcode:"320581",location:"120.726437,31.668019",address:"虞山北路兴福寺路街8号",typecode:"130100",city:[],longitude:120.726437,latitude:31.668019},geometry:{type:"Point",coordinates:[120.726437,31.668019]}},{type:"Feature",properties:{id:"B0FFFY1BHI",name:"高新技术产业开发区管委会",district:"江苏省苏州市常熟市",adcode:"320581",location:"120.789449,31.601032",address:"东南大道1号",typecode:"130000",city:[],longitude:120.789449,latitude:31.601032},geometry:{type:"Point",coordinates:[120.789449,31.601032]}},{type:"Feature",properties:{id:"B020001QS2",name:"尚湖镇",district:"江苏省苏州市常熟市",adcode:"320581",location:"120.627862,31.661417",address:"永升(安)路附近",typecode:"130105",city:[],longitude:120.627862,latitude:31.661417},geometry:{type:"Point",coordinates:[120.627862,31.661417]}}],lL={type:sL,features:uL},cL=""+new URL("changshu-CJhH3VgD.png",import.meta.url).href,fL=""+new URL("chinamap-dd5f46jr.png",import.meta.url).href,hL=""+new URL("cityTextures-Bg0Fz_IN.png",import.meta.url).href;var SR={},AR={},q7=function(t){return AR[t]},pl=function(t,r){AR[t]=r},pL=function(t){return SR[t]},A0=function(t,r){SR[t]=r},K7={},f3={},h3=34,cv=10,p3=13;function TR(e){return new Function("d","return {"+e.map(function(t,r){return JSON.stringify(t)+": d["+r+'] || ""'}).join(",")+"}")}function dL(e,t){var r=TR(e);return function(n,i){return t(r(n),i,e)}}function Q7(e){var t=Object.create(null),r=[];return e.forEach(function(n){for(var i in n)i in t||r.push(t[i]=i)}),r}function Fu(e,t){var r=e+"",n=r.length;return n<t?new Array(t-n+1).join(0)+r:r}function vL(e){return e<0?"-"+Fu(-e,6):e>9999?"+"+Fu(e,6):Fu(e,4)}function mL(e){var t=e.getUTCHours(),r=e.getUTCMinutes(),n=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":vL(e.getUTCFullYear())+"-"+Fu(e.getUTCMonth()+1,2)+"-"+Fu(e.getUTCDate(),2)+(i?"T"+Fu(t,2)+":"+Fu(r,2)+":"+Fu(n,2)+"."+Fu(i,3)+"Z":n?"T"+Fu(t,2)+":"+Fu(r,2)+":"+Fu(n,2)+"Z":r||t?"T"+Fu(t,2)+":"+Fu(r,2)+"Z":"")}function gL(e){var t=new RegExp('["'+e+`
|
|
\r]`),r=e.charCodeAt(0);function n(_,b){var A,w,R=i(_,function(P,k){if(A)return A(P,k-1);w=P,A=b?dL(P,b):TR(P)});return R.columns=w||[],R}function i(_,b){var A=[],w=_.length,R=0,P=0,k,L=w<=0,B=!1;_.charCodeAt(w-1)===cv&&--w,_.charCodeAt(w-1)===p3&&--w;function V(){if(L)return f3;if(B)return B=!1,K7;var K,Z=R,ve;if(_.charCodeAt(Z)===h3){for(;R++<w&&_.charCodeAt(R)!==h3||_.charCodeAt(++R)===h3;);return(K=R)>=w?L=!0:(ve=_.charCodeAt(R++))===cv?B=!0:ve===p3&&(B=!0,_.charCodeAt(R)===cv&&++R),_.slice(Z+1,K-1).replace(/""/g,'"')}for(;R<w;){if((ve=_.charCodeAt(K=R++))===cv)B=!0;else if(ve===p3)B=!0,_.charCodeAt(R)===cv&&++R;else if(ve!==r)continue;return _.slice(Z,K)}return L=!0,_.slice(Z,w)}for(;(k=V())!==f3;){for(var G=[];k!==K7&&k!==f3;)G.push(k),k=V();b&&(G=b(G,P++))==null||A.push(G)}return A}function o(_,b){return _.map(function(A){return b.map(function(w){return m(A[w])}).join(e)})}function a(_,b){return b==null&&(b=Q7(_)),[b.map(m).join(e)].concat(o(_,b)).join(`
|
|
`)}function u(_,b){return b==null&&(b=Q7(_)),o(_,b).join(`
|
|
`)}function c(_){return _.map(f).join(`
|
|
`)}function f(_){return _.map(m).join(e)}function m(_){return _==null?"":_ instanceof Date?mL(_):t.test(_+="")?'"'+_.replace(/"/g,'""')+'"':_}return{parse:n,parseRows:i,format:a,formatBody:u,formatRows:c,formatRow:f,formatValue:m}}var _L=gL(","),yL=_L.parse;function mu(e){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mu(e)}function xL(e,t){if(mu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(mu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wR(e){var t=xL(e,"string");return mu(t)=="symbol"?t:String(t)}function F(e,t,r){return t=wR(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function J7(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Qe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?J7(Object(r),!0).forEach(function(n){F(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J7(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vm(e,t,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function f5(e,t,r){r===void 0&&(r={});for(var n=0,i=e;n<i.length;n++){var o=i[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}var u={type:"Polygon",coordinates:e};return vm(u,t,r)}function bL(e,t,r){if(r===void 0&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:e};return vm(n,t,r)}function EL(e,t){t===void 0&&(t={});var r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}function SL(e,t,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:e};return vm(n,t,r)}function CR(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function eE(e){return e.type==="Feature"?e.geometry:e}function RR(e,t,r){if(e!==null)for(var n,i,o,a,u,c,f,m=0,_=0,b,A=e.type,w=A==="FeatureCollection",R=A==="Feature",P=w?e.features.length:1,k=0;k<P;k++){f=w?e.features[k].geometry:R?e.geometry:e,b=f?f.type==="GeometryCollection":!1,u=b?f.geometries.length:1;for(var L=0;L<u;L++){var B=0,V=0;if(a=b?f.geometries[L]:f,a!==null){c=a.coordinates;var G=a.type;switch(m=r&&(G==="Polygon"||G==="MultiPolygon")?1:0,G){case null:break;case"Point":if(t(c,_,k,B,V)===!1)return!1;_++,B++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(t(c[n],_,k,B,V)===!1)return!1;_++,G==="MultiPoint"&&B++}G==="LineString"&&B++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(i=0;i<c[n].length-m;i++){if(t(c[n][i],_,k,B,V)===!1)return!1;_++}G==="MultiLineString"&&B++,G==="Polygon"&&V++}G==="Polygon"&&B++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(V=0,i=0;i<c[n].length;i++){for(o=0;o<c[n][i].length-m;o++){if(t(c[n][i][o],_,k,B,V)===!1)return!1;_++}V++}B++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(RR(a.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function AL(e,t){var r,n,i,o,a,u,c,f,m,_,b=0,A=e.type==="FeatureCollection",w=e.type==="Feature",R=A?e.features.length:1;for(r=0;r<R;r++){for(u=A?e.features[r].geometry:w?e.geometry:e,f=A?e.features[r].properties:w?e.properties:{},m=A?e.features[r].bbox:w?e.bbox:void 0,_=A?e.features[r].id:w?e.id:void 0,c=u?u.type==="GeometryCollection":!1,a=c?u.geometries.length:1,i=0;i<a;i++){if(o=c?u.geometries[i]:u,o===null){if(t(null,b,f,m,_)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,b,f,m,_)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(t(o.geometries[n],b,f,m,_)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}b++}}function IR(e,t){AL(e,function(r,n,i,o,a){var u=r===null?null:r.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return t(vm(r,i,{bbox:o,id:a}),n,0)===!1?!1:void 0}var c;switch(u){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var f=0;f<r.coordinates.length;f++){var m=r.coordinates[f],_={type:c,coordinates:m};if(t(vm(_,i),n,f)===!1)return!1}})}function tE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wR(n.key),n)}}function jt(e,t,r){return t&&tE(e.prototype,t),r&&tE(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mm(e,t){return mm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},mm(e,t)}function _n(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mm(e,t)}function $e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yn(e,t){if(t&&(mu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $e(e)}function Bt(e){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bt(e)}function TL(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function MR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(MR=function(){return!!e})()}function wL(e,t,r){if(MR())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var i=new(e.bind.apply(e,n));return r&&mm(i,r.prototype),i}function P6(e){var t=typeof Map=="function"?new Map:void 0;return P6=function(n){if(n===null||!TL(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return wL(n,arguments,Bt(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),mm(i,n)},P6(e)}var wg={REGISTERED_PROTOCOLS:{}};function CL(e){var t=RL();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function RL(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var h5=function(t){return wg.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]},IL=function(e){_n(r,e);var t=CL(r);function r(n,i,o,a){var u;return Ht(this,r),u=t.call(this,"AJAXError: ".concat(i," (").concat(n,"): ").concat(o)),u.status=n,u.statusText=i,u.url=o,u.body=a,u}return jt(r)}(P6(Error));function PR(e,t){var r=new XMLHttpRequest,n=Array.isArray(e.url)?e.url[0]:e.url;r.open(e.method||"GET",n,!0),e.type==="arrayBuffer"&&(r.responseType="arraybuffer");for(var i in e.headers)e.headers.hasOwnProperty(i)&&r.setRequestHeader(i,e.headers[i]);return e.type==="json"&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials=e.credentials==="include",r.onerror=function(){t(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||r.status===0)&&r.response!==null){var o=r.response;if(e.type==="json")try{o=JSON.parse(r.response)}catch(u){return t(u)}t(null,o,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"),r)}else{var a=new Blob([r.response],{type:r.getResponseHeader("Content-Type")});t(new IL(r.status,r.statusText,n.toString(),a))}},r.cancel=r.abort,r.send(e.body),r}function ML(e){return new Promise(function(t,r){PR(e,function(n,i,o,a,u){n?r({err:n,data:null,xhr:u}):t({err:null,data:i,cacheControl:o,expires:a,xhr:u})})})}function p5(e,t){return PR(e,t)}var PL=function(t,r){var n=h5(t.url)||p5;return n(Qe(Qe({},t),{},{type:"json"}),r)},d5=function(t,r){var n=h5(t.url)||p5;return n(Qe(Qe({},t),{},{type:"arrayBuffer"}),r)},OL=function(t,r){return p5(Qe(Qe({},t),{},{method:"GET"}),r)},rE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function OR(e,t){var r=new window.Image,n=window.URL||window.webkitURL;r.crossOrigin="anonymous",r.onload=function(){t(null,r),n.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(function(){r.src=rE})},r.onerror=function(){return t(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."))};var i=new Blob([new Uint8Array(e)],{type:"image/png"});r.src=e.byteLength?n.createObjectURL(i):rE}function kR(e,t){var r=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(r).then(function(n){t(null,n)}).catch(function(n){t(new Error("Could not load image because of ".concat(n.message,". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")))})}var O6=function(t,r,n){var i=function(a,u){if(a)r(a);else if(u){var c=typeof createImageBitmap=="function",f=n?n(u):u;c?kR(f,r):OR(f,r)}};return t.type==="json"?PL(t,i):d5(t,i)},kL=function(t,r){var n=typeof createImageBitmap=="function";n?kR(t,r):OR(t,r)};function v5(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function DR(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Vm(){}var gm=.7,Yg=1/gm,qd="\\s*([+-]?\\d+)\\s*",_m="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",hf="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",DL=/^#([0-9a-f]{3,8})$/,FL=new RegExp("^rgb\\("+[qd,qd,qd]+"\\)$"),BL=new RegExp("^rgb\\("+[hf,hf,hf]+"\\)$"),LL=new RegExp("^rgba\\("+[qd,qd,qd,_m]+"\\)$"),NL=new RegExp("^rgba\\("+[hf,hf,hf,_m]+"\\)$"),UL=new RegExp("^hsl\\("+[_m,hf,hf]+"\\)$"),zL=new RegExp("^hsla\\("+[_m,hf,hf,_m]+"\\)$"),nE={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};v5(Vm,u0,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:iE,formatHex:iE,formatHsl:$L,formatRgb:aE,toString:aE});function iE(){return this.rgb().formatHex()}function $L(){return FR(this).formatHsl()}function aE(){return this.rgb().formatRgb()}function u0(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=DL.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?oE(t):r===3?new cl(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?j2(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?j2(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=FL.exec(e))?new cl(t[1],t[2],t[3],1):(t=BL.exec(e))?new cl(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=LL.exec(e))?j2(t[1],t[2],t[3],t[4]):(t=NL.exec(e))?j2(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=UL.exec(e))?lE(t[1],t[2]/100,t[3]/100,1):(t=zL.exec(e))?lE(t[1],t[2]/100,t[3]/100,t[4]):nE.hasOwnProperty(e)?oE(nE[e]):e==="transparent"?new cl(NaN,NaN,NaN,0):null}function oE(e){return new cl(e>>16&255,e>>8&255,e&255,1)}function j2(e,t,r,n){return n<=0&&(e=t=r=NaN),new cl(e,t,r,n)}function VL(e){return e instanceof Vm||(e=u0(e)),e?(e=e.rgb(),new cl(e.r,e.g,e.b,e.opacity)):new cl}function Zg(e,t,r,n){return arguments.length===1?VL(e):new cl(e,t,r,n??1)}function cl(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}v5(cl,Zg,DR(Vm,{brighter:function(e){return e=e==null?Yg:Math.pow(Yg,e),new cl(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=e==null?gm:Math.pow(gm,e),new cl(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:sE,formatHex:sE,formatRgb:uE,toString:uE}));function sE(){return"#"+d3(this.r)+d3(this.g)+d3(this.b)}function uE(){var e=this.opacity;return e=isNaN(e)?1:Math.max(0,Math.min(1,e)),(e===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(e===1?")":", "+e+")")}function d3(e){return e=Math.max(0,Math.min(255,Math.round(e)||0)),(e<16?"0":"")+e.toString(16)}function lE(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new uf(e,t,r,n)}function FR(e){if(e instanceof uf)return new uf(e.h,e.s,e.l,e.opacity);if(e instanceof Vm||(e=u0(e)),!e)return new uf;if(e instanceof uf)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=NaN,u=o-i,c=(o+i)/2;return u?(t===o?a=(r-n)/u+(r<n)*6:r===o?a=(n-t)/u+2:a=(t-r)/u+4,u/=c<.5?o+i:2-o-i,a*=60):u=c>0&&c<1?0:a,new uf(a,u,c,e.opacity)}function jL(e,t,r,n){return arguments.length===1?FR(e):new uf(e,t,r,n??1)}function uf(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}v5(uf,jL,DR(Vm,{brighter:function(e){return e=e==null?Yg:Math.pow(Yg,e),new uf(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=e==null?gm:Math.pow(gm,e),new uf(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new cl(v3(e>=240?e-240:e+120,i,n),v3(e,i,n),v3(e<120?e+240:e-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return e=isNaN(e)?1:Math.max(0,Math.min(1,e)),(e===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(e===1?")":", "+e+")")}}));function v3(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}function Ta(e){var t=u0(e),r=[0,0,0,0];return t!=null&&(r[0]=t.r/255,r[1]=t.g/255,r[2]=t.b/255,r[3]=t.opacity),r}function x1(e){var t=e&&e[0],r=e&&e[1],n=e&&e[2],i=t+r*256+n*65536-1;return i}function sh(e){return[e+1&255,e+1>>8&255,e+1>>8>>8&255]}function HL(e){var t=window.document.createElement("canvas"),r=t.getContext("2d");t.width=256,t.height=1;for(var n=null,i=r.createLinearGradient(0,0,256,1),o=e.positions[0],a=e.positions[e.positions.length-1],u=0;u<e.colors.length;++u){var c=(e.positions[u]-o)/(a-o);i.addColorStop(c,e.colors[u])}return r.fillStyle=i,r.fillRect(0,0,256,1),n=new Uint8ClampedArray(r.getImageData(0,0,256,1).data),t=null,r=null,{data:n,width:256,height:1}}function GL(e,t){var r=window.document.createElement("canvas"),n=r.getContext("2d");r.width=256,r.height=1,console.log("colorRamp",r);for(var i=n.createLinearGradient(0,0,256,1),o=t[1]-t[0],a=0;a<e.colors.length;++a){var u=Math.max((e.positions[a]-t[0])/o,0);i.addColorStop(u,e.colors[a])}n.fillStyle=i,n.fillRect(0,0,256,1);var c=n.getImageData(0,0,256,1).data,f=m5(n,c);return r=null,n=null,f}function WL(e){var t=window.document.createElement("canvas"),r=t.getContext("2d");t.width=256,t.height=1;var n=r.createImageData(256,1);return n.data.fill(0),e.positions.forEach(function(i,o){var a=Ta(e.colors[o]);n.data[i*4+0]=a[0]*255,n.data[i*4+1]=a[1]*255,n.data[i*4+2]=a[2]*255,n.data[i*4+3]=a[3]*255}),t=null,r=null,n}function XL(e){var t=window.document.createElement("canvas"),r=t.getContext("2d");r.globalAlpha=1,t.width=256,t.height=1;for(var n=256/e.colors.length,i=0;i<e.colors.length;i++)r.beginPath(),r.lineWidth=2,r.strokeStyle=e.colors[i],r.moveTo(i*n,0),r.lineTo((i+1)*n,0),r.stroke();var o=r.getImageData(0,0,256,1).data,a=m5(r,o);return t=null,r=null,a}function YL(e,t){var r=window.document.createElement("canvas"),n=r.getContext("2d");n.globalAlpha=1,r.width=256,r.height=1;var i=t[1]-t[0];e.positions.length-e.colors.length!==1&&console.warn("positions 的数字个数应当比 colors 的样式多一个,poisitions 的首尾值一般为数据的最大最新值");for(var o=0;o<e.colors.length;o++)n.beginPath(),n.lineWidth=2,n.strokeStyle=e.colors[o],n.moveTo((e.positions[o]-t[0])/i*255,0),n.lineTo((e.positions[o+1]-t[0])/i*255,0),n.stroke();var a=n.getImageData(0,0,256,1).data,u=m5(n,a);return r=null,n=null,u}function m5(e,t){for(var r=e.createImageData(256,1),n=0;n<r.data.length;n+=4)r.data[n+0]=t[n+0],r.data[n+1]=t[n+1],r.data[n+2]=t[n+2],r.data[n+3]=t[n+3];return r}function g5(e){switch(e.type){case"cat":return[0,255];default:return[0,1]}}var i1={BACK:1029,FRONT:1028};function _5(e){switch(e){case"GAODE1.x":return i1.BACK;case"GAODE2.x":return i1.BACK;case"MAPBOX":return i1.FRONT;case"SIMPLE":return i1.FRONT;case"GLOBEL":return i1.BACK;case"DEBAULT":return i1.FRONT;default:return i1.FRONT}}function k6(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ZL(e){if(Array.isArray(e))return k6(e)}function qL(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function BR(e,t){if(e){if(typeof e=="string")return k6(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return k6(e,t)}}function KL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nr(e){return ZL(e)||qL(e)||BR(e)||KL()}function QL(e){if(Array.isArray(e))return e}function JL(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,u=[],c=!0,f=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(m){f=!0,i=m}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(f)throw i}}return u}}function eN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nn(e,t){return QL(e)||JL(e,t)||BR(e,t)||eN()}var _c=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function tN(e,t,r){return e===e&&(r!==void 0&&(e=e<=r?e:r),t!==void 0&&(e=e>=t?e:t)),e}var rN=tN,nN=/\s/;function iN(e){for(var t=e.length;t--&&nN.test(e.charAt(t)););return t}var aN=iN,oN=aN,sN=/^\s+/;function uN(e){return e&&e.slice(0,oN(e)+1).replace(sN,"")}var lN=uN;function cN(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Zl=cN;const fN=oa(Zl);var hN=typeof _c=="object"&&_c&&_c.Object===Object&&_c,LR=hN,pN=LR,dN=typeof self=="object"&&self&&self.Object===Object&&self,vN=pN||dN||Function("return this")(),Sc=vN,mN=Sc,gN=mN.Symbol,jm=gN,cE=jm,NR=Object.prototype,_N=NR.hasOwnProperty,yN=NR.toString,fv=cE?cE.toStringTag:void 0;function xN(e){var t=_N.call(e,fv),r=e[fv];try{e[fv]=void 0;var n=!0}catch{}var i=yN.call(e);return n&&(t?e[fv]=r:delete e[fv]),i}var bN=xN,EN=Object.prototype,SN=EN.toString;function AN(e){return SN.call(e)}var TN=AN,fE=jm,wN=bN,CN=TN,RN="[object Null]",IN="[object Undefined]",hE=fE?fE.toStringTag:void 0;function MN(e){return e==null?e===void 0?IN:RN:hE&&hE in Object(e)?wN(e):CN(e)}var lh=MN;function PN(e){return e!=null&&typeof e=="object"}var ql=PN,ON=lh,kN=ql,DN="[object Symbol]";function FN(e){return typeof e=="symbol"||kN(e)&&ON(e)==DN}var X_=FN,BN=lN,pE=Zl,LN=X_,dE=NaN,NN=/^[-+]0x[0-9a-f]+$/i,UN=/^0b[01]+$/i,zN=/^0o[0-7]+$/i,$N=parseInt;function VN(e){if(typeof e=="number")return e;if(LN(e))return dE;if(pE(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=pE(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=BN(e);var r=UN.test(e);return r||zN.test(e)?$N(e.slice(2),r?2:8):NN.test(e)?dE:+e}var UR=VN,jN=rN,m3=UR;function HN(e,t,r){return r===void 0&&(r=t,t=void 0),r!==void 0&&(r=m3(r),r=r===r?r:0),t!==void 0&&(t=m3(t),t=t===t?t:0),jN(m3(e),t,r)}var GN=HN;const WN=oa(GN);function XN(){this.__data__=[],this.size=0}var YN=XN;function ZN(e,t){return e===t||e!==e&&t!==t}var Hm=ZN,qN=Hm;function KN(e,t){for(var r=e.length;r--;)if(qN(e[r][0],t))return r;return-1}var Y_=KN,QN=Y_,JN=Array.prototype,eU=JN.splice;function tU(e){var t=this.__data__,r=QN(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():eU.call(t,r,1),--this.size,!0}var rU=tU,nU=Y_;function iU(e){var t=this.__data__,r=nU(t,e);return r<0?void 0:t[r][1]}var aU=iU,oU=Y_;function sU(e){return oU(this.__data__,e)>-1}var uU=sU,lU=Y_;function cU(e,t){var r=this.__data__,n=lU(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var fU=cU,hU=YN,pU=rU,dU=aU,vU=uU,mU=fU;function T0(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}T0.prototype.clear=hU;T0.prototype.delete=pU;T0.prototype.get=dU;T0.prototype.has=vU;T0.prototype.set=mU;var Z_=T0,gU=Z_;function _U(){this.__data__=new gU,this.size=0}var yU=_U;function xU(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var bU=xU;function EU(e){return this.__data__.get(e)}var SU=EU;function AU(e){return this.__data__.has(e)}var TU=AU,wU=lh,CU=Zl,RU="[object AsyncFunction]",IU="[object Function]",MU="[object GeneratorFunction]",PU="[object Proxy]";function OU(e){if(!CU(e))return!1;var t=wU(e);return t==IU||t==MU||t==RU||t==PU}var q_=OU;const kU=oa(q_);var DU=Sc,FU=DU["__core-js_shared__"],BU=FU,g3=BU,vE=function(){var e=/[^.]+$/.exec(g3&&g3.keys&&g3.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function LU(e){return!!vE&&vE in e}var NU=LU,UU=Function.prototype,zU=UU.toString;function $U(e){if(e!=null){try{return zU.call(e)}catch{}try{return e+""}catch{}}return""}var zR=$U,VU=q_,jU=NU,HU=Zl,GU=zR,WU=/[\\^$.*+?()[\]{}|]/g,XU=/^\[object .+?Constructor\]$/,YU=Function.prototype,ZU=Object.prototype,qU=YU.toString,KU=ZU.hasOwnProperty,QU=RegExp("^"+qU.call(KU).replace(WU,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function JU(e){if(!HU(e)||jU(e))return!1;var t=VU(e)?QU:XU;return t.test(GU(e))}var ez=JU;function tz(e,t){return e==null?void 0:e[t]}var rz=tz,nz=ez,iz=rz;function az(e,t){var r=iz(e,t);return nz(r)?r:void 0}var P1=az,oz=P1,sz=Sc,uz=oz(sz,"Map"),y5=uz,lz=P1,cz=lz(Object,"create"),K_=cz,mE=K_;function fz(){this.__data__=mE?mE(null):{},this.size=0}var hz=fz;function pz(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var dz=pz,vz=K_,mz="__lodash_hash_undefined__",gz=Object.prototype,_z=gz.hasOwnProperty;function yz(e){var t=this.__data__;if(vz){var r=t[e];return r===mz?void 0:r}return _z.call(t,e)?t[e]:void 0}var xz=yz,bz=K_,Ez=Object.prototype,Sz=Ez.hasOwnProperty;function Az(e){var t=this.__data__;return bz?t[e]!==void 0:Sz.call(t,e)}var Tz=Az,wz=K_,Cz="__lodash_hash_undefined__";function Rz(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=wz&&t===void 0?Cz:t,this}var Iz=Rz,Mz=hz,Pz=dz,Oz=xz,kz=Tz,Dz=Iz;function w0(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}w0.prototype.clear=Mz;w0.prototype.delete=Pz;w0.prototype.get=Oz;w0.prototype.has=kz;w0.prototype.set=Dz;var Fz=w0,gE=Fz,Bz=Z_,Lz=y5;function Nz(){this.size=0,this.__data__={hash:new gE,map:new(Lz||Bz),string:new gE}}var Uz=Nz;function zz(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var $z=zz,Vz=$z;function jz(e,t){var r=e.__data__;return Vz(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Q_=jz,Hz=Q_;function Gz(e){var t=Hz(this,e).delete(e);return this.size-=t?1:0,t}var Wz=Gz,Xz=Q_;function Yz(e){return Xz(this,e).get(e)}var Zz=Yz,qz=Q_;function Kz(e){return qz(this,e).has(e)}var Qz=Kz,Jz=Q_;function e$(e,t){var r=Jz(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var t$=e$,r$=Uz,n$=Wz,i$=Zz,a$=Qz,o$=t$;function C0(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}C0.prototype.clear=r$;C0.prototype.delete=n$;C0.prototype.get=i$;C0.prototype.has=a$;C0.prototype.set=o$;var x5=C0,s$=Z_,u$=y5,l$=x5,c$=200;function f$(e,t){var r=this.__data__;if(r instanceof s$){var n=r.__data__;if(!u$||n.length<c$-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new l$(n)}return r.set(e,t),this.size=r.size,this}var h$=f$,p$=Z_,d$=yU,v$=bU,m$=SU,g$=TU,_$=h$;function R0(e){var t=this.__data__=new p$(e);this.size=t.size}R0.prototype.clear=d$;R0.prototype.delete=v$;R0.prototype.get=m$;R0.prototype.has=g$;R0.prototype.set=_$;var b5=R0;function y$(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var x$=y$,b$=P1,E$=function(){try{var e=b$(Object,"defineProperty");return e({},"",{}),e}catch{}}(),$R=E$,_E=$R;function S$(e,t,r){t=="__proto__"&&_E?_E(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var E5=S$,A$=E5,T$=Hm,w$=Object.prototype,C$=w$.hasOwnProperty;function R$(e,t,r){var n=e[t];(!(C$.call(e,t)&&T$(n,r))||r===void 0&&!(t in e))&&A$(e,t,r)}var VR=R$,I$=VR,M$=E5;function P$(e,t,r,n){var i=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var u=t[o],c=n?n(r[u],e[u],u,r,e):void 0;c===void 0&&(c=e[u]),i?M$(r,u,c):I$(r,u,c)}return r}var Gm=P$;function O$(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var k$=O$,D$=lh,F$=ql,B$="[object Arguments]";function L$(e){return F$(e)&&D$(e)==B$}var N$=L$,yE=N$,U$=ql,jR=Object.prototype,z$=jR.hasOwnProperty,$$=jR.propertyIsEnumerable,V$=yE(function(){return arguments}())?yE:function(e){return U$(e)&&z$.call(e,"callee")&&!$$.call(e,"callee")},HR=V$,j$=Array.isArray,ch=j$,qg={exports:{}};function H$(){return!1}var G$=H$;qg.exports;(function(e,t){var r=Sc,n=G$,i=t&&!t.nodeType&&t,o=i&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===i,u=a?r.Buffer:void 0,c=u?u.isBuffer:void 0,f=c||n;e.exports=f})(qg,qg.exports);var J_=qg.exports,W$=9007199254740991,X$=/^(?:0|[1-9]\d*)$/;function Y$(e,t){var r=typeof e;return t=t??W$,!!t&&(r=="number"||r!="symbol"&&X$.test(e))&&e>-1&&e%1==0&&e<t}var GR=Y$,Z$=9007199254740991;function q$(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Z$}var WR=q$,K$=lh,Q$=WR,J$=ql,eV="[object Arguments]",tV="[object Array]",rV="[object Boolean]",nV="[object Date]",iV="[object Error]",aV="[object Function]",oV="[object Map]",sV="[object Number]",uV="[object Object]",lV="[object RegExp]",cV="[object Set]",fV="[object String]",hV="[object WeakMap]",pV="[object ArrayBuffer]",dV="[object DataView]",vV="[object Float32Array]",mV="[object Float64Array]",gV="[object Int8Array]",_V="[object Int16Array]",yV="[object Int32Array]",xV="[object Uint8Array]",bV="[object Uint8ClampedArray]",EV="[object Uint16Array]",SV="[object Uint32Array]",qa={};qa[vV]=qa[mV]=qa[gV]=qa[_V]=qa[yV]=qa[xV]=qa[bV]=qa[EV]=qa[SV]=!0;qa[eV]=qa[tV]=qa[pV]=qa[rV]=qa[dV]=qa[nV]=qa[iV]=qa[aV]=qa[oV]=qa[sV]=qa[uV]=qa[lV]=qa[cV]=qa[fV]=qa[hV]=!1;function AV(e){return J$(e)&&Q$(e.length)&&!!qa[K$(e)]}var TV=AV;function wV(e){return function(t){return e(t)}}var ey=wV,Kg={exports:{}};Kg.exports;(function(e,t){var r=LR,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===n,a=o&&r.process,u=function(){try{var c=i&&i.require&&i.require("util").types;return c||a&&a.binding&&a.binding("util")}catch{}}();e.exports=u})(Kg,Kg.exports);var S5=Kg.exports,CV=TV,RV=ey,xE=S5,bE=xE&&xE.isTypedArray,IV=bE?RV(bE):CV,ty=IV;const MV=oa(ty);var PV=k$,OV=HR,kV=ch,DV=J_,FV=GR,BV=ty,LV=Object.prototype,NV=LV.hasOwnProperty;function UV(e,t){var r=kV(e),n=!r&&OV(e),i=!r&&!n&&DV(e),o=!r&&!n&&!i&&BV(e),a=r||n||i||o,u=a?PV(e.length,String):[],c=u.length;for(var f in e)(t||NV.call(e,f))&&!(a&&(f=="length"||i&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||FV(f,c)))&&u.push(f);return u}var XR=UV,zV=Object.prototype;function $V(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||zV;return e===r}var A5=$V;function VV(e,t){return function(r){return e(t(r))}}var YR=VV,jV=YR,HV=jV(Object.keys,Object),GV=HV,WV=A5,XV=GV,YV=Object.prototype,ZV=YV.hasOwnProperty;function qV(e){if(!WV(e))return XV(e);var t=[];for(var r in Object(e))ZV.call(e,r)&&r!="constructor"&&t.push(r);return t}var KV=qV,QV=q_,JV=WR;function ej(e){return e!=null&&JV(e.length)&&!QV(e)}var ry=ej,tj=XR,rj=KV,nj=ry;function ij(e){return nj(e)?tj(e):rj(e)}var T5=ij,aj=Gm,oj=T5;function sj(e,t){return e&&aj(t,oj(t),e)}var uj=sj;function lj(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var cj=lj,fj=Zl,hj=A5,pj=cj,dj=Object.prototype,vj=dj.hasOwnProperty;function mj(e){if(!fj(e))return pj(e);var t=hj(e),r=[];for(var n in e)n=="constructor"&&(t||!vj.call(e,n))||r.push(n);return r}var gj=mj,_j=XR,yj=gj,xj=ry;function bj(e){return xj(e)?_j(e,!0):yj(e)}var Wm=bj,Ej=Gm,Sj=Wm;function Aj(e,t){return e&&Ej(t,Sj(t),e)}var Tj=Aj,Qg={exports:{}};Qg.exports;(function(e,t){var r=Sc,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===n,a=o?r.Buffer:void 0,u=a?a.allocUnsafe:void 0;function c(f,m){if(m)return f.slice();var _=f.length,b=u?u(_):new f.constructor(_);return f.copy(b),b}e.exports=c})(Qg,Qg.exports);var ZR=Qg.exports;function wj(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var w5=wj;function Cj(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}var Rj=Cj;function Ij(){return[]}var qR=Ij,Mj=Rj,Pj=qR,Oj=Object.prototype,kj=Oj.propertyIsEnumerable,EE=Object.getOwnPropertySymbols,Dj=EE?function(e){return e==null?[]:(e=Object(e),Mj(EE(e),function(t){return kj.call(e,t)}))}:Pj,C5=Dj,Fj=Gm,Bj=C5;function Lj(e,t){return Fj(e,Bj(e),t)}var Nj=Lj;function Uj(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var KR=Uj,zj=YR,$j=zj(Object.getPrototypeOf,Object),R5=$j,Vj=KR,jj=R5,Hj=C5,Gj=qR,Wj=Object.getOwnPropertySymbols,Xj=Wj?function(e){for(var t=[];e;)Vj(t,Hj(e)),e=jj(e);return t}:Gj,QR=Xj,Yj=Gm,Zj=QR;function qj(e,t){return Yj(e,Zj(e),t)}var Kj=qj,Qj=KR,Jj=ch;function eH(e,t,r){var n=t(e);return Jj(e)?n:Qj(n,r(e))}var JR=eH,tH=JR,rH=C5,nH=T5;function iH(e){return tH(e,nH,rH)}var eI=iH,aH=JR,oH=QR,sH=Wm;function uH(e){return aH(e,sH,oH)}var lH=uH,cH=P1,fH=Sc,hH=cH(fH,"DataView"),pH=hH,dH=P1,vH=Sc,mH=dH(vH,"Promise"),gH=mH,_H=P1,yH=Sc,xH=_H(yH,"Set"),tI=xH,bH=P1,EH=Sc,SH=bH(EH,"WeakMap"),AH=SH,D6=pH,F6=y5,B6=gH,L6=tI,N6=AH,rI=lh,I0=zR,SE="[object Map]",TH="[object Object]",AE="[object Promise]",TE="[object Set]",wE="[object WeakMap]",CE="[object DataView]",wH=I0(D6),CH=I0(F6),RH=I0(B6),IH=I0(L6),MH=I0(N6),h1=rI;(D6&&h1(new D6(new ArrayBuffer(1)))!=CE||F6&&h1(new F6)!=SE||B6&&h1(B6.resolve())!=AE||L6&&h1(new L6)!=TE||N6&&h1(new N6)!=wE)&&(h1=function(e){var t=rI(e),r=t==TH?e.constructor:void 0,n=r?I0(r):"";if(n)switch(n){case wH:return CE;case CH:return SE;case RH:return AE;case IH:return TE;case MH:return wE}return t});var ny=h1,PH=Object.prototype,OH=PH.hasOwnProperty;function kH(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&OH.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var DH=kH,FH=Sc,BH=FH.Uint8Array,nI=BH,RE=nI;function LH(e){var t=new e.constructor(e.byteLength);return new RE(t).set(new RE(e)),t}var I5=LH,NH=I5;function UH(e,t){var r=t?NH(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var zH=UH,$H=/\w*$/;function VH(e){var t=new e.constructor(e.source,$H.exec(e));return t.lastIndex=e.lastIndex,t}var jH=VH,IE=jm,ME=IE?IE.prototype:void 0,PE=ME?ME.valueOf:void 0;function HH(e){return PE?Object(PE.call(e)):{}}var GH=HH,WH=I5;function XH(e,t){var r=t?WH(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var iI=XH,YH=I5,ZH=zH,qH=jH,KH=GH,QH=iI,JH="[object Boolean]",eG="[object Date]",tG="[object Map]",rG="[object Number]",nG="[object RegExp]",iG="[object Set]",aG="[object String]",oG="[object Symbol]",sG="[object ArrayBuffer]",uG="[object DataView]",lG="[object Float32Array]",cG="[object Float64Array]",fG="[object Int8Array]",hG="[object Int16Array]",pG="[object Int32Array]",dG="[object Uint8Array]",vG="[object Uint8ClampedArray]",mG="[object Uint16Array]",gG="[object Uint32Array]";function _G(e,t,r){var n=e.constructor;switch(t){case sG:return YH(e);case JH:case eG:return new n(+e);case uG:return ZH(e,r);case lG:case cG:case fG:case hG:case pG:case dG:case vG:case mG:case gG:return QH(e,r);case tG:return new n;case rG:case aG:return new n(e);case nG:return qH(e);case iG:return new n;case oG:return KH(e)}}var yG=_G,xG=Zl,OE=Object.create,bG=function(){function e(){}return function(t){if(!xG(t))return{};if(OE)return OE(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),EG=bG,SG=EG,AG=R5,TG=A5;function wG(e){return typeof e.constructor=="function"&&!TG(e)?SG(AG(e)):{}}var aI=wG,CG=ny,RG=ql,IG="[object Map]";function MG(e){return RG(e)&&CG(e)==IG}var PG=MG,OG=PG,kG=ey,kE=S5,DE=kE&&kE.isMap,DG=DE?kG(DE):OG,FG=DG,BG=ny,LG=ql,NG="[object Set]";function UG(e){return LG(e)&&BG(e)==NG}var zG=UG,$G=zG,VG=ey,FE=S5,BE=FE&&FE.isSet,jG=BE?VG(BE):$G,HG=jG,GG=b5,WG=x$,XG=VR,YG=uj,ZG=Tj,qG=ZR,KG=w5,QG=Nj,JG=Kj,eW=eI,tW=lH,rW=ny,nW=DH,iW=yG,aW=aI,oW=ch,sW=J_,uW=FG,lW=Zl,cW=HG,fW=T5,hW=Wm,pW=1,dW=2,vW=4,oI="[object Arguments]",mW="[object Array]",gW="[object Boolean]",_W="[object Date]",yW="[object Error]",sI="[object Function]",xW="[object GeneratorFunction]",bW="[object Map]",EW="[object Number]",uI="[object Object]",SW="[object RegExp]",AW="[object Set]",TW="[object String]",wW="[object Symbol]",CW="[object WeakMap]",RW="[object ArrayBuffer]",IW="[object DataView]",MW="[object Float32Array]",PW="[object Float64Array]",OW="[object Int8Array]",kW="[object Int16Array]",DW="[object Int32Array]",FW="[object Uint8Array]",BW="[object Uint8ClampedArray]",LW="[object Uint16Array]",NW="[object Uint32Array]",za={};za[oI]=za[mW]=za[RW]=za[IW]=za[gW]=za[_W]=za[MW]=za[PW]=za[OW]=za[kW]=za[DW]=za[bW]=za[EW]=za[uI]=za[SW]=za[AW]=za[TW]=za[wW]=za[FW]=za[BW]=za[LW]=za[NW]=!0;za[yW]=za[sI]=za[CW]=!1;function Cg(e,t,r,n,i,o){var a,u=t&pW,c=t&dW,f=t&vW;if(r&&(a=i?r(e,n,i,o):r(e)),a!==void 0)return a;if(!lW(e))return e;var m=oW(e);if(m){if(a=nW(e),!u)return KG(e,a)}else{var _=rW(e),b=_==sI||_==xW;if(sW(e))return qG(e,u);if(_==uI||_==oI||b&&!i){if(a=c||b?{}:aW(e),!u)return c?JG(e,ZG(a,e)):QG(e,YG(a,e))}else{if(!za[_])return i?e:{};a=iW(e,_,u)}}o||(o=new GG);var A=o.get(e);if(A)return A;o.set(e,a),cW(e)?e.forEach(function(P){a.add(Cg(P,t,r,P,e,o))}):uW(e)&&e.forEach(function(P,k){a.set(k,Cg(P,t,r,k,e,o))});var w=f?c?tW:eW:c?hW:fW,R=m?void 0:w(e);return WG(R||e,function(P,k){R&&(k=P,P=e[k]),XG(a,k,Cg(P,t,r,k,e,o))}),a}var UW=Cg,zW=UW,$W=1,VW=4;function jW(e){return zW(e,$W|VW)}var HW=jW;const GW=oa(HW);var WW=Sc,XW=function(){return WW.Date.now()},YW=XW,ZW=Zl,_3=YW,LE=UR,qW="Expected a function",KW=Math.max,QW=Math.min;function JW(e,t,r){var n,i,o,a,u,c,f=0,m=!1,_=!1,b=!0;if(typeof e!="function")throw new TypeError(qW);t=LE(t)||0,ZW(r)&&(m=!!r.leading,_="maxWait"in r,o=_?KW(LE(r.maxWait)||0,t):o,b="trailing"in r?!!r.trailing:b);function A(K){var Z=n,ve=i;return n=i=void 0,f=K,a=e.apply(ve,Z),a}function w(K){return f=K,u=setTimeout(k,t),m?A(K):a}function R(K){var Z=K-c,ve=K-f,Ie=t-Z;return _?QW(Ie,o-ve):Ie}function P(K){var Z=K-c,ve=K-f;return c===void 0||Z>=t||Z<0||_&&ve>=o}function k(){var K=_3();if(P(K))return L(K);u=setTimeout(k,R(K))}function L(K){return u=void 0,b&&n?A(K):(n=i=void 0,a)}function B(){u!==void 0&&clearTimeout(u),f=0,n=c=i=u=void 0}function V(){return u===void 0?a:L(_3())}function G(){var K=_3(),Z=P(K);if(n=arguments,i=this,c=K,Z){if(u===void 0)return w(c);if(_)return clearTimeout(u),u=setTimeout(k,t),A(c)}return u===void 0&&(u=setTimeout(k,t)),a}return G.cancel=B,G.flush=V,G}var lI=JW;const eX=oa(lI);var tX=ch,rX=X_,nX=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,iX=/^\w*$/;function aX(e,t){if(tX(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||rX(e)?!0:iX.test(e)||!nX.test(e)||t!=null&&e in Object(t)}var oX=aX,cI=x5,sX="Expected a function";function M5(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(sX);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(M5.Cache||cI),r}M5.Cache=cI;var uX=M5,lX=uX,cX=500;function fX(e){var t=lX(e,function(n){return r.size===cX&&r.clear(),n}),r=t.cache;return t}var hX=fX,pX=hX,dX=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vX=/\\(\\)?/g,mX=pX(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(dX,function(r,n,i,o){t.push(i?o.replace(vX,"$1"):n||r)}),t}),gX=mX;function _X(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var fI=_X,NE=jm,yX=fI,xX=ch,bX=X_,EX=1/0,UE=NE?NE.prototype:void 0,zE=UE?UE.toString:void 0;function hI(e){if(typeof e=="string")return e;if(xX(e))return yX(e,hI)+"";if(bX(e))return zE?zE.call(e):"";var t=e+"";return t=="0"&&1/e==-EX?"-0":t}var SX=hI,AX=SX;function TX(e){return e==null?"":AX(e)}var Xm=TX,wX=ch,CX=oX,RX=gX,IX=Xm;function MX(e,t){return wX(e)?e:CX(e,t)?[e]:RX(IX(e))}var PX=MX,OX=X_,kX=1/0;function DX(e){if(typeof e=="string"||OX(e))return e;var t=e+"";return t=="0"&&1/e==-kX?"-0":t}var FX=DX,BX=PX,LX=FX;function NX(e,t){t=BX(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[LX(t[r++])];return r&&r==n?e:void 0}var UX=NX,zX=UX;function $X(e,t,r){var n=e==null?void 0:zX(e,t);return n===void 0?r:n}var VX=$X;const jX=oa(VX);var HX=lh,GX=ql,WX="[object Boolean]";function XX(e){return e===!0||e===!1||GX(e)&&HX(e)==WX}var YX=XX;const ZX=oa(YX);var qX="__lodash_hash_undefined__";function KX(e){return this.__data__.set(e,qX),this}var QX=KX;function JX(e){return this.__data__.has(e)}var eY=JX,tY=x5,rY=QX,nY=eY;function Jg(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new tY;++t<r;)this.add(e[t])}Jg.prototype.add=Jg.prototype.push=rY;Jg.prototype.has=nY;var pI=Jg;function iY(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var aY=iY;function oY(e,t){return e.has(t)}var dI=oY,sY=pI,uY=aY,lY=dI,cY=1,fY=2;function hY(e,t,r,n,i,o){var a=r&cY,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var f=o.get(e),m=o.get(t);if(f&&m)return f==t&&m==e;var _=-1,b=!0,A=r&fY?new sY:void 0;for(o.set(e,t),o.set(t,e);++_<u;){var w=e[_],R=t[_];if(n)var P=a?n(R,w,_,t,e,o):n(w,R,_,e,t,o);if(P!==void 0){if(P)continue;b=!1;break}if(A){if(!uY(t,function(k,L){if(!lY(A,L)&&(w===k||i(w,k,r,n,o)))return A.push(L)})){b=!1;break}}else if(!(w===R||i(w,R,r,n,o))){b=!1;break}}return o.delete(e),o.delete(t),b}var vI=hY;function pY(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var dY=pY;function vY(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var P5=vY,$E=jm,VE=nI,mY=Hm,gY=vI,_Y=dY,yY=P5,xY=1,bY=2,EY="[object Boolean]",SY="[object Date]",AY="[object Error]",TY="[object Map]",wY="[object Number]",CY="[object RegExp]",RY="[object Set]",IY="[object String]",MY="[object Symbol]",PY="[object ArrayBuffer]",OY="[object DataView]",jE=$E?$E.prototype:void 0,y3=jE?jE.valueOf:void 0;function kY(e,t,r,n,i,o,a){switch(r){case OY:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case PY:return!(e.byteLength!=t.byteLength||!o(new VE(e),new VE(t)));case EY:case SY:case wY:return mY(+e,+t);case AY:return e.name==t.name&&e.message==t.message;case CY:case IY:return e==t+"";case TY:var u=_Y;case RY:var c=n&xY;if(u||(u=yY),e.size!=t.size&&!c)return!1;var f=a.get(e);if(f)return f==t;n|=bY,a.set(e,t);var m=gY(u(e),u(t),n,i,o,a);return a.delete(e),m;case MY:if(y3)return y3.call(e)==y3.call(t)}return!1}var DY=kY,HE=eI,FY=1,BY=Object.prototype,LY=BY.hasOwnProperty;function NY(e,t,r,n,i,o){var a=r&FY,u=HE(e),c=u.length,f=HE(t),m=f.length;if(c!=m&&!a)return!1;for(var _=c;_--;){var b=u[_];if(!(a?b in t:LY.call(t,b)))return!1}var A=o.get(e),w=o.get(t);if(A&&w)return A==t&&w==e;var R=!0;o.set(e,t),o.set(t,e);for(var P=a;++_<c;){b=u[_];var k=e[b],L=t[b];if(n)var B=a?n(L,k,b,t,e,o):n(k,L,b,e,t,o);if(!(B===void 0?k===L||i(k,L,r,n,o):B)){R=!1;break}P||(P=b=="constructor")}if(R&&!P){var V=e.constructor,G=t.constructor;V!=G&&"constructor"in e&&"constructor"in t&&!(typeof V=="function"&&V instanceof V&&typeof G=="function"&&G instanceof G)&&(R=!1)}return o.delete(e),o.delete(t),R}var UY=NY,x3=b5,zY=vI,$Y=DY,VY=UY,GE=ny,WE=ch,XE=J_,jY=ty,HY=1,YE="[object Arguments]",ZE="[object Array]",H2="[object Object]",GY=Object.prototype,qE=GY.hasOwnProperty;function WY(e,t,r,n,i,o){var a=WE(e),u=WE(t),c=a?ZE:GE(e),f=u?ZE:GE(t);c=c==YE?H2:c,f=f==YE?H2:f;var m=c==H2,_=f==H2,b=c==f;if(b&&XE(e)){if(!XE(t))return!1;a=!0,m=!1}if(b&&!m)return o||(o=new x3),a||jY(e)?zY(e,t,r,n,i,o):$Y(e,t,c,r,n,i,o);if(!(r&HY)){var A=m&&qE.call(e,"__wrapped__"),w=_&&qE.call(t,"__wrapped__");if(A||w){var R=A?e.value():e,P=w?t.value():t;return o||(o=new x3),i(R,P,r,n,o)}}return b?(o||(o=new x3),VY(e,t,r,n,i,o)):!1}var XY=WY,YY=XY,KE=ql;function mI(e,t,r,n,i){return e===t?!0:e==null||t==null||!KE(e)&&!KE(t)?e!==e&&t!==t:YY(e,t,r,n,mI,i)}var ZY=mI,qY=ZY;function KY(e,t){return qY(e,t)}var QY=KY;const JY=oa(QY);function eZ(e){return e==null}var tZ=eZ;const rZ=oa(tZ);var nZ=lh,iZ=ql,aZ="[object Number]";function oZ(e){return typeof e=="number"||iZ(e)&&nZ(e)==aZ}var sZ=oZ;const uZ=oa(sZ);var lZ=lh,cZ=R5,fZ=ql,hZ="[object Object]",pZ=Function.prototype,dZ=Object.prototype,gI=pZ.toString,vZ=dZ.hasOwnProperty,mZ=gI.call(Object);function gZ(e){if(!fZ(e)||lZ(e)!=hZ)return!1;var t=cZ(e);if(t===null)return!0;var r=vZ.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&gI.call(r)==mZ}var _I=gZ;const _Z=oa(_I);var yZ=lh,xZ=ch,bZ=ql,EZ="[object String]";function SZ(e){return typeof e=="string"||!xZ(e)&&bZ(e)&&yZ(e)==EZ}var AZ=SZ;const TZ=oa(AZ);var wZ=E5,CZ=Hm;function RZ(e,t,r){(r!==void 0&&!CZ(e[t],r)||r===void 0&&!(t in e))&&wZ(e,t,r)}var yI=RZ;function IZ(e){return function(t,r,n){for(var i=-1,o=Object(t),a=n(t),u=a.length;u--;){var c=a[e?u:++i];if(r(o[c],c,o)===!1)break}return t}}var MZ=IZ,PZ=MZ,OZ=PZ(),kZ=OZ,DZ=ry,FZ=ql;function BZ(e){return FZ(e)&&DZ(e)}var LZ=BZ;function NZ(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var xI=NZ,UZ=Gm,zZ=Wm;function $Z(e){return UZ(e,zZ(e))}var VZ=$Z,QE=yI,jZ=ZR,HZ=iI,GZ=w5,WZ=aI,JE=HR,e4=ch,XZ=LZ,YZ=J_,ZZ=q_,qZ=Zl,KZ=_I,QZ=ty,t4=xI,JZ=VZ;function eq(e,t,r,n,i,o,a){var u=t4(e,r),c=t4(t,r),f=a.get(c);if(f){QE(e,r,f);return}var m=o?o(u,c,r+"",e,t,a):void 0,_=m===void 0;if(_){var b=e4(c),A=!b&&YZ(c),w=!b&&!A&&QZ(c);m=c,b||A||w?e4(u)?m=u:XZ(u)?m=GZ(u):A?(_=!1,m=jZ(c,!0)):w?(_=!1,m=HZ(c,!0)):m=[]:KZ(c)||JE(c)?(m=u,JE(u)?m=JZ(u):(!qZ(u)||ZZ(u))&&(m=WZ(c))):_=!1}_&&(a.set(c,m),i(m,c,n,o,a),a.delete(c)),QE(e,r,m)}var tq=eq,rq=b5,nq=yI,iq=kZ,aq=tq,oq=Zl,sq=Wm,uq=xI;function bI(e,t,r,n,i){e!==t&&iq(t,function(o,a){if(i||(i=new rq),oq(o))aq(e,t,a,r,bI,n,i);else{var u=n?n(uq(e,a),o,a+"",e,t,i):void 0;u===void 0&&(u=o),nq(e,a,u)}},sq)}var EI=bI;function lq(e){return e}var SI=lq;function cq(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var fq=cq,hq=fq,r4=Math.max;function pq(e,t,r){return t=r4(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=r4(n.length-t,0),a=Array(o);++i<o;)a[i]=n[t+i];i=-1;for(var u=Array(t+1);++i<t;)u[i]=n[i];return u[t]=r(a),hq(e,this,u)}}var dq=pq;function vq(e){return function(){return e}}var mq=vq,gq=mq,n4=$R,_q=SI,yq=n4?function(e,t){return n4(e,"toString",{configurable:!0,enumerable:!1,value:gq(t),writable:!0})}:_q,xq=yq,bq=800,Eq=16,Sq=Date.now;function Aq(e){var t=0,r=0;return function(){var n=Sq(),i=Eq-(n-r);if(r=n,i>0){if(++t>=bq)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Tq=Aq,wq=xq,Cq=Tq,Rq=Cq(wq),Iq=Rq,Mq=SI,Pq=dq,Oq=Iq;function kq(e,t){return Oq(Pq(e,t,Mq),e+"")}var AI=kq,Dq=Hm,Fq=ry,Bq=GR,Lq=Zl;function Nq(e,t,r){if(!Lq(r))return!1;var n=typeof t;return(n=="number"?Fq(r)&&Bq(t,r.length):n=="string"&&t in r)?Dq(r[t],e):!1}var Uq=Nq,zq=AI,$q=Uq;function Vq(e){return zq(function(t,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&$q(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++n<i;){var u=r[n];u&&e(t,u,n,o)}return t})}var TI=Vq,jq=EI,Hq=TI,Gq=Hq(function(e,t,r){jq(e,t,r)}),Wq=Gq;const Xq=oa(Wq);var Yq=EI,Zq=TI,qq=Zq(function(e,t,r,n){Yq(e,t,r,n)}),Kq=qq;const Qq=oa(Kq);function Jq(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var eK=Jq;function tK(e){return e!==e}var rK=tK;function nK(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var iK=nK,aK=eK,oK=rK,sK=iK;function uK(e,t,r){return t===t?sK(e,t,r):aK(e,oK,r)}var wI=uK;function lK(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}var cK=lK,fK=fI,hK=wI,pK=cK,dK=ey,vK=w5,mK=Array.prototype,i4=mK.splice;function gK(e,t,r,n){var i=n?pK:hK,o=-1,a=t.length,u=e;for(e===t&&(t=vK(t)),r&&(u=fK(e,dK(r)));++o<a;)for(var c=0,f=t[o],m=r?r(f):f;(c=i(u,m,c,n))>-1;)u!==e&&i4.call(u,c,1),i4.call(e,c,1);return e}var _K=gK,yK=_K;function xK(e,t){return e&&e.length&&t&&t.length?yK(e,t):e}var bK=xK,EK=AI,SK=bK,AK=EK(SK),TK=AK;const wK=oa(TK);var CK=lI,RK=Zl,IK="Expected a function";function MK(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(IK);return RK(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),CK(e,t,{leading:n,maxWait:t,trailing:i})}var PK=MK;const OK=oa(PK);var kK=wI;function DK(e,t){var r=e==null?0:e.length;return!!r&&kK(e,t,0)>-1}var FK=DK;function BK(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var LK=BK;function NK(){}var UK=NK,b3=tI,zK=UK,$K=P5,VK=1/0,jK=b3&&1/$K(new b3([,-0]))[1]==VK?function(e){return new b3(e)}:zK,HK=jK,GK=pI,WK=FK,XK=LK,YK=dI,ZK=HK,qK=P5,KK=200;function QK(e,t,r){var n=-1,i=WK,o=e.length,a=!0,u=[],c=u;if(r)a=!1,i=XK;else if(o>=KK){var f=t?null:ZK(e);if(f)return qK(f);a=!1,i=YK,c=new GK}else c=t?[]:u;e:for(;++n<o;){var m=e[n],_=t?t(m):m;if(m=r||m!==0?m:0,a&&_===_){for(var b=c.length;b--;)if(c[b]===_)continue e;t&&c.push(_),u.push(m)}else i(c,_,r)||(c!==u&&c.push(_),u.push(m))}return u}var JK=QK,eQ=JK;function tQ(e){return e&&e.length?eQ(e):[]}var rQ=tQ;const nQ=oa(rQ);function iQ(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o}var aQ=iQ,oQ=aQ;function sQ(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:oQ(e,t,r)}var uQ=sQ,lQ="\\ud800-\\udfff",cQ="\\u0300-\\u036f",fQ="\\ufe20-\\ufe2f",hQ="\\u20d0-\\u20ff",pQ=cQ+fQ+hQ,dQ="\\ufe0e\\ufe0f",vQ="\\u200d",mQ=RegExp("["+vQ+lQ+pQ+dQ+"]");function gQ(e){return mQ.test(e)}var CI=gQ;function _Q(e){return e.split("")}var yQ=_Q,RI="\\ud800-\\udfff",xQ="\\u0300-\\u036f",bQ="\\ufe20-\\ufe2f",EQ="\\u20d0-\\u20ff",SQ=xQ+bQ+EQ,AQ="\\ufe0e\\ufe0f",TQ="["+RI+"]",U6="["+SQ+"]",z6="\\ud83c[\\udffb-\\udfff]",wQ="(?:"+U6+"|"+z6+")",II="[^"+RI+"]",MI="(?:\\ud83c[\\udde6-\\uddff]){2}",PI="[\\ud800-\\udbff][\\udc00-\\udfff]",CQ="\\u200d",OI=wQ+"?",kI="["+AQ+"]?",RQ="(?:"+CQ+"(?:"+[II,MI,PI].join("|")+")"+kI+OI+")*",IQ=kI+OI+RQ,MQ="(?:"+[II+U6+"?",U6,MI,PI,TQ].join("|")+")",PQ=RegExp(z6+"(?="+z6+")|"+MQ+IQ,"g");function OQ(e){return e.match(PQ)||[]}var kQ=OQ,DQ=yQ,FQ=CI,BQ=kQ;function LQ(e){return FQ(e)?BQ(e):DQ(e)}var NQ=LQ,UQ=uQ,zQ=CI,$Q=NQ,VQ=Xm;function jQ(e){return function(t){t=VQ(t);var r=zQ(t)?$Q(t):void 0,n=r?r[0]:t.charAt(0),i=r?UQ(r,1).join(""):t.slice(1);return n[e]()+i}}var HQ=jQ,GQ=HQ,WQ=GQ("toUpperCase"),DI=WQ;const XQ=oa(DI);function YQ(e){return e===void 0}var ZQ=YQ;const qQ=oa(ZQ);var KQ=Xm,QQ=DI;function JQ(e){return QQ(KQ(e).toLowerCase())}var eJ=JQ;function tJ(e,t,r,n){var i=-1,o=e==null?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}var rJ=tJ;function nJ(e){return function(t){return e==null?void 0:e[t]}}var iJ=nJ,aJ=iJ,oJ={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},sJ=aJ(oJ),uJ=sJ,lJ=uJ,cJ=Xm,fJ=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,hJ="\\u0300-\\u036f",pJ="\\ufe20-\\ufe2f",dJ="\\u20d0-\\u20ff",vJ=hJ+pJ+dJ,mJ="["+vJ+"]",gJ=RegExp(mJ,"g");function _J(e){return e=cJ(e),e&&e.replace(fJ,lJ).replace(gJ,"")}var yJ=_J,xJ=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function bJ(e){return e.match(xJ)||[]}var EJ=bJ,SJ=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function AJ(e){return SJ.test(e)}var TJ=AJ,FI="\\ud800-\\udfff",wJ="\\u0300-\\u036f",CJ="\\ufe20-\\ufe2f",RJ="\\u20d0-\\u20ff",IJ=wJ+CJ+RJ,BI="\\u2700-\\u27bf",LI="a-z\\xdf-\\xf6\\xf8-\\xff",MJ="\\xac\\xb1\\xd7\\xf7",PJ="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",OJ="\\u2000-\\u206f",kJ=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",NI="A-Z\\xc0-\\xd6\\xd8-\\xde",DJ="\\ufe0e\\ufe0f",UI=MJ+PJ+OJ+kJ,zI="['’]",a4="["+UI+"]",FJ="["+IJ+"]",$I="\\d+",BJ="["+BI+"]",VI="["+LI+"]",jI="[^"+FI+UI+$I+BI+LI+NI+"]",LJ="\\ud83c[\\udffb-\\udfff]",NJ="(?:"+FJ+"|"+LJ+")",UJ="[^"+FI+"]",HI="(?:\\ud83c[\\udde6-\\uddff]){2}",GI="[\\ud800-\\udbff][\\udc00-\\udfff]",Bd="["+NI+"]",zJ="\\u200d",o4="(?:"+VI+"|"+jI+")",$J="(?:"+Bd+"|"+jI+")",s4="(?:"+zI+"(?:d|ll|m|re|s|t|ve))?",u4="(?:"+zI+"(?:D|LL|M|RE|S|T|VE))?",WI=NJ+"?",XI="["+DJ+"]?",VJ="(?:"+zJ+"(?:"+[UJ,HI,GI].join("|")+")"+XI+WI+")*",jJ="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",HJ="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",GJ=XI+WI+VJ,WJ="(?:"+[BJ,HI,GI].join("|")+")"+GJ,XJ=RegExp([Bd+"?"+VI+"+"+s4+"(?="+[a4,Bd,"$"].join("|")+")",$J+"+"+u4+"(?="+[a4,Bd+o4,"$"].join("|")+")",Bd+"?"+o4+"+"+s4,Bd+"+"+u4,HJ,jJ,$I,WJ].join("|"),"g");function YJ(e){return e.match(XJ)||[]}var ZJ=YJ,qJ=EJ,KJ=TJ,QJ=Xm,JJ=ZJ;function eee(e,t,r){return e=QJ(e),t=r?void 0:t,t===void 0?KJ(e)?JJ(e):qJ(e):e.match(t)||[]}var tee=eee,ree=rJ,nee=yJ,iee=tee,aee="['’]",oee=RegExp(aee,"g");function see(e){return function(t){return ree(iee(nee(t).replace(oee,"")),e,"")}}var uee=see,lee=eJ,cee=uee,fee=cee(function(e,t,r){return t=t.toLowerCase(),e+(r?lee(t):t)}),hee=fee;const pee=oa(hee);var Ci={isNil:rZ,merge:Xq,throttle:OK,isString:TZ,debounce:eX,pull:wK,isTypedArray:MV,isPlainObject:_Z,isNumber:uZ,isBoolean:ZX,isEqual:JY,cloneDeep:GW,uniq:nQ,clamp:WN,upperFirst:XQ,get:jX,mergeWith:Qq,isFunction:kU,isObject:fN,isUndefined:qQ,camelCase:pee};Ci.pull;function dee(e){var t=e;return typeof e=="string"&&(t=window.document.getElementById(e)),t}function YI(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function ZI(e){return YI(e).split(/\s+/)}function vee(e){var t,r=(t=document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.style;if(!r)return e[0];for(var n in e)if(e[n]&&e[n]in r)return e[n];return e[0]}function fl(e,t,r){var n=window.document.createElement(e);return t&&(n.className=t||""),r&&r.appendChild(n),n}function e_(e){var t=e.parentNode;t&&t.removeChild(e)}function nm(e,t){if(e.classList!==void 0)for(var r=ZI(t),n=0,i=r.length;n<i;n++)e.classList.add(r[n]);else if(!mee(e,t)){var o=O5(e);qI(e,(o?o+" ":"")+t)}}function $6(e,t){if(e.classList!==void 0){var r=ZI(t);r.forEach(function(n){e.classList.remove(n)})}else qI(e,YI((" "+O5(e)+" ").replace(" "+t+" "," ")))}function mee(e,t){if(e.classList!==void 0)return e.classList.contains(t);var r=O5(e);return r.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(r)}function qI(e,t){e instanceof HTMLElement?e.className=t:e.className.baseVal=t}function O5(e){return e instanceof SVGElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}vee(["transform","WebkitTransform"]);function gee(){var e,t=window.document.querySelector('meta[name="viewport"]');if(!t)return 1;var r=(e=t.content)===null||e===void 0?void 0:e.split(","),n=r.find(function(i){var o=i.split("="),a=Nn(o,1),u=a[0];return u==="initial-scale"});return n?n.split("=")[1]*1:1}var ul=gee()<1?1:window.devicePixelRatio;function _ee(e,t){e.setAttribute("style","".concat(e.style.cssText).concat(t))}function yee(e){return Object.entries(e).map(function(t){var r=Nn(t,2),n=r[0],i=r[1];return"".concat(n,": ").concat(i)}).join(";")}function xee(e,t){return{left:e.left-t.left,top:e.top-t.top,right:t.left+t.width-e.left-e.width,bottom:t.top+t.height-e.top-e.height}}function KI(e){e.innerHTML=""}function bee(e){e.setAttribute("draggable","false")}function Eee(e,t){for(var r=Array.isArray(t)?t:[t],n=e;n instanceof Element&&n!==window.document.body;){var i,o;if(r.find(function(a){var u;return(u=n)===null||u===void 0?void 0:u.matches(a)}))return n;n=(i=(o=n)===null||o===void 0?void 0:o.parentElement)!==null&&i!==void 0?i:null}}var E3;function See(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}var V6=(E3=navigator)===null||E3===void 0?void 0:E3.userAgent;V6.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);V6.indexOf("Android")>-1||V6.indexOf("Adr")>-1;function j6(e){var t=[1/0,1/0,-1/0,-1/0];return RR(e,function(r){t[0]>r[0]&&(t[0]=r[0]),t[1]>r[1]&&(t[1]=r[1]),t[2]<r[0]&&(t[2]=r[0]),t[3]<r[1]&&(t[3]=r[1])}),t}j6.default=j6;function S3(e){return typeof e=="number"}var l4=2*Math.PI*6378137/2;function Aee(e,t){var r=Nn(t,4),n=r[0],i=r[1],o=r[2],a=r[3];return e.lng>n&&e.lng<=o&&e.lat>i&&e.lat<=a}function Tee(e){var t=[1/0,1/0,-1/0,-1/0];return e.forEach(function(r){var n=r.coordinates;QI(t,n)}),t}function QI(e,t){return Array.isArray(t[0])?t.forEach(function(r){QI(e,r)}):(e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])),e}function A3(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{enable:!0,decimal:1};e=Ree(e,t);var n=e[0],i=e[1],o=n*l4/180,a=Math.log(Math.tan((90+i)*Math.PI/360))/(Math.PI/180);return a=a*l4/180,r.enable&&(o=Number(o.toFixed(r.decimal)),a=Number(a.toFixed(r.decimal))),e.length===3?[o,a,e[2]]:[o,a]}function wee(e){if(e==null)throw new Error("lng is required");return(e>180||e<-180)&&(e=e%360,e>180&&(e=-360+e),e<-180&&(e=360+e),e===0&&(e=0)),e}function Cee(e){if(e==null)throw new Error("lat is required");return(e>90||e<-90)&&(e=e%180,e>90&&(e=-180+e),e<-90&&(e=180+e),e===0&&(e=0)),e}function Ree(e,t){if(t===!1)return e;var r=wee(e[0]),n=Cee(e[1]);return n>85&&(n=85),n<-85&&(n=-85),e.length===3?[r,n,e[2]]:[r,n]}function ko(e){var t=85.0511287798,r=Math.max(Math.min(t,e[1]),-t),n=256<<20,i=Math.PI/180,o=e[0]*i,a=r*i;a=Math.log(Math.tan(Math.PI/4+a/2));var u=.5/Math.PI,c=.5,f=-.5/Math.PI;return i=.5,o=n*(u*o+c),a=n*(f*a+i),[Math.floor(o),Math.floor(a)]}function k5(e,t){var r=Math.abs(e[1][1]-e[0][1])*t,n=Math.abs(e[1][0]-e[0][0])*t;return[[e[0][0]-n,e[0][1]-r],[e[1][0]+n,e[1][1]+r]]}function JI(e,t){return e[0][0]<=t[0][0]&&e[0][1]<=t[0][1]&&e[1][0]>=t[1][0]&&e[1][1]>=t[1][1]}function t_(e){return[[e[0],e[1]],[e[2],e[3]]]}function Iee(e){var t=Mee(e,[0,0]);return[e[0]/t,e[1]/t]}function Mee(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))}function ih(e){if(S3(e[0]))return e;if(S3(e[0][0]))throw new Error("当前数据不支持标注");if(S3(e[0][0][0])){var t=e,r=0,n=0,i=0;return t.forEach(function(o){o.forEach(function(a){r+=a[0],n+=a[1],i++})}),[r/i,n/i,0]}else throw new Error("当前数据不支持标注")}function Pee(e){for(var t=e[0],r=e[1],n=e[0],i=e[1],o=0,a=0,u=0,c=0;c<e.length;c+=2){var f=e[c],m=e[c+1];f&&m&&(t=Math.max(f,t),r=Math.max(m,r),n=Math.min(f,n),i=Math.min(m,i),o+=f,a+=m,u++)}return{center:[o/u,a/u],radius:Math.sqrt(Math.pow(t-n,2)+Math.pow(r-i,2))/2}}function Oee(e){return j6(EL([bL(e)]))}function kee(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,r=e==="x"?t:t&3|8;return r.toString(16)})}var Dee=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:50,r=arguments.length>1?arguments[1]:void 0;Ht(this,e),this.limit=t,this.destroy=r||this.defaultDestroy,this.order=[],this.clear()}return jt(e,[{key:"clear",value:function(){var r=this;this.order.forEach(function(n){r.delete(n)}),this.cache={},this.order=[]}},{key:"get",value:function(r){var n=this.cache[r];return n&&(this.deleteOrder(r),this.appendOrder(r)),n}},{key:"set",value:function(r,n){this.cache[r]?(this.delete(r),this.cache[r]=n,this.appendOrder(r)):(Object.keys(this.cache).length===this.limit&&this.delete(this.order[0]),this.cache[r]=n,this.appendOrder(r))}},{key:"delete",value:function(r){var n=this.cache[r];n&&(this.deleteCache(r),this.deleteOrder(r),this.destroy(n,r))}},{key:"deleteCache",value:function(r){delete this.cache[r]}},{key:"deleteOrder",value:function(r){var n=this.order.findIndex(function(i){return i===r});n>=0&&this.order.splice(n,1)}},{key:"appendOrder",value:function(r){this.order.push(r)}},{key:"defaultDestroy",value:function(r,n){return null}}]),e}();function Fee(e){if(e.length===0)throw new Error("max requires at least one data point");for(var t=e[0],r=1;r<e.length;r++)e[r]>t&&(t=e[r]);return t*1}function Bee(e){if(e.length===0)throw new Error("min requires at least one data point");for(var t=e[0],r=1;r<e.length;r++)e[r]<t&&(t=e[r]);return t*1}function eM(e){if(e.length===0)return 0;for(var t=e[0]*1,r=1;r<e.length;r++)t+=e[r]*1;return t}function Lee(e){if(e.length===0)throw new Error("mean requires at least one data point");return eM(e)/e.length}function Nee(e){if(e.length===0)throw new Error("mean requires at least one data point");if(e.length<3)return e[0];e.sort();for(var t=e[0],r=NaN,n=0,i=1,o=1;o<e.length+1;o++)e[o]!==t?(i>n&&(n=i,r=t),i=1,t=e[o]):i++;return r*1}var tM={min:Bee,max:Fee,mean:Lee,sum:eM,mode:Nee};function rM(e,t){return e.map(function(r){return r[t]})}function c4(e,t,r,n,i,o,a){try{var u=e[o](a),c=u.value}catch(f){r(f);return}u.done?t(c):Promise.resolve(c).then(n,i)}function Mt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(c){c4(o,n,i,a,u,"next",c)}function u(c){c4(o,n,i,a,u,"throw",c)}a(void 0)})}}var nM={exports:{}},iM={exports:{}};(function(e){function t(r){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(iM);var Uee=iM.exports;(function(e){var t=Uee.default;function r(){e.exports=r=function(){return i},e.exports.__esModule=!0,e.exports.default=e.exports;var n,i={},o=Object.prototype,a=o.hasOwnProperty,u=Object.defineProperty||function(st,tt,dt){st[tt]=dt.value},c=typeof Symbol=="function"?Symbol:{},f=c.iterator||"@@iterator",m=c.asyncIterator||"@@asyncIterator",_=c.toStringTag||"@@toStringTag";function b(st,tt,dt){return Object.defineProperty(st,tt,{value:dt,enumerable:!0,configurable:!0,writable:!0}),st[tt]}try{b({},"")}catch{b=function(dt,nt,pr){return dt[nt]=pr}}function A(st,tt,dt,nt){var pr=tt&&tt.prototype instanceof V?tt:V,ur=Object.create(pr.prototype),Ar=new Gt(nt||[]);return u(ur,"_invoke",{value:ye(st,dt,Ar)}),ur}function w(st,tt,dt){try{return{type:"normal",arg:st.call(tt,dt)}}catch(nt){return{type:"throw",arg:nt}}}i.wrap=A;var R="suspendedStart",P="suspendedYield",k="executing",L="completed",B={};function V(){}function G(){}function K(){}var Z={};b(Z,f,function(){return this});var ve=Object.getPrototypeOf,Ie=ve&&ve(ve(Zt([])));Ie&&Ie!==o&&a.call(Ie,f)&&(Z=Ie);var de=K.prototype=V.prototype=Object.create(Z);function se(st){["next","throw","return"].forEach(function(tt){b(st,tt,function(dt){return this._invoke(tt,dt)})})}function le(st,tt){function dt(pr,ur,Ar,Xn){var pn=w(st[pr],st,ur);if(pn.type!=="throw"){var gi=pn.arg,Je=gi.value;return Je&&t(Je)=="object"&&a.call(Je,"__await")?tt.resolve(Je.__await).then(function(Qt){dt("next",Qt,Ar,Xn)},function(Qt){dt("throw",Qt,Ar,Xn)}):tt.resolve(Je).then(function(Qt){gi.value=Qt,Ar(gi)},function(Qt){return dt("throw",Qt,Ar,Xn)})}Xn(pn.arg)}var nt;u(this,"_invoke",{value:function(ur,Ar){function Xn(){return new tt(function(pn,gi){dt(ur,Ar,pn,gi)})}return nt=nt?nt.then(Xn,Xn):Xn()}})}function ye(st,tt,dt){var nt=R;return function(pr,ur){if(nt===k)throw new Error("Generator is already running");if(nt===L){if(pr==="throw")throw ur;return{value:n,done:!0}}for(dt.method=pr,dt.arg=ur;;){var Ar=dt.delegate;if(Ar){var Xn=ke(Ar,dt);if(Xn){if(Xn===B)continue;return Xn}}if(dt.method==="next")dt.sent=dt._sent=dt.arg;else if(dt.method==="throw"){if(nt===R)throw nt=L,dt.arg;dt.dispatchException(dt.arg)}else dt.method==="return"&&dt.abrupt("return",dt.arg);nt=k;var pn=w(st,tt,dt);if(pn.type==="normal"){if(nt=dt.done?L:P,pn.arg===B)continue;return{value:pn.arg,done:dt.done}}pn.type==="throw"&&(nt=L,dt.method="throw",dt.arg=pn.arg)}}}function ke(st,tt){var dt=tt.method,nt=st.iterator[dt];if(nt===n)return tt.delegate=null,dt==="throw"&&st.iterator.return&&(tt.method="return",tt.arg=n,ke(st,tt),tt.method==="throw")||dt!=="return"&&(tt.method="throw",tt.arg=new TypeError("The iterator does not provide a '"+dt+"' method")),B;var pr=w(nt,st.iterator,tt.arg);if(pr.type==="throw")return tt.method="throw",tt.arg=pr.arg,tt.delegate=null,B;var ur=pr.arg;return ur?ur.done?(tt[st.resultName]=ur.value,tt.next=st.nextLoc,tt.method!=="return"&&(tt.method="next",tt.arg=n),tt.delegate=null,B):ur:(tt.method="throw",tt.arg=new TypeError("iterator result is not an object"),tt.delegate=null,B)}function Rt(st){var tt={tryLoc:st[0]};1 in st&&(tt.catchLoc=st[1]),2 in st&&(tt.finallyLoc=st[2],tt.afterLoc=st[3]),this.tryEntries.push(tt)}function Lt(st){var tt=st.completion||{};tt.type="normal",delete tt.arg,st.completion=tt}function Gt(st){this.tryEntries=[{tryLoc:"root"}],st.forEach(Rt,this),this.reset(!0)}function Zt(st){if(st||st===""){var tt=st[f];if(tt)return tt.call(st);if(typeof st.next=="function")return st;if(!isNaN(st.length)){var dt=-1,nt=function pr(){for(;++dt<st.length;)if(a.call(st,dt))return pr.value=st[dt],pr.done=!1,pr;return pr.value=n,pr.done=!0,pr};return nt.next=nt}}throw new TypeError(t(st)+" is not iterable")}return G.prototype=K,u(de,"constructor",{value:K,configurable:!0}),u(K,"constructor",{value:G,configurable:!0}),G.displayName=b(K,_,"GeneratorFunction"),i.isGeneratorFunction=function(st){var tt=typeof st=="function"&&st.constructor;return!!tt&&(tt===G||(tt.displayName||tt.name)==="GeneratorFunction")},i.mark=function(st){return Object.setPrototypeOf?Object.setPrototypeOf(st,K):(st.__proto__=K,b(st,_,"GeneratorFunction")),st.prototype=Object.create(de),st},i.awrap=function(st){return{__await:st}},se(le.prototype),b(le.prototype,m,function(){return this}),i.AsyncIterator=le,i.async=function(st,tt,dt,nt,pr){pr===void 0&&(pr=Promise);var ur=new le(A(st,tt,dt,nt),pr);return i.isGeneratorFunction(tt)?ur:ur.next().then(function(Ar){return Ar.done?Ar.value:ur.next()})},se(de),b(de,_,"Generator"),b(de,f,function(){return this}),b(de,"toString",function(){return"[object Generator]"}),i.keys=function(st){var tt=Object(st),dt=[];for(var nt in tt)dt.push(nt);return dt.reverse(),function pr(){for(;dt.length;){var ur=dt.pop();if(ur in tt)return pr.value=ur,pr.done=!1,pr}return pr.done=!0,pr}},i.values=Zt,Gt.prototype={constructor:Gt,reset:function(tt){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(Lt),!tt)for(var dt in this)dt.charAt(0)==="t"&&a.call(this,dt)&&!isNaN(+dt.slice(1))&&(this[dt]=n)},stop:function(){this.done=!0;var tt=this.tryEntries[0].completion;if(tt.type==="throw")throw tt.arg;return this.rval},dispatchException:function(tt){if(this.done)throw tt;var dt=this;function nt(gi,Je){return Ar.type="throw",Ar.arg=tt,dt.next=gi,Je&&(dt.method="next",dt.arg=n),!!Je}for(var pr=this.tryEntries.length-1;pr>=0;--pr){var ur=this.tryEntries[pr],Ar=ur.completion;if(ur.tryLoc==="root")return nt("end");if(ur.tryLoc<=this.prev){var Xn=a.call(ur,"catchLoc"),pn=a.call(ur,"finallyLoc");if(Xn&&pn){if(this.prev<ur.catchLoc)return nt(ur.catchLoc,!0);if(this.prev<ur.finallyLoc)return nt(ur.finallyLoc)}else if(Xn){if(this.prev<ur.catchLoc)return nt(ur.catchLoc,!0)}else{if(!pn)throw new Error("try statement without catch or finally");if(this.prev<ur.finallyLoc)return nt(ur.finallyLoc)}}}},abrupt:function(tt,dt){for(var nt=this.tryEntries.length-1;nt>=0;--nt){var pr=this.tryEntries[nt];if(pr.tryLoc<=this.prev&&a.call(pr,"finallyLoc")&&this.prev<pr.finallyLoc){var ur=pr;break}}ur&&(tt==="break"||tt==="continue")&&ur.tryLoc<=dt&&dt<=ur.finallyLoc&&(ur=null);var Ar=ur?ur.completion:{};return Ar.type=tt,Ar.arg=dt,ur?(this.method="next",this.next=ur.finallyLoc,B):this.complete(Ar)},complete:function(tt,dt){if(tt.type==="throw")throw tt.arg;return tt.type==="break"||tt.type==="continue"?this.next=tt.arg:tt.type==="return"?(this.rval=this.arg=tt.arg,this.method="return",this.next="end"):tt.type==="normal"&&dt&&(this.next=dt),B},finish:function(tt){for(var dt=this.tryEntries.length-1;dt>=0;--dt){var nt=this.tryEntries[dt];if(nt.finallyLoc===tt)return this.complete(nt.completion,nt.afterLoc),Lt(nt),B}},catch:function(tt){for(var dt=this.tryEntries.length-1;dt>=0;--dt){var nt=this.tryEntries[dt];if(nt.tryLoc===tt){var pr=nt.completion;if(pr.type==="throw"){var ur=pr.arg;Lt(nt)}return ur}}throw new Error("illegal catch attempt")},delegateYield:function(tt,dt,nt){return this.delegate={iterator:Zt(tt),resultName:dt,nextLoc:nt},this.method==="next"&&(this.arg=n),B}},i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(nM);var zee=nM.exports,Rg=zee(),$ee=Rg;try{regeneratorRuntime=Rg}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Rg:Function("r","regeneratorRuntime = r")(Rg)}const he=oa($ee);function Vee(e,t){t===void 0&&(t={});var r=Number(e[0]),n=Number(e[1]),i=Number(e[2]),o=Number(e[3]);if(e.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var a=[r,n],u=[r,o],c=[i,o],f=[i,n];return f5([[a,f,c,u,a]],t.properties,{bbox:e,id:t.id})}var aM={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,f,m){this.fn=c,this.context=f,this.once=m||!1}function o(c,f,m,_,b){if(typeof m!="function")throw new TypeError("The listener must be a function");var A=new i(m,_||c,b),w=r?r+f:f;return c._events[w]?c._events[w].fn?c._events[w]=[c._events[w],A]:c._events[w].push(A):(c._events[w]=A,c._eventsCount++),c}function a(c,f){--c._eventsCount===0?c._events=new n:delete c._events[f]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],m,_;if(this._eventsCount===0)return f;for(_ in m=this._events)t.call(m,_)&&f.push(r?_.slice(1):_);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(m)):f},u.prototype.listeners=function(f){var m=r?r+f:f,_=this._events[m];if(!_)return[];if(_.fn)return[_.fn];for(var b=0,A=_.length,w=new Array(A);b<A;b++)w[b]=_[b].fn;return w},u.prototype.listenerCount=function(f){var m=r?r+f:f,_=this._events[m];return _?_.fn?1:_.length:0},u.prototype.emit=function(f,m,_,b,A,w){var R=r?r+f:f;if(!this._events[R])return!1;var P=this._events[R],k=arguments.length,L,B;if(P.fn){switch(P.once&&this.removeListener(f,P.fn,void 0,!0),k){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,m),!0;case 3:return P.fn.call(P.context,m,_),!0;case 4:return P.fn.call(P.context,m,_,b),!0;case 5:return P.fn.call(P.context,m,_,b,A),!0;case 6:return P.fn.call(P.context,m,_,b,A,w),!0}for(B=1,L=new Array(k-1);B<k;B++)L[B-1]=arguments[B];P.fn.apply(P.context,L)}else{var V=P.length,G;for(B=0;B<V;B++)switch(P[B].once&&this.removeListener(f,P[B].fn,void 0,!0),k){case 1:P[B].fn.call(P[B].context);break;case 2:P[B].fn.call(P[B].context,m);break;case 3:P[B].fn.call(P[B].context,m,_);break;case 4:P[B].fn.call(P[B].context,m,_,b);break;default:if(!L)for(G=1,L=new Array(k-1);G<k;G++)L[G-1]=arguments[G];P[B].fn.apply(P[B].context,L)}}return!0},u.prototype.on=function(f,m,_){return o(this,f,m,_,!1)},u.prototype.once=function(f,m,_){return o(this,f,m,_,!0)},u.prototype.removeListener=function(f,m,_,b){var A=r?r+f:f;if(!this._events[A])return this;if(!m)return a(this,A),this;var w=this._events[A];if(w.fn)w.fn===m&&(!b||w.once)&&(!_||w.context===_)&&a(this,A);else{for(var R=0,P=[],k=w.length;R<k;R++)(w[R].fn!==m||b&&!w[R].once||_&&w[R].context!==_)&&P.push(w[R]);P.length?this._events[A]=P.length===1?P[0]:P:a(this,A)}return this},u.prototype.removeAllListeners=function(f){var m;return f?(m=r?r+f:f,this._events[m]&&a(this,m)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=r,u.EventEmitter=u,e.exports=u})(aM);var ju=aM.exports;const D5=oa(ju);var Ig=function(e){return e.Realtime="realtime",e.Overlap="overlap",e.Replace="replace",e}({}),dc=function(e){return e.Loading="Loading",e.Loaded="Loaded",e.Failure="Failure",e.Cancelled="Cancelled",e}({}),oM=0,f4=1,iy=2;function jee(e){e.forEach(function(t){t.isCurrent&&(t.isVisible=t.isLoaded)})}function Hee(e){e.forEach(function(t){t.properties.state=oM}),e.forEach(function(t){t.isCurrent&&!sM(t)&&F5(t)}),e.forEach(function(t){t.isVisible=!!(t.properties.state&iy)})}function Gee(e){e.forEach(function(r){r.properties.state=oM}),e.forEach(function(r){r.isCurrent&&sM(r)});var t=e.slice().sort(function(r,n){return r.z-n.z});t.forEach(function(r){r.isVisible=!!(r.properties.state&iy),r.children.length&&(r.isVisible||r.properties.state&f4)?r.children.forEach(function(n){n.properties.state=f4}):r.isCurrent&&F5(r)})}function sM(e){for(;e;){if(e.isLoaded)return e.properties.state|=iy,!0;e=e.parent}return!1}function F5(e){e.children.forEach(function(t){t.isLoaded?t.properties.state|=iy:F5(t)})}var hv,uM=[-1/0,-1/0,1/0,1/0],Wee=.2,Xee=5,Yee=(hv={},F(hv,Ig.Realtime,jee),F(hv,Ig.Overlap,Hee),F(hv,Ig.Replace,Gee),hv),Zee=function(){};function H6(e,t,r){var n=Math.floor((e+180)/360*Math.pow(2,r)),i=Math.floor((1-Math.log(Math.tan(t*Math.PI/180)+1/Math.cos(t*Math.PI/180))/Math.PI)/2*Math.pow(2,r));return[n,i]}function h4(e,t,r){var n=e/Math.pow(2,r)*360-180,i=Math.PI-2*Math.PI*t/Math.pow(2,r),o=180/Math.PI*Math.atan(.5*(Math.exp(i)-Math.exp(-i)));return[n,o]}var lM=function(t,r,n){var i=h4(t,r,n),o=Nn(i,2),a=o[0],u=o[1],c=h4(t+1,r+1,n),f=Nn(c,2),m=f[0],_=f[1];return[a,_,m,u]};function qee(e){var t=e.zoom,r=e.latLonBounds,n=e.maxZoom,i=n===void 0?1/0:n,o=e.minZoom,a=o===void 0?0:o,u=e.zoomOffset,c=u===void 0?0:u,f=e.extent,m=f===void 0?uM:f,_=Math.ceil(t)+c;if(Number.isFinite(a)&&_<a)return[];Number.isFinite(i)&&_>i&&(_=i);for(var b=Nn(r,4),A=b[0],w=b[1],R=b[2],P=b[3],k=[Math.max(A,m[0]),Math.max(w,m[1]),Math.min(R,m[2]),Math.min(P,m[3])],L=[],B=H6(k[0],k[1],_),V=Nn(B,2),G=V[0],K=V[1],Z=H6(k[2],k[3],_),ve=Nn(Z,2),Ie=ve[0],de=ve[1],se=G;se<=Ie;se++)for(var le=de;le<=K;le++)L.push({x:se,y:le,z:_});var ye=(Ie+G)/2,ke=(K+de)/2,Rt=function(Gt,Zt){return Math.abs(Gt-ye)+Math.abs(Zt-ke)};return L.sort(function(Lt,Gt){return Rt(Lt.x,Lt.y)-Rt(Gt.x,Gt.y)}),L}var Kee=function(t,r,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=Math.pow(2,n),a=o-1,u=o,c=t,f=r;return i&&(c<0?c=c+u:c>a&&(c=c%u)),{warpX:c,warpY:f}};function Qee(e){var t=Jee();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Jee(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ete=function(e){_n(r,e);var t=Qee(r);function r(n){var i;Ht(this,r),i=t.call(this),F($e(i),"tileSize",256),F($e(i),"isVisible",!1),F($e(i),"isCurrent",!1),F($e(i),"isVisibleChange",!1),F($e(i),"loadedLayers",0),F($e(i),"isLayerLoaded",!1),F($e(i),"isLoad",!1),F($e(i),"isChildLoad",!1),F($e(i),"parent",null),F($e(i),"children",[]),F($e(i),"data",null),F($e(i),"properties",{}),F($e(i),"loadDataId",0);var o=n.x,a=n.y,u=n.z,c=n.tileSize,f=n.warp,m=f===void 0?!0:f;return i.x=o,i.y=a,i.z=u,i.warp=m||!0,i.tileSize=c,i}return jt(r,[{key:"isLoading",get:function(){return this.loadStatus===dc.Loading}},{key:"isLoaded",get:function(){return this.loadStatus===dc.Loaded}},{key:"isFailure",get:function(){return this.loadStatus===dc.Failure}},{key:"setTileLayerLoaded",value:function(){this.isLayerLoaded=!0}},{key:"isCancelled",get:function(){return this.loadStatus===dc.Cancelled}},{key:"isDone",get:function(){return[dc.Loaded,dc.Cancelled,dc.Failure].includes(this.loadStatus)}},{key:"bounds",get:function(){return lM(this.x,this.y,this.z)}},{key:"bboxPolygon",get:function(){var i=Nn(this.bounds,4),o=i[0],a=i[1],u=i[2],c=i[3],f=[(u-o)/2,(c-a)/2],m=Vee(this.bounds,{properties:{key:this.key,id:this.key,bbox:this.bounds,center:f,meta:`
|
|
`.concat(this.key,`
|
|
`)}});return m}},{key:"key",get:function(){var i="".concat(this.x,"_").concat(this.y,"_").concat(this.z);return i}},{key:"layerLoad",value:function(){this.loadedLayers++,this.emit("layerLoaded")}},{key:"loadData",value:function(){var n=Mt(he.mark(function o(a){var u,c,f,m,_,b,A,w,R,P,k,L,B,V,G,K,Z;return he.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:return u=a.getData,c=a.onLoad,f=a.onError,this.loadDataId++,m=this.loadDataId,this.isLoading&&this.abortLoad(),this.abortController=new AbortController,this.loadStatus=dc.Loading,_=null,Ie.prev=7,A=this.x,w=this.y,R=this.z,P=this.bounds,k=this.tileSize,L=this.warp,B=Kee(A,w,R,L),V=B.warpX,G=B.warpY,K=this.abortController.signal,Z={x:V,y:G,z:R,bounds:P,tileSize:k,signal:K,warp:L},Ie.next=14,u(Z,this);case 14:_=Ie.sent,Ie.next=20;break;case 17:Ie.prev=17,Ie.t0=Ie.catch(7),b=Ie.t0;case 20:if(m===this.loadDataId){Ie.next=22;break}return Ie.abrupt("return");case 22:if(!(this.isCancelled&&!_)){Ie.next=24;break}return Ie.abrupt("return");case 24:if(!(b||!_)){Ie.next=28;break}return this.loadStatus=dc.Failure,f(b,this),Ie.abrupt("return");case 28:this.loadStatus=dc.Loaded,this.data=_,c(this);case 31:case"end":return Ie.stop()}},o,this,[[7,17]])}));function i(o){return n.apply(this,arguments)}return i}()},{key:"reloadData",value:function(i){this.isLoading&&this.abortLoad(),this.loadData(i)}},{key:"abortLoad",value:function(){this.isLoaded||this.isCancelled||(this.loadStatus=dc.Cancelled,this.abortController.abort(),this.xhrCancel&&this.xhrCancel())}}]),r}(ju.EventEmitter),tte=function(t,r){var n=t_(t),i=k5(n,r),o=360*3-180,a=85.0511287798065,u=[Math.max(i[0][0],-o),Math.max(i[0][1],-a),Math.min(i[1][0],o),Math.min(i[1][1],a)];return u},rte=function(t,r){var n=t_(t),i=t_(r),o=JI(n,i);return o};function Wh(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=nte(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function nte(e,t){if(e){if(typeof e=="string")return p4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p4(e,t)}}function p4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ite(e){var t=ate();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function ate(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ote=Ci.throttle,_d=function(e){return e.TilesLoadStart="tiles-load-start",e.TileLoaded="tile-loaded",e.TileError="tile-error",e.TileUnload="tile-unload",e.TileUpdate="tile-update",e.TilesLoadFinished="tiles-load-finished",e}({}),ste=function(e){_n(r,e);var t=ite(r);function r(n){var i;return Ht(this,r),i=t.call(this),F($e(i),"currentTiles",[]),F($e(i),"cacheTiles",new Map),F($e(i),"throttleUpdate",ote(function(o,a){i.update(o,a)},16)),F($e(i),"onTileLoad",function(o){i.emit(_d.TileLoaded,o),i.updateTileVisible(),i.loadFinished()}),F($e(i),"onTileError",function(o,a){i.emit(_d.TileError,{error:o,tile:a}),i.updateTileVisible(),i.loadFinished()}),F($e(i),"onTileUnload",function(o){i.emit(_d.TileUnload,o),i.loadFinished()}),i.options={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,extent:uM,getTileData:Zee,warp:!0,updateStrategy:Ig.Replace},i.updateOptions(n),i}return jt(r,[{key:"isLoaded",get:function(){return this.currentTiles.every(function(i){return i.isDone})}},{key:"tiles",get:function(){var i=Array.from(this.cacheTiles.values()).sort(function(o,a){return o.z-a.z});return i}},{key:"updateOptions",value:function(i){var o=i.minZoom===void 0?this.options.minZoom:Math.ceil(i.minZoom),a=i.maxZoom===void 0?this.options.maxZoom:Math.floor(i.maxZoom);this.options=Qe(Qe(Qe({},this.options),i),{},{minZoom:o,maxZoom:a})}},{key:"update",value:function(i,o){var a=this,u=Math.max(0,Math.ceil(i));if(!(this.lastViewStates&&this.lastViewStates.zoom===u&&rte(this.lastViewStates.latLonBoundsBuffer,o))){var c=tte(o,Wee);this.lastViewStates={zoom:u,latLonBounds:o,latLonBoundsBuffer:c},this.currentZoom=u;var f=!1,m=this.getTileIndices(u,c).filter(function(_){return a.options.warp||_.x>=0&&_.x<Math.pow(2,u)});this.emit(_d.TilesLoadStart),this.currentTiles=m.map(function(_){var b=_.x,A=_.y,w=_.z,R=a.getTile(b,A,w);if(R){var P,k,L=((P=R)===null||P===void 0?void 0:P.isFailure)||((k=R)===null||k===void 0?void 0:k.isCancelled);return L&&R.loadData({getData:a.options.getTileData,onLoad:a.onTileLoad,onError:a.onTileError}),R}return R=a.createTile(b,A,w),f=!0,R}),f&&this.resizeCacheTiles(),this.updateTileVisible(),this.pruneRequests()}}},{key:"reloadAll",value:function(){var i=Wh(this.cacheTiles),o;try{for(i.s();!(o=i.n()).done;){var a=Nn(o.value,2),u=a[0],c=a[1];if(!this.currentTiles.includes(c)){this.cacheTiles.delete(u),this.onTileUnload(c);return}this.onTileUnload(c),c.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError})}}catch(f){i.e(f)}finally{i.f()}}},{key:"reloadTileById",value:function(i,o,a){var u=this.cacheTiles.get("".concat(o,",").concat(a,",").concat(i));u&&(this.onTileUnload(u),u.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}))}},{key:"reloadTileByLnglat",value:function(i,o,a){var u=this.getTileByLngLat(i,o,a);u&&this.reloadTileById(u.z,u.x,u.y)}},{key:"reloadTileByExtent",value:function(i,o){var a=this,u=this.getTileIndices(o,i);u.forEach(function(c){a.reloadTileById(c.z,c.x,c.y)})}},{key:"pruneRequests",value:function(){var i=[],o=Wh(this.cacheTiles.values()),a;try{for(o.s();!(a=o.n()).done;){var u=a.value;u.isLoading&&!u.isCurrent&&!u.isVisible&&i.push(u)}}catch(f){o.e(f)}finally{o.f()}for(;i.length>0;){var c=i.shift();c.abortLoad()}}},{key:"getTileByLngLat",value:function(i,o,a){var u=this.options.zoomOffset,c=Math.ceil(a)+u,f=H6(i,o,c),m=this.tiles.filter(function(_){return _.key==="".concat(f[0],"_").concat(f[1],"_").concat(c)});return m[0]}},{key:"getTileExtent",value:function(i,o){return this.getTileIndices(o,i)}},{key:"getTileByZXY",value:function(i,o,a){var u=this.tiles.filter(function(c){return c.key==="".concat(o,"_").concat(a,"_").concat(i)});return u[0]}},{key:"clear",value:function(){var i=Wh(this.cacheTiles.values()),o;try{for(i.s();!(o=i.n()).done;){var a=o.value;a.isLoading?a.abortLoad():this.onTileUnload(a)}}catch(u){i.e(u)}finally{i.f()}this.lastViewStates=void 0,this.cacheTiles.clear(),this.currentTiles=[]}},{key:"destroy",value:function(){this.clear(),this.removeAllListeners()}},{key:"updateTileVisible",value:function(){var i=this.options.updateStrategy,o=new Map,a=Wh(this.cacheTiles.values()),u;try{for(a.s();!(u=a.n()).done;){var c=u.value;o.set(c.key,c.isVisible),c.isCurrent=!1,c.isVisible=!1}}catch(w){a.e(w)}finally{a.f()}var f=Wh(this.currentTiles),m;try{for(f.s();!(m=f.n()).done;){var _=m.value;_.isCurrent=!0,_.isVisible=!0}}catch(w){f.e(w)}finally{f.f()}var b=Array.from(this.cacheTiles.values());typeof i=="function"?i(b):Yee[i](b);var A=!1;Array.from(this.cacheTiles.values()).forEach(function(w){w.isVisible!==o.get(w.key)?(w.isVisibleChange=!0,A=!0):w.isVisibleChange=!1}),A&&this.emit(_d.TileUpdate)}},{key:"getTileIndices",value:function(i,o){var a=this.options,u=a.tileSize,c=a.extent,f=a.zoomOffset,m=Math.floor(this.options.maxZoom),_=Math.ceil(this.options.minZoom),b=qee({maxZoom:m,minZoom:_,zoomOffset:f,tileSize:u,zoom:i,latLonBounds:o,extent:c});return b}},{key:"getTileId",value:function(i,o,a){var u="".concat(i,",").concat(o,",").concat(a);return u}},{key:"loadFinished",value:function(){var i=!this.currentTiles.some(function(o){return!o.isDone});return i&&this.emit(_d.TilesLoadFinished),i}},{key:"getTile",value:function(i,o,a){var u=this.getTileId(i,o,a),c=this.cacheTiles.get(u);return c}},{key:"createTile",value:function(i,o,a){var u=this.getTileId(i,o,a),c=new ete({x:i,y:o,z:a,tileSize:this.options.tileSize,warp:this.options.warp});return this.cacheTiles.set(u,c),c.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}),c}},{key:"resizeCacheTiles",value:function(){var i=Xee*this.currentTiles.length,o=this.cacheTiles.size>i;if(o){var a=Wh(this.cacheTiles),u;try{for(a.s();!(u=a.n()).done;){var c=Nn(u.value,2),f=c[0],m=c[1];if(!m.isVisible&&!this.currentTiles.includes(m)&&(this.cacheTiles.delete(f),this.onTileUnload(m)),this.cacheTiles.size<=i)break}}catch(_){a.e(_)}finally{a.f()}}this.rebuildTileTree()}},{key:"rebuildTileTree",value:function(){var i=Wh(this.cacheTiles.values()),o;try{for(i.s();!(o=i.n()).done;){var a=o.value;a.parent=null,a.children.length=0}}catch(_){i.e(_)}finally{i.f()}var u=Wh(this.cacheTiles.values()),c;try{for(u.s();!(c=u.n()).done;){var f=c.value,m=this.getNearestAncestor(f.x,f.y,f.z);f.parent=m,m!=null&&m.children&&m.children.push(f)}}catch(_){u.e(_)}finally{u.f()}}},{key:"getNearestAncestor",value:function(i,o,a){for(;a>this.options.minZoom;){i=Math.floor(i/2),o=Math.floor(o/2),a=a-1;var u=this.getTile(i,o,a);if(u)return u}return null}}]),r}(D5);function cM(e){var t=[],r=/\{([a-z])-([a-z])\}/.exec(e);if(r){var n=r[1].charCodeAt(0),i=r[2].charCodeAt(0),o;for(o=n;o<=i;++o)t.push(e.replace(r[0],String.fromCharCode(o)));return t}if(r=/\{(\d+)-(\d+)\}/.exec(e),r){for(var a=parseInt(r[2],10),u=parseInt(r[1],10);u<=a;u++)t.push(e.replace(r[0],u.toString()));return t}return t.push(e),t}function Kd(e,t){if(!e||!e.length)throw new Error("url is not allowed to be empty");var r=t.x,n=t.y,i=t.z,o=cM(e),a=Math.abs(r+n)%o.length,u=h5(o[a])?"".concat(o[a],"/{z}/{x}/{y}"):o[a];return u.replace(/\{x\}/g,r.toString()).replace(/\{y\}/g,n.toString()).replace(/\{z\}/g,i.toString()).replace(/\{bbox\}/g,lM(r,n,i).join(",")).replace(/\{-y\}/g,(Math.pow(2,i)-n-1).toString())}function ute(e,t){var r=t.x,n=t.y,i=t.z,o=t.layer,a=t.version,u=a===void 0?"1.0.0":a,c=t.style,f=c===void 0?"default":c,m=t.format,_=t.service,b=_===void 0?"WMTS":_,A=t.tileMatrixset,w=cM(e),R=Math.abs(r+n)%w.length,P="".concat(w[R],"&SERVICE=").concat(b,"&REQUEST=GetTile&VERSION=").concat(u,"&LAYER=").concat(o,"&STYLE=").concat(f,"&TILEMATRIXSET=").concat(A,"&FORMAT=").concat(m,"&TILECOL=").concat(r,"&TILEROW=").concat(n,"&TILEMATRIX=").concat(i);return P}function G6(e,t){if(!e)throw new Error(t||"web worker helper assertion failed.")}var T3=new Map;function lte(e){G6(e.source&&!e.url||!e.source&&e.url);var t=T3.get(e.source||e.url);return t||(e.url&&(t=cte(e.url),T3.set(e.url,t)),e.source&&(t=fM(e.source),T3.set(e.source,t))),G6(t),t}function cte(e){if(!e.startsWith("http"))return e;var t=fte(e);return fM(t)}function fM(e){var t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function fte(e){return`try {
|
|
importScripts('`+e+`');
|
|
} catch (error) {
|
|
console.error(error);
|
|
throw error;
|
|
}`}function B5(e,t,r){t===void 0&&(t=!0);var n=r||new Set;if(e){if(d4(e))n.add(e);else if(d4(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(var i in e)B5(e[i],t,n)}}return r===void 0?Array.from(n):[]}function d4(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}var w3=function(){};(function(){function e(t){this.terminated=!1,this.loadableURL="";var r=t.name,n=t.source,i=t.url;G6(n||i),this.name=r,this.source=n,this.url=i,this.onMessage=w3,this.onError=function(o){return console.log(o)},this.worker=this.createBrowserWorker()}return e.isSupported=function(){return typeof Worker<"u"},e.prototype.destroy=function(){this.onMessage=w3,this.onError=w3,this.worker.terminate(),this.terminated=!0},Object.defineProperty(e.prototype,"isRunning",{get:function(){return!!this.onMessage},enumerable:!1,configurable:!0}),e.prototype.postMessage=function(t,r){r=r||B5(t),this.worker.postMessage(t,r)},e.prototype.getErrorFromErrorEvent=function(t){var r="Failed to load ";return r+="worker "+this.name+" from "+this.url+". ",t.message&&(r+=t.message+" in "),t.lineno&&(r+=":"+t.lineno+":"+t.colno),new Error(r)},e.prototype.createBrowserWorker=function(){var t=this;this.loadableURL=lte({source:this.source,url:this.url});var r=new Worker(this.loadableURL,{name:this.name});return r.onmessage=function(n){n.data?t.onMessage(n.data):t.onError(new Error("No data received"))},r.onerror=function(n){t.onError(t.getErrorFromErrorEvent(n)),t.terminated=!0},r.onmessageerror=function(n){return console.error("worker "+t.name+", message error: "+n)},r},e})();var C3=new Map;(function(){function e(){}return Object.defineProperty(e,"onmessage",{set:function(t){self.onmessage=function(r){if(v4(r)){var n=r.data,i=n.type,o=n.payload;t(i,o)}}},enumerable:!1,configurable:!0}),e.addEventListener=function(t){var r=C3.get(t);r||(r=function(n){if(v4(n)){var i=n.data,o=i.type,a=i.payload;t(o,a)}}),self.addEventListener("message",r)},e.removeEventListener=function(t){var r=C3.get(t);C3.delete(t),self.removeEventListener("message",r)},e.postMessage=function(t,r){if(self){var n={source:"Worker thread",type:t,payload:r},i=B5(r);self.postMessage(n,i)}},e})();function v4(e){var t=e.type,r=e.data;return t==="message"&&r&&typeof r.source=="string"&&r.source==="Main thread"}function L5(e){var t=e.color;return!t||!t.length?[1,1,1,1]:t}function N5(e,t,r){return r.length===2?[r[0],r[1],0]:[r[0],r[1],r[2]]}function U5(e){var t=e.filter;return t?[1]:[0]}function z5(e,t){return[t]}var $5={exports:{}};$5.exports=ay;$5.exports.default=ay;function ay(e,t,r){r=r||2;var n=t&&t.length,i=n?t[0]*r:e.length,o=hM(e,0,i,r,!0),a=[];if(!o||o.next===o.prev)return a;var u,c,f,m,_,b,A;if(n&&(o=mte(e,t,o,r)),e.length>80*r){u=f=e[0],c=m=e[1];for(var w=r;w<i;w+=r)_=e[w],b=e[w+1],_<u&&(u=_),b<c&&(c=b),_>f&&(f=_),b>m&&(m=b);A=Math.max(f-u,m-c),A=A!==0?32767/A:0}return ym(o,a,r,u,c,A,0),a}function hM(e,t,r,n,i){var o,a;if(i===Y6(e,t,r,n)>0)for(o=t;o<r;o+=n)a=m4(o,e[o],e[o+1],a);else for(o=r-n;o>=t;o-=n)a=m4(o,e[o],e[o+1],a);return a&&oy(a,a.next)&&(bm(a),a=a.next),a}function E1(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(oy(r,r.next)||So(r.prev,r,r.next)===0)){if(bm(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function ym(e,t,r,n,i,o,a){if(e){!a&&o&&bte(e,n,i,o);for(var u=e,c,f;e.prev!==e.next;){if(c=e.prev,f=e.next,o?pte(e,n,i,o):hte(e)){t.push(c.i/r|0),t.push(e.i/r|0),t.push(f.i/r|0),bm(e),e=f.next,u=f.next;continue}if(e=f,e===u){a?a===1?(e=dte(E1(e),t,r),ym(e,t,r,n,i,o,2)):a===2&&vte(e,t,r,n,i,o):ym(E1(e),t,r,n,i,o,1);break}}}}function hte(e){var t=e.prev,r=e,n=e.next;if(So(t,r,n)>=0)return!1;for(var i=t.x,o=r.x,a=n.x,u=t.y,c=r.y,f=n.y,m=i<o?i<a?i:a:o<a?o:a,_=u<c?u<f?u:f:c<f?c:f,b=i>o?i>a?i:a:o>a?o:a,A=u>c?u>f?u:f:c>f?c:f,w=n.next;w!==t;){if(w.x>=m&&w.x<=b&&w.y>=_&&w.y<=A&&Ud(i,u,o,c,a,f,w.x,w.y)&&So(w.prev,w,w.next)>=0)return!1;w=w.next}return!0}function pte(e,t,r,n){var i=e.prev,o=e,a=e.next;if(So(i,o,a)>=0)return!1;for(var u=i.x,c=o.x,f=a.x,m=i.y,_=o.y,b=a.y,A=u<c?u<f?u:f:c<f?c:f,w=m<_?m<b?m:b:_<b?_:b,R=u>c?u>f?u:f:c>f?c:f,P=m>_?m>b?m:b:_>b?_:b,k=W6(A,w,t,r,n),L=W6(R,P,t,r,n),B=e.prevZ,V=e.nextZ;B&&B.z>=k&&V&&V.z<=L;){if(B.x>=A&&B.x<=R&&B.y>=w&&B.y<=P&&B!==i&&B!==a&&Ud(u,m,c,_,f,b,B.x,B.y)&&So(B.prev,B,B.next)>=0||(B=B.prevZ,V.x>=A&&V.x<=R&&V.y>=w&&V.y<=P&&V!==i&&V!==a&&Ud(u,m,c,_,f,b,V.x,V.y)&&So(V.prev,V,V.next)>=0))return!1;V=V.nextZ}for(;B&&B.z>=k;){if(B.x>=A&&B.x<=R&&B.y>=w&&B.y<=P&&B!==i&&B!==a&&Ud(u,m,c,_,f,b,B.x,B.y)&&So(B.prev,B,B.next)>=0)return!1;B=B.prevZ}for(;V&&V.z<=L;){if(V.x>=A&&V.x<=R&&V.y>=w&&V.y<=P&&V!==i&&V!==a&&Ud(u,m,c,_,f,b,V.x,V.y)&&So(V.prev,V,V.next)>=0)return!1;V=V.nextZ}return!0}function dte(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!oy(i,o)&&pM(i,n,n.next,o)&&xm(i,o)&&xm(o,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(o.i/r|0),bm(n),bm(n.next),n=e=o),n=n.next}while(n!==e);return E1(n)}function vte(e,t,r,n,i,o){var a=e;do{for(var u=a.next.next;u!==a.prev;){if(a.i!==u.i&&Ate(a,u)){var c=dM(a,u);a=E1(a,a.next),c=E1(c,c.next),ym(a,t,r,n,i,o,0),ym(c,t,r,n,i,o,0);return}u=u.next}a=a.next}while(a!==e)}function mte(e,t,r,n){var i=[],o,a,u,c,f;for(o=0,a=t.length;o<a;o++)u=t[o]*n,c=o<a-1?t[o+1]*n:e.length,f=hM(e,u,c,n,!1),f===f.next&&(f.steiner=!0),i.push(Ste(f));for(i.sort(gte),o=0;o<i.length;o++)r=_te(i[o],r);return r}function gte(e,t){return e.x-t.x}function _te(e,t){var r=yte(e,t);if(!r)return t;var n=dM(r,e);return E1(n,n.next),E1(r,r.next)}function yte(e,t){var r=t,n=e.x,i=e.y,o=-1/0,a;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=n&&u>o&&(o=u,a=r.x<r.next.x?r:r.next,u===n))return a}r=r.next}while(r!==t);if(!a)return null;var c=a,f=a.x,m=a.y,_=1/0,b;r=a;do n>=r.x&&r.x>=f&&n!==r.x&&Ud(i<m?n:o,i,f,m,i<m?o:n,i,r.x,r.y)&&(b=Math.abs(i-r.y)/(n-r.x),xm(r,e)&&(b<_||b===_&&(r.x>a.x||r.x===a.x&&xte(a,r)))&&(a=r,_=b)),r=r.next;while(r!==c);return a}function xte(e,t){return So(e.prev,e,t.prev)<0&&So(t.next,e,e.next)<0}function bte(e,t,r,n){var i=e;do i.z===0&&(i.z=W6(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,Ete(i)}function Ete(e){var t,r,n,i,o,a,u,c,f=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,u=0,t=0;t<f&&(u++,n=n.nextZ,!!n);t++);for(c=f;u>0||c>0&&n;)u!==0&&(c===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,u--):(i=n,n=n.nextZ,c--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,f*=2}while(a>1);return e}function W6(e,t,r,n,i){return e=(e-r)*i|0,t=(t-n)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Ste(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function Ud(e,t,r,n,i,o,a,u){return(i-a)*(t-u)>=(e-a)*(o-u)&&(e-a)*(n-u)>=(r-a)*(t-u)&&(r-a)*(o-u)>=(i-a)*(n-u)}function Ate(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Tte(e,t)&&(xm(e,t)&&xm(t,e)&&wte(e,t)&&(So(e.prev,e,t.prev)||So(e,t.prev,t))||oy(e,t)&&So(e.prev,e,e.next)>0&&So(t.prev,t,t.next)>0)}function So(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function oy(e,t){return e.x===t.x&&e.y===t.y}function pM(e,t,r,n){var i=W2(So(e,t,r)),o=W2(So(e,t,n)),a=W2(So(r,n,e)),u=W2(So(r,n,t));return!!(i!==o&&a!==u||i===0&&G2(e,r,t)||o===0&&G2(e,n,t)||a===0&&G2(r,e,n)||u===0&&G2(r,t,n))}function G2(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function W2(e){return e>0?1:e<0?-1:0}function Tte(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&pM(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function xm(e,t){return So(e.prev,e,e.next)<0?So(e,t,e.next)>=0&&So(e,e.prev,t)>=0:So(e,t,e.prev)<0||So(e,e.next,t)<0}function wte(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function dM(e,t){var r=new X6(e.i,e.x,e.y),n=new X6(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function m4(e,t,r,n){var i=new X6(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function bm(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function X6(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}ay.deviation=function(e,t,r,n){var i=t&&t.length,o=i?t[0]*r:e.length,a=Math.abs(Y6(e,0,o,r));if(i)for(var u=0,c=t.length;u<c;u++){var f=t[u]*r,m=u<c-1?t[u+1]*r:e.length;a-=Math.abs(Y6(e,f,m,r))}var _=0;for(u=0;u<n.length;u+=3){var b=n[u]*r,A=n[u+1]*r,w=n[u+2]*r;_+=Math.abs((e[b]-e[w])*(e[A+1]-e[b+1])-(e[b]-e[A])*(e[w+1]-e[b+1]))}return a===0&&_===0?0:Math.abs((_-a)/a)};function Y6(e,t,r,n){for(var i=0,o=t,a=r-n;o<r;o+=n)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}ay.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[i][o][a]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r};var Cte=$5.exports;const mf=oa(Cte);var po=1e-6,au=typeof Float32Array<"u"?Float32Array:Array,g4=Math.random;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function v1(){var e=new au(16);return au!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Rte(e){var t=new au(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ite(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function vM(e,t,r,n,i,o,a,u,c,f,m,_,b,A,w,R){var P=new au(16);return P[0]=e,P[1]=t,P[2]=r,P[3]=n,P[4]=i,P[5]=o,P[6]=a,P[7]=u,P[8]=c,P[9]=f,P[10]=m,P[11]=_,P[12]=b,P[13]=A,P[14]=w,P[15]=R,P}function Mte(e,t,r,n,i,o,a,u,c,f,m,_,b,A,w,R,P){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=o,e[5]=a,e[6]=u,e[7]=c,e[8]=f,e[9]=m,e[10]=_,e[11]=b,e[12]=A,e[13]=w,e[14]=R,e[15]=P,e}function mM(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Pte(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],o=t[6],a=t[7],u=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=u}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function V5(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],u=t[5],c=t[6],f=t[7],m=t[8],_=t[9],b=t[10],A=t[11],w=t[12],R=t[13],P=t[14],k=t[15],L=r*u-n*a,B=r*c-i*a,V=r*f-o*a,G=n*c-i*u,K=n*f-o*u,Z=i*f-o*c,ve=m*R-_*w,Ie=m*P-b*w,de=m*k-A*w,se=_*P-b*R,le=_*k-A*R,ye=b*k-A*P,ke=L*ye-B*le+V*se+G*de-K*Ie+Z*ve;return ke?(ke=1/ke,e[0]=(u*ye-c*le+f*se)*ke,e[1]=(i*le-n*ye-o*se)*ke,e[2]=(R*Z-P*K+k*G)*ke,e[3]=(b*K-_*Z-A*G)*ke,e[4]=(c*de-a*ye-f*Ie)*ke,e[5]=(r*ye-i*de+o*Ie)*ke,e[6]=(P*V-w*Z-k*B)*ke,e[7]=(m*Z-b*V+A*B)*ke,e[8]=(a*le-u*de+f*ve)*ke,e[9]=(n*de-r*le-o*ve)*ke,e[10]=(w*K-R*V+k*L)*ke,e[11]=(_*V-m*K-A*L)*ke,e[12]=(u*Ie-a*se-c*ve)*ke,e[13]=(r*se-n*Ie+i*ve)*ke,e[14]=(R*B-w*G-P*L)*ke,e[15]=(m*G-_*B+b*L)*ke,e):null}function Ote(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],u=t[5],c=t[6],f=t[7],m=t[8],_=t[9],b=t[10],A=t[11],w=t[12],R=t[13],P=t[14],k=t[15];return e[0]=u*(b*k-A*P)-_*(c*k-f*P)+R*(c*A-f*b),e[1]=-(n*(b*k-A*P)-_*(i*k-o*P)+R*(i*A-o*b)),e[2]=n*(c*k-f*P)-u*(i*k-o*P)+R*(i*f-o*c),e[3]=-(n*(c*A-f*b)-u*(i*A-o*b)+_*(i*f-o*c)),e[4]=-(a*(b*k-A*P)-m*(c*k-f*P)+w*(c*A-f*b)),e[5]=r*(b*k-A*P)-m*(i*k-o*P)+w*(i*A-o*b),e[6]=-(r*(c*k-f*P)-a*(i*k-o*P)+w*(i*f-o*c)),e[7]=r*(c*A-f*b)-a*(i*A-o*b)+m*(i*f-o*c),e[8]=a*(_*k-A*R)-m*(u*k-f*R)+w*(u*A-f*_),e[9]=-(r*(_*k-A*R)-m*(n*k-o*R)+w*(n*A-o*_)),e[10]=r*(u*k-f*R)-a*(n*k-o*R)+w*(n*f-o*u),e[11]=-(r*(u*A-f*_)-a*(n*A-o*_)+m*(n*f-o*u)),e[12]=-(a*(_*P-b*R)-m*(u*P-c*R)+w*(u*b-c*_)),e[13]=r*(_*P-b*R)-m*(n*P-i*R)+w*(n*b-i*_),e[14]=-(r*(u*P-c*R)-a*(n*P-i*R)+w*(n*c-i*u)),e[15]=r*(u*b-c*_)-a*(n*b-i*_)+m*(n*c-i*u),e}function kte(e){var t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],u=e[6],c=e[7],f=e[8],m=e[9],_=e[10],b=e[11],A=e[12],w=e[13],R=e[14],P=e[15],k=t*a-r*o,L=t*u-n*o,B=t*c-i*o,V=r*u-n*a,G=r*c-i*a,K=n*c-i*u,Z=f*w-m*A,ve=f*R-_*A,Ie=f*P-b*A,de=m*R-_*w,se=m*P-b*w,le=_*P-b*R;return k*le-L*se+B*de+V*Ie-G*ve+K*Z}function pf(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],u=t[4],c=t[5],f=t[6],m=t[7],_=t[8],b=t[9],A=t[10],w=t[11],R=t[12],P=t[13],k=t[14],L=t[15],B=r[0],V=r[1],G=r[2],K=r[3];return e[0]=B*n+V*u+G*_+K*R,e[1]=B*i+V*c+G*b+K*P,e[2]=B*o+V*f+G*A+K*k,e[3]=B*a+V*m+G*w+K*L,B=r[4],V=r[5],G=r[6],K=r[7],e[4]=B*n+V*u+G*_+K*R,e[5]=B*i+V*c+G*b+K*P,e[6]=B*o+V*f+G*A+K*k,e[7]=B*a+V*m+G*w+K*L,B=r[8],V=r[9],G=r[10],K=r[11],e[8]=B*n+V*u+G*_+K*R,e[9]=B*i+V*c+G*b+K*P,e[10]=B*o+V*f+G*A+K*k,e[11]=B*a+V*m+G*w+K*L,B=r[12],V=r[13],G=r[14],K=r[15],e[12]=B*n+V*u+G*_+K*R,e[13]=B*i+V*c+G*b+K*P,e[14]=B*o+V*f+G*A+K*k,e[15]=B*a+V*m+G*w+K*L,e}function Em(e,t,r){var n=r[0],i=r[1],o=r[2],a,u,c,f,m,_,b,A,w,R,P,k;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*o+t[12],e[13]=t[1]*n+t[5]*i+t[9]*o+t[13],e[14]=t[2]*n+t[6]*i+t[10]*o+t[14],e[15]=t[3]*n+t[7]*i+t[11]*o+t[15]):(a=t[0],u=t[1],c=t[2],f=t[3],m=t[4],_=t[5],b=t[6],A=t[7],w=t[8],R=t[9],P=t[10],k=t[11],e[0]=a,e[1]=u,e[2]=c,e[3]=f,e[4]=m,e[5]=_,e[6]=b,e[7]=A,e[8]=w,e[9]=R,e[10]=P,e[11]=k,e[12]=a*n+m*i+w*o+t[12],e[13]=u*n+_*i+R*o+t[13],e[14]=c*n+b*i+P*o+t[14],e[15]=f*n+A*i+k*o+t[15]),e}function Sm(e,t,r){var n=r[0],i=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Dte(e,t,r,n){var i=n[0],o=n[1],a=n[2],u=Math.hypot(i,o,a),c,f,m,_,b,A,w,R,P,k,L,B,V,G,K,Z,ve,Ie,de,se,le,ye,ke,Rt;return u<po?null:(u=1/u,i*=u,o*=u,a*=u,c=Math.sin(r),f=Math.cos(r),m=1-f,_=t[0],b=t[1],A=t[2],w=t[3],R=t[4],P=t[5],k=t[6],L=t[7],B=t[8],V=t[9],G=t[10],K=t[11],Z=i*i*m+f,ve=o*i*m+a*c,Ie=a*i*m-o*c,de=i*o*m-a*c,se=o*o*m+f,le=a*o*m+i*c,ye=i*a*m+o*c,ke=o*a*m-i*c,Rt=a*a*m+f,e[0]=_*Z+R*ve+B*Ie,e[1]=b*Z+P*ve+V*Ie,e[2]=A*Z+k*ve+G*Ie,e[3]=w*Z+L*ve+K*Ie,e[4]=_*de+R*se+B*le,e[5]=b*de+P*se+V*le,e[6]=A*de+k*se+G*le,e[7]=w*de+L*se+K*le,e[8]=_*ye+R*ke+B*Rt,e[9]=b*ye+P*ke+V*Rt,e[10]=A*ye+k*ke+G*Rt,e[11]=w*ye+L*ke+K*Rt,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function sy(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[4],a=t[5],u=t[6],c=t[7],f=t[8],m=t[9],_=t[10],b=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+f*n,e[5]=a*i+m*n,e[6]=u*i+_*n,e[7]=c*i+b*n,e[8]=f*i-o*n,e[9]=m*i-a*n,e[10]=_*i-u*n,e[11]=b*i-c*n,e}function j5(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],u=t[2],c=t[3],f=t[8],m=t[9],_=t[10],b=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-f*n,e[1]=a*i-m*n,e[2]=u*i-_*n,e[3]=c*i-b*n,e[8]=o*n+f*i,e[9]=a*n+m*i,e[10]=u*n+_*i,e[11]=c*n+b*i,e}function H5(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],u=t[2],c=t[3],f=t[4],m=t[5],_=t[6],b=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+f*n,e[1]=a*i+m*n,e[2]=u*i+_*n,e[3]=c*i+b*n,e[4]=f*i-o*n,e[5]=m*i-a*n,e[6]=_*i-u*n,e[7]=b*i-c*n,e}function gM(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function Fte(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Bte(e,t,r){var n=r[0],i=r[1],o=r[2],a=Math.hypot(n,i,o),u,c,f;return a<po?null:(a=1/a,n*=a,i*=a,o*=a,u=Math.sin(t),c=Math.cos(t),f=1-c,e[0]=n*n*f+c,e[1]=i*n*f+o*u,e[2]=o*n*f-i*u,e[3]=0,e[4]=n*i*f-o*u,e[5]=i*i*f+c,e[6]=o*i*f+n*u,e[7]=0,e[8]=n*o*f+i*u,e[9]=i*o*f-n*u,e[10]=o*o*f+c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function Lte(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Nte(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ute(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function _M(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],u=n+n,c=i+i,f=o+o,m=n*u,_=n*c,b=n*f,A=i*c,w=i*f,R=o*f,P=a*u,k=a*c,L=a*f;return e[0]=1-(A+R),e[1]=_+L,e[2]=b-k,e[3]=0,e[4]=_-L,e[5]=1-(m+R),e[6]=w+P,e[7]=0,e[8]=b+k,e[9]=w-P,e[10]=1-(m+A),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function zte(e,t){var r=new au(3),n=-t[0],i=-t[1],o=-t[2],a=t[3],u=t[4],c=t[5],f=t[6],m=t[7],_=n*n+i*i+o*o+a*a;return _>0?(r[0]=(u*a+m*n+c*o-f*i)*2/_,r[1]=(c*a+m*i+f*n-u*o)*2/_,r[2]=(f*a+m*o+u*i-c*n)*2/_):(r[0]=(u*a+m*n+c*o-f*i)*2,r[1]=(c*a+m*i+f*n-u*o)*2,r[2]=(f*a+m*o+u*i-c*n)*2),_M(e,t,r),e}function $te(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function yM(e,t){var r=t[0],n=t[1],i=t[2],o=t[4],a=t[5],u=t[6],c=t[8],f=t[9],m=t[10];return e[0]=Math.hypot(r,n,i),e[1]=Math.hypot(o,a,u),e[2]=Math.hypot(c,f,m),e}function Vte(e,t){var r=new au(3);yM(r,t);var n=1/r[0],i=1/r[1],o=1/r[2],a=t[0]*n,u=t[1]*i,c=t[2]*o,f=t[4]*n,m=t[5]*i,_=t[6]*o,b=t[8]*n,A=t[9]*i,w=t[10]*o,R=a+m+w,P=0;return R>0?(P=Math.sqrt(R+1)*2,e[3]=.25*P,e[0]=(_-A)/P,e[1]=(b-c)/P,e[2]=(u-f)/P):a>m&&a>w?(P=Math.sqrt(1+a-m-w)*2,e[3]=(_-A)/P,e[0]=.25*P,e[1]=(u+f)/P,e[2]=(b+c)/P):m>w?(P=Math.sqrt(1+m-a-w)*2,e[3]=(b-c)/P,e[0]=(u+f)/P,e[1]=.25*P,e[2]=(_+A)/P):(P=Math.sqrt(1+w-a-m)*2,e[3]=(u-f)/P,e[0]=(b+c)/P,e[1]=(_+A)/P,e[2]=.25*P),e}function jte(e,t,r,n){var i=t[0],o=t[1],a=t[2],u=t[3],c=i+i,f=o+o,m=a+a,_=i*c,b=i*f,A=i*m,w=o*f,R=o*m,P=a*m,k=u*c,L=u*f,B=u*m,V=n[0],G=n[1],K=n[2];return e[0]=(1-(w+P))*V,e[1]=(b+B)*V,e[2]=(A-L)*V,e[3]=0,e[4]=(b-B)*G,e[5]=(1-(_+P))*G,e[6]=(R+k)*G,e[7]=0,e[8]=(A+L)*K,e[9]=(R-k)*K,e[10]=(1-(_+w))*K,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function Hte(e,t,r,n,i){var o=t[0],a=t[1],u=t[2],c=t[3],f=o+o,m=a+a,_=u+u,b=o*f,A=o*m,w=o*_,R=a*m,P=a*_,k=u*_,L=c*f,B=c*m,V=c*_,G=n[0],K=n[1],Z=n[2],ve=i[0],Ie=i[1],de=i[2],se=(1-(R+k))*G,le=(A+V)*G,ye=(w-B)*G,ke=(A-V)*K,Rt=(1-(b+k))*K,Lt=(P+L)*K,Gt=(w+B)*Z,Zt=(P-L)*Z,st=(1-(b+R))*Z;return e[0]=se,e[1]=le,e[2]=ye,e[3]=0,e[4]=ke,e[5]=Rt,e[6]=Lt,e[7]=0,e[8]=Gt,e[9]=Zt,e[10]=st,e[11]=0,e[12]=r[0]+ve-(se*ve+ke*Ie+Gt*de),e[13]=r[1]+Ie-(le*ve+Rt*Ie+Zt*de),e[14]=r[2]+de-(ye*ve+Lt*Ie+st*de),e[15]=1,e}function Gte(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=r+r,u=n+n,c=i+i,f=r*a,m=n*a,_=n*u,b=i*a,A=i*u,w=i*c,R=o*a,P=o*u,k=o*c;return e[0]=1-_-w,e[1]=m+k,e[2]=b-P,e[3]=0,e[4]=m-k,e[5]=1-f-w,e[6]=A+R,e[7]=0,e[8]=b+P,e[9]=A-R,e[10]=1-f-_,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Wte(e,t,r,n,i,o,a){var u=1/(r-t),c=1/(i-n),f=1/(o-a);return e[0]=o*2*u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*c,e[6]=0,e[7]=0,e[8]=(r+t)*u,e[9]=(i+n)*c,e[10]=(a+o)*f,e[11]=-1,e[12]=0,e[13]=0,e[14]=a*o*2*f,e[15]=0,e}function xM(e,t,r,n,i){var o=1/Math.tan(t/2),a;return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(a=1/(n-i),e[10]=(i+n)*a,e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e}var bM=xM;function Xte(e,t,r,n,i){var o=1/Math.tan(t/2),a;return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(a=1/(n-i),e[10]=i*a,e[14]=i*n*a):(e[10]=-1,e[14]=-n),e}function Yte(e,t,r,n){var i=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),u=Math.tan(t.rightDegrees*Math.PI/180),c=2/(a+u),f=2/(i+o);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=f,e[6]=0,e[7]=0,e[8]=-((a-u)*c*.5),e[9]=(i-o)*f*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function EM(e,t,r,n,i,o,a){var u=1/(t-r),c=1/(n-i),f=1/(o-a);return e[0]=-2*u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*f,e[11]=0,e[12]=(t+r)*u,e[13]=(i+n)*c,e[14]=(a+o)*f,e[15]=1,e}var Zte=EM;function qte(e,t,r,n,i,o,a){var u=1/(t-r),c=1/(n-i),f=1/(o-a);return e[0]=-2*u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=f,e[11]=0,e[12]=(t+r)*u,e[13]=(i+n)*c,e[14]=o*f,e[15]=1,e}function Kte(e,t,r,n){var i,o,a,u,c,f,m,_,b,A,w=t[0],R=t[1],P=t[2],k=n[0],L=n[1],B=n[2],V=r[0],G=r[1],K=r[2];return Math.abs(w-V)<po&&Math.abs(R-G)<po&&Math.abs(P-K)<po?mM(e):(m=w-V,_=R-G,b=P-K,A=1/Math.hypot(m,_,b),m*=A,_*=A,b*=A,i=L*b-B*_,o=B*m-k*b,a=k*_-L*m,A=Math.hypot(i,o,a),A?(A=1/A,i*=A,o*=A,a*=A):(i=0,o=0,a=0),u=_*a-b*o,c=b*i-m*a,f=m*o-_*i,A=Math.hypot(u,c,f),A?(A=1/A,u*=A,c*=A,f*=A):(u=0,c=0,f=0),e[0]=i,e[1]=u,e[2]=m,e[3]=0,e[4]=o,e[5]=c,e[6]=_,e[7]=0,e[8]=a,e[9]=f,e[10]=b,e[11]=0,e[12]=-(i*w+o*R+a*P),e[13]=-(u*w+c*R+f*P),e[14]=-(m*w+_*R+b*P),e[15]=1,e)}function Qte(e,t,r,n){var i=t[0],o=t[1],a=t[2],u=n[0],c=n[1],f=n[2],m=i-r[0],_=o-r[1],b=a-r[2],A=m*m+_*_+b*b;A>0&&(A=1/Math.sqrt(A),m*=A,_*=A,b*=A);var w=c*b-f*_,R=f*m-u*b,P=u*_-c*m;return A=w*w+R*R+P*P,A>0&&(A=1/Math.sqrt(A),w*=A,R*=A,P*=A),e[0]=w,e[1]=R,e[2]=P,e[3]=0,e[4]=_*P-b*R,e[5]=b*w-m*P,e[6]=m*R-_*w,e[7]=0,e[8]=m,e[9]=_,e[10]=b,e[11]=0,e[12]=i,e[13]=o,e[14]=a,e[15]=1,e}function Jte(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function ere(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function tre(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function SM(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function rre(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function nre(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function ire(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function Z6(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],u=e[5],c=e[6],f=e[7],m=e[8],_=e[9],b=e[10],A=e[11],w=e[12],R=e[13],P=e[14],k=e[15],L=t[0],B=t[1],V=t[2],G=t[3],K=t[4],Z=t[5],ve=t[6],Ie=t[7],de=t[8],se=t[9],le=t[10],ye=t[11],ke=t[12],Rt=t[13],Lt=t[14],Gt=t[15];return Math.abs(r-L)<=po*Math.max(1,Math.abs(r),Math.abs(L))&&Math.abs(n-B)<=po*Math.max(1,Math.abs(n),Math.abs(B))&&Math.abs(i-V)<=po*Math.max(1,Math.abs(i),Math.abs(V))&&Math.abs(o-G)<=po*Math.max(1,Math.abs(o),Math.abs(G))&&Math.abs(a-K)<=po*Math.max(1,Math.abs(a),Math.abs(K))&&Math.abs(u-Z)<=po*Math.max(1,Math.abs(u),Math.abs(Z))&&Math.abs(c-ve)<=po*Math.max(1,Math.abs(c),Math.abs(ve))&&Math.abs(f-Ie)<=po*Math.max(1,Math.abs(f),Math.abs(Ie))&&Math.abs(m-de)<=po*Math.max(1,Math.abs(m),Math.abs(de))&&Math.abs(_-se)<=po*Math.max(1,Math.abs(_),Math.abs(se))&&Math.abs(b-le)<=po*Math.max(1,Math.abs(b),Math.abs(le))&&Math.abs(A-ye)<=po*Math.max(1,Math.abs(A),Math.abs(ye))&&Math.abs(w-ke)<=po*Math.max(1,Math.abs(w),Math.abs(ke))&&Math.abs(R-Rt)<=po*Math.max(1,Math.abs(R),Math.abs(Rt))&&Math.abs(P-Lt)<=po*Math.max(1,Math.abs(P),Math.abs(Lt))&&Math.abs(k-Gt)<=po*Math.max(1,Math.abs(k),Math.abs(Gt))}var are=pf,ore=SM;const sre=Object.freeze(Object.defineProperty({__proto__:null,add:tre,adjoint:Ote,clone:Rte,copy:Ite,create:v1,determinant:kte,equals:Z6,exactEquals:ire,frob:ere,fromQuat:Gte,fromQuat2:zte,fromRotation:Bte,fromRotationTranslation:_M,fromRotationTranslationScale:jte,fromRotationTranslationScaleOrigin:Hte,fromScaling:Fte,fromTranslation:gM,fromValues:vM,fromXRotation:Lte,fromYRotation:Nte,fromZRotation:Ute,frustum:Wte,getRotation:Vte,getScaling:yM,getTranslation:$te,identity:mM,invert:V5,lookAt:Kte,mul:are,multiply:pf,multiplyScalar:rre,multiplyScalarAndAdd:nre,ortho:Zte,orthoNO:EM,orthoZO:qte,perspective:bM,perspectiveFromFieldOfView:Yte,perspectiveNO:xM,perspectiveZO:Xte,rotate:Dte,rotateX:sy,rotateY:j5,rotateZ:H5,scale:Sm,set:Mte,str:Jte,sub:ore,subtract:SM,targetTo:Qte,translate:Em,transpose:Pte},Symbol.toStringTag,{value:"Module"}));function zd(){var e=new au(3);return au!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function ure(e){var t=new au(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function AM(e){var t=e[0],r=e[1],n=e[2];return Math.hypot(t,r,n)}function Gl(e,t,r){var n=new au(3);return n[0]=e,n[1]=t,n[2]=r,n}function lre(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function cre(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function fre(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function TM(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function wM(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function CM(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function hre(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function pre(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function dre(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function vre(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function mre(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}function gre(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function _re(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function RM(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.hypot(r,n,i)}function IM(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}function MM(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function PM(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function yre(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function $d(e,t){var r=t[0],n=t[1],i=t[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function OM(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function kM(e,t,r){var n=t[0],i=t[1],o=t[2],a=r[0],u=r[1],c=r[2];return e[0]=i*c-o*u,e[1]=o*a-n*c,e[2]=n*u-i*a,e}function xre(e,t,r,n){var i=t[0],o=t[1],a=t[2];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e[2]=a+n*(r[2]-a),e}function bre(e,t,r,n,i,o){var a=o*o,u=a*(2*o-3)+1,c=a*(o-2)+o,f=a*(o-1),m=a*(3-2*o);return e[0]=t[0]*u+r[0]*c+n[0]*f+i[0]*m,e[1]=t[1]*u+r[1]*c+n[1]*f+i[1]*m,e[2]=t[2]*u+r[2]*c+n[2]*f+i[2]*m,e}function Ere(e,t,r,n,i,o){var a=1-o,u=a*a,c=o*o,f=u*a,m=3*o*u,_=3*c*a,b=c*o;return e[0]=t[0]*f+r[0]*m+n[0]*_+i[0]*b,e[1]=t[1]*f+r[1]*m+n[1]*_+i[1]*b,e[2]=t[2]*f+r[2]*m+n[2]*_+i[2]*b,e}function Sre(e,t){t=t||1;var r=g4()*2*Math.PI,n=g4()*2-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e}function Vv(e,t,r){var n=t[0],i=t[1],o=t[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,e[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,e[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,e[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,e}function Are(e,t,r){var n=t[0],i=t[1],o=t[2];return e[0]=n*r[0]+i*r[3]+o*r[6],e[1]=n*r[1]+i*r[4]+o*r[7],e[2]=n*r[2]+i*r[5]+o*r[8],e}function Tre(e,t,r){var n=r[0],i=r[1],o=r[2],a=r[3],u=t[0],c=t[1],f=t[2],m=i*f-o*c,_=o*u-n*f,b=n*c-i*u,A=i*b-o*_,w=o*m-n*b,R=n*_-i*m,P=a*2;return m*=P,_*=P,b*=P,A*=2,w*=2,R*=2,e[0]=u+m+A,e[1]=c+_+w,e[2]=f+b+R,e}function wre(e,t,r,n){var i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Cre(e,t,r,n){var i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Rre(e,t,r,n){var i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function q6(e,t){var r=e[0],n=e[1],i=e[2],o=t[0],a=t[1],u=t[2],c=Math.sqrt(r*r+n*n+i*i),f=Math.sqrt(o*o+a*a+u*u),m=c*f,_=m&&OM(e,t)/m;return Math.acos(Math.min(Math.max(_,-1),1))}function Ire(e){return e[0]=0,e[1]=0,e[2]=0,e}function Mre(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function Pre(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ore(e,t){var r=e[0],n=e[1],i=e[2],o=t[0],a=t[1],u=t[2];return Math.abs(r-o)<=po*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=po*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-u)<=po*Math.max(1,Math.abs(i),Math.abs(u))}var K6=TM,kre=wM,Dre=CM,Fre=RM,Bre=IM,Lre=AM,Nre=MM,Ure=function(){var e=zd();return function(t,r,n,i,o,a){var u,c;for(r||(r=3),n||(n=0),i?c=Math.min(i*r+n,t.length):c=t.length,u=n;u<c;u+=r)e[0]=t[u],e[1]=t[u+1],e[2]=t[u+2],o(e,e,a),t[u]=e[0],t[u+1]=e[1],t[u+2]=e[2];return t}}();const R3=Object.freeze(Object.defineProperty({__proto__:null,add:fre,angle:q6,bezier:Ere,ceil:hre,clone:ure,copy:lre,create:zd,cross:kM,dist:Fre,distance:RM,div:Dre,divide:CM,dot:OM,equals:Ore,exactEquals:Pre,floor:pre,forEach:Ure,fromValues:Gl,hermite:bre,inverse:yre,len:Lre,length:AM,lerp:xre,max:vre,min:dre,mul:kre,multiply:wM,negate:PM,normalize:$d,random:Sre,rotateX:wre,rotateY:Cre,rotateZ:Rre,round:mre,scale:gre,scaleAndAdd:_re,set:cre,sqrDist:Bre,sqrLen:Nre,squaredDistance:IM,squaredLength:MM,str:Mre,sub:K6,subtract:TM,transformMat3:Are,transformMat4:Vv,transformQuat:Tre,zero:Ire},Symbol.toStringTag,{value:"Module"}));function DM(){var e=new au(4);return au!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function zre(e,t,r,n){var i=new au(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i}function $re(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function G5(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,e[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,e[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,e[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,e}(function(){var e=DM();return function(t,r,n,i,o,a){var u,c;for(r||(r=4),n||(n=0),i?c=Math.min(i*r+n,t.length):c=t.length,u=n;u<c;u+=r)e[0]=t[u],e[1]=t[u+1],e[2]=t[u+2],e[3]=t[u+3],o(e,e,a),t[u]=e[0],t[u+1]=e[1],t[u+2]=e[2],t[u+3]=e[3];return t}})();function Vi(){var e=new au(2);return au!=Float32Array&&(e[0]=0,e[1]=0),e}function l0(e,t){var r=new au(2);return r[0]=e,r[1]=t,r}function lf(e,t){return e[0]=t[0],e[1]=t[1],e}function FM(e,t,r){return e[0]=t,e[1]=r,e}function Oo(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e}function b1(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}function Vre(e,t){return e[0]=-t[0],e[1]=-t[1],e}function df(e,t){var r=t[0],n=t[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e}function mp(e,t){return e[0]*t[0]+e[1]*t[1]}function jre(e,t,r,n){var i=t[0],o=t[1];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e}var c0=b1;(function(){var e=Vi();return function(t,r,n,i,o,a){var u,c;for(r||(r=2),n||(n=0),i?c=Math.min(i*r+n,t.length):c=t.length,u=n;u<c;u+=r)e[0]=t[u],e[1]=t[u+1],o(e,e,a),t[u]=e[0],t[u+1]=e[1];return t}})();var X2=Vi();Vi();var Qo=Vi(),Xh=Vi(),yd=Vi();function I3(e,t,r,n,i){Oo(e,r,n),df(e,e),t=l0(-e[1],e[0]);var o=l0(-r[1],r[0]);return[i/mp(t,o),t]}function Yh(e,t){return FM(e,-t[1],t[0])}function xd(e,t,r){return c0(e,t,r),df(e,e),e}function M3(e,t){return e[0]===t[0]&&e[1]===t[1]}var Hre=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ht(this,e),F(this,"lastFlip",-1),F(this,"miter",l0(0,0)),F(this,"started",!1),F(this,"dash",!1),F(this,"totalDistance",0),F(this,"currentIndex",0),this.join=t.join||"miter",this.cap=t.cap||"butt",this.miterLimit=t.miterLimit||10,this.thickness=t.thickness||1,this.dash=t.dash||!1,this.complex={positions:[],indices:[],normals:[],startIndex:0,indexes:[]}}return jt(e,[{key:"extrude_gaode2",value:function(r,n){var i=this.complex;if(r.length<=1)return i;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var o=r.length,a=i.startIndex,u=1;u<o;u++){var c,f,m,_=r[u-1];_.push((c=n[u-1][2])!==null&&c!==void 0?c:0);var b=n[u-1],A=r[u];A.push((f=n[u][2])!==null&&f!==void 0?f:0);var w=n[u],R=u<r.length-1?[].concat(nr(r[u+1]),[(m=n[u+1][2])!==null&&m!==void 0?m:0]):null,P=u<n.length-1?n[u+1]:null,k=this.segment_gaode2(i,a,_,A,R,b,w,P);a+=k}if(this.dash)for(var L=0;L<i.positions.length/6;L++)i.positions[L*6+5]=this.totalDistance;return i.startIndex=i.positions.length/6,i}},{key:"simpleExtrude_gaode2",value:function(r,n){var i=this.complex;if(r.length<=1)return i;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var o=r.length,a=i.startIndex,u=1;u<o;u++){var c,f,m,_=r[u-1];_.push((c=n[u-1][2])!==null&&c!==void 0?c:0);var b=n[u-1],A=r[u];A.push((f=n[u][2])!==null&&f!==void 0?f:0);var w=n[u],R=u<r.length-1?[].concat(nr(r[u+1]),[(m=n[u+1][2])!==null&&m!==void 0?m:0]):null,P=u<n.length-1?n[u+1]:null,k=this.simpleSegment(i,a,_,A,R,b,w,P);a+=k}if(this.dash)for(var L=0;L<i.positions.length/6;L++)i.positions[L*6+5]=this.totalDistance;return i.startIndex=i.positions.length/6,i}},{key:"extrude",value:function(r){var n=this.complex;if(r.length<=1)return n;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var i=r.length,o=n.startIndex,a=1;a<i;a++){var u=r[a-1],c=r[a],f=a<r.length-1?r[a+1]:null,m=this.segment(n,o,u,c,f);o+=m}if(this.dash)for(var _=0;_<n.positions.length/6;_++)n.positions[_*6+5]=this.totalDistance;return n.startIndex=n.positions.length/6,n}},{key:"simpleExtrude",value:function(r){var n=this.complex;if(r.length<=1)return n;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var i=r.length,o=n.startIndex,a=1;a<i;a++){var u=r[a-1],c=r[a],f=a<r.length-1?r[a+1]:null,m=this.simpleSegment(n,o,u,c,f);o+=m}if(this.dash)for(var _=0;_<n.positions.length/6;_++)n.positions[_*6+5]=this.totalDistance;return n.startIndex=n.positions.length/6,n}},{key:"segment_gaode2",value:function(r,n,i,o,a,u,c,f){var m=0,_=r.indices,b=r.positions,A=r.normals,w=this.cap==="square",R=this.join==="bevel",P=ko([c[0],c[1]]),k=ko([u[0],u[1]]);xd(Qo,o,i);var L=0;if(this.dash&&(L=this.lineSegmentDistance(P,k),this.totalDistance+=L),this.normal||(this.normal=Vi(),Yh(this.normal,Qo)),!this.started)if(this.started=!0,w){var B=Vi(),V=Vi();Oo(B,this.normal,Qo),Oo(V,this.normal,Qo),A.push(V[0],V[1],0),A.push(B[0],B[1],0),b.push(i[0],i[1],i[2]|0,this.totalDistance-L,-this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),b.push(i[0],i[1],i[2]|0,this.totalDistance-L,this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(b,A,i,this.normal,this.thickness,this.totalDistance-L);if(_.push(n+0,n+1,n+2),a){M3(o,a)&&Oo(a,o,df(a,b1(a,o,i))),xd(Xh,a,o);var Z=I3(yd,Vi(),Qo,Xh,this.thickness),ve=Nn(Z,2),Ie=ve[0],de=ve[1],se=mp(yd,this.normal)<0?-1:1,le=R;if(!le&&this.join==="miter"){var ye=Ie;ye>this.miterLimit&&(le=!0)}le?(A.push(this.normal[0],this.normal[1],0),A.push(de[0],de[1],0),b.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*se,o[2]|0),this.complex.indexes.push(this.currentIndex),b.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness*se,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,_.push.apply(_,nr(this.lastFlip!==-se?[n,n+2,n+3]:[n+2,n+1,n+3])),_.push(n+2,n+3,n+4),Yh(X2,Xh),lf(this.normal,X2),A.push(this.normal[0],this.normal[1],0),b.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*se,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,m+=3):(this.extrusions(b,A,o,de,Ie,this.totalDistance),_.push.apply(_,nr(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),se=-1,lf(this.normal,de),m+=2),this.lastFlip=se}else{if(Yh(this.normal,Qo),w){var G=Vi(),K=Vi();c0(K,Qo,this.normal),Oo(G,Qo,this.normal),A.push(K[0],K[1],0),A.push(G[0],G[1],0),b.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),b.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(b,A,o,this.normal,this.thickness,this.totalDistance);_.push.apply(_,nr(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),m+=2}return m}},{key:"simpleSegment",value:function(r,n,i,o,a){var u=0,c=r.indices,f=r.positions,m=r.normals,_=ko([o[0],o[1]]),b=ko([i[0],i[1]]);xd(Qo,_,b);var A=0;if(this.dash&&(A=this.lineSegmentDistance(_,b),this.totalDistance+=A),this.normal||(this.normal=Vi(),Yh(this.normal,Qo)),this.started||(this.started=!0,this.extrusions(f,m,i,this.normal,this.thickness,this.totalDistance-A)),c.push(n+0,n+1,n+2),!a)Yh(this.normal,Qo),this.extrusions(f,m,o,this.normal,this.thickness,this.totalDistance),c.push.apply(c,nr(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),u+=2;else{var w=ko([a[0],a[1]]);M3(_,w)&&Oo(w,_,df(w,b1(w,_,b))),xd(Xh,w,_);var R=I3(yd,Vi(),Qo,Xh,this.thickness),P=Nn(R,2),k=P[0],L=P[1],B=mp(yd,this.normal)<0?-1:1;this.extrusions(f,m,o,L,k,this.totalDistance),c.push.apply(c,nr(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),B=-1,lf(this.normal,L),u+=2,this.lastFlip=B}return u}},{key:"segment",value:function(r,n,i,o,a){var u=0,c=r.indices,f=r.positions,m=r.normals,_=this.cap==="square",b=this.join==="bevel",A=ko([o[0],o[1]]),w=ko([i[0],i[1]]);xd(Qo,A,w);var R=0;if(this.dash&&(R=this.lineSegmentDistance(A,w),this.totalDistance+=R),this.normal||(this.normal=Vi(),Yh(this.normal,Qo)),!this.started)if(this.started=!0,_){var P=Vi(),k=Vi();Oo(P,this.normal,Qo),Oo(k,this.normal,Qo),m.push(k[0],k[1],0),m.push(P[0],P[1],0),f.push(i[0],i[1],i[2]|0,this.totalDistance-R,-this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),f.push(i[0],i[1],i[2]|0,this.totalDistance-R,this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(f,m,i,this.normal,this.thickness,this.totalDistance-R);if(c.push(n+0,n+1,n+2),a){var V=ko([a[0],a[1]]);M3(A,V)&&Oo(V,A,df(V,b1(V,A,w))),xd(Xh,V,A);var G=I3(yd,Vi(),Qo,Xh,this.thickness),K=Nn(G,2),Z=K[0],ve=K[1],Ie=mp(yd,this.normal)<0?-1:1,de=b;if(!de&&this.join==="miter"){var se=Z;se>this.miterLimit&&(de=!0)}de?(m.push(this.normal[0],this.normal[1],0),m.push(ve[0],ve[1],0),f.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*Ie,o[2]|0),this.complex.indexes.push(this.currentIndex),f.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness*Ie,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,c.push.apply(c,nr(this.lastFlip!==-Ie?[n,n+2,n+3]:[n+2,n+1,n+3])),c.push(n+2,n+3,n+4),Yh(X2,Xh),lf(this.normal,X2),m.push(this.normal[0],this.normal[1],0),f.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*Ie,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,u+=3):(this.extrusions(f,m,o,ve,Z,this.totalDistance),c.push.apply(c,nr(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),Ie=-1,lf(this.normal,ve),u+=2),this.lastFlip=Ie}else{if(Yh(this.normal,Qo),_){var L=Vi(),B=Vi();c0(B,Qo,this.normal),Oo(L,Qo,this.normal),m.push(B[0],B[1],0),m.push(L[0],L[1],0),f.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),f.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(f,m,o,this.normal,this.thickness,this.totalDistance);c.push.apply(c,nr(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),u+=2}return u}},{key:"extrusions",value:function(r,n,i,o,a,u){n.push(o[0],o[1],0),n.push(o[0],o[1],0),r.push(i[0],i[1],i[2]|0,u,-a,i[2]|0),this.complex.indexes.push(this.currentIndex),r.push(i[0],i[1],i[2]|0,u,a,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}},{key:"lineSegmentDistance",value:function(r,n){var i=n[0]-r[0],o=n[1]-r[1];return Math.sqrt(i*i+o*o)}}]),e}();function Q6(e){var t=e.coordinates,r=e.originCoordinates,n=e.version,i=new Hre({dash:!0,join:"bevel"});if(n==="GAODE2.x"){var o=t;Array.isArray(o[0][0])||(o=[t]);var a=r;Array.isArray(a[0][0])||(a=[r]);for(var u=0;u<o.length;u++){var c=o[u],f=a[u];i.extrude_gaode2(c,f)}}else{var m=t;m[0]&&!Array.isArray(m[0][0])&&(m=[t]),m.forEach(function(b){i.extrude(b)})}var _=i.complex;return{vertices:_.positions,indices:_.indices,normals:_.normals,indexes:_.indexes,size:6}}function Mg(e){var t=ih(e.coordinates);return{vertices:[].concat(nr(t),nr(t),nr(t),nr(t)),indices:[0,1,2,2,3,0],size:t.length}}function BM(e){var t=e.coordinates,r=mf.flatten(t),n=r.vertices,i=r.dimensions,o=r.holes,a=mf(n,o,i);return{indices:a,vertices:n,size:i}}var Gre=function(){var e=Mt(he.mark(function t(r){var n,i,o,a,u,c,f,m,_;return he.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return n=r.descriptors,i=r.features,o=r.enablePicking,a=r.iconMap,u={a_Color:L5,a_Position:N5,filter:U5,a_vertexId:z5,a_PickingColor:function(R){var P=R.id;return o?sh(P):[0,0,0]},a_DistanceAndIndex:function(R,P,k,L,B,V){return V===void 0?[k[3],10]:[k[3],V]},a_Total_Distance:function(R,P,k){return[k[5]]},a_Size:function(R){var P=R.size,k=P===void 0?1:P;return Array.isArray(k)?[k[0],k[1]]:[k,0]},a_Normal:function(R,P,k,L,B){return B},a_Miter:function(R,P,k){return[k[4]]},a_iconMapUV:function(R){var P=R.texture,k=a[P]||{x:0,y:0},L=k.x,B=k.y;return[L,B]}},c={sizePerElement:0,elements:[]},f=0,m=[],_=3,i.forEach(function(w,R){var P=Q6(w),k=P.indices,L=P.vertices,B=P.normals,V=P.size,G=P.indexes;k.forEach(function(Ie){m.push(Ie+f)}),_=V;var K=L.length/V;c.sizePerElement=_,c.elements.push({featureIdx:R,vertices:L,normals:B,offset:f}),f+=K;for(var Z=function(de){var se=(B==null?void 0:B.slice(de*3,de*3+3))||[],le=L.slice(de*V,de*V+V),ye=0;G&&G[de]!==void 0&&(ye=G[de]),n.forEach(function(ke){if(ke&&u[ke.name]){var Rt;(Rt=ke.buffer.data).push.apply(Rt,nr(u[ke.name](w,R,le,de,se,ye)))}})},ve=0;ve<K;ve++)Z(ve)}),A.abrupt("return",{descriptors:n,featureLayout:c,indices:m});case 8:case"end":return A.stop()}},t)}));return function(r){return e.apply(this,arguments)}}(),Wre=function(){var e=Mt(he.mark(function t(r){var n,i,o,a,u,c,f,m,_;return he.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return n=r.descriptors,i=r.features,o=r.enablePicking,a=r.shape2d,u={a_Color:L5,a_Position:N5,filter:U5,a_vertexId:z5,a_PickingColor:function(R){var P=R.id;return o?sh(P):[0,0,0]},a_Shape:function(R){var P=R.shape,k=P===void 0?2:P,L=a.indexOf(k);return[L]},a_Extrude:function(R,P,k,L){var B=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],V=L%4*3;return[B[V],B[V+1],B[V+2]]},a_Size:function(R){var P=R.size,k=P===void 0?5:P;return Array.isArray(k)?[k[0]]:[k]}},c={sizePerElement:0,elements:[]},f=0,m=[],_=3,i.forEach(function(w,R){var P=Mg(w),k=P.indices,L=P.vertices,B=P.normals,V=P.size,G=P.indexes;k.forEach(function(Ie){m.push(Ie+f)}),_=V;var K=L.length/V;c.sizePerElement=_,c.elements.push({featureIdx:R,vertices:L,normals:B,offset:f}),f+=K;for(var Z=function(de){var se=(B==null?void 0:B.slice(de*3,de*3+3))||[],le=L.slice(de*V,de*V+V),ye=0;G&&G[de]!==void 0&&(ye=G[de]),n.forEach(function(ke){if(ke&&u[ke.name]){var Rt;(Rt=ke.buffer.data).push.apply(Rt,nr(u[ke.name](w,R,le,de,se,ye)))}})},ve=0;ve<K;ve++)Z(ve)}),A.abrupt("return",{descriptors:n,featureLayout:c,indices:m});case 8:case"end":return A.stop()}},t)}));return function(r){return e.apply(this,arguments)}}(),Xre=function(){var e=Mt(he.mark(function t(r){var n,i,o,a,u,c,f,m;return he.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return n=r.descriptors,i=r.features,o=r.enablePicking,a={a_Color:L5,a_Position:N5,filter:U5,a_vertexId:z5,a_PickingColor:function(w){var R=w.id;return o?sh(R):[0,0,0]}},u={sizePerElement:0,elements:[]},c=0,f=[],m=3,i.forEach(function(A,w){var R=BM(A),P=R.indices,k=R.vertices,L=R.normals,B=R.size,V=R.indexes;P.forEach(function(ve){f.push(ve+c)}),m=B;var G=k.length/B;u.sizePerElement=m,u.elements.push({featureIdx:w,vertices:k,normals:L,offset:c}),c+=G;for(var K=function(Ie){var de=(L==null?void 0:L.slice(Ie*3,Ie*3+3))||[],se=k.slice(Ie*B,Ie*B+B),le=0;V&&V[Ie]!==void 0&&(le=V[Ie]),n.forEach(function(ye){if(ye&&a[ye.name]){var ke;(ke=ye.buffer.data).push.apply(ke,nr(a[ye.name](A,w,se,Ie,de,le)))}})},Z=0;Z<G;Z++)K(Z)}),b.abrupt("return",{descriptors:n,featureLayout:u,indices:f});case 8:case"end":return b.stop()}},t)}));return function(r){return e.apply(this,arguments)}}(),Yre={pointFill:Wre,line:Gre,polygonFill:Xre};Qe({},Yre);function pv(e,t){return e??t}var Zre=Pg;function Pg(e,t){var r=e&&e.type,n;if(r==="FeatureCollection")for(n=0;n<e.features.length;n++)Pg(e.features[n],t);else if(r==="GeometryCollection")for(n=0;n<e.geometries.length;n++)Pg(e.geometries[n],t);else if(r==="Feature")Pg(e.geometry,t);else if(r==="Polygon")_4(e.coordinates,t);else if(r==="MultiPolygon")for(n=0;n<e.coordinates.length;n++)_4(e.coordinates[n],t);return e}function _4(e,t){if(e.length!==0){y4(e[0],t);for(var r=1;r<e.length;r++)y4(e[r],!t)}}function y4(e,t){for(var r=0,n=0,i=0,o=e.length,a=o-1;i<o;a=i++){var u=(e[i][0]-e[a][0])*(e[a][1]+e[i][1]),c=r+u;n+=Math.abs(r)>=Math.abs(u)?r-c+u:u-c+r,r=c}r+n>=0!=!!t&&e.reverse()}const qre=oa(Zre);function Kre(e,t){return e.map(function(r){return r[t]*1})}function LM(e){return Array.isArray(e)?e.length===0||typeof e[0]=="number":!1}function J6(e){var t=Object.isFrozen(e)?Ci.cloneDeep(e):e;return qre(t,!0),t}function NM(e,t){var r=t.x,n=t.y,i=t.x1,o=t.y1,a=t.coordinates,u=t.geometry,c=[];if(!Array.isArray(e))return{dataArray:[]};if(u)return e.filter(function(k){return k[u]&&k[u].type&&k[u].coordinates&&k[u].coordinates.length>0}).forEach(function(k,L){var B=J6(k[u]);IR(B,function(V){var G=CR(V),K=Qe(Qe({},k),{},{_id:L,coordinates:G});c.push(K)})}),{dataArray:c};for(var f=0;f<e.length;f++){var m=e[f],_=[];if(a){var b="Polygon";Array.isArray(a[0])||(b="Point"),Array.isArray(a[0])&&!Array.isArray(a[0][0])&&(b="LineString");var A=J6({type:b,coordinates:m[a]});_=A.coordinates}else if(r&&n&&i&&o){var w=[parseFloat(m[r]),parseFloat(m[n])],R=[parseFloat(m[i]),parseFloat(m[o])];_=[w,R]}else r&&n&&(_=[parseFloat(m[r]),parseFloat(m[n])]);var P=Qe(Qe({},m),{},{_id:f,coordinates:_});c.push(P)}return{dataArray:c}}function Qre(e,t){var r=yL(e);return NM(r,t)}function Jre(e){for(var t=e.toString(),r=5381,n=t.length;n;)r=r*33^t.charCodeAt(--n);return r>>>0}function ene(e,t){return t===void 0?null:typeof(e.properties[t]*1)=="number"?e.properties[t]*1:e.properties&&e.properties[t]?Jre(e.properties[t]+"")%1000019:null}function tne(e,t){var r=[],n={};return e.features?(e.features=e.features.filter(function(i){var o=i.geometry;return i!=null&&o&&o.type&&o.coordinates&&o.coordinates.length>0}),e=J6(e),e.features.length===0?{dataArray:[],featureKeys:n}:(IR(e,function(i,o){var a=ene(i,t==null?void 0:t.featureId);a===null&&(a=o);var u=a,c=CR(i),f=Qe(Qe({},i.properties),{},{coordinates:c,_id:u});r.push(f)}),{dataArray:r,featureKeys:n})):(e.features=[],{dataArray:[]})}function ex(e,t,r,n){for(var i=n,o=r-t>>1,a=r-t,u,c=e[t],f=e[t+1],m=e[r],_=e[r+1],b=t+3;b<r;b+=3){var A=rne(e[b],e[b+1],c,f,m,_);if(A>i)u=b,i=A;else if(A===i){var w=Math.abs(b-o);w<a&&(u=b,a=w)}}i>n&&(u-t>3&&ex(e,t,u,n),e[u+2]=i,r-u>3&&ex(e,u,r,n))}function rne(e,t,r,n,i,o){var a=i-r,u=o-n;if(a!==0||u!==0){var c=((e-r)*a+(t-n)*u)/(a*a+u*u);c>1?(r=i,n=o):c>0&&(r+=a*c,n+=u*c)}return a=e-r,u=t-n,a*a+u*u}function Am(e,t,r,n){var i={id:typeof e>"u"?null:e,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return nne(i),i}function nne(e){var t=e.geometry,r=e.type;if(r==="Point"||r==="MultiPoint"||r==="LineString")P3(e,t);else if(r==="Polygon"||r==="MultiLineString")for(var n=0;n<t.length;n++)P3(e,t[n]);else if(r==="MultiPolygon")for(n=0;n<t.length;n++)for(var i=0;i<t[n].length;i++)P3(e,t[n][i])}function P3(e,t){for(var r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}function ine(e,t){var r=[];if(e.type==="FeatureCollection")for(var n=0;n<e.features.length;n++)Og(r,e.features[n],t,n);else e.type==="Feature"?Og(r,e,t):Og(r,{geometry:e},t);return r}function Og(e,t,r,n){if(t.geometry){var i=t.geometry.coordinates,o=t.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),u=[],c=t.id;if(r.promoteId?c=t.properties[r.promoteId]:r.generateId&&(c=n||0),o==="Point")x4(i,u);else if(o==="MultiPoint")for(var f=0;f<i.length;f++)x4(i[f],u);else if(o==="LineString")tx(i,u,a,!1);else if(o==="MultiLineString")if(r.lineMetrics){for(f=0;f<i.length;f++)u=[],tx(i[f],u,a,!1),e.push(Am(c,"LineString",u,t.properties));return}else O3(i,u,a,!1);else if(o==="Polygon")O3(i,u,a,!0);else if(o==="MultiPolygon")for(f=0;f<i.length;f++){var m=[];O3(i[f],m,a,!0),u.push(m)}else if(o==="GeometryCollection"){for(f=0;f<t.geometry.geometries.length;f++)Og(e,{id:c,geometry:t.geometry.geometries[f],properties:t.properties},r,n);return}else throw new Error("Input data is not a valid GeoJSON object.");e.push(Am(c,o,u,t.properties))}}function x4(e,t){t.push(UM(e[0])),t.push(zM(e[1])),t.push(0)}function tx(e,t,r,n){for(var i,o,a=0,u=0;u<e.length;u++){var c=UM(e[u][0]),f=zM(e[u][1]);t.push(c),t.push(f),t.push(0),u>0&&(n?a+=(i*f-c*o)/2:a+=Math.sqrt(Math.pow(c-i,2)+Math.pow(f-o,2))),i=c,o=f}var m=t.length-3;t[2]=1,ex(t,0,m,r),t[m+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size}function O3(e,t,r,n){for(var i=0;i<e.length;i++){var o=[];tx(e[i],o,r,n),t.push(o)}}function UM(e){return e/360+.5}function zM(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function Jf(e,t,r,n,i,o,a,u){if(r/=t,n/=t,o>=r&&a<n)return e;if(a<r||o>=n)return null;for(var c=[],f=0;f<e.length;f++){var m=e[f],_=m.geometry,b=m.type,A=i===0?m.minX:m.minY,w=i===0?m.maxX:m.maxY;if(A>=r&&w<n){c.push(m);continue}else if(w<r||A>=n)continue;var R=[];if(b==="Point"||b==="MultiPoint")ane(_,R,r,n,i);else if(b==="LineString")$M(_,R,r,n,i,!1,u.lineMetrics);else if(b==="MultiLineString")k3(_,R,r,n,i,!1);else if(b==="Polygon")k3(_,R,r,n,i,!0);else if(b==="MultiPolygon")for(var P=0;P<_.length;P++){var k=[];k3(_[P],k,r,n,i,!0),k.length&&R.push(k)}if(R.length){if(u.lineMetrics&&b==="LineString"){for(P=0;P<R.length;P++)c.push(Am(m.id,b,R[P],m.tags));continue}(b==="LineString"||b==="MultiLineString")&&(R.length===1?(b="LineString",R=R[0]):b="MultiLineString"),(b==="Point"||b==="MultiPoint")&&(b=R.length===3?"Point":"MultiPoint"),c.push(Am(m.id,b,R,m.tags))}}return c.length?c:null}function ane(e,t,r,n,i){for(var o=0;o<e.length;o+=3){var a=e[o+i];a>=r&&a<=n&&(t.push(e[o]),t.push(e[o+1]),t.push(e[o+2]))}}function $M(e,t,r,n,i,o,a){for(var u=b4(e),c=i===0?one:sne,f=e.start,m,_,b=0;b<e.length-3;b+=3){var A=e[b],w=e[b+1],R=e[b+2],P=e[b+3],k=e[b+4],L=i===0?A:w,B=i===0?P:k,V=!1;a&&(m=Math.sqrt(Math.pow(A-P,2)+Math.pow(w-k,2))),L<r?B>r&&(_=c(u,A,w,P,k,r),a&&(u.start=f+m*_)):L>n?B<n&&(_=c(u,A,w,P,k,n),a&&(u.start=f+m*_)):D3(u,A,w,R),B<r&&L>=r&&(_=c(u,A,w,P,k,r),V=!0),B>n&&L<=n&&(_=c(u,A,w,P,k,n),V=!0),!o&&V&&(a&&(u.end=f+m*_),t.push(u),u=b4(e)),a&&(f+=m)}var G=e.length-3;A=e[G],w=e[G+1],R=e[G+2],L=i===0?A:w,L>=r&&L<=n&&D3(u,A,w,R),G=u.length-3,o&&G>=3&&(u[G]!==u[0]||u[G+1]!==u[1])&&D3(u,u[0],u[1],u[2]),u.length&&t.push(u)}function b4(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function k3(e,t,r,n,i,o){for(var a=0;a<e.length;a++)$M(e[a],t,r,n,i,o,!1)}function D3(e,t,r,n){e.push(t),e.push(r),e.push(n)}function one(e,t,r,n,i,o){var a=(o-t)/(n-t);return e.push(o),e.push(r+(i-r)*a),e.push(1),a}function sne(e,t,r,n,i,o){var a=(o-r)/(i-r);return e.push(t+(n-t)*a),e.push(o),e.push(1),a}function une(e,t){var r=t.buffer/t.extent,n=e,i=Jf(e,1,-1-r,r,0,-1,2,t),o=Jf(e,1,1-r,2+r,0,-1,2,t);return(i||o)&&(n=Jf(e,1,-r,1+r,0,-1,2,t)||[],i&&(n=E4(i,1).concat(n)),o&&(n=n.concat(E4(o,-1)))),n}function E4(e,t){for(var r=[],n=0;n<e.length;n++){var i=e[n],o=i.type,a;if(o==="Point"||o==="MultiPoint"||o==="LineString")a=F3(i.geometry,t);else if(o==="MultiLineString"||o==="Polygon"){a=[];for(var u=0;u<i.geometry.length;u++)a.push(F3(i.geometry[u],t))}else if(o==="MultiPolygon")for(a=[],u=0;u<i.geometry.length;u++){for(var c=[],f=0;f<i.geometry[u].length;f++)c.push(F3(i.geometry[u][f],t));a.push(c)}r.push(Am(i.id,o,a,i.tags))}return r}function F3(e,t){var r=[];r.size=e.size,e.start!==void 0&&(r.start=e.start,r.end=e.end);for(var n=0;n<e.length;n+=3)r.push(e[n]+t,e[n+1],e[n+2]);return r}function S4(e,t){if(e.transformed)return e;var r=1<<e.z,n=e.x,i=e.y,o,a,u;for(o=0;o<e.features.length;o++){var c=e.features[o],f=c.geometry,m=c.type;if(c.geometry=[],m===1)for(a=0;a<f.length;a+=2)c.geometry.push(A4(f[a],f[a+1],t,r,n,i));else for(a=0;a<f.length;a++){var _=[];for(u=0;u<f[a].length;u+=2)_.push(A4(f[a][u],f[a][u+1],t,r,n,i));c.geometry.push(_)}}return e.transformed=!0,e}function A4(e,t,r,n,i,o){return[Math.round(r*(e*n-i)),Math.round(r*(t*n-o))]}function lne(e,t,r,n,i){for(var o=t===i.maxZoom?0:i.tolerance/((1<<t)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},u=0;u<e.length;u++){a.numFeatures++,cne(a,e[u],o,i);var c=e[u].minX,f=e[u].minY,m=e[u].maxX,_=e[u].maxY;c<a.minX&&(a.minX=c),f<a.minY&&(a.minY=f),m>a.maxX&&(a.maxX=m),_>a.maxY&&(a.maxY=_)}return a}function cne(e,t,r,n){var i=t.geometry,o=t.type,a=[];if(o==="Point"||o==="MultiPoint")for(var u=0;u<i.length;u+=3)a.push(i[u]),a.push(i[u+1]),e.numPoints++,e.numSimplified++;else if(o==="LineString")B3(a,i,e,r,!1,!1);else if(o==="MultiLineString"||o==="Polygon")for(u=0;u<i.length;u++)B3(a,i[u],e,r,o==="Polygon",u===0);else if(o==="MultiPolygon")for(var c=0;c<i.length;c++){var f=i[c];for(u=0;u<f.length;u++)B3(a,f[u],e,r,!0,u===0)}if(a.length){var m=t.tags||null;if(o==="LineString"&&n.lineMetrics){m={};for(var _ in t.tags)m[_]=t.tags[_];m.mapbox_clip_start=i.start/i.size,m.mapbox_clip_end=i.end/i.size}var b={geometry:a,type:o==="Polygon"||o==="MultiPolygon"?3:o==="LineString"||o==="MultiLineString"?2:1,tags:m};t.id!==null&&(b.id=t.id),e.features.push(b)}}function B3(e,t,r,n,i,o){var a=n*n;if(n>0&&t.size<(i?a:n)){r.numPoints+=t.length/3;return}for(var u=[],c=0;c<t.length;c+=3)(n===0||t[c+2]>a)&&(r.numSimplified++,u.push(t[c]),u.push(t[c+1])),r.numPoints++;i&&fne(u,o),e.push(u)}function fne(e,t){for(var r=0,n=0,i=e.length,o=i-2;n<i;o=n,n+=2)r+=(e[n]-e[o])*(e[n+1]+e[o+1]);if(r>0===t)for(n=0,i=e.length;n<i/2;n+=2){var a=e[n],u=e[n+1];e[n]=e[i-2-n],e[n+1]=e[i-1-n],e[i-2-n]=a,e[i-1-n]=u}}function hne(e,t){return new uy(e,t)}function uy(e,t){t=this.options=pne(Object.create(this.options),t);var r=t.debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=ine(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=une(n,t),n.length&&this.splitTile(n,0,0,0),r&&(n.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)))}uy.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};uy.prototype.splitTile=function(e,t,r,n,i,o,a){for(var u=[e,t,r,n],c=this.options,f=c.debug;u.length;){n=u.pop(),r=u.pop(),t=u.pop(),e=u.pop();var m=1<<t,_=rx(t,r,n),b=this.tiles[_];if(!b&&(f>1&&console.time("creation"),b=this.tiles[_]=lne(e,t,r,n,c),this.tileCoords.push({z:t,x:r,y:n}),f)){f>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,n,b.numFeatures,b.numPoints,b.numSimplified),console.timeEnd("creation"));var A="z"+t;this.stats[A]=(this.stats[A]||0)+1,this.total++}if(b.source=e,i){if(t===c.maxZoom||t===i)continue;var w=1<<i-t;if(r!==Math.floor(o/w)||n!==Math.floor(a/w))continue}else if(t===c.indexMaxZoom||b.numPoints<=c.indexMaxPoints)continue;if(b.source=null,e.length!==0){f>1&&console.time("clipping");var R=.5*c.buffer/c.extent,P=.5-R,k=.5+R,L=1+R,B,V,G,K,Z,ve;B=V=G=K=null,Z=Jf(e,m,r-R,r+k,0,b.minX,b.maxX,c),ve=Jf(e,m,r+P,r+L,0,b.minX,b.maxX,c),e=null,Z&&(B=Jf(Z,m,n-R,n+k,1,b.minY,b.maxY,c),V=Jf(Z,m,n+P,n+L,1,b.minY,b.maxY,c),Z=null),ve&&(G=Jf(ve,m,n-R,n+k,1,b.minY,b.maxY,c),K=Jf(ve,m,n+P,n+L,1,b.minY,b.maxY,c),ve=null),f>1&&console.timeEnd("clipping"),u.push(B||[],t+1,r*2,n*2),u.push(V||[],t+1,r*2,n*2+1),u.push(G||[],t+1,r*2+1,n*2),u.push(K||[],t+1,r*2+1,n*2+1)}}};uy.prototype.getTile=function(e,t,r){var n=this.options,i=n.extent,o=n.debug;if(e<0||e>24)return null;var a=1<<e;t=(t%a+a)%a;var u=rx(e,t,r);if(this.tiles[u])return S4(this.tiles[u],i);o>1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var c=e,f=t,m=r,_;!_&&c>0;)c--,f=Math.floor(f/2),m=Math.floor(m/2),_=this.tiles[rx(c,f,m)];return!_||!_.source?null:(o>1&&console.log("found parent tile z%d-%d-%d",c,f,m),o>1&&console.time("drilling down"),this.splitTile(_.source,c,f,m,e,t,r),o>1&&console.timeEnd("drilling down"),this.tiles[u]?S4(this.tiles[u],i):null)};function rx(e,t,r){return((1<<e)*r+t)*32+e}function pne(e,t){for(var r in t)e[r]=t[r];return e}var jv=function(){function e(t,r,n,i){Ht(this,e),F(this,"vectorLayerCache",{}),this.x=r,this.y=n,this.z=i,this.vectorTile=t}return jt(e,[{key:"getTileData",value:function(r){if(!r||!this.vectorTile.layers[r])return[];if(this.vectorLayerCache[r])return this.vectorLayerCache[r];var n=this.vectorTile.layers[r];return n.features}},{key:"getFeatureById",value:function(){throw new Error("Method not implemented.")}}]),e}(),dne={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0};function vne(e){for(var t=0,r=0,n=e.length,i=n-1,o,a;r<n;i=r++)o=e[r],a=e[i],t+=(a.x-o.x)*(o.y+a.y);return t}function mne(e){var t=e.length;if(t<=1)return[e];for(var r=[],n,i,o=0;o<t;o++){var a=vne(e[o]);a!==0&&(i===void 0&&(i=a<0),i===a<0?(n&&r.push(n),n=[e[o]]):n.push(e[o]))}return n&&r.push(n),r}var gne=["Unknown","Point","LineString","Polygon"];function _ne(e,t,r,n,i){var o=i.geometry,a=i.type,u=i.tags,c=i.id,f=e*Math.pow(2,n),m=e*t,_=e*r,b=gne[a],A,w;function R(L){for(var B=0;B<L.length;B++){var V=L[B];if(V[3])break;var G=180-(V[1]+_)*360/f,K=(V[0]+m)*360/f-180,Z=360/Math.PI*Math.atan(Math.exp(G*Math.PI/180))-90;L[B]=[K,Z,0,1]}}switch(a){case 1:var P=[];for(A=0;A<o.length;A++)P[A]=o[A][0];o=P,R(o);break;case 2:for(A=0;A<o.length;A++)R(o[A]);break;case 3:for(o=mne(o),A=0;A<o.length;A++)for(w=0;w<o[A].length;w++)R(o[A][w]);break}o.length===1?o=o[0]:b="Multi"+b;var k={type:"Feature",geometry:{type:b,coordinates:o},properties:u,id:c,tileOrigin:[0,0],coord:""};return k}var yne=function(){var e=Mt(he.mark(function t(r,n,i,o){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",new Promise(function(c){var f=n.getTile(r.z,r.x,r.y),m=f?f.features.map(function(A){return _ne(o,i.x,i.y,i.z,A)}):[],_={layers:{defaultLayer:{features:m}}},b=new jv(_,r.x,r.y,r.z);c(b)}));case 1:case"end":return u.stop()}},t)}));return function(r,n,i,o){return e.apply(this,arguments)}}();function xne(e){var t={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!0,debug:0};return e===void 0||typeof e.geojsonvtOptions>"u"?t:Qe(Qe({},t),e.geojsonvtOptions)}function bne(e,t){var r=xne(t),n=r.extent||4096,i=hne(e,r),o=function(c,f){return yne(f,i,c,n)},a=Qe(Qe(Qe({},dne),t),{},{getTileData:o});return{data:e,dataArray:[],tilesetOptions:a,isTile:!0}}function VM(e,t){var r=t.extent,n=r===void 0?[121.168,30.2828,121.384,30.4219]:r,i=t.requestParameters,o=i===void 0?{}:i,a=new Promise(function(c){e instanceof HTMLImageElement||See(e)?c([e]):Ene(e,o,function(f){c(f)})}),u={originData:e,images:a,_id:1,dataArray:[{_id:0,coordinates:[[n[0],n[1]],[n[2],n[3]]]}]};return u}function Ene(e,t,r){var n=[];if(typeof e=="string")O6(Qe(Qe({},t),{},{url:e}),function(a,u){u&&(n.push(u),r(n))});else{var i=e.length,o=0;e.forEach(function(a){O6(Qe(Qe({},t),{},{url:a}),function(u,c){o++,c&&n.push(c),o===i&&r(n)})})}return VM}var Sne=function(){var e=Mt(he.mark(function t(r,n,i,o){var a,u;return he.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return a={x:n.x,y:n.y,z:n.z},u=Kd(r,a),f.abrupt("return",new Promise(function(m){o?o(a,function(_,b){if(_||!b){var A={layers:{defaultLayer:{features:[]}}},w=new jv(A,n.x,n.y,n.z);m(w)}else{var R={layers:{defaultLayer:{features:b.features}}},P=new jv(R,n.x,n.y,n.z);m(P)}}):OL(Qe(Qe({},i),{},{url:u}),function(_,b){if(_||!b){var A={layers:{defaultLayer:{features:[]}}},w=new jv(A,n.x,n.y,n.z);m(w)}else{var R=JSON.parse(b),P={layers:{defaultLayer:{features:R}}},k=new jv(P,n.x,n.y,n.z);m(k)}})}));case 3:case"end":return f.stop()}},t)}));return function(r,n,i,o){return e.apply(this,arguments)}}();function Ane(e,t){var r=function(o,a){return Sne(e,a,t==null?void 0:t.requestParameters,t.getCustomData)},n=Qe(Qe({},t),{},{getTileData:r});return{dataArray:[],tilesetOptions:n,isTile:!0}}var Tne=Qd;function Qd(e,t){this.x=e,this.y=t}Qd.prototype={clone:function(){return new Qd(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,t){return this.clone()._rotateAround(e,t)},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 t=e.x-this.x,r=e.y-this.y;return t*t+r*r},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,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,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 t=Math.cos(e),r=Math.sin(e),n=t*this.x-r*this.y,i=r*this.x+t*this.y;return this.x=n,this.y=i,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),i=t.x+r*(this.x-t.x)-n*(this.y-t.y),o=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}};Qd.convert=function(e){return e instanceof Qd?e:Array.isArray(e)?new Qd(e[0],e[1]):e};var wne=Tne,Cne=f0;function f0(e,t,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=i,e.readFields(Rne,this,t)}function Rne(e,t,r){e==1?t.id=r.readVarint():e==2?Ine(r,t):e==3?t.type=r.readVarint():e==4&&(t._geometry=r.pos)}function Ine(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}f0.types=["Unknown","Point","LineString","Polygon"];f0.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,o=0,a=[],u;e.pos<t;){if(n<=0){var c=e.readVarint();r=c&7,n=c>>3}if(n--,r===1||r===2)i+=e.readSVarint(),o+=e.readSVarint(),r===1&&(u&&a.push(u),u=[]),u.push(new wne(i,o));else if(r===7)u&&u.push(u[0].clone());else throw new Error("unknown command "+r)}return u&&a.push(u),a};f0.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,o=0,a=1/0,u=-1/0,c=1/0,f=-1/0;e.pos<t;){if(n<=0){var m=e.readVarint();r=m&7,n=m>>3}if(n--,r===1||r===2)i+=e.readSVarint(),o+=e.readSVarint(),i<a&&(a=i),i>u&&(u=i),o<c&&(c=o),o>f&&(f=o);else if(r!==7)throw new Error("unknown command "+r)}return[a,c,u,f]};f0.prototype.toGeoJSON=function(e,t,r){var n=this.extent*Math.pow(2,r),i=this.extent*e,o=this.extent*t,a=this.loadGeometry(),u=f0.types[this.type],c,f;function m(A){for(var w=0;w<A.length;w++){var R=A[w],P=180-(R.y+o)*360/n;A[w]=[(R.x+i)*360/n-180,360/Math.PI*Math.atan(Math.exp(P*Math.PI/180))-90]}}switch(this.type){case 1:var _=[];for(c=0;c<a.length;c++)_[c]=a[c][0];a=_,m(a);break;case 2:for(c=0;c<a.length;c++)m(a[c]);break;case 3:for(a=Mne(a),c=0;c<a.length;c++)for(f=0;f<a[c].length;f++)m(a[c][f]);break}a.length===1?a=a[0]:u="Multi"+u;var b={type:"Feature",geometry:{type:u,coordinates:a},properties:this.properties};return"id"in this&&(b.id=this.id),b};function Mne(e){var t=e.length;if(t<=1)return[e];for(var r=[],n,i,o=0;o<t;o++){var a=Pne(e[o]);a!==0&&(i===void 0&&(i=a<0),i===a<0?(n&&r.push(n),n=[e[o]]):n.push(e[o]))}return n&&r.push(n),r}function Pne(e){for(var t=0,r=0,n=e.length,i=n-1,o,a;r<n;i=r++)o=e[r],a=e[i],t+=(a.x-o.x)*(o.y+a.y);return t}var One=Cne,kne=jM;function jM(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Dne,this,t),this.length=this._features.length}function Dne(e,t,r){e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push(Fne(r))}function Fne(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var n=e.readVarint()>>3;t=n===1?e.readString():n===2?e.readFloat():n===3?e.readDouble():n===4?e.readVarint64():n===5?e.readVarint():n===6?e.readSVarint():n===7?e.readBoolean():null}return t}jM.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new One(this._pbf,t,this.extent,this._keys,this._values)};var Bne=kne,Lne=Nne;function Nne(e,t){this.layers=e.readFields(Une,{},t)}function Une(e,t,r){if(e===3){var n=new Bne(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}var zne=Lne,W5={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */W5.read=function(e,t,r,n,i){var o,a,u=i*8-n-1,c=(1<<u)-1,f=c>>1,m=-7,_=r?i-1:0,b=r?-1:1,A=e[t+_];for(_+=b,o=A&(1<<-m)-1,A>>=-m,m+=u;m>0;o=o*256+e[t+_],_+=b,m-=8);for(a=o&(1<<-m)-1,o>>=-m,m+=n;m>0;a=a*256+e[t+_],_+=b,m-=8);if(o===0)o=1-f;else{if(o===c)return a?NaN:(A?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(A?-1:1)*a*Math.pow(2,o-n)};W5.write=function(e,t,r,n,i,o){var a,u,c,f=o*8-i-1,m=(1<<f)-1,_=m>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:o-1,w=n?1:-1,R=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=m):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+_>=1?t+=b/c:t+=b*Math.pow(2,1-_),t*c>=2&&(a++,c/=2),a+_>=m?(u=0,a=m):a+_>=1?(u=(t*c-1)*Math.pow(2,i),a=a+_):(u=t*Math.pow(2,_-1)*Math.pow(2,i),a=0));i>=8;e[r+A]=u&255,A+=w,u/=256,i-=8);for(a=a<<i|u,f+=i;f>0;e[r+A]=a&255,A+=w,a/=256,f-=8);e[r+A-w]|=R*128};var $ne=ha,Y2=W5;function ha(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}ha.Varint=0;ha.Fixed64=1;ha.Bytes=2;ha.Fixed32=5;var nx=65536*65536,T4=1/nx,Vne=12,HM=typeof TextDecoder>"u"?null:new TextDecoder("utf8");ha.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,e(i,t,this),this.pos===o&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Z2(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=C4(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Z2(this.buf,this.pos)+Z2(this.buf,this.pos+4)*nx;return this.pos+=8,e},readSFixed64:function(){var e=Z2(this.buf,this.pos)+C4(this.buf,this.pos+4)*nx;return this.pos+=8,e},readFloat:function(){var e=Y2.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Y2.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,r,n;return n=t[this.pos++],r=n&127,n<128||(n=t[this.pos++],r|=(n&127)<<7,n<128)||(n=t[this.pos++],r|=(n&127)<<14,n<128)||(n=t[this.pos++],r|=(n&127)<<21,n<128)?r:(n=t[this.pos],r|=(n&15)<<28,jne(r,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=Vne&&HM?nie(this.buf,t,e):rie(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==ha.Bytes)return e.push(this.readVarint(t));var r=Yf(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==ha.Bytes)return e.push(this.readSVarint());var t=Yf(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==ha.Bytes)return e.push(this.readBoolean());var t=Yf(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==ha.Bytes)return e.push(this.readFloat());var t=Yf(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==ha.Bytes)return e.push(this.readDouble());var t=Yf(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==ha.Bytes)return e.push(this.readFixed32());var t=Yf(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==ha.Bytes)return e.push(this.readSFixed32());var t=Yf(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==ha.Bytes)return e.push(this.readFixed64());var t=Yf(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==ha.Bytes)return e.push(this.readSFixed64());var t=Yf(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=e&7;if(t===ha.Varint)for(;this.buf[this.pos++]>127;);else if(t===ha.Bytes)this.pos=this.readVarint()+this.pos;else if(t===ha.Fixed32)this.pos+=4;else if(t===ha.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+t)},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Ed(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Ed(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Ed(this.buf,e&-1,this.pos),Ed(this.buf,Math.floor(e*T4),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Ed(this.buf,e&-1,this.pos),Ed(this.buf,Math.floor(e*T4),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){Hne(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var t=this.pos;this.pos=iie(this.buf,e,this.pos);var r=this.pos-t;r>=128&&w4(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Y2.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Y2.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&w4(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,ha.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,Xne,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Yne,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Kne,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,Zne,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,qne,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Qne,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Jne,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,eie,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,tie,t)},writeBytesField:function(e,t){this.writeTag(e,ha.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,ha.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,ha.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,ha.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,ha.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,ha.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,ha.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,ha.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,ha.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,ha.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};function jne(e,t,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return bd(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function Yf(e){return e.type===ha.Bytes?e.readVarint()+e.pos:e.pos+1}function bd(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function Hne(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),Gne(r,n,t),Wne(n,t)}function Gne(e,t,r){r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos]=e&127}function Wne(e,t){var r=(e&7)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function w4(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function Xne(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function Yne(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function Zne(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function qne(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Kne(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Qne(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Jne(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function eie(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function tie(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function Z2(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function Ed(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function C4(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function rie(e,t,r){for(var n="",i=t;i<r;){var o=e[i],a=null,u=o>239?4:o>223?3:o>191?2:1;if(i+u>r)break;var c,f,m;u===1?o<128&&(a=o):u===2?(c=e[i+1],(c&192)===128&&(a=(o&31)<<6|c&63,a<=127&&(a=null))):u===3?(c=e[i+1],f=e[i+2],(c&192)===128&&(f&192)===128&&(a=(o&15)<<12|(c&63)<<6|f&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):u===4&&(c=e[i+1],f=e[i+2],m=e[i+3],(c&192)===128&&(f&192)===128&&(m&192)===128&&(a=(o&15)<<18|(c&63)<<12|(f&63)<<6|m&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,u=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),n+=String.fromCharCode(a),i+=u}return n}function nie(e,t,r){return HM.decode(e.subarray(t,r))}function iie(e,t,r){for(var n=0,i,o;n<t.length;n++){if(i=t.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):o=i;continue}else o&&(e[r++]=239,e[r++]=191,e[r++]=189,o=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=i&63|128)}return r}const aie=oa($ne);var R4=function(){function e(t,r,n,i){Ht(this,e),F(this,"vectorLayerCache",{}),this.x=r,this.y=n,this.z=i,this.vectorTile=new zne(new aie(t))}return jt(e,[{key:"getTileData",value:function(r){if(!r||!this.vectorTile.layers[r])return[];if(this.vectorLayerCache[r])return this.vectorLayerCache[r];var n=this.vectorTile.layers[r];if(Array.isArray(n.features))return this.vectorLayerCache[r]=n.features,n.features;for(var i=[],o=0;o<n.length;o++){var a=n.feature(o),u=a.toGeoJSON(this.x,this.y,this.z);i.push(Qe(Qe({},u),{},{properties:Qe({id:u.id},u.properties)}))}return this.vectorLayerCache[r]=i,i}},{key:"getFeatureById",value:function(){throw new Error("Method not implemented.")}}]),e}(),oie={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,warp:!0},sie=function(){var e=Mt(he.mark(function t(r,n,i,o,a){var u;return he.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return u=Kd(r,n),f.abrupt("return",new Promise(function(m){if(a)a({x:i.x,y:i.y,z:i.z},function(b,A){if(b||!A)m(void 0);else{var w=new R4(A,i.x,i.y,i.z);m(w)}});else{var _=d5(Qe(Qe({},o),{},{url:u}),function(b,A){if(b||!A)m(void 0);else{var w=new R4(A,i.x,i.y,i.z);m(w)}});i.xhrCancel=function(){return _.cancel()}}}));case 2:case"end":return f.stop()}},t)}));return function(r,n,i,o,a){return e.apply(this,arguments)}}();function uie(e,t){var r=Array.isArray(e)?e[0]:e,n=function(a,u){return sie(r,a,u,t==null?void 0:t.requestParameters,t==null?void 0:t.getCustomData)},i=Qe(Qe(Qe({},oie),t),{},{getTileData:n});return{data:r,dataArray:[],tilesetOptions:i,isTile:!0}}function lie(e,t,r){switch(e){case"+":return t+r;case"-":return t-r;case"*":return t*r;case"/":return t/r;case"%":return t%r;case"^":return Math.pow(t,r);case"abs":return Math.abs(t);case"floor":return Math.floor(t);case"round":return Math.round(t);case"ceil":return Math.ceil(t);case"sin":return Math.sin(t);case"cos":return Math.cos(t);case"atan":return r===-1?Math.atan(t):Math.atan2(t,r);case"min":return Math.min(t,r);case"max":return Math.max(t,r);case"log10":return Math.log(t);case"log2":return Math.log2(t);default:return console.warn("Calculate symbol err! Return default 0"),0}}function im(e,t){for(var r=t[0],n=r.width,i=r.height,o=t.map(function(A){return A.rasterData}),a=n*i,u=[],c=JSON.stringify(e),f=0;f<a;f++){var m=JSON.parse(c),_=GM(m,o,f);if(typeof _=="number")u.push(_);else{var b=ix(m);u.push(b)}}return u}function GM(e,t,r){if(e.length===2&&e[0]==="band"&&typeof e[1]=="number")try{return t[e[1]][r]}catch{return console.warn("Raster Data err!"),0}e.map(function(n,i){if(Array.isArray(n)&&n.length>0)switch(n[0]){case"band":try{e[i]=t[n[1]][r]}catch{console.warn("Raster Data err!"),e[i]=0}break;default:GM(n,t,r)}})}function cie(e){var t=Nn(e,3),r=t[0],n=t[1],i=n===void 0?-1:n,o=t[2],a=o===void 0?-1:o;if(r===void 0)return console.warn("Express err!"),["+",0,0];var u=r.replace(/\s+/g,"");return[u,i,a]}function ix(e){var t=cie(e),r=t[0],n=t[1],i=t[2];return Array.isArray(n)&&(n=ix(e[1])),Array.isArray(i)&&(i=ix(e[2])),lie(r,n,i)}var fie={nd:{type:"operation",expression:["/",["-",["band",1],["band",0]],["+",["band",1],["band",0]]]},rgb:{type:"function",method:hie}};function hie(e,t){for(var r=e[0].rasterData,n=e[1].rasterData,i=e[2].rasterData,o=[],a=(t==null?void 0:t.countCut)||[2,98],u=Nn(a,2),c=u[0],f=u[1],m=(t==null?void 0:t.RMinMax)||Jd(r,c,f),_=(t==null?void 0:t.GMinMax)||Jd(n,c,f),b=(t==null?void 0:t.BMinMax)||Jd(i,c,f),A=0;A<r.length;A++)o.push(Math.max(0,r[A]-m[0])),o.push(Math.max(0,n[A]-_[0])),o.push(Math.max(0,i[A]-b[0]));return{rasterData:o,rMinMax:m,gMinMax:_,bMinMax:b}}function Jd(e,t,r){var n=e.slice().sort(function(u,c){return u-c}),i=n.length,o=n[Math.ceil(i*t/100)],a=n[Math.ceil(i*r/100)];return[o,a]}function X5(e,t,r){return ax.apply(this,arguments)}function ax(){return ax=Mt(he.mark(function e(t,r,n){var i,o,a,u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(t.length!==0){_.next=2;break}return _.abrupt("return",{rasterData:[0],width:1,heigh:1});case 2:return _.next=4,Promise.all(t.map(function(b){var A=b.data,w=b.bands,R=w===void 0?[0]:w;return r(A,R)}));case 4:i=_.sent,o=[],i.forEach(function(b){Array.isArray(b)?o.push.apply(o,nr(b)):o.push(b)}),a=o[0],u=a.width,c=a.height,_.t0=mu(n),_.next=_.t0==="function"?11:_.t0==="object"?13:15;break;case 11:return f=n(o),_.abrupt("break",16);case 13:return Array.isArray(n)?f={rasterData:im(n,o)}:f=pie(n,o),_.abrupt("break",16);case 15:f={rasterData:o[0].rasterData};case 16:return _.abrupt("return",Qe(Qe({},f),{},{width:u,height:c}));case 17:case"end":return _.stop()}},e)})),ax.apply(this,arguments)}function pie(e,t){var r=fie[e.type];if(r.type==="function")return r.method(t,e==null?void 0:e.options);if(r.type==="operation")return e.type==="rgb"?die(r.expression,t):{rasterData:im(r.expression,t)}}function die(e,t){e.r===void 0&&console.warn("Channel R lost in Operation! Use band[0] to fill!"),e.g===void 0&&console.warn("Channel G lost in Operation! Use band[0] to fill!"),e.b===void 0&&console.warn("Channel B lost in Operation! Use band[0] to fill!");var r=im(e.r||["band",0],t),n=im(e.g||["band",0],t),i=im(e.b||["band",0],t);return[r,n,i]}function ox(e,t,r,n){return sx.apply(this,arguments)}function sx(){return sx=Mt(he.mark(function e(t,r,n,i){var o;return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,X5(t,r,n);case 2:o=u.sent,i(null,{data:o});case 4:case"end":return u.stop()}},e)})),sx.apply(this,arguments)}function vie(e,t){var r=t.extent,n=t.width,i=t.height,o=t.min,a=t.max,u=t.format,c=t.operation,f,m,_;if(u===void 0||LM(e))f=Array.from(e),m=n,_=i;else{var b=Array.isArray(e)?e:[e];f=X5(b,u,c)}var A={_id:1,dataArray:[{_id:1,data:f,width:m,height:_,min:o,max:a,coordinates:[[r[0],r[1]],[r[2],r[3]]]}]};return A}/*! *****************************************************************************
|
|
Copyright (C) Microsoft. All rights reserved.
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
this file except in compliance with the License. You may obtain a copy of the
|
|
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
and limitations under the License.
|
|
***************************************************************************** */var I4;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof _c=="object"?_c:typeof self=="object"?self:typeof this=="object"?this:u(),n=i(e);typeof r.Reflect<"u"&&(n=i(r.Reflect,n)),t(n,r),typeof r.Reflect>"u"&&(r.Reflect=e);function i(c,f){return function(m,_){Object.defineProperty(c,m,{configurable:!0,writable:!0,value:_}),f&&f(m,_)}}function o(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return o()||a()}})(function(t,r){var n=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",o=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",c={__proto__:[]}instanceof Array,f=!u&&!c,m={create:u?function(){return rn(Object.create(null))}:c?function(){return rn({__proto__:null})}:function(){return rn({})},has:f?function(Ne,qe){return n.call(Ne,qe)}:function(Ne,qe){return qe in Ne},get:f?function(Ne,qe){return n.call(Ne,qe)?Ne[qe]:void 0}:function(Ne,qe){return Ne[qe]}},_=Object.getPrototypeOf(Function),b=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:rr(),A=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:hr(),w=typeof WeakMap=="function"?WeakMap:Cn(),R=i?Symbol.for("@reflect-metadata:registry"):void 0,P=Q(),k=Ge(P);function L(Ne,qe,ct,Vt){if(nt(ct)){if(!Xr(Ne))throw new TypeError;if(!ge(qe))throw new TypeError;return le(Ne,qe)}else{if(!Xr(Ne))throw new TypeError;if(!Ar(qe))throw new TypeError;if(!Ar(Vt)&&!nt(Vt)&&!pr(Vt))throw new TypeError;return pr(Vt)&&(Vt=void 0),ct=Qt(ct),ye(Ne,qe,ct,Vt)}}t("decorate",L);function B(Ne,qe){function ct(Vt,Qr){if(!Ar(Vt))throw new TypeError;if(!nt(Qr)&&!Be(Qr))throw new TypeError;Zt(Ne,qe,Vt,Qr)}return ct}t("metadata",B);function V(Ne,qe,ct,Vt){if(!Ar(ct))throw new TypeError;return nt(Vt)||(Vt=Qt(Vt)),Zt(Ne,qe,ct,Vt)}t("defineMetadata",V);function G(Ne,qe,ct){if(!Ar(qe))throw new TypeError;return nt(ct)||(ct=Qt(ct)),ke(Ne,qe,ct)}t("hasMetadata",G);function K(Ne,qe,ct){if(!Ar(qe))throw new TypeError;return nt(ct)||(ct=Qt(ct)),Rt(Ne,qe,ct)}t("hasOwnMetadata",K);function Z(Ne,qe,ct){if(!Ar(qe))throw new TypeError;return nt(ct)||(ct=Qt(ct)),Lt(Ne,qe,ct)}t("getMetadata",Z);function ve(Ne,qe,ct){if(!Ar(qe))throw new TypeError;return nt(ct)||(ct=Qt(ct)),Gt(Ne,qe,ct)}t("getOwnMetadata",ve);function Ie(Ne,qe){if(!Ar(Ne))throw new TypeError;return nt(qe)||(qe=Qt(qe)),st(Ne,qe)}t("getMetadataKeys",Ie);function de(Ne,qe){if(!Ar(Ne))throw new TypeError;return nt(qe)||(qe=Qt(qe)),tt(Ne,qe)}t("getOwnMetadataKeys",de);function se(Ne,qe,ct){if(!Ar(qe))throw new TypeError;if(nt(ct)||(ct=Qt(ct)),!Ar(qe))throw new TypeError;nt(ct)||(ct=Qt(ct));var Vt=yt(qe,ct,!1);return nt(Vt)?!1:Vt.OrdinaryDeleteMetadata(Ne,qe,ct)}t("deleteMetadata",se);function le(Ne,qe){for(var ct=Ne.length-1;ct>=0;--ct){var Vt=Ne[ct],Qr=Vt(qe);if(!nt(Qr)&&!pr(Qr)){if(!ge(Qr))throw new TypeError;qe=Qr}}return qe}function ye(Ne,qe,ct,Vt){for(var Qr=Ne.length-1;Qr>=0;--Qr){var Jn=Ne[Qr],Ri=Jn(qe,ct,Vt);if(!nt(Ri)&&!pr(Ri)){if(!Ar(Ri))throw new TypeError;Vt=Ri}}return Vt}function ke(Ne,qe,ct){var Vt=Rt(Ne,qe,ct);if(Vt)return!0;var Qr=lr(qe);return pr(Qr)?!1:ke(Ne,Qr,ct)}function Rt(Ne,qe,ct){var Vt=yt(qe,ct,!1);return nt(Vt)?!1:gi(Vt.OrdinaryHasOwnMetadata(Ne,qe,ct))}function Lt(Ne,qe,ct){var Vt=Rt(Ne,qe,ct);if(Vt)return Gt(Ne,qe,ct);var Qr=lr(qe);if(!pr(Qr))return Lt(Ne,Qr,ct)}function Gt(Ne,qe,ct){var Vt=yt(qe,ct,!1);if(!nt(Vt))return Vt.OrdinaryGetOwnMetadata(Ne,qe,ct)}function Zt(Ne,qe,ct,Vt){var Qr=yt(ct,Vt,!0);Qr.OrdinaryDefineOwnMetadata(Ne,qe,ct,Vt)}function st(Ne,qe){var ct=tt(Ne,qe),Vt=lr(Ne);if(Vt===null)return ct;var Qr=st(Vt,qe);if(Qr.length<=0)return ct;if(ct.length<=0)return Qr;for(var Jn=new A,Ri=[],qn=0,en=ct;qn<en.length;qn++){var fn=en[qn],an=Jn.has(fn);an||(Jn.add(fn),Ri.push(fn))}for(var un=0,ti=Qr;un<ti.length;un++){var fn=ti[un],an=Jn.has(fn);an||(Jn.add(fn),Ri.push(fn))}return Ri}function tt(Ne,qe){var ct=yt(Ne,qe,!1);return ct?ct.OrdinaryOwnMetadataKeys(Ne,qe):[]}function dt(Ne){if(Ne===null)return 1;switch(typeof Ne){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return Ne===null?1:6;default:return 6}}function nt(Ne){return Ne===void 0}function pr(Ne){return Ne===null}function ur(Ne){return typeof Ne=="symbol"}function Ar(Ne){return typeof Ne=="object"?Ne!==null:typeof Ne=="function"}function Xn(Ne,qe){switch(dt(Ne)){case 0:return Ne;case 1:return Ne;case 2:return Ne;case 3:return Ne;case 4:return Ne;case 5:return Ne}var ct=qe===3?"string":qe===5?"number":"default",Vt=At(Ne,o);if(Vt!==void 0){var Qr=Vt.call(Ne,ct);if(Ar(Qr))throw new TypeError;return Qr}return pn(Ne,ct==="default"?"number":ct)}function pn(Ne,qe){if(qe==="string"){var ct=Ne.toString;if(Ut(ct)){var Vt=ct.call(Ne);if(!Ar(Vt))return Vt}var Qr=Ne.valueOf;if(Ut(Qr)){var Vt=Qr.call(Ne);if(!Ar(Vt))return Vt}}else{var Qr=Ne.valueOf;if(Ut(Qr)){var Vt=Qr.call(Ne);if(!Ar(Vt))return Vt}var Jn=Ne.toString;if(Ut(Jn)){var Vt=Jn.call(Ne);if(!Ar(Vt))return Vt}}throw new TypeError}function gi(Ne){return!!Ne}function Je(Ne){return""+Ne}function Qt(Ne){var qe=Xn(Ne,3);return ur(qe)?qe:Je(qe)}function Xr(Ne){return Array.isArray?Array.isArray(Ne):Ne instanceof Object?Ne instanceof Array:Object.prototype.toString.call(Ne)==="[object Array]"}function Ut(Ne){return typeof Ne=="function"}function ge(Ne){return typeof Ne=="function"}function Be(Ne){switch(dt(Ne)){case 3:return!0;case 4:return!0;default:return!1}}function ft(Ne,qe){return Ne===qe||Ne!==Ne&&qe!==qe}function At(Ne,qe){var ct=Ne[qe];if(ct!=null){if(!Ut(ct))throw new TypeError;return ct}}function bt(Ne){var qe=At(Ne,a);if(!Ut(qe))throw new TypeError;var ct=qe.call(Ne);if(!Ar(ct))throw new TypeError;return ct}function $t(Ne){return Ne.value}function Mr(Ne){var qe=Ne.next();return qe.done?!1:qe}function tr(Ne){var qe=Ne.return;qe&&qe.call(Ne)}function lr(Ne){var qe=Object.getPrototypeOf(Ne);if(typeof Ne!="function"||Ne===_||qe!==_)return qe;var ct=Ne.prototype,Vt=ct&&Object.getPrototypeOf(ct);if(Vt==null||Vt===Object.prototype)return qe;var Qr=Vt.constructor;return typeof Qr!="function"||Qr===Ne?qe:Qr}function or(){var Ne;!nt(R)&&typeof r.Reflect<"u"&&!(R in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(Ne=at(r.Reflect));var qe,ct,Vt,Qr=new w,Jn={registerProvider:Ri,getProvider:en,setProvider:an};return Jn;function Ri(un){if(!Object.isExtensible(Jn))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case Ne===un:break;case nt(qe):qe=un;break;case qe===un:break;case nt(ct):ct=un;break;case ct===un:break;default:Vt===void 0&&(Vt=new A),Vt.add(un);break}}function qn(un,ti){if(!nt(qe)){if(qe.isProviderFor(un,ti))return qe;if(!nt(ct)){if(ct.isProviderFor(un,ti))return qe;if(!nt(Vt))for(var Hi=bt(Vt);;){var Fn=Mr(Hi);if(!Fn)return;var j=$t(Fn);if(j.isProviderFor(un,ti))return tr(Hi),j}}}if(!nt(Ne)&&Ne.isProviderFor(un,ti))return Ne}function en(un,ti){var Hi=Qr.get(un),Fn;return nt(Hi)||(Fn=Hi.get(ti)),nt(Fn)&&(Fn=qn(un,ti),nt(Fn)||(nt(Hi)&&(Hi=new b,Qr.set(un,Hi)),Hi.set(ti,Fn))),Fn}function fn(un){if(nt(un))throw new TypeError;return qe===un||ct===un||!nt(Vt)&&Vt.has(un)}function an(un,ti,Hi){if(!fn(Hi))throw new Error("Metadata provider not registered.");var Fn=en(un,ti);if(Fn!==Hi){if(!nt(Fn))return!1;var j=Qr.get(un);nt(j)&&(j=new b,Qr.set(un,j)),j.set(ti,Hi)}return!0}}function Q(){var Ne;return!nt(R)&&Ar(r.Reflect)&&Object.isExtensible(r.Reflect)&&(Ne=r.Reflect[R]),nt(Ne)&&(Ne=or()),!nt(R)&&Ar(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,R,{enumerable:!1,configurable:!1,writable:!1,value:Ne}),Ne}function Ge(Ne){var qe=new w,ct={isProviderFor:function(fn,an){var un=qe.get(fn);return nt(un)?!1:un.has(an)},OrdinaryDefineOwnMetadata:Ri,OrdinaryHasOwnMetadata:Qr,OrdinaryGetOwnMetadata:Jn,OrdinaryOwnMetadataKeys:qn,OrdinaryDeleteMetadata:en};return P.registerProvider(ct),ct;function Vt(fn,an,un){var ti=qe.get(fn),Hi=!1;if(nt(ti)){if(!un)return;ti=new b,qe.set(fn,ti),Hi=!0}var Fn=ti.get(an);if(nt(Fn)){if(!un)return;if(Fn=new b,ti.set(an,Fn),!Ne.setProvider(fn,an,ct))throw ti.delete(an),Hi&&qe.delete(fn),new Error("Wrong provider for target.")}return Fn}function Qr(fn,an,un){var ti=Vt(an,un,!1);return nt(ti)?!1:gi(ti.has(fn))}function Jn(fn,an,un){var ti=Vt(an,un,!1);if(!nt(ti))return ti.get(fn)}function Ri(fn,an,un,ti){var Hi=Vt(un,ti,!0);Hi.set(fn,an)}function qn(fn,an){var un=[],ti=Vt(fn,an,!1);if(nt(ti))return un;for(var Hi=ti.keys(),Fn=bt(Hi),j=0;;){var Y=Mr(Fn);if(!Y)return un.length=j,un;var J=$t(Y);try{un[j]=J}catch(ce){try{tr(Fn)}finally{throw ce}}j++}}function en(fn,an,un){var ti=Vt(an,un,!1);if(nt(ti)||!ti.delete(fn))return!1;if(ti.size===0){var Hi=qe.get(an);nt(Hi)||(Hi.delete(un),Hi.size===0&&qe.delete(Hi))}return!0}}function at(Ne){var qe=Ne.defineMetadata,ct=Ne.hasOwnMetadata,Vt=Ne.getOwnMetadata,Qr=Ne.getOwnMetadataKeys,Jn=Ne.deleteMetadata,Ri=new w,qn={isProviderFor:function(en,fn){var an=Ri.get(en);return nt(an)?Qr(en,fn).length?(nt(an)&&(an=new A,Ri.set(en,an)),an.add(fn),!0):!1:an.has(fn)},OrdinaryDefineOwnMetadata:qe,OrdinaryHasOwnMetadata:ct,OrdinaryGetOwnMetadata:Vt,OrdinaryOwnMetadataKeys:Qr,OrdinaryDeleteMetadata:Jn};return qn}function yt(Ne,qe,ct){var Vt=P.getProvider(Ne,qe);if(!nt(Vt))return Vt;if(ct){if(P.setProvider(Ne,qe,k))return k;throw new Error("Illegal state.")}}function rr(){var Ne={},qe=[],ct=function(){function qn(en,fn,an){this._index=0,this._keys=en,this._values=fn,this._selector=an}return qn.prototype["@@iterator"]=function(){return this},qn.prototype[a]=function(){return this},qn.prototype.next=function(){var en=this._index;if(en>=0&&en<this._keys.length){var fn=this._selector(this._keys[en],this._values[en]);return en+1>=this._keys.length?(this._index=-1,this._keys=qe,this._values=qe):this._index++,{value:fn,done:!1}}return{value:void 0,done:!0}},qn.prototype.throw=function(en){throw this._index>=0&&(this._index=-1,this._keys=qe,this._values=qe),en},qn.prototype.return=function(en){return this._index>=0&&(this._index=-1,this._keys=qe,this._values=qe),{value:en,done:!0}},qn}(),Vt=function(){function qn(){this._keys=[],this._values=[],this._cacheKey=Ne,this._cacheIndex=-2}return Object.defineProperty(qn.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),qn.prototype.has=function(en){return this._find(en,!1)>=0},qn.prototype.get=function(en){var fn=this._find(en,!1);return fn>=0?this._values[fn]:void 0},qn.prototype.set=function(en,fn){var an=this._find(en,!0);return this._values[an]=fn,this},qn.prototype.delete=function(en){var fn=this._find(en,!1);if(fn>=0){for(var an=this._keys.length,un=fn+1;un<an;un++)this._keys[un-1]=this._keys[un],this._values[un-1]=this._values[un];return this._keys.length--,this._values.length--,ft(en,this._cacheKey)&&(this._cacheKey=Ne,this._cacheIndex=-2),!0}return!1},qn.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=Ne,this._cacheIndex=-2},qn.prototype.keys=function(){return new ct(this._keys,this._values,Qr)},qn.prototype.values=function(){return new ct(this._keys,this._values,Jn)},qn.prototype.entries=function(){return new ct(this._keys,this._values,Ri)},qn.prototype["@@iterator"]=function(){return this.entries()},qn.prototype[a]=function(){return this.entries()},qn.prototype._find=function(en,fn){if(!ft(this._cacheKey,en)){this._cacheIndex=-1;for(var an=0;an<this._keys.length;an++)if(ft(this._keys[an],en)){this._cacheIndex=an;break}}return this._cacheIndex<0&&fn&&(this._cacheIndex=this._keys.length,this._keys.push(en),this._values.push(void 0)),this._cacheIndex},qn}();return Vt;function Qr(qn,en){return qn}function Jn(qn,en){return en}function Ri(qn,en){return[qn,en]}}function hr(){var Ne=function(){function qe(){this._map=new b}return Object.defineProperty(qe.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),qe.prototype.has=function(ct){return this._map.has(ct)},qe.prototype.add=function(ct){return this._map.set(ct,ct),this},qe.prototype.delete=function(ct){return this._map.delete(ct)},qe.prototype.clear=function(){this._map.clear()},qe.prototype.keys=function(){return this._map.keys()},qe.prototype.values=function(){return this._map.keys()},qe.prototype.entries=function(){return this._map.entries()},qe.prototype["@@iterator"]=function(){return this.keys()},qe.prototype[a]=function(){return this.keys()},qe}();return Ne}function Cn(){var Ne=16,qe=m.create(),ct=Vt();return function(){function en(){this._key=Vt()}return en.prototype.has=function(fn){var an=Qr(fn,!1);return an!==void 0?m.has(an,this._key):!1},en.prototype.get=function(fn){var an=Qr(fn,!1);return an!==void 0?m.get(an,this._key):void 0},en.prototype.set=function(fn,an){var un=Qr(fn,!0);return un[this._key]=an,this},en.prototype.delete=function(fn){var an=Qr(fn,!1);return an!==void 0?delete an[this._key]:!1},en.prototype.clear=function(){this._key=Vt()},en}();function Vt(){var en;do en="@@WeakMap@@"+qn();while(m.has(qe,en));return qe[en]=!0,en}function Qr(en,fn){if(!n.call(en,ct)){if(!fn)return;Object.defineProperty(en,ct,{value:m.create()})}return en[ct]}function Jn(en,fn){for(var an=0;an<fn;++an)en[an]=Math.random()*255|0;return en}function Ri(en){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(en)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(en)):Jn(new Uint8Array(en),en):Jn(new Array(en),en)}function qn(){var en=Ri(Ne);en[6]=en[6]&79|64,en[8]=en[8]&191|128;for(var fn="",an=0;an<Ne;++an){var un=en[an];(an===4||an===6||an===8)&&(fn+="-"),un<16&&(fn+="0"),fn+=un.toString(16).toLowerCase()}return fn}}function rn(Ne){return Ne.__=void 0,delete Ne.__,Ne}})})(I4||(I4={}));var ff="named",WM="name",Y5="unmanaged",XM="optional",ly="inject",Tm="multi_inject",YM="inversify:tagged",ZM="inversify:tagged_props",ux="inversify:paramtypes",mie="design:paramtypes",am="post_construct";function gie(){return[ly,Tm,WM,Y5,ff,XM]}var M4=gie(),zs={Request:"Request",Singleton:"Singleton",Transient:"Transient"},Us={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},th={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},_ie=0;function Ym(){return _ie++}var yie=function(){function e(t,r){this.id=Ym(),this.activated=!1,this.serviceIdentifier=t,this.scope=r,this.type=Us.Invalid,this.constraint=function(n){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return e.prototype.clone=function(){var t=new e(this.serviceIdentifier,this.scope);return t.activated=t.scope===zs.Singleton?this.activated:!1,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.factory=this.factory,t.provider=this.provider,t.constraint=this.constraint,t.onActivation=this.onActivation,t.cache=this.cache,t},e}(),xie="Cannot apply @injectable decorator multiple times.",bie="Metadata key was used more than once in a parameter:",dv="NULL argument",P4="Key Not Found",Eie="Ambiguous match found for serviceIdentifier:",Sie="Could not unbind serviceIdentifier:",Aie="No matching bindings found for serviceIdentifier:",Tie="Missing required @injectable annotation in:",wie="Missing required @inject or @multiInject annotation in:",Cie=function(e){return"@inject called with undefined this could mean that the class "+e+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},Rie="Circular dependency found:",Iie="Invalid binding type:",Mie="No snapshot available to restore.",Pie="Invalid return type in middleware. Middleware must return!",Oie="Value provided to function binding must be a function!",kie="The toSelf function can only be applied when a constructor is used as service identifier",Die="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",Fie=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"The number of constructor arguments in the derived class "+(e[0]+" must be >= than the number of constructor arguments of its base class.")},Bie="Invalid Container constructor argument. Container options must be an object.",Lie="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",Nie="Invalid Container option. Auto bind injectable must be a boolean",Uie="Invalid Container option. Skip base check must be a boolean",zie="Cannot apply @postConstruct decorator multiple times in the same class",$ie=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"@postConstruct error in class "+e[0]+": "+e[1]},Vie=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"It looks like there is a circular dependency "+("in one of the '"+e[0]+"' bindings. Please investigate bindings with")+("service identifier '"+e[1]+"'.")},jie="Maximum call stack size exceeded",Hie=function(){function e(){}return e.prototype.getConstructorMetadata=function(t){var r=Reflect.getMetadata(ux,t),n=Reflect.getMetadata(YM,t);return{compilerGeneratedMetadata:r,userGeneratedMetadata:n||{}}},e.prototype.getPropertiesMetadata=function(t){var r=Reflect.getMetadata(ZM,t)||[];return r},e}(),kg={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function qM(e){return e instanceof RangeError||e.message===jie}function wm(e){if(typeof e=="function"){var t=e;return t.name}else{if(typeof e=="symbol")return e.toString();var t=e;return t}}function O4(e,t,r){var n="",i=r(e,t);return i.length!==0&&(n=`
|
|
Registered bindings:`,i.forEach(function(o){var a="Object";o.implementationType!==null&&(a=cy(o.implementationType)),n=n+`
|
|
`+a,o.constraint.metaData&&(n=n+" - "+o.constraint.metaData)})),n}function KM(e,t){return e.parentRequest===null?!1:e.parentRequest.serviceIdentifier===t?!0:KM(e.parentRequest,t)}function Gie(e){function t(n,i){i===void 0&&(i=[]);var o=wm(n.serviceIdentifier);return i.push(o),n.parentRequest!==null?t(n.parentRequest,i):i}var r=t(e);return r.reverse().join(" --> ")}function QM(e){e.childRequests.forEach(function(t){if(KM(t,t.serviceIdentifier)){var r=Gie(t);throw new Error(Rie+" "+r)}else QM(t)})}function Wie(e,t){if(t.isTagged()||t.isNamed()){var r="",n=t.getNamedTag(),i=t.getCustomTags();return n!==null&&(r+=n.toString()+`
|
|
`),i!==null&&i.forEach(function(o){r+=o.toString()+`
|
|
`})," "+e+`
|
|
`+e+" - "+r}else return" "+e}function cy(e){if(e.name)return e.name;var t=e.toString(),r=t.match(/^function\s*([^\s(]+)/);return r?r[1]:"Anonymous function: "+t}var JM=function(){function e(t){this.id=Ym(),this.container=t}return e.prototype.addPlan=function(t){this.plan=t},e.prototype.setCurrentRequest=function(t){this.currentRequest=t},e}(),bp=function(){function e(t,r){this.key=t,this.value=r}return e.prototype.toString=function(){return this.key===ff?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},e}(),Xie=function(){function e(t,r){this.parentContext=t,this.rootRequest=r}return e}();function Yie(e,t,r,n){var i=YM;eP(i,e,t,n,r)}function Zie(e,t,r){var n=ZM;eP(n,e.constructor,t,r)}function eP(e,t,r,n,i){var o={},a=typeof i=="number",u=i!==void 0&&a?i.toString():r;if(a&&r!==void 0)throw new Error(Die);Reflect.hasOwnMetadata(e,t)&&(o=Reflect.getMetadata(e,t));var c=o[u];if(!Array.isArray(c))c=[];else for(var f=0,m=c;f<m.length;f++){var _=m[f];if(_.key===n.key)throw new Error(bie+" "+_.key.toString())}c.push(n),o[u]=c,Reflect.defineMetadata(e,o,t)}function k4(e,t){Reflect.decorate(e,t)}function qie(e,t){return function(r,n){t(r,n,e)}}function Kie(e,t,r){typeof r=="number"?k4([qie(r,e)],t):typeof r=="string"?Reflect.decorate([e],t,r):k4([e],t)}var Qie=function(){function e(t){this._cb=t}return e.prototype.unwrap=function(){return this._cb()},e}();function ki(e){return function(t,r,n){if(e===void 0)throw new Error(Cie(t.name));var i=new bp(ly,e);typeof n=="number"?Yie(t,r,n,i):Zie(t,r,i)}}var Jie=function(){function e(t){this.str=t}return e.prototype.startsWith=function(t){return this.str.indexOf(t)===0},e.prototype.endsWith=function(t){var r="",n=t.split("").reverse().join("");return r=this.str.split("").reverse().join(""),this.startsWith.call({str:r},n)},e.prototype.contains=function(t){return this.str.indexOf(t)!==-1},e.prototype.equals=function(t){return this.str===t},e.prototype.value=function(){return this.str},e}(),fy=function(){function e(t,r,n,i){this.id=Ym(),this.type=t,this.serviceIdentifier=n,this.name=new Jie(r||""),this.metadata=new Array;var o=null;typeof i=="string"?o=new bp(ff,i):i instanceof bp&&(o=i),o!==null&&this.metadata.push(o)}return e.prototype.hasTag=function(t){for(var r=0,n=this.metadata;r<n.length;r++){var i=n[r];if(i.key===t)return!0}return!1},e.prototype.isArray=function(){return this.hasTag(Tm)},e.prototype.matchesArray=function(t){return this.matchesTag(Tm)(t)},e.prototype.isNamed=function(){return this.hasTag(ff)},e.prototype.isTagged=function(){return this.metadata.some(function(t){return M4.every(function(r){return t.key!==r})})},e.prototype.isOptional=function(){return this.matchesTag(XM)(!0)},e.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(t){return t.key===ff})[0]:null},e.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(t){return M4.every(function(r){return t.key!==r})}):null},e.prototype.matchesNamedTag=function(t){return this.matchesTag(ff)(t)},e.prototype.matchesTag=function(t){var r=this;return function(n){for(var i=0,o=r.metadata;i<o.length;i++){var a=o[i];if(a.key===t&&a.value===n)return!0}return!1}},e}(),r_=function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};function eae(e,t){var r=cy(t),n=tP(e,r,t,!1);return n}function tP(e,t,r,n){var i=e.getConstructorMetadata(r),o=i.compilerGeneratedMetadata;if(o===void 0){var a=Tie+" "+t+".";throw new Error(a)}var u=i.userGeneratedMetadata,c=Object.keys(u),f=r.length===0&&c.length>0,m=c.length>r.length,_=f||m?c.length:r.length,b=rae(n,t,o,u,_),A=rP(e,r),w=r_(r_([],b),A);return w}function tae(e,t,r,n,i){var o=i[e.toString()]||[],a=iP(o),u=a.unmanaged!==!0,c=n[e],f=a.inject||a.multiInject;if(c=f||c,c instanceof Qie&&(c=c.unwrap()),u){var m=c===Object,_=c===Function,b=c===void 0,A=m||_||b;if(!t&&A){var w=wie+" argument "+e+" in class "+r+".";throw new Error(w)}var R=new fy(th.ConstructorArgument,a.targetName,c);return R.metadata=o,R}return null}function rae(e,t,r,n,i){for(var o=[],a=0;a<i;a++){var u=a,c=tae(u,e,t,r,n);c!==null&&o.push(c)}return o}function rP(e,t){for(var r=e.getPropertiesMetadata(t),n=[],i=Object.keys(r),o=0,a=i;o<a.length;o++){var u=a[o],c=r[u],f=iP(r[u]),m=f.targetName||u,_=f.inject||f.multiInject,b=new fy(th.ClassProperty,m,_);b.metadata=c,n.push(b)}var A=Object.getPrototypeOf(t.prototype).constructor;if(A!==Object){var w=rP(e,A);n=r_(r_([],n),w)}return n}function nP(e,t){var r=Object.getPrototypeOf(t.prototype).constructor;if(r!==Object){var n=cy(r),i=tP(e,n,r,!0),o=i.map(function(c){return c.metadata.filter(function(f){return f.key===Y5})}),a=[].concat.apply([],o).length,u=i.length-a;return u>0?u:nP(e,r)}else return 0}function iP(e){var t={};return e.forEach(function(r){t[r.key.toString()]=r.value}),{inject:t[ly],multiInject:t[Tm],targetName:t[WM],unmanaged:t[Y5]}}var Z5=function(){function e(t,r,n,i,o){this.id=Ym(),this.serviceIdentifier=t,this.parentContext=r,this.parentRequest=n,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=n===null?new Map:null}return e.prototype.addChildRequest=function(t,r,n){var i=new e(t,this.parentContext,this,r,n);return this.childRequests.push(i),i},e}();function lx(e){return e._bindingDictionary}function nae(e,t,r,n,i,o){var a=e?Tm:ly,u=new bp(a,r),c=new fy(t,n,r,u);if(i!==void 0){var f=new bp(i,o);c.metadata.push(f)}return c}function D4(e,t,r,n,i){var o=Cm(r.container,i.serviceIdentifier),a=[];return o.length===kg.NoBindingsAvailable&&r.container.options.autoBindInjectable&&typeof i.serviceIdentifier=="function"&&e.getConstructorMetadata(i.serviceIdentifier).compilerGeneratedMetadata&&(r.container.bind(i.serviceIdentifier).toSelf(),o=Cm(r.container,i.serviceIdentifier)),t?a=o:a=o.filter(function(u){var c=new Z5(u.serviceIdentifier,r,n,u,i);return u.constraint(c)}),iae(i.serviceIdentifier,a,i,r.container),a}function iae(e,t,r,n){switch(t.length){case kg.NoBindingsAvailable:if(r.isOptional())return t;var i=wm(e),o=Aie;throw o+=Wie(i,r),o+=O4(n,i,Cm),new Error(o);case kg.OnlyOneBindingAvailable:if(!r.isArray())return t;case kg.MultipleBindingsAvailable:default:if(r.isArray())return t;var i=wm(e),o=Eie+" "+i;throw o+=O4(n,i,Cm),new Error(o)}}function aP(e,t,r,n,i,o){var a,u;if(i===null){a=D4(e,t,n,null,o),u=new Z5(r,n,null,a,o);var c=new Xie(n,u);n.addPlan(c)}else a=D4(e,t,n,i,o),u=i.addChildRequest(o.serviceIdentifier,a,o);a.forEach(function(f){var m=null;if(o.isArray())m=u.addChildRequest(f.serviceIdentifier,f,o);else{if(f.cache)return;m=u}if(f.type===Us.Instance&&f.implementationType!==null){var _=eae(e,f.implementationType);if(!n.container.options.skipBaseClassChecks){var b=nP(e,f.implementationType);if(_.length<b){var A=Fie(cy(f.implementationType));throw new Error(A)}}_.forEach(function(w){aP(e,!1,w.serviceIdentifier,n,m,w)})}})}function Cm(e,t){var r=[],n=lx(e);return n.hasKey(t)?r=n.get(t):e.parent!==null&&(r=Cm(e.parent,t)),r}function aae(e,t,r,n,i,o,a,u){u===void 0&&(u=!1);var c=new JM(t),f=nae(r,n,i,"",o,a);try{return aP(e,u,i,c,null,f),c}catch(m){throw qM(m)&&c.plan&&QM(c.plan.rootRequest),m}}function oae(e,t,r,n){var i=new fy(th.Variable,"",t,new bp(r,n)),o=new JM(e),a=new Z5(t,o,null,[],i);return a}var sae=function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};function uae(e,t,r){var n=t.filter(function(o){return o.target!==null&&o.target.type===th.ClassProperty}),i=n.map(r);return n.forEach(function(o,a){var u="";u=o.target.name.value();var c=i[a];e[u]=c}),e}function lae(e,t){return new(e.bind.apply(e,sae([void 0],t)))}function cae(e,t){if(Reflect.hasMetadata(am,e)){var r=Reflect.getMetadata(am,e);try{t[r.value]()}catch(n){throw new Error($ie(e.name,n.message))}}}function fae(e,t,r){var n=null;if(t.length>0){var i=t.filter(function(a){return a.target!==null&&a.target.type===th.ConstructorArgument}),o=i.map(r);n=lae(e,o),n=uae(n,t,r)}else n=new e;return cae(e,n),n}var L3=function(e,t,r){try{return r()}catch(n){throw qM(n)?new Error(Vie(e,t.toString())):n}},cx=function(e){return function(t){t.parentContext.setCurrentRequest(t);var r=t.bindings,n=t.childRequests,i=t.target&&t.target.isArray(),o=!t.parentRequest||!t.parentRequest.target||!t.target||!t.parentRequest.target.matchesArray(t.target.serviceIdentifier);if(i&&o)return n.map(function(_){var b=cx(e);return b(_)});var a=null;if(t.target.isOptional()&&r.length===0)return;var u=r[0],c=u.scope===zs.Singleton,f=u.scope===zs.Request;if(c&&u.activated)return u.cache;if(f&&e!==null&&e.has(u.id))return e.get(u.id);if(u.type===Us.ConstantValue)a=u.cache,u.activated=!0;else if(u.type===Us.Function)a=u.cache,u.activated=!0;else if(u.type===Us.Constructor)a=u.implementationType;else if(u.type===Us.DynamicValue&&u.dynamicValue!==null)a=L3("toDynamicValue",u.serviceIdentifier,function(){return u.dynamicValue(t.parentContext)});else if(u.type===Us.Factory&&u.factory!==null)a=L3("toFactory",u.serviceIdentifier,function(){return u.factory(t.parentContext)});else if(u.type===Us.Provider&&u.provider!==null)a=L3("toProvider",u.serviceIdentifier,function(){return u.provider(t.parentContext)});else if(u.type===Us.Instance&&u.implementationType!==null)a=fae(u.implementationType,n,cx(e));else{var m=wm(t.serviceIdentifier);throw new Error(Iie+" "+m)}return typeof u.onActivation=="function"&&(a=u.onActivation(t.parentContext,a)),c&&(u.cache=a,u.activated=!0),f&&e!==null&&!e.has(u.id)&&e.set(u.id,a),a}};function hae(e){var t=cx(e.plan.rootRequest.requestScope);return t(e.plan.rootRequest)}var Qf=function(e,t){var r=e.parentRequest;return r!==null?t(r)?!0:Qf(r,t):!1},Hv=function(e){return function(t){var r=function(n){return n!==null&&n.target!==null&&n.target.matchesTag(e)(t)};return r.metaData=new bp(e,t),r}},q2=Hv(ff),N3=function(e){return function(t){var r=null;if(t!==null)if(r=t.bindings[0],typeof e=="string"){var n=r.serviceIdentifier;return n===e}else{var i=t.bindings[0].implementationType;return e===i}return!1}},q5=function(){function e(t){this._binding=t}return e.prototype.when=function(t){return this._binding.constraint=t,new Ls(this._binding)},e.prototype.whenTargetNamed=function(t){return this._binding.constraint=q2(t),new Ls(this._binding)},e.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){var r=t.target!==null&&!t.target.isNamed()&&!t.target.isTagged();return r},new Ls(this._binding)},e.prototype.whenTargetTagged=function(t,r){return this._binding.constraint=Hv(t)(r),new Ls(this._binding)},e.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(r){return N3(t)(r.parentRequest)},new Ls(this._binding)},e.prototype.whenParentNamed=function(t){return this._binding.constraint=function(r){return q2(t)(r.parentRequest)},new Ls(this._binding)},e.prototype.whenParentTagged=function(t,r){return this._binding.constraint=function(n){return Hv(t)(r)(n.parentRequest)},new Ls(this._binding)},e.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(r){return Qf(r,N3(t))},new Ls(this._binding)},e.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(r){return!Qf(r,N3(t))},new Ls(this._binding)},e.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(r){return Qf(r,q2(t))},new Ls(this._binding)},e.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(r){return!Qf(r,q2(t))},new Ls(this._binding)},e.prototype.whenAnyAncestorTagged=function(t,r){return this._binding.constraint=function(n){return Qf(n,Hv(t)(r))},new Ls(this._binding)},e.prototype.whenNoAncestorTagged=function(t,r){return this._binding.constraint=function(n){return!Qf(n,Hv(t)(r))},new Ls(this._binding)},e.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(r){return Qf(r,t)},new Ls(this._binding)},e.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(r){return!Qf(r,t)},new Ls(this._binding)},e}(),Ls=function(){function e(t){this._binding=t}return e.prototype.onActivation=function(t){return this._binding.onActivation=t,new q5(this._binding)},e}(),lp=function(){function e(t){this._binding=t,this._bindingWhenSyntax=new q5(this._binding),this._bindingOnSyntax=new Ls(this._binding)}return e.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},e.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(t,r){return this._bindingWhenSyntax.whenTargetTagged(t,r)},e.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},e.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},e.prototype.whenParentTagged=function(t,r){return this._bindingWhenSyntax.whenParentTagged(t,r)},e.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},e.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},e.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},e.prototype.whenAnyAncestorTagged=function(t,r){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,r)},e.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},e.prototype.whenNoAncestorTagged=function(t,r){return this._bindingWhenSyntax.whenNoAncestorTagged(t,r)},e.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},e.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},e.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},e}(),pae=function(){function e(t){this._binding=t}return e.prototype.inRequestScope=function(){return this._binding.scope=zs.Request,new lp(this._binding)},e.prototype.inSingletonScope=function(){return this._binding.scope=zs.Singleton,new lp(this._binding)},e.prototype.inTransientScope=function(){return this._binding.scope=zs.Transient,new lp(this._binding)},e}(),F4=function(){function e(t){this._binding=t,this._bindingWhenSyntax=new q5(this._binding),this._bindingOnSyntax=new Ls(this._binding),this._bindingInSyntax=new pae(t)}return e.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},e.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},e.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},e.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},e.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(t,r){return this._bindingWhenSyntax.whenTargetTagged(t,r)},e.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},e.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},e.prototype.whenParentTagged=function(t,r){return this._bindingWhenSyntax.whenParentTagged(t,r)},e.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},e.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},e.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},e.prototype.whenAnyAncestorTagged=function(t,r){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,r)},e.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},e.prototype.whenNoAncestorTagged=function(t,r){return this._bindingWhenSyntax.whenNoAncestorTagged(t,r)},e.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},e.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},e.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},e}(),dae=function(){function e(t){this._binding=t}return e.prototype.to=function(t){return this._binding.type=Us.Instance,this._binding.implementationType=t,new F4(this._binding)},e.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+kie);var t=this._binding.serviceIdentifier;return this.to(t)},e.prototype.toConstantValue=function(t){return this._binding.type=Us.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=zs.Singleton,new lp(this._binding)},e.prototype.toDynamicValue=function(t){return this._binding.type=Us.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new F4(this._binding)},e.prototype.toConstructor=function(t){return this._binding.type=Us.Constructor,this._binding.implementationType=t,this._binding.scope=zs.Singleton,new lp(this._binding)},e.prototype.toFactory=function(t){return this._binding.type=Us.Factory,this._binding.factory=t,this._binding.scope=zs.Singleton,new lp(this._binding)},e.prototype.toFunction=function(t){if(typeof t!="function")throw new Error(Oie);var r=this.toConstantValue(t);return this._binding.type=Us.Function,this._binding.scope=zs.Singleton,r},e.prototype.toAutoFactory=function(t){return this._binding.type=Us.Factory,this._binding.factory=function(r){var n=function(){return r.container.get(t)};return n},this._binding.scope=zs.Singleton,new lp(this._binding)},e.prototype.toProvider=function(t){return this._binding.type=Us.Provider,this._binding.provider=t,this._binding.scope=zs.Singleton,new lp(this._binding)},e.prototype.toService=function(t){this.toDynamicValue(function(r){return r.container.get(t)})},e}(),vae=function(){function e(){}return e.of=function(t,r){var n=new e;return n.bindings=t,n.middleware=r,n},e}(),B4=function(){function e(){this._map=new Map}return e.prototype.getMap=function(){return this._map},e.prototype.add=function(t,r){if(t==null)throw new Error(dv);if(r==null)throw new Error(dv);var n=this._map.get(t);n!==void 0?(n.push(r),this._map.set(t,n)):this._map.set(t,[r])},e.prototype.get=function(t){if(t==null)throw new Error(dv);var r=this._map.get(t);if(r!==void 0)return r;throw new Error(P4)},e.prototype.remove=function(t){if(t==null)throw new Error(dv);if(!this._map.delete(t))throw new Error(P4)},e.prototype.removeByCondition=function(t){var r=this;this._map.forEach(function(n,i){var o=n.filter(function(a){return!t(a)});o.length>0?r._map.set(i,o):r._map.delete(i)})},e.prototype.hasKey=function(t){if(t==null)throw new Error(dv);return this._map.has(t)},e.prototype.clone=function(){var t=new e;return this._map.forEach(function(r,n){r.forEach(function(i){return t.add(n,i.clone())})}),t},e.prototype.traverse=function(t){this._map.forEach(function(r,n){t(n,r)})},e}(),mae=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function u(m){try{f(n.next(m))}catch(_){a(_)}}function c(m){try{f(n.throw(m))}catch(_){a(_)}}function f(m){m.done?o(m.value):i(m.value).then(u,c)}f((n=n.apply(e,t||[])).next())})},gae=function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(f){return function(m){return c([f,m])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=t.call(e,r)}catch(m){f=[6,m],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},_ae=function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e},K5=function(){function e(t){this._appliedMiddleware=[];var r=t||{};if(typeof r!="object")throw new Error(""+Bie);if(r.defaultScope===void 0)r.defaultScope=zs.Transient;else if(r.defaultScope!==zs.Singleton&&r.defaultScope!==zs.Transient&&r.defaultScope!==zs.Request)throw new Error(""+Lie);if(r.autoBindInjectable===void 0)r.autoBindInjectable=!1;else if(typeof r.autoBindInjectable!="boolean")throw new Error(""+Nie);if(r.skipBaseClassChecks===void 0)r.skipBaseClassChecks=!1;else if(typeof r.skipBaseClassChecks!="boolean")throw new Error(""+Uie);this.options={autoBindInjectable:r.autoBindInjectable,defaultScope:r.defaultScope,skipBaseClassChecks:r.skipBaseClassChecks},this.id=Ym(),this._bindingDictionary=new B4,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new Hie}return e.merge=function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var o=new e,a=_ae([t,r],n).map(function(f){return lx(f)}),u=lx(o);function c(f,m){f.traverse(function(_,b){b.forEach(function(A){m.add(A.serviceIdentifier,A.clone())})})}return a.forEach(function(f){c(f,u)}),o},e.prototype.load=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n=this._getContainerModuleHelpersFactory(),i=0,o=t;i<o.length;i++){var a=o[i],u=n(a.id);a.registry(u.bindFunction,u.unbindFunction,u.isboundFunction,u.rebindFunction)}},e.prototype.loadAsync=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return mae(this,void 0,void 0,function(){var n,i,o,a,u;return gae(this,function(c){switch(c.label){case 0:n=this._getContainerModuleHelpersFactory(),i=0,o=t,c.label=1;case 1:return i<o.length?(a=o[i],u=n(a.id),[4,a.registry(u.bindFunction,u.unbindFunction,u.isboundFunction,u.rebindFunction)]):[3,4];case 2:c.sent(),c.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},e.prototype.unload=function(){for(var t=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=function(o){return function(a){return a.moduleId===o}};r.forEach(function(o){var a=i(o.id);t._bindingDictionary.removeByCondition(a)})},e.prototype.bind=function(t){var r=this.options.defaultScope||zs.Transient,n=new yie(t,r);return this._bindingDictionary.add(t,n),new dae(n)},e.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},e.prototype.unbind=function(t){try{this._bindingDictionary.remove(t)}catch{throw new Error(Sie+" "+wm(t))}},e.prototype.unbindAll=function(){this._bindingDictionary=new B4},e.prototype.isBound=function(t){var r=this._bindingDictionary.hasKey(t);return!r&&this.parent&&(r=this.parent.isBound(t)),r},e.prototype.isBoundNamed=function(t,r){return this.isBoundTagged(t,ff,r)},e.prototype.isBoundTagged=function(t,r,n){var i=!1;if(this._bindingDictionary.hasKey(t)){var o=this._bindingDictionary.get(t),a=oae(this,t,r,n);i=o.some(function(u){return u.constraint(a)})}return!i&&this.parent&&(i=this.parent.isBoundTagged(t,r,n)),i},e.prototype.snapshot=function(){this._snapshots.push(vae.of(this._bindingDictionary.clone(),this._middleware))},e.prototype.restore=function(){var t=this._snapshots.pop();if(t===void 0)throw new Error(Mie);this._bindingDictionary=t.bindings,this._middleware=t.middleware},e.prototype.createChild=function(t){var r=new e(t||this.options);return r.parent=this,r},e.prototype.applyMiddleware=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this._appliedMiddleware=this._appliedMiddleware.concat(t);var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce(function(i,o){return o(i)},n)},e.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},e.prototype.get=function(t){return this._get(!1,!1,th.Variable,t)},e.prototype.getTagged=function(t,r,n){return this._get(!1,!1,th.Variable,t,r,n)},e.prototype.getNamed=function(t,r){return this.getTagged(t,ff,r)},e.prototype.getAll=function(t){return this._get(!0,!0,th.Variable,t)},e.prototype.getAllTagged=function(t,r,n){return this._get(!1,!0,th.Variable,t,r,n)},e.prototype.getAllNamed=function(t,r){return this.getAllTagged(t,ff,r)},e.prototype.resolve=function(t){var r=this.createChild();return r.bind(t).toSelf(),this._appliedMiddleware.forEach(function(n){r.applyMiddleware(n)}),r.get(t)},e.prototype._getContainerModuleHelpersFactory=function(){var t=this,r=function(u,c){u._binding.moduleId=c},n=function(u){return function(c){var f=t.bind.bind(t),m=f(c);return r(m,u),m}},i=function(u){return function(c){var f=t.unbind.bind(t);f(c)}},o=function(u){return function(c){var f=t.isBound.bind(t);return f(c)}},a=function(u){return function(c){var f=t.rebind.bind(t),m=f(c);return r(m,u),m}};return function(u){return{bindFunction:n(u),isboundFunction:o(),rebindFunction:a(u),unbindFunction:i()}}},e.prototype._get=function(t,r,n,i,o,a){var u=null,c={avoidConstraints:t,contextInterceptor:function(f){return f},isMultiInject:r,key:o,serviceIdentifier:i,targetType:n,value:a};if(this._middleware){if(u=this._middleware(c),u==null)throw new Error(Pie)}else u=this._planAndResolve()(c);return u},e.prototype._planAndResolve=function(){var t=this;return function(r){var n=aae(t._metadataReader,t,r.isMultiInject,r.targetType,r.serviceIdentifier,r.key,r.value,r.avoidConstraints);n=r.contextInterceptor(n);var i=hae(n);return i}},e}();function ai(){return function(e){if(Reflect.hasOwnMetadata(ux,e))throw new Error(xie);var t=Reflect.getMetadata(mie,e)||[];return Reflect.defineMetadata(ux,t,e),e}}function yae(){return function(e,t,r){var n=new bp(am,t);if(Reflect.hasOwnMetadata(am,e.constructor))throw new Error(zie);Reflect.defineMetadata(am,n,e.constructor)}}var vv=Symbol.for("INJECTION");function hy(e,t,r,n){function i(){return n&&!Reflect.hasMetadata(vv,this,t)&&Reflect.defineMetadata(vv,r(),this,t),Reflect.hasMetadata(vv,this,t)?Reflect.getMetadata(vv,this,t):r()}function o(a){Reflect.defineMetadata(vv,a,this,t)}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:i,set:o})}function xae(e,t){return function(r){return function(n,i){var o=function(){return e.get(r)};hy(n,i,o,t)}}}function bae(e,t){return function(r,n){return function(i,o){var a=function(){return e.getNamed(r,n)};hy(i,o,a,t)}}}function Eae(e,t){return function(r,n,i){return function(o,a){var u=function(){return e.getTagged(r,n,i)};hy(o,a,u,t)}}}function Sae(e,t){return function(r){return function(n,i){var o=function(){return e.getAll(r)};hy(n,i,o,t)}}}function Aae(e,t){t===void 0&&(t=!0);var r=xae(e,t),n=bae(e,t),i=Eae(e,t),o=Sae(e,t);return{lazyInject:r,lazyInjectNamed:n,lazyInjectTagged:i,lazyMultiInject:o}}var wt={IEventEmitter:Symbol.for("IEventEmitter"),ISceneService:Symbol.for("ISceneService"),IGlobalConfigService:Symbol.for("IGlobalConfigService"),ICameraService:Symbol.for("ICameraService"),ICoordinateSystemService:Symbol.for("ICoordinateSystemService"),ILayerService:Symbol.for("ILayerService"),IDebugService:Symbol.for("IDebugService"),ILayerMappingService:Symbol.for("ILayerMappingService"),ILayerStyleService:Symbol.for("ILayerStyleService"),IMapService:Symbol.for("IMapService"),IMarkerService:Symbol.for("IMarkerService"),IPopupService:Symbol.for("PopupService"),IFactoryMapService:Symbol.for("Factory<IMapService>"),IRendererService:Symbol.for("IRendererService"),IShaderModuleService:Symbol.for("IShaderModuleService"),IIconService:Symbol.for("IIconService"),IFontService:Symbol.for("IFontService"),IInteractionService:Symbol.for("IInteractionService"),IPickingService:Symbol.for("IPickingService"),IControlService:Symbol.for("IControlService"),IStyleAttributeService:Symbol.for("IStyleAttributeService"),ILayer:Symbol.for("ILayer"),ILayerPlugin:Symbol.for("ILayerPlugin"),INormalPass:Symbol.for("INormalPass"),IPostProcessor:Symbol.for("IPostProcessor"),IPostProcessingPass:Symbol.for("IPostProcessingPass"),IFactoryPostProcessingPass:Symbol.for("Factory<IPostProcessingPass>"),IFactoryNormalPass:Symbol.for("Factory<IFactoryNormalPass>"),IMultiPassRenderer:Symbol.for("IMultiPassRenderer"),SceneID:Symbol.for("SceneID"),MapConfig:Symbol.for("MapConfig")},Q5={exports:{}};Q5.exports=Zm;Q5.exports.default=Zm;var e0=1e20;function Zm(e,t,r,n,i,o){this.fontSize=e||24,this.buffer=t===void 0?3:t,this.cutoff=n||.25,this.fontFamily=i||"sans-serif",this.fontWeight=o||"normal",this.radius=r||8;var a=this.size=this.fontSize+this.buffer*2,u=a+this.buffer*2;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(u*u),this.gridInner=new Float64Array(u*u),this.f=new Float64Array(u),this.z=new Float64Array(u+1),this.v=new Uint16Array(u),this.useMetrics=this.ctx.measureText("A").actualBoundingBoxLeft!==void 0,this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Tae(e,t,r,n,i,o,a){o.fill(e0,0,t*r),a.fill(0,0,t*r);for(var u=(t-n)/2,c=0;c<i;c++)for(var f=0;f<n;f++){var m=(c+u)*t+f+u,_=e.data[4*(c*n+f)+3]/255;if(_===1)o[m]=0,a[m]=e0;else if(_===0)o[m]=e0,a[m]=0;else{var b=Math.max(0,.5-_),A=Math.max(0,_-.5);o[m]=b*b,a[m]=A*A}}}function wae(e,t,r,n,i,o,a){for(var u=0;u<t*r;u++){var c=Math.sqrt(n[u])-Math.sqrt(i[u]);e[u]=Math.round(255-255*(c/o+a))}}Zm.prototype._draw=function(e,t){var r=this.ctx.measureText(e),n=r.width,i=2*this.buffer,o,a,u,c,f,m,_,b;t&&this.useMetrics?(f=Math.floor(r.actualBoundingBoxAscent),b=this.buffer+Math.ceil(r.actualBoundingBoxAscent),m=this.buffer,_=this.buffer,a=Math.min(this.size,Math.ceil(r.actualBoundingBoxRight-r.actualBoundingBoxLeft)),c=Math.min(this.size-m,Math.ceil(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)),o=a+i,u=c+i,this.ctx.textBaseline="alphabetic"):(o=a=this.size,u=c=this.size,f=19*this.fontSize/24,m=_=0,b=this.middle,this.ctx.textBaseline="middle");var A;a&&c&&(this.ctx.clearRect(_,m,a,c),this.ctx.fillText(e,this.buffer,b),A=this.ctx.getImageData(_,m,a,c));var w=new Uint8ClampedArray(o*u);return Tae(A,o,u,a,c,this.gridOuter,this.gridInner),L4(this.gridOuter,o,u,this.f,this.v,this.z),L4(this.gridInner,o,u,this.f,this.v,this.z),wae(w,o,u,this.gridOuter,this.gridInner,this.radius,this.cutoff),{data:w,metrics:{width:a,height:c,sdfWidth:o,sdfHeight:u,top:f,left:0,advance:n}}};Zm.prototype.draw=function(e){return this._draw(e,!1).data};Zm.prototype.drawWithMetrics=function(e){return this._draw(e,!0)};function L4(e,t,r,n,i,o){for(var a=0;a<t;a++)N4(e,a,t,r,n,i,o);for(var u=0;u<r;u++)N4(e,u*t,1,t,n,i,o)}function N4(e,t,r,n,i,o,a){var u,c,f,m;for(o[0]=0,a[0]=-e0,a[1]=e0,u=0;u<n;u++)i[u]=e[t+u*r];for(u=1,c=0,f=0;u<n;u++){do m=o[c],f=(i[u]-i[m]+u*u-m*m)/(u-m)/2;while(f<=a[c]&&--c>-1);c++,o[c]=u,a[c]=f,a[c+1]=e0}for(u=0,c=0;u<n;u++){for(;a[c+1]<u;)c++;m=o[c],e[t+u*r]=i[m]+(u-m)*(u-m)}}var Cae=Q5.exports;const Rae=oa(Cae);function oP(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Iae(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Iae(e,t){if(e){if(typeof e=="string")return U4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return U4(e,t)}}function U4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var mv=30;function Mae(e){var t=e.characterSet,r=e.getFontWidth,n=e.fontHeight,i=e.buffer,o=e.maxCanvasWidth,a=e.mapping,u=a===void 0?{}:a,c=e.xOffset,f=c===void 0?0:c,m=e.yOffset,_=m===void 0?0:m,b=0,A=f;Array.from(t).forEach(function(R,P){if(!u[R]){var k=r(R,P);A+mv>o&&(A=0,b++),u[R]={x:A,y:_+b*mv,width:mv,height:mv,advance:k},A+=mv}});var w=n+i*2;return{mapping:u,xOffset:A,yOffset:_+b*w,canvasHeight:sP(_+(b+1)*w)}}function Pae(e,t,r){var n=0,i=0,o=0,a=[],u={},c=oP(e),f;try{for(c.s();!(f=c.n()).done;){var m=f.value;if(!u[m.id]){var _=m.size;n+_+t>r&&(z4(u,a,i),n=0,i=o+i+t,o=0,a=[]),a.push({icon:m,xOffset:n}),n=n+_+t,o=Math.max(o,_)}}}catch(A){c.e(A)}finally{c.f()}a.length>0&&z4(u,a,i);var b=sP(o+i+t);return{mapping:u,canvasHeight:b}}function z4(e,t,r){var n=oP(t),i;try{for(n.s();!(i=n.n()).done;){var o=i.value,a=o.icon,u=o.xOffset;e[a.id]=Qe(Qe({},a),{},{x:u,y:r,image:a.image,width:a.width,height:a.height})}}catch(c){n.e(c)}finally{n.f()}}function sP(e){return Math.pow(2,Math.ceil(Math.log2(e)))}var $4,V4;function j4(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Oae(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Oae(e,t){if(e){if(typeof e=="string")return H4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return H4(e,t)}}function H4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kae(e){var t=Dae();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Dae(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Fae=Hae(),Bae="sans-serif",Lae="normal",Nae=24,Uae=3,zae=.25,$ae=8,G4=1024,Vae=1,W4=1,jae=3;function Hae(){for(var e=[],t=32;t<128;t++)e.push(String.fromCharCode(t));return e}function X4(e,t,r,n){e.font="".concat(n," ").concat(r,"px ").concat(t),e.fillStyle="black",e.textBaseline="middle"}function Y4(e,t){for(var r=0;r<e.length;r++)t.data[4*r+3]=e[r]}var Gae=($4=ai(),$4(V4=function(e){_n(r,e);var t=kae(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"fontAtlas",void 0),F($e(n),"iconFontMap",void 0),F($e(n),"iconFontGlyphs",{}),F($e(n),"fontOptions",void 0),F($e(n),"key",void 0),F($e(n),"cache",new Dee(jae)),n}return jt(r,[{key:"scale",get:function(){return W4}},{key:"canvas",get:function(){var i=this.cache.get(this.key);return i&&i.data}},{key:"mapping",get:function(){var i=this.cache.get(this.key);return i&&i.mapping||{}}},{key:"getCanvasByKey",value:function(i){var o=this.cache.get(i);return o&&o.data}},{key:"getMappingByKey",value:function(i){var o=this.cache.get(i);return o&&o.mapping||{}}},{key:"init",value:function(){this.cache.clear(),this.fontOptions={fontFamily:Bae,fontWeight:Lae,characterSet:Fae,fontSize:Nae,buffer:Uae,sdf:!0,cutoff:zae,radius:$ae,iconfont:!1},this.key="",this.iconFontMap=new Map}},{key:"addIconGlyphs",value:function(i){var o=this;i.forEach(function(a){o.iconFontGlyphs[a.name]=a.unicode})}},{key:"addIconFont",value:function(i,o){this.iconFontMap.set(i,o)}},{key:"getIconFontKey",value:function(i){return this.iconFontMap.get(i)||i}},{key:"getGlyph",value:function(i){return this.iconFontGlyphs[i]?String.fromCharCode(parseInt(this.iconFontGlyphs[i],16)):""}},{key:"setFontOptions",value:function(i){this.fontOptions=Qe(Qe({},this.fontOptions),i),this.key=this.getKey();var o=this.getNewChars(this.key,this.fontOptions.characterSet),a=this.cache.get(this.key);if(!(a&&o.length===0)){var u=this.generateFontAtlas(this.key,o,a);this.fontAtlas=u,this.cache.set(this.key,u)}}},{key:"addFontFace",value:function(i,o){var a=this,u=document.createElement("style");u.type="text/css",u.innerText=`
|
|
@font-face{
|
|
font-family: '`.concat(i,`';
|
|
src: url('`).concat(o,`') format('woff2'),
|
|
url('`).concat(o,`') format('woff'),
|
|
url('`).concat(o,`') format('truetype');
|
|
}`),u.onload=function(){if(document.fonts)try{document.fonts.load("24px ".concat(i),"L7text"),document.fonts.ready.then(function(){a.emit("fontloaded",{fontFamily:i})})}catch(c){console.warn("当前环境不支持 document.fonts !"),console.warn("当前环境不支持 iconfont !"),console.warn(c)}},document.getElementsByTagName("head")[0].appendChild(u)}},{key:"destroy",value:function(){this.cache.clear(),this.iconFontMap.clear()}},{key:"generateFontAtlas",value:function(i,o,a){var u=this.fontOptions,c=u.fontFamily,f=u.fontWeight,m=u.fontSize,_=u.buffer,b=u.sdf,A=u.radius,w=u.cutoff,R=u.iconfont,P=a&&a.data;P||(P=window.document.createElement("canvas"),P.width=G4);var k=P.getContext("2d",{willReadFrequently:!0});X4(k,c,m,f);var L=Mae(Qe({getFontWidth:function(st){return k.measureText(st).width},fontHeight:m*W4,buffer:_,characterSet:o,maxCanvasWidth:G4},a&&{mapping:a.mapping,xOffset:a.xOffset,yOffset:a.yOffset})),B=L.mapping,V=L.canvasHeight,G=L.xOffset,K=L.yOffset,Z=k.getImageData(0,0,P.width,P.height);if(P.height=V,k.putImageData(Z,0,0),X4(k,c,m,f),b){var ve=new Rae(m,_,A,w,c,f),Ie=k.getImageData(0,0,ve.size,ve.size),de=j4(o),se;try{for(de.s();!(se=de.n()).done;){var le=se.value;if(R){var ye=String.fromCharCode(parseInt(le.replace("&#x","").replace(";",""),16)),ke=ve.draw(ye);Y4(ke,Ie)}else Y4(ve.draw(le),Ie);k.putImageData(Ie,B[le].x,B[le].y)}}catch(Zt){de.e(Zt)}finally{de.f()}}else{var Rt=j4(o),Lt;try{for(Rt.s();!(Lt=Rt.n()).done;){var Gt=Lt.value;k.fillText(Gt,B[Gt].x,B[Gt].y+m*Vae)}}catch(Zt){Rt.e(Zt)}finally{Rt.f()}}return{xOffset:G,yOffset:K,mapping:B,data:P,width:P.width,height:P.height}}},{key:"getKey",value:function(){var i=this.fontOptions,o=i.fontFamily,a=i.fontWeight;return"".concat(o,"_").concat(a)}},{key:"getNewChars",value:function(i,o){var a=this.cache.get(i);if(!a)return o;var u=[],c=a.mapping,f=new Set(Object.keys(c)),m=new Set(o);return m.forEach(function(_){f.has(_)||u.push(_)}),u}}]),r}(ju.EventEmitter))||V4),Z4,q4;function Wae(e){var t=Xae();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Xae(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Yae=3,K4=1024,gv=64,Zae=(Z4=ai(),Z4(q4=function(e){_n(r,e);var t=Wae(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"canvasHeight",128),F($e(n),"texture",void 0),F($e(n),"canvas",void 0),F($e(n),"iconData",void 0),F($e(n),"iconMap",void 0),F($e(n),"ctx",void 0),F($e(n),"loadingImageCount",0),n}return jt(r,[{key:"isLoading",value:function(){return this.loadingImageCount===0}},{key:"init",value:function(){this.iconData=[],this.iconMap={},this.canvas=window.document.createElement("canvas"),this.canvas.width=128,this.canvas.height=128,this.ctx=this.canvas.getContext("2d")}},{key:"addImage",value:function(){var n=Mt(he.mark(function o(a,u){var c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return c=new Image,this.loadingImageCount++,this.hasImage(a)?console.warn("Image Id already exists"):this.iconData.push({id:a,size:gv}),this.updateIconMap(),_.next=6,this.loadImage(u);case 6:c=_.sent,f=this.iconData.find(function(b){return b.id===a}),f&&(f.image=c,f.width=c.width,f.height=c.height),this.update();case 10:case"end":return _.stop()}},o,this)}));function i(o,a){return n.apply(this,arguments)}return i}()},{key:"addImageMini",value:function(i,o,a){var u=this,c=a.getSceneConfig().canvas,f=c.createImage();if(this.loadingImageCount++,this.hasImage(i))throw new Error("Image Id already exists");this.iconData.push({id:i,size:gv}),this.updateIconMap(),this.loadImageMini(o,c).then(function(m){f=m;var _=u.iconData.find(function(b){return b.id===i});_&&(_.image=f,_.width=f.width,_.height=f.height),u.update()})}},{key:"getTexture",value:function(){return this.texture}},{key:"getIconMap",value:function(){return this.iconMap}},{key:"getCanvas",value:function(){return this.canvas}},{key:"hasImage",value:function(i){return this.iconMap.hasOwnProperty(i)}},{key:"removeImage",value:function(i){this.hasImage(i)&&(this.iconData=this.iconData.filter(function(o){return o.id!==i}),delete this.iconMap[i],this.update())}},{key:"destroy",value:function(){this.removeAllListeners("imageUpdate"),this.iconData=[],this.iconMap={}}},{key:"loadImage",value:function(i){return new Promise(function(o,a){if(i instanceof HTMLImageElement){o(i);return}var u=new Image;u.crossOrigin="anonymous",u.onload=function(){o(u)},u.onerror=function(){a(new Error("Could not load image at "+i))},u.src=i instanceof File?URL.createObjectURL(i):i})}},{key:"update",value:function(){this.updateIconMap(),this.updateIconAtlas(),this.loadingImageCount--,this.loadingImageCount===0&&this.emit("imageUpdate")}},{key:"updateIconAtlas",value:function(){var i=this;this.canvas.width=K4,this.canvas.height=this.canvasHeight,Object.keys(this.iconMap).forEach(function(o){var a=i.iconMap[o],u=a.x,c=a.y,f=a.image,m=a.width,_=m===void 0?64:m,b=a.height,A=b===void 0?64:b,w=Math.max(_,A),R=w/gv,P=A/R,k=_/R;f&&i.ctx.drawImage(f,u+(gv-k)/2,c+(gv-P)/2,k,P)})}},{key:"updateIconMap",value:function(){var i=Pae(this.iconData,Yae,K4),o=i.mapping,a=i.canvasHeight;this.iconMap=o,this.canvasHeight=a}},{key:"loadImageMini",value:function(i,o){return new Promise(function(a,u){var c=o.createImage();c.crossOrigin="anonymous",c.onload=function(){a(c)},c.onerror=function(){u(new Error("Could not load image at "+i))},c.src=i})}}]),r}(ju.EventEmitter))||q4),Q4,J4,qae=(Q4=ai(),Q4(J4=function(){function e(){Ht(this,e),F(this,"viewport",void 0),F(this,"overridedViewProjectionMatrix",void 0),F(this,"jitteredViewProjectionMatrix",void 0),F(this,"jitteredProjectionMatrix",void 0),F(this,"viewMatrixInverse",void 0),F(this,"cameraPosition",void 0)}return jt(e,[{key:"init",value:function(){}},{key:"update",value:function(r){this.viewport=r,this.viewMatrixInverse=v1(),V5(this.viewMatrixInverse,r.getViewMatrix()),this.cameraPosition=[this.viewMatrixInverse[12],this.viewMatrixInverse[13],this.viewMatrixInverse[14]]}},{key:"getProjectionMatrix",value:function(){return this.jitteredProjectionMatrix||this.viewport.getProjectionMatrix()}},{key:"getModelMatrix",value:function(){return this.viewport.getModelMatrix()}},{key:"getViewMatrix",value:function(){return this.viewport.getViewMatrix()}},{key:"getViewMatrixUncentered",value:function(){return this.viewport.getViewMatrixUncentered()}},{key:"getViewProjectionMatrixUncentered",value:function(){return this.viewport.getViewProjectionMatrixUncentered()}},{key:"getViewProjectionMatrix",value:function(){return this.overridedViewProjectionMatrix||this.jitteredViewProjectionMatrix||this.viewport.getViewProjectionMatrix()}},{key:"getZoom",value:function(){return this.viewport.getZoom()}},{key:"getZoomScale",value:function(){return this.viewport.getZoomScale()}},{key:"getCenter",value:function(){var r=this.viewport.getCenter(),n=Nn(r,2),i=n[0],o=n[1];return[i,o]}},{key:"getFocalDistance",value:function(){return this.viewport.getFocalDistance()}},{key:"getCameraPosition",value:function(){return this.cameraPosition}},{key:"projectFlat",value:function(r,n){return this.viewport.projectFlat(r,n)}},{key:"setViewProjectionMatrix",value:function(r){this.overridedViewProjectionMatrix=r}},{key:"jitterProjectionMatrix",value:function(r,n){var i=gM(v1(),[r,n,0]);this.jitteredProjectionMatrix=pf(v1(),i,this.viewport.getProjectionMatrix()),this.jitteredViewProjectionMatrix=pf(v1(),this.jitteredProjectionMatrix,this.viewport.getViewMatrix())}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0,this.jitteredViewProjectionMatrix=void 0}}]),e}())||J4),n_=function(e){return e.TOPRIGHT="topright",e.TOPLEFT="topleft",e.BOTTOMRIGHT="bottomright",e.BOTTOMLEFT="bottomleft",e.TOPCENTER="topcenter",e.BOTTOMCENTER="bottomcenter",e.LEFTCENTER="leftcenter",e.RIGHTCENTER="rightcenter",e.LEFTTOP="lefttop",e.RIGHTTOP="righttop",e.LEFTBOTTOM="leftbottom",e.RIGHTBOTTOM="rightbottom",e}({}),e8,t8;function Kae(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Qae(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Qae(e,t){if(e){if(typeof e=="string")return r8(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return r8(e,t)}}function r8(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Jae={topleft:"column",topright:"column",bottomright:"column",bottomleft:"column",leftcenter:"column",rightcenter:"column",topcenter:"row",bottomcenter:"row",lefttop:"row",righttop:"row",leftbottom:"row",rightbottom:"row"},eoe=(e8=ai(),e8(t8=function(){function e(){Ht(this,e),F(this,"container",void 0),F(this,"controlCorners",void 0),F(this,"controlContainer",void 0),F(this,"scene",void 0),F(this,"mapsService",void 0),F(this,"controls",[]),F(this,"unAddControls",[])}return jt(e,[{key:"init",value:function(r,n){this.container=r.container,this.scene=n,this.mapsService=n.get(wt.IMapService),this.initControlPos()}},{key:"addControl",value:function(r,n){var i=n.get(wt.IMapService);i.map?(r.addTo(this.scene),this.controls.push(r)):this.unAddControls.push(r)}},{key:"getControlByName",value:function(r){return this.controls.find(function(n){return n.controlOption.name===r})}},{key:"removeControl",value:function(r){var n=this.controls.indexOf(r);return n>-1&&this.controls.splice(n,1),r.remove(),this}},{key:"addControls",value:function(){var r=this;this.unAddControls.forEach(function(n){n.addTo(r.scene),r.controls.push(n)}),this.unAddControls=[]}},{key:"destroy",value:function(){var r=Kae(this.controls),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.remove()}}catch(o){r.e(o)}finally{r.f()}this.controls=[],this.clearControlPos()}},{key:"initControlPos",value:function(){var r=this.controlCorners={},n="l7-",i=this.controlContainer=fl("div",n+"control-container",this.container);function o(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],c=u.map(function(f){return n+f}).join(" ");r[u.filter(function(f){return!["row","column"].includes(f)}).join("")]=fl("div",c,i)}function a(u){var c=u.replace(/^(top|bottom|left|right|center)/,"$1-").split("-");return[].concat(nr(c),[Jae[u]])}Object.values(n_).forEach(function(u){o(a(u))}),this.checkCornerOverlap()}},{key:"clearControlPos",value:function(){for(var r in this.controlCorners)this.controlCorners[r]&&e_(this.controlCorners[r]);this.controlContainer&&e_(this.controlContainer)}},{key:"checkCornerOverlap",value:function(){var r=this,n=window.MutationObserver;if(n)for(var i=function(){var c=a[o],f=c.match(/^(top|bottom)(left|right)$/);if(f){var m=Nn(f,3),_=m[1],b=m[2],A=r.controlCorners["".concat(_).concat(b)],w=new n(function(R){var P=Nn(R,1),k=P[0].target;A&&(A.style[_]=k.clientHeight+"px")});w.observe(r.controlCorners["".concat(b).concat(_)],{childList:!0,attributes:!0})}},o=0,a=Object.keys(this.controlCorners);o<a.length;o++)i()}}]),e}())||t8),n8,i8,toe=(n8=ai(),n8(i8=function(){function e(){Ht(this,e),F(this,"container",void 0),F(this,"scene",void 0),F(this,"mapsService",void 0),F(this,"markers",[]),F(this,"markerLayers",[]),F(this,"unAddMarkers",[]),F(this,"unAddMarkerLayers",[])}return jt(e,[{key:"addMarkerLayer",value:function(r){this.mapsService.map&&this.mapsService.getMarkerContainer()?(this.markerLayers.push(r),r.addTo(this.scene)):this.unAddMarkerLayers.push(r)}},{key:"removeMarkerLayer",value:function(r){r.destroy(),this.markerLayers.indexOf(r);var n=this.markerLayers.indexOf(r);n>-1&&this.markerLayers.splice(n,1)}},{key:"addMarker",value:function(r){this.mapsService.map&&this.mapsService.getMarkerContainer()?(this.markers.push(r),r.addTo(this.scene)):this.unAddMarkers.push(r)}},{key:"addMarkers",value:function(){var r=this;this.unAddMarkers.forEach(function(n){n.addTo(r.scene),r.markers.push(n)}),this.unAddMarkers=[]}},{key:"addMarkerLayers",value:function(){var r=this;this.unAddMarkerLayers.forEach(function(n){r.markerLayers.push(n),n.addTo(r.scene)}),this.unAddMarkers=[]}},{key:"removeMarker",value:function(r){r.remove(),this.markers.indexOf(r);var n=this.markers.indexOf(r);n>-1&&this.markers.splice(n,1)}},{key:"removeAllMarkers",value:function(){this.destroy()}},{key:"init",value:function(r){this.scene=r,this.mapsService=r.get(wt.IMapService)}},{key:"destroy",value:function(){this.markers.forEach(function(r){r.remove()}),this.markers=[],this.markerLayers.forEach(function(r){r.destroy()}),this.markerLayers=[]}},{key:"removeMakerLayerMarker",value:function(r){r.destroy()}}]),e}())||i8),a8,o8,roe=(a8=ai(),a8(o8=function(){function e(){Ht(this,e),F(this,"scene",void 0),F(this,"mapsService",void 0),F(this,"popups",[]),F(this,"unAddPopups",[])}return jt(e,[{key:"isMarkerReady",get:function(){return this.mapsService.map&&this.mapsService.getMarkerContainer()}},{key:"removePopup",value:function(r){r!=null&&r.isOpen()&&r.remove();var n=this.popups.indexOf(r);n>-1&&this.popups.splice(n,1);var i=this.unAddPopups.indexOf(r);i>-1&&this.unAddPopups.splice(i,1)}},{key:"destroy",value:function(){this.popups.forEach(function(r){return r.remove()})}},{key:"addPopup",value:function(r){var n=this;r&&r.getOptions().autoClose&&[].concat(nr(this.popups),nr(this.unAddPopups)).forEach(function(i){i.getOptions().autoClose&&n.removePopup(i)}),this.isMarkerReady?(r.addTo(this.scene),this.popups.push(r)):this.unAddPopups.push(r),r.on("close",function(){n.removePopup(r)})}},{key:"initPopup",value:function(){var r=this;this.unAddPopups.length&&this.unAddPopups.forEach(function(n){r.addPopup(n),r.unAddPopups=[]})}},{key:"init",value:function(r){this.scene=r,this.mapsService=r.get(wt.IMapService)}}]),e}())||o8),up=function(e){return e.normal="normal",e.additive="additive",e.subtractive="subtractive",e.min="min",e.max="max",e.none="none",e}({}),m1=function(e){return e.MULTIPLE="MULTIPLE",e.SINGLE="SINGLE",e}({}),py=function(e){return e.AND="and",e.OR="or",e}({}),ps=function(e){return e.INIT="init",e.UPDATE="update",e}({}),noe={MapToken:"您正在使用 Demo 测试 Token, 生产环境务必自行注册 Token 确保服务稳定 高德地图申请地址 https://lbs.amap.com/api/javascript-api/guide/abc/prepare Mapbox地图申请地址 https://docs.mapbox.com/help/glossary/access-token/",SDK:"请确认引入了mapbox-gl api且在L7之前引入"},s8,u8,ioe=Ci.merge,aoe={id:"map",logoPosition:"bottomleft",logoVisible:!0,antialias:!0,stencil:!0,preserveDrawingBuffer:!1,pickBufferScale:1,fitBoundsOptions:{animate:!1}},ooe={colors:["rgb(103,0,31)","rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(247,247,247)","rgb(209,229,240)","rgb(146,197,222)","rgb(67,147,195)","rgb(33,102,172)","rgb(5,48,97)"],size:10,shape:"circle",scales:{},shape2d:["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],shape3d:["cylinder","triangleColumn","hexagonColumn","squareColumn"],minZoom:-1,maxZoom:24,visible:!0,autoFit:!1,pickingBuffer:0,enablePropagation:!1,zIndex:0,blend:"normal",maskLayers:[],enableMask:!0,maskOperation:py.AND,pickedFeatureID:-1,enableMultiPassRenderer:!1,enablePicking:!0,active:!1,activeColor:"#2f54eb",enableHighlight:!1,enableSelect:!1,highlightColor:"#2f54eb",activeMix:0,selectColor:"blue",selectMix:0,enableTAA:!1,jitterScale:1,enableLighting:!1,animateOption:{enable:!1,interval:.2,duration:4,trailLength:.15},forward:!0},soe=(s8=ai(),s8(u8=function(){function e(){Ht(this,e),F(this,"sceneConfigCache",{}),F(this,"layerConfigCache",{}),F(this,"layerAttributeConfigCache",{})}return jt(e,[{key:"getSceneConfig",value:function(r){return this.sceneConfigCache[r]}},{key:"getSceneWarninfo",value:function(r){return noe[r]}},{key:"setSceneConfig",value:function(r,n){this.sceneConfigCache[r]=Qe(Qe({},aoe),n)}},{key:"getLayerConfig",value:function(r){return this.layerConfigCache[r]}},{key:"setLayerConfig",value:function(r,n,i){this.layerConfigCache[n]=Qe({},ioe({},this.sceneConfigCache[r],ooe,i))}},{key:"getAttributeConfig",value:function(r){return this.layerAttributeConfigCache[r]}},{key:"setAttributeConfig",value:function(r,n){this.layerAttributeConfigCache[r]=Qe(Qe({},this.layerAttributeConfigCache[r]),n)}},{key:"clean",value:function(){this.sceneConfigCache={},this.layerConfigCache={}}}]),e}())||u8);function bi(e,t,r,n){r&&Object.defineProperty(e,t,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(n):void 0})}function mi(e,t,r,n,i){var o={};return Object.keys(n).forEach(function(a){o[a]=n[a]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=r.slice().reverse().reduce(function(a,u){return u(e,t,a)||a},o),i&&o.initializer!==void 0&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),o.initializer===void 0&&(Object.defineProperty(e,t,o),o=null),o}var U3=Math.PI/180,uoe=512,l8=4003e4;function c8(e){var t=e.latitude,r=t===void 0?0:t,n=e.zoom,i=n===void 0?0:n,o=e.scale,a=e.highPrecision,u=a===void 0?!1:a,c=e.flipY,f=c===void 0?!1:c;o=o!==void 0?o:Math.pow(2,i);var m={},_=uoe*o,b=Math.cos(r*U3),A=_/360,w=A/b,R=_/l8/b;if(m.pixelsPerMeter=[R,-R,R],m.metersPerPixel=[1/R,-1/R,1/R],m.pixelsPerDegree=[A,-w,R],m.degreesPerPixel=[1/A,-1/w,1/R],u){var P=U3*Math.tan(r*U3)/b,k=A*P/2,L=_/l8*P,B=L/w*R;m.pixelsPerDegree2=[0,-k,L],m.pixelsPerMeter2=[B,0,B],f&&(m.pixelsPerDegree2[1]=-m.pixelsPerDegree2[1],m.pixelsPerMeter2[1]=-m.pixelsPerMeter2[1])}return f&&(m.pixelsPerMeter[1]=-m.pixelsPerMeter[1],m.metersPerPixel[1]=-m.metersPerPixel[1],m.pixelsPerDegree[1]=-m.pixelsPerDegree[1],m.degreesPerPixel[1]=-m.degreesPerPixel[1]),m}var Vd=function(e){return e[e.LNGLAT=1]="LNGLAT",e[e.LNGLAT_OFFSET=2]="LNGLAT_OFFSET",e[e.VECTOR_TILE=3]="VECTOR_TILE",e[e.IDENTITY=4]="IDENTITY",e[e.P20=5]="P20",e[e.P20_OFFSET=6]="P20_OFFSET",e[e.METER_OFFSET=7]="METER_OFFSET",e[e.P20_2=8]="P20_2",e}({}),a1={CoordinateSystem:"u_CoordinateSystem",ViewportCenter:"u_ViewportCenter",ViewportCenterProjection:"u_ViewportCenterProjection",PixelsPerDegree:"u_PixelsPerDegree",PixelsPerDegree2:"u_PixelsPerDegree2",PixelsPerMeter:"u_PixelsPerMeter",Mvp:"u_Mvp"},f8,h8,p8,z3,d8,loe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],coe=(f8=ai(),h8=ki(wt.ICameraService),f8(p8=(z3=function(){function e(){Ht(this,e),F(this,"needRefresh",!0),bi(this,"cameraService",d8,this),F(this,"coordinateSystem",void 0),F(this,"viewportCenter",void 0),F(this,"viewportCenterProjection",void 0),F(this,"pixelsPerDegree",void 0),F(this,"pixelsPerDegree2",void 0),F(this,"pixelsPerMeter",void 0)}return jt(e,[{key:"refresh",value:function(r){var n=this.cameraService.getZoom(),i=this.cameraService.getZoomScale(),o=r||this.cameraService.getCenter(),a=c8({latitude:o[1],zoom:n}),u=a.pixelsPerMeter,c=a.pixelsPerDegree;this.viewportCenter=o,this.viewportCenterProjection=[0,0,0,0],this.pixelsPerMeter=u,this.pixelsPerDegree=c,this.pixelsPerDegree2=[0,0,0],this.coordinateSystem===Vd.LNGLAT||this.coordinateSystem===Vd.P20?this.cameraService.setViewProjectionMatrix(void 0):this.coordinateSystem===Vd.LNGLAT_OFFSET?this.calculateLnglatOffset(o,n):this.coordinateSystem===Vd.P20_OFFSET&&this.calculateLnglatOffset(o,n,i,!0),this.needRefresh=!1}},{key:"getCoordinateSystem",value:function(){return this.coordinateSystem}},{key:"setCoordinateSystem",value:function(r){this.coordinateSystem=r}},{key:"getViewportCenter",value:function(){return this.viewportCenter}},{key:"getViewportCenterProjection",value:function(){return this.viewportCenterProjection}},{key:"getPixelsPerDegree",value:function(){return this.pixelsPerDegree}},{key:"getPixelsPerDegree2",value:function(){return this.pixelsPerDegree2}},{key:"getPixelsPerMeter",value:function(){return this.pixelsPerMeter}},{key:"calculateLnglatOffset",value:function(r,n,i,o){var a=c8({latitude:r[1],zoom:n,scale:i,flipY:o,highPrecision:!0}),u=a.pixelsPerMeter,c=a.pixelsPerDegree,f=a.pixelsPerDegree2,m=this.cameraService.getViewMatrix(),_=this.cameraService.getProjectionMatrix(),b=pf([],_,m),A=this.cameraService.projectFlat([Math.fround(r[0]),Math.fround(r[1])],Math.pow(2,n));this.viewportCenterProjection=G5([],[A[0],A[1],0,1],b),m=this.cameraService.getViewMatrixUncentered()||m,b=pf([],_,m),b=pf([],b,loe),this.cameraService.setViewProjectionMatrix(b),this.pixelsPerMeter=u,this.pixelsPerDegree=c,this.pixelsPerDegree2=f}}]),e}(),d8=mi(z3.prototype,"cameraService",[h8],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),z3))||p8),v8,m8;function foe(e){var t=hoe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function hoe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var poe=(v8=ai(),v8(m8=function(e){_n(r,e);var t=foe(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"renderMap",new Map),F($e(n),"enable",!1),F($e(n),"renderEnable",!1),F($e(n),"cacheLogs",{}),n}return jt(r,[{key:"setEnable",value:function(i){this.enable=!!i}},{key:"log",value:function(i,o){var a=this;if(this.enable){var u=i.split("."),c=null;u.forEach(function(f,m){c!==null?(c[f]||(c[f]={}),m!==u.length-1&&(c=c[f])):(a.cacheLogs[f]||(a.cacheLogs[f]={}),m!==u.length-1&&(c=a.cacheLogs[f])),m===u.length-1&&(c[f]=Qe(Qe({time:Date.now()},c[f]),o))})}}},{key:"getLog",value:function(i){var o=this;switch(mu(i)){case"string":return this.cacheLogs[i];case"object":return i.map(function(a){return o.cacheLogs[a]}).filter(function(a){return a!==void 0});case"undefined":return this.cacheLogs}}},{key:"removeLog",value:function(i){delete this.cacheLogs[i]}},{key:"generateRenderUid",value:function(){return this.renderEnable?kee():""}},{key:"renderDebug",value:function(i){this.renderEnable=i}},{key:"renderStart",value:function(i){if(!(!this.renderEnable||!this.enable)){var o=this.renderMap.get(i)||{};this.renderMap.set(i,Qe(Qe({},o),{},{renderUid:i,renderStart:Date.now()}))}}},{key:"renderEnd",value:function(i){if(!(!this.renderEnable||!this.enable)){var o=this.renderMap.get(i);if(o){var a=o.renderStart,u=Date.now();this.emit("renderEnd",Qe(Qe({},o),{},{renderEnd:u,renderDuration:u-a})),this.renderMap.delete(i)}}}},{key:"destroy",value:function(){this.cacheLogs=null,this.renderMap.clear()}}]),r}(ju.EventEmitter))||m8),uP={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
* http://hammerjs.github.io/
|
|
*
|
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
* Licensed under the MIT license */(function(e){(function(t,r,n,i){var o=["","webkit","Moz","MS","ms","o"],a=r.createElement("div"),u="function",c=Math.round,f=Math.abs,m=Date.now;function _(ee,ue,Ue){return setTimeout(B(ee,Ue),ue)}function b(ee,ue,Ue){return Array.isArray(ee)?(A(ee,Ue[ue],Ue),!0):!1}function A(ee,ue,Ue){var _t;if(ee)if(ee.forEach)ee.forEach(ue,Ue);else if(ee.length!==i)for(_t=0;_t<ee.length;)ue.call(Ue,ee[_t],_t,ee),_t++;else for(_t in ee)ee.hasOwnProperty(_t)&&ue.call(Ue,ee[_t],_t,ee)}function w(ee,ue,Ue){var _t="DEPRECATED METHOD: "+ue+`
|
|
`+Ue+` AT
|
|
`;return function(){var Sr=new Error("get-stack-trace"),hn=Sr&&Sr.stack?Sr.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Ei=t.console&&(t.console.warn||t.console.log);return Ei&&Ei.call(t.console,_t,hn),ee.apply(this,arguments)}}var R;typeof Object.assign!="function"?R=function(ue){if(ue===i||ue===null)throw new TypeError("Cannot convert undefined or null to object");for(var Ue=Object(ue),_t=1;_t<arguments.length;_t++){var Sr=arguments[_t];if(Sr!==i&&Sr!==null)for(var hn in Sr)Sr.hasOwnProperty(hn)&&(Ue[hn]=Sr[hn])}return Ue}:R=Object.assign;var P=w(function(ue,Ue,_t){for(var Sr=Object.keys(Ue),hn=0;hn<Sr.length;)(!_t||_t&&ue[Sr[hn]]===i)&&(ue[Sr[hn]]=Ue[Sr[hn]]),hn++;return ue},"extend","Use `assign`."),k=w(function(ue,Ue){return P(ue,Ue,!0)},"merge","Use `assign`.");function L(ee,ue,Ue){var _t=ue.prototype,Sr;Sr=ee.prototype=Object.create(_t),Sr.constructor=ee,Sr._super=_t,Ue&&R(Sr,Ue)}function B(ee,ue){return function(){return ee.apply(ue,arguments)}}function V(ee,ue){return typeof ee==u?ee.apply(ue&&ue[0]||i,ue):ee}function G(ee,ue){return ee===i?ue:ee}function K(ee,ue,Ue){A(de(ue),function(_t){ee.addEventListener(_t,Ue,!1)})}function Z(ee,ue,Ue){A(de(ue),function(_t){ee.removeEventListener(_t,Ue,!1)})}function ve(ee,ue){for(;ee;){if(ee==ue)return!0;ee=ee.parentNode}return!1}function Ie(ee,ue){return ee.indexOf(ue)>-1}function de(ee){return ee.trim().split(/\s+/g)}function se(ee,ue,Ue){if(ee.indexOf&&!Ue)return ee.indexOf(ue);for(var _t=0;_t<ee.length;){if(Ue&&ee[_t][Ue]==ue||!Ue&&ee[_t]===ue)return _t;_t++}return-1}function le(ee){return Array.prototype.slice.call(ee,0)}function ye(ee,ue,Ue){for(var _t=[],Sr=[],hn=0;hn<ee.length;){var Ei=ue?ee[hn][ue]:ee[hn];se(Sr,Ei)<0&&_t.push(ee[hn]),Sr[hn]=Ei,hn++}return Ue&&(ue?_t=_t.sort(function(mo,no){return mo[ue]>no[ue]}):_t=_t.sort()),_t}function ke(ee,ue){for(var Ue,_t,Sr=ue[0].toUpperCase()+ue.slice(1),hn=0;hn<o.length;){if(Ue=o[hn],_t=Ue?Ue+Sr:ue,_t in ee)return _t;hn++}return i}var Rt=1;function Lt(){return Rt++}function Gt(ee){var ue=ee.ownerDocument||ee;return ue.defaultView||ue.parentWindow||t}var Zt=/mobile|tablet|ip(ad|hone|od)|android/i,st="ontouchstart"in t,tt=ke(t,"PointerEvent")!==i,dt=st&&Zt.test(navigator.userAgent),nt="touch",pr="pen",ur="mouse",Ar="kinect",Xn=25,pn=1,gi=2,Je=4,Qt=8,Xr=1,Ut=2,ge=4,Be=8,ft=16,At=Ut|ge,bt=Be|ft,$t=At|bt,Mr=["x","y"],tr=["clientX","clientY"];function lr(ee,ue){var Ue=this;this.manager=ee,this.callback=ue,this.element=ee.element,this.target=ee.options.inputTarget,this.domHandler=function(_t){V(ee.options.enable,[ee])&&Ue.handler(_t)},this.init()}lr.prototype={handler:function(){},init:function(){this.evEl&&K(this.element,this.evEl,this.domHandler),this.evTarget&&K(this.target,this.evTarget,this.domHandler),this.evWin&&K(Gt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Z(this.element,this.evEl,this.domHandler),this.evTarget&&Z(this.target,this.evTarget,this.domHandler),this.evWin&&Z(Gt(this.element),this.evWin,this.domHandler)}};function or(ee){var ue,Ue=ee.options.inputClass;return Ue?ue=Ue:tt?ue=ti:dt?ue=je:st?ue=it:ue=qn,new ue(ee,Q)}function Q(ee,ue,Ue){var _t=Ue.pointers.length,Sr=Ue.changedPointers.length,hn=ue&pn&&_t-Sr===0,Ei=ue&(Je|Qt)&&_t-Sr===0;Ue.isFirst=!!hn,Ue.isFinal=!!Ei,hn&&(ee.session={}),Ue.eventType=ue,Ge(ee,Ue),ee.emit("hammer.input",Ue),ee.recognize(Ue),ee.session.prevInput=Ue}function Ge(ee,ue){var Ue=ee.session,_t=ue.pointers,Sr=_t.length;Ue.firstInput||(Ue.firstInput=rr(ue)),Sr>1&&!Ue.firstMultiple?Ue.firstMultiple=rr(ue):Sr===1&&(Ue.firstMultiple=!1);var hn=Ue.firstInput,Ei=Ue.firstMultiple,La=Ei?Ei.center:hn.center,mo=ue.center=hr(_t);ue.timeStamp=m(),ue.deltaTime=ue.timeStamp-hn.timeStamp,ue.angle=qe(La,mo),ue.distance=Ne(La,mo),at(Ue,ue),ue.offsetDirection=rn(ue.deltaX,ue.deltaY);var no=Cn(ue.deltaTime,ue.deltaX,ue.deltaY);ue.overallVelocityX=no.x,ue.overallVelocityY=no.y,ue.overallVelocity=f(no.x)>f(no.y)?no.x:no.y,ue.scale=Ei?Vt(Ei.pointers,_t):1,ue.rotation=Ei?ct(Ei.pointers,_t):0,ue.maxPointers=Ue.prevInput?ue.pointers.length>Ue.prevInput.maxPointers?ue.pointers.length:Ue.prevInput.maxPointers:ue.pointers.length,yt(Ue,ue);var Vs=ee.element;ve(ue.srcEvent.target,Vs)&&(Vs=ue.srcEvent.target),ue.target=Vs}function at(ee,ue){var Ue=ue.center,_t=ee.offsetDelta||{},Sr=ee.prevDelta||{},hn=ee.prevInput||{};(ue.eventType===pn||hn.eventType===Je)&&(Sr=ee.prevDelta={x:hn.deltaX||0,y:hn.deltaY||0},_t=ee.offsetDelta={x:Ue.x,y:Ue.y}),ue.deltaX=Sr.x+(Ue.x-_t.x),ue.deltaY=Sr.y+(Ue.y-_t.y)}function yt(ee,ue){var Ue=ee.lastInterval||ue,_t=ue.timeStamp-Ue.timeStamp,Sr,hn,Ei,La;if(ue.eventType!=Qt&&(_t>Xn||Ue.velocity===i)){var mo=ue.deltaX-Ue.deltaX,no=ue.deltaY-Ue.deltaY,Vs=Cn(_t,mo,no);hn=Vs.x,Ei=Vs.y,Sr=f(Vs.x)>f(Vs.y)?Vs.x:Vs.y,La=rn(mo,no),ee.lastInterval=ue}else Sr=Ue.velocity,hn=Ue.velocityX,Ei=Ue.velocityY,La=Ue.direction;ue.velocity=Sr,ue.velocityX=hn,ue.velocityY=Ei,ue.direction=La}function rr(ee){for(var ue=[],Ue=0;Ue<ee.pointers.length;)ue[Ue]={clientX:c(ee.pointers[Ue].clientX),clientY:c(ee.pointers[Ue].clientY)},Ue++;return{timeStamp:m(),pointers:ue,center:hr(ue),deltaX:ee.deltaX,deltaY:ee.deltaY}}function hr(ee){var ue=ee.length;if(ue===1)return{x:c(ee[0].clientX),y:c(ee[0].clientY)};for(var Ue=0,_t=0,Sr=0;Sr<ue;)Ue+=ee[Sr].clientX,_t+=ee[Sr].clientY,Sr++;return{x:c(Ue/ue),y:c(_t/ue)}}function Cn(ee,ue,Ue){return{x:ue/ee||0,y:Ue/ee||0}}function rn(ee,ue){return ee===ue?Xr:f(ee)>=f(ue)?ee<0?Ut:ge:ue<0?Be:ft}function Ne(ee,ue,Ue){Ue||(Ue=Mr);var _t=ue[Ue[0]]-ee[Ue[0]],Sr=ue[Ue[1]]-ee[Ue[1]];return Math.sqrt(_t*_t+Sr*Sr)}function qe(ee,ue,Ue){Ue||(Ue=Mr);var _t=ue[Ue[0]]-ee[Ue[0]],Sr=ue[Ue[1]]-ee[Ue[1]];return Math.atan2(Sr,_t)*180/Math.PI}function ct(ee,ue){return qe(ue[1],ue[0],tr)+qe(ee[1],ee[0],tr)}function Vt(ee,ue){return Ne(ue[0],ue[1],tr)/Ne(ee[0],ee[1],tr)}var Qr={mousedown:pn,mousemove:gi,mouseup:Je},Jn="mousedown",Ri="mousemove mouseup";function qn(){this.evEl=Jn,this.evWin=Ri,this.pressed=!1,lr.apply(this,arguments)}L(qn,lr,{handler:function(ue){var Ue=Qr[ue.type];Ue&pn&&ue.button===0&&(this.pressed=!0),Ue&gi&&ue.which!==1&&(Ue=Je),this.pressed&&(Ue&Je&&(this.pressed=!1),this.callback(this.manager,Ue,{pointers:[ue],changedPointers:[ue],pointerType:ur,srcEvent:ue}))}});var en={pointerdown:pn,pointermove:gi,pointerup:Je,pointercancel:Qt,pointerout:Qt},fn={2:nt,3:pr,4:ur,5:Ar},an="pointerdown",un="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(an="MSPointerDown",un="MSPointerMove MSPointerUp MSPointerCancel");function ti(){this.evEl=an,this.evWin=un,lr.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}L(ti,lr,{handler:function(ue){var Ue=this.store,_t=!1,Sr=ue.type.toLowerCase().replace("ms",""),hn=en[Sr],Ei=fn[ue.pointerType]||ue.pointerType,La=Ei==nt,mo=se(Ue,ue.pointerId,"pointerId");hn&pn&&(ue.button===0||La)?mo<0&&(Ue.push(ue),mo=Ue.length-1):hn&(Je|Qt)&&(_t=!0),!(mo<0)&&(Ue[mo]=ue,this.callback(this.manager,hn,{pointers:Ue,changedPointers:[ue],pointerType:Ei,srcEvent:ue}),_t&&Ue.splice(mo,1))}});var Hi={touchstart:pn,touchmove:gi,touchend:Je,touchcancel:Qt},Fn="touchstart",j="touchstart touchmove touchend touchcancel";function Y(){this.evTarget=Fn,this.evWin=j,this.started=!1,lr.apply(this,arguments)}L(Y,lr,{handler:function(ue){var Ue=Hi[ue.type];if(Ue===pn&&(this.started=!0),!!this.started){var _t=J.call(this,ue,Ue);Ue&(Je|Qt)&&_t[0].length-_t[1].length===0&&(this.started=!1),this.callback(this.manager,Ue,{pointers:_t[0],changedPointers:_t[1],pointerType:nt,srcEvent:ue})}}});function J(ee,ue){var Ue=le(ee.touches),_t=le(ee.changedTouches);return ue&(Je|Qt)&&(Ue=ye(Ue.concat(_t),"identifier",!0)),[Ue,_t]}var ce={touchstart:pn,touchmove:gi,touchend:Je,touchcancel:Qt},Ee="touchstart touchmove touchend touchcancel";function je(){this.evTarget=Ee,this.targetIds={},lr.apply(this,arguments)}L(je,lr,{handler:function(ue){var Ue=ce[ue.type],_t=Ye.call(this,ue,Ue);_t&&this.callback(this.manager,Ue,{pointers:_t[0],changedPointers:_t[1],pointerType:nt,srcEvent:ue})}});function Ye(ee,ue){var Ue=le(ee.touches),_t=this.targetIds;if(ue&(pn|gi)&&Ue.length===1)return _t[Ue[0].identifier]=!0,[Ue,Ue];var Sr,hn,Ei=le(ee.changedTouches),La=[],mo=this.target;if(hn=Ue.filter(function(no){return ve(no.target,mo)}),ue===pn)for(Sr=0;Sr<hn.length;)_t[hn[Sr].identifier]=!0,Sr++;for(Sr=0;Sr<Ei.length;)_t[Ei[Sr].identifier]&&La.push(Ei[Sr]),ue&(Je|Qt)&&delete _t[Ei[Sr].identifier],Sr++;if(La.length)return[ye(hn.concat(La),"identifier",!0),La]}var ie=2500,Ce=25;function it(){lr.apply(this,arguments);var ee=B(this.handler,this);this.touch=new je(this.manager,ee),this.mouse=new qn(this.manager,ee),this.primaryTouch=null,this.lastTouches=[]}L(it,lr,{handler:function(ue,Ue,_t){var Sr=_t.pointerType==nt,hn=_t.pointerType==ur;if(!(hn&&_t.sourceCapabilities&&_t.sourceCapabilities.firesTouchEvents)){if(Sr)Nt.call(this,Ue,_t);else if(hn&&Ot.call(this,_t))return;this.callback(ue,Ue,_t)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Nt(ee,ue){ee&pn?(this.primaryTouch=ue.changedPointers[0].identifier,vr.call(this,ue)):ee&(Je|Qt)&&vr.call(this,ue)}function vr(ee){var ue=ee.changedPointers[0];if(ue.identifier===this.primaryTouch){var Ue={x:ue.clientX,y:ue.clientY};this.lastTouches.push(Ue);var _t=this.lastTouches,Sr=function(){var hn=_t.indexOf(Ue);hn>-1&&_t.splice(hn,1)};setTimeout(Sr,ie)}}function Ot(ee){for(var ue=ee.srcEvent.clientX,Ue=ee.srcEvent.clientY,_t=0;_t<this.lastTouches.length;_t++){var Sr=this.lastTouches[_t],hn=Math.abs(ue-Sr.x),Ei=Math.abs(Ue-Sr.y);if(hn<=Ce&&Ei<=Ce)return!0}return!1}var ar=ke(a.style,"touchAction"),tn=ar!==i,qr="compute",Dt="auto",zr="manipulation",Rr="none",Pr="pan-x",Hn="pan-y",Lr=oi();function ci(ee,ue){this.manager=ee,this.set(ue)}ci.prototype={set:function(ee){ee==qr&&(ee=this.compute()),tn&&this.manager.element.style&&Lr[ee]&&(this.manager.element.style[ar]=ee),this.actions=ee.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var ee=[];return A(this.manager.recognizers,function(ue){V(ue.options.enable,[ue])&&(ee=ee.concat(ue.getTouchAction()))}),Gi(ee.join(" "))},preventDefaults:function(ee){var ue=ee.srcEvent,Ue=ee.offsetDirection;if(this.manager.session.prevented){ue.preventDefault();return}var _t=this.actions,Sr=Ie(_t,Rr)&&!Lr[Rr],hn=Ie(_t,Hn)&&!Lr[Hn],Ei=Ie(_t,Pr)&&!Lr[Pr];if(Sr){var La=ee.pointers.length===1,mo=ee.distance<2,no=ee.deltaTime<250;if(La&&mo&&no)return}if(!(Ei&&hn)&&(Sr||hn&&Ue&At||Ei&&Ue&bt))return this.preventSrc(ue)},preventSrc:function(ee){this.manager.session.prevented=!0,ee.preventDefault()}};function Gi(ee){if(Ie(ee,Rr))return Rr;var ue=Ie(ee,Pr),Ue=Ie(ee,Hn);return ue&&Ue?Rr:ue||Ue?ue?Pr:Hn:Ie(ee,zr)?zr:Dt}function oi(){if(!tn)return!1;var ee={},ue=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(Ue){ee[Ue]=ue?t.CSS.supports("touch-action",Ue):!0}),ee}var _i=1,Gn=2,ka=4,hi=8,Wi=hi,Ii=16,Wn=32;function si(ee){this.options=R({},this.defaults,ee||{}),this.id=Lt(),this.manager=null,this.options.enable=G(this.options.enable,!0),this.state=_i,this.simultaneous={},this.requireFail=[]}si.prototype={defaults:{},set:function(ee){return R(this.options,ee),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(ee){if(b(ee,"recognizeWith",this))return this;var ue=this.simultaneous;return ee=wa(ee,this),ue[ee.id]||(ue[ee.id]=ee,ee.recognizeWith(this)),this},dropRecognizeWith:function(ee){return b(ee,"dropRecognizeWith",this)?this:(ee=wa(ee,this),delete this.simultaneous[ee.id],this)},requireFailure:function(ee){if(b(ee,"requireFailure",this))return this;var ue=this.requireFail;return ee=wa(ee,this),se(ue,ee)===-1&&(ue.push(ee),ee.requireFailure(this)),this},dropRequireFailure:function(ee){if(b(ee,"dropRequireFailure",this))return this;ee=wa(ee,this);var ue=se(this.requireFail,ee);return ue>-1&&this.requireFail.splice(ue,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(ee){return!!this.simultaneous[ee.id]},emit:function(ee){var ue=this,Ue=this.state;function _t(Sr){ue.manager.emit(Sr,ee)}Ue<hi&&_t(ue.options.event+To(Ue)),_t(ue.options.event),ee.additionalEvent&&_t(ee.additionalEvent),Ue>=hi&&_t(ue.options.event+To(Ue))},tryEmit:function(ee){if(this.canEmit())return this.emit(ee);this.state=Wn},canEmit:function(){for(var ee=0;ee<this.requireFail.length;){if(!(this.requireFail[ee].state&(Wn|_i)))return!1;ee++}return!0},recognize:function(ee){var ue=R({},ee);if(!V(this.options.enable,[this,ue])){this.reset(),this.state=Wn;return}this.state&(Wi|Ii|Wn)&&(this.state=_i),this.state=this.process(ue),this.state&(Gn|ka|hi|Ii)&&this.tryEmit(ue)},process:function(ee){},getTouchAction:function(){},reset:function(){}};function To(ee){return ee&Ii?"cancel":ee&hi?"end":ee&ka?"move":ee&Gn?"start":""}function dl(ee){return ee==ft?"down":ee==Be?"up":ee==Ut?"left":ee==ge?"right":""}function wa(ee,ue){var Ue=ue.manager;return Ue?Ue.get(ee):ee}function fa(){si.apply(this,arguments)}L(fa,si,{defaults:{pointers:1},attrTest:function(ee){var ue=this.options.pointers;return ue===0||ee.pointers.length===ue},process:function(ee){var ue=this.state,Ue=ee.eventType,_t=ue&(Gn|ka),Sr=this.attrTest(ee);return _t&&(Ue&Qt||!Sr)?ue|Ii:_t||Sr?Ue&Je?ue|hi:ue&Gn?ue|ka:Gn:Wn}});function vl(){fa.apply(this,arguments),this.pX=null,this.pY=null}L(vl,fa,{defaults:{event:"pan",threshold:10,pointers:1,direction:$t},getTouchAction:function(){var ee=this.options.direction,ue=[];return ee&At&&ue.push(Hn),ee&bt&&ue.push(Pr),ue},directionTest:function(ee){var ue=this.options,Ue=!0,_t=ee.distance,Sr=ee.direction,hn=ee.deltaX,Ei=ee.deltaY;return Sr&ue.direction||(ue.direction&At?(Sr=hn===0?Xr:hn<0?Ut:ge,Ue=hn!=this.pX,_t=Math.abs(ee.deltaX)):(Sr=Ei===0?Xr:Ei<0?Be:ft,Ue=Ei!=this.pY,_t=Math.abs(ee.deltaY))),ee.direction=Sr,Ue&&_t>ue.threshold&&Sr&ue.direction},attrTest:function(ee){return fa.prototype.attrTest.call(this,ee)&&(this.state&Gn||!(this.state&Gn)&&this.directionTest(ee))},emit:function(ee){this.pX=ee.deltaX,this.pY=ee.deltaY;var ue=dl(ee.direction);ue&&(ee.additionalEvent=this.options.event+ue),this._super.emit.call(this,ee)}});function $s(){fa.apply(this,arguments)}L($s,fa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Rr]},attrTest:function(ee){return this._super.attrTest.call(this,ee)&&(Math.abs(ee.scale-1)>this.options.threshold||this.state&Gn)},emit:function(ee){if(ee.scale!==1){var ue=ee.scale<1?"in":"out";ee.additionalEvent=this.options.event+ue}this._super.emit.call(this,ee)}});function sa(){si.apply(this,arguments),this._timer=null,this._input=null}L(sa,si,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Dt]},process:function(ee){var ue=this.options,Ue=ee.pointers.length===ue.pointers,_t=ee.distance<ue.threshold,Sr=ee.deltaTime>ue.time;if(this._input=ee,!_t||!Ue||ee.eventType&(Je|Qt)&&!Sr)this.reset();else if(ee.eventType&pn)this.reset(),this._timer=_(function(){this.state=Wi,this.tryEmit()},ue.time,this);else if(ee.eventType&Je)return Wi;return Wn},reset:function(){clearTimeout(this._timer)},emit:function(ee){this.state===Wi&&(ee&&ee.eventType&Je?this.manager.emit(this.options.event+"up",ee):(this._input.timeStamp=m(),this.manager.emit(this.options.event,this._input)))}});function Hu(){fa.apply(this,arguments)}L(Hu,fa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Rr]},attrTest:function(ee){return this._super.attrTest.call(this,ee)&&(Math.abs(ee.rotation)>this.options.threshold||this.state&Gn)}});function ro(){fa.apply(this,arguments)}L(ro,fa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:At|bt,pointers:1},getTouchAction:function(){return vl.prototype.getTouchAction.call(this)},attrTest:function(ee){var ue=this.options.direction,Ue;return ue&(At|bt)?Ue=ee.overallVelocity:ue&At?Ue=ee.overallVelocityX:ue&bt&&(Ue=ee.overallVelocityY),this._super.attrTest.call(this,ee)&&ue&ee.offsetDirection&&ee.distance>this.options.threshold&&ee.maxPointers==this.options.pointers&&f(Ue)>this.options.velocity&&ee.eventType&Je},emit:function(ee){var ue=dl(ee.offsetDirection);ue&&this.manager.emit(this.options.event+ue,ee),this.manager.emit(this.options.event,ee)}});function ua(){si.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}L(ua,si,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[zr]},process:function(ee){var ue=this.options,Ue=ee.pointers.length===ue.pointers,_t=ee.distance<ue.threshold,Sr=ee.deltaTime<ue.time;if(this.reset(),ee.eventType&pn&&this.count===0)return this.failTimeout();if(_t&&Sr&&Ue){if(ee.eventType!=Je)return this.failTimeout();var hn=this.pTime?ee.timeStamp-this.pTime<ue.interval:!0,Ei=!this.pCenter||Ne(this.pCenter,ee.center)<ue.posThreshold;this.pTime=ee.timeStamp,this.pCenter=ee.center,!Ei||!hn?this.count=1:this.count+=1,this._input=ee;var La=this.count%ue.taps;if(La===0)return this.hasRequireFailures()?(this._timer=_(function(){this.state=Wi,this.tryEmit()},ue.interval,this),Gn):Wi}return Wn},failTimeout:function(){return this._timer=_(function(){this.state=Wn},this.options.interval,this),Wn},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Wi&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Ca(ee,ue){return ue=ue||{},ue.recognizers=G(ue.recognizers,Ca.defaults.preset),new Bo(ee,ue)}Ca.VERSION="2.0.7",Ca.defaults={domEvents:!1,touchAction:qr,enable:!0,inputTarget:null,inputClass:null,preset:[[Hu,{enable:!1}],[$s,{enable:!1},["rotate"]],[ro,{direction:At}],[vl,{direction:At},["swipe"]],[ua],[ua,{event:"doubletap",taps:2},["tap"]],[sa]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Qi=1,Go=2;function Bo(ee,ue){this.options=R({},Ca.defaults,ue||{}),this.options.inputTarget=this.options.inputTarget||ee,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=ee,this.input=or(this),this.touchAction=new ci(this,this.options.touchAction),yf(this,!0),A(this.options.recognizers,function(Ue){var _t=this.add(new Ue[0](Ue[1]));Ue[2]&&_t.recognizeWith(Ue[2]),Ue[3]&&_t.requireFailure(Ue[3])},this)}Bo.prototype={set:function(ee){return R(this.options,ee),ee.touchAction&&this.touchAction.update(),ee.inputTarget&&(this.input.destroy(),this.input.target=ee.inputTarget,this.input.init()),this},stop:function(ee){this.session.stopped=ee?Go:Qi},recognize:function(ee){var ue=this.session;if(!ue.stopped){this.touchAction.preventDefaults(ee);var Ue,_t=this.recognizers,Sr=ue.curRecognizer;(!Sr||Sr&&Sr.state&Wi)&&(Sr=ue.curRecognizer=null);for(var hn=0;hn<_t.length;)Ue=_t[hn],ue.stopped!==Go&&(!Sr||Ue==Sr||Ue.canRecognizeWith(Sr))?Ue.recognize(ee):Ue.reset(),!Sr&&Ue.state&(Gn|ka|hi)&&(Sr=ue.curRecognizer=Ue),hn++}},get:function(ee){if(ee instanceof si)return ee;for(var ue=this.recognizers,Ue=0;Ue<ue.length;Ue++)if(ue[Ue].options.event==ee)return ue[Ue];return null},add:function(ee){if(b(ee,"add",this))return this;var ue=this.get(ee.options.event);return ue&&this.remove(ue),this.recognizers.push(ee),ee.manager=this,this.touchAction.update(),ee},remove:function(ee){if(b(ee,"remove",this))return this;if(ee=this.get(ee),ee){var ue=this.recognizers,Ue=se(ue,ee);Ue!==-1&&(ue.splice(Ue,1),this.touchAction.update())}return this},on:function(ee,ue){if(ee!==i&&ue!==i){var Ue=this.handlers;return A(de(ee),function(_t){Ue[_t]=Ue[_t]||[],Ue[_t].push(ue)}),this}},off:function(ee,ue){if(ee!==i){var Ue=this.handlers;return A(de(ee),function(_t){ue?Ue[_t]&&Ue[_t].splice(se(Ue[_t],ue),1):delete Ue[_t]}),this}},emit:function(ee,ue){this.options.domEvents&&vs(ee,ue);var Ue=this.handlers[ee]&&this.handlers[ee].slice();if(!(!Ue||!Ue.length)){ue.type=ee,ue.preventDefault=function(){ue.srcEvent.preventDefault()};for(var _t=0;_t<Ue.length;)Ue[_t](ue),_t++}},destroy:function(){this.element&&yf(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function yf(ee,ue){var Ue=ee.element;if(Ue.style){var _t;A(ee.options.cssProps,function(Sr,hn){_t=ke(Ue.style,hn),ue?(ee.oldCssProps[_t]=Ue.style[_t],Ue.style[_t]=Sr):Ue.style[_t]=ee.oldCssProps[_t]||""}),ue||(ee.oldCssProps={})}}function vs(ee,ue){var Ue=r.createEvent("Event");Ue.initEvent(ee,!0,!0),Ue.gesture=ue,ue.target.dispatchEvent(Ue)}R(Ca,{INPUT_START:pn,INPUT_MOVE:gi,INPUT_END:Je,INPUT_CANCEL:Qt,STATE_POSSIBLE:_i,STATE_BEGAN:Gn,STATE_CHANGED:ka,STATE_ENDED:hi,STATE_RECOGNIZED:Wi,STATE_CANCELLED:Ii,STATE_FAILED:Wn,DIRECTION_NONE:Xr,DIRECTION_LEFT:Ut,DIRECTION_RIGHT:ge,DIRECTION_UP:Be,DIRECTION_DOWN:ft,DIRECTION_HORIZONTAL:At,DIRECTION_VERTICAL:bt,DIRECTION_ALL:$t,Manager:Bo,Input:lr,TouchAction:ci,TouchInput:je,MouseInput:qn,PointerEventInput:ti,TouchMouseInput:it,SingleTouchInput:Y,Recognizer:si,AttrRecognizer:fa,Tap:ua,Pan:vl,Swipe:ro,Pinch:$s,Rotate:Hu,Press:sa,on:K,off:Z,each:A,merge:k,extend:P,assign:R,inherit:L,bindFn:B,prefixed:ke});var Tp=typeof t<"u"?t:typeof self<"u"?self:{};Tp.Hammer=Ca,typeof i=="function"&&i.amd?i(function(){return Ca}):e.exports?e.exports=Ca:t[n]=Ca})(window,document,"Hammer")})(uP);var doe=uP.exports;const _v=oa(doe);var Bu=function(e){return e.Hover="hover",e.Click="click",e.Select="select",e.Active="active",e.Drag="drag",e}({}),g8,_8,y8,$3,x8;function voe(e){var t=moe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function moe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var goe={panstart:"dragstart",panmove:"dragging",panend:"dragend",pancancel:"dragcancel"},_oe=(g8=ai(),_8=ki(wt.IMapService),g8(y8=($3=function(e){_n(r,e);var t=voe(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"indragging",!1),bi($e(n),"mapService",x8,$e(n)),F($e(n),"hammertime",void 0),F($e(n),"lastClickTime",0),F($e(n),"lastClickXY",[-1,-1]),F($e(n),"clickTimer",void 0),F($e(n),"$containter",void 0),F($e(n),"onDrag",function(u){var c=n.interactionEvent(u);c.type=goe[c.type],c.type==="dragging"?n.indragging=!0:n.indragging=!1,n.emit(Bu.Drag,c)}),F($e(n),"onHammer",function(u){u.srcEvent.stopPropagation();var c=n.interactionEvent(u);n.emit(Bu.Hover,c)}),F($e(n),"onTouch",function(u){var c=u.touches[0];n.onHover({clientX:c.clientX,clientY:c.clientY,type:"touchstart"})}),F($e(n),"onTouchEnd",function(u){if(u.changedTouches.length>0){var c=u.changedTouches[0];n.onHover({clientX:c.clientX,clientY:c.clientY,type:"touchend"})}}),F($e(n),"onTouchMove",function(u){var c=u.changedTouches[0];n.onHover({clientX:c.clientX,clientY:c.clientY,type:"touchmove"})}),F($e(n),"onHover",function(u){var c=u.clientX,f=u.clientY,m=c,_=f,b=u.type,A=n.mapService.getMapContainer();if(A){var w=A.getBoundingClientRect(),R=w.top,P=w.left;m=m-P-A.clientLeft,_=_-R-A.clientTop}var k=n.mapService.containerToLngLat([m,_]);if(b==="click"){n.isDoubleTap(m,_,k);return}if(b==="touch"){n.isDoubleTap(m,_,k);return}b!=="click"&&b!=="dblclick"&&n.emit(Bu.Hover,{x:m,y:_,lngLat:k,type:b,target:u})}),n}return jt(r,[{key:"init",value:function(){this.addEventListenerOnMap(),this.$containter=this.mapService.getMapContainer()}},{key:"destroy",value:function(){this.hammertime&&this.hammertime.destroy(),this.removeEventListenerOnMap(),this.off(Bu.Hover)}},{key:"triggerHover",value:function(i){var o=i.x,a=i.y;this.emit(Bu.Hover,{x:o,y:a})}},{key:"triggerSelect",value:function(i){this.emit(Bu.Select,{featureId:i})}},{key:"triggerActive",value:function(i){this.emit(Bu.Active,{featureId:i})}},{key:"addEventListenerOnMap",value:function(){var i=this.mapService.getMapContainer();if(i){var o=new _v.Manager(i);o.add(new _v.Tap({event:"dblclick",taps:2})),o.add(new _v.Tap({event:"click"})),o.add(new _v.Pan({threshold:0,pointers:0})),o.add(new _v.Press({})),o.on("dblclick click",this.onHammer),o.on("panstart panmove panend pancancel",this.onDrag),i.addEventListener("touchstart",this.onTouch),i.addEventListener("touchend",this.onTouchEnd),i.addEventListener("mousemove",this.onHover),i.addEventListener("touchmove",this.onTouchMove),i.addEventListener("mousedown",this.onHover,!0),i.addEventListener("mouseup",this.onHover),i.addEventListener("contextmenu",this.onHover),this.hammertime=o}}},{key:"removeEventListenerOnMap",value:function(){var i=this.mapService.getMapContainer();i&&(i.removeEventListener("mousemove",this.onHover),this.hammertime.off("dblclick click",this.onHammer),this.hammertime.off("panstart panmove panend pancancel",this.onDrag),i.removeEventListener("touchstart",this.onTouch),i.removeEventListener("touchend",this.onTouchEnd),i.removeEventListener("mousedown",this.onHover),i.removeEventListener("mouseup",this.onHover),i.removeEventListener("contextmenu",this.onHover))}},{key:"interactionEvent",value:function(i){var o=i.type,a=i.pointerType,u,c;a==="touch"?(c=Math.floor(i.pointers[0].clientY),u=Math.floor(i.pointers[0].clientX)):(c=Math.floor(i.srcEvent.y),u=Math.floor(i.srcEvent.x));var f=this.mapService.getMapContainer();if(f){var m=f.getBoundingClientRect(),_=m.top,b=m.left;u-=b,c-=_}var A=this.mapService.containerToLngLat([u,c]);return{x:u,y:c,lngLat:A,type:o,target:i.srcEvent}}},{key:"isDoubleTap",value:function(i,o,a){var u=this,c=new Date().getTime(),f="click";c-this.lastClickTime<400&&Math.abs(this.lastClickXY[0]-i)<10&&Math.abs(this.lastClickXY[1]-o)<10?(this.lastClickTime=0,this.lastClickXY=[-1,-1],this.clickTimer&&clearTimeout(this.clickTimer),f="dblclick",this.emit(Bu.Hover,{x:i,y:o,lngLat:a,type:f})):(this.lastClickTime=c,this.lastClickXY=[i,o],this.clickTimer=setTimeout(function(){f="click",u.emit(Bu.Hover,{x:i,y:o,lngLat:a,type:f})},400))}}]),r}(D5),x8=mi($3.prototype,"mapService",[_8],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$3))||y8),yoe=0;function xoe(e){var t=e;if(typeof e=="string"&&(t=document.getElementById(e)),t){var r=document.createElement("div");return r.style.cssText+=`
|
|
position: absolute;
|
|
z-index:2;
|
|
height: 100%;
|
|
width: 100%;
|
|
pointer-events: none;
|
|
`,r.id="l7-scene-".concat(yoe++),r.classList.add("l7-scene"),t.appendChild(r),r}return null}function boe(e){var t,r=!0;if((e==null||(t=e.target)===null||t===void 0?void 0:t.target)instanceof HTMLElement)for(var n,i=e==null||(n=e.target)===null||n===void 0?void 0:n.target;i;){var o,a=Array.from(i.classList);if(a.includes("l7-marker")||a.includes("l7-popup")){r=!1;break}i=(o=i)===null||o===void 0?void 0:o.parentElement}return r}var fx=function(e){return e[e.SAMPLED=0]="SAMPLED",e[e.RENDER_TARGET=1]="RENDER_TARGET",e}({}),b8,E8,S8,A8,T8,w8,C8,o1,R8,I8,M8,P8,O8;function Eoe(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Soe(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Soe(e,t){if(e){if(typeof e=="string")return k8(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return k8(e,t)}}function k8(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Aoe=(b8=ai(),E8=ki(wt.IMapService),S8=ki(wt.IRendererService),A8=ki(wt.IGlobalConfigService),T8=ki(wt.IInteractionService),w8=ki(wt.ILayerService),b8(C8=(o1=function(){function e(){var t=this;Ht(this,e),F(this,"pickedColors",void 0),F(this,"pickedTileLayers",[]),bi(this,"mapService",R8,this),bi(this,"rendererService",I8,this),bi(this,"configService",M8,this),bi(this,"interactionService",P8,this),bi(this,"layerService",O8,this),F(this,"pickingFBO",void 0),F(this,"width",0),F(this,"height",0),F(this,"alreadyInPicking",!1),F(this,"pickBufferScale",1),F(this,"pickFromPickingFBO",function(){var r=Mt(he.mark(function n(i,o){var a,u,c,f,m,_,b,A,w,R,P,k,L,B,V,G,K,Z,ve,Ie,de,se,le;return he.wrap(function(ke){for(;;)switch(ke.prev=ke.next){case 0:if(a=o.x,u=o.y,c=o.lngLat,f=o.type,m=o.target,_=!1,b=t.rendererService,A=b.readPixelsAsync,w=b.getViewportSize,R=w(),P=R.width,k=R.height,L=i.getLayerConfig(),B=L.enableHighlight,V=L.enableSelect,G=a*ul,K=u*ul,!(G>P-1*ul||G<0||K>k-1*ul||K<0)){ke.next=9;break}return ke.abrupt("return",!1);case 9:return ke.next=11,A({x:Math.floor(G/t.pickBufferScale),y:Math.floor((k-(u+1)*ul)/t.pickBufferScale),width:1,height:1,data:new Uint8Array(4),framebuffer:t.pickingFBO});case 11:return Z=ke.sent,t.pickedColors=Z,Z[0]!==0||Z[1]!==0||Z[2]!==0?(ve=x1(Z),Ie=i.layerPickService.getFeatureById(ve),ve!==i.getCurrentPickId()&&f==="mousemove"&&(f="mouseenter"),de={x:a,y:u,type:f,lngLat:c,featureId:ve,feature:Ie,target:m},Ie&&(_=!0,i.setCurrentPickId(ve),t.triggerHoverOnLayer(i,de))):(se={x:a,y:u,lngLat:c,type:i.getCurrentPickId()!==null&&f==="mousemove"?"mouseout":"un"+f,featureId:null,target:m,feature:null},t.triggerHoverOnLayer(i,Qe(Qe({},se),{},{type:"unpick"})),t.triggerHoverOnLayer(i,se),i.setCurrentPickId(null)),B&&i.layerPickService.highlightPickedFeature(Z),V&&f==="click"&&(Z==null?void 0:Z.toString())!==[0,0,0,0].toString()&&(le=x1(Z),i.getCurrentSelectedId()===null||le!==i.getCurrentSelectedId()?(i.layerPickService.selectFeature(Z),i.setCurrentSelectedId(le)):(i.layerPickService.selectFeature(new Uint8Array([0,0,0,0])),i.setCurrentSelectedId(null))),ke.abrupt("return",_);case 17:case"end":return ke.stop()}},n)}));return function(n,i){return r.apply(this,arguments)}}())}return jt(e,[{key:"init",value:function(r){var n=this.rendererService,i=n.createTexture2D,o=n.createFramebuffer,a=n.getViewportSize,u=a(),c=u.width,f=u.height;this.pickBufferScale=this.configService.getSceneConfig(r).pickBufferScale||1,c=Math.round(c/this.pickBufferScale),f=Math.round(f/this.pickBufferScale);var m=i({width:c,height:f,usage:fx.RENDER_TARGET,label:"Picking Texture"});this.pickingFBO=o({color:m,depth:!0,width:c,height:f}),this.interactionService.on(Bu.Hover,this.pickingAllLayer.bind(this))}},{key:"boxPickLayer",value:function(){var t=Mt(he.mark(function n(i,o,a){var u=this,c,f,m,_;return he.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return c=this.rendererService,f=c.useFramebufferAsync,m=c.clear,this.resizePickingFBO(),i.hooks.beforePickingEncode.call(),A.next=5,f(this.pickingFBO,Mt(he.mark(function w(){return he.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:m({framebuffer:u.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),i.renderModels({ispick:!0});case 2:case"end":return P.stop()}},w)})));case 5:return i.hooks.afterPickingEncode.call(),A.next=8,this.pickBox(i,o);case 8:_=A.sent,a(_);case 10:case"end":return A.stop()}},n,this)}));function r(n,i,o){return t.apply(this,arguments)}return r}()},{key:"pickBox",value:function(){var t=Mt(he.mark(function n(i,o){var a=this,u,c,f,m,_,b,A,w,R,P,k,L,B,V,G,K,Z,ve,Ie,de,se;return he.wrap(function(ye){for(;;)switch(ye.prev=ye.next){case 0:if(u=o.map(function(ke){var Rt=ke<0?0:ke;return Math.floor(Rt*ul/a.pickBufferScale)}),c=Nn(u,4),f=c[0],m=c[1],_=c[2],b=c[3],A=this.rendererService,w=A.readPixelsAsync,R=A.getViewportSize,P=R(),k=P.width,L=P.height,!(f>(k-1)*ul/this.pickBufferScale||_<0||m>(L-1)*ul/this.pickBufferScale||b<0)){ye.next=5;break}return ye.abrupt("return",[]);case 5:return B=Math.min(k/this.pickBufferScale,_)-f,V=Math.min(L/this.pickBufferScale,b)-m,ye.next=9,w({x:f,y:Math.floor(L/this.pickBufferScale-(b+1)),width:B,height:V,data:new Uint8Array(B*V*4),framebuffer:this.pickingFBO});case 9:for(G=ye.sent,K=[],Z={},ve=0;ve<G.length/4;ve=ve+1)Ie=G.slice(ve*4,ve*4+4),de=x1(Ie),de!==-1&&!Z[de]&&(se=i.layerPickService.getFeatureById(de),K.push(Qe(Qe({},se),{},{pickedFeatureIdx:de})),Z[de]=!0);return ye.abrupt("return",K);case 14:case"end":return ye.stop()}},n,this)}));function r(n,i){return t.apply(this,arguments)}return r}()},{key:"handleCursor",value:function(r,n){var i=r.getLayerConfig(),o=i.cursor,a=o===void 0?"":o,u=i.cursorEnabled;if(u){var c=this.mapService.version,f=c==="GAODE2.x"?this.mapService.getMapContainer():this.mapService.getMarkerContainer(),m=f==null?void 0:f.style.getPropertyValue("cursor");n==="unmousemove"&&m!==""?f==null||f.style.setProperty("cursor",""):n==="mousemove"&&(f==null||f.style.setProperty("cursor",a))}}},{key:"destroy",value:function(){this.pickingFBO.destroy(),this.pickingFBO=null}},{key:"getContainerSize",value:function(r){return r.getBoundingClientRect()}},{key:"pickingAllLayer",value:function(){var t=Mt(he.mark(function n(i){return he.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(!(!this.layerService.needPick(i.type)||!this.isPickingAllLayer())){a.next=2;break}return a.abrupt("return");case 2:return this.alreadyInPicking=!0,a.next=5,this.pickingLayers(i);case 5:this.layerService.renderLayers(),this.alreadyInPicking=!1;case 7:case"end":return a.stop()}},n,this)}));function r(n){return t.apply(this,arguments)}return r}()},{key:"isPickingAllLayer",value:function(){return!(this.alreadyInPicking||this.layerService.alreadyInRendering||this.interactionService.indragging||!this.layerService.getShaderPickStat())}},{key:"resizePickingFBO",value:function(){var r=this.rendererService.getViewportSize,n=r(),i=n.width,o=n.height;(this.width!==i||this.height!==o)&&(this.pickingFBO.resize({width:Math.round(i/this.pickBufferScale),height:Math.round(o/this.pickBufferScale)}),this.width=i,this.height=o)}},{key:"pickingLayers",value:function(){var t=Mt(he.mark(function n(i){var o=this,a,u,c,f,m,_,b;return he.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:a=this.rendererService,u=a.clear,c=a.useFramebufferAsync,this.resizePickingFBO(),f=this.layerService.getRenderList(),m=Eoe(f.filter(function(R){return R.needPick(i.type)}).reverse()),w.prev=4,b=he.mark(function R(){var P,k;return he.wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return P=_.value,B.next=3,c(o.pickingFBO,Mt(he.mark(function V(){return he.wrap(function(K){for(;;)switch(K.prev=K.next){case 0:u({framebuffer:o.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),P.layerPickService.pickRender(i);case 2:case"end":return K.stop()}},V)})));case 3:return B.next=5,o.pickFromPickingFBO(P,i);case 5:if(k=B.sent,o.layerService.pickedLayerId=k?+P.id:-1,!(k&&!P.getLayerConfig().enablePropagation)){B.next=9;break}return B.abrupt("return",1);case 9:case"end":return B.stop()}},R)}),m.s();case 7:if((_=m.n()).done){w.next=13;break}return w.delegateYield(b(),"t0",9);case 9:if(!w.t0){w.next=11;break}return w.abrupt("break",13);case 11:w.next=7;break;case 13:w.next=18;break;case 15:w.prev=15,w.t1=w.catch(4),m.e(w.t1);case 18:return w.prev=18,m.f(),w.finish(18);case 21:case"end":return w.stop()}},n,this,[[4,15,18,21]])}));function r(n){return t.apply(this,arguments)}return r}()},{key:"triggerHoverOnLayer",value:function(r,n){boe(n)&&(this.handleCursor(r,n.type),r.emit(n.type,n))}}]),e}(),R8=mi(o1.prototype,"mapService",[E8],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),I8=mi(o1.prototype,"rendererService",[S8],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),M8=mi(o1.prototype,"configService",[A8],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),P8=mi(o1.prototype,"interactionService",[T8],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),O8=mi(o1.prototype,"layerService",[w8],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),o1))||C8),Toe=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;Ht(this,e),F(this,"autoStart",void 0),F(this,"startTime",0),F(this,"oldTime",0),F(this,"running",!1),F(this,"elapsedTime",0),this.autoStart=t}return jt(e,[{key:"start",value:function(){this.startTime=(typeof performance>"u"?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}},{key:"stop",value:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}},{key:"getElapsedTime",value:function(){return this.getDelta(),this.elapsedTime}},{key:"getDelta",value:function(){var r=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var n=(typeof performance>"u"?Date:performance).now();r=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=r}return r}}]),e}(),D8,F8,B8,L8,N8,yv,U8,z8,$8;function K2(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=woe(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function woe(e,t){if(e){if(typeof e=="string")return V8(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return V8(e,t)}}function V8(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Coe(e){var t=Roe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Roe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var j8=Ci.throttle,Ioe=(D8=ai(),F8=ki(wt.IRendererService),B8=ki(wt.IMapService),L8=ki(wt.IDebugService),D8(N8=(yv=function(e){_n(r,e);var t=Coe(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"pickedLayerId",-1),F($e(n),"clock",new Toe),F($e(n),"alreadyInRendering",!1),F($e(n),"layers",[]),F($e(n),"layerList",[]),F($e(n),"layerRenderID",void 0),F($e(n),"sceneInited",!1),F($e(n),"animateInstanceCount",0),F($e(n),"shaderPicking",!0),F($e(n),"enableRender",!0),bi($e(n),"renderService",U8,$e(n)),bi($e(n),"mapService",z8,$e(n)),bi($e(n),"debugService",$8,$e(n)),F($e(n),"reRender",j8(function(){n.renderLayers()},32)),F($e(n),"throttleRenderLayers",j8(function(){n.renderLayers()},16)),n}return jt(r,[{key:"needPick",value:function(i){return this.updateLayerRenderList(),this.layerList.some(function(o){return o.needPick(i)})}},{key:"add",value:function(i){var o=this;this.layers.push(i),this.sceneInited&&i.init().then(function(){o.renderLayers()})}},{key:"addMask",value:function(i){var o=this;this.sceneInited&&i.init().then(function(){o.renderLayers()})}},{key:"initLayers",value:function(){var n=Mt(he.mark(function o(){var a=this;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:this.sceneInited=!0,this.layers.forEach(function(){var f=Mt(he.mark(function m(_){return he.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(_.startInit){A.next=4;break}return A.next=3,_.init();case 3:a.updateLayerRenderList();case 4:case"end":return A.stop()}},m)}));return function(m){return f.apply(this,arguments)}}());case 2:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSceneInited",value:function(){return this.sceneInited}},{key:"getRenderList",value:function(){return this.layerList}},{key:"getLayers",value:function(){return this.layers}},{key:"getLayer",value:function(i){return this.layers.find(function(o){return o.id===i})}},{key:"getLayerByName",value:function(i){return this.layers.find(function(o){return o.name===i})}},{key:"remove",value:function(){var n=Mt(he.mark(function o(a,u){var c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:u?(c=u.layerChildren.indexOf(a),c>-1&&u.layerChildren.splice(c,1)):(f=this.layers.indexOf(a),f>-1&&this.layers.splice(f,1)),a.destroy(),this.reRender(),this.emit("layerChange",this.layers);case 4:case"end":return _.stop()}},o,this)}));function i(o,a){return n.apply(this,arguments)}return i}()},{key:"removeAllLayers",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:this.destroy(),this.reRender();case 2:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"setEnableRender",value:function(i){this.enableRender=i}},{key:"renderLayers",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f,m,_,b,A,w;return he.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(!(this.alreadyInRendering||!this.enableRender)){P.next=2;break}return P.abrupt("return");case 2:this.updateLayerRenderList(),a=this.debugService.generateRenderUid(),this.debugService.renderStart(a),this.alreadyInRendering=!0,this.clear(),u=K2(this.layerList);try{for(u.s();!(c=u.n()).done;)f=c.value,f.prerender()}catch(k){u.e(k)}finally{u.f()}this.renderService.beginFrame(),m=K2(this.layerList),P.prev=11,m.s();case 13:if((_=m.n()).done){P.next=25;break}if(b=_.value,A=b.getLayerConfig(),w=A.enableMask,b.masks.filter(function(k){return k.inited}).length>0&&w&&this.renderMask(b.masks),!b.getLayerConfig().enableMultiPassRenderer){P.next=22;break}return P.next=20,b.renderMultiPass();case 20:P.next=23;break;case 22:b.render();case 23:P.next=13;break;case 25:P.next=30;break;case 27:P.prev=27,P.t0=P.catch(11),m.e(P.t0);case 30:return P.prev=30,m.f(),P.finish(30);case 33:this.renderService.endFrame(),this.debugService.renderEnd(a),this.alreadyInRendering=!1;case 36:case"end":return P.stop()}},o,this,[[11,27,30,33]])}));function i(){return n.apply(this,arguments)}return i}()},{key:"renderMask",value:function(i){var o=0;this.renderService.clear({stencil:0,depth:1,framebuffer:null});var a=i.length>1?m1.MULTIPLE:m1.SINGLE,u=K2(i),c;try{for(u.s();!(c=u.n()).done;){var f=c.value;f.render({isStencil:!0,stencilType:a,stencilIndex:o++})}}catch(m){u.e(m)}finally{u.f()}}},{key:"beforeRenderData",value:function(){var n=Mt(he.mark(function o(a){var u;return he.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,a.hooks.beforeRenderData.promise();case 2:u=f.sent,u&&this.renderLayers();case 4:case"end":return f.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"renderTileLayerMask",value:function(i){var o=0,a=i.getLayerConfig(),u=a.enableMask,c=u===void 0?!0:u,f=i.tileMask?1:0,m=i.masks.filter(function(R){return R.inited});f=f+(c?m.length:1);var _=f>1?m1.MULTIPLE:m1.SINGLE;if((i.tileMask||m.length&&c)&&this.renderService.clear({stencil:0,depth:1,framebuffer:null}),m.length&&c){var b=K2(m),A;try{for(b.s();!(A=b.n()).done;){var w=A.value;w.render({isStencil:!0,stencilType:_,stencilIndex:o++})}}catch(R){b.e(R)}finally{b.f()}}i.tileMask&&i.tileMask.render({isStencil:!0,stencilType:_,stencilIndex:o++,stencilOperation:py.OR})}},{key:"renderTileLayer",value:function(){var n=Mt(he.mark(function o(a){return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(this.renderTileLayerMask(a),!a.getLayerConfig().enableMultiPassRenderer){c.next=6;break}return c.next=4,a.renderMultiPass();case 4:c.next=8;break;case 6:return c.next=8,a.render();case 8:case"end":return c.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"updateLayerRenderList",value:function(){var i=this;this.layerList=[],this.layers.filter(function(o){return o.inited}).filter(function(o){return o.isVisible()}).sort(function(o,a){return o.zIndex-a.zIndex}).forEach(function(o){i.layerList.push(o)})}},{key:"destroy",value:function(){this.layers.forEach(function(i){i.destroy()}),this.layers=[],this.layerList=[],this.emit("layerChange",this.layers)}},{key:"startAnimate",value:function(){this.animateInstanceCount++===0&&(this.clock.start(),this.runRender())}},{key:"stopAnimate",value:function(){--this.animateInstanceCount===0&&(this.stopRender(),this.clock.stop())}},{key:"getOESTextureFloat",value:function(){return this.renderService.extensionObject.OES_texture_float}},{key:"enableShaderPick",value:function(){this.shaderPicking=!0}},{key:"disableShaderPick",value:function(){this.shaderPicking=!1}},{key:"getShaderPickStat",value:function(){return this.shaderPicking}},{key:"clear",value:function(){var i=Ta(this.mapService.bgColor);this.renderService.clear({color:i,depth:1,stencil:0,framebuffer:null})}},{key:"runRender",value:function(){this.renderLayers(),this.layerRenderID=window.requestAnimationFrame(this.runRender.bind(this))}},{key:"stopRender",value:function(){window.cancelAnimationFrame(this.layerRenderID)}}]),r}(ju.EventEmitter),U8=mi(yv.prototype,"renderService",[F8],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),z8=mi(yv.prototype,"mapService",[B8],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$8=mi(yv.prototype,"debugService",[L8],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yv))||N8);function Moe(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o<n.length;o++)i=n[o],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function hl(e,t){if(e==null)return{};var r=Moe(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var W=function(e){return e[e.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",e[e.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",e[e.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN",e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",e[e.FUNC_ADD=32774]="FUNC_ADD",e[e.BLEND_EQUATION=32777]="BLEND_EQUATION",e[e.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",e[e.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",e[e.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",e[e.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",e[e.MAX_EXT=32776]="MAX_EXT",e[e.MIN_EXT=32775]="MIN_EXT",e[e.BLEND_DST_RGB=32968]="BLEND_DST_RGB",e[e.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",e[e.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",e[e.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",e[e.BLEND_COLOR=32773]="BLEND_COLOR",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",e[e.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",e[e.STREAM_DRAW=35040]="STREAM_DRAW",e[e.STATIC_DRAW=35044]="STATIC_DRAW",e[e.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",e[e.BUFFER_SIZE=34660]="BUFFER_SIZE",e[e.BUFFER_USAGE=34661]="BUFFER_USAGE",e[e.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK",e[e.CULL_FACE=2884]="CULL_FACE",e[e.BLEND=3042]="BLEND",e[e.DITHER=3024]="DITHER",e[e.STENCIL_TEST=2960]="STENCIL_TEST",e[e.DEPTH_TEST=2929]="DEPTH_TEST",e[e.SCISSOR_TEST=3089]="SCISSOR_TEST",e[e.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",e[e.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",e[e.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",e[e.NO_ERROR=0]="NO_ERROR",e[e.INVALID_ENUM=1280]="INVALID_ENUM",e[e.INVALID_VALUE=1281]="INVALID_VALUE",e[e.INVALID_OPERATION=1282]="INVALID_OPERATION",e[e.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",e[e.CW=2304]="CW",e[e.CCW=2305]="CCW",e[e.LINE_WIDTH=2849]="LINE_WIDTH",e[e.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",e[e.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",e[e.CULL_FACE_MODE=2885]="CULL_FACE_MODE",e[e.FRONT_FACE=2886]="FRONT_FACE",e[e.DEPTH_RANGE=2928]="DEPTH_RANGE",e[e.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",e[e.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",e[e.DEPTH_FUNC=2932]="DEPTH_FUNC",e[e.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",e[e.STENCIL_FUNC=2962]="STENCIL_FUNC",e[e.STENCIL_FAIL=2964]="STENCIL_FAIL",e[e.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",e[e.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",e[e.STENCIL_REF=2967]="STENCIL_REF",e[e.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",e[e.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",e[e.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",e[e.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",e[e.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",e[e.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",e[e.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",e[e.VIEWPORT=2978]="VIEWPORT",e[e.SCISSOR_BOX=3088]="SCISSOR_BOX",e[e.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",e[e.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",e[e.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",e[e.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",e[e.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",e[e.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",e[e.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",e[e.RED_BITS=3410]="RED_BITS",e[e.GREEN_BITS=3411]="GREEN_BITS",e[e.BLUE_BITS=3412]="BLUE_BITS",e[e.ALPHA_BITS=3413]="ALPHA_BITS",e[e.DEPTH_BITS=3414]="DEPTH_BITS",e[e.STENCIL_BITS=3415]="STENCIL_BITS",e[e.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",e[e.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",e[e.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",e[e.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",e[e.SAMPLES=32937]="SAMPLES",e[e.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",e[e.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",e[e.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",e[e.DONT_CARE=4352]="DONT_CARE",e[e.FASTEST=4353]="FASTEST",e[e.NICEST=4354]="NICEST",e[e.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.RED=6403]="RED",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",e[e.VERTEX_SHADER=35633]="VERTEX_SHADER",e[e.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",e[e.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",e[e.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",e[e.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",e[e.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",e[e.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",e[e.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",e[e.SHADER_TYPE=35663]="SHADER_TYPE",e[e.DELETE_STATUS=35712]="DELETE_STATUS",e[e.LINK_STATUS=35714]="LINK_STATUS",e[e.VALIDATE_STATUS=35715]="VALIDATE_STATUS",e[e.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",e[e.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",e[e.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",e[e.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",e[e.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",e[e.NEVER=512]="NEVER",e[e.LESS=513]="LESS",e[e.EQUAL=514]="EQUAL",e[e.LEQUAL=515]="LEQUAL",e[e.GREATER=516]="GREATER",e[e.NOTEQUAL=517]="NOTEQUAL",e[e.GEQUAL=518]="GEQUAL",e[e.ALWAYS=519]="ALWAYS",e[e.KEEP=7680]="KEEP",e[e.REPLACE=7681]="REPLACE",e[e.INCR=7682]="INCR",e[e.DECR=7683]="DECR",e[e.INVERT=5386]="INVERT",e[e.INCR_WRAP=34055]="INCR_WRAP",e[e.DECR_WRAP=34056]="DECR_WRAP",e[e.VENDOR=7936]="VENDOR",e[e.RENDERER=7937]="RENDERER",e[e.VERSION=7938]="VERSION",e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9729]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",e[e.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",e[e.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",e[e.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",e[e.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE=5890]="TEXTURE",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e[e.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",e[e.TEXTURE0=33984]="TEXTURE0",e[e.TEXTURE1=33985]="TEXTURE1",e[e.TEXTURE2=33986]="TEXTURE2",e[e.TEXTURE3=33987]="TEXTURE3",e[e.TEXTURE4=33988]="TEXTURE4",e[e.TEXTURE5=33989]="TEXTURE5",e[e.TEXTURE6=33990]="TEXTURE6",e[e.TEXTURE7=33991]="TEXTURE7",e[e.TEXTURE8=33992]="TEXTURE8",e[e.TEXTURE9=33993]="TEXTURE9",e[e.TEXTURE10=33994]="TEXTURE10",e[e.TEXTURE11=33995]="TEXTURE11",e[e.TEXTURE12=33996]="TEXTURE12",e[e.TEXTURE13=33997]="TEXTURE13",e[e.TEXTURE14=33998]="TEXTURE14",e[e.TEXTURE15=33999]="TEXTURE15",e[e.TEXTURE16=34e3]="TEXTURE16",e[e.TEXTURE17=34001]="TEXTURE17",e[e.TEXTURE18=34002]="TEXTURE18",e[e.TEXTURE19=34003]="TEXTURE19",e[e.TEXTURE20=34004]="TEXTURE20",e[e.TEXTURE21=34005]="TEXTURE21",e[e.TEXTURE22=34006]="TEXTURE22",e[e.TEXTURE23=34007]="TEXTURE23",e[e.TEXTURE24=34008]="TEXTURE24",e[e.TEXTURE25=34009]="TEXTURE25",e[e.TEXTURE26=34010]="TEXTURE26",e[e.TEXTURE27=34011]="TEXTURE27",e[e.TEXTURE28=34012]="TEXTURE28",e[e.TEXTURE29=34013]="TEXTURE29",e[e.TEXTURE30=34014]="TEXTURE30",e[e.TEXTURE31=34015]="TEXTURE31",e[e.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",e[e.REPEAT=10497]="REPEAT",e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D",e[e.SAMPLER_CUBE=35680]="SAMPLER_CUBE",e[e.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",e[e.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",e[e.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",e[e.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",e[e.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",e[e.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",e[e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",e[e.COMPILE_STATUS=35713]="COMPILE_STATUS",e[e.LOW_FLOAT=36336]="LOW_FLOAT",e[e.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",e[e.HIGH_FLOAT=36338]="HIGH_FLOAT",e[e.LOW_INT=36339]="LOW_INT",e[e.MEDIUM_INT=36340]="MEDIUM_INT",e[e.HIGH_INT=36341]="HIGH_INT",e[e.FRAMEBUFFER=36160]="FRAMEBUFFER",e[e.RENDERBUFFER=36161]="RENDERBUFFER",e[e.RGBA4=32854]="RGBA4",e[e.RGB5_A1=32855]="RGB5_A1",e[e.RGB565=36194]="RGB565",e[e.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",e[e.STENCIL_INDEX=6401]="STENCIL_INDEX",e[e.STENCIL_INDEX8=36168]="STENCIL_INDEX8",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e[e.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",e[e.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",e[e.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",e[e.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",e[e.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",e[e.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",e[e.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",e[e.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",e[e.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",e[e.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",e[e.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",e[e.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",e[e.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",e[e.NONE=0]="NONE",e[e.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",e[e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",e[e.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",e[e.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",e[e.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",e[e.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",e[e.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",e[e.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",e[e.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",e[e.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",e[e.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",e[e.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",e}({}),Poe=Ci.isNil,Ooe=function(){function e(t){var r=this;Ht(this,e),F(this,"name",void 0),F(this,"type",void 0),F(this,"scale",void 0),F(this,"descriptor",void 0),F(this,"featureBufferLayout",[]),F(this,"needRescale",!1),F(this,"needRemapping",!1),F(this,"needRegenerateVertices",!1),F(this,"featureRange",{startIndex:0,endIndex:1/0}),F(this,"vertexAttribute",void 0),F(this,"defaultCallback",function(n){if(n.length===0){var i;return((i=r.scale)===null||i===void 0?void 0:i.defaultValues)||[]}return n.map(function(o,a){var u,c=(u=r.scale)===null||u===void 0?void 0:u.scalers[a].func,f=c(o);return f})}),this.setProps(t)}return jt(e,[{key:"setProps",value:function(r){Object.assign(this,r)}},{key:"mapping",value:function(r){var n;if((n=this.scale)!==null&&n!==void 0&&n.callback){var i,o=(i=this.scale)===null||i===void 0?void 0:i.callback.apply(i,nr(r));if(!Poe(o))return[o]}return this.defaultCallback(r)}},{key:"resetDescriptor",value:function(){this.descriptor&&(this.descriptor.buffer.data=[])}}]),e}(),koe=["buffer","update","name"],Doe=["buffer","update","name"],xv,H8,G8,W8,V3,X8,Foe=(xv={},F(xv,W.FLOAT,4),F(xv,W.UNSIGNED_BYTE,1),F(xv,W.UNSIGNED_SHORT,2),xv),Boe=(H8=ai(),G8=ki(wt.IRendererService),H8(W8=(V3=function(){function e(){Ht(this,e),F(this,"attributesAndIndices",void 0),bi(this,"rendererService",X8,this),F(this,"attributes",[]),F(this,"triangulation",void 0),F(this,"featureLayout",{sizePerElement:0,elements:[]})}return jt(e,[{key:"registerStyleAttribute",value:function(r){var n=this.getLayerStyleAttribute(r.name||"");return n?n.setProps(r):(n=new Ooe(r),this.attributes.push(n)),n}},{key:"unRegisterStyleAttribute",value:function(r){var n=this.attributes.findIndex(function(i){return i.name===r});n>-1&&this.attributes.splice(n,1)}},{key:"updateScaleAttribute",value:function(r){this.attributes.forEach(function(n){var i,o=n.name,a=(i=n.scale)===null||i===void 0?void 0:i.field;(r[o]||a&&r[a])&&(n.needRescale=!0,n.needRemapping=!0,n.needRegenerateVertices=!0)})}},{key:"updateStyleAttribute",value:function(r,n,i){var o=this.getLayerStyleAttribute(r);o||(o=this.registerStyleAttribute(Qe(Qe({},n),{},{name:r})));var a=n.scale;a&&o&&(o.scale=a,o.needRescale=!0,o.needRemapping=!0,o.needRegenerateVertices=!0,i&&i.featureRange&&(o.featureRange=i.featureRange))}},{key:"getLayerStyleAttributes",value:function(){return this.attributes}},{key:"getLayerStyleAttribute",value:function(r){return this.attributes.find(function(n){return n.name===r})}},{key:"getLayerAttributeScale",value:function(r){var n,i=this.getLayerStyleAttribute(r),o=i==null||(n=i.scale)===null||n===void 0?void 0:n.scalers;return o&&o[0]?o[0].func:null}},{key:"updateAttributeByFeatureRange",value:function(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,u=this.attributes.find(function(G){return G.name===r});if(u&&u.descriptor){var c=u.descriptor,f=c.update,m=c.buffer,_=c.size,b=_===void 0?0:_,A=Foe[m.type||W.FLOAT];if(f){var w=this.featureLayout,R=w.elements,P=w.sizePerElement,k=R.slice(i,o);if(!k.length)return;var L=k[0].offset,B=L*b*A,V=k.map(function(G,K){for(var Z=G.featureIdx,ve=G.vertices,Ie=G.normals,de=ve.length/P,se=[],le=0;le<de;le++){var ye=Ie?Ie.slice(le*3,le*3+3):[];se.push.apply(se,nr(f(n[Z],Z,ve.slice(le*P,le*P+P),K,ye)))}return se}).flat();u.vertexAttribute.updateBuffer({data:V,offset:B}),a==null||a.emit("legend:".concat(r),{type:r,attr:u})}}}},{key:"createAttributesAndIndices",value:function(r,n,i){var o=this;this.featureLayout={sizePerElement:0,elements:[]},n&&(this.triangulation=n);var a=this.attributes.map(function(k){return k.resetDescriptor(),k.descriptor}),u=0,c=0,f=[],m=3;r.forEach(function(k,L){var B=o.triangulation(k,i),V=B.indices,G=B.vertices,K=B.normals,Z=B.size,ve=B.indexes,Ie=B.count;typeof Ie=="number"&&(c+=Ie),V.forEach(function(ye){f.push(ye+u)}),m=Z;var de=G.length/Z;o.featureLayout.sizePerElement=m,o.featureLayout.elements.push({featureIdx:L,vertices:G,normals:K,offset:u}),u+=de;for(var se=function(ke){var Rt=(K==null?void 0:K.slice(ke*3,ke*3+3))||[],Lt=G.slice(ke*Z,ke*Z+Z),Gt=0;ve&&ve[ke]!==void 0&&(Gt=ve[ke]),a.forEach(function(Zt,st){if(Zt&&Zt.update){var tt;(tt=Zt.buffer.data).push.apply(tt,nr(Zt.update(k,L,Lt,ke,Rt,Gt)))}})},le=0;le<de;le++)se(le)});var _=this.rendererService,b=_.createAttribute,A=_.createBuffer,w=_.createElements,R={};a.forEach(function(k,L){if(k){var B=k.buffer;k.update,k.name;var V=hl(k,koe),G=b(Qe({buffer:A(B)},V));R[k.name||""]=G,o.attributes[L].vertexAttribute=G}});var P=w({data:f,type:W.UNSIGNED_INT,count:f.length});return this.attributesAndIndices={attributes:R,elements:P,count:c},this.attributesAndIndices}},{key:"createAttributes",value:function(r,n){var i=this;this.featureLayout={sizePerElement:0,elements:[]},n&&(this.triangulation=n);var o=this.attributes.map(function(b){return b.resetDescriptor(),b.descriptor}),a=0,u=3;r.forEach(function(b,A){var w=i.triangulation(b),R=w.indices,P=w.vertices,k=w.normals,L=w.size,B=w.indexes;R.forEach(function(Z){}),u=L;var V=P.length/L;i.featureLayout.sizePerElement=u,i.featureLayout.elements.push({featureIdx:A,vertices:P,normals:k,offset:a}),a+=V;for(var G=function(ve){var Ie=(k==null?void 0:k.slice(ve*3,ve*3+3))||[],de=P.slice(ve*L,ve*L+L),se=0;B&&B[ve]!==void 0&&(se=B[ve]),o.forEach(function(le,ye){if(le&&le.update){var ke;(ke=le.buffer.data).push.apply(ke,nr(le.update(b,A,de,ve,Ie,se)))}})},K=0;K<V;K++)G(K)});var c=this.rendererService,f=c.createAttribute,m=c.createBuffer,_={};return o.forEach(function(b,A){if(b){var w=b.buffer;b.update,b.name;var R=hl(b,Doe),P=f(Qe({buffer:m(w)},R));_[b.name||""]=P,i.attributes[A].vertexAttribute=P}}),{attributes:_}}},{key:"clearAllAttributes",value:function(){var r;this.attributes.forEach(function(n){n.vertexAttribute&&n.vertexAttribute.destroy()}),(r=this.attributesAndIndices)===null||r===void 0||r.elements.destroy(),this.attributes=[]}}]),e}(),X8=mi(V3.prototype,"rendererService",[G8],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),V3))||W8);function lP(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function u(m){try{f(n.next(m))}catch(_){a(_)}}function c(m){try{f(n.throw(m))}catch(_){a(_)}}function f(m){m.done?o(m.value):i(m.value).then(u,c)}f((n=n.apply(e,t||[])).next())})}function cP(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(f){return function(m){return c([f,m])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=t.call(e,r)}catch(m){f=[6,m],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function J5(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(u){a={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function eb(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}function fP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hx={exports:{}},i_={exports:{}},Rm={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function r(n){return n&&typeof n.length=="number"&&n.length>=0&&n.length%1===0}e.exports=t.default})(Rm,Rm.exports);var zu={},px={exports:{}},dx={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];var o=n.pop();return r.call(this,n,o)}},e.exports=t.default})(dx,dx.exports);var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});Sp.fallback=hP;Sp.wrap=pP;var Loe=Sp.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,Noe=Sp.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,Uoe=Sp.hasNextTick=typeof process=="object"&&typeof process.nextTick=="function";function hP(e){setTimeout(e,0)}function pP(e){return function(t){for(var r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return e(function(){return t.apply(void 0,r)})}}var Gv;Loe?Gv=queueMicrotask:Noe?Gv=setImmediate:Uoe?Gv=process.nextTick:Gv=hP;Sp.default=pP(Gv);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var r=dx.exports,n=u(r),i=Sp,o=u(i),a=zu;function u(_){return _&&_.__esModule?_:{default:_}}function c(_){return(0,a.isAsync)(_)?function(){for(var b=[],A=arguments.length;A--;)b[A]=arguments[A];var w=b.pop(),R=_.apply(this,b);return f(R,w)}:(0,n.default)(function(b,A){var w;try{w=_.apply(this,b)}catch(R){return A(R)}if(w&&typeof w.then=="function")return f(w,A);A(null,w)})}function f(_,b){return _.then(function(A){m(b,null,A)},function(A){m(b,A&&A.message?A:new Error(A))})}function m(_,b,A){try{_(b,A)}catch(w){(0,o.default)(function(R){throw R},w)}}e.exports=t.default})(px,px.exports);Object.defineProperty(zu,"__esModule",{value:!0});zu.isAsyncIterable=zu.isAsyncGenerator=zu.isAsync=void 0;var zoe=px.exports,$oe=Voe(zoe);function Voe(e){return e&&e.__esModule?e:{default:e}}function dP(e){return e[Symbol.toStringTag]==="AsyncFunction"}function joe(e){return e[Symbol.toStringTag]==="AsyncGenerator"}function Hoe(e){return typeof e[Symbol.asyncIterator]=="function"}function Goe(e){if(typeof e!="function")throw new Error("expected a function");return dP(e)?(0,$oe.default)(e):e}zu.default=Goe;zu.isAsync=dP;zu.isAsyncGenerator=joe;zu.isAsyncIterable=Hoe;var S1={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function r(n,i){if(i===void 0&&(i=n.length),!i)throw new Error("arity is undefined");function o(){for(var a=this,u=[],c=arguments.length;c--;)u[c]=arguments[c];return typeof u[i-1]=="function"?n.apply(this,u):new Promise(function(f,m){u[i-1]=function(_){for(var b=[],A=arguments.length-1;A-- >0;)b[A]=arguments[A+1];if(_)return m(_);f(b.length>1?b:b[0])},n.apply(a,u)})}return o}e.exports=t.default})(S1,S1.exports);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=Rm.exports,n=c(r),i=zu,o=c(i),a=S1.exports,u=c(a);function c(f){return f&&f.__esModule?f:{default:f}}t.default=(0,u.default)(function(f,m,_){var b=(0,n.default)(m)?[]:{};f(m,function(A,w,R){(0,o.default)(A)(function(P){for(var k,L=[],B=arguments.length-1;B-- >0;)L[B]=arguments[B+1];L.length<2&&(k=L,L=k[0]),b[w]=L,R(P)})},function(A){return _(A,b)})},3),e.exports=t.default})(i_,i_.exports);var vx={exports:{}},a_={exports:{}},mx={exports:{}},Im={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function r(n){function i(){for(var o=[],a=arguments.length;a--;)o[a]=arguments[a];if(n!==null){var u=n;n=null,u.apply(this,o)}}return Object.assign(i,n),i}e.exports=t.default})(Im,Im.exports);var gx={exports:{}},_x={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return r[Symbol.iterator]&&r[Symbol.iterator]()},e.exports=t.default})(_x,_x.exports);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;var r=Rm.exports,n=a(r),i=_x.exports,o=a(i);function a(_){return _&&_.__esModule?_:{default:_}}function u(_){var b=-1,A=_.length;return function(){return++b<A?{value:_[b],key:b}:null}}function c(_){var b=-1;return function(){var w=_.next();return w.done?null:(b++,{value:w.value,key:b})}}function f(_){var b=_?Object.keys(_):[],A=-1,w=b.length;return function R(){var P=b[++A];return P==="__proto__"?R():A<w?{value:_[P],key:P}:null}}function m(_){if((0,n.default)(_))return u(_);var b=(0,o.default)(_);return b?c(b):f(_)}e.exports=t.default})(gx,gx.exports);var Mm={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function r(n){return function(){for(var i=[],o=arguments.length;o--;)i[o]=arguments[o];if(n===null)throw new Error("Callback was already called.");var a=n;n=null,a.apply(this,i)}}e.exports=t.default})(Mm,Mm.exports);var yx={exports:{}},Pm={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r={};t.default=r,e.exports=t.default})(Pm,Pm.exports);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r=Pm.exports,n=i(r);function i(a){return a&&a.__esModule?a:{default:a}}function o(a,u,c,f){var m=!1,_=!1,b=!1,A=0,w=0;function R(){A>=u||b||m||(b=!0,a.next().then(function(L){var B=L.value,V=L.done;if(!(_||m)){if(b=!1,V){m=!0,A<=0&&f(null);return}A++,c(B,w,P),w++,R()}}).catch(k))}function P(L,B){if(A-=1,!_){if(L)return k(L);if(L===!1){m=!0,_=!0;return}if(B===n.default||m&&A<=0)return m=!0,f(null);R()}}function k(L){_||(b=!1,m=!0,f(L))}R()}e.exports=t.default})(yx,yx.exports);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=Im.exports,n=A(r),i=gx.exports,o=A(i),a=Mm.exports,u=A(a),c=zu,f=yx.exports,m=A(f),_=Pm.exports,b=A(_);function A(w){return w&&w.__esModule?w:{default:w}}t.default=function(w){return function(R,P,k){if(k=(0,n.default)(k),w<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!R)return k(null);if((0,c.isAsyncGenerator)(R))return(0,m.default)(R,w,P,k);if((0,c.isAsyncIterable)(R))return(0,m.default)(R[Symbol.asyncIterator](),w,P,k);var L=(0,o.default)(R),B=!1,V=!1,G=0,K=!1;function Z(Ie,de){if(!V)if(G-=1,Ie)B=!0,k(Ie);else if(Ie===!1)B=!0,V=!0;else{if(de===b.default||B&&G<=0)return B=!0,k(null);K||ve()}}function ve(){for(K=!0;G<w&&!B;){var Ie=L();if(Ie===null){B=!0,G<=0&&k(null);return}G+=1,P(Ie.value,Ie.key,(0,u.default)(Z))}K=!1}ve()}},e.exports=t.default})(mx,mx.exports);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=mx.exports,n=c(r),i=zu,o=c(i),a=S1.exports,u=c(a);function c(m){return m&&m.__esModule?m:{default:m}}function f(m,_,b,A){return(0,n.default)(_)(m,(0,o.default)(b),A)}t.default=(0,u.default)(f,4),e.exports=t.default})(a_,a_.exports);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=a_.exports,n=a(r),i=S1.exports,o=a(i);function a(c){return c&&c.__esModule?c:{default:c}}function u(c,f,m){return(0,n.default)(c,1,f,m)}t.default=(0,o.default)(u,3),e.exports=t.default})(vx,vx.exports);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var r=i_.exports,n=a(r),i=vx.exports,o=a(i);function a(c){return c&&c.__esModule?c:{default:c}}function u(c,f){return(0,n.default)(o.default,c,f)}e.exports=t.default})(hx,hx.exports);var dy=fP(hx.exports),nf=function(){function e(){this.args=[],this.tasks=[]}return e.prototype.call=function(){for(var t=arguments,r=[],n=0;n<arguments.length;n++)r[n]=t[n];return this.args=r,dy(this.tasks)},e.prototype.tap=function(t,r){var n=this;this.tasks.push(function(i){r.apply(void 0,eb([],J5(n.args),!1)),i(null,t)})},e}(),Y8={exports:{}},xx={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=Rm.exports,n=P(r),i=Pm.exports,o=P(i),a=a_.exports,u=P(a),c=Im.exports,f=P(c),m=Mm.exports,_=P(m),b=zu,A=P(b),w=S1.exports,R=P(w);function P(V){return V&&V.__esModule?V:{default:V}}function k(V,G,K){K=(0,f.default)(K);var Z=0,ve=0,Ie=V.length,de=!1;Ie===0&&K(null);function se(le,ye){le===!1&&(de=!0),de!==!0&&(le?K(le):(++ve===Ie||ye===o.default)&&K(null))}for(;Z<Ie;Z++)G(V[Z],Z,(0,_.default)(se))}function L(V,G,K){return(0,u.default)(V,1/0,G,K)}function B(V,G,K){var Z=(0,n.default)(V)?k:L;return Z(V,(0,A.default)(G),K)}t.default=(0,R.default)(B,3),e.exports=t.default})(xx,xx.exports);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var r=xx.exports,n=a(r),i=i_.exports,o=a(i);function a(c){return c&&c.__esModule?c:{default:c}}function u(c,f){return(0,o.default)(n.default,c,f)}e.exports=t.default})(Y8,Y8.exports);var bx={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=Im.exports,n=m(r),i=Mm.exports,o=m(i),a=zu,u=m(a),c=S1.exports,f=m(c);function m(b){return b&&b.__esModule?b:{default:b}}function _(b,A){if(A=(0,n.default)(A),!Array.isArray(b))return A(new Error("First argument to waterfall must be an array of functions"));if(!b.length)return A();var w=0;function R(k){var L=(0,u.default)(b[w++]);L.apply(void 0,k.concat([(0,o.default)(P)]))}function P(k){for(var L=[],B=arguments.length-1;B-- >0;)L[B]=arguments[B+1];if(k!==!1){if(k||w===b.length)return A.apply(void 0,[k].concat(L));R(L)}}R([])}t.default=(0,f.default)(_),e.exports=t.default})(bx,bx.exports);var Woe=fP(bx.exports),Z8=function(){function e(){this.tasks=[]}return e.prototype.call=function(){return dy(this.tasks)},e.prototype.tap=function(t,r){this.tasks.push(function(n){var i=r();n(i,t)})},e}(),Xoe=function(){function e(){this.args=[],this.tasks=[]}return e.prototype.promise=function(){for(var t=arguments,r=[],n=0;n<arguments.length;n++)r[n]=t[n];return this.args=r,dy(this.tasks)},e.prototype.tapPromise=function(t,r){var n=this;this.tasks.push(function(i){return lP(n,void 0,void 0,function(){return cP(this,function(o){switch(o.label){case 0:return[4,r.apply(void 0,eb([],J5(this.args),!1))];case 1:return o.sent(),i(null,t),[2]}})})})},e}(),Yoe=function(){function e(){this.args=[],this.tasks=[]}return e.prototype.promise=function(){for(var t=arguments,r=[],n=0;n<arguments.length;n++)r[n]=t[n];return this.args=r,dy(this.tasks)},e.prototype.tapPromise=function(t,r){var n=this;this.tasks.push(function(i){return lP(n,void 0,void 0,function(){var o;return cP(this,function(a){switch(a.label){case 0:return[4,r.apply(void 0,eb([],J5(this.args),!1))];case 1:return o=a.sent(),i(o,t),[2]}})})})},e}(),Zoe=function(){function e(){this.tasks=[]}return e.prototype.promise=function(){return Woe(this.tasks)},e.prototype.tapPromise=function(t,r){this.tasks.length===0?this.tasks.push(function(n){r().then(function(i){n(null,i)})}):this.tasks.push(function(n,i){r(n).then(function(o){i(null,o)})})},e}(),vP={exports:{}},qoe=vP.exports={};qoe.forEach=function(e,t){for(var r=0;r<e.length;r++){var n=t(e[r]);if(n)return n}};var mP=vP.exports,Koe=function(e){var t=e.stateHandler.getState;function r(a){var u=t(a);return u&&!!u.isDetectable}function n(a){t(a).isDetectable=!0}function i(a){return!!t(a).busy}function o(a,u){t(a).busy=!!u}return{isDetectable:r,markAsDetectable:n,isBusy:i,markBusy:o}},Qoe=function(e){var t={};function r(a){var u=e.get(a);return u===void 0?[]:t[u]||[]}function n(a,u){var c=e.get(a);t[c]||(t[c]=[]),t[c].push(u)}function i(a,u){for(var c=r(a),f=0,m=c.length;f<m;++f)if(c[f]===u){c.splice(f,1);break}}function o(a){var u=r(a);u&&(u.length=0)}return{get:r,add:n,removeListener:i,removeAllListeners:o}},Joe=function(){var e=1;function t(){return e++}return{generate:t}},ese=function(e){var t=e.idGenerator,r=e.stateHandler.getState;function n(o){var a=r(o);return a&&a.id!==void 0?a.id:null}function i(o){var a=r(o);if(!a)throw new Error("setId required the element to have a resize detection state.");var u=t.generate();return a.id=u,u}return{get:n,set:i}},tse=function(e){function t(){}var r={log:t,warn:t,error:t};if(!e&&window.console){var n=function(i,o){i[o]=function(){var u=console[o];if(u.apply)u.apply(console,arguments);else for(var c=0;c<arguments.length;c++)u(arguments[c])}};n(r,"log"),n(r,"warn"),n(r,"error")}return r},gP={exports:{}},_P=gP.exports={};_P.isIE=function(e){function t(){var n=navigator.userAgent.toLowerCase();return n.indexOf("msie")!==-1||n.indexOf("trident")!==-1||n.indexOf(" edge/")!==-1}if(!t())return!1;if(!e)return!0;var r=function(){var n,i=3,o=document.createElement("div"),a=o.getElementsByTagName("i");do o.innerHTML="<!--[if gt IE "+ ++i+"]><i></i><![endif]-->";while(a[0]);return i>4?i:n}();return e===r};_P.isLegacyOpera=function(){return!!window.opera};var yP=gP.exports,xP={exports:{}},rse=xP.exports={};rse.getOption=nse;function nse(e,t,r){var n=e[t];return n==null&&r!==void 0?r:n}var ise=xP.exports,q8=ise,ase=function(t){t=t||{};var r=t.reporter,n=q8.getOption(t,"async",!0),i=q8.getOption(t,"auto",!0);i&&!n&&(r&&r.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var o=K8(),a,u=!1;function c(w,R){!u&&i&&n&&o.size()===0&&_(),o.add(w,R)}function f(){for(u=!0;o.size();){var w=o;o=K8(),w.process()}u=!1}function m(w){u||(w===void 0&&(w=n),a&&(b(a),a=null),w?_():f())}function _(){a=A(f)}function b(w){var R=clearTimeout;return R(w)}function A(w){var R=function(P){return setTimeout(P,0)};return R(w)}return{add:c,force:m}};function K8(){var e={},t=0,r=0,n=0;function i(u,c){c||(c=u,u=0),u>r?r=u:u<n&&(n=u),e[u]||(e[u]=[]),e[u].push(c),t++}function o(){for(var u=n;u<=r;u++)for(var c=e[u],f=0;f<c.length;f++){var m=c[f];m()}}function a(){return t}return{add:i,process:o,size:a}}var tb="_erd";function ose(e){return e[tb]={},bP(e)}function bP(e){return e[tb]}function sse(e){delete e[tb]}var use={initState:ose,getState:bP,cleanState:sse},bv=yP,lse=function(e){e=e||{};var t=e.reporter,r=e.batchProcessor,n=e.stateHandler.getState;if(!t)throw new Error("Missing required dependency: reporter.");function i(f,m){function _(){m(f)}if(bv.isIE(8))n(f).object={proxy:_},f.attachEvent("onresize",_);else{var b=u(f);if(!b)throw new Error("Element is not detectable by this strategy.");b.contentDocument.defaultView.addEventListener("resize",_)}}function o(f){var m=e.important?" !important; ":"; ";return(f.join(m)+m).trim()}function a(f,m,_){_||(_=m,m=f,f=null),f=f||{},f.debug;function b(A,w){var R=o(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),P=!1,k=window.getComputedStyle(A),L=A.offsetWidth,B=A.offsetHeight;n(A).startSize={width:L,height:B};function V(){function G(){if(k.position==="static"){A.style.setProperty("position","relative",f.important?"important":"");var ve=function(Ie,de,se,le){function ye(Rt){return Rt.replace(/[^-\d\.]/g,"")}var ke=se[le];ke!=="auto"&&ye(ke)!=="0"&&(Ie.warn("An element that is positioned static has style."+le+"="+ke+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+le+" will be set to 0. Element: ",de),de.style.setProperty(le,"0",f.important?"important":""))};ve(t,A,k,"top"),ve(t,A,k,"right"),ve(t,A,k,"bottom"),ve(t,A,k,"left")}}function K(){P||G();function ve(de,se){if(!de.contentDocument){var le=n(de);le.checkForObjectDocumentTimeoutId&&window.clearTimeout(le.checkForObjectDocumentTimeoutId),le.checkForObjectDocumentTimeoutId=setTimeout(function(){le.checkForObjectDocumentTimeoutId=0,ve(de,se)},100);return}se(de.contentDocument)}var Ie=this;ve(Ie,function(se){w(A)})}k.position!==""&&(G(),P=!0);var Z=document.createElement("object");Z.style.cssText=R,Z.tabIndex=-1,Z.type="text/html",Z.setAttribute("aria-hidden","true"),Z.onload=K,bv.isIE()||(Z.data="about:blank"),n(A)&&(A.appendChild(Z),n(A).object=Z,bv.isIE()&&(Z.data="about:blank"))}r?r.add(V):V()}bv.isIE(8)?_(m):b(m,_)}function u(f){return n(f).object}function c(f){if(n(f)){var m=u(f);m&&(bv.isIE(8)?f.detachEvent("onresize",m.proxy):f.removeChild(m),n(f).checkForObjectDocumentTimeoutId&&window.clearTimeout(n(f).checkForObjectDocumentTimeoutId),delete n(f).object)}}return{makeDetectable:a,addListener:i,uninstall:c}},cse=mP.forEach,fse=function(e){e=e||{};var t=e.reporter,r=e.batchProcessor,n=e.stateHandler.getState;e.stateHandler.hasState;var i=e.idHandler;if(!r)throw new Error("Missing required dependency: batchProcessor");if(!t)throw new Error("Missing required dependency: reporter.");var o=m(),a="erd_scroll_detection_scrollbar_style",u="erd_scroll_detection_container";function c(V){_(V,a,u)}c(window.document);function f(V){var G=e.important?" !important; ":"; ";return(V.join(G)+G).trim()}function m(){var V=500,G=500,K=document.createElement("div");K.style.cssText=f(["position: absolute","width: "+V*2+"px","height: "+G*2+"px","visibility: hidden","margin: 0","padding: 0"]);var Z=document.createElement("div");Z.style.cssText=f(["position: absolute","width: "+V+"px","height: "+G+"px","overflow: scroll","visibility: none","top: "+-V*3+"px","left: "+-G*3+"px","visibility: hidden","margin: 0","padding: 0"]),Z.appendChild(K),document.body.insertBefore(Z,document.body.firstChild);var ve=V-Z.clientWidth,Ie=G-Z.clientHeight;return document.body.removeChild(Z),{width:ve,height:Ie}}function _(V,G,K){function Z(se,le){le=le||function(ke){V.head.appendChild(ke)};var ye=V.createElement("style");return ye.innerHTML=se,ye.id=G,le(ye),ye}if(!V.getElementById(G)){var ve=K+"_animation",Ie=K+"_animation_active",de=`/* Created by the element-resize-detector library. */
|
|
`;de+="."+K+" > div::-webkit-scrollbar { "+f(["display: none"])+` }
|
|
|
|
`,de+="."+Ie+" { "+f(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+ve,"animation-name: "+ve])+` }
|
|
`,de+="@-webkit-keyframes "+ve+` { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }
|
|
`,de+="@keyframes "+ve+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }",Z(de)}}function b(V){V.className+=" "+u+"_animation_active"}function A(V,G,K){if(V.addEventListener)V.addEventListener(G,K);else if(V.attachEvent)V.attachEvent("on"+G,K);else return t.error("[scroll] Don't know how to add event listeners.")}function w(V,G,K){if(V.removeEventListener)V.removeEventListener(G,K);else if(V.detachEvent)V.detachEvent("on"+G,K);else return t.error("[scroll] Don't know how to remove event listeners.")}function R(V){return n(V).container.childNodes[0].childNodes[0].childNodes[0]}function P(V){return n(V).container.childNodes[0].childNodes[0].childNodes[1]}function k(V,G){var K=n(V).listeners;if(!K.push)throw new Error("Cannot add listener to an element that is not detectable.");n(V).listeners.push(G)}function L(V,G,K){K||(K=G,G=V,V=null),V=V||{};function Z(){if(V.debug){var Je=Array.prototype.slice.call(arguments);if(Je.unshift(i.get(G),"Scroll: "),t.log.apply)t.log.apply(null,Je);else for(var Qt=0;Qt<Je.length;Qt++)t.log(Je[Qt])}}function ve(Je){function Qt(Xr){var Ut=Xr.getRootNode&&Xr.getRootNode().contains(Xr);return Xr===Xr.ownerDocument.body||Xr.ownerDocument.body.contains(Xr)||Ut}return!Qt(Je)||window.getComputedStyle(Je)===null}function Ie(Je){var Qt=n(Je).container.childNodes[0],Xr=window.getComputedStyle(Qt);return!Xr.width||Xr.width.indexOf("px")===-1}function de(){var Je=window.getComputedStyle(G),Qt={};return Qt.position=Je.position,Qt.width=G.offsetWidth,Qt.height=G.offsetHeight,Qt.top=Je.top,Qt.right=Je.right,Qt.bottom=Je.bottom,Qt.left=Je.left,Qt.widthCSS=Je.width,Qt.heightCSS=Je.height,Qt}function se(){var Je=de();n(G).startSize={width:Je.width,height:Je.height},Z("Element start size",n(G).startSize)}function le(){n(G).listeners=[]}function ye(){if(Z("storeStyle invoked."),!n(G)){Z("Aborting because element has been uninstalled");return}var Je=de();n(G).style=Je}function ke(Je,Qt,Xr){n(Je).lastWidth=Qt,n(Je).lastHeight=Xr}function Rt(Je){return R(Je).childNodes[0]}function Lt(){return 2*o.width+1}function Gt(){return 2*o.height+1}function Zt(Je){return Je+10+Lt()}function st(Je){return Je+10+Gt()}function tt(Je){return Je*2+Lt()}function dt(Je){return Je*2+Gt()}function nt(Je,Qt,Xr){var Ut=R(Je),ge=P(Je),Be=Zt(Qt),ft=st(Xr),At=tt(Qt),bt=dt(Xr);Ut.scrollLeft=Be,Ut.scrollTop=ft,ge.scrollLeft=At,ge.scrollTop=bt}function pr(){var Je=n(G).container;if(!Je){Je=document.createElement("div"),Je.className=u,Je.style.cssText=f(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),n(G).container=Je,b(Je),G.appendChild(Je);var Qt=function(){n(G).onRendered&&n(G).onRendered()};A(Je,"animationstart",Qt),n(G).onAnimationStart=Qt}return Je}function ur(){function Je(){var hr=n(G).style;if(hr.position==="static"){G.style.setProperty("position","relative",V.important?"important":"");var Cn=function(rn,Ne,qe,ct){function Vt(Jn){return Jn.replace(/[^-\d\.]/g,"")}var Qr=qe[ct];Qr!=="auto"&&Vt(Qr)!=="0"&&(rn.warn("An element that is positioned static has style."+ct+"="+Qr+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+ct+" will be set to 0. Element: ",Ne),Ne.style[ct]=0)};Cn(t,G,hr,"top"),Cn(t,G,hr,"right"),Cn(t,G,hr,"bottom"),Cn(t,G,hr,"left")}}function Qt(hr,Cn,rn,Ne){return hr=hr?hr+"px":"0",Cn=Cn?Cn+"px":"0",rn=rn?rn+"px":"0",Ne=Ne?Ne+"px":"0",["left: "+hr,"top: "+Cn,"right: "+Ne,"bottom: "+rn]}if(Z("Injecting elements"),!n(G)){Z("Aborting because element has been uninstalled");return}Je();var Xr=n(G).container;Xr||(Xr=pr());var Ut=o.width,ge=o.height,Be=f(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),ft=f(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(Qt(-(1+Ut),-(1+ge),-ge,-Ut))),At=f(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),bt=f(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),$t=f(["position: absolute","left: 0","top: 0"]),Mr=f(["position: absolute","width: 200%","height: 200%"]),tr=document.createElement("div"),lr=document.createElement("div"),or=document.createElement("div"),Q=document.createElement("div"),Ge=document.createElement("div"),at=document.createElement("div");tr.dir="ltr",tr.style.cssText=Be,tr.className=u,lr.className=u,lr.style.cssText=ft,or.style.cssText=At,Q.style.cssText=$t,Ge.style.cssText=bt,at.style.cssText=Mr,or.appendChild(Q),Ge.appendChild(at),lr.appendChild(or),lr.appendChild(Ge),tr.appendChild(lr),Xr.appendChild(tr);function yt(){var hr=n(G);hr&&hr.onExpand?hr.onExpand():Z("Aborting expand scroll handler: element has been uninstalled")}function rr(){var hr=n(G);hr&&hr.onShrink?hr.onShrink():Z("Aborting shrink scroll handler: element has been uninstalled")}A(or,"scroll",yt),A(Ge,"scroll",rr),n(G).onExpandScroll=yt,n(G).onShrinkScroll=rr}function Ar(){function Je(At,bt,$t){var Mr=Rt(At),tr=Zt(bt),lr=st($t);Mr.style.setProperty("width",tr+"px",V.important?"important":""),Mr.style.setProperty("height",lr+"px",V.important?"important":"")}function Qt(At){var bt=G.offsetWidth,$t=G.offsetHeight,Mr=bt!==n(G).lastWidth||$t!==n(G).lastHeight;Z("Storing current size",bt,$t),ke(G,bt,$t),r.add(0,function(){if(Mr){if(!n(G)){Z("Aborting because element has been uninstalled");return}if(!Xr()){Z("Aborting because element container has not been initialized");return}if(V.debug){var lr=G.offsetWidth,or=G.offsetHeight;(lr!==bt||or!==$t)&&t.warn(i.get(G),"Scroll: Size changed before updating detector elements.")}Je(G,bt,$t)}}),r.add(1,function(){if(!n(G)){Z("Aborting because element has been uninstalled");return}if(!Xr()){Z("Aborting because element container has not been initialized");return}nt(G,bt,$t)}),Mr&&At&&r.add(2,function(){if(!n(G)){Z("Aborting because element has been uninstalled");return}if(!Xr()){Z("Aborting because element container has not been initialized");return}At()})}function Xr(){return!!n(G).container}function Ut(){function At(){return n(G).lastNotifiedWidth===void 0}Z("notifyListenersIfNeeded invoked");var bt=n(G);if(At()&&bt.lastWidth===bt.startSize.width&&bt.lastHeight===bt.startSize.height)return Z("Not notifying: Size is the same as the start size, and there has been no notification yet.");if(bt.lastWidth===bt.lastNotifiedWidth&&bt.lastHeight===bt.lastNotifiedHeight)return Z("Not notifying: Size already notified");Z("Current size not notified, notifying..."),bt.lastNotifiedWidth=bt.lastWidth,bt.lastNotifiedHeight=bt.lastHeight,cse(n(G).listeners,function($t){$t(G)})}function ge(){if(Z("startanimation triggered."),Ie(G)){Z("Ignoring since element is still unrendered...");return}Z("Element rendered.");var At=R(G),bt=P(G);(At.scrollLeft===0||At.scrollTop===0||bt.scrollLeft===0||bt.scrollTop===0)&&(Z("Scrollbars out of sync. Updating detector elements..."),Qt(Ut))}function Be(){if(Z("Scroll detected."),Ie(G)){Z("Scroll event fired while unrendered. Ignoring...");return}Qt(Ut)}if(Z("registerListenersAndPositionElements invoked."),!n(G)){Z("Aborting because element has been uninstalled");return}n(G).onRendered=ge,n(G).onExpand=Be,n(G).onShrink=Be;var ft=n(G).style;Je(G,ft.width,ft.height)}function Xn(){if(Z("finalizeDomMutation invoked."),!n(G)){Z("Aborting because element has been uninstalled");return}var Je=n(G).style;ke(G,Je.width,Je.height),nt(G,Je.width,Je.height)}function pn(){K(G)}function gi(){Z("Installing..."),le(),se(),r.add(0,ye),r.add(1,ur),r.add(2,Ar),r.add(3,Xn),r.add(4,pn)}Z("Making detectable..."),ve(G)?(Z("Element is detached"),pr(),Z("Waiting until element is attached..."),n(G).onRendered=function(){Z("Element is now attached"),gi()}):gi()}function B(V){var G=n(V);G&&(G.onExpandScroll&&w(R(V),"scroll",G.onExpandScroll),G.onShrinkScroll&&w(P(V),"scroll",G.onShrinkScroll),G.onAnimationStart&&w(G.container,"animationstart",G.onAnimationStart),G.container&&V.removeChild(G.container))}return{makeDetectable:L,addListener:k,uninstall:B,initDocument:c}},Wv=mP.forEach,hse=Koe,pse=Qoe,dse=Joe,vse=ese,mse=tse,Q8=yP,gse=ase,Zh=use,_se=lse,yse=fse;function J8(e){return Array.isArray(e)||e.length!==void 0}function eS(e){if(Array.isArray(e))return e;var t=[];return Wv(e,function(r){t.push(r)}),t}function tS(e){return e&&e.nodeType===1}var xse=function(e){e=e||{};var t;if(e.idHandler)t={get:function(L){return e.idHandler.get(L,!0)},set:e.idHandler.set};else{var r=dse(),n=vse({idGenerator:r,stateHandler:Zh});t=n}var i=e.reporter;if(!i){var o=i===!1;i=mse(o)}var a=qh(e,"batchProcessor",gse({reporter:i})),u={};u.callOnAdd=!!qh(e,"callOnAdd",!0),u.debug=!!qh(e,"debug",!1);var c=pse(t),f=hse({stateHandler:Zh}),m,_=qh(e,"strategy","object"),b=qh(e,"important",!1),A={reporter:i,batchProcessor:a,stateHandler:Zh,idHandler:t,important:b};if(_==="scroll"&&(Q8.isLegacyOpera()?(i.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),_="object"):Q8.isIE(9)&&(i.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),_="object")),_==="scroll")m=yse(A);else if(_==="object")m=_se(A);else throw new Error("Invalid strategy name: "+_);var w={};function R(L,B,V){function G(se){var le=c.get(se);Wv(le,function(ke){ke(se)})}function K(se,le,ye){c.add(le,ye),se&&ye(le)}if(V||(V=B,B=L,L={}),!B)throw new Error("At least one element required.");if(!V)throw new Error("Listener required.");if(tS(B))B=[B];else if(J8(B))B=eS(B);else return i.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");var Z=0,ve=qh(L,"callOnAdd",u.callOnAdd),Ie=qh(L,"onReady",function(){}),de=qh(L,"debug",u.debug);Wv(B,function(le){Zh.getState(le)||(Zh.initState(le),t.set(le));var ye=t.get(le);if(de&&i.log("Attaching listener to element",ye,le),!f.isDetectable(le)){if(de&&i.log(ye,"Not detectable."),f.isBusy(le)){de&&i.log(ye,"System busy making it detectable"),K(ve,le,V),w[ye]=w[ye]||[],w[ye].push(function(){Z++,Z===B.length&&Ie()});return}return de&&i.log(ye,"Making detectable..."),f.markBusy(le,!0),m.makeDetectable({debug:de,important:b},le,function(Rt){if(de&&i.log(ye,"onElementDetectable"),Zh.getState(Rt)){f.markAsDetectable(Rt),f.markBusy(Rt,!1),m.addListener(Rt,G),K(ve,Rt,V);var Lt=Zh.getState(Rt);if(Lt&&Lt.startSize){var Gt=Rt.offsetWidth,Zt=Rt.offsetHeight;(Lt.startSize.width!==Gt||Lt.startSize.height!==Zt)&&G(Rt)}w[ye]&&Wv(w[ye],function(st){st()})}else de&&i.log(ye,"Element uninstalled before being detectable.");delete w[ye],Z++,Z===B.length&&Ie()})}de&&i.log(ye,"Already detecable, adding listener."),K(ve,le,V),Z++}),Z===B.length&&Ie()}function P(L){if(!L)return i.error("At least one element is required.");if(tS(L))L=[L];else if(J8(L))L=eS(L);else return i.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");Wv(L,function(B){c.removeAllListeners(B),m.uninstall(B),Zh.cleanState(B)})}function k(L){m.initDocument&&m.initDocument(L)}return{listenTo:R,removeListener:c.removeListener,removeAllListeners:c.removeAllListeners,uninstall:P,initDocument:k}};function qh(e,t,r){var n=e[t];return n==null&&r!==void 0?r:n}const bse=oa(xse);var rS,nS,iS,aS,oS,sS,uS,lS,cS,fS,hS,pS,dS,vS,mS,gS,_S,yS,As,xS,bS,ES,SS,AS,TS,wS,CS,RS,IS,MS,PS,OS,kS,DS,FS;function Ese(e){var t=Sse();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Sse(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ase=(rS=ai(),nS=ki(wt.SceneID),iS=ki(wt.IIconService),aS=ki(wt.IFontService),oS=ki(wt.IControlService),sS=ki(wt.IGlobalConfigService),uS=ki(wt.IMapService),lS=ki(wt.ICoordinateSystemService),cS=ki(wt.IRendererService),fS=ki(wt.ILayerService),hS=ki(wt.IDebugService),pS=ki(wt.ICameraService),dS=ki(wt.IInteractionService),vS=ki(wt.IPickingService),mS=ki(wt.IShaderModuleService),gS=ki(wt.IMarkerService),_S=ki(wt.IPopupService),rS(yS=(As=function(e){_n(r,e);var t=Ese(r);function r(){var n;return Ht(this,r),n=t.call(this),F($e(n),"destroyed",!1),F($e(n),"loaded",!1),bi($e(n),"id",xS,$e(n)),bi($e(n),"iconService",bS,$e(n)),bi($e(n),"fontService",ES,$e(n)),bi($e(n),"controlService",SS,$e(n)),bi($e(n),"configService",AS,$e(n)),bi($e(n),"map",TS,$e(n)),bi($e(n),"coordinateSystemService",wS,$e(n)),bi($e(n),"rendererService",CS,$e(n)),bi($e(n),"layerService",RS,$e(n)),bi($e(n),"debugService",IS,$e(n)),bi($e(n),"cameraService",MS,$e(n)),bi($e(n),"interactionService",PS,$e(n)),bi($e(n),"pickingService",OS,$e(n)),bi($e(n),"shaderModuleService",kS,$e(n)),bi($e(n),"markerService",DS,$e(n)),bi($e(n),"popupService",FS,$e(n)),F($e(n),"inited",!1),F($e(n),"rendering",!1),F($e(n),"$container",void 0),F($e(n),"canvas",void 0),F($e(n),"markerContainer",void 0),F($e(n),"resizeDetector",void 0),F($e(n),"hooks",void 0),F($e(n),"handleWindowResized",function(){n.emit("resize"),n.$container&&(n.initContainer(),n.coordinateSystemService.needRefresh=!0,n.render())}),F($e(n),"handleMapCameraChanged",function(i){n.cameraService.update(i),n.render()}),n.hooks={init:new Xoe},n}return jt(r,[{key:"init",value:function(i){var o=this;this.configService.setSceneConfig(this.id,i),this.shaderModuleService.registerBuiltinModules(),this.iconService.init(),this.iconService.on("imageUpdate",function(){return o.render()}),this.fontService.init(),this.hooks.init.tapPromise("initMap",Mt(he.mark(function a(){return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return o.debugService.log("map.mapInitStart",{type:o.map.version}),c.next=3,new Promise(function(f){o.map.onCameraChanged(function(m){o.cameraService.init(),o.cameraService.update(m),f()}),o.map.init()});case 3:o.map.onCameraChanged(o.handleMapCameraChanged),o.map.addMarkerContainer(),o.markerService.addMarkers(),o.markerService.addMarkerLayers(),o.popupService.initPopup(),o.interactionService.init(),o.interactionService.on(Bu.Drag,o.addSceneEvent.bind(o));case 10:case"end":return c.stop()}},a)}))),this.hooks.init.tapPromise("initRenderer",Mt(he.mark(function a(){var u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(c=((u=o.map)===null||u===void 0?void 0:u.getOverlayContainer())||void 0,c?o.$container=c:o.$container=xoe(o.configService.getSceneConfig(o.id).id||""),!o.$container){_.next=14;break}return o.canvas=fl("canvas","",o.$container),o.setCanvas(),_.next=7,o.rendererService.init(o.canvas,o.configService.getSceneConfig(o.id),i.gl);case 7:o.registerContextLost(),o.initContainer(),o.resizeDetector=bse({strategy:"scroll"}),o.resizeDetector.listenTo(o.$container,o.handleWindowResized),window.matchMedia&&((f=window.matchMedia("screen and (-webkit-min-device-pixel-ratio: 1.5)"))===null||f===void 0||f.addListener(o.handleWindowResized.bind("screen"))),_.next=15;break;case 14:console.error("容器 id 不存在");case 15:o.pickingService.init(o.id);case 16:case"end":return _.stop()}},a)}))),this.render()}},{key:"registerContextLost",value:function(){var i=this,o=this.rendererService.getCanvas();o&&o.addEventListener("webglcontextlost",function(){return i.emit("webglcontextlost")})}},{key:"addLayer",value:function(i){this.layerService.sceneService=this,this.layerService.add(i)}},{key:"addMask",value:function(i){this.layerService.sceneService=this,this.layerService.addMask(i)}},{key:"render",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!(this.rendering||this.destroyed)){u.next=2;break}return u.abrupt("return");case 2:if(this.rendering=!0,this.inited){u.next=16;break}return u.next=6,this.hooks.init.promise();case 6:return this.destroyed&&this.destroy(),u.next=9,this.layerService.initLayers();case 9:this.layerService.renderLayers(),this.controlService.addControls(),this.loaded=!0,this.emit("loaded"),this.inited=!0,u.next=20;break;case 16:return u.next=18,this.layerService.initLayers();case 18:return u.next=20,this.layerService.renderLayers();case 20:this.rendering=!1;case 21:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"addFontFace",value:function(i,o){this.fontService.addFontFace(i,o)}},{key:"getSceneContainer",value:function(){return this.$container}},{key:"exportPng",value:function(){var n=Mt(he.mark(function o(a){var u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return c=(u=this.$container)===null||u===void 0?void 0:u.getElementsByTagName("canvas")[0],_.next=3,this.render();case 3:return f=a==="jpg"?c==null?void 0:c.toDataURL("image/jpeg"):c==null?void 0:c.toDataURL("image/png"),_.abrupt("return",f);case 5:case"end":return _.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"getSceneConfig",value:function(){return this.configService.getSceneConfig(this.id)}},{key:"getPointSizeRange",value:function(){return this.rendererService.getPointSizeRange()}},{key:"addMarkerContainer",value:function(){var i=this.$container.parentElement;i!==null&&(this.markerContainer=fl("div","l7-marker-container",i))}},{key:"getMarkerContainer",value:function(){return this.markerContainer}},{key:"destroy",value:function(){var i=this,o;if(!this.inited){this.destroyed=!0;return}this.resizeDetector.removeListener(this.$container,this.handleWindowResized),this.pickingService.destroy(),this.layerService.destroy(),this.interactionService.destroy(),this.controlService.destroy(),this.markerService.destroy(),this.fontService.destroy(),this.iconService.destroy(),this.removeAllListeners(),this.inited=!1,this.map.destroy(),setTimeout(function(){var a;(a=i.$container)===null||a===void 0||a.removeChild(i.canvas),i.canvas=null,i.rendererService.destroy()}),(o=this.$container)===null||o===void 0||(o=o.parentNode)===null||o===void 0||o.removeChild(this.$container),this.emit("destroy")}},{key:"initContainer",value:function(){var i,o,a=ul,u=((i=this.$container)===null||i===void 0?void 0:i.clientWidth)||400,c=((o=this.$container)===null||o===void 0?void 0:o.clientHeight)||300,f=this.canvas;f&&(f.width=u*a,f.height=c*a),this.rendererService.viewport({x:0,y:0,width:a*u,height:a*c})}},{key:"setCanvas",value:function(){var i,o,a=ul,u=((i=this.$container)===null||i===void 0?void 0:i.clientWidth)||400,c=((o=this.$container)===null||o===void 0?void 0:o.clientHeight)||300,f=this.canvas;f.width=u*a,f.height=c*a,f.style.width="100%",f.style.height="100%"}},{key:"addSceneEvent",value:function(i){this.emit(i.type,i)}}]),r}(ju.EventEmitter),xS=mi(As.prototype,"id",[nS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bS=mi(As.prototype,"iconService",[iS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ES=mi(As.prototype,"fontService",[aS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),SS=mi(As.prototype,"controlService",[oS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),AS=mi(As.prototype,"configService",[sS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),TS=mi(As.prototype,"map",[uS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wS=mi(As.prototype,"coordinateSystemService",[lS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),CS=mi(As.prototype,"rendererService",[cS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),RS=mi(As.prototype,"layerService",[fS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),IS=mi(As.prototype,"debugService",[hS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),MS=mi(As.prototype,"cameraService",[pS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),PS=mi(As.prototype,"interactionService",[dS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),OS=mi(As.prototype,"pickingService",[vS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),kS=mi(As.prototype,"shaderModuleService",[mS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),DS=mi(As.prototype,"markerService",[gS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),FS=mi(As.prototype,"popupService",[_S],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),As))||yS);function Tse(e){var t=0;switch(e){case"vec2":case"ivec2":t=2;break;case"vec3":case"ivec3":t=3;break;case"vec4":case"ivec4":case"mat2":t=4;break;case"mat3":t=9;break;case"mat4":t=16;break}return t}var EP=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function BS(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r={};return e=e.replace(EP,function(n,i,o){var a=o.split(":"),u=a[0].trim(),c="";switch(a.length>1&&(c=a[1].trim()),i){case"bool":c=c==="true";break;case"float":case"int":c=Number(c);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":c?c=c.replace("[","").replace("]","").split(",").reduce(function(f,m){return f.push(Number(m.trim())),f},[]):c=new Array(Tse(i)).fill(0);break}return r[u]=c,"".concat(t?"uniform ":"").concat(i," ").concat(u,`;
|
|
`)}),{content:e,uniforms:r}}function j3(e){var t=BS(e,!0),r=t.content,n=t.uniforms;return r=r.replace(/(\s*uniform\s*.*\s*){((?:\s*.*\s*)*?)};/g,function(i,o,a){a=a.trim().replace(/^.*$/gm,function(m){return"uniform ".concat(m)});var u=BS(a),c=u.content,f=u.uniforms;return Object.assign(n,f),"".concat(o,`{
|
|
`).concat(c,`
|
|
};`)}),{content:r,uniforms:n}}function LS(e){var t={};return e.replace(EP,function(r,n,i){var o=i.trim();return t[o]?"":(t[o]=!0,"uniform ".concat(n," ").concat(o,`;
|
|
`))})}var NS,US,wse=Ci.uniq,zS="#define PI 3.14159265359",Cse=`#define SHIFT_RIGHT17 1.0 / 131072.0
|
|
#define SHIFT_RIGHT18 1.0 / 262144.0
|
|
#define SHIFT_RIGHT19 1.0 / 524288.0
|
|
#define SHIFT_RIGHT20 1.0 / 1048576.0
|
|
#define SHIFT_RIGHT21 1.0 / 2097152.0
|
|
#define SHIFT_RIGHT22 1.0 / 4194304.0
|
|
#define SHIFT_RIGHT23 1.0 / 8388608.0
|
|
#define SHIFT_RIGHT24 1.0 / 16777216.0
|
|
|
|
#define SHIFT_LEFT17 131072.0
|
|
#define SHIFT_LEFT18 262144.0
|
|
#define SHIFT_LEFT19 524288.0
|
|
#define SHIFT_LEFT20 1048576.0
|
|
#define SHIFT_LEFT21 2097152.0
|
|
#define SHIFT_LEFT22 4194304.0
|
|
#define SHIFT_LEFT23 8388608.0
|
|
#define SHIFT_LEFT24 16777216.0
|
|
|
|
vec2 unpack_float(float packedValue) {
|
|
int packedIntValue = int(packedValue);
|
|
int v0 = packedIntValue / 256;
|
|
return vec2(v0, packedIntValue - v0 * 256);
|
|
}
|
|
|
|
vec4 decode_color(vec2 encodedColor) {
|
|
return vec4(
|
|
unpack_float(encodedColor[0]) / 255.0,
|
|
unpack_float(encodedColor[1]) / 255.0
|
|
);
|
|
}
|
|
`,$S=`layout(std140) uniform SceneUniforms {
|
|
mat4 u_ViewMatrix;
|
|
mat4 u_ProjectionMatrix;
|
|
mat4 u_ViewProjectionMatrix;
|
|
mat4 u_ModelMatrix;
|
|
vec4 u_ViewportCenterProjection;
|
|
vec3 u_PixelsPerDegree;
|
|
float u_Zoom;
|
|
vec3 u_PixelsPerDegree2;
|
|
float u_ZoomScale;
|
|
vec3 u_PixelsPerMeter;
|
|
float u_CoordinateSystem;
|
|
vec3 u_CameraPosition;
|
|
float u_DevicePixelRatio;
|
|
vec2 u_ViewportCenter;
|
|
vec2 u_ViewportSize;
|
|
float u_FocalDistance;
|
|
};
|
|
|
|
layout(std140) uniform LayerUniforms {
|
|
mat4 u_Mvp;
|
|
vec2 u_sceneCenterMercator;
|
|
};
|
|
`,VS=`layout(std140) uniform PickingUniforms {
|
|
vec4 u_HighlightColor;
|
|
vec4 u_SelectColor;
|
|
vec3 u_PickingColor;
|
|
float u_PickingStage;
|
|
vec3 u_CurrentSelectedId;
|
|
float u_PickingThreshold;
|
|
float u_PickingBuffer;
|
|
float u_shaderPick;
|
|
float u_EnableSelect;
|
|
float u_activeMix;
|
|
};`,Rse=`#define ambientRatio 0.5
|
|
#define diffuseRatio 0.3
|
|
#define specularRatio 0.2
|
|
|
|
|
|
float calc_lighting(vec4 pos) {
|
|
|
|
vec3 worldPos = vec3(pos * u_ModelMatrix);
|
|
|
|
vec3 worldNormal = a_Normal;
|
|
// //cal light weight
|
|
vec3 viewDir = normalize(u_CameraPosition - worldPos);
|
|
|
|
vec3 lightDir = normalize(vec3(1, -10.5, 12));
|
|
|
|
vec3 halfDir = normalize(viewDir+lightDir);
|
|
// //lambert
|
|
float lambert = dot(worldNormal, lightDir);
|
|
//specular
|
|
float specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0);
|
|
//sum to light weight
|
|
float lightWeight = ambientRatio + diffuseRatio * lambert + specularRatio * specular;
|
|
|
|
return lightWeight;
|
|
}
|
|
`,Ise=`// Blinn-Phong model
|
|
// apply lighting in vertex shader instead of fragment shader
|
|
// @see https://learnopengl.com/Advanced-Lighting/Advanced-Lighting
|
|
uniform float u_Ambient : 1.0;
|
|
uniform float u_Diffuse : 1.0;
|
|
uniform float u_Specular : 1.0;
|
|
uniform int u_NumOfDirectionalLights : 1;
|
|
uniform int u_NumOfSpotLights : 0;
|
|
|
|
#define SHININESS 32.0
|
|
#define MAX_NUM_OF_DIRECTIONAL_LIGHTS 3
|
|
#define MAX_NUM_OF_SPOT_LIGHTS 3
|
|
|
|
struct DirectionalLight {
|
|
vec3 direction;
|
|
vec3 ambient;
|
|
vec3 diffuse;
|
|
vec3 specular;
|
|
};
|
|
|
|
struct SpotLight {
|
|
vec3 position;
|
|
vec3 direction;
|
|
vec3 ambient;
|
|
vec3 diffuse;
|
|
vec3 specular;
|
|
float constant;
|
|
float linear;
|
|
float quadratic;
|
|
float angle;
|
|
float blur;
|
|
float exponent;
|
|
};
|
|
|
|
uniform DirectionalLight u_DirectionalLights[MAX_NUM_OF_DIRECTIONAL_LIGHTS];
|
|
uniform SpotLight u_SpotLights[MAX_NUM_OF_SPOT_LIGHTS];
|
|
|
|
vec3 calc_directional_light(DirectionalLight light, vec3 normal, vec3 viewDir) {
|
|
vec3 lightDir = normalize(light.direction);
|
|
// diffuse shading
|
|
float diff = max(dot(normal, lightDir), 0.0);
|
|
// Blinn-Phong specular shading
|
|
vec3 halfwayDir = normalize(lightDir + viewDir);
|
|
float spec = pow(max(dot(normal, halfwayDir), 0.0), SHININESS);
|
|
|
|
vec3 ambient = light.ambient * u_Ambient;
|
|
vec3 diffuse = light.diffuse * diff * u_Diffuse;
|
|
vec3 specular = light.specular * spec * u_Specular;
|
|
|
|
return ambient + diffuse + specular;
|
|
}
|
|
|
|
|
|
vec3 calc_lighting(vec3 position, vec3 normal, vec3 viewDir) {
|
|
vec3 weight = vec3(0.0);
|
|
for (int i = 0; i < MAX_NUM_OF_DIRECTIONAL_LIGHTS; i++) {
|
|
if (i >= u_NumOfDirectionalLights) {
|
|
break;
|
|
}
|
|
weight += calc_directional_light(u_DirectionalLights[i], normal, viewDir);
|
|
}
|
|
return weight;
|
|
}
|
|
`,Mse=`
|
|
in vec4 v_PickingResult;
|
|
|
|
#pragma include "picking_uniforms"
|
|
|
|
#define PICKING_NONE 0.0
|
|
#define PICKING_ENCODE 1.0
|
|
#define PICKING_HIGHLIGHT 2.0
|
|
#define COLOR_SCALE 1. / 255.
|
|
|
|
#define HIGHLIGHT 1.0
|
|
#define SELECT 2.0
|
|
|
|
/*
|
|
* Returns highlight color if this item is selected.
|
|
*/
|
|
vec4 filterHighlightColor(vec4 color, float weight) {
|
|
// float selected = v_PickingResult.a;
|
|
bool selected = bool(v_PickingResult.a);
|
|
|
|
// if (selected == SELECT) {
|
|
if (selected) {
|
|
// // 点击选中状态
|
|
// vec4 selectColor = u_SelectColor * COLOR_SCALE;
|
|
// return selectColor;
|
|
// } else if (selected == HIGHLIGHT) {
|
|
// // hover 高亮状态
|
|
vec4 highLightColor = u_HighlightColor * COLOR_SCALE;
|
|
|
|
float highLightAlpha = highLightColor.a;
|
|
float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));
|
|
|
|
vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);
|
|
return vec4(mix(resultRGB * weight, color.rgb, u_activeMix), color.a);
|
|
} else {
|
|
return color;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Returns picking color if picking enabled else unmodified argument.
|
|
*/
|
|
vec4 filterPickingColor(vec4 color) {
|
|
vec3 pickingColor = v_PickingResult.rgb;
|
|
if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {
|
|
discard;
|
|
}
|
|
return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;
|
|
}
|
|
|
|
/*
|
|
* Returns picking color if picking is enabled if not
|
|
* highlight color if this item is selected, otherwise unmodified argument.
|
|
*/
|
|
vec4 filterColor(vec4 color) {
|
|
// 过滤多余的 shader 计算
|
|
// return color;
|
|
if(u_shaderPick < 0.5) {
|
|
return color; // 暂时去除 直接取消计算在选中时拖拽地图会有问题
|
|
} else {
|
|
return filterPickingColor(filterHighlightColor(color, 1.0));
|
|
}
|
|
|
|
}
|
|
|
|
vec4 filterColorAlpha(vec4 color, float alpha) {
|
|
// 过滤多余的 shader 计算
|
|
// return color;
|
|
if(u_shaderPick < 0.5) {
|
|
return color; // 暂时去除 直接取消计算在选中时拖拽地图会有问题
|
|
} else {
|
|
return filterPickingColor(filterHighlightColor(color, alpha));
|
|
}
|
|
}
|
|
|
|
`,Pse=`layout(location = 3) in vec3 a_PickingColor;
|
|
out vec4 v_PickingResult;
|
|
|
|
#pragma include "picking_uniforms"
|
|
|
|
#define PICKING_NONE 0.0
|
|
#define PICKING_ENCODE 1.0
|
|
#define PICKING_HIGHLIGHT 2.0
|
|
#define COLOR_SCALE 1. / 255.
|
|
|
|
#define NORMAL 0.0
|
|
#define HIGHLIGHT 1.0
|
|
#define SELECT 2.0
|
|
|
|
bool isVertexPicked(vec3 vertexColor) {
|
|
return distance(vertexColor,u_PickingColor.rgb) < 0.01;
|
|
}
|
|
|
|
// 判断当前点是否已经被 select 选中
|
|
bool isVertexSelected(vec3 vertexColor) {
|
|
return distance(vertexColor,u_CurrentSelectedId.rgb) < 0.01;
|
|
}
|
|
|
|
void setPickingColor(vec3 pickingColor) {
|
|
if(u_shaderPick < 0.5) {
|
|
return;
|
|
}
|
|
// compares only in highlight stage
|
|
|
|
v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && isVertexPicked(pickingColor));
|
|
|
|
// Stores the picking color so that the fragment shader can render it during picking
|
|
v_PickingResult.rgb = pickingColor * COLOR_SCALE;
|
|
}
|
|
|
|
float setPickingSize(float x) {
|
|
return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;
|
|
}
|
|
|
|
float setPickingOrder(float z) {
|
|
bool selected = bool(v_PickingResult.a);
|
|
return selected ? z + 1. : 0.;
|
|
}
|
|
`,Ose=`
|
|
#define E 2.718281828459045
|
|
vec2 ProjectFlat(vec2 lnglat){
|
|
float maxs=85.0511287798;
|
|
float lat=max(min(maxs,lnglat.y),-maxs);
|
|
float scale= 268435456.;
|
|
float d=PI/180.;
|
|
float x=lnglat.x*d;
|
|
float y=lat*d;
|
|
y=log(tan((PI/4.)+(y/2.)));
|
|
|
|
float a=.5/PI,
|
|
b=.5,
|
|
c=-.5/PI;
|
|
d=.5;
|
|
x=scale*(a*x+b);
|
|
y=scale*(c*y+d);
|
|
return vec2(x,y);
|
|
}
|
|
|
|
vec2 unProjectFlat(vec2 px){
|
|
float a=.5/PI;
|
|
float b=.5;
|
|
float c=-.5/PI;
|
|
float d=.5;
|
|
float scale = 268435456.;
|
|
float x=(px.x/scale-b)/a;
|
|
float y=(px.y/scale-d)/c;
|
|
y=(atan(pow(E,y))-(PI/4.))*2.;
|
|
d=PI/180.;
|
|
float lat=y/d;
|
|
float lng=x/d;
|
|
return vec2(lng,lat);
|
|
}
|
|
|
|
float pixelDistance(vec2 from, vec2 to) {
|
|
vec2 a1 = ProjectFlat(from);
|
|
vec2 b1 = ProjectFlat(to);
|
|
return distance(a1, b1);
|
|
}
|
|
|
|
// gaode2.0
|
|
vec2 customProject(vec2 lnglat) { // 经纬度 => 平面坐标
|
|
float t = lnglat.x;
|
|
float e = lnglat.y;
|
|
float Sm = 180.0 / PI;
|
|
float Tm = 6378137.0;
|
|
float Rm = PI / 180.0;
|
|
float r = 85.0511287798;
|
|
e = max(min(r, e), -r);
|
|
t *= Rm;
|
|
e *= Rm;
|
|
e = log(tan(PI / 4.0 + e / 2.0));
|
|
return vec2(t * Tm, e * Tm);
|
|
}
|
|
|
|
vec2 unProjCustomCoord(vec2 point) { // 平面坐标 => 经纬度
|
|
float Sm = 57.29577951308232; //180 / Math.PI
|
|
float Tm = 6378137.0;
|
|
float t = point.x;
|
|
float e = point.y;
|
|
return vec2(t / Tm * Sm, (2.0 * atan(exp(e / Tm)) - PI / 2.0) * Sm);
|
|
}
|
|
|
|
|
|
float customPixelDistance(vec2 from, vec2 to) {
|
|
vec2 a1 = ProjectFlat(from);
|
|
vec2 b1 = ProjectFlat(to);
|
|
return distance(a1, b1);
|
|
}`,jS=`#define TILE_SIZE 512.0
|
|
#define PI 3.1415926536
|
|
#define WORLD_SCALE TILE_SIZE / (PI * 2.0)
|
|
#define EARTH_CIRCUMFERENCE 40.03e6
|
|
|
|
#define COORDINATE_SYSTEM_LNGLAT 1.0 // mapbox
|
|
#define COORDINATE_SYSTEM_LNGLAT_OFFSET 2.0 // mapbox offset
|
|
#define COORDINATE_SYSTEM_VECTOR_TILE 3.0
|
|
#define COORDINATE_SYSTEM_IDENTITY 4.0
|
|
#define COORDINATE_SYSTEM_P20 5.0 // amap
|
|
#define COORDINATE_SYSTEM_P20_OFFSET 6.0 // amap offset
|
|
#define COORDINATE_SYSTEM_METER_OFFSET 7.0
|
|
|
|
#define COORDINATE_SYSTEM_P20_2 8.0 // amap2.0
|
|
#pragma include "scene_uniforms"
|
|
|
|
|
|
// web mercator coords -> world coords
|
|
vec2 project_mercator(vec2 lnglat) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.0
|
|
return lnglat;
|
|
}
|
|
float x = lnglat.x;
|
|
return vec2(
|
|
radians(x) + PI,
|
|
PI - log(tan(PI * 0.25 + radians(lnglat.y) * 0.5))
|
|
);
|
|
}
|
|
|
|
float project_scale(float meters) {
|
|
return meters * u_PixelsPerMeter.z;
|
|
}
|
|
|
|
|
|
// offset coords -> world coords
|
|
vec4 project_offset(vec4 offset) {
|
|
float dy = offset.y;
|
|
dy = clamp(dy, -1., 1.);
|
|
vec3 pixels_per_unit = u_PixelsPerDegree + u_PixelsPerDegree2 * dy;
|
|
return vec4(offset.xyz * pixels_per_unit, offset.w);
|
|
}
|
|
|
|
vec3 project_normal(vec3 normal) {
|
|
vec4 normal_modelspace = u_ModelMatrix * vec4(normal, 0.0);
|
|
return normalize(normal_modelspace.xyz * u_PixelsPerMeter);
|
|
}
|
|
|
|
vec3 project_offset_normal(vec3 vector) {
|
|
if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01
|
|
|| u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// normals generated by the polygon tesselator are in lnglat offsets instead of meters
|
|
return normalize(vector * u_PixelsPerDegree);
|
|
}
|
|
return project_normal(vector);
|
|
}
|
|
// || u_CoordinateSystem < COORDINATE_SYSTEM_P20_OFFSET + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_P20_OFFSET - 0.01
|
|
// reverse Y
|
|
vec3 reverse_offset_normal(vec3 vector) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 ||u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET ) {
|
|
return vector * vec3(1.0, -1.0, 1.0);
|
|
}
|
|
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.0
|
|
return vector;
|
|
}
|
|
return vector;
|
|
}
|
|
|
|
vec4 project_mvt_offset_position(vec4 position) {
|
|
float a = COORDINATE_SYSTEM_LNGLAT_OFFSET;
|
|
float b = COORDINATE_SYSTEM_P20_OFFSET;
|
|
float c = COORDINATE_SYSTEM_LNGLAT;
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
return project_offset(vec4(0.0, 0.0, position.z, position.w));
|
|
}
|
|
if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01) {
|
|
return vec4(
|
|
project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale,
|
|
project_scale(position.z),
|
|
position.w
|
|
);
|
|
}
|
|
return position;
|
|
}
|
|
|
|
vec4 project_position(vec4 position) {
|
|
float a = COORDINATE_SYSTEM_LNGLAT_OFFSET;
|
|
float b = COORDINATE_SYSTEM_P20_OFFSET;
|
|
float c = COORDINATE_SYSTEM_LNGLAT;
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET
|
|
|| u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
float X = position.x - u_ViewportCenter.x;
|
|
float Y = position.y - u_ViewportCenter.y;
|
|
return project_offset(vec4(X, Y, position.z, position.w));
|
|
}
|
|
if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01) {
|
|
return vec4(
|
|
project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale,
|
|
project_scale(position.z),
|
|
position.w
|
|
);
|
|
}
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20) {
|
|
return vec4(
|
|
(project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale - vec2(215440491., 106744817.)) * vec2(1., -1.),
|
|
project_scale(position.z),
|
|
position.w
|
|
);
|
|
}
|
|
|
|
// if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
|
|
|
|
// return vec4(
|
|
// position.xy,
|
|
// project_scale(position.z),
|
|
// position.w);
|
|
// }
|
|
return position;
|
|
|
|
// TODO: 瓦片坐标系 & 常规世界坐标系
|
|
}
|
|
vec2 project_pixel_size_to_clipspace(vec2 pixels) {
|
|
vec2 offset = pixels / u_ViewportSize * u_DevicePixelRatio * 2.0;
|
|
return offset * u_FocalDistance;
|
|
}
|
|
|
|
|
|
|
|
float project_pixel_allmap(float pixel) {
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {
|
|
return pixel * pow(2.0, u_Zoom);
|
|
}
|
|
return pixel * u_FocalDistance ;
|
|
}
|
|
|
|
// 适配纹理贴图的等像素大小
|
|
float project_pixel_texture(float pixel) {
|
|
// mapbox zoom > 12
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
return pixel * pow(0.5, u_Zoom) * u_FocalDistance ;
|
|
}
|
|
|
|
// amap2 zoom > 12
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom))* u_FocalDistance ;
|
|
}
|
|
|
|
// amap zoom > 12
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
return pixel * pow(0.5, u_Zoom)* u_FocalDistance ;
|
|
}
|
|
|
|
// amap zoom < 12
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20) {
|
|
return pixel * pow(2.0, (20.0 - u_Zoom))* u_FocalDistance ;
|
|
}
|
|
return pixel * 2.0 * u_FocalDistance;;
|
|
}
|
|
|
|
// 在不论什么底图下需要统一处理的时候使用
|
|
float project_float_pixel(float pixel) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// mapbox P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1
|
|
return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;
|
|
}
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
// amap P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1
|
|
return pixel * pow(2.0, (19.0 - u_Zoom));
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// amap2 P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3
|
|
return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom))* u_FocalDistance ;
|
|
}
|
|
return pixel * u_FocalDistance;
|
|
}
|
|
|
|
// Project meter into the unit of pixel which used in the camera world space
|
|
float project_float_meter(float meter) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// Since the zoom level uniform is updated by mapservice and it's alread been subtracted by 1
|
|
// Not sure if we are supposed to do that again
|
|
return meter;
|
|
} else {
|
|
return project_float_pixel(meter);
|
|
}
|
|
|
|
// TODO: change the following code to make adaptations for amap
|
|
// return u_FocalDistance * TILE_SIZE * pow(2.0, u_Zoom) * meter / EARTH_CIRCUMFERENCE;
|
|
}
|
|
|
|
float project_pixel(float pixel) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
// amap P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1
|
|
return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// amap2 P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3
|
|
return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom)) * u_FocalDistance ;
|
|
}
|
|
return pixel * u_FocalDistance;
|
|
}
|
|
vec2 project_pixel(vec2 pixel) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
// P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1
|
|
return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3
|
|
return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom)) * u_FocalDistance ;
|
|
}
|
|
return pixel * -1. * u_FocalDistance;
|
|
}
|
|
vec3 project_pixel(vec3 pixel) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
// P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1
|
|
return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3
|
|
return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom)) * u_FocalDistance ;
|
|
}
|
|
return pixel * -1. * u_FocalDistance;
|
|
}
|
|
|
|
vec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET ||
|
|
u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// Needs to be divided with project_uCommonUnitsPerMeter
|
|
position.w *= u_PixelsPerMeter.z;
|
|
}
|
|
|
|
return viewProjectionMatrix * position + center;
|
|
}
|
|
|
|
// Projects from common space coordinates to clip space
|
|
vec4 project_common_position_to_clipspace(vec4 position) {
|
|
return project_common_position_to_clipspace(
|
|
position,
|
|
u_ViewProjectionMatrix,
|
|
u_ViewportCenterProjection
|
|
);
|
|
}
|
|
|
|
vec4 unproject_clipspace_to_position(vec4 clipspacePos, mat4 u_InverseViewProjectionMatrix) {
|
|
vec4 pos = u_InverseViewProjectionMatrix * (clipspacePos - u_ViewportCenterProjection);
|
|
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET ||
|
|
u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// Needs to be divided with project_uCommonUnitsPerMeter
|
|
pos.w = pos.w / u_PixelsPerMeter.z;
|
|
}
|
|
return pos;
|
|
}
|
|
|
|
|
|
bool isEqual( float a, float b) {
|
|
return a< b + 0.001 && a > b - 0.001;
|
|
}
|
|
|
|
// 支持 GaodeV2、Mapbox
|
|
vec4 project_common_position_to_clipspace_v2(vec4 position) {
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
return u_Mvp * position;
|
|
} else {
|
|
return project_common_position_to_clipspace(position);
|
|
}
|
|
}
|
|
`,kse=`vec2 rotate_matrix(vec2 v, float a) {
|
|
float b = a / 180.0 * 3.1415926535897932384626433832795;
|
|
float s = sin(b);
|
|
float c = cos(b);
|
|
mat2 m = mat2(c, s, -s, c);
|
|
return m * v;
|
|
}`,Dse=`/**
|
|
* 2D signed distance field functions
|
|
* @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm
|
|
*/
|
|
|
|
float ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }
|
|
|
|
float sdCircle(vec2 p, float r) {
|
|
return length(p) - r;
|
|
}
|
|
|
|
float sdEquilateralTriangle(vec2 p) {
|
|
float k = sqrt(3.0);
|
|
p.x = abs(p.x) - 1.0;
|
|
p.y = p.y + 1.0/k;
|
|
if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;
|
|
p.x -= clamp( p.x, -2.0, 0.0 );
|
|
return -length(p)*sign(p.y);
|
|
}
|
|
|
|
float sdBox(vec2 p, vec2 b) {
|
|
vec2 d = abs(p)-b;
|
|
return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);
|
|
}
|
|
|
|
float sdPentagon(vec2 p, float r) {
|
|
vec3 k = vec3(0.809016994,0.587785252,0.726542528);
|
|
p.x = abs(p.x);
|
|
p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);
|
|
p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);
|
|
p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);
|
|
return length(p)*sign(p.y);
|
|
}
|
|
|
|
float sdHexagon(vec2 p, float r) {
|
|
vec3 k = vec3(-0.866025404,0.5,0.577350269);
|
|
p = abs(p);
|
|
p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
|
|
p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);
|
|
return length(p)*sign(p.y);
|
|
}
|
|
|
|
float sdOctogon(vec2 p, float r) {
|
|
vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );
|
|
p = abs(p);
|
|
p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);
|
|
p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);
|
|
p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);
|
|
return length(p)*sign(p.y);
|
|
}
|
|
|
|
float sdHexagram(vec2 p, float r) {
|
|
vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);
|
|
p = abs(p);
|
|
p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
|
|
p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;
|
|
p -= vec2(clamp(p.x,r*k.z,r*k.w),r);
|
|
return length(p)*sign(p.y);
|
|
}
|
|
|
|
float sdRhombus(vec2 p, vec2 b) {
|
|
vec2 q = abs(p);
|
|
float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);
|
|
float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );
|
|
return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );
|
|
}
|
|
|
|
float sdVesica(vec2 p, float r, float d) {
|
|
p = abs(p);
|
|
float b = sqrt(r*r-d*d); // can delay this sqrt
|
|
return ((p.y-b)*d>p.x*b)
|
|
? length(p-vec2(0.0,b))
|
|
: length(p-vec2(-d,0.0))-r;
|
|
}
|
|
`,HS=/precision\s+(high|low|medium)p\s+float/,GS=`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
precision highp float;
|
|
#else
|
|
precision mediump float;
|
|
#endif
|
|
`,Fse=/#pragma include (["^+"]?["[a-zA-Z_0-9](.*)"]*?)/g,Bse=/void\s+main\s*\([^)]*\)\s*\{\n?/,Lse=(NS=ai(),NS(US=function(){function e(){Ht(this,e),F(this,"moduleCache",{}),F(this,"rawContentCache",{})}return jt(e,[{key:"registerBuiltinModules",value:function(){this.destroy(),this.registerModule("common",{vs:zS,fs:zS}),this.registerModule("decode",{vs:Cse,fs:""}),this.registerModule("scene_uniforms",{vs:$S,fs:$S}),this.registerModule("picking_uniforms",{vs:VS,fs:VS}),this.registerModule("projection",{vs:jS,fs:jS}),this.registerModule("project",{vs:Ose,fs:""}),this.registerModule("sdf_2d",{vs:"",fs:Dse}),this.registerModule("lighting",{vs:Ise,fs:""}),this.registerModule("light",{vs:Rse,fs:""}),this.registerModule("picking",{vs:Pse,fs:Mse}),this.registerModule("rotation_2d",{vs:kse,fs:""})}},{key:"registerModule",value:function(r,n){n.vs=n.vs.replace(/\r\n/g,`
|
|
`),n.fs=n.fs.replace(/\r\n/g,`
|
|
`);var i=n.vs,o=n.fs,a=n.uniforms,u=n.inject,c=j3(i),f=c.content,m=c.uniforms,_=j3(o),b=_.content,A=_.uniforms;this.rawContentCache[r]={fs:b,inject:u,uniforms:Qe(Qe(Qe({},m),A),a),vs:f}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(r){var n=this,i=this.rawContentCache[r].vs,o=this.rawContentCache[r].fs,a=this.rawContentCache[r].inject,u={};a!=null&&a["vs:#decl"]&&(i=(a==null?void 0:a["vs:#decl"])+i,u=j3(a==null?void 0:a["vs:#decl"]).uniforms),a!=null&&a["vs:#main-start"]&&(i=i.replace(Bse,function(k){return k+(a==null?void 0:a["vs:#main-start"])})),a!=null&&a["fs:#decl"]&&(o=(a==null?void 0:a["fs:#decl"])+o);var c=this.processModule(i,[],"vs"),f=c.content,m=c.includeList,_=this.processModule(o,[],"fs"),b=_.content,A=_.includeList,w="",R=wse(m.concat(A).concat(r)).reduce(function(k,L){return Qe(Qe({},k),n.rawContentCache[L].uniforms)},Qe({},u));HS.test(b)||(w=w+GS),w=w+b;var P="";return HS.test(f)||(P=P+GS),P=P+f,this.moduleCache[r]={fs:w.trim(),uniforms:R,vs:P.trim()},this.moduleCache[r]}},{key:"processModule",value:function(r,n,i){var o=this,a=r.replace(Fse,function(u,c){var f=c.split(" "),m=f[0].replace(/"/g,"");if(n.indexOf(m)>-1)return"";var _=o.rawContentCache[m][i];n.push(m);var b=o.processModule(_,n,i),A=b.content;return A});return{content:a,includeList:n}}},{key:"injectDefines",value:function(r){var n=Object.keys(r).reduce(function(i,o){return i+"#define ".concat(o.toUpperCase()," ").concat(r[o],`;
|
|
`)},`
|
|
`);return n}}]),e}())||US);function Nse(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Bt(e),e!==null););return e}function gp(){return typeof Reflect<"u"&&Reflect.get?gp=Reflect.get.bind():gp=function(t,r,n){var i=Nse(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},gp.apply(this,arguments)}var M0=function(e){return e.Normal="normal",e.PostProcessing="post-processing",e}({}),WS,XS,vy=(WS=ai(),WS(XS=function(){function e(){Ht(this,e),F(this,"shaderModuleService",void 0),F(this,"rendererService",void 0),F(this,"cameraService",void 0),F(this,"mapService",void 0),F(this,"interactionService",void 0),F(this,"layerService",void 0),F(this,"config",void 0)}return jt(e,[{key:"getName",value:function(){return""}},{key:"getType",value:function(){return M0.Normal}},{key:"init",value:function(r,n){this.config=n,this.rendererService=r.getContainer().get(wt.IRendererService),this.cameraService=r.getContainer().get(wt.ICameraService),this.mapService=r.getContainer().get(wt.IMapService),this.interactionService=r.getContainer().get(wt.IInteractionService),this.layerService=r.getContainer().get(wt.ILayerService),this.shaderModuleService=r.getContainer().get(wt.IShaderModuleService)}},{key:"render",value:function(r){}}]),e}())||XS),YS,ZS;function Use(e){var t=zse();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function zse(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var $se=(YS=ai(),YS(ZS=function(e){_n(r,e);var t=Use(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getName",value:function(){return"clear"}},{key:"init",value:function(i,o){gp(Bt(r.prototype),"init",this).call(this,i,o)}},{key:"render",value:function(){this.rendererService.clear({color:[0,0,0,0],depth:1,framebuffer:null})}}]),r}(vy))||ZS),qS,KS,QS,H3,JS;function Vse(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=jse(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function jse(e,t){if(e){if(typeof e=="string")return eA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eA(e,t)}}function eA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Hse=(qS=ai(),KS=ki(wt.IPostProcessor),qS(QS=(H3=function(){function e(){Ht(this,e),F(this,"passes",[]),bi(this,"postProcessor",JS,this),F(this,"layer",void 0),F(this,"renderFlag",void 0),F(this,"width",0),F(this,"height",0)}return jt(e,[{key:"setLayer",value:function(r){this.layer=r}},{key:"setRenderFlag",value:function(r){this.renderFlag=r}},{key:"getRenderFlag",value:function(){return this.renderFlag}},{key:"getPostProcessor",value:function(){return this.postProcessor}},{key:"render",value:function(){var t=Mt(he.mark(function n(){var i,o,a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:i=Vse(this.passes),c.prev=1,i.s();case 3:if((o=i.n()).done){c.next=9;break}return a=o.value,c.next=7,a.render(this.layer);case 7:c.next=3;break;case 9:c.next=14;break;case 11:c.prev=11,c.t0=c.catch(1),i.e(c.t0);case 14:return c.prev=14,i.f(),c.finish(14);case 17:return c.next=19,this.postProcessor.render(this.layer);case 19:case"end":return c.stop()}},n,this,[[1,11,14,17]])}));function r(){return t.apply(this,arguments)}return r}()},{key:"resize",value:function(r,n){(this.width!==r||this.height!==n)&&(this.postProcessor.resize(r,n),this.width=r,this.height=n)}},{key:"add",value:function(r,n){r.getType()===M0.PostProcessing?this.postProcessor.add(r,this.layer,n):(r.init(this.layer,n),this.passes.push(r))}},{key:"insert",value:function(r,n,i){r.init(this.layer,n),this.passes.splice(i,0,r)}},{key:"destroy",value:function(){this.passes.length=0}}]),e}(),JS=mi(H3.prototype,"postProcessor",[KS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),H3))||QS),tA,rA;function Gse(e){var t=Wse();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Wse(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Xse=(tA=ai(),tA(rA=function(e){_n(r,e);var t=Gse(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"pickingFBO",void 0),F($e(n),"layer",void 0),F($e(n),"width",0),F($e(n),"height",0),F($e(n),"alreadyInRendering",!1),F($e(n),"pickFromPickingFBO",function(u){var c=u.x,f=u.y,m=u.lngLat,_=u.type;if(!(!n.layer.isVisible()||!n.layer.needPick(_))){var b=n.rendererService,A=b.getViewportSize,w=b.readPixelsAsync,R=b.useFramebuffer,P=A(),k=P.width,L=P.height,B=n.layer.getLayerConfig(),V=B.enableHighlight,G=B.enableSelect,K=c*ul,Z=f*ul;if(!(K>k||K<0||Z>L||Z<0)){var ve;R(n.pickingFBO,Mt(he.mark(function Ie(){var de,se,le,ye,ke;return he.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:return Lt.next=2,w({x:Math.round(K),y:Math.round(L-(f+1)*ul),width:1,height:1,data:new Uint8Array(1*1*4),framebuffer:n.pickingFBO});case 2:ve=Lt.sent,ve[0]!==0||ve[1]!==0||ve[2]!==0?(se=x1(ve),le=n.layer.getSource().getFeatureById(se),ye={x:c,y:f,type:_,lngLat:m,featureId:se,feature:le},le&&(n.layer.setCurrentPickId(se),n.triggerHoverOnLayer(ye))):(ke={x:c,y:f,lngLat:m,type:n.layer.getCurrentPickId()===null?"un"+_:"mouseout",featureId:null,feature:null},n.triggerHoverOnLayer(Qe(Qe({},ke),{},{type:"unpick"})),n.triggerHoverOnLayer(ke),n.layer.setCurrentPickId(null)),V&&n.highlightPickedFeature(ve),G&&_==="click"&&((de=ve)===null||de===void 0?void 0:de.toString())!==[0,0,0,0].toString()&&n.selectFeature(ve);case 6:case"end":return Lt.stop()}},Ie)})))}}}),n}return jt(r,[{key:"getType",value:function(){return M0.Normal}},{key:"getName",value:function(){return"pixelPicking"}},{key:"init",value:function(i,o){gp(Bt(r.prototype),"init",this).call(this,i,o),this.layer=i;var a=this.rendererService,u=a.createTexture2D,c=a.createFramebuffer,f=a.getViewportSize,m=f(),_=m.width,b=m.height,A=u({width:_,height:b,wrapS:W.CLAMP_TO_EDGE,wrapT:W.CLAMP_TO_EDGE,label:"Picking Texture"});this.pickingFBO=c({color:A}),this.interactionService.on(Bu.Hover,this.pickFromPickingFBO),this.interactionService.on(Bu.Select,this.selectFeatureHandle.bind(this)),this.interactionService.on(Bu.Active,this.highlightFeatureHandle.bind(this))}},{key:"render",value:function(i){var o=this;if(!this.alreadyInRendering){var a=this.rendererService,u=a.getViewportSize,c=a.useFramebuffer,f=a.clear,m=u(),_=m.width,b=m.height;this.alreadyInRendering=!0,(this.width!==_||this.height!==b)&&(this.pickingFBO.resize({width:_,height:b}),this.width=_,this.height=b),c(this.pickingFBO,function(){f({framebuffer:o.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});var A=o.layer.multiPassRenderer.getRenderFlag();o.layer.multiPassRenderer.setRenderFlag(!1),i.hooks.beforePickingEncode.call(),i.render(),i.hooks.afterPickingEncode.call(),o.layer.multiPassRenderer.setRenderFlag(A),o.alreadyInRendering=!1})}}},{key:"triggerHoverOnLayer",value:function(i){this.layer.emit(i.type,i)}},{key:"highlightPickedFeature",value:function(i){var o=Nn(i,3),a=o[0],u=o[1],c=o[2];this.layer.hooks.beforeHighlight.call([a,u,c]),this.layerService.renderLayers()}},{key:"selectFeature",value:function(i){var o=Nn(i,3),a=o[0],u=o[1],c=o[2];this.layer.hooks.beforeSelect.call([a,u,c]),this.layerService.renderLayers()}},{key:"selectFeatureHandle",value:function(i){var o=i.featureId,a=sh(o);this.selectFeature(new Uint8Array(a))}},{key:"highlightFeatureHandle",value:function(i){var o=i.featureId,a=sh(o);this.highlightPickedFeature(new Uint8Array(a))}}]),r}(vy))||rA),nA,iA,aA,G3,oA,Yse=Ci.camelCase,Zse=Ci.isNil,qse=Ci.upperFirst,Kse=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,fh=(nA=ai(),iA=ki(wt.IShaderModuleService),nA(aA=(G3=function(){function e(){Ht(this,e),bi(this,"shaderModuleService",oA,this),F(this,"rendererService",void 0),F(this,"config",void 0),F(this,"quad",Kse),F(this,"enabled",!0),F(this,"renderToScreen",!1),F(this,"model",void 0),F(this,"name",void 0),F(this,"optionsToUpdate",{})}return jt(e,[{key:"getName",value:function(){return this.name}},{key:"setName",value:function(r){this.name=r}},{key:"getType",value:function(){return M0.PostProcessing}},{key:"init",value:function(r,n){this.config=n,this.rendererService=r.getContainer().get(wt.IRendererService),this.shaderModuleService=r.getContainer().get(wt.IShaderModuleService);var i=this.rendererService,o=i.createAttribute,a=i.createBuffer,u=i.createModel,c=this.setupShaders(),f=c.vs,m=c.fs,_=c.uniforms;this.model=u({vs:f,fs:m,attributes:{a_Position:o({buffer:a({data:[-4,-4,4,-4,0,4],type:W.FLOAT}),size:2})},uniforms:Qe(Qe({u_Texture:null},_),this.config&&this.convertOptionsToUniforms(this.config)),depth:{enable:!1},count:3,blend:{enable:this.getName()==="copy"}})}},{key:"render",value:function(r,n){var i=this,o=r.multiPassRenderer.getPostProcessor(),a=this.rendererService,u=a.useFramebuffer,c=a.getViewportSize,f=a.clear,m=c(),_=m.width,b=m.height;u(this.renderToScreen?null:o.getWriteFBO(),function(){f({framebuffer:o.getWriteFBO(),color:[0,0,0,0],depth:1,stencil:0});var A=Qe({u_BloomFinal:0,u_Texture:o.getReadFBO(),u_ViewportSize:[_,b]},i.convertOptionsToUniforms(i.optionsToUpdate));n&&(A.u_BloomFinal=1,A.u_Texture2=n),i.model.draw({uniforms:A})})}},{key:"isEnabled",value:function(){return this.enabled}},{key:"setEnabled",value:function(r){this.enabled=r}},{key:"setRenderToScreen",value:function(r){this.renderToScreen=r}},{key:"updateOptions",value:function(r){this.optionsToUpdate=Qe(Qe({},this.optionsToUpdate),r)}},{key:"setupShaders",value:function(){throw new Error("Method not implemented.")}},{key:"convertOptionsToUniforms",value:function(r){var n={};return Object.keys(r).forEach(function(i){Zse(r[i])||(n["u_".concat(qse(Yse(i)))]=r[i])}),n}}]),e}(),oA=mi(G3.prototype,"shaderModuleService",[iA],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),G3))||aA),sA,uA;function Qse(e){var t=Jse();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Jse(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var eue=`varying vec2 v_UV;
|
|
|
|
uniform float u_BloomFinal: 0.0;
|
|
uniform sampler2D u_Texture;
|
|
uniform sampler2D u_Texture2;
|
|
|
|
uniform vec2 u_ViewportSize: [1.0, 1.0];
|
|
uniform float u_radius: 5.0;
|
|
uniform float u_intensity: 0.3;
|
|
uniform float u_baseRadio: 0.5;
|
|
|
|
// https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl
|
|
vec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {
|
|
vec4 color = vec4(0.0);
|
|
vec2 off1 = vec2(1.3846153846) * direction;
|
|
vec2 off2 = vec2(3.2307692308) * direction;
|
|
color += texture2D(image, uv) * 0.2270270270;
|
|
color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;
|
|
color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;
|
|
color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;
|
|
color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;
|
|
return color;
|
|
}
|
|
|
|
float luminance(vec4 color) {
|
|
return 0.2125 * color.r + 0.7154 * color.g + 0.0721 * color.b;
|
|
}
|
|
|
|
void main() {
|
|
// vec4 baseColor = texture2D(u_Texture, v_UV);
|
|
|
|
float r = sqrt(u_radius);
|
|
|
|
vec4 c1 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(u_radius, 0.0));
|
|
// c1 *= luminance(c1);
|
|
vec4 c2 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(0.0, u_radius));
|
|
// c2 *= luminance(c2);
|
|
vec4 c3 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(r, r));
|
|
// c3 *= luminance(c3);
|
|
vec4 c4 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(r, -r));
|
|
// c4 *= luminance(c4);
|
|
vec4 inbloomColor = (c1 + c2 + c3 + c4) * 0.25;
|
|
|
|
// float lum = luminance(inbloomColor);
|
|
// inbloomColor.rgb *= lum;
|
|
|
|
if(u_BloomFinal > 0.0) {
|
|
vec4 baseColor = texture2D(u_Texture2, v_UV);
|
|
float baselum = luminance(baseColor);
|
|
gl_FragColor = mix(inbloomColor, baseColor, u_baseRadio);
|
|
if(baselum <= 0.2) {
|
|
gl_FragColor = inbloomColor * u_intensity;
|
|
}
|
|
} else {
|
|
gl_FragColor = inbloomColor;
|
|
}
|
|
}`,tue=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,W3=Ci.isNil,rue=(sA=ai(),sA(uA=function(e){_n(r,e);var t=Qse(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("blur-pass",{vs:tue,fs:eue});var i=this.shaderModuleService.getModule("blur-pass"),o=i.vs,a=i.fs,u=i.uniforms,c=this.rendererService.getViewportSize(),f=c.width,m=c.height;return{vs:o,fs:a,uniforms:Qe(Qe({},u),{},{u_ViewportSize:[f,m]})}}},{key:"convertOptionsToUniforms",value:function(i){var o={};return W3(i.bloomRadius)||(o.u_radius=i.bloomRadius),W3(i.bloomIntensity)||(o.u_intensity=i.bloomIntensity),W3(i.bloomBaseRadio)||(o.u_baseRadio=i.bloomBaseRadio),o}}]),r}(fh))||uA),lA,cA;function nue(e){var t=iue();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function iue(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var aue=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
|
|
uniform vec2 u_ViewportSize: [1.0, 1.0];
|
|
uniform vec2 u_BlurDir: [1.0, 0.0];
|
|
|
|
// https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl
|
|
vec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {
|
|
vec4 color = vec4(0.0);
|
|
vec2 off1 = vec2(1.3846153846) * direction;
|
|
vec2 off2 = vec2(3.2307692308) * direction;
|
|
color += texture2D(image, uv) * 0.2270270270;
|
|
color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;
|
|
color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;
|
|
color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;
|
|
color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;
|
|
return color;
|
|
}
|
|
|
|
void main() {
|
|
gl_FragColor = blur9(u_Texture, v_UV, u_ViewportSize, u_BlurDir);
|
|
}`,oue=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,sue=Ci.isNil,uue=(lA=ai(),lA(cA=function(e){_n(r,e);var t=nue(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("blur-pass",{vs:oue,fs:aue});var i=this.shaderModuleService.getModule("blur-pass"),o=i.vs,a=i.fs,u=i.uniforms,c=this.rendererService.getViewportSize(),f=c.width,m=c.height;return{vs:o,fs:a,uniforms:Qe(Qe({},u),{},{u_ViewportSize:[f,m]})}}},{key:"convertOptionsToUniforms",value:function(i){var o={};return sue(i.blurRadius)||(o.u_BlurDir=[i.blurRadius,0]),o}}]),r}(fh))||cA),fA,hA;function lue(e){var t=cue();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function cue(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var fue=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
|
|
uniform vec2 u_ViewportSize: [1.0, 1.0];
|
|
uniform vec2 u_BlurDir: [1.0, 0.0];
|
|
|
|
// https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl
|
|
vec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {
|
|
vec4 color = vec4(0.0);
|
|
vec2 off1 = vec2(1.3846153846) * direction;
|
|
vec2 off2 = vec2(3.2307692308) * direction;
|
|
color += texture2D(image, uv) * 0.2270270270;
|
|
color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;
|
|
color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;
|
|
color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;
|
|
color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;
|
|
return color;
|
|
}
|
|
|
|
void main() {
|
|
gl_FragColor = blur9(u_Texture, v_UV, u_ViewportSize, u_BlurDir);
|
|
}`,hue=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,pue=Ci.isNil,due=(fA=ai(),fA(hA=function(e){_n(r,e);var t=lue(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("blur-pass",{vs:hue,fs:fue});var i=this.shaderModuleService.getModule("blur-pass"),o=i.vs,a=i.fs,u=i.uniforms,c=this.rendererService.getViewportSize(),f=c.width,m=c.height;return{vs:o,fs:a,uniforms:Qe(Qe({},u),{},{u_ViewportSize:[f,m]})}}},{key:"convertOptionsToUniforms",value:function(i){var o={};return pue(i.blurRadius)||(o.u_BlurDir=[0,i.blurRadius]),o}}]),r}(fh))||hA),pA,dA;function vue(e){var t=mue();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function mue(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var gue=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
uniform vec2 u_ViewportSize: [1.0, 1.0];
|
|
uniform vec2 u_Center : [0.5, 0.5];
|
|
uniform float u_Angle : 0;
|
|
uniform float u_Size : 8;
|
|
|
|
#pragma include "common"
|
|
|
|
float scale = PI / u_Size;
|
|
|
|
float pattern(float u_Angle, vec2 texSize, vec2 texCoord) {
|
|
float s = sin(u_Angle), c = cos(u_Angle);
|
|
vec2 tex = texCoord * texSize - u_Center * texSize;
|
|
vec2 point = vec2(
|
|
c * tex.x - s * tex.y,
|
|
s * tex.x + c * tex.y
|
|
) * scale;
|
|
return (sin(point.x) * sin(point.y)) * 4.0;
|
|
}
|
|
|
|
// https://github.com/evanw/glfx.js/blob/master/src/filters/fun/colorhalftone.js
|
|
vec4 colorHalftone_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
vec3 cmy = 1.0 - color.rgb;
|
|
float k = min(cmy.x, min(cmy.y, cmy.z));
|
|
cmy = (cmy - k) / (1.0 - k);
|
|
cmy = clamp(
|
|
cmy * 10.0 - 3.0 + vec3(
|
|
pattern(u_Angle + 0.26179, texSize, texCoord),
|
|
pattern(u_Angle + 1.30899, texSize, texCoord),
|
|
pattern(u_Angle, texSize, texCoord)
|
|
),
|
|
0.0,
|
|
1.0
|
|
);
|
|
k = clamp(k * 10.0 - 5.0 + pattern(u_Angle + 0.78539, texSize, texCoord), 0.0, 1.0);
|
|
return vec4(1.0 - cmy - k, color.a);
|
|
}
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
gl_FragColor = colorHalftone_filterColor(gl_FragColor, u_ViewportSize, v_UV);
|
|
}`,_ue=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,yue=(pA=ai(),pA(dA=function(e){_n(r,e);var t=vue(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("colorhalftone-pass",{vs:_ue,fs:gue});var i=this.shaderModuleService.getModule("colorhalftone-pass"),o=i.vs,a=i.fs,u=i.uniforms,c=this.rendererService.getViewportSize(),f=c.width,m=c.height;return{vs:o,fs:a,uniforms:Qe(Qe({},u),{},{u_ViewportSize:[f,m]})}}}]),r}(fh))||dA),vA,mA;function xue(e){var t=bue();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function bue(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Eue=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
}`,Sue=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,Aue=(vA=ai(),vA(mA=function(e){_n(r,e);var t=xue(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"setupShaders",value:function(){return this.shaderModuleService.registerModule("copy-pass",{vs:Sue,fs:Eue}),this.shaderModuleService.getModule("copy-pass")}}]),r}(fh))||mA),gA,_A;function Tue(e){var t=wue();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function wue(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Cue=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
uniform vec2 u_ViewportSize: [1.0, 1.0];
|
|
uniform vec2 u_Center : [0.5, 0.5];
|
|
uniform float u_Scale : 10;
|
|
|
|
// https://github.com/evanw/glfx.js/blob/master/src/filters/fun/hexagonalpixelate.js
|
|
vec4 hexagonalPixelate_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
vec2 tex = (texCoord * texSize - u_Center * texSize) / u_Scale;
|
|
tex.y /= 0.866025404;
|
|
tex.x -= tex.y * 0.5;
|
|
vec2 a;
|
|
if (tex.x + tex.y - floor(tex.x) - floor(tex.y) < 1.0) {
|
|
a = vec2(floor(tex.x), floor(tex.y));
|
|
}
|
|
else a = vec2(ceil(tex.x), ceil(tex.y));
|
|
vec2 b = vec2(ceil(tex.x), floor(tex.y));
|
|
vec2 c = vec2(floor(tex.x), ceil(tex.y));
|
|
vec3 TEX = vec3(tex.x, tex.y, 1.0 - tex.x - tex.y);
|
|
vec3 A = vec3(a.x, a.y, 1.0 - a.x - a.y);
|
|
vec3 B = vec3(b.x, b.y, 1.0 - b.x - b.y);
|
|
vec3 C = vec3(c.x, c.y, 1.0 - c.x - c.y);
|
|
float alen = length(TEX - A);
|
|
float blen = length(TEX - B);
|
|
float clen = length(TEX - C);
|
|
vec2 choice;
|
|
if (alen < blen) {
|
|
if (alen < clen) choice = a;
|
|
else choice = c;
|
|
} else {
|
|
if (blen < clen) choice = b;
|
|
else choice = c;
|
|
}
|
|
choice.x += choice.y * 0.5;
|
|
choice.y *= 0.866025404;
|
|
choice *= u_Scale / texSize;
|
|
return texture2D(texture, choice + u_Center);
|
|
}
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
gl_FragColor = hexagonalPixelate_sampleColor(u_Texture, u_ViewportSize, v_UV);
|
|
}`,Rue=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,Iue=(gA=ai(),gA(_A=function(e){_n(r,e);var t=Tue(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("hexagonalpixelate-pass",{vs:Rue,fs:Cue});var i=this.shaderModuleService.getModule("hexagonalpixelate-pass"),o=i.vs,a=i.fs,u=i.uniforms,c=this.rendererService.getViewportSize(),f=c.width,m=c.height;return{vs:o,fs:a,uniforms:Qe(Qe({},u),{},{u_ViewportSize:[f,m]})}}}]),r}(fh))||_A),yA,xA;function Mue(e){var t=Pue();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Pue(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Oue=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
uniform vec2 u_ViewportSize: [1.0, 1.0];
|
|
uniform float u_Strength : 0.6;
|
|
|
|
vec4 ink_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
vec2 dx = vec2(1.0 / texSize.x, 0.0);
|
|
vec2 dy = vec2(0.0, 1.0 / texSize.y);
|
|
vec4 color = texture2D(texture, texCoord);
|
|
float bigTotal = 0.0;
|
|
float smallTotal = 0.0;
|
|
vec3 bigAverage = vec3(0.0);
|
|
vec3 smallAverage = vec3(0.0);
|
|
for (float x = -2.0; x <= 2.0; x += 1.0) {
|
|
for (float y = -2.0; y <= 2.0; y += 1.0) {
|
|
vec3 sample = texture2D(texture, texCoord + dx * x + dy * y).rgb;
|
|
bigAverage += sample;
|
|
bigTotal += 1.0;
|
|
if (abs(x) + abs(y) < 2.0) {
|
|
smallAverage += sample;
|
|
smallTotal += 1.0;
|
|
}
|
|
}
|
|
}
|
|
vec3 edge = max(vec3(0.0), bigAverage / bigTotal - smallAverage / smallTotal);
|
|
float power = u_Strength * u_Strength * u_Strength * u_Strength * u_Strength;
|
|
return vec4(color.rgb - dot(edge, edge) * power * 100000.0, color.a);
|
|
}
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
gl_FragColor = ink_sampleColor(u_Texture, u_ViewportSize, v_UV);
|
|
}`,kue=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,Due=(yA=ai(),yA(xA=function(e){_n(r,e);var t=Mue(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("ink-pass",{vs:kue,fs:Oue});var i=this.shaderModuleService.getModule("ink-pass"),o=i.vs,a=i.fs,u=i.uniforms,c=this.rendererService.getViewportSize(),f=c.width,m=c.height;return{vs:o,fs:a,uniforms:Qe(Qe({},u),{},{u_ViewportSize:[f,m]})}}}]),r}(fh))||xA),bA,EA;function Fue(e){var t=Bue();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Bue(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Lue=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
uniform float u_Amount : 0.5;
|
|
|
|
float rand(vec2 co) {
|
|
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
|
|
}
|
|
|
|
// https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js
|
|
vec4 noise_filterColor(vec4 color, vec2 texCoord) {
|
|
float diff = (rand(texCoord) - 0.5) * u_Amount;
|
|
color.r += diff;
|
|
color.g += diff;
|
|
color.b += diff;
|
|
return color;
|
|
}
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
gl_FragColor = noise_filterColor(gl_FragColor, v_UV);
|
|
}`,Nue=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,Uue=(bA=ai(),bA(EA=function(e){_n(r,e);var t=Fue(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"setupShaders",value:function(){return this.shaderModuleService.registerModule("noise-pass",{vs:Nue,fs:Lue}),this.shaderModuleService.getModule("noise-pass")}}]),r}(fh))||EA),SA,AA;function zue(e){var t=$ue();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function $ue(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Vue=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,jue=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
|
|
uniform float u_Amount : 0.5;
|
|
|
|
// https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/sepia.js
|
|
vec4 sepia_filterColor(vec4 color) {
|
|
float r = color.r;
|
|
float g = color.g;
|
|
float b = color.b;
|
|
color.r =
|
|
min(1.0, (r * (1.0 - (0.607 * u_Amount))) + (g * (0.769 * u_Amount)) + (b * (0.189 * u_Amount)));
|
|
color.g = min(1.0, (r * 0.349 * u_Amount) + (g * (1.0 - (0.314 * u_Amount))) + (b * 0.168 * u_Amount));
|
|
color.b = min(1.0, (r * 0.272 * u_Amount) + (g * 0.534 * u_Amount) + (b * (1.0 - (0.869 * u_Amount))));
|
|
return color;
|
|
}
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
gl_FragColor = sepia_filterColor(gl_FragColor);
|
|
}`,Hue=(SA=ai(),SA(AA=function(e){_n(r,e);var t=zue(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"setupShaders",value:function(){return this.shaderModuleService.registerModule("sepia-pass",{vs:Vue,fs:jue}),this.shaderModuleService.getModule("sepia-pass")}}]),r}(fh))||AA),TA,wA,CA,RA,Sd,IA,Gue=(TA=ai(),wA=ki(wt.IRendererService),CA=yae(),TA(RA=(Sd=function(){function e(){Ht(this,e),bi(this,"rendererService",IA,this),F(this,"passes",[]),F(this,"readFBO",void 0),F(this,"writeFBO",void 0)}return jt(e,[{key:"getReadFBO",value:function(){return this.readFBO}},{key:"getWriteFBO",value:function(){return this.writeFBO}},{key:"getCurrentFBOTex",value:function(){var r=this.rendererService,n=r.getViewportSize,i=r.createTexture2D,o=n(),a=o.width,u=o.height;return i({x:0,y:0,width:a,height:u,copy:!0})}},{key:"getReadFBOTex",value:function(){var r=this,n=this.rendererService.useFramebuffer;return new Promise(function(i){n(r.readFBO,Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:i(r.getCurrentFBOTex());case 1:case"end":return u.stop()}},o)})))})}},{key:"renderBloomPass",value:function(){var t=Mt(he.mark(function n(i,o){var a,u;return he.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.getReadFBOTex();case 2:a=f.sent,u=0;case 4:if(!(u<4)){f.next=11;break}return f.next=7,o.render(i,a);case 7:this.swap(),u++,f.next=4;break;case 11:case"end":return f.stop()}},n,this)}));function r(n,i){return t.apply(this,arguments)}return r}()},{key:"render",value:function(){var t=Mt(he.mark(function n(i){var o,a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:o=0;case 1:if(!(o<this.passes.length)){c.next=15;break}if(a=this.passes[o],a.setRenderToScreen(this.isLastEnabledPass(o)),a.getName()!=="bloom"){c.next=9;break}return c.next=7,this.renderBloomPass(i,a);case 7:c.next=12;break;case 9:return c.next=11,a.render(i);case 11:o!==this.passes.length-1&&this.swap();case 12:o++,c.next=1;break;case 15:case"end":return c.stop()}},n,this)}));function r(n){return t.apply(this,arguments)}return r}()},{key:"resize",value:function(r,n){this.readFBO.resize({width:r,height:n}),this.writeFBO.resize({width:r,height:n})}},{key:"add",value:function(r,n,i){r.init(n,i),this.passes.push(r)}},{key:"insert",value:function(r,n,i,o){r.init(i,o),this.passes.splice(n,0,r)}},{key:"getPostProcessingPassByName",value:function(r){return this.passes.find(function(n){return n.getName()===r})}},{key:"init",value:function(){var r=this.rendererService,n=r.createFramebuffer,i=r.createTexture2D;this.readFBO=n({color:i({width:1,height:1,wrapS:W.CLAMP_TO_EDGE,wrapT:W.CLAMP_TO_EDGE})}),this.writeFBO=n({color:i({width:1,height:1,wrapS:W.CLAMP_TO_EDGE,wrapT:W.CLAMP_TO_EDGE})})}},{key:"isLastEnabledPass",value:function(r){for(var n=r+1;n<this.passes.length;n++)if(this.passes[n].isEnabled())return!1;return!0}},{key:"swap",value:function(){var r=this.readFBO;this.readFBO=this.writeFBO,this.writeFBO=r}}]),e}(),IA=mi(Sd.prototype,"rendererService",[wA],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mi(Sd.prototype,"init",[CA],Object.getOwnPropertyDescriptor(Sd.prototype,"init"),Sd.prototype),Sd))||RA),MA,PA;function Wue(e){var t=Xue();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Xue(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Yue=(MA=ai(),MA(PA=function(e){_n(r,e);var t=Wue(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getType",value:function(){return M0.Normal}},{key:"getName",value:function(){return"render"}},{key:"init",value:function(i,o){gp(Bt(r.prototype),"init",this).call(this,i,o)}},{key:"render",value:function(i){var o=this.rendererService,a=o.useFramebuffer,u=o.clear,c=i.multiPassRenderer.getPostProcessor().getReadFBO();a(c,function(){u({color:[0,0,0,0],depth:1,stencil:0,framebuffer:c}),i.multiPassRenderer.setRenderFlag(!1),i.models.forEach(function(f){f.draw({uniforms:i.layerModel.getUninforms()})}),i.multiPassRenderer.setRenderFlag(!0)})}}]),r}(vy))||PA),OA,kA,DA,X3,FA;function Zue(e){var t=que();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function que(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Kue=`uniform float u_opacity : 1.0;
|
|
uniform float u_MixRatio : 0.5;
|
|
|
|
uniform sampler2D u_Diffuse1;
|
|
uniform sampler2D u_Diffuse2;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
vec4 texel1 = texture2D(u_Diffuse1, v_UV);
|
|
vec4 texel2 = texture2D(u_Diffuse2, v_UV);
|
|
gl_FragColor = u_opacity * mix(texel1, texel2, u_MixRatio);
|
|
}
|
|
`,BA=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
}`,Que=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`;function LA(e,t){for(var r=0,n=1/t,i=e;i>0;)r=r+n*(i%t),i=Math.floor(i/t),n=n/t;return r}var Jue=1,ele=(OA=ai(),kA=ki(wt.IShaderModuleService),OA(DA=(X3=function(e){_n(r,e);var t=Zue(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),bi($e(n),"shaderModuleService",FA,$e(n)),F($e(n),"haltonSequence",[]),F($e(n),"accumulatingId",0),F($e(n),"frame",0),F($e(n),"timer",void 0),F($e(n),"sampleRenderTarget",void 0),F($e(n),"prevRenderTarget",void 0),F($e(n),"outputRenderTarget",void 0),F($e(n),"copyRenderTarget",void 0),F($e(n),"blendModel",void 0),F($e(n),"outputModel",void 0),F($e(n),"copyModel",void 0),n}return jt(r,[{key:"getType",value:function(){return M0.Normal}},{key:"getName",value:function(){return"taa"}},{key:"init",value:function(i,o){gp(Bt(r.prototype),"init",this).call(this,i,o);var a=this.rendererService,u=a.createFramebuffer,c=a.createTexture2D;this.sampleRenderTarget=u({color:c({width:1,height:1,wrapS:W.CLAMP_TO_EDGE,wrapT:W.CLAMP_TO_EDGE})}),this.prevRenderTarget=u({color:c({width:1,height:1,wrapS:W.CLAMP_TO_EDGE,wrapT:W.CLAMP_TO_EDGE})}),this.outputRenderTarget=u({color:c({width:1,height:1,wrapS:W.CLAMP_TO_EDGE,wrapT:W.CLAMP_TO_EDGE})}),this.copyRenderTarget=u({color:c({width:1,height:1,wrapS:W.CLAMP_TO_EDGE,wrapT:W.CLAMP_TO_EDGE})});for(var f=0;f<30;f++)this.haltonSequence.push([LA(f,2),LA(f,3)]);this.blendModel=this.createTriangleModel("blend-pass",Kue),this.outputModel=this.createTriangleModel("copy-pass",BA,{blend:{enable:!0,func:{srcRGB:W.ONE,dstRGB:W.ONE_MINUS_SRC_ALPHA,srcAlpha:W.ONE,dstAlpha:W.ONE_MINUS_SRC_ALPHA},equation:{rgb:W.FUNC_ADD,alpha:W.FUNC_ADD}}}),this.copyModel=this.createTriangleModel("copy-pass",BA)}},{key:"render",value:function(i){var o=this,a=this.rendererService,u=a.clear,c=a.getViewportSize,f=a.useFramebuffer,m=c(),_=m.width,b=m.height;this.sampleRenderTarget.resize({width:_,height:b}),this.prevRenderTarget.resize({width:_,height:b}),this.outputRenderTarget.resize({width:_,height:b}),this.copyRenderTarget.resize({width:_,height:b}),this.resetFrame(),this.stopAccumulating();var A=i.multiPassRenderer.getPostProcessor().getReadFBO();f(A,function(){u({color:[0,0,0,0],depth:1,stencil:0,framebuffer:A}),i.multiPassRenderer.setRenderFlag(!1),i.render(),i.multiPassRenderer.setRenderFlag(!0)});var w=function R(P){!o.accumulatingId||P!==o.accumulatingId||o.isFinished()||(o.doRender(i),window.requestAnimationFrame(function(){R(P)}))};this.accumulatingId=Jue++,this.timer=window.setTimeout(function(){w(o.accumulatingId)},50)}},{key:"doRender",value:function(i){var o=this,a=this.rendererService,u=a.clear,c=a.getViewportSize,f=a.useFramebuffer,m=c(),_=m.width,b=m.height,A=i.getLayerConfig(),w=A.jitterScale,R=w===void 0?1:w,P=this.haltonSequence[this.frame%this.haltonSequence.length];this.cameraService.jitterProjectionMatrix((P[0]*2-1)/_*R,(P[1]*2-1)/b*R),i.multiPassRenderer.setRenderFlag(!1),i.hooks.beforeRender.call(),f(this.sampleRenderTarget,function(){u({color:[0,0,0,0],depth:1,stencil:0,framebuffer:o.sampleRenderTarget}),i.render()}),i.hooks.afterRender.call(),i.multiPassRenderer.setRenderFlag(!0);var k=i.getLayerConfig();f(this.outputRenderTarget,function(){o.blendModel.draw({uniforms:{u_opacity:k.opacity||1,u_MixRatio:o.frame===0?1:.9,u_Diffuse1:o.sampleRenderTarget,u_Diffuse2:o.frame===0?i.multiPassRenderer.getPostProcessor().getReadFBO():o.prevRenderTarget}})}),this.frame===0&&u({color:[0,0,0,0],depth:1,stencil:0,framebuffer:this.copyRenderTarget}),this.frame>=1&&(f(this.copyRenderTarget,function(){o.outputModel.draw({uniforms:{u_Texture:o.outputRenderTarget}})}),f(i.multiPassRenderer.getPostProcessor().getReadFBO(),function(){o.copyModel.draw({uniforms:{u_Texture:o.copyRenderTarget}})}),i.multiPassRenderer.getPostProcessor().render(i));var L=this.prevRenderTarget;this.prevRenderTarget=this.outputRenderTarget,this.outputRenderTarget=L,this.frame++,this.cameraService.clearJitterProjectionMatrix()}},{key:"isFinished",value:function(){return this.frame>=this.haltonSequence.length}},{key:"resetFrame",value:function(){this.frame=0}},{key:"stopAccumulating",value:function(){this.accumulatingId=0,window.clearTimeout(this.timer)}},{key:"createTriangleModel",value:function(i,o,a){this.shaderModuleService.registerModule(i,{vs:Que,fs:o});var u=this.shaderModuleService.getModule(i),c=u.vs,f=u.fs,m=u.uniforms,_=this.rendererService,b=_.createAttribute,A=_.createBuffer,w=_.createModel;return w(Qe({vs:c,fs:f,attributes:{a_Position:b({buffer:A({data:[-4,-4,4,-4,0,4],type:W.FLOAT}),size:2})},uniforms:Qe({},m),depth:{enable:!1},count:3},a))}}]),r}(vy),FA=mi(X3.prototype,"shaderModuleService",[kA],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),X3))||DA),Ts=new K5;Ts.bind(wt.IGlobalConfigService).to(soe).inSingletonScope();Kie(ai(),ju.EventEmitter);Ts.bind(wt.IEventEmitter).to(ju.EventEmitter);var tle=Aae(Ts,!1),rb=function(t){var r=tle.lazyInject(t);return function(n,i,o){r.call(this,n,i),o&&(o.initializer=function(){return n[i]})}},rle=0;function nle(){var e=new K5;return e.parent=Ts,e.bind(wt.SceneID).toConstantValue("".concat(rle++)),e.bind(wt.IShaderModuleService).to(Lse).inSingletonScope(),e.bind(wt.ILayerService).to(Ioe).inSingletonScope(),e.bind(wt.IDebugService).to(poe).inSingletonScope(),e.bind(wt.ISceneService).to(Ase).inSingletonScope(),e.bind(wt.ICameraService).to(qae).inSingletonScope(),e.bind(wt.ICoordinateSystemService).to(coe).inSingletonScope(),e.bind(wt.IInteractionService).to(_oe).inSingletonScope(),e.bind(wt.IPickingService).to(Aoe).inSingletonScope(),e.bind(wt.IControlService).to(eoe).inSingletonScope(),e.bind(wt.IMarkerService).to(toe).inSingletonScope(),e.bind(wt.IIconService).to(Zae).inSingletonScope(),e.bind(wt.IFontService).to(Gae).inSingletonScope(),e.bind(wt.IPopupService).to(roe).inSingletonScope(),e.bind(wt.INormalPass).to($se).whenTargetNamed("clear"),e.bind(wt.INormalPass).to(Xse).whenTargetNamed("pixelPicking"),e.bind(wt.INormalPass).to(Yue).whenTargetNamed("render"),e.bind(wt.INormalPass).to(ele).whenTargetNamed("taa"),e.bind(wt.IFactoryNormalPass).toFactory(function(t){return function(r){return t.container.getNamed(wt.INormalPass,r)}}),e.bind(wt.IPostProcessingPass).to(Aue).whenTargetNamed("copy"),e.bind(wt.IPostProcessingPass).to(rue).whenTargetNamed("bloom"),e.bind(wt.IPostProcessingPass).to(uue).whenTargetNamed("blurH"),e.bind(wt.IPostProcessingPass).to(due).whenTargetNamed("blurV"),e.bind(wt.IPostProcessingPass).to(Uue).whenTargetNamed("noise"),e.bind(wt.IPostProcessingPass).to(Hue).whenTargetNamed("sepia"),e.bind(wt.IPostProcessingPass).to(yue).whenTargetNamed("colorHalftone"),e.bind(wt.IPostProcessingPass).to(Iue).whenTargetNamed("hexagonalPixelate"),e.bind(wt.IPostProcessingPass).to(Due).whenTargetNamed("ink"),e.bind(wt.IFactoryPostProcessingPass).toFactory(function(t){return function(r){var n=t.container.getNamed(wt.IPostProcessingPass,r);return n.setName(r),n}}),e}function om(e){var t=new K5;return t.parent=e,t.bind(wt.IStyleAttributeService).to(Boe).inSingletonScope(),t.bind(wt.IMultiPassRenderer).to(Hse).inSingletonScope(),t.bind(wt.IPostProcessor).to(Gue).inSingletonScope(),t}Ci.clamp;var s1={ProjectionMatrix:"u_ProjectionMatrix",ViewMatrix:"u_ViewMatrix",ViewProjectionMatrix:"u_ViewProjectionMatrix",Zoom:"u_Zoom",ZoomScale:"u_ZoomScale",FocalDistance:"u_FocalDistance",CameraPosition:"u_CameraPosition"},Ho={MapInitStart:"mapInitStart",LayerInitStart:"layerInitStart",LayerInitEnd:"layerInitEnd",SourceInitStart:"sourceInitStart",SourceInitEnd:"sourceInitEnd",ScaleInitStart:"scaleInitStart",ScaleInitEnd:"scaleInitEnd",MappingStart:"mappingStart",MappingEnd:"mappingEnd",BuildModelStart:"buildModelStart",BuildModelEnd:"buildModelEnd"},pa=function(e){return e.LINEAR="linear",e.SEQUENTIAL="sequential",e.POWER="power",e.LOG="log",e.IDENTITY="identity",e.TIME="time",e.QUANTILE="quantile",e.QUANTIZE="quantize",e.THRESHOLD="threshold",e.CAT="cat",e.DIVERGING="diverging",e.CUSTOM="threshold",e}({}),Ad=function(e){return e.CONSTANT="constant",e.VARIABLE="variable",e}({}),wn=function(e){return e[e.Attribute=0]="Attribute",e[e.InstancedAttribute=1]="InstancedAttribute",e[e.Uniform=2]="Uniform",e}({}),ile=["mapload","mapchange","mapAfterFrameChange"],Q2=["loaded","fontloaded","maploaded","resize","destroy","dragstart","dragging","dragend","dragcancel"],Ns=function(e){return e.IMAGE="image",e.CUSTOMIMAGE="customImage",e.ARRAYBUFFER="arraybuffer",e.RGB="rgb",e.TERRAINRGB="terrainRGB",e.CUSTOMRGB="customRGB",e.CUSTOMARRAYBUFFER="customArrayBuffer",e.CUSTOMTERRAINRGB="customTerrainRGB",e}({}),ale=function(){var e=Mt(he.mark(function t(r,n,i,o){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",new Promise(function(c,f){n({x:r.x,y:r.y,z:r.z},function(m,_){if(m||_.length===0){f(m);return}_&&ox([{data:_,bands:[0]}],i,o,function(b,A){b?f(b):A&&c(A)})})}));case 1:case"end":return u.stop()}},t)}));return function(r,n,i,o){return e.apply(this,arguments)}}(),ole=function(){var e=Mt(he.mark(function t(r,n){return he.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",new Promise(function(a,u){n({x:r.x,y:r.y,z:r.z},function(c,f){if(c||!f){u(c);return}f instanceof ArrayBuffer?kL(f,function(m,_){m&&u(m),a(_)}):f instanceof HTMLImageElement?a(f):u(c)})}));case 1:case"end":return o.stop()}},t)}));return function(r,n){return e.apply(this,arguments)}}();function sle(e,t){return Array.isArray(e)?typeof e[0]=="string"?e.map(function(r){return Kd(r,t)}):e.map(function(r){return{url:Kd(r.url,t),bands:r.bands||[0]}}):Kd(e,t)}function ule(e){return typeof e=="string"?[{url:e,bands:[0]}]:typeof e[0]=="string"?e.map(function(t){return{url:t,bands:[0]}}):e}function NA(e,t){e.xhrCancel=function(){t.map(function(r){r.abort()})}}var lle=function(){var e=Mt(he.mark(function t(r,n,i,o,a){var u,c,f,m,_,b;return he.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if(u=ule(n.url),!(u.length>1)){w.next=15;break}return w.next=4,cle(u,n);case 4:if(c=w.sent,f=c.rasterFiles,m=c.xhrList,_=c.errList,NA(r,m),!(_.length>0)){w.next=12;break}return i(_,null),w.abrupt("return");case 12:ox(f,o,a,i),w.next=17;break;case 15:b=d5(n,function(R,P){if(R)i(R);else if(P){var k=[{data:P,bands:u[0].bands}];ox(k,o,a,i)}}),NA(r,[b]);case 17:case"end":return w.stop()}},t)}));return function(r,n,i,o,a){return e.apply(this,arguments)}}();function cle(e,t){return Ex.apply(this,arguments)}function Ex(){return Ex=Mt(he.mark(function e(t,r){var n,i,o,a,u,c,f,m,_,b,A;return he.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:n=[],i=[],o=[],a=0;case 4:if(!(a<t.length)){R.next=20;break}return u=t[a],c=Qe(Qe({},r),{},{url:u.url}),f=u.bands,R.next=10,ML(Qe(Qe({},c),{},{type:"arrayBuffer"}));case 10:m=R.sent,_=m.err,b=m.data,A=m.xhr,_&&o.push(_),i.push(A),n.push({data:b,bands:f});case 17:a++,R.next=4;break;case 20:return R.abrupt("return",{rasterFiles:n,xhrList:i,errList:o});case 21:case"end":return R.stop()}},e)})),Ex.apply(this,arguments)}var fle=function(){var e=Mt(he.mark(function t(r,n,i,o,a){var u;return he.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return u={url:sle(r,n)},f.abrupt("return",new Promise(function(m,_){lle(i,u,function(b,A){b?_(b):A&&m(A)},o,a)}));case 2:case"end":return f.stop()}},t)}));return function(r,n,i,o,a){return e.apply(this,arguments)}}(),UA=function(){var e=Mt(he.mark(function t(r,n,i,o){var a,u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return u=Array.isArray(r)?r[0]:r,o.wmtsOptions?(c=(o==null?void 0:o.getURLFromTemplate)||ute,a=c(u,Qe(Qe({},n),o.wmtsOptions))):(f=(o==null?void 0:o.getURLFromTemplate)||Kd,a=f(u,n)),_.abrupt("return",new Promise(function(b,A){var w,R=O6({url:a,type:(o==null||(w=o.requestParameters)===null||w===void 0?void 0:w.type)||"arrayBuffer"},function(P,k){P?A(P):k&&b(k)},o.transformResponse);i.xhrCancel=function(){return R.cancel()}}));case 3:case"end":return _.stop()}},t)}));return function(r,n,i,o){return e.apply(this,arguments)}}(),zA=function(){return{rasterData:new Uint8Array([0]),width:1,height:1}},hle={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,warp:!0};Ns.ARRAYBUFFER,Ns.RGB;function ple(e){return!!(Array.isArray(e)&&e.length===0||!Array.isArray(e)&&typeof e!="string")}function dle(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ple(e))throw new Error("tile server url is error");var r=(t==null?void 0:t.dataType)||Ns.IMAGE;r===Ns.RGB&&(r=Ns.ARRAYBUFFER);var n=function(a,u){switch(r){case Ns.IMAGE:return UA(e,a,u,t);case Ns.CUSTOMIMAGE:case Ns.CUSTOMTERRAINRGB:return ole(u,t==null?void 0:t.getCustomData);case Ns.ARRAYBUFFER:return fle(e,a,u,(t==null?void 0:t.format)||zA,t==null?void 0:t.operation);case Ns.CUSTOMARRAYBUFFER:case Ns.CUSTOMRGB:return ale(u,t==null?void 0:t.getCustomData,(t==null?void 0:t.format)||zA,t==null?void 0:t.operation);default:return UA(e,a,u,t)}},i=Qe(Qe(Qe({},hle),t),{},{getTileData:n});return{data:e,dataArray:[],tilesetOptions:i,isTile:!0}}var vle=["extent","min","max","width","height","format","operation"];function mle(e,t){var r=t.extent,n=t.min,i=t.max,o=t.width,a=t.height,u=t.format,c=t.operation,f=hl(t,vle),m;if(u===void 0||LM(e))m=Array.from(e);else{var _=Array.isArray(e)?e:[e];m=X5(_,u,c)}var b={_id:1,dataArray:[Qe(Qe({_id:1,data:m,width:o,height:a},f),{},{min:n,max:i,coordinates:[[r[0],r[1]],[r[2],r[3]]]})]};return b}var gle={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0},_le=function(){var e=Mt(he.mark(function t(r){return he.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o){var a=Nn(r.bounds,4),u=a[0],c=a[1],f=a[2],m=a[3],_={layers:{testTile:{features:[{type:"Feature",properties:{key:r.x+"/"+r.y+"/"+r.z,x:(u+f)/2,y:(c+m)/2},geometry:{type:"LineString",coordinates:[[f,m],[f,c],[u,c],[u,c]]}}]}}};o(_)}));case 1:case"end":return i.stop()}},t)}));return function(r){return e.apply(this,arguments)}}();function yle(e,t){var r=function(o){return _le(o)},n=Qe(Qe(Qe({},gle),t),{},{getTileData:r});return{data:e,dataArray:[],tilesetOptions:n,isTile:!0}}var xle=["extent","width","height"];function ble(e,t){var r=t.extent,n=t.width,i=t.height,o=hl(t,xle);e.length<3&&console.warn("RGB解析需要三个波段的数据");for(var a=o.bands||[0,1,2],u=Nn(a,3),c=u[0],f=u[1],m=u[2],_=[e[c],e[f],e[m]],b=[],A=(o==null?void 0:o.countCut)||[2,98],w=Nn(A,2),R=w[0],P=w[1],k=(o==null?void 0:o.RMinMax)||Jd(_[0],R,P),L=(o==null?void 0:o.GMinMax)||Jd(_[1],R,P),B=(o==null?void 0:o.BMinMax)||Jd(_[2],R,P),V=0;V<_[0].length;V++)b.push(Math.max(0,_[0][V]-k[0])),b.push(Math.max(0,_[1][V]-L[0])),b.push(Math.max(0,_[2][V]-B[0]));var G={_id:1,dataArray:[Qe(Qe({_id:1,data:b,width:n,height:i,rMinMax:k,gMinMax:L,bMinMax:B},o),{},{coordinates:[[r[0],r[1]],[r[2],r[3]]]})]};return G}var Ele=["extent","width","height"];function Sle(e,t){var r=t.extent,n=t.width,i=t.height,o=hl(t,Ele);e.length<2&&console.warn("RGB解析需要2个波段的数据");for(var a=o.bands||[0,1],u=Nn(a,2),c=u[0],f=u[1],m=[e[c],e[f]],_=[],b=0;b<m[0].length;b++)_.push((m[1][b]-m[0][b])/(m[1][b]+m[0][b]));var A={_id:1,dataArray:[Qe(Qe({_id:1,data:_,width:n,height:i},o),{},{coordinates:[[r[0],r[1]],[r[2],r[3]]]})]};return A}var SP={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(_c,function(){function r(de,se,le,ye,ke,Rt){if(!(ke-ye<=le)){var Lt=ye+ke>>1;n(de,se,Lt,ye,ke,Rt%2),r(de,se,le,ye,Lt-1,Rt+1),r(de,se,le,Lt+1,ke,Rt+1)}}function n(de,se,le,ye,ke,Rt){for(;ke>ye;){if(ke-ye>600){var Lt=ke-ye+1,Gt=le-ye+1,Zt=Math.log(Lt),st=.5*Math.exp(2*Zt/3),tt=.5*Math.sqrt(Zt*st*(Lt-st)/Lt)*(Gt-Lt/2<0?-1:1),dt=Math.max(ye,Math.floor(le-Gt*st/Lt+tt)),nt=Math.min(ke,Math.floor(le+(Lt-Gt)*st/Lt+tt));n(de,se,le,dt,nt,Rt)}var pr=se[2*le+Rt],ur=ye,Ar=ke;for(i(de,se,ye,le),se[2*ke+Rt]>pr&&i(de,se,ye,ke);ur<Ar;){for(i(de,se,ur,Ar),ur++,Ar--;se[2*ur+Rt]<pr;)ur++;for(;se[2*Ar+Rt]>pr;)Ar--}se[2*ye+Rt]===pr?i(de,se,ye,Ar):(Ar++,i(de,se,Ar,ke)),Ar<=le&&(ye=Ar+1),le<=Ar&&(ke=Ar-1)}}function i(de,se,le,ye){o(de,le,ye),o(se,2*le,2*ye),o(se,2*le+1,2*ye+1)}function o(de,se,le){var ye=de[se];de[se]=de[le],de[le]=ye}function a(de,se,le,ye,ke,Rt,Lt){for(var Gt=[0,de.length-1,0],Zt=[],st,tt;Gt.length;){var dt=Gt.pop(),nt=Gt.pop(),pr=Gt.pop();if(nt-pr<=Lt){for(var ur=pr;ur<=nt;ur++)st=se[2*ur],tt=se[2*ur+1],st>=le&&st<=ke&&tt>=ye&&tt<=Rt&&Zt.push(de[ur]);continue}var Ar=Math.floor((pr+nt)/2);st=se[2*Ar],tt=se[2*Ar+1],st>=le&&st<=ke&&tt>=ye&&tt<=Rt&&Zt.push(de[Ar]);var Xn=(dt+1)%2;(dt===0?le<=st:ye<=tt)&&(Gt.push(pr),Gt.push(Ar-1),Gt.push(Xn)),(dt===0?ke>=st:Rt>=tt)&&(Gt.push(Ar+1),Gt.push(nt),Gt.push(Xn))}return Zt}function u(de,se,le,ye,ke,Rt){for(var Lt=[0,de.length-1,0],Gt=[],Zt=ke*ke;Lt.length;){var st=Lt.pop(),tt=Lt.pop(),dt=Lt.pop();if(tt-dt<=Rt){for(var nt=dt;nt<=tt;nt++)c(se[2*nt],se[2*nt+1],le,ye)<=Zt&&Gt.push(de[nt]);continue}var pr=Math.floor((dt+tt)/2),ur=se[2*pr],Ar=se[2*pr+1];c(ur,Ar,le,ye)<=Zt&&Gt.push(de[pr]);var Xn=(st+1)%2;(st===0?le-ke<=ur:ye-ke<=Ar)&&(Lt.push(dt),Lt.push(pr-1),Lt.push(Xn)),(st===0?le+ke>=ur:ye+ke>=Ar)&&(Lt.push(pr+1),Lt.push(tt),Lt.push(Xn))}return Gt}function c(de,se,le,ye){var ke=de-le,Rt=se-ye;return ke*ke+Rt*Rt}var f=function(de){return de[0]},m=function(de){return de[1]},_=function(se,le,ye,ke,Rt){le===void 0&&(le=f),ye===void 0&&(ye=m),ke===void 0&&(ke=64),Rt===void 0&&(Rt=Float64Array),this.nodeSize=ke,this.points=se;for(var Lt=se.length<65536?Uint16Array:Uint32Array,Gt=this.ids=new Lt(se.length),Zt=this.coords=new Rt(se.length*2),st=0;st<se.length;st++)Gt[st]=st,Zt[2*st]=le(se[st]),Zt[2*st+1]=ye(se[st]);r(Gt,Zt,ke,0,Gt.length-1,0)};_.prototype.range=function(se,le,ye,ke){return a(this.ids,this.coords,se,le,ye,ke,this.nodeSize)},_.prototype.within=function(se,le,ye){return u(this.ids,this.coords,se,le,ye,this.nodeSize)};var b={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(de){return de}},A=Math.fround||function(de){return function(se){return de[0]=+se,de[0]}}(new Float32Array(1)),w=function(se){this.options=Z(Object.create(b),se),this.trees=new Array(this.options.maxZoom+1)};w.prototype.load=function(se){var le=this.options,ye=le.log,ke=le.minZoom,Rt=le.maxZoom,Lt=le.nodeSize;ye&&console.time("total time");var Gt="prepare "+se.length+" points";ye&&console.time(Gt),this.points=se;for(var Zt=[],st=0;st<se.length;st++)se[st].geometry&&Zt.push(P(se[st],st));this.trees[Rt+1]=new _(Zt,ve,Ie,Lt,Float32Array),ye&&console.timeEnd(Gt);for(var tt=Rt;tt>=ke;tt--){var dt=+Date.now();Zt=this._cluster(Zt,tt),this.trees[tt]=new _(Zt,ve,Ie,Lt,Float32Array),ye&&console.log("z%d: %d clusters in %dms",tt,Zt.length,+Date.now()-dt)}return ye&&console.timeEnd("total time"),this},w.prototype.getClusters=function(se,le){var ye=((se[0]+180)%360+360)%360-180,ke=Math.max(-90,Math.min(90,se[1])),Rt=se[2]===180?180:((se[2]+180)%360+360)%360-180,Lt=Math.max(-90,Math.min(90,se[3]));if(se[2]-se[0]>=360)ye=-180,Rt=180;else if(ye>Rt){var Gt=this.getClusters([ye,ke,180,Lt],le),Zt=this.getClusters([-180,ke,Rt,Lt],le);return Gt.concat(Zt)}for(var st=this.trees[this._limitZoom(le)],tt=st.range(B(ye),V(Lt),B(Rt),V(ke)),dt=[],nt=0,pr=tt;nt<pr.length;nt+=1){var ur=pr[nt],Ar=st.points[ur];dt.push(Ar.numPoints?k(Ar):this.points[Ar.index])}return dt},w.prototype.getChildren=function(se){var le=this._getOriginId(se),ye=this._getOriginZoom(se),ke="No cluster with the specified id.",Rt=this.trees[ye];if(!Rt)throw new Error(ke);var Lt=Rt.points[le];if(!Lt)throw new Error(ke);for(var Gt=this.options.radius/(this.options.extent*Math.pow(2,ye-1)),Zt=Rt.within(Lt.x,Lt.y,Gt),st=[],tt=0,dt=Zt;tt<dt.length;tt+=1){var nt=dt[tt],pr=Rt.points[nt];pr.parentId===se&&st.push(pr.numPoints?k(pr):this.points[pr.index])}if(st.length===0)throw new Error(ke);return st},w.prototype.getLeaves=function(se,le,ye){le=le||10,ye=ye||0;var ke=[];return this._appendLeaves(ke,se,le,ye,0),ke},w.prototype.getTile=function(se,le,ye){var ke=this.trees[this._limitZoom(se)],Rt=Math.pow(2,se),Lt=this.options,Gt=Lt.extent,Zt=Lt.radius,st=Zt/Gt,tt=(ye-st)/Rt,dt=(ye+1+st)/Rt,nt={features:[]};return this._addTileFeatures(ke.range((le-st)/Rt,tt,(le+1+st)/Rt,dt),ke.points,le,ye,Rt,nt),le===0&&this._addTileFeatures(ke.range(1-st/Rt,tt,1,dt),ke.points,Rt,ye,Rt,nt),le===Rt-1&&this._addTileFeatures(ke.range(0,tt,st/Rt,dt),ke.points,-1,ye,Rt,nt),nt.features.length?nt:null},w.prototype.getClusterExpansionZoom=function(se){for(var le=this._getOriginZoom(se)-1;le<=this.options.maxZoom;){var ye=this.getChildren(se);if(le++,ye.length!==1)break;se=ye[0].properties.cluster_id}return le},w.prototype._appendLeaves=function(se,le,ye,ke,Rt){for(var Lt=this.getChildren(le),Gt=0,Zt=Lt;Gt<Zt.length;Gt+=1){var st=Zt[Gt],tt=st.properties;if(tt&&tt.cluster?Rt+tt.point_count<=ke?Rt+=tt.point_count:Rt=this._appendLeaves(se,tt.cluster_id,ye,ke,Rt):Rt<ke?Rt++:se.push(st),se.length===ye)break}return Rt},w.prototype._addTileFeatures=function(se,le,ye,ke,Rt,Lt){for(var Gt=0,Zt=se;Gt<Zt.length;Gt+=1){var st=Zt[Gt],tt=le[st],dt=tt.numPoints,nt=void 0,pr=void 0,ur=void 0;if(dt)nt=L(tt),pr=tt.x,ur=tt.y;else{var Ar=this.points[tt.index];nt=Ar.properties,pr=B(Ar.geometry.coordinates[0]),ur=V(Ar.geometry.coordinates[1])}var Xn={type:1,geometry:[[Math.round(this.options.extent*(pr*Rt-ye)),Math.round(this.options.extent*(ur*Rt-ke))]],tags:nt},pn=void 0;dt?pn=tt.id:this.options.generateId?pn=tt.index:this.points[tt.index].id&&(pn=this.points[tt.index].id),pn!==void 0&&(Xn.id=pn),Lt.features.push(Xn)}},w.prototype._limitZoom=function(se){return Math.max(this.options.minZoom,Math.min(Math.floor(+se),this.options.maxZoom+1))},w.prototype._cluster=function(se,le){for(var ye=[],ke=this.options,Rt=ke.radius,Lt=ke.extent,Gt=ke.reduce,Zt=ke.minPoints,st=Rt/(Lt*Math.pow(2,le)),tt=0;tt<se.length;tt++){var dt=se[tt];if(!(dt.zoom<=le)){dt.zoom=le;for(var nt=this.trees[le+1],pr=nt.within(dt.x,dt.y,st),ur=dt.numPoints||1,Ar=ur,Xn=0,pn=pr;Xn<pn.length;Xn+=1){var gi=pn[Xn],Je=nt.points[gi];Je.zoom>le&&(Ar+=Je.numPoints||1)}if(Ar>ur&&Ar>=Zt){for(var Qt=dt.x*ur,Xr=dt.y*ur,Ut=Gt&&ur>1?this._map(dt,!0):null,ge=(tt<<5)+(le+1)+this.points.length,Be=0,ft=pr;Be<ft.length;Be+=1){var At=ft[Be],bt=nt.points[At];if(!(bt.zoom<=le)){bt.zoom=le;var $t=bt.numPoints||1;Qt+=bt.x*$t,Xr+=bt.y*$t,bt.parentId=ge,Gt&&(Ut||(Ut=this._map(dt,!0)),Gt(Ut,this._map(bt)))}}dt.parentId=ge,ye.push(R(Qt/Ar,Xr/Ar,ge,Ar,Ut))}else if(ye.push(dt),Ar>1)for(var Mr=0,tr=pr;Mr<tr.length;Mr+=1){var lr=tr[Mr],or=nt.points[lr];or.zoom<=le||(or.zoom=le,ye.push(or))}}}return ye},w.prototype._getOriginId=function(se){return se-this.points.length>>5},w.prototype._getOriginZoom=function(se){return(se-this.points.length)%32},w.prototype._map=function(se,le){if(se.numPoints)return le?Z({},se.properties):se.properties;var ye=this.points[se.index].properties,ke=this.options.map(ye);return le&&ke===ye?Z({},ke):ke};function R(de,se,le,ye,ke){return{x:A(de),y:A(se),zoom:1/0,id:le,parentId:-1,numPoints:ye,properties:ke}}function P(de,se){var le=de.geometry.coordinates,ye=le[0],ke=le[1];return{x:A(B(ye)),y:A(V(ke)),zoom:1/0,index:se,parentId:-1}}function k(de){return{type:"Feature",id:de.id,properties:L(de),geometry:{type:"Point",coordinates:[G(de.x),K(de.y)]}}}function L(de){var se=de.numPoints,le=se>=1e4?Math.round(se/1e3)+"k":se>=1e3?Math.round(se/100)/10+"k":se;return Z(Z({},de.properties),{cluster:!0,cluster_id:de.id,point_count:se,point_count_abbreviated:le})}function B(de){return de/360+.5}function V(de){var se=Math.sin(de*Math.PI/180),le=.5-.25*Math.log((1+se)/(1-se))/Math.PI;return le<0?0:le>1?1:le}function G(de){return(de-.5)*360}function K(de){var se=(180-de*360)*Math.PI/180;return 360*Math.atan(Math.exp(se))/Math.PI-90}function Z(de,se){for(var le in se)de[le]=se[le];return de}function ve(de){return de.x}function Ie(de){return de.y}return w})})(SP);var Ale=SP.exports;const Tle=oa(Ale);function AP(e,t){var r=t.radius,n=r===void 0?40:r,i=t.maxZoom,o=i===void 0?18:i,a=t.minZoom,u=a===void 0?0:a,c=t.zoom,f=c===void 0?2:c;if(e.pointIndex){var m=e.pointIndex.getClusters(e.extent,Math.floor(f));return e.dataArray=wle(m),e}var _=new Tle({radius:n,minZoom:u,maxZoom:o}),b={type:"FeatureCollection",features:[]};return b.features=e.dataArray.map(function(A){return{type:"Feature",geometry:{type:"Point",coordinates:A.coordinates},properties:Qe({},A)}}),_.load(b.features),_}function wle(e){return e.map(function(t,r){return Qe({coordinates:t.geometry.coordinates,_id:r+1},t.properties)})}function Cle(e){if(e.length===0)throw new Error("max requires at least one data point");for(var t=e[0],r=1;r<e.length;r++)e[r]>t&&(t=e[r]);return t}function Rle(e){if(e.length===0)throw new Error("min requires at least one data point");for(var t=e[0],r=1;r<e.length;r++)e[r]<t&&(t=e[r]);return t}function TP(e){if(e.length===0)return 0;for(var t=e[0],r=0,n,i=1;i<e.length;i++)n=t+e[i]*1,Math.abs(t)>=Math.abs(e[i])?r+=t-n+e[i]:r+=e[i]-n+t,t=n;return t+r*1}function Ile(e){if(e.length===0)throw new Error("mean requires at least one data point");return TP(e)/e.length}var Mle={min:Rle,max:Cle,mean:Ile,sum:TP};function Ple(e){var t=Ole();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Ole(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var kle=Ci.cloneDeep,$A=Ci.isFunction,Dle=Ci.isString,Fle=Ci.mergeWith;function Ble(e,t){if(Array.isArray(t))return t}var wP=function(e){_n(r,e);var t=Ple(r);function r(n,i){var o;return Ht(this,r),o=t.call(this),F($e(o),"type","source"),F($e(o),"isTile",!1),F($e(o),"inited",!1),F($e(o),"hooks",{init:new nf}),F($e(o),"parser",{type:"geojson"}),F($e(o),"transforms",[]),F($e(o),"cluster",!1),F($e(o),"clusterOptions",{enable:!1,radius:40,maxZoom:20,zoom:-99,method:"count"}),F($e(o),"invalidExtent",!1),F($e(o),"dataArrayChanged",!1),F($e(o),"cfg",{autoRender:!0}),o.originData=n,o.initCfg(i),o.init().then(function(){o.inited=!0,o.emit("update",{type:"inited"})}),o}return jt(r,[{key:"getSourceCfg",value:function(){return this.cfg}},{key:"getClusters",value:function(i){return this.clusterIndex.getClusters(this.caculClusterExtent(2),i)}},{key:"getClustersLeaves",value:function(i){return this.clusterIndex.getLeaves(i,1/0)}},{key:"getParserType",value:function(){return this.parser.type}},{key:"updateClusterData",value:function(i){var o=this,a=this.clusterOptions,u=a.method,c=u===void 0?"sum":u,f=a.field,m=this.clusterIndex.getClusters(this.caculClusterExtent(2),Math.floor(i));this.clusterOptions.zoom=i,m.forEach(function(_){_.id||(_.properties.point_count=1)}),(f||$A(c))&&(m=m.map(function(_){var b=_.id;if(b){var A=o.clusterIndex.getLeaves(b,1/0),w=A.map(function(k){return k.properties}),R;if(Dle(c)&&f){var P=Kre(w,f);R=Mle[c](P)}$A(c)&&(R=c(w)),_.properties.stat=R}else _.properties.point_count=1;return _})),this.data=q7("geojson")({type:"FeatureCollection",features:m}),this.executeTrans()}},{key:"getFeatureById",value:function(i){var o=this.parser,a=o.type,u=a===void 0?"geojson":a,c=o.geometry;if(u==="geojson"&&!this.cluster){var f=i<this.originData.features.length?this.originData.features[i]:"null",m=kle(f);if(m!=null&&m.properties&&(this.transforms.length!==0||this.dataArrayChanged)){var _=this.data.dataArray.find(function(b){return b._id===i});m.properties=_}return m}else return u==="json"&&c?this.data.dataArray.find(function(b){return b._id===i}):i<this.data.dataArray.length?this.data.dataArray[i]:"null"}},{key:"updateFeaturePropertiesById",value:function(i,o){this.data.dataArray=this.data.dataArray.map(function(a){return a._id===i?Qe(Qe({},a),o):a}),this.dataArrayChanged=!0,this.emit("update",{type:"update"})}},{key:"getFeatureId",value:function(i,o){var a=this.data.dataArray.find(function(u){return u[i]===o});return a==null?void 0:a._id}},{key:"setData",value:function(i,o){var a=this;this.originData=i,this.dataArrayChanged=!1,this.initCfg(o),this.init().then(function(){a.emit("update",{type:"update"})})}},{key:"reloadAllTile",value:function(){var i;(i=this.tileset)===null||i===void 0||i.reloadAll()}},{key:"reloadTilebyId",value:function(i,o,a){var u;(u=this.tileset)===null||u===void 0||u.reloadTileById(i,o,a)}},{key:"reloadTileByLnglat",value:function(i,o,a){var u;(u=this.tileset)===null||u===void 0||u.reloadTileByLnglat(i,o,a)}},{key:"getTileExtent",value:function(i,o){var a;return(a=this.tileset)===null||a===void 0?void 0:a.getTileExtent(i,o)}},{key:"getTileByZXY",value:function(i,o,a){var u;return(u=this.tileset)===null||u===void 0?void 0:u.getTileByZXY(i,o,a)}},{key:"reloadTileByExtent",value:function(i,o){var a;(a=this.tileset)===null||a===void 0||a.reloadTileByExtent(i,o)}},{key:"destroy",value:function(){var i;this.removeAllListeners(),this.originData=null,this.clusterIndex=null,this.data=null,(i=this.tileset)===null||i===void 0||i.destroy()}},{key:"processData",value:function(){var n=Mt(he.mark(function o(){var a=this;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",new Promise(function(f,m){try{a.excuteParser(),a.initCluster(),a.executeTrans(),f({})}catch(_){m(_)}}));case 1:case"end":return c.stop()}},o)}));function i(){return n.apply(this,arguments)}return i}()},{key:"initCfg",value:function(i){this.cfg=Fle(this.cfg,i,Ble);var o=this.cfg;o&&(o.parser&&(this.parser=o.parser),o.transforms&&(this.transforms=o.transforms),this.cluster=o.cluster||!1,o.clusterOptions&&(this.cluster=!0,this.clusterOptions=Qe(Qe({},this.clusterOptions),o.clusterOptions)))}},{key:"init",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.inited=!1,u.next=3,this.processData();case 3:this.inited=!0;case 4:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"excuteParser",value:function(){var i=this.parser,o=i.type||"geojson",a=q7(o);this.data=a(this.originData,i),this.tileset=this.initTileset(),!i.cancelExtent&&(this.extent=Tee(this.data.dataArray),this.setCenter(this.extent),this.invalidExtent=this.extent[0]===this.extent[2]||this.extent[1]===this.extent[3])}},{key:"setCenter",value:function(i){this.center=[(i[0]+i[2])/2,(i[1]+i[3])/2],(isNaN(this.center[0])||isNaN(this.center[1]))&&(this.center=[108.92361111111111,34.54083333333333])}},{key:"initTileset",value:function(){var i=this.data.tilesetOptions;if(i){if(this.isTile=!0,this.tileset)return this.tileset.updateOptions(i),this.tileset;var o=new ste(Qe({},i));return o}}},{key:"executeTrans",value:function(){var i=this,o=this.transforms;o.forEach(function(a){var u=a.type,c=pL(u)(i.data,a);Object.assign(i.data,c)})}},{key:"initCluster",value:function(){if(this.cluster){var i=this.clusterOptions||{};this.clusterIndex=AP(this.data,i)}}},{key:"caculClusterExtent",value:function(i){var o=[[-1/0,-1/0],[1/0,1/0]];return this.invalidExtent||(o=k5(t_(this.extent),i)),o[0].concat(o[1])}}]),r}(ju.EventEmitter);function Lle(e,t){var r=t.callback;return r&&(e.dataArray=e.dataArray.filter(r)),e}function VA(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Nle(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Nle(e,t){if(e){if(typeof e=="string")return jA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jA(e,t)}}function jA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var nb=6378e3;function Ule(e,t){var r=e.dataArray,n=t.size,i=n===void 0?10:n,o=i/(2*Math.PI*nb)*(256<<20)/2,a=zle(r,i),u=a.gridHash,c=a.gridOffset,f=Hle(u,c,t);return{yOffset:o,xOffset:o,radius:o,type:"grid",dataArray:f}}function zle(e,t){var r=1/0,n=-1/0,i,o=VA(e),a;try{for(o.s();!(a=o.n()).done;){var u=a.value;i=u.coordinates[1],Number.isFinite(i)&&(r=i<r?i:r,n=i>n?i:n)}}catch(B){o.e(B)}finally{o.f()}var c=(r+n)/2,f=$le(t,c);if(f.xOffset<=0||f.yOffset<=0)return{gridHash:{},gridOffset:f};var m={},_=VA(e),b;try{for(_.s();!(b=_.n()).done;){var A=b.value,w=A.coordinates[1],R=A.coordinates[0];if(Number.isFinite(w)&&Number.isFinite(R)){var P=Math.floor((w+90)/f.yOffset),k=Math.floor((R+180)/f.xOffset),L="".concat(P,"-").concat(k);m[L]=m[L]||{count:0,points:[]},m[L].count+=1,m[L].points.push(A)}}}catch(B){_.e(B)}finally{_.f()}return{gridHash:m,gridOffset:f}}function $le(e,t){var r=Vle(e),n=jle(t,e);return{yOffset:r,xOffset:n}}function Vle(e){return e/nb*(180/Math.PI)}function jle(e,t){return t/nb*(180/Math.PI)/Math.cos(e*Math.PI/180)}function Hle(e,t,r){return Object.keys(e).reduce(function(n,i,o){var a=i.split("-"),u=parseInt(a[0],10),c=parseInt(a[1],10),f={};if(r.field&&r.method){var m=rM(e[i].points,r.field);f[r.method]=tM[r.method](m)}return Object.assign(f,{_id:o,coordinates:ko([-180+t.xOffset*(c+.5),-90+t.yOffset*(u+.5)]),rawData:e[i].points,count:e[i].count}),n.push(f),n},[])}var Ld=Math.PI/3,Gle=[0,Ld,2*Ld,3*Ld,4*Ld,5*Ld];function Wle(e){return e[0]}function Xle(e){return e[1]}function Yle(){var e=0,t=0,r=1,n=1,i=Wle,o=Xle,a,u,c;function f(_){var b={},A=[],w,R=_.length;for(w=0;w<R;++w)if(!(isNaN(k=+i.call(null,P=_[w],w,_))||isNaN(L=+o.call(null,P,w,_)))){var P,k,L,B=Math.round(L=L/c),V=Math.round(k=k/u-(B&1)/2),G=L-B;if(Math.abs(G)*3>1){var K=k-V,Z=V+(k<V?-1:1)/2,ve=B+(L<B?-1:1),Ie=k-Z,de=L-ve;K*K+G*G>Ie*Ie+de*de&&(V=Z+(B&1?1:-1)/2,B=ve)}var se=V+"-"+B,le=b[se];le?le.push(P):(A.push(le=b[se]=[P]),le.x=(V+(B&1)/2)*u,le.y=B*c)}return A}function m(_){var b=0,A=0;return Gle.map(function(w){var R=Math.sin(w)*_,P=-Math.cos(w)*_,k=R-b,L=P-A;return b=R,A=P,[k,L]})}return f.hexagon=function(_){return"m"+m(_==null?a:+_).join("l")+"z"},f.centers=function(){for(var _=[],b=Math.round(t/c),A=Math.round(e/u),w=b*c;w<n+a;w+=c,++b)for(var R=A*u+(b&1)*u/2;R<r+u/2;R+=u)_.push([R,w]);return _},f.mesh=function(){var _=m(a).slice(0,4).join("l");return f.centers().map(function(b){return"M"+b+"m"+_}).join("")},f.x=function(_){return arguments.length?(i=_,f):i},f.y=function(_){return arguments.length?(o=_,f):o},f.radius=function(_){return arguments.length?(a=+_,u=a*2*Math.sin(Ld),c=a*1.5,f):a},f.size=function(_){return arguments.length?(e=t=0,r=+_[0],n=+_[1],f):[r-e,n-t]},f.extent=function(_){return arguments.length?(e=+_[0][0],t=+_[0][1],r=+_[1][0],n=+_[1][1],f):[[e,t],[r,n]]},f.radius(1)}var Zle=6378e3;function qle(e,t){var r=e.dataArray,n=t.size,i=n===void 0?10:n,o=t.method,a=o===void 0?"sum":o,u=i/(2*Math.PI*Zle)*(256<<20)/2,c=r.map(function(b){var A=ko(b.coordinates),w=Nn(A,2),R=w[0],P=w[1];return Qe(Qe({},b),{},{coordinates:[R,P]})}),f=Yle().radius(u).x(function(b){return b.coordinates[0]}).y(function(b){return b.coordinates[1]}),m=f(c),_={dataArray:m.map(function(b,A){var w;if(t.field&&a){var R=rM(b,t.field);b[a]=tM[a](R)}return w={},F(w,t.method,b[a]),F(w,"count",b.length),F(w,"rawData",b),F(w,"coordinates",[b.x,b.y]),F(w,"_id",A),w}),radius:u,xOffset:u,yOffset:u,type:"hexagon"};return _}function Kle(e,t){var r=t.sourceField,n=t.targetField,i=t.data,o={};return i.forEach(function(a){o[a[r]]=a}),e.dataArray=e.dataArray.map(function(a){var u=a[n];return Qe(Qe({},a),o[u])}),e}function Qle(e,t){var r=t.callback;return r&&(e.dataArray=e.dataArray.map(r)),e}pl("rasterTile",dle);pl("mvt",uie);pl("geojsonvt",bne);pl("testTile",yle);pl("geojson",tne);pl("jsonTile",Ane);pl("image",VM);pl("csv",Qre);pl("json",NM);pl("raster",vie);pl("rasterRgb",mle);pl("rgb",ble);pl("ndi",Sle);A0("cluster",AP);A0("filter",Lle);A0("join",Kle);A0("map",Qle);A0("grid",Ule);A0("hexagon",qle);Ci.merge;window._iconfont_svg_string_3580659='<svg><symbol id="l7-icon-area1" viewBox="0 0 1024 1024"><path d="M796.444444 56.888889a113.777778 113.777778 0 0 1 43.064889 219.136l38.798223 466.261333a113.777778 113.777778 0 1 1-133.518223 145.237334H279.210667a113.777778 113.777778 0 1 1-60.302223-137.272889L697.856 227.555556A113.777778 113.777778 0 0 1 796.444444 56.888889z m56.888889 750.933333a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m-682.666666 0a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m577.592889-534.072889L269.198222 796.444444c4.152889 7.168 7.509333 14.791111 10.012445 22.812445h465.578666a114.119111 114.119111 0 0 1 65.479111-71.224889l-38.798222-466.261333a112.924444 112.924444 0 0 1-23.210666-7.964445zM796.444444 125.155556a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-area" viewBox="0 0 1024 1024"><path d="M796.444444 56.888889a113.777778 113.777778 0 0 1 43.008 219.136l38.855112 466.261333a113.777778 113.777778 0 0 1-16.497778 224.540445L853.333333 967.111111a113.777778 113.777778 0 0 1-108.544-79.644444H279.210667a113.834667 113.834667 0 0 1-100.067556 79.36L170.666667 967.111111a113.777778 113.777778 0 0 1-17.066667-226.304l30.492444-351.175111a113.777778 113.777778 0 0 1 34.986667-218.680889L227.555556 170.666667a113.777778 113.777778 0 0 1 99.896888 59.221333l355.84-71.395556a113.777778 113.777778 0 0 1 104.675556-101.262222L796.444444 56.888889z m56.888889 750.933333a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m-682.666666 0a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m526.051555-582.314666L340.650667 296.903111a113.891556 113.891556 0 0 1-88.462223 98.645333l-30.947555 355.84c27.477333 13.653333 48.64 38.115556 58.026667 67.754667h465.521777a114.119111 114.119111 0 0 1 65.536-71.168l-38.855111-466.261333a113.948444 113.948444 0 0 1-74.752-56.206222zM227.555556 238.933333a45.511111 45.511111 0 1 0 0 91.022223 45.511111 45.511111 0 0 0 0-91.022223z m568.888888-113.777777a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-delete" viewBox="0 0 1024 1024"><path d="M705.422222 85.333333a34.133333 34.133333 0 0 1 34.133334 34.133334V227.555556h136.533333a34.133333 34.133333 0 0 1 0 68.266666h-25.543111l-24.348445 610.076445a34.133333 34.133333 0 0 1-34.133333 32.768H231.936a34.133333 34.133333 0 0 1-34.076444-32.768L173.340444 295.822222H147.911111a34.133333 34.133333 0 1 1 0-68.266666H284.444444V119.466667a34.133333 34.133333 0 0 1 34.133334-34.133334h386.844444zM241.720889 295.822222l22.983111 574.577778h494.535111l23.04-574.577778H241.720889zM671.288889 153.6H352.711111V227.555556h318.577778V153.6z" ></path></symbol><symbol id="l7-icon-color" viewBox="0 0 1024 1024"><path d="M512 56.888889c9.841778 0 19.626667 0.341333 29.354667 0.910222 69.176889 4.437333 119.068444 62.577778 124.302222 131.072l0.455111 9.386667c0.739556 44.600889 15.303111 84.935111 44.999111 114.631111 27.022222 27.022222 62.805333 41.528889 102.570667 44.430222l12.060444 0.568889c72.476444 1.194667 135.793778 52.451556 140.458667 124.757333 1.137778 18.261333 1.251556 36.807111 0.170667 55.637334-13.198222 233.585778-211.399111 424.220444-445.326223 428.714666L512 967.111111a455.111111 455.111111 0 0 1-455.054222-464.156444c4.551111-233.927111 195.185778-432.128 428.771555-445.326223C494.535111 57.116444 503.296 56.888889 512 56.888889z m0 68.266667a385.706667 385.706667 0 0 0-22.414222 0.625777C291.726222 136.988444 129.080889 305.948444 125.155556 504.263111c-4.152889 212.366222 163.100444 387.185778 372.508444 394.353778l13.425778 0.227555 8.533333-0.113777c198.371556-3.811556 367.331556-166.456889 378.538667-364.373334a396.174222 396.174222 0 0 0-0.170667-47.331555c-1.991111-31.232-29.127111-56.604444-67.128889-60.472889l-8.248889-0.455111-14.051555-0.682667c-56.547556-4.209778-107.406222-25.884444-145.806222-64.284444-38.855111-38.798222-60.416-90.225778-64.284445-145.749334l-0.910222-21.333333c-2.901333-38.001778-28.785778-66.048-60.302222-68.096A433.891556 433.891556 0 0 0 512 125.155556zM438.044444 682.666667a68.266667 68.266667 0 1 1 0 136.533333 68.266667 68.266667 0 0 1 0-136.533333z m-170.666666-227.555556a68.266667 68.266667 0 1 1 0 136.533333 68.266667 68.266667 0 0 1 0-136.533333z m142.222222-227.555555a68.266667 68.266667 0 1 1 0 136.533333 68.266667 68.266667 0 0 1 0-136.533333z" ></path></symbol><symbol id="l7-icon-base-map" viewBox="0 0 1024 1024"><path d="M923.761778 115.029333A34.133333 34.133333 0 0 1 967.111111 147.911111v624.128a34.133333 34.133333 0 0 1-22.186667 32.028445l-278.755555 103.992888a34.133333 34.133333 0 0 1-23.665778 0.056889L381.724444 812.714667a34.133333 34.133333 0 0 0-23.665777 0.113777L102.968889 908.060444a34.133333 34.133333 0 0 1-45.738667-26.965333L56.888889 876.088889V251.960889a34.133333 34.133333 0 0 1 22.186667-32.028445l278.755555-103.992888a34.133333 34.133333 0 0 1 20.992-0.967112l266.183111 72.988445a34.133333 34.133333 0 0 0 18.204445 0zM403.911111 192.625778v555.576889l216.177778 79.075555V251.960889l-216.177778-59.335111z m-68.266667 4.380444L125.155556 275.569778v551.310222l210.432-78.506667V197.006222zM898.844444 192.853333l-210.545777 58.936889v575.089778l210.545777-78.563556V192.853333z" ></path></symbol><symbol id="l7-icon-dot" viewBox="0 0 1024 1024"><path d="M341.333333 739.555556a113.777778 113.777778 0 0 1 8.533334 227.271111L341.333333 967.111111a113.777778 113.777778 0 0 1-8.533333-227.271111L341.333333 739.555556z m0 68.266666a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222zM910.222222 341.333333a113.777778 113.777778 0 0 1 8.533334 227.271111L910.222222 568.888889a113.777778 113.777778 0 0 1-8.533333-227.271111L910.222222 341.333333z m0 68.266667a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222zM227.555556 56.888889a113.777778 113.777778 0 0 1 8.533333 227.271111L227.555556 284.444444a113.777778 113.777778 0 0 1-8.533334-227.271111L227.555556 56.888889z m0 68.266667a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-display" viewBox="0 0 1024 1024"><path d="M512 170.666667c284.444444 0 455.111111 227.555556 455.111111 341.333333s-170.666667 341.333333-455.111111 341.333333-455.111111-227.555556-455.111111-341.333333 170.666667-341.333333 455.111111-341.333333z m0 68.266666C303.729778 238.933333 125.155556 401.237333 125.155556 512c0 110.762667 178.574222 273.066667 386.844444 273.066667s386.844444-162.304 386.844444-273.066667c0-110.762667-178.574222-273.066667-386.844444-273.066667zM512 341.333333a170.666667 170.666667 0 1 1 0 341.333334 170.666667 170.666667 0 0 1 0-341.333334z m0 68.266667a102.4 102.4 0 1 0 0 204.8 102.4 102.4 0 0 0 0-204.8z" ></path></symbol><symbol id="l7-icon-enlarge" viewBox="0 0 1024 1024"><path d="M546.133333 147.911111l-0.056889 329.955556H876.088889a34.133333 34.133333 0 0 1 0 68.266666H546.076444v329.955556a34.133333 34.133333 0 0 1-68.266666 0V546.133333H147.911111a34.133333 34.133333 0 1 1 0-68.266666h329.898667V147.911111a34.133333 34.133333 0 0 1 68.266666 0z" ></path></symbol><symbol id="l7-icon-export-picture" viewBox="0 0 1024 1024"><path d="M883.873684 161.684211a32.336842 32.336842 0 0 1 32.336842 32.336842v582.063158a32.336842 32.336842 0 0 1-32.336842 32.336842H86.231579a32.336842 32.336842 0 0 1-32.336842-32.336842V194.021053a32.336842 32.336842 0 0 1 32.336842-32.336842h797.642105z m-32.336842 64.673684H118.568421v517.389473h170.792421a32.175158 32.175158 0 0 1 0.431158-0.646736l3.772632-4.473264 330.320842-330.374736a32.336842 32.336842 0 0 1 38.588631-5.389474l4.473263 3.018105 184.589474 147.725474V226.357895z m-202.428631 248.131368L379.850105 743.747368H851.536842v-107.304421l-202.428631-161.953684zM323.368421 323.368421a107.789474 107.789474 0 1 1 0 215.578947 107.789474 107.789474 0 0 1 0-215.578947z m0 64.673684a43.115789 43.115789 0 1 0 0 86.231579 43.115789 43.115789 0 0 0 0-86.231579z" ></path></symbol><symbol id="l7-icon-exit-fullscreen" viewBox="0 0 1024 1024"><path d="M841.955556 591.644444a34.133333 34.133333 0 0 1 5.518222 67.811556l-5.518222 0.455111h-133.745778l192 192.056889a34.133333 34.133333 0 0 1-38.343111 55.182222l-5.176889-2.958222-4.721778-3.982222L659.911111 708.266667V841.955556a34.133333 34.133333 0 0 1-28.615111 33.678222L625.777778 876.088889a34.133333 34.133333 0 0 1-33.678222-28.615111L591.644444 841.955556V625.777778a34.133333 34.133333 0 0 1 28.615112-33.678222L625.777778 591.644444h216.177778z m-443.733334 0a34.133333 34.133333 0 0 1 33.678222 28.615112L432.355556 625.777778v216.177778a34.133333 34.133333 0 0 1-67.811556 5.518222L364.088889 841.955556v-133.745778l-192.056889 192a34.133333 34.133333 0 0 1-52.224-43.52l3.982222-4.721778L315.847111 659.911111H182.044444a34.133333 34.133333 0 0 1-33.678222-28.615111L147.911111 625.777778a34.133333 34.133333 0 0 1 28.615111-33.678222L182.044444 591.644444H398.222222zM167.310222 119.808l4.721778 3.982222L364.088889 315.847111V182.044444a34.133333 34.133333 0 0 1 28.615111-33.678222L398.222222 147.911111a34.133333 34.133333 0 0 1 33.678222 28.615111L432.355556 182.044444V398.222222a34.133333 34.133333 0 0 1-28.615112 33.678222L398.222222 432.355556H182.044444a34.133333 34.133333 0 0 1-5.518222-67.811556L182.044444 364.088889h133.802667L123.790222 172.032a34.133333 34.133333 0 0 1 43.52-52.224z m732.899556 3.982222a34.133333 34.133333 0 0 1 3.982222 43.52l-3.982222 4.721778L708.266667 364.088889H841.955556a34.133333 34.133333 0 0 1 33.678222 28.615111L876.088889 398.222222a34.133333 34.133333 0 0 1-28.615111 33.678222L841.955556 432.355556H625.777778a34.133333 34.133333 0 0 1-33.678222-28.615112L591.644444 398.222222V182.044444a34.133333 34.133333 0 0 1 67.811556-5.518222l0.455111 5.518222v133.802667l192.056889-192.056889a34.133333 34.133333 0 0 1 48.241778 0z" ></path></symbol><symbol id="l7-icon-line" viewBox="0 0 1024 1024"><path d="M853.333333 56.888889a113.777778 113.777778 0 0 1 8.533334 227.271111L853.333333 284.444444c-19.000889 0-36.864-4.664889-52.622222-12.856888l-529.123555 529.066666a113.777778 113.777778 0 0 1-92.387556 166.115556L170.666667 967.111111a113.777778 113.777778 0 0 1-8.533334-227.271111L170.666667 739.555556c19.000889 0 36.864 4.664889 52.622222 12.856888l529.123555-529.066666a113.777778 113.777778 0 0 1 92.387556-166.115556L853.333333 56.888889zM170.666667 807.822222a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m682.666666-682.666666a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-layer" viewBox="0 0 1024 1024"><path d="M767.089778 625.777778l180.167111 82.773333a34.133333 34.133333 0 0 1 4.892444 59.278222l-4.892444 2.730667-420.977778 193.422222a34.133333 34.133333 0 0 1-22.983111 1.991111l-5.575111-1.991111-420.977778-193.422222a34.133333 34.133333 0 0 1-4.892444-59.278222l4.892444-2.730667L256.853333 625.777778l81.749334 37.546666L172.771556 739.555556 512 895.374222 851.171556 739.555556l-165.831112-76.231112 81.749334-37.546666z m0-227.555556l180.167111 82.773334a34.133333 34.133333 0 0 1 4.892444 59.278222l-4.892444 2.730666-420.977778 193.422223a34.133333 34.133333 0 0 1-22.983111 1.991111l-5.575111-1.991111-420.977778-193.422223a34.133333 34.133333 0 0 1-4.892444-59.278222l4.892444-2.730666L256.853333 398.222222l81.749334 37.546667-165.831111 76.174222L512 667.818667l339.171556-155.875556-165.831112-76.174222L767.089778 398.222222zM497.720889 60.017778a34.133333 34.133333 0 0 1 28.558222 0l420.977778 193.422222a34.133333 34.133333 0 0 1 0 62.008889l-420.977778 193.422222a34.133333 34.133333 0 0 1-28.558222 0l-420.977778-193.422222a34.133333 34.133333 0 0 1 0-62.008889zM512 128.568889L172.771556 284.387556 512 440.263111l339.171556-155.875555L512 128.568889z" ></path></symbol><symbol id="l7-icon-narrow" viewBox="0 0 1024 1024"><path d="M910.222222 512a34.133333 34.133333 0 0 1-34.133333 34.133333H147.911111a34.133333 34.133333 0 1 1 0-68.266666h728.177778a34.133333 34.133333 0 0 1 34.133333 34.133333z" ></path></symbol><symbol id="l7-icon-fullscreen" viewBox="0 0 1024 1024"><path d="M645.176889 597.674667l4.721778 3.982222L841.955556 793.6l0.056888-133.688889a34.133333 34.133333 0 0 1 28.615112-33.678222L876.088889 625.777778a34.133333 34.133333 0 0 1 33.678222 28.615111L910.222222 659.911111v216.177778a34.133333 34.133333 0 0 1-28.615111 33.678222L876.088889 910.222222h-216.177778a34.133333 34.133333 0 0 1-5.518222-67.811555l5.518222-0.455111h133.745778l-192-192.056889a34.133333 34.133333 0 0 1 43.52-52.224z m-222.833778 3.982222a34.133333 34.133333 0 0 1 3.982222 43.52l-3.982222 4.721778L230.286222 841.955556H364.088889a34.133333 34.133333 0 0 1 33.678222 28.615111L398.222222 876.088889a34.133333 34.133333 0 0 1-28.615111 33.678222L364.088889 910.222222H147.911111a34.133333 34.133333 0 0 1-33.678222-28.615111L113.777778 876.088889v-216.177778a34.133333 34.133333 0 0 1 67.811555-5.518222l0.455111 5.518222-0.056888 133.745778 192.113777-192a34.133333 34.133333 0 0 1 48.241778 0zM364.088889 113.777778a34.133333 34.133333 0 0 1 5.518222 67.811555L364.088889 182.044444H230.343111l192 192.056889a34.133333 34.133333 0 0 1-43.52 52.224l-4.721778-3.982222-192.113777-192.056889L182.044444 364.088889a34.133333 34.133333 0 0 1-28.615111 33.678222L147.911111 398.222222a34.133333 34.133333 0 0 1-33.678222-28.615111L113.777778 364.088889V147.911111a34.133333 34.133333 0 0 1 28.615111-33.678222L147.911111 113.777778h216.177778z m512 0a34.133333 34.133333 0 0 1 33.678222 28.615111L910.222222 147.911111v216.177778a34.133333 34.133333 0 0 1-67.811555 5.518222L841.955556 364.088889l-0.056889-133.745778-192 192a34.133333 34.133333 0 0 1-52.224-43.52l3.982222-4.721778L793.6 182.044444H659.911111a34.133333 34.133333 0 0 1-33.678222-28.615111L625.777778 147.911111a34.133333 34.133333 0 0 1 28.615111-33.678222L659.911111 113.777778h216.177778z" ></path></symbol><symbol id="l7-icon-hide" viewBox="0 0 1024 1024"><path d="M875.52 87.836444a34.133333 34.133333 0 0 1 7.281778 43.121778l-3.527111 5.006222-682.666667 796.444445a34.133333 34.133333 0 0 1-55.409778-39.367111l3.527111-5.006222 97.166223-113.379556C123.164444 697.969778 56.888889 582.940444 56.888889 512c0-113.777778 170.666667-341.333333 455.111111-341.333333a496.64 496.64 0 0 1 208.952889 45.112889l106.439111-124.188445a34.133333 34.133333 0 0 1 48.128-3.754667z m-38.684444 202.524445C921.031111 362.951111 967.111111 452.835556 967.111111 512c0 113.777778-170.666667 341.333333-455.111111 341.333333-50.631111 0-97.678222-7.224889-140.8-19.740444l50.232889-58.595556A417.393778 417.393778 0 0 0 512 785.066667c208.270222 0 386.844444-162.304 386.844444-273.066667 0-52.849778-40.675556-117.418667-105.813333-170.496l43.804445-51.2zM512 238.933333C303.729778 238.933333 125.155556 401.237333 125.155556 512c0 66.787556 64.853333 152.291556 162.133333 209.692444L377.173333 616.675556a170.666667 170.666667 0 0 1 217.713778-253.895112l78.620445-91.704888A432.924444 432.924444 0 0 0 512 238.933333z m166.684444 236.088889a170.666667 170.666667 0 0 1-177.664 207.303111l177.607112-207.303111zM512 409.6a102.4 102.4 0 0 0-88.746667 153.486222L548.864 416.426667A102.172444 102.172444 0 0 0 512 409.6z" ></path></symbol><symbol id="l7-icon-rectangle" viewBox="0 0 1024 1024"><path d="M170.666667 56.888889a113.777778 113.777778 0 0 1 108.544 79.644444H853.333333a34.133333 34.133333 0 0 1 33.678223 28.615111L887.466667 170.666667v574.122666a113.777778 113.777778 0 1 1-142.677334 142.734223L170.666667 887.466667a34.133333 34.133333 0 0 1-33.678223-28.615111L136.533333 853.333333V279.210667A113.777778 113.777778 0 0 1 170.666667 56.888889z m682.666666 750.933333a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m-34.133333-603.022222H279.210667a114.062222 114.062222 0 0 1-74.353778 74.410667L204.8 819.2h539.989333a114.062222 114.062222 0 0 1 74.410667-74.410667V204.8zM170.666667 125.155556a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-ranging" viewBox="0 0 1024 1024"><path d="M723.171556 50.403556l250.424888 250.424888a31.061333 31.061333 0 0 1 0 43.918223L344.746667 973.596444a31.061333 31.061333 0 0 1-43.918223 0L50.403556 723.171556a31.061333 31.061333 0 0 1 0-43.918223L679.253333 50.403556a31.061333 31.061333 0 0 1 43.918223 0z m-21.959112 74.524444l-39.765333 39.822222 98.986667 98.872889a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.640889-98.929778-98.929778-63.886222 63.886222 62.179556 62.122667a34.133333 34.133333 0 0 1-44.088889 51.882667L563.2 387.242667 501.077333 325.063111 437.191111 388.949333l98.986667 98.929778a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.640889-98.929778-98.929778-63.886222 63.886222L387.242667 563.2a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.584-62.122667-62.179556-63.886222 63.886222 98.986667 98.929778a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.640889-98.929778-98.929778-39.765333 39.822222 197.802667 197.745778 576.284444-576.284444-197.802667-197.745778z" ></path></symbol><symbol id="l7-icon-reposition" viewBox="0 0 1024 1024"><path d="M512 56.888889a34.133333 34.133333 0 0 1 34.133333 34.133333v24.177778A398.336 398.336 0 0 1 908.856889 477.866667h24.177778a34.133333 34.133333 0 0 1 0 68.266666h-24.177778A398.336 398.336 0 0 1 546.133333 908.856889L546.133333 932.977778a34.133333 34.133333 0 0 1-68.266666 0v-24.177778A398.336 398.336 0 0 1 115.2 546.133333L91.022222 546.133333a34.133333 34.133333 0 1 1 0-68.266666h24.177778A398.336 398.336 0 0 1 477.866667 115.2V91.022222A34.133333 34.133333 0 0 1 512 56.888889z m34.190222 126.862222L546.133333 193.422222a34.133333 34.133333 0 1 1-68.266666 0v-9.671111A330.069333 330.069333 0 0 0 183.751111 477.866667h9.671111a34.133333 34.133333 0 1 1 0 68.266666l-9.671111 0.056889A330.069333 330.069333 0 0 0 477.866667 840.248889V830.577778a34.133333 34.133333 0 0 1 68.266666 0l0.056889 9.671111A330.069333 330.069333 0 0 0 840.248889 546.133333L830.577778 546.133333a34.133333 34.133333 0 0 1 0-68.266666h9.671111A330.069333 330.069333 0 0 0 546.133333 183.751111zM512 341.333333a170.666667 170.666667 0 1 1 0 341.333334 170.666667 170.666667 0 0 1 0-341.333334z m0 68.266667a102.4 102.4 0 1 0 0 204.8 102.4 102.4 0 0 0 0-204.8z" ></path></symbol><symbol id="l7-icon-round" viewBox="0 0 1024 1024"><path d="M512 56.888889a455.111111 455.111111 0 0 1 391.395556 687.502222 113.777778 113.777778 0 0 1-159.061334 158.890667A455.111111 455.111111 0 0 1 120.604444 279.608889 113.777778 113.777778 0 0 1 279.608889 120.604444 452.835556 452.835556 0 0 1 512 56.888889z m0 68.266667a384.910222 384.910222 0 0 0-191.715556 50.744888A113.777778 113.777778 0 0 1 175.957333 320.284444a386.844444 386.844444 0 0 0 527.815111 527.758223 113.777778 113.777778 0 0 1 144.270223-144.440889A386.844444 386.844444 0 0 0 512 125.155556z m299.406222 640.739555a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222zM212.593778 167.082667a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-guanbi" viewBox="0 0 1024 1024"><path d="M576 512l277.333333 277.333333-64 64-277.333333-277.333333L234.666667 853.333333 170.666667 789.333333l277.333333-277.333333L170.666667 234.666667 234.666667 170.666667l277.333333 277.333333L789.333333 170.666667 853.333333 234.666667 576 512z" ></path></symbol></svg>',function(e){try{let f=function(){u||(u=!0,o())},m=function(){try{a.documentElement.doScroll("left")}catch{return void setTimeout(m,50)}f()};var r=(r=document.getElementsByTagName("script"))[r.length-1],t=r.getAttribute("data-injectcss"),r=r.getAttribute("data-disable-injectsvg");if(!r){var n,i,o,a,u,c=function(b,A){A.parentNode.insertBefore(b,A)};if(t&&!e.__iconfont__svg__cssinject__){e.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(_){console&&console.log(_)}}n=function(){var b,A=document.createElement("div");A.innerHTML=e._iconfont_svg_string_3580659,(A=A.getElementsByTagName("svg")[0])&&(A.setAttribute("aria-hidden","true"),A.style.position="absolute",A.style.width=0,A.style.height=0,A.style.overflow="hidden",A=A,(b=document.body).firstChild?c(A,b.firstChild):b.appendChild(A))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),n()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=n,a=e.document,u=!1,m(),a.onreadystatechange=function(){a.readyState=="complete"&&(a.onreadystatechange=null,f())})}}catch{}}(window);function Jle(e){var t=ece();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function ece(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var CP=function(e){_n(r,e);var t=Jle(r);function r(n){var i;return Ht(this,r),i=t.call(this),r.controlCount++,i.controlOption=Qe(Qe({},i.getDefault(n)),n||{}),i}return jt(r,[{key:"getOptions",value:function(){return this.controlOption}},{key:"setOptions",value:function(i){var o=this.getDefault(i);Object.entries(i).forEach(function(a){var u=Nn(a,2),c=u[0],f=u[1];f===void 0&&(i[c]=o[c])}),"position"in i&&this.setPosition(i.position),"className"in i&&this.setClassName(i.className),"style"in i&&this.setStyle(i.style),this.controlOption=Qe(Qe({},this.controlOption),i)}},{key:"addTo",value:function(i){this.mapsService=i.get(wt.IMapService),this.renderService=i.get(wt.IRendererService),this.layerService=i.get(wt.ILayerService),this.controlService=i.get(wt.IControlService),this.configService=i.get(wt.IGlobalConfigService),this.scene=i.get(wt.ISceneService),this.sceneContainer=i,this.isShow=!0,this.container=this.onAdd(),nm(this.container,"l7-control");var o=this.controlOption,a=o.className,u=o.style;return a&&this.setClassName(a),u&&this.setStyle(u),this.insertContainer(),this.emit("add",this),this}},{key:"remove",value:function(){if(!this.mapsService)return this;e_(this.container),this.onRemove(),this.emit("remove",this)}},{key:"onAdd",value:function(){return fl("div")}},{key:"onRemove",value:function(){}},{key:"show",value:function(){var i=this.container;$6(i,"l7-control--hide"),this.isShow=!0,this.emit("show",this)}},{key:"hide",value:function(){var i=this.container;nm(i,"l7-control--hide"),this.isShow=!1,this.emit("hide",this)}},{key:"getDefault",value:function(i){return{position:n_.TOPRIGHT,name:"".concat(r.controlCount)}}},{key:"getContainer",value:function(){return this.container}},{key:"getIsShow",value:function(){return this.isShow}},{key:"_refocusOnMap",value:function(i){if(this.mapsService&&i&&i.screenX>0&&i.screenY>0){var o=this.mapsService.getContainer();o!==null&&o.focus()}}},{key:"setPosition",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:n_.TOPLEFT,o=this.controlService;return o&&o.removeControl(this),this.controlOption.position=i,o&&o.addControl(this,this.sceneContainer),this}},{key:"setClassName",value:function(i){var o=this.container,a=this.controlOption.className;a&&$6(o,a),i&&nm(o,i)}},{key:"setStyle",value:function(i){var o=this.container;i?o.setAttribute("style",i):o.removeAttribute("style")}},{key:"insertContainer",value:function(){var i=this.controlOption.position,o=this.container;if(i instanceof Element)i.appendChild(o);else{var a=this.controlService.controlCorners[i];["bottomleft","bottomright","righttop","rightbottom"].includes(i)?a.insertBefore(o,a.firstChild):a.appendChild(o)}}},{key:"checkUpdateOption",value:function(i,o){return o.some(function(a){return a in i})}}]),r}(D5);F(CP,"controlCount",0);function tce(e){var t=rce();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function rce(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var nce=function(e){_n(r,e);var t=tce(r);function r(n,i){var o;return Ht(this,r),o=t.call(this),F($e(o),"isShow",!1),F($e(o),"timeout",null),F($e(o),"show",function(){return o.isShow||!o.contentDOM.innerHTML||(o.resetPopperPosition(),$6(o.popperDOM,"l7-popper-hide"),o.isShow=!0,o.option.unique&&r.conflictPopperList.forEach(function(a){a!==$e(o)&&a.isShow&&a.hide()}),o.emit("show"),window.addEventListener("pointerdown",o.onPopperUnClick)),$e(o)}),F($e(o),"hide",function(){return o.isShow&&(nm(o.popperDOM,"l7-popper-hide"),o.isShow=!1,o.emit("hide"),window.removeEventListener("pointerdown",o.onPopperUnClick)),$e(o)}),F($e(o),"setHideTimeout",function(){o.timeout||(o.timeout=window.setTimeout(function(){o.isShow&&(o.hide(),o.timeout=null)},300))}),F($e(o),"clearHideTimeout",function(){o.timeout&&(window.clearTimeout(o.timeout),o.timeout=null)}),F($e(o),"onBtnClick",function(){o.isShow?o.hide():o.show()}),F($e(o),"onPopperUnClick",function(a){Eee(a.target,[".l7-button-control",".l7-popper-content"])||o.hide()}),F($e(o),"onBtnMouseLeave",function(){o.setHideTimeout()}),F($e(o),"onBtnMouseMove",function(){o.clearHideTimeout(),!o.isShow&&o.show()}),o.button=n,o.option=i,o.init(),i.unique&&r.conflictPopperList.push($e(o)),o}return jt(r,[{key:"buttonRect",get:function(){return this.button.getBoundingClientRect()}},{key:"getPopperDOM",value:function(){return this.popperDOM}},{key:"getIsShow",value:function(){return this.isShow}},{key:"getContent",value:function(){return this.content}},{key:"setContent",value:function(i){typeof i=="string"?this.contentDOM.innerHTML=i:i instanceof HTMLElement&&(KI(this.contentDOM),this.contentDOM.appendChild(i)),this.content=i}},{key:"init",value:function(){var i=this.option.trigger;this.popperDOM=this.createPopper(),i==="click"?this.button.addEventListener("click",this.onBtnClick):(this.button.addEventListener("mousemove",this.onBtnMouseMove),this.button.addEventListener("mouseleave",this.onBtnMouseLeave),this.popperDOM.addEventListener("mousemove",this.onBtnMouseMove),this.popperDOM.addEventListener("mouseleave",this.onBtnMouseLeave))}},{key:"destroy",value:function(){this.button.removeEventListener("click",this.onBtnClick),this.button.removeEventListener("mousemove",this.onBtnMouseMove),this.button.removeEventListener("mousemove",this.onBtnMouseLeave),this.popperDOM.removeEventListener("mousemove",this.onBtnMouseMove),this.popperDOM.removeEventListener("mouseleave",this.onBtnMouseLeave),e_(this.popperDOM)}},{key:"resetPopperPosition",value:function(){var i={},o=this.option,a=o.container,u=o.offset,c=u===void 0?[0,0]:u,f=o.placement,m=Nn(c,2),_=m[0],b=m[1],A=this.button.getBoundingClientRect(),w=a.getBoundingClientRect(),R=xee(A,w),P=R.left,k=R.right,L=R.top,B=R.bottom,V=!1,G=!1;/^(left|right)/.test(f)?(f.includes("left")?i.right="".concat(A.width+k,"px"):f.includes("right")&&(i.left="".concat(A.width+P,"px")),f.includes("start")?i.top="".concat(L,"px"):f.includes("end")?i.bottom="".concat(B,"px"):(i.top="".concat(L+A.height/2,"px"),G=!0,i.transform="translate(".concat(_,"px, calc(").concat(b,"px - 50%))"))):/^(top|bottom)/.test(f)&&(f.includes("top")?i.bottom="".concat(A.height+B,"px"):f.includes("bottom")&&(i.top="".concat(A.height+L,"px")),f.includes("start")?i.left="".concat(P,"px"):f.includes("end")?i.right="".concat(k,"px"):(i.left="".concat(P+A.width/2,"px"),V=!0,i.transform="translate(calc(".concat(_,"px - 50%), ").concat(b,"px)"))),i.transform="translate(calc(".concat(_,"px - ").concat(V?"50%":"0%","), calc(").concat(b,"px - ").concat(G?"50%":"0%",")");var K=f.split("-");K.length&&nm(this.popperDOM,K.map(function(Z){return"l7-popper-".concat(Z)}).join(" ")),_ee(this.popperDOM,yee(i))}},{key:"createPopper",value:function(){var i=this.option,o=i.container,a=i.className,u=a===void 0?"":a,c=i.content,f=fl("div","l7-popper l7-popper-hide ".concat(u)),m=fl("div","l7-popper-content"),_=fl("div","l7-popper-arrow");return f.appendChild(m),f.appendChild(_),o.appendChild(f),this.popperDOM=f,this.contentDOM=m,c&&this.setContent(c),f}}]),r}(ju.EventEmitter);F(nce,"conflictPopperList",[]);function ice(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ace(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function ace(e,t){if(e){if(typeof e=="string")return HA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return HA(e,t)}}function HA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var GA=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],ah=function(){if(typeof document>"u")return!1;for(var e=GA[0],t={},r=0,n=GA;r<n.length;r++){var i=n[r],o=i==null?void 0:i[1];if(o in document){var a=ice(i.entries()),u;try{for(a.s();!(u=a.n()).done;){var c=Nn(u.value,2),f=c[0],m=c[1];t[e[f]]=m}}catch(_){a.e(_)}finally{a.f()}return t}}return!1}(),WA={change:ah.fullscreenchange,error:ah.fullscreenerror},Vl={request:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document.documentElement,r=arguments.length>1?arguments[1]:void 0;return new Promise(function(n,i){var o=function u(){Vl.off("change",u),n()};Vl.on("change",o);var a=t[ah.requestFullscreen](r);a instanceof Promise&&a.then(o).catch(i)})},exit:function(){return new Promise(function(t,r){if(!Vl.isFullscreen){t();return}var n=function o(){Vl.off("change",o),t()};Vl.on("change",n);var i=document[ah.exitFullscreen]();i instanceof Promise&&i.then(n).catch(r)})},toggle:function(t,r){return Vl.isFullscreen?Vl.exit():Vl.request(t,r)},onchange:function(t){Vl.on("change",t)},onerror:function(t){Vl.on("error",t)},on:function(t,r){var n=WA[t];n&&document.addEventListener(n,r,!1)},off:function(t,r){var n=WA[t];n&&document.removeEventListener(n,r,!1)},raw:ah};Object.defineProperties(Vl,{isFullscreen:{get:function(){return!!document[ah.fullscreenElement]}},element:{enumerable:!0,get:function(){var t;return(t=document[ah.fullscreenElement])!==null&&t!==void 0?t:void 0}},isEnabled:{enumerable:!0,get:function(){return!!document[ah.fullscreenEnabled]}}});ah||(Vl={isEnabled:!1});function oce(e){var t=sce();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function sce(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var uce=function(e){_n(r,e);var t=oce(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getDefault",value:function(){return{position:n_.BOTTOMLEFT,name:"logo",href:"https://l7.antv.antgroup.com/",img:"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*GRb1TKp4HcMAAAAAAAAAAAAAARQnAQ"}}},{key:"onAdd",value:function(){var i=fl("div","l7-control-logo");return this.setLogoContent(i),i}},{key:"onRemove",value:function(){return null}},{key:"setOptions",value:function(i){gp(Bt(r.prototype),"setOptions",this).call(this,i),this.checkUpdateOption(i,["img","href"])&&(KI(this.container),this.setLogoContent(this.container))}},{key:"setLogoContent",value:function(i){var o=this.controlOption,a=o.href,u=o.img,c=fl("img");if(c.setAttribute("src",u),c.setAttribute("aria-label","AntV logo"),bee(c),a){var f=fl("a","l7-control-logo-link");f.target="_blank",f.href=a,f.rel="noopener nofollow",f.setAttribute("rel","noopener nofollow"),f.appendChild(c),i.appendChild(f)}else i.appendChild(c)}}]),r}(CP),Kh,RP=(Kh={},F(Kh,up.additive,{enable:!0,func:{srcRGB:W.ONE,dstRGB:W.ONE,srcAlpha:1,dstAlpha:1}}),F(Kh,up.none,{enable:!1}),F(Kh,up.normal,{enable:!0,func:{srcRGB:W.SRC_ALPHA,dstRGB:W.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}}),F(Kh,up.subtractive,{enable:!0,func:{srcRGB:W.ONE,dstRGB:W.ONE,srcAlpha:W.ZERO,dstAlpha:W.ONE_MINUS_SRC_COLOR},equation:{rgb:W.FUNC_SUBTRACT,alpha:W.FUNC_SUBTRACT}}),F(Kh,up.max,{enable:!0,func:{srcRGB:W.ONE,dstRGB:W.ONE},equation:{rgb:W.MAX_EXT}}),F(Kh,up.min,{enable:!0,func:{srcRGB:W.ONE,dstRGB:W.ONE},equation:{rgb:W.MIN_EXT}}),Kh);function IP(e){return e.map(function(t){return typeof t=="string"&&(t=[t,{}]),t})}function MP(e,t,r,n){var i=e.multiPassRenderer,o=e.getLayerConfig(),a=o.enableTAA;return a?i.add(n("taa")):i.add(n("render")),IP(t).forEach(function(u){var c=Nn(u,2),f=c[0],m=c[1];i.add(r(f),m)}),i.add(r("copy")),i}var lce=function(){function e(t){Ht(this,e),this.layer=t}return jt(e,[{key:"pickRender",value:function(r){var n=this.layer.getContainer(),i=n.get(wt.ILayerService),o=this.layer;if(o.tileLayer)return o.tileLayer.pickRender(r);o.hooks.beforePickingEncode.call(),i.renderTileLayerMask(o),o.renderModels({ispick:!0}),o.hooks.afterPickingEncode.call()}},{key:"pick",value:function(){var t=Mt(he.mark(function n(i,o){var a,u;return he.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(a=this.layer.getContainer(),u=a.get(wt.IPickingService),i.type!=="RasterLayer"){f.next=4;break}return f.abrupt("return",this.pickRasterLayer(i,o));case 4:return this.pickRender(o),f.abrupt("return",u.pickFromPickingFBO(i,o));case 6:case"end":return f.stop()}},n,this)}));function r(n,i){return t.apply(this,arguments)}return r}()},{key:"pickRasterLayer",value:function(r,n,i){var o=this.layer.getContainer(),a=o.get(wt.IPickingService),u=o.get(wt.IMapService),c=this.layer.getSource().extent,f=Aee(n.lngLat,c),m={x:n.x,y:n.y,type:n.type,lngLat:n.lngLat,target:n,rasterValue:null},_=i||r;if(f){var b=this.readRasterValue(r,c,u,n.x,n.y);return m.rasterValue=b,a.triggerHoverOnLayer(_,m),!0}else return m.type=n.type==="mousemove"?"mouseout":"un"+n.type,a.triggerHoverOnLayer(_,Qe(Qe({},m),{},{type:"unpick"})),a.triggerHoverOnLayer(_,m),!1}},{key:"readRasterValue",value:function(r,n,i,o,a){var u=r.getSource().data.dataArray[0],c=Nn(n,4),f=c[0],m=f===void 0?0:f,_=c[1],b=_===void 0?0:_,A=c[2],w=A===void 0?10:A,R=c[3],P=R===void 0?-10:R,k=i.lngLatToContainer([m,b]),L=i.lngLatToContainer([w,P]),B=L.x-k.x,V=k.y-L.y,G=[(o-k.x)/B,(a-L.y)/V],K=u.width||1,Z=u.height||1,ve=Math.floor(G[0]*K),Ie=Math.floor(G[1]*Z),de=Math.max(0,Ie-1)*K+ve,se=u.data[de];return se}},{key:"selectFeature",value:function(r){var n=this.layer,i=Nn(r,3),o=i[0],a=i[1],u=i[2];n.hooks.beforeSelect.call([o,a,u])}},{key:"highlightPickedFeature",value:function(r){var n=Nn(r,3),i=n[0],o=n[1],a=n[2];this.layer.hooks.beforeHighlight.call([i,o,a])}},{key:"getFeatureById",value:function(r){return this.layer.getSource().getFeatureById(r)}}]),e}(),cce=function(){function e(t){Ht(this,e),this.layer=t;var r=this.layer.getContainer();this.rendererService=r.get(wt.IRendererService)}return jt(e,[{key:"getColorTexture",value:function(r,n){var i=this.getTextureKey(r,n);return this.key===i?this.colorTexture:(this.createColorTexture(r,n),this.key=i,this.colorTexture)}},{key:"createColorTexture",value:function(r,n){var i=this.rendererService.createTexture2D,o=this.getColorRampBar(r,n),a=i({data:new Uint8Array(o.data),width:o.width,height:o.height,flipY:!1,unorm:!0});return this.colorTexture=a,a}},{key:"setColorTexture",value:function(r,n,i){this.key=this.getTextureKey(n,i),this.colorTexture=r}},{key:"destroy",value:function(){var r;(r=this.colorTexture)===null||r===void 0||r.destroy()}},{key:"getColorRampBar",value:function(r,n){switch(r.type){case"cat":return WL(r);case"quantize":return XL(r);case"custom":return YL(r,n);case"linear":return GL(r,n);default:return HL(r)}}},{key:"getTextureKey",value:function(r,n){var i;return"".concat(r.colors.join("_"),"_").concat(r==null||(i=r.positions)===null||i===void 0?void 0:i.join("_"),"_").concat(r.type,"_").concat(n==null?void 0:n.join("_"))}}]),e}(),fce=["passes"],hce=["moduleName","vertexShader","fragmentShader","inject","triangulation","styleOption","pickingEnabled"],XA,Y3,YA;function pce(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=dce(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function dce(e,t){if(e){if(typeof e=="string")return ZA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ZA(e,t)}}function ZA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function vce(e){var t=mce();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function mce(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Z3=Ci.isEqual,qA=Ci.isFunction,KA=Ci.isNumber,Ds=Ci.isObject,gce=Ci.isPlainObject,_ce=Ci.isUndefined,QA=0,P0=(XA=rb(wt.IGlobalConfigService),Y3=function(e){_n(r,e);var t=vce(r);function r(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Ht(this,r),n=t.call(this),F($e(n),"id","".concat(QA++)),F($e(n),"name","".concat(QA)),F($e(n),"visible",!0),F($e(n),"zIndex",0),F($e(n),"inited",!1),F($e(n),"layerModelNeedUpdate",!1),F($e(n),"pickedFeatureID",null),F($e(n),"selectedFeatureID",null),F($e(n),"styleNeedUpdate",!1),F($e(n),"forceRender",!1),F($e(n),"clusterZoom",0),F($e(n),"defaultSourceConfig",{data:[],options:{parser:{type:"json"}}}),F($e(n),"dataState",{dataSourceNeedUpdate:!1,dataMappingNeedUpdate:!1,filterNeedUpdate:!1,featureScaleNeedUpdate:!1,StyleAttrNeedUpdate:!1}),F($e(n),"hooks",{init:new Yoe,afterInit:new Z8,beforeRender:new Z8,beforeRenderData:new Zoe,afterRender:new nf,beforePickingEncode:new nf,afterPickingEncode:new nf,beforeHighlight:new nf(["pickedColor"]),afterHighlight:new nf,beforeSelect:new nf(["pickedColor"]),afterSelect:new nf,beforeDestroy:new nf,afterDestroy:new nf}),F($e(n),"models",[]),F($e(n),"startInit",!1),F($e(n),"layerChildren",[]),F($e(n),"masks",[]),bi($e(n),"configService",YA,$e(n)),F($e(n),"animateOptions",{enable:!1}),F($e(n),"currentPickId",null),F($e(n),"encodeStyleAttribute",{}),F($e(n),"enableShaderEncodeStyles",[]),F($e(n),"enableDataEncodeStyles",[]),F($e(n),"pendingStyleAttributes",[]),F($e(n),"scaleOptions",{}),F($e(n),"animateStatus",!1),F($e(n),"isDestroyed",!1),F($e(n),"uniformBuffers",[]),F($e(n),"encodeDataLength",0),F($e(n),"sourceEvent",function(){n.dataState.dataSourceNeedUpdate=!0;var o=n.getLayerConfig();o&&o.autoFit&&n.fitBounds(o.fitBoundsOptions);var a=n.layerSource.getSourceCfg().autoRender;a&&setTimeout(function(){n.reRender()},10)}),n.name=i.name||n.id,n.zIndex=i.zIndex||0,n.rawConfig=i,n}return jt(r,[{key:"addMask",value:function(i){this.masks.push(i),this.updateLayerConfig({maskLayers:this.masks}),this.enableMask()}},{key:"removeMask",value:function(i){var o=this.masks.indexOf(i);o>-1&&this.masks.splice(o,1),this.updateLayerConfig({maskLayers:this.masks})}},{key:"disableMask",value:function(){this.updateLayerConfig({enableMask:!1})}},{key:"enableMask",value:function(){this.updateLayerConfig({enableMask:!0})}},{key:"addMaskLayer",value:function(i){this.masks.push(i)}},{key:"removeMaskLayer",value:function(i){var o=this.masks.indexOf(i);o>-1&&this.masks.splice(o,1),i.destroy()}},{key:"getAttribute",value:function(i){return this.styleAttributeService.getLayerStyleAttribute(i)}},{key:"getLayerConfig",value:function(){return this.configService.getLayerConfig(this.id)}},{key:"updateLayerConfig",value:function(i){var o=this;if(Object.keys(i).map(function(u){u in o.rawConfig&&(o.rawConfig[u]=i[u])}),!this.startInit)this.needUpdateConfig=Qe(Qe({},this.needUpdateConfig),i);else{var a=this.container.get(wt.SceneID);this.configService.setLayerConfig(a,this.id,Qe(Qe(Qe({},this.configService.getLayerConfig(this.id)),this.needUpdateConfig),i)),this.needUpdateConfig={}}}},{key:"setContainer",value:function(i,o){this.container=i,this.sceneContainer=o}},{key:"getContainer",value:function(){return this.container}},{key:"addPlugin",value:function(i){return this.plugins.push(i),this}},{key:"init",value:function(){var n=Mt(he.mark(function o(){var a=this,u,c,f,m,_,b,A;return he.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:u=this.container.get(wt.SceneID),this.startInit=!0,this.configService.setLayerConfig(u,this.id,this.rawConfig),this.layerType=this.rawConfig.layerType,this.iconService=this.container.get(wt.IIconService),this.fontService=this.container.get(wt.IFontService),this.rendererService=this.container.get(wt.IRendererService),this.layerService=this.container.get(wt.ILayerService),this.debugService=this.container.get(wt.IDebugService),this.interactionService=this.container.get(wt.IInteractionService),this.pickingService=this.container.get(wt.IPickingService),this.mapService=this.container.get(wt.IMapService),c=this.getLayerConfig(),f=c.enableMultiPassRenderer,m=c.passes,f&&m!==null&&m!==void 0&&m.length&&m.length>0&&this.mapService.on("mapAfterFrameChange",function(){a.renderLayers()}),this.cameraService=this.container.get(wt.ICameraService),this.coordinateService=this.container.get(wt.ICoordinateSystemService),this.shaderModuleService=this.container.get(wt.IShaderModuleService),this.postProcessingPassFactory=this.container.get(wt.IFactoryPostProcessingPass),this.normalPassFactory=this.container.get(wt.IFactoryNormalPass),this.styleAttributeService=this.container.get(wt.IStyleAttributeService),f&&(this.multiPassRenderer=this.container.get(wt.IMultiPassRenderer),this.multiPassRenderer.setLayer(this)),this.pendingStyleAttributes.forEach(function(P){var k=P.attributeName,L=P.attributeField,B=P.attributeValues,V=P.updateOptions;a.styleAttributeService.updateStyleAttribute(k,{scale:Qe({field:L},a.splitValuesAndCallbackInAttribute(B,L?void 0:a.getLayerConfig()[k]))},V)}),this.pendingStyleAttributes=[],this.plugins=this.container.getAll(wt.ILayerPlugin),_=pce(this.plugins);try{for(_.s();!(b=_.n()).done;)A=b.value,A.apply(this,{rendererService:this.rendererService,mapService:this.mapService,styleAttributeService:this.styleAttributeService,normalPassFactory:this.normalPassFactory,postProcessingPassFactory:this.postProcessingPassFactory})}catch(P){_.e(P)}finally{_.f()}return this.layerPickService=new lce(this),this.textureService=new cce(this),this.log(Ho.LayerInitStart),R.next=31,this.hooks.init.promise();case 31:this.log(Ho.LayerInitEnd),this.inited=!0,this.emit("inited",{target:this,type:"inited"}),this.emit("add",{target:this,type:"add"}),this.hooks.afterInit.call();case 36:case"end":return R.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"log",value:function(i){var o,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"init";if(!(this.tileLayer||this.isTileLayer)){var u="".concat(this.id,".").concat(a,".").concat(i),c={id:this.id,type:this.type};(o=this.debugService)===null||o===void 0||o.log(u,c)}}},{key:"updateModelData",value:function(i){i.attributes&&i.elements?this.models.map(function(o){o.updateAttributesAndElements(i.attributes,i.elements)}):console.warn("data error")}},{key:"setLayerPickService",value:function(i){this.layerPickService=i}},{key:"prepareBuildModel",value:function(){Object.keys(this.needUpdateConfig||{}).length!==0&&this.updateLayerConfig({});var i=this.getLayerConfig(),o=i.animateOption;o!=null&&o.enable&&(this.layerService.startAnimate(),this.animateStatus=!0)}},{key:"color",value:function(i,o,a){return this.updateStyleAttribute("color",i,o,a),this}},{key:"texture",value:function(i,o,a){return this.updateStyleAttribute("texture",i,o,a),this}},{key:"rotate",value:function(i,o,a){return this.updateStyleAttribute("rotate",i,o,a),this}},{key:"size",value:function(i,o,a){return this.updateStyleAttribute("size",i,o,a),this}},{key:"filter",value:function(i,o,a){var u=this.updateStyleAttribute("filter",i,o,a);return this.dataState.dataSourceNeedUpdate=u&&this.inited,this}},{key:"shape",value:function(i,o,a){this.shapeOption={field:i,values:o};var u=this.updateStyleAttribute("shape",i,o,a);return this.dataState.dataSourceNeedUpdate=u&&this.inited,this}},{key:"label",value:function(i,o,a){return this.pendingStyleAttributes.push({attributeName:"label",attributeField:i,attributeValues:o,updateOptions:a}),this}},{key:"animate",value:function(i){var o={};return Ds(i)?(o.enable=!0,o=Qe(Qe({},o),i)):o.enable=i,this.updateLayerConfig({animateOption:o}),this}},{key:"source",value:function(i,o){return(i==null?void 0:i.type)==="source"?(this.setSource(i),this):(this.sourceOption={data:i,options:o},this.clusterZoom=0,this)}},{key:"setData",value:function(i,o){var a=this;return this.inited?(this.log(Ho.SourceInitStart,ps.UPDATE),this.layerSource.setData(i,o),this.log(Ho.SourceInitEnd,ps.UPDATE)):this.on("inited",function(){a.log(Ho.SourceInitStart,ps.UPDATE);var u=a.getSource();u?a.layerSource.setData(i,o):a.source(new wP(i,o)),a.layerSource.once("update",function(){a.log(Ho.SourceInitEnd,ps.UPDATE)})}),this}},{key:"style",value:function(i){var o=this,a=i.passes,u=hl(i,fce);a&&IP(a).forEach(function(f){var m=o.multiPassRenderer.getPostProcessor().getPostProcessingPassByName(f[0]);m&&m.updateOptions(f[1])}),u.borderColor&&(u.stroke=u.borderColor),u.borderWidth&&(u.strokeWidth=u.borderWidth);var c=u;return Object.keys(u).forEach(function(f){var m=u[f];Array.isArray(m)&&m.length===2&&!KA(m[0])&&!KA(m[1])&&(c[f]={field:m[0],value:m[1]})}),this.encodeStyle(c),this.updateLayerConfig(c),this}},{key:"encodeStyle",value:function(i){var o=this;Object.keys(i).forEach(function(a){[].concat(nr(o.enableShaderEncodeStyles),nr(o.enableDataEncodeStyles)).includes(a)&&gce(i[a])&&(i[a].field||i[a].value)&&!Z3(o.encodeStyleAttribute[a],i[a])?(o.encodeStyleAttribute[a]=i[a],o.updateStyleAttribute(a,i[a].field,i[a].value),o.inited&&(o.dataState.dataMappingNeedUpdate=!0)):o.encodeStyleAttribute[a]&&(delete o.encodeStyleAttribute[a],o.dataState.dataSourceNeedUpdate=!0)})}},{key:"scale",value:function(i,o){var a=Qe({},this.scaleOptions);if(Ds(i)?this.scaleOptions=Qe(Qe({},this.scaleOptions),i):this.scaleOptions[i]=o,this.styleAttributeService&&!Z3(a,this.scaleOptions)){var u=Ds(i)?i:F({},i,o);this.styleAttributeService.updateScaleAttribute(u)}return this}},{key:"renderLayers",value:function(){this.rendering=!0,this.layerService.reRender(),this.rendering=!1}},{key:"prerender",value:function(){}},{key:"render",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.tileLayer?(this.tileLayer.render(),this):(this.layerService.beforeRenderData(this),this.encodeDataLength<=0&&!this.forceRender?this:(this.renderModels(i),this))}},{key:"renderMultiPass",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!(this.encodeDataLength<=0&&!this.forceRender)){u.next=2;break}return u.abrupt("return");case 2:if(!(this.multiPassRenderer&&this.multiPassRenderer.getRenderFlag())){u.next=7;break}return u.next=5,this.multiPassRenderer.render();case 5:u.next=8;break;case 7:this.multiPassRenderer?this.renderModels():this.renderModels();case 8:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"active",value:function(i){var o={};return o.enableHighlight=Ds(i)?!0:i,Ds(i)?(o.enableHighlight=!0,i.color&&(o.highlightColor=i.color),i.mix&&(o.activeMix=i.mix)):o.enableHighlight=!!i,this.updateLayerConfig(o),this}},{key:"setActive",value:function(i,o){var a=this;if(Ds(i)){var u=i.x,c=u===void 0?0:u,f=i.y,m=f===void 0?0:f;this.updateLayerConfig({highlightColor:Ds(o)?o.color:this.getLayerConfig().highlightColor,activeMix:Ds(o)?o.mix:this.getLayerConfig().activeMix}),this.pick({x:c,y:m})}else this.updateLayerConfig({pickedFeatureID:i,highlightColor:Ds(o)?o.color:this.getLayerConfig().highlightColor,activeMix:Ds(o)?o.mix:this.getLayerConfig().activeMix}),this.hooks.beforeHighlight.call(sh(i)).then(function(){setTimeout(function(){a.reRender()},1)})}},{key:"select",value:function(i){var o={};return o.enableSelect=Ds(i)?!0:i,Ds(i)?(o.enableSelect=!0,i.color&&(o.selectColor=i.color),i.mix&&(o.selectMix=i.mix)):o.enableSelect=!!i,this.updateLayerConfig(o),this}},{key:"setSelect",value:function(i,o){var a=this;if(Ds(i)){var u=i.x,c=u===void 0?0:u,f=i.y,m=f===void 0?0:f;this.updateLayerConfig({selectColor:Ds(o)?o.color:this.getLayerConfig().selectColor,selectMix:Ds(o)?o.mix:this.getLayerConfig().selectMix}),this.pick({x:c,y:m})}else this.updateLayerConfig({pickedFeatureID:i,selectColor:Ds(o)?o.color:this.getLayerConfig().selectColor,selectMix:Ds(o)?o.mix:this.getLayerConfig().selectMix}),this.hooks.beforeSelect.call(sh(i)).then(function(){setTimeout(function(){a.reRender()},1)})}},{key:"setBlend",value:function(i){return this.updateLayerConfig({blend:i}),this.reRender(),this}},{key:"show",value:function(){return this.updateLayerConfig({visible:!0}),this.reRender(),this.emit("show"),this}},{key:"hide",value:function(){return this.updateLayerConfig({visible:!1}),this.reRender(),this.emit("hide"),this}},{key:"setIndex",value:function(i){return this.zIndex=i,this.layerService.updateLayerRenderList(),this.layerService.renderLayers(),this}},{key:"setCurrentPickId",value:function(i){this.currentPickId=i}},{key:"getCurrentPickId",value:function(){return this.currentPickId}},{key:"setCurrentSelectedId",value:function(i){this.selectedFeatureID=i}},{key:"getCurrentSelectedId",value:function(){return this.selectedFeatureID}},{key:"isVisible",value:function(){var i=this.mapService.getZoom(),o=this.getLayerConfig(),a=o.visible,u=o.minZoom,c=u===void 0?-1/0:u,f=o.maxZoom,m=f===void 0?1/0:f;return!!a&&i>=c&&i<m}},{key:"setMultiPass",value:function(i,o){if(this.updateLayerConfig({enableMultiPassRenderer:i}),o&&this.updateLayerConfig({passes:o}),i){var a=this.getLayerConfig(),u=a.passes,c=u===void 0?[]:u;this.multiPassRenderer=MP(this,c,this.postProcessingPassFactory,this.normalPassFactory),this.multiPassRenderer.setRenderFlag(!0);var f=this.rendererService.getViewportSize(),m=f.width,_=f.height;this.multiPassRenderer.resize(m,_)}return this}},{key:"setMinZoom",value:function(i){return this.updateLayerConfig({minZoom:i}),this}},{key:"getMinZoom",value:function(){var i=this.getLayerConfig(),o=i.minZoom;return o}},{key:"getMaxZoom",value:function(){var i=this.getLayerConfig(),o=i.maxZoom;return o}},{key:"get",value:function(i){var o=this.getLayerConfig();return o[i]}},{key:"setMaxZoom",value:function(i){return this.updateLayerConfig({maxZoom:i}),this}},{key:"setAutoFit",value:function(i){return this.updateLayerConfig({autoFit:i}),this}},{key:"fitBounds",value:function(i){if(!this.inited)return this.updateLayerConfig({autoFit:!0}),this;var o=this.getSource(),a=o.extent,u=a.some(function(c){return Math.abs(c)===1/0});return u?this:(this.mapService.fitBounds([[a[0],a[1]],[a[2],a[3]]],i),this)}},{key:"destroy",value:function(){var i,o,a,u,c,f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.isDestroyed){(i=this.layerModel)===null||i===void 0||i.uniformBuffers.forEach(function(b){b.destroy()}),this.layerChildren.map(function(b){return b.destroy(!1)}),this.layerChildren=[];var m=this.getLayerConfig(),_=m.maskfence;_&&(this.masks.map(function(b){return b.destroy(!1)}),this.masks=[]),this.hooks.beforeDestroy.call(),this.layerSource.off("update",this.sourceEvent),(o=this.multiPassRenderer)===null||o===void 0||o.destroy(),this.textureService.destroy(),this.styleAttributeService.clearAllAttributes(),this.hooks.afterDestroy.call(),(a=this.layerModel)===null||a===void 0||a.clearModels(f),(u=this.tileLayer)===null||u===void 0||u.destroy(),this.models=[],(c=this.debugService)===null||c===void 0||c.removeLog(this.id),this.emit("remove",{target:this,type:"remove"}),this.emit("destroy",{target:this,type:"destroy"}),this.removeAllListeners(),this.isDestroyed=!0}}},{key:"clear",value:function(){this.styleAttributeService.clearAllAttributes()}},{key:"clearModels",value:function(){var i;this.models.forEach(function(o){return o.destroy()}),(i=this.layerModel)===null||i===void 0||i.clearModels(),this.models=[]}},{key:"isDirty",value:function(){return!!(this.styleAttributeService.getLayerStyleAttributes()||[]).filter(function(i){return i.needRescale||i.needRemapping||i.needRegenerateVertices}).length}},{key:"setSource",value:function(i){var o=this;if(this.layerSource&&this.layerSource.off("update",this.sourceEvent),this.layerSource=i,this.clusterZoom=0,this.inited&&this.layerSource.cluster){var a=this.mapService.getZoom();this.layerSource.updateClusterData(a)}this.layerSource.inited&&this.sourceEvent(),this.layerSource.on("update",function(u){var c=u.type;if(o.coordCenter===void 0){var f,m=o.layerSource.center;o.coordCenter=m,(f=o.mapService)!==null&&f!==void 0&&f.setCoordCenter&&o.mapService.setCoordCenter(m)}if(c==="update"){if(o.tileLayer){o.tileLayer.reload();return}o.sourceEvent()}})}},{key:"getSource",value:function(){return this.layerSource}},{key:"getScaleOptions",value:function(){return this.scaleOptions}},{key:"setEncodedData",value:function(i){this.encodedData=i,this.encodeDataLength=i.length}},{key:"getEncodedData",value:function(){return this.encodedData}},{key:"getScale",value:function(i){return this.styleAttributeService.getLayerAttributeScale(i)}},{key:"getLegend",value:function(i){var o,a,u,c=this.styleAttributeService.getLayerStyleAttribute(i),f=(c==null||(o=c.scale)===null||o===void 0?void 0:o.scalers)||[];return{type:(a=f[0].option)===null||a===void 0?void 0:a.type,field:c==null||(u=c.scale)===null||u===void 0?void 0:u.field,items:this.getLegendItems(i)}}},{key:"getLegendItems",value:function(i){var o=this.styleAttributeService.getLayerAttributeScale(i);if(!o)return[];if(o.invertExtent){var a=o.range().map(function(f){return F({value:o.invertExtent(f)},i,f)});return a}else if(o.ticks){var u=o.ticks().map(function(f){return F({value:f},i,o(f))});return u}else if(o!=null&&o.domain){var c=o.domain().filter(function(f){return!_ce(f)}).map(function(f){return F({value:f},i,o(f))});return c}return[]}},{key:"pick",value:function(i){var o=i.x,a=i.y;this.interactionService.triggerHover({x:o,y:a})}},{key:"boxSelect",value:function(i,o){this.pickingService.boxPickLayer(this,i,o)}},{key:"buildLayerModel",value:function(){var n=Mt(he.mark(function o(a){var u=this,c,f,m,_,b,A,w,R,P,k,L,B,V,G;return he.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return c=a.moduleName,f=a.vertexShader,m=a.fragmentShader,_=a.inject,b=a.triangulation,A=a.styleOption,w=a.pickingEnabled,R=w===void 0?!0:w,P=hl(a,hce),this.shaderModuleService.registerModule(c,{vs:f,fs:m,inject:_}),k=this.shaderModuleService.getModule(c),L=k.vs,B=k.fs,V=k.uniforms,G=this.rendererService.createModel,Z.abrupt("return",new Promise(function(ve){var Ie=u.styleAttributeService.createAttributesAndIndices(u.encodedData,b,A),de=Ie.attributes,se=Ie.elements,le=Ie.count,ye=[].concat(nr(u.layerModel.uniformBuffers),nr(u.rendererService.uniformBuffers),[u.getLayerUniformBuffer()]);R&&ye.push(u.getPickingUniformBuffer());var ke=Qe({attributes:de,uniforms:V,fs:B,vs:L,elements:se,blend:RP[up.normal],uniformBuffers:ye,textures:u.layerModel.textures},P);le&&(ke.count=le);var Rt=G(ke);ve(Rt)}));case 5:case"end":return Z.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"createAttributes",value:function(i){var o=i.triangulation,a=this.styleAttributeService.createAttributes(this.encodedData,o),u=a.attributes;return u}},{key:"getTime",value:function(){return this.layerService.clock.getDelta()}},{key:"setAnimateStartTime",value:function(){this.animateStartTime=this.layerService.clock.getElapsedTime()}},{key:"stopAnimate",value:function(){this.animateStatus&&(this.layerService.stopAnimate(),this.animateStatus=!1,this.updateLayerConfig({animateOption:{enable:!1}}))}},{key:"getLayerAnimateTime",value:function(){return this.layerService.clock.getElapsedTime()-this.animateStartTime}},{key:"needPick",value:function(i){var o=this.getLayerConfig(),a=o.enableHighlight,u=a===void 0?!0:a,c=o.enableSelect,f=c===void 0?!0:c,m=this.eventNames().indexOf(i)!==-1||this.eventNames().indexOf("un"+i)!==-1;return(i==="click"||i==="dblclick")&&f&&(m=!0),i==="mousemove"&&(u||this.eventNames().indexOf("mouseenter")!==-1||this.eventNames().indexOf("unmousemove")!==-1||this.eventNames().indexOf("mouseout")!==-1)&&(m=!0),this.isVisible()&&m}},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return u.stop()}},o)}));function i(){return n.apply(this,arguments)}return i}()},{key:"rebuildModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.buildModels();case 2:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"renderMulPass",value:function(){var n=Mt(he.mark(function o(a){return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,a.render();case 2:case"end":return c.stop()}},o)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"renderModels",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.encodeDataLength<=0&&!this.forceRender?(this.clearModels(),this):(this.hooks.beforeRender.call(),this.models.forEach(function(a){a.draw({uniforms:i.layerModel.getUninforms(),blend:i.layerModel.getBlend(),stencil:i.layerModel.getStencil(o),textures:i.layerModel.textures},(o==null?void 0:o.ispick)||!1)}),this.hooks.afterRender.call(),this)}},{key:"updateStyleAttribute",value:function(i,o,a,u){var c=this.configService.getAttributeConfig(this.id)||{};return Z3(c[i],{field:o,values:a})?!1:(["color","size","texture","rotate","filter","label","shape"].indexOf(i)!==-1&&this.configService.setAttributeConfig(this.id,F({},i,{field:o,values:a})),this.startInit?this.styleAttributeService.updateStyleAttribute(i,{scale:Qe({field:o},this.splitValuesAndCallbackInAttribute(a,this.getLayerConfig()[o]))},u):this.pendingStyleAttributes.push({attributeName:i,attributeField:o,attributeValues:a,updateOptions:u}),!0)}},{key:"getLayerAttributeConfig",value:function(){return this.configService.getAttributeConfig(this.id)}},{key:"getShaderPickStat",value:function(){return this.layerService.getShaderPickStat()}},{key:"setEarthTime",value:function(i){console.warn("empty fn")}},{key:"processData",value:function(i){return i}},{key:"getModelType",value:function(){throw new Error("Method not implemented.")}},{key:"getDefaultConfig",value:function(){return{}}},{key:"initLayerModels",value:function(){var n=Mt(he.mark(function o(){var a,u;return he.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.models.forEach(function(m){return m.destroy()}),this.models=[],this.uniformBuffers.forEach(function(m){m.destroy()}),this.uniformBuffers=[],a=this.rendererService.createBuffer({data:new Float32Array(20).fill(0),isUBO:!0}),this.uniformBuffers.push(a),u=this.rendererService.createBuffer({data:new Float32Array(20).fill(0),isUBO:!0}),this.uniformBuffers.push(u),f.next=10,this.layerModel.initModels();case 10:this.models=f.sent;case 11:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getLayerUniformBuffer",value:function(){return this.uniformBuffers[0]}},{key:"getPickingUniformBuffer",value:function(){return this.uniformBuffers[1]}},{key:"reRender",value:function(){this.inited&&this.layerService.reRender()}},{key:"splitValuesAndCallbackInAttribute",value:function(i){return{values:qA(i)?void 0:i,callback:qA(i)?i:void 0}}}]),r}(ju.EventEmitter),YA=mi(Y3.prototype,"configService",[XA],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Y3);function yce(e,t){return{enable:e,mask:255,func:{cmp:W.EQUAL,ref:t?1:0,mask:1}}}function JA(e){return e.maskOperation===py.OR?{enable:!0,mask:255,func:{cmp:W.ALWAYS,ref:1,mask:255},opFront:{fail:W.KEEP,zfail:W.REPLACE,zpass:W.REPLACE}}:{enable:!0,mask:255,func:{cmp:e.stencilType===m1.SINGLE||e.stencilIndex===0?W.ALWAYS:W.LESS,ref:e.stencilType===m1.SINGLE?1:e.stencilIndex===0?2:1,mask:255},opFront:{fail:W.KEEP,zfail:W.REPLACE,zpass:W.REPLACE}}}var Vn=function(e){return e[e.POSITION=0]="POSITION",e[e.COLOR=1]="COLOR",e[e.VERTEX_ID=2]="VERTEX_ID",e[e.PICKING_COLOR=3]="PICKING_COLOR",e[e.STROKE=4]="STROKE",e[e.OPACITY=5]="OPACITY",e[e.OFFSETS=6]="OFFSETS",e[e.ROTATION=7]="ROTATION",e[e.EXTRUSION_BASE=8]="EXTRUSION_BASE",e[e.SIZE=9]="SIZE",e[e.SHAPE=10]="SHAPE",e[e.EXTRUDE=11]="EXTRUDE",e[e.MAX=12]="MAX",e[e.NORMAL=13]="NORMAL",e[e.UV=14]="UV",e[e.LINEAR=15]="LINEAR",e}({});function xce(e){switch(e){case"rotation":return{name:"Rotation",type:wn.Attribute,descriptor:{name:"a_Rotation",shaderLocation:Vn.ROTATION,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(r){var n=r.rotation,i=n===void 0?0:n;return Array.isArray(i)?[i[0]]:[i]}}};case"stroke":return{name:"stroke",type:wn.Attribute,descriptor:{name:"a_Stroke",shaderLocation:Vn.STROKE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:4,update:function(r){var n=r.stroke,i=n===void 0?[1,1,1,1]:n;return i}}};case"opacity":return{name:"opacity",type:wn.Attribute,descriptor:{name:"a_Opacity",shaderLocation:Vn.OPACITY,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(r){var n=r.opacity,i=n===void 0?1:n;return[i]}}};case"extrusionBase":return{name:"extrusionBase",type:wn.Attribute,descriptor:{name:"a_ExtrusionBase",shaderLocation:Vn.EXTRUSION_BASE,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(r){var n=r.extrusionBase,i=n===void 0?0:n;return[i]}}};case"offsets":return{name:"offsets",type:wn.Attribute,descriptor:{name:"a_Offsets",shaderLocation:Vn.OFFSETS,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(r){var n=r.offsets;return n}}};case"thetaOffset":return{name:"thetaOffset",type:wn.Attribute,descriptor:{name:"a_ThetaOffset",shaderLocation:15,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(r){var n=r.thetaOffset,i=n===void 0?1:n;return[i]}}};default:return}}var bce={opacity:1,stroke:[1,0,0,1],offsets:[0,0],rotation:0,extrusionBase:0,strokeOpacity:1,thetaOffset:.314},J2={opacity:"float",stroke:"vec4",offsets:"vec2",textOffset:"vec2",rotation:"float",extrusionBase:"float",strokeOpacity:"float",thetaOffset:"float"};function eT(e){return Math.max(Math.ceil(e/4)*4,4)}var tT,q3,rT,nT={opacity:Vn.OPACITY,stroke:Vn.STROKE,offsets:Vn.OFFSETS,rotation:Vn.ROTATION,extrusionBase:Vn.EXTRUSION_BASE,thetaOffset:15},Ba=(tT=rb(wt.IGlobalConfigService),q3=function(){function e(t){Ht(this,e),F(this,"uniformBuffers",[]),F(this,"textures",[]),F(this,"preStyleAttribute",{}),F(this,"encodeStyleAttribute",{}),bi(this,"configService",rT,this),this.layer=t,this.rendererService=t.getContainer().get(wt.IRendererService),this.pickingService=t.getContainer().get(wt.IPickingService),this.shaderModuleService=t.getContainer().get(wt.IShaderModuleService),this.styleAttributeService=t.getContainer().get(wt.IStyleAttributeService),this.mapService=t.getContainer().get(wt.IMapService),this.iconService=t.getContainer().get(wt.IIconService),this.fontService=t.getContainer().get(wt.IFontService),this.cameraService=t.getContainer().get(wt.ICameraService),this.layerService=t.getContainer().get(wt.ILayerService),this.registerStyleAttribute(),this.registerBuiltinAttributes(),this.startModelAnimate();var r=this.rendererService.createTexture2D;this.createTexture2D=r}return jt(e,[{key:"getBlend",value:function(){var r=this.layer.getLayerConfig(),n=r.blend,i=n===void 0?"normal":n;return RP[up[i]]}},{key:"getStencil",value:function(r){var n=this.layer.getLayerConfig(),i=n.mask,o=i===void 0?!1:i,a=n.maskInside,u=a===void 0?!0:a,c=n.enableMask,f=n.maskOperation,m=f===void 0?py.AND:f;if(this.layer.type==="MaskLayer")return JA({isStencil:!0,stencilType:m1.SINGLE});if(r.isStencil)return JA(Qe(Qe({},r),{},{maskOperation:m}));var _=o||c&&this.layer.masks.length!==0||this.layer.tileMask!==void 0;return yce(_,u)}},{key:"getDefaultStyle",value:function(){return{}}},{key:"getUninforms",value:function(){var r=this.getCommonUniformsInfo(),n=this.getUniformsBufferInfo(this.getStyleAttribute());this.updateStyleUnifoms();var i=Qe(Qe({},n.uniformsOption),r.uniformsOption);return!this.rendererService.hasOwnProperty("device")&&this.textures&&this.textures.length===1&&(i.u_texture=this.textures[0]),i}},{key:"getAnimateUniforms",value:function(){return{}}},{key:"needUpdate",value:function(){var t=Mt(he.mark(function n(){return he.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",!1);case 1:case"end":return o.stop()}},n)}));function r(){return t.apply(this,arguments)}return r}()},{key:"buildModels",value:function(){var t=Mt(he.mark(function n(){return he.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return o.stop()}},n)}));function r(){return t.apply(this,arguments)}return r}()},{key:"initModels",value:function(){var t=Mt(he.mark(function n(){return he.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return o.stop()}},n)}));function r(){return t.apply(this,arguments)}return r}()},{key:"clearModels",value:function(){}},{key:"getAttribute",value:function(){throw new Error("Method not implemented.")}},{key:"prerender",value:function(){}},{key:"render",value:function(r){throw new Error("Method not implemented.")}},{key:"registerBuiltinAttributes",value:function(){throw new Error("Method not implemented.")}},{key:"animateOption2Array",value:function(r){return[r.enable?0:1,r.duration||4,r.interval||.2,r.trailLength||.1]}},{key:"startModelAnimate",value:function(){var r=this.layer.getLayerConfig(),n=r.animateOption;n.enable&&this.layer.setAnimateStartTime()}},{key:"getInject",value:function(){var r=this.layer.encodeStyleAttribute,n="",i=[];this.layer.enableShaderEncodeStyles.forEach(function(u){r[u]?n+="#define USE_ATTRIBUTE_".concat(u.toUpperCase(),` 0.0;
|
|
|
|
`):i.push(" ".concat(J2[u]," u_").concat(u,";")),n+=`
|
|
#ifdef USE_ATTRIBUTE_`.concat(u.toUpperCase(),`
|
|
layout(location = `).concat(nT[u],") in ").concat(J2[u]," a_").concat(u.charAt(0).toUpperCase()+u.slice(1),`;
|
|
#endif
|
|
|
|
`)});var o=i.length?`
|
|
layout(std140) uniform AttributeUniforms {
|
|
`.concat(i.join(`
|
|
`),`
|
|
};
|
|
`):"";n+=o;var a="";return this.layer.enableShaderEncodeStyles.forEach(function(u){a+=`
|
|
|
|
#ifdef USE_ATTRIBUTE_`.concat(u.toUpperCase(),`
|
|
`).concat(J2[u]," ").concat(u," = a_").concat(u.charAt(0).toUpperCase()+u.slice(1),`;
|
|
#else
|
|
`).concat(J2[u]," ").concat(u," = u_").concat(u,`;
|
|
#endif
|
|
|
|
`)}),{"vs:#decl":n,"fs:#decl":o,"vs:#main-start":a}}},{key:"getStyleAttribute",value:function(){var r=this,n={};return this.layer.enableShaderEncodeStyles.forEach(function(i){if(!r.layer.encodeStyleAttribute[i]){var o=r.layer.getLayerConfig()[i],a=typeof o>"u"?bce[i]:o;i==="stroke"&&(a=Ta(a)),n["u_"+i]=a}}),n}},{key:"registerStyleAttribute",value:function(){var r=this;Object.keys(this.layer.encodeStyleAttribute).forEach(function(n){var i=xce(n);i&&(r.styleAttributeService.registerStyleAttribute(i),i.descriptor&&(i.descriptor.shaderLocation=nT[n]))})}},{key:"updateEncodeAttribute",value:function(r,n){this.encodeStyleAttribute[r]=n}},{key:"initUniformsBuffer",value:function(){var r=this.getUniformsBufferInfo(this.getStyleAttribute()),n=this.getCommonUniformsInfo();r.uniformsLength!==0&&(this.attributeUnifoms=this.rendererService.createBuffer({data:new Float32Array(eT(r.uniformsLength)).fill(0),isUBO:!0}),this.uniformBuffers.push(this.attributeUnifoms)),n.uniformsLength!==0&&(this.commonUnifoms=this.rendererService.createBuffer({data:new Float32Array(eT(n.uniformsLength)).fill(0),isUBO:!0}),this.uniformBuffers.push(this.commonUnifoms))}},{key:"getUniformsBufferInfo",value:function(r){var n=0,i=[];return Object.values(r).forEach(function(o){Array.isArray(o)?(i.push.apply(i,nr(o)),n+=o.length):typeof o=="number"?(i.push(o),n+=1):typeof o=="boolean"&&(i.push(Number(o)),n+=1)}),{uniformsOption:r,uniformsLength:n,uniformsArray:i}}},{key:"getCommonUniformsInfo",value:function(){return{uniformsLength:0,uniformsArray:[],uniformsOption:{}}}},{key:"updateStyleUnifoms",value:function(){var r,n,i=this.getUniformsBufferInfo(this.getStyleAttribute()),o=i.uniformsArray,a=this.getCommonUniformsInfo(),u=a.uniformsArray;(r=this.attributeUnifoms)===null||r===void 0||r.subData({offset:0,data:new Uint8Array(new Float32Array(o).buffer)}),(n=this.commonUnifoms)===null||n===void 0||n.subData({offset:0,data:new Uint8Array(new Float32Array(u).buffer)})}}]),e}(),rT=mi(q3.prototype,"configService",[tT],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),q3),iT=function(e){return e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e}({}),Ece=function(e){return e.NORMAL="normal",e.REPLACE="replace",e}({}),ib=function(e){return e[e.pixel=0]="pixel",e[e.meter=1]="meter",e}({}),PP=100;function aT(e){return e/180*Math.acos(-1)}function OP(e){var t=aT(e[0])+Math.PI/2,r=aT(e[1]),n=PP+Math.random()*.4,i=n*Math.cos(r)*Math.cos(t),o=n*Math.cos(r)*Math.sin(t),a=n*Math.sin(r);return[o,a,i]}var eg=Vi();Vi();var Jo=Vi(),Qh=Vi(),Td=Vi();function K3(e,t,r,n,i){Oo(e,r,n),df(e,e),t=l0(-e[1],e[0]);var o=l0(-r[1],r[0]);return[i/mp(t,o),t]}function Jh(e,t){return FM(e,-t[1],t[0])}function wd(e,t,r){return c0(e,t,r),df(e,e),e}function Q3(e,t){return e[0]===t[0]&&e[1]===t[1]}var Sce=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ht(this,e),F(this,"lastFlip",-1),F(this,"miter",l0(0,0)),F(this,"started",!1),F(this,"dash",!1),F(this,"totalDistance",0),F(this,"currentIndex",0),this.join=t.join||"miter",this.cap=t.cap||"butt",this.miterLimit=t.miterLimit||10,this.thickness=t.thickness||1,this.dash=t.dash||!1,this.complex={positions:[],indices:[],normals:[],startIndex:0,indexes:[]}}return jt(e,[{key:"simpleExtrude",value:function(r){var n=this.complex;if(r.length<=1)return n;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var i=r.length,o=n.startIndex,a=1;a<i;a++){var u=r[a-1],c=r[a],f=a<r.length-1?r[a+1]:null,m=this.simpleSegment(n,o,u,c,f);o+=m}if(this.dash)for(var _=0;_<n.positions.length/6;_++)n.positions[_*6+5]=this.totalDistance;return n.startIndex=n.positions.length/6,n}},{key:"simpleExtrude_gaode2",value:function(r,n){var i=this.complex;if(r.length<=1)return i;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var o=r.length,a=i.startIndex,u=1;u<o;u++){var c,f,m,_=r[u-1];_.push((c=n[u-1][2])!==null&&c!==void 0?c:0);var b=n[u-1],A=r[u];A.push((f=n[u][2])!==null&&f!==void 0?f:0);var w=n[u],R=u<r.length-1?[].concat(nr(r[u+1]),[(m=n[u+1][2])!==null&&m!==void 0?m:0]):null,P=u<n.length-1?n[u+1]:null,k=this.simpleSegment(i,a,_,A,R,b,w,P);a+=k}if(this.dash)for(var L=0;L<i.positions.length/6;L++)i.positions[L*6+5]=this.totalDistance;return i.startIndex=i.positions.length/6,i}},{key:"extrude_gaode2",value:function(r,n){var i=this.complex;if(r.length<=1)return i;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var o=r.length,a=i.startIndex,u=1;u<o;u++){var c,f,m,_=r[u-1];_.push((c=n[u-1][2])!==null&&c!==void 0?c:0);var b=n[u-1],A=r[u];A.push((f=n[u][2])!==null&&f!==void 0?f:0);var w=n[u],R=u<r.length-1?[].concat(nr(r[u+1]),[(m=n[u+1][2])!==null&&m!==void 0?m:0]):null,P=u<n.length-1?n[u+1]:null,k=this.segment_gaode2(i,a,_,A,R,b,w,P);a+=k}if(this.dash)for(var L=0;L<i.positions.length/6;L++)i.positions[L*6+5]=this.totalDistance;return i.startIndex=i.positions.length/6,i}},{key:"extrude",value:function(r){var n=this.complex;if(r.length<=1)return n;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var i=r.length,o=n.startIndex,a=1;a<i;a++){var u=r[a-1],c=r[a],f=a<r.length-1?r[a+1]:null,m=this.segment(n,o,u,c,f);o+=m}if(this.dash)for(var _=0;_<n.positions.length/6;_++)n.positions[_*6+5]=this.totalDistance;return n.startIndex=n.positions.length/6,n}},{key:"simpleSegment",value:function(r,n,i,o,a){var u=0,c=r.indices,f=r.positions,m=r.normals,_=ko([o[0],o[1]]),b=ko([i[0],i[1]]);wd(Jo,_,b);var A=0;if(this.dash&&(A=this.lineSegmentDistance(_,b),this.totalDistance+=A),this.normal||(this.normal=Vi(),Jh(this.normal,Jo)),this.started||(this.started=!0,this.extrusions(f,m,i,this.normal,this.thickness,this.totalDistance-A)),c.push(n+0,n+1,n+2),!a)Jh(this.normal,Jo),this.extrusions(f,m,o,this.normal,this.thickness,this.totalDistance),c.push.apply(c,nr(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),u+=2;else{var w=ko([a[0],a[1]]);Q3(_,w)&&Oo(w,_,df(w,b1(w,_,b))),wd(Qh,w,_);var R=K3(Td,Vi(),Jo,Qh,this.thickness),P=Nn(R,2),k=P[0],L=P[1],B=mp(Td,this.normal)<0?-1:1;this.extrusions(f,m,o,L,k,this.totalDistance),c.push.apply(c,nr(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),B=-1,lf(this.normal,L),u+=2,this.lastFlip=B}return u}},{key:"segment_gaode2",value:function(r,n,i,o,a,u,c,f){var m=0,_=r.indices,b=r.positions,A=r.normals,w=this.cap==="square",R=this.join==="bevel",P=ko([c[0],c[1]]),k=ko([u[0],u[1]]);wd(Jo,o,i);var L=0;if(this.dash&&(L=this.lineSegmentDistance(P,k),this.totalDistance+=L),this.normal||(this.normal=Vi(),Jh(this.normal,Jo)),!this.started)if(this.started=!0,w){var B=Vi(),V=Vi();Oo(B,this.normal,Jo),Oo(V,this.normal,Jo),A.push(V[0],V[1],0),A.push(B[0],B[1],0),b.push(i[0],i[1],i[2]|0,this.totalDistance-L,-this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),b.push(i[0],i[1],i[2]|0,this.totalDistance-L,this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(b,A,i,this.normal,this.thickness,this.totalDistance-L);if(_.push(n+0,n+1,n+2),a){Q3(o,a)&&Oo(a,o,df(a,b1(a,o,i))),wd(Qh,a,o);var Z=K3(Td,Vi(),Jo,Qh,this.thickness),ve=Nn(Z,2),Ie=ve[0],de=ve[1],se=mp(Td,this.normal)<0?-1:1,le=R;if(!le&&this.join==="miter"){var ye=Ie;ye>this.miterLimit&&(le=!0)}le?(A.push(this.normal[0],this.normal[1],0),A.push(de[0],de[1],0),b.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*se,o[2]|0),this.complex.indexes.push(this.currentIndex),b.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness*se,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,_.push.apply(_,nr(this.lastFlip!==-se?[n,n+2,n+3]:[n+2,n+1,n+3])),_.push(n+2,n+3,n+4),Jh(eg,Qh),lf(this.normal,eg),A.push(this.normal[0],this.normal[1],0),b.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*se,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,m+=3):(this.extrusions(b,A,o,de,Ie,this.totalDistance),_.push.apply(_,nr(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),se=-1,lf(this.normal,de),m+=2),this.lastFlip=se}else{if(Jh(this.normal,Jo),w){var G=Vi(),K=Vi();c0(K,Jo,this.normal),Oo(G,Jo,this.normal),A.push(K[0],K[1],0),A.push(G[0],G[1],0),b.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),b.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(b,A,o,this.normal,this.thickness,this.totalDistance);_.push.apply(_,nr(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),m+=2}return m}},{key:"segment",value:function(r,n,i,o,a){var u=0,c=r.indices,f=r.positions,m=r.normals,_=this.cap==="square",b=this.join==="bevel",A=ko([o[0],o[1]]),w=ko([i[0],i[1]]);wd(Jo,A,w);var R=0;if(this.dash&&(R=this.lineSegmentDistance(A,w),this.totalDistance+=R),this.normal||(this.normal=Vi(),Jh(this.normal,Jo)),!this.started)if(this.started=!0,_){var P=Vi(),k=Vi();Oo(P,this.normal,Jo),Oo(k,this.normal,Jo),m.push(k[0],k[1],0),m.push(P[0],P[1],0),f.push(i[0],i[1],i[2]|0,this.totalDistance-R,-this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),f.push(i[0],i[1],i[2]|0,this.totalDistance-R,this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(f,m,i,this.normal,this.thickness,this.totalDistance-R);if(c.push(n+0,n+1,n+2),a){var V=ko([a[0],a[1]]);Q3(A,V)&&Oo(V,A,df(V,b1(V,A,w))),wd(Qh,V,A);var G=K3(Td,Vi(),Jo,Qh,this.thickness),K=Nn(G,2),Z=K[0],ve=K[1],Ie=mp(Td,this.normal)<0?-1:1,de=b;if(!de&&this.join==="miter"){var se=Z;se>this.miterLimit&&(de=!0)}de?(m.push(this.normal[0],this.normal[1],0),m.push(ve[0],ve[1],0),f.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*Ie,o[2]|0),this.complex.indexes.push(this.currentIndex),f.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness*Ie,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,c.push.apply(c,nr(this.lastFlip!==-Ie?[n,n+2,n+3]:[n+2,n+1,n+3])),c.push(n+2,n+3,n+4),Jh(eg,Qh),lf(this.normal,eg),m.push(this.normal[0],this.normal[1],0),f.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*Ie,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,u+=3):(this.extrusions(f,m,o,ve,Z,this.totalDistance),c.push.apply(c,nr(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),Ie=-1,lf(this.normal,ve),u+=2),this.lastFlip=Ie}else{if(Jh(this.normal,Jo),_){var L=Vi(),B=Vi();c0(B,Jo,this.normal),Oo(L,Jo,this.normal),m.push(B[0],B[1],0),m.push(L[0],L[1],0),f.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),f.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(f,m,o,this.normal,this.thickness,this.totalDistance);c.push.apply(c,nr(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),u+=2}return u}},{key:"extrusions",value:function(r,n,i,o,a,u){n.push(o[0],o[1],0),n.push(o[0],o[1],0),r.push(i[0],i[1],i[2]|0,u,-a,i[2]|0),this.complex.indexes.push(this.currentIndex),r.push(i[0],i[1],i[2]|0,u,a,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}},{key:"lineSegmentDistance",value:function(r,n){var i=n[0]-r[0],o=n[1]-r[1];return Math.sqrt(i*i+o*o)}}]),e}();function kP(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=e[0][0],n=e[0][e[0].length-1];r[0]===n[0]&&r[1]===n[1]&&(e[0]=e[0].slice(0,e[0].length-1));for(var i=e[0].length,o=mf.flatten(e),a=o.vertices,u=o.dimensions,c=[],f=[],m=[],_=0;_<a.length/u;_++)c.push(a[_*u],a[_*u+1],1,-1,-1),m.push(0,0,1);var b=mf(o.vertices,o.holes,o.dimensions);f.push.apply(f,nr(b));for(var A=function(){var P=o.vertices.slice(w*u,(w+1)*u),k=o.vertices.slice((w+1)*u,(w+2)*u);k.length===0&&(k=o.vertices.slice(0,u));var L=c.length/5;c.push(P[0],P[1],1,0,0,k[0],k[1],1,.1,0,P[0],P[1],0,0,.8,k[0],k[1],0,.1,.8);var B=Ace([k[0],k[1],1],[P[0],P[1],0],[P[0],P[1],1],t);m.push.apply(m,nr(B).concat(nr(B),nr(B),nr(B))),f.push.apply(f,nr([1,2,0,3,2,1].map(function(V){return V+L})))},w=0;w<i;w++)A();return{positions:c,index:f,normals:m}}function Ace(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=zd(),o=zd(),a=zd();n&&(e=A3(e),t=A3(t),r=A3(r));var u=Gl.apply(R3,nr(e)),c=Gl.apply(R3,nr(t)),f=Gl.apply(R3,nr(r));K6(i,f,c),K6(o,u,c),kM(a,i,o);var m=zd();return $d(m,a),m}var Ul,Ev=function(e){return e.CYLINDER="cylinder",e.SQUARECOLUMN="squareColumn",e.TRIANGLECOLUMN="triangleColumn",e.HEXAGONCOLUMN="hexagonColumn",e.PENTAGONCOLUMN="pentagonColumn",e}({}),Sv=function(e){return e.CIRCLE="circle",e.SQUARE="square",e.TRIANGLE="triangle",e.HEXAGON="hexagon",e.PENTAGON="pentagon",e}({});function qm(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=Math.PI*2/e,n=[],i=0;i<e;i++)n.push(r*i+t*Math.PI/12);var o=n.map(function(a){var u=Math.sin(a+Math.PI/4),c=Math.cos(a+Math.PI/4);return[u,c,0]});return o}function Sx(){return qm(30)}function oT(){return qm(4)}function sT(){return qm(3)}function uT(){return qm(6,1)}function lT(){return qm(5)}var J3=(Ul={},F(Ul,Sv.CIRCLE,Sx),F(Ul,Sv.HEXAGON,uT),F(Ul,Sv.TRIANGLE,sT),F(Ul,Sv.SQUARE,oT),F(Ul,Sv.PENTAGON,lT),F(Ul,Ev.CYLINDER,Sx),F(Ul,Ev.HEXAGONCOLUMN,uT),F(Ul,Ev.TRIANGLECOLUMN,sT),F(Ul,Ev.SQUARECOLUMN,oT),F(Ul,Ev.PENTAGONCOLUMN,lT),Ul),tg={};function o_(e){var t=ih(e.coordinates);return{vertices:[].concat(nr(t),nr(t),nr(t),nr(t)),indices:[0,1,2,2,3,0],size:t.length}}function cT(e){var t=ih(e.coordinates),r=OP(t);return{vertices:[].concat(nr(r),nr(r),nr(r),nr(r)),indices:[0,1,2,2,3,0],size:r.length}}function DP(e){var t=e.shape,r=Pce(t,!1),n=r.positions,i=r.index,o=r.normals;return{vertices:n,indices:i,normals:o,size:5}}function Tce(e){var t=ih(e.coordinates);return{vertices:nr(t),indices:[0],size:t.length}}function wce(e){var t=e.coordinates,r=e.originCoordinates,n=e.version,i=new Sce({dash:!0,join:"bevel"});if(n==="GAODE2.x"){var o=t;Array.isArray(o[0][0])||(o=[t]);var a=r;Array.isArray(a[0][0])||(a=[r]);for(var u=0;u<o.length;u++){var c=o[u],f=a[u];i.extrude_gaode2(c,f)}}else{var m=t;m[0]&&!Array.isArray(m[0][0])&&(m=[t]),m.forEach(function(b){i.extrude(b)})}var _=i.complex;return{vertices:_.positions,indices:_.indices,normals:_.normals,indexes:_.indexes,size:6}}function Cce(e){var t=e.coordinates,r=e.originCoordinates,n=[];if(!Array.isArray(t[0]))return{vertices:[],indices:[],normals:[],size:6,count:0};var i=Rce(t,r),o=i.results,a=i.totalDistance;return o.map(function(u){n.push(u[0],u[1],u[2],u[3],0,a)}),{vertices:n,indices:[],normals:[],size:6,count:o.length}}function fT(e,t){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function e6(e,t){return e.length<3&&e.push(0),t!==void 0&&e.push(t),e}function Rce(e,t){var r=e,n=t||e;Array.isArray(r)&&Array.isArray(r[0])&&Array.isArray(r[0][0])&&(r=t.flat(),n=t.flat());var i=0;if(r.length<2)return{results:r,totalDistance:0};var o=[],a=e6(r[0],i);o.push(a);for(var u=1;u<r.length-1;u++){var c=fT(ko(n[u-1]),ko(n[u]));i+=c;var f=e6(r[u],i);o.push(f),o.push(f)}var m=fT(ko(n[n.length-2]),ko(n[n.length-1]));return i+=m,o.push(e6(r[r.length-1],i)),{results:o,totalDistance:i}}function ab(e){var t=e.coordinates,r=mf.flatten(t),n=r.vertices,i=r.dimensions,o=r.holes;return{indices:mf(n,o,i),vertices:n,size:i}}function Ice(e){var t=e.coordinates,r=mf.flatten(t),n=r.vertices,i=r.dimensions,o=r.holes;return{indices:mf(n,o,i),vertices:Mce(n),size:i+4}}function Mce(e){for(var t=[],r=Pee(e),n=r.center,i=r.radius,o=0;o<e.length;o+=2){var a=e[o],u=e[o+1];t.push.apply(t,[a,u,0].concat(nr(n),[i]))}return t}function FP(e){var t=e.coordinates,r=kP(t,!0),n=r.positions,i=r.index,o=r.normals;return{vertices:n,indices:i,normals:o,size:5}}function gy(e){var t=e.coordinates,r=[].concat(nr(t[0]),[0,0,1,t[1][0],t[0][1],0,1,1],nr(t[1]),[0,1,0],nr(t[0]),[0,0,1],nr(t[1]),[0,1,0,t[0][0],t[1][1],0,0,0]),n=[0,1,2,3,4,5];return{vertices:r,indices:n,size:5}}function ob(e,t){for(var r=t.segmentNumber,n=r===void 0?30:r,i=e.coordinates,o=[],a=[],u=function(m){o.push(m,1,m,i[0][0],i[0][1],i[1][0],i[1][1],m,-1,m,i[0][0],i[0][1],i[1][0],i[1][1]),m!==n-1&&a.push.apply(a,nr([0,1,2,1,3,2].map(function(_){return m*2+_})))},c=0;c<n;c++)u(c);return{vertices:o,indices:a,size:7}}function Pce(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(tg&&tg[e])return tg[e];var r=J3[e]?J3[e]():J3.cylinder(),n=kP([r],t);return tg[e]=n,n}/*! *****************************************************************************
|
|
Copyright (C) Microsoft. All rights reserved.
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
this file except in compliance with the License. You may obtain a copy of the
|
|
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
and limitations under the License.
|
|
***************************************************************************** */var hT;(function(e){(function(t){var r=typeof _c=="object"?_c:typeof self=="object"?self:typeof this=="object"?this:Function("return this;")(),n=i(e);typeof r.Reflect>"u"?r.Reflect=e:n=i(r.Reflect,n),t(n);function i(o,a){return function(u,c){typeof o[u]!="function"&&Object.defineProperty(o,u,{configurable:!0,writable:!0,value:c}),a&&a(u,c)}}})(function(t){var r=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",i=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",o=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",a=typeof Object.create=="function",u={__proto__:[]}instanceof Array,c=!a&&!u,f={create:a?function(){return Q(Object.create(null))}:u?function(){return Q({__proto__:null})}:function(){return Q({})},has:c?function(Ge,at){return r.call(Ge,at)}:function(Ge,at){return at in Ge},get:c?function(Ge,at){return r.call(Ge,at)?Ge[at]:void 0}:function(Ge,at){return Ge[at]}},m=Object.getPrototypeOf(Function),_=typeof process=="object"&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL==="true",b=!_&&typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:tr(),A=!_&&typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:lr(),w=!_&&typeof WeakMap=="function"?WeakMap:or(),R=new w;function P(Ge,at,yt,rr){if(dt(yt)){if(!Qt(Ge))throw new TypeError;if(!Ut(at))throw new TypeError;return de(Ge,at)}else{if(!Qt(Ge))throw new TypeError;if(!ur(at))throw new TypeError;if(!ur(rr)&&!dt(rr)&&!nt(rr))throw new TypeError;return nt(rr)&&(rr=void 0),yt=Je(yt),se(Ge,at,yt,rr)}}t("decorate",P);function k(Ge,at){function yt(rr,hr){if(!ur(rr))throw new TypeError;if(!dt(hr)&&!ge(hr))throw new TypeError;Gt(Ge,at,rr,hr)}return yt}t("metadata",k);function L(Ge,at,yt,rr){if(!ur(yt))throw new TypeError;return dt(rr)||(rr=Je(rr)),Gt(Ge,at,yt,rr)}t("defineMetadata",L);function B(Ge,at,yt){if(!ur(at))throw new TypeError;return dt(yt)||(yt=Je(yt)),ye(Ge,at,yt)}t("hasMetadata",B);function V(Ge,at,yt){if(!ur(at))throw new TypeError;return dt(yt)||(yt=Je(yt)),ke(Ge,at,yt)}t("hasOwnMetadata",V);function G(Ge,at,yt){if(!ur(at))throw new TypeError;return dt(yt)||(yt=Je(yt)),Rt(Ge,at,yt)}t("getMetadata",G);function K(Ge,at,yt){if(!ur(at))throw new TypeError;return dt(yt)||(yt=Je(yt)),Lt(Ge,at,yt)}t("getOwnMetadata",K);function Z(Ge,at){if(!ur(Ge))throw new TypeError;return dt(at)||(at=Je(at)),Zt(Ge,at)}t("getMetadataKeys",Z);function ve(Ge,at){if(!ur(Ge))throw new TypeError;return dt(at)||(at=Je(at)),st(Ge,at)}t("getOwnMetadataKeys",ve);function Ie(Ge,at,yt){if(!ur(at))throw new TypeError;dt(yt)||(yt=Je(yt));var rr=le(at,yt,!1);if(dt(rr)||!rr.delete(Ge))return!1;if(rr.size>0)return!0;var hr=R.get(at);return hr.delete(yt),hr.size>0||R.delete(at),!0}t("deleteMetadata",Ie);function de(Ge,at){for(var yt=Ge.length-1;yt>=0;--yt){var rr=Ge[yt],hr=rr(at);if(!dt(hr)&&!nt(hr)){if(!Ut(hr))throw new TypeError;at=hr}}return at}function se(Ge,at,yt,rr){for(var hr=Ge.length-1;hr>=0;--hr){var Cn=Ge[hr],rn=Cn(at,yt,rr);if(!dt(rn)&&!nt(rn)){if(!ur(rn))throw new TypeError;rr=rn}}return rr}function le(Ge,at,yt){var rr=R.get(Ge);if(dt(rr)){if(!yt)return;rr=new b,R.set(Ge,rr)}var hr=rr.get(at);if(dt(hr)){if(!yt)return;hr=new b,rr.set(at,hr)}return hr}function ye(Ge,at,yt){var rr=ke(Ge,at,yt);if(rr)return!0;var hr=Mr(at);return nt(hr)?!1:ye(Ge,hr,yt)}function ke(Ge,at,yt){var rr=le(at,yt,!1);return dt(rr)?!1:pn(rr.has(Ge))}function Rt(Ge,at,yt){var rr=ke(Ge,at,yt);if(rr)return Lt(Ge,at,yt);var hr=Mr(at);if(!nt(hr))return Rt(Ge,hr,yt)}function Lt(Ge,at,yt){var rr=le(at,yt,!1);if(!dt(rr))return rr.get(Ge)}function Gt(Ge,at,yt,rr){var hr=le(yt,rr,!0);hr.set(Ge,at)}function Zt(Ge,at){var yt=st(Ge,at),rr=Mr(Ge);if(rr===null)return yt;var hr=Zt(rr,at);if(hr.length<=0)return yt;if(yt.length<=0)return hr;for(var Cn=new A,rn=[],Ne=0,qe=yt;Ne<qe.length;Ne++){var ct=qe[Ne],Vt=Cn.has(ct);Vt||(Cn.add(ct),rn.push(ct))}for(var Qr=0,Jn=hr;Qr<Jn.length;Qr++){var ct=Jn[Qr],Vt=Cn.has(ct);Vt||(Cn.add(ct),rn.push(ct))}return rn}function st(Ge,at){var yt=[],rr=le(Ge,at,!1);if(dt(rr))return yt;for(var hr=rr.keys(),Cn=ft(hr),rn=0;;){var Ne=bt(Cn);if(!Ne)return yt.length=rn,yt;var qe=At(Ne);try{yt[rn]=qe}catch(ct){try{$t(Cn)}finally{throw ct}}rn++}}function tt(Ge){if(Ge===null)return 1;switch(typeof Ge){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return Ge===null?1:6;default:return 6}}function dt(Ge){return Ge===void 0}function nt(Ge){return Ge===null}function pr(Ge){return typeof Ge=="symbol"}function ur(Ge){return typeof Ge=="object"?Ge!==null:typeof Ge=="function"}function Ar(Ge,at){switch(tt(Ge)){case 0:return Ge;case 1:return Ge;case 2:return Ge;case 3:return Ge;case 4:return Ge;case 5:return Ge}var yt=at===3?"string":at===5?"number":"default",rr=Be(Ge,i);if(rr!==void 0){var hr=rr.call(Ge,yt);if(ur(hr))throw new TypeError;return hr}return Xn(Ge,yt==="default"?"number":yt)}function Xn(Ge,at){if(at==="string"){var yt=Ge.toString;if(Xr(yt)){var rr=yt.call(Ge);if(!ur(rr))return rr}var hr=Ge.valueOf;if(Xr(hr)){var rr=hr.call(Ge);if(!ur(rr))return rr}}else{var hr=Ge.valueOf;if(Xr(hr)){var rr=hr.call(Ge);if(!ur(rr))return rr}var Cn=Ge.toString;if(Xr(Cn)){var rr=Cn.call(Ge);if(!ur(rr))return rr}}throw new TypeError}function pn(Ge){return!!Ge}function gi(Ge){return""+Ge}function Je(Ge){var at=Ar(Ge,3);return pr(at)?at:gi(at)}function Qt(Ge){return Array.isArray?Array.isArray(Ge):Ge instanceof Object?Ge instanceof Array:Object.prototype.toString.call(Ge)==="[object Array]"}function Xr(Ge){return typeof Ge=="function"}function Ut(Ge){return typeof Ge=="function"}function ge(Ge){switch(tt(Ge)){case 3:return!0;case 4:return!0;default:return!1}}function Be(Ge,at){var yt=Ge[at];if(yt!=null){if(!Xr(yt))throw new TypeError;return yt}}function ft(Ge){var at=Be(Ge,o);if(!Xr(at))throw new TypeError;var yt=at.call(Ge);if(!ur(yt))throw new TypeError;return yt}function At(Ge){return Ge.value}function bt(Ge){var at=Ge.next();return at.done?!1:at}function $t(Ge){var at=Ge.return;at&&at.call(Ge)}function Mr(Ge){var at=Object.getPrototypeOf(Ge);if(typeof Ge!="function"||Ge===m||at!==m)return at;var yt=Ge.prototype,rr=yt&&Object.getPrototypeOf(yt);if(rr==null||rr===Object.prototype)return at;var hr=rr.constructor;return typeof hr!="function"||hr===Ge?at:hr}function tr(){var Ge={},at=[],yt=function(){function rn(Ne,qe,ct){this._index=0,this._keys=Ne,this._values=qe,this._selector=ct}return rn.prototype["@@iterator"]=function(){return this},rn.prototype[o]=function(){return this},rn.prototype.next=function(){var Ne=this._index;if(Ne>=0&&Ne<this._keys.length){var qe=this._selector(this._keys[Ne],this._values[Ne]);return Ne+1>=this._keys.length?(this._index=-1,this._keys=at,this._values=at):this._index++,{value:qe,done:!1}}return{value:void 0,done:!0}},rn.prototype.throw=function(Ne){throw this._index>=0&&(this._index=-1,this._keys=at,this._values=at),Ne},rn.prototype.return=function(Ne){return this._index>=0&&(this._index=-1,this._keys=at,this._values=at),{value:Ne,done:!0}},rn}();return function(){function rn(){this._keys=[],this._values=[],this._cacheKey=Ge,this._cacheIndex=-2}return Object.defineProperty(rn.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),rn.prototype.has=function(Ne){return this._find(Ne,!1)>=0},rn.prototype.get=function(Ne){var qe=this._find(Ne,!1);return qe>=0?this._values[qe]:void 0},rn.prototype.set=function(Ne,qe){var ct=this._find(Ne,!0);return this._values[ct]=qe,this},rn.prototype.delete=function(Ne){var qe=this._find(Ne,!1);if(qe>=0){for(var ct=this._keys.length,Vt=qe+1;Vt<ct;Vt++)this._keys[Vt-1]=this._keys[Vt],this._values[Vt-1]=this._values[Vt];return this._keys.length--,this._values.length--,Ne===this._cacheKey&&(this._cacheKey=Ge,this._cacheIndex=-2),!0}return!1},rn.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=Ge,this._cacheIndex=-2},rn.prototype.keys=function(){return new yt(this._keys,this._values,rr)},rn.prototype.values=function(){return new yt(this._keys,this._values,hr)},rn.prototype.entries=function(){return new yt(this._keys,this._values,Cn)},rn.prototype["@@iterator"]=function(){return this.entries()},rn.prototype[o]=function(){return this.entries()},rn.prototype._find=function(Ne,qe){return this._cacheKey!==Ne&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=Ne)),this._cacheIndex<0&&qe&&(this._cacheIndex=this._keys.length,this._keys.push(Ne),this._values.push(void 0)),this._cacheIndex},rn}();function rr(rn,Ne){return rn}function hr(rn,Ne){return Ne}function Cn(rn,Ne){return[rn,Ne]}}function lr(){return function(){function Ge(){this._map=new b}return Object.defineProperty(Ge.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),Ge.prototype.has=function(at){return this._map.has(at)},Ge.prototype.add=function(at){return this._map.set(at,at),this},Ge.prototype.delete=function(at){return this._map.delete(at)},Ge.prototype.clear=function(){this._map.clear()},Ge.prototype.keys=function(){return this._map.keys()},Ge.prototype.values=function(){return this._map.values()},Ge.prototype.entries=function(){return this._map.entries()},Ge.prototype["@@iterator"]=function(){return this.keys()},Ge.prototype[o]=function(){return this.keys()},Ge}()}function or(){var Ge=16,at=f.create(),yt=rr();return function(){function qe(){this._key=rr()}return qe.prototype.has=function(ct){var Vt=hr(ct,!1);return Vt!==void 0?f.has(Vt,this._key):!1},qe.prototype.get=function(ct){var Vt=hr(ct,!1);return Vt!==void 0?f.get(Vt,this._key):void 0},qe.prototype.set=function(ct,Vt){var Qr=hr(ct,!0);return Qr[this._key]=Vt,this},qe.prototype.delete=function(ct){var Vt=hr(ct,!1);return Vt!==void 0?delete Vt[this._key]:!1},qe.prototype.clear=function(){this._key=rr()},qe}();function rr(){var qe;do qe="@@WeakMap@@"+Ne();while(f.has(at,qe));return at[qe]=!0,qe}function hr(qe,ct){if(!r.call(qe,yt)){if(!ct)return;Object.defineProperty(qe,yt,{value:f.create()})}return qe[yt]}function Cn(qe,ct){for(var Vt=0;Vt<ct;++Vt)qe[Vt]=Math.random()*255|0;return qe}function rn(qe){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(qe)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(qe)):Cn(new Uint8Array(qe),qe):Cn(new Array(qe),qe)}function Ne(){var qe=rn(Ge);qe[6]=qe[6]&79|64,qe[8]=qe[8]&191|128;for(var ct="",Vt=0;Vt<Ge;++Vt){var Qr=qe[Vt];(Vt===4||Vt===6||Vt===8)&&(ct+="-"),Qr<16&&(ct+="0"),ct+=Qr.toString(16).toLowerCase()}return ct}}function Q(Ge){return Ge.__=void 0,delete Ge.__,Ge}})})(hT||(hT={}));function Oce(e,t){return{type:e.type,field:"value",items:e.positions.map(function(r,n){var i;return i={},F(i,t,n>=e.colors.length?null:e.colors[n]),F(i,"value",r),i})}}function kce(e){var t=Dce();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Dce(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Fce=`uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniforms {
|
|
float u_opacity:1.0;
|
|
float u_brightness:1.0;
|
|
float u_contrast:1.0;
|
|
float u_saturation:1.0;
|
|
float u_gamma:1.0;
|
|
};
|
|
|
|
in vec2 v_texCoord;
|
|
out vec4 outputColor;
|
|
vec3 setContrast(vec3 rgb, float contrast) {
|
|
vec3 color = mix(vec3(0.5), rgb, contrast);
|
|
color = clamp(color, 0.0, 1.0);
|
|
return color;
|
|
}
|
|
vec3 setSaturation(vec3 rgb, float adjustment) {
|
|
const vec3 grayVector = vec3(0.2125, 0.7154, 0.0721);
|
|
vec3 intensity = vec3(dot(rgb, grayVector));
|
|
vec3 color = mix(intensity, rgb, adjustment);
|
|
color = clamp(color, 0.0, 1.0);
|
|
return color;
|
|
}
|
|
void main() {
|
|
vec4 color = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y));
|
|
//brightness
|
|
color.rgb = mix(vec3(0.0, 0.0, 0.0), color.rgb, u_brightness);
|
|
//contrast
|
|
color.rgb = setContrast(color.rgb, u_contrast);
|
|
// saturation
|
|
color.rgb = setSaturation(color.rgb, u_saturation);
|
|
// gamma
|
|
color.rgb = pow(color.rgb, vec3(u_gamma));
|
|
outputColor = color;
|
|
outputColor.a *= u_opacity;
|
|
if(outputColor.a < 0.01)
|
|
discard;
|
|
}
|
|
`,Bce=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 14) in vec2 a_Uv;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
float u_opacity:1.0;
|
|
float u_brightness:1.0;
|
|
float u_contrast:1.0;
|
|
float u_saturation:1.0;
|
|
float u_gamma:1.0;
|
|
};
|
|
|
|
out vec2 v_texCoord;
|
|
#pragma include "projection"
|
|
void main() {
|
|
v_texCoord = a_Uv;
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
|
|
|
|
}
|
|
`,Lce=function(e){_n(r,e);var t=kce(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,a=i.brightness,u=i.contrast,c=i.saturation,f=i.gamma,m={u_opacity:pv(o,1),u_brightness:pv(a,1),u_contrast:pv(u,1),u_saturation:pv(c,1),u_gamma:pv(f,1)};this.textures=[this.texture];var _=this.getUniformsBufferInfo(m);return _}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.loadTexture();case 2:return u.abrupt("return",this.buildModels());case 3:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"loadTexture",value:function(){var n=Mt(he.mark(function o(){var a,u,c;return he.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return a=this.rendererService.createTexture2D,this.texture=a({height:1,width:1}),u=this.layer.getSource(),m.next=5,u.data.images;case 5:c=m.sent,this.texture=a({data:c[0],width:c[0].width,height:c[0].height,mag:W.LINEAR,min:W.LINEAR});case 7:case"end":return m.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.initUniformsBuffer(),c.next=3,this.layer.buildLayerModel({moduleName:"rasterImage",vertexShader:Bce,fragmentShader:Fce,triangulation:gy,primitive:W.TRIANGLES,blend:{enable:!0},depth:{enable:!1},pickingEnabled:!1});case 3:return a=c.sent,c.abrupt("return",[a]);case 5:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:wn.Attribute,descriptor:{name:"a_Uv",shaderLocation:Vn.UV,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(o,a,u){return[u[3],u[4]]}}})}}]),r}(Ba),Nce={image:Lce};function Uce(e){var t=zce();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function zce(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var $ce=function(e){_n(r,e);var t=Uce(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"type","ImageLayer"),n}return jt(r,[{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return a=this.getModelType(),this.layerModel=new Nce[a](this),c.next=4,this.initLayerModels();case 4:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getDefaultConfig",value:function(){var i=this.getModelType(),o={image:{}};return o[i]}},{key:"getModelType",value:function(){return"image"}}]),r}(P0);function Vce(e){var t=jce();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function jce(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Hce=`
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array;
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float segmentNumber;
|
|
float u_lineDir: 1.0;
|
|
float u_icon_step: 100;
|
|
float u_line_texture: 0.0;
|
|
float u_textureBlend;
|
|
float u_blur : 0.9;
|
|
float u_line_type: 0.0;
|
|
float u_time;
|
|
float u_linearColor: 0.0;
|
|
};
|
|
|
|
in vec4 v_color;
|
|
in vec2 v_iconMapUV;
|
|
in vec4 v_lineData;
|
|
//dash
|
|
in vec4 v_dash_array;
|
|
in float v_distance_ratio;
|
|
|
|
out vec4 outputColor;
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
if(u_dash_array!=vec4(0.0)){
|
|
float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
|
|
if(!(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z))) {
|
|
discard;
|
|
};
|
|
}
|
|
float animateSpeed = 0.0; // 运动速度
|
|
outputColor = v_color;
|
|
if(u_animate.x == Animate && u_line_texture != LineTexture) {
|
|
animateSpeed = u_time / u_animate.y;
|
|
float alpha =1.0 - fract( mod(1.0- v_lineData.b, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
// alpha = smoothstep(0., 1., alpha);
|
|
alpha = clamp(alpha, 0.0, 1.0);
|
|
outputColor.a *= alpha;
|
|
}
|
|
|
|
// 当存在贴图时在底色上贴上贴图
|
|
if(u_line_texture == LineTexture) { // while load texture
|
|
float arcRadio = smoothstep( 0.0, 1.0, (v_lineData.r / segmentNumber));
|
|
// float arcRadio = smoothstep( 0.0, 1.0, d_distance_ratio);
|
|
|
|
float count = v_lineData.g; // 贴图在弧线上重复的数量
|
|
|
|
float time = 0.0;
|
|
if(u_animate.x == Animate) {
|
|
time = u_time / u_animate.y;
|
|
}
|
|
float redioCount = arcRadio * count;
|
|
|
|
float u = fract(redioCount - time);
|
|
float v = v_lineData.a; // 横向 v
|
|
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
|
|
|
|
vec4 pattern = texture(SAMPLER_2D(u_texture), uv);
|
|
|
|
if(u_animate.x == Animate) {
|
|
float currentPlane = floor(redioCount - time);
|
|
float textureStep = floor(count * u_animate.z);
|
|
float a = mod(currentPlane, textureStep);
|
|
if(a < textureStep - 1.0) {
|
|
pattern = vec4(0.0);
|
|
}
|
|
}
|
|
|
|
if(u_textureBlend == 0.0) { // normal
|
|
pattern.a = 0.0;
|
|
outputColor = filterColor(outputColor + pattern);
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(outputColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
}
|
|
outputColor = filterColor(pattern);
|
|
}
|
|
|
|
} else {
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
}`,Gce=`#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 12) in vec4 a_Instance;
|
|
layout(location = 14) in vec2 a_iconMapUV;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array;
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float segmentNumber;
|
|
float u_lineDir: 1.0;
|
|
float u_icon_step: 100;
|
|
float u_line_texture: 0.0;
|
|
float u_textureBlend;
|
|
float u_blur : 0.9;
|
|
float u_line_type: 0.0;
|
|
float u_time;
|
|
float u_linearColor: 0.0;
|
|
};
|
|
out vec4 v_color;
|
|
out vec2 v_iconMapUV;
|
|
out vec4 v_lineData;
|
|
//dash
|
|
out vec4 v_dash_array;
|
|
out float v_distance_ratio;
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
|
|
float bezier3(vec3 arr, float t) {
|
|
float ut = 1. - t;
|
|
return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;
|
|
}
|
|
vec2 midPoint(vec2 source, vec2 target, float arcThetaOffset) {
|
|
vec2 center = target - source;
|
|
float r = length(center);
|
|
float theta = atan(center.y, center.x);
|
|
float thetaOffset = arcThetaOffset;
|
|
float r2 = r / 2.0 / cos(thetaOffset);
|
|
float theta2 = theta + thetaOffset;
|
|
vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);
|
|
if(u_lineDir == 1.0) { // 正向
|
|
return mid;
|
|
} else { // 逆向
|
|
// (mid + vmin)/2 = (s + t)/2
|
|
vec2 vmid = source + target - mid;
|
|
return vmid;
|
|
}
|
|
// return mid;
|
|
}
|
|
float getSegmentRatio(float index) {
|
|
// dash: index / (segmentNumber - 1.);
|
|
// normal: smoothstep(0.0, 1.0, index / (segmentNumber - 1.));
|
|
return smoothstep(0.0, 1.0, index / (segmentNumber - 1.));
|
|
// return index / (segmentNumber - 1.);
|
|
}
|
|
vec2 interpolate (vec2 source, vec2 target, float t, float arcThetaOffset) {
|
|
// if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation
|
|
vec2 mid = midPoint(source, target, arcThetaOffset);
|
|
vec3 x = vec3(source.x, mid.x, target.x);
|
|
vec3 y = vec3(source.y, mid.y, target.y);
|
|
return vec2(bezier3(x ,t), bezier3(y,t));
|
|
}
|
|
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;
|
|
return offset;
|
|
}
|
|
vec2 getNormal(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);
|
|
}
|
|
|
|
void main() {
|
|
//vs中计算渐变色
|
|
if(u_linearColor==1.0){
|
|
float d_segmentIndex = a_Position.x + 1.0; // 当前顶点在弧线中所处的分段位置
|
|
v_color = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);
|
|
}
|
|
else{
|
|
v_color = a_Color;
|
|
}
|
|
v_color.a = v_color.a * opacity;
|
|
|
|
vec2 source = a_Instance.rg; // 起始点
|
|
vec2 target = a_Instance.ba; // 终点
|
|
|
|
|
|
|
|
float segmentIndex = a_Position.x;
|
|
float segmentRatio = getSegmentRatio(segmentIndex);
|
|
|
|
//计算dashArray和distanceRatio 输出到片元
|
|
vec2 s = source;
|
|
vec2 t = target;
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
s = unProjCustomCoord(source);
|
|
t = unProjCustomCoord(target);
|
|
}
|
|
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
|
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;
|
|
v_distance_ratio = segmentIndex / segmentNumber;
|
|
|
|
float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
|
|
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
|
|
float d_distance_ratio;
|
|
|
|
if(u_animate.x == Animate) {
|
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
if(u_lineDir != 1.0) {
|
|
d_distance_ratio = 1.0 - d_distance_ratio;
|
|
}
|
|
}
|
|
|
|
v_lineData.b = d_distance_ratio;
|
|
|
|
vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio, thetaOffset), 0.0, 1.0));
|
|
vec4 next = project_position(vec4(interpolate(source, target, nextSegmentRatio, thetaOffset), 0.0, 1.0));
|
|
|
|
|
|
vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));
|
|
|
|
|
|
float d_segmentIndex = a_Position.x + 1.0; // 当前顶点在弧线中所处的分段位置
|
|
v_lineData.r = d_segmentIndex;
|
|
|
|
if(LineTexture == u_line_texture) { // 开启贴图模式
|
|
|
|
float arcDistrance = length(source - target); // 起始点和终点的距离
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20) { // amap
|
|
arcDistrance *= 1000000.0;
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox
|
|
// arcDistrance *= 8.0;
|
|
arcDistrance = project_pixel_allmap(arcDistrance);
|
|
}
|
|
v_iconMapUV = a_iconMapUV;
|
|
|
|
float pixelLen = project_pixel_texture(u_icon_step); // 贴图沿弧线方向的长度 - 随地图缩放改变
|
|
float texCount = floor(arcDistrance/pixelLen); // 贴图在弧线上重复的数量
|
|
v_lineData.g = texCount;
|
|
|
|
float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // 线横向偏移的距离
|
|
float linePixelSize = project_pixel(a_Size); // 定点位置偏移
|
|
v_lineData.a = lineOffsetWidth/linePixelSize; // 线图层贴图部分的 v 坐标值
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + offset, 0, 1.0));
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,Wce={solid:0,dash:1};Ci.isNumber;var Xce=function(e){_n(r,e);var t=Vce(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"updateTexture",function(){var u=n.rendererService.createTexture2D;if(n.texture){n.texture.update({data:n.iconService.getCanvas()}),n.layer.render();return}n.texture=u({data:n.iconService.getCanvas(),mag:W.NEAREST,min:W.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128}),n.textures=[n.texture]}),n}return jt(r,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.sourceColor,a=i.targetColor,u=i.textureBlend,c=u===void 0?"normal":u,f=i.lineType,m=f===void 0?"solid":f,_=i.dashArray,b=_===void 0?[10,5]:_,A=i.forward,w=A===void 0?!0:A,R=i.lineTexture,P=R===void 0?!1:R,k=i.iconStep,L=k===void 0?100:k,B=i.segmentNumber,V=B===void 0?30:B,G=this.layer.getLayerConfig(),K=G.animateOption,Z=b;m!=="dash"&&(Z=[0,0]),Z.length===2&&Z.push(0,0);var ve=0,Ie=[0,0,0,0],de=[0,0,0,0];o&&a&&(Ie=Ta(o),de=Ta(a),ve=1),this.rendererService.getDirty()&&this.texture.bind();var se={u_animate:this.animateOption2Array(K),u_dash_array:Z,u_sourceColor:Ie,u_targetColor:de,u_textSize:[1024,this.iconService.canvasHeight||128],segmentNumber:V,u_lineDir:w?1:-1,u_icon_step:L,u_line_texture:P?1:0,u_textureBlend:c==="normal"?0:1,u_blur:.9,u_line_type:Wce[m||"solid"],u_time:this.layer.getLayerAnimateTime()||0,u_linearColor:ve},le=this.getUniformsBufferInfo(se);return le}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),u.abrupt("return",this.buildModels());case 3:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"getShaders",value:function(){return{frag:Hce,vert:Gce,type:""}}},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f,m,_,b,A;return he.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return this.initUniformsBuffer(),a=this.layer.getLayerConfig(),u=a.segmentNumber,c=u===void 0?30:u,f=this.getShaders(),m=f.frag,_=f.vert,b=f.type,R.next=5,this.layer.buildLayerModel({moduleName:"lineArc2d"+b,vertexShader:_,fragmentShader:m,inject:this.getInject(),triangulation:ob,depth:{enable:!1},styleOption:{segmentNumber:c}});case 5:return A=R.sent,R.abrupt("return",[A]);case 7:case"end":return R.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(a){var u=a.size,c=u===void 0?1:u;return Array.isArray(c)?[c[0]]:[c]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:wn.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:4,update:function(a,u,c){return[c[3],c[4],c[5],c[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:wn.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(a){var u=i.iconService.getIconMap(),c=a.texture,f=u[c]||{x:0,y:0},m=f.x,_=f.y;return[m,_]}}})}}]),r}(Ba);function Yce(e){var t=Zce();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Zce(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var qce=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
|
|
uniform sampler2D u_texture;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float u_globel;
|
|
float u_globel_radius;
|
|
float u_global_height: 10;
|
|
float segmentNumber;
|
|
float u_line_type: 0.0;
|
|
float u_icon_step: 100;
|
|
float u_line_texture: 0.0;
|
|
float u_textureBlend;
|
|
float u_time;
|
|
float u_linearColor: 0.0;
|
|
};
|
|
|
|
// varying vec2 v_normal;
|
|
in vec4 v_dash_array;
|
|
in vec4 v_color;
|
|
in vec4 v_line_data;
|
|
in float v_segmentIndex;
|
|
in vec2 v_iconMapUV;
|
|
|
|
out vec4 outputColor;
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
float animateSpeed = 0.0; // 运动速度
|
|
float d_distance_ratio = v_line_data.g; // 当前点位距离占线总长的比例
|
|
outputColor = v_color;
|
|
|
|
if(u_line_type == LineTypeDash) {
|
|
float flag = 0.;
|
|
float dashLength = mod(d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
|
|
if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {
|
|
flag = 1.;
|
|
}
|
|
outputColor.a *=flag;
|
|
}
|
|
|
|
if(u_animate.x == Animate && u_line_texture != LineTexture) {
|
|
animateSpeed = u_time / u_animate.y;
|
|
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
|
|
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
// alpha = smoothstep(0., 1., alpha);
|
|
alpha = clamp(alpha, 0.0, 1.0);
|
|
outputColor.a *= alpha;
|
|
|
|
// u_animate
|
|
// x enable
|
|
// y duration
|
|
// z interval
|
|
// w trailLength
|
|
}
|
|
|
|
if(u_line_texture == LineTexture && u_line_type != LineTypeDash) { // while load texture
|
|
// float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / segmentNumber));
|
|
float arcRadio = v_segmentIndex / (segmentNumber - 1.0);
|
|
float count = v_line_data.b; // // 贴图在弧线上重复的数量
|
|
|
|
float time = 0.0;
|
|
if(u_animate.x == Animate) {
|
|
time = u_time / u_animate.y;
|
|
}
|
|
float redioCount = arcRadio * count;
|
|
|
|
float u = fract(redioCount - time);
|
|
|
|
float v = v_line_data.a; // 线图层贴图部分的 v 坐标值
|
|
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
|
|
vec4 pattern = texture(SAMPLER_2D(u_texture), uv);
|
|
|
|
if(u_animate.x == Animate) {
|
|
float currentPlane = floor(redioCount - time);
|
|
float textureStep = floor(count * u_animate.z);
|
|
float a = mod(currentPlane, textureStep);
|
|
if(a < textureStep - 1.0) {
|
|
pattern = vec4(0.0);
|
|
}
|
|
}
|
|
|
|
if(u_textureBlend == 0.0) { // normal
|
|
pattern.a = 0.0;
|
|
outputColor = filterColor(outputColor + pattern);
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(outputColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
discard;
|
|
} else {
|
|
outputColor = filterColor(pattern);
|
|
}
|
|
}
|
|
|
|
} else {
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
}
|
|
`,Kce=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 12) in vec4 a_Instance;
|
|
layout(location = 14) in vec2 a_iconMapUV;
|
|
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float u_globel;
|
|
float u_globel_radius;
|
|
float u_global_height: 10;
|
|
float segmentNumber;
|
|
float u_line_type: 0.0;
|
|
float u_icon_step: 100;
|
|
float u_line_texture: 0.0;
|
|
float u_textureBlend;
|
|
float u_time;
|
|
float u_linearColor: 0.0;
|
|
};
|
|
out vec4 v_color;
|
|
out vec4 v_dash_array;
|
|
out float v_segmentIndex;
|
|
out vec2 v_iconMapUV;
|
|
out vec4 v_line_data;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
|
|
float maps (float value, float start1, float stop1, float start2, float stop2) {
|
|
return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));
|
|
}
|
|
|
|
float getSegmentRatio(float index) {
|
|
return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));
|
|
}
|
|
|
|
float paraboloid(vec2 source, vec2 target, float ratio) {
|
|
vec2 x = mix(source, target, ratio);
|
|
vec2 center = mix(source, target, 0.5);
|
|
float dSourceCenter = distance(source, center);
|
|
float dXCenter = distance(x, center);
|
|
return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);
|
|
}
|
|
|
|
vec3 getPos(vec2 source, vec2 target, float segmentRatio) {
|
|
float vertex_height = paraboloid(source, target, segmentRatio);
|
|
|
|
return vec3(
|
|
mix(source, target, segmentRatio),
|
|
sqrt(max(0.0, vertex_height))
|
|
);
|
|
}
|
|
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
|
|
vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;
|
|
|
|
return offset;
|
|
}
|
|
vec2 getNormal(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);
|
|
}
|
|
|
|
float torad(float deg) {
|
|
return (deg / 180.0) * acos(-1.0);
|
|
}
|
|
|
|
vec3 lglt2xyz(vec2 lnglat) {
|
|
float pi = 3.1415926;
|
|
// + Math.PI/2 是为了对齐坐标
|
|
float lng = torad(lnglat.x) + pi / 2.0;
|
|
float lat = torad(lnglat.y);
|
|
|
|
// 手动增加一些偏移,减轻面的冲突
|
|
float radius = u_globel_radius;
|
|
|
|
float z = radius * cos(lat) * cos(lng);
|
|
float x = radius * cos(lat) * sin(lng);
|
|
float y = radius * sin(lat);
|
|
return vec3(x, y, z);
|
|
}
|
|
|
|
void main() {
|
|
//vs中计算渐变色
|
|
if(u_linearColor==1.0){
|
|
float d_segmentIndex = a_Position.x + 1.0; // 当前顶点在弧线中所处的分段位置
|
|
v_color = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);
|
|
}
|
|
else{
|
|
v_color = a_Color;
|
|
}
|
|
v_color.a = v_color.a * opacity;
|
|
vec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy;
|
|
vec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy;
|
|
float segmentIndex = a_Position.x;
|
|
float segmentRatio = getSegmentRatio(segmentIndex);
|
|
float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
|
|
|
|
float d_distance_ratio;
|
|
if(u_line_type == LineTypeDash) {
|
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
vec2 s = source;
|
|
vec2 t = target;
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
s = unProjCustomCoord(source);
|
|
t = unProjCustomCoord(target);
|
|
}
|
|
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
|
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
|
|
}
|
|
if(u_animate.x == Animate) {
|
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
}
|
|
v_line_data.g = d_distance_ratio; // 当前点位距离占线总长的比例
|
|
|
|
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
|
|
vec3 curr = getPos(source, target, segmentRatio);
|
|
vec3 next = getPos(source, target, nextSegmentRatio);
|
|
vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y);
|
|
// v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);
|
|
|
|
|
|
v_segmentIndex = a_Position.x;
|
|
if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { // 开启贴图模式
|
|
|
|
float arcDistrance = length(source - target);
|
|
float pixelLen = project_pixel_texture(u_icon_step);
|
|
v_line_data.b = floor(arcDistrance/pixelLen); // 贴图在弧线上重复的数量
|
|
|
|
vec2 projectOffset = project_pixel(offset);
|
|
float lineOffsetWidth = length(projectOffset + projectOffset * sign(a_Position.y)); // 线横向偏移的距离
|
|
float linePixelSize = project_pixel(a_Size); // 定点位置偏移,按地图等级缩放后的距离
|
|
v_line_data.a = lineOffsetWidth/linePixelSize; // 线图层贴图部分的 v 坐标值
|
|
|
|
v_iconMapUV = a_iconMapUV;
|
|
}
|
|
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + project_pixel(offset), curr.z * thetaOffset, 1.0));
|
|
|
|
// 地球模式
|
|
if(u_globel > 0.0) {
|
|
vec3 startLngLat = lglt2xyz(a_Instance.rg);
|
|
vec3 endLngLat = lglt2xyz(a_Instance.ba);
|
|
float globalRadius = length(startLngLat);
|
|
|
|
vec3 lineDir = normalize(endLngLat - startLngLat);
|
|
vec3 midPointDir = normalize((startLngLat + endLngLat)/2.0);
|
|
|
|
// 线的偏移
|
|
vec3 lnglatOffset = cross(lineDir, midPointDir) * a_Position.y;
|
|
// 计算起始点和终止点的距离
|
|
float lnglatLength = length(a_Instance.rg - a_Instance.ba)/50.0;
|
|
// 计算飞线各个节点相应的高度
|
|
float lineHeight = u_global_height * (-4.0*segmentRatio*segmentRatio + 4.0 * segmentRatio) * lnglatLength;
|
|
// 地球点位
|
|
vec3 globalPoint = normalize(mix(startLngLat, endLngLat, segmentRatio)) * (globalRadius + lineHeight) + lnglatOffset * a_Size;
|
|
|
|
gl_Position = u_ViewProjectionMatrix * vec4(globalPoint, 1.0);
|
|
}
|
|
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,Qce={solid:0,dash:1},pT=function(e){_n(r,e);var t=Yce(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"updateTexture",function(){var u=n.rendererService.createTexture2D;if(n.texture){n.texture.update({data:n.iconService.getCanvas()}),n.layer.render();return}n.texture=u({data:n.iconService.getCanvas(),mag:W.NEAREST,min:W.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128}),n.textures=[n.texture]}),n}return jt(r,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.sourceColor,a=i.targetColor,u=i.textureBlend,c=u===void 0?"normal":u,f=i.lineType,m=f===void 0?"solid":f,_=i.dashArray,b=_===void 0?[10,5]:_,A=i.lineTexture,w=A===void 0?!1:A,R=i.iconStep,P=R===void 0?100:R,k=i.segmentNumber,L=k===void 0?30:k,B=i.globalArcHeight,V=B===void 0?10:B,G=this.layer.getLayerConfig(),K=G.animateOption;b.length===2&&b.push(0,0);var Z=0,ve=[0,0,0,0],Ie=[0,0,0,0];o&&a&&(ve=Ta(o),Ie=Ta(a),Z=1),this.rendererService.getDirty()&&this.texture.bind();var de={u_animate:this.animateOption2Array(K),u_dash_array:b,u_sourceColor:ve,u_targetColor:Ie,u_textSize:[1024,this.iconService.canvasHeight||128],u_globel:this.mapService.version==="GLOBEL"?1:0,u_globel_radius:PP,u_global_height:V,segmentNumber:L,u_line_type:Qce[m]||0,u_icon_step:P,u_line_texture:w?1:0,u_textureBlend:c==="normal"?0:1,u_time:this.layer.getLayerAnimateTime()||0,u_linearColor:Z},se=this.getUniformsBufferInfo(de);return se}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.initUniformsBuffer(),this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),u.abrupt("return",this.buildModels());case 4:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"getShaders",value:function(){return{frag:qce,vert:Kce,type:""}}},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f,m,_,b,A;return he.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return a=this.layer.getLayerConfig(),u=a.segmentNumber,c=u===void 0?30:u,f=this.getShaders(),m=f.frag,_=f.vert,b=f.type,R.next=4,this.layer.buildLayerModel({moduleName:"lineArc3d"+b,vertexShader:_,fragmentShader:m,inject:this.getInject(),triangulation:ob,styleOption:{segmentNumber:c}});case 4:return A=R.sent,R.abrupt("return",[A]);case 6:case"end":return R.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(a){var u=a.size,c=u===void 0?1:u;return Array.isArray(c)?[c[0]]:[c]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:wn.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:4,update:function(a,u,c){return[c[3],c[4],c[5],c[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:wn.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(a){var u=i.iconService.getIconMap(),c=a.texture,f=u[c]||{x:0,y:0},m=f.x,_=f.y;return[m,_]}}})}}]),r}(Ba),dT={circle:2,triangle:2,diamond:4,rect:2,classic:3,halfTriangle:2,none:0},Nu=1/2;function Jce(e,t){var r=t.width,n=r===void 0?2:r,i=t.height,o=i===void 0?1:i;return{vertices:[0,Nu*e,1*e*n,-(o+Nu)*e,1*e*n,(o-Nu)*e,0,Nu*e,1*e*n,-(o+Nu)*e,1*e*n,(o-Nu)*e],indices:[3,4,5],outLineIndices:[0,1,2],normals:[1*e,-2*e,1,-2*e,1.5*e,1,1*e,1.5*e,1,0,0,0,0,0,0,0,0,0],dimensions:2}}function efe(e,t){var r=t.width,n=r===void 0?2:r,i=t.height,o=i===void 0?3:i;return{vertices:[0,0,1*e*n,1*o,1*e*n,-1*o,0,0,1*e*n,1*o,1*e*n,-1*o],outLineIndices:[0,1,2],indices:[3,4,5],normals:[0,-1.5*e,1,2,1*e,1,-2,1*e,1,0,0,0,0,0,0,0,0,0],dimensions:2}}function tfe(e,t){var r=t.width,n=r===void 0?2:r,i=t.height,o=i===void 0?2:i;return{vertices:[0,o/2,e*n*1,o/2,e*n*1,-o/2,0,-o/2,0,o/2,e*n*1,o/2,e*n*1,-o/2,0,-o/2],dimensions:2,indices:[4,5,6,4,6,7],outLineIndices:[0,1,2,0,2,3],normals:[0,-e,1,1,0,1,0,-e,1,-1,-0,1,0,0,0,0,0,0,0,0,0,0,0,0]}}function rfe(e,t){var r=t.width,n=r===void 0?2:r,i=t.height,o=i===void 0?3:i;return{vertices:[0,0,1*n*e,.5*o,2*n*e,0,1*n*e,-.5*o,0,0,1*n*e,.5*o,2*n*e,0,1*n*e,-.5*o],dimensions:2,indices:[4,5,6,4,6,7],outLineIndices:[0,1,2,0,2,3],normals:[0,-e,1,1,0,1,0,-e,1,-1,-0,1,0,0,0,0,0,0,0,0,0,0,0,0]}}function nfe(e,t){var r=t.width,n=r===void 0?2:r,i=t.height,o=i===void 0?3:i;return{vertices:[0,0,2*e*n,1*o,1.5*e*n,0,2*e*n,-1*o,0,0,2*e*n,1*o,1.5*e*n,0,2*e*n,-1*o],dimensions:2,indices:[4,5,6,4,6,7],outLineIndices:[0,1,2,0,2,3],normals:[0,-e,1,1,0,1,0,-e,1,-1,-0,1,0,0,0,0,0,0,0,0,0,0,0,0]}}function ife(e,t){var r=t.width,n=r===void 0?2:r,i=t.height,o=i===void 0?2:i,a=Sx(),u=mf.flatten([a]),c=mf(u.vertices,u.holes,u.dimensions),f=a.map(function(m){return[m[0]*n*e,m[1]*o]}).flat();return{vertices:[].concat(nr(f),nr(f)),dimensions:2,indices:c.map(function(m){return m+a.length}),outLineIndices:c,normals:[].concat(nr(a.map(function(m){return[m[1]*o,m[0]*n*e,1]}).flat()),nr(new Array(a.length*3).fill(0)))}}function afe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=mu(r.source)==="object"?r.source.type:r.source,i=mu(r.target)==="object"?r.target.type:r.target,o=mu(r.source)==="object"?r.source:{},a=o.width,u=a===void 0?n?dT[n]:0:a;o.height;var c=mu(r.target)==="object"?r.target:{},f=c.width,m=f===void 0?i?dT[i]:0:f;return c.height,{vertices:[0,Nu,1*u].concat(nr(e),[1,Nu,-1*m],nr(e),[1,-Nu,-1*m],nr(e),[0,-Nu,1*u],nr(e),[0,Nu,1*u],nr(e),[1,Nu,-1*m],nr(e),[1,-Nu,-1*m],nr(e),[0,-Nu,1*u],nr(e)),outLineIndices:[0,1,2,0,2,3].map(function(_){return _+t}),indices:[4,5,6,4,6,7].map(function(_){return _+t}),normals:[1,-1,1,1,1,1,-1,0,1,-1,0,1,0,0,0,0,0,0,0,0,0,0,0,0],dimensions:2}}function vT(e,t){var r=mu(e)==="object"?e.type:e,n=t==="source"?1:-1,i=mu(e)==="object"?e:{};switch(r){case"circle":return ife(n,i);case"triangle":return efe(n,i);case"diamond":return rfe(n,i);case"rect":return tfe(n,i);case"classic":return nfe(n,i);case"halfTriangle":return Jce(n,i);default:return{vertices:[],indices:[],normals:[],dimensions:2,outLineIndices:[],outLineNormals:[]}}}function ofe(e){var t=e.coordinates.flat(),r=1,n=1;return{vertices:[1,0,0].concat(nr(t),[1,2,-3],nr(t),[1,1,-3],nr(t),[0,1,0],nr(t),[0,0,0],nr(t),[1,0,0],nr(t),[1,2,-3],nr(t),[1,1,-3],nr(t),[0,1,0],nr(t),[0,0,0],nr(t)),normals:[-r,2*n,1,2*n,-n,1,n,-n,1,n,-n,1,-r,-n,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],indices:[0,1,2,0,2,3,0,3,4,5,6,7,5,7,8,5,8,9],size:7}}function sfe(e,t){return t?ufe(e,t):ofe(e)}function ufe(e,t){var r=e.coordinates.flat(),n=t,i=n.target,o=i===void 0?"classic":i,a=n.source,u=a===void 0?"circle":a,c=mT(vT(u,"source"),r,0,0),f=afe(r,c.vertices.length/7,t),m=mT(vT(o,"target"),r,1,c.vertices.length/7+f.vertices.length/7),_={vertices:[].concat(nr(c.vertices),nr(f.vertices),nr(m.vertices)),indices:[].concat(nr(c.outLineIndices),nr(f.outLineIndices),nr(m.outLineIndices),nr(c.indices),nr(f.indices),nr(m.indices)),normals:[].concat(nr(c.normals),nr(f.normals),nr(m.normals)),size:7};return _}function mT(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=[],o=e.vertices,a=e.indices,u=e.dimensions,c=e.outLineIndices,f=0;f<o.length;f+=u)i.push.apply(i,[r,o[f+1],o[f]].concat(nr(t)));return Qe(Qe({},e),{},{vertices:i,indices:a.map(function(m){return m+n}),outLineIndices:c.map(function(m){return m+n})})}function lfe(e){var t=cfe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function cfe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ffe=`// #extension GL_OES_standard_derivatives : enable
|
|
|
|
in vec4 v_color;
|
|
out vec4 outputColor;
|
|
|
|
|
|
// line texture
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
outputColor = v_color;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,hfe=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in vec2 a_Size;
|
|
layout(location = 12) in vec4 a_Instance;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
float u_gap_width: 1.0;
|
|
float u_stroke_width: 1.0;
|
|
float u_stroke_opacity: 1.0;
|
|
};
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
|
|
out vec4 v_color;
|
|
|
|
vec2 project_pixel_offset(vec2 offsets) {
|
|
|
|
vec2 data = project_pixel(offsets);
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3
|
|
return data;
|
|
}
|
|
|
|
return vec2(data.x, -data.y);;
|
|
}
|
|
|
|
vec2 line_dir(vec2 target, vec2 source) {
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3
|
|
return normalize(target - source);
|
|
}
|
|
return normalize(ProjectFlat(target) - ProjectFlat(source));
|
|
}
|
|
|
|
float flag_gap() {
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3
|
|
return 1.;
|
|
}
|
|
return -1.;
|
|
|
|
}
|
|
|
|
|
|
void main() {
|
|
|
|
// 透明度计算
|
|
vec2 source = a_Instance.rg; // 起始点
|
|
vec2 target = a_Instance.ba; // 终点
|
|
vec2 flowlineDir = line_dir(target,source);
|
|
vec2 perpendicularDir = vec2(-flowlineDir.y, flowlineDir.x); // mapbox || 高德
|
|
|
|
vec2 position = mix(source, target, a_Position.x);
|
|
|
|
float lengthCommon = length(project_position(vec4(target,0,1)) - project_position(vec4(source,0,1))); //
|
|
vec2 offsetDistances = a_Size.x * project_pixel_offset(vec2(a_Position.y, a_Position.z)); // Mapbox || 高德
|
|
vec2 limitedOffsetDistances = clamp(
|
|
offsetDistances,
|
|
project_pixel(-lengthCommon*.2), project_pixel(lengthCommon*.2)
|
|
);
|
|
|
|
|
|
float startOffsetCommon = project_pixel(offsets[0]);
|
|
float endOffsetCommon = project_pixel(offsets[1]);
|
|
float endpointOffset = mix(
|
|
clamp(startOffsetCommon, 0.0, lengthCommon*.2),
|
|
-clamp(endOffsetCommon, 0.0, lengthCommon*.2),
|
|
a_Position.x
|
|
);
|
|
|
|
vec2 normalsCommon = u_stroke_width * project_pixel_offset(vec2(a_Normal.x, a_Normal.y)); // mapbox || 高德
|
|
|
|
float gapCommon = flag_gap() * project_pixel(u_gap_width);
|
|
vec3 offsetCommon = vec3(
|
|
flowlineDir * (limitedOffsetDistances[1] + normalsCommon.y + endpointOffset * 1.05) -
|
|
perpendicularDir * (limitedOffsetDistances[0] + gapCommon + normalsCommon.x),
|
|
0.0
|
|
);
|
|
|
|
vec4 project_pos = project_position(vec4(position.xy, 0, 1.0));
|
|
|
|
vec4 fillColor = vec4(a_Color.rgb, a_Color.a * opacity);
|
|
v_color = mix(fillColor, vec4(u_stroke.xyz, u_stroke.w * fillColor.w * u_stroke_opacity), a_Normal.z);
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offsetCommon.xy, 0., 1.0));
|
|
|
|
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,pfe=function(e){_n(r,e);var t=lfe(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.gapWidth,a=o===void 0?2:o,u=i.strokeWidth,c=u===void 0?1:u,f=i.strokeOpacity,m=f===void 0?1:f,_={u_gap_width:a,u_stroke_width:c,u_stroke_opacity:m},b=this.getUniformsBufferInfo(_);return b}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.initUniformsBuffer(),u.abrupt("return",this.buildModels());case 2:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.layer.buildLayerModel({moduleName:"flow_line",vertexShader:hfe,fragmentShader:ffe,inject:this.getInject(),triangulation:sfe,styleOption:this.layer.getLayerConfig().symbol,primitive:W.TRIANGLES,depth:{enable:!1},pick:!1});case 2:return a=c.sent,c.abrupt("return",[a]);case 4:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(o){var a=o.size,u=a===void 0?1:a;return Array.isArray(u)?[u[0],u[1]]:[u,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:wn.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:4,update:function(o,a,u){return[u[3],u[4],u[5],u[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:wn.Attribute,descriptor:{name:"a_Normal",shaderLocation:Vn.NORMAL,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(o,a,u,c,f){return f}}})}}]),r}(Ba);function dfe(e){var t=vfe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function vfe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var mfe=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
|
|
uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float segmentNumber;
|
|
float u_line_type: 0.0;
|
|
float u_icon_step: 100;
|
|
float u_line_texture: 0.0;
|
|
float u_textureBlend;
|
|
float u_time;
|
|
float u_linearColor: 0;
|
|
};
|
|
|
|
in vec4 v_line_data;
|
|
in vec2 v_iconMapUV;
|
|
in vec4 v_dash_array;
|
|
in float v_distance_ratio;
|
|
in vec4 v_color;
|
|
|
|
out vec4 outputColor;
|
|
#pragma include "picking"
|
|
#pragma include "project"
|
|
#pragma include "projection"
|
|
|
|
void main() {
|
|
|
|
float animateSpeed = 0.0;
|
|
float d_segmentIndex = v_line_data.g;
|
|
|
|
// 设置弧线的底色
|
|
if(u_linearColor == 1.0) { // 使用渐变颜色
|
|
outputColor = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);
|
|
outputColor.a *= v_color.a;
|
|
} else { // 使用 color 方法传入的颜色
|
|
outputColor = v_color;
|
|
}
|
|
|
|
// float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy));
|
|
// float blur = smoothstep(1.0, u_blur, length(v_normal.xy));
|
|
if(u_line_type == LineTypeDash) {
|
|
float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
|
|
if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {
|
|
// 实线部分
|
|
} else {
|
|
// 虚线部分
|
|
discard;
|
|
};
|
|
}
|
|
|
|
// 设置弧线的动画模式
|
|
if(u_animate.x == Animate) {
|
|
animateSpeed = u_time / u_animate.y;
|
|
float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
alpha = smoothstep(0., 1., alpha);
|
|
outputColor.a *= alpha;
|
|
}
|
|
|
|
// 设置弧线的贴图
|
|
if(LineTexture == u_line_texture && u_line_type != LineTypeDash) {
|
|
float arcRadio = smoothstep( 0.0, 1.0, (d_segmentIndex / (segmentNumber - 1.0)));
|
|
// float arcRadio = d_segmentIndex / (segmentNumber - 1.0);
|
|
float count = v_line_data.b; // 贴图在弧线上重复的数量
|
|
float u = fract(arcRadio * count - animateSpeed * count);
|
|
// float u = fract(arcRadio * count - animateSpeed);
|
|
if(u_animate.x == Animate) {
|
|
u = outputColor.a/v_color.a;
|
|
}
|
|
|
|
float v = v_line_data.a; // 线图层贴图部分的 v 坐标值
|
|
|
|
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
|
|
vec4 pattern = texture(SAMPLER_2D(u_texture), uv);
|
|
|
|
// 设置贴图和底色的叠加模式
|
|
if(u_textureBlend == 0.0) { // normal
|
|
pattern.a = 0.0;
|
|
outputColor = filterColor(outputColor + pattern);
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(outputColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
}
|
|
outputColor = filterColor(pattern);
|
|
}
|
|
} else {
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
|
|
// gl_FragColor = filterColor(gl_FragColor);
|
|
}`,gfe=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 12) in vec4 a_Instance;
|
|
layout(location = 14) in vec2 a_iconMapUV;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float segmentNumber;
|
|
float u_line_type: 0.0;
|
|
float u_icon_step: 100;
|
|
float u_line_texture: 0.0;
|
|
float u_textureBlend;
|
|
float u_time;
|
|
float u_linearColor: 0;
|
|
};
|
|
|
|
out vec4 v_dash_array;
|
|
out vec4 v_color;
|
|
out vec2 v_iconMapUV;
|
|
out vec4 v_line_data;
|
|
out float v_distance_ratio;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
|
|
float maps (float value, float start1, float stop1, float start2, float stop2) {
|
|
return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));
|
|
}
|
|
|
|
float getSegmentRatio(float index) {
|
|
return index / (segmentNumber - 1.);
|
|
}
|
|
|
|
float paraboloid(vec2 source, vec2 target, float ratio) {
|
|
vec2 x = mix(source, target, ratio);
|
|
vec2 center = mix(source, target, 0.5);
|
|
float dSourceCenter = distance(source, center);
|
|
float dXCenter = distance(x, center);
|
|
return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);
|
|
}
|
|
|
|
vec3 getPos(vec2 source, vec2 target, float segmentRatio) {
|
|
float vertex_height = paraboloid(source, target, segmentRatio);
|
|
|
|
return vec3(
|
|
mix(source, target, segmentRatio),
|
|
sqrt(max(0.0, vertex_height))
|
|
);
|
|
}
|
|
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size)/ 2.0;
|
|
return offset;
|
|
}
|
|
vec2 getNormal(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);
|
|
}
|
|
float getAngularDist (vec2 source, vec2 target) {
|
|
vec2 delta = source - target;
|
|
vec2 sin_half_delta = sin(delta / 2.0);
|
|
float a =
|
|
sin_half_delta.y * sin_half_delta.y +
|
|
cos(source.y) * cos(target.y) *
|
|
sin_half_delta.x * sin_half_delta.x;
|
|
return 2.0 * atan(sqrt(a), sqrt(1.0 - a));
|
|
}
|
|
|
|
vec2 midPoint(vec2 source, vec2 target) {
|
|
vec2 center = target - source;
|
|
float r = length(center);
|
|
float theta = atan(center.y, center.x);
|
|
float thetaOffset = 0.314;
|
|
float r2 = r / 2.0 / cos(thetaOffset);
|
|
float theta2 = theta + thetaOffset;
|
|
vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);
|
|
return mid;
|
|
}
|
|
float bezier3(vec3 arr, float t) {
|
|
float ut = 1. - t;
|
|
return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;
|
|
}
|
|
|
|
vec2 interpolate (vec2 source, vec2 target, float angularDist, float t) {
|
|
// if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
vec2 mid = midPoint(source, target);
|
|
vec3 x = vec3(source.x, mid.x, target.x);
|
|
vec3 y = vec3(source.y, mid.y, target.y);
|
|
return vec2(bezier3(x ,t), bezier3(y,t));
|
|
}
|
|
else {
|
|
if(abs(angularDist - PI) < 0.001) {
|
|
return (1.0 - t) * source + t * target;
|
|
}
|
|
float a = sin((1.0 - t) * angularDist) / sin(angularDist);
|
|
float b = sin(t * angularDist) / sin(angularDist);
|
|
vec2 sin_source = sin(source);
|
|
vec2 cos_source = cos(source);
|
|
vec2 sin_target = sin(target);
|
|
vec2 cos_target = cos(target);
|
|
float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;
|
|
float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;
|
|
float z = a * sin_source.y + b * sin_target.y;
|
|
return vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));
|
|
}
|
|
}
|
|
|
|
void main() {
|
|
v_color = a_Color;
|
|
v_color.a = v_color.a * opacity;
|
|
vec2 source = radians(a_Instance.rg);
|
|
vec2 target = radians(a_Instance.ba);
|
|
float angularDist = getAngularDist(source, target);
|
|
float segmentIndex = a_Position.x;
|
|
float segmentRatio = getSegmentRatio(segmentIndex);
|
|
float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
|
|
|
|
if(u_line_type == LineTypeDash) {
|
|
v_distance_ratio = segmentIndex / segmentNumber;
|
|
vec2 s = source;
|
|
vec2 t = target;
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
s = unProjCustomCoord(source);
|
|
t = unProjCustomCoord(target);
|
|
}
|
|
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
|
|
total_Distance = total_Distance*16.0; // total_Distance*16.0 调整默认的效果
|
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;
|
|
}
|
|
|
|
if(u_animate.x == Animate) {
|
|
v_distance_ratio = segmentIndex / segmentNumber;
|
|
}
|
|
|
|
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
|
|
v_distance_ratio = segmentIndex / segmentNumber;
|
|
vec4 curr = project_position(vec4(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0, 1.0));
|
|
vec4 next = project_position(vec4(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0, 1.0));
|
|
// v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);
|
|
vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));
|
|
// vec4 project_pos = project_position(vec4(curr.xy, 0, 1.0));
|
|
// gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));
|
|
|
|
v_line_data.g = a_Position.x; // 该顶点在弧线上的分段排序
|
|
if(LineTexture == u_line_texture) { // 开启贴图模式
|
|
// float mapZoomScale = u_CoordinateSystem !== COORDINATE_SYSTEM_P20_2?10000000.0:1.0;
|
|
float d_arcDistrance = length(source - target);
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20) { // amap
|
|
d_arcDistrance = d_arcDistrance * 1000000.0;
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox
|
|
d_arcDistrance = project_pixel_allmap(d_arcDistrance);
|
|
}
|
|
float d_pixelLen = project_pixel(u_icon_step)/8.0;
|
|
v_line_data.b = floor(d_arcDistrance/d_pixelLen); // 贴图在弧线上重复的数量
|
|
|
|
float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // 线横向偏移的距离
|
|
float linePixelSize = project_pixel(a_Size); // 定点位置偏移,按地图等级缩放后的距离
|
|
v_line_data.a = lineOffsetWidth/linePixelSize; // 线图层贴图部分的 v 坐标值
|
|
|
|
v_iconMapUV = a_iconMapUV;
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + offset, 0, 1.0));
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
|
|
`,_fe={solid:0,dash:1},yfe=function(e){_n(r,e);var t=dfe(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"updateTexture",function(){var u=n.rendererService.createTexture2D;if(n.texture){n.texture.update({data:n.iconService.getCanvas()}),n.layer.render();return}n.texture=u({data:n.iconService.getCanvas(),mag:W.NEAREST,min:W.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128}),n.textures=[n.texture]}),n}return jt(r,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.sourceColor,a=i.targetColor,u=i.textureBlend,c=u===void 0?"normal":u,f=i.lineType,m=f===void 0?"solid":f,_=i.dashArray,b=_===void 0?[10,5]:_,A=i.lineTexture,w=A===void 0?!1:A,R=i.iconStep,P=R===void 0?100:R,k=i.segmentNumber,L=k===void 0?30:k,B=this.layer.getLayerConfig(),V=B.animateOption;b.length===2&&b.push(0,0),this.rendererService.getDirty()&&this.texture.bind();var G=0,K=[0,0,0,0],Z=[0,0,0,0];o&&a&&(K=Ta(o),Z=Ta(a),G=1);var ve=this.layer.getLayerAnimateTime();isNaN(ve)&&(ve=0);var Ie={u_animate:this.animateOption2Array(V),u_dash_array:b,u_sourceColor:K,u_targetColor:Z,u_textSize:[1024,this.iconService.canvasHeight||128],segmentNumber:L,u_line_type:_fe[m]||0,u_icon_step:P,u_line_texture:w?1:0,u_textureBlend:c==="normal"?0:1,u_time:ve,u_linearColor:G},de=this.getUniformsBufferInfo(Ie);return de}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.initUniformsBuffer(),this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),u.abrupt("return",this.buildModels());case 4:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return a=this.layer.getLayerConfig(),u=a.segmentNumber,c=u===void 0?30:u,_.next=3,this.layer.buildLayerModel({moduleName:"lineGreatCircle",vertexShader:gfe,fragmentShader:mfe,triangulation:ob,styleOption:{segmentNumber:c},inject:this.getInject(),depth:{enable:!1}});case 3:return f=_.sent,_.abrupt("return",[f]);case 5:case"end":return _.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(a){var u=a.size,c=u===void 0?1:u;return Array.isArray(c)?[c[0]]:[c]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:wn.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:4,update:function(a,u,c){return[c[3],c[4],c[5],c[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:wn.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(a){var u=i.iconService.getIconMap(),c=a.texture,f=u[c]||{x:0,y:0},m=f.x,_=f.y;return[m,_]}}})}}]),r}(Ba);function xfe(e){var t=bfe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function bfe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Efe=`// #extension GL_OES_standard_derivatives : enable
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
|
|
uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array;
|
|
vec4 u_blur;
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float u_icon_step: 100;
|
|
float u_heightfixed: 0.0;
|
|
float u_vertexScale: 1.0;
|
|
float u_raisingHeight: 0.0;
|
|
float u_strokeWidth: 0.0;
|
|
float u_textureBlend;
|
|
float u_line_texture;
|
|
float u_linearDir: 1.0;
|
|
float u_linearColor: 0;
|
|
float u_time;
|
|
};
|
|
|
|
in vec4 v_color;
|
|
in vec4 v_stroke;
|
|
// dash
|
|
in vec4 v_dash_array;
|
|
in float v_d_distance_ratio;
|
|
in vec2 v_iconMapUV;
|
|
in vec4 v_texture_data;
|
|
|
|
out vec4 outputColor;
|
|
#pragma include "picking"
|
|
|
|
// [animate, duration, interval, trailLength],
|
|
void main() {
|
|
if(u_dash_array!=vec4(0.0)){
|
|
float dashLength = mod(v_d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
|
|
if(!(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z))) {
|
|
// 虚线部分
|
|
discard;
|
|
};
|
|
}
|
|
float animateSpeed = 0.0; // 运动速度
|
|
float d_distance_ratio = v_texture_data.r; // 当前点位距离占线总长的比例
|
|
if(u_linearDir < 1.0) {
|
|
d_distance_ratio = v_texture_data.a;
|
|
}
|
|
if(u_linearColor == 1.0) { // 使用渐变颜色
|
|
outputColor = mix(u_sourceColor, u_targetColor, d_distance_ratio);
|
|
outputColor.a *= v_color.a;
|
|
} else { // 使用 color 方法传入的颜色
|
|
outputColor = v_color;
|
|
}
|
|
// anti-alias
|
|
// float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy));
|
|
if(u_animate.x == Animate) {
|
|
animateSpeed = u_time / u_animate.y;
|
|
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);
|
|
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
alpha = smoothstep(0., 1., alpha);
|
|
outputColor.a *= alpha;
|
|
}
|
|
|
|
if(u_line_texture == LineTexture) { // while load texture
|
|
float aDistance = v_texture_data.g; // 当前顶点的距离
|
|
float d_texPixelLen = v_texture_data.b; // 贴图的像素长度,根据地图层级缩放
|
|
float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);
|
|
float v = v_texture_data.a; // 线图层贴图部分的 v 坐标值
|
|
|
|
// v = max(smoothstep(0.95, 1.0, v), v);
|
|
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
|
|
vec4 pattern = texture(SAMPLER_2D(u_texture), uv);
|
|
|
|
if(u_textureBlend == 0.0) { // normal
|
|
pattern.a = 0.0;
|
|
outputColor += pattern;
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(outputColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
}
|
|
outputColor = pattern;
|
|
}
|
|
}
|
|
|
|
float v = v_texture_data.a;
|
|
float strokeWidth = min(0.5, u_strokeWidth);
|
|
// 绘制 border
|
|
if(strokeWidth > 0.01) {
|
|
float borderOuterWidth = strokeWidth / 2.0;
|
|
|
|
|
|
if(v >= 1.0 - strokeWidth || v <= strokeWidth) {
|
|
if(v > strokeWidth) { // 外侧
|
|
float linear = smoothstep(0.0, 1.0, (v - (1.0 - strokeWidth))/strokeWidth);
|
|
// float linear = step(0.0, (v - (1.0 - borderWidth))/borderWidth);
|
|
outputColor.rgb = mix(outputColor.rgb, v_stroke.rgb, linear);
|
|
} else if(v <= strokeWidth) {
|
|
float linear = smoothstep(0.0, 1.0, v/strokeWidth);
|
|
outputColor.rgb = mix(v_stroke.rgb, outputColor.rgb, linear);
|
|
}
|
|
}
|
|
|
|
if(v < borderOuterWidth) {
|
|
outputColor.a = mix(0.0, outputColor.a, v/borderOuterWidth);
|
|
} else if(v > 1.0 - borderOuterWidth) {
|
|
outputColor.a = mix(outputColor.a, 0.0, (v - (1.0 - borderOuterWidth))/borderOuterWidth);
|
|
}
|
|
}
|
|
|
|
// blur
|
|
float blurV = v_texture_data.a;
|
|
if(blurV < 0.5) {
|
|
outputColor.a *= mix(u_blur.r, u_blur.g, blurV/0.5);
|
|
} else {
|
|
outputColor.a *= mix(u_blur.g, u_blur.b, (blurV - 0.5)/0.5);
|
|
}
|
|
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,Sfe=`
|
|
#define Animate 0.0
|
|
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in vec2 a_Size;
|
|
layout(location = 10) in vec3 a_DistanceAndIndexAndMiter;
|
|
layout(location = 13) in vec4 a_Normal_Total_Distance;
|
|
layout(location = 14) in vec2 a_iconMapUV;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array;
|
|
vec4 u_blur;
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float u_icon_step: 100;
|
|
float u_heightfixed: 0.0;
|
|
float u_vertexScale: 1.0;
|
|
float u_raisingHeight: 0.0;
|
|
float u_strokeWidth: 0.0;
|
|
float u_textureBlend;
|
|
float u_line_texture;
|
|
float u_linearDir: 1.0;
|
|
float u_linearColor: 0;
|
|
float u_time;
|
|
};
|
|
|
|
|
|
out vec4 v_color;
|
|
out vec4 v_stroke;
|
|
//dash
|
|
out vec4 v_dash_array;
|
|
out float v_d_distance_ratio;
|
|
// texV 线图层 - 贴图部分的 v 坐标(线的宽度方向)
|
|
out vec2 v_iconMapUV;
|
|
out vec4 v_texture_data;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
vec2 a_DistanceAndIndex = a_DistanceAndIndexAndMiter.xy;
|
|
float a_Miter = a_DistanceAndIndexAndMiter.z;
|
|
vec3 a_Normal = a_Normal_Total_Distance.xyz;
|
|
float a_Total_Distance = a_Normal_Total_Distance.w;
|
|
//dash输出
|
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance;
|
|
v_d_distance_ratio = a_DistanceAndIndex.x / a_Total_Distance;
|
|
|
|
// cal style mapping - 数据纹理映射部分的计算
|
|
float d_texPixelLen; // 贴图的像素长度,根据地图层级缩放
|
|
v_iconMapUV = a_iconMapUV;
|
|
d_texPixelLen = project_float_pixel(u_icon_step);
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
d_texPixelLen *= 10.0;
|
|
}
|
|
|
|
v_color = a_Color;
|
|
v_color.a *= opacity;
|
|
v_stroke = stroke;
|
|
|
|
vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal);
|
|
|
|
vec2 offset = project_pixel(size.xy);
|
|
|
|
float lineDistance = a_DistanceAndIndex.x;
|
|
float currentLinePointRatio = lineDistance / a_Total_Distance;
|
|
|
|
|
|
float lineOffsetWidth = length(offset + offset * sign(a_Miter)); // 线横向偏移的距离(向两侧偏移的和)
|
|
float linePixelSize = project_pixel(a_Size.x) * 2.0; // 定点位置偏移,按地图等级缩放后的距离 单侧 * 2
|
|
float texV = lineOffsetWidth/linePixelSize; // 线图层贴图部分的 v 坐标值
|
|
|
|
v_texture_data = vec4(currentLinePointRatio, lineDistance, d_texPixelLen, texV);
|
|
// 设置数据集的参数
|
|
|
|
vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));
|
|
|
|
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));
|
|
|
|
float h = float(a_Position.z) * u_vertexScale; // 线顶点的高度 - 兼容不存在第三个数值的情况 vertex height
|
|
float lineHeight = a_Size.y; // size 第二个参数代表的高度 [linewidth, lineheight]
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
lineHeight *= 0.2; // 保持和 amap/mapbox 一致的效果
|
|
h *= 0.2;
|
|
if(u_heightfixed < 1.0) {
|
|
lineHeight = project_pixel(a_Size.y);
|
|
}
|
|
gl_Position = u_Mvp * (vec4(project_pos.xy + offset, lineHeight + h + u_raisingHeight, 1.0));
|
|
} else {
|
|
// mapbox - amap
|
|
|
|
// 兼容 mapbox 在线高度上的效果表现基本一致
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// mapbox
|
|
// 保持高度相对不变
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
h *= mapboxZoomScale;
|
|
h += u_raisingHeight * mapboxZoomScale;
|
|
if(u_heightfixed > 0.0) {
|
|
lineHeight *= mapboxZoomScale;
|
|
}
|
|
|
|
} else {
|
|
// amap
|
|
h += u_raisingHeight;
|
|
// lineHeight 顶点偏移高度
|
|
if(u_heightfixed < 1.0) {
|
|
lineHeight *= pow(2.0, 20.0 - u_Zoom);
|
|
}
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, lineHeight + h, 1.0));
|
|
}
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,BP=function(e){_n(r,e);var t=xfe(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"textureEventFlag",!1),F($e(n),"texture",n.createTexture2D({data:new Uint8Array([0,0,0,0]),width:1,height:1})),F($e(n),"updateTexture",function(){var u=n.rendererService.createTexture2D;if(n.textures.length===0&&(n.textures=[n.texture]),n.texture){n.texture.update({data:n.iconService.getCanvas()}),n.layer.render();return}n.texture=u({data:n.iconService.getCanvas(),mag:W.NEAREST,min:W.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128})}),n}return jt(r,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.sourceColor,a=i.targetColor,u=i.textureBlend,c=u===void 0?"normal":u,f=i.lineType,m=f===void 0?"solid":f,_=i.dashArray,b=_===void 0?[10,5,0,0]:_,A=i.lineTexture,w=A===void 0?!1:A,R=i.iconStep,P=R===void 0?100:R,k=i.vertexHeightScale,L=k===void 0?20:k,B=i.strokeWidth,V=B===void 0?0:B,G=i.raisingHeight,K=G===void 0?0:G,Z=i.heightfixed,ve=Z===void 0?!1:Z,Ie=i.linearDir,de=Ie===void 0?iT.VERTICAL:Ie,se=i.blur,le=se===void 0?[1,1,1,0]:se,ye=b;m!=="dash"&&(ye=[0,0,0,0]),ye.length===2&&ye.push(0,0),this.rendererService.getDirty()&&this.texture&&this.texture.bind();var ke=this.layer.getLayerConfig(),Rt=ke.animateOption,Lt=0,Gt=[0,0,0,0],Zt=[0,0,0,0];o&&a&&(Gt=Ta(o),Zt=Ta(a),Lt=1);var st={u_animate:this.animateOption2Array(Rt),u_dash_array:ye,u_blur:le,u_sourceColor:Gt,u_targetColor:Zt,u_textSize:[1024,this.iconService.canvasHeight||128],u_icon_step:P,u_heightfixed:Number(ve),u_vertexScale:L,u_raisingHeight:Number(K),u_strokeWidth:V,u_textureBlend:c===Ece.NORMAL?0:1,u_line_texture:w?1:0,u_linearDir:de===iT.VERTICAL?1:0,u_linearColor:Lt,u_time:this.layer.getLayerAnimateTime()||0},tt=this.getUniformsBufferInfo(st);return tt}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.initUniformsBuffer(),this.textureEventFlag||(this.textureEventFlag=!0,this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture)),u.abrupt("return",this.buildModels());case 3:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f,m,_,b,A;return he.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return a=this.layer.getLayerConfig(),u=a.depth,c=u===void 0?!1:u,f=this.getShaders(),m=f.frag,_=f.vert,b=f.type,this.layer.triangulation=Q6,R.next=5,this.layer.buildLayerModel({moduleName:"line"+b,vertexShader:_,fragmentShader:m,triangulation:Q6,inject:this.getInject(),depth:{enable:c}});case 5:return A=R.sent,R.abrupt("return",[A]);case 7:case"end":return R.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(){return{frag:Efe,vert:Sfe,type:""}}},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"distanceAndIndex",type:wn.Attribute,descriptor:{name:"a_DistanceAndIndexAndMiter",shaderLocation:10,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(a,u,c,f,m,_){return _===void 0?[c[3],10,c[4]]:[c[3],_,c[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(a){var u=a.size,c=u===void 0?1:u;return Array.isArray(c)?[c[0],c[1]]:[c,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal_total_distance",type:wn.Attribute,descriptor:{name:"a_Normal_Total_Distance",shaderLocation:Vn.NORMAL,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:4,update:function(a,u,c,f,m){return[].concat(nr(m),[c[5]])}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:wn.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:Vn.UV,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(a){var u=i.iconService.getIconMap(),c=a.texture,f=u[c]||{x:0,y:0},m=f.x,_=f.y;return[m,_]}}})}}]),r}(Ba);function Afe(e){var t=Tfe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Tfe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var wfe=`
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec4 u_dash_array;
|
|
float u_vertexScale: 1.0;
|
|
float u_linearColor: 0;
|
|
};
|
|
in float v_distanceScale;
|
|
in vec4 v_color;
|
|
//dash
|
|
in vec4 v_dash_array;
|
|
|
|
out vec4 outputColor;
|
|
void main() {
|
|
if(u_dash_array!=vec4(0.0)){
|
|
float dashLength = mod(v_distanceScale, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
|
|
if(!(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z))) {
|
|
// 虚线部分
|
|
discard;
|
|
};
|
|
}
|
|
if(u_linearColor==1.0){
|
|
outputColor = mix(u_sourceColor, u_targetColor, v_distanceScale);
|
|
outputColor.a *= v_color.a; // 全局透明度
|
|
}
|
|
else{
|
|
outputColor = v_color;
|
|
}
|
|
}
|
|
`,Cfe=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in vec4 a_SizeDistanceAndTotalDistance;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec4 u_dash_array;
|
|
float u_vertexScale: 1.0;
|
|
float u_linearColor: 0;
|
|
};
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
out vec4 v_color;
|
|
out float v_distanceScale;
|
|
out vec4 v_dash_array;
|
|
|
|
void main() {
|
|
//dash输出
|
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_SizeDistanceAndTotalDistance.a;
|
|
|
|
v_color = a_Color;
|
|
v_distanceScale = a_SizeDistanceAndTotalDistance.b / a_SizeDistanceAndTotalDistance.a;
|
|
v_color.a = v_color.a * opacity;
|
|
vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));
|
|
|
|
float h = float(a_Position.z) * u_vertexScale; // 线顶点的高度 - 兼容不存在第三个数值的情况
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
gl_Position = u_Mvp * (vec4(project_pos.xy, project_pixel(a_SizeDistanceAndTotalDistance.y) + h * 0.2, 1.0));
|
|
} else {
|
|
float lineHeight = a_SizeDistanceAndTotalDistance.y;
|
|
// 兼容 mapbox 在线高度上的效果表现基本一致
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// 保持高度相对不变
|
|
h *= 2.0/pow(2.0, 20.0 - u_Zoom);
|
|
}
|
|
|
|
// amap1.x
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
// 保持高度相对不变
|
|
lineHeight *= pow(2.0, 20.0 - u_Zoom);
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, lineHeight + h, 1.0));
|
|
gl_PointSize = 10.0;
|
|
}
|
|
}
|
|
`;Ci.isNumber;var Rfe=function(e){_n(r,e);var t=Afe(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.sourceColor,a=i.targetColor,u=i.lineType,c=u===void 0?"solid":u,f=i.dashArray,m=f===void 0?[10,5,0,0]:f,_=i.vertexHeightScale,b=_===void 0?20:_,A=m;c!=="dash"&&(A=[0,0,0,0]),A.length===2&&A.push(0,0);var w=0,R=[0,0,0,0],P=[0,0,0,0];o&&a&&(R=Ta(o),P=Ta(a),w=1);var k={u_sourceColor:R,u_targetColor:P,u_dash_array:A,u_vertexScale:b,u_linearColor:w},L=this.getUniformsBufferInfo(k);return L}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.buildModels());case 1:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(){return{frag:wfe,vert:Cfe,type:"lineSimpleNormal"}}},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f,m;return he.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return this.initUniformsBuffer(),a=this.getShaders(),u=a.frag,c=a.vert,f=a.type,b.next=4,this.layer.buildLayerModel({moduleName:f,vertexShader:c,fragmentShader:u,triangulation:Cce,inject:this.getInject(),primitive:W.LINES,depth:{enable:!1},pick:!1});case 4:return m=b.sent,b.abrupt("return",[m]);case 6:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"sizeDistanceAndTotalDistance",type:wn.Attribute,descriptor:{name:"a_SizeDistanceAndTotalDistance",shaderLocation:Vn.SIZE,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:4,update:function(o,a,u){var c=o.size,f=c===void 0?1:c,m=Array.isArray(f)?[f[0],f[1]]:[f,0];return[m[0],m[1],u[3],u[5]]}}})}}]),r}(Ba);function Ife(e){var t=Mfe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Mfe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Pfe=`#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
|
|
// line texture
|
|
|
|
uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float u_icon_step: 100;
|
|
float u_heightfixed;
|
|
float u_linearColor: 0;
|
|
float u_line_texture;
|
|
float u_textureBlend;
|
|
float u_iconStepCount;
|
|
float u_time;
|
|
};
|
|
in vec2 v_iconMapUV;
|
|
in float v_blur;
|
|
in float v_radio;
|
|
in vec4 v_color;
|
|
in vec4 v_dataset;
|
|
|
|
out vec4 outputColor;
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
float animateSpeed = 0.0; // 运动速度
|
|
float d_distance_ratio = v_dataset.r; // 当前点位距离占线总长的比例
|
|
float v = v_dataset.a;
|
|
|
|
if(u_linearColor == 1.0) { // 使用渐变颜色
|
|
outputColor = mix(u_sourceColor, u_targetColor, v);
|
|
} else { // 使用 color 方法传入的颜色
|
|
outputColor = v_color;
|
|
}
|
|
|
|
outputColor.a *= v_color.a; // 全局透明度
|
|
if(u_animate.x == Animate) {
|
|
animateSpeed = u_time / u_animate.y;
|
|
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);
|
|
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
alpha = smoothstep(0., 1., alpha);
|
|
outputColor.a *= alpha;
|
|
}
|
|
|
|
if(u_line_texture == LineTexture) { // while load texture
|
|
float aDistance = v_dataset.g; // 当前顶点的距离
|
|
float d_texPixelLen = v_dataset.b; // 贴图的像素长度,根据地图层级缩放
|
|
float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);
|
|
float v = v_dataset.a; // 线图层贴图部分的 v 坐标值
|
|
|
|
// 计算纹理间隔 start
|
|
float flag = 0.0;
|
|
if(u > 1.0/u_iconStepCount) {
|
|
flag = 1.0;
|
|
}
|
|
u = fract(u*u_iconStepCount);
|
|
// 计算纹理间隔 end
|
|
|
|
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
|
|
vec4 pattern = texture(SAMPLER_2D(u_texture), uv);
|
|
|
|
// Tip: 判断纹理间隔
|
|
if(flag > 0.0) {
|
|
pattern = vec4(0.0);
|
|
}
|
|
|
|
if(u_textureBlend == 0.0) { // normal
|
|
pattern.a = 0.0;
|
|
outputColor = filterColor(outputColor + pattern);
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(outputColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
}
|
|
outputColor = filterColor(pattern);
|
|
}
|
|
}
|
|
|
|
|
|
// blur - AA
|
|
if(v < v_blur) {
|
|
outputColor.a = mix(0.0, outputColor.a, v/v_blur);
|
|
} else if(v > 1.0 - v_blur) {
|
|
outputColor.a = mix(outputColor.a, 0.0, (v - (1.0 - v_blur))/v_blur);
|
|
}
|
|
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,Ofe=`#define Animate 0.0
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in vec2 a_Size;
|
|
layout(location = 10) in float a_Miter;
|
|
layout(location = 11) in float a_Total_Distance;
|
|
layout(location = 12) in vec4 a_Instance;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
layout(location = 14) in vec2 a_iconMapUV;
|
|
layout(location = 15) in float a_Distance;
|
|
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float u_icon_step: 100;
|
|
float u_heightfixed;
|
|
float u_linearColor: 0;
|
|
float u_line_texture;
|
|
float u_textureBlend;
|
|
float u_iconStepCount;
|
|
float u_time;
|
|
};
|
|
#pragma include "projection"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
// texV 线图层 - 贴图部分的 v 坐标(线的宽度方向)
|
|
out vec2 v_iconMapUV;
|
|
out vec4 v_color;
|
|
out float v_blur;
|
|
out float v_radio;
|
|
out vec4 v_dataset;
|
|
|
|
void main() {
|
|
|
|
|
|
float d_distance_ratio; // 当前点位距离占线总长的比例
|
|
float d_texPixelLen; // 贴图的像素长度,根据地图层级缩放
|
|
|
|
v_iconMapUV = a_iconMapUV;
|
|
if(u_heightfixed < 1.0) { // 高度随 zoom 调整
|
|
d_texPixelLen = project_pixel(u_icon_step);
|
|
} else {
|
|
d_texPixelLen = u_icon_step;
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
d_texPixelLen *= 10.0;
|
|
}
|
|
|
|
if(u_animate.x == Animate || u_linearColor == 1.0) {
|
|
d_distance_ratio = a_Distance / a_Total_Distance;
|
|
}
|
|
|
|
float miter = (a_Miter + 1.0)/2.0;
|
|
// 设置数据集的参数
|
|
v_dataset[0] = d_distance_ratio; // 当前点位距离占线总长的比例
|
|
v_dataset[1] = a_Distance; // 当前顶点的距离
|
|
v_dataset[2] = d_texPixelLen; // 贴图的像素长度,根据地图层级缩放
|
|
v_dataset[3] = miter; // 线图层贴图部分的 v 坐标值 0 - 1
|
|
|
|
vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));
|
|
|
|
float originSize = a_Size.x; // 固定高度
|
|
if(u_heightfixed < 1.0) {
|
|
originSize = project_float_meter(a_Size.x); // 高度随 zoom 调整
|
|
}
|
|
|
|
|
|
float wallHeight = originSize * miter;
|
|
float lightWeight = calc_lighting(vec4(project_pos.xy, wallHeight, 1.0));
|
|
|
|
v_blur = min(project_float_pixel(2.0) / originSize, 0.05);
|
|
v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
gl_Position = u_Mvp * (vec4(project_pos.xy, wallHeight, 1.0));
|
|
} else {
|
|
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, wallHeight, 1.0));
|
|
}
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,kfe=function(e){_n(r,e);var t=Ife(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"updateTexture",function(){var u=n.rendererService.createTexture2D;if(n.texture){n.texture.update({data:n.iconService.getCanvas()}),n.layer.render();return}n.texture=u({data:n.iconService.getCanvas(),mag:W.NEAREST,min:W.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128}),n.textures=[n.texture]}),n}return jt(r,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.sourceColor,a=i.targetColor,u=i.textureBlend,c=u===void 0?"normal":u,f=i.heightfixed,m=f===void 0?!1:f,_=i.lineTexture,b=_===void 0?!1:_,A=i.iconStep,w=A===void 0?100:A,R=i.iconStepCount,P=R===void 0?1:R,k=this.layer.getLayerConfig(),L=k.animateOption;this.rendererService.getDirty()&&this.texture.bind();var B=0,V=[0,0,0,0],G=[0,0,0,0];o&&a&&(V=Ta(o),G=Ta(a),B=1);var K={u_animate:this.animateOption2Array(L),u_sourceColor:V,u_targetColor:G,u_textSize:[1024,this.iconService.canvasHeight||128],u_icon_step:w,u_heightfixed:Number(m),u_linearColor:B,u_line_texture:b?1:0,u_textureBlend:c==="normal"?0:1,u_iconStepCount:P,u_time:this.layer.getLayerAnimateTime()||0},Z=this.getUniformsBufferInfo(K);return Z}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.initUniformsBuffer(),this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),u.abrupt("return",this.buildModels());case 4:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.layer.buildLayerModel({moduleName:"lineWall",vertexShader:Ofe,fragmentShader:Pfe,triangulation:wce,inject:this.getInject(),depth:{enable:!1},blend:this.getBlend()});case 2:return a=c.sent,c.abrupt("return",[a]);case 4:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"distance",type:wn.Attribute,descriptor:{name:"a_Distance",shaderLocation:15,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(a,u,c){return[c[3]]}}}),this.styleAttributeService.registerStyleAttribute({name:"total_distance",type:wn.Attribute,descriptor:{name:"a_Total_Distance",shaderLocation:11,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(a,u,c){return[c[5]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(a){var u=a.size,c=u===void 0?1:u;return Array.isArray(c)?[c[0],c[1]]:[c,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:wn.Attribute,descriptor:{name:"a_Normal",shaderLocation:Vn.NORMAL,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(a,u,c,f,m){return m}}}),this.styleAttributeService.registerStyleAttribute({name:"miter",type:wn.Attribute,descriptor:{name:"a_Miter",shaderLocation:10,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(a,u,c){return[c[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:wn.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(a){var u=i.iconService.getIconMap(),c=a.texture,f=u[c]||{x:0,y:0},m=f.x,_=f.y;return[m,_]}}})}}]),r}(Ba),Dfe={arc:Xce,arc3d:pT,greatcircle:yfe,wall:kfe,line:BP,simple:Rfe,flowline:pfe,earthArc3d:pT};function Ffe(e){var t=Bfe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Bfe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var sb=function(e){_n(r,e);var t=Ffe(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"type","LineLayer"),F($e(n),"enableShaderEncodeStyles",["stroke","offsets","opacity","thetaOffset"]),F($e(n),"arrowInsertCount",0),F($e(n),"defaultSourceConfig",{data:[{lng1:100,lat1:30,lng2:130,lat2:30}],options:{parser:{type:"json",x:"lng1",y:"lat1",x1:"lng2",y1:"lat2"}}}),n}return jt(r,[{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return a=this.getModelType(),this.layerModel=new Dfe[a](this),c.next=4,this.initLayerModels();case 4:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getDefaultConfig",value:function(){var i=this.getModelType(),o={line:{},linearline:{},simple:{},wall:{},arc3d:{blend:"additive"},arc:{blend:"additive"},greatcircle:{blend:"additive"},tileLine:{},earthArc3d:{},flowline:{},arrow:{}};return o[i]}},{key:"getModelType",value:function(){var i;if(this.layerType)return this.layerType;var o=this.styleAttributeService.getLayerStyleAttribute("shape"),a=o==null||(i=o.scale)===null||i===void 0?void 0:i.field;return a||"line"}},{key:"processData",value:function(i){if(this.getModelType()!=="simple")return i;var o=[];return i.map(function(a){if(Array.isArray(a.coordinates)&&Array.isArray(a.coordinates[0])&&Array.isArray(a.coordinates[0][0])){var u=Qe({},a);a.coordinates.map(function(c){o.push(Qe(Qe({},u),{},{coordinates:c}))})}else o.push(a)}),o}}]),r}(P0);function Lfe(e){var t=Nfe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Nfe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ufe=`
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_stroke_color;
|
|
float u_additive;
|
|
float u_stroke_opacity;
|
|
float u_stroke_width;
|
|
};
|
|
|
|
in vec4 v_color;
|
|
in float v_blur;
|
|
in float v_innerRadius;
|
|
|
|
out vec4 outputColor;
|
|
|
|
#pragma include "picking"
|
|
void main() {
|
|
vec2 center = vec2(0.5);
|
|
|
|
// Tip: 片元到中心点的距离 0 - 1
|
|
float fragmengTocenter = distance(center, gl_PointCoord) * 2.0;
|
|
// Tip: 片元的剪切成圆形
|
|
float circleClipOpacity = 1.0 - smoothstep(v_blur, 1.0, fragmengTocenter);
|
|
|
|
|
|
if(v_innerRadius < 0.99) {
|
|
// 当存在 stroke 且 stroke > 0.01
|
|
float blurWidth = (1.0 - v_blur)/2.0;
|
|
vec4 stroke = vec4(u_stroke_color.rgb, u_stroke_opacity);
|
|
if(fragmengTocenter > v_innerRadius + blurWidth) {
|
|
outputColor = stroke;
|
|
} else if(fragmengTocenter > v_innerRadius - blurWidth){
|
|
float mixR = (fragmengTocenter - (v_innerRadius - blurWidth)) / (blurWidth * 2.0);
|
|
outputColor = mix(v_color, stroke, mixR);
|
|
} else {
|
|
outputColor = v_color;
|
|
}
|
|
} else {
|
|
// 当不存在 stroke 或 stroke <= 0.01
|
|
outputColor = v_color;
|
|
}
|
|
|
|
outputColor = filterColor(outputColor);
|
|
|
|
if(u_additive > 0.0) {
|
|
outputColor *= circleClipOpacity;
|
|
} else {
|
|
outputColor.a *= circleClipOpacity;
|
|
}
|
|
|
|
}
|
|
`,zfe=`
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_stroke_color;
|
|
float u_additive;
|
|
float u_stroke_opacity;
|
|
float u_stroke_width;
|
|
};
|
|
|
|
out vec4 v_color;
|
|
out float v_blur;
|
|
out float v_innerRadius;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
#pragma include "project"
|
|
void main() {
|
|
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
v_blur = 1.0 - max(2.0/a_Size, 0.05);
|
|
v_innerRadius = max((a_Size - u_stroke_width) / a_Size, 0.0);
|
|
|
|
vec2 offset = project_pixel(u_offsets);
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
gl_Position = u_Mvp * vec4(a_Position.xy + offset, a_Position.z, 1.0);
|
|
} else { // else
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);
|
|
gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));
|
|
}
|
|
|
|
gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`;function gT(e){var t=e.coordinates;return{vertices:nr(t),indices:[0],size:t.length}}var $fe=function(e){_n(r,e);var t=Lfe(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getDefaultStyle",value:function(){return{blend:"additive"}}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.blend,a=i.strokeOpacity,u=a===void 0?1:a,c=i.strokeWidth,f=c===void 0?0:c,m=i.stroke,_=m===void 0?"#fff":m,b={u_stroke_color:Ta(_),u_additive:o==="additive"?1:0,u_stroke_opacity:u,u_stroke_width:f},A=this.getUniformsBufferInfo(b);return A}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.buildModels());case 1:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.layer.triangulation=gT,this.initUniformsBuffer(),c.next=4,this.layer.buildLayerModel({moduleName:"pointSimple",vertexShader:zfe,fragmentShader:Ufe,inject:this.getInject(),triangulation:gT,depth:{enable:!1},primitive:W.POINTS});case 4:return a=c.sent,c.abrupt("return",[a]);case 6:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(o){var a=o.size,u=a===void 0?1:a;return Array.isArray(u)?[u[0]]:[u]}}})}}]),r}(Ba);function Vfe(e){var t=jfe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function jfe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Hfe=`precision highp float;
|
|
in vec4 v_color;
|
|
|
|
#pragma include "picking"
|
|
|
|
layout(std140) uniform commonUniform {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor: 0;
|
|
float u_heightfixed: 0.0; // 默认不固定
|
|
float u_globel;
|
|
float u_r;
|
|
float u_pickLight: 0.0;
|
|
float u_opacitylinear: 0.0;
|
|
float u_opacitylinear_dir: 1.0;
|
|
float u_lightEnable: 1.0;
|
|
};
|
|
in float v_lightWeight;
|
|
in float v_barLinearZ;
|
|
out vec4 outputColor;
|
|
void main() {
|
|
|
|
outputColor = v_color;
|
|
|
|
// 开启透明度渐变
|
|
if(u_opacitylinear > 0.0) {
|
|
outputColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - v_barLinearZ): v_barLinearZ;
|
|
}
|
|
|
|
// picking
|
|
if(u_pickLight > 0.0) {
|
|
outputColor = filterColorAlpha(outputColor, v_lightWeight);
|
|
} else {
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
}
|
|
`,Gfe=`precision highp float;
|
|
|
|
#define pi 3.1415926535
|
|
#define ambientRatio 0.5
|
|
#define diffuseRatio 0.3
|
|
#define specularRatio 0.2
|
|
|
|
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in vec3 a_Size;
|
|
layout(location = 11) in vec3 a_Pos;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
|
|
|
|
layout(std140) uniform commonUniform {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor: 0;
|
|
float u_heightfixed: 0.0; // 默认不固定
|
|
float u_globel;
|
|
float u_r;
|
|
float u_pickLight: 0.0;
|
|
float u_opacitylinear: 0.0;
|
|
float u_opacitylinear_dir: 1.0;
|
|
float u_lightEnable: 1.0;
|
|
};
|
|
|
|
out vec4 v_color;
|
|
out float v_lightWeight;
|
|
out float v_barLinearZ;
|
|
// 用于将在顶点着色器中计算好的样式值传递给片元
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
float getYRadian(float x, float z) {
|
|
if(x > 0.0 && z > 0.0) {
|
|
return atan(x/z);
|
|
} else if(x > 0.0 && z <= 0.0){
|
|
return atan(-z/x) + pi/2.0;
|
|
} else if(x <= 0.0 && z <= 0.0) {
|
|
return pi + atan(x/z); //atan(x/z) +
|
|
} else {
|
|
return atan(z/-x) + pi*3.0/2.0;
|
|
}
|
|
}
|
|
|
|
float getXRadian(float y, float r) {
|
|
return atan(y/r);
|
|
}
|
|
|
|
void main() {
|
|
|
|
// cal style mapping - 数据纹理映射部分的计算
|
|
vec3 size = a_Size * a_Position;
|
|
|
|
// a_Position.z 是在构建网格的时候传入的标准值 0 - 1,在插值器插值可以获取 0~1 线性渐变的值
|
|
v_barLinearZ = a_Position.z;
|
|
|
|
vec3 offset = size; // 控制圆柱体的大小 - 从标准单位圆柱体进行偏移
|
|
if(u_heightfixed < 1.0) { // 圆柱体不固定高度
|
|
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
// P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1
|
|
offset = offset * pow(2.0, (19.0 - u_Zoom));
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3
|
|
offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom));
|
|
}
|
|
} else {// 圆柱体固定高度 ( 处理 mapbox )
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
offset *= 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
}
|
|
}
|
|
|
|
|
|
vec4 project_pos = project_position(vec4(a_Pos.xy, 0., 1.0));
|
|
|
|
// u_r 控制圆柱的生长
|
|
vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);
|
|
|
|
// 圆柱光照效果
|
|
float lightWeight = 1.0;
|
|
if(u_lightEnable > 0.0) { // 取消三元表达式,增强健壮性
|
|
lightWeight = calc_lighting(pos);
|
|
}
|
|
v_lightWeight = lightWeight;
|
|
// 设置圆柱的底色
|
|
if(u_linearColor == 1.0) { // 使用渐变颜色
|
|
v_color = mix(u_sourceColor, u_targetColor, v_barLinearZ);
|
|
v_color.rgb *= lightWeight;
|
|
} else { // 使用 color 方法传入的颜色
|
|
v_color = a_Color;
|
|
}
|
|
v_color.a *= u_opacity;
|
|
|
|
|
|
// 在地球模式下,将原本垂直于 xy 平面的圆柱调整姿态到适应圆的角度
|
|
//旋转矩阵mx,创建绕x轴旋转矩阵
|
|
float r = sqrt(a_Pos.z*a_Pos.z + a_Pos.x*a_Pos.x);
|
|
float xRadian = getXRadian(a_Pos.y, r);
|
|
float xcos = cos(xRadian);//求解旋转角度余弦值
|
|
float xsin = sin(xRadian);//求解旋转角度正弦值
|
|
mat4 mx = mat4(
|
|
1,0,0,0,
|
|
0,xcos,-xsin,0,
|
|
0,xsin,xcos,0,
|
|
0,0,0,1);
|
|
|
|
//旋转矩阵my,创建绕y轴旋转矩阵
|
|
float yRadian = getYRadian(a_Pos.x, a_Pos.z);
|
|
float ycos = cos(yRadian);//求解旋转角度余弦值
|
|
float ysin = sin(yRadian);//求解旋转角度正弦值
|
|
mat4 my = mat4(
|
|
ycos,0,-ysin,0,
|
|
0,1,0,0,
|
|
ysin,0,ycos,0,
|
|
0,0,0,1);
|
|
|
|
gl_Position = u_ViewProjectionMatrix * vec4(( my * mx * vec4(a_Position * a_Size, 1.0)).xyz + a_Pos, 1.0);
|
|
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,Wfe=Ci.isNumber,Xfe=function(e){_n(r,e);var t=Vfe(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"raiseCount",0),F($e(n),"raiseRepeat",0),n}return jt(r,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption,a=o===void 0?{enable:!1,speed:.01,repeat:!1}:o,u=i.opacity,c=u===void 0?1:u,f=i.sourceColor,m=i.targetColor,_=i.pickLight,b=_===void 0?!1:_,A=i.heightfixed,w=A===void 0?!0:A,R=i.opacityLinear,P=R===void 0?{enable:!1,dir:"up"}:R,k=i.lightEnable,L=k===void 0?!0:k,B=0,V=[0,0,0,0],G=[0,0,0,0];if(f&&m&&(V=Ta(f),G=Ta(m),B=1),this.raiseCount<1&&this.raiseRepeat>0&&a.enable){var K=a.speed,Z=K===void 0?.01:K;this.raiseCount+=Z,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}var ve={u_sourceColor:V,u_targetColor:G,u_linearColor:B,u_pickLight:Number(b),u_heightfixed:Number(w),u_r:a.enable&&this.raiseRepeat>0?this.raiseCount:1,u_opacity:Wfe(c)?c:1,u_opacitylinear:Number(P.enable),u_opacitylinear_dir:P.dir==="up"?1:0,u_lightEnable:Number(L)},Ie=this.getUniformsBufferInfo(ve);return Ie}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.initUniformsBuffer(),u.abrupt("return",this.buildModels());case 2:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return a=this.layer.getLayerConfig(),u=a.animateOption.repeat,c=u===void 0?1:u,this.raiseRepeat=c,_.next=4,this.layer.buildLayerModel({moduleName:"pointEarthExtrude",vertexShader:Gfe,fragmentShader:Hfe,triangulation:DP,depth:{enable:!0},inject:this.getInject(),cull:{enable:!0,face:_5(this.mapService.version)},blend:this.getBlend()});case 4:return f=_.sent,_.abrupt("return",[f]);case 6:case"end":return _.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(o){var a=o.size;if(a){var u=[];return Array.isArray(a)&&(u=a.length===2?[a[0],a[0],a[1]]:a),Array.isArray(a)||(u=[a,a,a]),u}else return[2,2,2]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:wn.Attribute,descriptor:{name:"a_Normal",shaderLocation:Vn.NORMAL,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(o,a,u,c,f){return f}}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:wn.Attribute,descriptor:{name:"a_Pos",shaderLocation:15,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(o){var a=ih(o.coordinates);return OP([a[0],a[1]])}}})}}]),r}(Ba);function Yfe(e){var t=Zfe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Zfe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var qfe=`in vec4 v_data;
|
|
in vec4 v_color;
|
|
in float v_radius;
|
|
|
|
layout(std140) uniform commonUniform {
|
|
float u_additive;
|
|
float u_stroke_opacity : 1;
|
|
float u_stroke_width : 2;
|
|
float u_blur : 0.0;
|
|
};
|
|
#pragma include "sdf_2d"
|
|
#pragma include "picking"
|
|
|
|
out vec4 outputColor;
|
|
|
|
void main() {
|
|
int shape = int(floor(v_data.w + 0.5));
|
|
|
|
vec4 strokeColor = u_stroke == vec4(0.0) ? v_color : u_stroke;
|
|
|
|
lowp float antialiasblur = v_data.z;
|
|
float r = v_radius / (v_radius + u_stroke_width);
|
|
|
|
float outer_df;
|
|
float inner_df;
|
|
// 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'
|
|
if (shape == 0) {
|
|
outer_df = sdCircle(v_data.xy, 1.0);
|
|
inner_df = sdCircle(v_data.xy, r);
|
|
} else if (shape == 1) {
|
|
outer_df = sdEquilateralTriangle(1.1 * v_data.xy);
|
|
inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);
|
|
} else if (shape == 2) {
|
|
outer_df = sdBox(v_data.xy, vec2(1.));
|
|
inner_df = sdBox(v_data.xy, vec2(r));
|
|
} else if (shape == 3) {
|
|
outer_df = sdPentagon(v_data.xy, 0.8);
|
|
inner_df = sdPentagon(v_data.xy, r * 0.8);
|
|
} else if (shape == 4) {
|
|
outer_df = sdHexagon(v_data.xy, 0.8);
|
|
inner_df = sdHexagon(v_data.xy, r * 0.8);
|
|
} else if (shape == 5) {
|
|
outer_df = sdOctogon(v_data.xy, 1.0);
|
|
inner_df = sdOctogon(v_data.xy, r);
|
|
} else if (shape == 6) {
|
|
outer_df = sdHexagram(v_data.xy, 0.52);
|
|
inner_df = sdHexagram(v_data.xy, r * 0.52);
|
|
} else if (shape == 7) {
|
|
outer_df = sdRhombus(v_data.xy, vec2(1.0));
|
|
inner_df = sdRhombus(v_data.xy, vec2(r));
|
|
} else if (shape == 8) {
|
|
outer_df = sdVesica(v_data.xy, 1.1, 0.8);
|
|
inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);
|
|
}
|
|
|
|
if(outer_df > antialiasblur + 0.018) discard;
|
|
|
|
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
|
|
|
|
float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(
|
|
antialiasblur,
|
|
0.0,
|
|
inner_df
|
|
);
|
|
|
|
if(u_stroke_width < 0.01) {
|
|
outputColor = vec4(v_color.rgb, v_color.a * u_opacity);
|
|
} else {
|
|
outputColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);
|
|
}
|
|
|
|
if(u_additive > 0.0) {
|
|
outputColor *= opacity_t;
|
|
outputColor = filterColorAlpha(outputColor, outputColor.a);
|
|
} else {
|
|
outputColor.a *= opacity_t;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
}
|
|
`,Kfe=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 10) in float a_Shape;
|
|
layout(location = 11) in vec3 a_Extrude;
|
|
|
|
layout(std140) uniform commonUniform {
|
|
float u_additive;
|
|
float u_stroke_opacity : 1;
|
|
float u_stroke_width : 2;
|
|
float u_blur : 0.0;
|
|
};
|
|
out vec4 v_data;
|
|
out vec4 v_color;
|
|
out float v_radius;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
|
|
void main() {
|
|
vec3 extrude = a_Extrude;
|
|
float shape_type = a_Shape;
|
|
/*
|
|
* setPickingSize 设置拾取大小
|
|
*/
|
|
float newSize = setPickingSize(a_Size);
|
|
// float newSize = setPickingSize(a_Size) * 0.00001038445708445579;
|
|
|
|
// unpack color(vec2)
|
|
v_color = a_Color;
|
|
|
|
// radius(16-bit)
|
|
v_radius = newSize;
|
|
|
|
// anti-alias
|
|
// float antialiased_blur = -max(u_blur, antialiasblur);
|
|
float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur);
|
|
|
|
// TODP: /abs(extrude.x) 是为了兼容地球模式
|
|
v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);
|
|
|
|
gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1 + vec3(u_offsets,0.0), 1.0);
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}`,Qfe=function(e){_n(r,e);var t=Yfe(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.strokeOpacity,a=o===void 0?1:o,u=i.strokeWidth,c=u===void 0?0:u,f=i.blend,m=i.blur,_=m===void 0?0:m;this.layer.getLayerConfig();var b={u_additive:f==="additive"?1:0,u_stroke_opacity:a,u_stroke_width:c,u_blur:_},A=this.getUniformsBufferInfo(b);return A}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.initUniformsBuffer(),u.abrupt("return",this.buildModels());case 2:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.layer.triangulation=cT,c.next=3,this.layer.buildLayerModel({moduleName:"pointEarthFill",vertexShader:Kfe,fragmentShader:qfe,triangulation:cT,inject:this.getInject(),depth:{enable:!0},blend:this.getBlend()});case 3:return a=c.sent,c.abrupt("return",[a]);case 5:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"animateOption2Array",value:function(i){return[i.enable?0:1,i.speed||1,i.rings||3,0]}},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"extrude",type:wn.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Vn.EXTRUDE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(a,u,c,f){var m=Nn(c,3),_=m[0],b=m[1],A=m[2],w=Gl(0,0,1),R=Gl(_,0,A),P=_>=0?q6(w,R):Math.PI*2-q6(w,R),k=Math.PI*2-Math.asin(b/100),L=v1();j5(L,L,P),sy(L,L,k);var B=Gl(1,1,0);Vv(B,B,L),$d(B,B);var V=Gl(-1,1,0);Vv(V,V,L),$d(V,V);var G=Gl(-1,-1,0);Vv(G,G,L),$d(G,G);var K=Gl(1,-1,0);Vv(K,K,L),$d(K,K);var Z=[].concat(nr(B),nr(V),nr(G),nr(K)),ve=f%4*3;return[Z[ve],Z[ve+1],Z[ve+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(a){var u=a.size,c=u===void 0?5:u;return Array.isArray(c)?[c[0]]:[c]}}}),this.styleAttributeService.registerStyleAttribute({name:"shape",type:wn.Attribute,descriptor:{name:"a_Shape",shaderLocation:Vn.SHAPE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(a){var u=a.shape,c=u===void 0?2:u,f=i.layer.getLayerConfig().shape2d,m=f.indexOf(c);return[m]}}})}}]),r}(Ba);function Jfe(e){var t=ehe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function ehe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var the=`
|
|
in vec4 v_color;
|
|
in float v_lightWeight;
|
|
out vec4 outputColor;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
float u_pickLight;
|
|
float u_heightfixed;
|
|
float u_r;
|
|
float u_linearColor;
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_opacitylinear;
|
|
float u_opacitylinear_dir;
|
|
float u_lightEnable;
|
|
};
|
|
|
|
#pragma include "scene_uniforms"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
outputColor = v_color;
|
|
// 开启透明度渐变
|
|
// picking
|
|
if(u_pickLight > 0.0) {
|
|
outputColor = filterColorAlpha(outputColor, v_lightWeight);
|
|
} else {
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
}
|
|
`,rhe=`#define pi 3.1415926535
|
|
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in vec3 a_Size;
|
|
layout(location = 11) in vec3 a_Extrude;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
float u_pickLight;
|
|
float u_heightfixed;
|
|
float u_r;
|
|
float u_linearColor;
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_opacitylinear;
|
|
float u_opacitylinear_dir;
|
|
float u_lightEnable;
|
|
};
|
|
out vec4 v_color;
|
|
out float v_lightWeight;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
float getYRadian(float x, float z) {
|
|
if(x > 0.0 && z > 0.0) {
|
|
return atan(x/z);
|
|
} else if(x > 0.0 && z <= 0.0){
|
|
return atan(-z/x) + pi/2.0;
|
|
} else if(x <= 0.0 && z <= 0.0) {
|
|
return pi + atan(x/z); //atan(x/z) +
|
|
} else {
|
|
return atan(z/-x) + pi*3.0/2.0;
|
|
}
|
|
}
|
|
|
|
float getXRadian(float y, float r) {
|
|
return atan(y/r);
|
|
}
|
|
|
|
void main() {
|
|
|
|
|
|
vec3 size = a_Size * a_Position;
|
|
|
|
vec3 offset = size; // 控制圆柱体的大小 - 从标准单位圆柱体进行偏移
|
|
|
|
if(u_heightfixed < 1.0) { // 圆柱体不固定高度
|
|
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
// P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1
|
|
offset = offset * pow(2.0, (19.0 - u_Zoom));
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3
|
|
offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom));
|
|
}
|
|
} else {// 圆柱体固定高度 ( 处理 mapbox )
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
offset *= 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
}
|
|
}
|
|
|
|
|
|
vec4 project_pos = project_position(vec4(a_Extrude.xy, 0., 1.0));
|
|
|
|
// u_r 控制圆柱的生长
|
|
vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);
|
|
|
|
// // 圆柱光照效果
|
|
float lightWeight = 1.0;
|
|
|
|
if(u_lightEnable > 0.0) { // 取消三元表达式,增强健壮性
|
|
lightWeight = calc_lighting(pos);
|
|
}
|
|
|
|
v_lightWeight = lightWeight;
|
|
|
|
v_color = a_Color;
|
|
|
|
// 设置圆柱的底色
|
|
if(u_linearColor == 1.0) { // 使用渐变颜色
|
|
v_color = mix(u_sourceColor, u_targetColor, a_Position.z);
|
|
v_color.a = v_color.a * opacity;
|
|
} else {
|
|
v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);
|
|
}
|
|
|
|
if(u_opacitylinear > 0.0) {
|
|
v_color.a *= u_opacitylinear_dir > 0.0 ? (1.0 - a_Position.z): a_Position.z;
|
|
}
|
|
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(pos);
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,LP=function(e){_n(r,e);var t=Jfe(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"raiseCount",0),F($e(n),"raiseRepeat",0),n}return jt(r,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption,a=o===void 0?{enable:!1,speed:.01,repeat:!1}:o,u=i.sourceColor,c=i.targetColor,f=i.pickLight,m=f===void 0?!1:f,_=i.heightfixed,b=_===void 0?!1:_,A=i.opacityLinear,w=A===void 0?{enable:!1,dir:"up"}:A,R=i.lightEnable,P=R===void 0?!0:R,k=0,L=[0,0,0,0],B=[0,0,0,0];if(u&&c&&(L=Ta(u),B=Ta(c),k=1),this.raiseCount<1&&this.raiseRepeat>0&&a.enable){var V=a.speed,G=V===void 0?.01:V;this.raiseCount+=G,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}var K={u_pickLight:Number(m),u_heightfixed:Number(b),u_r:a.enable&&this.raiseRepeat>0?this.raiseCount:1,u_linearColor:k,u_sourceColor:L,u_targetColor:B,u_opacitylinear:Number(w.enable),u_opacitylinear_dir:w.dir==="up"?1:0,u_lightEnable:Number(P)},Z=this.getUniformsBufferInfo(K);return Z}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.buildModels());case 1:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f,m,_;return he.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return a=this.layer.getLayerConfig(),u=a.depth,c=u===void 0?!0:u,f=a.animateOption.repeat,m=f===void 0?1:f,this.raiseRepeat=m,this.initUniformsBuffer(),A.next=5,this.layer.buildLayerModel({moduleName:"pointExtrude",vertexShader:rhe,fragmentShader:the,triangulation:DP,inject:this.getInject(),cull:{enable:!0,face:_5(this.mapService.version)},depth:{enable:c}});case 5:return _=A.sent,A.abrupt("return",[_]);case 7:case"end":return A.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(o){var a=o.size;if(a){var u=[];return Array.isArray(a)&&(u=a.length===2?[a[0],a[0],a[1]]:a),Array.isArray(a)||(u=[a,a,a]),u}else return[2,2,2]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:wn.Attribute,descriptor:{name:"a_Normal",shaderLocation:Vn.NORMAL,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(o,a,u,c,f){return f}}}),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:wn.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Vn.EXTRUDE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(o){var a=ih(o.coordinates);return[a[0],a[1],0]}}})}}]),r}(Ba);function nhe(e){var t=ihe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function ihe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ahe=`
|
|
layout(std140) uniform commonUniforms {
|
|
vec3 u_blur_height_fixed;
|
|
float u_stroke_width;
|
|
float u_additive;
|
|
float u_stroke_opacity;
|
|
float u_size_unit;
|
|
float u_time;
|
|
vec4 u_animate;
|
|
};
|
|
|
|
in vec4 v_color;
|
|
in vec4 v_stroke;
|
|
in vec4 v_data;
|
|
in float v_radius;
|
|
|
|
#pragma include "scene_uniforms"
|
|
#pragma include "sdf_2d"
|
|
#pragma include "picking"
|
|
|
|
out vec4 outputColor;
|
|
|
|
void main() {
|
|
int shape = int(floor(v_data.w + 0.5));
|
|
lowp float antialiasblur = v_data.z;
|
|
float r = v_radius / (v_radius + u_stroke_width);
|
|
|
|
float outer_df;
|
|
float inner_df;
|
|
// 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'
|
|
if (shape == 0) {
|
|
outer_df = sdCircle(v_data.xy, 1.0);
|
|
inner_df = sdCircle(v_data.xy, r);
|
|
} else if (shape == 1) {
|
|
outer_df = sdEquilateralTriangle(1.1 * v_data.xy);
|
|
inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);
|
|
} else if (shape == 2) {
|
|
outer_df = sdBox(v_data.xy, vec2(1.));
|
|
inner_df = sdBox(v_data.xy, vec2(r));
|
|
} else if (shape == 3) {
|
|
outer_df = sdPentagon(v_data.xy, 0.8);
|
|
inner_df = sdPentagon(v_data.xy, r * 0.8);
|
|
} else if (shape == 4) {
|
|
outer_df = sdHexagon(v_data.xy, 0.8);
|
|
inner_df = sdHexagon(v_data.xy, r * 0.8);
|
|
} else if (shape == 5) {
|
|
outer_df = sdOctogon(v_data.xy, 1.0);
|
|
inner_df = sdOctogon(v_data.xy, r);
|
|
} else if (shape == 6) {
|
|
outer_df = sdHexagram(v_data.xy, 0.52);
|
|
inner_df = sdHexagram(v_data.xy, r * 0.52);
|
|
} else if (shape == 7) {
|
|
outer_df = sdRhombus(v_data.xy, vec2(1.0));
|
|
inner_df = sdRhombus(v_data.xy, vec2(r));
|
|
} else if (shape == 8) {
|
|
outer_df = sdVesica(v_data.xy, 1.1, 0.8);
|
|
inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);
|
|
}
|
|
|
|
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
|
|
|
|
float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(
|
|
antialiasblur,
|
|
0.0,
|
|
inner_df
|
|
);
|
|
|
|
float PI = 3.14159;
|
|
float N_RINGS = 3.0;
|
|
float FREQ = 1.0;
|
|
|
|
if(u_stroke_width < 0.01) {
|
|
outputColor = v_color;
|
|
} else {
|
|
outputColor = mix(v_color, v_stroke * u_stroke_opacity, color_t);
|
|
}
|
|
float intensity = 1.0;
|
|
if(u_time!=-1.0){
|
|
//wave相关逻辑
|
|
float d = length(v_data.xy);
|
|
if(d > 0.5) {
|
|
discard;
|
|
}
|
|
intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_animate.z - u_animate.y * u_time)), 0.0, 1.0);
|
|
}
|
|
|
|
if(u_additive > 0.0) {
|
|
outputColor *= opacity_t;
|
|
outputColor *= intensity;//wave
|
|
outputColor = filterColorAlpha(outputColor, outputColor.a);
|
|
} else {
|
|
outputColor.a *= opacity_t;
|
|
outputColor.a *= intensity;//wave
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
// 作为 mask 模板时需要丢弃透明的像素
|
|
if(outputColor.a < 0.01) {
|
|
discard;
|
|
}
|
|
}
|
|
`,ohe=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 10) in float a_Shape;
|
|
layout(location = 11) in vec3 a_Extrude;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec3 u_blur_height_fixed;
|
|
float u_stroke_width;
|
|
float u_additive;
|
|
float u_stroke_opacity;
|
|
float u_size_unit;
|
|
float u_time;
|
|
vec4 u_animate;
|
|
};
|
|
|
|
out vec4 v_color;
|
|
out vec4 v_stroke;
|
|
out vec4 v_data;
|
|
out float v_radius;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
#pragma include "rotation_2d"
|
|
|
|
void main() {
|
|
// 透明度计算
|
|
v_stroke = stroke;
|
|
vec3 extrude = a_Extrude;
|
|
float shape_type = a_Shape;
|
|
/*
|
|
* setPickingSize 设置拾取大小
|
|
* u_meter2coord 在等面积大小的时候设置单位
|
|
*/
|
|
float newSize = setPickingSize(a_Size);
|
|
// float newSize = setPickingSize(a_Size) * 0.00001038445708445579;
|
|
|
|
|
|
|
|
// unpack color(vec2)
|
|
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
|
|
if(u_size_unit == 1.0) {
|
|
newSize = newSize * u_PixelsPerMeter.z;
|
|
}
|
|
|
|
v_radius = newSize;
|
|
|
|
// anti-alias
|
|
// float antialiased_blur = -max(u_blur, antialiasblur);
|
|
float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur_height_fixed.x);
|
|
|
|
vec2 offset = (extrude.xy * (newSize + u_stroke_width) + u_offsets);
|
|
vec3 aPosition = a_Position;
|
|
|
|
offset = project_pixel(offset);
|
|
offset = rotate_matrix(offset,rotation);
|
|
|
|
// TODP: /abs(extrude.x) 是为了兼容地球模式
|
|
v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);
|
|
|
|
|
|
// vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));
|
|
vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
|
|
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));
|
|
|
|
float raisingHeight = u_blur_height_fixed.y;
|
|
|
|
if(u_blur_height_fixed.z < 1.0) { // false
|
|
raisingHeight = project_pixel(u_blur_height_fixed.y);
|
|
} else {
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
raisingHeight = u_blur_height_fixed.y * mapboxZoomScale;
|
|
}
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, raisingHeight, 1.0));
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,NP=function(e){_n(r,e);var t=nhe(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.strokeOpacity,a=o===void 0?1:o,u=i.strokeWidth,c=u===void 0?0:u,f=i.blend,m=i.blur,_=m===void 0?0:m,b=i.raisingHeight,A=b===void 0?0:b,w=i.heightfixed,R=w===void 0?!1:w,P=i.unit,k=P===void 0?"pixel":P,L=this.getAnimateUniforms().u_time;isNaN(L)&&(L=-1);var B={u_blur_height_fixed:[_,Number(A),Number(R)],u_stroke_width:c,u_additive:f==="additive"?1:0,u_stroke_opacity:a,u_size_unit:ib[k],u_time:L,u_animate:this.getAnimateUniforms().u_animate},V=this.getUniformsBufferInfo(B);return V}},{key:"getAnimateUniforms",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption,a=o===void 0?{enable:!1}:o;return{u_animate:this.animateOption2Array(a),u_time:this.layer.getLayerAnimateTime()}}},{key:"getAttribute",value:function(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),Mg)}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.buildModels());case 1:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f,m,_,b,A;return he.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return a=this.layer.getLayerConfig(),u=a.animateOption,c=u===void 0?{enable:!1}:u,f=this.getShaders(c),m=f.frag,_=f.vert,b=f.type,this.layer.triangulation=Mg,this.initUniformsBuffer(),R.next=6,this.layer.buildLayerModel({moduleName:b,vertexShader:_,fragmentShader:m,inject:this.getInject(),triangulation:Mg,depth:{enable:!1}});case 6:return A=R.sent,R.abrupt("return",[A]);case 8:case"end":return R.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(i){return{frag:ahe,vert:ohe,type:"pointFill"}}},{key:"animateOption2Array",value:function(i){return[i.enable?0:1,i.speed||1,i.rings||3,0]}},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getLayerConfig().shape2d;this.styleAttributeService.registerStyleAttribute({name:"extrude",type:wn.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Vn.EXTRUDE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(a,u,c,f){var m=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],_=f%4*3;return[m[_],m[_+1],m[_+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(a){var u=a.size,c=u===void 0?5:u;return Array.isArray(c)?[c[0]]:[c]}}}),this.styleAttributeService.registerStyleAttribute({name:"shape",type:wn.Attribute,descriptor:{name:"a_Shape",shaderLocation:Vn.SHAPE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(a){var u=a.shape,c=u===void 0?2:u,f=i.indexOf(c);return[f]}}})}}]),r}(Ba);function she(e){var t=uhe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function uhe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var lhe=`in vec2 v_uv;// 本身的 uv 坐标
|
|
in vec2 v_Iconuv;
|
|
in float v_opacity;
|
|
out vec4 outputColor;
|
|
|
|
uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniform {
|
|
vec2 u_textSize;
|
|
float u_heightfixed: 0.0;
|
|
float u_raisingHeight: 0.0;
|
|
float u_size_unit;
|
|
};
|
|
|
|
#pragma include "scene_uniforms"
|
|
#pragma include "sdf_2d"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
vec2 pos = v_Iconuv / u_textSize + v_uv / u_textSize * 64.;
|
|
outputColor = texture(SAMPLER_2D(u_texture), pos);
|
|
outputColor.a *= v_opacity;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,che=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 11) in vec3 a_Extrude;
|
|
layout(location = 14) in vec2 a_Uv;
|
|
|
|
layout(std140) uniform commonUniform {
|
|
vec2 u_textSize;
|
|
float u_heightfixed: 0.0;
|
|
float u_raisingHeight: 0.0;
|
|
float u_size_unit;
|
|
};
|
|
|
|
out vec2 v_uv;
|
|
out vec2 v_Iconuv;
|
|
out float v_opacity;
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
#pragma include "rotation_2d"
|
|
|
|
void main() {
|
|
vec3 extrude = a_Extrude;
|
|
v_uv = (a_Extrude.xy + 1.0)/2.0;
|
|
v_uv.y = 1.0 - v_uv.y;
|
|
v_Iconuv = a_Uv;
|
|
v_opacity = opacity;
|
|
float newSize = a_Size;
|
|
if(u_size_unit == 1.0) {
|
|
newSize = newSize * u_PixelsPerMeter.z;
|
|
}
|
|
|
|
// vec2 offset = (u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);
|
|
vec2 offset = (extrude.xy * (newSize) + offsets);
|
|
|
|
offset = rotate_matrix(offset,rotation);
|
|
|
|
vec3 aPosition = a_Position;
|
|
|
|
offset = project_pixel(offset);
|
|
|
|
vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
|
|
float raisingHeight = u_raisingHeight;
|
|
if(u_heightfixed < 1.0) { // height fixed
|
|
raisingHeight = project_pixel(u_raisingHeight);
|
|
} else {
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
raisingHeight = u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, 0.0, 1.0));
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,fhe=function(e){_n(r,e);var t=she(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"meter2coord",1),F($e(n),"isMeter",!1),F($e(n),"radian",0),F($e(n),"updateTexture",function(){var u=n.rendererService.createTexture2D;if(n.texture){n.texture.update({data:n.iconService.getCanvas(),mag:"linear",min:"linear mipmap nearest",mipmap:!0}),n.layerService.throttleRenderLayers();return}n.texture=u({data:n.iconService.getCanvas(),mag:W.LINEAR,min:W.LINEAR_MIPMAP_LINEAR,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128,mipmap:!0}),n.textures=[n.texture]}),n}return jt(r,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.raisingHeight,a=o===void 0?0:o,u=i.heightfixed,c=u===void 0?!1:u,f=i.unit,m=f===void 0?"pixel":f;this.rendererService.getDirty()&&this.texture.bind();var _={u_textSize:[1024,this.iconService.canvasHeight||128],u_heightfixed:Number(c),u_raisingHeight:Number(a),u_size_unit:ib[m]},b=this.getUniformsBufferInfo(_);return b}},{key:"getAttribute",value:function(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),o_)}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.iconService.on("imageUpdate",this.updateTexture),this.updateTexture(),u.abrupt("return",this.buildModels());case 3:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.initUniformsBuffer(),c.next=3,this.layer.buildLayerModel({moduleName:"pointFillImage",vertexShader:che,fragmentShader:lhe,triangulation:o_,depth:{enable:!1},inject:this.getInject(),cull:{enable:!0,face:_5(this.mapService.version)}});case 3:return a=c.sent,c.abrupt("return",[a]);case 5:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;this.iconService.off("imageUpdate",this.updateTexture),(i=this.texture)===null||i===void 0||i.destroy()}},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"uv",type:wn.Attribute,descriptor:{name:"a_Uv",shaderLocation:Vn.UV,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(a){var u=i.iconService.getIconMap(),c=a.shape,f=u[c]||{x:-64,y:-64},m=f.x,_=f.y;return[m,_]}}}),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:wn.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Vn.EXTRUDE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(a,u,c,f){var m=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],_=f%4*3;return[m[_],m[_+1],m[_+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(a){var u=a.size,c=u===void 0?5:u;return Array.isArray(c)?[c[0]]:[c]}}})}}]),r}(Ba);function hhe(e){var t=phe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function phe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var dhe=`layout(std140) uniform commonUniforms {
|
|
vec2 u_textSize;
|
|
float u_raisingHeight;
|
|
float u_heightfixed;
|
|
};
|
|
|
|
uniform sampler2D u_texture;
|
|
|
|
in vec4 v_color;
|
|
in vec2 v_uv;
|
|
in float v_opacity;
|
|
|
|
#pragma include "picking"
|
|
|
|
out vec4 outputColor;
|
|
|
|
void main(){
|
|
vec2 pos = v_uv / u_textSize + gl_PointCoord / u_textSize * 64.;
|
|
vec4 textureColor;
|
|
|
|
// Y = 0.299R + 0.587G + 0.114B // 亮度提取
|
|
|
|
textureColor = texture(SAMPLER_2D(u_texture), pos);
|
|
|
|
// Tip: 去除边缘部分 mipmap 导致的混合变暗
|
|
float fragmengTocenter = distance(vec2(0.5), gl_PointCoord);
|
|
if(fragmengTocenter >= 0.5) {
|
|
float luma = 0.299 * textureColor.r + 0.587 * textureColor.g + 0.114 * textureColor.b;
|
|
textureColor.a *= luma;
|
|
}
|
|
|
|
if(all(lessThan(v_color, vec4(1.0+0.00001))) && all(greaterThan(v_color, vec4(1.0-0.00001))) || v_color==vec4(1.0)){
|
|
outputColor= textureColor;
|
|
}else {
|
|
outputColor= step(0.01, textureColor.z) * v_color;
|
|
}
|
|
outputColor.a *= v_opacity;
|
|
if (outputColor.a < 0.01) {
|
|
discard;
|
|
}
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,vhe=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 14) in vec2 a_Uv;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec2 u_textSize;
|
|
float u_raisingHeight;
|
|
float u_heightfixed;
|
|
};
|
|
|
|
out vec4 v_color;
|
|
out vec2 v_uv;
|
|
out float v_opacity;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
// cal style mapping - 数据纹理映射部分的计算
|
|
v_color = a_Color;
|
|
v_opacity = opacity;
|
|
v_uv = a_Uv;
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
|
|
vec2 offset = project_pixel(offsets);
|
|
|
|
float raisingHeight = u_raisingHeight;
|
|
if(u_heightfixed < 1.0) { // false
|
|
raisingHeight = project_pixel(u_raisingHeight);
|
|
} else {
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
raisingHeight = u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
}
|
|
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, raisingHeight, 1.0));
|
|
|
|
gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,UP=function(e){_n(r,e);var t=hhe(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"updateTexture",function(){var u=n.rendererService.createTexture2D;if(n.texture){n.texture.update({data:n.iconService.getCanvas(),mag:"linear",min:"linear mipmap nearest",mipmap:!0}),setTimeout(function(){n.layerService.throttleRenderLayers()});return}n.texture=u({data:n.iconService.getCanvas(),mag:W.LINEAR,min:W.LINEAR_MIPMAP_LINEAR,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128,mipmap:!0})}),n}return jt(r,[{key:"getUninforms",value:function(){this.rendererService.getDirty()&&this.texture.bind();var i=this.getCommonUniformsInfo(),o=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),Qe(Qe({},i.uniformsOption),o.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.raisingHeight,a=o===void 0?0:o,u=i.heightfixed,c=u===void 0?!1:u,f={u_textSize:[1024,this.iconService.canvasHeight||128],u_raisingHeight:Number(a),u_heightfixed:Number(c),u_texture:this.texture};this.textures=[this.texture];var m=this.getUniformsBufferInfo(f);return m}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.iconService.on("imageUpdate",this.updateTexture),this.updateTexture(),u.abrupt("return",this.buildModels());case 3:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.initUniformsBuffer(),c.next=3,this.layer.buildLayerModel({moduleName:"pointImage",vertexShader:vhe,fragmentShader:dhe,triangulation:Tce,inject:this.getInject(),depth:{enable:!1},primitive:W.POINTS});case 3:return a=c.sent,c.abrupt("return",[a]);case 5:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(a){var u=a.size,c=u===void 0?5:u;return Array.isArray(c)?[c[0]]:[c]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:wn.Attribute,descriptor:{name:"a_Uv",shaderLocation:Vn.UV,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(a){var u=i.iconService.getIconMap(),c=a.shape,f=u[c]||{x:-64,y:-64},m=f.x,_=f.y;return[m,_]}}})}}]),r}(Ba);function mhe(e){var t=ghe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function ghe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var _he=`in vec4 v_color;
|
|
out vec4 outputColor;
|
|
void main() {
|
|
outputColor = v_color;
|
|
}`,yhe=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
|
|
layout(std140) uniform u_Common {
|
|
float u_size_scale;
|
|
};
|
|
|
|
out vec4 v_color;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
|
|
void main() {
|
|
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
gl_Position = u_Mvp * vec4(a_Position, 1.0);
|
|
} else {
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2., -a_Size /2., 0., 0.);
|
|
gl_Position = project_common_position_to_clipspace(project_pos);
|
|
}
|
|
|
|
gl_PointSize = a_Size * u_size_scale * 2.0 * u_DevicePixelRatio;
|
|
}
|
|
`;function _T(e){var t=e.coordinates;return{vertices:nr(t),indices:[0],size:t.length}}var zP=function(e){_n(r,e);var t=mhe(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getDefaultStyle",value:function(){return{blend:"additive"}}},{key:"getCommonUniformsInfo",value:function(){var i={u_size_scale:.5},o=this.getUniformsBufferInfo(i);return o}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.buildModels());case 1:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.layer.triangulation=_T,this.initUniformsBuffer(),c.next=4,this.layer.buildLayerModel({moduleName:"pointNormal",vertexShader:yhe,fragmentShader:_he,triangulation:_T,inject:this.getInject(),depth:{enable:!1},primitive:W.POINTS,pick:!1});case 4:return a=c.sent,c.abrupt("return",[a]);case 6:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(o){var a=o.size,u=a===void 0?1:a;return Array.isArray(u)?[u[0]]:[u]}}})}}]),r}(Ba);function xhe(e){var t=bhe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function bhe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ehe=`
|
|
layout(std140) uniform commonUniorm{
|
|
float u_additive;
|
|
float u_size_unit;
|
|
float u_speed: 1.0;
|
|
float u_time;
|
|
};
|
|
in vec4 v_data;
|
|
in vec4 v_color;
|
|
in float v_radius;
|
|
in vec2 v_extrude;
|
|
#pragma include "sdf_2d"
|
|
#pragma include "picking"
|
|
|
|
out vec4 outputColor;
|
|
|
|
void main() {
|
|
|
|
lowp float antialiasblur = v_data.z;
|
|
float r = v_radius / (v_radius);
|
|
|
|
float outer_df = sdCircle(v_data.xy, 1.0);
|
|
float inner_df = sdCircle(v_data.xy, r);
|
|
|
|
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
|
|
|
|
outputColor = vec4(v_color.rgb, v_color.a);
|
|
|
|
if(u_additive > 0.0) {
|
|
outputColor *= opacity_t;
|
|
} else {
|
|
outputColor.a *= opacity_t;
|
|
}
|
|
|
|
if(outputColor.a > 0.0) {
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
|
|
vec2 extrude = v_extrude;
|
|
vec2 dir = normalize(extrude);
|
|
vec2 baseDir = vec2(1.0, 0.0);
|
|
float pi = 3.14159265359;
|
|
float flag = sign(dir.y);
|
|
float rades = dot(dir, baseDir);
|
|
float radar_v = (flag - 1.0) * -0.5 * acos(rades)/pi;
|
|
// simple AA
|
|
if(radar_v > 0.99) {
|
|
radar_v = 1.0 - (radar_v - 0.99)/0.01;
|
|
}
|
|
|
|
outputColor.a *= radar_v;
|
|
}
|
|
`,She=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 11) in vec3 a_Extrude;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
float u_additive;
|
|
float u_size_unit;
|
|
float u_speed: 1.0;
|
|
float u_time;
|
|
};
|
|
|
|
out vec4 v_data;
|
|
out vec4 v_color;
|
|
out float v_radius;
|
|
out vec2 v_extrude;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
float newSize = setPickingSize(a_Size);
|
|
|
|
float time = u_time * u_speed;
|
|
mat2 rotateMatrix = mat2(
|
|
cos(time), sin(time),
|
|
-sin(time), cos(time)
|
|
);
|
|
v_extrude = rotateMatrix * a_Extrude.xy;
|
|
|
|
v_color = a_Color;
|
|
v_color.a *= opacity;
|
|
|
|
float blur = 0.0;
|
|
float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);
|
|
|
|
if(u_size_unit == 1.) {
|
|
newSize = newSize * u_PixelsPerMeter.z;
|
|
}
|
|
v_radius = newSize;
|
|
|
|
vec2 offset = (a_Extrude.xy * (newSize));
|
|
vec3 aPosition = a_Position;
|
|
|
|
offset = project_pixel(offset);
|
|
|
|
v_data = vec4(a_Extrude.x, a_Extrude.y, antialiasblur, -1.0);
|
|
|
|
vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,Ahe=function(e){_n(r,e);var t=xhe(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.blend,a=i.speed,u=a===void 0?1:a,c=i.unit,f=c===void 0?"pixel":c,m={u_additive:o==="additive"?1:0,u_size_unit:ib[f],u_speed:u,u_time:this.layer.getLayerAnimateTime()},_=this.getUniformsBufferInfo(m);return _}},{key:"getAnimateUniforms",value:function(){return{}}},{key:"getAttribute",value:function(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),o_)}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.buildModels());case 1:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.initUniformsBuffer(),c.next=3,this.layer.buildLayerModel({moduleName:"pointRadar",vertexShader:She,fragmentShader:Ehe,triangulation:o_,inject:this.getInject(),depth:{enable:!1}});case 3:return a=c.sent,c.abrupt("return",[a]);case 5:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"animateOption2Array",value:function(i){return[i.enable?0:1,i.speed||1,i.rings||3,0]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"extrude",type:wn.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Vn.EXTRUDE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(o,a,u,c){var f=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],m=c%4*3;return[f[m],f[m+1],f[m+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{shaderLocation:Vn.SIZE,name:"a_Size",buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(o){var a=o.size,u=a===void 0?5:a;return Array.isArray(u)?[u[0]]:[u]}}})}}]),r}(Ba);function The(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=whe(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function whe(e,t){if(e){if(typeof e=="string")return yT(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yT(e,t)}}function yT(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Che=function(){function e(t,r,n){Ht(this,e),F(this,"boxCells",[]);var i=this.boxCells;this.xCellCount=Math.ceil(t/n),this.yCellCount=Math.ceil(r/n);for(var o=0;o<this.xCellCount*this.yCellCount;o++)i.push([]);this.boxKeys=[],this.bboxes=[],this.width=t,this.height=r,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/r,this.boxUid=0}return jt(e,[{key:"insert",value:function(r,n,i,o,a){this.forEachCell(n,i,o,a,this.insertBoxCell,this.boxUid++),this.boxKeys.push(r),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(o),this.bboxes.push(a)}},{key:"query",value:function(r,n,i,o,a){return this.queryHitTest(r,n,i,o,!1,a)}},{key:"hitTest",value:function(r,n,i,o,a){return this.queryHitTest(r,n,i,o,!0,a)}},{key:"insertBoxCell",value:function(r,n,i,o,a,u){this.boxCells[a].push(u)}},{key:"queryHitTest",value:function(r,n,i,o,a,u){if(i<0||r>this.width||o<0||n>this.height)return a?!1:[];var c=[];if(r<=0&&n<=0&&this.width<=i&&this.height<=o){if(a)return!0;for(var f=0;f<this.boxKeys.length;f++)c.push({key:this.boxKeys[f],x1:this.bboxes[f*4],y1:this.bboxes[f*4+1],x2:this.bboxes[f*4+2],y2:this.bboxes[f*4+3]});return u?c.filter(u):c}var m={hitTest:a,seenUids:{box:{},circle:{}}};return this.forEachCell(r,n,i,o,this.queryCell,c,m,u),a?c.length>0:c}},{key:"queryCell",value:function(r,n,i,o,a,u,c,f){var m=c.seenUids,_=this.boxCells[a];if(_!==null){var b=this.bboxes,A=The(_),w;try{for(A.s();!(w=A.n()).done;){var R=w.value;if(!m.box[R]){m.box[R]=!0;var P=R*4;if(r<=b[P+2]&&n<=b[P+3]&&i>=b[P+0]&&o>=b[P+1]&&(!f||f(this.boxKeys[R]))){if(c.hitTest)return u.push(!0),!0;u.push({key:this.boxKeys[R],x1:b[P],y1:b[P+1],x2:b[P+2],y2:b[P+3]})}}}}catch(k){A.e(k)}finally{A.f()}}return!1}},{key:"forEachCell",value:function(r,n,i,o,a,u,c,f){for(var m=this.convertToXCellCoord(r),_=this.convertToYCellCoord(n),b=this.convertToXCellCoord(i),A=this.convertToYCellCoord(o),w=m;w<=b;w++)for(var R=_;R<=A;R++){var P=this.xCellCount*R+w;if(a.call(this,r,n,i,o,P,u,c,f))return}}},{key:"convertToXCellCoord",value:function(r){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(r*this.xScale)))}},{key:"convertToYCellCoord",value:function(r){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(r*this.yScale)))}}]),e}();const Rhe=Che;var Ihe=function(){function e(t,r){Ht(this,e),F(this,"viewportPadding",100),this.width=t,this.height=r,this.viewportPadding=Math.max(t,r),this.grid=new Rhe(t+this.viewportPadding,r+this.viewportPadding,25),this.screenRightBoundary=t+this.viewportPadding,this.screenBottomBoundary=r+this.viewportPadding,this.gridRightBoundary=t+2*this.viewportPadding,this.gridBottomBoundary=r+2*this.viewportPadding}return jt(e,[{key:"placeCollisionBox",value:function(r){var n=r.x1+r.anchorPointX+this.viewportPadding,i=r.y1+r.anchorPointY+this.viewportPadding,o=r.x2+r.anchorPointX+this.viewportPadding,a=r.y2+r.anchorPointY+this.viewportPadding;return!this.isInsideGrid(n,i,o,a)||this.grid.hitTest(n,i,o,a)?{box:[]}:{box:[n,i,o,a]}}},{key:"insertCollisionBox",value:function(r,n){var i={featureIndex:n};this.grid.insert(i,r[0],r[1],r[2],r[3])}},{key:"project",value:function(r,n,i){var o=zre(n,i,0,1),a=DM(),u=vM.apply(sre,nr(r));return G5(a,o,u),{x:(a[0]/a[3]+1)/2*this.width+this.viewportPadding,y:(-a[1]/a[3]+1)/2*this.height+this.viewportPadding}}},{key:"isInsideGrid",value:function(r,n,i,o){return i>=0&&r<this.gridRightBoundary&&o>=0&&n<this.gridBottomBoundary}}]),e}();function $P(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Mhe(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Mhe(e,t){if(e){if(typeof e=="string")return xT(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xT(e,t)}}function xT(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function VP(e){var t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0;break;default:t=.5}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0;break;default:r=.5}return{horizontalAlign:t,verticalAlign:r}}function jP(e,t,r,n,i){if(i){var o=e[n],a=o.glyph;if(a)for(var u=t[a].advance*o.scale,c=(e[n].x+u)*i,f=r;f<=n;f++)e[f].x-=c}}function HP(e,t,r,n,i,o,a){var u=(t-r)*i,c=(-n*a+.5)*o,f=$P(e),m;try{for(f.s();!(m=f.n()).done;){var _=m.value;_.x+=u,_.y+=c}}catch(b){f.e(b)}finally{f.f()}}function Phe(e,t,r,n,i,o,a){var u=-8,c=0,f=u,m=0,_=e.positionedGlyphs,b=o==="right"?1:o==="left"?0:.5,A=_.length;r.forEach(function(L){if(L.split("").forEach(function(V){var G=t[V],K=0;G&&(_.push({glyph:V,x:c,y:f+K,vertical:!1,scale:1,metrics:G}),c+=G.advance+a)}),_.length!==A){var B=c-a;m=Math.max(B,m),jP(_,t,A,_.length-1,b)}c=0,f-=n+5});var w=VP(i),R=w.horizontalAlign,P=w.verticalAlign;HP(_,b,R,P,m,n,r.length);var k=f-u;e.top+=-P*k,e.bottom=e.top-k,e.left+=-R*m,e.right=e.left+m}function Ohe(e,t,r,n,i,o,a){var u=-8,c=0,f=u,m=0,_=e.positionedGlyphs,b=o==="right"?1:o==="left"?0:.5,A=_.length;r.forEach(function(L){var B=t[L],V=0;if(B&&(_.push({glyph:L,x:B.advance/2,y:f+V,vertical:!1,scale:1,metrics:B}),c+=B.advance+a),_.length!==A){var G=c-a;m=Math.max(G,m),jP(_,t,A,_.length-1,b)}c=0,f-=n+5});var w=VP(i),R=w.horizontalAlign,P=w.verticalAlign;HP(_,b,R,P,m,n,r.length);var k=f-u;e.top+=-P*k,e.bottom=e.top-k,e.left+=-R*m,e.right=e.left+m}function khe(e,t,r,n,i,o){var a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:[0,0],u=arguments.length>7?arguments[7]:void 0,c=e.split(`
|
|
`),f=[],m={positionedGlyphs:f,top:a[1],bottom:a[1],left:a[0],right:a[0],lineCount:c.length,text:e};return u?Ohe(m,t,c,r,n,i,o):Phe(m,t,c,r,n,i,o),f.length?m:!1}function Dhe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0],r=arguments.length>2?arguments[2]:void 0,n=e.positionedGlyphs,i=n===void 0?[]:n,o=[],a=$P(i),u;try{for(a.s();!(u=a.n()).done;){var c=u.value,f=c.metrics,m=4,_=f.advance*c.scale/2,b=r?[c.x+_,c.y]:[0,0],A=r?[0,0]:[c.x+_+t[0],c.y+t[1]],w=(0-m)*c.scale-_+A[0],R=(0-m)*c.scale+A[1],P=w+f.width*c.scale,k=R+f.height*c.scale,L={x:w,y:R},B={x:P,y:R},V={x:w,y:k},G={x:P,y:k};o.push({tl:L,tr:B,bl:V,br:G,tex:f,glyphOffset:b})}}catch(K){a.e(K)}finally{a.f()}return o}function Fhe(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Bhe(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Bhe(e,t){if(e){if(typeof e=="string")return bT(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bT(e,t)}}function bT(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Lhe(e){var t=Nhe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Nhe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ET=`#define SDF_PX 8.0
|
|
#define EDGE_GAMMA 0.105
|
|
#define FONT_SIZE 48.0
|
|
|
|
uniform sampler2D u_sdf_map;
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
vec2 u_sdf_map_size;
|
|
float u_raisingHeight: 0.0;
|
|
float u_stroke_width : 2;
|
|
float u_gamma_scale : 0.5;
|
|
float u_halo_blur : 0.5;
|
|
};
|
|
|
|
in vec2 v_uv;
|
|
in float v_gamma_scale;
|
|
in vec4 v_color;
|
|
in vec4 v_stroke_color;
|
|
in float v_fontScale;
|
|
|
|
out vec4 outputColor;
|
|
|
|
#pragma include "picking"
|
|
void main() {
|
|
// get style data mapping
|
|
|
|
// get sdf from atlas
|
|
float dist = texture(SAMPLER_2D(u_sdf_map), v_uv).a;
|
|
|
|
lowp float buff = (6.0 - u_stroke_width / v_fontScale) / SDF_PX;
|
|
highp float gamma = (u_halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (v_fontScale * u_gamma_scale) / 1.0;
|
|
|
|
highp float gamma_scaled = gamma * v_gamma_scale;
|
|
|
|
highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);
|
|
|
|
outputColor = mix(v_color, v_stroke_color, smoothstep(0., 0.5, 1.- dist));
|
|
|
|
outputColor.a *= alpha;
|
|
// 作为 mask 模板时需要丢弃透明的像素
|
|
if (outputColor.a < 0.01) {
|
|
discard;
|
|
}
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,ST=`#define SDF_PX 8.0
|
|
#define EDGE_GAMMA 0.105
|
|
#define FONT_SIZE 24.0
|
|
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 10) in vec2 a_textOffsets;
|
|
layout(location = 14) in vec2 a_tex;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
vec2 u_sdf_map_size;
|
|
float u_raisingHeight: 0.0;
|
|
float u_stroke_width : 2;
|
|
float u_gamma_scale : 0.5;
|
|
float u_halo_blur : 0.5;
|
|
};
|
|
|
|
out vec2 v_uv;
|
|
out float v_gamma_scale;
|
|
out vec4 v_color;
|
|
out vec4 v_stroke_color;
|
|
out float v_fontScale;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
#pragma include "rotation_2d"
|
|
|
|
void main() {
|
|
// cal style mapping - 数据纹理映射部分的计算
|
|
|
|
v_uv = a_tex / u_sdf_map_size;
|
|
|
|
|
|
|
|
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
v_stroke_color = vec4(u_stroke_color.xyz, u_stroke_color.w * opacity);
|
|
|
|
// 文本缩放比例
|
|
float fontScale = a_Size / FONT_SIZE;
|
|
v_fontScale = fontScale;
|
|
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
// vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
|
|
|
|
vec2 offset = rotate_matrix(a_textOffsets,rotation);
|
|
|
|
// gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);
|
|
|
|
float raiseHeight = u_raisingHeight;
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
raiseHeight = u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
|
|
vec4 projected_position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));
|
|
|
|
gl_Position = vec4(
|
|
projected_position.xy / projected_position.w + offset * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);
|
|
v_gamma_scale = gl_Position.w;
|
|
setPickingColor(a_PickingColor);
|
|
|
|
}
|
|
`,Av=Ci.isEqual;function AT(e){var t=this,r=e.id,n=[],i=[];if(!t.glyphInfoMap||!t.glyphInfoMap[r])return{vertices:[],indices:[],size:7};var o=t.glyphInfoMap[r].centroid,a=o.length===2?[o[0],o[1],0]:o;return t.glyphInfoMap[r].glyphQuads.forEach(function(u,c){n.push.apply(n,nr(a).concat([u.tex.x,u.tex.y+u.tex.height,u.tl.x,u.tl.y],nr(a),[u.tex.x+u.tex.width,u.tex.y+u.tex.height,u.tr.x,u.tr.y],nr(a),[u.tex.x+u.tex.width,u.tex.y,u.br.x,u.br.y],nr(a),[u.tex.x,u.tex.y,u.bl.x,u.bl.y])),i.push(0+c*4,1+c*4,2+c*4,2+c*4,3+c*4,0+c*4)}),{vertices:n,indices:i,size:7}}var GP=function(e){_n(r,e);var t=Lhe(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"glyphInfoMap",{}),F($e(n),"currentZoom",-1),F($e(n),"textureHeight",0),F($e(n),"textCount",0),F($e(n),"preTextStyle",{}),F($e(n),"mapping",Mt(he.mark(function u(){return he.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return n.initGlyph(),n.updateTexture(),f.next=4,n.reBuildModel();case 4:case"end":return f.stop()}},u)}))),n}return jt(r,[{key:"getUninforms",value:function(){var i=this.getCommonUniformsInfo(),o=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),Qe(Qe(Qe({},i.uniformsOption),o.uniformsOption),{u_sdf_map:this.textures[0]})}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.stroke,a=o===void 0?"#fff":o,u=i.strokeWidth,c=u===void 0?0:u,f=i.halo,m=f===void 0?.5:f,_=i.gamma,b=_===void 0?2:_,A=i.raisingHeight,w=A===void 0?0:A,R=this.getFontServiceMapping(),P=this.getFontServiceCanvas();R&&Object.keys(R).length!==this.textCount&&P&&(this.updateTexture(),this.textCount=Object.keys(R).length),this.preTextStyle=this.getTextStyle();var k={u_stroke_color:Ta(a),u_sdf_map_size:[(P==null?void 0:P.width)||1,(P==null?void 0:P.height)||1],u_raisingHeight:Number(w),u_stroke_width:c,u_gamma_scale:b,u_halo_blur:m},L=this.getUniformsBufferInfo(k);return L}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.bindEvent(),this.extent=this.textExtent(),this.rawEncodeData=this.layer.getEncodedData(),this.preTextStyle=this.getTextStyle(),this.initUniformsBuffer(),u.abrupt("return",this.buildModels());case 6:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return a=this.layer.getLayerConfig(),u=a.textAllowOverlap,c=u===void 0?!1:u,this.initGlyph(),this.updateTexture(),c||this.filterGlyphs(),_.next=6,this.layer.buildLayerModel({moduleName:"pointText",vertexShader:ST,fragmentShader:ET,inject:this.getInject(),triangulation:AT.bind(this),depth:{enable:!1}});case 6:return f=_.sent,_.abrupt("return",[f]);case 8:case"end":return _.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"needUpdate",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f,m,_,b,A,w,R,P,k;return he.wrap(function(B){for(;;)switch(B.prev=B.next){case 0:if(a=this.getTextStyle(),u=a.textAllowOverlap,c=u===void 0?!1:u,f=a.textAnchor,m=f===void 0?"center":f,_=a.textOffset,b=a.padding,A=a.fontFamily,w=a.fontWeight,!(!Av(b,this.preTextStyle.padding)||!Av(_,this.preTextStyle.textOffset)||!Av(m,this.preTextStyle.textAnchor)||!Av(A,this.preTextStyle.fontFamily)||!Av(w,this.preTextStyle.fontWeight))){B.next=5;break}return B.next=4,this.mapping();case 4:return B.abrupt("return",!0);case 5:if(!c){B.next=7;break}return B.abrupt("return",!1);case 7:if(R=this.mapService.getZoom(),P=this.mapService.getBounds(),k=JI(this.extent,P),!(Math.abs(this.currentZoom-R)>.5||!k||c!==this.preTextStyle.textAllowOverlap)){B.next=14;break}return B.next=13,this.reBuildModel();case 13:return B.abrupt("return",!0);case 14:return B.abrupt("return",!1);case 15:case"end":return B.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.layer.off("remapping",this.mapping)}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"textOffsets",type:wn.Attribute,descriptor:{shaderLocation:10,name:"a_textOffsets",buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(o,a,u){return[u[5],u[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"textUv",type:wn.Attribute,descriptor:{name:"a_tex",shaderLocation:Vn.UV,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(o,a,u){return[u[3],u[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(o){var a=o.size,u=a===void 0?12:a;return Array.isArray(u)?[u[0]]:[u]}}})}},{key:"bindEvent",value:function(){this.layer.isTileLayer||this.layer.on("remapping",this.mapping)}},{key:"textExtent",value:function(){var i=this.mapService.getBounds();return k5(i,.5)}},{key:"initTextFont",value:function(){var i=this.getTextStyle(),o=i.fontWeight,a=i.fontFamily,u=this.rawEncodeData,c=[];u.forEach(function(f){var m=f.shape,_=m===void 0?"":m;_=_.toString();var b=Fhe(_),A;try{for(b.s();!(A=b.n()).done;){var w=A.value;c.indexOf(w)===-1&&c.push(w)}}catch(R){b.e(R)}finally{b.f()}}),this.fontService.setFontOptions({characterSet:c,fontWeight:o,fontFamily:a,iconfont:!1})}},{key:"initIconFontTex",value:function(){var i=this.getTextStyle(),o=i.fontWeight,a=i.fontFamily,u=this.rawEncodeData,c=[];u.forEach(function(f){var m=f.shape,_=m===void 0?"":m;_="".concat(_),c.indexOf(_)===-1&&c.push(_)}),this.fontService.setFontOptions({characterSet:c,fontWeight:o,fontFamily:a,iconfont:!0})}},{key:"getTextStyle",value:function(){var i=this.layer.getLayerConfig(),o=i.fontWeight,a=o===void 0?"400":o,u=i.fontFamily,c=u===void 0?"sans-serif":u,f=i.textAllowOverlap,m=f===void 0?!1:f,_=i.padding,b=_===void 0?[0,0]:_,A=i.textAnchor,w=A===void 0?"center":A,R=i.textOffset,P=R===void 0?[0,0]:R,k=i.opacity,L=k===void 0?1:k,B=i.strokeOpacity,V=B===void 0?1:B,G=i.strokeWidth,K=G===void 0?0:G,Z=i.stroke,ve=Z===void 0?"#000":Z;return{fontWeight:a,fontFamily:c,textAllowOverlap:m,padding:b,textAnchor:w,textOffset:P,opacity:L,strokeOpacity:V,strokeWidth:K,stroke:ve}}},{key:"generateGlyphLayout",value:function(i){var o=this,a=this.getFontServiceMapping(),u=this.layer.getLayerConfig(),c=u.spacing,f=c===void 0?2:c,m=u.textAnchor,_=m===void 0?"center":m,b=u.textOffset,A=this.rawEncodeData;this.glyphInfo=A.map(function(w){var R=w.shape,P=R===void 0?"":R,k=w.id,L=w.size,B=L===void 0?1:L,V=w.textOffset?w.textOffset:b||[0,0],G=w.textAnchor?w.textAnchor:_||"center",K=khe(P.toString(),a,B,G,"left",f,V,i),Z=Dhe(K,V,!1);return w.shaping=K,w.glyphQuads=Z,w.centroid=ih(w.coordinates),w.originCentroid=w.version==="GAODE2.x"?ih(w.originCoordinates):w.originCentroid=w.centroid,o.glyphInfoMap[k]={shaping:K,glyphQuads:Z,centroid:ih(w.coordinates)},w})}},{key:"getFontServiceMapping",value:function(){var i=this.layer.getLayerConfig(),o=i.fontWeight,a=o===void 0?"400":o,u=i.fontFamily,c=u===void 0?"sans-serif":u;return this.fontService.getMappingByKey("".concat(c,"_").concat(a))}},{key:"getFontServiceCanvas",value:function(){var i=this.layer.getLayerConfig(),o=i.fontWeight,a=o===void 0?"400":o,u=i.fontFamily,c=u===void 0?"sans-serif":u;return this.fontService.getCanvasByKey("".concat(c,"_").concat(a))}},{key:"filterGlyphs",value:function(){var i=this,o=this.layer.getLayerConfig(),a=o.padding,u=a===void 0?[0,0]:a,c=o.textAllowOverlap,f=c===void 0?!1:c;if(!f){this.glyphInfoMap={},this.currentZoom=this.mapService.getZoom(),this.extent=this.textExtent();var m=this.rendererService.getViewportSize(),_=m.width,b=m.height,A=new Ihe(_,b),w=this.glyphInfo.filter(function(R){var P=R.shaping,k=R.id,L=k===void 0?0:k,B=R.version==="GAODE2.x"?R.originCentroid:R.centroid,V=R.size,G=V/16,K=i.mapService.lngLatToContainer(B),Z=A.placeCollisionBox({x1:P.left*G-u[0],x2:P.right*G+u[0],y1:P.top*G-u[1],y2:P.bottom*G+u[1],anchorPointX:K.x,anchorPointY:K.y}),ve=Z.box;return ve&&ve.length?(A.insertCollisionBox(ve,L),!0):!1});w.forEach(function(R){i.glyphInfoMap[R.id]=R})}}},{key:"initGlyph",value:function(){var i=this.layer.getLayerConfig(),o=i.iconfont,a=o===void 0?!1:o;a?this.initIconFontTex():this.initTextFont(),this.generateGlyphLayout(a)}},{key:"updateTexture",value:function(){var i=this.rendererService.createTexture2D,o=this.getFontServiceCanvas();this.textureHeight=o.height,this.texture&&this.texture.destroy(),this.texture=i({data:o,mag:W.LINEAR,min:W.LINEAR,width:o.width,height:o.height}),this.textures=[this.texture]}},{key:"reBuildModel",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.filterGlyphs(),c.next=3,this.layer.buildLayerModel({moduleName:"pointText",vertexShader:ST,fragmentShader:ET,triangulation:AT.bind(this),inject:this.getInject(),depth:{enable:!1}});case 3:a=c.sent,this.layer.models=[a];case 5:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()}]),r}(Ba),Uhe={fillImage:fhe,fill:NP,radar:Ahe,image:UP,normal:zP,simplePoint:$fe,extrude:LP,text:GP,earthFill:Qfe,earthExtrude:Xfe};function zhe(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=$he(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function $he(e,t){if(e){if(typeof e=="string")return TT(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return TT(e,t)}}function TT(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Vhe(e){var t=jhe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function jhe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Om=function(e){_n(r,e);var t=Vhe(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"type","PointLayer"),F($e(n),"enableShaderEncodeStyles",["stroke","offsets","opacity","rotation"]),F($e(n),"enableDataEncodeStyles",["textOffset","textAnchor"]),F($e(n),"defaultSourceConfig",{data:[],options:{parser:{type:"json",x:"lng",y:"lat"}}}),n}return jt(r,[{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return a=this.getModelType(),this.layerModel&&this.layerModel.clearModels(),this.layerModel=new Uhe[a](this),c.next=5,this.initLayerModels();case 5:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"rebuildModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.buildModels();case 2:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getModelTypeWillEmptyData",value:function(){if(this.shapeOption){var i=this.shapeOption,o=i.field,a=i.values,u=this.getLayerConfig(),c=u.shape2d,f=this.iconService.getIconMap();if(o&&(c==null?void 0:c.indexOf(o))!==-1)return"fill";if(a==="text")return"text";if(a&&a instanceof Array){var m=zhe(a),_;try{for(m.s();!(_=m.n()).done;){var b=_.value;if(typeof b=="string"&&f.hasOwnProperty(b))return"image"}}catch(A){m.e(A)}finally{m.f()}}}return"normal"}},{key:"getDefaultConfig",value:function(){var i=this.getModelType(),o={fillImage:{},normal:{blend:"additive"},radar:{},simplePoint:{},fill:{blend:"normal"},extrude:{},image:{},text:{blend:"normal"},tile:{},tileText:{},earthFill:{},earthExtrude:{}};return o[i]}},{key:"getModelType",value:function(){var i=this.getEncodedData(),o=this.getLayerConfig(),a=o.shape2d,u=o.shape3d,c=o.billboard,f=c===void 0?!0:c,m=this.iconService.getIconMap(),_=i.find(function(A){return A.hasOwnProperty("shape")});if(_){var b=_.shape;return b==="dot"?"normal":b==="simple"?"simplePoint":b==="radar"?"radar":this.layerType==="fillImage"||f===!1?"fillImage":(a==null?void 0:a.indexOf(b))!==-1?this.mapService.version==="GLOBEL"?"earthFill":"fill":(u==null?void 0:u.indexOf(b))!==-1?this.mapService.version==="GLOBEL"?"earthExtrude":"extrude":m.hasOwnProperty(b)?"image":"text"}else return this.getModelTypeWillEmptyData()}}]),r}(P0);function Hhe(e){return Ax.apply(this,arguments)}function Ax(){return Ax=Mt(he.mark(function e(t){var r,n,i;return he.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(!window.createImageBitmap){a.next=14;break}return a.next=3,fetch(t);case 3:return r=a.sent,a.t0=createImageBitmap,a.next=7,r.blob();case 7:return a.t1=a.sent,a.next=10,(0,a.t0)(a.t1);case 10:return n=a.sent,a.abrupt("return",n);case 14:return i=new window.Image,a.abrupt("return",new Promise(function(u){i.onload=function(){return u(i)},i.src=t,i.crossOrigin="Anonymous"}));case 16:case"end":return a.stop()}},e)})),Ax.apply(this,arguments)}function Ghe(e){var t=Whe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Whe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Xhe=`layout(std140) uniform commonUniforms {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor;
|
|
float u_topsurface;
|
|
float u_sidesurface;
|
|
float u_heightfixed; // 默认不固定
|
|
float u_raisingHeight;
|
|
};
|
|
|
|
in vec4 v_Color;
|
|
#pragma include "scene_uniforms"
|
|
#pragma include "picking"
|
|
out vec4 outputColor;
|
|
void main() {
|
|
|
|
// top face
|
|
if(u_topsurface < 1.0) {
|
|
discard;
|
|
}
|
|
|
|
outputColor = v_Color;
|
|
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,Yhe=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
layout(location = 14) in vec3 a_uvs;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor;
|
|
float u_topsurface;
|
|
float u_sidesurface;
|
|
float u_heightfixed; // 默认不固定
|
|
float u_raisingHeight;
|
|
};
|
|
|
|
out vec4 v_Color;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
float isSide = a_Position.z;
|
|
float topU = a_uvs[0];
|
|
float topV = 1.0 - a_uvs[1];
|
|
float sidey = a_uvs[2];
|
|
|
|
vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);
|
|
float lightWeight = calc_lighting(pos);
|
|
|
|
vec4 project_pos = project_position(pos);
|
|
|
|
if(u_heightfixed > 0.0) { // 判断几何体是否固定高度
|
|
project_pos.z = a_Position.z * a_Size;
|
|
project_pos.z += u_raisingHeight;
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
project_pos.z *= mapboxZoomScale;
|
|
project_pos.z += u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
}
|
|
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
|
|
// Tip: 部分机型 GPU 计算精度兼容
|
|
if(isSide < 0.999) {
|
|
// side face
|
|
// if(u_sidesurface < 1.0) {
|
|
// discard;
|
|
// }
|
|
|
|
if(u_linearColor == 1.0) {
|
|
vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);
|
|
linearColor.rgb *= lightWeight;
|
|
v_Color = linearColor;
|
|
} else {
|
|
v_Color = a_Color;
|
|
}
|
|
|
|
} else {
|
|
v_Color = a_Color;
|
|
}
|
|
|
|
v_Color = vec4(v_Color.rgb * lightWeight, v_Color.w * opacity);
|
|
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,Zhe=`uniform sampler2D u_texture;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor;
|
|
float u_topsurface;
|
|
float u_sidesurface;
|
|
float u_heightfixed; // 默认不固定
|
|
float u_raisingHeight;
|
|
};
|
|
|
|
in vec4 v_Color;
|
|
in vec3 v_uvs;
|
|
in vec2 v_texture_data;
|
|
|
|
#pragma include "scene_uniforms"
|
|
#pragma include "picking"
|
|
|
|
out vec4 outputColor;
|
|
|
|
void main() {
|
|
float opacity = u_opacity;
|
|
float isSide = v_texture_data.x;
|
|
float lightWeight = v_texture_data.y;
|
|
float topU = v_uvs[0];
|
|
float topV = 1.0 - v_uvs[1];
|
|
float sidey = v_uvs[2];
|
|
|
|
outputColor = texture(SAMPLER_2D(u_texture), vec2(topU, topV));
|
|
// Tip: 部分机型 GPU 计算精度兼容
|
|
if (isSide < 0.999) {// 是否是边缘
|
|
// side face
|
|
if (u_sidesurface < 1.0) {
|
|
discard;
|
|
}
|
|
|
|
if (u_linearColor == 1.0) {
|
|
vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);
|
|
linearColor.rgb *= lightWeight;
|
|
outputColor = linearColor;
|
|
} else {
|
|
outputColor = v_Color;
|
|
}
|
|
} else {
|
|
// top face
|
|
if (u_topsurface < 1.0) {
|
|
discard;
|
|
}
|
|
}
|
|
|
|
outputColor.a *= opacity;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,qhe=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
layout(location = 14) in vec3 a_uvs;
|
|
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor;
|
|
float u_topsurface;
|
|
float u_sidesurface;
|
|
float u_heightfixed; // 默认不固定
|
|
float u_raisingHeight;
|
|
};
|
|
|
|
out vec4 v_Color;
|
|
out vec3 v_uvs;
|
|
out vec2 v_texture_data;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);
|
|
float lightWeight = calc_lighting(pos);
|
|
vec4 project_pos = project_position(pos);
|
|
v_uvs = a_uvs;
|
|
v_Color = a_Color;
|
|
v_Color.a *= opacity;
|
|
|
|
v_texture_data = vec2(a_Position.z, lightWeight);
|
|
|
|
if(u_heightfixed > 0.0) { // 判断几何体是否固定高度
|
|
project_pos.z = a_Position.z * a_Size;
|
|
project_pos.z += u_raisingHeight;
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
project_pos.z *= mapboxZoomScale;
|
|
project_pos.z += u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
}
|
|
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
|
|
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,Khe=`
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor;
|
|
float u_topsurface;
|
|
float u_sidesurface;
|
|
float u_heightfixed; // 默认不固定
|
|
float u_raisingHeight;
|
|
};
|
|
|
|
in vec4 v_Color;
|
|
in vec3 v_uvs;
|
|
in vec2 v_texture_data;
|
|
out vec4 outputColor;
|
|
|
|
#pragma include "scene_uniforms"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
float isSide = v_texture_data.x;
|
|
float sidey = v_uvs[2];
|
|
float lightWeight = v_texture_data.y;
|
|
|
|
// Tip: 部分机型 GPU 计算精度兼容
|
|
if(isSide < 0.999) {
|
|
// side face
|
|
if(u_sidesurface < 1.0) {
|
|
discard;
|
|
}
|
|
|
|
if( u_linearColor == 1.0) {
|
|
// side use linear
|
|
vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);
|
|
linearColor.rgb *= lightWeight;
|
|
outputColor = linearColor;
|
|
} else {
|
|
// side notuse linear
|
|
outputColor = v_Color;
|
|
}
|
|
} else {
|
|
// top face
|
|
if(u_topsurface < 1.0) {
|
|
discard;
|
|
}
|
|
outputColor = v_Color;
|
|
}
|
|
|
|
outputColor = filterColorAlpha(outputColor, lightWeight);
|
|
}
|
|
`,Qhe=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
layout(location = 14) in vec3 a_uvs;
|
|
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor;
|
|
float u_topsurface;
|
|
float u_sidesurface;
|
|
float u_heightfixed; // 默认不固定
|
|
float u_raisingHeight;
|
|
};
|
|
|
|
out vec4 v_Color;
|
|
out vec3 v_uvs;
|
|
out vec2 v_texture_data;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
|
|
v_uvs = a_uvs;
|
|
// cal style mapping - 数据纹理映射部分的计算
|
|
vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);
|
|
vec4 project_pos = project_position(pos);
|
|
|
|
if(u_heightfixed > 0.0) { // 判断几何体是否固定高度
|
|
project_pos.z = a_Position.z * a_Size;
|
|
project_pos.z += u_raisingHeight;
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
project_pos.z *= mapboxZoomScale;
|
|
project_pos.z += u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
float lightWeight = calc_lighting(pos);
|
|
v_texture_data = vec2(a_Position.z,lightWeight);
|
|
|
|
v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,Jhe=function(e){_n(r,e);var t=Ghe(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getUninforms",value:function(){var i=this.getCommonUniformsInfo(),o=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),Qe(Qe({},i.uniformsOption),o.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.mapTexture,a=i.heightfixed,u=a===void 0?!1:a,c=i.raisingHeight,f=c===void 0?0:c,m=i.topsurface,_=m===void 0?!0:m,b=i.sidesurface,A=b===void 0?!0:b,w=i.sourceColor,R=i.targetColor,P=0,k=[1,1,1,1],L=[1,1,1,1];w&&R&&(k=Ta(w),L=Ta(R),P=1);var B={u_sourceColor:k,u_targetColor:L,u_linearColor:P,u_topsurface:Number(_),u_sidesurface:Number(A),u_heightfixed:Number(u),u_raisingHeight:Number(f)};o&&this.texture&&(B.u_texture=this.texture,this.textures=[this.texture]);var V=this.getUniformsBufferInfo(B);return V}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.loadTexture();case 2:return u.abrupt("return",this.buildModels());case 3:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f,m;return he.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return a=this.getShaders(),u=a.frag,c=a.vert,f=a.type,this.initUniformsBuffer(),b.next=4,this.layer.buildLayerModel({moduleName:f,vertexShader:c,fragmentShader:u,depth:{enable:!0},inject:this.getInject(),triangulation:FP});case 4:return m=b.sent,b.abrupt("return",[m]);case 6:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(){var i=this.layer.getLayerConfig(),o=i.pickLight,a=i.mapTexture;return a?{frag:Zhe,vert:qhe,type:"polygonExtrudeTexture"}:o?{frag:Khe,vert:Qhe,type:"polygonExtrudePickLight"}:{frag:Xhe,vert:Yhe,type:"polygonExtrude"}}},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.textures=[]}},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getSource().extent,o=i,a=this.layer.coordCenter||this.layer.getSource().center,u=o[2]-o[0],c=o[3]-o[1];if(this.mapService.version==="GAODE2.x"){var f=this.mapService.coordToAMap2RelativeCoordinates([i[0],i[1]],a),m=Nn(f,2),_=m[0],b=m[1],A=this.mapService.coordToAMap2RelativeCoordinates([i[2],i[3]],a),w=Nn(A,2),R=w[0],P=w[1];u=R-_,c=P-b,o=[_,b,R,P]}this.styleAttributeService.registerStyleAttribute({name:"uvs",type:wn.Attribute,descriptor:{name:"a_uvs",shaderLocation:Vn.UV,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(L,B,V){var G=V[0],K=V[1];return[(G-o[0])/u,(K-o[1])/c,V[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:wn.Attribute,descriptor:{name:"a_Normal",shaderLocation:Vn.NORMAL,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(L,B,V,G,K){return K}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(L){var B=L.size,V=B===void 0?10:B;return Array.isArray(V)?[V[0]]:[V]}}})}},{key:"loadTexture",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(a=this.layer.getLayerConfig(),u=a.mapTexture,c=this.rendererService.createTexture2D,this.texture=c({height:1,width:1}),!u){_.next=8;break}return _.next=6,Hhe(u);case 6:f=_.sent,this.texture=c({data:f,width:f.width,height:f.height,wrapS:W.CLAMP_TO_EDGE,wrapT:W.CLAMP_TO_EDGE,min:W.LINEAR,mag:W.LINEAR});case 8:case"end":return _.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()}]),r}(Ba);function epe(e){var t=tpe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function tpe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var rpe=`
|
|
in vec4 v_Color;
|
|
#pragma include "scene_uniforms"
|
|
#pragma include "picking"
|
|
out vec4 outputColor;
|
|
void main() {
|
|
|
|
outputColor = v_Color;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,npe=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
|
|
out vec4 v_Color;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size + (1.0 - a_Position.z) * extrusionBase, 1.0);
|
|
|
|
vec4 project_pos = project_position(pos);
|
|
float lightWeight = calc_lighting(project_pos);
|
|
v_Color = a_Color;
|
|
v_Color = vec4(v_Color.rgb * lightWeight, v_Color.w * opacity);
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,ipe=function(e){_n(r,e);var t=epe(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getUninforms",value:function(){var i=this.getCommonUniformsInfo(),o=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),Qe(Qe({},i.uniformsOption),o.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i={},o=this.getUniformsBufferInfo(i);return o}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.buildModels());case 1:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f,m;return he.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return a=this.getShaders(),u=a.frag,c=a.vert,f=a.type,this.initUniformsBuffer(),b.next=4,this.layer.buildLayerModel({moduleName:f,vertexShader:c,fragmentShader:u,inject:this.getInject(),triangulation:FP,depth:{enable:!0}});case 4:return m=b.sent,b.abrupt("return",[m]);case 6:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(){return{frag:rpe,vert:npe,type:"polygonExtrude"}}},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"normal",type:wn.Attribute,descriptor:{name:"a_Normal",shaderLocation:Vn.NORMAL,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(o,a,u,c,f){return f}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:wn.Attribute,descriptor:{name:"a_Size",shaderLocation:Vn.SIZE,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(o){var a=o.size,u=a===void 0?10:a;return Array.isArray(u)?[u[0]]:[u]}}})}}]),r}(Ba);function ape(e){var t=ope();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function ope(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var spe=`in vec4 v_color;
|
|
#pragma include "scene_uniforms"
|
|
#pragma include "picking"
|
|
out vec4 outputColor;
|
|
void main() {
|
|
outputColor = v_color;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,upe=`
|
|
layout(std140) uniform commonUniforms {
|
|
float u_raisingHeight;
|
|
float u_opacitylinear;
|
|
float u_dir;
|
|
};
|
|
|
|
in vec4 v_color;
|
|
in vec3 v_linear;
|
|
in vec2 v_pos;
|
|
out vec4 outputColor;
|
|
#pragma include "scene_uniforms"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
outputColor = v_color;
|
|
if (u_opacitylinear > 0.0) {
|
|
outputColor.a *= u_dir == 1.0 ? 1.0 - length(v_pos - v_linear.xy)/v_linear.z : length(v_pos - v_linear.xy)/v_linear.z;
|
|
}
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,lpe=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 15) in vec3 a_linear;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
float u_raisingHeight;
|
|
float u_opacitylinear;
|
|
float u_dir;
|
|
};
|
|
|
|
out vec4 v_color;
|
|
out vec3 v_linear;
|
|
out vec2 v_pos;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
if (u_opacitylinear > 0.0) {
|
|
v_linear = a_linear;
|
|
v_pos = a_Position.xy;
|
|
}
|
|
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
project_pos.z += u_raisingHeight;
|
|
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
project_pos.z *= mapboxZoomScale;
|
|
project_pos.z += u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
setPickingColor(a_PickingColor);
|
|
}`,cpe=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
float u_raisingHeight;
|
|
};
|
|
|
|
|
|
out vec4 v_color;
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
// cal style mapping - 数据纹理映射部分的计算
|
|
|
|
// cal style mapping - 数据纹理映射部分的计算
|
|
|
|
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
|
|
|
|
project_pos.z += u_raisingHeight;
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
project_pos.z *= mapboxZoomScale;
|
|
project_pos.z += u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
|
|
`,fpe=function(e){_n(r,e);var t=ape(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getUninforms",value:function(){var i=this.getCommonUniformsInfo(),o=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),Qe(Qe({},i.uniformsOption),o.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.raisingHeight,a=o===void 0?0:o,u=i.opacityLinear,c=u===void 0?{enable:!1,dir:"in"}:u,f={u_raisingHeight:Number(a),u_opacitylinear:Number(c.enable),u_dir:c.dir==="in"?1:0},m=this.getUniformsBufferInfo(f);return m}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.buildModels());case 1:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f,m,_;return he.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return a=this.getModelParams(),u=a.frag,c=a.vert,f=a.triangulation,m=a.type,this.initUniformsBuffer(),this.layer.triangulation=f,A.next=5,this.layer.buildLayerModel({moduleName:m,vertexShader:c,fragmentShader:u,inject:this.getInject(),triangulation:f,primitive:W.TRIANGLES,depth:{enable:!1}});case 5:return _=A.sent,A.abrupt("return",[_]);case 7:case"end":return A.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getLayerConfig(),o=i.opacityLinear,a=o===void 0?{enable:!1,dir:"in"}:o;a.enable&&this.styleAttributeService.registerStyleAttribute({name:"linear",type:wn.Attribute,descriptor:{name:"a_linear",shaderLocation:Vn.LINEAR,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:3,update:function(c,f,m){return[m[3],m[4],m[5]]}}})}},{key:"getModelParams",value:function(){var i=this.layer.getLayerConfig(),o=i.opacityLinear,a=o===void 0?{enable:!1}:o;return a.enable?{frag:upe,vert:lpe,type:"polygonLinear",triangulation:Ice}:{frag:spe,vert:cpe,type:"polygonFill",triangulation:BM}}}]),r}(Ba);function hpe(e){var t=ppe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function ppe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var dpe=`
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_watercolor;
|
|
vec4 u_watercolor2;
|
|
float u_time;
|
|
};
|
|
|
|
in vec2 v_uv;
|
|
in float v_opacity;
|
|
out vec4 outputColor;
|
|
|
|
float coast2water_fadedepth = 0.10;
|
|
float large_waveheight = .750; // change to adjust the "heavy" waves
|
|
float large_wavesize = 3.4; // factor to adjust the large wave size
|
|
float small_waveheight = 0.6; // change to adjust the small random waves
|
|
float small_wavesize = 0.5; // factor to ajust the small wave size
|
|
float water_softlight_fact = 15.; // range [1..200] (should be << smaller than glossy-fact)
|
|
float water_glossylight_fact= 120.; // range [1..200]
|
|
float particle_amount = 70.;
|
|
|
|
vec3 water_specularcolor = vec3(1.3, 1.3, 0.9); // specular Color (RGB) of the water-highlights
|
|
#define light vec3(-0., sin(u_time*0.5)*.5 + .35, 2.8) // position of the sun
|
|
|
|
uniform sampler2D u_texture1;
|
|
uniform sampler2D u_texture2;
|
|
uniform sampler2D u_texture3;
|
|
|
|
|
|
|
|
float hash( float n ) {
|
|
return fract(sin(n)*43758.5453123);
|
|
}
|
|
|
|
// 2d noise function
|
|
float noise1( in vec2 x ) {
|
|
vec2 p = floor(x);
|
|
vec2 f = smoothstep(0.0, 1.0, fract(x));
|
|
float n = p.x + p.y*57.0;
|
|
return mix(mix( hash(n+ 0.0), hash(n+ 1.0),f.x),
|
|
mix( hash(n+ 57.0), hash(n+ 58.0),f.x),f.y);
|
|
}
|
|
|
|
float noise(vec2 p) {
|
|
return texture(SAMPLER_2D(u_texture2),p*vec2(1./256.)).x;
|
|
}
|
|
|
|
vec4 highness(vec2 p) {
|
|
vec4 t = texture(SAMPLER_2D(u_texture1),fract(p));
|
|
float clipped = -2.0-smoothstep(3.,10.,t.a)*6.9-smoothstep(10.,100.,t.a)*89.9-smoothstep(0.,10000.,t.a)*10000.0;
|
|
return clamp(t, 0.0,3.0)+clamp(t/3.0-1.0, 0.0,1.0)+clamp(t/16.0-1.0, 0.0,1.0);
|
|
}
|
|
|
|
float height_map( vec2 p ) {
|
|
vec4 height=highness(p);
|
|
/*
|
|
height = -0.5+
|
|
0.5*smoothstep(-100.,0.,-height)+
|
|
2.75*smoothstep(0.,2.,height)+
|
|
1.75*smoothstep(2.,4.,height)+
|
|
2.75*smoothstep(4.,16.,height)+
|
|
1.5*smoothstep(16.,1000.,height);
|
|
*/
|
|
|
|
mat2 m = mat2( 0.9563*1.4, -0.2924*1.4, 0.2924*1.4, 0.9563*1.4 );
|
|
//p = p*6.;
|
|
float f = 0.6000*noise1( p ); p = m*p*1.1*6.;
|
|
f += 0.2500*noise( p ); p = m*p*1.32;
|
|
f += 0.1666*noise( p ); p = m*p*1.11;
|
|
f += 0.0834*noise( p ); p = m*p*1.12;
|
|
f += 0.0634*noise( p ); p = m*p*1.13;
|
|
f += 0.0444*noise( p ); p = m*p*1.14;
|
|
f += 0.0274*noise( p ); p = m*p*1.15;
|
|
f += 0.0134*noise( p ); p = m*p*1.16;
|
|
f += 0.0104*noise( p ); p = m*p*1.17;
|
|
f += 0.0084*noise( p );
|
|
f = .25*f+dot(height,vec4(-.03125,-.125,.25,.25))*.5;
|
|
const float FLAT_LEVEL = 0.92525;
|
|
//f = f*0.25+height*0.75;
|
|
if (f<FLAT_LEVEL)
|
|
f = f;
|
|
else
|
|
f = pow((f-FLAT_LEVEL)/(1.-FLAT_LEVEL), 2.)*(1.-FLAT_LEVEL)*2.0+FLAT_LEVEL; // makes a smooth coast-increase
|
|
return clamp(f, 0., 10.);
|
|
}
|
|
|
|
vec3 plasma_quintic( float x ) {
|
|
x = clamp( x, 0.0, 1.0);
|
|
vec4 x1 = vec4( 1.0, x, x * x, x * x * x ); // 1 x x2 x3
|
|
vec4 x2 = x1 * x1.w * x; // x4 x5 x6 x7
|
|
return vec3(
|
|
dot( x1.xyzw, vec4( +0.063861086, +1.992659096, -1.023901152, -0.490832805 ) ) + dot( x2.xy, vec2( +1.308442123, -0.914547012 ) ),
|
|
dot( x1.xyzw, vec4( +0.049718590, -0.791144343, +2.892305078, +0.811726816 ) ) + dot( x2.xy, vec2( -4.686502417, +2.717794514 ) ),
|
|
dot( x1.xyzw, vec4( +0.513275779, +1.580255060, -5.164414457, +4.559573646 ) ) + dot( x2.xy, vec2( -1.916810682, +0.570638854 ) ) );
|
|
}
|
|
|
|
vec4 color(vec2 p){
|
|
vec4 c1 = vec4(1.7,1.6,.9,1);
|
|
vec4 c2 = vec4(.2,.94,.1,1);
|
|
vec4 c3 = vec4(.3,.2,.0,1);
|
|
vec4 c4 = vec4(.99,.99,1.6,1);
|
|
vec4 v = highness(p);
|
|
float los = smoothstep(0.1,1.1,v.b);
|
|
float his = smoothstep(3.5,6.5,v.b);
|
|
float ces = smoothstep(1.,5.,v.a);
|
|
vec4 lo = mix(c1,c2,los);
|
|
vec4 hi = mix(c3,c4,his);
|
|
vec4 ce = mix(lo,hi,ces);
|
|
|
|
return vec4(plasma_quintic(ces),1).ragb;
|
|
}
|
|
|
|
vec3 terrain_map( vec2 p )
|
|
{
|
|
return color(p).rgb*0.75+0.25*vec3(0.7, .55, .4)+texture(SAMPLER_2D(u_texture3), fract(p*5.)).rgb*.5; // test-terrain is simply 'sandstone'
|
|
}
|
|
|
|
const mat2 m = mat2( 0.72, -1.60, 1.60, 0.72 );
|
|
|
|
float water_map( vec2 p, float height ) {
|
|
vec2 p2 = p*large_wavesize;
|
|
vec2 shift1 = 0.001*vec2( u_time*160.0*2.0, u_time*120.0*2.0 );
|
|
vec2 shift2 = 0.001*vec2( u_time*190.0*2.0, -u_time*130.0*2.0 );
|
|
|
|
// coarse crossing 'ocean' waves...
|
|
float f = 0.6000*noise( p );
|
|
f += 0.2500*noise( p*m );
|
|
f += 0.1666*noise( p*m*m );
|
|
float wave = sin(p2.x*0.622+p2.y*0.622+shift2.x*4.269)*large_waveheight*f*height*height ;
|
|
|
|
p *= small_wavesize;
|
|
f = 0.;
|
|
float amp = 1.0, s = .5;
|
|
for (int i=0; i<9; i++)
|
|
{ p = m*p*.947; f -= amp*abs(sin((noise( p+shift1*s )-.5)*2.)); amp = amp*.59; s*=-1.329; }
|
|
|
|
return wave+f*small_waveheight;
|
|
}
|
|
|
|
float nautic(vec2 p) {
|
|
p *= 18.;
|
|
float f = 0.;
|
|
float amp = 1.0, s = .5;
|
|
for (int i=0; i<3; i++)
|
|
{ p = m*p*1.2; f += amp*abs(smoothstep(0., 1., noise( p+u_time*s ))-.5); amp = amp*.5; s*=-1.227; }
|
|
return pow(1.-f, 5.);
|
|
}
|
|
|
|
float particles(vec2 p) {
|
|
p *= 200.;
|
|
float f = 0.;
|
|
float amp = 1.0, s = 1.5;
|
|
for (int i=0; i<3; i++)
|
|
{ p = m*p*1.2; f += amp*noise( p+u_time*s ); amp = amp*.5; s*=-1.227; }
|
|
return pow(f*.35, 7.)*particle_amount;
|
|
}
|
|
|
|
float test_shadow( vec2 xy, float height) {
|
|
vec3 r0 = vec3(xy, height);
|
|
vec3 rd = normalize( light - r0 );
|
|
|
|
float hit = 1.0;
|
|
float t = 0.001;
|
|
for (int j=1; j<25; j++)
|
|
{
|
|
vec3 p = r0 + t*rd;
|
|
float h = height_map( p.xy );
|
|
float height_diff = p.z - h;
|
|
if (height_diff<0.0)
|
|
{
|
|
return 0.0;
|
|
}
|
|
t += 0.01+height_diff*.02;
|
|
hit = min(hit, 2.*height_diff/t); // soft shaddow
|
|
}
|
|
return hit;
|
|
}
|
|
|
|
vec3 CalcTerrain(vec2 uv, float height) {
|
|
vec3 col = terrain_map( uv );
|
|
vec2 iResolution = vec2(512.);
|
|
float h1 = height_map(uv-vec2(0., 0.5)/ iResolution.xy);
|
|
float h2 = height_map(uv+vec2(0., 0.5)/ iResolution.xy);
|
|
float h3 = height_map(uv-vec2(0.5, 0.)/ iResolution.xy);
|
|
float h4 = height_map(uv+vec2(0.5, 0.)/ iResolution.xy);
|
|
vec3 norm = normalize(vec3(h3-h4, h1-h2, 1.));
|
|
vec3 r0 = vec3(uv, height);
|
|
vec3 rd = normalize( light - r0 );
|
|
float grad = dot(norm, rd);
|
|
col *= grad+pow(grad, 8.);
|
|
float terrainshade = test_shadow( uv, height );
|
|
col = mix(col*.25, col, terrainshade);
|
|
return col;
|
|
}
|
|
|
|
|
|
void main() {
|
|
vec3 watercolor = u_watercolor.rgb;
|
|
vec3 watercolor2 = u_watercolor2.rgb;
|
|
vec2 uv = v_uv;
|
|
float WATER_LEVEL = 0.84; // Water level (range: 0.0 - 2.0)
|
|
float deepwater_fadedepth = 0.4 + coast2water_fadedepth;
|
|
float height = height_map( uv );
|
|
vec3 col;
|
|
|
|
float waveheight = clamp(WATER_LEVEL*3.-1.5, 0., 1.);
|
|
float level = WATER_LEVEL + .2*water_map(uv*15. + vec2(u_time*.1), waveheight);
|
|
if (height > level)
|
|
{
|
|
col = CalcTerrain(uv, height);
|
|
}
|
|
if (height <= level)
|
|
{
|
|
vec2 dif = vec2(.0, .01);
|
|
vec2 pos = uv*15. + vec2(u_time*.01);
|
|
float h1 = water_map(pos-dif,waveheight);
|
|
float h2 = water_map(pos+dif,waveheight);
|
|
float h3 = water_map(pos-dif.yx,waveheight);
|
|
float h4 = water_map(pos+dif.yx,waveheight);
|
|
vec3 normwater = normalize(vec3(h3-h4, h1-h2, .125)); // norm-vector of the 'bumpy' water-plane
|
|
uv += normwater.xy*.002*(level-height);
|
|
|
|
col = CalcTerrain(uv, height);
|
|
|
|
float coastfade = clamp((level-height)/coast2water_fadedepth, 0., 1.);
|
|
float coastfade2= clamp((level-height)/deepwater_fadedepth, 0., 1.);
|
|
float intensity = col.r*.2126+col.g*.7152+col.b*.0722;
|
|
watercolor = mix(watercolor*intensity, watercolor2, smoothstep(0., 1., coastfade2));
|
|
|
|
vec3 r0 = vec3(uv, WATER_LEVEL);
|
|
vec3 rd = normalize( light - r0 ); // ray-direction to the light from water-position
|
|
float grad = dot(normwater, rd); // dot-product of norm-vector and light-direction
|
|
float specular = pow(grad, water_softlight_fact); // used for soft highlights
|
|
float specular2= pow(grad, water_glossylight_fact); // used for glossy highlights
|
|
float gradpos = dot(vec3(0., 0., 1.), rd);
|
|
float specular1= smoothstep(0., 1., pow(gradpos, 5.)); // used for diffusity (some darker corona around light's specular reflections...)
|
|
float watershade = test_shadow( uv, level );
|
|
watercolor *= 2.2+watershade;
|
|
watercolor += (.2+.8*watershade) * ((grad-1.0)*.5+specular) * .25;
|
|
watercolor /= (1.+specular1*1.25);
|
|
watercolor += watershade*specular2*water_specularcolor;
|
|
watercolor += watershade*coastfade*(1.-coastfade2)*(vec3(.5, .6, .7)*nautic(uv)+vec3(1., 1., 1.)*particles(uv));
|
|
|
|
col = mix(col, watercolor, coastfade);
|
|
}
|
|
|
|
outputColor = vec4(col, v_opacity);
|
|
}
|
|
`,vpe=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 14) in vec2 a_uv;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_watercolor;
|
|
vec4 u_watercolor2;
|
|
float u_time;
|
|
};
|
|
|
|
|
|
out vec2 v_uv;
|
|
out float v_opacity;
|
|
|
|
#pragma include "projection"
|
|
|
|
void main() {
|
|
v_uv = a_uv;
|
|
v_opacity = opacity;
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
}
|
|
|
|
`;Ci.isNumber;var mpe=function(e){_n(r,e);var t=hpe(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getUninforms",value:function(){var i=this.getCommonUniformsInfo(),o=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),Qe(Qe({},i.uniformsOption),o.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.watercolor,a=o===void 0?"#6D99A8":o,u=i.watercolor2,c=u===void 0?"#0F121C":u,f={u_watercolor:Ta(a),u_watercolor2:Ta(c),u_time:this.layer.getLayerAnimateTime(),u_texture1:this.texture1,u_texture2:this.texture2,u_texture3:this.texture3};this.textures=[this.texture1,this.texture2,this.texture3];var m=this.getUniformsBufferInfo(f);return m}},{key:"getAnimateUniforms",value:function(){return{u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.loadTexture(),u.abrupt("return",this.buildModels());case 2:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.initUniformsBuffer(),c.next=3,this.layer.buildLayerModel({moduleName:"polygonOcean",vertexShader:vpe,fragmentShader:dpe,inject:this.getInject(),triangulation:ab,primitive:W.TRIANGLES,depth:{enable:!1}});case 3:return a=c.sent,c.abrupt("return",[a]);case 5:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i,o,a;(i=this.texture1)===null||i===void 0||i.destroy(),(o=this.texture2)===null||o===void 0||o.destroy(),(a=this.texture3)===null||a===void 0||a.destroy()}},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getSource().extent,o=Nn(i,4),a=o[0],u=o[1],c=o[2],f=o[3],m=c-a,_=f-u;this.styleAttributeService.registerStyleAttribute({name:"oceanUv",type:wn.Attribute,descriptor:{name:"a_uv",shaderLocation:Vn.UV,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(A,w,R,P){var k=A.version==="GAODE2.x"?A.originCoordinates[0][P]:R,L=Nn(k,2),B=L[0],V=L[1];return[(B-a)/m,(V-u)/_]}}})}},{key:"loadTexture",value:function(){var i=this,o=this.rendererService.createTexture2D,a={height:0,width:0};this.texture1=o(a),this.texture2=o(a),this.texture3=o(a),u(function(f){i.texture1=c(f[0]),i.texture2=c(f[1]),i.texture3=c(f[2]),i.layerService.reRender()});function u(f){var m=0,_=[],b=["https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ","https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*MJ22QbpuCzIAAAAAAAAAAAAAARQnAQ","https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*-z2HSIVDsHIAAAAAAAAAAAAAARQnAQ"];b.map(function(A){var w=new Image;w.crossOrigin="",w.src=A,_.push(w),w.onload=function(){m++,m===3&&f(_)}})}function c(f){return o({data:f,width:f.width,height:f.height,wrapS:W.MIRRORED_REPEAT,wrapT:W.MIRRORED_REPEAT,min:W.LINEAR,mag:W.LINEAR})}}}]),r}(Ba);function gpe(e){var t=_pe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function _pe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ype=`uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniforms {
|
|
float u_speed;
|
|
float u_time;
|
|
};
|
|
|
|
out vec4 outputColor;
|
|
|
|
|
|
in vec4 v_Color;
|
|
in vec2 v_uv;
|
|
|
|
float rand(vec2 n) { return 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453); }
|
|
|
|
float water(vec3 p) {
|
|
float t = u_time * u_speed;
|
|
p.z += t * 2.; p.x += t * 2.;
|
|
vec3 c1 = texture(SAMPLER_2D(u_texture), p.xz / 30.).xyz;
|
|
p.z += t * 3.; p.x += t * 0.52;
|
|
vec3 c2 = texture(SAMPLER_2D(u_texture), p.xz / 30.).xyz;
|
|
p.z += t * 4.; p.x += t * 0.8;
|
|
vec3 c3 = texture(SAMPLER_2D(u_texture), p.xz / 30.).xyz;
|
|
c1 += c2 - c3;
|
|
float z = (c1.x + c1.y + c1.z) / 3.;
|
|
return p.y + z / 4.;
|
|
}
|
|
|
|
float map(vec3 p) {
|
|
float d = 100.0;
|
|
d = water(p);
|
|
return d;
|
|
}
|
|
|
|
float intersect(vec3 ro, vec3 rd) {
|
|
float d = 0.0;
|
|
for (int i = 0; i <= 100; i++) {
|
|
float h = map(ro + rd * d);
|
|
if (h < 0.1) return d;
|
|
d += h;
|
|
}
|
|
return 0.0;
|
|
}
|
|
|
|
vec3 norm(vec3 p) {
|
|
float eps = .1;
|
|
return normalize(vec3(
|
|
map(p + vec3(eps, 0, 0)) - map(p + vec3(-eps, 0, 0)),
|
|
map(p + vec3(0, eps, 0)) - map(p + vec3(0, -eps, 0)),
|
|
map(p + vec3(0, 0, eps)) - map(p + vec3(0, 0, -eps))
|
|
));
|
|
}
|
|
|
|
float calSpc() {
|
|
vec3 l1 = normalize(vec3(1, 1, 1));
|
|
vec3 ro = vec3(-3, 20, -8);
|
|
vec3 rc = vec3(0, 0, 0);
|
|
vec3 ww = normalize(rc - ro);
|
|
vec3 uu = normalize(cross(vec3(0,1,0), ww));
|
|
vec3 vv = normalize(cross(rc - ro, uu));
|
|
vec3 rd = normalize(uu * v_uv.x + vv * v_uv.y + ww);
|
|
float d = intersect(ro, rd);
|
|
vec3 p = ro + rd * d;
|
|
vec3 n = norm(p);
|
|
float spc = pow(max(0.0, dot(reflect(l1, n), rd)), 30.0);
|
|
return spc;
|
|
}
|
|
|
|
void main() {
|
|
|
|
outputColor = v_Color;
|
|
float spc = calSpc();
|
|
outputColor += spc * 0.4;
|
|
}
|
|
`,xpe=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 14) in vec2 a_uv;
|
|
layout(std140) uniform commonUniforms {
|
|
float u_speed;
|
|
float u_time;
|
|
};
|
|
out vec4 v_Color;
|
|
out vec2 v_uv;
|
|
|
|
|
|
#pragma include "projection"
|
|
|
|
void main() {
|
|
v_uv = a_uv;
|
|
v_Color = a_Color;
|
|
v_Color.a *= opacity;
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
}
|
|
|
|
`;Ci.isNumber;var bpe=function(e){_n(r,e);var t=gpe(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getUninforms",value:function(){var i=this.getCommonUniformsInfo(),o=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),Qe(Qe({},i.uniformsOption),o.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.speed,a=o===void 0?.5:o,u={u_speed:a,u_time:this.layer.getLayerAnimateTime(),u_texture:this.texture};this.textures=[this.texture];var c=this.getUniformsBufferInfo(u);return c}},{key:"getAnimateUniforms",value:function(){return{u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.loadTexture(),u.abrupt("return",this.buildModels());case 2:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.initUniformsBuffer(),c.next=3,this.layer.buildLayerModel({moduleName:"polygonWater",vertexShader:xpe,fragmentShader:ype,triangulation:ab,inject:this.getInject(),primitive:W.TRIANGLES,depth:{enable:!1},pickingEnabled:!1,diagnosticDerivativeUniformityEnabled:!1});case 3:return a=c.sent,c.abrupt("return",[a]);case 5:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getSource().extent,o=Nn(i,4),a=o[0],u=o[1],c=o[2],f=o[3],m=c-a,_=f-u;this.styleAttributeService.registerStyleAttribute({name:"waterUv",type:wn.Attribute,descriptor:{name:"a_uv",shaderLocation:Vn.UV,buffer:{usage:W.STATIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(A,w,R,P){var k=A.version==="GAODE2.x"?A.originCoordinates[0][P]:R,L=Nn(k,2),B=L[0],V=L[1];return[(B-a)/m,(V-u)/_]}}})}},{key:"loadTexture",value:function(){var i=this,o=this.layer.getLayerConfig(),a=o.waterTexture,u=this.rendererService.createTexture2D;this.texture=u({height:1,width:1});var c=new Image;c.crossOrigin="",a?(console.warn("L7 recommend:https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ"),c.src=a):c.src="https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ",c.onload=function(){i.texture=u({data:c,width:c.width,height:c.height,wrapS:W.MIRRORED_REPEAT,wrapT:W.MIRRORED_REPEAT,min:W.LINEAR,mag:W.LINEAR}),i.layerService.reRender()}}}]),r}(Ba),Epe={fill:fpe,line:BP,extrude:Jhe,text:GP,point_fill:NP,point_image:UP,point_normal:zP,point_extrude:LP,water:bpe,ocean:mpe,extrusion:ipe};function Spe(e){var t=Ape();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Ape(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var s_=function(e){_n(r,e);var t=Spe(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"type","PolygonLayer"),F($e(n),"enableShaderEncodeStyles",["opacity","extrusionBase","rotation","offsets","stroke"]),n}return jt(r,[{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return a=this.getModelType(),this.layerModel=new Epe[a](this),c.next=4,this.initLayerModels();case 4:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getModelType",value:function(){var i,o=this.styleAttributeService.getLayerStyleAttribute("shape"),a=o==null||(i=o.scale)===null||i===void 0?void 0:i.field;return a==="fill"||!a?"fill":a==="extrude"?"extrude":a==="extrusion"?"extrusion":a==="water"?"water":a==="ocean"?"ocean":a==="line"?"line":this.getPointModelType()}},{key:"getPointModelType",value:function(){var i=this.getEncodedData(),o=this.getLayerConfig(),a=o.shape2d,u=o.shape3d,c=this.iconService.getIconMap(),f=i.find(function(_){return _.hasOwnProperty("shape")});if(f){var m=f.shape;return m==="dot"?"point_normal":(a==null?void 0:a.indexOf(m))!==-1?"point_fill":(u==null?void 0:u.indexOf(m))!==-1?"point_extrude":c.hasOwnProperty(m)?"point_image":"text"}else return"fill"}}]),r}(P0);function Tpe(e){var t=wpe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function wpe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Cpe=`layout(std140) uniform commonUniforms {
|
|
vec2 u_domain;
|
|
float u_opacity;
|
|
float u_noDataValue;
|
|
float u_clampLow;
|
|
float u_clampHigh;
|
|
};
|
|
|
|
uniform sampler2D u_rasterTexture;
|
|
uniform sampler2D u_colorTexture;
|
|
|
|
in vec2 v_texCoord;
|
|
|
|
bool isnan_emu(float x) { return (x > 0.0 || x < 0.0) ? x != x : x != 0.0; }
|
|
|
|
out vec4 outputColor;
|
|
|
|
void main() {
|
|
// Can use any component here since u_rasterTexture is under luminance format.
|
|
float value = texture(SAMPLER_2D(u_rasterTexture), vec2(v_texCoord.x, v_texCoord.y)).r;
|
|
if (value == u_noDataValue || isnan_emu(value)) {
|
|
discard;
|
|
} else if ((u_clampLow < 0.5 && value < u_domain[0]) || (u_clampHigh < 0.5 && value > u_domain[1])) {
|
|
discard;
|
|
} else {
|
|
float normalisedValue =(value - u_domain[0]) / (u_domain[1] - u_domain[0]);
|
|
vec4 color = texture(SAMPLER_2D(u_colorTexture), vec2(normalisedValue, 0));
|
|
|
|
outputColor = color;
|
|
outputColor.a = outputColor.a * u_opacity ;
|
|
if (outputColor.a < 0.01)
|
|
discard;
|
|
}
|
|
}
|
|
`,Rpe=`
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 14) in vec2 a_Uv;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec2 u_domain;
|
|
float u_opacity;
|
|
float u_noDataValue;
|
|
float u_clampLow;
|
|
float u_clampHigh;
|
|
};
|
|
|
|
out vec2 v_texCoord;
|
|
|
|
#pragma include "projection"
|
|
|
|
void main() {
|
|
v_texCoord = a_Uv;
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
|
|
}
|
|
`,wT=function(e){_n(r,e);var t=Tpe(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getUninforms",value:function(){var i=this.getCommonUniformsInfo(),o=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),Qe(Qe({},i.uniformsOption),o.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,a=o===void 0?1:o,u=i.clampLow,c=u===void 0?!0:u,f=i.clampHigh,m=f===void 0?!0:f,_=i.noDataValue,b=_===void 0?-9999999:_,A=i.domain,w=i.rampColors,R=A||g5(w);this.colorTexture=this.layer.textureService.getColorTexture(w,R);var P={u_domain:R,u_opacity:a||1,u_noDataValue:b,u_clampLow:c?1:0,u_clampHigh:(typeof m<"u"?m:c)?1:0,u_rasterTexture:this.texture,u_colorTexture:this.colorTexture};this.textures=[this.texture,this.colorTexture];var k=this.getUniformsBufferInfo(P);return k}},{key:"getRasterData",value:function(){var n=Mt(he.mark(function o(a){var u,c,f,m;return he.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(!Array.isArray(a.data)){b.next=4;break}return b.abrupt("return",{data:a.data,width:a.width,height:a.height});case 4:return b.next=6,a.data;case 6:return u=b.sent,c=u.rasterData,f=u.width,m=u.height,b.abrupt("return",{data:Array.from(c),width:f,height:m});case 11:case"end":return b.stop()}},o)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.buildModels());case 1:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f,m,_,b,A,w,R;return he.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return this.initUniformsBuffer(),a=this.layer.getSource(),u=this.rendererService,c=u.createTexture2D,f=u.queryVerdorInfo,m=a.data.dataArray[0],k.next=6,this.getRasterData(m);case 6:return _=k.sent,b=_.data,A=_.width,w=_.height,this.texture=c({data:new Float32Array(b),width:A,height:w,format:f()==="WebGL1"?W.LUMINANCE:W.RED,type:W.FLOAT,alignment:1}),k.next=13,this.layer.buildLayerModel({moduleName:"rasterImageData",vertexShader:Rpe,fragmentShader:Cpe,triangulation:gy,primitive:W.TRIANGLES,depth:{enable:!1},pickingEnabled:!1});case 13:return R=k.sent,k.abrupt("return",[R]);case 15:case"end":return k.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i,o;(i=this.texture)===null||i===void 0||i.destroy(),(o=this.colorTexture)===null||o===void 0||o.destroy()}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:wn.Attribute,descriptor:{shaderLocation:Vn.UV,name:"a_Uv",buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(o,a,u){return[u[3],u[4]]}}})}}]),r}(Ba),Ipe=["data"],Mpe=["rasterData"];function Ppe(e){var t=Ope();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Ope(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var kpe=`uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniforms {
|
|
vec2 u_rminmax;
|
|
vec2 u_gminmax;
|
|
vec2 u_bminmax;
|
|
float u_opacity;
|
|
float u_noDataValue;
|
|
};
|
|
|
|
in vec2 v_texCoord;
|
|
|
|
out vec4 outputColor;
|
|
|
|
void main() {
|
|
|
|
vec3 rgb = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y)).rgb;
|
|
|
|
if(rgb == vec3(u_noDataValue)) {
|
|
outputColor = vec4(0.0, 0, 0, 0.0);
|
|
} else {
|
|
outputColor = vec4(rgb.r / (u_rminmax.y -u_rminmax.x), rgb.g /(u_gminmax.y -u_gminmax.x), rgb.b/ (u_bminmax.y - u_bminmax.x), u_opacity);
|
|
}
|
|
|
|
if(outputColor.a < 0.01)
|
|
discard;
|
|
|
|
}`,Dpe=`
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 14) in vec2 a_Uv;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec2 u_rminmax;
|
|
vec2 u_gminmax;
|
|
vec2 u_bminmax;
|
|
float u_opacity;
|
|
float u_noDataValue;
|
|
};
|
|
|
|
out vec2 v_texCoord;
|
|
|
|
#pragma include "projection"
|
|
|
|
void main() {
|
|
v_texCoord = a_Uv;
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
|
|
}
|
|
`,Fpe=function(e){_n(r,e);var t=Ppe(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"dataOption",{}),n}return jt(r,[{key:"getUninforms",value:function(){var i=this.getCommonUniformsInfo(),o=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),Qe(Qe({},i.uniformsOption),o.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,a=o===void 0?1:o,u=i.noDataValue,c=u===void 0?0:u,f=this.dataOption,m=f.rMinMax,_=m===void 0?[0,255]:m,b=f.gMinMax,A=b===void 0?[0,255]:b,w=f.bMinMax,R=w===void 0?[0,255]:w,P={u_rminmax:_,u_gminmax:A,u_bminmax:R,u_opacity:a||1,u_noDataValue:c,u_texture:this.texture};this.textures=[this.texture];var k=this.getUniformsBufferInfo(P);return k}},{key:"getRasterData",value:function(){var n=Mt(he.mark(function o(a){var u,c,f,m,_;return he.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(!Array.isArray(a.data)){A.next=4;break}return u=a.data,c=hl(a,Ipe),this.dataOption=c,A.abrupt("return",Qe({data:u},c));case 4:return A.next=6,a.data;case 6:if(f=A.sent,m=f.rasterData,_=hl(f,Mpe),this.dataOption=_,!Array.isArray(m)){A.next=14;break}return A.abrupt("return",Qe({data:m},_));case 14:return A.abrupt("return",Qe({data:Array.from(m)},_));case 15:case"end":return A.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f,m,_,b,A;return he.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return this.initUniformsBuffer(),a=this.layer.getSource(),u=this.rendererService.createTexture2D,c=a.data.dataArray[0],R.next=6,this.getRasterData(c);case 6:return f=R.sent,m=f.data,_=f.width,b=f.height,this.texture=u({data:new Float32Array(m),width:_,height:b,format:W.RGB,type:W.FLOAT}),R.next=13,this.layer.buildLayerModel({moduleName:"rasterImageDataRGBA",vertexShader:Dpe,fragmentShader:kpe,triangulation:gy,primitive:W.TRIANGLES,depth:{enable:!1},pickingEnabled:!1});case 13:return A=R.sent,R.abrupt("return",[A]);case 15:case"end":return R.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.initModels());case 1:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:wn.Attribute,descriptor:{name:"a_Uv",shaderLocation:Vn.UV,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(o,a,u){return[u[3],u[4]]}}})}}]),r}(Ba);function Bpe(e){var t=Lpe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Lpe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Npe=`uniform sampler2D u_texture;
|
|
uniform sampler2D u_colorTexture;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_unpack;
|
|
vec2 u_domain;
|
|
float u_opacity;
|
|
float u_noDataValue;
|
|
float u_clampLow;
|
|
float u_clampHigh;
|
|
};
|
|
|
|
in vec2 v_texCoord;
|
|
out vec4 outputColor;
|
|
|
|
|
|
float getElevation(vec2 coord, float bias) {
|
|
// Convert encoded elevation value to meters
|
|
vec4 data = texture(SAMPLER_2D(u_texture), coord,bias) * 255.0;
|
|
data.a = -1.0;
|
|
return dot(data, u_unpack);
|
|
}
|
|
|
|
vec4 getColor(float value) {
|
|
float normalisedValue =(value- u_domain[0]) / (u_domain[1] - u_domain[0]);
|
|
vec2 coord = vec2(normalisedValue, 0);
|
|
return texture(SAMPLER_2D(u_colorTexture), coord);
|
|
}
|
|
|
|
void main() {
|
|
float value = getElevation(v_texCoord,0.0);
|
|
if (value == u_noDataValue) {
|
|
outputColor = vec4(0.0, 0, 0, 0.0);
|
|
} else if ((u_clampLow < 0.5 && value < u_domain[0]) || (u_clampHigh < 0.5 && value > u_domain[1])) {
|
|
outputColor = vec4(0.0, 0, 0, 0.0);
|
|
} else {
|
|
|
|
outputColor = getColor(value);
|
|
outputColor.a = outputColor.a * u_opacity ;
|
|
if(outputColor.a < 0.01)
|
|
discard;
|
|
}
|
|
}
|
|
`,Upe=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 14) in vec2 a_Uv;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_unpack;
|
|
vec2 u_domain;
|
|
float u_opacity;
|
|
float u_noDataValue;
|
|
float u_clampLow;
|
|
float u_clampHigh;
|
|
};
|
|
out vec2 v_texCoord;
|
|
#pragma include "projection"
|
|
|
|
void main() {
|
|
v_texCoord = a_Uv;
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
|
|
}
|
|
`,zpe=function(e){_n(r,e);var t=Bpe(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,a=i.clampLow,u=a===void 0?!0:a,c=i.clampHigh,f=c===void 0?!0:c,m=i.noDataValue,_=m===void 0?-9999999:m,b=i.domain,A=i.rampColors,w=i.colorTexture,R=i.rScaler,P=R===void 0?6553.6:R,k=i.gScaler,L=k===void 0?25.6:k,B=i.bScaler,V=B===void 0?.1:B,G=i.offset,K=G===void 0?1e4:G,Z=b||g5(A),ve=w;w?this.layer.textureService.setColorTexture(w,A,Z):ve=this.layer.textureService.getColorTexture(A,Z);var Ie={u_unpack:[P,L,V,K],u_domain:Z,u_opacity:o||1,u_noDataValue:_,u_clampLow:u,u_clampHigh:typeof f<"u"?f:u,u_texture:this.texture,u_colorTexture:ve};this.textures=[this.texture,ve];var de=this.getUniformsBufferInfo(Ie);return de}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return this.initUniformsBuffer(),a=this.layer.getSource(),u=this.rendererService.createTexture2D,_.next=5,a.data.images;case 5:return c=_.sent,this.texture=u({data:c[0],width:c[0].width,height:c[0].height,min:W.LINEAR,mag:W.LINEAR}),_.next=9,this.layer.buildLayerModel({moduleName:"RasterTileDataImage",vertexShader:Upe,fragmentShader:Npe,triangulation:gy,primitive:W.TRIANGLES,depth:{enable:!1}});case 9:return f=_.sent,_.abrupt("return",[f]);case 11:case"end":return _.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.initModels());case 1:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:wn.Attribute,descriptor:{name:"a_Uv",shaderLocation:Vn.UV,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:2,update:function(o,a,u){return[u[3],u[4]]}}})}}]),r}(Ba),$pe={raster:wT,rasterRgb:Fpe,raster3d:wT,rasterTerrainRgb:zpe};function Vpe(e){var t=jpe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function jpe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ub=function(e){_n(r,e);var t=Vpe(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"type","RasterLayer"),n}return jt(r,[{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return a=this.getModelType(),this.layerModel=new $pe[a](this),c.next=4,this.initLayerModels();case 4:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getDefaultConfig",value:function(){var i=this.getModelType(),o={raster:{},rasterRgb:{},raster3d:{},rasterTerrainRgb:{}};return o[i]}},{key:"getModelType",value:function(){var i=this.layerSource.getParserType();switch(i){case"raster":return"raster";case"rasterRgb":return"rasterRgb";case"rgb":return"rasterRgb";case"image":return"rasterTerrainRgb";default:return"raster"}}},{key:"getLegend",value:function(i){if(i!=="color")return{type:void 0,field:void 0,items:[]};var o=this.getLayerConfig().rampColors;return Oce(o,i)}}]),r}(P0);function Hpe(e){var t=Gpe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Gpe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Wpe=`layout(std140) uniform commonUniorm {
|
|
vec4 u_color;
|
|
float u_opacity;
|
|
};
|
|
|
|
out vec4 outputColor;
|
|
|
|
void main() {
|
|
outputColor = u_color;
|
|
outputColor.a *= u_opacity;
|
|
}
|
|
`,Xpe=`layout(location = 0) in vec3 a_Position;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_color;
|
|
float u_opacity;
|
|
};
|
|
|
|
#pragma include "projection"
|
|
|
|
void main() {
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));
|
|
} else {
|
|
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
|
|
}
|
|
}
|
|
|
|
`,Ype=function(e){_n(r,e);var t=Hpe(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getUninforms",value:function(){var i=this.getCommonUniformsInfo(),o=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),Qe(Qe({},i.uniformsOption),o.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,a=o===void 0?1:o,u=i.color,c=u===void 0?"#000":u,f={u_color:Ta(c),u_opacity:a||1},m=this.getUniformsBufferInfo(f);return m}},{key:"initModels",value:function(){var n=Mt(he.mark(function o(){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",this.buildModels());case 1:case"end":return u.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.initUniformsBuffer(),c.next=3,this.layer.buildLayerModel({moduleName:"mask",vertexShader:Xpe,fragmentShader:Wpe,triangulation:ab,depth:{enable:!1},pick:!1});case 3:return a=c.sent,c.abrupt("return",[a]);case 5:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;i&&this.layerService.clear()}},{key:"registerBuiltinAttributes",value:function(){return""}}]),r}(Ba),Zpe={fill:Ype};function qpe(e){var t=Kpe();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Kpe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var WP=function(e){_n(r,e);var t=qpe(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"type","MaskLayer"),n}return jt(r,[{key:"buildModels",value:function(){var n=Mt(he.mark(function o(){var a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return a=this.getModelType(),this.layerModel=new Zpe[a](this),c.next=4,this.initLayerModels();case 4:case"end":return c.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getModelType",value:function(){return"fill"}}]),r}(P0),CT,RT,IT,MT,rg,PT,OT,Qpe=Ci.cloneDeep,Jpe=(CT=ai(),RT=ki(wt.IMapService),IT=ki(wt.IFontService),CT(MT=(rg=function(){function e(){Ht(this,e),bi(this,"mapService",PT,this),bi(this,"fontService",OT,this)}return jt(e,[{key:"apply",value:function(r,n){var i=this,o=n.styleAttributeService;r.hooks.init.tapPromise("DataMappingPlugin",Mt(he.mark(function a(){return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:r.log(Ho.MappingStart,ps.INIT),i.generateMaping(r,{styleAttributeService:o}),r.log(Ho.MappingEnd,ps.INIT);case 3:case"end":return c.stop()}},a)}))),r.hooks.beforeRenderData.tapPromise("DataMappingPlugin",function(){var a=Mt(he.mark(function u(c){var f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(c){_.next=2;break}return _.abrupt("return",c);case 2:return r.dataState.dataMappingNeedUpdate=!1,r.log(Ho.MappingStart,ps.UPDATE),f=i.generateMaping(r,{styleAttributeService:o}),r.log(Ho.MappingEnd,ps.UPDATE),_.abrupt("return",f);case 7:case"end":return _.stop()}},u)}));return function(u){return a.apply(this,arguments)}}()),r.hooks.beforeRender.tap("DataMappingPlugin",function(){var a=r.getSource();if(!(r.layerModelNeedUpdate||!a||!a.inited)){var u=o.getLayerStyleAttributes()||[],c=o.getLayerStyleAttribute("filter"),f=a.data.dataArray;if(!(Array.isArray(f)&&f.length===0)){var m=u.filter(function(A){return A.needRemapping}),_=f;if(c!=null&&c.needRemapping&&c!==null&&c!==void 0&&c.scale&&(_=f.filter(function(A){return i.applyAttributeMapping(c,A)[0]})),m.length){var b=i.mapping(r,m,_,r.getEncodedData());r.setEncodedData(b)}}}})}},{key:"generateMaping",value:function(r,n){var i=this,o=n.styleAttributeService,a=o.getLayerStyleAttributes()||[],u=o.getLayerStyleAttribute("filter"),c=r.getSource().data.dataArray,f=c;u!=null&&u.scale&&(f=c.filter(function(_){return i.applyAttributeMapping(u,_)[0]})),f=r.processData(f);var m=this.mapping(r,a,f,void 0);return r.setEncodedData(m),r.emit("dataUpdate",null),!0}},{key:"mapping",value:function(r,n,i,o){var a=this,u=n.filter(function(f){return f.scale!==void 0}).filter(function(f){return f.name!=="filter"}),c=i.map(function(f,m){var _=o?o[m]:{},b=Qe({id:f._id,coordinates:f.coordinates},_);return u.forEach(function(A){var w=a.applyAttributeMapping(A,f);(A.name==="color"||A.name==="stroke")&&(w=w.map(function(R){return Ta(R)})),b[A.name]=Array.isArray(w)&&w.length===1?w[0]:w,A.name==="shape"&&(b.shape=a.fontService.getIconFontKey(b[A.name]))}),b});return n.forEach(function(f){f.needRemapping=!1}),this.adjustData2Amap2Coordinates(c,r),this.adjustData2SimpleCoordinates(c),c}},{key:"adjustData2Amap2Coordinates",value:function(r,n){var i=this;if(r.length>0&&this.mapService.version==="GAODE2.x"){var o=n.coordCenter||n.getSource().center;r.filter(function(a){return!a.originCoordinates}).map(function(a){a.version="GAODE2.x",a.originCoordinates=Qpe(a.coordinates),a.coordinates=i.mapService.coordToAMap2RelativeCoordinates(a.coordinates,o)})}}},{key:"adjustData2SimpleCoordinates",value:function(r){var n=this;r.length>0&&this.mapService.version==="SIMPLE"&&r.map(function(i){i.simpleCoordinate||(i.coordinates=n.unProjectCoordinates(i.coordinates),i.simpleCoordinate=!0)})}},{key:"unProjectCoordinates",value:function(r){var n=this;if(typeof r[0]=="number")return this.mapService.simpleMapCoord.unproject(r);if(r[0]&&r[0][0]instanceof Array){var i=[];return r.map(function(a){var u=[];a.map(function(c){u.push(n.mapService.simpleMapCoord.unproject(c))}),i.push(u)}),i}else{var o=[];return r.map(function(a){o.push(n.mapService.simpleMapCoord.unproject(a))}),o}}},{key:"applyAttributeMapping",value:function(r,n){var i;if(!r.scale)return[];var o=(r==null||(i=r.scale)===null||i===void 0?void 0:i.scalers)||[],a=[];o.forEach(function(c){var f,m=c.field;(n.hasOwnProperty(m)||((f=r.scale)===null||f===void 0?void 0:f.type)==="variable")&&a.push(n[m])});var u=r.mapping?r.mapping(a):[];return u}},{key:"getArrowPoints",value:function(r,n){var i=[n[0]-r[0],n[1]-r[1]],o=Iee(i),a=[r[0]+o[0]*1e-4,r[1]+o[1]*1e-4];return a}}]),e}(),PT=mi(rg.prototype,"mapService",[RT],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),OT=mi(rg.prototype,"fontService",[IT],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rg))||MT),kT,DT,e1e=(kT=ai(),kT(DT=function(){function e(){Ht(this,e)}return jt(e,[{key:"apply",value:function(r){var n=this;this.mapService=r.getContainer().get(wt.IMapService),r.hooks.init.tapPromise("DataSourcePlugin",Mt(he.mark(function i(){var o,a,u,c;return he.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(r.log(Ho.SourceInitStart,ps.INIT),o=r.getSource(),o||(a=r.sourceOption||r.defaultSourceConfig,u=a.data,c=a.options,o=new wP(u,c),r.setSource(o)),!o.inited){m.next=8;break}n.updateClusterData(r),r.log(Ho.SourceInitEnd,ps.INIT),m.next=10;break;case 8:return m.next=10,new Promise(function(_){o.on("update",function(b){b.type==="inited"&&(n.updateClusterData(r),r.log(Ho.SourceInitEnd,ps.INIT)),_(null)})});case 10:case"end":return m.stop()}},i)}))),r.hooks.beforeRenderData.tapPromise("DataSourcePlugin",Mt(he.mark(function i(){var o,a,u;return he.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return o=n.updateClusterData(r),a=r.dataState.dataSourceNeedUpdate,r.dataState.dataSourceNeedUpdate=!1,u=o||a,f.abrupt("return",u);case 5:case"end":return f.stop()}},i)})))}},{key:"updateClusterData",value:function(r){if(r.isTileLayer||r.tileLayer||!r.getSource())return!1;var n=r.getSource(),i=n.cluster,o=n.clusterOptions.zoom,a=o===void 0?0:o,u=this.mapService.getZoom()-1,c=r.dataState.dataSourceNeedUpdate;return i&&c&&n.updateClusterData(Math.floor(u)),i&&Math.abs(r.clusterZoom-u)>=1?(a!==Math.floor(u)&&n.updateClusterData(Math.floor(u)),r.clusterZoom=u,!0):!1}}]),e}())||DT);function lb(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function XP(e){return e.length===1&&(e=t1e(e)),{left:function(t,r,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var o=n+i>>>1;e(t[o],r)<0?n=o+1:i=o}return n},right:function(t,r,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var o=n+i>>>1;e(t[o],r)>0?i=o:n=o+1}return n}}}function t1e(e){return function(t,r){return lb(e(t),r)}}var r1e=XP(lb),_y=r1e.right;function n1e(e){return e===null?NaN:+e}function FT(e,t){var r=e.length,n=-1,i,o,a;if(t==null){for(;++n<r;)if((i=e[n])!=null&&i>=i)for(o=a=i;++n<r;)(i=e[n])!=null&&(o>i&&(o=i),a<i&&(a=i))}else for(;++n<r;)if((i=t(e[n],n,e))!=null&&i>=i)for(o=a=i;++n<r;)(i=t(e[n],n,e))!=null&&(o>i&&(o=i),a<i&&(a=i));return[o,a]}var Tx=Math.sqrt(50),Cx=Math.sqrt(10),Rx=Math.sqrt(2);function YP(e,t,r){var n,i=-1,o,a,u;if(t=+t,e=+e,r=+r,e===t&&r>0)return[e];if((n=t<e)&&(o=e,e=t,t=o),(u=Dg(e,t,r))===0||!isFinite(u))return[];if(u>0)for(e=Math.ceil(e/u),t=Math.floor(t/u),a=new Array(o=Math.ceil(t-e+1));++i<o;)a[i]=(e+i)*u;else for(e=Math.floor(e*u),t=Math.ceil(t*u),a=new Array(o=Math.ceil(e-t+1));++i<o;)a[i]=(e-i)/u;return n&&a.reverse(),a}function Dg(e,t,r){var n=(t-e)/Math.max(0,r),i=Math.floor(Math.log(n)/Math.LN10),o=n/Math.pow(10,i);return i>=0?(o>=Tx?10:o>=Cx?5:o>=Rx?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=Tx?10:o>=Cx?5:o>=Rx?2:1)}function Ix(e,t,r){var n=Math.abs(t-e)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),o=n/i;return o>=Tx?i*=10:o>=Cx?i*=5:o>=Rx&&(i*=2),t<e?-i:i}function i1e(e,t,r){if(r==null&&(r=n1e),!!(n=e.length)){if((t=+t)<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),a=+r(e[o],o,e),u=+r(e[o+1],o+1,e);return a+(u-a)*(i-o)}}function a1e(e,t,r,n,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*r+(1+3*e+3*o-3*a)*n+a*i)/6}function o1e(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],o=e[n+1],a=n>0?e[n-1]:2*i-o,u=n<t-1?e[n+2]:2*o-i;return a1e((r-n/t)*t,a,i,o,u)}}function cb(e){return function(){return e}}function s1e(e,t){return function(r){return e+r*t}}function u1e(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function l1e(e){return(e=+e)==1?ZP:function(t,r){return r-t?u1e(t,r,e):cb(isNaN(t)?r:t)}}function ZP(e,t){var r=t-e;return r?s1e(e,r):cb(isNaN(e)?t:e)}const BT=function e(t){var r=l1e(t);function n(i,o){var a=r((i=Zg(i)).r,(o=Zg(o)).r),u=r(i.g,o.g),c=r(i.b,o.b),f=ZP(i.opacity,o.opacity);return function(m){return i.r=a(m),i.g=u(m),i.b=c(m),i.opacity=f(m),i+""}}return n.gamma=e,n}(1);function c1e(e){return function(t){var r=t.length,n=new Array(r),i=new Array(r),o=new Array(r),a,u;for(a=0;a<r;++a)u=Zg(t[a]),n[a]=u.r||0,i[a]=u.g||0,o[a]=u.b||0;return n=e(n),i=e(i),o=e(o),u.opacity=1,function(c){return u.r=n(c),u.g=i(c),u.b=o(c),u+""}}}var f1e=c1e(o1e);function h1e(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;i<r;++i)n[i]=e[i]*(1-o)+t[i]*o;return n}}function p1e(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function d1e(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),o=new Array(r),a;for(a=0;a<n;++a)i[a]=fb(e[a],t[a]);for(;a<r;++a)o[a]=t[a];return function(u){for(a=0;a<n;++a)o[a]=i[a](u);return o}}function v1e(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function u_(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function m1e(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=fb(e[i],t[i]):n[i]=t[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var Mx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,t6=new RegExp(Mx.source,"g");function g1e(e){return function(){return e}}function _1e(e){return function(t){return e(t)+""}}function y1e(e,t){var r=Mx.lastIndex=t6.lastIndex=0,n,i,o,a=-1,u=[],c=[];for(e=e+"",t=t+"";(n=Mx.exec(e))&&(i=t6.exec(t));)(o=i.index)>r&&(o=t.slice(r,o),u[a]?u[a]+=o:u[++a]=o),(n=n[0])===(i=i[0])?u[a]?u[a]+=i:u[++a]=i:(u[++a]=null,c.push({i:a,x:u_(n,i)})),r=t6.lastIndex;return r<t.length&&(o=t.slice(r),u[a]?u[a]+=o:u[++a]=o),u.length<2?c[0]?_1e(c[0].x):g1e(t):(t=c.length,function(f){for(var m=0,_;m<t;++m)u[(_=c[m]).i]=_.x(f);return u.join("")})}function fb(e,t){var r=typeof t,n;return t==null||r==="boolean"?cb(t):(r==="number"?u_:r==="string"?(n=u0(t))?(t=n,BT):y1e:t instanceof u0?BT:t instanceof Date?v1e:p1e(t)?h1e:Array.isArray(t)?d1e:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?m1e:u_)(e,t)}function x1e(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function Ap(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function qP(e,t){switch(arguments.length){case 0:break;case 1:this.interpolator(e);break;default:this.interpolator(t).domain(e);break}return this}var $l="$";function l_(){}l_.prototype=c_.prototype={constructor:l_,has:function(e){return $l+e in this},get:function(e){return this[$l+e]},set:function(e,t){return this[$l+e]=t,this},remove:function(e){var t=$l+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===$l&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===$l&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===$l&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===$l&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===$l&&++e;return e},empty:function(){for(var e in this)if(e[0]===$l)return!1;return!0},each:function(e){for(var t in this)t[0]===$l&&e(this[t],t.slice(1),this)}};function c_(e,t){var r=new l_;if(e instanceof l_)e.each(function(u,c){r.set(c,u)});else if(Array.isArray(e)){var n=-1,i=e.length,o;if(t==null)for(;++n<i;)r.set(n,e[n]);else for(;++n<i;)r.set(t(o=e[n],n,e),o)}else if(e)for(var a in e)r.set(a,e[a]);return r}function LT(){}var u1=c_.prototype;LT.prototype={constructor:LT,has:u1.has,add:function(e){return e+="",this[$l+e]=e,this},remove:u1.remove,clear:u1.clear,values:u1.keys,size:u1.size,empty:u1.empty,each:u1.each};var KP=Array.prototype,QP=KP.map,A1=KP.slice,NT={name:"implicit"};function f_(){var e=c_(),t=[],r=[],n=NT;function i(o){var a=o+"",u=e.get(a);if(!u){if(n!==NT)return n;e.set(a,u=t.push(o))}return r[(u-1)%r.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=c_();for(var a=-1,u=o.length,c,f;++a<u;)e.has(f=(c=o[a])+"")||e.set(f,t.push(c));return i},i.range=function(o){return arguments.length?(r=A1.call(o),i):r.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return f_(t,r).unknown(n)},Ap.apply(i,arguments),i}function b1e(e){return function(){return e}}function E1e(e){return+e}var UT=[0,1];function ru(e){return e}function Px(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:b1e(isNaN(t)?NaN:.5)}function zT(e){var t=e[0],r=e[e.length-1],n;return t>r&&(n=t,t=r,r=n),function(i){return Math.max(t,Math.min(r,i))}}function S1e(e,t,r){var n=e[0],i=e[1],o=t[0],a=t[1];return i<n?(n=Px(i,n),o=r(a,o)):(n=Px(n,i),o=r(o,a)),function(u){return o(n(u))}}function A1e(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),o=new Array(n),a=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<n;)i[a]=Px(e[a],e[a+1]),o[a]=r(t[a],t[a+1]);return function(u){var c=_y(e,u,1,n)-1;return o[c](i[c](u))}}function yy(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function hb(){var e=UT,t=UT,r=fb,n,i,o,a=ru,u,c,f;function m(){return u=Math.min(e.length,t.length)>2?A1e:S1e,c=f=null,_}function _(b){return isNaN(b=+b)?o:(c||(c=u(e.map(n),t,r)))(n(a(b)))}return _.invert=function(b){return a(i((f||(f=u(t,e.map(n),u_)))(b)))},_.domain=function(b){return arguments.length?(e=QP.call(b,E1e),a===ru||(a=zT(e)),m()):e.slice()},_.range=function(b){return arguments.length?(t=A1.call(b),m()):t.slice()},_.rangeRound=function(b){return t=A1.call(b),r=x1e,m()},_.clamp=function(b){return arguments.length?(a=b?zT(e):ru,_):a!==ru},_.interpolate=function(b){return arguments.length?(r=b,m()):r},_.unknown=function(b){return arguments.length?(o=b,_):o},function(b,A){return n=b,i=A,m()}}function JP(e,t){return hb()(e,t)}function T1e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function h_(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function h0(e){return e=h_(Math.abs(e)),e?e[1]:NaN}function w1e(e,t){return function(r,n){for(var i=r.length,o=[],a=0,u=e[0],c=0;i>0&&u>0&&(c+u+1>n&&(u=Math.max(1,n-c)),o.push(r.substring(i-=u,i+u)),!((c+=u+1)>n));)u=e[a=(a+1)%e.length];return o.reverse().join(t)}}function C1e(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var R1e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function p_(e){if(!(t=R1e.exec(e)))throw new Error("invalid format: "+e);var t;return new pb({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}p_.prototype=pb.prototype;function pb(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}pb.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function I1e(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var eO;function M1e(e,t){var r=h_(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-(eO=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=n.length;return o===a?n:o>a?n+new Array(o-a+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+h_(e,Math.max(0,t+o-1))[0]}function $T(e,t){var r=h_(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const VT={"%":function(e,t){return(e*100).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:T1e,e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return $T(e*100,t)},r:$T,s:M1e,X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function jT(e){return e}var HT=Array.prototype.map,GT=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function P1e(e){var t=e.grouping===void 0||e.thousands===void 0?jT:w1e(HT.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?jT:C1e(HT.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"-":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function f(_){_=p_(_);var b=_.fill,A=_.align,w=_.sign,R=_.symbol,P=_.zero,k=_.width,L=_.comma,B=_.precision,V=_.trim,G=_.type;G==="n"?(L=!0,G="g"):VT[G]||(B===void 0&&(B=12),V=!0,G="g"),(P||b==="0"&&A==="=")&&(P=!0,b="0",A="=");var K=R==="$"?r:R==="#"&&/[boxX]/.test(G)?"0"+G.toLowerCase():"",Z=R==="$"?n:/[%p]/.test(G)?a:"",ve=VT[G],Ie=/[defgprs%]/.test(G);B=B===void 0?6:/[gprs]/.test(G)?Math.max(1,Math.min(21,B)):Math.max(0,Math.min(20,B));function de(se){var le=K,ye=Z,ke,Rt,Lt;if(G==="c")ye=ve(se)+ye,se="";else{se=+se;var Gt=se<0||1/se<0;if(se=isNaN(se)?c:ve(Math.abs(se),B),V&&(se=I1e(se)),Gt&&+se==0&&w!=="+"&&(Gt=!1),le=(Gt?w==="("?w:u:w==="-"||w==="("?"":w)+le,ye=(G==="s"?GT[8+eO/3]:"")+ye+(Gt&&w==="("?")":""),Ie){for(ke=-1,Rt=se.length;++ke<Rt;)if(Lt=se.charCodeAt(ke),48>Lt||Lt>57){ye=(Lt===46?i+se.slice(ke+1):se.slice(ke))+ye,se=se.slice(0,ke);break}}}L&&!P&&(se=t(se,1/0));var Zt=le.length+se.length+ye.length,st=Zt<k?new Array(k-Zt+1).join(b):"";switch(L&&P&&(se=t(st+se,st.length?k-ye.length:1/0),st=""),A){case"<":se=le+se+ye+st;break;case"=":se=le+st+se+ye;break;case"^":se=st.slice(0,Zt=st.length>>1)+le+se+ye+st.slice(Zt);break;default:se=st+le+se+ye;break}return o(se)}return de.toString=function(){return _+""},de}function m(_,b){var A=f((_=p_(_),_.type="f",_)),w=Math.max(-8,Math.min(8,Math.floor(h0(b)/3)))*3,R=Math.pow(10,-w),P=GT[8+w/3];return function(k){return A(R*k)+P}}return{format:f,formatPrefix:m}}var ng,db,tO;O1e({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function O1e(e){return ng=P1e(e),db=ng.format,tO=ng.formatPrefix,ng}function k1e(e){return Math.max(0,-h0(Math.abs(e)))}function D1e(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(h0(t)/3)))*3-h0(Math.abs(e)))}function F1e(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,h0(t)-h0(e))+1}function B1e(e,t,r,n){var i=Ix(e,t,r),o;switch(n=p_(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=D1e(i,a))&&(n.precision=o),tO(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=F1e(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=k1e(i))&&(n.precision=o-(n.type==="%")*2);break}}return db(n)}function Km(e){var t=e.domain;return e.ticks=function(r){var n=t();return YP(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return B1e(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,a=n[i],u=n[o],c;return u<a&&(c=a,a=u,u=c,c=i,i=o,o=c),c=Dg(a,u,r),c>0?(a=Math.floor(a/c)*c,u=Math.ceil(u/c)*c,c=Dg(a,u,r)):c<0&&(a=Math.ceil(a*c)/c,u=Math.floor(u*c)/c,c=Dg(a,u,r)),c>0?(n[i]=Math.floor(a/c)*c,n[o]=Math.ceil(u/c)*c,t(n)):c<0&&(n[i]=Math.ceil(a*c)/c,n[o]=Math.floor(u*c)/c,t(n)),e},e}function rO(){var e=JP(ru,ru);return e.copy=function(){return yy(e,rO())},Ap.apply(e,arguments),Km(e)}function nO(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],a;return o<i&&(a=r,r=n,n=a,a=i,i=o,o=a),e[r]=t.floor(i),e[n]=t.ceil(o),e}function WT(e){return Math.log(e)}function XT(e){return Math.exp(e)}function L1e(e){return-Math.log(-e)}function N1e(e){return-Math.exp(-e)}function U1e(e){return isFinite(e)?+("1e"+e):e<0?0:e}function z1e(e){return e===10?U1e:e===Math.E?Math.exp:function(t){return Math.pow(e,t)}}function $1e(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),function(t){return Math.log(t)/e})}function YT(e){return function(t){return-e(-t)}}function V1e(e){var t=e(WT,XT),r=t.domain,n=10,i,o;function a(){return i=$1e(n),o=z1e(n),r()[0]<0?(i=YT(i),o=YT(o),e(L1e,N1e)):e(WT,XT),t}return t.base=function(u){return arguments.length?(n=+u,a()):n},t.domain=function(u){return arguments.length?(r(u),a()):r()},t.ticks=function(u){var c=r(),f=c[0],m=c[c.length-1],_;(_=m<f)&&(b=f,f=m,m=b);var b=i(f),A=i(m),w,R,P,k=u==null?10:+u,L=[];if(!(n%1)&&A-b<k){if(b=Math.round(b)-1,A=Math.round(A)+1,f>0){for(;b<A;++b)for(R=1,w=o(b);R<n;++R)if(P=w*R,!(P<f)){if(P>m)break;L.push(P)}}else for(;b<A;++b)for(R=n-1,w=o(b);R>=1;--R)if(P=w*R,!(P<f)){if(P>m)break;L.push(P)}}else L=YP(b,A,Math.min(A-b,k)).map(o);return _?L.reverse():L},t.tickFormat=function(u,c){if(c==null&&(c=n===10?".0e":","),typeof c!="function"&&(c=db(c)),u===1/0)return c;u==null&&(u=10);var f=Math.max(1,n*u/t.ticks().length);return function(m){var _=m/o(Math.round(i(m)));return _*n<n-.5&&(_*=n),_<=f?c(m):""}},t.nice=function(){return r(nO(r(),{floor:function(u){return o(Math.floor(i(u)))},ceil:function(u){return o(Math.ceil(i(u)))}}))},t}function iO(){var e=V1e(hb()).domain([1,10]);return e.copy=function(){return yy(e,iO()).base(e.base())},Ap.apply(e,arguments),e}function ZT(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function j1e(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function H1e(e){return e<0?-e*e:e*e}function G1e(e){var t=e(ru,ru),r=1;function n(){return r===1?e(ru,ru):r===.5?e(j1e,H1e):e(ZT(r),ZT(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Km(t)}function aO(){var e=G1e(hb());return e.copy=function(){return yy(e,aO()).exponent(e.exponent())},Ap.apply(e,arguments),e}function oO(){var e=[],t=[],r=[],n;function i(){var a=0,u=Math.max(1,t.length);for(r=new Array(u-1);++a<u;)r[a-1]=i1e(e,a/u);return o}function o(a){return isNaN(a=+a)?n:t[_y(r,a)]}return o.invertExtent=function(a){var u=t.indexOf(a);return u<0?[NaN,NaN]:[u>0?r[u-1]:e[0],u<r.length?r[u]:e[e.length-1]]},o.domain=function(a){if(!arguments.length)return e.slice();e=[];for(var u=0,c=a.length,f;u<c;++u)f=a[u],f!=null&&!isNaN(f=+f)&&e.push(f);return e.sort(lb),i()},o.range=function(a){return arguments.length?(t=A1.call(a),i()):t.slice()},o.unknown=function(a){return arguments.length?(n=a,o):n},o.quantiles=function(){return r.slice()},o.copy=function(){return oO().domain(e).range(t).unknown(n)},Ap.apply(o,arguments)}function sO(){var e=0,t=1,r=1,n=[.5],i=[0,1],o;function a(c){return c<=c?i[_y(n,c,0,r)]:o}function u(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return a}return a.domain=function(c){return arguments.length?(e=+c[0],t=+c[1],u()):[e,t]},a.range=function(c){return arguments.length?(r=(i=A1.call(c)).length-1,u()):i.slice()},a.invertExtent=function(c){var f=i.indexOf(c);return f<0?[NaN,NaN]:f<1?[e,n[0]]:f>=r?[n[r-1],t]:[n[f-1],n[f]]},a.unknown=function(c){return arguments.length&&(o=c),a},a.thresholds=function(){return n.slice()},a.copy=function(){return sO().domain([e,t]).range(i).unknown(o)},Ap.apply(Km(a),arguments)}function uO(){var e=[.5],t=[0,1],r,n=1;function i(o){return o<=o?t[_y(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=A1.call(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=A1.call(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var a=t.indexOf(o);return[e[a-1],e[a]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return uO().domain(e).range(t).unknown(r)},Ap.apply(i,arguments)}var r6=new Date,n6=new Date;function _u(e,t,r,n){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=function(o){return e(o=new Date(+o)),o},i.ceil=function(o){return e(o=new Date(o-1)),t(o,1),e(o),o},i.round=function(o){var a=i(o),u=i.ceil(o);return o-a<u-o?a:u},i.offset=function(o,a){return t(o=new Date(+o),a==null?1:Math.floor(a)),o},i.range=function(o,a,u){var c=[],f;if(o=i.ceil(o),u=u==null?1:Math.floor(u),!(o<a)||!(u>0))return c;do c.push(f=new Date(+o)),t(o,u),e(o);while(f<o&&o<a);return c},i.filter=function(o){return _u(function(a){if(a>=a)for(;e(a),!o(a);)a.setTime(a-1)},function(a,u){if(a>=a)if(u<0)for(;++u<=0;)for(;t(a,-1),!o(a););else for(;--u>=0;)for(;t(a,1),!o(a););})},r&&(i.count=function(o,a){return r6.setTime(+o),n6.setTime(+a),e(r6),e(n6),Math.floor(r(r6,n6))},i.every=function(o){return o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?function(a){return n(a)%o===0}:function(a){return i.count(0,a)%o===0}):i}),i}var d_=_u(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});d_.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?_u(function(t){t.setTime(Math.floor(t/e)*e)},function(t,r){t.setTime(+t+r*e)},function(t,r){return(r-t)/e}):d_};const W1e=d_;d_.range;var v_=1e3,km=6e4,qT=36e5,lO=864e5,cO=6048e5,fO=_u(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*v_)},function(e,t){return(t-e)/v_},function(e){return e.getUTCSeconds()});const X1e=fO;fO.range;var hO=_u(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*v_)},function(e,t){e.setTime(+e+t*km)},function(e,t){return(t-e)/km},function(e){return e.getMinutes()});const Y1e=hO;hO.range;var pO=_u(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*v_-e.getMinutes()*km)},function(e,t){e.setTime(+e+t*qT)},function(e,t){return(t-e)/qT},function(e){return e.getHours()});const Z1e=pO;pO.range;var dO=_u(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*km)/lO},function(e){return e.getDate()-1});const vb=dO;dO.range;function O1(e){return _u(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,r){t.setDate(t.getDate()+r*7)},function(t,r){return(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*km)/cO})}var mb=O1(0),m_=O1(1),q1e=O1(2),K1e=O1(3),p0=O1(4),Q1e=O1(5),J1e=O1(6);mb.range;m_.range;q1e.range;K1e.range;p0.range;Q1e.range;J1e.range;var vO=_u(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()});const ede=vO;vO.range;var gb=_u(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});gb.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:_u(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,r){t.setFullYear(t.getFullYear()+r*e)})};const d0=gb;gb.range;var _b=_u(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/lO},function(e){return e.getUTCDate()-1});_b.range;function k1(e){return _u(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,r){t.setUTCDate(t.getUTCDate()+r*7)},function(t,r){return(r-t)/cO})}var mO=k1(0),g_=k1(1),tde=k1(2),rde=k1(3),v0=k1(4),nde=k1(5),ide=k1(6);mO.range;g_.range;tde.range;rde.range;v0.range;nde.range;ide.range;var T1=_u(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});T1.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:_u(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})};T1.range;function i6(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function a6(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Tv(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function ade(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,o=e.days,a=e.shortDays,u=e.months,c=e.shortMonths,f=wv(i),m=Cv(i),_=wv(o),b=Cv(o),A=wv(a),w=Cv(a),R=wv(u),P=Cv(u),k=wv(c),L=Cv(c),B={a:Gt,A:Zt,b:st,B:tt,c:null,d:rw,e:rw,f:Rde,g:Nde,G:zde,H:Tde,I:wde,j:Cde,L:gO,m:Ide,M:Mde,p:dt,q:nt,Q:aw,s:ow,S:Pde,u:Ode,U:kde,V:Dde,w:Fde,W:Bde,x:null,X:null,y:Lde,Y:Ude,Z:$de,"%":iw},V={a:pr,A:ur,b:Ar,B:Xn,c:null,d:nw,e:nw,f:Gde,g:t0e,G:n0e,H:Vde,I:jde,j:Hde,L:yO,m:Wde,M:Xde,p:pn,q:gi,Q:aw,s:ow,S:Yde,u:Zde,U:qde,V:Kde,w:Qde,W:Jde,x:null,X:null,y:e0e,Y:r0e,Z:i0e,"%":iw},G={a:de,A:se,b:le,B:ye,c:ke,d:ew,e:ew,f:bde,g:JT,G:QT,H:tw,I:tw,j:gde,L:xde,m:mde,M:_de,p:Ie,q:vde,Q:Sde,s:Ade,S:yde,u:cde,U:fde,V:hde,w:lde,W:pde,x:Rt,X:Lt,y:JT,Y:QT,Z:dde,"%":Ede};B.x=K(r,B),B.X=K(n,B),B.c=K(t,B),V.x=K(r,V),V.X=K(n,V),V.c=K(t,V);function K(Je,Qt){return function(Xr){var Ut=[],ge=-1,Be=0,ft=Je.length,At,bt,$t;for(Xr instanceof Date||(Xr=new Date(+Xr));++ge<ft;)Je.charCodeAt(ge)===37&&(Ut.push(Je.slice(Be,ge)),(bt=KT[At=Je.charAt(++ge)])!=null?At=Je.charAt(++ge):bt=At==="e"?" ":"0",($t=Qt[At])&&(At=$t(Xr,bt)),Ut.push(At),Be=ge+1);return Ut.push(Je.slice(Be,ge)),Ut.join("")}}function Z(Je,Qt){return function(Xr){var Ut=Tv(1900,void 0,1),ge=ve(Ut,Je,Xr+="",0),Be,ft;if(ge!=Xr.length)return null;if("Q"in Ut)return new Date(Ut.Q);if("s"in Ut)return new Date(Ut.s*1e3+("L"in Ut?Ut.L:0));if(Qt&&!("Z"in Ut)&&(Ut.Z=0),"p"in Ut&&(Ut.H=Ut.H%12+Ut.p*12),Ut.m===void 0&&(Ut.m="q"in Ut?Ut.q:0),"V"in Ut){if(Ut.V<1||Ut.V>53)return null;"w"in Ut||(Ut.w=1),"Z"in Ut?(Be=a6(Tv(Ut.y,0,1)),ft=Be.getUTCDay(),Be=ft>4||ft===0?g_.ceil(Be):g_(Be),Be=_b.offset(Be,(Ut.V-1)*7),Ut.y=Be.getUTCFullYear(),Ut.m=Be.getUTCMonth(),Ut.d=Be.getUTCDate()+(Ut.w+6)%7):(Be=i6(Tv(Ut.y,0,1)),ft=Be.getDay(),Be=ft>4||ft===0?m_.ceil(Be):m_(Be),Be=vb.offset(Be,(Ut.V-1)*7),Ut.y=Be.getFullYear(),Ut.m=Be.getMonth(),Ut.d=Be.getDate()+(Ut.w+6)%7)}else("W"in Ut||"U"in Ut)&&("w"in Ut||(Ut.w="u"in Ut?Ut.u%7:"W"in Ut?1:0),ft="Z"in Ut?a6(Tv(Ut.y,0,1)).getUTCDay():i6(Tv(Ut.y,0,1)).getDay(),Ut.m=0,Ut.d="W"in Ut?(Ut.w+6)%7+Ut.W*7-(ft+5)%7:Ut.w+Ut.U*7-(ft+6)%7);return"Z"in Ut?(Ut.H+=Ut.Z/100|0,Ut.M+=Ut.Z%100,a6(Ut)):i6(Ut)}}function ve(Je,Qt,Xr,Ut){for(var ge=0,Be=Qt.length,ft=Xr.length,At,bt;ge<Be;){if(Ut>=ft)return-1;if(At=Qt.charCodeAt(ge++),At===37){if(At=Qt.charAt(ge++),bt=G[At in KT?Qt.charAt(ge++):At],!bt||(Ut=bt(Je,Xr,Ut))<0)return-1}else if(At!=Xr.charCodeAt(Ut++))return-1}return Ut}function Ie(Je,Qt,Xr){var Ut=f.exec(Qt.slice(Xr));return Ut?(Je.p=m[Ut[0].toLowerCase()],Xr+Ut[0].length):-1}function de(Je,Qt,Xr){var Ut=A.exec(Qt.slice(Xr));return Ut?(Je.w=w[Ut[0].toLowerCase()],Xr+Ut[0].length):-1}function se(Je,Qt,Xr){var Ut=_.exec(Qt.slice(Xr));return Ut?(Je.w=b[Ut[0].toLowerCase()],Xr+Ut[0].length):-1}function le(Je,Qt,Xr){var Ut=k.exec(Qt.slice(Xr));return Ut?(Je.m=L[Ut[0].toLowerCase()],Xr+Ut[0].length):-1}function ye(Je,Qt,Xr){var Ut=R.exec(Qt.slice(Xr));return Ut?(Je.m=P[Ut[0].toLowerCase()],Xr+Ut[0].length):-1}function ke(Je,Qt,Xr){return ve(Je,t,Qt,Xr)}function Rt(Je,Qt,Xr){return ve(Je,r,Qt,Xr)}function Lt(Je,Qt,Xr){return ve(Je,n,Qt,Xr)}function Gt(Je){return a[Je.getDay()]}function Zt(Je){return o[Je.getDay()]}function st(Je){return c[Je.getMonth()]}function tt(Je){return u[Je.getMonth()]}function dt(Je){return i[+(Je.getHours()>=12)]}function nt(Je){return 1+~~(Je.getMonth()/3)}function pr(Je){return a[Je.getUTCDay()]}function ur(Je){return o[Je.getUTCDay()]}function Ar(Je){return c[Je.getUTCMonth()]}function Xn(Je){return u[Je.getUTCMonth()]}function pn(Je){return i[+(Je.getUTCHours()>=12)]}function gi(Je){return 1+~~(Je.getUTCMonth()/3)}return{format:function(Je){var Qt=K(Je+="",B);return Qt.toString=function(){return Je},Qt},parse:function(Je){var Qt=Z(Je+="",!1);return Qt.toString=function(){return Je},Qt},utcFormat:function(Je){var Qt=K(Je+="",V);return Qt.toString=function(){return Je},Qt},utcParse:function(Je){var Qt=Z(Je+="",!0);return Qt.toString=function(){return Je},Qt}}}var KT={"-":"",_:" ",0:"0"},ws=/^\s*\d+/,ode=/^%/,sde=/[\\^$*+?|[\]().{}]/g;function ca(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o<r?new Array(r-o+1).join(t)+i:i)}function ude(e){return e.replace(sde,"\\$&")}function wv(e){return new RegExp("^(?:"+e.map(ude).join("|")+")","i")}function Cv(e){for(var t={},r=-1,n=e.length;++r<n;)t[e[r].toLowerCase()]=r;return t}function lde(e,t,r){var n=ws.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function cde(e,t,r){var n=ws.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function fde(e,t,r){var n=ws.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function hde(e,t,r){var n=ws.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function pde(e,t,r){var n=ws.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function QT(e,t,r){var n=ws.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function JT(e,t,r){var n=ws.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function dde(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function vde(e,t,r){var n=ws.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function mde(e,t,r){var n=ws.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function ew(e,t,r){var n=ws.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function gde(e,t,r){var n=ws.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function tw(e,t,r){var n=ws.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function _de(e,t,r){var n=ws.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function yde(e,t,r){var n=ws.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function xde(e,t,r){var n=ws.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function bde(e,t,r){var n=ws.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Ede(e,t,r){var n=ode.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Sde(e,t,r){var n=ws.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Ade(e,t,r){var n=ws.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function rw(e,t){return ca(e.getDate(),t,2)}function Tde(e,t){return ca(e.getHours(),t,2)}function wde(e,t){return ca(e.getHours()%12||12,t,2)}function Cde(e,t){return ca(1+vb.count(d0(e),e),t,3)}function gO(e,t){return ca(e.getMilliseconds(),t,3)}function Rde(e,t){return gO(e,t)+"000"}function Ide(e,t){return ca(e.getMonth()+1,t,2)}function Mde(e,t){return ca(e.getMinutes(),t,2)}function Pde(e,t){return ca(e.getSeconds(),t,2)}function Ode(e){var t=e.getDay();return t===0?7:t}function kde(e,t){return ca(mb.count(d0(e)-1,e),t,2)}function _O(e){var t=e.getDay();return t>=4||t===0?p0(e):p0.ceil(e)}function Dde(e,t){return e=_O(e),ca(p0.count(d0(e),e)+(d0(e).getDay()===4),t,2)}function Fde(e){return e.getDay()}function Bde(e,t){return ca(m_.count(d0(e)-1,e),t,2)}function Lde(e,t){return ca(e.getFullYear()%100,t,2)}function Nde(e,t){return e=_O(e),ca(e.getFullYear()%100,t,2)}function Ude(e,t){return ca(e.getFullYear()%1e4,t,4)}function zde(e,t){var r=e.getDay();return e=r>=4||r===0?p0(e):p0.ceil(e),ca(e.getFullYear()%1e4,t,4)}function $de(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ca(t/60|0,"0",2)+ca(t%60,"0",2)}function nw(e,t){return ca(e.getUTCDate(),t,2)}function Vde(e,t){return ca(e.getUTCHours(),t,2)}function jde(e,t){return ca(e.getUTCHours()%12||12,t,2)}function Hde(e,t){return ca(1+_b.count(T1(e),e),t,3)}function yO(e,t){return ca(e.getUTCMilliseconds(),t,3)}function Gde(e,t){return yO(e,t)+"000"}function Wde(e,t){return ca(e.getUTCMonth()+1,t,2)}function Xde(e,t){return ca(e.getUTCMinutes(),t,2)}function Yde(e,t){return ca(e.getUTCSeconds(),t,2)}function Zde(e){var t=e.getUTCDay();return t===0?7:t}function qde(e,t){return ca(mO.count(T1(e)-1,e),t,2)}function xO(e){var t=e.getUTCDay();return t>=4||t===0?v0(e):v0.ceil(e)}function Kde(e,t){return e=xO(e),ca(v0.count(T1(e),e)+(T1(e).getUTCDay()===4),t,2)}function Qde(e){return e.getUTCDay()}function Jde(e,t){return ca(g_.count(T1(e)-1,e),t,2)}function e0e(e,t){return ca(e.getUTCFullYear()%100,t,2)}function t0e(e,t){return e=xO(e),ca(e.getUTCFullYear()%100,t,2)}function r0e(e,t){return ca(e.getUTCFullYear()%1e4,t,4)}function n0e(e,t){var r=e.getUTCDay();return e=r>=4||r===0?v0(e):v0.ceil(e),ca(e.getUTCFullYear()%1e4,t,4)}function i0e(){return"+0000"}function iw(){return"%"}function aw(e){return+e}function ow(e){return Math.floor(+e/1e3)}var Cd,bO;a0e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function a0e(e){return Cd=ade(e),bO=Cd.format,Cd.parse,Cd.utcFormat,Cd.utcParse,Cd}var Xv=1e3,Yv=Xv*60,Zv=Yv*60,Dm=Zv*24,o0e=Dm*7,sw=Dm*30,o6=Dm*365;function s0e(e){return new Date(e)}function u0e(e){return e instanceof Date?+e:+new Date(+e)}function EO(e,t,r,n,i,o,a,u,c){var f=JP(ru,ru),m=f.invert,_=f.domain,b=c(".%L"),A=c(":%S"),w=c("%I:%M"),R=c("%I %p"),P=c("%a %d"),k=c("%b %d"),L=c("%B"),B=c("%Y"),V=[[a,1,Xv],[a,5,5*Xv],[a,15,15*Xv],[a,30,30*Xv],[o,1,Yv],[o,5,5*Yv],[o,15,15*Yv],[o,30,30*Yv],[i,1,Zv],[i,3,3*Zv],[i,6,6*Zv],[i,12,12*Zv],[n,1,Dm],[n,2,2*Dm],[r,1,o0e],[t,1,sw],[t,3,3*sw],[e,1,o6]];function G(Z){return(a(Z)<Z?b:o(Z)<Z?A:i(Z)<Z?w:n(Z)<Z?R:t(Z)<Z?r(Z)<Z?P:k:e(Z)<Z?L:B)(Z)}function K(Z,ve,Ie,de){if(Z==null&&(Z=10),typeof Z=="number"){var se=Math.abs(Ie-ve)/Z,le=XP(function(ye){return ye[2]}).right(V,se);le===V.length?(de=Ix(ve/o6,Ie/o6,Z),Z=e):le?(le=V[se/V[le-1][2]<V[le][2]/se?le-1:le],de=le[1],Z=le[0]):(de=Math.max(Ix(ve,Ie,Z),1),Z=u)}return de==null?Z:Z.every(de)}return f.invert=function(Z){return new Date(m(Z))},f.domain=function(Z){return arguments.length?_(QP.call(Z,u0e)):_().map(s0e)},f.ticks=function(Z,ve){var Ie=_(),de=Ie[0],se=Ie[Ie.length-1],le=se<de,ye;return le&&(ye=de,de=se,se=ye),ye=K(Z,de,se,ve),ye=ye?ye.range(de,se+1):[],le?ye.reverse():ye},f.tickFormat=function(Z,ve){return ve==null?G:c(ve)},f.nice=function(Z,ve){var Ie=_();return(Z=K(Z,Ie[0],Ie[Ie.length-1],ve))?_(nO(Ie,Z)):f},f.copy=function(){return yy(f,EO(e,t,r,n,i,o,a,u,c))},f}function l0e(){return Ap.apply(EO(d0,ede,mb,vb,Z1e,Y1e,X1e,W1e,bO).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function c0e(){var e=0,t=1,r,n,i,o,a=ru,u=!1,c;function f(m){return isNaN(m=+m)?c:a(i===0?.5:(m=(o(m)-r)*i,u?Math.max(0,Math.min(1,m)):m))}return f.domain=function(m){return arguments.length?(r=o(e=+m[0]),n=o(t=+m[1]),i=r===n?0:1/(n-r),f):[e,t]},f.clamp=function(m){return arguments.length?(u=!!m,f):u},f.interpolator=function(m){return arguments.length?(a=m,f):a},f.unknown=function(m){return arguments.length?(c=m,f):c},function(m){return o=m,r=m(e),n=m(t),i=r===n?0:1/(n-r),f}}function SO(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function AO(){var e=Km(c0e()(ru));return e.copy=function(){return SO(e,AO())},qP.apply(e,arguments)}function f0e(){var e=0,t=.5,r=1,n,i,o,a,u,c=ru,f,m=!1,_;function b(A){return isNaN(A=+A)?_:(A=.5+((A=+f(A))-i)*(A<i?a:u),c(m?Math.max(0,Math.min(1,A)):A))}return b.domain=function(A){return arguments.length?(n=f(e=+A[0]),i=f(t=+A[1]),o=f(r=+A[2]),a=n===i?0:.5/(i-n),u=i===o?0:.5/(o-i),b):[e,t,r]},b.clamp=function(A){return arguments.length?(m=!!A,b):m},b.interpolator=function(A){return arguments.length?(c=A,b):c},b.unknown=function(A){return arguments.length?(_=A,b):_},function(A){return f=A,n=A(e),i=A(t),o=A(r),a=n===i?0:.5/(i-n),u=i===o?0:.5/(o-i),b}}function TO(){var e=Km(f0e()(ru));return e.copy=function(){return SO(e,TO())},qP.apply(e,arguments)}function wO(e){var t,r=[];function n(i){return i??t}return n.invert=n,n.domain=n.range=function(i){return i?(r=i,i):r},n.unknown=function(i){return i?(t=i,i):t},n.copy=function(){return wO().unknown(t)},n}var ol,uw,lw,s6=Ci.isNil,h0e=Ci.isString,p0e=Ci.uniq,d0e=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/,v0e=(ol={},F(ol,pa.LINEAR,rO),F(ol,pa.POWER,aO),F(ol,pa.LOG,iO),F(ol,pa.IDENTITY,wO),F(ol,pa.SEQUENTIAL,AO),F(ol,pa.TIME,l0e),F(ol,pa.QUANTILE,oO),F(ol,pa.QUANTIZE,sO),F(ol,pa.THRESHOLD,uO),F(ol,pa.CAT,f_),F(ol,pa.DIVERGING,TO),ol),m0e=(uw=ai(),uw(lw=function(){function e(){Ht(this,e),F(this,"scaleOptions",{})}return jt(e,[{key:"apply",value:function(r,n){var i=this,o=n.styleAttributeService;r.hooks.init.tapPromise("FeatureScalePlugin",Mt(he.mark(function a(){var u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(r.log(Ho.ScaleInitStart,ps.INIT),i.scaleOptions=r.getScaleOptions(),c=o.getLayerStyleAttributes(),f=(u=r.getSource())===null||u===void 0?void 0:u.data.dataArray,!(Array.isArray(f)&&f.length===0)){_.next=8;break}return _.abrupt("return");case 8:i.caculateScalesForAttributes(c||[],f);case 9:r.log(Ho.ScaleInitEnd,ps.INIT);case 10:case"end":return _.stop()}},a)}))),r.hooks.beforeRenderData.tapPromise("FeatureScalePlugin",function(){var a=Mt(he.mark(function u(c){var f,m;return he.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(c){b.next=2;break}return b.abrupt("return",c);case 2:if(r.log(Ho.ScaleInitStart,ps.UPDATE),i.scaleOptions=r.getScaleOptions(),f=o.getLayerStyleAttributes(),m=r.getSource().data.dataArray,!(Array.isArray(m)&&m.length===0)){b.next=8;break}return b.abrupt("return",!0);case 8:return i.caculateScalesForAttributes(f||[],m),r.log(Ho.ScaleInitEnd,ps.UPDATE),r.layerModelNeedUpdate=!0,b.abrupt("return",!0);case 12:case"end":return b.stop()}},u)}));return function(u){return a.apply(this,arguments)}}()),r.hooks.beforeRender.tap("FeatureScalePlugin",function(){if(!r.layerModelNeedUpdate){i.scaleOptions=r.getScaleOptions();var a=o.getLayerStyleAttributes(),u=r.getSource().data.dataArray;if(!(Array.isArray(u)&&u.length===0)&&a){var c=a.filter(function(f){return f.needRescale});c.length&&i.caculateScalesForAttributes(c,u)}}})}},{key:"isNumber",value:function(r){return!isNaN(parseFloat(r))&&isFinite(r)}},{key:"caculateScalesForAttributes",value:function(r,n){var i=this;r.forEach(function(o){if(o.scale){var a=o.scale,u=o.scale.field;a.names=i.parseFields(s6(u)?[]:u);var c=[];a.names.forEach(function(f){var m;c.push(i.createScale(f,o.name,(m=o.scale)===null||m===void 0?void 0:m.values,n))}),c.some(function(f){return f.type===Ad.VARIABLE})?(a.type=Ad.VARIABLE,c.forEach(function(f){if(!a.callback&&a.values!=="text"){var m;switch((m=f.option)===null||m===void 0?void 0:m.type){case pa.LOG:case pa.LINEAR:case pa.POWER:if(a.values&&a.values.length>2){var _=f.scale.ticks(a.values.length);f.scale.domain(_)}a.values?f.scale.range(a.values):f.scale.range(f.option.domain);break;case pa.QUANTILE:case pa.QUANTIZE:case pa.THRESHOLD:f.scale.range(a.values);break;case pa.IDENTITY:break;case pa.CAT:a.values?f.scale.range(a.values):f.scale.range(f.option.domain);break;case pa.DIVERGING:case pa.SEQUENTIAL:f.scale.interpolator(f1e(a.values));break}}if(a.values==="text"){var b;f.scale.range((b=f.option)===null||b===void 0?void 0:b.domain)}})):(a.type=Ad.CONSTANT,a.defaultValues=c.map(function(f,m){return f.scale(a.names[m])})),a.scalers=c.map(function(f){return{field:f.field,func:f.scale,option:f.option}}),o.needRescale=!1}})}},{key:"parseFields",value:function(r){return Array.isArray(r)?r:h0e(r)?r.split("*"):[r]}},{key:"createScale",value:function(r,n,i,o){var a,u,c=this.scaleOptions[n]&&((a=this.scaleOptions[n])===null||a===void 0?void 0:a.field)===r?this.scaleOptions[n]:this.scaleOptions[r],f={field:r,scale:void 0,type:Ad.VARIABLE,option:c};if(!o||!o.length)return c&&c.type?f.scale=this.createDefaultScale(c):(f.scale=f_([r]),f.type=Ad.CONSTANT),f;var m=(u=o.find(function(A){return!s6(A[r])}))===null||u===void 0?void 0:u[r];if(this.isNumber(r)||s6(m)&&!c)f.scale=f_([r]),f.type=Ad.CONSTANT;else{var _=c&&c.type||this.getDefaultType(m);i==="text"&&(_=pa.CAT),i===void 0&&(_=pa.IDENTITY);var b=this.createScaleConfig(_,r,c,o);f.scale=this.createDefaultScale(b),f.option=b}return f}},{key:"getDefaultType",value:function(r){var n=pa.LINEAR;return typeof r=="string"&&(n=d0e.test(r)?pa.TIME:pa.CAT),n}},{key:"createScaleConfig",value:function(r,n,i,o){var a={type:r},u=[];if(r===pa.QUANTILE){var c=new Map;o==null||o.forEach(function(_){c.set(_._id,_[n])}),u=Array.from(c.values())}else u=(o==null?void 0:o.map(function(_){return _[n]}))||[];if(i!=null&&i.domain)a.domain=i==null?void 0:i.domain;else if(r===pa.CAT||r===pa.IDENTITY)a.domain=p0e(u);else if(r===pa.QUANTILE)a.domain=u;else if(r===pa.DIVERGING){var f=FT(u),m=(i==null?void 0:i.neutral)!==void 0?i==null?void 0:i.neutral:(f[0]+f[1])/2;a.domain=[f[0],m,f[1]]}else a.domain=FT(u);return Qe(Qe({},a),i)}},{key:"createDefaultScale",value:function(r){var n=r.type,i=r.domain,o=r.unknown,a=r.clamp,u=r.nice,c=v0e[n]();return i&&c.domain&&c.domain(i),o&&c.unknown(o),a!==void 0&&c.clamp&&c.clamp(a),u!==void 0&&c.nice&&c.nice(u),c}}]),e}())||lw),cw,fw,g0e=(cw=ai(),cw(fw=function(){function e(){Ht(this,e)}return jt(e,[{key:"apply",value:function(r){r.hooks.beforeRender.tap("LayerAnimateStylePlugin",function(){var n=r.animateStatus;n&&r.models.forEach(function(i){i.addUniforms(Qe({},r.layerModel.getAnimateUniforms()))})})}}]),e}())||fw),hw,pw,_0e=(hw=ai(),hw(pw=function(){function e(){Ht(this,e)}return jt(e,[{key:"apply",value:function(r){r.hooks.afterInit.tap("LayerMaskPlugin",function(){var n=r.getLayerConfig(),i=n.maskLayers,o=n.enableMask;if(!r.tileLayer&&i&&i.length>0){var a;(a=r.masks).push.apply(a,nr(i)),r.updateLayerConfig({mask:o})}})}}]),e}())||pw),y0e=function(){function e(t){var r=t.rendererService,n=t.layerService,i=t.parent;Ht(this,e),F(this,"tileResource",new Map),F(this,"layerTiles",[]),this.rendererService=r,this.layerService=n,this.parent=i}return jt(e,[{key:"tiles",get:function(){return this.layerTiles}},{key:"hasTile",value:function(r){return this.layerTiles.some(function(n){return n.key===r})}},{key:"addTile",value:function(r){this.layerTiles.push(r)}},{key:"getTile",value:function(r){return this.layerTiles.find(function(n){return n.key===r})}},{key:"getVisibleTileBylngLat",value:function(r){return this.layerTiles.find(function(n){return n.isLoaded&&n.visible&&n.lnglatInBounds(r)})}},{key:"removeTile",value:function(r){var n=this.layerTiles.findIndex(function(o){return o.key===r}),i=this.layerTiles.splice(n,1);i[0]&&i[0].destroy()}},{key:"updateTileVisible",value:function(r){var n=this.getTile(r.key);if(r.isVisible)if(r.parent){var i=this.isChildrenLoaded(r.parent);n==null||n.updateVisible(i)}else n==null||n.updateVisible(!0);else if(r.parent){var o=this.isChildrenLoaded(r.parent);n==null||n.updateVisible(!o)}else n==null||n.updateVisible(!1)}},{key:"isParentLoaded",value:function(r){var n=r.parent;if(!n)return!0;var i=this.getTile(n==null?void 0:n.key);return!!(i!=null&&i.isLoaded)}},{key:"isChildrenLoaded",value:function(r){var n=this,i=r==null?void 0:r.children;return i.length===0?!0:i.every(function(o){var a=n.getTile(o==null?void 0:o.key);return a?(a==null?void 0:a.isLoaded)===!0:!0})}},{key:"render",value:function(){var t=Mt(he.mark(function n(){var i=this,o,a;return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return o=this.getRenderLayers(),a=o.map(function(){var f=Mt(he.mark(function m(_){return he.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,i.layerService.renderTileLayer(_);case 2:case"end":return A.stop()}},m)}));return function(m){return f.apply(this,arguments)}}()),c.next=4,Promise.all(a);case 4:case"end":return c.stop()}},n,this)}));function r(){return t.apply(this,arguments)}return r}()},{key:"getRenderLayers",value:function(){var r=this.layerTiles.filter(function(i){return i.visible&&i.isLoaded}),n=[];return r.map(function(i){return n.push.apply(n,nr(i.getLayers()))}),n}},{key:"getLayers",value:function(){var r=this.layerTiles.filter(function(i){return i.isLoaded}),n=[];return r.map(function(i){return n.push.apply(n,nr(i.getLayers()))}),n}},{key:"getTiles",value:function(){return this.layerTiles}},{key:"destroy",value:function(){this.layerTiles.forEach(function(r){return r.destroy()}),this.tileResource.clear()}}]),e}();/**
|
|
* splaytree v3.1.2
|
|
* Fast Splay tree for Node and browser
|
|
*
|
|
* @author Alexander Milevski <info@w8r.name>
|
|
* @license MIT
|
|
* @preserve
|
|
*//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
this file except in compliance with the License. You may obtain a copy of the
|
|
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
and limitations under the License.
|
|
***************************************************************************** */function x0e(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(f){return function(m){return c([f,m])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=t.call(e,r)}catch(m){f=[6,m],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var Ep=function(){function e(t,r){this.next=null,this.key=t,this.data=r,this.left=null,this.right=null}return e}();function b0e(e,t){return e>t?1:e<t?-1:0}function cp(e,t,r){for(var n=new Ep(null,null),i=n,o=n;;){var a=r(e,t.key);if(a<0){if(t.left===null)break;if(r(e,t.left.key)<0){var u=t.left;if(t.left=u.right,u.right=t,t=u,t.left===null)break}o.left=t,o=t,t=t.left}else if(a>0){if(t.right===null)break;if(r(e,t.right.key)>0){var u=t.right;if(t.right=u.left,u.left=t,t=u,t.right===null)break}i.right=t,i=t,t=t.right}else break}return i.right=t.left,o.left=t.right,t.left=n.right,t.right=n.left,t}function u6(e,t,r,n){var i=new Ep(e,t);if(r===null)return i.left=i.right=null,i;r=cp(e,r,n);var o=n(e,r.key);return o<0?(i.left=r.left,i.right=r,r.left=null):o>=0&&(i.right=r.right,i.left=r,r.right=null),i}function dw(e,t,r){var n=null,i=null;if(t){t=cp(e,t,r);var o=r(t.key,e);o===0?(n=t.left,i=t.right):o<0?(i=t.right,t.right=null,n=t):(n=t.left,t.left=null,i=t)}return{left:n,right:i}}function E0e(e,t,r){return t===null?e:(e===null||(t=cp(e.key,t,r),t.left=e),t)}function Ox(e,t,r,n,i){if(e){n(""+t+(r?"└── ":"├── ")+i(e)+`
|
|
`);var o=t+(r?" ":"│ ");e.left&&Ox(e.left,o,!1,n,i),e.right&&Ox(e.right,o,!0,n,i)}}var yb=function(){function e(t){t===void 0&&(t=b0e),this._root=null,this._size=0,this._comparator=t}return e.prototype.insert=function(t,r){return this._size++,this._root=u6(t,r,this._root,this._comparator)},e.prototype.add=function(t,r){var n=new Ep(t,r);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,o=cp(t,this._root,i),a=i(t,o.key);return a===0?this._root=o:(a<0?(n.left=o.left,n.right=o,o.left=null):a>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},e.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},e.prototype._remove=function(t,r,n){var i;if(r===null)return null;r=cp(t,r,n);var o=n(t,r.key);return o===0?(r.left===null?i=r.right:(i=cp(t,r.left,n),i.right=r.right),this._size--,i):r},e.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=cp(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},e.prototype.findStatic=function(t){for(var r=this._root,n=this._comparator;r;){var i=n(t,r.key);if(i===0)return r;i<0?r=r.left:r=r.right}return null},e.prototype.find=function(t){return this._root&&(this._root=cp(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},e.prototype.contains=function(t){for(var r=this._root,n=this._comparator;r;){var i=n(t,r.key);if(i===0)return!0;i<0?r=r.left:r=r.right}return!1},e.prototype.forEach=function(t,r){for(var n=this._root,i=[],o=!1;!o;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),t.call(r,n),n=n.right):o=!0;return this},e.prototype.range=function(t,r,n,i){for(var o=[],a=this._comparator,u=this._root,c;o.length!==0||u;)if(u)o.push(u),u=u.left;else{if(u=o.pop(),c=a(u.key,r),c>0)break;if(a(u.key,t)>=0&&n.call(i,u))return this;u=u.right}return this},e.prototype.keys=function(){var t=[];return this.forEach(function(r){var n=r.key;return t.push(n)}),t},e.prototype.values=function(){var t=[];return this.forEach(function(r){var n=r.data;return t.push(n)}),t},e.prototype.min=function(){return this._root?this.minNode(this._root).key:null},e.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},e.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},e.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},e.prototype.at=function(t){for(var r=this._root,n=!1,i=0,o=[];!n;)if(r)o.push(r),r=r.left;else if(o.length>0){if(r=o.pop(),i===t)return r;i++,r=r.right}else n=!0;return null},e.prototype.next=function(t){var r=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var i=this._comparator;r;){var o=i(t.key,r.key);if(o===0)break;o<0?(n=r,r=r.left):r=r.right}return n},e.prototype.prev=function(t){var r=this._root,n=null;if(t.left!==null){for(n=t.left;n.right;)n=n.right;return n}for(var i=this._comparator;r;){var o=i(t.key,r.key);if(o===0)break;o<0?r=r.left:(n=r,r=r.right)}return n},e.prototype.clear=function(){return this._root=null,this._size=0,this},e.prototype.toList=function(){return A0e(this._root)},e.prototype.load=function(t,r,n){r===void 0&&(r=[]),n===void 0&&(n=!1);var i=t.length,o=this._comparator;if(n&&Fx(t,r,0,i-1,o),this._root===null)this._root=kx(t,r,0,i),this._size=i;else{var a=T0e(this.toList(),S0e(t,r),o);i=this._size+i,this._root=Dx({head:a},0,i)}return this},e.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),e.prototype.toString=function(t){t===void 0&&(t=function(n){return String(n.key)});var r=[];return Ox(this._root,"",!0,function(n){return r.push(n)},t),r.join("")},e.prototype.update=function(t,r,n){var i=this._comparator,o=dw(t,this._root,i),a=o.left,u=o.right;i(t,r)<0?u=u6(r,n,u,i):a=u6(r,n,a,i),this._root=E0e(a,u,i)},e.prototype.split=function(t){return dw(t,this._root,this._comparator)},e.prototype[Symbol.iterator]=function(){var t,r,n;return x0e(this,function(i){switch(i.label){case 0:t=this._root,r=[],n=!1,i.label=1;case 1:return n?[3,6]:t===null?[3,2]:(r.push(t),t=t.left,[3,5]);case 2:return r.length===0?[3,4]:(t=r.pop(),[4,t]);case 3:return i.sent(),t=t.right,[3,5];case 4:n=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},e}();function kx(e,t,r,n){var i=n-r;if(i>0){var o=r+Math.floor(i/2),a=e[o],u=t[o],c=new Ep(a,u);return c.left=kx(e,t,r,o),c.right=kx(e,t,o+1,n),c}return null}function S0e(e,t){for(var r=new Ep(null,null),n=r,i=0;i<e.length;i++)n=n.next=new Ep(e[i],t[i]);return n.next=null,r.next}function A0e(e){for(var t=e,r=[],n=!1,i=new Ep(null,null),o=i;!n;)t?(r.push(t),t=t.left):r.length>0?(t=o=o.next=r.pop(),t=t.right):n=!0;return o.next=null,i.next}function Dx(e,t,r){var n=r-t;if(n>0){var i=t+Math.floor(n/2),o=Dx(e,t,i),a=e.head;return a.left=o,e.head=e.head.next,a.right=Dx(e,i+1,r),a}return null}function T0e(e,t,r){for(var n=new Ep(null,null),i=n,o=e,a=t;o!==null&&a!==null;)r(o.key,a.key)<0?(i.next=o,o=o.next):(i.next=a,a=a.next),i=i.next;return o!==null?i.next=o:a!==null&&(i.next=a),n.next}function Fx(e,t,r,n,i){if(!(r>=n)){for(var o=e[r+n>>1],a=r-1,u=n+1;;){do a++;while(i(e[a],o)<0);do u--;while(i(e[u],o)>0);if(a>=u)break;var c=e[a];e[a]=e[u],e[u]=c,c=t[a],t[a]=t[u],t[u]=c}Fx(e,t,r,u,i),Fx(e,t,u+1,n,i)}}const oh=11102230246251565e-32,Qs=134217729,w0e=(3+8*oh)*oh;function l6(e,t,r,n,i){let o,a,u,c,f=t[0],m=n[0],_=0,b=0;m>f==m>-f?(o=f,f=t[++_]):(o=m,m=n[++b]);let A=0;if(_<e&&b<r)for(m>f==m>-f?(a=f+o,u=o-(a-f),f=t[++_]):(a=m+o,u=o-(a-m),m=n[++b]),o=a,u!==0&&(i[A++]=u);_<e&&b<r;)m>f==m>-f?(a=o+f,c=a-o,u=o-(a-c)+(f-c),f=t[++_]):(a=o+m,c=a-o,u=o-(a-c)+(m-c),m=n[++b]),o=a,u!==0&&(i[A++]=u);for(;_<e;)a=o+f,c=a-o,u=o-(a-c)+(f-c),f=t[++_],o=a,u!==0&&(i[A++]=u);for(;b<r;)a=o+m,c=a-o,u=o-(a-c)+(m-c),m=n[++b],o=a,u!==0&&(i[A++]=u);return(o!==0||A===0)&&(i[A++]=o),A}function C0e(e,t){let r=t[0];for(let n=1;n<e;n++)r+=t[n];return r}function Qm(e){return new Float64Array(e)}const R0e=(3+16*oh)*oh,I0e=(2+12*oh)*oh,M0e=(9+64*oh)*oh*oh,Rd=Qm(4),vw=Qm(8),mw=Qm(12),gw=Qm(16),hu=Qm(4);function P0e(e,t,r,n,i,o,a){let u,c,f,m,_,b,A,w,R,P,k,L,B,V,G,K,Z,ve;const Ie=e-i,de=r-i,se=t-o,le=n-o;V=Ie*le,b=Qs*Ie,A=b-(b-Ie),w=Ie-A,b=Qs*le,R=b-(b-le),P=le-R,G=w*P-(V-A*R-w*R-A*P),K=se*de,b=Qs*se,A=b-(b-se),w=se-A,b=Qs*de,R=b-(b-de),P=de-R,Z=w*P-(K-A*R-w*R-A*P),k=G-Z,_=G-k,Rd[0]=G-(k+_)+(_-Z),L=V+k,_=L-V,B=V-(L-_)+(k-_),k=B-K,_=B-k,Rd[1]=B-(k+_)+(_-K),ve=L+k,_=ve-L,Rd[2]=L-(ve-_)+(k-_),Rd[3]=ve;let ye=C0e(4,Rd),ke=I0e*a;if(ye>=ke||-ye>=ke||(_=e-Ie,u=e-(Ie+_)+(_-i),_=r-de,f=r-(de+_)+(_-i),_=t-se,c=t-(se+_)+(_-o),_=n-le,m=n-(le+_)+(_-o),u===0&&c===0&&f===0&&m===0)||(ke=M0e*a+w0e*Math.abs(ye),ye+=Ie*m+le*u-(se*f+de*c),ye>=ke||-ye>=ke))return ye;V=u*le,b=Qs*u,A=b-(b-u),w=u-A,b=Qs*le,R=b-(b-le),P=le-R,G=w*P-(V-A*R-w*R-A*P),K=c*de,b=Qs*c,A=b-(b-c),w=c-A,b=Qs*de,R=b-(b-de),P=de-R,Z=w*P-(K-A*R-w*R-A*P),k=G-Z,_=G-k,hu[0]=G-(k+_)+(_-Z),L=V+k,_=L-V,B=V-(L-_)+(k-_),k=B-K,_=B-k,hu[1]=B-(k+_)+(_-K),ve=L+k,_=ve-L,hu[2]=L-(ve-_)+(k-_),hu[3]=ve;const Rt=l6(4,Rd,4,hu,vw);V=Ie*m,b=Qs*Ie,A=b-(b-Ie),w=Ie-A,b=Qs*m,R=b-(b-m),P=m-R,G=w*P-(V-A*R-w*R-A*P),K=se*f,b=Qs*se,A=b-(b-se),w=se-A,b=Qs*f,R=b-(b-f),P=f-R,Z=w*P-(K-A*R-w*R-A*P),k=G-Z,_=G-k,hu[0]=G-(k+_)+(_-Z),L=V+k,_=L-V,B=V-(L-_)+(k-_),k=B-K,_=B-k,hu[1]=B-(k+_)+(_-K),ve=L+k,_=ve-L,hu[2]=L-(ve-_)+(k-_),hu[3]=ve;const Lt=l6(Rt,vw,4,hu,mw);V=u*m,b=Qs*u,A=b-(b-u),w=u-A,b=Qs*m,R=b-(b-m),P=m-R,G=w*P-(V-A*R-w*R-A*P),K=c*f,b=Qs*c,A=b-(b-c),w=c-A,b=Qs*f,R=b-(b-f),P=f-R,Z=w*P-(K-A*R-w*R-A*P),k=G-Z,_=G-k,hu[0]=G-(k+_)+(_-Z),L=V+k,_=L-V,B=V-(L-_)+(k-_),k=B-K,_=B-k,hu[1]=B-(k+_)+(_-K),ve=L+k,_=ve-L,hu[2]=L-(ve-_)+(k-_),hu[3]=ve;const Gt=l6(Lt,mw,4,hu,gw);return gw[Gt-1]}function O0e(e,t,r,n,i,o){const a=(t-o)*(r-i),u=(e-i)*(n-o),c=a-u,f=Math.abs(a+u);return Math.abs(c)>=R0e*f?c:-P0e(e,t,r,n,i,o,f)}var CO={};const Rv=(e,t)=>e.ll.x<=t.x&&t.x<=e.ur.x&&e.ll.y<=t.y&&t.y<=e.ur.y,Bx=(e,t)=>{if(t.ur.x<e.ll.x||e.ur.x<t.ll.x||t.ur.y<e.ll.y||e.ur.y<t.ll.y)return null;const r=e.ll.x<t.ll.x?t.ll.x:e.ll.x,n=e.ur.x<t.ur.x?e.ur.x:t.ur.x,i=e.ll.y<t.ll.y?t.ll.y:e.ll.y,o=e.ur.y<t.ur.y?e.ur.y:t.ur.y;return{ll:{x:r,y:i},ur:{x:n,y:o}}};let fp=Number.EPSILON;fp===void 0&&(fp=Math.pow(2,-52));const k0e=fp*fp,_w=(e,t)=>{if(-fp<e&&e<fp&&-fp<t&&t<fp)return 0;const r=e-t;return r*r<k0e*e*t?0:e<t?-1:1};class D0e{constructor(){this.reset()}reset(){this.xRounder=new yw,this.yRounder=new yw}round(t,r){return{x:this.xRounder.round(t),y:this.yRounder.round(r)}}}class yw{constructor(){this.tree=new yb,this.round(0)}round(t){const r=this.tree.add(t),n=this.tree.prev(r);if(n!==null&&_w(r.key,n.key)===0)return this.tree.remove(t),n.key;const i=this.tree.next(r);return i!==null&&_w(r.key,i.key)===0?(this.tree.remove(t),i.key):t}}const Fm=new D0e,Fg=(e,t)=>e.x*t.y-e.y*t.x,RO=(e,t)=>e.x*t.x+e.y*t.y,xw=(e,t,r)=>{const n=O0e(e.x,e.y,t.x,t.y,r.x,r.y);return n>0?-1:n<0?1:0},__=e=>Math.sqrt(RO(e,e)),F0e=(e,t,r)=>{const n={x:t.x-e.x,y:t.y-e.y},i={x:r.x-e.x,y:r.y-e.y};return Fg(i,n)/__(i)/__(n)},B0e=(e,t,r)=>{const n={x:t.x-e.x,y:t.y-e.y},i={x:r.x-e.x,y:r.y-e.y};return RO(i,n)/__(i)/__(n)},bw=(e,t,r)=>t.y===0?null:{x:e.x+t.x/t.y*(r-e.y),y:r},Ew=(e,t,r)=>t.x===0?null:{x:r,y:e.y+t.y/t.x*(r-e.x)},L0e=(e,t,r,n)=>{if(t.x===0)return Ew(r,n,e.x);if(n.x===0)return Ew(e,t,r.x);if(t.y===0)return bw(r,n,e.y);if(n.y===0)return bw(e,t,r.y);const i=Fg(t,n);if(i==0)return null;const o={x:r.x-e.x,y:r.y-e.y},a=Fg(o,t)/i,u=Fg(o,n)/i,c=e.x+u*t.x,f=r.x+a*n.x,m=e.y+u*t.y,_=r.y+a*n.y,b=(c+f)/2,A=(m+_)/2;return{x:b,y:A}};class Hl{static compare(t,r){const n=Hl.comparePoints(t.point,r.point);return n!==0?n:(t.point!==r.point&&t.link(r),t.isLeft!==r.isLeft?t.isLeft?1:-1:_p.compare(t.segment,r.segment))}static comparePoints(t,r){return t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0}constructor(t,r){t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=r}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const r=t.point.events;for(let n=0,i=r.length;n<i;n++){const o=r[n];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let r=0;r<t;r++){const n=this.point.events[r];if(n.segment.consumedBy===void 0)for(let i=r+1;i<t;i++){const o=this.point.events[i];o.consumedBy===void 0&&n.otherSE.point.events===o.otherSE.point.events&&n.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const t=[];for(let r=0,n=this.point.events.length;r<n;r++){const i=this.point.events[r];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){const r=new Map,n=i=>{const o=i.otherSE;r.set(i,{sine:F0e(this.point,t.point,o.point),cosine:B0e(this.point,t.point,o.point)})};return(i,o)=>{r.has(i)||n(i),r.has(o)||n(o);const{sine:a,cosine:u}=r.get(i),{sine:c,cosine:f}=r.get(o);return a>=0&&c>=0?u<f?1:u>f?-1:0:a<0&&c<0?u<f?-1:u>f?1:0:c<a?-1:c>a?1:0}}}let N0e=0;class _p{static compare(t,r){const n=t.leftSE.point.x,i=r.leftSE.point.x,o=t.rightSE.point.x,a=r.rightSE.point.x;if(a<n)return 1;if(o<i)return-1;const u=t.leftSE.point.y,c=r.leftSE.point.y,f=t.rightSE.point.y,m=r.rightSE.point.y;if(n<i){if(c<u&&c<f)return 1;if(c>u&&c>f)return-1;const _=t.comparePoint(r.leftSE.point);if(_<0)return 1;if(_>0)return-1;const b=r.comparePoint(t.rightSE.point);return b!==0?b:-1}if(n>i){if(u<c&&u<m)return-1;if(u>c&&u>m)return 1;const _=r.comparePoint(t.leftSE.point);if(_!==0)return _;const b=t.comparePoint(r.rightSE.point);return b<0?1:b>0?-1:1}if(u<c)return-1;if(u>c)return 1;if(o<a){const _=r.comparePoint(t.rightSE.point);if(_!==0)return _}if(o>a){const _=t.comparePoint(r.rightSE.point);if(_<0)return 1;if(_>0)return-1}if(o!==a){const _=f-u,b=o-n,A=m-c,w=a-i;if(_>b&&A<w)return 1;if(_<b&&A>w)return-1}return o>a?1:o<a||f<m?-1:f>m?1:t.id<r.id?-1:t.id>r.id?1:0}constructor(t,r,n,i){this.id=++N0e,this.leftSE=t,t.segment=this,t.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=t,this.rings=n,this.windings=i}static fromRing(t,r,n){let i,o,a;const u=Hl.comparePoints(t,r);if(u<0)i=t,o=r,a=1;else if(u>0)i=r,o=t,a=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);const c=new Hl(i,!0),f=new Hl(o,!1);return new _p(c,f,[n],[a])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,r=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<r?t:r},ur:{x:this.rightSE.point.x,y:t>r?t:r}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const r=this.leftSE.point,n=this.rightSE.point,i=this.vector();if(r.x===n.x)return t.x===r.x?0:t.x<r.x?1:-1;const o=(t.y-r.y)/i.y,a=r.x+o*i.x;if(t.x===a)return 0;const u=(t.x-r.x)/i.x,c=r.y+u*i.y;return t.y===c?0:t.y<c?-1:1}getIntersection(t){const r=this.bbox(),n=t.bbox(),i=Bx(r,n);if(i===null)return null;const o=this.leftSE.point,a=this.rightSE.point,u=t.leftSE.point,c=t.rightSE.point,f=Rv(r,u)&&this.comparePoint(u)===0,m=Rv(n,o)&&t.comparePoint(o)===0,_=Rv(r,c)&&this.comparePoint(c)===0,b=Rv(n,a)&&t.comparePoint(a)===0;if(m&&f)return b&&!_?a:!b&&_?c:null;if(m)return _&&o.x===c.x&&o.y===c.y?null:o;if(f)return b&&a.x===u.x&&a.y===u.y?null:u;if(b&&_)return null;if(b)return a;if(_)return c;const A=L0e(o,this.vector(),u,t.vector());return A===null||!Rv(i,A)?null:Fm.round(A.x,A.y)}split(t){const r=[],n=t.events!==void 0,i=new Hl(t,!0),o=new Hl(t,!1),a=this.rightSE;this.replaceRightSE(o),r.push(o),r.push(i);const u=new _p(i,a,this.rings.slice(),this.windings.slice());return Hl.comparePoints(u.leftSE.point,u.rightSE.point)>0&&u.swapEvents(),Hl.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),o.checkForConsuming()),r}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let r=0,n=this.windings.length;r<n;r++)this.windings[r]*=-1}consume(t){let r=this,n=t;for(;r.consumedBy;)r=r.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const i=_p.compare(r,n);if(i!==0){if(i>0){const o=r;r=n,n=o}if(r.prev===n){const o=r;r=n,n=o}for(let o=0,a=n.rings.length;o<a;o++){const u=n.rings[o],c=n.windings[o],f=r.rings.indexOf(u);f===-1?(r.rings.push(u),r.windings.push(c)):r.windings[f]+=c}n.rings=null,n.windings=null,n.consumedBy=r,n.leftSE.consumedBy=r.leftSE,n.rightSE.consumedBy=r.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const r=this._afterState.rings,n=this._afterState.windings,i=this._afterState.multiPolys;for(let u=0,c=this.rings.length;u<c;u++){const f=this.rings[u],m=this.windings[u],_=r.indexOf(f);_===-1?(r.push(f),n.push(m)):n[_]+=m}const o=[],a=[];for(let u=0,c=r.length;u<c;u++){if(n[u]===0)continue;const f=r[u],m=f.poly;if(a.indexOf(m)===-1)if(f.isExterior)o.push(m);else{a.indexOf(m)===-1&&a.push(m);const _=o.indexOf(f.poly);_!==-1&&o.splice(_,1)}}for(let u=0,c=o.length;u<c;u++){const f=o[u].multiPoly;i.indexOf(f)===-1&&i.push(f)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const t=this.beforeState().multiPolys,r=this.afterState().multiPolys;switch(yc.type){case"union":{const n=t.length===0,i=r.length===0;this._isInResult=n!==i;break}case"intersection":{let n,i;t.length<r.length?(n=t.length,i=r.length):(n=r.length,i=t.length),this._isInResult=i===yc.numMultiPolys&&n<i;break}case"xor":{const n=Math.abs(t.length-r.length);this._isInResult=n%2===1;break}case"difference":{const n=i=>i.length===1&&i[0].isSubject;this._isInResult=n(t)!==n(r);break}default:throw new Error(`Unrecognized operation type found ${yc.type}`)}return this._isInResult}}class Sw{constructor(t,r,n){if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=r,this.isExterior=n,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=Fm.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let o=i;for(let a=1,u=t.length;a<u;a++){if(typeof t[a][0]!="number"||typeof t[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=Fm.round(t[a][0],t[a][1]);c.x===o.x&&c.y===o.y||(this.segments.push(_p.fromRing(o,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),o=c)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(_p.fromRing(o,i,this))}getSweepEvents(){const t=[];for(let r=0,n=this.segments.length;r<n;r++){const i=this.segments[r];t.push(i.leftSE),t.push(i.rightSE)}return t}}class U0e{constructor(t,r){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Sw(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,i=t.length;n<i;n++){const o=new Sw(t[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=r}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let r=0,n=this.interiorRings.length;r<n;r++){const i=this.interiorRings[r].getSweepEvents();for(let o=0,a=i.length;o<a;o++)t.push(i[o])}return t}}class Aw{constructor(t,r){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,i=t.length;n<i;n++){const o=new U0e(t[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=r}getSweepEvents(){const t=[];for(let r=0,n=this.polys.length;r<n;r++){const i=this.polys[r].getSweepEvents();for(let o=0,a=i.length;o<a;o++)t.push(i[o])}return t}}class y_{static factory(t){const r=[];for(let n=0,i=t.length;n<i;n++){const o=t[n];if(!o.isInResult()||o.ringOut)continue;let a=null,u=o.leftSE,c=o.rightSE;const f=[u],m=u.point,_=[];for(;a=u,u=c,f.push(u),u.point!==m;)for(;;){const b=u.getAvailableLinkedEvents();if(b.length===0){const R=f[0].point,P=f[f.length-1].point;throw new Error(`Unable to complete output ring starting at [${R.x}, ${R.y}]. Last matching segment found ends at [${P.x}, ${P.y}].`)}if(b.length===1){c=b[0].otherSE;break}let A=null;for(let R=0,P=_.length;R<P;R++)if(_[R].point===u.point){A=R;break}if(A!==null){const R=_.splice(A)[0],P=f.splice(R.index);P.unshift(P[0].otherSE),r.push(new y_(P.reverse()));continue}_.push({index:f.length,point:u.point});const w=u.getLeftmostComparator(a);c=b.sort(w)[0].otherSE;break}r.push(new y_(f))}return r}constructor(t){this.events=t;for(let r=0,n=t.length;r<n;r++)t[r].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const r=[t];for(let f=1,m=this.events.length-1;f<m;f++){const _=this.events[f].point,b=this.events[f+1].point;xw(_,t,b)!==0&&(r.push(_),t=_)}if(r.length===1)return null;const n=r[0],i=r[1];xw(n,t,i)===0&&r.shift(),r.push(r[0]);const o=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:r.length-1,u=this.isExteriorRing()?r.length:-1,c=[];for(let f=a;f!=u;f+=o)c.push([r[f].x,r[f].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let i=1,o=this.events.length;i<o;i++){const a=this.events[i];Hl.compare(t,a)>0&&(t=a)}let r=t.segment.prevInResult(),n=r?r.prevInResult():null;for(;;){if(!r)return null;if(!n)return r.ringOut;if(n.ringOut!==r.ringOut)return n.ringOut.enclosingRing()!==r.ringOut?r.ringOut:r.ringOut.enclosingRing();r=n.prevInResult(),n=r?r.prevInResult():null}}}class Tw{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(let r=0,n=this.interiorRings.length;r<n;r++){const i=this.interiorRings[r].getGeom();i!==null&&t.push(i)}return t}}class z0e{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let r=0,n=this.polys.length;r<n;r++){const i=this.polys[r].getGeom();i!==null&&t.push(i)}return t}_composePolys(t){const r=[];for(let n=0,i=t.length;n<i;n++){const o=t[n];if(!o.poly)if(o.isExteriorRing())r.push(new Tw(o));else{const a=o.enclosingRing();a.poly||r.push(new Tw(a)),a.poly.addInterior(o)}}return r}}class $0e{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_p.compare;this.queue=t,this.tree=new yb(r),this.segments=[]}process(t){const r=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(r),n;const i=t.isLeft?this.tree.add(r):this.tree.find(r);if(!i)throw new Error(`Unable to find segment #${r.id} [${r.leftSE.point.x}, ${r.leftSE.point.y}] -> [${r.rightSE.point.x}, ${r.rightSE.point.y}] in SweepLine tree.`);let o=i,a=i,u,c;for(;u===void 0;)o=this.tree.prev(o),o===null?u=null:o.key.consumedBy===void 0&&(u=o.key);for(;c===void 0;)a=this.tree.next(a),a===null?c=null:a.key.consumedBy===void 0&&(c=a.key);if(t.isLeft){let f=null;if(u){const _=u.getIntersection(r);if(_!==null&&(r.isAnEndpoint(_)||(f=_),!u.isAnEndpoint(_))){const b=this._splitSafely(u,_);for(let A=0,w=b.length;A<w;A++)n.push(b[A])}}let m=null;if(c){const _=c.getIntersection(r);if(_!==null&&(r.isAnEndpoint(_)||(m=_),!c.isAnEndpoint(_))){const b=this._splitSafely(c,_);for(let A=0,w=b.length;A<w;A++)n.push(b[A])}}if(f!==null||m!==null){let _=null;f===null?_=m:m===null?_=f:_=Hl.comparePoints(f,m)<=0?f:m,this.queue.remove(r.rightSE),n.push(r.rightSE);const b=r.split(_);for(let A=0,w=b.length;A<w;A++)n.push(b[A])}n.length>0?(this.tree.remove(r),n.push(t)):(this.segments.push(r),r.prev=u)}else{if(u&&c){const f=u.getIntersection(c);if(f!==null){if(!u.isAnEndpoint(f)){const m=this._splitSafely(u,f);for(let _=0,b=m.length;_<b;_++)n.push(m[_])}if(!c.isAnEndpoint(f)){const m=this._splitSafely(c,f);for(let _=0,b=m.length;_<b;_++)n.push(m[_])}}}this.tree.remove(r)}return n}_splitSafely(t,r){this.tree.remove(t);const n=t.rightSE;this.queue.remove(n);const i=t.split(r);return i.push(n),t.consumedBy===void 0&&this.tree.add(t),i}}const ww=typeof process<"u"&&CO.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,V0e=typeof process<"u"&&CO.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class j0e{run(t,r,n){yc.type=t,Fm.reset();const i=[new Aw(r,!0)];for(let _=0,b=n.length;_<b;_++)i.push(new Aw(n[_],!1));if(yc.numMultiPolys=i.length,yc.type==="difference"){const _=i[0];let b=1;for(;b<i.length;)Bx(i[b].bbox,_.bbox)!==null?b++:i.splice(b,1)}if(yc.type==="intersection")for(let _=0,b=i.length;_<b;_++){const A=i[_];for(let w=_+1,R=i.length;w<R;w++)if(Bx(A.bbox,i[w].bbox)===null)return[]}const o=new yb(Hl.compare);for(let _=0,b=i.length;_<b;_++){const A=i[_].getSweepEvents();for(let w=0,R=A.length;w<R;w++)if(o.insert(A[w]),o.size>ww)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const a=new $0e(o);let u=o.size,c=o.pop();for(;c;){const _=c.key;if(o.size===u){const A=_.segment;throw new Error(`Unable to pop() ${_.isLeft?"left":"right"} SweepEvent [${_.point.x}, ${_.point.y}] from segment #${A.id} [${A.leftSE.point.x}, ${A.leftSE.point.y}] -> [${A.rightSE.point.x}, ${A.rightSE.point.y}] from queue.`)}if(o.size>ww)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>V0e)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const b=a.process(_);for(let A=0,w=b.length;A<w;A++){const R=b[A];R.consumedBy===void 0&&o.insert(R)}u=o.size,c=o.pop()}Fm.reset();const f=y_.factory(a.segments);return new z0e(f).getGeom()}}const yc=new j0e,H0e=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return yc.run("union",e,r)},G0e=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return yc.run("intersection",e,r)},W0e=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return yc.run("xor",e,r)},X0e=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return yc.run("difference",e,r)};var Y0e={union:H0e,intersection:G0e,xor:W0e,difference:X0e};function Z0e(e,t,r){r===void 0&&(r={});var n=eE(e),i=eE(t),o=Y0e.union(n.coordinates,i.coordinates);return o.length===0?null:o.length===1?f5(o[0],r.properties):SL(o,r.properties)}var q0e=function(){function e(){Ht(this,e)}return jt(e,[{key:"getCombineFeature",value:function(r){var n=null,i=r[0];return r.map(function(o){var a=f5(o.coordinates);n===null?n=a:n=Z0e(n,a)}),i&&(n.properties=Qe({},i)),n}}]),e}(),Iv="select",Mv="active",K0e=function(){function e(t){var r=t.layerService,n=t.tileLayerService,i=t.parent;Ht(this,e),F(this,"tilePickID",new Map),this.layerService=r,this.tileLayerService=n,this.parent=i,this.tileSourceService=new q0e}return jt(e,[{key:"pickRender",value:function(r){var n=this.tileLayerService.getVisibleTileBylngLat(r.lngLat);if(n){var i=n.getMainLayer();i==null||i.layerPickService.pickRender(r)}}},{key:"pick",value:function(){var t=Mt(he.mark(function n(i,o){var a,u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(a=this.parent.getContainer(),u=a.get(wt.IPickingService),i.type!=="RasterLayer"){_.next=8;break}if(c=this.tileLayerService.getVisibleTileBylngLat(o.lngLat),!(c&&c.getMainLayer()!==void 0)){_.next=7;break}return f=c.getMainLayer(),_.abrupt("return",f.layerPickService.pickRasterLayer(f,o,this.parent));case 7:return _.abrupt("return",!1);case 8:return this.pickRender(o),_.abrupt("return",u.pickFromPickingFBO(i,o));case 10:case"end":return _.stop()}},n,this)}));function r(n,i){return t.apply(this,arguments)}return r}()},{key:"selectFeature",value:function(r){var n=Nn(r,3),i=n[0],o=n[1],a=n[2],u=this.color2PickId(i,o,a);this.tilePickID.set(Iv,u),this.updateHighLight(i,o,a,Iv)}},{key:"highlightPickedFeature",value:function(r){var n=Nn(r,3),i=n[0],o=n[1],a=n[2],u=this.color2PickId(i,o,a);this.tilePickID.set(Mv,u),this.updateHighLight(i,o,a,Mv)}},{key:"updateHighLight",value:function(r,n,i,o){this.tileLayerService.tiles.map(function(a){var u=a.getMainLayer();switch(o){case Iv:u==null||u.hooks.beforeSelect.call([r,n,i]);break;case Mv:u==null||u.hooks.beforeHighlight.call([r,n,i]);break}})}},{key:"setPickState",value:function(){var r=this.tilePickID.get(Iv),n=this.tilePickID.get(Mv);if(r){var i=this.pickId2Color(r),o=Nn(i,3),a=o[0],u=o[1],c=o[2];this.updateHighLight(a,u,c,Iv);return}if(n){var f=this.pickId2Color(n),m=Nn(f,3),_=m[0],b=m[1],A=m[2];this.updateHighLight(_,b,A,Mv);return}}},{key:"color2PickId",value:function(r,n,i){return x1(new Uint8Array([r,n,i]))}},{key:"pickId2Color",value:function(r){return sh(r)}},{key:"getFeatureById",value:function(r){var n=this.tileLayerService.getTiles().filter(function(o){return o.visible}),i=[];return n.forEach(function(o){i.push.apply(i,nr(o.getFeatureById(r)))}),i}},{key:"pickRasterLayer",value:function(r,n,i){return!1}}]),e}();function Q0e(e){return e==="PolygonLayer"?s_:e==="LineLayer"?sb:Om}function J0e(e){return["PolygonLayer","LineLayer"].indexOf(e)!==-1}function eve(e){var t=tve();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function tve(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var D1=function(e){_n(r,e);var t=eve(r);function r(n,i){var o;return Ht(this,r),o=t.call(this),F($e(o),"visible",!0),F($e(o),"layers",[]),F($e(o),"isLoaded",!1),F($e(o),"tileMaskLayers",[]),o.parent=i,o.sourceTile=n,o.x=n.x,o.y=n.y,o.z=n.z,o.key="".concat(o.x,"_").concat(o.y,"_").concat(o.z),o}return jt(r,[{key:"getLayers",value:function(){return this.layers}},{key:"styleUpdate",value:function(){}},{key:"lnglatInBounds",value:function(i){var o=Nn(this.sourceTile.bounds,4),a=o[0],u=o[1],c=o[2],f=o[3],m=i.lng,_=i.lat;return m>=a&&m<=c&&_>=u&&_<=f}},{key:"getLayerOptions",value:function(){var i,o=this.parent.getLayerConfig();return Qe(Qe({},o),{},{textAllowOverlap:!0,autoFit:!1,maskLayers:this.getMaskLayer(),tileMask:J0e(this.parent.type),mask:o.mask||((i=o.maskLayers)===null||i===void 0?void 0:i.length)!==0&&o.enableMask})}},{key:"getMaskLayer",value:function(){var i=this,o=this.parent.getLayerConfig(),a=o.maskLayers,u=[];return a==null||a.forEach(function(c){if(!c.tileLayer)return u.push(c),c;var f=c.tileLayer,m=f.getTile(i.sourceTile.key),_=m==null?void 0:m.getLayers()[0];_&&u.push(_)}),u}},{key:"addTileMask",value:function(){var n=Mt(he.mark(function o(){var a,u,c;return he.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return a=new s_({name:"mask",visible:!0,enablePicking:!1}).source({type:"FeatureCollection",features:[this.sourceTile.bboxPolygon]},{parser:{type:"geojson",featureId:"id"}}).shape("fill").color("#0f0").style({opacity:.5}),u=om(this.parent.sceneContainer),a.setContainer(u,this.parent.sceneContainer),m.next=5,a.init();case 5:return this.tileMask=a,c=this.getMainLayer(),c!==void 0&&(c.tileMask=a),m.abrupt("return",a);case 9:case"end":return m.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"addMask",value:function(){var n=Mt(he.mark(function o(a,u){var c;return he.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return c=om(this.parent.sceneContainer),u.setContainer(c,this.parent.sceneContainer),m.next=4,u.init();case 4:a.addMask(u),this.tileMaskLayers.push(u);case 6:case"end":return m.stop()}},o,this)}));function i(o,a){return n.apply(this,arguments)}return i}()},{key:"addLayer",value:function(){var n=Mt(he.mark(function o(a){var u;return he.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return a.isTileLayer=!0,u=om(this.parent.sceneContainer),a.setContainer(u,this.parent.sceneContainer),this.layers.push(a),f.next=6,a.init();case 6:case"end":return f.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"updateVisible",value:function(i){this.visible=i,this.updateOptions("visible",i)}},{key:"updateOptions",value:function(i,o){this.layers.forEach(function(a){a.updateLayerConfig(F({},i,o))})}},{key:"getMainLayer",value:function(){return this.layers[0]}},{key:"getFeatures",value:function(i){return[]}},{key:"getFeatureById",value:function(i){return[]}},{key:"destroy",value:function(){var i;(i=this.tileMask)===null||i===void 0||i.destroy(),this.layers.forEach(function(o){return o.destroy()})}}]),r}(ju.EventEmitter);function rve(e){var t=nve();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function nve(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ive=function(e){_n(r,e);var t=rve(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"initTileLayer",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return a=this.getSourceOption(),u=a.data.features[0].properties,c=new sb().source(a.data,a.options).size(1).shape("line").color("red"),f=new Om({minZoom:this.z-1,maxZoom:this.z+1,textAllowOverlap:!0}).source([u],{parser:{type:"json",x:"x",y:"y"}}).size(20).color("red").shape(this.key).style({stroke:"#fff",strokeWidth:2}),_.next=6,this.addLayer(c);case 6:return _.next=8,this.addLayer(f);case 8:this.isLoaded=!0;case 9:case"end":return _.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),o=this.sourceTile.data.layers.testTile.features;return{data:{type:"FeatureCollection",features:o},options:{parser:{type:"geojson"},transforms:i.transforms}}}}]),r}(D1);function ave(e){var t=ove();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function ove(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var sve=function(e){_n(r,e);var t=ave(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"initTileLayer",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return a=this.parent.getLayerAttributeConfig(),u=this.getLayerOptions(),c=this.getSourceOption(),f=new $ce(Qe({},u)).source(c.data,c.options),a&&Object.keys(a).forEach(function(b){var A,w,R=b;f[R]((A=a[R])===null||A===void 0?void 0:A.field,(w=a[R])===null||w===void 0?void 0:w.values)}),_.next=7,this.addLayer(f);case 7:this.isLoaded=!0;case 8:case"end":return _.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource();return{data:this.sourceTile.data,options:{parser:{type:"image",extent:this.sourceTile.bounds},transforms:i.transforms}}}}]),r}(D1);function uve(e){var t=lve();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function lve(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var cve=function(e){_n(r,e);var t=uve(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"initTileLayer",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return a=this.parent.getLayerAttributeConfig(),u=this.getLayerOptions(),c=this.getSourceOption(),f=new WP(Qe({},u)).source(c.data,c.options),a&&Object.keys(a).forEach(function(b){var A,w,R=b;f[R]((A=a[R])===null||A===void 0?void 0:A.field,(w=a[R])===null||w===void 0?void 0:w.values)}),_.next=7,this.addLayer(f);case 7:this.isLoaded=!0;case 8:case"end":return _.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getFeatures",value:function(i){if(!i)return[];var o=this.sourceTile.data;return o.getTileData(i)}},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),o=this.parent.getLayerConfig(),a=o.sourceLayer,u=o.featureId,c=this.getFeatures(a);return{data:{type:"FeatureCollection",features:c},options:{parser:{type:"geojson",featureId:u},transforms:i.transforms}}}}]),r}(D1),fve=["rasterData"];function hve(e){var t=pve();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function pve(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var dve=function(e){_n(r,e);var t=hve(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"initTileLayer",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return a=this.parent.getLayerAttributeConfig(),u=this.getLayerOptions(),c=this.getSourceOption(),f=new ub(Qe({},u)).source(c.data,c.options),a&&Object.keys(a).forEach(function(b){var A,w,R=b;f[R]((A=a[R])===null||A===void 0?void 0:A.field,(w=a[R])===null||w===void 0?void 0:w.values)}),_.next=7,this.addLayer(f);case 7:this.isLoaded=!0;case 8:case"end":return _.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),o=this.sourceTile.data.data,a=o.rasterData,u=hl(o,fve);return{data:a,options:{parser:Qe({type:"rasterRgb",extent:this.sourceTile.bounds},u),transforms:i.transforms}}}}]),r}(D1);function vve(e){var t=mve();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function mve(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var gve=function(e){_n(r,e);var t=vve(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"initTileLayer",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f;return he.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return a=this.parent.getLayerAttributeConfig(),u=this.getLayerOptions(),c=this.getSourceOption(),f=new ub(Qe({},u)).source(c.data,c.options),a&&Object.keys(a).forEach(function(b){var A,w,R=b;f[R]((A=a[R])===null||A===void 0?void 0:A.field,(w=a[R])===null||w===void 0?void 0:w.values)}),_.next=7,this.addLayer(f);case 7:this.isLoaded=!0;case 8:case"end":return _.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource();return{data:this.sourceTile.data,options:{parser:{type:"image",extent:this.sourceTile.bounds},transforms:i.transforms}}}}]),r}(D1),_ve=["rasterData"];function yve(e){var t=xve();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function xve(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var bve={positions:[0,1],colors:["#000","#fff"]},Eve=function(e){_n(r,e);var t=yve(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"initTileLayer",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f,m,_,b;return he.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return a=this.parent.getLayerAttributeConfig(),u=this.getLayerOptions(),c=this.getSourceOption(),f=this.getLayerOptions(),m=f.rampColors,_=f.domain,this.colorTexture=this.parent.textureService.getColorTexture(m,_),b=new ub(Qe(Qe({},u),{},{colorTexture:this.colorTexture})).source(c.data,c.options),a&&Object.keys(a).forEach(function(R){var P,k,L=R;b[L]((P=a[L])===null||P===void 0?void 0:P.field,(k=a[L])===null||k===void 0?void 0:k.values)}),w.next=9,this.addLayer(b);case 9:this.isLoaded=!0;case 10:case"end":return w.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),o=this.sourceTile.data.data,a=o.rasterData,u=hl(o,_ve);return{data:a,options:{parser:Qe({type:"raster",extent:this.sourceTile.bounds},u),transforms:i.transforms}}}},{key:"styleUpdate",value:function(){for(var i=this,o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];var c=a,f=c.rampColors,m=f===void 0?bve:f,_=c.domain;this.colorTexture=this.parent.textureService.getColorTexture(m,_||g5(m)),this.layers.forEach(function(b){return b.style({colorTexture:i.colorTexture})})}},{key:"destroy",value:function(){this.layers.forEach(function(i){return i.destroy()})}}]),r}(D1);function Sve(e){var t=Ave();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function Ave(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ig=function(e){_n(r,e);var t=Sve(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"initTileLayer",value:function(){var n=Mt(he.mark(function o(){var a,u,c,f,m;return he.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(a=this.parent.getLayerAttributeConfig(),u=this.getLayerOptions(),c=Q0e(this.parent.type),f=this.getSourceOption(),f){b.next=8;break}return this.isLoaded=!0,this.emit("loaded"),b.abrupt("return");case 8:return m=new c(Qe({},u)).source(f.data,f.options),Object.keys(a).forEach(function(A){var w,R,P=A;m[P]((w=a[P])===null||w===void 0?void 0:w.field,(R=a[P])===null||R===void 0?void 0:R.values)}),b.next=12,this.addLayer(m);case 12:if(!u.tileMask){b.next=15;break}return b.next=15,this.addTileMask();case 15:this.setLayerMinMaxZoom(m),this.isLoaded=!0,this.emit("loaded");case 18:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),o=this.parent.getLayerConfig(),a=o.sourceLayer,u=a===void 0?"defaultLayer":a,c=o.featureId,f=c===void 0?"id":c,m=this.getFeatures(u);return{data:{type:"FeatureCollection",features:m},options:{parser:{type:"geojson",featureId:f},transforms:i.transforms}}}},{key:"setLayerMinMaxZoom",value:function(i){i.getModelType()==="text"&&i.updateLayerConfig({maxZoom:this.z+1,minZoom:this.z-1})}},{key:"getFeatures",value:function(i){var o=this.sourceTile.data;return o.getTileData(i)}},{key:"getFeatureById",value:function(i){var o=this.getMainLayer();if(!o)return[];var a=o.getSource().data.dataArray.filter(function(u){return u._id===i});return a}}]),r}(D1);function Tve(e){var t=e.type;switch(t){case"PolygonLayer":return ig;case"LineLayer":return ig;case"PointLayer":return ig;case"TileDebugLayer":return ive;case"MaskLayer":return cve;case"RasterLayer":var r=e.getSource().parser.dataType;switch(r){case Ns.RGB:case Ns.CUSTOMRGB:return dve;case Ns.ARRAYBUFFER:case Ns.CUSTOMARRAYBUFFER:return Eve;case Ns.TERRAINRGB:case Ns.CUSTOMTERRAINRGB:return gve;default:return sve}default:return ig}}var wve=["shape","color","size","style","animate","filter","rotate","scale","setBlend","setSelect","setActive","disableMask","enableMask","addMask","removeMask"],Cve=Ci.debounce,Cw=function(){function e(t){var r=this;Ht(this,e),F(this,"initedTileset",!1),F(this,"mapchange",function(){var i;if(r.parent.isVisible()!==!1){var o=r.getCurrentView(),a=o.latLonBounds,u=o.zoom;if(r.mapService.version==="GAODE1.x"){var c=r.parent.getLayerConfig(),f=c.visible;u<2&&f?(r.parent.updateLayerConfig({visible:!1}),r.layerService.reRender()):u>=2&&!f&&(r.parent.updateLayerConfig({visible:!0}),r.layerService.reRender())}r.lastViewStates&&r.lastViewStates.zoom===u&&r.lastViewStates.latLonBounds.toString()===a.toString()||(r.lastViewStates={zoom:u,latLonBounds:a},(i=r.tilesetManager)===null||i===void 0||i.throttleUpdate(u,a))}}),F(this,"viewchange",Cve(this.mapchange,24)),this.parent=t;var n=this.parent.getContainer();this.rendererService=n.get(wt.IRendererService),this.layerService=n.get(wt.ILayerService),this.mapService=n.get(wt.IMapService),this.pickingService=n.get(wt.IPickingService),this.tileLayerService=new y0e({rendererService:this.rendererService,layerService:this.layerService,parent:t}),this.tilePickService=new K0e({tileLayerService:this.tileLayerService,layerService:this.layerService,parent:t}),this.parent.setLayerPickService(this.tilePickService),this.proxy(t),this.initTileSetManager()}return jt(e,[{key:"initTileSetManager",value:function(){var r,n=this.parent.getSource();if(this.tilesetManager=n.tileset,this.initedTileset||(this.bindTilesetEvent(),this.initedTileset=!0),this.parent.isVisible()!==!1){var i=this.getCurrentView(),o=i.latLonBounds,a=i.zoom;(r=this.tilesetManager)===null||r===void 0||r.update(a,o)}}},{key:"getCurrentView",value:function(){var r=this.mapService.getBounds(),n=[r[0][0],r[0][1],r[1][0],r[1][1]],i=this.mapService.getZoom();return{latLonBounds:n,zoom:i}}},{key:"bindTilesetEvent",value:function(){var r=this;this.tilesetManager.on("tile-loaded",function(n){}),this.tilesetManager.on("tile-unload",function(n){r.tileUnLoad(n)}),this.tilesetManager.on("tile-error",function(n,i){r.tileError(n)}),this.tilesetManager.on("tile-update",function(){r.tileUpdate()}),this.mapService.on("zoomend",this.mapchange),this.mapService.on("moveend",this.viewchange)}},{key:"render",value:function(){this.tileLayerService.render()}},{key:"getLayers",value:function(){return this.tileLayerService.getLayers()}},{key:"getTiles",value:function(){return this.tileLayerService.getTiles()}},{key:"getTile",value:function(r){return this.tileLayerService.getTile(r)}},{key:"tileLoaded",value:function(r){}},{key:"tileError",value:function(r){console.warn("error:",r)}},{key:"destroy",value:function(){var r;this.mapService.off("zoomend",this.mapchange),this.mapService.off("moveend",this.viewchange),(r=this.tilesetManager)===null||r===void 0||r.destroy(),this.tileLayerService.destroy()}},{key:"reload",value:function(){var r;this.tilesetManager.clear();var n=this.getCurrentView(),i=n.latLonBounds,o=n.zoom;(r=this.tilesetManager)===null||r===void 0||r.update(o,i)}},{key:"tileUnLoad",value:function(r){this.tileLayerService.removeTile(r.key)}},{key:"tileUpdate",value:function(){var t=Mt(he.mark(function n(){var i=this,o,a,u;return he.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(this.tilesetManager){f.next=2;break}return f.abrupt("return");case 2:return o=this.parent.getMinZoom(),a=this.parent.getMaxZoom(),u=this.tilesetManager.tiles.filter(function(m){return m.isLoaded}).filter(function(m){return m.isVisibleChange}).filter(function(m){return m.data}).filter(function(m){return m.z>=o&&m.z<a}),f.next=7,Promise.all(u.map(function(){var m=Mt(he.mark(function _(b){var A,w;return he.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(i.tileLayerService.hasTile(b.key)){P.next=9;break}return A=Tve(i.parent),w=new A(b,i.parent),P.next=5,w.initTileLayer();case 5:i.tilePickService.setPickState(),w.getLayers().length!==0&&(i.tileLayerService.addTile(w),i.tileLayerService.updateTileVisible(b),i.layerService.reRender()),P.next=12;break;case 9:i.tileLayerService.updateTileVisible(b),i.tilePickService.setPickState(),i.layerService.reRender();case 12:case"end":return P.stop()}},_)}));return function(_){return m.apply(this,arguments)}}()));case 7:this.tilesetManager.isLoaded&&this.parent.emit("tiles-loaded",this.tilesetManager.currentTiles);case 8:case"end":return f.stop()}},n,this)}));function r(){return t.apply(this,arguments)}return r}()},{key:"setPickState",value:function(r){}},{key:"pickRender",value:function(r){this.tilePickService.pickRender(r)}},{key:"selectFeature",value:function(r){this.tilePickService.selectFeature(r)}},{key:"highlightPickedFeature",value:function(r){this.tilePickService.highlightPickedFeature(r)}},{key:"proxy",value:function(r){var n=this;wve.forEach(function(i){var o=r[i].bind(r);r[i]=function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];return o.apply(void 0,u),n.getLayers().map(function(f){f[i].apply(f,u)}),i==="style"&&n.getTiles().forEach(function(f){return f.styleUpdate.apply(f,u)}),r}})}}]),e}(),Rw,Iw,Rve=(Rw=ai(),Rw(Iw=function(){function e(){Ht(this,e)}return jt(e,[{key:"build",value:function(){var t=Mt(he.mark(function n(i){return he.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return i.prepareBuildModel(),a.next=3,i.buildModels();case 3:case"end":return a.stop()}},n)}));function r(n){return t.apply(this,arguments)}return r}()},{key:"initLayerModel",value:function(){var t=Mt(he.mark(function n(i){return he.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.build(i);case 2:i.styleNeedUpdate=!1;case 3:case"end":return a.stop()}},n,this)}));function r(n){return t.apply(this,arguments)}return r}()},{key:"prepareLayerModel",value:function(){var t=Mt(he.mark(function n(i){return he.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.build(i);case 2:i.styleNeedUpdate=!1;case 3:case"end":return a.stop()}},n,this)}));function r(n){return t.apply(this,arguments)}return r}()},{key:"apply",value:function(r){var n=this;r.hooks.init.tapPromise("LayerModelPlugin",Mt(he.mark(function i(){return he.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(!r.getSource().isTile){a.next=4;break}return r.prepareBuildModel(),r.tileLayer=new Cw(r),a.abrupt("return");case 4:return r.log(Ho.BuildModelStart,ps.INIT),a.next=7,n.initLayerModel(r);case 7:r.log(Ho.BuildModelEnd,ps.INIT);case 8:case"end":return a.stop()}},i)}))),r.hooks.beforeRenderData.tapPromise("LayerModelPlugin",function(){var i=Mt(he.mark(function o(a){return he.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(a){c.next=2;break}return c.abrupt("return",!1);case 2:if(!r.getSource().isTile){c.next=5;break}return r.tileLayer=new Cw(r),c.abrupt("return",!1);case 5:return r.log(Ho.BuildModelStart,ps.UPDATE),c.next=8,n.prepareLayerModel(r);case 8:return r.log(Ho.BuildModelEnd,ps.UPDATE),c.abrupt("return",!0);case 10:case"end":return c.stop()}},o)}));return function(o){return i.apply(this,arguments)}}())}}]),e}())||Iw),Mw,Pw,Ive=(Mw=ai(),Mw(Pw=function(){function e(){Ht(this,e)}return jt(e,[{key:"apply",value:function(r){r.hooks.afterInit.tap("LayerStylePlugin",function(){var n=r.getLayerConfig(),i=n.autoFit,o=n.fitBoundsOptions;i&&r.fitBounds(o),r.styleNeedUpdate=!1})}}]),e}())||Pw),Ow,kw,Mve=["type"],Dw={directional:{lights:"u_DirectionalLights",num:"u_NumOfDirectionalLights"},spot:{lights:"u_SpotLights",num:"u_NumOfSpotLights"}},Pve={type:"directional",direction:[1,10.5,12],ambient:[.2,.2,.2],diffuse:[.6,.6,.6],specular:[.1,.1,.1]},Ove={direction:[0,0,0],ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0]},kve={position:[0,0,0],direction:[0,0,0],ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],constant:1,linear:0,quadratic:0,angle:14,exponent:40,blur:5};function Dve(e){var t={u_DirectionalLights:new Array(3).fill(Qe({},Ove)),u_NumOfDirectionalLights:0,u_SpotLights:new Array(3).fill(Qe({},kve)),u_NumOfSpotLights:0};return(!e||!e.length)&&(e=[Pve]),e.forEach(function(r){var n=r.type,i=n===void 0?"directional":n,o=hl(r,Mve),a=Dw[i].lights,u=Dw[i].num,c=t[u];t[a][c]=Qe(Qe({},t[a][c]),o),t[u]++}),t}var Fve=(Ow=ai(),Ow(kw=function(){function e(){Ht(this,e)}return jt(e,[{key:"apply",value:function(r){r.hooks.beforeRender.tap("LightingPlugin",function(){var n=r.getLayerConfig(),i=n.enableLighting;i&&r.models.forEach(function(o){return o.addUniforms(Qe({},Dve()))})})}}]),e}())||kw),Fw,Bw,Bve=(Fw=ai(),Fw(Bw=function(){function e(){Ht(this,e)}return jt(e,[{key:"apply",value:function(r,n){var i=this,o=n.rendererService,a=n.postProcessingPassFactory,u=n.normalPassFactory;r.hooks.init.tapPromise("MultiPassRendererPlugin",function(){var c=r.getLayerConfig(),f=c.enableMultiPassRenderer,m=c.passes,_=m===void 0?[]:m;i.enabled=!!f&&r.getLayerConfig().enableMultiPassRenderer!==!1,i.enabled&&(r.multiPassRenderer=MP(r,_,a,u),r.multiPassRenderer.setRenderFlag(!0))}),r.hooks.beforeRender.tap("MultiPassRendererPlugin",function(){if(i.enabled){var c=o.getViewportSize(),f=c.width,m=c.height;r.multiPassRenderer.resize(f,m)}})}}]),e}())||Bw),Lw,Nw,Lve=Ci.isNumber,Id={NONE:0,ENCODE:1,HIGHLIGHT:2},Nve=(Lw=ai(),Lw(Nw=function(){function e(){Ht(this,e)}return jt(e,[{key:"pickOption2Array",value:function(){var r=[];return this.pickingUniformMap.forEach(function(n,i){Lve(n)?r.push(n):r.push.apply(r,nr(n))}),r}},{key:"updatePickOption",value:function(r,n){var i=this;Object.keys(r).forEach(function(c){i.pickingUniformMap.set(c,r[c])});var o=n.getLayerConfig().pickingBuffer||0,a=Number(n.getShaderPickStat());this.pickingUniformMap.set("u_PickingBuffer",o),this.pickingUniformMap.set("u_shaderPick",a);var u=n.getPickingUniformBuffer();u.subData({offset:0,data:this.pickOption2Array()})}},{key:"apply",value:function(r,n){var i=this;n.rendererService;var o=n.styleAttributeService;this.pickingUniformMap=new Map([["u_HighlightColor",[1,0,0,1]],["u_SelectColor",[1,0,0,1]],["u_PickingColor",[0,0,0]],["u_PickingStage",0],["u_CurrentSelectedId",[0,0,0]],["u_PickingThreshold",10],["u_PickingBuffer",0],["u_shaderPick",0],["u_EnableSelect",0],["u_activeMix",0]]),r.hooks.init.tapPromise("PixelPickingPlugin",function(){var a=r.getLayerConfig(),u=a.enablePicking;o.registerStyleAttribute({name:"pickingColor",type:wn.Attribute,descriptor:{name:"a_PickingColor",shaderLocation:Vn.PICKING_COLOR,buffer:{data:[],type:W.FLOAT},size:3,update:function(f){var m=f.id;return u?sh(m):[0,0,0]}}})}),r.hooks.beforePickingEncode.tap("PixelPickingPlugin",function(){var a=r.getLayerConfig(),u=a.enablePicking;u&&r.isVisible()&&(i.updatePickOption({u_PickingStage:Id.ENCODE},r),r.models.forEach(function(c){return c.addUniforms({u_PickingStage:Id.ENCODE})}))}),r.hooks.afterPickingEncode.tap("PixelPickingPlugin",function(){var a=r.getLayerConfig(),u=a.enablePicking;u&&r.isVisible()&&(i.updatePickOption({u_PickingStage:Id.HIGHLIGHT},r),r.models.forEach(function(c){return c.addUniforms({u_PickingStage:Id.HIGHLIGHT})}))}),r.hooks.beforeHighlight.tap("PixelPickingPlugin",function(a){var u=r.getLayerConfig(),c=u.highlightColor,f=u.activeMix,m=f===void 0?0:f,_=typeof c=="string"?Ta(c):c||[1,0,0,1];r.updateLayerConfig({pickedFeatureID:x1(new Uint8Array(a))});var b={u_PickingStage:Id.HIGHLIGHT,u_PickingColor:a,u_HighlightColor:_.map(function(A){return A*255}),u_activeMix:m};i.updatePickOption(b,r),r.models.forEach(function(A){return A.addUniforms(b)})}),r.hooks.beforeSelect.tap("PixelPickingPlugin",function(a){var u=r.getLayerConfig(),c=u.selectColor,f=u.selectMix,m=f===void 0?0:f,_=typeof c=="string"?Ta(c):c||[1,0,0,1];r.updateLayerConfig({pickedFeatureID:x1(new Uint8Array(a))});var b={u_PickingStage:Id.HIGHLIGHT,u_PickingColor:a,u_HighlightColor:_.map(function(A){return A*255}),u_activeMix:m,u_CurrentSelectedId:a,u_SelectColor:_.map(function(A){return A*255}),u_EnableSelect:1};i.updatePickOption(b,r),r.models.forEach(function(A){return A.addUniforms(b)})})}}]),e}())||Nw),Uve=["mvt","geojsonvt","testTile"];function zve(e){var t=e.getSource();return Uve.includes(t.parser.type)}var Uw,zw,$ve=(Uw=ai(),Uw(zw=function(){function e(){Ht(this,e)}return jt(e,[{key:"apply",value:function(r,n){var i=this,o=n.styleAttributeService;r.hooks.init.tapPromise("RegisterStyleAttributePlugin",function(){zve(r)||i.registerBuiltinAttributes(o,r)})}},{key:"registerBuiltinAttributes",value:function(r,n){if(n.type==="MaskLayer"){this.registerPositionAttribute(r);return}this.registerPositionAttribute(r),this.registerColorAttribute(r),this.registerVertexIdAttribute(r)}},{key:"registerPositionAttribute",value:function(r){r.registerStyleAttribute({name:"position",type:wn.Attribute,descriptor:{name:"a_Position",shaderLocation:Vn.POSITION,buffer:{data:[],type:W.FLOAT},size:3,update:function(i,o,a){return a.length===2?[a[0],a[1],0]:[a[0],a[1],a[2]]}}})}},{key:"registerColorAttribute",value:function(r){r.registerStyleAttribute({name:"color",type:wn.Attribute,descriptor:{name:"a_Color",shaderLocation:Vn.COLOR,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:4,update:function(i){var o=i.color;return!o||!o.length?[1,1,1,1]:o}}})}},{key:"registerVertexIdAttribute",value:function(r){r.registerStyleAttribute({name:"vertexId",type:wn.Attribute,descriptor:{name:"a_vertexId",shaderLocation:Vn.VERTEX_ID,buffer:{usage:W.DYNAMIC_DRAW,data:[],type:W.FLOAT},size:1,update:function(i,o){return[o]}}})}}]),e}())||zw),$w,Vw,jw,Hw,Gw,Ww,Xw,l1,Yw,Zw,qw,Kw,Qw,Vve=($w=ai(),Vw=ki(wt.ICameraService),jw=ki(wt.ICoordinateSystemService),Hw=ki(wt.IRendererService),Gw=ki(wt.IMapService),Ww=ki(wt.ILayerService),$w(Xw=(l1=function(){function e(){Ht(this,e),bi(this,"cameraService",Yw,this),bi(this,"coordinateSystemService",Zw,this),bi(this,"rendererService",qw,this),bi(this,"mapService",Kw,this),bi(this,"layerService",Qw,this)}return jt(e,[{key:"apply",value:function(r){var n=this,i=this.mapService.version,o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],a=[0,0],u;this.rendererService.uniformBuffers[0]||(u=this.rendererService.createBuffer({data:new Float32Array(16*4+4*7),isUBO:!0}),this.rendererService.uniformBuffers[0]=u),r.hooks.beforeRender.tap("ShaderUniformPlugin",function(){var c=r.getLayerConfig().tileOrigin;if(n.coordinateSystemService.refresh(c),i==="GAODE2.x"){n.setLayerCenter(r),o=n.mapService.map.customCoords.getMVPMatrix(),a=n.mapService.getCustomCoordCenter();var f=r.getLayerUniformBuffer();f.subData({offset:0,data:new Uint8Array(new Float32Array([].concat(nr(o),nr(a))).buffer)})}var m=n.rendererService.getViewportSize(),_=m.width,b=m.height,A=n.generateUBO(o,a,_,b),w=A.data,R=A.uniforms;if(n.layerService.alreadyInRendering&&n.rendererService.uniformBuffers[0]){var P=n.rendererService.uniformBuffers[0];P.subData({offset:0,data:w})}var k=n.rendererService.queryVerdorInfo();k==="WebGL1"&&r.models.forEach(function(L){L.addUniforms(Qe(Qe({},R),{},{u_PickingBuffer:r.getLayerConfig().pickingBuffer||0,u_shaderPick:Number(r.getShaderPickStat())}))})})}},{key:"setLayerCenter",value:function(r){r.coordCenter===void 0&&(r.coordCenter=r.getSource().center),this.mapService.setCoordCenter&&this.mapService.setCoordCenter(r.coordCenter)}},{key:"generateUBO",value:function(r,n,i,o){var a,u=this.cameraService.getProjectionMatrix(),c=this.cameraService.getViewMatrix(),f=this.cameraService.getViewProjectionMatrix(),m=this.cameraService.getModelMatrix(),_=this.coordinateSystemService.getViewportCenterProjection(),b=this.coordinateSystemService.getPixelsPerDegree(),A=this.cameraService.getZoom(),w=this.coordinateSystemService.getPixelsPerDegree2(),R=this.cameraService.getZoomScale(),P=this.coordinateSystemService.getPixelsPerMeter(),k=this.coordinateSystemService.getCoordinateSystem(),L=this.cameraService.getCameraPosition(),B=window.devicePixelRatio,V=this.coordinateSystemService.getViewportCenter(),G=[i,o],K=this.cameraService.getFocalDistance(),Z=[].concat(nr(c),nr(u),nr(f),nr(m),nr(_),nr(b),[A],nr(w),[R],nr(P),[k],nr(L),[B],nr(V),G,[K,0,0,0]);return{data:Z,uniforms:(a={},F(a,s1.ProjectionMatrix,u),F(a,s1.ViewMatrix,c),F(a,s1.ViewProjectionMatrix,f),F(a,s1.Zoom,A),F(a,s1.ZoomScale,R),F(a,s1.FocalDistance,K),F(a,s1.CameraPosition,L),F(a,a1.CoordinateSystem,k),F(a,a1.ViewportCenter,V),F(a,a1.ViewportCenterProjection,_),F(a,a1.PixelsPerDegree,b),F(a,a1.PixelsPerDegree2,w),F(a,a1.PixelsPerMeter,P),F(a,a1.Mvp,r),F(a,"u_sceneCenterMercator",n),F(a,"u_ViewportSize",G),F(a,"u_ModelMatrix",m),F(a,"u_DevicePixelRatio",B),a)}}}]),e}(),Yw=mi(l1.prototype,"cameraService",[Vw],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Zw=mi(l1.prototype,"coordinateSystemService",[jw],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qw=mi(l1.prototype,"rendererService",[Hw],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Kw=mi(l1.prototype,"mapService",[Gw],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qw=mi(l1.prototype,"layerService",[Ww],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),l1))||Xw),Jw,e9,jve=(Jw=ai(),Jw(e9=function(){function e(){Ht(this,e)}return jt(e,[{key:"apply",value:function(r){r.hooks.beforeRender.tap("UpdateModelPlugin",function(){r.layerModel&&r.layerModel.needUpdate().then(function(n){n&&r.renderLayers()})}),r.hooks.afterRender.tap("UpdateModelPlugin",function(){r.layerModelNeedUpdate=!1})}}]),e}())||e9),t9,r9,Hve=(t9=ai(),t9(r9=function(){function e(){Ht(this,e)}return jt(e,[{key:"apply",value:function(r,n){var i=this,o=n.styleAttributeService;r.hooks.init.tapPromise("UpdateStyleAttributePlugin",function(){i.initStyleAttribute(r,{styleAttributeService:o})}),r.hooks.beforeRender.tap("UpdateStyleAttributePlugin",function(){r.layerModelNeedUpdate||r.inited&&i.updateStyleAttribute(r,{styleAttributeService:o})})}},{key:"updateStyleAttribute",value:function(r,n){var i=n.styleAttributeService,o=i.getLayerStyleAttributes()||[],a=i.getLayerStyleAttribute("filter");if(a&&a.needRegenerateVertices){r.layerModelNeedUpdate=!0,o.forEach(function(u){return u.needRegenerateVertices=!1});return}o.filter(function(u){return u.needRegenerateVertices}).forEach(function(u){i.updateAttributeByFeatureRange(u.name,r.getEncodedData(),u.featureRange.startIndex,u.featureRange.endIndex,r),u.needRegenerateVertices=!1})}},{key:"initStyleAttribute",value:function(r,n){var i=n.styleAttributeService,o=i.getLayerStyleAttributes()||[];o.filter(function(a){return a.needRegenerateVertices}).forEach(function(a){i.updateAttributeByFeatureRange(a.name,r.getEncodedData(),a.featureRange.startIndex,a.featureRange.endIndex),a.needRegenerateVertices=!1})}}]),e}())||r9);Ts.bind(wt.ILayerPlugin).to(e1e).inRequestScope();Ts.bind(wt.ILayerPlugin).to($ve).inRequestScope();Ts.bind(wt.ILayerPlugin).to(m0e).inRequestScope();Ts.bind(wt.ILayerPlugin).to(Jpe).inRequestScope();Ts.bind(wt.ILayerPlugin).to(Ive).inRequestScope();Ts.bind(wt.ILayerPlugin).to(_0e).inRequestScope();Ts.bind(wt.ILayerPlugin).to(Hve).inRequestScope();Ts.bind(wt.ILayerPlugin).to(jve).inRequestScope();Ts.bind(wt.ILayerPlugin).to(Bve).inRequestScope();Ts.bind(wt.ILayerPlugin).to(Vve).inRequestScope();Ts.bind(wt.ILayerPlugin).to(g0e).inRequestScope();Ts.bind(wt.ILayerPlugin).to(Fve).inRequestScope();Ts.bind(wt.ILayerPlugin).to(Nve).inRequestScope();Ts.bind(wt.ILayerPlugin).to(Rve).inRequestScope();Ci.get;function Gve(e,t){var r=typeof my<"u"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx<"u"&&wx!==null&&(typeof wx.request<"u"||typeof wx.miniProgram<"u");if(!(r||n)&&(t||(t=document),!!t)){var i=t.head||t.getElementsByTagName("head")[0];if(!i){i=t.createElement("head");var o=t.body||t.getElementsByTagName("body")[0];o?o.parentNode.insertBefore(i,o):t.documentElement.appendChild(i)}var a=t.createElement("style");return a.type="text/css",a.styleSheet?a.styleSheet.cssText=e:a.appendChild(t.createTextNode(e)),i.appendChild(a),a}}Gve(`.l7-marker-container {
|
|
position: absolute;
|
|
width: 100%;
|
|
height: 100%;
|
|
overflow: hidden;
|
|
}
|
|
.l7-marker {
|
|
position: absolute !important;
|
|
top: 0;
|
|
left: 0;
|
|
z-index: 5;
|
|
cursor: pointer;
|
|
}
|
|
.l7-marker-cluster {
|
|
width: 40px;
|
|
height: 40px;
|
|
background-color: rgba(181, 226, 140, 0.6);
|
|
background-clip: padding-box;
|
|
border-radius: 20px;
|
|
}
|
|
.l7-marker-cluster div {
|
|
width: 30px;
|
|
height: 30px;
|
|
margin-top: 5px;
|
|
margin-left: 5px;
|
|
font: 12px 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
text-align: center;
|
|
background-color: rgba(110, 204, 57, 0.6);
|
|
border-radius: 15px;
|
|
}
|
|
.l7-marker-cluster span {
|
|
line-height: 30px;
|
|
}
|
|
.l7-touch .l7-control-attribution,
|
|
.l7-touch .l7-control-layers,
|
|
.l7-touch .l7-bar {
|
|
-webkit-box-shadow: none;
|
|
box-shadow: none;
|
|
}
|
|
.l7-touch .l7-control-layers,
|
|
.l7-touch .l7-bar {
|
|
background-clip: padding-box;
|
|
border: 2px solid rgba(0, 0, 0, 0.2);
|
|
}
|
|
.mapboxgl-ctrl-logo,
|
|
.amap-logo {
|
|
display: none !important;
|
|
}
|
|
.l7-select-box {
|
|
border: 3px dashed gray;
|
|
border-radius: 2px;
|
|
position: absolute;
|
|
z-index: 999;
|
|
-webkit-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
.l7-control-container {
|
|
font: 12px/1.5 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
}
|
|
.l7-control-container .l7-control {
|
|
position: relative;
|
|
z-index: 999;
|
|
float: left;
|
|
clear: both;
|
|
color: #595959;
|
|
font-size: 12px;
|
|
pointer-events: visiblePainted;
|
|
/* IE 9-10 doesn't have auto */
|
|
pointer-events: auto;
|
|
}
|
|
.l7-control-container .l7-control.l7-control--hide {
|
|
display: none;
|
|
}
|
|
.l7-control-container .l7-top {
|
|
top: 0;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
position: absolute;
|
|
z-index: 999;
|
|
pointer-events: none;
|
|
}
|
|
.l7-control-container .l7-top .l7-control:not(.l7-control--hide) {
|
|
margin-top: 8px;
|
|
}
|
|
.l7-control-container .l7-right {
|
|
right: 0;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
position: absolute;
|
|
z-index: 999;
|
|
pointer-events: none;
|
|
}
|
|
.l7-control-container .l7-right .l7-control:not(.l7-control--hide) {
|
|
margin-right: 8px;
|
|
}
|
|
.l7-control-container .l7-bottom {
|
|
bottom: 0;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
position: absolute;
|
|
z-index: 999;
|
|
pointer-events: none;
|
|
}
|
|
.l7-control-container .l7-bottom .l7-control:not(.l7-control--hide) {
|
|
margin-bottom: 8px;
|
|
}
|
|
.l7-control-container .l7-left {
|
|
left: 0;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
position: absolute;
|
|
z-index: 999;
|
|
pointer-events: none;
|
|
}
|
|
.l7-control-container .l7-left .l7-control:not(.l7-control--hide) {
|
|
margin-left: 8px;
|
|
}
|
|
.l7-control-container .l7-center {
|
|
position: absolute;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-pack: center;
|
|
-ms-flex-pack: center;
|
|
justify-content: center;
|
|
}
|
|
.l7-control-container .l7-center.l7-top,
|
|
.l7-control-container .l7-center.l7-bottom {
|
|
width: 100%;
|
|
}
|
|
.l7-control-container .l7-center.l7-left,
|
|
.l7-control-container .l7-center.l7-right {
|
|
height: 100%;
|
|
}
|
|
.l7-control-container .l7-center .l7-control {
|
|
margin-right: 8px;
|
|
margin-bottom: 8px;
|
|
}
|
|
.l7-control-container .l7-row {
|
|
-webkit-box-orient: horizontal;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: row;
|
|
flex-direction: row;
|
|
}
|
|
.l7-control-container .l7-row.l7-top {
|
|
-webkit-box-align: start;
|
|
-ms-flex-align: start;
|
|
align-items: flex-start;
|
|
}
|
|
.l7-control-container .l7-row.l7-bottom {
|
|
-webkit-box-align: end;
|
|
-ms-flex-align: end;
|
|
align-items: flex-end;
|
|
}
|
|
.l7-control-container .l7-column {
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: column;
|
|
flex-direction: column;
|
|
}
|
|
.l7-control-container .l7-column.l7-left {
|
|
-webkit-box-align: start;
|
|
-ms-flex-align: start;
|
|
align-items: flex-start;
|
|
}
|
|
.l7-control-container .l7-column.l7-right {
|
|
-webkit-box-align: end;
|
|
-ms-flex-align: end;
|
|
align-items: flex-end;
|
|
}
|
|
.l7-button-control {
|
|
min-width: 28px;
|
|
height: 28px;
|
|
background-color: #fff;
|
|
border-width: 0;
|
|
border-radius: 2px;
|
|
outline: 0;
|
|
cursor: pointer;
|
|
-webkit-transition: all 0.2s;
|
|
transition: all 0.2s;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-pack: center;
|
|
-ms-flex-pack: center;
|
|
justify-content: center;
|
|
-webkit-box-align: center;
|
|
-ms-flex-align: center;
|
|
align-items: center;
|
|
padding: 0 6px;
|
|
-webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
line-height: 16px;
|
|
}
|
|
.l7-button-control .l7-iconfont {
|
|
fill: #595959;
|
|
color: #595959;
|
|
width: 16px;
|
|
height: 16px;
|
|
}
|
|
.l7-button-control.l7-button-control--row {
|
|
padding: 0 16px 0 13px;
|
|
}
|
|
.l7-button-control.l7-button-control--row * + .l7-button-control__text {
|
|
margin-left: 8px;
|
|
}
|
|
.l7-button-control.l7-button-control--column {
|
|
height: 44px;
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: column;
|
|
flex-direction: column;
|
|
}
|
|
.l7-button-control.l7-button-control--column .l7-iconfont {
|
|
margin-top: 3px;
|
|
}
|
|
.l7-button-control.l7-button-control--column .l7-button-control__text {
|
|
margin-top: 3px;
|
|
font-size: 10px;
|
|
-webkit-transform: scale(0.83333);
|
|
transform: scale(0.83333);
|
|
}
|
|
.l7-button-control:not(:disabled):hover {
|
|
background-color: #f3f3f3;
|
|
}
|
|
.l7-button-control:not(:disabled):active {
|
|
background-color: #f3f3f3;
|
|
}
|
|
.l7-button-control:disabled {
|
|
background-color: #fafafa;
|
|
color: #bdbdbd;
|
|
cursor: not-allowed;
|
|
}
|
|
.l7-button-control:disabled .l7-iconfont {
|
|
fill: #bdbdbd;
|
|
color: #bdbdbd;
|
|
}
|
|
.l7-button-control:disabled:hover {
|
|
background-color: #fafafa;
|
|
}
|
|
.l7-button-control:disabled:active {
|
|
background-color: #fafafa;
|
|
}
|
|
.l7-popper {
|
|
position: absolute;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-pack: center;
|
|
-ms-flex-pack: center;
|
|
justify-content: center;
|
|
-webkit-box-align: center;
|
|
-ms-flex-align: center;
|
|
align-items: center;
|
|
z-index: 5;
|
|
color: #595959;
|
|
}
|
|
.l7-popper.l7-popper-hide {
|
|
display: none;
|
|
}
|
|
.l7-popper .l7-popper-content {
|
|
min-height: 28px;
|
|
background: #fff;
|
|
border-radius: 2px;
|
|
-webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
}
|
|
.l7-popper .l7-popper-arrow {
|
|
width: 0;
|
|
height: 0;
|
|
border-width: 4px;
|
|
border-style: solid;
|
|
border-top-color: transparent;
|
|
border-bottom-color: transparent;
|
|
border-left-color: transparent;
|
|
border-right-color: transparent;
|
|
-webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
}
|
|
.l7-popper.l7-popper-left {
|
|
-webkit-box-orient: horizontal;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: row;
|
|
flex-direction: row;
|
|
}
|
|
.l7-popper.l7-popper-left .l7-popper-arrow {
|
|
border-left-color: #fff;
|
|
margin: 10px 0;
|
|
}
|
|
.l7-popper.l7-popper-right {
|
|
-webkit-box-orient: horizontal;
|
|
-webkit-box-direction: reverse;
|
|
-ms-flex-direction: row-reverse;
|
|
flex-direction: row-reverse;
|
|
}
|
|
.l7-popper.l7-popper-right .l7-popper-arrow {
|
|
border-right-color: #fff;
|
|
margin: 10px 0;
|
|
}
|
|
.l7-popper.l7-popper-top {
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: column;
|
|
flex-direction: column;
|
|
}
|
|
.l7-popper.l7-popper-top .l7-popper-arrow {
|
|
border-top-color: #fff;
|
|
margin: 0 10px;
|
|
}
|
|
.l7-popper.l7-popper-bottom {
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: reverse;
|
|
-ms-flex-direction: column-reverse;
|
|
flex-direction: column-reverse;
|
|
}
|
|
.l7-popper.l7-popper-bottom .l7-popper-arrow {
|
|
border-bottom-color: #fff;
|
|
margin: 0 10px;
|
|
}
|
|
.l7-popper.l7-popper-start {
|
|
-webkit-box-align: start;
|
|
-ms-flex-align: start;
|
|
align-items: flex-start;
|
|
}
|
|
.l7-popper.l7-popper-end {
|
|
-webkit-box-align: end;
|
|
-ms-flex-align: end;
|
|
align-items: flex-end;
|
|
}
|
|
.l7-select-control--normal {
|
|
padding: 4px 0;
|
|
}
|
|
.l7-select-control--normal .l7-select-control-item {
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-align: center;
|
|
-ms-flex-align: center;
|
|
align-items: center;
|
|
height: 24px;
|
|
padding: 0 16px;
|
|
font-size: 12px;
|
|
line-height: 24px;
|
|
}
|
|
.l7-select-control--normal .l7-select-control-item > * + * {
|
|
margin-left: 6px;
|
|
}
|
|
.l7-select-control--normal .l7-select-control-item input[type='checkbox'] {
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
.l7-select-control--normal .l7-select-control-item:hover {
|
|
background-color: #f3f3f3;
|
|
}
|
|
.l7-select-control--image {
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-ms-flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
-webkit-box-align: start;
|
|
-ms-flex-align: start;
|
|
align-items: flex-start;
|
|
-webkit-box-sizing: content-box;
|
|
box-sizing: content-box;
|
|
max-width: 460px;
|
|
max-height: 400px;
|
|
margin: 12px 0 0 12px;
|
|
overflow-x: hidden;
|
|
overflow-y: auto;
|
|
}
|
|
.l7-select-control--image .l7-select-control-item {
|
|
position: relative;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-flex: 0;
|
|
-ms-flex: 0 0 calc((100% - (12px + 9px) * 2) / 3);
|
|
flex: 0 0 calc((100% - (12px + 9px) * 2) / 3);
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: column;
|
|
flex-direction: column;
|
|
-webkit-box-pack: center;
|
|
-ms-flex-pack: center;
|
|
justify-content: center;
|
|
-webkit-box-sizing: content-box;
|
|
box-sizing: content-box;
|
|
margin-right: 12px;
|
|
margin-bottom: 12px;
|
|
overflow: hidden;
|
|
font-size: 12px;
|
|
border: 1px solid #fff;
|
|
border-radius: 2px;
|
|
}
|
|
.l7-select-control--image .l7-select-control-item img {
|
|
width: 100%;
|
|
height: 80px;
|
|
}
|
|
.l7-select-control--image .l7-select-control-item input[type='checkbox'] {
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
}
|
|
.l7-select-control--image .l7-select-control-item input[type='radio'] {
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
}
|
|
.l7-select-control--image .l7-select-control-item .l7-select-control-item-row {
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-align: center;
|
|
-ms-flex-align: center;
|
|
align-items: center;
|
|
-webkit-box-pack: center;
|
|
-ms-flex-pack: center;
|
|
justify-content: center;
|
|
line-height: 26px;
|
|
}
|
|
.l7-select-control--image .l7-select-control-item .l7-select-control-item-row > * + * {
|
|
margin-left: 8px;
|
|
}
|
|
.l7-select-control--image .l7-select-control-item.l7-select-control-item-active {
|
|
border-color: #0370fe;
|
|
}
|
|
.l7-select-control-item {
|
|
cursor: pointer;
|
|
}
|
|
.l7-select-control-item input[type='checkbox'] {
|
|
margin: 0;
|
|
cursor: pointer;
|
|
}
|
|
.l7-select-control--multiple .l7-select-control-item:hover {
|
|
background-color: transparent;
|
|
}
|
|
.l7-control-logo {
|
|
width: 89px;
|
|
height: 16px;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
}
|
|
.l7-control-logo img {
|
|
height: 100%;
|
|
width: 100%;
|
|
}
|
|
.l7-control-logo .l7-control-logo-link {
|
|
display: block;
|
|
cursor: pointer;
|
|
}
|
|
.l7-control-logo .l7-control-logo-link img {
|
|
cursor: pointer;
|
|
}
|
|
.l7-control-mouse-location {
|
|
background-color: #fff;
|
|
border-radius: 2px;
|
|
-webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
padding: 2px 4px;
|
|
min-width: 130px;
|
|
}
|
|
.l7-control-zoom {
|
|
overflow: hidden;
|
|
border-radius: 2px;
|
|
-webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
}
|
|
.l7-control-zoom .l7-button-control {
|
|
font-size: 16px;
|
|
border-bottom: 1px solid #f0f0f0;
|
|
border-radius: 0;
|
|
-webkit-box-shadow: 0 0 0;
|
|
box-shadow: 0 0 0;
|
|
}
|
|
.l7-control-zoom .l7-button-control .l7-iconfont {
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
.l7-control-zoom .l7-button-control:last-child {
|
|
border-bottom: 0;
|
|
}
|
|
.l7-control-zoom .l7-control-zoom__number {
|
|
color: #595959;
|
|
padding: 0;
|
|
}
|
|
.l7-control-zoom .l7-control-zoom__number:hover {
|
|
background-color: #fff;
|
|
}
|
|
.l7-control-scale {
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: column;
|
|
flex-direction: column;
|
|
}
|
|
.l7-control-scale .l7-control-scale-line {
|
|
-webkit-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
padding: 2px 5px 1px;
|
|
overflow: hidden;
|
|
color: #595959;
|
|
font-size: 10px;
|
|
line-height: 1.1;
|
|
white-space: nowrap;
|
|
background: #fff;
|
|
border: 2px solid #000;
|
|
border-top: 0;
|
|
-webkit-transition: width 0.1s;
|
|
transition: width 0.1s;
|
|
}
|
|
.l7-control-scale .l7-control-scale-line + .l7-control-scale .l7-control-scale-line {
|
|
margin-top: -2px;
|
|
border-top: 2px solid #777;
|
|
border-bottom: none;
|
|
}
|
|
.l7-right .l7-control-scale {
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-align: end;
|
|
-ms-flex-align: end;
|
|
align-items: flex-end;
|
|
}
|
|
.l7-right .l7-control-scale .l7-control-scale-line {
|
|
text-align: right;
|
|
}
|
|
.l7-popup {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
z-index: 5;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
will-change: transform;
|
|
pointer-events: none;
|
|
}
|
|
.l7-popup.l7-popup-hide {
|
|
display: none;
|
|
}
|
|
.l7-popup .l7-popup-content {
|
|
position: relative;
|
|
padding: 16px;
|
|
font-size: 14px;
|
|
background: #fff;
|
|
border-radius: 3px;
|
|
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
}
|
|
.l7-popup .l7-popup-content .l7-popup-content__title {
|
|
margin-bottom: 8px;
|
|
font-weight: bold;
|
|
}
|
|
.l7-popup .l7-popup-content .l7-popup-close-button,
|
|
.l7-popup .l7-popup-content .l7-popup-content__title,
|
|
.l7-popup .l7-popup-content .l7-popup-content__panel {
|
|
white-space: normal;
|
|
-webkit-user-select: text;
|
|
-moz-user-select: text;
|
|
-ms-user-select: text;
|
|
user-select: text;
|
|
pointer-events: initial;
|
|
}
|
|
.l7-popup .l7-popup-content .l7-popup-close-button {
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
width: 18px;
|
|
height: 18px;
|
|
padding: 0;
|
|
font-size: 14px;
|
|
line-height: 18px;
|
|
text-align: center;
|
|
background-color: transparent;
|
|
border: 0;
|
|
border-radius: 0 3px 0 0;
|
|
cursor: pointer;
|
|
}
|
|
.l7-popup .l7-popup-tip {
|
|
position: relative;
|
|
z-index: 1;
|
|
width: 0;
|
|
height: 0;
|
|
border: 10px solid transparent;
|
|
}
|
|
.l7-popup.l7-popup-anchor-bottom,
|
|
.l7-popup.l7-popup-anchor-bottom-left,
|
|
.l7-popup.l7-popup-anchor-bottom-right {
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: reverse;
|
|
-ms-flex-direction: column-reverse;
|
|
flex-direction: column-reverse;
|
|
}
|
|
.l7-popup.l7-popup-anchor-bottom .l7-popup-tip,
|
|
.l7-popup.l7-popup-anchor-bottom-left .l7-popup-tip,
|
|
.l7-popup.l7-popup-anchor-bottom-right .l7-popup-tip {
|
|
bottom: 1px;
|
|
}
|
|
.l7-popup.l7-popup-anchor-top,
|
|
.l7-popup.l7-popup-anchor-top-left,
|
|
.l7-popup.l7-popup-anchor-top-right {
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: column;
|
|
flex-direction: column;
|
|
}
|
|
.l7-popup.l7-popup-anchor-top .l7-popup-tip,
|
|
.l7-popup.l7-popup-anchor-top-left .l7-popup-tip,
|
|
.l7-popup.l7-popup-anchor-top-right .l7-popup-tip {
|
|
top: 1px;
|
|
}
|
|
.l7-popup.l7-popup-anchor-left {
|
|
-webkit-box-orient: horizontal;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: row;
|
|
flex-direction: row;
|
|
}
|
|
.l7-popup.l7-popup-anchor-right {
|
|
-webkit-box-orient: horizontal;
|
|
-webkit-box-direction: reverse;
|
|
-ms-flex-direction: row-reverse;
|
|
flex-direction: row-reverse;
|
|
}
|
|
.l7-popup-anchor-top .l7-popup-tip {
|
|
position: relative;
|
|
-webkit-align-self: center;
|
|
-ms-flex-item-align: center;
|
|
align-self: center;
|
|
border-top: none;
|
|
border-bottom-color: #fff;
|
|
}
|
|
.l7-popup-anchor-top-left .l7-popup-tip {
|
|
-webkit-align-self: flex-start;
|
|
-ms-flex-item-align: start;
|
|
align-self: flex-start;
|
|
border-top: none;
|
|
border-bottom-color: #fff;
|
|
border-left: none;
|
|
}
|
|
.l7-popup-anchor-top-right .l7-popup-tip {
|
|
-webkit-align-self: flex-end;
|
|
-ms-flex-item-align: end;
|
|
align-self: flex-end;
|
|
border-top: none;
|
|
border-right: none;
|
|
border-bottom-color: #fff;
|
|
}
|
|
.l7-popup-anchor-bottom .l7-popup-tip {
|
|
-webkit-align-self: center;
|
|
-ms-flex-item-align: center;
|
|
align-self: center;
|
|
border-top-color: #fff;
|
|
border-bottom: none;
|
|
}
|
|
.l7-popup-anchor-bottom-left .l7-popup-tip {
|
|
-webkit-align-self: flex-start;
|
|
-ms-flex-item-align: start;
|
|
align-self: flex-start;
|
|
border-top-color: #fff;
|
|
border-bottom: none;
|
|
border-left: none;
|
|
}
|
|
.l7-popup-anchor-bottom-right .l7-popup-tip {
|
|
-webkit-align-self: flex-end;
|
|
-ms-flex-item-align: end;
|
|
align-self: flex-end;
|
|
border-top-color: #fff;
|
|
border-right: none;
|
|
border-bottom: none;
|
|
}
|
|
.l7-popup-anchor-left .l7-popup-tip {
|
|
-webkit-align-self: center;
|
|
-ms-flex-item-align: center;
|
|
align-self: center;
|
|
border-right-color: #fff;
|
|
border-left: none;
|
|
}
|
|
.l7-popup-anchor-right .l7-popup-tip {
|
|
right: 1px;
|
|
-webkit-align-self: center;
|
|
-ms-flex-item-align: center;
|
|
align-self: center;
|
|
border-right: none;
|
|
border-left-color: #fff;
|
|
}
|
|
.l7-popup-anchor-top-left .l7-popup-content {
|
|
border-top-left-radius: 0;
|
|
}
|
|
.l7-popup-anchor-top-right .l7-popup-content {
|
|
border-top-right-radius: 0;
|
|
}
|
|
.l7-popup-anchor-bottom-left .l7-popup-content {
|
|
border-bottom-left-radius: 0;
|
|
}
|
|
.l7-popup-anchor-bottom-right .l7-popup-content {
|
|
border-bottom-right-radius: 0;
|
|
}
|
|
.l7-popup-track-pointer {
|
|
display: none;
|
|
}
|
|
.l7-popup-track-pointer * {
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
pointer-events: none;
|
|
}
|
|
.l7-map:hover .l7-popup-track-pointer {
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
}
|
|
.l7-map:active .l7-popup-track-pointer {
|
|
display: none;
|
|
}
|
|
.l7-layer-popup__row {
|
|
font-size: 12px;
|
|
}
|
|
.l7-layer-popup__row + .l7-layer-popup__row {
|
|
margin-top: 4px;
|
|
}
|
|
.l7-control-swipe {
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
z-index: 6;
|
|
-webkit-transform: translate(-50%, -50%);
|
|
transform: translate(-50%, -50%);
|
|
-ms-touch-action: none;
|
|
touch-action: none;
|
|
}
|
|
.l7-control-swipe_hide {
|
|
display: none;
|
|
}
|
|
.l7-control-swipe:before {
|
|
position: absolute;
|
|
top: -5000px;
|
|
bottom: -5000px;
|
|
left: 50%;
|
|
z-index: -1;
|
|
width: 4px;
|
|
background: #fff;
|
|
-webkit-transform: translate(-2px, 0);
|
|
transform: translate(-2px, 0);
|
|
content: '';
|
|
}
|
|
.l7-control-swipe.horizontal:before {
|
|
top: 50%;
|
|
right: -5000px;
|
|
bottom: auto;
|
|
left: -5000px;
|
|
width: auto;
|
|
height: 4px;
|
|
}
|
|
.l7-control-swipe__button {
|
|
display: block;
|
|
width: 28px;
|
|
height: 28px;
|
|
margin: 0;
|
|
padding: 0;
|
|
color: #595959;
|
|
font-weight: bold;
|
|
font-size: inherit;
|
|
text-align: center;
|
|
text-decoration: none;
|
|
background-color: #fff;
|
|
border: none;
|
|
border-radius: 2px;
|
|
outline: none;
|
|
}
|
|
.l7-control-swipe,
|
|
.l7-control-swipe__button {
|
|
cursor: ew-resize;
|
|
}
|
|
.l7-control-swipe.horizontal,
|
|
.l7-control-swipe.horizontal button {
|
|
cursor: ns-resize;
|
|
}
|
|
.l7-control-swipe:after,
|
|
.l7-control-swipe__button:before,
|
|
.l7-control-swipe__button:after {
|
|
position: absolute;
|
|
top: 25%;
|
|
bottom: 25%;
|
|
left: 50%;
|
|
width: 2px;
|
|
background: currentColor;
|
|
-webkit-transform: translate(-1px, 0);
|
|
transform: translate(-1px, 0);
|
|
content: '';
|
|
}
|
|
.l7-control-swipe__button:after {
|
|
-webkit-transform: translateX(4px);
|
|
transform: translateX(4px);
|
|
}
|
|
.l7-control-swipe__button:before {
|
|
-webkit-transform: translateX(-6px);
|
|
transform: translateX(-6px);
|
|
}
|
|
`);var n9,c6,i9,Wve=(n9=rb(wt.IGlobalConfigService),c6=function(){function e(t){Ht(this,e),bi(this,"configService",i9,this),this.config=t}return jt(e,[{key:"setContainer",value:function(r,n,i){r.bind(wt.MapConfig).toConstantValue(Qe(Qe({},this.config),{},{id:n,canvas:i})),r.bind(wt.IMapService).to(this.getServiceConstructor()).inSingletonScope()}},{key:"getServiceConstructor",value:function(){throw new Error("Method not implemented.")}}]),e}(),i9=mi(c6.prototype,"configService",[n9],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),c6);function sm(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Bg(e,t){var r=G5([],t,e);return $re(r,r,1/r[3]),r}function w1(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}var xc=Math.PI,IO=xc/4,yp=xc/180,a9=180/xc,xb=512,o9=4003e4,Xve=1.5;function MO(e){return Math.pow(2,e)}function f6(e,t){var r=Nn(e,2),n=r[0],i=r[1];w1(Number.isFinite(n)&&Number.isFinite(t)),w1(Number.isFinite(i)&&i>=-90&&i<=90,"invalid latitude"),t*=xb;var o=n*yp,a=i*yp,u=t*(o+xc)/(2*xc),c=t*(xc-Math.log(Math.tan(IO+a*.5)))/(2*xc);return[u,c]}function s9(e,t){var r=Nn(e,2),n=r[0],i=r[1];t*=xb;var o=n/t*(2*xc)-xc,a=2*(Math.atan(Math.exp(xc-i/t*(2*xc)))-IO);return[o*a9,a*a9]}function Yve(e){var t=e.latitude,r=e.longitude,n=e.zoom,i=e.scale,o=e.highPrecision,a=o===void 0?!1:o;i=i!==void 0?i:MO(n),w1(Number.isFinite(t)&&Number.isFinite(r)&&Number.isFinite(i));var u={},c=xb*i,f=Math.cos(t*yp),m=c/360,_=m/f,b=c/o9/f;if(u.pixelsPerMeter=[b,-b,b],u.metersPerPixel=[1/b,-1/b,1/b],u.pixelsPerDegree=[m,-_,b],u.degreesPerPixel=[1/m,-1/_,1/b],a){var A=yp*Math.tan(t*yp)/f,w=m*A/2,R=c/o9*A,P=R/_*b;u.pixelsPerDegree2=[0,-w,R],u.pixelsPerMeter2=[P,0,P]}return u}function Zve(e){var t=e.height,r=e.pitch,n=e.bearing,i=e.altitude,o=e.center,a=o===void 0?null:o,u=e.flipY,c=u===void 0?!1:u,f=sm();return Em(f,f,[0,0,-i]),Sm(f,f,[1,1,1/t]),sy(f,f,-r*yp),H5(f,f,n*yp),c&&Sm(f,f,[1,-1,1]),a&&Em(f,f,PM([],a)),f}function qve(e){var t=e.width,r=e.height,n=e.altitude,i=n===void 0?Xve:n,o=e.pitch,a=o===void 0?0:o,u=e.nearZMultiplier,c=u===void 0?1:u,f=e.farZMultiplier,m=f===void 0?1:f,_=a*yp,b=Math.atan(.5/i),A=Math.sin(b)*i/Math.sin(Math.PI/2-_-b),w=Math.cos(Math.PI/2-_)*A+i;return{fov:2*Math.atan(r/2/i),aspect:t/r,focalDistance:i,near:c,far:w*m}}function Kve(e){var t=e.width,r=e.height,n=e.pitch,i=e.altitude,o=e.nearZMultiplier,a=e.farZMultiplier,u=qve({width:t,height:r,altitude:i,pitch:n,nearZMultiplier:o,farZMultiplier:a}),c=u.fov,f=u.aspect,m=u.near,_=u.far,b=bM([],c,f,m,_);return b}function Qve(e,t){var r=Nn(e,3),n=r[0],i=r[1],o=r[2],a=o===void 0?0:o;return w1(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(a)),Bg(t,[n,i,a,1])}function PO(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=Nn(e,3),i=n[0],o=n[1],a=n[2];if(w1(Number.isFinite(i)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(a)){var u=Bg(t,[i,o,a,1]);return u}var c=Bg(t,[i,o,0,1]),f=Bg(t,[i,o,1,1]),m=c[2],_=f[2],b=m===_?0:((r||0)-m)/(_-m);return jre([],c,f,b)}var u9=sm(),Jve=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.width,n=t.height,i=t.viewMatrix,o=i===void 0?u9:i,a=t.projectionMatrix,u=a===void 0?u9:a;Ht(this,e),this.width=r||1,this.height=n||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=u;var c=sm();pf(c,c,this.projectionMatrix),pf(c,c,this.viewMatrix),this.viewProjectionMatrix=c;var f=sm();Sm(f,f,[this.width/2,-this.height/2,1]),Em(f,f,[1,-1,0]),pf(f,f,this.viewProjectionMatrix);var m=V5(sm(),f);if(!m)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=f,this.pixelUnprojectionMatrix=m,this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}return jt(e,[{key:"equals",value:function(r){return r instanceof e?r.width===this.width&&r.height===this.height&&Z6(r.projectionMatrix,this.projectionMatrix)&&Z6(r.viewMatrix,this.viewMatrix):!1}},{key:"project",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.topLeft,o=i===void 0?!0:i,a=this.projectPosition(r),u=Qve(a,this.pixelProjectionMatrix),c=Nn(u,2),f=c[0],m=c[1],_=o?m:this.height-m;return r.length===2?[f,_]:[f,_,u[2]]}},{key:"unproject",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.topLeft,o=i===void 0?!0:i,a=n.targetZ,u=Nn(r,3),c=u[0],f=u[1],m=u[2],_=o?f:this.height-f,b=a&&a*this.pixelsPerMeter,A=PO([c,_,m],this.pixelUnprojectionMatrix,b),w=this.unprojectPosition(A),R=Nn(w,3),P=R[0],k=R[1],L=R[2];return Number.isFinite(m)?[P,k,L]:Number.isFinite(a)?[P,k,a]:[P,k]}},{key:"projectPosition",value:function(r){var n=this.projectFlat(r),i=Nn(n,2),o=i[0],a=i[1],u=(r[2]||0)*this.pixelsPerMeter;return[o,a,u]}},{key:"unprojectPosition",value:function(r){var n=this.unprojectFlat(r),i=Nn(n,2),o=i[0],a=i[1],u=(r[2]||0)/this.pixelsPerMeter;return[o,a,u]}},{key:"projectFlat",value:function(r){return arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale,r}},{key:"unprojectFlat",value:function(r){return arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale,r}}]),e}();function eme(e){var t=e.width,r=e.height,n=e.bounds,i=e.minExtent,o=i===void 0?0:i,a=e.maxZoom,u=a===void 0?24:a,c=e.padding,f=c===void 0?0:c,m=e.offset,_=m===void 0?[0,0]:m,b=Nn(n,2),A=Nn(b[0],2),w=A[0],R=A[1],P=Nn(b[1],2),k=P[0],L=P[1];if(Number.isFinite(f)){var B=f;f={top:B,bottom:B,left:B,right:B}}else w1(Number.isFinite(f.top)&&Number.isFinite(f.bottom)&&Number.isFinite(f.left)&&Number.isFinite(f.right));var V=new OO({width:t,height:r,longitude:0,latitude:0,zoom:0}),G=V.project([w,L]),K=V.project([k,R]),Z=[Math.max(Math.abs(K[0]-G[0]),o),Math.max(Math.abs(K[1]-G[1]),o)],ve=[t-f.left-f.right-Math.abs(_[0])*2,r-f.top-f.bottom-Math.abs(_[1])*2];w1(ve[0]>0&&ve[1]>0);var Ie=ve[0]/Z[0],de=ve[1]/Z[1],se=(f.right-f.left)/2/Ie,le=(f.bottom-f.top)/2/de,ye=[(K[0]+G[0])/2+se,(K[1]+G[1])/2+le],ke=V.unproject(ye),Rt=V.zoom+Math.log2(Math.abs(Math.min(Ie,de)));return{longitude:ke[0],latitude:ke[1],zoom:Math.min(Rt,u)}}var OO=function(e){_n(t,e);function t(){var r,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.width,o=n.height,a=n.latitude,u=a===void 0?0:a,c=n.longitude,f=c===void 0?0:c,m=n.zoom,_=m===void 0?0:m,b=n.pitch,A=b===void 0?0:b,w=n.bearing,R=w===void 0?0:w,P=n.altitude,k=P===void 0?1.5:P,L=n.nearZMultiplier,B=n.farZMultiplier;Ht(this,t),i=i||1,o=o||1;var V=MO(_);k=Math.max(.75,k);var G=f6([f,u],V);G[2]=0;var K=Kve({width:i,height:o,pitch:A,bearing:R,altitude:k,nearZMultiplier:L||1/o,farZMultiplier:B||1.01}),Z=Zve({height:o,center:G,pitch:A,bearing:R,altitude:k,flipY:!0});return r=yn(this,Bt(t).call(this,{width:i,height:o,viewMatrix:Z,projectionMatrix:K})),r.latitude=u,r.longitude=f,r.zoom=_,r.pitch=A,r.bearing=R,r.altitude=k,r.scale=V,r.center=G,r.pixelsPerMeter=Yve($e($e(r))).pixelsPerMeter[2],Object.freeze($e($e(r))),r}return jt(t,[{key:"projectFlat",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return f6(n,i)}},{key:"unprojectFlat",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return s9(n,i)}},{key:"getMapCenterByLngLatPosition",value:function(n){var i=n.lngLat,o=n.pos,a=PO(o,this.pixelUnprojectionMatrix),u=f6(i,this.scale),c=Oo([],u,Vre([],a)),f=Oo([],this.center,c);return s9(f,this.scale)}},{key:"getLocationAtPoint",value:function(n){var i=n.lngLat,o=n.pos;return this.getMapCenterByLngLatPosition({lngLat:i,pos:o})}},{key:"fitBounds",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.width,a=this.height,u=eme(Object.assign({width:o,height:a,bounds:n},i)),c=u.longitude,f=u.latitude,m=u.zoom;return new t({width:o,height:a,longitude:c,latitude:f,zoom:m})}}]),t}(Jve),tme=function(){function e(t){Ht(this,e),F(this,"size",1e4),this.size=t||1e4}return jt(e,[{key:"setSize",value:function(r){this.size=r}},{key:"getSize",value:function(){return[this.size,this.size]}},{key:"mercatorXfromLng",value:function(r){return(180+r)/360*this.size}},{key:"mercatorYfromLat",value:function(r){return(1-(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360)*this.size}},{key:"lngFromMercatorX",value:function(r){return r/this.size*360-180}},{key:"latFromMercatorY",value:function(r){var n=180-(1-r/this.size)*360;return 360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90}},{key:"project",value:function(r){var n=this.mercatorXfromLng(r[0]),i=this.mercatorYfromLat(r[1]);return[n,i]}},{key:"unproject",value:function(r){var n=this.lngFromMercatorX(r[0]),i=this.latFromMercatorY(r[1]);return[n,i]}}]),e}(),rme={light:"mapbox://styles/zcxduo/ck2ypyb1r3q9o1co1766dex29",dark:"mapbox://styles/zcxduo/ck241p6413s0b1cpayzldv7x7",normal:"mapbox://styles/mapbox/streets-v11",blank:{version:8,sources:{},layers:[{id:"background",type:"background",layout:{visibility:"none"}}]}},l9,c9,f9,h9,p9,d9,Md,v9,m9,g9,_9,y9={mapmove:"move",camerachange:"move",zoomchange:"zoom",dragging:"drag"},nme=12,ime=(l9=ai(),c9=ki(wt.MapConfig),f9=ki(wt.IGlobalConfigService),h9=ki(wt.ICoordinateSystemService),p9=ki(wt.IEventEmitter),l9(d9=(Md=function(){function e(){var t=this;Ht(this,e),F(this,"version","DEFAUlTMAP"),F(this,"simpleMapCoord",new tme),F(this,"bgColor","rgba(0.0, 0.0, 0.0, 0.0)"),bi(this,"config",v9,this),bi(this,"configService",m9,this),bi(this,"coordinateSystemService",g9,this),bi(this,"eventEmitter",_9,this),F(this,"handleCameraChanged",function(r){var n=t.map.getCenter(),i=n.lat,o=n.lng;t.emit("mapchange"),t.viewport.syncWithMapCamera({bearing:t.map.getBearing(),center:[o,i],viewportHeight:t.map.transform.height,pitch:t.map.getPitch(),viewportWidth:t.map.transform.width,zoom:t.map.getZoom(),cameraHeight:0}),t.updateCoordinateSystemService(),t.cameraChangedCallback(t.viewport)})}return jt(e,[{key:"setBgColor",value:function(r){this.bgColor=r}},{key:"addMarkerContainer",value:function(){var r=this.map.getCanvasContainer();this.markerContainer=fl("div","l7-marker-container",r),this.markerContainer.setAttribute("tabindex","-1")}},{key:"getMarkerContainer",value:function(){return this.markerContainer}},{key:"getOverlayContainer",value:function(){}},{key:"on",value:function(r,n){ile.indexOf(r)!==-1?this.eventEmitter.on(r,n):this.map.on(y9[r]||r,n)}},{key:"off",value:function(r,n){this.map.off(y9[r]||r,n),this.eventEmitter.off(r,n)}},{key:"getContainer",value:function(){return this.map.getContainer()}},{key:"getMapCanvasContainer",value:function(){return this.map.getCanvasContainer()}},{key:"getSize",value:function(){if(this.version==="SIMPLE")return this.simpleMapCoord.getSize();var r=this.map.transform;return[r.width,r.height]}},{key:"getType",value:function(){return"default"}},{key:"getZoom",value:function(){return this.map.getZoom()}},{key:"setZoom",value:function(r){return this.map.setZoom(r)}},{key:"getCenter",value:function(){return this.map.getCenter()}},{key:"setCenter",value:function(r){this.map.setCenter(r)}},{key:"getPitch",value:function(){return this.map.getPitch()}},{key:"getRotation",value:function(){return this.map.getBearing()}},{key:"getBounds",value:function(){return this.map.getBounds().toArray()}},{key:"getMinZoom",value:function(){return this.map.getMinZoom()}},{key:"getMaxZoom",value:function(){return this.map.getMaxZoom()}},{key:"setRotation",value:function(r){this.map.setBearing(r)}},{key:"zoomIn",value:function(r,n){this.map.zoomIn(r,n)}},{key:"zoomOut",value:function(r,n){this.map.zoomOut(r,n)}},{key:"setPitch",value:function(r){return this.map.setPitch(r)}},{key:"panTo",value:function(r){this.map.panTo(r)}},{key:"panBy",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.map.panBy([r,n])}},{key:"fitBounds",value:function(r,n){this.map.fitBounds(r,n)}},{key:"setMaxZoom",value:function(r){this.map.setMaxZoom(r)}},{key:"setMinZoom",value:function(r){this.map.setMinZoom(r)}},{key:"setMapStatus",value:function(r){r.doubleClickZoom===!0&&this.map.doubleClickZoom.enable(),r.doubleClickZoom===!1&&this.map.doubleClickZoom.disable(),r.dragEnable===!1&&this.map.dragPan.disable(),r.dragEnable===!0&&this.map.dragPan.enable(),r.rotateEnable===!1&&this.map.dragRotate.disable(),r.dragEnable===!0&&this.map.dragRotate.enable(),r.keyboardEnable===!1&&this.map.keyboard.disable(),r.keyboardEnable===!0&&this.map.keyboard.enable(),r.zoomEnable===!1&&this.map.scrollZoom.disable(),r.zoomEnable===!0&&this.map.scrollZoom.enable()}},{key:"setZoomAndCenter",value:function(r,n){this.map.flyTo({zoom:r,center:n})}},{key:"setMapStyle",value:function(r){this.map.setStyle(this.getMapStyleValue(r))}},{key:"meterToCoord",value:function(r,n){return 1}},{key:"pixelToLngLat",value:function(r){return this.map.unproject(r)}},{key:"lngLatToPixel",value:function(r){return this.map.project(r)}},{key:"containerToLngLat",value:function(r){return this.map.unproject(r)}},{key:"lngLatToContainer",value:function(r){return this.map.project(r)}},{key:"getMapStyle",value:function(){try{var r,n=(r=this.map.getStyle().sprite)!==null&&r!==void 0?r:"";return/^mapbox:\/\/sprites\/zcxduo\/\w+\/\w+$/.test(n)?n==null?void 0:n.replace(/\/\w+$/,"").replace(/sprites/,"styles"):n}catch{return""}}},{key:"getMapStyleConfig",value:function(){return rme}},{key:"getMapStyleValue",value:function(r){var n;return(n=this.getMapStyleConfig()[r])!==null&&n!==void 0?n:r}},{key:"destroy",value:function(){this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}},{key:"emit",value:function(r){for(var n,i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];(n=this.eventEmitter).emit.apply(n,[r].concat(o))}},{key:"once",value:function(r){for(var n,i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];(n=this.eventEmitter).once.apply(n,[r].concat(o))}},{key:"getMapContainer",value:function(){return this.$mapContainer}},{key:"exportMap",value:function(r){var n=this.map.getCanvas(),i=r==="jpg"?n==null?void 0:n.toDataURL("image/jpeg"):n==null?void 0:n.toDataURL("image/png");return i}},{key:"onCameraChanged",value:function(r){this.cameraChangedCallback=r}},{key:"creatMapContainer",value:function(r){var n=r;return typeof r=="string"&&(n=document.getElementById(r)),n}},{key:"updateView",value:function(r){this.emit("mapchange"),this.viewport.syncWithMapCamera({bearing:r.bearing,center:r.center,viewportHeight:r.viewportHeight,pitch:r.pitch,viewportWidth:r.viewportWidth,zoom:r.zoom,cameraHeight:0}),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport)}},{key:"updateCoordinateSystemService",value:function(){var r=this.config.offsetCoordinate,n=r===void 0?!0:r;this.viewport.getZoom()>nme&&n?this.coordinateSystemService.setCoordinateSystem(Vd.LNGLAT_OFFSET):this.coordinateSystemService.setCoordinateSystem(Vd.LNGLAT)}}]),e}(),v9=mi(Md.prototype,"config",[c9],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),m9=mi(Md.prototype,"configService",[f9],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),g9=mi(Md.prototype,"coordinateSystemService",[h9],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_9=mi(Md.prototype,"eventEmitter",[p9],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Md))||d9),kO={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(_c,function(){var r,n,i;function o(a,u){if(!r)r=u;else if(!n)n=u;else{var c="var sharedChunk = {}; ("+r+")(sharedChunk); ("+n+")(sharedChunk);",f={};r(f),i=u(f),typeof window<"u"&&(i.workerUrl=window.URL.createObjectURL(new Blob([c],{type:"text/javascript"})))}}return o(["exports"],function(a){function u(s,l){return s(l={exports:{}},l.exports),l.exports}var c=f;function f(s,l,h,g){this.cx=3*s,this.bx=3*(h-s)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*l,this.by=3*(g-l)-this.cy,this.ay=1-this.cy-this.by,this.p1x=s,this.p1y=g,this.p2x=h,this.p2y=g}f.prototype.sampleCurveX=function(s){return((this.ax*s+this.bx)*s+this.cx)*s},f.prototype.sampleCurveY=function(s){return((this.ay*s+this.by)*s+this.cy)*s},f.prototype.sampleCurveDerivativeX=function(s){return(3*this.ax*s+2*this.bx)*s+this.cx},f.prototype.solveCurveX=function(s,l){var h,g,x,E,T;for(l===void 0&&(l=1e-6),x=s,T=0;T<8;T++){if(E=this.sampleCurveX(x)-s,Math.abs(E)<l)return x;var M=this.sampleCurveDerivativeX(x);if(Math.abs(M)<1e-6)break;x-=E/M}if((x=s)<(h=0))return h;if(x>(g=1))return g;for(;h<g;){if(E=this.sampleCurveX(x),Math.abs(E-s)<l)return x;s>E?h=x:g=x,x=.5*(g-h)+h}return x},f.prototype.solve=function(s,l){return this.sampleCurveY(this.solveCurveX(s,l))};var m=_;function _(s,l){this.x=s,this.y=l}_.prototype={clone:function(){return new _(this.x,this.y)},add:function(s){return this.clone()._add(s)},sub:function(s){return this.clone()._sub(s)},multByPoint:function(s){return this.clone()._multByPoint(s)},divByPoint:function(s){return this.clone()._divByPoint(s)},mult:function(s){return this.clone()._mult(s)},div:function(s){return this.clone()._div(s)},rotate:function(s){return this.clone()._rotate(s)},rotateAround:function(s,l){return this.clone()._rotateAround(s,l)},matMult:function(s){return this.clone()._matMult(s)},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(s){return this.x===s.x&&this.y===s.y},dist:function(s){return Math.sqrt(this.distSqr(s))},distSqr:function(s){var l=s.x-this.x,h=s.y-this.y;return l*l+h*h},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(s){return Math.atan2(this.y-s.y,this.x-s.x)},angleWith:function(s){return this.angleWithSep(s.x,s.y)},angleWithSep:function(s,l){return Math.atan2(this.x*l-this.y*s,this.x*s+this.y*l)},_matMult:function(s){var l=s[2]*this.x+s[3]*this.y;return this.x=s[0]*this.x+s[1]*this.y,this.y=l,this},_add:function(s){return this.x+=s.x,this.y+=s.y,this},_sub:function(s){return this.x-=s.x,this.y-=s.y,this},_mult:function(s){return this.x*=s,this.y*=s,this},_div:function(s){return this.x/=s,this.y/=s,this},_multByPoint:function(s){return this.x*=s.x,this.y*=s.y,this},_divByPoint:function(s){return this.x/=s.x,this.y/=s.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var s=this.y;return this.y=this.x,this.x=-s,this},_rotate:function(s){var l=Math.cos(s),h=Math.sin(s),g=h*this.x+l*this.y;return this.x=l*this.x-h*this.y,this.y=g,this},_rotateAround:function(s,l){var h=Math.cos(s),g=Math.sin(s),x=l.y+g*(this.x-l.x)+h*(this.y-l.y);return this.x=l.x+h*(this.x-l.x)-g*(this.y-l.y),this.y=x,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},_.convert=function(s){return s instanceof _?s:Array.isArray(s)?new _(s[0],s[1]):s};var b=typeof self<"u"?self:{},A=Math.pow(2,53)-1;function w(s,l,h,g){var x=new c(s,l,h,g);return function(E){return x.solve(E)}}var R=w(.25,.1,.25,1);function P(s,l,h){return Math.min(h,Math.max(l,s))}function k(s,l,h){var g=h-l,x=((s-l)%g+g)%g+l;return x===l?h:x}function L(s){for(var l=[],h=arguments.length-1;h-- >0;)l[h]=arguments[h+1];for(var g=0,x=l;g<x.length;g+=1){var E=x[g];for(var T in E)s[T]=E[T]}return s}var B=1;function V(){return B++}function G(){return function s(l){return l?(l^16*Math.random()>>l/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,s)}()}function K(s){return!!s&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(s)}function Z(s,l){s.forEach(function(h){l[h]&&(l[h]=l[h].bind(l))})}function ve(s,l){return s.indexOf(l,s.length-l.length)!==-1}function Ie(s,l,h){var g={};for(var x in s)g[x]=l.call(h||this,s[x],x,s);return g}function de(s,l,h){var g={};for(var x in s)l.call(h||this,s[x],x,s)&&(g[x]=s[x]);return g}function se(s){return Array.isArray(s)?s.map(se):typeof s=="object"&&s?Ie(s,se):s}var le={};function ye(s){le[s]||(typeof console<"u"&&console.warn(s),le[s]=!0)}function ke(s,l,h){return(h.y-s.y)*(l.x-s.x)>(l.y-s.y)*(h.x-s.x)}function Rt(s){for(var l=0,h=0,g=s.length,x=g-1,E=void 0,T=void 0;h<g;x=h++)l+=((T=s[x]).x-(E=s[h]).x)*(E.y+T.y);return l}function Lt(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Gt(s){var l={};if(s.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(g,x,E,T){var M=E||T;return l[x]=!M||M.toLowerCase(),""}),l["max-age"]){var h=parseInt(l["max-age"],10);isNaN(h)?delete l["max-age"]:l["max-age"]=h}return l}var Zt=null;function st(s){if(Zt==null){var l=s.navigator?s.navigator.userAgent:null;Zt=!!s.safari||!(!l||!(/\b(iPad|iPhone|iPod)\b/.test(l)||l.match("Safari")&&!l.match("Chrome")))}return Zt}function tt(s){try{var l=b[s];return l.setItem("_mapbox_test_",1),l.removeItem("_mapbox_test_"),!0}catch{return!1}}var dt,nt,pr,ur,Ar=b.performance&&b.performance.now?b.performance.now.bind(b.performance):Date.now.bind(Date),Xn=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame,pn=b.cancelAnimationFrame||b.mozCancelAnimationFrame||b.webkitCancelAnimationFrame||b.msCancelAnimationFrame,gi={now:Ar,frame:function(s){var l=Xn(s);return{cancel:function(){return pn(l)}}},getImageData:function(s,l){l===void 0&&(l=0);var h=b.document.createElement("canvas"),g=h.getContext("2d");if(!g)throw new Error("failed to create canvas 2d context");return h.width=s.width,h.height=s.height,g.drawImage(s,0,0,s.width,s.height),g.getImageData(-l,-l,s.width+2*l,s.height+2*l)},resolveURL:function(s){return dt||(dt=b.document.createElement("a")),dt.href=s,dt.href},hardwareConcurrency:b.navigator&&b.navigator.hardwareConcurrency||4,get devicePixelRatio(){return b.devicePixelRatio},get prefersReducedMotion(){return!!b.matchMedia&&(nt==null&&(nt=b.matchMedia("(prefers-reduced-motion: reduce)")),nt.matches)}},Je={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Qt={supported:!1,testSupport:function(s){!Xr&&ur&&(Ut?ge(s):pr=s)}},Xr=!1,Ut=!1;function ge(s){var l=s.createTexture();s.bindTexture(s.TEXTURE_2D,l);try{if(s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,ur),s.isContextLost())return;Qt.supported=!0}catch{}s.deleteTexture(l),Xr=!0}b.document&&((ur=b.document.createElement("img")).onload=function(){pr&&ge(pr),pr=null,Ut=!0},ur.onerror=function(){Xr=!0,pr=null},ur.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var Be="01",ft=function(s,l){this._transformRequestFn=s,this._customAccessToken=l,this._createSkuToken()};function At(s){return s.indexOf("mapbox:")===0}ft.prototype._createSkuToken=function(){var s=function(){for(var l="",h=0;h<10;h++)l+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",Be,l].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=s.token,this._skuTokenExpiresAt=s.tokenExpiresAt},ft.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},ft.prototype.transformRequest=function(s,l){return this._transformRequestFn&&this._transformRequestFn(s,l)||{url:s}},ft.prototype.normalizeStyleURL=function(s,l){if(!At(s))return s;var h=tr(s);return h.path="/styles/v1"+h.path,this._makeAPIURL(h,this._customAccessToken||l)},ft.prototype.normalizeGlyphsURL=function(s,l){if(!At(s))return s;var h=tr(s);return h.path="/fonts/v1"+h.path,this._makeAPIURL(h,this._customAccessToken||l)},ft.prototype.normalizeSourceURL=function(s,l){if(!At(s))return s;var h=tr(s);return h.path="/v4/"+h.authority+".json",h.params.push("secure"),this._makeAPIURL(h,this._customAccessToken||l)},ft.prototype.normalizeSpriteURL=function(s,l,h,g){var x=tr(s);return At(s)?(x.path="/styles/v1"+x.path+"/sprite"+l+h,this._makeAPIURL(x,this._customAccessToken||g)):(x.path+=""+l+h,lr(x))},ft.prototype.normalizeTileURL=function(s,l){if(this._isSkuTokenExpired()&&this._createSkuToken(),s&&!At(s))return s;var h=tr(s);h.path=h.path.replace(/(\.(png|jpg)\d*)(?=$)/,(gi.devicePixelRatio>=2||l===512?"@2x":"")+(Qt.supported?".webp":"$1")),h.path=h.path.replace(/^.+\/v4\//,"/"),h.path="/v4"+h.path;var g=this._customAccessToken||function(x){for(var E=0,T=x;E<T.length;E+=1){var M=T[E].match(/^access_token=(.*)$/);if(M)return M[1]}return null}(h.params)||Je.ACCESS_TOKEN;return Je.REQUIRE_ACCESS_TOKEN&&g&&this._skuToken&&h.params.push("sku="+this._skuToken),this._makeAPIURL(h,g)},ft.prototype.canonicalizeTileURL=function(s,l){var h=tr(s);if(!h.path.match(/(^\/v4\/)/)||!h.path.match(/\.[\w]+$/))return s;var g="mapbox://tiles/";g+=h.path.replace("/v4/","");var x=h.params;return l&&(x=x.filter(function(E){return!E.match(/^access_token=/)})),x.length&&(g+="?"+x.join("&")),g},ft.prototype.canonicalizeTileset=function(s,l){for(var h=!!l&&At(l),g=[],x=0,E=s.tiles||[];x<E.length;x+=1){var T=E[x];$t(T)?g.push(this.canonicalizeTileURL(T,h)):g.push(T)}return g},ft.prototype._makeAPIURL=function(s,l){var h="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",g=tr(Je.API_URL);if(s.protocol=g.protocol,s.authority=g.authority,s.protocol==="http"){var x=s.params.indexOf("secure");x>=0&&s.params.splice(x,1)}if(g.path!=="/"&&(s.path=""+g.path+s.path),!Je.REQUIRE_ACCESS_TOKEN)return lr(s);if(!(l=l||Je.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+h);if(l[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+h);return s.params=s.params.filter(function(E){return E.indexOf("access_token")===-1}),s.params.push("access_token="+l),lr(s)};var bt=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function $t(s){return bt.test(s)}var Mr=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function tr(s){var l=s.match(Mr);if(!l)throw new Error("Unable to parse URL object");return{protocol:l[1],authority:l[2],path:l[3]||"/",params:l[4]?l[4].split("&"):[]}}function lr(s){var l=s.params.length?"?"+s.params.join("&"):"";return s.protocol+"://"+s.authority+s.path+l}function or(s){if(!s)return null;var l=s.split(".");if(!l||l.length!==3)return null;try{return JSON.parse(decodeURIComponent(b.atob(l[1]).split("").map(function(h){return"%"+("00"+h.charCodeAt(0).toString(16)).slice(-2)}).join("")))}catch{return null}}var Q=function(s){this.type=s,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Q.prototype.getStorageKey=function(s){var l,h=or(Je.ACCESS_TOKEN);return l=h&&h.u?b.btoa(encodeURIComponent(h.u).replace(/%([0-9A-F]{2})/g,function(g,x){return String.fromCharCode(+("0x"+x))})):Je.ACCESS_TOKEN||"",s?"mapbox.eventData."+s+":"+l:"mapbox.eventData:"+l},Q.prototype.fetchEventData=function(){var s=tt("localStorage"),l=this.getStorageKey(),h=this.getStorageKey("uuid");if(s)try{var g=b.localStorage.getItem(l);g&&(this.eventData=JSON.parse(g));var x=b.localStorage.getItem(h);x&&(this.anonId=x)}catch{ye("Unable to read from LocalStorage")}},Q.prototype.saveEventData=function(){var s=tt("localStorage"),l=this.getStorageKey(),h=this.getStorageKey("uuid");if(s)try{b.localStorage.setItem(h,this.anonId),Object.keys(this.eventData).length>=1&&b.localStorage.setItem(l,JSON.stringify(this.eventData))}catch{ye("Unable to write to LocalStorage")}},Q.prototype.processRequests=function(s){},Q.prototype.postEvent=function(s,l,h,g){var x=this;if(Je.EVENTS_URL){var E=tr(Je.EVENTS_URL);E.params.push("access_token="+(g||Je.ACCESS_TOKEN||""));var T={event:this.type,created:new Date(s).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:Be,userId:this.anonId},M=l?L(T,l):T,D={url:lr(E),headers:{"Content-Type":"text/plain"},body:JSON.stringify([M])};this.pendingRequest=Fn(D,function(N){x.pendingRequest=null,h(N),x.saveEventData(),x.processRequests(g)})}},Q.prototype.queueRequest=function(s,l){this.queue.push(s),this.processRequests(l)};var Ge,at,yt=function(s){function l(){s.call(this,"map.load"),this.success={},this.skuToken=""}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.postMapLoadEvent=function(h,g,x,E){this.skuToken=x;var T=!(!E&&!Je.ACCESS_TOKEN),M=Array.isArray(h)&&h.some(function(D){return At(D)||$t(D)});Je.EVENTS_URL&&T&&M&&this.queueRequest({id:g,timestamp:Date.now()},E)},l.prototype.processRequests=function(h){var g=this;if(!this.pendingRequest&&this.queue.length!==0){var x=this.queue.shift(),E=x.id,T=x.timestamp;E&&this.success[E]||(this.anonId||this.fetchEventData(),K(this.anonId)||(this.anonId=G()),this.postEvent(T,{skuToken:this.skuToken},function(M){M||E&&(g.success[E]=!0)},h))}},l}(Q),rr=new(function(s){function l(h){s.call(this,"appUserTurnstile"),this._customAccessToken=h}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.postTurnstileEvent=function(h,g){Je.EVENTS_URL&&Je.ACCESS_TOKEN&&Array.isArray(h)&&h.some(function(x){return At(x)||$t(x)})&&this.queueRequest(Date.now(),g)},l.prototype.processRequests=function(h){var g=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var x=or(Je.ACCESS_TOKEN),E=x?x.u:Je.ACCESS_TOKEN,T=E!==this.eventData.tokenU;K(this.anonId)||(this.anonId=G(),T=!0);var M=this.queue.shift();if(this.eventData.lastSuccess){var D=new Date(this.eventData.lastSuccess),N=new Date(M),$=(M-this.eventData.lastSuccess)/864e5;T=T||$>=1||$<-1||D.getDate()!==N.getDate()}else T=!0;if(!T)return this.processRequests();this.postEvent(M,{"enabled.telemetry":!1},function(H){H||(g.eventData.lastSuccess=M,g.eventData.tokenU=E)},h)}},l}(Q)),hr=rr.postTurnstileEvent.bind(rr),Cn=new yt,rn=Cn.postMapLoadEvent.bind(Cn),Ne=500,qe=50;function ct(){b.caches&&!Ge&&(Ge=b.caches.open("mapbox-tiles"))}function Vt(s){var l=s.indexOf("?");return l<0?s:s.slice(0,l)}var Qr,Jn=1/0;function Ri(){return Qr==null&&(Qr=b.OffscreenCanvas&&new b.OffscreenCanvas(1,1).getContext("2d")&&typeof b.createImageBitmap=="function"),Qr}var qn={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(qn);var en=function(s){function l(h,g,x){g===401&&$t(x)&&(h+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),s.call(this,h),this.status=g,this.url=x,this.name=this.constructor.name,this.message=h}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},l}(Error),fn=Lt()?function(){return self.worker&&self.worker.referrer}:function(){return(b.location.protocol==="blob:"?b.parent:b).location.href},an,un,ti=function(s,l){if(!(/^file:/.test(h=s.url)||/^file:/.test(fn())&&!/^\w+:/.test(h))){if(b.fetch&&b.Request&&b.AbortController&&b.Request.prototype.hasOwnProperty("signal"))return function(g,x){var E,T=new b.AbortController,M=new b.Request(g.url,{method:g.method||"GET",body:g.body,credentials:g.credentials,headers:g.headers,referrer:fn(),signal:T.signal}),D=!1,N=!1,$=(E=M.url).indexOf("sku=")>0&&$t(E);g.type==="json"&&M.headers.set("Accept","application/json");var H=function(re,xe,Se){if(!N){if(re&&re.message!=="SecurityError"&&ye(re),xe&&Se)return q(xe);var ze=Date.now();b.fetch(M).then(function(Oe){if(Oe.ok){var et=$?Oe.clone():null;return q(Oe,et,ze)}return x(new en(Oe.statusText,Oe.status,g.url))}).catch(function(Oe){Oe.code!==20&&x(new Error(Oe.message))})}},q=function(re,xe,Se){(g.type==="arrayBuffer"?re.arrayBuffer():g.type==="json"?re.json():re.text()).then(function(ze){N||(xe&&Se&&function(Oe,et,ut){if(ct(),Ge){var St={status:et.status,statusText:et.statusText,headers:new b.Headers};et.headers.forEach(function(Xt,Er){return St.headers.set(Er,Xt)});var It=Gt(et.headers.get("Cache-Control")||"");It["no-store"]||(It["max-age"]&&St.headers.set("Expires",new Date(ut+1e3*It["max-age"]).toUTCString()),new Date(St.headers.get("Expires")).getTime()-ut<42e4||function(Xt,Er){if(at===void 0)try{new Response(new ReadableStream),at=!0}catch{at=!1}at?Er(Xt.body):Xt.blob().then(Er)}(et,function(Xt){var Er=new b.Response(Xt,St);ct(),Ge&&Ge.then(function(kr){return kr.put(Vt(Oe.url),Er)}).catch(function(kr){return ye(kr.message)})}))}}(M,xe,Se),D=!0,x(null,ze,re.headers.get("Cache-Control"),re.headers.get("Expires")))}).catch(function(ze){N||x(new Error(ze.message))})};return $?function(re,xe){if(ct(),!Ge)return xe(null);var Se=Vt(re.url);Ge.then(function(ze){ze.match(Se).then(function(Oe){var et=function(ut){if(!ut)return!1;var St=new Date(ut.headers.get("Expires")||0),It=Gt(ut.headers.get("Cache-Control")||"");return St>Date.now()&&!It["no-cache"]}(Oe);ze.delete(Se),et&&ze.put(Se,Oe.clone()),xe(null,Oe,et)}).catch(xe)}).catch(xe)}(M,H):H(null,null),{cancel:function(){N=!0,D||T.abort()}}}(s,l);if(Lt()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",s,l,void 0,!0)}var h;return function(g,x){var E=new b.XMLHttpRequest;for(var T in E.open(g.method||"GET",g.url,!0),g.type==="arrayBuffer"&&(E.responseType="arraybuffer"),g.headers)E.setRequestHeader(T,g.headers[T]);return g.type==="json"&&(E.responseType="text",E.setRequestHeader("Accept","application/json")),E.withCredentials=g.credentials==="include",E.onerror=function(){x(new Error(E.statusText))},E.onload=function(){if((E.status>=200&&E.status<300||E.status===0)&&E.response!==null){var M=E.response;if(g.type==="json")try{M=JSON.parse(E.response)}catch(D){return x(D)}x(null,M,E.getResponseHeader("Cache-Control"),E.getResponseHeader("Expires"))}else x(new en(E.statusText,E.status,g.url))},E.send(g.body),{cancel:function(){return E.abort()}}}(s,l)},Hi=function(s,l){return ti(L(s,{type:"arrayBuffer"}),l)},Fn=function(s,l){return ti(L(s,{method:"POST"}),l)},j="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";an=[],un=0;var Y=function(s,l){if(Qt.supported&&(s.headers||(s.headers={}),s.headers.accept="image/webp,*/*"),un>=Je.MAX_PARALLEL_IMAGE_REQUESTS){var h={requestParameters:s,callback:l,cancelled:!1,cancel:function(){this.cancelled=!0}};return an.push(h),h}un++;var g=!1,x=function(){if(!g)for(g=!0,un--;an.length&&un<Je.MAX_PARALLEL_IMAGE_REQUESTS;){var T=an.shift();T.cancelled||(T.cancel=Y(T.requestParameters,T.callback).cancel)}},E=Hi(s,function(T,M,D,N){x(),T?l(T):M&&(Ri()?function($,H){var q=new b.Blob([new Uint8Array($)],{type:"image/png"});b.createImageBitmap(q).then(function(re){H(null,re)}).catch(function(re){H(new Error("Could not load image because of "+re.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}(M,l):function($,H,q,re){var xe=new b.Image,Se=b.URL;xe.onload=function(){H(null,xe),Se.revokeObjectURL(xe.src),xe.onload=null,b.requestAnimationFrame(function(){xe.src=j})},xe.onerror=function(){return H(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."))};var ze=new b.Blob([new Uint8Array($)],{type:"image/png"});xe.cacheControl=q,xe.expires=re,xe.src=$.byteLength?Se.createObjectURL(ze):j}(M,l,D,N))});return{cancel:function(){E.cancel(),x()}}};function J(s,l,h){h[s]&&h[s].indexOf(l)!==-1||(h[s]=h[s]||[],h[s].push(l))}function ce(s,l,h){if(h&&h[s]){var g=h[s].indexOf(l);g!==-1&&h[s].splice(g,1)}}var Ee=function(s,l){l===void 0&&(l={}),L(this,l),this.type=s},je=function(s){function l(h,g){g===void 0&&(g={}),s.call(this,"error",L({error:h},g))}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l}(Ee),Ye=function(){};Ye.prototype.on=function(s,l){return this._listeners=this._listeners||{},J(s,l,this._listeners),this},Ye.prototype.off=function(s,l){return ce(s,l,this._listeners),ce(s,l,this._oneTimeListeners),this},Ye.prototype.once=function(s,l){return this._oneTimeListeners=this._oneTimeListeners||{},J(s,l,this._oneTimeListeners),this},Ye.prototype.fire=function(s,l){typeof s=="string"&&(s=new Ee(s,l||{}));var h=s.type;if(this.listens(h)){s.target=this;for(var g=0,x=this._listeners&&this._listeners[h]?this._listeners[h].slice():[];g<x.length;g+=1)x[g].call(this,s);for(var E=0,T=this._oneTimeListeners&&this._oneTimeListeners[h]?this._oneTimeListeners[h].slice():[];E<T.length;E+=1){var M=T[E];ce(h,M,this._oneTimeListeners),M.call(this,s)}var D=this._eventedParent;D&&(L(s,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),D.fire(s))}else s instanceof je&&console.error(s.error);return this},Ye.prototype.listens=function(s){return this._listeners&&this._listeners[s]&&this._listeners[s].length>0||this._oneTimeListeners&&this._oneTimeListeners[s]&&this._oneTimeListeners[s].length>0||this._eventedParent&&this._eventedParent.listens(s)},Ye.prototype.setEventedParent=function(s,l){return this._eventedParent=s,this._eventedParentData=l,this};var ie={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Ce=function(s,l,h,g){this.message=(s?s+": ":"")+h,g&&(this.identifier=g),l!=null&&l.__line__&&(this.line=l.__line__)};function it(s){var l=s.value;return l?[new Ce(s.key,l,"constants have been deprecated as of v8")]:[]}function Nt(s){for(var l=[],h=arguments.length-1;h-- >0;)l[h]=arguments[h+1];for(var g=0,x=l;g<x.length;g+=1){var E=x[g];for(var T in E)s[T]=E[T]}return s}function vr(s){return s instanceof Number||s instanceof String||s instanceof Boolean?s.valueOf():s}function Ot(s){if(Array.isArray(s))return s.map(Ot);if(s instanceof Object&&!(s instanceof Number||s instanceof String||s instanceof Boolean)){var l={};for(var h in s)l[h]=Ot(s[h]);return l}return vr(s)}var ar=function(s){function l(h,g){s.call(this,g),this.message=g,this.key=h}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l}(Error),tn=function(s,l){l===void 0&&(l=[]),this.parent=s,this.bindings={};for(var h=0,g=l;h<g.length;h+=1){var x=g[h];this.bindings[x[0]]=x[1]}};tn.prototype.concat=function(s){return new tn(this,s)},tn.prototype.get=function(s){if(this.bindings[s])return this.bindings[s];if(this.parent)return this.parent.get(s);throw new Error(s+" not found in scope.")},tn.prototype.has=function(s){return!!this.bindings[s]||!!this.parent&&this.parent.has(s)};var qr={kind:"null"},Dt={kind:"number"},zr={kind:"string"},Rr={kind:"boolean"},Pr={kind:"color"},Hn={kind:"object"},Lr={kind:"value"},ci={kind:"collator"},Gi={kind:"formatted"},oi={kind:"resolvedImage"};function _i(s,l){return{kind:"array",itemType:s,N:l}}function Gn(s){if(s.kind==="array"){var l=Gn(s.itemType);return typeof s.N=="number"?"array<"+l+", "+s.N+">":s.itemType.kind==="value"?"array":"array<"+l+">"}return s.kind}var ka=[qr,Dt,zr,Rr,Pr,Gi,Hn,_i(Lr),oi];function hi(s,l){if(l.kind==="error")return null;if(s.kind==="array"){if(l.kind==="array"&&(l.N===0&&l.itemType.kind==="value"||!hi(s.itemType,l.itemType))&&(typeof s.N!="number"||s.N===l.N))return null}else{if(s.kind===l.kind)return null;if(s.kind==="value"){for(var h=0,g=ka;h<g.length;h+=1)if(!hi(g[h],l))return null}}return"Expected "+Gn(s)+" but found "+Gn(l)+" instead."}function Wi(s,l){return l.some(function(h){return h.kind===s.kind})}function Ii(s,l){return l.some(function(h){return h==="null"?s===null:h==="array"?Array.isArray(s):h==="object"?s&&!Array.isArray(s)&&typeof s=="object":h===typeof s})}var Wn=u(function(s,l){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]};function g(M){return(M=Math.round(M))<0?0:M>255?255:M}function x(M){return g(M[M.length-1]==="%"?parseFloat(M)/100*255:parseInt(M))}function E(M){return(D=M[M.length-1]==="%"?parseFloat(M)/100:parseFloat(M))<0?0:D>1?1:D;var D}function T(M,D,N){return N<0?N+=1:N>1&&(N-=1),6*N<1?M+(D-M)*N*6:2*N<1?D:3*N<2?M+(D-M)*(2/3-N)*6:M}try{l.parseCSSColor=function(M){var D,N=M.replace(/ /g,"").toLowerCase();if(N in h)return h[N].slice();if(N[0]==="#")return N.length===4?(D=parseInt(N.substr(1),16))>=0&&D<=4095?[(3840&D)>>4|(3840&D)>>8,240&D|(240&D)>>4,15&D|(15&D)<<4,1]:null:N.length===7&&(D=parseInt(N.substr(1),16))>=0&&D<=16777215?[(16711680&D)>>16,(65280&D)>>8,255&D,1]:null;var $=N.indexOf("("),H=N.indexOf(")");if($!==-1&&H+1===N.length){var q=N.substr(0,$),re=N.substr($+1,H-($+1)).split(","),xe=1;switch(q){case"rgba":if(re.length!==4)return null;xe=E(re.pop());case"rgb":return re.length!==3?null:[x(re[0]),x(re[1]),x(re[2]),xe];case"hsla":if(re.length!==4)return null;xe=E(re.pop());case"hsl":if(re.length!==3)return null;var Se=(parseFloat(re[0])%360+360)%360/360,ze=E(re[1]),Oe=E(re[2]),et=Oe<=.5?Oe*(ze+1):Oe+ze-Oe*ze,ut=2*Oe-et;return[g(255*T(ut,et,Se+1/3)),g(255*T(ut,et,Se)),g(255*T(ut,et,Se-1/3)),xe];default:return null}}return null}}catch{}}).parseCSSColor,si=function(s,l,h,g){g===void 0&&(g=1),this.r=s,this.g=l,this.b=h,this.a=g};si.parse=function(s){if(s){if(s instanceof si)return s;if(typeof s=="string"){var l=Wn(s);if(l)return new si(l[0]/255*l[3],l[1]/255*l[3],l[2]/255*l[3],l[3])}}},si.prototype.toString=function(){var s=this.toArray(),l=s[1],h=s[2],g=s[3];return"rgba("+Math.round(s[0])+","+Math.round(l)+","+Math.round(h)+","+g+")"},si.prototype.toArray=function(){var s=this.a;return s===0?[0,0,0,0]:[255*this.r/s,255*this.g/s,255*this.b/s,s]},si.black=new si(0,0,0,1),si.white=new si(1,1,1,1),si.transparent=new si(0,0,0,0),si.red=new si(1,0,0,1);var To=function(s,l,h){this.sensitivity=s?l?"variant":"case":l?"accent":"base",this.locale=h,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};To.prototype.compare=function(s,l){return this.collator.compare(s,l)},To.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var dl=function(s,l,h,g,x){this.text=s,this.image=l,this.scale=h,this.fontStack=g,this.textColor=x},wa=function(s){this.sections=s};wa.fromString=function(s){return new wa([new dl(s,null,null,null,null)])},wa.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some(function(s){return s.text.length!==0||s.image&&s.image.name.length!==0})},wa.factory=function(s){return s instanceof wa?s:wa.fromString(s)},wa.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(s){return s.text}).join("")},wa.prototype.serialize=function(){for(var s=["format"],l=0,h=this.sections;l<h.length;l+=1){var g=h[l];if(g.image)s.push(["image",g.image.name]);else{s.push(g.text);var x={};g.fontStack&&(x["text-font"]=["literal",g.fontStack.split(",")]),g.scale&&(x["font-scale"]=g.scale),g.textColor&&(x["text-color"]=["rgba"].concat(g.textColor.toArray())),s.push(x)}}return s};var fa=function(s){this.name=s.name,this.available=s.available};function vl(s,l,h,g){return typeof s=="number"&&s>=0&&s<=255&&typeof l=="number"&&l>=0&&l<=255&&typeof h=="number"&&h>=0&&h<=255?g===void 0||typeof g=="number"&&g>=0&&g<=1?null:"Invalid rgba value ["+[s,l,h,g].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof g=="number"?[s,l,h,g]:[s,l,h]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function $s(s){if(s===null||typeof s=="string"||typeof s=="boolean"||typeof s=="number"||s instanceof si||s instanceof To||s instanceof wa||s instanceof fa)return!0;if(Array.isArray(s)){for(var l=0,h=s;l<h.length;l+=1)if(!$s(h[l]))return!1;return!0}if(typeof s=="object"){for(var g in s)if(!$s(s[g]))return!1;return!0}return!1}function sa(s){if(s===null)return qr;if(typeof s=="string")return zr;if(typeof s=="boolean")return Rr;if(typeof s=="number")return Dt;if(s instanceof si)return Pr;if(s instanceof To)return ci;if(s instanceof wa)return Gi;if(s instanceof fa)return oi;if(Array.isArray(s)){for(var l,h=s.length,g=0,x=s;g<x.length;g+=1){var E=sa(x[g]);if(l){if(l===E)continue;l=Lr;break}l=E}return _i(l||Lr,h)}return Hn}function Hu(s){var l=typeof s;return s===null?"":l==="string"||l==="number"||l==="boolean"?String(s):s instanceof si||s instanceof wa||s instanceof fa?s.toString():JSON.stringify(s)}fa.prototype.toString=function(){return this.name},fa.fromString=function(s){return s?new fa({name:s,available:!1}):null},fa.prototype.serialize=function(){return["image",this.name]};var ro=function(s,l){this.type=s,this.value=l};ro.parse=function(s,l){if(s.length!==2)return l.error("'literal' expression requires exactly one argument, but found "+(s.length-1)+" instead.");if(!$s(s[1]))return l.error("invalid value");var h=s[1],g=sa(h),x=l.expectedType;return g.kind!=="array"||g.N!==0||!x||x.kind!=="array"||typeof x.N=="number"&&x.N!==0||(g=x),new ro(g,h)},ro.prototype.evaluate=function(){return this.value},ro.prototype.eachChild=function(){},ro.prototype.outputDefined=function(){return!0},ro.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof si?["rgba"].concat(this.value.toArray()):this.value instanceof wa?this.value.serialize():this.value};var ua=function(s){this.name="ExpressionEvaluationError",this.message=s};ua.prototype.toJSON=function(){return this.message};var Ca={string:zr,number:Dt,boolean:Rr,object:Hn},Qi=function(s,l){this.type=s,this.args=l};Qi.parse=function(s,l){if(s.length<2)return l.error("Expected at least one argument.");var h,g=1,x=s[0];if(x==="array"){var E,T;if(s.length>2){var M=s[1];if(typeof M!="string"||!(M in Ca)||M==="object")return l.error('The item type argument of "array" must be one of string, number, boolean',1);E=Ca[M],g++}else E=Lr;if(s.length>3){if(s[2]!==null&&(typeof s[2]!="number"||s[2]<0||s[2]!==Math.floor(s[2])))return l.error('The length argument to "array" must be a positive integer literal',2);T=s[2],g++}h=_i(E,T)}else h=Ca[x];for(var D=[];g<s.length;g++){var N=l.parse(s[g],g,Lr);if(!N)return null;D.push(N)}return new Qi(h,D)},Qi.prototype.evaluate=function(s){for(var l=0;l<this.args.length;l++){var h=this.args[l].evaluate(s);if(!hi(this.type,sa(h)))return h;if(l===this.args.length-1)throw new ua("Expected value to be of type "+Gn(this.type)+", but found "+Gn(sa(h))+" instead.")}return null},Qi.prototype.eachChild=function(s){this.args.forEach(s)},Qi.prototype.outputDefined=function(){return this.args.every(function(s){return s.outputDefined()})},Qi.prototype.serialize=function(){var s=this.type,l=[s.kind];if(s.kind==="array"){var h=s.itemType;if(h.kind==="string"||h.kind==="number"||h.kind==="boolean"){l.push(h.kind);var g=s.N;(typeof g=="number"||this.args.length>1)&&l.push(g)}}return l.concat(this.args.map(function(x){return x.serialize()}))};var Go=function(s){this.type=Gi,this.sections=s};Go.parse=function(s,l){if(s.length<2)return l.error("Expected at least one argument.");var h=s[1];if(!Array.isArray(h)&&typeof h=="object")return l.error("First argument must be an image or text section.");for(var g=[],x=!1,E=1;E<=s.length-1;++E){var T=s[E];if(x&&typeof T=="object"&&!Array.isArray(T)){x=!1;var M=null;if(T["font-scale"]&&!(M=l.parse(T["font-scale"],1,Dt)))return null;var D=null;if(T["text-font"]&&!(D=l.parse(T["text-font"],1,_i(zr))))return null;var N=null;if(T["text-color"]&&!(N=l.parse(T["text-color"],1,Pr)))return null;var $=g[g.length-1];$.scale=M,$.font=D,$.textColor=N}else{var H=l.parse(s[E],1,Lr);if(!H)return null;var q=H.type.kind;if(q!=="string"&&q!=="value"&&q!=="null"&&q!=="resolvedImage")return l.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");x=!0,g.push({content:H,scale:null,font:null,textColor:null})}}return new Go(g)},Go.prototype.evaluate=function(s){return new wa(this.sections.map(function(l){var h=l.content.evaluate(s);return sa(h)===oi?new dl("",h,null,null,null):new dl(Hu(h),null,l.scale?l.scale.evaluate(s):null,l.font?l.font.evaluate(s).join(","):null,l.textColor?l.textColor.evaluate(s):null)}))},Go.prototype.eachChild=function(s){for(var l=0,h=this.sections;l<h.length;l+=1){var g=h[l];s(g.content),g.scale&&s(g.scale),g.font&&s(g.font),g.textColor&&s(g.textColor)}},Go.prototype.outputDefined=function(){return!1},Go.prototype.serialize=function(){for(var s=["format"],l=0,h=this.sections;l<h.length;l+=1){var g=h[l];s.push(g.content.serialize());var x={};g.scale&&(x["font-scale"]=g.scale.serialize()),g.font&&(x["text-font"]=g.font.serialize()),g.textColor&&(x["text-color"]=g.textColor.serialize()),s.push(x)}return s};var Bo=function(s){this.type=oi,this.input=s};Bo.parse=function(s,l){if(s.length!==2)return l.error("Expected two arguments.");var h=l.parse(s[1],1,zr);return h?new Bo(h):l.error("No image name provided.")},Bo.prototype.evaluate=function(s){var l=this.input.evaluate(s),h=fa.fromString(l);return h&&s.availableImages&&(h.available=s.availableImages.indexOf(l)>-1),h},Bo.prototype.eachChild=function(s){s(this.input)},Bo.prototype.outputDefined=function(){return!1},Bo.prototype.serialize=function(){return["image",this.input.serialize()]};var yf={"to-boolean":Rr,"to-color":Pr,"to-number":Dt,"to-string":zr},vs=function(s,l){this.type=s,this.args=l};vs.parse=function(s,l){if(s.length<2)return l.error("Expected at least one argument.");var h=s[0];if((h==="to-boolean"||h==="to-string")&&s.length!==2)return l.error("Expected one argument.");for(var g=yf[h],x=[],E=1;E<s.length;E++){var T=l.parse(s[E],E,Lr);if(!T)return null;x.push(T)}return new vs(g,x)},vs.prototype.evaluate=function(s){if(this.type.kind==="boolean")return!!this.args[0].evaluate(s);if(this.type.kind==="color"){for(var l,h,g=0,x=this.args;g<x.length;g+=1){if(h=null,(l=x[g].evaluate(s))instanceof si)return l;if(typeof l=="string"){var E=s.parseColor(l);if(E)return E}else if(Array.isArray(l)&&!(h=l.length<3||l.length>4?"Invalid rbga value "+JSON.stringify(l)+": expected an array containing either three or four numeric values.":vl(l[0],l[1],l[2],l[3])))return new si(l[0]/255,l[1]/255,l[2]/255,l[3])}throw new ua(h||"Could not parse color from value '"+(typeof l=="string"?l:String(JSON.stringify(l)))+"'")}if(this.type.kind==="number"){for(var T=null,M=0,D=this.args;M<D.length;M+=1){if((T=D[M].evaluate(s))===null)return 0;var N=Number(T);if(!isNaN(N))return N}throw new ua("Could not convert "+JSON.stringify(T)+" to number.")}return this.type.kind==="formatted"?wa.fromString(Hu(this.args[0].evaluate(s))):this.type.kind==="resolvedImage"?fa.fromString(Hu(this.args[0].evaluate(s))):Hu(this.args[0].evaluate(s))},vs.prototype.eachChild=function(s){this.args.forEach(s)},vs.prototype.outputDefined=function(){return this.args.every(function(s){return s.outputDefined()})},vs.prototype.serialize=function(){if(this.type.kind==="formatted")return new Go([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Bo(this.args[0]).serialize();var s=["to-"+this.type.kind];return this.eachChild(function(l){s.push(l.serialize())}),s};var Tp=["Unknown","Point","LineString","Polygon"],ee=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};ee.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},ee.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?Tp[this.feature.type]:this.feature.type:null},ee.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},ee.prototype.canonicalID=function(){return this.canonical},ee.prototype.properties=function(){return this.feature&&this.feature.properties||{}},ee.prototype.parseColor=function(s){var l=this._parseColorCache[s];return l||(l=this._parseColorCache[s]=si.parse(s)),l};var ue=function(s,l,h,g){this.name=s,this.type=l,this._evaluate=h,this.args=g};ue.prototype.evaluate=function(s){return this._evaluate(s,this.args)},ue.prototype.eachChild=function(s){this.args.forEach(s)},ue.prototype.outputDefined=function(){return!1},ue.prototype.serialize=function(){return[this.name].concat(this.args.map(function(s){return s.serialize()}))},ue.parse=function(s,l){var h,g=s[0],x=ue.definitions[g];if(!x)return l.error('Unknown expression "'+g+'". If you wanted a literal array, use ["literal", [...]].',0);for(var E=Array.isArray(x)?x[0]:x.type,T=Array.isArray(x)?[[x[1],x[2]]]:x.overloads,M=T.filter(function(An){var Zr=An[0];return!Array.isArray(Zr)||Zr.length===s.length-1}),D=null,N=0,$=M;N<$.length;N+=1){var H=$[N],q=H[0],re=H[1];D=new Gu(l.registry,l.path,null,l.scope);for(var xe=[],Se=!1,ze=1;ze<s.length;ze++){var Oe=s[ze],et=Array.isArray(q)?q[ze-1]:q.type,ut=D.parse(Oe,1+xe.length,et);if(!ut){Se=!0;break}xe.push(ut)}if(!Se)if(Array.isArray(q)&&q.length!==xe.length)D.error("Expected "+q.length+" arguments, but found "+xe.length+" instead.");else{for(var St=0;St<xe.length;St++){var It=Array.isArray(q)?q[St]:q.type,Xt=xe[St];D.concat(St+1).checkSubtype(It,Xt.type)}if(D.errors.length===0)return new ue(g,E,re,xe)}}if(M.length===1)(h=l.errors).push.apply(h,D.errors);else{for(var Er=(M.length?M:T).map(function(An){var Zr;return Zr=An[0],Array.isArray(Zr)?"("+Zr.map(Gn).join(", ")+")":"("+Gn(Zr.type)+"...)"}).join(" | "),kr=[],mn=1;mn<s.length;mn++){var Gr=l.parse(s[mn],1+kr.length);if(!Gr)return null;kr.push(Gn(Gr.type))}l.error("Expected arguments of type "+Er+", but found ("+kr.join(", ")+") instead.")}return null},ue.register=function(s,l){for(var h in ue.definitions=l,l)s[h]=ue};var Ue=function(s,l,h){this.type=ci,this.locale=h,this.caseSensitive=s,this.diacriticSensitive=l};function _t(s,l){s[0]=Math.min(s[0],l[0]),s[1]=Math.min(s[1],l[1]),s[2]=Math.max(s[2],l[0]),s[3]=Math.max(s[3],l[1])}function Sr(s,l){return!(s[0]<=l[0]||s[2]>=l[2]||s[1]<=l[1]||s[3]>=l[3])}function hn(s,l){var h=(180+s[0])/360,g=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s[1]*Math.PI/360)))/360,x=Math.pow(2,l.z);return[Math.round(h*x*8192),Math.round(g*x*8192)]}function Ei(s,l,h){return l[1]>s[1]!=h[1]>s[1]&&s[0]<(h[0]-l[0])*(s[1]-l[1])/(h[1]-l[1])+l[0]}function La(s,l){for(var h,g,x,E,T,M,D,N=!1,$=0,H=l.length;$<H;$++)for(var q=l[$],re=0,xe=q.length;re<xe-1;re++){if((E=(h=s)[0]-(g=q[re])[0])*(D=h[1]-(x=q[re+1])[1])-(M=h[0]-x[0])*(T=h[1]-g[1])==0&&E*M<=0&&T*D<=0)return!1;Ei(s,q[re],q[re+1])&&(N=!N)}return N}function mo(s,l){for(var h=0;h<l.length;h++)if(La(s,l[h]))return!0;return!1}function no(s,l,h,g){var x=g[0]-h[0],E=g[1]-h[1],T=(s[0]-h[0])*E-x*(s[1]-h[1]),M=(l[0]-h[0])*E-x*(l[1]-h[1]);return T>0&&M<0||T<0&&M>0}function Vs(s,l,h){for(var g=0,x=h;g<x.length;g+=1)for(var E=x[g],T=0;T<E.length-1;++T)if((H=[($=E[T+1])[0]-(N=E[T])[0],$[1]-N[1]])[0]*(q=[(D=l)[0]-(M=s)[0],D[1]-M[1]])[1]-H[1]*q[0]!=0&&no(M,D,N,$)&&no(N,$,M,D))return!0;var M,D,N,$,H,q;return!1}function F1(s,l){for(var h=0;h<s.length;++h)if(!La(s[h],l))return!1;for(var g=0;g<s.length-1;++g)if(Vs(s[g],s[g+1],l))return!1;return!0}function B1(s,l){for(var h=0;h<l.length;h++)if(F1(s,l[h]))return!0;return!1}function Tc(s,l,h){for(var g=[],x=0;x<s.length;x++){for(var E=[],T=0;T<s[x].length;T++){var M=hn(s[x][T],h);_t(l,M),E.push(M)}g.push(E)}return g}function wp(s,l,h){for(var g=[],x=0;x<s.length;x++){var E=Tc(s[x],l,h);g.push(E)}return g}function xf(s,l,h,g){if(s[0]<h[0]||s[0]>h[2]){var x=.5*g,E=s[0]-h[0]>x?-g:h[0]-s[0]>x?g:0;E===0&&(E=s[0]-h[2]>x?-g:h[2]-s[0]>x?g:0),s[0]+=E}_t(l,s)}function L1(s,l,h,g){for(var x=8192*Math.pow(2,g.z),E=[8192*g.x,8192*g.y],T=[],M=0,D=s;M<D.length;M+=1)for(var N=0,$=D[M];N<$.length;N+=1){var H=$[N],q=[H.x+E[0],H.y+E[1]];xf(q,l,h,x),T.push(q)}return T}function hh(s,l,h,g){for(var x,E=8192*Math.pow(2,g.z),T=[8192*g.x,8192*g.y],M=[],D=0,N=s;D<N.length;D+=1){for(var $=[],H=0,q=N[D];H<q.length;H+=1){var re=q[H],xe=[re.x+T[0],re.y+T[1]];_t(l,xe),$.push(xe)}M.push($)}if(l[2]-l[0]<=E/2){(x=l)[0]=x[1]=1/0,x[2]=x[3]=-1/0;for(var Se=0,ze=M;Se<ze.length;Se+=1)for(var Oe=0,et=ze[Se];Oe<et.length;Oe+=1)xf(et[Oe],l,h,E)}return M}Ue.parse=function(s,l){if(s.length!==2)return l.error("Expected one argument.");var h=s[1];if(typeof h!="object"||Array.isArray(h))return l.error("Collator options argument must be an object.");var g=l.parse(h["case-sensitive"]!==void 0&&h["case-sensitive"],1,Rr);if(!g)return null;var x=l.parse(h["diacritic-sensitive"]!==void 0&&h["diacritic-sensitive"],1,Rr);if(!x)return null;var E=null;return h.locale&&!(E=l.parse(h.locale,1,zr))?null:new Ue(g,x,E)},Ue.prototype.evaluate=function(s){return new To(this.caseSensitive.evaluate(s),this.diacriticSensitive.evaluate(s),this.locale?this.locale.evaluate(s):null)},Ue.prototype.eachChild=function(s){s(this.caseSensitive),s(this.diacriticSensitive),this.locale&&s(this.locale)},Ue.prototype.outputDefined=function(){return!1},Ue.prototype.serialize=function(){var s={};return s["case-sensitive"]=this.caseSensitive.serialize(),s["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(s.locale=this.locale.serialize()),["collator",s]};var wo=function(s,l){this.type=Rr,this.geojson=s,this.geometries=l};function ml(s){if(s instanceof ue&&(s.name==="get"&&s.args.length===1||s.name==="feature-state"||s.name==="has"&&s.args.length===1||s.name==="properties"||s.name==="geometry-type"||s.name==="id"||/^filter-/.test(s.name))||s instanceof wo)return!1;var l=!0;return s.eachChild(function(h){l&&!ml(h)&&(l=!1)}),l}function gl(s){if(s instanceof ue&&s.name==="feature-state")return!1;var l=!0;return s.eachChild(function(h){l&&!gl(h)&&(l=!1)}),l}function yu(s,l){if(s instanceof ue&&l.indexOf(s.name)>=0)return!1;var h=!0;return s.eachChild(function(g){h&&!yu(g,l)&&(h=!1)}),h}wo.parse=function(s,l){if(s.length!==2)return l.error("'within' expression requires exactly one argument, but found "+(s.length-1)+" instead.");if($s(s[1])){var h=s[1];if(h.type==="FeatureCollection")for(var g=0;g<h.features.length;++g){var x=h.features[g].geometry.type;if(x==="Polygon"||x==="MultiPolygon")return new wo(h,h.features[g].geometry)}else if(h.type==="Feature"){var E=h.geometry.type;if(E==="Polygon"||E==="MultiPolygon")return new wo(h,h.geometry)}else if(h.type==="Polygon"||h.type==="MultiPolygon")return new wo(h,h)}return l.error("'within' expression requires valid geojson object that contains polygon geometry type.")},wo.prototype.evaluate=function(s){if(s.geometry()!=null&&s.canonicalID()!=null){if(s.geometryType()==="Point")return function(l,h){var g=[1/0,1/0,-1/0,-1/0],x=[1/0,1/0,-1/0,-1/0],E=l.canonicalID();if(h.type==="Polygon"){var T=Tc(h.coordinates,x,E),M=L1(l.geometry(),g,x,E);if(!Sr(g,x))return!1;for(var D=0,N=M;D<N.length;D+=1)if(!La(N[D],T))return!1}if(h.type==="MultiPolygon"){var $=wp(h.coordinates,x,E),H=L1(l.geometry(),g,x,E);if(!Sr(g,x))return!1;for(var q=0,re=H;q<re.length;q+=1)if(!mo(re[q],$))return!1}return!0}(s,this.geometries);if(s.geometryType()==="LineString")return function(l,h){var g=[1/0,1/0,-1/0,-1/0],x=[1/0,1/0,-1/0,-1/0],E=l.canonicalID();if(h.type==="Polygon"){var T=Tc(h.coordinates,x,E),M=hh(l.geometry(),g,x,E);if(!Sr(g,x))return!1;for(var D=0,N=M;D<N.length;D+=1)if(!F1(N[D],T))return!1}if(h.type==="MultiPolygon"){var $=wp(h.coordinates,x,E),H=hh(l.geometry(),g,x,E);if(!Sr(g,x))return!1;for(var q=0,re=H;q<re.length;q+=1)if(!B1(re[q],$))return!1}return!0}(s,this.geometries)}return!1},wo.prototype.eachChild=function(){},wo.prototype.outputDefined=function(){return!0},wo.prototype.serialize=function(){return["within",this.geojson]};var xu=function(s,l){this.type=l.type,this.name=s,this.boundExpression=l};xu.parse=function(s,l){if(s.length!==2||typeof s[1]!="string")return l.error("'var' expression requires exactly one string literal argument.");var h=s[1];return l.scope.has(h)?new xu(h,l.scope.get(h)):l.error('Unknown variable "'+h+'". Make sure "'+h+'" has been bound in an enclosing "let" expression before using it.',1)},xu.prototype.evaluate=function(s){return this.boundExpression.evaluate(s)},xu.prototype.eachChild=function(){},xu.prototype.outputDefined=function(){return!1},xu.prototype.serialize=function(){return["var",this.name]};var Gu=function(s,l,h,g,x){l===void 0&&(l=[]),g===void 0&&(g=new tn),x===void 0&&(x=[]),this.registry=s,this.path=l,this.key=l.map(function(E){return"["+E+"]"}).join(""),this.scope=g,this.errors=x,this.expectedType=h};function bf(s,l){for(var h,g=s.length-1,x=0,E=g,T=0;x<=E;)if((h=s[T=Math.floor((x+E)/2)])<=l){if(T===g||l<s[T+1])return T;x=T+1}else{if(!(h>l))throw new ua("Input is not a number.");E=T-1}return 0}Gu.prototype.parse=function(s,l,h,g,x){return x===void 0&&(x={}),l?this.concat(l,h,g)._parse(s,x):this._parse(s,x)},Gu.prototype._parse=function(s,l){function h(N,$,H){return H==="assert"?new Qi($,[N]):H==="coerce"?new vs($,[N]):N}if(s!==null&&typeof s!="string"&&typeof s!="boolean"&&typeof s!="number"||(s=["literal",s]),Array.isArray(s)){if(s.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var g=s[0];if(typeof g!="string")return this.error("Expression name must be a string, but found "+typeof g+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var x=this.registry[g];if(x){var E=x.parse(s,this);if(!E)return null;if(this.expectedType){var T=this.expectedType,M=E.type;if(T.kind!=="string"&&T.kind!=="number"&&T.kind!=="boolean"&&T.kind!=="object"&&T.kind!=="array"||M.kind!=="value")if(T.kind!=="color"&&T.kind!=="formatted"&&T.kind!=="resolvedImage"||M.kind!=="value"&&M.kind!=="string"){if(this.checkSubtype(T,M))return null}else E=h(E,T,l.typeAnnotation||"coerce");else E=h(E,T,l.typeAnnotation||"assert")}if(!(E instanceof ro)&&E.type.kind!=="resolvedImage"&&function N($){if($ instanceof xu)return N($.boundExpression);if($ instanceof ue&&$.name==="error"||$ instanceof Ue||$ instanceof wo)return!1;var H=$ instanceof vs||$ instanceof Qi,q=!0;return $.eachChild(function(re){q=H?q&&N(re):q&&re instanceof ro}),!!q&&ml($)&&yu($,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(E)){var D=new ee;try{E=new ro(E.type,E.evaluate(D))}catch(N){return this.error(N.message),null}}return E}return this.error('Unknown expression "'+g+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(s===void 0?"'undefined' value invalid. Use null instead.":typeof s=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof s+" instead.")},Gu.prototype.concat=function(s,l,h){var g=typeof s=="number"?this.path.concat(s):this.path,x=h?this.scope.concat(h):this.scope;return new Gu(this.registry,g,l||null,x,this.errors)},Gu.prototype.error=function(s){for(var l=[],h=arguments.length-1;h-- >0;)l[h]=arguments[h+1];var g=""+this.key+l.map(function(x){return"["+x+"]"}).join("");this.errors.push(new ar(g,s))},Gu.prototype.checkSubtype=function(s,l){var h=hi(s,l);return h&&this.error(h),h};var ms=function(s,l,h){this.type=s,this.input=l,this.labels=[],this.outputs=[];for(var g=0,x=h;g<x.length;g+=1){var E=x[g],T=E[1];this.labels.push(E[0]),this.outputs.push(T)}};function Ra(s,l,h){return s*(1-h)+l*h}ms.parse=function(s,l){if(s.length-1<4)return l.error("Expected at least 4 arguments, but found only "+(s.length-1)+".");if((s.length-1)%2!=0)return l.error("Expected an even number of arguments.");var h=l.parse(s[1],1,Dt);if(!h)return null;var g=[],x=null;l.expectedType&&l.expectedType.kind!=="value"&&(x=l.expectedType);for(var E=1;E<s.length;E+=2){var T=E===1?-1/0:s[E],M=s[E+1],D=E,N=E+1;if(typeof T!="number")return l.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',D);if(g.length&&g[g.length-1][0]>=T)return l.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',D);var $=l.parse(M,N,x);if(!$)return null;x=x||$.type,g.push([T,$])}return new ms(x,h,g)},ms.prototype.evaluate=function(s){var l=this.labels,h=this.outputs;if(l.length===1)return h[0].evaluate(s);var g=this.input.evaluate(s);if(g<=l[0])return h[0].evaluate(s);var x=l.length;return g>=l[x-1]?h[x-1].evaluate(s):h[bf(l,g)].evaluate(s)},ms.prototype.eachChild=function(s){s(this.input);for(var l=0,h=this.outputs;l<h.length;l+=1)s(h[l])},ms.prototype.outputDefined=function(){return this.outputs.every(function(s){return s.outputDefined()})},ms.prototype.serialize=function(){for(var s=["step",this.input.serialize()],l=0;l<this.labels.length;l++)l>0&&s.push(this.labels[l]),s.push(this.outputs[l].serialize());return s};var _l=Object.freeze({__proto__:null,number:Ra,color:function(s,l,h){return new si(Ra(s.r,l.r,h),Ra(s.g,l.g,h),Ra(s.b,l.b,h),Ra(s.a,l.a,h))},array:function(s,l,h){return s.map(function(g,x){return Ra(g,l[x],h)})}}),Wu=6/29*3*(6/29),ph=Math.PI/180,N1=180/Math.PI;function dh(s){return s>.008856451679035631?Math.pow(s,1/3):s/Wu+4/29}function Cp(s){return s>6/29?s*s*s:Wu*(s-4/29)}function Rp(s){return 255*(s<=.0031308?12.92*s:1.055*Math.pow(s,1/2.4)-.055)}function Ip(s){return(s/=255)<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4)}function U1(s){var l=Ip(s.r),h=Ip(s.g),g=Ip(s.b),x=dh((.4124564*l+.3575761*h+.1804375*g)/.95047),E=dh((.2126729*l+.7151522*h+.072175*g)/1);return{l:116*E-16,a:500*(x-E),b:200*(E-dh((.0193339*l+.119192*h+.9503041*g)/1.08883)),alpha:s.a}}function z1(s){var l=(s.l+16)/116,h=isNaN(s.a)?l:l+s.a/500,g=isNaN(s.b)?l:l-s.b/200;return l=1*Cp(l),h=.95047*Cp(h),g=1.08883*Cp(g),new si(Rp(3.2404542*h-1.5371385*l-.4985314*g),Rp(-.969266*h+1.8760108*l+.041556*g),Rp(.0556434*h-.2040259*l+1.0572252*g),s.alpha)}function O0(s,l,h){var g=l-s;return s+h*(g>180||g<-180?g-360*Math.round(g/360):g)}var Ef={forward:U1,reverse:z1,interpolate:function(s,l,h){return{l:Ra(s.l,l.l,h),a:Ra(s.a,l.a,h),b:Ra(s.b,l.b,h),alpha:Ra(s.alpha,l.alpha,h)}}},bu={forward:function(s){var l=U1(s),h=l.l,g=l.a,x=l.b,E=Math.atan2(x,g)*N1;return{h:E<0?E+360:E,c:Math.sqrt(g*g+x*x),l:h,alpha:s.a}},reverse:function(s){var l=s.h*ph,h=s.c;return z1({l:s.l,a:Math.cos(l)*h,b:Math.sin(l)*h,alpha:s.alpha})},interpolate:function(s,l,h){return{h:O0(s.h,l.h,h),c:Ra(s.c,l.c,h),l:Ra(s.l,l.l,h),alpha:Ra(s.alpha,l.alpha,h)}}},$1=Object.freeze({__proto__:null,lab:Ef,hcl:bu}),Co=function(s,l,h,g,x){this.type=s,this.operator=l,this.interpolation=h,this.input=g,this.labels=[],this.outputs=[];for(var E=0,T=x;E<T.length;E+=1){var M=T[E],D=M[1];this.labels.push(M[0]),this.outputs.push(D)}};function Ql(s,l,h,g){var x=g-h,E=s-h;return x===0?0:l===1?E/x:(Math.pow(l,E)-1)/(Math.pow(l,x)-1)}Co.interpolationFactor=function(s,l,h,g){var x=0;if(s.name==="exponential")x=Ql(l,s.base,h,g);else if(s.name==="linear")x=Ql(l,1,h,g);else if(s.name==="cubic-bezier"){var E=s.controlPoints;x=new c(E[0],E[1],E[2],E[3]).solve(Ql(l,1,h,g))}return x},Co.parse=function(s,l){var h=s[0],g=s[1],x=s[2],E=s.slice(3);if(!Array.isArray(g)||g.length===0)return l.error("Expected an interpolation type expression.",1);if(g[0]==="linear")g={name:"linear"};else if(g[0]==="exponential"){var T=g[1];if(typeof T!="number")return l.error("Exponential interpolation requires a numeric base.",1,1);g={name:"exponential",base:T}}else{if(g[0]!=="cubic-bezier")return l.error("Unknown interpolation type "+String(g[0]),1,0);var M=g.slice(1);if(M.length!==4||M.some(function(ze){return typeof ze!="number"||ze<0||ze>1}))return l.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);g={name:"cubic-bezier",controlPoints:M}}if(s.length-1<4)return l.error("Expected at least 4 arguments, but found only "+(s.length-1)+".");if((s.length-1)%2!=0)return l.error("Expected an even number of arguments.");if(!(x=l.parse(x,2,Dt)))return null;var D=[],N=null;h==="interpolate-hcl"||h==="interpolate-lab"?N=Pr:l.expectedType&&l.expectedType.kind!=="value"&&(N=l.expectedType);for(var $=0;$<E.length;$+=2){var H=E[$],q=E[$+1],re=$+3,xe=$+4;if(typeof H!="number")return l.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',re);if(D.length&&D[D.length-1][0]>=H)return l.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',re);var Se=l.parse(q,xe,N);if(!Se)return null;N=N||Se.type,D.push([H,Se])}return N.kind==="number"||N.kind==="color"||N.kind==="array"&&N.itemType.kind==="number"&&typeof N.N=="number"?new Co(N,h,g,x,D):l.error("Type "+Gn(N)+" is not interpolatable.")},Co.prototype.evaluate=function(s){var l=this.labels,h=this.outputs;if(l.length===1)return h[0].evaluate(s);var g=this.input.evaluate(s);if(g<=l[0])return h[0].evaluate(s);var x=l.length;if(g>=l[x-1])return h[x-1].evaluate(s);var E=bf(l,g),T=Co.interpolationFactor(this.interpolation,g,l[E],l[E+1]),M=h[E].evaluate(s),D=h[E+1].evaluate(s);return this.operator==="interpolate"?_l[this.type.kind.toLowerCase()](M,D,T):this.operator==="interpolate-hcl"?bu.reverse(bu.interpolate(bu.forward(M),bu.forward(D),T)):Ef.reverse(Ef.interpolate(Ef.forward(M),Ef.forward(D),T))},Co.prototype.eachChild=function(s){s(this.input);for(var l=0,h=this.outputs;l<h.length;l+=1)s(h[l])},Co.prototype.outputDefined=function(){return this.outputs.every(function(s){return s.outputDefined()})},Co.prototype.serialize=function(){var s;s=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var l=[this.operator,s,this.input.serialize()],h=0;h<this.labels.length;h++)l.push(this.labels[h],this.outputs[h].serialize());return l};var yl=function(s,l){this.type=s,this.args=l};yl.parse=function(s,l){if(s.length<2)return l.error("Expectected at least one argument.");var h=null,g=l.expectedType;g&&g.kind!=="value"&&(h=g);for(var x=[],E=0,T=s.slice(1);E<T.length;E+=1){var M=l.parse(T[E],1+x.length,h,void 0,{typeAnnotation:"omit"});if(!M)return null;h=h||M.type,x.push(M)}var D=g&&x.some(function(N){return hi(g,N.type)});return new yl(D?Lr:h,x)},yl.prototype.evaluate=function(s){for(var l,h=null,g=0,x=0,E=this.args;x<E.length&&(g++,(h=E[x].evaluate(s))&&h instanceof fa&&!h.available&&(l||(l=h.name),h=null,g===this.args.length&&(h=l)),h===null);x+=1);return h},yl.prototype.eachChild=function(s){this.args.forEach(s)},yl.prototype.outputDefined=function(){return this.args.every(function(s){return s.outputDefined()})},yl.prototype.serialize=function(){var s=["coalesce"];return this.eachChild(function(l){s.push(l.serialize())}),s};var Cs=function(s,l){this.type=l.type,this.bindings=[].concat(s),this.result=l};Cs.prototype.evaluate=function(s){return this.result.evaluate(s)},Cs.prototype.eachChild=function(s){for(var l=0,h=this.bindings;l<h.length;l+=1)s(h[l][1]);s(this.result)},Cs.parse=function(s,l){if(s.length<4)return l.error("Expected at least 3 arguments, but found "+(s.length-1)+" instead.");for(var h=[],g=1;g<s.length-1;g+=2){var x=s[g];if(typeof x!="string")return l.error("Expected string, but found "+typeof x+" instead.",g);if(/[^a-zA-Z0-9_]/.test(x))return l.error("Variable names must contain only alphanumeric characters or '_'.",g);var E=l.parse(s[g+1],g+1);if(!E)return null;h.push([x,E])}var T=l.parse(s[s.length-1],s.length-1,l.expectedType,h);return T?new Cs(h,T):null},Cs.prototype.outputDefined=function(){return this.result.outputDefined()},Cs.prototype.serialize=function(){for(var s=["let"],l=0,h=this.bindings;l<h.length;l+=1){var g=h[l];s.push(g[0],g[1].serialize())}return s.push(this.result.serialize()),s};var xl=function(s,l,h){this.type=s,this.index=l,this.input=h};xl.parse=function(s,l){if(s.length!==3)return l.error("Expected 2 arguments, but found "+(s.length-1)+" instead.");var h=l.parse(s[1],1,Dt),g=l.parse(s[2],2,_i(l.expectedType||Lr));return h&&g?new xl(g.type.itemType,h,g):null},xl.prototype.evaluate=function(s){var l=this.index.evaluate(s),h=this.input.evaluate(s);if(l<0)throw new ua("Array index out of bounds: "+l+" < 0.");if(l>=h.length)throw new ua("Array index out of bounds: "+l+" > "+(h.length-1)+".");if(l!==Math.floor(l))throw new ua("Array index must be an integer, but found "+l+" instead.");return h[l]},xl.prototype.eachChild=function(s){s(this.index),s(this.input)},xl.prototype.outputDefined=function(){return!1},xl.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var js=function(s,l){this.type=Rr,this.needle=s,this.haystack=l};js.parse=function(s,l){if(s.length!==3)return l.error("Expected 2 arguments, but found "+(s.length-1)+" instead.");var h=l.parse(s[1],1,Lr),g=l.parse(s[2],2,Lr);return h&&g?Wi(h.type,[Rr,zr,Dt,qr,Lr])?new js(h,g):l.error("Expected first argument to be of type boolean, string, number or null, but found "+Gn(h.type)+" instead"):null},js.prototype.evaluate=function(s){var l=this.needle.evaluate(s),h=this.haystack.evaluate(s);if(!h)return!1;if(!Ii(l,["boolean","string","number","null"]))throw new ua("Expected first argument to be of type boolean, string, number or null, but found "+Gn(sa(l))+" instead.");if(!Ii(h,["string","array"]))throw new ua("Expected second argument to be of type array or string, but found "+Gn(sa(h))+" instead.");return h.indexOf(l)>=0},js.prototype.eachChild=function(s){s(this.needle),s(this.haystack)},js.prototype.outputDefined=function(){return!0},js.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Xu=function(s,l,h){this.type=Dt,this.needle=s,this.haystack=l,this.fromIndex=h};Xu.parse=function(s,l){if(s.length<=2||s.length>=5)return l.error("Expected 3 or 4 arguments, but found "+(s.length-1)+" instead.");var h=l.parse(s[1],1,Lr),g=l.parse(s[2],2,Lr);if(!h||!g)return null;if(!Wi(h.type,[Rr,zr,Dt,qr,Lr]))return l.error("Expected first argument to be of type boolean, string, number or null, but found "+Gn(h.type)+" instead");if(s.length===4){var x=l.parse(s[3],3,Dt);return x?new Xu(h,g,x):null}return new Xu(h,g)},Xu.prototype.evaluate=function(s){var l=this.needle.evaluate(s),h=this.haystack.evaluate(s);if(!Ii(l,["boolean","string","number","null"]))throw new ua("Expected first argument to be of type boolean, string, number or null, but found "+Gn(sa(l))+" instead.");if(!Ii(h,["string","array"]))throw new ua("Expected second argument to be of type array or string, but found "+Gn(sa(h))+" instead.");if(this.fromIndex){var g=this.fromIndex.evaluate(s);return h.indexOf(l,g)}return h.indexOf(l)},Xu.prototype.eachChild=function(s){s(this.needle),s(this.haystack),this.fromIndex&&s(this.fromIndex)},Xu.prototype.outputDefined=function(){return!1},Xu.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var s=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),s]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Rs=function(s,l,h,g,x,E){this.inputType=s,this.type=l,this.input=h,this.cases=g,this.outputs=x,this.otherwise=E};Rs.parse=function(s,l){if(s.length<5)return l.error("Expected at least 4 arguments, but found only "+(s.length-1)+".");if(s.length%2!=1)return l.error("Expected an even number of arguments.");var h,g;l.expectedType&&l.expectedType.kind!=="value"&&(g=l.expectedType);for(var x={},E=[],T=2;T<s.length-1;T+=2){var M=s[T],D=s[T+1];Array.isArray(M)||(M=[M]);var N=l.concat(T);if(M.length===0)return N.error("Expected at least one branch label.");for(var $=0,H=M;$<H.length;$+=1){var q=H[$];if(typeof q!="number"&&typeof q!="string")return N.error("Branch labels must be numbers or strings.");if(typeof q=="number"&&Math.abs(q)>Number.MAX_SAFE_INTEGER)return N.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof q=="number"&&Math.floor(q)!==q)return N.error("Numeric branch labels must be integer values.");if(h){if(N.checkSubtype(h,sa(q)))return null}else h=sa(q);if(x[String(q)]!==void 0)return N.error("Branch labels must be unique.");x[String(q)]=E.length}var re=l.parse(D,T,g);if(!re)return null;g=g||re.type,E.push(re)}var xe=l.parse(s[1],1,Lr);if(!xe)return null;var Se=l.parse(s[s.length-1],s.length-1,g);return Se?xe.type.kind!=="value"&&l.concat(1).checkSubtype(h,xe.type)?null:new Rs(h,g,xe,x,E,Se):null},Rs.prototype.evaluate=function(s){var l=this.input.evaluate(s);return(sa(l)===this.inputType&&this.outputs[this.cases[l]]||this.otherwise).evaluate(s)},Rs.prototype.eachChild=function(s){s(this.input),this.outputs.forEach(s),s(this.otherwise)},Rs.prototype.outputDefined=function(){return this.outputs.every(function(s){return s.outputDefined()})&&this.otherwise.outputDefined()},Rs.prototype.serialize=function(){for(var s=this,l=["match",this.input.serialize()],h=[],g={},x=0,E=Object.keys(this.cases).sort();x<E.length;x+=1){var T=E[x];(H=g[this.cases[T]])===void 0?(g[this.cases[T]]=h.length,h.push([this.cases[T],[T]])):h[H][1].push(T)}for(var M=function(re){return s.inputType.kind==="number"?Number(re):re},D=0,N=h;D<N.length;D+=1){var $=N[D],H=$[0],q=$[1];l.push(q.length===1?M(q[0]):q.map(M)),l.push(this.outputs[outputIndex$1].serialize())}return l.push(this.otherwise.serialize()),l};var Yu=function(s,l,h){this.type=s,this.branches=l,this.otherwise=h};Yu.parse=function(s,l){if(s.length<4)return l.error("Expected at least 3 arguments, but found only "+(s.length-1)+".");if(s.length%2!=0)return l.error("Expected an odd number of arguments.");var h;l.expectedType&&l.expectedType.kind!=="value"&&(h=l.expectedType);for(var g=[],x=1;x<s.length-1;x+=2){var E=l.parse(s[x],x,Rr);if(!E)return null;var T=l.parse(s[x+1],x+1,h);if(!T)return null;g.push([E,T]),h=h||T.type}var M=l.parse(s[s.length-1],s.length-1,h);return M?new Yu(h,g,M):null},Yu.prototype.evaluate=function(s){for(var l=0,h=this.branches;l<h.length;l+=1){var g=h[l],x=g[1];if(g[0].evaluate(s))return x.evaluate(s)}return this.otherwise.evaluate(s)},Yu.prototype.eachChild=function(s){for(var l=0,h=this.branches;l<h.length;l+=1){var g=h[l],x=g[1];s(g[0]),s(x)}s(this.otherwise)},Yu.prototype.outputDefined=function(){return this.branches.every(function(s){return s[1].outputDefined()})&&this.otherwise.outputDefined()},Yu.prototype.serialize=function(){var s=["case"];return this.eachChild(function(l){s.push(l.serialize())}),s};var bl=function(s,l,h,g){this.type=s,this.input=l,this.beginIndex=h,this.endIndex=g};function V1(s,l){return s==="=="||s==="!="?l.kind==="boolean"||l.kind==="string"||l.kind==="number"||l.kind==="null"||l.kind==="value":l.kind==="string"||l.kind==="number"||l.kind==="value"}function j1(s,l,h,g){return g.compare(l,h)===0}function Xi(s,l,h){var g=s!=="=="&&s!=="!=";return function(){function x(E,T,M){this.type=Rr,this.lhs=E,this.rhs=T,this.collator=M,this.hasUntypedArgument=E.type.kind==="value"||T.type.kind==="value"}return x.parse=function(E,T){if(E.length!==3&&E.length!==4)return T.error("Expected two or three arguments.");var M=E[0],D=T.parse(E[1],1,Lr);if(!D)return null;if(!V1(M,D.type))return T.concat(1).error('"'+M+`" comparisons are not supported for type '`+Gn(D.type)+"'.");var N=T.parse(E[2],2,Lr);if(!N)return null;if(!V1(M,N.type))return T.concat(2).error('"'+M+`" comparisons are not supported for type '`+Gn(N.type)+"'.");if(D.type.kind!==N.type.kind&&D.type.kind!=="value"&&N.type.kind!=="value")return T.error("Cannot compare types '"+Gn(D.type)+"' and '"+Gn(N.type)+"'.");g&&(D.type.kind==="value"&&N.type.kind!=="value"?D=new Qi(N.type,[D]):D.type.kind!=="value"&&N.type.kind==="value"&&(N=new Qi(D.type,[N])));var $=null;if(E.length===4){if(D.type.kind!=="string"&&N.type.kind!=="string"&&D.type.kind!=="value"&&N.type.kind!=="value")return T.error("Cannot use collator to compare non-string types.");if(!($=T.parse(E[3],3,ci)))return null}return new x(D,N,$)},x.prototype.evaluate=function(E){var T=this.lhs.evaluate(E),M=this.rhs.evaluate(E);if(g&&this.hasUntypedArgument){var D=sa(T),N=sa(M);if(D.kind!==N.kind||D.kind!=="string"&&D.kind!=="number")throw new ua('Expected arguments for "'+s+'" to be (string, string) or (number, number), but found ('+D.kind+", "+N.kind+") instead.")}if(this.collator&&!g&&this.hasUntypedArgument){var $=sa(T),H=sa(M);if($.kind!=="string"||H.kind!=="string")return l(E,T,M)}return this.collator?h(E,T,M,this.collator.evaluate(E)):l(E,T,M)},x.prototype.eachChild=function(E){E(this.lhs),E(this.rhs),this.collator&&E(this.collator)},x.prototype.outputDefined=function(){return!0},x.prototype.serialize=function(){var E=[s];return this.eachChild(function(T){E.push(T.serialize())}),E},x}()}bl.parse=function(s,l){if(s.length<=2||s.length>=5)return l.error("Expected 3 or 4 arguments, but found "+(s.length-1)+" instead.");var h=l.parse(s[1],1,Lr),g=l.parse(s[2],2,Dt);if(!h||!g)return null;if(!Wi(h.type,[_i(Lr),zr,Lr]))return l.error("Expected first argument to be of type array or string, but found "+Gn(h.type)+" instead");if(s.length===4){var x=l.parse(s[3],3,Dt);return x?new bl(h.type,h,g,x):null}return new bl(h.type,h,g)},bl.prototype.evaluate=function(s){var l=this.input.evaluate(s),h=this.beginIndex.evaluate(s);if(!Ii(l,["string","array"]))throw new ua("Expected first argument to be of type array or string, but found "+Gn(sa(l))+" instead.");if(this.endIndex){var g=this.endIndex.evaluate(s);return l.slice(h,g)}return l.slice(h)},bl.prototype.eachChild=function(s){s(this.input),s(this.beginIndex),this.endIndex&&s(this.endIndex)},bl.prototype.outputDefined=function(){return!1},bl.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var s=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),s]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var k0=Xi("==",function(s,l,h){return l===h},j1),vh=Xi("!=",function(s,l,h){return l!==h},function(s,l,h,g){return!j1(0,l,h,g)}),Mp=Xi("<",function(s,l,h){return l<h},function(s,l,h,g){return g.compare(l,h)<0}),Ia=Xi(">",function(s,l,h){return l>h},function(s,l,h,g){return g.compare(l,h)>0}),Pp=Xi("<=",function(s,l,h){return l<=h},function(s,l,h,g){return g.compare(l,h)<=0}),H1=Xi(">=",function(s,l,h){return l>=h},function(s,l,h,g){return g.compare(l,h)>=0}),ns=function(s,l,h,g,x){this.type=zr,this.number=s,this.locale=l,this.currency=h,this.minFractionDigits=g,this.maxFractionDigits=x};ns.parse=function(s,l){if(s.length!==3)return l.error("Expected two arguments.");var h=l.parse(s[1],1,Dt);if(!h)return null;var g=s[2];if(typeof g!="object"||Array.isArray(g))return l.error("NumberFormat options argument must be an object.");var x=null;if(g.locale&&!(x=l.parse(g.locale,1,zr)))return null;var E=null;if(g.currency&&!(E=l.parse(g.currency,1,zr)))return null;var T=null;if(g["min-fraction-digits"]&&!(T=l.parse(g["min-fraction-digits"],1,Dt)))return null;var M=null;return g["max-fraction-digits"]&&!(M=l.parse(g["max-fraction-digits"],1,Dt))?null:new ns(h,x,E,T,M)},ns.prototype.evaluate=function(s){return new Intl.NumberFormat(this.locale?this.locale.evaluate(s):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(s):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(s):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(s):void 0}).format(this.number.evaluate(s))},ns.prototype.eachChild=function(s){s(this.number),this.locale&&s(this.locale),this.currency&&s(this.currency),this.minFractionDigits&&s(this.minFractionDigits),this.maxFractionDigits&&s(this.maxFractionDigits)},ns.prototype.outputDefined=function(){return!1},ns.prototype.serialize=function(){var s={};return this.locale&&(s.locale=this.locale.serialize()),this.currency&&(s.currency=this.currency.serialize()),this.minFractionDigits&&(s["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(s["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),s]};var Zu=function(s){this.type=Dt,this.input=s};Zu.parse=function(s,l){if(s.length!==2)return l.error("Expected 1 argument, but found "+(s.length-1)+" instead.");var h=l.parse(s[1],1);return h?h.type.kind!=="array"&&h.type.kind!=="string"&&h.type.kind!=="value"?l.error("Expected argument of type string or array, but found "+Gn(h.type)+" instead."):new Zu(h):null},Zu.prototype.evaluate=function(s){var l=this.input.evaluate(s);if(typeof l=="string"||Array.isArray(l))return l.length;throw new ua("Expected value to be of type string or array, but found "+Gn(sa(l))+" instead.")},Zu.prototype.eachChild=function(s){s(this.input)},Zu.prototype.outputDefined=function(){return!1},Zu.prototype.serialize=function(){var s=["length"];return this.eachChild(function(l){s.push(l.serialize())}),s};var Eu={"==":k0,"!=":vh,">":Ia,"<":Mp,">=":H1,"<=":Pp,array:Qi,at:xl,boolean:Qi,case:Yu,coalesce:yl,collator:Ue,format:Go,image:Bo,in:js,"index-of":Xu,interpolate:Co,"interpolate-hcl":Co,"interpolate-lab":Co,length:Zu,let:Cs,literal:ro,match:Rs,number:Qi,"number-format":ns,object:Qi,slice:bl,step:ms,string:Qi,"to-boolean":vs,"to-color":vs,"to-number":vs,"to-string":vs,var:xu,within:wo};function El(s,l){var h=l[0],g=l[1],x=l[2],E=l[3];h=h.evaluate(s),g=g.evaluate(s),x=x.evaluate(s);var T=E?E.evaluate(s):1,M=vl(h,g,x,T);if(M)throw new ua(M);return new si(h/255*T,g/255*T,x/255*T,T)}function mh(s,l){return s in l}function wc(s,l){var h=l[s];return h===void 0?null:h}function ou(s){return{type:s}}function Sf(s){return{result:"success",value:s}}function Sl(s){return{result:"error",value:s}}function qu(s){return s["property-type"]==="data-driven"||s["property-type"]==="cross-faded-data-driven"}function Op(s){return!!s.expression&&s.expression.parameters.indexOf("zoom")>-1}function Af(s){return!!s.expression&&s.expression.interpolated}function ta(s){return s instanceof Number?"number":s instanceof String?"string":s instanceof Boolean?"boolean":Array.isArray(s)?"array":s===null?"null":typeof s}function gh(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function D0(s){return s}function Al(s,l,h){return s!==void 0?s:l!==void 0?l:h!==void 0?h:void 0}function Tf(s,l,h,g,x){return Al(typeof h===x?g[h]:void 0,s.default,l.default)}function kp(s,l,h){if(ta(h)!=="number")return Al(s.default,l.default);var g=s.stops.length;if(g===1||h<=s.stops[0][0])return s.stops[0][1];if(h>=s.stops[g-1][0])return s.stops[g-1][1];var x=bf(s.stops.map(function(E){return E[0]}),h);return s.stops[x][1]}function _h(s,l,h){var g=s.base!==void 0?s.base:1;if(ta(h)!=="number")return Al(s.default,l.default);var x=s.stops.length;if(x===1||h<=s.stops[0][0])return s.stops[0][1];if(h>=s.stops[x-1][0])return s.stops[x-1][1];var E=bf(s.stops.map(function(H){return H[0]}),h),T=function(H,q,re,xe){var Se=xe-re,ze=H-re;return Se===0?0:q===1?ze/Se:(Math.pow(q,ze)-1)/(Math.pow(q,Se)-1)}(h,g,s.stops[E][0],s.stops[E+1][0]),M=s.stops[E][1],D=s.stops[E+1][1],N=_l[l.type]||D0;if(s.colorSpace&&s.colorSpace!=="rgb"){var $=$1[s.colorSpace];N=function(H,q){return $.reverse($.interpolate($.forward(H),$.forward(q),T))}}return typeof M.evaluate=="function"?{evaluate:function(){for(var H=[],q=arguments.length;q--;)H[q]=arguments[q];var re=M.evaluate.apply(void 0,H),xe=D.evaluate.apply(void 0,H);if(re!==void 0&&xe!==void 0)return N(re,xe,T)}}:N(M,D,T)}function Ku(s,l,h){return l.type==="color"?h=si.parse(h):l.type==="formatted"?h=wa.fromString(h.toString()):l.type==="resolvedImage"?h=fa.fromString(h.toString()):ta(h)===l.type||l.type==="enum"&&l.values[h]||(h=void 0),Al(h,s.default,l.default)}ue.register(Eu,{error:[{kind:"error"},[zr],function(s,l){throw new ua(l[0].evaluate(s))}],typeof:[zr,[Lr],function(s,l){return Gn(sa(l[0].evaluate(s)))}],"to-rgba":[_i(Dt,4),[Pr],function(s,l){return l[0].evaluate(s).toArray()}],rgb:[Pr,[Dt,Dt,Dt],El],rgba:[Pr,[Dt,Dt,Dt,Dt],El],has:{type:Rr,overloads:[[[zr],function(s,l){return mh(l[0].evaluate(s),s.properties())}],[[zr,Hn],function(s,l){var h=l[1];return mh(l[0].evaluate(s),h.evaluate(s))}]]},get:{type:Lr,overloads:[[[zr],function(s,l){return wc(l[0].evaluate(s),s.properties())}],[[zr,Hn],function(s,l){var h=l[1];return wc(l[0].evaluate(s),h.evaluate(s))}]]},"feature-state":[Lr,[zr],function(s,l){return wc(l[0].evaluate(s),s.featureState||{})}],properties:[Hn,[],function(s){return s.properties()}],"geometry-type":[zr,[],function(s){return s.geometryType()}],id:[Lr,[],function(s){return s.id()}],zoom:[Dt,[],function(s){return s.globals.zoom}],"heatmap-density":[Dt,[],function(s){return s.globals.heatmapDensity||0}],"line-progress":[Dt,[],function(s){return s.globals.lineProgress||0}],accumulated:[Lr,[],function(s){return s.globals.accumulated===void 0?null:s.globals.accumulated}],"+":[Dt,ou(Dt),function(s,l){for(var h=0,g=0,x=l;g<x.length;g+=1)h+=x[g].evaluate(s);return h}],"*":[Dt,ou(Dt),function(s,l){for(var h=1,g=0,x=l;g<x.length;g+=1)h*=x[g].evaluate(s);return h}],"-":{type:Dt,overloads:[[[Dt,Dt],function(s,l){var h=l[1];return l[0].evaluate(s)-h.evaluate(s)}],[[Dt],function(s,l){return-l[0].evaluate(s)}]]},"/":[Dt,[Dt,Dt],function(s,l){var h=l[1];return l[0].evaluate(s)/h.evaluate(s)}],"%":[Dt,[Dt,Dt],function(s,l){var h=l[1];return l[0].evaluate(s)%h.evaluate(s)}],ln2:[Dt,[],function(){return Math.LN2}],pi:[Dt,[],function(){return Math.PI}],e:[Dt,[],function(){return Math.E}],"^":[Dt,[Dt,Dt],function(s,l){var h=l[1];return Math.pow(l[0].evaluate(s),h.evaluate(s))}],sqrt:[Dt,[Dt],function(s,l){return Math.sqrt(l[0].evaluate(s))}],log10:[Dt,[Dt],function(s,l){return Math.log(l[0].evaluate(s))/Math.LN10}],ln:[Dt,[Dt],function(s,l){return Math.log(l[0].evaluate(s))}],log2:[Dt,[Dt],function(s,l){return Math.log(l[0].evaluate(s))/Math.LN2}],sin:[Dt,[Dt],function(s,l){return Math.sin(l[0].evaluate(s))}],cos:[Dt,[Dt],function(s,l){return Math.cos(l[0].evaluate(s))}],tan:[Dt,[Dt],function(s,l){return Math.tan(l[0].evaluate(s))}],asin:[Dt,[Dt],function(s,l){return Math.asin(l[0].evaluate(s))}],acos:[Dt,[Dt],function(s,l){return Math.acos(l[0].evaluate(s))}],atan:[Dt,[Dt],function(s,l){return Math.atan(l[0].evaluate(s))}],min:[Dt,ou(Dt),function(s,l){return Math.min.apply(Math,l.map(function(h){return h.evaluate(s)}))}],max:[Dt,ou(Dt),function(s,l){return Math.max.apply(Math,l.map(function(h){return h.evaluate(s)}))}],abs:[Dt,[Dt],function(s,l){return Math.abs(l[0].evaluate(s))}],round:[Dt,[Dt],function(s,l){var h=l[0].evaluate(s);return h<0?-Math.round(-h):Math.round(h)}],floor:[Dt,[Dt],function(s,l){return Math.floor(l[0].evaluate(s))}],ceil:[Dt,[Dt],function(s,l){return Math.ceil(l[0].evaluate(s))}],"filter-==":[Rr,[zr,Lr],function(s,l){var h=l[0],g=l[1];return s.properties()[h.value]===g.value}],"filter-id-==":[Rr,[Lr],function(s,l){var h=l[0];return s.id()===h.value}],"filter-type-==":[Rr,[zr],function(s,l){var h=l[0];return s.geometryType()===h.value}],"filter-<":[Rr,[zr,Lr],function(s,l){var h=l[0],g=l[1],x=s.properties()[h.value],E=g.value;return typeof x==typeof E&&x<E}],"filter-id-<":[Rr,[Lr],function(s,l){var h=l[0],g=s.id(),x=h.value;return typeof g==typeof x&&g<x}],"filter->":[Rr,[zr,Lr],function(s,l){var h=l[0],g=l[1],x=s.properties()[h.value],E=g.value;return typeof x==typeof E&&x>E}],"filter-id->":[Rr,[Lr],function(s,l){var h=l[0],g=s.id(),x=h.value;return typeof g==typeof x&&g>x}],"filter-<=":[Rr,[zr,Lr],function(s,l){var h=l[0],g=l[1],x=s.properties()[h.value],E=g.value;return typeof x==typeof E&&x<=E}],"filter-id-<=":[Rr,[Lr],function(s,l){var h=l[0],g=s.id(),x=h.value;return typeof g==typeof x&&g<=x}],"filter->=":[Rr,[zr,Lr],function(s,l){var h=l[0],g=l[1],x=s.properties()[h.value],E=g.value;return typeof x==typeof E&&x>=E}],"filter-id->=":[Rr,[Lr],function(s,l){var h=l[0],g=s.id(),x=h.value;return typeof g==typeof x&&g>=x}],"filter-has":[Rr,[Lr],function(s,l){return l[0].value in s.properties()}],"filter-has-id":[Rr,[],function(s){return s.id()!==null&&s.id()!==void 0}],"filter-type-in":[Rr,[_i(zr)],function(s,l){return l[0].value.indexOf(s.geometryType())>=0}],"filter-id-in":[Rr,[_i(Lr)],function(s,l){return l[0].value.indexOf(s.id())>=0}],"filter-in-small":[Rr,[zr,_i(Lr)],function(s,l){var h=l[0];return l[1].value.indexOf(s.properties()[h.value])>=0}],"filter-in-large":[Rr,[zr,_i(Lr)],function(s,l){var h=l[0],g=l[1];return function(x,E,T,M){for(;T<=M;){var D=T+M>>1;if(E[D]===x)return!0;E[D]>x?M=D-1:T=D+1}return!1}(s.properties()[h.value],g.value,0,g.value.length-1)}],all:{type:Rr,overloads:[[[Rr,Rr],function(s,l){var h=l[1];return l[0].evaluate(s)&&h.evaluate(s)}],[ou(Rr),function(s,l){for(var h=0,g=l;h<g.length;h+=1)if(!g[h].evaluate(s))return!1;return!0}]]},any:{type:Rr,overloads:[[[Rr,Rr],function(s,l){var h=l[1];return l[0].evaluate(s)||h.evaluate(s)}],[ou(Rr),function(s,l){for(var h=0,g=l;h<g.length;h+=1)if(g[h].evaluate(s))return!0;return!1}]]},"!":[Rr,[Rr],function(s,l){return!l[0].evaluate(s)}],"is-supported-script":[Rr,[zr],function(s,l){var h=s.globals&&s.globals.isSupportedScript;return!h||h(l[0].evaluate(s))}],upcase:[zr,[zr],function(s,l){return l[0].evaluate(s).toUpperCase()}],downcase:[zr,[zr],function(s,l){return l[0].evaluate(s).toLowerCase()}],concat:[zr,ou(Lr),function(s,l){return l.map(function(h){return Hu(h.evaluate(s))}).join("")}],"resolved-locale":[zr,[ci],function(s,l){return l[0].evaluate(s).resolvedLocale()}]});var Tl=function(s,l){this.expression=s,this._warningHistory={},this._evaluator=new ee,this._defaultValue=l?function(h){return h.type==="color"&&gh(h.default)?new si(0,0,0,0):h.type==="color"?si.parse(h.default)||null:h.default===void 0?null:h.default}(l):null,this._enumValues=l&&l.type==="enum"?l.values:null};function Jl(s){return Array.isArray(s)&&s.length>0&&typeof s[0]=="string"&&s[0]in Eu}function Cc(s,l){var h=new Gu(Eu,[],l?function(x){var E={color:Pr,string:zr,number:Dt,enum:zr,boolean:Rr,formatted:Gi,resolvedImage:oi};return x.type==="array"?_i(E[x.value]||Lr,x.length):E[x.type]}(l):void 0),g=h.parse(s,void 0,void 0,void 0,l&&l.type==="string"?{typeAnnotation:"coerce"}:void 0);return g?Sf(new Tl(g,l)):Sl(h.errors)}Tl.prototype.evaluateWithoutErrorHandling=function(s,l,h,g,x,E){return this._evaluator.globals=s,this._evaluator.feature=l,this._evaluator.featureState=h,this._evaluator.canonical=g,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=E,this.expression.evaluate(this._evaluator)},Tl.prototype.evaluate=function(s,l,h,g,x,E){this._evaluator.globals=s,this._evaluator.feature=l||null,this._evaluator.featureState=h||null,this._evaluator.canonical=g,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=E||null;try{var T=this.expression.evaluate(this._evaluator);if(T==null||typeof T=="number"&&T!=T)return this._defaultValue;if(this._enumValues&&!(T in this._enumValues))throw new ua("Expected value to be one of "+Object.keys(this._enumValues).map(function(M){return JSON.stringify(M)}).join(", ")+", but found "+JSON.stringify(T)+" instead.");return T}catch(M){return this._warningHistory[M.message]||(this._warningHistory[M.message]=!0,typeof console<"u"&&console.warn(M.message)),this._defaultValue}};var ec=function(s,l){this.kind=s,this._styleExpression=l,this.isStateDependent=s!=="constant"&&!gl(l.expression)};ec.prototype.evaluateWithoutErrorHandling=function(s,l,h,g,x,E){return this._styleExpression.evaluateWithoutErrorHandling(s,l,h,g,x,E)},ec.prototype.evaluate=function(s,l,h,g,x,E){return this._styleExpression.evaluate(s,l,h,g,x,E)};var tc=function(s,l,h,g){this.kind=s,this.zoomStops=h,this._styleExpression=l,this.isStateDependent=s!=="camera"&&!gl(l.expression),this.interpolationType=g};function Dp(s,l){if((s=Cc(s,l)).result==="error")return s;var h=s.value.expression,g=ml(h);if(!g&&!qu(l))return Sl([new ar("","data expressions not supported")]);var x=yu(h,["zoom"]);if(!x&&!Op(l))return Sl([new ar("","zoom expressions not supported")]);var E=function T(M){var D=null;if(M instanceof Cs)D=T(M.result);else if(M instanceof yl)for(var N=0,$=M.args;N<$.length&&!(D=T($[N]));N+=1);else(M instanceof ms||M instanceof Co)&&M.input instanceof ue&&M.input.name==="zoom"&&(D=M);return D instanceof ar||M.eachChild(function(H){var q=T(H);q instanceof ar?D=q:!D&&q?D=new ar("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):D&&q&&D!==q&&(D=new ar("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),D}(h);return E||x?E instanceof ar?Sl([E]):E instanceof Co&&!Af(l)?Sl([new ar("",'"interpolate" expressions cannot be used with this property')]):Sf(E?new tc(g?"camera":"composite",s.value,E.labels,E instanceof Co?E.interpolation:void 0):new ec(g?"constant":"source",s.value)):Sl([new ar("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}tc.prototype.evaluateWithoutErrorHandling=function(s,l,h,g,x,E){return this._styleExpression.evaluateWithoutErrorHandling(s,l,h,g,x,E)},tc.prototype.evaluate=function(s,l,h,g,x,E){return this._styleExpression.evaluate(s,l,h,g,x,E)},tc.prototype.interpolationFactor=function(s,l,h){return this.interpolationType?Co.interpolationFactor(this.interpolationType,s,l,h):0};var rc=function(s,l){this._parameters=s,this._specification=l,Nt(this,function h(g,x){var E,T,M,D=x.type==="color",N=g.stops&&typeof g.stops[0][0]=="object",$=N||!(N||g.property!==void 0),H=g.type||(Af(x)?"exponential":"interval");if(D&&((g=Nt({},g)).stops&&(g.stops=g.stops.map(function(Gr){return[Gr[0],si.parse(Gr[1])]})),g.default=si.parse(g.default?g.default:x.default)),g.colorSpace&&g.colorSpace!=="rgb"&&!$1[g.colorSpace])throw new Error("Unknown color space: "+g.colorSpace);if(H==="exponential")E=_h;else if(H==="interval")E=kp;else if(H==="categorical"){E=Tf,T=Object.create(null);for(var q=0,re=g.stops;q<re.length;q+=1){var xe=re[q];T[xe[0]]=xe[1]}M=typeof g.stops[0][0]}else{if(H!=="identity")throw new Error('Unknown function type "'+H+'"');E=Ku}if(N){for(var Se={},ze=[],Oe=0;Oe<g.stops.length;Oe++){var et=g.stops[Oe],ut=et[0].zoom;Se[ut]===void 0&&(Se[ut]={zoom:ut,type:g.type,property:g.property,default:g.default,stops:[]},ze.push(ut)),Se[ut].stops.push([et[0].value,et[1]])}for(var St=[],It=0,Xt=ze;It<Xt.length;It+=1){var Er=Xt[It];St.push([Se[Er].zoom,h(Se[Er],x)])}var kr={name:"linear"};return{kind:"composite",interpolationType:kr,interpolationFactor:Co.interpolationFactor.bind(void 0,kr),zoomStops:St.map(function(Gr){return Gr[0]}),evaluate:function(Gr,An){var Zr=Gr.zoom;return _h({stops:St,base:g.base},x,Zr).evaluate(Zr,An)}}}if($){var mn=H==="exponential"?{name:"exponential",base:g.base!==void 0?g.base:1}:null;return{kind:"camera",interpolationType:mn,interpolationFactor:Co.interpolationFactor.bind(void 0,mn),zoomStops:g.stops.map(function(Gr){return Gr[0]}),evaluate:function(Gr){return E(g,x,Gr.zoom,T,M)}}}return{kind:"source",evaluate:function(Gr,An){var Zr=An&&An.properties?An.properties[g.property]:void 0;return Zr===void 0?Al(g.default,x.default):E(g,x,Zr,T,M)}}}(this._parameters,this._specification))};function Hs(s){var l=s.key,h=s.value,g=s.valueSpec||{},x=s.objectElementValidators||{},E=s.style,T=s.styleSpec,M=[],D=ta(h);if(D!=="object")return[new Ce(l,h,"object expected, "+D+" found")];for(var N in h){var $=N.split(".")[0],H=g[$]||g["*"],q=void 0;if(x[$])q=x[$];else if(g[$])q=yi;else if(x["*"])q=x["*"];else{if(!g["*"]){M.push(new Ce(l,h[N],'unknown property "'+N+'"'));continue}q=yi}M=M.concat(q({key:(l&&l+".")+N,value:h[N],valueSpec:H,style:E,styleSpec:T,object:h,objectKey:N},h))}for(var re in g)x[re]||g[re].required&&g[re].default===void 0&&h[re]===void 0&&M.push(new Ce(l,h,'missing required property "'+re+'"'));return M}function Fp(s){var l=s.value,h=s.valueSpec,g=s.style,x=s.styleSpec,E=s.key,T=s.arrayElementValidator||yi;if(ta(l)!=="array")return[new Ce(E,l,"array expected, "+ta(l)+" found")];if(h.length&&l.length!==h.length)return[new Ce(E,l,"array length "+h.length+" expected, length "+l.length+" found")];if(h["min-length"]&&l.length<h["min-length"])return[new Ce(E,l,"array length at least "+h["min-length"]+" expected, length "+l.length+" found")];var M={type:h.value,values:h.values};x.$version<7&&(M.function=h.function),ta(h.value)==="object"&&(M=h.value);for(var D=[],N=0;N<l.length;N++)D=D.concat(T({array:l,arrayIndex:N,value:l[N],valueSpec:M,style:g,styleSpec:x,key:E+"["+N+"]"}));return D}function Bp(s){var l=s.key,h=s.value,g=s.valueSpec,x=ta(h);return x==="number"&&h!=h&&(x="NaN"),x!=="number"?[new Ce(l,h,"number expected, "+x+" found")]:"minimum"in g&&h<g.minimum?[new Ce(l,h,h+" is less than the minimum value "+g.minimum)]:"maximum"in g&&h>g.maximum?[new Ce(l,h,h+" is greater than the maximum value "+g.maximum)]:[]}function Lp(s){var l,h,g,x=s.valueSpec,E=vr(s.value.type),T={},M=E!=="categorical"&&s.value.property===void 0,D=!M,N=ta(s.value.stops)==="array"&&ta(s.value.stops[0])==="array"&&ta(s.value.stops[0][0])==="object",$=Hs({key:s.key,value:s.value,valueSpec:s.styleSpec.function,style:s.style,styleSpec:s.styleSpec,objectElementValidators:{stops:function(re){if(E==="identity")return[new Ce(re.key,re.value,'identity function may not have a "stops" property')];var xe=[],Se=re.value;return xe=xe.concat(Fp({key:re.key,value:Se,valueSpec:re.valueSpec,style:re.style,styleSpec:re.styleSpec,arrayElementValidator:H})),ta(Se)==="array"&&Se.length===0&&xe.push(new Ce(re.key,Se,"array must have at least one stop")),xe},default:function(re){return yi({key:re.key,value:re.value,valueSpec:x,style:re.style,styleSpec:re.styleSpec})}}});return E==="identity"&&M&&$.push(new Ce(s.key,s.value,'missing required property "property"')),E==="identity"||s.value.stops||$.push(new Ce(s.key,s.value,'missing required property "stops"')),E==="exponential"&&s.valueSpec.expression&&!Af(s.valueSpec)&&$.push(new Ce(s.key,s.value,"exponential functions not supported")),s.styleSpec.$version>=8&&(D&&!qu(s.valueSpec)?$.push(new Ce(s.key,s.value,"property functions not supported")):M&&!Op(s.valueSpec)&&$.push(new Ce(s.key,s.value,"zoom functions not supported"))),E!=="categorical"&&!N||s.value.property!==void 0||$.push(new Ce(s.key,s.value,'"property" property is required')),$;function H(re){var xe=[],Se=re.value,ze=re.key;if(ta(Se)!=="array")return[new Ce(ze,Se,"array expected, "+ta(Se)+" found")];if(Se.length!==2)return[new Ce(ze,Se,"array length 2 expected, length "+Se.length+" found")];if(N){if(ta(Se[0])!=="object")return[new Ce(ze,Se,"object expected, "+ta(Se[0])+" found")];if(Se[0].zoom===void 0)return[new Ce(ze,Se,"object stop key must have zoom")];if(Se[0].value===void 0)return[new Ce(ze,Se,"object stop key must have value")];if(g&&g>vr(Se[0].zoom))return[new Ce(ze,Se[0].zoom,"stop zoom values must appear in ascending order")];vr(Se[0].zoom)!==g&&(g=vr(Se[0].zoom),h=void 0,T={}),xe=xe.concat(Hs({key:ze+"[0]",value:Se[0],valueSpec:{zoom:{}},style:re.style,styleSpec:re.styleSpec,objectElementValidators:{zoom:Bp,value:q}}))}else xe=xe.concat(q({key:ze+"[0]",value:Se[0],valueSpec:{},style:re.style,styleSpec:re.styleSpec},Se));return Jl(Ot(Se[1]))?xe.concat([new Ce(ze+"[1]",Se[1],"expressions are not allowed in function stops.")]):xe.concat(yi({key:ze+"[1]",value:Se[1],valueSpec:x,style:re.style,styleSpec:re.styleSpec}))}function q(re,xe){var Se=ta(re.value),ze=vr(re.value),Oe=re.value!==null?re.value:xe;if(l){if(Se!==l)return[new Ce(re.key,Oe,Se+" stop domain type must match previous stop domain type "+l)]}else l=Se;if(Se!=="number"&&Se!=="string"&&Se!=="boolean")return[new Ce(re.key,Oe,"stop domain value must be a number, string, or boolean")];if(Se!=="number"&&E!=="categorical"){var et="number expected, "+Se+" found";return qu(x)&&E===void 0&&(et+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ce(re.key,Oe,et)]}return E!=="categorical"||Se!=="number"||isFinite(ze)&&Math.floor(ze)===ze?E!=="categorical"&&Se==="number"&&h!==void 0&&ze<h?[new Ce(re.key,Oe,"stop domain values must appear in ascending order")]:(h=ze,E==="categorical"&&ze in T?[new Ce(re.key,Oe,"stop domain values must be unique")]:(T[ze]=!0,[])):[new Ce(re.key,Oe,"integer expected, found "+ze)]}}function wl(s){var l=(s.expressionContext==="property"?Dp:Cc)(Ot(s.value),s.valueSpec);if(l.result==="error")return l.value.map(function(g){return new Ce(""+s.key+g.key,s.value,g.message)});var h=l.value.expression||l.value._styleExpression.expression;if(s.expressionContext==="property"&&s.propertyKey==="text-font"&&!h.outputDefined())return[new Ce(s.key,s.value,'Invalid data expression for "'+s.propertyKey+'". Output values must be contained as literals within the expression.')];if(s.expressionContext==="property"&&s.propertyType==="layout"&&!gl(h))return[new Ce(s.key,s.value,'"feature-state" data expressions are not supported with layout properties.')];if(s.expressionContext==="filter"&&!gl(h))return[new Ce(s.key,s.value,'"feature-state" data expressions are not supported with filters.')];if(s.expressionContext&&s.expressionContext.indexOf("cluster")===0){if(!yu(h,["zoom","feature-state"]))return[new Ce(s.key,s.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(s.expressionContext==="cluster-initial"&&!ml(h))return[new Ce(s.key,s.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Su(s){var l=s.key,h=s.value,g=s.valueSpec,x=[];return Array.isArray(g.values)?g.values.indexOf(vr(h))===-1&&x.push(new Ce(l,h,"expected one of ["+g.values.join(", ")+"], "+JSON.stringify(h)+" found")):Object.keys(g.values).indexOf(vr(h))===-1&&x.push(new Ce(l,h,"expected one of ["+Object.keys(g.values).join(", ")+"], "+JSON.stringify(h)+" found")),x}function Rc(s){if(s===!0||s===!1)return!0;if(!Array.isArray(s)||s.length===0)return!1;switch(s[0]){case"has":return s.length>=2&&s[1]!=="$id"&&s[1]!=="$type";case"in":return s.length>=3&&(typeof s[1]!="string"||Array.isArray(s[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return s.length!==3||Array.isArray(s[1])||Array.isArray(s[2]);case"any":case"all":for(var l=0,h=s.slice(1);l<h.length;l+=1){var g=h[l];if(!Rc(g)&&typeof g!="boolean")return!1}return!0;default:return!0}}rc.deserialize=function(s){return new rc(s._parameters,s._specification)},rc.serialize=function(s){return{_parameters:s._parameters,_specification:s._specification}};var wf={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Cl(s){if(s==null)return{filter:function(){return!0},needGeometry:!1};Rc(s)||(s=yh(s));var l=Cc(s,wf);if(l.result==="error")throw new Error(l.value.map(function(h){return h.key+": "+h.message}).join(", "));return{filter:function(h,g,x){return l.value.evaluate(h,g,{},x)},needGeometry:function h(g){if(!Array.isArray(g))return!1;if(g[0]==="within")return!0;for(var x=1;x<g.length;x++)if(h(g[x]))return!0;return!1}(s)}}function F0(s,l){return s<l?-1:s>l?1:0}function yh(s){if(!s)return!0;var l,h=s[0];return s.length<=1?h!=="any":h==="=="?Np(s[1],s[2],"=="):h==="!="?bh(Np(s[1],s[2],"==")):h==="<"||h===">"||h==="<="||h===">="?Np(s[1],s[2],h):h==="any"?(l=s.slice(1),["any"].concat(l.map(yh))):h==="all"?["all"].concat(s.slice(1).map(yh)):h==="none"?["all"].concat(s.slice(1).map(yh).map(bh)):h==="in"?xh(s[1],s.slice(2)):h==="!in"?bh(xh(s[1],s.slice(2))):h==="has"?G1(s[1]):h==="!has"?bh(G1(s[1])):h!=="within"||s}function Np(s,l,h){switch(s){case"$type":return["filter-type-"+h,l];case"$id":return["filter-id-"+h,l];default:return["filter-"+h,s,l]}}function xh(s,l){if(l.length===0)return!1;switch(s){case"$type":return["filter-type-in",["literal",l]];case"$id":return["filter-id-in",["literal",l]];default:return l.length>200&&!l.some(function(h){return typeof h!=typeof l[0]})?["filter-in-large",s,["literal",l.sort(F0)]]:["filter-in-small",s,["literal",l]]}}function G1(s){switch(s){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",s]}}function bh(s){return["!",s]}function Up(s){return Rc(Ot(s.value))?wl(Nt({},s,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function l(h){var g=h.value,x=h.key;if(ta(g)!=="array")return[new Ce(x,g,"array expected, "+ta(g)+" found")];var E,T=h.styleSpec,M=[];if(g.length<1)return[new Ce(x,g,"filter array must have at least 1 element")];switch(M=M.concat(Su({key:x+"[0]",value:g[0],valueSpec:T.filter_operator,style:h.style,styleSpec:h.styleSpec})),vr(g[0])){case"<":case"<=":case">":case">=":g.length>=2&&vr(g[1])==="$type"&&M.push(new Ce(x,g,'"$type" cannot be use with operator "'+g[0]+'"'));case"==":case"!=":g.length!==3&&M.push(new Ce(x,g,'filter array for operator "'+g[0]+'" must have 3 elements'));case"in":case"!in":g.length>=2&&(E=ta(g[1]))!=="string"&&M.push(new Ce(x+"[1]",g[1],"string expected, "+E+" found"));for(var D=2;D<g.length;D++)E=ta(g[D]),vr(g[1])==="$type"?M=M.concat(Su({key:x+"["+D+"]",value:g[D],valueSpec:T.geometry_type,style:h.style,styleSpec:h.styleSpec})):E!=="string"&&E!=="number"&&E!=="boolean"&&M.push(new Ce(x+"["+D+"]",g[D],"string, number, or boolean expected, "+E+" found"));break;case"any":case"all":case"none":for(var N=1;N<g.length;N++)M=M.concat(l({key:x+"["+N+"]",value:g[N],style:h.style,styleSpec:h.styleSpec}));break;case"has":case"!has":E=ta(g[1]),g.length!==2?M.push(new Ce(x,g,'filter array for "'+g[0]+'" operator must have 2 elements')):E!=="string"&&M.push(new Ce(x+"[1]",g[1],"string expected, "+E+" found"));break;case"within":E=ta(g[1]),g.length!==2?M.push(new Ce(x,g,'filter array for "'+g[0]+'" operator must have 2 elements')):E!=="object"&&M.push(new Ce(x+"[1]",g[1],"object expected, "+E+" found"))}return M}(s)}function Cf(s,l){var h=s.key,g=s.style,x=s.styleSpec,E=s.value,T=s.objectKey,M=x[l+"_"+s.layerType];if(!M)return[];var D=T.match(/^(.*)-transition$/);if(l==="paint"&&D&&M[D[1]]&&M[D[1]].transition)return yi({key:h,value:E,valueSpec:x.transition,style:g,styleSpec:x});var N,$=s.valueSpec||M[T];if(!$)return[new Ce(h,E,'unknown property "'+T+'"')];if(ta(E)==="string"&&qu($)&&!$.tokens&&(N=/^{([^}]+)}$/.exec(E)))return[new Ce(h,E,'"'+T+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(N[1])+" }`.")];var H=[];return s.layerType==="symbol"&&(T==="text-field"&&g&&!g.glyphs&&H.push(new Ce(h,E,'use of "text-field" requires a style "glyphs" property')),T==="text-font"&&gh(Ot(E))&&vr(E.type)==="identity"&&H.push(new Ce(h,E,'"text-font" does not support identity functions'))),H.concat(yi({key:s.key,value:E,valueSpec:$,style:g,styleSpec:x,expressionContext:"property",propertyType:l,propertyKey:T}))}function zp(s){return Cf(s,"paint")}function nc(s){return Cf(s,"layout")}function $p(s){var l=[],h=s.value,g=s.key,x=s.style,E=s.styleSpec;h.type||h.ref||l.push(new Ce(g,h,'either "type" or "ref" is required'));var T,M=vr(h.type),D=vr(h.ref);if(h.id)for(var N=vr(h.id),$=0;$<s.arrayIndex;$++){var H=x.layers[$];vr(H.id)===N&&l.push(new Ce(g,h.id,'duplicate layer id "'+h.id+'", previously used at line '+H.id.__line__))}if("ref"in h)["type","source","source-layer","filter","layout"].forEach(function(xe){xe in h&&l.push(new Ce(g,h[xe],'"'+xe+'" is prohibited for ref layers'))}),x.layers.forEach(function(xe){vr(xe.id)===D&&(T=xe)}),T?T.ref?l.push(new Ce(g,h.ref,"ref cannot reference another ref layer")):M=vr(T.type):l.push(new Ce(g,h.ref,'ref layer "'+D+'" not found'));else if(M!=="background")if(h.source){var q=x.sources&&x.sources[h.source],re=q&&vr(q.type);q?re==="vector"&&M==="raster"?l.push(new Ce(g,h.source,'layer "'+h.id+'" requires a raster source')):re==="raster"&&M!=="raster"?l.push(new Ce(g,h.source,'layer "'+h.id+'" requires a vector source')):re!=="vector"||h["source-layer"]?re==="raster-dem"&&M!=="hillshade"?l.push(new Ce(g,h.source,"raster-dem source can only be used with layer type 'hillshade'.")):M!=="line"||!h.paint||!h.paint["line-gradient"]||re==="geojson"&&q.lineMetrics||l.push(new Ce(g,h,'layer "'+h.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):l.push(new Ce(g,h,'layer "'+h.id+'" must specify a "source-layer"')):l.push(new Ce(g,h.source,'source "'+h.source+'" not found'))}else l.push(new Ce(g,h,'missing required property "source"'));return l=l.concat(Hs({key:g,value:h,valueSpec:E.layer,style:s.style,styleSpec:s.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return yi({key:g+".type",value:h.type,valueSpec:E.layer.type,style:s.style,styleSpec:s.styleSpec,object:h,objectKey:"type"})},filter:Up,layout:function(xe){return Hs({layer:h,key:xe.key,value:xe.value,style:xe.style,styleSpec:xe.styleSpec,objectElementValidators:{"*":function(Se){return nc(Nt({layerType:M},Se))}}})},paint:function(xe){return Hs({layer:h,key:xe.key,value:xe.value,style:xe.style,styleSpec:xe.styleSpec,objectElementValidators:{"*":function(Se){return zp(Nt({layerType:M},Se))}}})}}}))}function Rl(s){var l=s.value,h=s.key,g=ta(l);return g!=="string"?[new Ce(h,l,"string expected, "+g+" found")]:[]}var ra={promoteId:function(s){var l=s.key,h=s.value;if(ta(h)==="string")return Rl({key:l,value:h});var g=[];for(var x in h)g.push.apply(g,Rl({key:l+"."+x,value:h[x]}));return g}};function Eh(s){var l=s.value,h=s.key,g=s.styleSpec,x=s.style;if(!l.type)return[new Ce(h,l,'"type" is required')];var E,T=vr(l.type);switch(T){case"vector":case"raster":case"raster-dem":return Hs({key:h,value:l,valueSpec:g["source_"+T.replace("-","_")],style:s.style,styleSpec:g,objectElementValidators:ra});case"geojson":if(E=Hs({key:h,value:l,valueSpec:g.source_geojson,style:x,styleSpec:g,objectElementValidators:ra}),l.cluster)for(var M in l.clusterProperties){var D=l.clusterProperties[M],N=D[0],$=typeof N=="string"?[N,["accumulated"],["get",M]]:N;E.push.apply(E,wl({key:h+"."+M+".map",value:D[1],expressionContext:"cluster-map"})),E.push.apply(E,wl({key:h+"."+M+".reduce",value:$,expressionContext:"cluster-reduce"}))}return E;case"video":return Hs({key:h,value:l,valueSpec:g.source_video,style:x,styleSpec:g});case"image":return Hs({key:h,value:l,valueSpec:g.source_image,style:x,styleSpec:g});case"canvas":return[new Ce(h,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Su({key:h+".type",value:l.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:x,styleSpec:g})}}function Au(s){var l=s.value,h=s.styleSpec,g=h.light,x=s.style,E=[],T=ta(l);if(l===void 0)return E;if(T!=="object")return E.concat([new Ce("light",l,"object expected, "+T+" found")]);for(var M in l){var D=M.match(/^(.*)-transition$/);E=E.concat(D&&g[D[1]]&&g[D[1]].transition?yi({key:M,value:l[M],valueSpec:h.transition,style:x,styleSpec:h}):g[M]?yi({key:M,value:l[M],valueSpec:g[M],style:x,styleSpec:h}):[new Ce(M,l[M],'unknown property "'+M+'"')])}return E}var Il={"*":function(){return[]},array:Fp,boolean:function(s){var l=s.value,h=s.key,g=ta(l);return g!=="boolean"?[new Ce(h,l,"boolean expected, "+g+" found")]:[]},number:Bp,color:function(s){var l=s.key,h=s.value,g=ta(h);return g!=="string"?[new Ce(l,h,"color expected, "+g+" found")]:Wn(h)===null?[new Ce(l,h,'color expected, "'+h+'" found')]:[]},constants:it,enum:Su,filter:Up,function:Lp,layer:$p,object:Hs,source:Eh,light:Au,string:Rl,formatted:function(s){return Rl(s).length===0?[]:wl(s)},resolvedImage:function(s){return Rl(s).length===0?[]:wl(s)}};function yi(s){var l=s.value,h=s.valueSpec,g=s.styleSpec;return h.expression&&gh(vr(l))?Lp(s):h.expression&&Jl(Ot(l))?wl(s):h.type&&Il[h.type]?Il[h.type](s):Hs(Nt({},s,{valueSpec:h.type?g[h.type]:h}))}function na(s){var l=s.value,h=s.key,g=Rl(s);return g.length||(l.indexOf("{fontstack}")===-1&&g.push(new Ce(h,l,'"glyphs" url must include a "{fontstack}" token')),l.indexOf("{range}")===-1&&g.push(new Ce(h,l,'"glyphs" url must include a "{range}" token'))),g}function Is(s,l){l===void 0&&(l=ie);var h=[];return h=h.concat(yi({key:"",value:s,valueSpec:l.$root,styleSpec:l,style:s,objectElementValidators:{glyphs:na,"*":function(){return[]}}})),s.constants&&(h=h.concat(it({key:"constants",value:s.constants,style:s,styleSpec:l}))),Rf(h)}function Rf(s){return[].concat(s).sort(function(l,h){return l.line-h.line})}function Ic(s){return function(){for(var l=[],h=arguments.length;h--;)l[h]=arguments[h];return Rf(s.apply(this,l))}}Is.source=Ic(Eh),Is.light=Ic(Au),Is.layer=Ic($p),Is.filter=Ic(Up),Is.paintProperty=Ic(zp),Is.layoutProperty=Ic(nc);var If=Is,W1=If.light,Sh=If.paintProperty,Mf=If.layoutProperty;function Ml(s,l){var h=!1;if(l&&l.length)for(var g=0,x=l;g<x.length;g+=1)s.fire(new je(new Error(x[g].message))),h=!0;return h}var io=ma;function ma(s,l,h){var g=this.cells=[];if(s instanceof ArrayBuffer){this.arrayBuffer=s;var x=new Int32Array(this.arrayBuffer);s=x[0],this.d=(l=x[1])+2*(h=x[2]);for(var E=0;E<this.d*this.d;E++){var T=x[3+E],M=x[3+E+1];g.push(T===M?null:x.subarray(T,M))}var D=x[3+g.length+1];this.keys=x.subarray(x[3+g.length],D),this.bboxes=x.subarray(D),this.insert=this._insertReadonly}else{this.d=l+2*h;for(var N=0;N<this.d*this.d;N++)g.push([]);this.keys=[],this.bboxes=[]}this.n=l,this.extent=s,this.padding=h,this.scale=l/s,this.uid=0;var $=h/l*s;this.min=-$,this.max=s+$}ma.prototype.insert=function(s,l,h,g,x){this._forEachCell(l,h,g,x,this._insertCell,this.uid++),this.keys.push(s),this.bboxes.push(l),this.bboxes.push(h),this.bboxes.push(g),this.bboxes.push(x)},ma.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},ma.prototype._insertCell=function(s,l,h,g,x,E){this.cells[x].push(E)},ma.prototype.query=function(s,l,h,g,x){var E=this.min,T=this.max;if(s<=E&&l<=E&&T<=h&&T<=g&&!x)return Array.prototype.slice.call(this.keys);var M=[];return this._forEachCell(s,l,h,g,this._queryCell,M,{},x),M},ma.prototype._queryCell=function(s,l,h,g,x,E,T,M){var D=this.cells[x];if(D!==null)for(var N=this.keys,$=this.bboxes,H=0;H<D.length;H++){var q=D[H];if(T[q]===void 0){var re=4*q;(M?M($[re+0],$[re+1],$[re+2],$[re+3]):s<=$[re+2]&&l<=$[re+3]&&h>=$[re+0]&&g>=$[re+1])?(T[q]=!0,E.push(N[q])):T[q]=!1}}},ma.prototype._forEachCell=function(s,l,h,g,x,E,T,M){for(var D=this._convertToCellCoord(s),N=this._convertToCellCoord(l),$=this._convertToCellCoord(h),H=this._convertToCellCoord(g),q=D;q<=$;q++)for(var re=N;re<=H;re++){var xe=this.d*re+q;if((!M||M(this._convertFromCellCoord(q),this._convertFromCellCoord(re),this._convertFromCellCoord(q+1),this._convertFromCellCoord(re+1)))&&x.call(this,s,l,h,g,xe,E,T,M))return}},ma.prototype._convertFromCellCoord=function(s){return(s-this.padding)/this.scale},ma.prototype._convertToCellCoord=function(s){return Math.max(0,Math.min(this.d-1,Math.floor(s*this.scale)+this.padding))},ma.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var s=this.cells,l=3+this.cells.length+1+1,h=0,g=0;g<this.cells.length;g++)h+=this.cells[g].length;var x=new Int32Array(l+h+this.keys.length+this.bboxes.length);x[0]=this.extent,x[1]=this.n,x[2]=this.padding;for(var E=l,T=0;T<s.length;T++){var M=s[T];x[3+T]=E,x.set(M,E),E+=M.length}return x[3+s.length]=E,x.set(this.keys,E),x[3+s.length+1]=E+=this.keys.length,x.set(this.bboxes,E),E+=this.bboxes.length,x.buffer};var Mc=b.ImageData,Vp=b.ImageBitmap,Da={};function Kr(s,l,h){h===void 0&&(h={}),Object.defineProperty(l,"_classRegistryKey",{value:s,writeable:!1}),Da[s]={klass:l,omit:h.omit||[],shallow:h.shallow||[]}}for(var is in Kr("Object",Object),io.serialize=function(s,l){var h=s.toArrayBuffer();return l&&l.push(h),{buffer:h}},io.deserialize=function(s){return new io(s.buffer)},Kr("Grid",io),Kr("Color",si),Kr("Error",Error),Kr("ResolvedImage",fa),Kr("StylePropertyFunction",rc),Kr("StyleExpression",Tl,{omit:["_evaluator"]}),Kr("ZoomDependentExpression",tc),Kr("ZoomConstantExpression",ec),Kr("CompoundExpression",ue,{omit:["_evaluate"]}),Eu)Eu[is]._classRegistryKey||Kr("Expression_"+is,Eu[is]);function Pf(s){return s&&typeof ArrayBuffer<"u"&&(s instanceof ArrayBuffer||s.constructor&&s.constructor.name==="ArrayBuffer")}function Pc(s){return Vp&&s instanceof Vp}function Wo(s,l){if(s==null||typeof s=="boolean"||typeof s=="number"||typeof s=="string"||s instanceof Boolean||s instanceof Number||s instanceof String||s instanceof Date||s instanceof RegExp)return s;if(Pf(s)||Pc(s))return l&&l.push(s),s;if(ArrayBuffer.isView(s)){var h=s;return l&&l.push(h.buffer),h}if(s instanceof Mc)return l&&l.push(s.data.buffer),s;if(Array.isArray(s)){for(var g=[],x=0,E=s;x<E.length;x+=1)g.push(Wo(E[x],l));return g}if(typeof s=="object"){var T=s.constructor,M=T._classRegistryKey;if(!M)throw new Error("can't serialize object of unregistered class");var D=T.serialize?T.serialize(s,l):{};if(!T.serialize){for(var N in s)if(s.hasOwnProperty(N)&&!(Da[M].omit.indexOf(N)>=0)){var $=s[N];D[N]=Da[M].shallow.indexOf(N)>=0?$:Wo($,l)}s instanceof Error&&(D.message=s.message)}if(D.$name)throw new Error("$name property is reserved for worker serialization logic.");return M!=="Object"&&(D.$name=M),D}throw new Error("can't serialize object of type "+typeof s)}function Yi(s){if(s==null||typeof s=="boolean"||typeof s=="number"||typeof s=="string"||s instanceof Boolean||s instanceof Number||s instanceof String||s instanceof Date||s instanceof RegExp||Pf(s)||Pc(s)||ArrayBuffer.isView(s)||s instanceof Mc)return s;if(Array.isArray(s))return s.map(Yi);if(typeof s=="object"){var l=s.$name||"Object",h=Da[l].klass;if(!h)throw new Error("can't deserialize unregistered class "+l);if(h.deserialize)return h.deserialize(s);for(var g=Object.create(h.prototype),x=0,E=Object.keys(s);x<E.length;x+=1){var T=E[x];if(T!=="$name"){var M=s[T];g[T]=Da[l].shallow.indexOf(T)>=0?M:Yi(M)}}return g}throw new Error("can't deserialize object of type "+typeof s)}var Ah=function(){this.first=!0};Ah.prototype.update=function(s,l){var h=Math.floor(s);return this.first?(this.first=!1,this.lastIntegerZoom=h,this.lastIntegerZoomTime=0,this.lastZoom=s,this.lastFloorZoom=h,!0):(this.lastFloorZoom>h?(this.lastIntegerZoom=h+1,this.lastIntegerZoomTime=l):this.lastFloorZoom<h&&(this.lastIntegerZoom=h,this.lastIntegerZoomTime=l),s!==this.lastZoom&&(this.lastZoom=s,this.lastFloorZoom=h,!0))};var Dr={"Latin-1 Supplement":function(s){return s>=128&&s<=255},Arabic:function(s){return s>=1536&&s<=1791},"Arabic Supplement":function(s){return s>=1872&&s<=1919},"Arabic Extended-A":function(s){return s>=2208&&s<=2303},"Hangul Jamo":function(s){return s>=4352&&s<=4607},"Unified Canadian Aboriginal Syllabics":function(s){return s>=5120&&s<=5759},Khmer:function(s){return s>=6016&&s<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(s){return s>=6320&&s<=6399},"General Punctuation":function(s){return s>=8192&&s<=8303},"Letterlike Symbols":function(s){return s>=8448&&s<=8527},"Number Forms":function(s){return s>=8528&&s<=8591},"Miscellaneous Technical":function(s){return s>=8960&&s<=9215},"Control Pictures":function(s){return s>=9216&&s<=9279},"Optical Character Recognition":function(s){return s>=9280&&s<=9311},"Enclosed Alphanumerics":function(s){return s>=9312&&s<=9471},"Geometric Shapes":function(s){return s>=9632&&s<=9727},"Miscellaneous Symbols":function(s){return s>=9728&&s<=9983},"Miscellaneous Symbols and Arrows":function(s){return s>=11008&&s<=11263},"CJK Radicals Supplement":function(s){return s>=11904&&s<=12031},"Kangxi Radicals":function(s){return s>=12032&&s<=12255},"Ideographic Description Characters":function(s){return s>=12272&&s<=12287},"CJK Symbols and Punctuation":function(s){return s>=12288&&s<=12351},Hiragana:function(s){return s>=12352&&s<=12447},Katakana:function(s){return s>=12448&&s<=12543},Bopomofo:function(s){return s>=12544&&s<=12591},"Hangul Compatibility Jamo":function(s){return s>=12592&&s<=12687},Kanbun:function(s){return s>=12688&&s<=12703},"Bopomofo Extended":function(s){return s>=12704&&s<=12735},"CJK Strokes":function(s){return s>=12736&&s<=12783},"Katakana Phonetic Extensions":function(s){return s>=12784&&s<=12799},"Enclosed CJK Letters and Months":function(s){return s>=12800&&s<=13055},"CJK Compatibility":function(s){return s>=13056&&s<=13311},"CJK Unified Ideographs Extension A":function(s){return s>=13312&&s<=19903},"Yijing Hexagram Symbols":function(s){return s>=19904&&s<=19967},"CJK Unified Ideographs":function(s){return s>=19968&&s<=40959},"Yi Syllables":function(s){return s>=40960&&s<=42127},"Yi Radicals":function(s){return s>=42128&&s<=42191},"Hangul Jamo Extended-A":function(s){return s>=43360&&s<=43391},"Hangul Syllables":function(s){return s>=44032&&s<=55215},"Hangul Jamo Extended-B":function(s){return s>=55216&&s<=55295},"Private Use Area":function(s){return s>=57344&&s<=63743},"CJK Compatibility Ideographs":function(s){return s>=63744&&s<=64255},"Arabic Presentation Forms-A":function(s){return s>=64336&&s<=65023},"Vertical Forms":function(s){return s>=65040&&s<=65055},"CJK Compatibility Forms":function(s){return s>=65072&&s<=65103},"Small Form Variants":function(s){return s>=65104&&s<=65135},"Arabic Presentation Forms-B":function(s){return s>=65136&&s<=65279},"Halfwidth and Fullwidth Forms":function(s){return s>=65280&&s<=65519}};function Qu(s){for(var l=0,h=s;l<h.length;l+=1)if(Of(h[l].charCodeAt(0)))return!0;return!1}function Of(s){return!(s!==746&&s!==747&&(s<4352||!(Dr["Bopomofo Extended"](s)||Dr.Bopomofo(s)||Dr["CJK Compatibility Forms"](s)&&!(s>=65097&&s<=65103)||Dr["CJK Compatibility Ideographs"](s)||Dr["CJK Compatibility"](s)||Dr["CJK Radicals Supplement"](s)||Dr["CJK Strokes"](s)||!(!Dr["CJK Symbols and Punctuation"](s)||s>=12296&&s<=12305||s>=12308&&s<=12319||s===12336)||Dr["CJK Unified Ideographs Extension A"](s)||Dr["CJK Unified Ideographs"](s)||Dr["Enclosed CJK Letters and Months"](s)||Dr["Hangul Compatibility Jamo"](s)||Dr["Hangul Jamo Extended-A"](s)||Dr["Hangul Jamo Extended-B"](s)||Dr["Hangul Jamo"](s)||Dr["Hangul Syllables"](s)||Dr.Hiragana(s)||Dr["Ideographic Description Characters"](s)||Dr.Kanbun(s)||Dr["Kangxi Radicals"](s)||Dr["Katakana Phonetic Extensions"](s)||Dr.Katakana(s)&&s!==12540||!(!Dr["Halfwidth and Fullwidth Forms"](s)||s===65288||s===65289||s===65293||s>=65306&&s<=65310||s===65339||s===65341||s===65343||s>=65371&&s<=65503||s===65507||s>=65512&&s<=65519)||!(!Dr["Small Form Variants"](s)||s>=65112&&s<=65118||s>=65123&&s<=65126)||Dr["Unified Canadian Aboriginal Syllabics"](s)||Dr["Unified Canadian Aboriginal Syllabics Extended"](s)||Dr["Vertical Forms"](s)||Dr["Yijing Hexagram Symbols"](s)||Dr["Yi Syllables"](s)||Dr["Yi Radicals"](s))))}function Th(s){return!(Of(s)||function(l){return!!(Dr["Latin-1 Supplement"](l)&&(l===167||l===169||l===174||l===177||l===188||l===189||l===190||l===215||l===247)||Dr["General Punctuation"](l)&&(l===8214||l===8224||l===8225||l===8240||l===8241||l===8251||l===8252||l===8258||l===8263||l===8264||l===8265||l===8273)||Dr["Letterlike Symbols"](l)||Dr["Number Forms"](l)||Dr["Miscellaneous Technical"](l)&&(l>=8960&&l<=8967||l>=8972&&l<=8991||l>=8996&&l<=9e3||l===9003||l>=9085&&l<=9114||l>=9150&&l<=9165||l===9167||l>=9169&&l<=9179||l>=9186&&l<=9215)||Dr["Control Pictures"](l)&&l!==9251||Dr["Optical Character Recognition"](l)||Dr["Enclosed Alphanumerics"](l)||Dr["Geometric Shapes"](l)||Dr["Miscellaneous Symbols"](l)&&!(l>=9754&&l<=9759)||Dr["Miscellaneous Symbols and Arrows"](l)&&(l>=11026&&l<=11055||l>=11088&&l<=11097||l>=11192&&l<=11243)||Dr["CJK Symbols and Punctuation"](l)||Dr.Katakana(l)||Dr["Private Use Area"](l)||Dr["CJK Compatibility Forms"](l)||Dr["Small Form Variants"](l)||Dr["Halfwidth and Fullwidth Forms"](l)||l===8734||l===8756||l===8757||l>=9984&&l<=10087||l>=10102&&l<=10131||l===65532||l===65533)}(s))}function Gs(s){return s>=1424&&s<=2303||Dr["Arabic Presentation Forms-A"](s)||Dr["Arabic Presentation Forms-B"](s)}function gs(s,l){return!(!l&&Gs(s)||s>=2304&&s<=3583||s>=3840&&s<=4255||Dr.Khmer(s))}function wh(s){for(var l=0,h=s;l<h.length;l+=1)if(Gs(h[l].charCodeAt(0)))return!0;return!1}var Ch=null,Xo="unavailable",Tu=null,X1=function(s){s&&typeof s=="string"&&s.indexOf("NetworkError")>-1&&(Xo="error"),Ch&&Ch(s)};function Oc(){Rh.fire(new Ee("pluginStateChange",{pluginStatus:Xo,pluginURL:Tu}))}var Rh=new Ye,jp=function(){return Xo},_s=function(){if(Xo!=="deferred"||!Tu)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Xo="loading",Oc(),Tu&&Hi({url:Tu},function(s){s?X1(s):(Xo="loaded",Oc())})},Ms={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Xo==="loaded"||Ms.applyArabicShaping!=null},isLoading:function(){return Xo==="loading"},setState:function(s){Xo=s.pluginStatus,Tu=s.pluginURL},isParsed:function(){return Ms.applyArabicShaping!=null&&Ms.processBidirectionalText!=null&&Ms.processStyledBidirectionalText!=null},getPluginURL:function(){return Tu}},Zn=function(s,l){this.zoom=s,l?(this.now=l.now,this.fadeDuration=l.fadeDuration,this.zoomHistory=l.zoomHistory,this.transition=l.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ah,this.transition={})};Zn.prototype.isSupportedScript=function(s){return function(l,h){for(var g=0,x=l;g<x.length;g+=1)if(!gs(x[g].charCodeAt(0),h))return!1;return!0}(s,Ms.isLoaded())},Zn.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Zn.prototype.getCrossfadeParameters=function(){var s=this.zoom,l=s-Math.floor(s),h=this.crossFadingFactor();return s>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:l+(1-l)*h}:{fromScale:.5,toScale:1,t:1-(1-h)*l}};var Ps=function(s,l){this.property=s,this.value=l,this.expression=function(h,g){if(gh(h))return new rc(h,g);if(Jl(h)){var x=Dp(h,g);if(x.result==="error")throw new Error(x.value.map(function(T){return T.key+": "+T.message}).join(", "));return x.value}var E=h;return typeof h=="string"&&g.type==="color"&&(E=si.parse(h)),{kind:"constant",evaluate:function(){return E}}}(l===void 0?s.specification.default:l,s.specification)};Ps.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Ps.prototype.possiblyEvaluate=function(s,l,h){return this.property.possiblyEvaluate(this,s,l,h)};var Os=function(s){this.property=s,this.value=new Ps(s,void 0)};Os.prototype.transitioned=function(s,l){return new Pl(this.property,this.value,l,L({},s.transition,this.transition),s.now)},Os.prototype.untransitioned=function(){return new Pl(this.property,this.value,null,{},0)};var go=function(s){this._properties=s,this._values=Object.create(s.defaultTransitionablePropertyValues)};go.prototype.getValue=function(s){return se(this._values[s].value.value)},go.prototype.setValue=function(s,l){this._values.hasOwnProperty(s)||(this._values[s]=new Os(this._values[s].property)),this._values[s].value=new Ps(this._values[s].property,l===null?void 0:se(l))},go.prototype.getTransition=function(s){return se(this._values[s].transition)},go.prototype.setTransition=function(s,l){this._values.hasOwnProperty(s)||(this._values[s]=new Os(this._values[s].property)),this._values[s].transition=se(l)||void 0},go.prototype.serialize=function(){for(var s={},l=0,h=Object.keys(this._values);l<h.length;l+=1){var g=h[l],x=this.getValue(g);x!==void 0&&(s[g]=x);var E=this.getTransition(g);E!==void 0&&(s[g+"-transition"]=E)}return s},go.prototype.transitioned=function(s,l){for(var h=new Ju(this._properties),g=0,x=Object.keys(this._values);g<x.length;g+=1){var E=x[g];h._values[E]=this._values[E].transitioned(s,l._values[E])}return h},go.prototype.untransitioned=function(){for(var s=new Ju(this._properties),l=0,h=Object.keys(this._values);l<h.length;l+=1){var g=h[l];s._values[g]=this._values[g].untransitioned()}return s};var Pl=function(s,l,h,g,x){this.property=s,this.value=l,this.begin=x+g.delay||0,this.end=this.begin+g.duration||0,s.specification.transition&&(g.delay||g.duration)&&(this.prior=h)};Pl.prototype.possiblyEvaluate=function(s,l,h){var g=s.now||0,x=this.value.possiblyEvaluate(s,l,h),E=this.prior;if(E){if(g>this.end)return this.prior=null,x;if(this.value.isDataDriven())return this.prior=null,x;if(g<this.begin)return E.possiblyEvaluate(s,l,h);var T=(g-this.begin)/(this.end-this.begin);return this.property.interpolate(E.possiblyEvaluate(s,l,h),x,function(M){if(M<=0)return 0;if(M>=1)return 1;var D=M*M,N=D*M;return 4*(M<.5?N:3*(M-D)+N-.75)}(T))}return x};var Ju=function(s){this._properties=s,this._values=Object.create(s.defaultTransitioningPropertyValues)};Ju.prototype.possiblyEvaluate=function(s,l,h){for(var g=new kc(this._properties),x=0,E=Object.keys(this._values);x<E.length;x+=1){var T=E[x];g._values[T]=this._values[T].possiblyEvaluate(s,l,h)}return g},Ju.prototype.hasTransition=function(){for(var s=0,l=Object.keys(this._values);s<l.length;s+=1)if(this._values[l[s]].prior)return!0;return!1};var Ws=function(s){this._properties=s,this._values=Object.create(s.defaultPropertyValues)};Ws.prototype.getValue=function(s){return se(this._values[s].value)},Ws.prototype.setValue=function(s,l){this._values[s]=new Ps(this._values[s].property,l===null?void 0:se(l))},Ws.prototype.serialize=function(){for(var s={},l=0,h=Object.keys(this._values);l<h.length;l+=1){var g=h[l],x=this.getValue(g);x!==void 0&&(s[g]=x)}return s},Ws.prototype.possiblyEvaluate=function(s,l,h){for(var g=new kc(this._properties),x=0,E=Object.keys(this._values);x<E.length;x+=1){var T=E[x];g._values[T]=this._values[T].possiblyEvaluate(s,l,h)}return g};var Lo=function(s,l,h){this.property=s,this.value=l,this.parameters=h};Lo.prototype.isConstant=function(){return this.value.kind==="constant"},Lo.prototype.constantOr=function(s){return this.value.kind==="constant"?this.value.value:s},Lo.prototype.evaluate=function(s,l,h,g){return this.property.evaluate(this.value,this.parameters,s,l,h,g)};var kc=function(s){this._properties=s,this._values=Object.create(s.defaultPossiblyEvaluatedValues)};kc.prototype.get=function(s){return this._values[s]};var dn=function(s){this.specification=s};dn.prototype.possiblyEvaluate=function(s,l){return s.expression.evaluate(l)},dn.prototype.interpolate=function(s,l,h){var g=_l[this.specification.type];return g?g(s,l,h):s};var nn=function(s,l){this.specification=s,this.overrides=l};nn.prototype.possiblyEvaluate=function(s,l,h,g){return new Lo(this,s.expression.kind==="constant"||s.expression.kind==="camera"?{kind:"constant",value:s.expression.evaluate(l,null,{},h,g)}:s.expression,l)},nn.prototype.interpolate=function(s,l,h){if(s.value.kind!=="constant"||l.value.kind!=="constant")return s;if(s.value.value===void 0||l.value.value===void 0)return new Lo(this,{kind:"constant",value:void 0},s.parameters);var g=_l[this.specification.type];return g?new Lo(this,{kind:"constant",value:g(s.value.value,l.value.value,h)},s.parameters):s},nn.prototype.evaluate=function(s,l,h,g,x,E){return s.kind==="constant"?s.value:s.evaluate(l,h,g,x,E)};var ys=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.possiblyEvaluate=function(h,g,x,E){if(h.value===void 0)return new Lo(this,{kind:"constant",value:void 0},g);if(h.expression.kind==="constant"){var T=h.expression.evaluate(g,null,{},x,E),M=h.property.specification.type==="resolvedImage"&&typeof T!="string"?T.name:T,D=this._calculate(M,M,M,g);return new Lo(this,{kind:"constant",value:D},g)}if(h.expression.kind==="camera"){var N=this._calculate(h.expression.evaluate({zoom:g.zoom-1}),h.expression.evaluate({zoom:g.zoom}),h.expression.evaluate({zoom:g.zoom+1}),g);return new Lo(this,{kind:"constant",value:N},g)}return new Lo(this,h.expression,g)},l.prototype.evaluate=function(h,g,x,E,T,M){if(h.kind==="source"){var D=h.evaluate(g,x,E,T,M);return this._calculate(D,D,D,g)}return h.kind==="composite"?this._calculate(h.evaluate({zoom:Math.floor(g.zoom)-1},x,E),h.evaluate({zoom:Math.floor(g.zoom)},x,E),h.evaluate({zoom:Math.floor(g.zoom)+1},x,E),g):h.value},l.prototype._calculate=function(h,g,x,E){return E.zoom>E.zoomHistory.lastIntegerZoom?{from:h,to:g}:{from:x,to:g}},l.prototype.interpolate=function(h){return h},l}(nn),No=function(s){this.specification=s};No.prototype.possiblyEvaluate=function(s,l,h,g){if(s.value!==void 0){if(s.expression.kind==="constant"){var x=s.expression.evaluate(l,null,{},h,g);return this._calculate(x,x,x,l)}return this._calculate(s.expression.evaluate(new Zn(Math.floor(l.zoom-1),l)),s.expression.evaluate(new Zn(Math.floor(l.zoom),l)),s.expression.evaluate(new Zn(Math.floor(l.zoom+1),l)),l)}},No.prototype._calculate=function(s,l,h,g){return g.zoom>g.zoomHistory.lastIntegerZoom?{from:s,to:l}:{from:h,to:l}},No.prototype.interpolate=function(s){return s};var su=function(s){this.specification=s};su.prototype.possiblyEvaluate=function(s,l,h,g){return!!s.expression.evaluate(l,null,{},h,g)},su.prototype.interpolate=function(){return!1};var ga=function(s){for(var l in this.properties=s,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],s){var h=s[l];h.specification.overridable&&this.overridableProperties.push(l);var g=this.defaultPropertyValues[l]=new Ps(h,void 0),x=this.defaultTransitionablePropertyValues[l]=new Os(h);this.defaultTransitioningPropertyValues[l]=x.untransitioned(),this.defaultPossiblyEvaluatedValues[l]=g.possiblyEvaluate({})}};Kr("DataDrivenProperty",nn),Kr("DataConstantProperty",dn),Kr("CrossFadedDataDrivenProperty",ys),Kr("CrossFadedProperty",No),Kr("ColorRampProperty",su);var Xs=function(s){function l(h,g){if(s.call(this),this.id=h.id,this.type=h.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},h.type!=="custom"&&(this.metadata=(h=h).metadata,this.minzoom=h.minzoom,this.maxzoom=h.maxzoom,h.type!=="background"&&(this.source=h.source,this.sourceLayer=h["source-layer"],this.filter=h.filter),g.layout&&(this._unevaluatedLayout=new Ws(g.layout)),g.paint)){for(var x in this._transitionablePaint=new go(g.paint),h.paint)this.setPaintProperty(x,h.paint[x],{validate:!1});for(var E in h.layout)this.setLayoutProperty(E,h.layout[E],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new kc(g.paint)}}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},l.prototype.getLayoutProperty=function(h){return h==="visibility"?this.visibility:this._unevaluatedLayout.getValue(h)},l.prototype.setLayoutProperty=function(h,g,x){x===void 0&&(x={}),g!=null&&this._validate(Mf,"layers."+this.id+".layout."+h,h,g,x)||(h!=="visibility"?this._unevaluatedLayout.setValue(h,g):this.visibility=g)},l.prototype.getPaintProperty=function(h){return ve(h,"-transition")?this._transitionablePaint.getTransition(h.slice(0,-11)):this._transitionablePaint.getValue(h)},l.prototype.setPaintProperty=function(h,g,x){if(x===void 0&&(x={}),g!=null&&this._validate(Sh,"layers."+this.id+".paint."+h,h,g,x))return!1;if(ve(h,"-transition"))return this._transitionablePaint.setTransition(h.slice(0,-11),g||void 0),!1;var E=this._transitionablePaint._values[h],T=E.property.specification["property-type"]==="cross-faded-data-driven",M=E.value.isDataDriven(),D=E.value;this._transitionablePaint.setValue(h,g),this._handleSpecialPaintPropertyUpdate(h);var N=this._transitionablePaint._values[h].value;return N.isDataDriven()||M||T||this._handleOverridablePaintPropertyUpdate(h,D,N)},l.prototype._handleSpecialPaintPropertyUpdate=function(h){},l.prototype._handleOverridablePaintPropertyUpdate=function(h,g,x){return!1},l.prototype.isHidden=function(h){return!!(this.minzoom&&h<this.minzoom)||!!(this.maxzoom&&h>=this.maxzoom)||this.visibility==="none"},l.prototype.updateTransitions=function(h){this._transitioningPaint=this._transitionablePaint.transitioned(h,this._transitioningPaint)},l.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},l.prototype.recalculate=function(h,g){h.getCrossfadeParameters&&(this._crossfadeParameters=h.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(h,void 0,g)),this.paint=this._transitioningPaint.possiblyEvaluate(h,void 0,g)},l.prototype.serialize=function(){var h={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(h.layout=h.layout||{},h.layout.visibility=this.visibility),de(h,function(g,x){return!(g===void 0||x==="layout"&&!Object.keys(g).length||x==="paint"&&!Object.keys(g).length)})},l.prototype._validate=function(h,g,x,E,T){return T===void 0&&(T={}),(!T||T.validate!==!1)&&Ml(this,h.call(If,{key:g,layerType:this.type,objectKey:x,value:E,styleSpec:ie,style:{glyphs:!0,sprite:!0}}))},l.prototype.is3D=function(){return!1},l.prototype.isTileClipped=function(){return!1},l.prototype.hasOffscreenPass=function(){return!1},l.prototype.resize=function(){},l.prototype.isStateDependent=function(){for(var h in this.paint._values){var g=this.paint.get(h);if(g instanceof Lo&&qu(g.property.specification)&&(g.value.kind==="source"||g.value.kind==="composite")&&g.value.isStateDependent)return!0}return!1},l}(Ye),el={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ic=function(s,l){this._structArray=s,this._pos1=l*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Li=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function ao(s,l){l===void 0&&(l=1);var h=0,g=0;return{members:s.map(function(x){var E=el[x.type].BYTES_PER_ELEMENT,T=h=Hp(h,Math.max(l,E)),M=x.components||1;return g=Math.max(g,E),h+=E*M,{name:x.name,type:x.type,components:M,offset:T}}),size:Hp(h,Math.max(g,l)),alignment:l}}function Hp(s,l){return Math.ceil(s/l)*l}Li.serialize=function(s,l){return s._trim(),l&&(s.isTransferred=!0,l.push(s.arrayBuffer)),{length:s.length,arrayBuffer:s.arrayBuffer}},Li.deserialize=function(s){var l=Object.create(this.prototype);return l.arrayBuffer=s.arrayBuffer,l.length=s.length,l.capacity=s.arrayBuffer.byteLength/l.bytesPerElement,l._refreshViews(),l},Li.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Li.prototype.clear=function(){this.length=0},Li.prototype.resize=function(s){this.reserve(s),this.length=s},Li.prototype.reserve=function(s){if(s>this.capacity){this.capacity=Math.max(s,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var l=this.uint8;this._refreshViews(),l&&this.uint8.set(l)}},Li.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Ol=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g){var x=this.length;return this.resize(x+1),this.emplace(x,h,g)},l.prototype.emplace=function(h,g,x){var E=2*h;return this.int16[E+0]=g,this.int16[E+1]=x,h},l}(Li);Ol.prototype.bytesPerElement=4,Kr("StructArrayLayout2i4",Ol);var Ih=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x,E){var T=this.length;return this.resize(T+1),this.emplace(T,h,g,x,E)},l.prototype.emplace=function(h,g,x,E,T){var M=4*h;return this.int16[M+0]=g,this.int16[M+1]=x,this.int16[M+2]=E,this.int16[M+3]=T,h},l}(Li);Ih.prototype.bytesPerElement=8,Kr("StructArrayLayout4i8",Ih);var tl=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x,E,T,M){var D=this.length;return this.resize(D+1),this.emplace(D,h,g,x,E,T,M)},l.prototype.emplace=function(h,g,x,E,T,M,D){var N=6*h;return this.int16[N+0]=g,this.int16[N+1]=x,this.int16[N+2]=E,this.int16[N+3]=T,this.int16[N+4]=M,this.int16[N+5]=D,h},l}(Li);tl.prototype.bytesPerElement=12,Kr("StructArrayLayout2i4i12",tl);var xs=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x,E,T,M){var D=this.length;return this.resize(D+1),this.emplace(D,h,g,x,E,T,M)},l.prototype.emplace=function(h,g,x,E,T,M,D){var N=4*h,$=8*h;return this.int16[N+0]=g,this.int16[N+1]=x,this.uint8[$+4]=E,this.uint8[$+5]=T,this.uint8[$+6]=M,this.uint8[$+7]=D,h},l}(Li);xs.prototype.bytesPerElement=8,Kr("StructArrayLayout2i4ub8",xs);var Dc=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g){var x=this.length;return this.resize(x+1),this.emplace(x,h,g)},l.prototype.emplace=function(h,g,x){var E=2*h;return this.float32[E+0]=g,this.float32[E+1]=x,h},l}(Li);Dc.prototype.bytesPerElement=8,Kr("StructArrayLayout2f8",Dc);var wu=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x,E,T,M,D,N,$,H){var q=this.length;return this.resize(q+1),this.emplace(q,h,g,x,E,T,M,D,N,$,H)},l.prototype.emplace=function(h,g,x,E,T,M,D,N,$,H,q){var re=10*h;return this.uint16[re+0]=g,this.uint16[re+1]=x,this.uint16[re+2]=E,this.uint16[re+3]=T,this.uint16[re+4]=M,this.uint16[re+5]=D,this.uint16[re+6]=N,this.uint16[re+7]=$,this.uint16[re+8]=H,this.uint16[re+9]=q,h},l}(Li);wu.prototype.bytesPerElement=20,Kr("StructArrayLayout10ui20",wu);var Mh=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x,E,T,M,D,N,$,H,q,re){var xe=this.length;return this.resize(xe+1),this.emplace(xe,h,g,x,E,T,M,D,N,$,H,q,re)},l.prototype.emplace=function(h,g,x,E,T,M,D,N,$,H,q,re,xe){var Se=12*h;return this.int16[Se+0]=g,this.int16[Se+1]=x,this.int16[Se+2]=E,this.int16[Se+3]=T,this.uint16[Se+4]=M,this.uint16[Se+5]=D,this.uint16[Se+6]=N,this.uint16[Se+7]=$,this.int16[Se+8]=H,this.int16[Se+9]=q,this.int16[Se+10]=re,this.int16[Se+11]=xe,h},l}(Li);Mh.prototype.bytesPerElement=24,Kr("StructArrayLayout4i4ui4i24",Mh);var Fc=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x){var E=this.length;return this.resize(E+1),this.emplace(E,h,g,x)},l.prototype.emplace=function(h,g,x,E){var T=3*h;return this.float32[T+0]=g,this.float32[T+1]=x,this.float32[T+2]=E,h},l}(Li);Fc.prototype.bytesPerElement=12,Kr("StructArrayLayout3f12",Fc);var kf=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h){var g=this.length;return this.resize(g+1),this.emplace(g,h)},l.prototype.emplace=function(h,g){return this.uint32[1*h+0]=g,h},l}(Li);kf.prototype.bytesPerElement=4,Kr("StructArrayLayout1ul4",kf);var Ph=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x,E,T,M,D,N,$){var H=this.length;return this.resize(H+1),this.emplace(H,h,g,x,E,T,M,D,N,$)},l.prototype.emplace=function(h,g,x,E,T,M,D,N,$,H){var q=10*h,re=5*h;return this.int16[q+0]=g,this.int16[q+1]=x,this.int16[q+2]=E,this.int16[q+3]=T,this.int16[q+4]=M,this.int16[q+5]=D,this.uint32[re+3]=N,this.uint16[q+8]=$,this.uint16[q+9]=H,h},l}(Li);Ph.prototype.bytesPerElement=20,Kr("StructArrayLayout6i1ul2ui20",Ph);var ac=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x,E,T,M){var D=this.length;return this.resize(D+1),this.emplace(D,h,g,x,E,T,M)},l.prototype.emplace=function(h,g,x,E,T,M,D){var N=6*h;return this.int16[N+0]=g,this.int16[N+1]=x,this.int16[N+2]=E,this.int16[N+3]=T,this.int16[N+4]=M,this.int16[N+5]=D,h},l}(Li);ac.prototype.bytesPerElement=12,Kr("StructArrayLayout2i2i2i12",ac);var oc=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x,E,T){var M=this.length;return this.resize(M+1),this.emplace(M,h,g,x,E,T)},l.prototype.emplace=function(h,g,x,E,T,M){var D=4*h,N=8*h;return this.float32[D+0]=g,this.float32[D+1]=x,this.float32[D+2]=E,this.int16[N+6]=T,this.int16[N+7]=M,h},l}(Li);oc.prototype.bytesPerElement=16,Kr("StructArrayLayout2f1f2i16",oc);var Gp=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x,E){var T=this.length;return this.resize(T+1),this.emplace(T,h,g,x,E)},l.prototype.emplace=function(h,g,x,E,T){var M=12*h,D=3*h;return this.uint8[M+0]=g,this.uint8[M+1]=x,this.float32[D+1]=E,this.float32[D+2]=T,h},l}(Li);Gp.prototype.bytesPerElement=12,Kr("StructArrayLayout2ub2f12",Gp);var Cu=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x){var E=this.length;return this.resize(E+1),this.emplace(E,h,g,x)},l.prototype.emplace=function(h,g,x,E){var T=3*h;return this.uint16[T+0]=g,this.uint16[T+1]=x,this.uint16[T+2]=E,h},l}(Li);Cu.prototype.bytesPerElement=6,Kr("StructArrayLayout3ui6",Cu);var uu=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x,E,T,M,D,N,$,H,q,re,xe,Se,ze,Oe,et){var ut=this.length;return this.resize(ut+1),this.emplace(ut,h,g,x,E,T,M,D,N,$,H,q,re,xe,Se,ze,Oe,et)},l.prototype.emplace=function(h,g,x,E,T,M,D,N,$,H,q,re,xe,Se,ze,Oe,et,ut){var St=24*h,It=12*h,Xt=48*h;return this.int16[St+0]=g,this.int16[St+1]=x,this.uint16[St+2]=E,this.uint16[St+3]=T,this.uint32[It+2]=M,this.uint32[It+3]=D,this.uint32[It+4]=N,this.uint16[St+10]=$,this.uint16[St+11]=H,this.uint16[St+12]=q,this.float32[It+7]=re,this.float32[It+8]=xe,this.uint8[Xt+36]=Se,this.uint8[Xt+37]=ze,this.uint8[Xt+38]=Oe,this.uint32[It+10]=et,this.int16[St+22]=ut,h},l}(Li);uu.prototype.bytesPerElement=48,Kr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",uu);var Oh=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x,E,T,M,D,N,$,H,q,re,xe,Se,ze,Oe,et,ut,St,It,Xt,Er,kr,mn,Gr,An,Zr,li){var Ln=this.length;return this.resize(Ln+1),this.emplace(Ln,h,g,x,E,T,M,D,N,$,H,q,re,xe,Se,ze,Oe,et,ut,St,It,Xt,Er,kr,mn,Gr,An,Zr,li)},l.prototype.emplace=function(h,g,x,E,T,M,D,N,$,H,q,re,xe,Se,ze,Oe,et,ut,St,It,Xt,Er,kr,mn,Gr,An,Zr,li,Ln){var sn=34*h,di=17*h;return this.int16[sn+0]=g,this.int16[sn+1]=x,this.int16[sn+2]=E,this.int16[sn+3]=T,this.int16[sn+4]=M,this.int16[sn+5]=D,this.int16[sn+6]=N,this.int16[sn+7]=$,this.uint16[sn+8]=H,this.uint16[sn+9]=q,this.uint16[sn+10]=re,this.uint16[sn+11]=xe,this.uint16[sn+12]=Se,this.uint16[sn+13]=ze,this.uint16[sn+14]=Oe,this.uint16[sn+15]=et,this.uint16[sn+16]=ut,this.uint16[sn+17]=St,this.uint16[sn+18]=It,this.uint16[sn+19]=Xt,this.uint16[sn+20]=Er,this.uint16[sn+21]=kr,this.uint16[sn+22]=mn,this.uint32[di+12]=Gr,this.float32[di+13]=An,this.float32[di+14]=Zr,this.float32[di+15]=li,this.float32[di+16]=Ln,h},l}(Li);Oh.prototype.bytesPerElement=68,Kr("StructArrayLayout8i15ui1ul4f68",Oh);var kl=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h){var g=this.length;return this.resize(g+1),this.emplace(g,h)},l.prototype.emplace=function(h,g){return this.float32[1*h+0]=g,h},l}(Li);kl.prototype.bytesPerElement=4,Kr("StructArrayLayout1f4",kl);var Ys=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x){var E=this.length;return this.resize(E+1),this.emplace(E,h,g,x)},l.prototype.emplace=function(h,g,x,E){var T=3*h;return this.int16[T+0]=g,this.int16[T+1]=x,this.int16[T+2]=E,h},l}(Li);Ys.prototype.bytesPerElement=6,Kr("StructArrayLayout3i6",Ys);var Wp=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x){var E=this.length;return this.resize(E+1),this.emplace(E,h,g,x)},l.prototype.emplace=function(h,g,x,E){var T=4*h;return this.uint32[2*h+0]=g,this.uint16[T+2]=x,this.uint16[T+3]=E,h},l}(Li);Wp.prototype.bytesPerElement=8,Kr("StructArrayLayout1ul2ui8",Wp);var Df=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g){var x=this.length;return this.resize(x+1),this.emplace(x,h,g)},l.prototype.emplace=function(h,g,x){var E=2*h;return this.uint16[E+0]=g,this.uint16[E+1]=x,h},l}(Li);Df.prototype.bytesPerElement=4,Kr("StructArrayLayout2ui4",Df);var kh=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h){var g=this.length;return this.resize(g+1),this.emplace(g,h)},l.prototype.emplace=function(h,g){return this.uint16[1*h+0]=g,h},l}(Li);kh.prototype.bytesPerElement=2,Kr("StructArrayLayout1ui2",kh);var Dh=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(h,g,x,E){var T=this.length;return this.resize(T+1),this.emplace(T,h,g,x,E)},l.prototype.emplace=function(h,g,x,E,T){var M=4*h;return this.float32[M+0]=g,this.float32[M+1]=x,this.float32[M+2]=E,this.float32[M+3]=T,h},l}(Li);Dh.prototype.bytesPerElement=16,Kr("StructArrayLayout4f16",Dh);var p=function(s){function l(){s.apply(this,arguments)}s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l;var h={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return h.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},h.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},h.x1.get=function(){return this._structArray.int16[this._pos2+2]},h.y1.get=function(){return this._structArray.int16[this._pos2+3]},h.x2.get=function(){return this._structArray.int16[this._pos2+4]},h.y2.get=function(){return this._structArray.int16[this._pos2+5]},h.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},h.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},h.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},h.anchorPoint.get=function(){return new m(this.anchorPointX,this.anchorPointY)},Object.defineProperties(l.prototype,h),l}(ic);p.prototype.size=20;var v=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.get=function(h){return new p(this,h)},l}(Ph);Kr("CollisionBoxArray",v);var d=function(s){function l(){s.apply(this,arguments)}s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l;var h={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return h.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},h.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},h.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},h.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},h.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},h.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},h.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},h.segment.get=function(){return this._structArray.uint16[this._pos2+10]},h.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},h.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},h.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},h.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},h.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},h.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},h.placedOrientation.set=function(g){this._structArray.uint8[this._pos1+37]=g},h.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},h.hidden.set=function(g){this._structArray.uint8[this._pos1+38]=g},h.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},h.crossTileID.set=function(g){this._structArray.uint32[this._pos4+10]=g},h.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(l.prototype,h),l}(ic);d.prototype.size=48;var y=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.get=function(h){return new d(this,h)},l}(uu);Kr("PlacedSymbolArray",y);var S=function(s){function l(){s.apply(this,arguments)}s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l;var h={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return h.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},h.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},h.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},h.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},h.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},h.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},h.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},h.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},h.key.get=function(){return this._structArray.uint16[this._pos2+8]},h.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},h.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},h.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},h.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},h.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},h.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},h.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},h.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},h.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},h.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},h.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},h.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},h.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},h.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},h.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},h.crossTileID.set=function(g){this._structArray.uint32[this._pos4+12]=g},h.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},h.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},h.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},h.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(l.prototype,h),l}(ic);S.prototype.size=68;var C=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.get=function(h){return new S(this,h)},l}(Oh);Kr("SymbolInstanceArray",C);var I=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.getoffsetX=function(h){return this.float32[1*h+0]},l}(kl);Kr("GlyphOffsetArray",I);var O=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.getx=function(h){return this.int16[3*h+0]},l.prototype.gety=function(h){return this.int16[3*h+1]},l.prototype.gettileUnitDistanceFromAnchor=function(h){return this.int16[3*h+2]},l}(Ys);Kr("SymbolLineVertexArray",O);var z=function(s){function l(){s.apply(this,arguments)}s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l;var h={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return h.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},h.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},h.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(l.prototype,h),l}(ic);z.prototype.size=8;var X=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.get=function(h){return new z(this,h)},l}(Wp);Kr("FeatureIndexArray",X);var ne=ao([{name:"a_pos",components:2,type:"Int16"}],4).members,ae=function(s){s===void 0&&(s=[]),this.segments=s};function oe(s,l){return 256*(s=P(Math.floor(s),0,255))+P(Math.floor(l),0,255)}ae.prototype.prepareSegment=function(s,l,h,g){var x=this.segments[this.segments.length-1];return s>ae.MAX_VERTEX_ARRAY_LENGTH&&ye("Max vertices per segment is "+ae.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+s),(!x||x.vertexLength+s>ae.MAX_VERTEX_ARRAY_LENGTH||x.sortKey!==g)&&(x={vertexOffset:l.length,primitiveOffset:h.length,vertexLength:0,primitiveLength:0},g!==void 0&&(x.sortKey=g),this.segments.push(x)),x},ae.prototype.get=function(){return this.segments},ae.prototype.destroy=function(){for(var s=0,l=this.segments;s<l.length;s+=1){var h=l[s];for(var g in h.vaos)h.vaos[g].destroy()}},ae.simpleSegment=function(s,l,h,g){return new ae([{vertexOffset:s,primitiveOffset:l,vertexLength:h,primitiveLength:g,vaos:{},sortKey:0}])},ae.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Kr("SegmentVector",ae);var we=ao([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),be=u(function(s){s.exports=function(l,h){var g,x,E,T,M,D,N,$;for(x=l.length-(g=3&l.length),E=h,M=3432918353,D=461845907,$=0;$<x;)N=255&l.charCodeAt($)|(255&l.charCodeAt(++$))<<8|(255&l.charCodeAt(++$))<<16|(255&l.charCodeAt(++$))<<24,++$,E=27492+(65535&(T=5*(65535&(E=(E^=N=(65535&(N=(N=(65535&N)*M+(((N>>>16)*M&65535)<<16)&4294967295)<<15|N>>>17))*D+(((N>>>16)*D&65535)<<16)&4294967295)<<13|E>>>19))+((5*(E>>>16)&65535)<<16)&4294967295))+((58964+(T>>>16)&65535)<<16);switch(N=0,g){case 3:N^=(255&l.charCodeAt($+2))<<16;case 2:N^=(255&l.charCodeAt($+1))<<8;case 1:E^=N=(65535&(N=(N=(65535&(N^=255&l.charCodeAt($)))*M+(((N>>>16)*M&65535)<<16)&4294967295)<<15|N>>>17))*D+(((N>>>16)*D&65535)<<16)&4294967295}return E^=l.length,E=2246822507*(65535&(E^=E>>>16))+((2246822507*(E>>>16)&65535)<<16)&4294967295,E=3266489909*(65535&(E^=E>>>13))+((3266489909*(E>>>16)&65535)<<16)&4294967295,(E^=E>>>16)>>>0}}),Fe=u(function(s){s.exports=function(l,h){for(var g,x=l.length,E=h^x,T=0;x>=4;)g=1540483477*(65535&(g=255&l.charCodeAt(T)|(255&l.charCodeAt(++T))<<8|(255&l.charCodeAt(++T))<<16|(255&l.charCodeAt(++T))<<24))+((1540483477*(g>>>16)&65535)<<16),E=1540483477*(65535&E)+((1540483477*(E>>>16)&65535)<<16)^(g=1540483477*(65535&(g^=g>>>24))+((1540483477*(g>>>16)&65535)<<16)),x-=4,++T;switch(x){case 3:E^=(255&l.charCodeAt(T+2))<<16;case 2:E^=(255&l.charCodeAt(T+1))<<8;case 1:E=1540483477*(65535&(E^=255&l.charCodeAt(T)))+((1540483477*(E>>>16)&65535)<<16)}return E=1540483477*(65535&(E^=E>>>13))+((1540483477*(E>>>16)&65535)<<16),(E^=E>>>15)>>>0}}),_e=be,De=Fe;_e.murmur3=be,_e.murmur2=De;var Xe=function(){this.ids=[],this.positions=[],this.indexed=!1};Xe.prototype.add=function(s,l,h,g){this.ids.push(Ct(s)),this.positions.push(l,h,g)},Xe.prototype.getPositions=function(s){for(var l=Ct(s),h=0,g=this.ids.length-1;h<g;){var x=h+g>>1;this.ids[x]>=l?g=x:h=x+1}for(var E=[];this.ids[h]===l;)E.push({index:this.positions[3*h],start:this.positions[3*h+1],end:this.positions[3*h+2]}),h++;return E},Xe.serialize=function(s,l){var h=new Float64Array(s.ids),g=new Uint32Array(s.positions);return function x(E,T,M,D){for(;M<D;){for(var N=E[M+D>>1],$=M-1,H=D+1;;){do $++;while(E[$]<N);do H--;while(E[H]>N);if($>=H)break;mt(E,$,H),mt(T,3*$,3*H),mt(T,3*$+1,3*H+1),mt(T,3*$+2,3*H+2)}H-M<D-H?(x(E,T,M,H),M=H+1):(x(E,T,H+1,D),D=H)}}(h,g,0,h.length-1),l&&l.push(h.buffer,g.buffer),{ids:h,positions:g}},Xe.deserialize=function(s){var l=new Xe;return l.ids=s.ids,l.positions=s.positions,l.indexed=!0,l};var ot=Math.pow(2,53)-1;function Ct(s){var l=+s;return!isNaN(l)&&l<=ot?l:_e(String(s))}function mt(s,l,h){var g=s[l];s[l]=s[h],s[h]=g}Kr("FeaturePositionMap",Xe);var kt=function(s,l){this.gl=s.gl,this.location=l},qt=function(s){function l(h,g){s.call(this,h,g),this.current=0}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.set=function(h){this.current!==h&&(this.current=h,this.gl.uniform1i(this.location,h))},l}(kt),Tr=function(s){function l(h,g){s.call(this,h,g),this.current=0}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.set=function(h){this.current!==h&&(this.current=h,this.gl.uniform1f(this.location,h))},l}(kt),yr=function(s){function l(h,g){s.call(this,h,g),this.current=[0,0]}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.set=function(h){h[0]===this.current[0]&&h[1]===this.current[1]||(this.current=h,this.gl.uniform2f(this.location,h[0],h[1]))},l}(kt),$r=function(s){function l(h,g){s.call(this,h,g),this.current=[0,0,0]}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.set=function(h){h[0]===this.current[0]&&h[1]===this.current[1]&&h[2]===this.current[2]||(this.current=h,this.gl.uniform3f(this.location,h[0],h[1],h[2]))},l}(kt),vn=function(s){function l(h,g){s.call(this,h,g),this.current=[0,0,0,0]}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.set=function(h){h[0]===this.current[0]&&h[1]===this.current[1]&&h[2]===this.current[2]&&h[3]===this.current[3]||(this.current=h,this.gl.uniform4f(this.location,h[0],h[1],h[2],h[3]))},l}(kt),bn=function(s){function l(h,g){s.call(this,h,g),this.current=si.transparent}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.set=function(h){h.r===this.current.r&&h.g===this.current.g&&h.b===this.current.b&&h.a===this.current.a||(this.current=h,this.gl.uniform4f(this.location,h.r,h.g,h.b,h.a))},l}(kt),xn=new Float32Array(16),Si=function(s){function l(h,g){s.call(this,h,g),this.current=xn}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.set=function(h){if(h[12]!==this.current[12]||h[0]!==this.current[0])return this.current=h,void this.gl.uniformMatrix4fv(this.location,!1,h);for(var g=1;g<16;g++)if(h[g]!==this.current[g]){this.current=h,this.gl.uniformMatrix4fv(this.location,!1,h);break}},l}(kt);function Yr(s){return[oe(255*s.r,255*s.g),oe(255*s.b,255*s.a)]}var Un=function(s,l,h){this.value=s,this.uniformNames=l.map(function(g){return"u_"+g}),this.type=h};Un.prototype.setUniform=function(s,l,h){s.set(h.constantOr(this.value))},Un.prototype.getBinding=function(s,l,h){return this.type==="color"?new bn(s,l):new Tr(s,l)};var Kn=function(s,l){this.uniformNames=l.map(function(h){return"u_"+h}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Kn.prototype.setConstantPatternPositions=function(s,l){this.pixelRatioFrom=l.pixelRatio,this.pixelRatioTo=s.pixelRatio,this.patternFrom=l.tlbr,this.patternTo=s.tlbr},Kn.prototype.setUniform=function(s,l,h,g){var x=g==="u_pattern_to"?this.patternTo:g==="u_pattern_from"?this.patternFrom:g==="u_pixel_ratio_to"?this.pixelRatioTo:g==="u_pixel_ratio_from"?this.pixelRatioFrom:null;x&&s.set(x)},Kn.prototype.getBinding=function(s,l,h){return h.substr(0,9)==="u_pattern"?new vn(s,l):new Tr(s,l)};var Bn=function(s,l,h,g){this.expression=s,this.type=h,this.maxValue=0,this.paintVertexAttributes=l.map(function(x){return{name:"a_"+x,type:"Float32",components:h==="color"?2:1,offset:0}}),this.paintVertexArray=new g};Bn.prototype.populatePaintArray=function(s,l,h,g,x){var E=this.paintVertexArray.length,T=this.expression.evaluate(new Zn(0),l,{},g,[],x);this.paintVertexArray.resize(s),this._setPaintValue(E,s,T)},Bn.prototype.updatePaintArray=function(s,l,h,g){var x=this.expression.evaluate({zoom:0},h,g);this._setPaintValue(s,l,x)},Bn.prototype._setPaintValue=function(s,l,h){if(this.type==="color")for(var g=Yr(h),x=s;x<l;x++)this.paintVertexArray.emplace(x,g[0],g[1]);else{for(var E=s;E<l;E++)this.paintVertexArray.emplace(E,h);this.maxValue=Math.max(this.maxValue,Math.abs(h))}},Bn.prototype.upload=function(s){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=s.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Bn.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var On=function(s,l,h,g,x,E){this.expression=s,this.uniformNames=l.map(function(T){return"u_"+T+"_t"}),this.type=h,this.useIntegerZoom=g,this.zoom=x,this.maxValue=0,this.paintVertexAttributes=l.map(function(T){return{name:"a_"+T,type:"Float32",components:h==="color"?4:2,offset:0}}),this.paintVertexArray=new E};On.prototype.populatePaintArray=function(s,l,h,g,x){var E=this.expression.evaluate(new Zn(this.zoom),l,{},g,[],x),T=this.expression.evaluate(new Zn(this.zoom+1),l,{},g,[],x),M=this.paintVertexArray.length;this.paintVertexArray.resize(s),this._setPaintValue(M,s,E,T)},On.prototype.updatePaintArray=function(s,l,h,g){var x=this.expression.evaluate({zoom:this.zoom},h,g),E=this.expression.evaluate({zoom:this.zoom+1},h,g);this._setPaintValue(s,l,x,E)},On.prototype._setPaintValue=function(s,l,h,g){if(this.type==="color")for(var x=Yr(h),E=Yr(g),T=s;T<l;T++)this.paintVertexArray.emplace(T,x[0],x[1],E[0],E[1]);else{for(var M=s;M<l;M++)this.paintVertexArray.emplace(M,h,g);this.maxValue=Math.max(this.maxValue,Math.abs(h),Math.abs(g))}},On.prototype.upload=function(s){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=s.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},On.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},On.prototype.setUniform=function(s,l){var h=this.useIntegerZoom?Math.floor(l.zoom):l.zoom,g=P(this.expression.interpolationFactor(h,this.zoom,this.zoom+1),0,1);s.set(g)},On.prototype.getBinding=function(s,l,h){return new Tr(s,l)};var Yn=function(s,l,h,g,x,E){this.expression=s,this.type=l,this.useIntegerZoom=h,this.zoom=g,this.layerId=E,this.zoomInPaintVertexArray=new x,this.zoomOutPaintVertexArray=new x};Yn.prototype.populatePaintArray=function(s,l,h){var g=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(s),this.zoomOutPaintVertexArray.resize(s),this._setPaintValues(g,s,l.patterns&&l.patterns[this.layerId],h)},Yn.prototype.updatePaintArray=function(s,l,h,g,x){this._setPaintValues(s,l,h.patterns&&h.patterns[this.layerId],x)},Yn.prototype._setPaintValues=function(s,l,h,g){if(g&&h){var x=g[h.min],E=g[h.mid],T=g[h.max];if(x&&E&&T)for(var M=s;M<l;M++)this.zoomInPaintVertexArray.emplace(M,E.tl[0],E.tl[1],E.br[0],E.br[1],x.tl[0],x.tl[1],x.br[0],x.br[1],E.pixelRatio,x.pixelRatio),this.zoomOutPaintVertexArray.emplace(M,E.tl[0],E.tl[1],E.br[0],E.br[1],T.tl[0],T.tl[1],T.br[0],T.br[1],E.pixelRatio,T.pixelRatio)}},Yn.prototype.upload=function(s){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=s.createVertexBuffer(this.zoomInPaintVertexArray,we.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=s.createVertexBuffer(this.zoomOutPaintVertexArray,we.members,this.expression.isStateDependent))},Yn.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var kn=function(s,l,h){this.binders={},this._buffers=[];var g=[];for(var x in s.paint._values)if(h(x)){var E=s.paint.get(x);if(E instanceof Lo&&qu(E.property.specification)){var T=$a(x,s.type),M=E.value,D=E.property.specification.type,N=E.property.useIntegerZoom,$=E.property.specification["property-type"],H=$==="cross-faded"||$==="cross-faded-data-driven";if(M.kind==="constant")this.binders[x]=H?new Kn(M.value,T):new Un(M.value,T,D),g.push("/u_"+x);else if(M.kind==="source"||H){var q=xa(x,D,"source");this.binders[x]=H?new Yn(M,D,N,l,q,s.id):new Bn(M,T,D,q),g.push("/a_"+x)}else{var re=xa(x,D,"composite");this.binders[x]=new On(M,T,D,N,l,re),g.push("/z_"+x)}}}this.cacheKey=g.sort().join("")};kn.prototype.getMaxValue=function(s){var l=this.binders[s];return l instanceof Bn||l instanceof On?l.maxValue:0},kn.prototype.populatePaintArrays=function(s,l,h,g,x){for(var E in this.binders){var T=this.binders[E];(T instanceof Bn||T instanceof On||T instanceof Yn)&&T.populatePaintArray(s,l,h,g,x)}},kn.prototype.setConstantPatternPositions=function(s,l){for(var h in this.binders){var g=this.binders[h];g instanceof Kn&&g.setConstantPatternPositions(s,l)}},kn.prototype.updatePaintArrays=function(s,l,h,g,x){var E=!1;for(var T in s)for(var M=0,D=l.getPositions(T);M<D.length;M+=1){var N=D[M],$=h.feature(N.index);for(var H in this.binders){var q=this.binders[H];if((q instanceof Bn||q instanceof On||q instanceof Yn)&&q.expression.isStateDependent===!0){var re=g.paint.get(H);q.expression=re.value,q.updatePaintArray(N.start,N.end,$,s[T],x),E=!0}}}return E},kn.prototype.defines=function(){var s=[];for(var l in this.binders){var h=this.binders[l];(h instanceof Un||h instanceof Kn)&&s.push.apply(s,h.uniformNames.map(function(g){return"#define HAS_UNIFORM_"+g}))}return s},kn.prototype.getBinderAttributes=function(){var s=[];for(var l in this.binders){var h=this.binders[l];if(h instanceof Bn||h instanceof On)for(var g=0;g<h.paintVertexAttributes.length;g++)s.push(h.paintVertexAttributes[g].name);else if(h instanceof Yn)for(var x=0;x<we.members.length;x++)s.push(we.members[x].name)}return s},kn.prototype.getBinderUniforms=function(){var s=[];for(var l in this.binders){var h=this.binders[l];if(h instanceof Un||h instanceof Kn||h instanceof On)for(var g=0,x=h.uniformNames;g<x.length;g+=1)s.push(x[g])}return s},kn.prototype.getPaintVertexBuffers=function(){return this._buffers},kn.prototype.getUniforms=function(s,l){var h=[];for(var g in this.binders){var x=this.binders[g];if(x instanceof Un||x instanceof Kn||x instanceof On)for(var E=0,T=x.uniformNames;E<T.length;E+=1){var M=T[E];if(l[M]){var D=x.getBinding(s,l[M],M);h.push({name:M,property:g,binding:D})}}}return h},kn.prototype.setUniforms=function(s,l,h,g){for(var x=0,E=l;x<E.length;x+=1){var T=E[x],M=T.name,D=T.property;this.binders[D].setUniform(T.binding,g,h.get(D),M)}},kn.prototype.updatePaintBuffers=function(s){for(var l in this._buffers=[],this.binders){var h=this.binders[l];if(s&&h instanceof Yn){var g=s.fromScale===2?h.zoomInPaintVertexBuffer:h.zoomOutPaintVertexBuffer;g&&this._buffers.push(g)}else(h instanceof Bn||h instanceof On)&&h.paintVertexBuffer&&this._buffers.push(h.paintVertexBuffer)}},kn.prototype.upload=function(s){for(var l in this.binders){var h=this.binders[l];(h instanceof Bn||h instanceof On||h instanceof Yn)&&h.upload(s)}this.updatePaintBuffers()},kn.prototype.destroy=function(){for(var s in this.binders){var l=this.binders[s];(l instanceof Bn||l instanceof On||l instanceof Yn)&&l.destroy()}};var In=function(s,l,h){h===void 0&&(h=function(){return!0}),this.programConfigurations={};for(var g=0,x=s;g<x.length;g+=1){var E=x[g];this.programConfigurations[E.id]=new kn(E,l,h)}this.needsUpload=!1,this._featureMap=new Xe,this._bufferOffset=0};function $a(s,l){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[s]||[s.replace(l+"-","").replace(/-/g,"_")]}function xa(s,l,h){var g={color:{source:Dc,composite:Dh},number:{source:kl,composite:Dc}},x=function(E){return{"line-pattern":{source:wu,composite:wu},"fill-pattern":{source:wu,composite:wu},"fill-extrusion-pattern":{source:wu,composite:wu}}[E]}(s);return x&&x[h]||g[l][h]}In.prototype.populatePaintArrays=function(s,l,h,g,x,E){for(var T in this.programConfigurations)this.programConfigurations[T].populatePaintArrays(s,l,g,x,E);l.id!==void 0&&this._featureMap.add(l.id,h,this._bufferOffset,s),this._bufferOffset=s,this.needsUpload=!0},In.prototype.updatePaintArrays=function(s,l,h,g){for(var x=0,E=h;x<E.length;x+=1){var T=E[x];this.needsUpload=this.programConfigurations[T.id].updatePaintArrays(s,this._featureMap,l,T,g)||this.needsUpload}},In.prototype.get=function(s){return this.programConfigurations[s]},In.prototype.upload=function(s){if(this.needsUpload){for(var l in this.programConfigurations)this.programConfigurations[l].upload(s);this.needsUpload=!1}},In.prototype.destroy=function(){for(var s in this.programConfigurations)this.programConfigurations[s].destroy()},Kr("ConstantBinder",Un),Kr("CrossFadedConstantBinder",Kn),Kr("SourceExpressionBinder",Bn),Kr("CrossFadedCompositeBinder",Yn),Kr("CompositeExpressionBinder",On),Kr("ProgramConfiguration",kn,{omit:["_buffers"]}),Kr("ProgramConfigurationSet",In);var _o=Math.pow(2,14)-1,oo=-_o-1;function _a(s){for(var l=8192/s.extent,h=s.loadGeometry(),g=0;g<h.length;g++)for(var x=h[g],E=0;E<x.length;E++){var T=x[E],M=Math.round(T.x*l),D=Math.round(T.y*l);T.x=P(M,oo,_o),T.y=P(D,oo,_o),(M<T.x||M>T.x+1||D<T.y||D>T.y+1)&&ye("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return h}function ba(s,l){return{type:s.type,id:s.id,properties:s.properties,geometry:l?_a(s):[]}}function Yo(s,l,h,g,x){s.emplaceBack(2*l+(g+1)/2,2*h+(x+1)/2)}var Uo=function(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(function(l){return l.id}),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new Ol,this.indexArray=new Cu,this.segments=new ae,this.programConfigurations=new In(s.layers,s.zoom),this.stateDependentLayerIds=this.layers.filter(function(l){return l.isStateDependent()}).map(function(l){return l.id})};function Ru(s,l){for(var h=0;h<s.length;h++)if(lu(l,s[h]))return!0;for(var g=0;g<l.length;g++)if(lu(s,l[g]))return!0;return!!Bc(s,l)}function Zo(s,l,h){return!!lu(s,l)||!!Iu(l,s,h)}function Zs(s,l){if(s.length===1)return rl(l,s[0]);for(var h=0;h<l.length;h++)for(var g=l[h],x=0;x<g.length;x++)if(lu(s,g[x]))return!0;for(var E=0;E<s.length;E++)if(rl(l,s[E]))return!0;for(var T=0;T<l.length;T++)if(Bc(s,l[T]))return!0;return!1}function bs(s,l,h){if(s.length>1){if(Bc(s,l))return!0;for(var g=0;g<l.length;g++)if(Iu(l[g],s,h))return!0}for(var x=0;x<s.length;x++)if(Iu(s[x],l,h))return!0;return!1}function Bc(s,l){if(s.length===0||l.length===0)return!1;for(var h=0;h<s.length-1;h++)for(var g=s[h],x=s[h+1],E=0;E<l.length-1;E++)if(sc(g,x,l[E],l[E+1]))return!0;return!1}function sc(s,l,h,g){return ke(s,h,g)!==ke(l,h,g)&&ke(s,l,h)!==ke(s,l,g)}function Iu(s,l,h){var g=h*h;if(l.length===1)return s.distSqr(l[0])<g;for(var x=1;x<l.length;x++)if(Dl(s,l[x-1],l[x])<g)return!0;return!1}function Dl(s,l,h){var g=l.distSqr(h);if(g===0)return s.distSqr(l);var x=((s.x-l.x)*(h.x-l.x)+(s.y-l.y)*(h.y-l.y))/g;return s.distSqr(x<0?l:x>1?h:h.sub(l)._mult(x)._add(l))}function rl(s,l){for(var h,g,x,E=!1,T=0;T<s.length;T++)for(var M=0,D=(h=s[T]).length-1;M<h.length;D=M++)(g=h[M]).y>l.y!=(x=h[D]).y>l.y&&l.x<(x.x-g.x)*(l.y-g.y)/(x.y-g.y)+g.x&&(E=!E);return E}function lu(s,l){for(var h=!1,g=0,x=s.length-1;g<s.length;x=g++){var E=s[g],T=s[x];E.y>l.y!=T.y>l.y&&l.x<(T.x-E.x)*(l.y-E.y)/(T.y-E.y)+E.x&&(h=!h)}return h}function Fl(s,l,h){var g=h[0],x=h[2];if(s.x<g.x&&l.x<g.x||s.x>x.x&&l.x>x.x||s.y<g.y&&l.y<g.y||s.y>x.y&&l.y>x.y)return!1;var E=ke(s,l,h[0]);return E!==ke(s,l,h[1])||E!==ke(s,l,h[2])||E!==ke(s,l,h[3])}function Ro(s,l,h){var g=l.paint.get(s).value;return g.kind==="constant"?g.value:h.programConfigurations.get(l.id).getMaxValue(s)}function Ma(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}function as(s,l,h,g,x){if(!l[0]&&!l[1])return s;var E=m.convert(l)._mult(x);h==="viewport"&&E._rotate(-g);for(var T=[],M=0;M<s.length;M++)T.push(s[M].sub(E));return T}Uo.prototype.populate=function(s,l,h){var g=this.layers[0],x=[],E=null;g.type==="circle"&&(E=g.layout.get("circle-sort-key"));for(var T=0,M=s;T<M.length;T+=1){var D=M[T],N=D.feature,$=D.id,H=D.index,q=D.sourceLayerIndex,re=this.layers[0]._featureFilter.needGeometry,xe=ba(N,re);if(this.layers[0]._featureFilter.filter(new Zn(this.zoom),xe,h)){var Se=E?E.evaluate(xe,{},h):void 0,ze={id:$,properties:N.properties,type:N.type,sourceLayerIndex:q,index:H,geometry:re?xe.geometry:_a(N),patterns:{},sortKey:Se};x.push(ze)}}E&&x.sort(function(kr,mn){return kr.sortKey-mn.sortKey});for(var Oe=0,et=x;Oe<et.length;Oe+=1){var ut=et[Oe],St=ut.geometry,It=ut.index,Xt=ut.sourceLayerIndex,Er=s[It].feature;this.addFeature(ut,St,It,h),l.featureIndex.insert(Er,St,It,Xt,this.index)}},Uo.prototype.update=function(s,l,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,l,this.stateDependentLayers,h)},Uo.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Uo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Uo.prototype.upload=function(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,ne),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0},Uo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Uo.prototype.addFeature=function(s,l,h,g){for(var x=0,E=l;x<E.length;x+=1)for(var T=0,M=E[x];T<M.length;T+=1){var D=M[T],N=D.x,$=D.y;if(!(N<0||N>=8192||$<0||$>=8192)){var H=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,s.sortKey),q=H.vertexLength;Yo(this.layoutVertexArray,N,$,-1,-1),Yo(this.layoutVertexArray,N,$,1,-1),Yo(this.layoutVertexArray,N,$,1,1),Yo(this.layoutVertexArray,N,$,-1,1),this.indexArray.emplaceBack(q,q+1,q+2),this.indexArray.emplaceBack(q,q+3,q+2),H.vertexLength+=4,H.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,h,{},g)},Kr("CircleBucket",Uo,{omit:["layers"]});var qs=new ga({"circle-sort-key":new nn(ie.layout_circle["circle-sort-key"])}),cu={paint:new ga({"circle-radius":new nn(ie.paint_circle["circle-radius"]),"circle-color":new nn(ie.paint_circle["circle-color"]),"circle-blur":new nn(ie.paint_circle["circle-blur"]),"circle-opacity":new nn(ie.paint_circle["circle-opacity"]),"circle-translate":new dn(ie.paint_circle["circle-translate"]),"circle-translate-anchor":new dn(ie.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new dn(ie.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new dn(ie.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new nn(ie.paint_circle["circle-stroke-width"]),"circle-stroke-color":new nn(ie.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new nn(ie.paint_circle["circle-stroke-opacity"])}),layout:qs},vi=typeof Float32Array<"u"?Float32Array:Array;function yo(s){return s[0]=1,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=1,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=1,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,s}function Va(s,l,h){var g=l[0],x=l[1],E=l[2],T=l[3],M=l[4],D=l[5],N=l[6],$=l[7],H=l[8],q=l[9],re=l[10],xe=l[11],Se=l[12],ze=l[13],Oe=l[14],et=l[15],ut=h[0],St=h[1],It=h[2],Xt=h[3];return s[0]=ut*g+St*M+It*H+Xt*Se,s[1]=ut*x+St*D+It*q+Xt*ze,s[2]=ut*E+St*N+It*re+Xt*Oe,s[3]=ut*T+St*$+It*xe+Xt*et,s[4]=(ut=h[4])*g+(St=h[5])*M+(It=h[6])*H+(Xt=h[7])*Se,s[5]=ut*x+St*D+It*q+Xt*ze,s[6]=ut*E+St*N+It*re+Xt*Oe,s[7]=ut*T+St*$+It*xe+Xt*et,s[8]=(ut=h[8])*g+(St=h[9])*M+(It=h[10])*H+(Xt=h[11])*Se,s[9]=ut*x+St*D+It*q+Xt*ze,s[10]=ut*E+St*N+It*re+Xt*Oe,s[11]=ut*T+St*$+It*xe+Xt*et,s[12]=(ut=h[12])*g+(St=h[13])*M+(It=h[14])*H+(Xt=h[15])*Se,s[13]=ut*x+St*D+It*q+Xt*ze,s[14]=ut*E+St*N+It*re+Xt*Oe,s[15]=ut*T+St*$+It*xe+Xt*et,s}Math.hypot||(Math.hypot=function(){for(var s=arguments,l=0,h=arguments.length;h--;)l+=s[h]*s[h];return Math.sqrt(l)});var Mu,Fh=Va;function Bl(s,l,h){var g=l[0],x=l[1],E=l[2],T=l[3];return s[0]=h[0]*g+h[4]*x+h[8]*E+h[12]*T,s[1]=h[1]*g+h[5]*x+h[9]*E+h[13]*T,s[2]=h[2]*g+h[6]*x+h[10]*E+h[14]*T,s[3]=h[3]*g+h[7]*x+h[11]*E+h[15]*T,s}Mu=new vi(3),vi!=Float32Array&&(Mu[0]=0,Mu[1]=0,Mu[2]=0),function(){var s=new vi(4);vi!=Float32Array&&(s[0]=0,s[1]=0,s[2]=0,s[3]=0)}();var Xp=(function(){var s=new vi(2);vi!=Float32Array&&(s[0]=0,s[1]=0)}(),function(s){function l(h){s.call(this,h,cu)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.createBucket=function(h){return new Uo(h)},l.prototype.queryRadius=function(h){var g=h;return Ro("circle-radius",this,g)+Ro("circle-stroke-width",this,g)+Ma(this.paint.get("circle-translate"))},l.prototype.queryIntersectsFeature=function(h,g,x,E,T,M,D,N){for(var $=as(h,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),M.angle,D),H=this.paint.get("circle-radius").evaluate(g,x)+this.paint.get("circle-stroke-width").evaluate(g,x),q=this.paint.get("circle-pitch-alignment")==="map",re=q?$:function(Er,kr){return Er.map(function(mn){return uc(mn,kr)})}($,N),xe=q?H*D:H,Se=0,ze=E;Se<ze.length;Se+=1)for(var Oe=0,et=ze[Se];Oe<et.length;Oe+=1){var ut=et[Oe],St=q?ut:uc(ut,N),It=xe,Xt=Bl([],[ut.x,ut.y,0,1],N);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?It*=Xt[3]/M.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(It*=M.cameraToCenterDistance/Xt[3]),Zo(re,St,It))return!0}return!1},l}(Xs));function uc(s,l){var h=Bl([],[s.x,s.y,0,1],l);return new m(h[0]/h[3],h[1]/h[3])}var lc=function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l}(Uo);function fu(s,l,h,g){var x=l.width,E=l.height;if(g){if(g instanceof Uint8ClampedArray)g=new Uint8Array(g.buffer);else if(g.length!==x*E*h)throw new RangeError("mismatched image size")}else g=new Uint8Array(x*E*h);return s.width=x,s.height=E,s.data=g,s}function Bh(s,l,h){var g=l.width,x=l.height;if(g!==s.width||x!==s.height){var E=fu({},{width:g,height:x},h);B0(s,E,{x:0,y:0},{x:0,y:0},{width:Math.min(s.width,g),height:Math.min(s.height,x)},h),s.width=g,s.height=x,s.data=E.data}}function B0(s,l,h,g,x,E){if(x.width===0||x.height===0)return l;if(x.width>s.width||x.height>s.height||h.x>s.width-x.width||h.y>s.height-x.height)throw new RangeError("out of range source coordinates for image copy");if(x.width>l.width||x.height>l.height||g.x>l.width-x.width||g.y>l.height-x.height)throw new RangeError("out of range destination coordinates for image copy");for(var T=s.data,M=l.data,D=0;D<x.height;D++)for(var N=((h.y+D)*s.width+h.x)*E,$=((g.y+D)*l.width+g.x)*E,H=0;H<x.width*E;H++)M[$+H]=T[N+H];return l}Kr("HeatmapBucket",lc,{omit:["layers"]});var Lc=function(s,l){fu(this,s,1,l)};Lc.prototype.resize=function(s){Bh(this,s,1)},Lc.prototype.clone=function(){return new Lc({width:this.width,height:this.height},new Uint8Array(this.data))},Lc.copy=function(s,l,h,g,x){B0(s,l,h,g,x,1)};var os=function(s,l){fu(this,s,4,l)};os.prototype.resize=function(s){Bh(this,s,4)},os.prototype.replace=function(s,l){l?this.data.set(s):this.data=s instanceof Uint8ClampedArray?new Uint8Array(s.buffer):s},os.prototype.clone=function(){return new os({width:this.width,height:this.height},new Uint8Array(this.data))},os.copy=function(s,l,h,g,x){B0(s,l,h,g,x,4)},Kr("AlphaImage",Lc),Kr("RGBAImage",os);var e2={paint:new ga({"heatmap-radius":new nn(ie.paint_heatmap["heatmap-radius"]),"heatmap-weight":new nn(ie.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new dn(ie.paint_heatmap["heatmap-intensity"]),"heatmap-color":new su(ie.paint_heatmap["heatmap-color"]),"heatmap-opacity":new dn(ie.paint_heatmap["heatmap-opacity"])})};function t2(s){var l={},h=s.resolution||256,g=s.clips?s.clips.length:1,x=s.image||new os({width:h,height:g}),E=function(xe,Se,ze){l[s.evaluationKey]=ze;var Oe=s.expression.evaluate(l);x.data[xe+Se+0]=Math.floor(255*Oe.r/Oe.a),x.data[xe+Se+1]=Math.floor(255*Oe.g/Oe.a),x.data[xe+Se+2]=Math.floor(255*Oe.b/Oe.a),x.data[xe+Se+3]=Math.floor(255*Oe.a)};if(s.clips)for(var T=0,M=0;T<g;++T,M+=4*h)for(var D=0,N=0;D<h;D++,N+=4){var $=D/(h-1),H=s.clips[T];E(M,N,H.start*(1-$)+H.end*$)}else for(var q=0,re=0;q<h;q++,re+=4)E(0,re,q/(h-1));return x}var Lh=function(s){function l(h){s.call(this,h,e2),this._updateColorRamp()}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.createBucket=function(h){return new lc(h)},l.prototype._handleSpecialPaintPropertyUpdate=function(h){h==="heatmap-color"&&this._updateColorRamp()},l.prototype._updateColorRamp=function(){this.colorRamp=t2({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},l.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},l.prototype.queryRadius=function(){return 0},l.prototype.queryIntersectsFeature=function(){return!1},l.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},l}(Xs),by={paint:new ga({"hillshade-illumination-direction":new dn(ie.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new dn(ie.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new dn(ie.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new dn(ie.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new dn(ie.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new dn(ie.paint_hillshade["hillshade-accent-color"])})},Ey=function(s){function l(h){s.call(this,h,by)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},l}(Xs),Sy=ao([{name:"a_pos",components:2,type:"Int16"}],4).members,Y1=Z1,Ay=Z1;function Z1(s,l,h){h=h||2;var g,x,E,T,M,D,N,$=l&&l.length,H=$?l[0]*h:s.length,q=r2(s,0,H,h,!0),re=[];if(!q||q.next===q.prev)return re;if($&&(q=function(Se,ze,Oe,et){var ut,St,It,Xt=[];for(ut=0,St=ze.length;ut<St;ut++)(It=r2(Se,ze[ut]*et,ut<St-1?ze[ut+1]*et:Se.length,et,!1))===It.next&&(It.steiner=!0),Xt.push(K1(It));for(Xt.sort(Iy),ut=0;ut<Xt.length;ut++)L0(Xt[ut],Oe),Oe=Nc(Oe,Oe.next);return Oe}(s,l,q,h)),s.length>80*h){g=E=s[0],x=T=s[1];for(var xe=h;xe<H;xe+=h)(M=s[xe])<g&&(g=M),(D=s[xe+1])<x&&(x=D),M>E&&(E=M),D>T&&(T=D);N=(N=Math.max(E-g,T-x))!==0?1/N:0}return Yp(q,re,h,g,x,N),re}function r2(s,l,h,g,x){var E,T;if(x===Uf(s,l,h,g)>0)for(E=l;E<h;E+=g)T=zh(E,s[E],s[E+1],T);else for(E=h-g;E>=l;E-=g)T=zh(E,s[E],s[E+1],T);return T&&Ff(T,T.next)&&(cc(T),T=T.next),T}function Nc(s,l){if(!s)return s;l||(l=s);var h,g=s;do if(h=!1,g.steiner||!Ff(g,g.next)&&Pa(g.prev,g,g.next)!==0)g=g.next;else{if(cc(g),(g=l=g.prev)===g.next)break;h=!0}while(h||g!==l);return l}function Yp(s,l,h,g,x,E,T){if(s){!T&&E&&function($,H,q,re){var xe=$;do xe.z===null&&(xe.z=Nh(xe.x,xe.y,H,q,re)),xe.prevZ=xe.prev,xe.nextZ=xe.next,xe=xe.next;while(xe!==$);xe.prevZ.nextZ=null,xe.prevZ=null,function(Se){var ze,Oe,et,ut,St,It,Xt,Er,kr=1;do{for(Oe=Se,Se=null,St=null,It=0;Oe;){for(It++,et=Oe,Xt=0,ze=0;ze<kr&&(Xt++,et=et.nextZ);ze++);for(Er=kr;Xt>0||Er>0&&et;)Xt!==0&&(Er===0||!et||Oe.z<=et.z)?(ut=Oe,Oe=Oe.nextZ,Xt--):(ut=et,et=et.nextZ,Er--),St?St.nextZ=ut:Se=ut,ut.prevZ=St,St=ut;Oe=et}St.nextZ=null,kr*=2}while(It>1)}(xe)}(s,g,x,E);for(var M,D,N=s;s.prev!==s.next;)if(M=s.prev,D=s.next,E?wy(s,g,x,E):Ty(s))l.push(M.i/h),l.push(s.i/h),l.push(D.i/h),cc(s),s=D.next,N=D.next;else if((s=D)===N){T?T===1?Yp(s=Cy(Nc(s),l,h),l,h,g,x,E,2):T===2&&Ry(s,l,h,g,x,E):Yp(Nc(s),l,h,g,x,E,1);break}}}function Ty(s){var l=s.prev,h=s,g=s.next;if(Pa(l,h,g)>=0)return!1;for(var x=s.next.next;x!==s.prev;){if(Uc(l.x,l.y,h.x,h.y,g.x,g.y,x.x,x.y)&&Pa(x.prev,x,x.next)>=0)return!1;x=x.next}return!0}function wy(s,l,h,g){var x=s.prev,E=s,T=s.next;if(Pa(x,E,T)>=0)return!1;for(var M=x.x>E.x?x.x>T.x?x.x:T.x:E.x>T.x?E.x:T.x,D=x.y>E.y?x.y>T.y?x.y:T.y:E.y>T.y?E.y:T.y,N=Nh(x.x<E.x?x.x<T.x?x.x:T.x:E.x<T.x?E.x:T.x,x.y<E.y?x.y<T.y?x.y:T.y:E.y<T.y?E.y:T.y,l,h,g),$=Nh(M,D,l,h,g),H=s.prevZ,q=s.nextZ;H&&H.z>=N&&q&&q.z<=$;){if(H!==s.prev&&H!==s.next&&Uc(x.x,x.y,E.x,E.y,T.x,T.y,H.x,H.y)&&Pa(H.prev,H,H.next)>=0||(H=H.prevZ,q!==s.prev&&q!==s.next&&Uc(x.x,x.y,E.x,E.y,T.x,T.y,q.x,q.y)&&Pa(q.prev,q,q.next)>=0))return!1;q=q.nextZ}for(;H&&H.z>=N;){if(H!==s.prev&&H!==s.next&&Uc(x.x,x.y,E.x,E.y,T.x,T.y,H.x,H.y)&&Pa(H.prev,H,H.next)>=0)return!1;H=H.prevZ}for(;q&&q.z<=$;){if(q!==s.prev&&q!==s.next&&Uc(x.x,x.y,E.x,E.y,T.x,T.y,q.x,q.y)&&Pa(q.prev,q,q.next)>=0)return!1;q=q.nextZ}return!0}function Cy(s,l,h){var g=s;do{var x=g.prev,E=g.next.next;!Ff(x,E)&&J1(x,g,g.next,E)&&zc(x,E)&&zc(E,x)&&(l.push(x.i/h),l.push(g.i/h),l.push(E.i/h),cc(g),cc(g.next),g=s=E),g=g.next}while(g!==s);return Nc(g)}function Ry(s,l,h,g,x,E){var T=s;do{for(var M=T.next.next;M!==T.prev;){if(T.i!==M.i&&Q1(T,M)){var D=Uh(T,M);return T=Nc(T,T.next),D=Nc(D,D.next),Yp(T,l,h,g,x,E),void Yp(D,l,h,g,x,E)}M=M.next}T=T.next}while(T!==s)}function Iy(s,l){return s.x-l.x}function L0(s,l){if(l=function(g,x){var E,T=x,M=g.x,D=g.y,N=-1/0;do{if(D<=T.y&&D>=T.next.y&&T.next.y!==T.y){var $=T.x+(D-T.y)*(T.next.x-T.x)/(T.next.y-T.y);if($<=M&&$>N){if(N=$,$===M){if(D===T.y)return T;if(D===T.next.y)return T.next}E=T.x<T.next.x?T:T.next}}T=T.next}while(T!==x);if(!E)return null;if(M===N)return E;var H,q=E,re=E.x,xe=E.y,Se=1/0;T=E;do M>=T.x&&T.x>=re&&M!==T.x&&Uc(D<xe?M:N,D,re,xe,D<xe?N:M,D,T.x,T.y)&&(H=Math.abs(D-T.y)/(M-T.x),zc(T,g)&&(H<Se||H===Se&&(T.x>E.x||T.x===E.x&&q1(E,T)))&&(E=T,Se=H)),T=T.next;while(T!==q);return E}(s,l)){var h=Uh(l,s);Nc(l,l.next),Nc(h,h.next)}}function q1(s,l){return Pa(s.prev,s,l.prev)<0&&Pa(l.next,s,s.next)<0}function Nh(s,l,h,g,x){return(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=32767*(s-h)*x)|s<<8))|s<<4))|s<<2))|s<<1))|(l=1431655765&((l=858993459&((l=252645135&((l=16711935&((l=32767*(l-g)*x)|l<<8))|l<<4))|l<<2))|l<<1))<<1}function K1(s){var l=s,h=s;do(l.x<h.x||l.x===h.x&&l.y<h.y)&&(h=l),l=l.next;while(l!==s);return h}function Uc(s,l,h,g,x,E,T,M){return(x-T)*(l-M)-(s-T)*(E-M)>=0&&(s-T)*(g-M)-(h-T)*(l-M)>=0&&(h-T)*(E-M)-(x-T)*(g-M)>=0}function Q1(s,l){return s.next.i!==l.i&&s.prev.i!==l.i&&!function(h,g){var x=h;do{if(x.i!==h.i&&x.next.i!==h.i&&x.i!==g.i&&x.next.i!==g.i&&J1(x,x.next,h,g))return!0;x=x.next}while(x!==h);return!1}(s,l)&&(zc(s,l)&&zc(l,s)&&function(h,g){var x=h,E=!1,T=(h.x+g.x)/2,M=(h.y+g.y)/2;do x.y>M!=x.next.y>M&&x.next.y!==x.y&&T<(x.next.x-x.x)*(M-x.y)/(x.next.y-x.y)+x.x&&(E=!E),x=x.next;while(x!==h);return E}(s,l)&&(Pa(s.prev,s,l.prev)||Pa(s,l.prev,l))||Ff(s,l)&&Pa(s.prev,s,s.next)>0&&Pa(l.prev,l,l.next)>0)}function Pa(s,l,h){return(l.y-s.y)*(h.x-l.x)-(l.x-s.x)*(h.y-l.y)}function Ff(s,l){return s.x===l.x&&s.y===l.y}function J1(s,l,h,g){var x=Lf(Pa(s,l,h)),E=Lf(Pa(s,l,g)),T=Lf(Pa(h,g,s)),M=Lf(Pa(h,g,l));return x!==E&&T!==M||!(x!==0||!Bf(s,h,l))||!(E!==0||!Bf(s,g,l))||!(T!==0||!Bf(h,s,g))||!(M!==0||!Bf(h,l,g))}function Bf(s,l,h){return l.x<=Math.max(s.x,h.x)&&l.x>=Math.min(s.x,h.x)&&l.y<=Math.max(s.y,h.y)&&l.y>=Math.min(s.y,h.y)}function Lf(s){return s>0?1:s<0?-1:0}function zc(s,l){return Pa(s.prev,s,s.next)<0?Pa(s,l,s.next)>=0&&Pa(s,s.prev,l)>=0:Pa(s,l,s.prev)<0||Pa(s,s.next,l)<0}function Uh(s,l){var h=new Nf(s.i,s.x,s.y),g=new Nf(l.i,l.x,l.y),x=s.next,E=l.prev;return s.next=l,l.prev=s,h.next=x,x.prev=h,g.next=h,h.prev=g,E.next=g,g.prev=E,g}function zh(s,l,h,g){var x=new Nf(s,l,h);return g?(x.next=g.next,x.prev=g,g.next.prev=x,g.next=x):(x.prev=x,x.next=x),x}function cc(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function Nf(s,l,h){this.i=s,this.x=l,this.y=h,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Uf(s,l,h,g){for(var x=0,E=l,T=h-g;E<h;E+=g)x+=(s[T]-s[E])*(s[E+1]+s[T+1]),T=E;return x}function n2(s,l,h,g,x){(function E(T,M,D,N,$){for(;N>D;){if(N-D>600){var H=N-D+1,q=M-D+1,re=Math.log(H),xe=.5*Math.exp(2*re/3),Se=.5*Math.sqrt(re*xe*(H-xe)/H)*(q-H/2<0?-1:1);E(T,M,Math.max(D,Math.floor(M-q*xe/H+Se)),Math.min(N,Math.floor(M+(H-q)*xe/H+Se)),$)}var ze=T[M],Oe=D,et=N;for(fc(T,D,M),$(T[N],ze)>0&&fc(T,D,N);Oe<et;){for(fc(T,Oe,et),Oe++,et--;$(T[Oe],ze)<0;)Oe++;for(;$(T[et],ze)>0;)et--}$(T[D],ze)===0?fc(T,D,et):fc(T,++et,N),et<=M&&(D=et+1),M<=et&&(N=et-1)}})(s,l,h||0,g||s.length-1,x||zf)}function fc(s,l,h){var g=s[l];s[l]=s[h],s[h]=g}function zf(s,l){return s<l?-1:s>l?1:0}function ed(s,l){var h=s.length;if(h<=1)return[s];for(var g,x,E=[],T=0;T<h;T++){var M=Rt(s[T]);M!==0&&(s[T].area=Math.abs(M),x===void 0&&(x=M<0),x===M<0?(g&&E.push(g),g=[s[T]]):g.push(s[T]))}if(g&&E.push(g),l>1)for(var D=0;D<E.length;D++)E[D].length<=l||(n2(E[D],l,1,E[D].length-1,N0),E[D]=E[D].slice(0,l));return E}function N0(s,l){return l.area-s.area}function U0(s,l,h){for(var g=h.patternDependencies,x=!1,E=0,T=l;E<T.length;E+=1){var M=T[E].paint.get(s+"-pattern");M.isConstant()||(x=!0);var D=M.constantOr(null);D&&(x=!0,g[D.to]=!0,g[D.from]=!0)}return x}function z0(s,l,h,g,x){for(var E=x.patternDependencies,T=0,M=l;T<M.length;T+=1){var D=M[T],N=D.paint.get(s+"-pattern").value;if(N.kind!=="constant"){var $=N.evaluate({zoom:g-1},h,{},x.availableImages),H=N.evaluate({zoom:g},h,{},x.availableImages),q=N.evaluate({zoom:g+1},h,{},x.availableImages);H=H&&H.name?H.name:H,q=q&&q.name?q.name:q,E[$=$&&$.name?$.name:$]=!0,E[H]=!0,E[q]=!0,h.patterns[D.id]={min:$,mid:H,max:q}}}return h}Z1.deviation=function(s,l,h,g){var x=l&&l.length,E=Math.abs(Uf(s,0,x?l[0]*h:s.length,h));if(x)for(var T=0,M=l.length;T<M;T++)E-=Math.abs(Uf(s,l[T]*h,T<M-1?l[T+1]*h:s.length,h));var D=0;for(T=0;T<g.length;T+=3){var N=g[T]*h,$=g[T+1]*h,H=g[T+2]*h;D+=Math.abs((s[N]-s[H])*(s[$+1]-s[N+1])-(s[N]-s[$])*(s[H+1]-s[N+1]))}return E===0&&D===0?0:Math.abs((D-E)/E)},Z1.flatten=function(s){for(var l=s[0][0].length,h={vertices:[],holes:[],dimensions:l},g=0,x=0;x<s.length;x++){for(var E=0;E<s[x].length;E++)for(var T=0;T<l;T++)h.vertices.push(s[x][E][T]);x>0&&h.holes.push(g+=s[x-1].length)}return h},Y1.default=Ay;var nl=function(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(function(l){return l.id}),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ol,this.indexArray=new Cu,this.indexArray2=new Df,this.programConfigurations=new In(s.layers,s.zoom),this.segments=new ae,this.segments2=new ae,this.stateDependentLayerIds=this.layers.filter(function(l){return l.isStateDependent()}).map(function(l){return l.id})};nl.prototype.populate=function(s,l,h){this.hasPattern=U0("fill",this.layers,l);for(var g=this.layers[0].layout.get("fill-sort-key"),x=[],E=0,T=s;E<T.length;E+=1){var M=T[E],D=M.feature,N=M.id,$=M.index,H=M.sourceLayerIndex,q=this.layers[0]._featureFilter.needGeometry,re=ba(D,q);if(this.layers[0]._featureFilter.filter(new Zn(this.zoom),re,h)){var xe=g?g.evaluate(re,{},h,l.availableImages):void 0,Se={id:N,properties:D.properties,type:D.type,sourceLayerIndex:H,index:$,geometry:q?re.geometry:_a(D),patterns:{},sortKey:xe};x.push(Se)}}g&&x.sort(function(Er,kr){return Er.sortKey-kr.sortKey});for(var ze=0,Oe=x;ze<Oe.length;ze+=1){var et=Oe[ze],ut=et.geometry,St=et.index,It=et.sourceLayerIndex;if(this.hasPattern){var Xt=z0("fill",this.layers,et,this.zoom,l);this.patternFeatures.push(Xt)}else this.addFeature(et,ut,St,h,{});l.featureIndex.insert(s[St].feature,ut,St,It,this.index)}},nl.prototype.update=function(s,l,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,l,this.stateDependentLayers,h)},nl.prototype.addFeatures=function(s,l,h){for(var g=0,x=this.patternFeatures;g<x.length;g+=1){var E=x[g];this.addFeature(E,E.geometry,E.index,l,h)}},nl.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},nl.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},nl.prototype.upload=function(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,Sy),this.indexBuffer=s.createIndexBuffer(this.indexArray),this.indexBuffer2=s.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(s),this.uploaded=!0},nl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},nl.prototype.addFeature=function(s,l,h,g,x){for(var E=0,T=ed(l,500);E<T.length;E+=1){for(var M=T[E],D=0,N=0,$=M;N<$.length;N+=1)D+=$[N].length;for(var H=this.segments.prepareSegment(D,this.layoutVertexArray,this.indexArray),q=H.vertexLength,re=[],xe=[],Se=0,ze=M;Se<ze.length;Se+=1){var Oe=ze[Se];if(Oe.length!==0){Oe!==M[0]&&xe.push(re.length/2);var et=this.segments2.prepareSegment(Oe.length,this.layoutVertexArray,this.indexArray2),ut=et.vertexLength;this.layoutVertexArray.emplaceBack(Oe[0].x,Oe[0].y),this.indexArray2.emplaceBack(ut+Oe.length-1,ut),re.push(Oe[0].x),re.push(Oe[0].y);for(var St=1;St<Oe.length;St++)this.layoutVertexArray.emplaceBack(Oe[St].x,Oe[St].y),this.indexArray2.emplaceBack(ut+St-1,ut+St),re.push(Oe[St].x),re.push(Oe[St].y);et.vertexLength+=Oe.length,et.primitiveLength+=Oe.length}}for(var It=Y1(re,xe),Xt=0;Xt<It.length;Xt+=3)this.indexArray.emplaceBack(q+It[Xt],q+It[Xt+1],q+It[Xt+2]);H.vertexLength+=D,H.primitiveLength+=It.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,h,x,g)},Kr("FillBucket",nl,{omit:["layers","patternFeatures"]});var $c=new ga({"fill-sort-key":new nn(ie.layout_fill["fill-sort-key"])}),i2={paint:new ga({"fill-antialias":new dn(ie.paint_fill["fill-antialias"]),"fill-opacity":new nn(ie.paint_fill["fill-opacity"]),"fill-color":new nn(ie.paint_fill["fill-color"]),"fill-outline-color":new nn(ie.paint_fill["fill-outline-color"]),"fill-translate":new dn(ie.paint_fill["fill-translate"]),"fill-translate-anchor":new dn(ie.paint_fill["fill-translate-anchor"]),"fill-pattern":new ys(ie.paint_fill["fill-pattern"])}),layout:$c},a2=function(s){function l(h){s.call(this,h,i2)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.recalculate=function(h,g){s.prototype.recalculate.call(this,h,g);var x=this.paint._values["fill-outline-color"];x.value.kind==="constant"&&x.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},l.prototype.createBucket=function(h){return new nl(h)},l.prototype.queryRadius=function(){return Ma(this.paint.get("fill-translate"))},l.prototype.queryIntersectsFeature=function(h,g,x,E,T,M,D){return Zs(as(h,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),M.angle,D),E)},l.prototype.isTileClipped=function(){return!0},l}(Xs),o2=ao([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,s2=$f;function $f(s,l,h,g,x){this.properties={},this.extent=h,this.type=0,this._pbf=s,this._geometry=-1,this._keys=g,this._values=x,s.readFields(My,this,l)}function My(s,l,h){s==1?l.id=h.readVarint():s==2?function(g,x){for(var E=g.readVarint()+g.pos;g.pos<E;){var T=x._keys[g.readVarint()],M=x._values[g.readVarint()];x.properties[T]=M}}(h,l):s==3?l.type=h.readVarint():s==4&&(l._geometry=h.pos)}function Ll(s){for(var l,h,g=0,x=0,E=s.length,T=E-1;x<E;T=x++)g+=((h=s[T]).x-(l=s[x]).x)*(l.y+h.y);return g}$f.types=["Unknown","Point","LineString","Polygon"],$f.prototype.loadGeometry=function(){var s=this._pbf;s.pos=this._geometry;for(var l,h=s.readVarint()+s.pos,g=1,x=0,E=0,T=0,M=[];s.pos<h;){if(x<=0){var D=s.readVarint();g=7&D,x=D>>3}if(x--,g===1||g===2)E+=s.readSVarint(),T+=s.readSVarint(),g===1&&(l&&M.push(l),l=[]),l.push(new m(E,T));else{if(g!==7)throw new Error("unknown command "+g);l&&l.push(l[0].clone())}}return l&&M.push(l),M},$f.prototype.bbox=function(){var s=this._pbf;s.pos=this._geometry;for(var l=s.readVarint()+s.pos,h=1,g=0,x=0,E=0,T=1/0,M=-1/0,D=1/0,N=-1/0;s.pos<l;){if(g<=0){var $=s.readVarint();h=7&$,g=$>>3}if(g--,h===1||h===2)(x+=s.readSVarint())<T&&(T=x),x>M&&(M=x),(E+=s.readSVarint())<D&&(D=E),E>N&&(N=E);else if(h!==7)throw new Error("unknown command "+h)}return[T,D,M,N]},$f.prototype.toGeoJSON=function(s,l,h){var g,x,E=this.extent*Math.pow(2,h),T=this.extent*s,M=this.extent*l,D=this.loadGeometry(),N=$f.types[this.type];function $(re){for(var xe=0;xe<re.length;xe++){var Se=re[xe];re[xe]=[360*(Se.x+T)/E-180,360/Math.PI*Math.atan(Math.exp((180-360*(Se.y+M)/E)*Math.PI/180))-90]}}switch(this.type){case 1:var H=[];for(g=0;g<D.length;g++)H[g]=D[g][0];$(D=H);break;case 2:for(g=0;g<D.length;g++)$(D[g]);break;case 3:for(D=function(re){var xe=re.length;if(xe<=1)return[re];for(var Se,ze,Oe=[],et=0;et<xe;et++){var ut=Ll(re[et]);ut!==0&&(ze===void 0&&(ze=ut<0),ze===ut<0?(Se&&Oe.push(Se),Se=[re[et]]):Se.push(re[et]))}return Se&&Oe.push(Se),Oe}(D),g=0;g<D.length;g++)for(x=0;x<D[g].length;x++)$(D[g][x])}D.length===1?D=D[0]:N="Multi"+N;var q={type:"Feature",geometry:{type:N,coordinates:D},properties:this.properties};return"id"in this&&(q.id=this.id),q};var $0=Vf;function Vf(s,l){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=s,this._keys=[],this._values=[],this._features=[],s.readFields(Vc,this,l),this.length=this._features.length}function Vc(s,l,h){s===15?l.version=h.readVarint():s===1?l.name=h.readString():s===5?l.extent=h.readVarint():s===2?l._features.push(h.pos):s===3?l._keys.push(h.readString()):s===4&&l._values.push(function(g){for(var x=null,E=g.readVarint()+g.pos;g.pos<E;){var T=g.readVarint()>>3;x=T===1?g.readString():T===2?g.readFloat():T===3?g.readDouble():T===4?g.readVarint64():T===5?g.readVarint():T===6?g.readSVarint():T===7?g.readBoolean():null}return x}(h))}function u2(s,l,h){if(s===3){var g=new $0(h,h.readVarint()+h.pos);g.length&&(l[g.name]=g)}}Vf.prototype.feature=function(s){if(s<0||s>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[s];var l=this._pbf.readVarint()+this._pbf.pos;return new s2(this._pbf,l,this.extent,this._keys,this._values)};var jc={VectorTile:function(s,l){this.layers=s.readFields(u2,{},l)},VectorTileFeature:s2,VectorTileLayer:$0},td=jc.VectorTileFeature.types,rd=Math.pow(2,13);function ss(s,l,h,g,x,E,T,M){s.emplaceBack(l,h,2*Math.floor(g*rd)+T,x*rd*2,E*rd*2,Math.round(M))}var qo=function(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(function(l){return l.id}),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new tl,this.indexArray=new Cu,this.programConfigurations=new In(s.layers,s.zoom),this.segments=new ae,this.stateDependentLayerIds=this.layers.filter(function(l){return l.isStateDependent()}).map(function(l){return l.id})};function so(s,l){return s.x===l.x&&(s.x<0||s.x>8192)||s.y===l.y&&(s.y<0||s.y>8192)}qo.prototype.populate=function(s,l,h){this.features=[],this.hasPattern=U0("fill-extrusion",this.layers,l);for(var g=0,x=s;g<x.length;g+=1){var E=x[g],T=E.feature,M=E.id,D=E.index,N=E.sourceLayerIndex,$=this.layers[0]._featureFilter.needGeometry,H=ba(T,$);if(this.layers[0]._featureFilter.filter(new Zn(this.zoom),H,h)){var q={id:M,sourceLayerIndex:N,index:D,geometry:$?H.geometry:_a(T),properties:T.properties,type:T.type,patterns:{}};this.hasPattern?this.features.push(z0("fill-extrusion",this.layers,q,this.zoom,l)):this.addFeature(q,q.geometry,D,h,{}),l.featureIndex.insert(T,q.geometry,D,N,this.index,!0)}}},qo.prototype.addFeatures=function(s,l,h){for(var g=0,x=this.features;g<x.length;g+=1){var E=x[g];this.addFeature(E,E.geometry,E.index,l,h)}},qo.prototype.update=function(s,l,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,l,this.stateDependentLayers,h)},qo.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},qo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},qo.prototype.upload=function(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,o2),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0},qo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},qo.prototype.addFeature=function(s,l,h,g,x){for(var E=0,T=ed(l,500);E<T.length;E+=1){for(var M=T[E],D=0,N=0,$=M;N<$.length;N+=1)D+=$[N].length;for(var H=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),q=0,re=M;q<re.length;q+=1){var xe=re[q];if(xe.length!==0&&!((di=xe).every(function(Qn){return Qn.x<0})||di.every(function(Qn){return Qn.x>8192})||di.every(function(Qn){return Qn.y<0})||di.every(function(Qn){return Qn.y>8192})))for(var Se=0,ze=0;ze<xe.length;ze++){var Oe=xe[ze];if(ze>=1){var et=xe[ze-1];if(!so(Oe,et)){H.vertexLength+4>ae.MAX_VERTEX_ARRAY_LENGTH&&(H=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var ut=Oe.sub(et)._perp()._unit(),St=et.dist(Oe);Se+St>32768&&(Se=0),ss(this.layoutVertexArray,Oe.x,Oe.y,ut.x,ut.y,0,0,Se),ss(this.layoutVertexArray,Oe.x,Oe.y,ut.x,ut.y,0,1,Se),ss(this.layoutVertexArray,et.x,et.y,ut.x,ut.y,0,0,Se+=St),ss(this.layoutVertexArray,et.x,et.y,ut.x,ut.y,0,1,Se);var It=H.vertexLength;this.indexArray.emplaceBack(It,It+2,It+1),this.indexArray.emplaceBack(It+1,It+2,It+3),H.vertexLength+=4,H.primitiveLength+=2}}}}if(H.vertexLength+D>ae.MAX_VERTEX_ARRAY_LENGTH&&(H=this.segments.prepareSegment(D,this.layoutVertexArray,this.indexArray)),td[s.type]==="Polygon"){for(var Xt=[],Er=[],kr=H.vertexLength,mn=0,Gr=M;mn<Gr.length;mn+=1){var An=Gr[mn];if(An.length!==0){An!==M[0]&&Er.push(Xt.length/2);for(var Zr=0;Zr<An.length;Zr++){var li=An[Zr];ss(this.layoutVertexArray,li.x,li.y,0,0,1,1,0),Xt.push(li.x),Xt.push(li.y)}}}for(var Ln=Y1(Xt,Er),sn=0;sn<Ln.length;sn+=3)this.indexArray.emplaceBack(kr+Ln[sn],kr+Ln[sn+2],kr+Ln[sn+1]);H.primitiveLength+=Ln.length/3,H.vertexLength+=D}}var di;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,h,x,g)},Kr("FillExtrusionBucket",qo,{omit:["layers","features"]});var Ks={paint:new ga({"fill-extrusion-opacity":new dn(ie["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new nn(ie["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new dn(ie["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new dn(ie["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ys(ie["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new nn(ie["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new nn(ie["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new dn(ie["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},l2=function(s){function l(h){s.call(this,h,Ks)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.createBucket=function(h){return new qo(h)},l.prototype.queryRadius=function(){return Ma(this.paint.get("fill-extrusion-translate"))},l.prototype.is3D=function(){return!0},l.prototype.queryIntersectsFeature=function(h,g,x,E,T,M,D,N){var $=as(h,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),M.angle,D),H=this.paint.get("fill-extrusion-height").evaluate(g,x),q=this.paint.get("fill-extrusion-base").evaluate(g,x),re=function(Se,ze,Oe,et){for(var ut=[],St=0,It=Se;St<It.length;St+=1){var Xt=It[St],Er=[Xt.x,Xt.y,0,1];Bl(Er,Er,ze),ut.push(new m(Er[0]/Er[3],Er[1]/Er[3]))}return ut}($,N),xe=function(Se,ze,Oe,et){for(var ut=[],St=[],It=et[8]*ze,Xt=et[9]*ze,Er=et[10]*ze,kr=et[11]*ze,mn=et[8]*Oe,Gr=et[9]*Oe,An=et[10]*Oe,Zr=et[11]*Oe,li=0,Ln=Se;li<Ln.length;li+=1){for(var sn=[],di=[],Qn=0,Pi=Ln[li];Qn<Pi.length;Qn+=1){var Tn=Pi[Qn],zi=Tn.x,Sa=Tn.y,Na=et[0]*zi+et[4]*Sa+et[12],Fa=et[1]*zi+et[5]*Sa+et[13],Aa=et[2]*zi+et[6]*Sa+et[14],Ua=et[3]*zi+et[7]*Sa+et[15],Mo=Aa+Er,Po=Ua+kr,Es=Na+mn,Vo=Fa+Gr,Ss=Aa+An,Wa=Ua+Zr,jo=new m((Na+It)/Po,(Fa+Xt)/Po);jo.z=Mo/Po,sn.push(jo);var xi=new m(Es/Wa,Vo/Wa);xi.z=Ss/Wa,di.push(xi)}ut.push(sn),St.push(di)}return[ut,St]}(E,q,H,N);return function(Se,ze,Oe){var et=1/0;Zs(Oe,ze)&&(et=c2(Oe,ze[0]));for(var ut=0;ut<ze.length;ut++)for(var St=ze[ut],It=Se[ut],Xt=0;Xt<St.length-1;Xt++){var Er=St[Xt],kr=[Er,St[Xt+1],It[Xt+1],It[Xt],Er];Ru(Oe,kr)&&(et=Math.min(et,c2(Oe,kr)))}return et!==1/0&&et}(xe[0],xe[1],re)},l}(Xs);function Zp(s,l){return s.x*l.x+s.y*l.y}function c2(s,l){if(s.length===1){for(var h,g=0,x=l[g++];!h||x.equals(h);)if(!(h=l[g++]))return 1/0;for(;g<l.length;g++){var E=l[g],T=s[0],M=h.sub(x),D=E.sub(x),N=T.sub(x),$=Zp(M,M),H=Zp(M,D),q=Zp(D,D),re=Zp(N,M),xe=Zp(N,D),Se=$*q-H*H,ze=(q*re-H*xe)/Se,Oe=($*xe-H*re)/Se,et=x.z*(1-ze-Oe)+h.z*ze+E.z*Oe;if(isFinite(et))return et}return 1/0}for(var ut=1/0,St=0,It=l;St<It.length;St+=1)ut=Math.min(ut,It[St].z);return ut}var Py=ao([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Oy=ao([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,f2=jc.VectorTileFeature.types,ky=Math.cos(Math.PI/180*37.5),h2=Math.pow(2,14)/.5,us=function(s){var l=this;this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(function(h){return h.id}),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(h){l.gradients[h.id]={}}),this.layoutVertexArray=new xs,this.layoutVertexArray2=new Dc,this.indexArray=new Cu,this.programConfigurations=new In(s.layers,s.zoom),this.segments=new ae,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(h){return h.isStateDependent()}).map(function(h){return h.id})};us.prototype.populate=function(s,l,h){this.hasPattern=U0("line",this.layers,l);for(var g=this.layers[0].layout.get("line-sort-key"),x=[],E=0,T=s;E<T.length;E+=1){var M=T[E],D=M.feature,N=M.id,$=M.index,H=M.sourceLayerIndex,q=this.layers[0]._featureFilter.needGeometry,re=ba(D,q);if(this.layers[0]._featureFilter.filter(new Zn(this.zoom),re,h)){var xe=g?g.evaluate(re,{},h):void 0,Se={id:N,properties:D.properties,type:D.type,sourceLayerIndex:H,index:$,geometry:q?re.geometry:_a(D),patterns:{},sortKey:xe};x.push(Se)}}g&&x.sort(function(Er,kr){return Er.sortKey-kr.sortKey});for(var ze=0,Oe=x;ze<Oe.length;ze+=1){var et=Oe[ze],ut=et.geometry,St=et.index,It=et.sourceLayerIndex;if(this.hasPattern){var Xt=z0("line",this.layers,et,this.zoom,l);this.patternFeatures.push(Xt)}else this.addFeature(et,ut,St,h,{});l.featureIndex.insert(s[St].feature,ut,St,It,this.index)}},us.prototype.update=function(s,l,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,l,this.stateDependentLayers,h)},us.prototype.addFeatures=function(s,l,h){for(var g=0,x=this.patternFeatures;g<x.length;g+=1){var E=x[g];this.addFeature(E,E.geometry,E.index,l,h)}},us.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},us.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},us.prototype.upload=function(s){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=s.createVertexBuffer(this.layoutVertexArray2,Oy)),this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,Py),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0},us.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},us.prototype.lineFeatureClips=function(s){if(s.properties&&s.properties.hasOwnProperty("mapbox_clip_start")&&s.properties.hasOwnProperty("mapbox_clip_end"))return{start:+s.properties.mapbox_clip_start,end:+s.properties.mapbox_clip_end}},us.prototype.addFeature=function(s,l,h,g,x){var E=this.layers[0].layout,T=E.get("line-join").evaluate(s,{}),M=E.get("line-cap"),D=E.get("line-miter-limit"),N=E.get("line-round-limit");this.lineClips=this.lineFeatureClips(s);for(var $=0,H=l;$<H.length;$+=1)this.addLine(H[$],s,T,M,D,N);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,h,x,g)},us.prototype.addLine=function(s,l,h,g,x,E){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var T=0;T<s.length-1;T++)this.totalDistance+=s[T].dist(s[T+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var M=f2[l.type]==="Polygon",D=s.length;D>=2&&s[D-1].equals(s[D-2]);)D--;for(var N=0;N<D-1&&s[N].equals(s[N+1]);)N++;if(!(D<(M?3:2))){h==="bevel"&&(x=1.05);var $,H=this.overscaling<=16?122880/(512*this.overscaling):0,q=this.segments.prepareSegment(10*D,this.layoutVertexArray,this.indexArray),re=void 0,xe=void 0,Se=void 0,ze=void 0;this.e1=this.e2=-1,M&&(ze=s[N].sub($=s[D-2])._unit()._perp());for(var Oe=N;Oe<D;Oe++)if(!(xe=Oe===D-1?M?s[N+1]:void 0:s[Oe+1])||!s[Oe].equals(xe)){ze&&(Se=ze),$&&(re=$),$=s[Oe],ze=xe?xe.sub($)._unit()._perp():Se;var et=(Se=Se||ze).add(ze);et.x===0&&et.y===0||et._unit();var ut=Se.x*ze.x+Se.y*ze.y,St=et.x*ze.x+et.y*ze.y,It=St!==0?1/St:1/0,Xt=2*Math.sqrt(2-2*St),Er=St<ky&&re&&xe,kr=Se.x*ze.y-Se.y*ze.x>0;if(Er&&Oe>N){var mn=$.dist(re);if(mn>2*H){var Gr=$.sub($.sub(re)._mult(H/mn)._round());this.updateDistance(re,Gr),this.addCurrentVertex(Gr,Se,0,0,q),re=Gr}}var An=re&&xe,Zr=An?h:M?"butt":g;if(An&&Zr==="round"&&(It<E?Zr="miter":It<=2&&(Zr="fakeround")),Zr==="miter"&&It>x&&(Zr="bevel"),Zr==="bevel"&&(It>2&&(Zr="flipbevel"),It<x&&(Zr="miter")),re&&this.updateDistance(re,$),Zr==="miter")et._mult(It),this.addCurrentVertex($,et,0,0,q);else if(Zr==="flipbevel"){if(It>100)et=ze.mult(-1);else{var li=It*Se.add(ze).mag()/Se.sub(ze).mag();et._perp()._mult(li*(kr?-1:1))}this.addCurrentVertex($,et,0,0,q),this.addCurrentVertex($,et.mult(-1),0,0,q)}else if(Zr==="bevel"||Zr==="fakeround"){var Ln=-Math.sqrt(It*It-1),sn=kr?Ln:0,di=kr?0:Ln;if(re&&this.addCurrentVertex($,Se,sn,di,q),Zr==="fakeround")for(var Qn=Math.round(180*Xt/Math.PI/20),Pi=1;Pi<Qn;Pi++){var Tn=Pi/Qn;if(Tn!==.5){var zi=Tn-.5;Tn+=Tn*zi*(Tn-1)*((1.0904+ut*(ut*(3.55645-1.43519*ut)-3.2452))*zi*zi+(.848013+ut*(.215638*ut-1.06021)))}var Sa=ze.sub(Se)._mult(Tn)._add(Se)._unit()._mult(kr?-1:1);this.addHalfVertex($,Sa.x,Sa.y,!1,kr,0,q)}xe&&this.addCurrentVertex($,ze,-sn,-di,q)}else if(Zr==="butt")this.addCurrentVertex($,et,0,0,q);else if(Zr==="square"){var Na=re?1:-1;this.addCurrentVertex($,et,Na,Na,q)}else Zr==="round"&&(re&&(this.addCurrentVertex($,Se,0,0,q),this.addCurrentVertex($,Se,1,1,q,!0)),xe&&(this.addCurrentVertex($,ze,-1,-1,q,!0),this.addCurrentVertex($,ze,0,0,q)));if(Er&&Oe<D-1){var Fa=$.dist(xe);if(Fa>2*H){var Aa=$.add(xe.sub($)._mult(H/Fa)._round());this.updateDistance($,Aa),this.addCurrentVertex(Aa,ze,0,0,q),$=Aa}}}}},us.prototype.addCurrentVertex=function(s,l,h,g,x,E){E===void 0&&(E=!1);var T=l.y*g-l.x,M=-l.y-l.x*g;this.addHalfVertex(s,l.x+l.y*h,l.y-l.x*h,E,!1,h,x),this.addHalfVertex(s,T,M,E,!0,-g,x),this.distance>h2/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(s,l,h,g,x,E))},us.prototype.addHalfVertex=function(s,l,h,g,x,E,T){var M=.5*(this.lineClips?this.scaledDistance*(h2-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((s.x<<1)+(g?1:0),(s.y<<1)+(x?1:0),Math.round(63*l)+128,Math.round(63*h)+128,1+(E===0?0:E<0?-1:1)|(63&M)<<2,M>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var D=T.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,D),T.primitiveLength++),x?this.e2=D:this.e1=D},us.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},us.prototype.updateDistance=function(s,l){this.distance+=s.dist(l),this.updateScaledDistance()},Kr("LineBucket",us,{omit:["layers","patternFeatures"]});var Dy=new ga({"line-cap":new dn(ie.layout_line["line-cap"]),"line-join":new nn(ie.layout_line["line-join"]),"line-miter-limit":new dn(ie.layout_line["line-miter-limit"]),"line-round-limit":new dn(ie.layout_line["line-round-limit"]),"line-sort-key":new nn(ie.layout_line["line-sort-key"])}),p2={paint:new ga({"line-opacity":new nn(ie.paint_line["line-opacity"]),"line-color":new nn(ie.paint_line["line-color"]),"line-translate":new dn(ie.paint_line["line-translate"]),"line-translate-anchor":new dn(ie.paint_line["line-translate-anchor"]),"line-width":new nn(ie.paint_line["line-width"]),"line-gap-width":new nn(ie.paint_line["line-gap-width"]),"line-offset":new nn(ie.paint_line["line-offset"]),"line-blur":new nn(ie.paint_line["line-blur"]),"line-dasharray":new No(ie.paint_line["line-dasharray"]),"line-pattern":new ys(ie.paint_line["line-pattern"]),"line-gradient":new su(ie.paint_line["line-gradient"])}),layout:Dy},V0=new(function(s){function l(){s.apply(this,arguments)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.possiblyEvaluate=function(h,g){return g=new Zn(Math.floor(g.zoom),{now:g.now,fadeDuration:g.fadeDuration,zoomHistory:g.zoomHistory,transition:g.transition}),s.prototype.possiblyEvaluate.call(this,h,g)},l.prototype.evaluate=function(h,g,x,E){return g=L({},g,{zoom:Math.floor(g.zoom)}),s.prototype.evaluate.call(this,h,g,x,E)},l}(nn))(p2.paint.properties["line-width"].specification);V0.useIntegerZoom=!0;var d2=function(s){function l(h){s.call(this,h,p2),this.gradientVersion=0}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype._handleSpecialPaintPropertyUpdate=function(h){h==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof ms,this.gradientVersion=(this.gradientVersion+1)%A)},l.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},l.prototype.recalculate=function(h,g){s.prototype.recalculate.call(this,h,g),this.paint._values["line-floorwidth"]=V0.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,h)},l.prototype.createBucket=function(h){return new us(h)},l.prototype.queryRadius=function(h){var g=h,x=j0(Ro("line-width",this,g),Ro("line-gap-width",this,g)),E=Ro("line-offset",this,g);return x/2+Math.abs(E)+Ma(this.paint.get("line-translate"))},l.prototype.queryIntersectsFeature=function(h,g,x,E,T,M,D){var N=as(h,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),M.angle,D),$=D/2*j0(this.paint.get("line-width").evaluate(g,x),this.paint.get("line-gap-width").evaluate(g,x)),H=this.paint.get("line-offset").evaluate(g,x);return H&&(E=function(q,re){for(var xe=[],Se=new m(0,0),ze=0;ze<q.length;ze++){for(var Oe=q[ze],et=[],ut=0;ut<Oe.length;ut++){var St=Oe[ut],It=Oe[ut+1],Xt=ut===0?Se:St.sub(Oe[ut-1])._unit()._perp(),Er=ut===Oe.length-1?Se:It.sub(St)._unit()._perp(),kr=Xt._add(Er)._unit();kr._mult(1/(kr.x*Er.x+kr.y*Er.y)),et.push(kr._mult(re)._add(St))}xe.push(et)}return xe}(E,H*D)),function(q,re,xe){for(var Se=0;Se<re.length;Se++){var ze=re[Se];if(q.length>=3){for(var Oe=0;Oe<ze.length;Oe++)if(lu(q,ze[Oe]))return!0}if(bs(q,ze,xe))return!0}return!1}(N,E,$)},l.prototype.isTileClipped=function(){return!0},l}(Xs);function j0(s,l){return l>0?l+2*s:s}var Fy=ao([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),By=ao([{name:"a_projected_pos",components:3,type:"Float32"}],4),v2=(ao([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ao([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),m2=(ao([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),ao([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),U=ao([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function fe(s,l,h){return s.sections.forEach(function(g){g.text=function(x,E,T){var M=E.layout.get("text-transform").evaluate(T,{});return M==="uppercase"?x=x.toLocaleUpperCase():M==="lowercase"&&(x=x.toLocaleLowerCase()),Ms.applyArabicShaping&&(x=Ms.applyArabicShaping(x)),x}(g.text,l,h)}),s}ao([{name:"triangle",components:3,type:"Uint16"}]),ao([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{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"}]),ao([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{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",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ao([{type:"Float32",name:"offsetX"}]),ao([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Me={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},gt=function(s,l,h,g,x){var E,T,M=8*x-g-1,D=(1<<M)-1,N=D>>1,$=-7,H=h?x-1:0,q=h?-1:1,re=s[l+H];for(H+=q,E=re&(1<<-$)-1,re>>=-$,$+=M;$>0;E=256*E+s[l+H],H+=q,$-=8);for(T=E&(1<<-$)-1,E>>=-$,$+=g;$>0;T=256*T+s[l+H],H+=q,$-=8);if(E===0)E=1-N;else{if(E===D)return T?NaN:1/0*(re?-1:1);T+=Math.pow(2,g),E-=N}return(re?-1:1)*T*Math.pow(2,E-g)},zt=function(s,l,h,g,x,E){var T,M,D,N=8*E-x-1,$=(1<<N)-1,H=$>>1,q=x===23?Math.pow(2,-24)-Math.pow(2,-77):0,re=g?0:E-1,xe=g?1:-1,Se=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(M=isNaN(l)?1:0,T=$):(T=Math.floor(Math.log(l)/Math.LN2),l*(D=Math.pow(2,-T))<1&&(T--,D*=2),(l+=T+H>=1?q/D:q*Math.pow(2,1-H))*D>=2&&(T++,D/=2),T+H>=$?(M=0,T=$):T+H>=1?(M=(l*D-1)*Math.pow(2,x),T+=H):(M=l*Math.pow(2,H-1)*Math.pow(2,x),T=0));x>=8;s[h+re]=255&M,re+=xe,M/=256,x-=8);for(T=T<<x|M,N+=x;N>0;s[h+re]=255&T,re+=xe,T/=256,N-=8);s[h+re-xe]|=128*Se},xt=lt;function lt(s){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(s)?s:new Uint8Array(s||0),this.pos=0,this.type=0,this.length=this.buf.length}lt.Varint=0,lt.Fixed64=1,lt.Bytes=2,lt.Fixed32=5;var gr=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function sr(s){return s.type===lt.Bytes?s.readVarint()+s.pos:s.pos+1}function Ir(s,l,h){return h?4294967296*l+(s>>>0):4294967296*(l>>>0)+(s>>>0)}function xr(s,l,h){var g=l<=16383?1:l<=2097151?2:l<=268435455?3:Math.floor(Math.log(l)/(7*Math.LN2));h.realloc(g);for(var x=h.pos-1;x>=s;x--)h.buf[x+g]=h.buf[x]}function wr(s,l){for(var h=0;h<s.length;h++)l.writeVarint(s[h])}function Or(s,l){for(var h=0;h<s.length;h++)l.writeSVarint(s[h])}function cr(s,l){for(var h=0;h<s.length;h++)l.writeFloat(s[h])}function Cr(s,l){for(var h=0;h<s.length;h++)l.writeDouble(s[h])}function rt(s,l){for(var h=0;h<s.length;h++)l.writeBoolean(s[h])}function Pt(s,l){for(var h=0;h<s.length;h++)l.writeFixed32(s[h])}function _r(s,l){for(var h=0;h<s.length;h++)l.writeSFixed32(s[h])}function Nr(s,l){for(var h=0;h<s.length;h++)l.writeFixed64(s[h])}function Jt(s,l){for(var h=0;h<s.length;h++)l.writeSFixed64(s[h])}function Vr(s,l){return(s[l]|s[l+1]<<8|s[l+2]<<16)+16777216*s[l+3]}function dr(s,l,h){s[h]=l,s[h+1]=l>>>8,s[h+2]=l>>>16,s[h+3]=l>>>24}function Ur(s,l){return(s[l]|s[l+1]<<8|s[l+2]<<16)+(s[l+3]<<24)}function er(s,l,h){s===1&&h.readMessage(Fr,l)}function Fr(s,l,h){if(s===3){var g=h.readMessage(En,{}),x=g.width,E=g.height,T=g.left,M=g.top,D=g.advance;l.push({id:g.id,bitmap:new Lc({width:x+6,height:E+6},g.bitmap),metrics:{width:x,height:E,left:T,top:M,advance:D}})}}function En(s,l,h){s===1?l.id=h.readVarint():s===2?l.bitmap=h.readBytes():s===3?l.width=h.readVarint():s===4?l.height=h.readVarint():s===5?l.left=h.readSVarint():s===6?l.top=h.readSVarint():s===7&&(l.advance=h.readVarint())}function jn(s){for(var l=0,h=0,g=0,x=s;g<x.length;g+=1){var E=x[g];l+=E.w*E.h,h=Math.max(h,E.w)}s.sort(function(Se,ze){return ze.h-Se.h});for(var T=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(l/.95)),h),h:1/0}],M=0,D=0,N=0,$=s;N<$.length;N+=1)for(var H=$[N],q=T.length-1;q>=0;q--){var re=T[q];if(!(H.w>re.w||H.h>re.h)){if(H.x=re.x,H.y=re.y,D=Math.max(D,H.y+H.h),M=Math.max(M,H.x+H.w),H.w===re.w&&H.h===re.h){var xe=T.pop();q<T.length&&(T[q]=xe)}else H.h===re.h?(re.x+=H.w,re.w-=H.w):H.w===re.w?(re.y+=H.h,re.h-=H.h):(T.push({x:re.x+H.w,y:re.y,w:re.w-H.w,h:H.h}),re.y+=H.h,re.h-=H.h);break}}return{w:M,h:D,fill:l/(M*D)||0}}lt.prototype={destroy:function(){this.buf=null},readFields:function(s,l,h){for(h=h||this.length;this.pos<h;){var g=this.readVarint(),x=g>>3,E=this.pos;this.type=7&g,s(x,l,this),this.pos===E&&this.skip(g)}return l},readMessage:function(s,l){return this.readFields(s,l,this.readVarint()+this.pos)},readFixed32:function(){var s=Vr(this.buf,this.pos);return this.pos+=4,s},readSFixed32:function(){var s=Ur(this.buf,this.pos);return this.pos+=4,s},readFixed64:function(){var s=Vr(this.buf,this.pos)+4294967296*Vr(this.buf,this.pos+4);return this.pos+=8,s},readSFixed64:function(){var s=Vr(this.buf,this.pos)+4294967296*Ur(this.buf,this.pos+4);return this.pos+=8,s},readFloat:function(){var s=gt(this.buf,this.pos,!0,23,4);return this.pos+=4,s},readDouble:function(){var s=gt(this.buf,this.pos,!0,52,8);return this.pos+=8,s},readVarint:function(s){var l,h,g=this.buf;return l=127&(h=g[this.pos++]),h<128?l:(l|=(127&(h=g[this.pos++]))<<7,h<128?l:(l|=(127&(h=g[this.pos++]))<<14,h<128?l:(l|=(127&(h=g[this.pos++]))<<21,h<128?l:function(x,E,T){var M,D,N=T.buf;if(M=(112&(D=N[T.pos++]))>>4,D<128||(M|=(127&(D=N[T.pos++]))<<3,D<128)||(M|=(127&(D=N[T.pos++]))<<10,D<128)||(M|=(127&(D=N[T.pos++]))<<17,D<128)||(M|=(127&(D=N[T.pos++]))<<24,D<128)||(M|=(1&(D=N[T.pos++]))<<31,D<128))return Ir(x,M,E);throw new Error("Expected varint not more than 10 bytes")}(l|=(15&(h=g[this.pos]))<<28,s,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var s=this.readVarint();return s%2==1?(s+1)/-2:s/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var s=this.readVarint()+this.pos,l=this.pos;return this.pos=s,s-l>=12&&gr?function(h,g,x){return gr.decode(h.subarray(g,x))}(this.buf,l,s):function(h,g,x){for(var E="",T=g;T<x;){var M,D,N,$=h[T],H=null,q=$>239?4:$>223?3:$>191?2:1;if(T+q>x)break;q===1?$<128&&(H=$):q===2?(192&(M=h[T+1]))==128&&(H=(31&$)<<6|63&M)<=127&&(H=null):q===3?(D=h[T+2],(192&(M=h[T+1]))==128&&(192&D)==128&&((H=(15&$)<<12|(63&M)<<6|63&D)<=2047||H>=55296&&H<=57343)&&(H=null)):q===4&&(D=h[T+2],N=h[T+3],(192&(M=h[T+1]))==128&&(192&D)==128&&(192&N)==128&&((H=(15&$)<<18|(63&M)<<12|(63&D)<<6|63&N)<=65535||H>=1114112)&&(H=null)),H===null?(H=65533,q=1):H>65535&&(H-=65536,E+=String.fromCharCode(H>>>10&1023|55296),H=56320|1023&H),E+=String.fromCharCode(H),T+=q}return E}(this.buf,l,s)},readBytes:function(){var s=this.readVarint()+this.pos,l=this.buf.subarray(this.pos,s);return this.pos=s,l},readPackedVarint:function(s,l){if(this.type!==lt.Bytes)return s.push(this.readVarint(l));var h=sr(this);for(s=s||[];this.pos<h;)s.push(this.readVarint(l));return s},readPackedSVarint:function(s){if(this.type!==lt.Bytes)return s.push(this.readSVarint());var l=sr(this);for(s=s||[];this.pos<l;)s.push(this.readSVarint());return s},readPackedBoolean:function(s){if(this.type!==lt.Bytes)return s.push(this.readBoolean());var l=sr(this);for(s=s||[];this.pos<l;)s.push(this.readBoolean());return s},readPackedFloat:function(s){if(this.type!==lt.Bytes)return s.push(this.readFloat());var l=sr(this);for(s=s||[];this.pos<l;)s.push(this.readFloat());return s},readPackedDouble:function(s){if(this.type!==lt.Bytes)return s.push(this.readDouble());var l=sr(this);for(s=s||[];this.pos<l;)s.push(this.readDouble());return s},readPackedFixed32:function(s){if(this.type!==lt.Bytes)return s.push(this.readFixed32());var l=sr(this);for(s=s||[];this.pos<l;)s.push(this.readFixed32());return s},readPackedSFixed32:function(s){if(this.type!==lt.Bytes)return s.push(this.readSFixed32());var l=sr(this);for(s=s||[];this.pos<l;)s.push(this.readSFixed32());return s},readPackedFixed64:function(s){if(this.type!==lt.Bytes)return s.push(this.readFixed64());var l=sr(this);for(s=s||[];this.pos<l;)s.push(this.readFixed64());return s},readPackedSFixed64:function(s){if(this.type!==lt.Bytes)return s.push(this.readSFixed64());var l=sr(this);for(s=s||[];this.pos<l;)s.push(this.readSFixed64());return s},skip:function(s){var l=7&s;if(l===lt.Varint)for(;this.buf[this.pos++]>127;);else if(l===lt.Bytes)this.pos=this.readVarint()+this.pos;else if(l===lt.Fixed32)this.pos+=4;else{if(l!==lt.Fixed64)throw new Error("Unimplemented type: "+l);this.pos+=8}},writeTag:function(s,l){this.writeVarint(s<<3|l)},realloc:function(s){for(var l=this.length||16;l<this.pos+s;)l*=2;if(l!==this.length){var h=new Uint8Array(l);h.set(this.buf),this.buf=h,this.length=l}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(s){this.realloc(4),dr(this.buf,s,this.pos),this.pos+=4},writeSFixed32:function(s){this.realloc(4),dr(this.buf,s,this.pos),this.pos+=4},writeFixed64:function(s){this.realloc(8),dr(this.buf,-1&s,this.pos),dr(this.buf,Math.floor(s*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(s){this.realloc(8),dr(this.buf,-1&s,this.pos),dr(this.buf,Math.floor(s*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(s){(s=+s||0)>268435455||s<0?function(l,h){var g,x;if(l>=0?(g=l%4294967296|0,x=l/4294967296|0):(x=~(-l/4294967296),4294967295^(g=~(-l%4294967296))?g=g+1|0:(g=0,x=x+1|0)),l>=18446744073709552e3||l<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");h.realloc(10),function(E,T,M){M.buf[M.pos++]=127&E|128,E>>>=7,M.buf[M.pos++]=127&E|128,E>>>=7,M.buf[M.pos++]=127&E|128,E>>>=7,M.buf[M.pos++]=127&E|128,M.buf[M.pos]=127&(E>>>=7)}(g,0,h),function(E,T){var M=(7&E)<<4;T.buf[T.pos++]|=M|((E>>>=3)?128:0),E&&(T.buf[T.pos++]=127&E|((E>>>=7)?128:0),E&&(T.buf[T.pos++]=127&E|((E>>>=7)?128:0),E&&(T.buf[T.pos++]=127&E|((E>>>=7)?128:0),E&&(T.buf[T.pos++]=127&E|((E>>>=7)?128:0),E&&(T.buf[T.pos++]=127&E)))))}(x,h)}(s,this):(this.realloc(4),this.buf[this.pos++]=127&s|(s>127?128:0),s<=127||(this.buf[this.pos++]=127&(s>>>=7)|(s>127?128:0),s<=127||(this.buf[this.pos++]=127&(s>>>=7)|(s>127?128:0),s<=127||(this.buf[this.pos++]=s>>>7&127))))},writeSVarint:function(s){this.writeVarint(s<0?2*-s-1:2*s)},writeBoolean:function(s){this.writeVarint(!!s)},writeString:function(s){s=String(s),this.realloc(4*s.length),this.pos++;var l=this.pos;this.pos=function(g,x,E){for(var T,M,D=0;D<x.length;D++){if((T=x.charCodeAt(D))>55295&&T<57344){if(!M){T>56319||D+1===x.length?(g[E++]=239,g[E++]=191,g[E++]=189):M=T;continue}if(T<56320){g[E++]=239,g[E++]=191,g[E++]=189,M=T;continue}T=M-55296<<10|T-56320|65536,M=null}else M&&(g[E++]=239,g[E++]=191,g[E++]=189,M=null);T<128?g[E++]=T:(T<2048?g[E++]=T>>6|192:(T<65536?g[E++]=T>>12|224:(g[E++]=T>>18|240,g[E++]=T>>12&63|128),g[E++]=T>>6&63|128),g[E++]=63&T|128)}return E}(this.buf,s,this.pos);var h=this.pos-l;h>=128&&xr(l,h,this),this.pos=l-1,this.writeVarint(h),this.pos+=h},writeFloat:function(s){this.realloc(4),zt(this.buf,s,this.pos,!0,23,4),this.pos+=4},writeDouble:function(s){this.realloc(8),zt(this.buf,s,this.pos,!0,52,8),this.pos+=8},writeBytes:function(s){var l=s.length;this.writeVarint(l),this.realloc(l);for(var h=0;h<l;h++)this.buf[this.pos++]=s[h]},writeRawMessage:function(s,l){this.pos++;var h=this.pos;s(l,this);var g=this.pos-h;g>=128&&xr(h,g,this),this.pos=h-1,this.writeVarint(g),this.pos+=g},writeMessage:function(s,l,h){this.writeTag(s,lt.Bytes),this.writeRawMessage(l,h)},writePackedVarint:function(s,l){l.length&&this.writeMessage(s,wr,l)},writePackedSVarint:function(s,l){l.length&&this.writeMessage(s,Or,l)},writePackedBoolean:function(s,l){l.length&&this.writeMessage(s,rt,l)},writePackedFloat:function(s,l){l.length&&this.writeMessage(s,cr,l)},writePackedDouble:function(s,l){l.length&&this.writeMessage(s,Cr,l)},writePackedFixed32:function(s,l){l.length&&this.writeMessage(s,Pt,l)},writePackedSFixed32:function(s,l){l.length&&this.writeMessage(s,_r,l)},writePackedFixed64:function(s,l){l.length&&this.writeMessage(s,Nr,l)},writePackedSFixed64:function(s,l){l.length&&this.writeMessage(s,Jt,l)},writeBytesField:function(s,l){this.writeTag(s,lt.Bytes),this.writeBytes(l)},writeFixed32Field:function(s,l){this.writeTag(s,lt.Fixed32),this.writeFixed32(l)},writeSFixed32Field:function(s,l){this.writeTag(s,lt.Fixed32),this.writeSFixed32(l)},writeFixed64Field:function(s,l){this.writeTag(s,lt.Fixed64),this.writeFixed64(l)},writeSFixed64Field:function(s,l){this.writeTag(s,lt.Fixed64),this.writeSFixed64(l)},writeVarintField:function(s,l){this.writeTag(s,lt.Varint),this.writeVarint(l)},writeSVarintField:function(s,l){this.writeTag(s,lt.Varint),this.writeSVarint(l)},writeStringField:function(s,l){this.writeTag(s,lt.Bytes),this.writeString(l)},writeFloatField:function(s,l){this.writeTag(s,lt.Fixed32),this.writeFloat(l)},writeDoubleField:function(s,l){this.writeTag(s,lt.Fixed64),this.writeDouble(l)},writeBooleanField:function(s,l){this.writeVarintField(s,!!l)}};var Br=function(s,l){var h=l.pixelRatio,g=l.version,x=l.stretchX,E=l.stretchY,T=l.content;this.paddedRect=s,this.pixelRatio=h,this.stretchX=x,this.stretchY=E,this.content=T,this.version=g},mr={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};mr.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},mr.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},mr.tlbr.get=function(){return this.tl.concat(this.br)},mr.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Br.prototype,mr);var Wt=function(s,l){var h={},g={};this.haveRenderCallbacks=[];var x=[];this.addImages(s,h,x),this.addImages(l,g,x);var E=jn(x),T=new os({width:E.w||1,height:E.h||1});for(var M in s){var D=s[M],N=h[M].paddedRect;os.copy(D.data,T,{x:0,y:0},{x:N.x+1,y:N.y+1},D.data)}for(var $ in l){var H=l[$],q=g[$].paddedRect,re=q.x+1,xe=q.y+1,Se=H.data.width,ze=H.data.height;os.copy(H.data,T,{x:0,y:0},{x:re,y:xe},H.data),os.copy(H.data,T,{x:0,y:ze-1},{x:re,y:xe-1},{width:Se,height:1}),os.copy(H.data,T,{x:0,y:0},{x:re,y:xe+ze},{width:Se,height:1}),os.copy(H.data,T,{x:Se-1,y:0},{x:re-1,y:xe},{width:1,height:ze}),os.copy(H.data,T,{x:0,y:0},{x:re+Se,y:xe},{width:1,height:ze})}this.image=T,this.iconPositions=h,this.patternPositions=g};Wt.prototype.addImages=function(s,l,h){for(var g in s){var x=s[g],E={x:0,y:0,w:x.data.width+2,h:x.data.height+2};h.push(E),l[g]=new Br(E,x),x.hasRenderCallback&&this.haveRenderCallbacks.push(g)}},Wt.prototype.patchUpdatedImages=function(s,l){for(var h in s.dispatchRenderCallbacks(this.haveRenderCallbacks),s.updatedImages)this.patchUpdatedImage(this.iconPositions[h],s.getImage(h),l),this.patchUpdatedImage(this.patternPositions[h],s.getImage(h),l)},Wt.prototype.patchUpdatedImage=function(s,l,h){if(s&&l&&s.version!==l.version){s.version=l.version;var g=s.tl;h.update(l.data,void 0,{x:g[0],y:g[1]})}},Kr("ImagePosition",Br),Kr("ImageAtlas",Wt);var Sn={horizontal:1,vertical:2,horizontalOnly:3},ui=function(){this.scale=1,this.fontStack="",this.imageName=null};ui.forText=function(s,l){var h=new ui;return h.scale=s||1,h.fontStack=l,h},ui.forImage=function(s){var l=new ui;return l.imageName=s,l};var jr=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function ri(s,l,h,g,x,E,T,M,D,N,$,H,q,re,xe,Se){var ze,Oe=jr.fromFeature(s,x);H===Sn.vertical&&Oe.verticalizePunctuation();var et=Ms.processBidirectionalText,ut=Ms.processStyledBidirectionalText;if(et&&Oe.sections.length===1){ze=[];for(var St=0,It=et(Oe.toString(),Ha(Oe,N,E,l,g,re,xe));St<It.length;St+=1){var Xt=It[St],Er=new jr;Er.text=Xt,Er.sections=Oe.sections;for(var kr=0;kr<Xt.length;kr++)Er.sectionIndex.push(0);ze.push(Er)}}else if(ut){ze=[];for(var mn=0,Gr=ut(Oe.text,Oe.sectionIndex,Ha(Oe,N,E,l,g,re,xe));mn<Gr.length;mn+=1){var An=Gr[mn],Zr=new jr;Zr.text=An[0],Zr.sectionIndex=An[1],Zr.sections=Oe.sections,ze.push(Zr)}}else ze=function(sn,di){for(var Qn=[],Pi=sn.text,Tn=0,zi=0,Sa=di;zi<Sa.length;zi+=1){var Na=Sa[zi];Qn.push(sn.substring(Tn,Na)),Tn=Na}return Tn<Pi.length&&Qn.push(sn.substring(Tn,Pi.length)),Qn}(Oe,Ha(Oe,N,E,l,g,re,xe));var li=[],Ln={positionedLines:li,text:Oe.toString(),top:$[1],bottom:$[1],left:$[0],right:$[0],writingMode:H,iconsInText:!1,verticalizable:!1};return function(sn,di,Qn,Pi,Tn,zi,Sa,Na,Fa,Aa,Ua,Mo){for(var Po=0,Es=-17,Vo=0,Ss=0,Wa=Na==="right"?1:Na==="left"?0:.5,jo=0,xi=0,ia=Tn;xi<ia.length;xi+=1){var qi=ia[xi];qi.trim();var Fi=qi.getMaxScale(),ks=24*(Fi-1),ls={positionedGlyphs:[],lineOffset:0};sn.positionedLines[jo]=ls;var ya=ls.positionedGlyphs,ho=0;if(qi.length()){for(var cs=0;cs<qi.length();cs++){var $i=qi.getSection(cs),Hc=qi.getSectionIndex(cs),Ou=qi.getCharCode(cs),Gc=0,Xa=null,Wc=null,Nl=null,ad=24,Jp=!(Fa===Sn.horizontal||!Ua&&!Of(Ou)||Ua&&($n[Ou]||(Wf=Ou,Dr.Arabic(Wf)||Dr["Arabic Supplement"](Wf)||Dr["Arabic Extended-A"](Wf)||Dr["Arabic Presentation Forms-A"](Wf)||Dr["Arabic Presentation Forms-B"](Wf))));if($i.imageName){var od=Pi[$i.imageName];if(!od)continue;Nl=$i.imageName,sn.iconsInText=sn.iconsInText||!0,Wc=od.paddedRect;var Gf=od.displaySize;$i.scale=24*$i.scale/Mo,Gc=ks+(24-Gf[1]*$i.scale),ad=(Xa={width:Gf[0],height:Gf[1],left:1,top:-3,advance:Jp?Gf[1]:Gf[0]}).advance;var sd=Jp?Gf[0]*$i.scale-24*Fi:Gf[1]*$i.scale-24*Fi;sd>0&&sd>ho&&(ho=sd)}else{var b2=Qn[$i.fontStack],ud=b2&&b2[Ou];if(ud&&ud.rect)Wc=ud.rect,Xa=ud.metrics;else{var X0=di[$i.fontStack],E2=X0&&X0[Ou];if(!E2)continue;Xa=E2.metrics}Gc=24*(Fi-$i.scale)}Jp?(sn.verticalizable=!0,ya.push({glyph:Ou,imageName:Nl,x:Po,y:Es+Gc,vertical:Jp,scale:$i.scale,fontStack:$i.fontStack,sectionIndex:Hc,metrics:Xa,rect:Wc}),Po+=ad*$i.scale+Aa):(ya.push({glyph:Ou,imageName:Nl,x:Po,y:Es+Gc,vertical:Jp,scale:$i.scale,fontStack:$i.fontStack,sectionIndex:Hc,metrics:Xa,rect:Wc}),Po+=Xa.advance*$i.scale+Aa)}ya.length!==0&&(Vo=Math.max(Po-Aa,Vo),uo(ya,0,ya.length-1,Wa,ho)),Po=0;var S2=zi*Fi+ho;ls.lineOffset=Math.max(ho,ks),Es+=S2,Ss=Math.max(S2,Ss),++jo}else Es+=zi,++jo}var Wf,Y0=Es- -17,ld=la(Sa),Vh=ld.horizontalAlign,cd=ld.verticalAlign;(function(A2,T2,Z0,q0,w2,K0,Q0,J0,C2){var fd,R2=(T2-Z0)*w2;fd=K0!==Q0?-J0*q0- -17:(-q0*C2+.5)*Q0;for(var hd=0,ev=A2;hd<ev.length;hd+=1)for(var e1=0,tv=ev[hd].positionedGlyphs;e1<tv.length;e1+=1){var pd=tv[e1];pd.x+=R2,pd.y+=fd}})(sn.positionedLines,Wa,Vh,cd,Vo,Ss,zi,Y0,Tn.length),sn.top+=-cd*Y0,sn.bottom=sn.top+Y0,sn.left+=-Vh*Vo,sn.right=sn.left+Vo}(Ln,l,h,g,ze,T,M,D,H,N,q,Se),!function(sn){for(var di=0,Qn=sn;di<Qn.length;di+=1)if(Qn[di].positionedGlyphs.length!==0)return!1;return!0}(li)&&Ln}jr.fromFeature=function(s,l){for(var h=new jr,g=0;g<s.sections.length;g++){var x=s.sections[g];x.image?h.addImageSection(x):h.addTextSection(x,l)}return h},jr.prototype.length=function(){return this.text.length},jr.prototype.getSection=function(s){return this.sections[this.sectionIndex[s]]},jr.prototype.getSectionIndex=function(s){return this.sectionIndex[s]},jr.prototype.getCharCode=function(s){return this.text.charCodeAt(s)},jr.prototype.verticalizePunctuation=function(){this.text=function(s){for(var l="",h=0;h<s.length;h++){var g=s.charCodeAt(h+1)||null,x=s.charCodeAt(h-1)||null;l+=g&&Th(g)&&!Me[s[h+1]]||x&&Th(x)&&!Me[s[h-1]]||!Me[s[h]]?s[h]:Me[s[h]]}return l}(this.text)},jr.prototype.trim=function(){for(var s=0,l=0;l<this.text.length&&$n[this.text.charCodeAt(l)];l++)s++;for(var h=this.text.length,g=this.text.length-1;g>=0&&g>=s&&$n[this.text.charCodeAt(g)];g--)h--;this.text=this.text.substring(s,h),this.sectionIndex=this.sectionIndex.slice(s,h)},jr.prototype.substring=function(s,l){var h=new jr;return h.text=this.text.substring(s,l),h.sectionIndex=this.sectionIndex.slice(s,l),h.sections=this.sections,h},jr.prototype.toString=function(){return this.text},jr.prototype.getMaxScale=function(){var s=this;return this.sectionIndex.reduce(function(l,h){return Math.max(l,s.sections[h].scale)},0)},jr.prototype.addTextSection=function(s,l){this.text+=s.text,this.sections.push(ui.forText(s.scale,s.fontStack||l));for(var h=this.sections.length-1,g=0;g<s.text.length;++g)this.sectionIndex.push(h)},jr.prototype.addImageSection=function(s){var l=s.image?s.image.name:"";if(l.length!==0){var h=this.getNextImageSectionCharCode();h?(this.text+=String.fromCharCode(h),this.sections.push(ui.forImage(l)),this.sectionIndex.push(this.sections.length-1)):ye("Reached maximum number of images 6401")}else ye("Can't add FormattedSection with an empty image.")},jr.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var $n={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Dn={};function Di(s,l,h,g,x,E){if(l.imageName){var T=g[l.imageName];return T?T.displaySize[0]*l.scale*24/E+x:0}var M=h[l.fontStack],D=M&&M[s];return D?D.metrics.advance*l.scale+x:0}function ja(s,l,h,g){var x=Math.pow(s-l,2);return g?s<l?x/2:2*x:x+Math.abs(h)*h}function Io(s,l,h){var g=0;return s===10&&(g-=1e4),h&&(g+=150),s!==40&&s!==65288||(g+=50),l!==41&&l!==65289||(g+=50),g}function pi(s,l,h,g,x,E){for(var T=null,M=ja(l,h,x,E),D=0,N=g;D<N.length;D+=1){var $=N[D],H=ja(l-$.x,h,x,E)+$.badness;H<=M&&(T=$,M=H)}return{index:s,x:l,priorBreak:T,badness:M}}function Ha(s,l,h,g,x,E,T){if(E!=="point")return[];if(!s)return[];for(var M,D=[],N=function(ze,Oe,et,ut,St,It){for(var Xt=0,Er=0;Er<ze.length();Er++){var kr=ze.getSection(Er);Xt+=Di(ze.getCharCode(Er),kr,ut,St,Oe,It)}return Xt/Math.max(1,Math.ceil(Xt/et))}(s,l,h,g,x,T),$=s.text.indexOf("")>=0,H=0,q=0;q<s.length();q++){var re=s.getSection(q),xe=s.getCharCode(q);if($n[xe]||(H+=Di(xe,re,g,x,l,T)),q<s.length()-1){var Se=!((M=xe)<11904||!(Dr["Bopomofo Extended"](M)||Dr.Bopomofo(M)||Dr["CJK Compatibility Forms"](M)||Dr["CJK Compatibility Ideographs"](M)||Dr["CJK Compatibility"](M)||Dr["CJK Radicals Supplement"](M)||Dr["CJK Strokes"](M)||Dr["CJK Symbols and Punctuation"](M)||Dr["CJK Unified Ideographs Extension A"](M)||Dr["CJK Unified Ideographs"](M)||Dr["Enclosed CJK Letters and Months"](M)||Dr["Halfwidth and Fullwidth Forms"](M)||Dr.Hiragana(M)||Dr["Ideographic Description Characters"](M)||Dr["Kangxi Radicals"](M)||Dr["Katakana Phonetic Extensions"](M)||Dr.Katakana(M)||Dr["Vertical Forms"](M)||Dr["Yi Radicals"](M)||Dr["Yi Syllables"](M)));(Dn[xe]||Se||re.imageName)&&D.push(pi(q+1,H,N,D,Io(xe,s.getCharCode(q+1),Se&&$),!1))}}return function ze(Oe){return Oe?ze(Oe.priorBreak).concat(Oe.index):[]}(pi(s.length(),H,N,D,0,!0))}function la(s){var l=.5,h=.5;switch(s){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(s){case"bottom":case"bottom-right":case"bottom-left":h=1;break;case"top":case"top-right":case"top-left":h=0}return{horizontalAlign:l,verticalAlign:h}}function uo(s,l,h,g,x){if(g||x)for(var E=s[h],T=(s[h].x+E.metrics.advance*E.scale)*g,M=l;M<=h;M++)s[M].x-=T,s[M].y+=x}function lo(s,l,h,g,x,E){var T,M=s.image;if(M.content){var D=M.content,N=M.pixelRatio||1;T=[D[0]/N,D[1]/N,M.displaySize[0]-D[2]/N,M.displaySize[1]-D[3]/N]}var $,H,q,re,xe=l.left*E,Se=l.right*E;h==="width"||h==="both"?(re=x[0]+xe-g[3],H=x[0]+Se+g[1]):H=(re=x[0]+(xe+Se-M.displaySize[0])/2)+M.displaySize[0];var ze=l.top*E,Oe=l.bottom*E;return h==="height"||h==="both"?($=x[1]+ze-g[0],q=x[1]+Oe+g[2]):q=($=x[1]+(ze+Oe-M.displaySize[1])/2)+M.displaySize[1],{image:M,top:$,right:H,bottom:q,left:re,collisionPadding:T}}Dn[10]=!0,Dn[32]=!0,Dn[38]=!0,Dn[40]=!0,Dn[41]=!0,Dn[43]=!0,Dn[45]=!0,Dn[47]=!0,Dn[173]=!0,Dn[183]=!0,Dn[8203]=!0,Dn[8208]=!0,Dn[8211]=!0,Dn[8231]=!0;var Oa=function(s){function l(h,g,x,E){s.call(this,h,g),this.angle=x,E!==void 0&&(this.segment=E)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.clone=function(){return new l(this.x,this.y,this.angle,this.segment)},l}(m);function xo(s,l){var h=l.expression;if(h.kind==="constant")return{kind:"constant",layoutSize:h.evaluate(new Zn(s+1))};if(h.kind==="source")return{kind:"source"};for(var g=h.zoomStops,x=h.interpolationType,E=0;E<g.length&&g[E]<=s;)E++;for(var T=E=Math.max(0,E-1);T<g.length&&g[T]<s+1;)T++;T=Math.min(g.length-1,T);var M=g[E],D=g[T];return h.kind==="composite"?{kind:"composite",minZoom:M,maxZoom:D,interpolationType:x}:{kind:"camera",minZoom:M,maxZoom:D,minSize:h.evaluate(new Zn(M)),maxSize:h.evaluate(new Zn(D)),interpolationType:x}}function Ko(s,l,h){var g=l.uSize,x=h.lowerSize;return s.kind==="source"?x/128:s.kind==="composite"?Ra(x/128,h.upperSize/128,l.uSizeT):g}function co(s,l){var h=0,g=0;if(s.kind==="constant")g=s.layoutSize;else if(s.kind!=="source"){var x=s.interpolationType,E=x?P(Co.interpolationFactor(x,l,s.minZoom,s.maxZoom),0,1):0;s.kind==="camera"?g=Ra(s.minSize,s.maxSize,E):h=E}return{uSizeT:h,uSize:g}}Kr("Anchor",Oa);var ei=Object.freeze({__proto__:null,getSizeData:xo,evaluateSizeForFeature:Ko,evaluateSizeForZoom:co,SIZE_PACK_FACTOR:128});function zo(s,l,h,g,x){if(l.segment===void 0)return!0;for(var E=l,T=l.segment+1,M=0;M>-h/2;){if(--T<0)return!1;M-=s[T].dist(E),E=s[T]}M+=s[T].dist(s[T+1]),T++;for(var D=[],N=0;M<h/2;){var $=s[T],H=s[T+1];if(!H)return!1;var q=s[T-1].angleTo($)-$.angleTo(H);for(q=Math.abs((q+3*Math.PI)%(2*Math.PI)-Math.PI),D.push({distance:M,angleDelta:q}),N+=q;M-D[0].distance>g;)N-=D.shift().angleDelta;if(N>x)return!1;T++,M+=$.dist(H)}return!0}function Ni(s){for(var l=0,h=0;h<s.length-1;h++)l+=s[h].dist(s[h+1]);return l}function Mn(s,l,h){return s?.6*l*h:0}function fi(s,l){return Math.max(s?s.right-s.left:0,l?l.right-l.left:0)}function Mi(s,l,h,g,x,E){for(var T=Mn(h,x,E),M=fi(h,g)*E,D=0,N=Ni(s)/2,$=0;$<s.length-1;$++){var H=s[$],q=s[$+1],re=H.dist(q);if(D+re>N){var xe=(N-D)/re,Se=Ra(H.x,q.x,xe),ze=Ra(H.y,q.y,xe),Oe=new Oa(Se,ze,q.angleTo(H),$);return Oe._round(),!T||zo(s,Oe,M,T,l)?Oe:void 0}D+=re}}function Ga(s,l,h,g,x,E,T,M,D){var N=Mn(g,E,T),$=fi(g,x),H=$*T,q=s[0].x===0||s[0].x===D||s[0].y===0||s[0].y===D;return l-H<l/4&&(l=H+l/4),function re(xe,Se,ze,Oe,et,ut,St,It,Xt){for(var Er=ut/2,kr=Ni(xe),mn=0,Gr=Se-ze,An=[],Zr=0;Zr<xe.length-1;Zr++){for(var li=xe[Zr],Ln=xe[Zr+1],sn=li.dist(Ln),di=Ln.angleTo(li);Gr+ze<mn+sn;){var Qn=((Gr+=ze)-mn)/sn,Pi=Ra(li.x,Ln.x,Qn),Tn=Ra(li.y,Ln.y,Qn);if(Pi>=0&&Pi<Xt&&Tn>=0&&Tn<Xt&&Gr-Er>=0&&Gr+Er<=kr){var zi=new Oa(Pi,Tn,di,Zr);zi._round(),Oe&&!zo(xe,zi,ut,Oe,et)||An.push(zi)}}mn+=sn}return It||An.length||St||(An=re(xe,mn/2,ze,Oe,et,ut,St,!0,Xt)),An}(s,q?l/2*M%l:($/2+2*E)*T*M%l,l,N,h,H,q,!1,D)}function il(s,l,h,g,x){for(var E=[],T=0;T<s.length;T++)for(var M=s[T],D=void 0,N=0;N<M.length-1;N++){var $=M[N],H=M[N+1];$.x<l&&H.x<l||($.x<l?$=new m(l,$.y+(l-$.x)/(H.x-$.x)*(H.y-$.y))._round():H.x<l&&(H=new m(l,$.y+(l-$.x)/(H.x-$.x)*(H.y-$.y))._round()),$.y<h&&H.y<h||($.y<h?$=new m($.x+(h-$.y)/(H.y-$.y)*(H.x-$.x),h)._round():H.y<h&&(H=new m($.x+(h-$.y)/(H.y-$.y)*(H.x-$.x),h)._round()),$.x>=g&&H.x>=g||($.x>=g?$=new m(g,$.y+(g-$.x)/(H.x-$.x)*(H.y-$.y))._round():H.x>=g&&(H=new m(g,$.y+(g-$.x)/(H.x-$.x)*(H.y-$.y))._round()),$.y>=x&&H.y>=x||($.y>=x?$=new m($.x+(x-$.y)/(H.y-$.y)*(H.x-$.x),x)._round():H.y>=x&&(H=new m($.x+(x-$.y)/(H.y-$.y)*(H.x-$.x),x)._round()),D&&$.equals(D[D.length-1])||E.push(D=[$]),D.push(H)))))}return E}function Ae(s,l,h,g){var x=[],E=s.image,T=E.pixelRatio,M=E.paddedRect.w-2,D=E.paddedRect.h-2,N=s.right-s.left,$=s.bottom-s.top,H=E.stretchX||[[0,M]],q=E.stretchY||[[0,D]],re=function(Pi,Tn){return Pi+Tn[1]-Tn[0]},xe=H.reduce(re,0),Se=q.reduce(re,0),ze=M-xe,Oe=D-Se,et=0,ut=xe,St=0,It=Se,Xt=0,Er=ze,kr=0,mn=Oe;if(E.content&&g){var Gr=E.content;et=Et(H,0,Gr[0]),St=Et(q,0,Gr[1]),ut=Et(H,Gr[0],Gr[2]),It=Et(q,Gr[1],Gr[3]),Xt=Gr[0]-et,kr=Gr[1]-St,Er=Gr[2]-Gr[0]-ut,mn=Gr[3]-Gr[1]-It}var An=function(Pi,Tn,zi,Sa){var Na=Hr(Pi.stretch-et,ut,N,s.left),Fa=ni(Pi.fixed-Xt,Er,Pi.stretch,xe),Aa=Hr(Tn.stretch-St,It,$,s.top),Ua=ni(Tn.fixed-kr,mn,Tn.stretch,Se),Mo=Hr(zi.stretch-et,ut,N,s.left),Po=ni(zi.fixed-Xt,Er,zi.stretch,xe),Es=Hr(Sa.stretch-St,It,$,s.top),Vo=ni(Sa.fixed-kr,mn,Sa.stretch,Se),Ss=new m(Na,Aa),Wa=new m(Mo,Aa),jo=new m(Mo,Es),xi=new m(Na,Es),ia=new m(Fa/T,Ua/T),qi=new m(Po/T,Vo/T),Fi=l*Math.PI/180;if(Fi){var ks=Math.sin(Fi),ls=Math.cos(Fi),ya=[ls,-ks,ks,ls];Ss._matMult(ya),Wa._matMult(ya),xi._matMult(ya),jo._matMult(ya)}var ho=Pi.stretch+Pi.fixed,cs=Tn.stretch+Tn.fixed;return{tl:Ss,tr:Wa,bl:xi,br:jo,tex:{x:E.paddedRect.x+1+ho,y:E.paddedRect.y+1+cs,w:zi.stretch+zi.fixed-ho,h:Sa.stretch+Sa.fixed-cs},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:ia,pixelOffsetBR:qi,minFontScaleX:Er/T/N,minFontScaleY:mn/T/$,isSDF:h}};if(g&&(E.stretchX||E.stretchY))for(var Zr=pt(H,ze,xe),li=pt(q,Oe,Se),Ln=0;Ln<Zr.length-1;Ln++)for(var sn=Zr[Ln],di=Zr[Ln+1],Qn=0;Qn<li.length-1;Qn++)x.push(An(sn,li[Qn],di,li[Qn+1]));else x.push(An({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:M+1},{fixed:0,stretch:D+1}));return x}function Et(s,l,h){for(var g=0,x=0,E=s;x<E.length;x+=1){var T=E[x];g+=Math.max(l,Math.min(h,T[1]))-Math.max(l,Math.min(h,T[0]))}return g}function pt(s,l,h){for(var g=[{fixed:-1,stretch:0}],x=0,E=s;x<E.length;x+=1){var T=E[x],M=T[0],D=T[1],N=g[g.length-1];g.push({fixed:M-N.stretch,stretch:N.stretch}),g.push({fixed:M-N.stretch,stretch:N.stretch+(D-M)})}return g.push({fixed:l+1,stretch:h}),g}function Hr(s,l,h,g){return s/l*h+g}function ni(s,l,h,g){return s-l*h/g}var Zi=function(s,l,h,g,x,E,T,M,D,N){if(this.boxStartIndex=s.length,D){var $=E.top,H=E.bottom,q=E.collisionPadding;q&&($-=q[1],H+=q[3]);var re=H-$;re>0&&(re=Math.max(10,re),this.circleDiameter=re)}else{var xe=E.top*T-M,Se=E.bottom*T+M,ze=E.left*T-M,Oe=E.right*T+M,et=E.collisionPadding;if(et&&(ze-=et[0]*T,xe-=et[1]*T,Oe+=et[2]*T,Se+=et[3]*T),N){var ut=new m(ze,xe),St=new m(Oe,xe),It=new m(ze,Se),Xt=new m(Oe,Se),Er=N*Math.PI/180;ut._rotate(Er),St._rotate(Er),It._rotate(Er),Xt._rotate(Er),ze=Math.min(ut.x,St.x,It.x,Xt.x),Oe=Math.max(ut.x,St.x,It.x,Xt.x),xe=Math.min(ut.y,St.y,It.y,Xt.y),Se=Math.max(ut.y,St.y,It.y,Xt.y)}s.emplaceBack(l.x,l.y,ze,xe,Oe,Se,h,g,x)}this.boxEndIndex=s.length},te=function(s,l){if(s===void 0&&(s=[]),l===void 0&&(l=me),this.data=s,this.length=this.data.length,this.compare=l,this.length>0)for(var h=(this.length>>1)-1;h>=0;h--)this._down(h)};function me(s,l){return s<l?-1:s>l?1:0}function Pe(s,l,h){l===void 0&&(l=1),h===void 0&&(h=!1);for(var g=1/0,x=1/0,E=-1/0,T=-1/0,M=s[0],D=0;D<M.length;D++){var N=M[D];(!D||N.x<g)&&(g=N.x),(!D||N.y<x)&&(x=N.y),(!D||N.x>E)&&(E=N.x),(!D||N.y>T)&&(T=N.y)}var $=Math.min(E-g,T-x),H=$/2,q=new te([],vt);if($===0)return new m(g,x);for(var re=g;re<E;re+=$)for(var xe=x;xe<T;xe+=$)q.push(new ht(re+H,xe+H,H,s));for(var Se=function(et){for(var ut=0,St=0,It=0,Xt=et[0],Er=0,kr=Xt.length,mn=kr-1;Er<kr;mn=Er++){var Gr=Xt[Er],An=Xt[mn],Zr=Gr.x*An.y-An.x*Gr.y;St+=(Gr.x+An.x)*Zr,It+=(Gr.y+An.y)*Zr,ut+=3*Zr}return new ht(St/ut,It/ut,0,et)}(s),ze=q.length;q.length;){var Oe=q.pop();(Oe.d>Se.d||!Se.d)&&(Se=Oe,h&&console.log("found best %d after %d probes",Math.round(1e4*Oe.d)/1e4,ze)),Oe.max-Se.d<=l||(q.push(new ht(Oe.p.x-(H=Oe.h/2),Oe.p.y-H,H,s)),q.push(new ht(Oe.p.x+H,Oe.p.y-H,H,s)),q.push(new ht(Oe.p.x-H,Oe.p.y+H,H,s)),q.push(new ht(Oe.p.x+H,Oe.p.y+H,H,s)),ze+=4)}return h&&(console.log("num probes: "+ze),console.log("best distance: "+Se.d)),Se.p}function vt(s,l){return l.max-s.max}function ht(s,l,h,g){this.p=new m(s,l),this.h=h,this.d=function(x,E){for(var T=!1,M=1/0,D=0;D<E.length;D++)for(var N=E[D],$=0,H=N.length,q=H-1;$<H;q=$++){var re=N[$],xe=N[q];re.y>x.y!=xe.y>x.y&&x.x<(xe.x-re.x)*(x.y-re.y)/(xe.y-re.y)+re.x&&(T=!T),M=Math.min(M,Dl(x,re,xe))}return(T?1:-1)*Math.sqrt(M)}(this.p,g),this.max=this.d+this.h*Math.SQRT2}te.prototype.push=function(s){this.data.push(s),this.length++,this._up(this.length-1)},te.prototype.pop=function(){if(this.length!==0){var s=this.data[0],l=this.data.pop();return this.length--,this.length>0&&(this.data[0]=l,this._down(0)),s}},te.prototype.peek=function(){return this.data[0]},te.prototype._up=function(s){for(var l=this.data,h=this.compare,g=l[s];s>0;){var x=s-1>>1,E=l[x];if(h(g,E)>=0)break;l[s]=E,s=x}l[s]=g},te.prototype._down=function(s){for(var l=this.data,h=this.compare,g=this.length>>1,x=l[s];s<g;){var E=1+(s<<1),T=l[E],M=E+1;if(M<this.length&&h(l[M],T)<0&&(E=M,T=l[M]),h(T,x)>=0)break;l[s]=T,s=E}l[s]=x};var Le=Number.POSITIVE_INFINITY;function We(s,l){return l[1]!==Le?function(h,g,x){var E=0,T=0;switch(g=Math.abs(g),x=Math.abs(x),h){case"top-right":case"top-left":case"top":T=x-7;break;case"bottom-right":case"bottom-left":case"bottom":T=7-x}switch(h){case"top-right":case"bottom-right":case"right":E=-g;break;case"top-left":case"bottom-left":case"left":E=g}return[E,T]}(s,l[0],l[1]):function(h,g){var x=0,E=0;g<0&&(g=0);var T=g/Math.sqrt(2);switch(h){case"top-right":case"top-left":E=T-7;break;case"bottom-right":case"bottom-left":E=7-T;break;case"bottom":E=7-g;break;case"top":E=g-7}switch(h){case"top-right":case"bottom-right":x=-T;break;case"top-left":case"bottom-left":x=T;break;case"left":x=g;break;case"right":x=-g}return[x,E]}(s,l[0])}function Ze(s){switch(s){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Te(s,l,h,g,x,E,T,M,D,N,$,H,q,re,xe){var Se=function(St,It,Xt,Er,kr,mn,Gr,An){for(var Zr=Er.layout.get("text-rotate").evaluate(mn,{})*Math.PI/180,li=[],Ln=0,sn=It.positionedLines;Ln<sn.length;Ln+=1)for(var di=sn[Ln],Qn=0,Pi=di.positionedGlyphs;Qn<Pi.length;Qn+=1){var Tn=Pi[Qn];if(Tn.rect){var zi=Tn.rect||{},Sa=4,Na=!0,Fa=1,Aa=0,Ua=(kr||An)&&Tn.vertical,Mo=Tn.metrics.advance*Tn.scale/2;if(An&&It.verticalizable&&(Aa=di.lineOffset/2-(Tn.imageName?-(24-Tn.metrics.width*Tn.scale)/2:24*(Tn.scale-1))),Tn.imageName){var Po=Gr[Tn.imageName];Na=Po.sdf,Sa=1/(Fa=Po.pixelRatio)}var Es=kr?[Tn.x+Mo,Tn.y]:[0,0],Vo=kr?[0,0]:[Tn.x+Mo+Xt[0],Tn.y+Xt[1]-Aa],Ss=[0,0];Ua&&(Ss=Vo,Vo=[0,0]);var Wa=(Tn.metrics.left-Sa)*Tn.scale-Mo+Vo[0],jo=(-Tn.metrics.top-Sa)*Tn.scale+Vo[1],xi=Wa+zi.w*Tn.scale/Fa,ia=jo+zi.h*Tn.scale/Fa,qi=new m(Wa,jo),Fi=new m(xi,jo),ks=new m(Wa,ia),ls=new m(xi,ia);if(Ua){var ya=new m(-Mo,Mo- -17),ho=-Math.PI/2,cs=12-Mo,$i=new m(22-cs,-(Tn.imageName?cs:0)),Hc=new(Function.prototype.bind.apply(m,[null].concat(Ss)));qi._rotateAround(ho,ya)._add($i)._add(Hc),Fi._rotateAround(ho,ya)._add($i)._add(Hc),ks._rotateAround(ho,ya)._add($i)._add(Hc),ls._rotateAround(ho,ya)._add($i)._add(Hc)}if(Zr){var Ou=Math.sin(Zr),Gc=Math.cos(Zr),Xa=[Gc,-Ou,Ou,Gc];qi._matMult(Xa),Fi._matMult(Xa),ks._matMult(Xa),ls._matMult(Xa)}var Wc=new m(0,0),Nl=new m(0,0);li.push({tl:qi,tr:Fi,bl:ks,br:ls,tex:zi,writingMode:It.writingMode,glyphOffset:Es,sectionIndex:Tn.sectionIndex,isSDF:Na,pixelOffsetTL:Wc,pixelOffsetBR:Nl,minFontScaleX:0,minFontScaleY:0})}}return li}(0,h,M,x,E,T,g,s.allowVerticalPlacement),ze=s.textSizeData,Oe=null;ze.kind==="source"?(Oe=[128*x.layout.get("text-size").evaluate(T,{})])[0]>32640&&ye(s.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):ze.kind==="composite"&&((Oe=[128*re.compositeTextSizes[0].evaluate(T,{},xe),128*re.compositeTextSizes[1].evaluate(T,{},xe)])[0]>32640||Oe[1]>32640)&&ye(s.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),s.addSymbols(s.text,Se,Oe,M,E,T,N,l,D.lineStartIndex,D.lineLength,q,xe);for(var et=0,ut=$;et<ut.length;et+=1)H[ut[et]]=s.text.placedSymbolArray.length-1;return 4*Se.length}function Ve(s){for(var l in s)return s[l];return null}function pe(s,l,h,g){var x=s.compareText;if(l in x){for(var E=x[l],T=E.length-1;T>=0;T--)if(g.dist(E[T])<h)return!0}else x[l]=[];return x[l].push(g),!1}var He=jc.VectorTileFeature.types,Tt=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Ft(s,l,h,g,x,E,T,M,D,N,$,H,q){var re=M?Math.min(32640,Math.round(M[0])):0,xe=M?Math.min(32640,Math.round(M[1])):0;s.emplaceBack(l,h,Math.round(32*g),Math.round(32*x),E,T,(re<<1)+(D?1:0),xe,16*N,16*$,256*H,256*q)}function ir(s,l,h){s.emplaceBack(l.x,l.y,h),s.emplaceBack(l.x,l.y,h),s.emplaceBack(l.x,l.y,h),s.emplaceBack(l.x,l.y,h)}function Yt(s){for(var l=0,h=s.sections;l<h.length;l+=1)if(wh(h[l].text))return!0;return!1}var fr=function(s){this.layoutVertexArray=new Mh,this.indexArray=new Cu,this.programConfigurations=s,this.segments=new ae,this.dynamicLayoutVertexArray=new Fc,this.opacityVertexArray=new kf,this.placedSymbolArray=new y};fr.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},fr.prototype.upload=function(s,l,h,g){this.isEmpty()||(h&&(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,Fy.members),this.indexBuffer=s.createIndexBuffer(this.indexArray,l),this.dynamicLayoutVertexBuffer=s.createVertexBuffer(this.dynamicLayoutVertexArray,By.members,!0),this.opacityVertexBuffer=s.createVertexBuffer(this.opacityVertexArray,Tt,!0),this.opacityVertexBuffer.itemSize=1),(h||g)&&this.programConfigurations.upload(s))},fr.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Kr("SymbolBuffers",fr);var cn=function(s,l,h){this.layoutVertexArray=new s,this.layoutAttributes=l,this.indexArray=new h,this.segments=new ae,this.collisionVertexArray=new Gp};cn.prototype.upload=function(s){this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=s.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=s.createVertexBuffer(this.collisionVertexArray,v2.members,!0)},cn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Kr("CollisionBuffers",cn);var Jr=function(s){this.collisionBoxArray=s.collisionBoxArray,this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(function(E){return E.id}),this.index=s.index,this.pixelRatio=s.pixelRatio,this.sourceLayerIndex=s.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=yo([]),this.placementViewportMatrix=yo([]);var l=this.layers[0]._unevaluatedLayout._values;this.textSizeData=xo(this.zoom,l["text-size"]),this.iconSizeData=xo(this.zoom,l["icon-size"]);var h=this.layers[0].layout,g=h.get("symbol-sort-key"),x=h.get("symbol-z-order");this.canOverlap=h.get("text-allow-overlap")||h.get("icon-allow-overlap")||h.get("text-ignore-placement")||h.get("icon-ignore-placement"),this.sortFeaturesByKey=x!=="viewport-y"&&g.constantOr(1)!==void 0,this.sortFeaturesByY=(x==="viewport-y"||x==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,h.get("symbol-placement")==="point"&&(this.writingModes=h.get("text-writing-mode").map(function(E){return Sn[E]})),this.stateDependentLayerIds=this.layers.filter(function(E){return E.isStateDependent()}).map(function(E){return E.id}),this.sourceID=s.sourceID};Jr.prototype.createArrays=function(){this.text=new fr(new In(this.layers,this.zoom,function(s){return/^text/.test(s)})),this.icon=new fr(new In(this.layers,this.zoom,function(s){return/^icon/.test(s)})),this.glyphOffsetArray=new I,this.lineVertexArray=new O,this.symbolInstances=new C},Jr.prototype.calculateGlyphDependencies=function(s,l,h,g,x){for(var E=0;E<s.length;E++)if(l[s.charCodeAt(E)]=!0,(h||g)&&x){var T=Me[s.charAt(E)];T&&(l[T.charCodeAt(0)]=!0)}},Jr.prototype.populate=function(s,l,h){var g=this.layers[0],x=g.layout,E=x.get("text-font"),T=x.get("text-field"),M=x.get("icon-image"),D=(T.value.kind!=="constant"||T.value.value instanceof wa&&!T.value.value.isEmpty()||T.value.value.toString().length>0)&&(E.value.kind!=="constant"||E.value.value.length>0),N=M.value.kind!=="constant"||!!M.value.value||Object.keys(M.parameters).length>0,$=x.get("symbol-sort-key");if(this.features=[],D||N){for(var H=l.iconDependencies,q=l.glyphDependencies,re=l.availableImages,xe=new Zn(this.zoom),Se=0,ze=s;Se<ze.length;Se+=1){var Oe=ze[Se],et=Oe.feature,ut=Oe.id,St=Oe.index,It=Oe.sourceLayerIndex,Xt=g._featureFilter.needGeometry,Er=ba(et,Xt);if(g._featureFilter.filter(xe,Er,h)){Xt||(Er.geometry=_a(et));var kr=void 0;if(D){var mn=g.getValueAndResolveTokens("text-field",Er,h,re),Gr=wa.factory(mn);Yt(Gr)&&(this.hasRTLText=!0),(!this.hasRTLText||jp()==="unavailable"||this.hasRTLText&&Ms.isParsed())&&(kr=fe(Gr,g,Er))}var An=void 0;if(N){var Zr=g.getValueAndResolveTokens("icon-image",Er,h,re);An=Zr instanceof fa?Zr:fa.fromString(Zr)}if(kr||An){var li=this.sortFeaturesByKey?$.evaluate(Er,{},h):void 0;if(this.features.push({id:ut,text:kr,icon:An,index:St,sourceLayerIndex:It,geometry:Er.geometry,properties:et.properties,type:He[et.type],sortKey:li}),An&&(H[An.name]=!0),kr){var Ln=E.evaluate(Er,{},h).join(","),sn=x.get("text-rotation-alignment")==="map"&&x.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Sn.vertical)>=0;for(var di=0,Qn=kr.sections;di<Qn.length;di+=1){var Pi=Qn[di];if(Pi.image)H[Pi.image.name]=!0;else{var Tn=Qu(kr.toString()),zi=Pi.fontStack||Ln,Sa=q[zi]=q[zi]||{};this.calculateGlyphDependencies(Pi.text,Sa,sn,this.allowVerticalPlacement,Tn)}}}}}}x.get("symbol-placement")==="line"&&(this.features=function(Na){var Fa={},Aa={},Ua=[],Mo=0;function Po(ya){Ua.push(Na[ya]),Mo++}function Es(ya,ho,cs){var $i=Aa[ya];return delete Aa[ya],Aa[ho]=$i,Ua[$i].geometry[0].pop(),Ua[$i].geometry[0]=Ua[$i].geometry[0].concat(cs[0]),$i}function Vo(ya,ho,cs){var $i=Fa[ho];return delete Fa[ho],Fa[ya]=$i,Ua[$i].geometry[0].shift(),Ua[$i].geometry[0]=cs[0].concat(Ua[$i].geometry[0]),$i}function Ss(ya,ho,cs){var $i=cs?ho[0][ho[0].length-1]:ho[0][0];return ya+":"+$i.x+":"+$i.y}for(var Wa=0;Wa<Na.length;Wa++){var jo=Na[Wa],xi=jo.geometry,ia=jo.text?jo.text.toString():null;if(ia){var qi=Ss(ia,xi),Fi=Ss(ia,xi,!0);if(qi in Aa&&Fi in Fa&&Aa[qi]!==Fa[Fi]){var ks=Vo(qi,Fi,xi),ls=Es(qi,Fi,Ua[ks].geometry);delete Fa[qi],delete Aa[Fi],Aa[Ss(ia,Ua[ls].geometry,!0)]=ls,Ua[ks].geometry=null}else qi in Aa?Es(qi,Fi,xi):Fi in Fa?Vo(qi,Fi,xi):(Po(Wa),Fa[qi]=Mo-1,Aa[Fi]=Mo-1)}else Po(Wa)}return Ua.filter(function(ya){return ya.geometry})}(this.features)),this.sortFeaturesByKey&&this.features.sort(function(Na,Fa){return Na.sortKey-Fa.sortKey})}},Jr.prototype.update=function(s,l,h){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(s,l,this.layers,h),this.icon.programConfigurations.updatePaintArrays(s,l,this.layers,h))},Jr.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},Jr.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Jr.prototype.upload=function(s){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(s),this.iconCollisionBox.upload(s)),this.text.upload(s,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(s,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Jr.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Jr.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Jr.prototype.addToLineVertexArray=function(s,l){var h=this.lineVertexArray.length;if(s.segment!==void 0){for(var g=s.dist(l[s.segment+1]),x=s.dist(l[s.segment]),E={},T=s.segment+1;T<l.length;T++)E[T]={x:l[T].x,y:l[T].y,tileUnitDistanceFromAnchor:g},T<l.length-1&&(g+=l[T+1].dist(l[T]));for(var M=s.segment||0;M>=0;M--)E[M]={x:l[M].x,y:l[M].y,tileUnitDistanceFromAnchor:x},M>0&&(x+=l[M-1].dist(l[M]));for(var D=0;D<l.length;D++){var N=E[D];this.lineVertexArray.emplaceBack(N.x,N.y,N.tileUnitDistanceFromAnchor)}}return{lineStartIndex:h,lineLength:this.lineVertexArray.length-h}},Jr.prototype.addSymbols=function(s,l,h,g,x,E,T,M,D,N,$,H){for(var q=s.indexArray,re=s.layoutVertexArray,xe=s.segments.prepareSegment(4*l.length,re,q,this.canOverlap?E.sortKey:void 0),Se=this.glyphOffsetArray.length,ze=xe.vertexLength,Oe=this.allowVerticalPlacement&&T===Sn.vertical?Math.PI/2:0,et=E.text&&E.text.sections,ut=0;ut<l.length;ut++){var St=l[ut],It=St.tl,Xt=St.tr,Er=St.bl,kr=St.br,mn=St.tex,Gr=St.pixelOffsetTL,An=St.pixelOffsetBR,Zr=St.minFontScaleX,li=St.minFontScaleY,Ln=St.glyphOffset,sn=St.isSDF,di=St.sectionIndex,Qn=xe.vertexLength,Pi=Ln[1];Ft(re,M.x,M.y,It.x,Pi+It.y,mn.x,mn.y,h,sn,Gr.x,Gr.y,Zr,li),Ft(re,M.x,M.y,Xt.x,Pi+Xt.y,mn.x+mn.w,mn.y,h,sn,An.x,Gr.y,Zr,li),Ft(re,M.x,M.y,Er.x,Pi+Er.y,mn.x,mn.y+mn.h,h,sn,Gr.x,An.y,Zr,li),Ft(re,M.x,M.y,kr.x,Pi+kr.y,mn.x+mn.w,mn.y+mn.h,h,sn,An.x,An.y,Zr,li),ir(s.dynamicLayoutVertexArray,M,Oe),q.emplaceBack(Qn,Qn+1,Qn+2),q.emplaceBack(Qn+1,Qn+2,Qn+3),xe.vertexLength+=4,xe.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Ln[0]),ut!==l.length-1&&di===l[ut+1].sectionIndex||s.programConfigurations.populatePaintArrays(re.length,E,E.index,{},H,et&&et[di])}s.placedSymbolArray.emplaceBack(M.x,M.y,Se,this.glyphOffsetArray.length-Se,ze,D,N,M.segment,h?h[0]:0,h?h[1]:0,g[0],g[1],T,0,!1,0,$)},Jr.prototype._addCollisionDebugVertex=function(s,l,h,g,x,E){return l.emplaceBack(0,0),s.emplaceBack(h.x,h.y,g,x,Math.round(E.x),Math.round(E.y))},Jr.prototype.addCollisionDebugVertices=function(s,l,h,g,x,E,T){var M=x.segments.prepareSegment(4,x.layoutVertexArray,x.indexArray),D=M.vertexLength,N=x.layoutVertexArray,$=x.collisionVertexArray,H=T.anchorX,q=T.anchorY;this._addCollisionDebugVertex(N,$,E,H,q,new m(s,l)),this._addCollisionDebugVertex(N,$,E,H,q,new m(h,l)),this._addCollisionDebugVertex(N,$,E,H,q,new m(h,g)),this._addCollisionDebugVertex(N,$,E,H,q,new m(s,g)),M.vertexLength+=4;var re=x.indexArray;re.emplaceBack(D,D+1),re.emplaceBack(D+1,D+2),re.emplaceBack(D+2,D+3),re.emplaceBack(D+3,D),M.primitiveLength+=4},Jr.prototype.addDebugCollisionBoxes=function(s,l,h,g){for(var x=s;x<l;x++){var E=this.collisionBoxArray.get(x);this.addCollisionDebugVertices(E.x1,E.y1,E.x2,E.y2,g?this.textCollisionBox:this.iconCollisionBox,E.anchorPoint,h)}},Jr.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new cn(ac,m2.members,Df),this.iconCollisionBox=new cn(ac,m2.members,Df);for(var s=0;s<this.symbolInstances.length;s++){var l=this.symbolInstances.get(s);this.addDebugCollisionBoxes(l.textBoxStartIndex,l.textBoxEndIndex,l,!0),this.addDebugCollisionBoxes(l.verticalTextBoxStartIndex,l.verticalTextBoxEndIndex,l,!0),this.addDebugCollisionBoxes(l.iconBoxStartIndex,l.iconBoxEndIndex,l,!1),this.addDebugCollisionBoxes(l.verticalIconBoxStartIndex,l.verticalIconBoxEndIndex,l,!1)}},Jr.prototype._deserializeCollisionBoxesForSymbol=function(s,l,h,g,x,E,T,M,D){for(var N={},$=l;$<h;$++){var H=s.get($);N.textBox={x1:H.x1,y1:H.y1,x2:H.x2,y2:H.y2,anchorPointX:H.anchorPointX,anchorPointY:H.anchorPointY},N.textFeatureIndex=H.featureIndex;break}for(var q=g;q<x;q++){var re=s.get(q);N.verticalTextBox={x1:re.x1,y1:re.y1,x2:re.x2,y2:re.y2,anchorPointX:re.anchorPointX,anchorPointY:re.anchorPointY},N.verticalTextFeatureIndex=re.featureIndex;break}for(var xe=E;xe<T;xe++){var Se=s.get(xe);N.iconBox={x1:Se.x1,y1:Se.y1,x2:Se.x2,y2:Se.y2,anchorPointX:Se.anchorPointX,anchorPointY:Se.anchorPointY},N.iconFeatureIndex=Se.featureIndex;break}for(var ze=M;ze<D;ze++){var Oe=s.get(ze);N.verticalIconBox={x1:Oe.x1,y1:Oe.y1,x2:Oe.x2,y2:Oe.y2,anchorPointX:Oe.anchorPointX,anchorPointY:Oe.anchorPointY},N.verticalIconFeatureIndex=Oe.featureIndex;break}return N},Jr.prototype.deserializeCollisionBoxes=function(s){this.collisionArrays=[];for(var l=0;l<this.symbolInstances.length;l++){var h=this.symbolInstances.get(l);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(s,h.textBoxStartIndex,h.textBoxEndIndex,h.verticalTextBoxStartIndex,h.verticalTextBoxEndIndex,h.iconBoxStartIndex,h.iconBoxEndIndex,h.verticalIconBoxStartIndex,h.verticalIconBoxEndIndex))}},Jr.prototype.hasTextData=function(){return this.text.segments.get().length>0},Jr.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Jr.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Jr.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Jr.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Jr.prototype.addIndicesForPlacedSymbol=function(s,l){for(var h=s.placedSymbolArray.get(l),g=h.vertexStartIndex+4*h.numGlyphs,x=h.vertexStartIndex;x<g;x+=4)s.indexArray.emplaceBack(x,x+1,x+2),s.indexArray.emplaceBack(x+1,x+2,x+3)},Jr.prototype.getSortedSymbolIndexes=function(s){if(this.sortedAngle===s&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var l=Math.sin(s),h=Math.cos(s),g=[],x=[],E=[],T=0;T<this.symbolInstances.length;++T){E.push(T);var M=this.symbolInstances.get(T);g.push(0|Math.round(l*M.anchorX+h*M.anchorY)),x.push(M.featureIndex)}return E.sort(function(D,N){return g[D]-g[N]||x[N]-x[D]}),E},Jr.prototype.addToSortKeyRanges=function(s,l){var h=this.sortKeyRanges[this.sortKeyRanges.length-1];h&&h.sortKey===l?h.symbolInstanceEnd=s+1:this.sortKeyRanges.push({sortKey:l,symbolInstanceStart:s,symbolInstanceEnd:s+1})},Jr.prototype.sortFeatures=function(s){var l=this;if(this.sortFeaturesByY&&this.sortedAngle!==s&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(s),this.sortedAngle=s,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var h=0,g=this.symbolInstanceIndexes;h<g.length;h+=1){var x=this.symbolInstances.get(g[h]);this.featureSortOrder.push(x.featureIndex),[x.rightJustifiedTextSymbolIndex,x.centerJustifiedTextSymbolIndex,x.leftJustifiedTextSymbolIndex].forEach(function(E,T,M){E>=0&&M.indexOf(E)===T&&l.addIndicesForPlacedSymbol(l.text,E)}),x.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,x.verticalPlacedTextSymbolIndex),x.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,x.placedIconSymbolIndex),x.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,x.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Kr("SymbolBucket",Jr,{omit:["layers","collisionBoxArray","features","compareText"]}),Jr.MAX_GLYPHS=65535,Jr.addDynamicAttributes=ir;var on=new ga({"symbol-placement":new dn(ie.layout_symbol["symbol-placement"]),"symbol-spacing":new dn(ie.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new dn(ie.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new nn(ie.layout_symbol["symbol-sort-key"]),"symbol-z-order":new dn(ie.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new dn(ie.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new dn(ie.layout_symbol["icon-ignore-placement"]),"icon-optional":new dn(ie.layout_symbol["icon-optional"]),"icon-rotation-alignment":new dn(ie.layout_symbol["icon-rotation-alignment"]),"icon-size":new nn(ie.layout_symbol["icon-size"]),"icon-text-fit":new dn(ie.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new dn(ie.layout_symbol["icon-text-fit-padding"]),"icon-image":new nn(ie.layout_symbol["icon-image"]),"icon-rotate":new nn(ie.layout_symbol["icon-rotate"]),"icon-padding":new dn(ie.layout_symbol["icon-padding"]),"icon-keep-upright":new dn(ie.layout_symbol["icon-keep-upright"]),"icon-offset":new nn(ie.layout_symbol["icon-offset"]),"icon-anchor":new nn(ie.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new dn(ie.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new dn(ie.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new dn(ie.layout_symbol["text-rotation-alignment"]),"text-field":new nn(ie.layout_symbol["text-field"]),"text-font":new nn(ie.layout_symbol["text-font"]),"text-size":new nn(ie.layout_symbol["text-size"]),"text-max-width":new nn(ie.layout_symbol["text-max-width"]),"text-line-height":new dn(ie.layout_symbol["text-line-height"]),"text-letter-spacing":new nn(ie.layout_symbol["text-letter-spacing"]),"text-justify":new nn(ie.layout_symbol["text-justify"]),"text-radial-offset":new nn(ie.layout_symbol["text-radial-offset"]),"text-variable-anchor":new dn(ie.layout_symbol["text-variable-anchor"]),"text-anchor":new nn(ie.layout_symbol["text-anchor"]),"text-max-angle":new dn(ie.layout_symbol["text-max-angle"]),"text-writing-mode":new dn(ie.layout_symbol["text-writing-mode"]),"text-rotate":new nn(ie.layout_symbol["text-rotate"]),"text-padding":new dn(ie.layout_symbol["text-padding"]),"text-keep-upright":new dn(ie.layout_symbol["text-keep-upright"]),"text-transform":new nn(ie.layout_symbol["text-transform"]),"text-offset":new nn(ie.layout_symbol["text-offset"]),"text-allow-overlap":new dn(ie.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new dn(ie.layout_symbol["text-ignore-placement"]),"text-optional":new dn(ie.layout_symbol["text-optional"])}),Pn={paint:new ga({"icon-opacity":new nn(ie.paint_symbol["icon-opacity"]),"icon-color":new nn(ie.paint_symbol["icon-color"]),"icon-halo-color":new nn(ie.paint_symbol["icon-halo-color"]),"icon-halo-width":new nn(ie.paint_symbol["icon-halo-width"]),"icon-halo-blur":new nn(ie.paint_symbol["icon-halo-blur"]),"icon-translate":new dn(ie.paint_symbol["icon-translate"]),"icon-translate-anchor":new dn(ie.paint_symbol["icon-translate-anchor"]),"text-opacity":new nn(ie.paint_symbol["text-opacity"]),"text-color":new nn(ie.paint_symbol["text-color"],{runtimeType:Pr,getOverride:function(s){return s.textColor},hasOverride:function(s){return!!s.textColor}}),"text-halo-color":new nn(ie.paint_symbol["text-halo-color"]),"text-halo-width":new nn(ie.paint_symbol["text-halo-width"]),"text-halo-blur":new nn(ie.paint_symbol["text-halo-blur"]),"text-translate":new dn(ie.paint_symbol["text-translate"]),"text-translate-anchor":new dn(ie.paint_symbol["text-translate-anchor"])}),layout:on},zn=function(s){this.type=s.property.overrides?s.property.overrides.runtimeType:qr,this.defaultValue=s};zn.prototype.evaluate=function(s){if(s.formattedSection){var l=this.defaultValue.property.overrides;if(l&&l.hasOverride(s.formattedSection))return l.getOverride(s.formattedSection)}return s.feature&&s.featureState?this.defaultValue.evaluate(s.feature,s.featureState):this.defaultValue.property.specification.default},zn.prototype.eachChild=function(s){this.defaultValue.isConstant()||s(this.defaultValue.value._styleExpression.expression)},zn.prototype.outputDefined=function(){return!1},zn.prototype.serialize=function(){return null},Kr("FormatSectionOverride",zn,{omit:["defaultValue"]});var Ui=function(s){function l(h){s.call(this,h,Pn)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.recalculate=function(h,g){if(s.prototype.recalculate.call(this,h,g),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")),this.layout.get("symbol-placement")==="point"){var x=this.layout.get("text-writing-mode");if(x){for(var E=[],T=0,M=x;T<M.length;T+=1){var D=M[T];E.indexOf(D)<0&&E.push(D)}this.layout._values["text-writing-mode"]=E}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},l.prototype.getValueAndResolveTokens=function(h,g,x,E){var T=this.layout.get(h).evaluate(g,{},x,E),M=this._unevaluatedLayout._values[h];return M.isDataDriven()||Jl(M.value)||!T?T:function(D,N){return N.replace(/{([^{}]+)}/g,function($,H){return H in D?String(D[H]):""})}(g.properties,T)},l.prototype.createBucket=function(h){return new Jr(h)},l.prototype.queryRadius=function(){return 0},l.prototype.queryIntersectsFeature=function(){return!1},l.prototype._setPaintOverrides=function(){for(var h=0,g=Pn.paint.overridableProperties;h<g.length;h+=1){var x=g[h];if(l.hasPaintOverride(this.layout,x)){var E,T=this.paint.get(x),M=new zn(T),D=new Tl(M,T.property.specification);E=T.value.kind==="constant"||T.value.kind==="source"?new ec("source",D):new tc("composite",D,T.value.zoomStops,T.value._interpolationType),this.paint._values[x]=new Lo(T.property,E,T.parameters)}}},l.prototype._handleOverridablePaintPropertyUpdate=function(h,g,x){return!(!this.layout||g.isDataDriven()||x.isDataDriven())&&l.hasPaintOverride(this.layout,h)},l.hasPaintOverride=function(h,g){var x=h.get("text-field"),E=Pn.paint.properties[g],T=!1,M=function($){for(var H=0,q=$;H<q.length;H+=1)if(E.overrides&&E.overrides.hasOverride(q[H]))return void(T=!0)};if(x.value.kind==="constant"&&x.value.value instanceof wa)M(x.value.value.sections);else if(x.value.kind==="source"){var D=function($){T||($ instanceof ro&&sa($.value)===Gi?M($.value.sections):$ instanceof Go?M($.sections):$.eachChild(D))},N=x.value;N._styleExpression&&D(N._styleExpression.expression)}return T},l}(Xs),fo={paint:new ga({"background-color":new dn(ie.paint_background["background-color"]),"background-pattern":new No(ie.paint_background["background-pattern"]),"background-opacity":new dn(ie.paint_background["background-opacity"])})},al=function(s){function l(h){s.call(this,h,fo)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l}(Xs),H0={paint:new ga({"raster-opacity":new dn(ie.paint_raster["raster-opacity"]),"raster-hue-rotate":new dn(ie.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new dn(ie.paint_raster["raster-brightness-min"]),"raster-brightness-max":new dn(ie.paint_raster["raster-brightness-max"]),"raster-saturation":new dn(ie.paint_raster["raster-saturation"]),"raster-contrast":new dn(ie.paint_raster["raster-contrast"]),"raster-resampling":new dn(ie.paint_raster["raster-resampling"]),"raster-fade-duration":new dn(ie.paint_raster["raster-fade-duration"])})},Pu=function(s){function l(h){s.call(this,h,H0)}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l}(Xs),g2=function(s){function l(h){s.call(this,h,{}),this.implementation=h}return s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l,l.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},l.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},l.prototype.recalculate=function(){},l.prototype.updateTransitions=function(){},l.prototype.hasTransition=function(){},l.prototype.serialize=function(){},l.prototype.onAdd=function(h){this.implementation.onAdd&&this.implementation.onAdd(h,h.painter.context.gl)},l.prototype.onRemove=function(h){this.implementation.onRemove&&this.implementation.onRemove(h,h.painter.context.gl)},l}(Xs),hc={circle:Xp,heatmap:Lh,hillshade:Ey,fill:a2,"fill-extrusion":l2,line:d2,symbol:Ui,background:al,raster:Pu},G0=b.HTMLImageElement,Tb=b.HTMLCanvasElement,wb=b.HTMLVideoElement,Cb=b.ImageData,_2=b.ImageBitmap,qp=function(s,l,h,g){this.context=s,this.format=h,this.texture=s.gl.createTexture(),this.update(l,g)};qp.prototype.update=function(s,l,h){var g=s.width,x=s.height,E=!(this.size&&this.size[0]===g&&this.size[1]===x||h),T=this.context,M=T.gl;if(this.useMipmap=!!(l&&l.useMipmap),M.bindTexture(M.TEXTURE_2D,this.texture),T.pixelStoreUnpackFlipY.set(!1),T.pixelStoreUnpack.set(1),T.pixelStoreUnpackPremultiplyAlpha.set(this.format===M.RGBA&&(!l||l.premultiply!==!1)),E)this.size=[g,x],s instanceof G0||s instanceof Tb||s instanceof wb||s instanceof Cb||_2&&s instanceof _2?M.texImage2D(M.TEXTURE_2D,0,this.format,this.format,M.UNSIGNED_BYTE,s):M.texImage2D(M.TEXTURE_2D,0,this.format,g,x,0,this.format,M.UNSIGNED_BYTE,s.data);else{var D=h||{x:0,y:0},N=D.x,$=D.y;s instanceof G0||s instanceof Tb||s instanceof wb||s instanceof Cb||_2&&s instanceof _2?M.texSubImage2D(M.TEXTURE_2D,0,N,$,M.RGBA,M.UNSIGNED_BYTE,s):M.texSubImage2D(M.TEXTURE_2D,0,N,$,g,x,M.RGBA,M.UNSIGNED_BYTE,s.data)}this.useMipmap&&this.isSizePowerOfTwo()&&M.generateMipmap(M.TEXTURE_2D)},qp.prototype.bind=function(s,l,h){var g=this.context.gl;g.bindTexture(g.TEXTURE_2D,this.texture),h!==g.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(h=g.LINEAR),s!==this.filter&&(g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,s),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,h||s),this.filter=s),l!==this.wrap&&(g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,l),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,l),this.wrap=l)},qp.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},qp.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Ly=function(s){var l=this;this._callback=s,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){l._triggered=!1,l._callback()})};Ly.prototype.trigger=function(){var s=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){s._triggered=!1,s._callback()},0))},Ly.prototype.remove=function(){delete this._channel,this._callback=function(){}};var nd=function(s,l,h){this.target=s,this.parent=l,this.mapId=h,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},Z(["receive","process"],this),this.invoker=new Ly(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Lt()?s:b};function Rb(s,l,h){var g=2*Math.PI*6378137/256/Math.pow(2,h);return[s*g-2*Math.PI*6378137/2,l*g-2*Math.PI*6378137/2]}nd.prototype.send=function(s,l,h,g,x){var E=this;x===void 0&&(x=!1);var T=Math.round(1e18*Math.random()).toString(36).substring(0,10);h&&(this.callbacks[T]=h);var M=st(this.globalScope)?void 0:[];return this.target.postMessage({id:T,type:s,hasCallback:!!h,targetMapId:g,mustQueue:x,sourceMapId:this.mapId,data:Wo(l,M)},M),{cancel:function(){h&&delete E.callbacks[T],E.target.postMessage({id:T,type:"<cancel>",targetMapId:g,sourceMapId:E.mapId})}}},nd.prototype.receive=function(s){var l=s.data,h=l.id;if(h&&(!l.targetMapId||this.mapId===l.targetMapId))if(l.type==="<cancel>"){delete this.tasks[h];var g=this.cancelCallbacks[h];delete this.cancelCallbacks[h],g&&g()}else Lt()||l.mustQueue?(this.tasks[h]=l,this.taskQueue.push(h),this.invoker.trigger()):this.processTask(h,l)},nd.prototype.process=function(){if(this.taskQueue.length){var s=this.taskQueue.shift(),l=this.tasks[s];delete this.tasks[s],this.taskQueue.length&&this.invoker.trigger(),l&&this.processTask(s,l)}},nd.prototype.processTask=function(s,l){var h=this;if(l.type==="<response>"){var g=this.callbacks[s];delete this.callbacks[s],g&&(l.error?g(Yi(l.error)):g(null,Yi(l.data)))}else{var x=!1,E=st(this.globalScope)?void 0:[],T=l.hasCallback?function($,H){x=!0,delete h.cancelCallbacks[s],h.target.postMessage({id:s,type:"<response>",sourceMapId:h.mapId,error:$?Wo($):null,data:Wo(H,E)},E)}:function($){x=!0},M=null,D=Yi(l.data);if(this.parent[l.type])M=this.parent[l.type](l.sourceMapId,D,T);else if(this.parent.getWorkerSource){var N=l.type.split(".");M=this.parent.getWorkerSource(l.sourceMapId,N[0],D.source)[N[1]](D,T)}else T(new Error("Could not find function "+l.type));!x&&M&&M.cancel&&(this.cancelCallbacks[s]=M.cancel)}},nd.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var bo=function(s,l){s&&(l?this.setSouthWest(s).setNorthEast(l):s.length===4?this.setSouthWest([s[0],s[1]]).setNorthEast([s[2],s[3]]):this.setSouthWest(s[0]).setNorthEast(s[1]))};bo.prototype.setNorthEast=function(s){return this._ne=s instanceof Ea?new Ea(s.lng,s.lat):Ea.convert(s),this},bo.prototype.setSouthWest=function(s){return this._sw=s instanceof Ea?new Ea(s.lng,s.lat):Ea.convert(s),this},bo.prototype.extend=function(s){var l,h,g=this._sw,x=this._ne;if(s instanceof Ea)l=s,h=s;else{if(!(s instanceof bo))return Array.isArray(s)?s.length===4||s.every(Array.isArray)?this.extend(bo.convert(s)):this.extend(Ea.convert(s)):this;if(h=s._ne,!(l=s._sw)||!h)return this}return g||x?(g.lng=Math.min(l.lng,g.lng),g.lat=Math.min(l.lat,g.lat),x.lng=Math.max(h.lng,x.lng),x.lat=Math.max(h.lat,x.lat)):(this._sw=new Ea(l.lng,l.lat),this._ne=new Ea(h.lng,h.lat)),this},bo.prototype.getCenter=function(){return new Ea((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},bo.prototype.getSouthWest=function(){return this._sw},bo.prototype.getNorthEast=function(){return this._ne},bo.prototype.getNorthWest=function(){return new Ea(this.getWest(),this.getNorth())},bo.prototype.getSouthEast=function(){return new Ea(this.getEast(),this.getSouth())},bo.prototype.getWest=function(){return this._sw.lng},bo.prototype.getSouth=function(){return this._sw.lat},bo.prototype.getEast=function(){return this._ne.lng},bo.prototype.getNorth=function(){return this._ne.lat},bo.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},bo.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},bo.prototype.isEmpty=function(){return!(this._sw&&this._ne)},bo.prototype.contains=function(s){var l=Ea.convert(s),h=l.lng,g=l.lat,x=this._sw.lng<=h&&h<=this._ne.lng;return this._sw.lng>this._ne.lng&&(x=this._sw.lng>=h&&h>=this._ne.lng),this._sw.lat<=g&&g<=this._ne.lat&&x},bo.convert=function(s){return!s||s instanceof bo?s:new bo(s)};var Ea=function(s,l){if(isNaN(s)||isNaN(l))throw new Error("Invalid LngLat object: ("+s+", "+l+")");if(this.lng=+s,this.lat=+l,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Ea.prototype.wrap=function(){return new Ea(k(this.lng,-180,180),this.lat)},Ea.prototype.toArray=function(){return[this.lng,this.lat]},Ea.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Ea.prototype.distanceTo=function(s){var l=Math.PI/180,h=this.lat*l,g=s.lat*l,x=Math.sin(h)*Math.sin(g)+Math.cos(h)*Math.cos(g)*Math.cos((s.lng-this.lng)*l);return 63710088e-1*Math.acos(Math.min(x,1))},Ea.prototype.toBounds=function(s){s===void 0&&(s=0);var l=360*s/40075017,h=l/Math.cos(Math.PI/180*this.lat);return new bo(new Ea(this.lng-h,this.lat-l),new Ea(this.lng+h,this.lat+l))},Ea.convert=function(s){if(s instanceof Ea)return s;if(Array.isArray(s)&&(s.length===2||s.length===3))return new Ea(Number(s[0]),Number(s[1]));if(!Array.isArray(s)&&typeof s=="object"&&s!==null)return new Ea(Number("lng"in s?s.lng:s.lon),Number(s.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Ib=2*Math.PI*63710088e-1;function Mb(s){return Ib*Math.cos(s*Math.PI/180)}function Pb(s){return(180+s)/360}function Ob(s){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s*Math.PI/360)))/360}function kb(s,l){return s/Mb(l)}function Ny(s){return 360/Math.PI*Math.atan(Math.exp((180-360*s)*Math.PI/180))-90}var Kp=function(s,l,h){h===void 0&&(h=0),this.x=+s,this.y=+l,this.z=+h};Kp.fromLngLat=function(s,l){l===void 0&&(l=0);var h=Ea.convert(s);return new Kp(Pb(h.lng),Ob(h.lat),kb(l,h.lat))},Kp.prototype.toLngLat=function(){return new Ea(360*this.x-180,Ny(this.y))},Kp.prototype.toAltitude=function(){return this.z*Mb(Ny(this.y))},Kp.prototype.meterInMercatorCoordinateUnits=function(){return 1/Ib*(s=Ny(this.y),1/Math.cos(s*Math.PI/180));var s};var Qp=function(s,l,h){this.z=s,this.x=l,this.y=h,this.key=W0(0,s,s,l,h)};Qp.prototype.equals=function(s){return this.z===s.z&&this.x===s.x&&this.y===s.y},Qp.prototype.url=function(s,l){var h,g,x,E,T,M=(g=this.y,x=this.z,E=Rb(256*(h=this.x),256*(g=Math.pow(2,x)-g-1),x),T=Rb(256*(h+1),256*(g+1),x),E[0]+","+E[1]+","+T[0]+","+T[1]),D=function(N,$,H){for(var q,re="",xe=N;xe>0;xe--)re+=($&(q=1<<xe-1)?1:0)+(H&q?2:0);return re}(this.z,this.x,this.y);return s[(this.x+this.y)%s.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(l==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",D).replace("{bbox-epsg-3857}",M)},Qp.prototype.getTilePoint=function(s){var l=Math.pow(2,this.z);return new m(8192*(s.x*l-this.x),8192*(s.y*l-this.y))},Qp.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Db=function(s,l){this.wrap=s,this.canonical=l,this.key=W0(s,l.z,l.z,l.x,l.y)},Eo=function(s,l,h,g,x){this.overscaledZ=s,this.wrap=l,this.canonical=new Qp(h,+g,+x),this.key=W0(l,s,h,g,x)};function W0(s,l,h,g,x){(s*=2)<0&&(s=-1*s-1);var E=1<<h;return(E*E*s+E*x+g).toString(36)+h.toString(36)+l.toString(36)}Eo.prototype.equals=function(s){return this.overscaledZ===s.overscaledZ&&this.wrap===s.wrap&&this.canonical.equals(s.canonical)},Eo.prototype.scaledTo=function(s){var l=this.canonical.z-s;return s>this.canonical.z?new Eo(s,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Eo(s,this.wrap,s,this.canonical.x>>l,this.canonical.y>>l)},Eo.prototype.calculateScaledKey=function(s,l){var h=this.canonical.z-s;return s>this.canonical.z?W0(this.wrap*+l,s,this.canonical.z,this.canonical.x,this.canonical.y):W0(this.wrap*+l,s,s,this.canonical.x>>h,this.canonical.y>>h)},Eo.prototype.isChildOf=function(s){if(s.wrap!==this.wrap)return!1;var l=this.canonical.z-s.canonical.z;return s.overscaledZ===0||s.overscaledZ<this.overscaledZ&&s.canonical.x===this.canonical.x>>l&&s.canonical.y===this.canonical.y>>l},Eo.prototype.children=function(s){if(this.overscaledZ>=s)return[new Eo(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var l=this.canonical.z+1,h=2*this.canonical.x,g=2*this.canonical.y;return[new Eo(l,this.wrap,l,h,g),new Eo(l,this.wrap,l,h+1,g),new Eo(l,this.wrap,l,h,g+1),new Eo(l,this.wrap,l,h+1,g+1)]},Eo.prototype.isLessThan=function(s){return this.wrap<s.wrap||!(this.wrap>s.wrap)&&(this.overscaledZ<s.overscaledZ||!(this.overscaledZ>s.overscaledZ)&&(this.canonical.x<s.canonical.x||!(this.canonical.x>s.canonical.x)&&this.canonical.y<s.canonical.y))},Eo.prototype.wrapped=function(){return new Eo(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Eo.prototype.unwrapTo=function(s){return new Eo(this.overscaledZ,s,this.canonical.z,this.canonical.x,this.canonical.y)},Eo.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Eo.prototype.toUnwrapped=function(){return new Db(this.wrap,this.canonical)},Eo.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Eo.prototype.getTilePoint=function(s){return this.canonical.getTilePoint(new Kp(s.x-this.wrap,s.y))},Kr("CanonicalTileID",Qp),Kr("OverscaledTileID",Eo,{omit:["posMatrix"]});var jf=function(s,l,h){if(this.uid=s,l.height!==l.width)throw new RangeError("DEM tiles must be square");if(h&&h!=="mapbox"&&h!=="terrarium")return ye('"'+h+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=l.height;var g=this.dim=l.height-2;this.data=new Uint32Array(l.data.buffer),this.encoding=h||"mapbox";for(var x=0;x<g;x++)this.data[this._idx(-1,x)]=this.data[this._idx(0,x)],this.data[this._idx(g,x)]=this.data[this._idx(g-1,x)],this.data[this._idx(x,-1)]=this.data[this._idx(x,0)],this.data[this._idx(x,g)]=this.data[this._idx(x,g-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(g,-1)]=this.data[this._idx(g-1,0)],this.data[this._idx(-1,g)]=this.data[this._idx(0,g-1)],this.data[this._idx(g,g)]=this.data[this._idx(g-1,g-1)]};jf.prototype.get=function(s,l){var h=new Uint8Array(this.data.buffer),g=4*this._idx(s,l);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(h[g],h[g+1],h[g+2])},jf.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},jf.prototype._idx=function(s,l){if(s<-1||s>=this.dim+1||l<-1||l>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(l+1)*this.stride+(s+1)},jf.prototype._unpackMapbox=function(s,l,h){return(256*s*256+256*l+h)/10-1e4},jf.prototype._unpackTerrarium=function(s,l,h){return 256*s+l+h/256-32768},jf.prototype.getPixels=function(){return new os({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},jf.prototype.backfillBorder=function(s,l,h){if(this.dim!==s.dim)throw new Error("dem dimension mismatch");var g=l*this.dim,x=l*this.dim+this.dim,E=h*this.dim,T=h*this.dim+this.dim;switch(l){case-1:g=x-1;break;case 1:x=g+1}switch(h){case-1:E=T-1;break;case 1:T=E+1}for(var M=-l*this.dim,D=-h*this.dim,N=E;N<T;N++)for(var $=g;$<x;$++)this.data[this._idx($,N)]=s.data[this._idx($+M,N+D)]},Kr("DEMData",jf);var y2=function(s){this._stringToNumber={},this._numberToString=[];for(var l=0;l<s.length;l++){var h=s[l];this._stringToNumber[h]=l,this._numberToString[l]=h}};y2.prototype.encode=function(s){return this._stringToNumber[s]},y2.prototype.decode=function(s){return this._numberToString[s]};var x2=function(s,l,h,g,x){this.type="Feature",this._vectorTileFeature=s,s._z=l,s._x=h,s._y=g,this.properties=s.properties,this.id=x},Uy={geometry:{configurable:!0}};Uy.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Uy.geometry.set=function(s){this._geometry=s},x2.prototype.toJSON=function(){var s={geometry:this.geometry};for(var l in this)l!=="_geometry"&&l!=="_vectorTileFeature"&&(s[l]=this[l]);return s},Object.defineProperties(x2.prototype,Uy);var id=function(){this.state={},this.stateChanges={},this.deletedStates={}};id.prototype.updateState=function(s,l,h){var g=String(l);if(this.stateChanges[s]=this.stateChanges[s]||{},this.stateChanges[s][g]=this.stateChanges[s][g]||{},L(this.stateChanges[s][g],h),this.deletedStates[s]===null)for(var x in this.deletedStates[s]={},this.state[s])x!==g&&(this.deletedStates[s][x]=null);else if(this.deletedStates[s]&&this.deletedStates[s][g]===null)for(var E in this.deletedStates[s][g]={},this.state[s][g])h[E]||(this.deletedStates[s][g][E]=null);else for(var T in h)this.deletedStates[s]&&this.deletedStates[s][g]&&this.deletedStates[s][g][T]===null&&delete this.deletedStates[s][g][T]},id.prototype.removeFeatureState=function(s,l,h){if(this.deletedStates[s]!==null){var g=String(l);if(this.deletedStates[s]=this.deletedStates[s]||{},h&&l!==void 0)this.deletedStates[s][g]!==null&&(this.deletedStates[s][g]=this.deletedStates[s][g]||{},this.deletedStates[s][g][h]=null);else if(l!==void 0)if(this.stateChanges[s]&&this.stateChanges[s][g])for(h in this.deletedStates[s][g]={},this.stateChanges[s][g])this.deletedStates[s][g][h]=null;else this.deletedStates[s][g]=null;else this.deletedStates[s]=null}},id.prototype.getState=function(s,l){var h=String(l),g=L({},(this.state[s]||{})[h],(this.stateChanges[s]||{})[h]);if(this.deletedStates[s]===null)return{};if(this.deletedStates[s]){var x=this.deletedStates[s][l];if(x===null)return{};for(var E in x)delete g[E]}return g},id.prototype.initializeTileState=function(s,l){s.setFeatureState(this.state,l)},id.prototype.coalesceChanges=function(s,l){var h={};for(var g in this.stateChanges){this.state[g]=this.state[g]||{};var x={};for(var E in this.stateChanges[g])this.state[g][E]||(this.state[g][E]={}),L(this.state[g][E],this.stateChanges[g][E]),x[E]=this.state[g][E];h[g]=x}for(var T in this.deletedStates){this.state[T]=this.state[T]||{};var M={};if(this.deletedStates[T]===null)for(var D in this.state[T])M[D]={},this.state[T][D]={};else for(var N in this.deletedStates[T]){if(this.deletedStates[T][N]===null)this.state[T][N]={};else for(var $=0,H=Object.keys(this.deletedStates[T][N]);$<H.length;$+=1)delete this.state[T][N][H[$]];M[N]=this.state[T][N]}h[T]=h[T]||{},L(h[T],M)}if(this.stateChanges={},this.deletedStates={},Object.keys(h).length!==0)for(var q in s)s[q].setFeatureState(h,l)};var Hf=function(s,l){this.tileID=s,this.x=s.canonical.x,this.y=s.canonical.y,this.z=s.canonical.z,this.grid=new io(8192,16,0),this.grid3D=new io(8192,16,0),this.featureIndexArray=new X,this.promoteId=l};function Fb(s,l,h,g,x){return Ie(s,function(E,T){var M=l instanceof kc?l.get(T):null;return M&&M.evaluate?M.evaluate(h,g,x):M})}function Bb(s){for(var l=1/0,h=1/0,g=-1/0,x=-1/0,E=0,T=s;E<T.length;E+=1){var M=T[E];l=Math.min(l,M.x),h=Math.min(h,M.y),g=Math.max(g,M.x),x=Math.max(x,M.y)}return{minX:l,minY:h,maxX:g,maxY:x}}function rk(s,l){return l-s}Hf.prototype.insert=function(s,l,h,g,x,E){var T=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(h,g,x);for(var M=E?this.grid3D:this.grid,D=0;D<l.length;D++){for(var N=l[D],$=[1/0,1/0,-1/0,-1/0],H=0;H<N.length;H++){var q=N[H];$[0]=Math.min($[0],q.x),$[1]=Math.min($[1],q.y),$[2]=Math.max($[2],q.x),$[3]=Math.max($[3],q.y)}$[0]<8192&&$[1]<8192&&$[2]>=0&&$[3]>=0&&M.insert(T,$[0],$[1],$[2],$[3])}},Hf.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new jc.VectorTile(new xt(this.rawTileData)).layers,this.sourceLayerCoder=new y2(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Hf.prototype.query=function(s,l,h,g){var x=this;this.loadVTLayers();for(var E=s.params||{},T=8192/s.tileSize/s.scale,M=Cl(E.filter),D=s.queryGeometry,N=s.queryPadding*T,$=Bb(D),H=this.grid.query($.minX-N,$.minY-N,$.maxX+N,$.maxY+N),q=Bb(s.cameraQueryGeometry),re=this.grid3D.query(q.minX-N,q.minY-N,q.maxX+N,q.maxY+N,function(St,It,Xt,Er){return function(kr,mn,Gr,An,Zr){for(var li=0,Ln=kr;li<Ln.length;li+=1){var sn=Ln[li];if(mn<=sn.x&&Gr<=sn.y&&An>=sn.x&&Zr>=sn.y)return!0}var di=[new m(mn,Gr),new m(mn,Zr),new m(An,Zr),new m(An,Gr)];if(kr.length>2){for(var Qn=0,Pi=di;Qn<Pi.length;Qn+=1)if(lu(kr,Pi[Qn]))return!0}for(var Tn=0;Tn<kr.length-1;Tn++)if(Fl(kr[Tn],kr[Tn+1],di))return!0;return!1}(s.cameraQueryGeometry,St-N,It-N,Xt+N,Er+N)}),xe=0,Se=re;xe<Se.length;xe+=1)H.push(Se[xe]);H.sort(rk);for(var ze,Oe={},et=function(St){var It=H[St];if(It!==ze){ze=It;var Xt=x.featureIndexArray.get(It),Er=null;x.loadMatchingFeature(Oe,Xt.bucketIndex,Xt.sourceLayerIndex,Xt.featureIndex,M,E.layers,E.availableImages,l,h,g,function(kr,mn,Gr){return Er||(Er=_a(kr)),mn.queryIntersectsFeature(D,kr,Gr,Er,x.z,s.transform,T,s.pixelPosMatrix)})}},ut=0;ut<H.length;ut++)et(ut);return Oe},Hf.prototype.loadMatchingFeature=function(s,l,h,g,x,E,T,M,D,N,$){var H=this.bucketLayerIDs[l];if(!E||function(kr,mn){for(var Gr=0;Gr<kr.length;Gr++)if(mn.indexOf(kr[Gr])>=0)return!0;return!1}(E,H)){var q=this.sourceLayerCoder.decode(h),re=this.vtLayers[q].feature(g);if(x.needGeometry){var xe=ba(re,!0);if(!x.filter(new Zn(this.tileID.overscaledZ),xe,this.tileID.canonical))return}else if(!x.filter(new Zn(this.tileID.overscaledZ),re))return;for(var Se=this.getId(re,q),ze=0;ze<H.length;ze++){var Oe=H[ze];if(!(E&&E.indexOf(Oe)<0)){var et=M[Oe];if(et){var ut={};Se!==void 0&&N&&(ut=N.getState(et.sourceLayer||"_geojsonTileLayer",Se));var St=L({},D[Oe]);St.paint=Fb(St.paint,et.paint,re,ut,T),St.layout=Fb(St.layout,et.layout,re,ut,T);var It=!$||$(re,et,ut);if(It){var Xt=new x2(re,this.z,this.x,this.y,Se);Xt.layer=St;var Er=s[Oe];Er===void 0&&(Er=s[Oe]=[]),Er.push({featureIndex:g,feature:Xt,intersectionZ:It})}}}}}},Hf.prototype.lookupSymbolFeatures=function(s,l,h,g,x,E,T,M){var D={};this.loadVTLayers();for(var N=Cl(x),$=0,H=s;$<H.length;$+=1)this.loadMatchingFeature(D,h,g,H[$],N,E,T,M,l);return D},Hf.prototype.hasLayer=function(s){for(var l=0,h=this.bucketLayerIDs;l<h.length;l+=1)for(var g=0,x=h[l];g<x.length;g+=1)if(s===x[g])return!0;return!1},Hf.prototype.getId=function(s,l){var h=s.id;return this.promoteId&&typeof(h=s.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[l]])=="boolean"&&(h=Number(h)),h},Kr("FeatureIndex",Hf,{omit:["rawTileData","sourceLayerCoder"]});var $o=function(s,l){this.tileID=s,this.uid=V(),this.uses=0,this.tileSize=l,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};$o.prototype.registerFadeDuration=function(s){var l=s+this.timeAdded;l<gi.now()||this.fadeEndTime&&l<this.fadeEndTime||(this.fadeEndTime=l)},$o.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},$o.prototype.loadVectorData=function(s,l,h){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",s){for(var g in s.featureIndex&&(this.latestFeatureIndex=s.featureIndex,s.rawTileData?(this.latestRawTileData=s.rawTileData,this.latestFeatureIndex.rawTileData=s.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=s.collisionBoxArray,this.buckets=function(N,$){var H={};if(!$)return H;for(var q=function(){var Se=xe[re],ze=Se.layerIds.map(function(ut){return $.getLayer(ut)}).filter(Boolean);if(ze.length!==0){Se.layers=ze,Se.stateDependentLayerIds&&(Se.stateDependentLayers=Se.stateDependentLayerIds.map(function(ut){return ze.filter(function(St){return St.id===ut})[0]}));for(var Oe=0,et=ze;Oe<et.length;Oe+=1)H[et[Oe].id]=Se}},re=0,xe=N;re<xe.length;re+=1)q();return H}(s.buckets,l.style),this.hasSymbolBuckets=!1,this.buckets){var x=this.buckets[g];if(x instanceof Jr){if(this.hasSymbolBuckets=!0,!h)break;x.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var E in this.buckets){var T=this.buckets[E];if(T instanceof Jr&&T.hasRTLText){this.hasRTLText=!0,Ms.isLoading()||Ms.isLoaded()||jp()!=="deferred"||_s();break}}for(var M in this.queryPadding=0,this.buckets){var D=this.buckets[M];this.queryPadding=Math.max(this.queryPadding,l.style.getLayer(M).queryRadius(D))}s.imageAtlas&&(this.imageAtlas=s.imageAtlas),s.glyphAtlasImage&&(this.glyphAtlasImage=s.glyphAtlasImage)}else this.collisionBoxArray=new v},$o.prototype.unloadVectorData=function(){for(var s in this.buckets)this.buckets[s].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},$o.prototype.getBucket=function(s){return this.buckets[s.id]},$o.prototype.upload=function(s){for(var l in this.buckets){var h=this.buckets[l];h.uploadPending()&&h.upload(s)}var g=s.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new qp(s,this.imageAtlas.image,g.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new qp(s,this.glyphAtlasImage,g.ALPHA),this.glyphAtlasImage=null)},$o.prototype.prepare=function(s){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(s,this.imageAtlasTexture)},$o.prototype.queryRenderedFeatures=function(s,l,h,g,x,E,T,M,D,N){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:g,cameraQueryGeometry:x,scale:E,tileSize:this.tileSize,pixelPosMatrix:N,transform:M,params:T,queryPadding:this.queryPadding*D},s,l,h):{}},$o.prototype.querySourceFeatures=function(s,l){var h=this.latestFeatureIndex;if(h&&h.rawTileData){var g=h.loadVTLayers(),x=l?l.sourceLayer:"",E=g._geojsonTileLayer||g[x];if(E)for(var T=Cl(l&&l.filter),M=this.tileID.canonical,D=M.z,N=M.x,$=M.y,H={z:D,x:N,y:$},q=0;q<E.length;q++){var re=E.feature(q);if(T.needGeometry){var xe=ba(re,!0);if(!T.filter(new Zn(this.tileID.overscaledZ),xe,this.tileID.canonical))continue}else if(!T.filter(new Zn(this.tileID.overscaledZ),re))continue;var Se=h.getId(re,x),ze=new x2(re,D,N,$,Se);ze.tile=H,s.push(ze)}}},$o.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},$o.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},$o.prototype.setExpiryData=function(s){var l=this.expirationTime;if(s.cacheControl){var h=Gt(s.cacheControl);h["max-age"]&&(this.expirationTime=Date.now()+1e3*h["max-age"])}else s.expires&&(this.expirationTime=new Date(s.expires).getTime());if(this.expirationTime){var g=Date.now(),x=!1;if(this.expirationTime>g)x=!1;else if(l)if(this.expirationTime<l)x=!0;else{var E=this.expirationTime-l;E?this.expirationTime=g+Math.max(E,3e4):x=!0}else x=!0;x?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},$o.prototype.getExpiryTimeout=function(){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)},$o.prototype.setFeatureState=function(s,l){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&Object.keys(s).length!==0){var h=this.latestFeatureIndex.loadVTLayers();for(var g in this.buckets)if(l.style.hasLayer(g)){var x=this.buckets[g],E=x.layers[0].sourceLayer||"_geojsonTileLayer",T=h[E],M=s[E];if(T&&M&&Object.keys(M).length!==0){x.update(M,T,this.imageAtlas&&this.imageAtlas.patternPositions||{});var D=l&&l.style&&l.style.getLayer(g);D&&(this.queryPadding=Math.max(this.queryPadding,D.queryRadius(x)))}}}},$o.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},$o.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<gi.now()},$o.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},$o.prototype.setHoldDuration=function(s){this.symbolFadeHoldUntil=gi.now()+s},$o.prototype.setDependencies=function(s,l){for(var h={},g=0,x=l;g<x.length;g+=1)h[x[g]]=!0;this.dependencies[s]=h},$o.prototype.hasDependency=function(s,l){for(var h=0,g=s;h<g.length;h+=1){var x=this.dependencies[g[h]];if(x){for(var E=0,T=l;E<T.length;E+=1)if(x[T[E]])return!0}}return!1};var $h=b.performance,Lb=function(s){this._marks={start:[s.url,"start"].join("#"),end:[s.url,"end"].join("#"),measure:s.url.toString()},$h.mark(this._marks.start)};Lb.prototype.finish=function(){$h.mark(this._marks.end);var s=$h.getEntriesByName(this._marks.measure);return s.length===0&&($h.measure(this._marks.measure,this._marks.start,this._marks.end),s=$h.getEntriesByName(this._marks.measure),$h.clearMarks(this._marks.start),$h.clearMarks(this._marks.end),$h.clearMeasures(this._marks.measure)),s},a.Actor=nd,a.AlphaImage=Lc,a.CanonicalTileID=Qp,a.CollisionBoxArray=v,a.Color=si,a.DEMData=jf,a.DataConstantProperty=dn,a.DictionaryCoder=y2,a.EXTENT=8192,a.ErrorEvent=je,a.EvaluationParameters=Zn,a.Event=Ee,a.Evented=Ye,a.FeatureIndex=Hf,a.FillBucket=nl,a.FillExtrusionBucket=qo,a.ImageAtlas=Wt,a.ImagePosition=Br,a.LineBucket=us,a.LngLat=Ea,a.LngLatBounds=bo,a.MercatorCoordinate=Kp,a.ONE_EM=24,a.OverscaledTileID=Eo,a.Point=m,a.Point$1=m,a.Properties=ga,a.Protobuf=xt,a.RGBAImage=os,a.RequestManager=ft,a.RequestPerformance=Lb,a.ResourceType=qn,a.SegmentVector=ae,a.SourceFeatureState=id,a.StructArrayLayout1ui2=kh,a.StructArrayLayout2f1f2i16=oc,a.StructArrayLayout2i4=Ol,a.StructArrayLayout3ui6=Cu,a.StructArrayLayout4i8=Ih,a.SymbolBucket=Jr,a.Texture=qp,a.Tile=$o,a.Transitionable=go,a.Uniform1f=Tr,a.Uniform1i=qt,a.Uniform2f=yr,a.Uniform3f=$r,a.Uniform4f=vn,a.UniformColor=bn,a.UniformMatrix4f=Si,a.UnwrappedTileID=Db,a.ValidationError=Ce,a.WritingMode=Sn,a.ZoomHistory=Ah,a.add=function(s,l,h){return s[0]=l[0]+h[0],s[1]=l[1]+h[1],s[2]=l[2]+h[2],s},a.addDynamicAttributes=ir,a.asyncAll=function(s,l,h){if(!s.length)return h(null,[]);var g=s.length,x=new Array(s.length),E=null;s.forEach(function(T,M){l(T,function(D,N){D&&(E=D),x[M]=N,--g==0&&h(E,x)})})},a.bezier=w,a.bindAll=Z,a.browser=gi,a.cacheEntryPossiblyAdded=function(s){++Jn>qe&&(s.getActor().send("enforceCacheSizeLimit",Ne),Jn=0)},a.clamp=P,a.clearTileCache=function(s){var l=b.caches.delete("mapbox-tiles");s&&l.catch(s).then(function(){return s()})},a.clipLine=il,a.clone=function(s){var l=new vi(16);return l[0]=s[0],l[1]=s[1],l[2]=s[2],l[3]=s[3],l[4]=s[4],l[5]=s[5],l[6]=s[6],l[7]=s[7],l[8]=s[8],l[9]=s[9],l[10]=s[10],l[11]=s[11],l[12]=s[12],l[13]=s[13],l[14]=s[14],l[15]=s[15],l},a.clone$1=se,a.clone$2=function(s){var l=new vi(3);return l[0]=s[0],l[1]=s[1],l[2]=s[2],l},a.collisionCircleLayout=U,a.config=Je,a.create=function(){var s=new vi(16);return vi!=Float32Array&&(s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=0,s[12]=0,s[13]=0,s[14]=0),s[0]=1,s[5]=1,s[10]=1,s[15]=1,s},a.create$1=function(){var s=new vi(9);return vi!=Float32Array&&(s[1]=0,s[2]=0,s[3]=0,s[5]=0,s[6]=0,s[7]=0),s[0]=1,s[4]=1,s[8]=1,s},a.create$2=function(){var s=new vi(4);return vi!=Float32Array&&(s[1]=0,s[2]=0),s[0]=1,s[3]=1,s},a.createCommonjsModule=u,a.createExpression=Cc,a.createLayout=ao,a.createStyleLayer=function(s){return s.type==="custom"?new g2(s):new hc[s.type](s)},a.cross=function(s,l,h){var g=l[0],x=l[1],E=l[2],T=h[0],M=h[1],D=h[2];return s[0]=x*D-E*M,s[1]=E*T-g*D,s[2]=g*M-x*T,s},a.deepEqual=function s(l,h){if(Array.isArray(l)){if(!Array.isArray(h)||l.length!==h.length)return!1;for(var g=0;g<l.length;g++)if(!s(l[g],h[g]))return!1;return!0}if(typeof l=="object"&&l!==null&&h!==null){if(typeof h!="object"||Object.keys(l).length!==Object.keys(h).length)return!1;for(var x in l)if(!s(l[x],h[x]))return!1;return!0}return l===h},a.dot=function(s,l){return s[0]*l[0]+s[1]*l[1]+s[2]*l[2]},a.dot$1=function(s,l){return s[0]*l[0]+s[1]*l[1]+s[2]*l[2]+s[3]*l[3]},a.ease=R,a.emitValidationErrors=Ml,a.endsWith=ve,a.enforceCacheSizeLimit=function(s){ct(),Ge&&Ge.then(function(l){l.keys().then(function(h){for(var g=0;g<h.length-s;g++)l.delete(h[g])})})},a.evaluateSizeForFeature=Ko,a.evaluateSizeForZoom=co,a.evaluateVariableOffset=We,a.evented=Rh,a.extend=L,a.featureFilter=Cl,a.filterObject=de,a.fromRotation=function(s,l){var h=Math.sin(l),g=Math.cos(l);return s[0]=g,s[1]=h,s[2]=0,s[3]=-h,s[4]=g,s[5]=0,s[6]=0,s[7]=0,s[8]=1,s},a.getAnchorAlignment=la,a.getAnchorJustification=Ze,a.getArrayBuffer=Hi,a.getImage=Y,a.getJSON=function(s,l){return ti(L(s,{type:"json"}),l)},a.getRTLTextPluginStatus=jp,a.getReferrer=fn,a.getVideo=function(s,l){var h,g,x=b.document.createElement("video");x.muted=!0,x.onloadstart=function(){l(null,x)};for(var E=0;E<s.length;E++){var T=b.document.createElement("source");h=s[E],g=void 0,(g=b.document.createElement("a")).href=h,(g.protocol!==b.document.location.protocol||g.host!==b.document.location.host)&&(x.crossOrigin="Anonymous"),T.src=s[E],x.appendChild(T)}return{cancel:function(){}}},a.identity=yo,a.invert=function(s,l){var h=l[0],g=l[1],x=l[2],E=l[3],T=l[4],M=l[5],D=l[6],N=l[7],$=l[8],H=l[9],q=l[10],re=l[11],xe=l[12],Se=l[13],ze=l[14],Oe=l[15],et=h*M-g*T,ut=h*D-x*T,St=h*N-E*T,It=g*D-x*M,Xt=g*N-E*M,Er=x*N-E*D,kr=$*Se-H*xe,mn=$*ze-q*xe,Gr=$*Oe-re*xe,An=H*ze-q*Se,Zr=H*Oe-re*Se,li=q*Oe-re*ze,Ln=et*li-ut*Zr+St*An+It*Gr-Xt*mn+Er*kr;return Ln?(s[0]=(M*li-D*Zr+N*An)*(Ln=1/Ln),s[1]=(x*Zr-g*li-E*An)*Ln,s[2]=(Se*Er-ze*Xt+Oe*It)*Ln,s[3]=(q*Xt-H*Er-re*It)*Ln,s[4]=(D*Gr-T*li-N*mn)*Ln,s[5]=(h*li-x*Gr+E*mn)*Ln,s[6]=(ze*St-xe*Er-Oe*ut)*Ln,s[7]=($*Er-q*St+re*ut)*Ln,s[8]=(T*Zr-M*Gr+N*kr)*Ln,s[9]=(g*Gr-h*Zr-E*kr)*Ln,s[10]=(xe*Xt-Se*St+Oe*et)*Ln,s[11]=(H*St-$*Xt-re*et)*Ln,s[12]=(M*mn-T*An-D*kr)*Ln,s[13]=(h*An-g*mn+x*kr)*Ln,s[14]=(Se*ut-xe*It-ze*et)*Ln,s[15]=($*It-H*ut+q*et)*Ln,s):null},a.isChar=Dr,a.isMapboxURL=At,a.keysDifference=function(s,l){var h=[];for(var g in s)g in l||h.push(g);return h},a.makeRequest=ti,a.mapObject=Ie,a.mercatorXfromLng=Pb,a.mercatorYfromLat=Ob,a.mercatorZfromAltitude=kb,a.mul=Fh,a.multiply=Va,a.mvt=jc,a.nextPowerOfTwo=function(s){return s<=1?1:Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))},a.normalize=function(s,l){var h=l[0],g=l[1],x=l[2],E=h*h+g*g+x*x;return E>0&&(E=1/Math.sqrt(E)),s[0]=l[0]*E,s[1]=l[1]*E,s[2]=l[2]*E,s},a.number=Ra,a.offscreenCanvasSupported=Ri,a.ortho=function(s,l,h,g,x,E,T){var M=1/(l-h),D=1/(g-x),N=1/(E-T);return s[0]=-2*M,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=-2*D,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=2*N,s[11]=0,s[12]=(l+h)*M,s[13]=(x+g)*D,s[14]=(T+E)*N,s[15]=1,s},a.parseGlyphPBF=function(s){return new xt(s).readFields(er,[])},a.pbf=xt,a.performSymbolLayout=function(s,l,h,g,x,E,T){s.createArrays(),s.tilePixelRatio=8192/(512*s.overscaling),s.compareText={},s.iconsNeedLinear=!1;var M=s.layers[0].layout,D=s.layers[0]._unevaluatedLayout._values,N={};if(s.textSizeData.kind==="composite"){var $=s.textSizeData,H=$.maxZoom;N.compositeTextSizes=[D["text-size"].possiblyEvaluate(new Zn($.minZoom),T),D["text-size"].possiblyEvaluate(new Zn(H),T)]}if(s.iconSizeData.kind==="composite"){var q=s.iconSizeData,re=q.maxZoom;N.compositeIconSizes=[D["icon-size"].possiblyEvaluate(new Zn(q.minZoom),T),D["icon-size"].possiblyEvaluate(new Zn(re),T)]}N.layoutTextSize=D["text-size"].possiblyEvaluate(new Zn(s.zoom+1),T),N.layoutIconSize=D["icon-size"].possiblyEvaluate(new Zn(s.zoom+1),T),N.textMaxSize=D["text-size"].possiblyEvaluate(new Zn(18));for(var xe=24*M.get("text-line-height"),Se=M.get("text-rotation-alignment")==="map"&&M.get("symbol-placement")!=="point",ze=M.get("text-keep-upright"),Oe=M.get("text-size"),et=function(){var It=St[ut],Xt=M.get("text-font").evaluate(It,{},T).join(","),Er=Oe.evaluate(It,{},T),kr=N.layoutTextSize.evaluate(It,{},T),mn=N.layoutIconSize.evaluate(It,{},T),Gr={horizontal:{},vertical:void 0},An=It.text,Zr=[0,0];if(An){var li=An.toString(),Ln=24*M.get("text-letter-spacing").evaluate(It,{},T),sn=function(xi){for(var ia=0,qi=xi;ia<qi.length;ia+=1)if(Fi=qi[ia].charCodeAt(0),Dr.Arabic(Fi)||Dr["Arabic Supplement"](Fi)||Dr["Arabic Extended-A"](Fi)||Dr["Arabic Presentation Forms-A"](Fi)||Dr["Arabic Presentation Forms-B"](Fi))return!1;var Fi;return!0}(li)?Ln:0,di=M.get("text-anchor").evaluate(It,{},T),Qn=M.get("text-variable-anchor");if(!Qn){var Pi=M.get("text-radial-offset").evaluate(It,{},T);Zr=Pi?We(di,[24*Pi,Le]):M.get("text-offset").evaluate(It,{},T).map(function(xi){return 24*xi})}var Tn=Se?"center":M.get("text-justify").evaluate(It,{},T),zi=M.get("symbol-placement"),Sa=zi==="point"?24*M.get("text-max-width").evaluate(It,{},T):0,Na=function(){s.allowVerticalPlacement&&Qu(li)&&(Gr.vertical=ri(An,l,h,x,Xt,Sa,xe,di,"left",sn,Zr,Sn.vertical,!0,zi,kr,Er))};if(!Se&&Qn){for(var Fa=Tn==="auto"?Qn.map(function(xi){return Ze(xi)}):[Tn],Aa=!1,Ua=0;Ua<Fa.length;Ua++){var Mo=Fa[Ua];if(!Gr.horizontal[Mo])if(Aa)Gr.horizontal[Mo]=Gr.horizontal[0];else{var Po=ri(An,l,h,x,Xt,Sa,xe,"center",Mo,sn,Zr,Sn.horizontal,!1,zi,kr,Er);Po&&(Gr.horizontal[Mo]=Po,Aa=Po.positionedLines.length===1)}}Na()}else{Tn==="auto"&&(Tn=Ze(di));var Es=ri(An,l,h,x,Xt,Sa,xe,di,Tn,sn,Zr,Sn.horizontal,!1,zi,kr,Er);Es&&(Gr.horizontal[Tn]=Es),Na(),Qu(li)&&Se&&ze&&(Gr.vertical=ri(An,l,h,x,Xt,Sa,xe,di,Tn,sn,Zr,Sn.vertical,!1,zi,kr,Er))}}var Vo=void 0,Ss=!1;if(It.icon&&It.icon.name){var Wa=g[It.icon.name];Wa&&(Vo=function(xi,ia,qi){var Fi=la(qi),ks=ia[0]-xi.displaySize[0]*Fi.horizontalAlign,ls=ia[1]-xi.displaySize[1]*Fi.verticalAlign;return{image:xi,top:ls,bottom:ls+xi.displaySize[1],left:ks,right:ks+xi.displaySize[0]}}(x[It.icon.name],M.get("icon-offset").evaluate(It,{},T),M.get("icon-anchor").evaluate(It,{},T)),Ss=Wa.sdf,s.sdfIcons===void 0?s.sdfIcons=Wa.sdf:s.sdfIcons!==Wa.sdf&&ye("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Wa.pixelRatio!==s.pixelRatio||M.get("icon-rotate").constantOr(1)!==0)&&(s.iconsNeedLinear=!0))}var jo=Ve(Gr.horizontal)||Gr.vertical;s.iconsInText=!!jo&&jo.iconsInText,(jo||Vo)&&function(xi,ia,qi,Fi,ks,ls,ya,ho,cs,$i,Hc){var Ou=ls.textMaxSize.evaluate(ia,{});Ou===void 0&&(Ou=ya);var Gc,Xa=xi.layers[0].layout,Wc=Xa.get("icon-offset").evaluate(ia,{},Hc),Nl=Ve(qi.horizontal),ad=ya/24,Jp=xi.tilePixelRatio*ad,od=xi.tilePixelRatio*Ou/24,Gf=xi.tilePixelRatio*ho,sd=xi.tilePixelRatio*Xa.get("symbol-spacing"),b2=Xa.get("text-padding")*xi.tilePixelRatio,ud=Xa.get("icon-padding")*xi.tilePixelRatio,X0=Xa.get("text-max-angle")/180*Math.PI,E2=Xa.get("text-rotation-alignment")==="map"&&Xa.get("symbol-placement")!=="point",S2=Xa.get("icon-rotation-alignment")==="map"&&Xa.get("symbol-placement")!=="point",Wf=Xa.get("symbol-placement"),Y0=sd/2,ld=Xa.get("icon-text-fit");Fi&&ld!=="none"&&(xi.allowVerticalPlacement&&qi.vertical&&(Gc=lo(Fi,qi.vertical,ld,Xa.get("icon-text-fit-padding"),Wc,ad)),Nl&&(Fi=lo(Fi,Nl,ld,Xa.get("icon-text-fit-padding"),Wc,ad)));var Vh=function(nk,rv){rv.x<0||rv.x>=8192||rv.y<0||rv.y>=8192||function(Ya,pc,ik,jh,jy,zb,I2,Xc,M2,nv,P2,O2,Hy,$b,iv,Vb,jb,Hb,Gb,Wb,ku,k2,Xb,Yc,ak){var Yb,t1,dd,vd,md,gd=Ya.addToLineVertexArray(pc,ik),Zb=0,qb=0,Kb=0,Qb=0,Gy=-1,Wy=-1,Xf={},Jb=_e(""),Xy=0,Yy=0;if(Xc._unevaluatedLayout.getValue("text-radial-offset")===void 0?(Xy=(Yb=Xc.layout.get("text-offset").evaluate(ku,{},Yc).map(function(ov){return 24*ov}))[0],Yy=Yb[1]):(Xy=24*Xc.layout.get("text-radial-offset").evaluate(ku,{},Yc),Yy=Le),Ya.allowVerticalPlacement&&jh.vertical){var e7=Xc.layout.get("text-rotate").evaluate(ku,{},Yc)+90;vd=new Zi(M2,pc,nv,P2,O2,jh.vertical,Hy,$b,iv,e7),I2&&(md=new Zi(M2,pc,nv,P2,O2,I2,jb,Hb,iv,e7))}if(jy){var Zy=Xc.layout.get("icon-rotate").evaluate(ku,{}),t7=Xc.layout.get("icon-text-fit")!=="none",r7=Ae(jy,Zy,Xb,t7),qy=I2?Ae(I2,Zy,Xb,t7):void 0;dd=new Zi(M2,pc,nv,P2,O2,jy,jb,Hb,!1,Zy),Zb=4*r7.length;var n7=Ya.iconSizeData,av=null;n7.kind==="source"?(av=[128*Xc.layout.get("icon-size").evaluate(ku,{})])[0]>32640&&ye(Ya.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):n7.kind==="composite"&&((av=[128*k2.compositeIconSizes[0].evaluate(ku,{},Yc),128*k2.compositeIconSizes[1].evaluate(ku,{},Yc)])[0]>32640||av[1]>32640)&&ye(Ya.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),Ya.addSymbols(Ya.icon,r7,av,Wb,Gb,ku,!1,pc,gd.lineStartIndex,gd.lineLength,-1,Yc),Gy=Ya.icon.placedSymbolArray.length-1,qy&&(qb=4*qy.length,Ya.addSymbols(Ya.icon,qy,av,Wb,Gb,ku,Sn.vertical,pc,gd.lineStartIndex,gd.lineLength,-1,Yc),Wy=Ya.icon.placedSymbolArray.length-1)}for(var i7 in jh.horizontal){var D2=jh.horizontal[i7];if(!t1){Jb=_e(D2.text);var ok=Xc.layout.get("text-rotate").evaluate(ku,{},Yc);t1=new Zi(M2,pc,nv,P2,O2,D2,Hy,$b,iv,ok)}var a7=D2.positionedLines.length===1;if(Kb+=Te(Ya,pc,D2,zb,Xc,iv,ku,Vb,gd,jh.vertical?Sn.horizontal:Sn.horizontalOnly,a7?Object.keys(jh.horizontal):[i7],Xf,Gy,k2,Yc),a7)break}jh.vertical&&(Qb+=Te(Ya,pc,jh.vertical,zb,Xc,iv,ku,Vb,gd,Sn.vertical,["vertical"],Xf,Wy,k2,Yc));var sk=t1?t1.boxStartIndex:Ya.collisionBoxArray.length,uk=t1?t1.boxEndIndex:Ya.collisionBoxArray.length,lk=vd?vd.boxStartIndex:Ya.collisionBoxArray.length,ck=vd?vd.boxEndIndex:Ya.collisionBoxArray.length,fk=dd?dd.boxStartIndex:Ya.collisionBoxArray.length,hk=dd?dd.boxEndIndex:Ya.collisionBoxArray.length,pk=md?md.boxStartIndex:Ya.collisionBoxArray.length,dk=md?md.boxEndIndex:Ya.collisionBoxArray.length,Zc=-1,F2=function(ov,s7){return ov&&ov.circleDiameter?Math.max(ov.circleDiameter,s7):s7};Zc=F2(t1,Zc),Zc=F2(vd,Zc),Zc=F2(dd,Zc);var o7=(Zc=F2(md,Zc))>-1?1:0;o7&&(Zc*=ak/24),Ya.glyphOffsetArray.length>=Jr.MAX_GLYPHS&&ye("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),ku.sortKey!==void 0&&Ya.addToSortKeyRanges(Ya.symbolInstances.length,ku.sortKey),Ya.symbolInstances.emplaceBack(pc.x,pc.y,Xf.right>=0?Xf.right:-1,Xf.center>=0?Xf.center:-1,Xf.left>=0?Xf.left:-1,Xf.vertical||-1,Gy,Wy,Jb,sk,uk,lk,ck,fk,hk,pk,dk,nv,Kb,Qb,Zb,qb,o7,0,Hy,Xy,Yy,Zc)}(xi,rv,nk,qi,Fi,ks,Gc,xi.layers[0],xi.collisionBoxArray,ia.index,ia.sourceLayerIndex,xi.index,Jp,b2,E2,cs,Gf,ud,S2,Wc,ia,ls,$i,Hc,ya)};if(Wf==="line")for(var cd=0,A2=il(ia.geometry,0,0,8192,8192);cd<A2.length;cd+=1)for(var T2=A2[cd],Z0=0,q0=Ga(T2,sd,X0,qi.vertical||Nl,Fi,24,od,xi.overscaling,8192);Z0<q0.length;Z0+=1){var w2=q0[Z0];Nl&&pe(xi,Nl.text,Y0,w2)||Vh(T2,w2)}else if(Wf==="line-center")for(var K0=0,Q0=ia.geometry;K0<Q0.length;K0+=1){var J0=Q0[K0];if(J0.length>1){var C2=Mi(J0,X0,qi.vertical||Nl,Fi,24,od);C2&&Vh(J0,C2)}}else if(ia.type==="Polygon")for(var fd=0,R2=ed(ia.geometry,0);fd<R2.length;fd+=1){var hd=R2[fd],ev=Pe(hd,16);Vh(hd[0],new Oa(ev.x,ev.y,0))}else if(ia.type==="LineString")for(var e1=0,tv=ia.geometry;e1<tv.length;e1+=1){var pd=tv[e1];Vh(pd,new Oa(pd[0].x,pd[0].y,0))}else if(ia.type==="Point")for(var zy=0,Nb=ia.geometry;zy<Nb.length;zy+=1)for(var $y=0,Ub=Nb[zy];$y<Ub.length;$y+=1){var Vy=Ub[$y];Vh([Vy],new Oa(Vy.x,Vy.y,0))}}(s,It,Gr,Vo,g,N,kr,mn,Zr,Ss,T)},ut=0,St=s.features;ut<St.length;ut+=1)et();E&&s.generateCollisionDebugBuffers()},a.perspective=function(s,l,h,g,x){var E,T=1/Math.tan(l/2);return s[0]=T/h,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=T,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=-1,s[12]=0,s[13]=0,s[15]=0,x!=null&&x!==1/0?(s[10]=(x+g)*(E=1/(g-x)),s[14]=2*x*g*E):(s[10]=-1,s[14]=-2*g),s},a.pick=function(s,l){for(var h={},g=0;g<l.length;g++){var x=l[g];x in s&&(h[x]=s[x])}return h},a.plugin=Ms,a.polygonIntersectsPolygon=Ru,a.postMapLoadEvent=rn,a.postTurnstileEvent=hr,a.potpack=jn,a.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],a.register=Kr,a.registerForPluginStateChange=function(s){return s({pluginStatus:Xo,pluginURL:Tu}),Rh.on("pluginStateChange",s),s},a.renderColorRamp=t2,a.rotate=function(s,l,h){var g=l[0],x=l[1],E=l[2],T=l[3],M=Math.sin(h),D=Math.cos(h);return s[0]=g*D+E*M,s[1]=x*D+T*M,s[2]=g*-M+E*D,s[3]=x*-M+T*D,s},a.rotateX=function(s,l,h){var g=Math.sin(h),x=Math.cos(h),E=l[4],T=l[5],M=l[6],D=l[7],N=l[8],$=l[9],H=l[10],q=l[11];return l!==s&&(s[0]=l[0],s[1]=l[1],s[2]=l[2],s[3]=l[3],s[12]=l[12],s[13]=l[13],s[14]=l[14],s[15]=l[15]),s[4]=E*x+N*g,s[5]=T*x+$*g,s[6]=M*x+H*g,s[7]=D*x+q*g,s[8]=N*x-E*g,s[9]=$*x-T*g,s[10]=H*x-M*g,s[11]=q*x-D*g,s},a.rotateZ=function(s,l,h){var g=Math.sin(h),x=Math.cos(h),E=l[0],T=l[1],M=l[2],D=l[3],N=l[4],$=l[5],H=l[6],q=l[7];return l!==s&&(s[8]=l[8],s[9]=l[9],s[10]=l[10],s[11]=l[11],s[12]=l[12],s[13]=l[13],s[14]=l[14],s[15]=l[15]),s[0]=E*x+N*g,s[1]=T*x+$*g,s[2]=M*x+H*g,s[3]=D*x+q*g,s[4]=N*x-E*g,s[5]=$*x-T*g,s[6]=H*x-M*g,s[7]=q*x-D*g,s},a.scale=function(s,l,h){var g=h[0],x=h[1],E=h[2];return s[0]=l[0]*g,s[1]=l[1]*g,s[2]=l[2]*g,s[3]=l[3]*g,s[4]=l[4]*x,s[5]=l[5]*x,s[6]=l[6]*x,s[7]=l[7]*x,s[8]=l[8]*E,s[9]=l[9]*E,s[10]=l[10]*E,s[11]=l[11]*E,s[12]=l[12],s[13]=l[13],s[14]=l[14],s[15]=l[15],s},a.scale$1=function(s,l,h){return s[0]=l[0]*h,s[1]=l[1]*h,s[2]=l[2]*h,s[3]=l[3]*h,s},a.scale$2=function(s,l,h){return s[0]=l[0]*h,s[1]=l[1]*h,s[2]=l[2]*h,s},a.setCacheLimits=function(s,l){Ne=s,qe=l},a.setRTLTextPlugin=function(s,l,h){if(h===void 0&&(h=!1),Xo==="deferred"||Xo==="loading"||Xo==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");Tu=gi.resolveURL(s),Xo="deferred",Ch=l,Oc(),h||_s()},a.sphericalToCartesian=function(s){var l=s[0],h=s[1],g=s[2];return h+=90,h*=Math.PI/180,g*=Math.PI/180,{x:l*Math.cos(h)*Math.sin(g),y:l*Math.sin(h)*Math.sin(g),z:l*Math.cos(g)}},a.sqrLen=function(s){var l=s[0],h=s[1];return l*l+h*h},a.styleSpec=ie,a.sub=function(s,l,h){return s[0]=l[0]-h[0],s[1]=l[1]-h[1],s[2]=l[2]-h[2],s},a.symbolSize=ei,a.transformMat3=function(s,l,h){var g=l[0],x=l[1],E=l[2];return s[0]=g*h[0]+x*h[3]+E*h[6],s[1]=g*h[1]+x*h[4]+E*h[7],s[2]=g*h[2]+x*h[5]+E*h[8],s},a.transformMat4=Bl,a.translate=function(s,l,h){var g,x,E,T,M,D,N,$,H,q,re,xe,Se=h[0],ze=h[1],Oe=h[2];return l===s?(s[12]=l[0]*Se+l[4]*ze+l[8]*Oe+l[12],s[13]=l[1]*Se+l[5]*ze+l[9]*Oe+l[13],s[14]=l[2]*Se+l[6]*ze+l[10]*Oe+l[14],s[15]=l[3]*Se+l[7]*ze+l[11]*Oe+l[15]):(x=l[1],E=l[2],T=l[3],M=l[4],D=l[5],N=l[6],$=l[7],H=l[8],q=l[9],re=l[10],xe=l[11],s[0]=g=l[0],s[1]=x,s[2]=E,s[3]=T,s[4]=M,s[5]=D,s[6]=N,s[7]=$,s[8]=H,s[9]=q,s[10]=re,s[11]=xe,s[12]=g*Se+M*ze+H*Oe+l[12],s[13]=x*Se+D*ze+q*Oe+l[13],s[14]=E*Se+N*ze+re*Oe+l[14],s[15]=T*Se+$*ze+xe*Oe+l[15]),s},a.triggerPluginCompletionEvent=X1,a.uniqueId=V,a.validateCustomStyleLayer=function(s){var l=[],h=s.id;return h===void 0&&l.push({message:"layers."+h+': missing required property "id"'}),s.render===void 0&&l.push({message:"layers."+h+': missing required method "render"'}),s.renderingMode&&s.renderingMode!=="2d"&&s.renderingMode!=="3d"&&l.push({message:"layers."+h+': property "renderingMode" must be either "2d" or "3d"'}),l},a.validateLight=W1,a.validateStyle=If,a.values=function(s){var l=[];for(var h in s)l.push(s[h]);return l},a.vectorTile=jc,a.version="1.13.3",a.warnOnce=ye,a.webpSupported=Qt,a.window=b,a.wrap=k}),o(["./shared"],function(a){function u(j){var Y=typeof j;if(Y==="number"||Y==="boolean"||Y==="string"||j==null)return JSON.stringify(j);if(Array.isArray(j)){for(var J="[",ce=0,Ee=j;ce<Ee.length;ce+=1)J+=u(Ee[ce])+",";return J+"]"}for(var je=Object.keys(j).sort(),Ye="{",ie=0;ie<je.length;ie++)Ye+=JSON.stringify(je[ie])+":"+u(j[je[ie]])+",";return Ye+"}"}function c(j){for(var Y="",J=0,ce=a.refProperties;J<ce.length;J+=1)Y+="/"+u(j[ce[J]]);return Y}var f=function(j){this.keyCache={},j&&this.replace(j)};f.prototype.replace=function(j){this._layerConfigs={},this._layers={},this.update(j,[])},f.prototype.update=function(j,Y){for(var J=this,ce=0,Ee=j;ce<Ee.length;ce+=1){var je=Ee[ce];this._layerConfigs[je.id]=je;var Ye=this._layers[je.id]=a.createStyleLayer(je);Ye._featureFilter=a.featureFilter(Ye.filter),this.keyCache[je.id]&&delete this.keyCache[je.id]}for(var ie=0,Ce=Y;ie<Ce.length;ie+=1){var it=Ce[ie];delete this.keyCache[it],delete this._layerConfigs[it],delete this._layers[it]}this.familiesBySource={};for(var Nt=0,vr=function(Rr,Pr){for(var Hn={},Lr=0;Lr<Rr.length;Lr++){var ci=Pr&&Pr[Rr[Lr].id]||c(Rr[Lr]);Pr&&(Pr[Rr[Lr].id]=ci);var Gi=Hn[ci];Gi||(Gi=Hn[ci]=[]),Gi.push(Rr[Lr])}var oi=[];for(var _i in Hn)oi.push(Hn[_i]);return oi}(a.values(this._layerConfigs),this.keyCache);Nt<vr.length;Nt+=1){var Ot=vr[Nt].map(function(Rr){return J._layers[Rr.id]}),ar=Ot[0];if(ar.visibility!=="none"){var tn=ar.source||"",qr=this.familiesBySource[tn];qr||(qr=this.familiesBySource[tn]={});var Dt=ar.sourceLayer||"_geojsonTileLayer",zr=qr[Dt];zr||(zr=qr[Dt]=[]),zr.push(Ot)}}};var m=function(j){var Y={},J=[];for(var ce in j){var Ee=j[ce],je=Y[ce]={};for(var Ye in Ee){var ie=Ee[+Ye];if(ie&&ie.bitmap.width!==0&&ie.bitmap.height!==0){var Ce={x:0,y:0,w:ie.bitmap.width+2,h:ie.bitmap.height+2};J.push(Ce),je[Ye]={rect:Ce,metrics:ie.metrics}}}}var it=a.potpack(J),Nt=new a.AlphaImage({width:it.w||1,height:it.h||1});for(var vr in j){var Ot=j[vr];for(var ar in Ot){var tn=Ot[+ar];if(tn&&tn.bitmap.width!==0&&tn.bitmap.height!==0){var qr=Y[vr][ar].rect;a.AlphaImage.copy(tn.bitmap,Nt,{x:0,y:0},{x:qr.x+1,y:qr.y+1},tn.bitmap)}}}this.image=Nt,this.positions=Y};a.register("GlyphAtlas",m);var _=function(j){this.tileID=new a.OverscaledTileID(j.tileID.overscaledZ,j.tileID.wrap,j.tileID.canonical.z,j.tileID.canonical.x,j.tileID.canonical.y),this.uid=j.uid,this.zoom=j.zoom,this.pixelRatio=j.pixelRatio,this.tileSize=j.tileSize,this.source=j.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=j.showCollisionBoxes,this.collectResourceTiming=!!j.collectResourceTiming,this.returnDependencies=!!j.returnDependencies,this.promoteId=j.promoteId};function b(j,Y,J){for(var ce=new a.EvaluationParameters(Y),Ee=0,je=j;Ee<je.length;Ee+=1)je[Ee].recalculate(ce,J)}function A(j,Y){var J=a.getArrayBuffer(j.request,function(ce,Ee,je,Ye){ce?Y(ce):Ee&&Y(null,{vectorTile:new a.vectorTile.VectorTile(new a.pbf(Ee)),rawData:Ee,cacheControl:je,expires:Ye})});return function(){J.cancel(),Y()}}_.prototype.parse=function(j,Y,J,ce,Ee){var je=this;this.status="parsing",this.data=j,this.collisionBoxArray=new a.CollisionBoxArray;var Ye=new a.DictionaryCoder(Object.keys(j.layers).sort()),ie=new a.FeatureIndex(this.tileID,this.promoteId);ie.bucketLayerIDs=[];var Ce,it,Nt,vr,Ot={},ar={featureIndex:ie,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:J},tn=Y.familiesBySource[this.source];for(var qr in tn){var Dt=j.layers[qr];if(Dt){Dt.version===1&&a.warnOnce('Vector tile source "'+this.source+'" layer "'+qr+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var zr=Ye.encode(qr),Rr=[],Pr=0;Pr<Dt.length;Pr++){var Hn=Dt.feature(Pr),Lr=ie.getId(Hn,qr);Rr.push({feature:Hn,id:Lr,index:Pr,sourceLayerIndex:zr})}for(var ci=0,Gi=tn[qr];ci<Gi.length;ci+=1){var oi=Gi[ci],_i=oi[0];_i.minzoom&&this.zoom<Math.floor(_i.minzoom)||_i.maxzoom&&this.zoom>=_i.maxzoom||_i.visibility!=="none"&&(b(oi,this.zoom,J),(Ot[_i.id]=_i.createBucket({index:ie.bucketLayerIDs.length,layers:oi,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:zr,sourceID:this.source})).populate(Rr,ar,this.tileID.canonical),ie.bucketLayerIDs.push(oi.map(function(Ii){return Ii.id})))}}}var Gn=a.mapObject(ar.glyphDependencies,function(Ii){return Object.keys(Ii).map(Number)});Object.keys(Gn).length?ce.send("getGlyphs",{uid:this.uid,stacks:Gn},function(Ii,Wn){Ce||(Ce=Ii,it=Wn,Wi.call(je))}):it={};var ka=Object.keys(ar.iconDependencies);ka.length?ce.send("getImages",{icons:ka,source:this.source,tileID:this.tileID,type:"icons"},function(Ii,Wn){Ce||(Ce=Ii,Nt=Wn,Wi.call(je))}):Nt={};var hi=Object.keys(ar.patternDependencies);function Wi(){if(Ce)return Ee(Ce);if(it&&Nt&&vr){var Ii=new m(it),Wn=new a.ImageAtlas(Nt,vr);for(var si in Ot){var To=Ot[si];To instanceof a.SymbolBucket?(b(To.layers,this.zoom,J),a.performSymbolLayout(To,it,Ii.positions,Nt,Wn.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):To.hasPattern&&(To instanceof a.LineBucket||To instanceof a.FillBucket||To instanceof a.FillExtrusionBucket)&&(b(To.layers,this.zoom,J),To.addFeatures(ar,this.tileID.canonical,Wn.patternPositions))}this.status="done",Ee(null,{buckets:a.values(Ot).filter(function(dl){return!dl.isEmpty()}),featureIndex:ie,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Ii.image,imageAtlas:Wn,glyphMap:this.returnDependencies?it:null,iconMap:this.returnDependencies?Nt:null,glyphPositions:this.returnDependencies?Ii.positions:null})}}hi.length?ce.send("getImages",{icons:hi,source:this.source,tileID:this.tileID,type:"patterns"},function(Ii,Wn){Ce||(Ce=Ii,vr=Wn,Wi.call(je))}):vr={},Wi.call(this)};var w=function(j,Y,J,ce){this.actor=j,this.layerIndex=Y,this.availableImages=J,this.loadVectorData=ce||A,this.loading={},this.loaded={}};w.prototype.loadTile=function(j,Y){var J=this,ce=j.uid;this.loading||(this.loading={});var Ee=!!(j&&j.request&&j.request.collectResourceTiming)&&new a.RequestPerformance(j.request),je=this.loading[ce]=new _(j);je.abort=this.loadVectorData(j,function(Ye,ie){if(delete J.loading[ce],Ye||!ie)return je.status="done",J.loaded[ce]=je,Y(Ye);var Ce=ie.rawData,it={};ie.expires&&(it.expires=ie.expires),ie.cacheControl&&(it.cacheControl=ie.cacheControl);var Nt={};if(Ee){var vr=Ee.finish();vr&&(Nt.resourceTiming=JSON.parse(JSON.stringify(vr)))}je.vectorTile=ie.vectorTile,je.parse(ie.vectorTile,J.layerIndex,J.availableImages,J.actor,function(Ot,ar){if(Ot||!ar)return Y(Ot);Y(null,a.extend({rawTileData:Ce.slice(0)},ar,it,Nt))}),J.loaded=J.loaded||{},J.loaded[ce]=je})},w.prototype.reloadTile=function(j,Y){var J=this,ce=this.loaded,Ee=j.uid,je=this;if(ce&&ce[Ee]){var Ye=ce[Ee];Ye.showCollisionBoxes=j.showCollisionBoxes;var ie=function(Ce,it){var Nt=Ye.reloadCallback;Nt&&(delete Ye.reloadCallback,Ye.parse(Ye.vectorTile,je.layerIndex,J.availableImages,je.actor,Nt)),Y(Ce,it)};Ye.status==="parsing"?Ye.reloadCallback=ie:Ye.status==="done"&&(Ye.vectorTile?Ye.parse(Ye.vectorTile,this.layerIndex,this.availableImages,this.actor,ie):ie())}},w.prototype.abortTile=function(j,Y){var J=this.loading,ce=j.uid;J&&J[ce]&&J[ce].abort&&(J[ce].abort(),delete J[ce]),Y()},w.prototype.removeTile=function(j,Y){var J=this.loaded,ce=j.uid;J&&J[ce]&&delete J[ce],Y()};var R=a.window.ImageBitmap,P=function(){this.loaded={}};function k(j,Y){if(j.length!==0){L(j[0],Y);for(var J=1;J<j.length;J++)L(j[J],!Y)}}function L(j,Y){for(var J=0,ce=0,Ee=0,je=j.length,Ye=je-1;Ee<je;Ye=Ee++){var ie=(j[Ee][0]-j[Ye][0])*(j[Ye][1]+j[Ee][1]),Ce=J+ie;ce+=Math.abs(J)>=Math.abs(ie)?J-Ce+ie:ie-Ce+J,J=Ce}J+ce>=0!=!!Y&&j.reverse()}P.prototype.loadTile=function(j,Y){var J=j.uid,ce=j.encoding,Ee=j.rawImageData,je=R&&Ee instanceof R?this.getImageData(Ee):Ee,Ye=new a.DEMData(J,je,ce);this.loaded=this.loaded||{},this.loaded[J]=Ye,Y(null,Ye)},P.prototype.getImageData=function(j){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(j.width,j.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=j.width,this.offscreenCanvas.height=j.height,this.offscreenCanvasContext.drawImage(j,0,0,j.width,j.height);var Y=this.offscreenCanvasContext.getImageData(-1,-1,j.width+2,j.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new a.RGBAImage({width:Y.width,height:Y.height},Y.data)},P.prototype.removeTile=function(j){var Y=this.loaded,J=j.uid;Y&&Y[J]&&delete Y[J]};var B=a.vectorTile.VectorTileFeature.prototype.toGeoJSON,V=function(j){this._feature=j,this.extent=a.EXTENT,this.type=j.type,this.properties=j.tags,"id"in j&&!isNaN(j.id)&&(this.id=parseInt(j.id,10))};V.prototype.loadGeometry=function(){if(this._feature.type===1){for(var j=[],Y=0,J=this._feature.geometry;Y<J.length;Y+=1){var ce=J[Y];j.push([new a.Point$1(ce[0],ce[1])])}return j}for(var Ee=[],je=0,Ye=this._feature.geometry;je<Ye.length;je+=1){for(var ie=[],Ce=0,it=Ye[je];Ce<it.length;Ce+=1){var Nt=it[Ce];ie.push(new a.Point$1(Nt[0],Nt[1]))}Ee.push(ie)}return Ee},V.prototype.toGeoJSON=function(j,Y,J){return B.call(this,j,Y,J)};var G=function(j){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=a.EXTENT,this.length=j.length,this._features=j};G.prototype.feature=function(j){return new V(this._features[j])};var K=a.vectorTile.VectorTileFeature,Z=ve;function ve(j,Y){this.options=Y||{},this.features=j,this.length=j.length}function Ie(j,Y){this.id=typeof j.id=="number"?j.id:void 0,this.type=j.type,this.rawGeometry=j.type===1?[j.geometry]:j.geometry,this.properties=j.tags,this.extent=Y||4096}ve.prototype.feature=function(j){return new Ie(this.features[j],this.options.extent)},Ie.prototype.loadGeometry=function(){var j=this.rawGeometry;this.geometry=[];for(var Y=0;Y<j.length;Y++){for(var J=j[Y],ce=[],Ee=0;Ee<J.length;Ee++)ce.push(new a.Point$1(J[Ee][0],J[Ee][1]));this.geometry.push(ce)}return this.geometry},Ie.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var j=this.geometry,Y=1/0,J=-1/0,ce=1/0,Ee=-1/0,je=0;je<j.length;je++)for(var Ye=j[je],ie=0;ie<Ye.length;ie++){var Ce=Ye[ie];Y=Math.min(Y,Ce.x),J=Math.max(J,Ce.x),ce=Math.min(ce,Ce.y),Ee=Math.max(Ee,Ce.y)}return[Y,ce,J,Ee]},Ie.prototype.toGeoJSON=K.prototype.toGeoJSON;var de=le,se=Z;function le(j){var Y=new a.pbf;return function(J,ce){for(var Ee in J.layers)ce.writeMessage(3,ye,J.layers[Ee])}(j,Y),Y.finish()}function ye(j,Y){var J;Y.writeVarintField(15,j.version||1),Y.writeStringField(1,j.name||""),Y.writeVarintField(5,j.extent||4096);var ce={keys:[],values:[],keycache:{},valuecache:{}};for(J=0;J<j.length;J++)ce.feature=j.feature(J),Y.writeMessage(2,ke,ce);var Ee=ce.keys;for(J=0;J<Ee.length;J++)Y.writeStringField(3,Ee[J]);var je=ce.values;for(J=0;J<je.length;J++)Y.writeMessage(4,st,je[J])}function ke(j,Y){var J=j.feature;J.id!==void 0&&Y.writeVarintField(1,J.id),Y.writeMessage(2,Rt,j),Y.writeVarintField(3,J.type),Y.writeMessage(4,Zt,J)}function Rt(j,Y){var J=j.feature,ce=j.keys,Ee=j.values,je=j.keycache,Ye=j.valuecache;for(var ie in J.properties){var Ce=je[ie];Ce===void 0&&(ce.push(ie),je[ie]=Ce=ce.length-1),Y.writeVarint(Ce);var it=J.properties[ie],Nt=typeof it;Nt!=="string"&&Nt!=="boolean"&&Nt!=="number"&&(it=JSON.stringify(it));var vr=Nt+":"+it,Ot=Ye[vr];Ot===void 0&&(Ee.push(it),Ye[vr]=Ot=Ee.length-1),Y.writeVarint(Ot)}}function Lt(j,Y){return(Y<<3)+(7&j)}function Gt(j){return j<<1^j>>31}function Zt(j,Y){for(var J=j.loadGeometry(),ce=j.type,Ee=0,je=0,Ye=J.length,ie=0;ie<Ye;ie++){var Ce=J[ie],it=1;ce===1&&(it=Ce.length),Y.writeVarint(Lt(1,it));for(var Nt=ce===3?Ce.length-1:Ce.length,vr=0;vr<Nt;vr++){vr===1&&ce!==1&&Y.writeVarint(Lt(2,Nt-1));var Ot=Ce[vr].x-Ee,ar=Ce[vr].y-je;Y.writeVarint(Gt(Ot)),Y.writeVarint(Gt(ar)),Ee+=Ot,je+=ar}ce===3&&Y.writeVarint(Lt(7,1))}}function st(j,Y){var J=typeof j;J==="string"?Y.writeStringField(1,j):J==="boolean"?Y.writeBooleanField(7,j):J==="number"&&(j%1!=0?Y.writeDoubleField(3,j):j<0?Y.writeSVarintField(6,j):Y.writeVarintField(5,j))}function tt(j,Y,J,ce){dt(j,J,ce),dt(Y,2*J,2*ce),dt(Y,2*J+1,2*ce+1)}function dt(j,Y,J){var ce=j[Y];j[Y]=j[J],j[J]=ce}function nt(j,Y,J,ce){var Ee=j-J,je=Y-ce;return Ee*Ee+je*je}de.fromVectorTileJs=le,de.fromGeojsonVt=function(j,Y){Y=Y||{};var J={};for(var ce in j)J[ce]=new Z(j[ce].features,Y),J[ce].name=ce,J[ce].version=Y.version,J[ce].extent=Y.extent;return le({layers:J})},de.GeoJSONWrapper=se;var pr=function(j){return j[0]},ur=function(j){return j[1]},Ar=function(j,Y,J,ce,Ee){Y===void 0&&(Y=pr),J===void 0&&(J=ur),ce===void 0&&(ce=64),Ee===void 0&&(Ee=Float64Array),this.nodeSize=ce,this.points=j;for(var je=j.length<65536?Uint16Array:Uint32Array,Ye=this.ids=new je(j.length),ie=this.coords=new Ee(2*j.length),Ce=0;Ce<j.length;Ce++)Ye[Ce]=Ce,ie[2*Ce]=Y(j[Ce]),ie[2*Ce+1]=J(j[Ce]);(function it(Nt,vr,Ot,ar,tn,qr){if(!(tn-ar<=Ot)){var Dt=ar+tn>>1;(function zr(Rr,Pr,Hn,Lr,ci,Gi){for(;ci>Lr;){if(ci-Lr>600){var oi=ci-Lr+1,_i=Hn-Lr+1,Gn=Math.log(oi),ka=.5*Math.exp(2*Gn/3),hi=.5*Math.sqrt(Gn*ka*(oi-ka)/oi)*(_i-oi/2<0?-1:1);zr(Rr,Pr,Hn,Math.max(Lr,Math.floor(Hn-_i*ka/oi+hi)),Math.min(ci,Math.floor(Hn+(oi-_i)*ka/oi+hi)),Gi)}var Wi=Pr[2*Hn+Gi],Ii=Lr,Wn=ci;for(tt(Rr,Pr,Lr,Hn),Pr[2*ci+Gi]>Wi&&tt(Rr,Pr,Lr,ci);Ii<Wn;){for(tt(Rr,Pr,Ii,Wn),Ii++,Wn--;Pr[2*Ii+Gi]<Wi;)Ii++;for(;Pr[2*Wn+Gi]>Wi;)Wn--}Pr[2*Lr+Gi]===Wi?tt(Rr,Pr,Lr,Wn):tt(Rr,Pr,++Wn,ci),Wn<=Hn&&(Lr=Wn+1),Hn<=Wn&&(ci=Wn-1)}})(Nt,vr,Dt,ar,tn,qr%2),it(Nt,vr,Ot,ar,Dt-1,qr+1),it(Nt,vr,Ot,Dt+1,tn,qr+1)}})(Ye,ie,ce,0,Ye.length-1,0)};Ar.prototype.range=function(j,Y,J,ce){return function(Ee,je,Ye,ie,Ce,it,Nt){for(var vr,Ot,ar=[0,Ee.length-1,0],tn=[];ar.length;){var qr=ar.pop(),Dt=ar.pop(),zr=ar.pop();if(Dt-zr<=Nt)for(var Rr=zr;Rr<=Dt;Rr++)Ot=je[2*Rr+1],(vr=je[2*Rr])>=Ye&&vr<=Ce&&Ot>=ie&&Ot<=it&&tn.push(Ee[Rr]);else{var Pr=Math.floor((zr+Dt)/2);Ot=je[2*Pr+1],(vr=je[2*Pr])>=Ye&&vr<=Ce&&Ot>=ie&&Ot<=it&&tn.push(Ee[Pr]);var Hn=(qr+1)%2;(qr===0?Ye<=vr:ie<=Ot)&&(ar.push(zr),ar.push(Pr-1),ar.push(Hn)),(qr===0?Ce>=vr:it>=Ot)&&(ar.push(Pr+1),ar.push(Dt),ar.push(Hn))}}return tn}(this.ids,this.coords,j,Y,J,ce,this.nodeSize)},Ar.prototype.within=function(j,Y,J){return function(ce,Ee,je,Ye,ie,Ce){for(var it=[0,ce.length-1,0],Nt=[],vr=ie*ie;it.length;){var Ot=it.pop(),ar=it.pop(),tn=it.pop();if(ar-tn<=Ce)for(var qr=tn;qr<=ar;qr++)nt(Ee[2*qr],Ee[2*qr+1],je,Ye)<=vr&&Nt.push(ce[qr]);else{var Dt=Math.floor((tn+ar)/2),zr=Ee[2*Dt],Rr=Ee[2*Dt+1];nt(zr,Rr,je,Ye)<=vr&&Nt.push(ce[Dt]);var Pr=(Ot+1)%2;(Ot===0?je-ie<=zr:Ye-ie<=Rr)&&(it.push(tn),it.push(Dt-1),it.push(Pr)),(Ot===0?je+ie>=zr:Ye+ie>=Rr)&&(it.push(Dt+1),it.push(ar),it.push(Pr))}}return Nt}(this.ids,this.coords,j,Y,J,this.nodeSize)};var Xn={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(j){return j}},pn=function(j){this.options=Be(Object.create(Xn),j),this.trees=new Array(this.options.maxZoom+1)};function gi(j,Y,J,ce,Ee){return{x:j,y:Y,zoom:1/0,id:J,parentId:-1,numPoints:ce,properties:Ee}}function Je(j,Y){var J=j.geometry.coordinates,ce=J[1];return{x:Ut(J[0]),y:ge(ce),zoom:1/0,index:Y,parentId:-1}}function Qt(j){return{type:"Feature",id:j.id,properties:Xr(j),geometry:{type:"Point",coordinates:[(ce=j.x,360*(ce-.5)),(Y=j.y,J=(180-360*Y)*Math.PI/180,360*Math.atan(Math.exp(J))/Math.PI-90)]}};var Y,J,ce}function Xr(j){var Y=j.numPoints,J=Y>=1e4?Math.round(Y/1e3)+"k":Y>=1e3?Math.round(Y/100)/10+"k":Y;return Be(Be({},j.properties),{cluster:!0,cluster_id:j.id,point_count:Y,point_count_abbreviated:J})}function Ut(j){return j/360+.5}function ge(j){var Y=Math.sin(j*Math.PI/180),J=.5-.25*Math.log((1+Y)/(1-Y))/Math.PI;return J<0?0:J>1?1:J}function Be(j,Y){for(var J in Y)j[J]=Y[J];return j}function ft(j){return j.x}function At(j){return j.y}function bt(j,Y,J,ce,Ee,je){var Ye=Ee-J,ie=je-ce;if(Ye!==0||ie!==0){var Ce=((j-J)*Ye+(Y-ce)*ie)/(Ye*Ye+ie*ie);Ce>1?(J=Ee,ce=je):Ce>0&&(J+=Ye*Ce,ce+=ie*Ce)}return(Ye=j-J)*Ye+(ie=Y-ce)*ie}function $t(j,Y,J,ce){var Ee={id:j===void 0?null:j,type:Y,geometry:J,tags:ce,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(je){var Ye=je.geometry,ie=je.type;if(ie==="Point"||ie==="MultiPoint"||ie==="LineString")Mr(je,Ye);else if(ie==="Polygon"||ie==="MultiLineString")for(var Ce=0;Ce<Ye.length;Ce++)Mr(je,Ye[Ce]);else if(ie==="MultiPolygon")for(Ce=0;Ce<Ye.length;Ce++)for(var it=0;it<Ye[Ce].length;it++)Mr(je,Ye[Ce][it])}(Ee),Ee}function Mr(j,Y){for(var J=0;J<Y.length;J+=3)j.minX=Math.min(j.minX,Y[J]),j.minY=Math.min(j.minY,Y[J+1]),j.maxX=Math.max(j.maxX,Y[J]),j.maxY=Math.max(j.maxY,Y[J+1])}function tr(j,Y,J,ce){if(Y.geometry){var Ee=Y.geometry.coordinates,je=Y.geometry.type,Ye=Math.pow(J.tolerance/((1<<J.maxZoom)*J.extent),2),ie=[],Ce=Y.id;if(J.promoteId?Ce=Y.properties[J.promoteId]:J.generateId&&(Ce=ce||0),je==="Point")lr(Ee,ie);else if(je==="MultiPoint")for(var it=0;it<Ee.length;it++)lr(Ee[it],ie);else if(je==="LineString")or(Ee,ie,Ye,!1);else if(je==="MultiLineString"){if(J.lineMetrics){for(it=0;it<Ee.length;it++)or(Ee[it],ie=[],Ye,!1),j.push($t(Ce,"LineString",ie,Y.properties));return}Q(Ee,ie,Ye,!1)}else if(je==="Polygon")Q(Ee,ie,Ye,!0);else{if(je!=="MultiPolygon"){if(je==="GeometryCollection"){for(it=0;it<Y.geometry.geometries.length;it++)tr(j,{id:Ce,geometry:Y.geometry.geometries[it],properties:Y.properties},J,ce);return}throw new Error("Input data is not a valid GeoJSON object.")}for(it=0;it<Ee.length;it++){var Nt=[];Q(Ee[it],Nt,Ye,!0),ie.push(Nt)}}j.push($t(Ce,je,ie,Y.properties))}}function lr(j,Y){Y.push(Ge(j[0])),Y.push(at(j[1])),Y.push(0)}function or(j,Y,J,ce){for(var Ee,je,Ye=0,ie=0;ie<j.length;ie++){var Ce=Ge(j[ie][0]),it=at(j[ie][1]);Y.push(Ce),Y.push(it),Y.push(0),ie>0&&(Ye+=ce?(Ee*it-Ce*je)/2:Math.sqrt(Math.pow(Ce-Ee,2)+Math.pow(it-je,2))),Ee=Ce,je=it}var Nt=Y.length-3;Y[2]=1,function vr(Ot,ar,tn,qr){for(var Dt,zr=qr,Rr=tn-ar>>1,Pr=tn-ar,Hn=Ot[ar],Lr=Ot[ar+1],ci=Ot[tn],Gi=Ot[tn+1],oi=ar+3;oi<tn;oi+=3){var _i=bt(Ot[oi],Ot[oi+1],Hn,Lr,ci,Gi);if(_i>zr)Dt=oi,zr=_i;else if(_i===zr){var Gn=Math.abs(oi-Rr);Gn<Pr&&(Dt=oi,Pr=Gn)}}zr>qr&&(Dt-ar>3&&vr(Ot,ar,Dt,qr),Ot[Dt+2]=zr,tn-Dt>3&&vr(Ot,Dt,tn,qr))}(Y,0,Nt,J),Y[Nt+2]=1,Y.size=Math.abs(Ye),Y.start=0,Y.end=Y.size}function Q(j,Y,J,ce){for(var Ee=0;Ee<j.length;Ee++){var je=[];or(j[Ee],je,J,ce),Y.push(je)}}function Ge(j){return j/360+.5}function at(j){var Y=Math.sin(j*Math.PI/180),J=.5-.25*Math.log((1+Y)/(1-Y))/Math.PI;return J<0?0:J>1?1:J}function yt(j,Y,J,ce,Ee,je,Ye,ie){if(ce/=Y,je>=(J/=Y)&&Ye<ce)return j;if(Ye<J||je>=ce)return null;for(var Ce=[],it=0;it<j.length;it++){var Nt=j[it],vr=Nt.geometry,Ot=Nt.type,ar=Ee===0?Nt.minX:Nt.minY,tn=Ee===0?Nt.maxX:Nt.maxY;if(ar>=J&&tn<ce)Ce.push(Nt);else if(!(tn<J||ar>=ce)){var qr=[];if(Ot==="Point"||Ot==="MultiPoint")rr(vr,qr,J,ce,Ee);else if(Ot==="LineString")hr(vr,qr,J,ce,Ee,!1,ie.lineMetrics);else if(Ot==="MultiLineString")rn(vr,qr,J,ce,Ee,!1);else if(Ot==="Polygon")rn(vr,qr,J,ce,Ee,!0);else if(Ot==="MultiPolygon")for(var Dt=0;Dt<vr.length;Dt++){var zr=[];rn(vr[Dt],zr,J,ce,Ee,!0),zr.length&&qr.push(zr)}if(qr.length){if(ie.lineMetrics&&Ot==="LineString"){for(Dt=0;Dt<qr.length;Dt++)Ce.push($t(Nt.id,Ot,qr[Dt],Nt.tags));continue}Ot!=="LineString"&&Ot!=="MultiLineString"||(qr.length===1?(Ot="LineString",qr=qr[0]):Ot="MultiLineString"),Ot!=="Point"&&Ot!=="MultiPoint"||(Ot=qr.length===3?"Point":"MultiPoint"),Ce.push($t(Nt.id,Ot,qr,Nt.tags))}}}return Ce.length?Ce:null}function rr(j,Y,J,ce,Ee){for(var je=0;je<j.length;je+=3){var Ye=j[je+Ee];Ye>=J&&Ye<=ce&&(Y.push(j[je]),Y.push(j[je+1]),Y.push(j[je+2]))}}function hr(j,Y,J,ce,Ee,je,Ye){for(var ie,Ce,it=Cn(j),Nt=Ee===0?qe:ct,vr=j.start,Ot=0;Ot<j.length-3;Ot+=3){var ar=j[Ot],tn=j[Ot+1],qr=j[Ot+2],Dt=j[Ot+3],zr=j[Ot+4],Rr=Ee===0?ar:tn,Pr=Ee===0?Dt:zr,Hn=!1;Ye&&(ie=Math.sqrt(Math.pow(ar-Dt,2)+Math.pow(tn-zr,2))),Rr<J?Pr>J&&(Ce=Nt(it,ar,tn,Dt,zr,J),Ye&&(it.start=vr+ie*Ce)):Rr>ce?Pr<ce&&(Ce=Nt(it,ar,tn,Dt,zr,ce),Ye&&(it.start=vr+ie*Ce)):Ne(it,ar,tn,qr),Pr<J&&Rr>=J&&(Ce=Nt(it,ar,tn,Dt,zr,J),Hn=!0),Pr>ce&&Rr<=ce&&(Ce=Nt(it,ar,tn,Dt,zr,ce),Hn=!0),!je&&Hn&&(Ye&&(it.end=vr+ie*Ce),Y.push(it),it=Cn(j)),Ye&&(vr+=ie)}var Lr=j.length-3;ar=j[Lr],tn=j[Lr+1],qr=j[Lr+2],(Rr=Ee===0?ar:tn)>=J&&Rr<=ce&&Ne(it,ar,tn,qr),Lr=it.length-3,je&&Lr>=3&&(it[Lr]!==it[0]||it[Lr+1]!==it[1])&&Ne(it,it[0],it[1],it[2]),it.length&&Y.push(it)}function Cn(j){var Y=[];return Y.size=j.size,Y.start=j.start,Y.end=j.end,Y}function rn(j,Y,J,ce,Ee,je){for(var Ye=0;Ye<j.length;Ye++)hr(j[Ye],Y,J,ce,Ee,je,!1)}function Ne(j,Y,J,ce){j.push(Y),j.push(J),j.push(ce)}function qe(j,Y,J,ce,Ee,je){var Ye=(je-Y)/(ce-Y);return j.push(je),j.push(J+(Ee-J)*Ye),j.push(1),Ye}function ct(j,Y,J,ce,Ee,je){var Ye=(je-J)/(Ee-J);return j.push(Y+(ce-Y)*Ye),j.push(je),j.push(1),Ye}function Vt(j,Y){for(var J=[],ce=0;ce<j.length;ce++){var Ee,je=j[ce],Ye=je.type;if(Ye==="Point"||Ye==="MultiPoint"||Ye==="LineString")Ee=Qr(je.geometry,Y);else if(Ye==="MultiLineString"||Ye==="Polygon"){Ee=[];for(var ie=0;ie<je.geometry.length;ie++)Ee.push(Qr(je.geometry[ie],Y))}else if(Ye==="MultiPolygon")for(Ee=[],ie=0;ie<je.geometry.length;ie++){for(var Ce=[],it=0;it<je.geometry[ie].length;it++)Ce.push(Qr(je.geometry[ie][it],Y));Ee.push(Ce)}J.push($t(je.id,Ye,Ee,je.tags))}return J}function Qr(j,Y){var J=[];J.size=j.size,j.start!==void 0&&(J.start=j.start,J.end=j.end);for(var ce=0;ce<j.length;ce+=3)J.push(j[ce]+Y,j[ce+1],j[ce+2]);return J}function Jn(j,Y){if(j.transformed)return j;var J,ce,Ee,je=1<<j.z,Ye=j.x,ie=j.y;for(J=0;J<j.features.length;J++){var Ce=j.features[J],it=Ce.geometry,Nt=Ce.type;if(Ce.geometry=[],Nt===1)for(ce=0;ce<it.length;ce+=2)Ce.geometry.push(Ri(it[ce],it[ce+1],Y,je,Ye,ie));else for(ce=0;ce<it.length;ce++){var vr=[];for(Ee=0;Ee<it[ce].length;Ee+=2)vr.push(Ri(it[ce][Ee],it[ce][Ee+1],Y,je,Ye,ie));Ce.geometry.push(vr)}}return j.transformed=!0,j}function Ri(j,Y,J,ce,Ee,je){return[Math.round(J*(j*ce-Ee)),Math.round(J*(Y*ce-je))]}function qn(j,Y,J,ce,Ee){for(var je=Y===Ee.maxZoom?0:Ee.tolerance/((1<<Y)*Ee.extent),Ye={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:J,y:ce,z:Y,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},ie=0;ie<j.length;ie++){Ye.numFeatures++,en(Ye,j[ie],je,Ee);var Ce=j[ie].minX,it=j[ie].minY,Nt=j[ie].maxX,vr=j[ie].maxY;Ce<Ye.minX&&(Ye.minX=Ce),it<Ye.minY&&(Ye.minY=it),Nt>Ye.maxX&&(Ye.maxX=Nt),vr>Ye.maxY&&(Ye.maxY=vr)}return Ye}function en(j,Y,J,ce){var Ee=Y.geometry,je=Y.type,Ye=[];if(je==="Point"||je==="MultiPoint")for(var ie=0;ie<Ee.length;ie+=3)Ye.push(Ee[ie]),Ye.push(Ee[ie+1]),j.numPoints++,j.numSimplified++;else if(je==="LineString")fn(Ye,Ee,j,J,!1,!1);else if(je==="MultiLineString"||je==="Polygon")for(ie=0;ie<Ee.length;ie++)fn(Ye,Ee[ie],j,J,je==="Polygon",ie===0);else if(je==="MultiPolygon")for(var Ce=0;Ce<Ee.length;Ce++){var it=Ee[Ce];for(ie=0;ie<it.length;ie++)fn(Ye,it[ie],j,J,!0,ie===0)}if(Ye.length){var Nt=Y.tags||null;if(je==="LineString"&&ce.lineMetrics){for(var vr in Nt={},Y.tags)Nt[vr]=Y.tags[vr];Nt.mapbox_clip_start=Ee.start/Ee.size,Nt.mapbox_clip_end=Ee.end/Ee.size}var Ot={geometry:Ye,type:je==="Polygon"||je==="MultiPolygon"?3:je==="LineString"||je==="MultiLineString"?2:1,tags:Nt};Y.id!==null&&(Ot.id=Y.id),j.features.push(Ot)}}function fn(j,Y,J,ce,Ee,je){var Ye=ce*ce;if(ce>0&&Y.size<(Ee?Ye:ce))J.numPoints+=Y.length/3;else{for(var ie=[],Ce=0;Ce<Y.length;Ce+=3)(ce===0||Y[Ce+2]>Ye)&&(J.numSimplified++,ie.push(Y[Ce]),ie.push(Y[Ce+1])),J.numPoints++;Ee&&function(it,Nt){for(var vr=0,Ot=0,ar=it.length,tn=ar-2;Ot<ar;tn=Ot,Ot+=2)vr+=(it[Ot]-it[tn])*(it[Ot+1]+it[tn+1]);if(vr>0===Nt)for(Ot=0,ar=it.length;Ot<ar/2;Ot+=2){var qr=it[Ot],Dt=it[Ot+1];it[Ot]=it[ar-2-Ot],it[Ot+1]=it[ar-1-Ot],it[ar-2-Ot]=qr,it[ar-1-Ot]=Dt}}(ie,je),j.push(ie)}}function an(j,Y){var J=(Y=this.options=function(Ee,je){for(var Ye in je)Ee[Ye]=je[Ye];return Ee}(Object.create(this.options),Y)).debug;if(J&&console.time("preprocess data"),Y.maxZoom<0||Y.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(Y.promoteId&&Y.generateId)throw new Error("promoteId and generateId cannot be used together.");var ce=function(Ee,je){var Ye=[];if(Ee.type==="FeatureCollection")for(var ie=0;ie<Ee.features.length;ie++)tr(Ye,Ee.features[ie],je,ie);else tr(Ye,Ee.type==="Feature"?Ee:{geometry:Ee},je);return Ye}(j,Y);this.tiles={},this.tileCoords=[],J&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",Y.indexMaxZoom,Y.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(ce=function(Ee,je){var Ye=je.buffer/je.extent,ie=Ee,Ce=yt(Ee,1,-1-Ye,Ye,0,-1,2,je),it=yt(Ee,1,1-Ye,2+Ye,0,-1,2,je);return(Ce||it)&&(ie=yt(Ee,1,-Ye,1+Ye,0,-1,2,je)||[],Ce&&(ie=Vt(Ce,1).concat(ie)),it&&(ie=ie.concat(Vt(it,-1)))),ie}(ce,Y)).length&&this.splitTile(ce,0,0,0),J&&(ce.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function un(j,Y,J){return 32*((1<<j)*J+Y)+j}function ti(j,Y){var J=j.tileID.canonical;if(!this._geoJSONIndex)return Y(null,null);var ce=this._geoJSONIndex.getTile(J.z,J.x,J.y);if(!ce)return Y(null,null);var Ee=new G(ce.features),je=de(Ee);je.byteOffset===0&&je.byteLength===je.buffer.byteLength||(je=new Uint8Array(je)),Y(null,{vectorTile:Ee,rawData:je.buffer})}pn.prototype.load=function(j){var Y=this.options,J=Y.log,ce=Y.minZoom,Ee=Y.maxZoom,je=Y.nodeSize;J&&console.time("total time");var Ye="prepare "+j.length+" points";J&&console.time(Ye),this.points=j;for(var ie=[],Ce=0;Ce<j.length;Ce++)j[Ce].geometry&&ie.push(Je(j[Ce],Ce));this.trees[Ee+1]=new Ar(ie,ft,At,je,Float32Array),J&&console.timeEnd(Ye);for(var it=Ee;it>=ce;it--){var Nt=+Date.now();ie=this._cluster(ie,it),this.trees[it]=new Ar(ie,ft,At,je,Float32Array),J&&console.log("z%d: %d clusters in %dms",it,ie.length,+Date.now()-Nt)}return J&&console.timeEnd("total time"),this},pn.prototype.getClusters=function(j,Y){var J=((j[0]+180)%360+360)%360-180,ce=Math.max(-90,Math.min(90,j[1])),Ee=j[2]===180?180:((j[2]+180)%360+360)%360-180,je=Math.max(-90,Math.min(90,j[3]));if(j[2]-j[0]>=360)J=-180,Ee=180;else if(J>Ee){var Ye=this.getClusters([J,ce,180,je],Y),ie=this.getClusters([-180,ce,Ee,je],Y);return Ye.concat(ie)}for(var Ce=this.trees[this._limitZoom(Y)],it=[],Nt=0,vr=Ce.range(Ut(J),ge(je),Ut(Ee),ge(ce));Nt<vr.length;Nt+=1){var Ot=Ce.points[vr[Nt]];it.push(Ot.numPoints?Qt(Ot):this.points[Ot.index])}return it},pn.prototype.getChildren=function(j){var Y=this._getOriginId(j),J=this._getOriginZoom(j),ce="No cluster with the specified id.",Ee=this.trees[J];if(!Ee)throw new Error(ce);var je=Ee.points[Y];if(!je)throw new Error(ce);for(var Ye=this.options.radius/(this.options.extent*Math.pow(2,J-1)),ie=[],Ce=0,it=Ee.within(je.x,je.y,Ye);Ce<it.length;Ce+=1){var Nt=Ee.points[it[Ce]];Nt.parentId===j&&ie.push(Nt.numPoints?Qt(Nt):this.points[Nt.index])}if(ie.length===0)throw new Error(ce);return ie},pn.prototype.getLeaves=function(j,Y,J){var ce=[];return this._appendLeaves(ce,j,Y=Y||10,J=J||0,0),ce},pn.prototype.getTile=function(j,Y,J){var ce=this.trees[this._limitZoom(j)],Ee=Math.pow(2,j),je=this.options,Ye=je.radius/je.extent,ie=(J-Ye)/Ee,Ce=(J+1+Ye)/Ee,it={features:[]};return this._addTileFeatures(ce.range((Y-Ye)/Ee,ie,(Y+1+Ye)/Ee,Ce),ce.points,Y,J,Ee,it),Y===0&&this._addTileFeatures(ce.range(1-Ye/Ee,ie,1,Ce),ce.points,Ee,J,Ee,it),Y===Ee-1&&this._addTileFeatures(ce.range(0,ie,Ye/Ee,Ce),ce.points,-1,J,Ee,it),it.features.length?it:null},pn.prototype.getClusterExpansionZoom=function(j){for(var Y=this._getOriginZoom(j)-1;Y<=this.options.maxZoom;){var J=this.getChildren(j);if(Y++,J.length!==1)break;j=J[0].properties.cluster_id}return Y},pn.prototype._appendLeaves=function(j,Y,J,ce,Ee){for(var je=0,Ye=this.getChildren(Y);je<Ye.length;je+=1){var ie=Ye[je],Ce=ie.properties;if(Ce&&Ce.cluster?Ee+Ce.point_count<=ce?Ee+=Ce.point_count:Ee=this._appendLeaves(j,Ce.cluster_id,J,ce,Ee):Ee<ce?Ee++:j.push(ie),j.length===J)break}return Ee},pn.prototype._addTileFeatures=function(j,Y,J,ce,Ee,je){for(var Ye=0,ie=j;Ye<ie.length;Ye+=1){var Ce=Y[ie[Ye]],it=Ce.numPoints,Nt={type:1,geometry:[[Math.round(this.options.extent*(Ce.x*Ee-J)),Math.round(this.options.extent*(Ce.y*Ee-ce))]],tags:it?Xr(Ce):this.points[Ce.index].properties},vr=void 0;it?vr=Ce.id:this.options.generateId?vr=Ce.index:this.points[Ce.index].id&&(vr=this.points[Ce.index].id),vr!==void 0&&(Nt.id=vr),je.features.push(Nt)}},pn.prototype._limitZoom=function(j){return Math.max(this.options.minZoom,Math.min(+j,this.options.maxZoom+1))},pn.prototype._cluster=function(j,Y){for(var J=[],ce=this.options,Ee=ce.reduce,je=ce.minPoints,Ye=ce.radius/(ce.extent*Math.pow(2,Y)),ie=0;ie<j.length;ie++){var Ce=j[ie];if(!(Ce.zoom<=Y)){Ce.zoom=Y;for(var it=this.trees[Y+1],Nt=it.within(Ce.x,Ce.y,Ye),vr=Ce.numPoints||1,Ot=vr,ar=0,tn=Nt;ar<tn.length;ar+=1){var qr=it.points[tn[ar]];qr.zoom>Y&&(Ot+=qr.numPoints||1)}if(Ot>=je){for(var Dt=Ce.x*vr,zr=Ce.y*vr,Rr=Ee&&vr>1?this._map(Ce,!0):null,Pr=(ie<<5)+(Y+1)+this.points.length,Hn=0,Lr=Nt;Hn<Lr.length;Hn+=1){var ci=it.points[Lr[Hn]];if(!(ci.zoom<=Y)){ci.zoom=Y;var Gi=ci.numPoints||1;Dt+=ci.x*Gi,zr+=ci.y*Gi,ci.parentId=Pr,Ee&&(Rr||(Rr=this._map(Ce,!0)),Ee(Rr,this._map(ci)))}}Ce.parentId=Pr,J.push(gi(Dt/Ot,zr/Ot,Pr,Ot,Rr))}else if(J.push(Ce),Ot>1)for(var oi=0,_i=Nt;oi<_i.length;oi+=1){var Gn=it.points[_i[oi]];Gn.zoom<=Y||(Gn.zoom=Y,J.push(Gn))}}}return J},pn.prototype._getOriginId=function(j){return j-this.points.length>>5},pn.prototype._getOriginZoom=function(j){return(j-this.points.length)%32},pn.prototype._map=function(j,Y){if(j.numPoints)return Y?Be({},j.properties):j.properties;var J=this.points[j.index].properties,ce=this.options.map(J);return Y&&ce===J?Be({},ce):ce},an.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},an.prototype.splitTile=function(j,Y,J,ce,Ee,je,Ye){for(var ie=[j,Y,J,ce],Ce=this.options,it=Ce.debug;ie.length;){ce=ie.pop(),J=ie.pop(),Y=ie.pop(),j=ie.pop();var Nt=1<<Y,vr=un(Y,J,ce),Ot=this.tiles[vr];if(!Ot&&(it>1&&console.time("creation"),Ot=this.tiles[vr]=qn(j,Y,J,ce,Ce),this.tileCoords.push({z:Y,x:J,y:ce}),it)){it>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Y,J,ce,Ot.numFeatures,Ot.numPoints,Ot.numSimplified),console.timeEnd("creation"));var ar="z"+Y;this.stats[ar]=(this.stats[ar]||0)+1,this.total++}if(Ot.source=j,Ee){if(Y===Ce.maxZoom||Y===Ee)continue;var tn=1<<Ee-Y;if(J!==Math.floor(je/tn)||ce!==Math.floor(Ye/tn))continue}else if(Y===Ce.indexMaxZoom||Ot.numPoints<=Ce.indexMaxPoints)continue;if(Ot.source=null,j.length!==0){it>1&&console.time("clipping");var qr,Dt,zr,Rr,Pr,Hn,Lr=.5*Ce.buffer/Ce.extent,ci=.5-Lr,Gi=.5+Lr,oi=1+Lr;qr=Dt=zr=Rr=null,Pr=yt(j,Nt,J-Lr,J+Gi,0,Ot.minX,Ot.maxX,Ce),Hn=yt(j,Nt,J+ci,J+oi,0,Ot.minX,Ot.maxX,Ce),j=null,Pr&&(qr=yt(Pr,Nt,ce-Lr,ce+Gi,1,Ot.minY,Ot.maxY,Ce),Dt=yt(Pr,Nt,ce+ci,ce+oi,1,Ot.minY,Ot.maxY,Ce),Pr=null),Hn&&(zr=yt(Hn,Nt,ce-Lr,ce+Gi,1,Ot.minY,Ot.maxY,Ce),Rr=yt(Hn,Nt,ce+ci,ce+oi,1,Ot.minY,Ot.maxY,Ce),Hn=null),it>1&&console.timeEnd("clipping"),ie.push(qr||[],Y+1,2*J,2*ce),ie.push(Dt||[],Y+1,2*J,2*ce+1),ie.push(zr||[],Y+1,2*J+1,2*ce),ie.push(Rr||[],Y+1,2*J+1,2*ce+1)}}},an.prototype.getTile=function(j,Y,J){var ce=this.options,Ee=ce.extent,je=ce.debug;if(j<0||j>24)return null;var Ye=1<<j,ie=un(j,Y=(Y%Ye+Ye)%Ye,J);if(this.tiles[ie])return Jn(this.tiles[ie],Ee);je>1&&console.log("drilling down to z%d-%d-%d",j,Y,J);for(var Ce,it=j,Nt=Y,vr=J;!Ce&&it>0;)it--,Nt=Math.floor(Nt/2),vr=Math.floor(vr/2),Ce=this.tiles[un(it,Nt,vr)];return Ce&&Ce.source?(je>1&&console.log("found parent tile z%d-%d-%d",it,Nt,vr),je>1&&console.time("drilling down"),this.splitTile(Ce.source,it,Nt,vr,j,Y,J),je>1&&console.timeEnd("drilling down"),this.tiles[ie]?Jn(this.tiles[ie],Ee):null):null};var Hi=function(j){function Y(J,ce,Ee,je){j.call(this,J,ce,Ee,ti),je&&(this.loadGeoJSON=je)}return j&&(Y.__proto__=j),(Y.prototype=Object.create(j&&j.prototype)).constructor=Y,Y.prototype.loadData=function(J,ce){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=ce,this._pendingLoadDataParams=J,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},Y.prototype._loadData=function(){var J=this;if(this._pendingCallback&&this._pendingLoadDataParams){var ce=this._pendingCallback,Ee=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var je=!!(Ee&&Ee.request&&Ee.request.collectResourceTiming)&&new a.RequestPerformance(Ee.request);this.loadGeoJSON(Ee,function(Ye,ie){if(Ye||!ie)return ce(Ye);if(typeof ie!="object")return ce(new Error("Input data given to '"+Ee.source+"' is not a valid GeoJSON object."));(function Ot(ar,tn){var qr,Dt=ar&&ar.type;if(Dt==="FeatureCollection")for(qr=0;qr<ar.features.length;qr++)Ot(ar.features[qr],tn);else if(Dt==="GeometryCollection")for(qr=0;qr<ar.geometries.length;qr++)Ot(ar.geometries[qr],tn);else if(Dt==="Feature")Ot(ar.geometry,tn);else if(Dt==="Polygon")k(ar.coordinates,tn);else if(Dt==="MultiPolygon")for(qr=0;qr<ar.coordinates.length;qr++)k(ar.coordinates[qr],tn);return ar})(ie,!0);try{if(Ee.filter){var Ce=a.createExpression(Ee.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ce.result==="error")throw new Error(Ce.value.map(function(Ot){return Ot.key+": "+Ot.message}).join(", "));var it=ie.features.filter(function(Ot){return Ce.value.evaluate({zoom:0},Ot)});ie={type:"FeatureCollection",features:it}}J._geoJSONIndex=Ee.cluster?new pn(function(Ot){var ar=Ot.superclusterOptions,tn=Ot.clusterProperties;if(!tn||!ar)return ar;for(var qr={},Dt={},zr={accumulated:null,zoom:0},Rr={properties:null},Pr=Object.keys(tn),Hn=0,Lr=Pr;Hn<Lr.length;Hn+=1){var ci=Lr[Hn],Gi=tn[ci],oi=Gi[0],_i=a.createExpression(Gi[1]),Gn=a.createExpression(typeof oi=="string"?[oi,["accumulated"],["get",ci]]:oi);qr[ci]=_i.value,Dt[ci]=Gn.value}return ar.map=function(ka){Rr.properties=ka;for(var hi={},Wi=0,Ii=Pr;Wi<Ii.length;Wi+=1){var Wn=Ii[Wi];hi[Wn]=qr[Wn].evaluate(zr,Rr)}return hi},ar.reduce=function(ka,hi){Rr.properties=hi;for(var Wi=0,Ii=Pr;Wi<Ii.length;Wi+=1){var Wn=Ii[Wi];zr.accumulated=ka[Wn],ka[Wn]=Dt[Wn].evaluate(zr,Rr)}},ar}(Ee)).load(ie.features):function(Ot,ar){return new an(Ot,ar)}(ie,Ee.geojsonVtOptions)}catch(Ot){return ce(Ot)}J.loaded={};var Nt={};if(je){var vr=je.finish();vr&&(Nt.resourceTiming={},Nt.resourceTiming[Ee.source]=JSON.parse(JSON.stringify(vr)))}ce(null,Nt)})}},Y.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},Y.prototype.reloadTile=function(J,ce){var Ee=this.loaded;return Ee&&Ee[J.uid]?j.prototype.reloadTile.call(this,J,ce):this.loadTile(J,ce)},Y.prototype.loadGeoJSON=function(J,ce){if(J.request)a.getJSON(J.request,ce);else{if(typeof J.data!="string")return ce(new Error("Input data given to '"+J.source+"' is not a valid GeoJSON object."));try{return ce(null,JSON.parse(J.data))}catch{return ce(new Error("Input data given to '"+J.source+"' is not a valid GeoJSON object."))}}},Y.prototype.removeSource=function(J,ce){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),ce()},Y.prototype.getClusterExpansionZoom=function(J,ce){try{ce(null,this._geoJSONIndex.getClusterExpansionZoom(J.clusterId))}catch(Ee){ce(Ee)}},Y.prototype.getClusterChildren=function(J,ce){try{ce(null,this._geoJSONIndex.getChildren(J.clusterId))}catch(Ee){ce(Ee)}},Y.prototype.getClusterLeaves=function(J,ce){try{ce(null,this._geoJSONIndex.getLeaves(J.clusterId,J.limit,J.offset))}catch(Ee){ce(Ee)}},Y}(w),Fn=function(j){var Y=this;this.self=j,this.actor=new a.Actor(j,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:w,geojson:Hi},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(J,ce){if(Y.workerSourceTypes[J])throw new Error('Worker source with name "'+J+'" already registered.');Y.workerSourceTypes[J]=ce},this.self.registerRTLTextPlugin=function(J){if(a.plugin.isParsed())throw new Error("RTL text plugin already registered.");a.plugin.applyArabicShaping=J.applyArabicShaping,a.plugin.processBidirectionalText=J.processBidirectionalText,a.plugin.processStyledBidirectionalText=J.processStyledBidirectionalText}};return Fn.prototype.setReferrer=function(j,Y){this.referrer=Y},Fn.prototype.setImages=function(j,Y,J){for(var ce in this.availableImages[j]=Y,this.workerSources[j]){var Ee=this.workerSources[j][ce];for(var je in Ee)Ee[je].availableImages=Y}J()},Fn.prototype.setLayers=function(j,Y,J){this.getLayerIndex(j).replace(Y),J()},Fn.prototype.updateLayers=function(j,Y,J){this.getLayerIndex(j).update(Y.layers,Y.removedIds),J()},Fn.prototype.loadTile=function(j,Y,J){this.getWorkerSource(j,Y.type,Y.source).loadTile(Y,J)},Fn.prototype.loadDEMTile=function(j,Y,J){this.getDEMWorkerSource(j,Y.source).loadTile(Y,J)},Fn.prototype.reloadTile=function(j,Y,J){this.getWorkerSource(j,Y.type,Y.source).reloadTile(Y,J)},Fn.prototype.abortTile=function(j,Y,J){this.getWorkerSource(j,Y.type,Y.source).abortTile(Y,J)},Fn.prototype.removeTile=function(j,Y,J){this.getWorkerSource(j,Y.type,Y.source).removeTile(Y,J)},Fn.prototype.removeDEMTile=function(j,Y){this.getDEMWorkerSource(j,Y.source).removeTile(Y)},Fn.prototype.removeSource=function(j,Y,J){if(this.workerSources[j]&&this.workerSources[j][Y.type]&&this.workerSources[j][Y.type][Y.source]){var ce=this.workerSources[j][Y.type][Y.source];delete this.workerSources[j][Y.type][Y.source],ce.removeSource!==void 0?ce.removeSource(Y,J):J()}},Fn.prototype.loadWorkerSource=function(j,Y,J){try{this.self.importScripts(Y.url),J()}catch(ce){J(ce.toString())}},Fn.prototype.syncRTLPluginState=function(j,Y,J){try{a.plugin.setState(Y);var ce=a.plugin.getPluginURL();if(a.plugin.isLoaded()&&!a.plugin.isParsed()&&ce!=null){this.self.importScripts(ce);var Ee=a.plugin.isParsed();J(Ee?void 0:new Error("RTL Text Plugin failed to import scripts from "+ce),Ee)}}catch(je){J(je.toString())}},Fn.prototype.getAvailableImages=function(j){var Y=this.availableImages[j];return Y||(Y=[]),Y},Fn.prototype.getLayerIndex=function(j){var Y=this.layerIndexes[j];return Y||(Y=this.layerIndexes[j]=new f),Y},Fn.prototype.getWorkerSource=function(j,Y,J){var ce=this;return this.workerSources[j]||(this.workerSources[j]={}),this.workerSources[j][Y]||(this.workerSources[j][Y]={}),this.workerSources[j][Y][J]||(this.workerSources[j][Y][J]=new this.workerSourceTypes[Y]({send:function(Ee,je,Ye){ce.actor.send(Ee,je,Ye,j)}},this.getLayerIndex(j),this.getAvailableImages(j))),this.workerSources[j][Y][J]},Fn.prototype.getDEMWorkerSource=function(j,Y){return this.demWorkerSources[j]||(this.demWorkerSources[j]={}),this.demWorkerSources[j][Y]||(this.demWorkerSources[j][Y]=new P),this.demWorkerSources[j][Y]},Fn.prototype.enforceCacheSizeLimit=function(j,Y){a.enforceCacheSizeLimit(Y)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Fn(self)),Fn}),o(["./shared"],function(a){var u=a.createCommonjsModule(function(p){function v(S){return!d(S)}function d(S){return typeof window>"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var I,O,z=new Blob([""],{type:"text/javascript"}),X=URL.createObjectURL(z);try{O=new Worker(X),I=!0}catch{I=!1}return O&&O.terminate(),URL.revokeObjectURL(X),I}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var I=document.createElement("canvas");I.width=I.height=1;var O=I.getContext("2d");if(!O)return!1;var z=O.getImageData(0,0,1,1);return z&&z.width===I.width}()?(y[C=S&&S.failIfMajorPerformanceCaveat]===void 0&&(y[C]=function(I){var O=function(X){var ne=document.createElement("canvas"),ae=Object.create(v.webGLContextAttributes);return ae.failIfMajorPerformanceCaveat=X,ne.probablySupportsContext?ne.probablySupportsContext("webgl",ae)||ne.probablySupportsContext("experimental-webgl",ae):ne.supportsContext?ne.supportsContext("webgl",ae)||ne.supportsContext("experimental-webgl",ae):ne.getContext("webgl",ae)||ne.getContext("experimental-webgl",ae)}(I);if(!O)return!1;var z=O.createShader(O.VERTEX_SHADER);return!(!z||O.isContextLost())&&(O.shaderSource(z,"void main() {}"),O.compileShader(z),O.getShaderParameter(z,O.COMPILE_STATUS)===!0)}(C)),y[C]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var C}p.exports?p.exports=v:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=v,window.mapboxgl.notSupportedReason=d);var y={};v.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),c={create:function(p,v,d){var y=a.window.document.createElement(p);return v!==void 0&&(y.className=v),d&&d.appendChild(y),y},createNS:function(p,v){return a.window.document.createElementNS(p,v)}},f=a.window.document&&a.window.document.documentElement.style;function m(p){if(!f)return p[0];for(var v=0;v<p.length;v++)if(p[v]in f)return p[v];return p[0]}var _,b=m(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);c.disableDrag=function(){f&&b&&(_=f[b],f[b]="none")},c.enableDrag=function(){f&&b&&(f[b]=_)};var A=m(["transform","WebkitTransform"]);c.setTransform=function(p,v){p.style[A]=v};var w=!1;try{var R=Object.defineProperty({},"passive",{get:function(){w=!0}});a.window.addEventListener("test",R,R),a.window.removeEventListener("test",R,R)}catch{w=!1}c.addEventListener=function(p,v,d,y){y===void 0&&(y={}),p.addEventListener(v,d,"passive"in y&&w?y:y.capture)},c.removeEventListener=function(p,v,d,y){y===void 0&&(y={}),p.removeEventListener(v,d,"passive"in y&&w?y:y.capture)};var P=function(p){p.preventDefault(),p.stopPropagation(),a.window.removeEventListener("click",P,!0)};function k(p){var v=p.userImage;return!!(v&&v.render&&v.render())&&(p.data.replace(new Uint8Array(v.data.buffer)),!0)}c.suppressClick=function(){a.window.addEventListener("click",P,!0),a.window.setTimeout(function(){a.window.removeEventListener("click",P,!0)},0)},c.mousePos=function(p,v){var d=p.getBoundingClientRect();return new a.Point(v.clientX-d.left-p.clientLeft,v.clientY-d.top-p.clientTop)},c.touchPos=function(p,v){for(var d=p.getBoundingClientRect(),y=[],S=0;S<v.length;S++)y.push(new a.Point(v[S].clientX-d.left-p.clientLeft,v[S].clientY-d.top-p.clientTop));return y},c.mouseButton=function(p){return a.window.InstallTrigger!==void 0&&p.button===2&&p.ctrlKey&&a.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:p.button},c.remove=function(p){p.parentNode&&p.parentNode.removeChild(p)};var L=function(p){function v(){p.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new a.RGBAImage({width:1,height:1}),this.dirty=!0}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.isLoaded=function(){return this.loaded},v.prototype.setLoaded=function(d){if(this.loaded!==d&&(this.loaded=d,d)){for(var y=0,S=this.requestors;y<S.length;y+=1){var C=S[y];this._notify(C.ids,C.callback)}this.requestors=[]}},v.prototype.getImage=function(d){return this.images[d]},v.prototype.addImage=function(d,y){this._validate(d,y)&&(this.images[d]=y)},v.prototype._validate=function(d,y){var S=!0;return this._validateStretch(y.stretchX,y.data&&y.data.width)||(this.fire(new a.ErrorEvent(new Error('Image "'+d+'" has invalid "stretchX" value'))),S=!1),this._validateStretch(y.stretchY,y.data&&y.data.height)||(this.fire(new a.ErrorEvent(new Error('Image "'+d+'" has invalid "stretchY" value'))),S=!1),this._validateContent(y.content,y)||(this.fire(new a.ErrorEvent(new Error('Image "'+d+'" has invalid "content" value'))),S=!1),S},v.prototype._validateStretch=function(d,y){if(!d)return!0;for(var S=0,C=0,I=d;C<I.length;C+=1){var O=I[C];if(O[0]<S||O[1]<O[0]||y<O[1])return!1;S=O[1]}return!0},v.prototype._validateContent=function(d,y){return!(d&&(d.length!==4||d[0]<0||y.data.width<d[0]||d[1]<0||y.data.height<d[1]||d[2]<0||y.data.width<d[2]||d[3]<0||y.data.height<d[3]||d[2]<d[0]||d[3]<d[1]))},v.prototype.updateImage=function(d,y){y.version=this.images[d].version+1,this.images[d]=y,this.updatedImages[d]=!0},v.prototype.removeImage=function(d){var y=this.images[d];delete this.images[d],delete this.patterns[d],y.userImage&&y.userImage.onRemove&&y.userImage.onRemove()},v.prototype.listImages=function(){return Object.keys(this.images)},v.prototype.getImages=function(d,y){var S=!0;if(!this.isLoaded())for(var C=0,I=d;C<I.length;C+=1)this.images[I[C]]||(S=!1);this.isLoaded()||S?this._notify(d,y):this.requestors.push({ids:d,callback:y})},v.prototype._notify=function(d,y){for(var S={},C=0,I=d;C<I.length;C+=1){var O=I[C];this.images[O]||this.fire(new a.Event("styleimagemissing",{id:O}));var z=this.images[O];z?S[O]={data:z.data.clone(),pixelRatio:z.pixelRatio,sdf:z.sdf,version:z.version,stretchX:z.stretchX,stretchY:z.stretchY,content:z.content,hasRenderCallback:!!(z.userImage&&z.userImage.render)}:a.warnOnce('Image "'+O+'" 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.')}y(null,S)},v.prototype.getPixelSize=function(){var d=this.atlasImage;return{width:d.width,height:d.height}},v.prototype.getPattern=function(d){var y=this.patterns[d],S=this.getImage(d);if(!S)return null;if(y&&y.position.version===S.version)return y.position;if(y)y.position.version=S.version;else{var C={w:S.data.width+2,h:S.data.height+2,x:0,y:0},I=new a.ImagePosition(C,S);this.patterns[d]={bin:C,position:I}}return this._updatePatternAtlas(),this.patterns[d].position},v.prototype.bind=function(d){var y=d.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new a.Texture(d,this.atlasImage,y.RGBA),this.atlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE)},v.prototype._updatePatternAtlas=function(){var d=[];for(var y in this.patterns)d.push(this.patterns[y].bin);var S=a.potpack(d),C=S.w,I=S.h,O=this.atlasImage;for(var z in O.resize({width:C||1,height:I||1}),this.patterns){var X=this.patterns[z].bin,ne=X.x+1,ae=X.y+1,oe=this.images[z].data,we=oe.width,be=oe.height;a.RGBAImage.copy(oe,O,{x:0,y:0},{x:ne,y:ae},{width:we,height:be}),a.RGBAImage.copy(oe,O,{x:0,y:be-1},{x:ne,y:ae-1},{width:we,height:1}),a.RGBAImage.copy(oe,O,{x:0,y:0},{x:ne,y:ae+be},{width:we,height:1}),a.RGBAImage.copy(oe,O,{x:we-1,y:0},{x:ne-1,y:ae},{width:1,height:be}),a.RGBAImage.copy(oe,O,{x:0,y:0},{x:ne+we,y:ae},{width:1,height:be})}this.dirty=!0},v.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},v.prototype.dispatchRenderCallbacks=function(d){for(var y=0,S=d;y<S.length;y+=1){var C=S[y];if(!this.callbackDispatchedThisFrame[C]){this.callbackDispatchedThisFrame[C]=!0;var I=this.images[C];k(I)&&this.updateImage(C,I)}}},v}(a.Evented),B=K,V=K,G=1e20;function K(p,v,d,y,S,C){this.fontSize=p||24,this.buffer=v===void 0?3:v,this.cutoff=y||.25,this.fontFamily=S||"sans-serif",this.fontWeight=C||"normal",this.radius=d||8;var I=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=I,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(I*I),this.gridInner=new Float64Array(I*I),this.f=new Float64Array(I),this.d=new Float64Array(I),this.z=new Float64Array(I+1),this.v=new Int16Array(I),this.middle=Math.round(I/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Z(p,v,d,y,S,C,I){for(var O=0;O<v;O++){for(var z=0;z<d;z++)y[z]=p[z*v+O];for(ve(y,S,C,I,d),z=0;z<d;z++)p[z*v+O]=S[z]}for(z=0;z<d;z++){for(O=0;O<v;O++)y[O]=p[z*v+O];for(ve(y,S,C,I,v),O=0;O<v;O++)p[z*v+O]=Math.sqrt(S[O])}}function ve(p,v,d,y,S){d[0]=0,y[0]=-G,y[1]=+G;for(var C=1,I=0;C<S;C++){for(var O=(p[C]+C*C-(p[d[I]]+d[I]*d[I]))/(2*C-2*d[I]);O<=y[I];)I--,O=(p[C]+C*C-(p[d[I]]+d[I]*d[I]))/(2*C-2*d[I]);d[++I]=C,y[I]=O,y[I+1]=+G}for(C=0,I=0;C<S;C++){for(;y[I+1]<C;)I++;v[C]=(C-d[I])*(C-d[I])+p[d[I]]}}K.prototype.draw=function(p){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(p,this.buffer,this.middle);for(var v=this.ctx.getImageData(0,0,this.size,this.size),d=new Uint8ClampedArray(this.size*this.size),y=0;y<this.size*this.size;y++){var S=v.data[4*y+3]/255;this.gridOuter[y]=S===1?0:S===0?G:Math.pow(Math.max(0,.5-S),2),this.gridInner[y]=S===1?G:S===0?0:Math.pow(Math.max(0,S-.5),2)}for(Z(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),Z(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),y=0;y<this.size*this.size;y++)d[y]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[y]-this.gridInner[y])/this.radius+this.cutoff))));return d},B.default=V;var Ie=function(p,v){this.requestManager=p,this.localIdeographFontFamily=v,this.entries={}};Ie.prototype.setURL=function(p){this.url=p},Ie.prototype.getGlyphs=function(p,v){var d=this,y=[];for(var S in p)for(var C=0,I=p[S];C<I.length;C+=1)y.push({stack:S,id:I[C]});a.asyncAll(y,function(O,z){var X=O.stack,ne=O.id,ae=d.entries[X];ae||(ae=d.entries[X]={glyphs:{},requests:{},ranges:{}});var oe=ae.glyphs[ne];if(oe===void 0){if(oe=d._tinySDF(ae,X,ne))return ae.glyphs[ne]=oe,void z(null,{stack:X,id:ne,glyph:oe});var we=Math.floor(ne/256);if(256*we>65535)z(new Error("glyphs > 65535 not supported"));else if(ae.ranges[we])z(null,{stack:X,id:ne,glyph:oe});else{var be=ae.requests[we];be||(be=ae.requests[we]=[],Ie.loadGlyphRange(X,we,d.url,d.requestManager,function(Fe,_e){if(_e){for(var De in _e)d._doesCharSupportLocalGlyph(+De)||(ae.glyphs[+De]=_e[+De]);ae.ranges[we]=!0}for(var Xe=0,ot=be;Xe<ot.length;Xe+=1)(0,ot[Xe])(Fe,_e);delete ae.requests[we]})),be.push(function(Fe,_e){Fe?z(Fe):_e&&z(null,{stack:X,id:ne,glyph:_e[ne]||null})})}}else z(null,{stack:X,id:ne,glyph:oe})},function(O,z){if(O)v(O);else if(z){for(var X={},ne=0,ae=z;ne<ae.length;ne+=1){var oe=ae[ne],we=oe.stack,be=oe.id,Fe=oe.glyph;(X[we]||(X[we]={}))[be]=Fe&&{id:Fe.id,bitmap:Fe.bitmap.clone(),metrics:Fe.metrics}}v(null,X)}})},Ie.prototype._doesCharSupportLocalGlyph=function(p){return!!this.localIdeographFontFamily&&(a.isChar["CJK Unified Ideographs"](p)||a.isChar["Hangul Syllables"](p)||a.isChar.Hiragana(p)||a.isChar.Katakana(p))},Ie.prototype._tinySDF=function(p,v,d){var y=this.localIdeographFontFamily;if(y&&this._doesCharSupportLocalGlyph(d)){var S=p.tinySDF;if(!S){var C="400";/bold/i.test(v)?C="900":/medium/i.test(v)?C="500":/light/i.test(v)&&(C="200"),S=p.tinySDF=new Ie.TinySDF(24,3,8,.25,y,C)}return{id:d,bitmap:new a.AlphaImage({width:30,height:30},S.draw(String.fromCharCode(d))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},Ie.loadGlyphRange=function(p,v,d,y,S){var C=256*v,I=C+255,O=y.transformRequest(y.normalizeGlyphsURL(d).replace("{fontstack}",p).replace("{range}",C+"-"+I),a.ResourceType.Glyphs);a.getArrayBuffer(O,function(z,X){if(z)S(z);else if(X){for(var ne={},ae=0,oe=a.parseGlyphPBF(X);ae<oe.length;ae+=1){var we=oe[ae];ne[we.id]=we}S(null,ne)}})},Ie.TinySDF=B;var de=function(){this.specification=a.styleSpec.light.position};de.prototype.possiblyEvaluate=function(p,v){return a.sphericalToCartesian(p.expression.evaluate(v))},de.prototype.interpolate=function(p,v,d){return{x:a.number(p.x,v.x,d),y:a.number(p.y,v.y,d),z:a.number(p.z,v.z,d)}};var se=new a.Properties({anchor:new a.DataConstantProperty(a.styleSpec.light.anchor),position:new de,color:new a.DataConstantProperty(a.styleSpec.light.color),intensity:new a.DataConstantProperty(a.styleSpec.light.intensity)}),le=function(p){function v(d){p.call(this),this._transitionable=new a.Transitionable(se),this.setLight(d),this._transitioning=this._transitionable.untransitioned()}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getLight=function(){return this._transitionable.serialize()},v.prototype.setLight=function(d,y){if(y===void 0&&(y={}),!this._validate(a.validateLight,d,y))for(var S in d){var C=d[S];a.endsWith(S,"-transition")?this._transitionable.setTransition(S.slice(0,-11),C):this._transitionable.setValue(S,C)}},v.prototype.updateTransitions=function(d){this._transitioning=this._transitionable.transitioned(d,this._transitioning)},v.prototype.hasTransition=function(){return this._transitioning.hasTransition()},v.prototype.recalculate=function(d){this.properties=this._transitioning.possiblyEvaluate(d)},v.prototype._validate=function(d,y,S){return(!S||S.validate!==!1)&&a.emitValidationErrors(this,d.call(a.validateStyle,a.extend({value:y,style:{glyphs:!0,sprite:!0},styleSpec:a.styleSpec})))},v}(a.Evented),ye=function(p,v){this.width=p,this.height=v,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};ye.prototype.getDash=function(p,v){var d=p.join(",")+String(v);return this.dashEntry[d]||(this.dashEntry[d]=this.addDash(p,v)),this.dashEntry[d]},ye.prototype.getDashRanges=function(p,v,d){var y=[],S=p.length%2==1?-p[p.length-1]*d:0,C=p[0]*d,I=!0;y.push({left:S,right:C,isDash:I,zeroLength:p[0]===0});for(var O=p[0],z=1;z<p.length;z++){var X=p[z];y.push({left:S=O*d,right:C=(O+=X)*d,isDash:I=!I,zeroLength:X===0})}return y},ye.prototype.addRoundDash=function(p,v,d){for(var y=v/2,S=-d;S<=d;S++)for(var C=this.width*(this.nextRow+d+S),I=0,O=p[I],z=0;z<this.width;z++){z/O.right>1&&(O=p[++I]);var X=Math.abs(z-O.left),ne=Math.abs(z-O.right),ae=Math.min(X,ne),oe=void 0,we=S/d*(y+1);if(O.isDash){var be=y-Math.abs(we);oe=Math.sqrt(ae*ae+be*be)}else oe=y-Math.sqrt(ae*ae+we*we);this.data[C+z]=Math.max(0,Math.min(255,oe+128))}},ye.prototype.addRegularDash=function(p){for(var v=p.length-1;v>=0;--v){var d=p[v],y=p[v+1];d.zeroLength?p.splice(v,1):y&&y.isDash===d.isDash&&(y.left=d.left,p.splice(v,1))}var S=p[0],C=p[p.length-1];S.isDash===C.isDash&&(S.left=C.left-this.width,C.right=S.right+this.width);for(var I=this.width*this.nextRow,O=0,z=p[O],X=0;X<this.width;X++){X/z.right>1&&(z=p[++O]);var ne=Math.abs(X-z.left),ae=Math.abs(X-z.right),oe=Math.min(ne,ae);this.data[I+X]=Math.max(0,Math.min(255,(z.isDash?oe:-oe)+128))}},ye.prototype.addDash=function(p,v){var d=v?7:0,y=2*d+1;if(this.nextRow+y>this.height)return a.warnOnce("LineAtlas out of space"),null;for(var S=0,C=0;C<p.length;C++)S+=p[C];if(S!==0){var I=this.width/S,O=this.getDashRanges(p,this.width,I);v?this.addRoundDash(O,I,d):this.addRegularDash(O)}var z={y:(this.nextRow+d+.5)/this.height,height:2*d/this.height,width:S};return this.nextRow+=y,this.dirty=!0,z},ye.prototype.bind=function(p){var v=p.gl;this.texture?(v.bindTexture(v.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,v.texSubImage2D(v.TEXTURE_2D,0,0,0,this.width,this.height,v.ALPHA,v.UNSIGNED_BYTE,this.data))):(this.texture=v.createTexture(),v.bindTexture(v.TEXTURE_2D,this.texture),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,v.REPEAT),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,v.REPEAT),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.LINEAR),v.texImage2D(v.TEXTURE_2D,0,v.ALPHA,this.width,this.height,0,v.ALPHA,v.UNSIGNED_BYTE,this.data))};var ke=function p(v,d){this.workerPool=v,this.actors=[],this.currentActor=0,this.id=a.uniqueId();for(var y=this.workerPool.acquire(this.id),S=0;S<y.length;S++){var C=new p.Actor(y[S],d,this.id);C.name="Worker "+S,this.actors.push(C)}};function Rt(p,v,d){var y=function(S,C){if(S)return d(S);if(C){var I=a.pick(a.extend(C,p),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);C.vector_layers&&(I.vectorLayers=C.vector_layers,I.vectorLayerIds=I.vectorLayers.map(function(O){return O.id})),I.tiles=v.canonicalizeTileset(I,p.url),d(null,I)}};return p.url?a.getJSON(v.transformRequest(v.normalizeSourceURL(p.url),a.ResourceType.Source),y):a.browser.frame(function(){return y(null,p)})}ke.prototype.broadcast=function(p,v,d){a.asyncAll(this.actors,function(y,S){y.send(p,v,S)},d=d||function(){})},ke.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},ke.prototype.remove=function(){this.actors.forEach(function(p){p.remove()}),this.actors=[],this.workerPool.release(this.id)},ke.Actor=a.Actor;var Lt=function(p,v,d){this.bounds=a.LngLatBounds.convert(this.validateBounds(p)),this.minzoom=v||0,this.maxzoom=d||24};Lt.prototype.validateBounds=function(p){return Array.isArray(p)&&p.length===4?[Math.max(-180,p[0]),Math.max(-90,p[1]),Math.min(180,p[2]),Math.min(90,p[3])]:[-180,-90,180,90]},Lt.prototype.contains=function(p){var v=Math.pow(2,p.z),d=Math.floor(a.mercatorXfromLng(this.bounds.getWest())*v),y=Math.floor(a.mercatorYfromLat(this.bounds.getNorth())*v),S=Math.ceil(a.mercatorXfromLng(this.bounds.getEast())*v),C=Math.ceil(a.mercatorYfromLat(this.bounds.getSouth())*v);return p.x>=d&&p.x<S&&p.y>=y&&p.y<C};var Gt=function(p){function v(d,y,S,C){if(p.call(this),this.id=d,this.dispatcher=S,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,a.extend(this,a.pick(y,["url","scheme","tileSize","promoteId"])),this._options=a.extend({type:"vector"},y),this._collectResourceTiming=y.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(C)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.load=function(){var d=this;this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Rt(this._options,this.map._requestManager,function(y,S){d._tileJSONRequest=null,d._loaded=!0,y?d.fire(new a.ErrorEvent(y)):S&&(a.extend(d,S),S.bounds&&(d.tileBounds=new Lt(S.bounds,d.minzoom,d.maxzoom)),a.postTurnstileEvent(S.tiles,d.map._requestManager._customAccessToken),a.postMapLoadEvent(S.tiles,d.map._getMapId(),d.map._requestManager._skuToken,d.map._requestManager._customAccessToken),d.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),d.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})))})},v.prototype.loaded=function(){return this._loaded},v.prototype.hasTile=function(d){return!this.tileBounds||this.tileBounds.contains(d.canonical)},v.prototype.onAdd=function(d){this.map=d,this.load()},v.prototype.setSourceProperty=function(d){this._tileJSONRequest&&this._tileJSONRequest.cancel(),d(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},v.prototype.setTiles=function(d){var y=this;return this.setSourceProperty(function(){y._options.tiles=d}),this},v.prototype.setUrl=function(d){var y=this;return this.setSourceProperty(function(){y.url=d,y._options.url=d}),this},v.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},v.prototype.serialize=function(){return a.extend({},this._options)},v.prototype.loadTile=function(d,y){var S=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme)),C={request:this.map._requestManager.transformRequest(S,a.ResourceType.Tile),uid:d.uid,tileID:d.tileID,zoom:d.tileID.overscaledZ,tileSize:this.tileSize*d.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:a.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function I(O,z){return delete d.request,d.aborted?y(null):O&&O.status!==404?y(O):(z&&z.resourceTiming&&(d.resourceTiming=z.resourceTiming),this.map._refreshExpiredTiles&&z&&d.setExpiryData(z),d.loadVectorData(z,this.map.painter),a.cacheEntryPossiblyAdded(this.dispatcher),y(null),void(d.reloadCallback&&(this.loadTile(d,d.reloadCallback),d.reloadCallback=null)))}C.request.collectResourceTiming=this._collectResourceTiming,d.actor&&d.state!=="expired"?d.state==="loading"?d.reloadCallback=y:d.request=d.actor.send("reloadTile",C,I.bind(this)):(d.actor=this.dispatcher.getActor(),d.request=d.actor.send("loadTile",C,I.bind(this)))},v.prototype.abortTile=function(d){d.request&&(d.request.cancel(),delete d.request),d.actor&&d.actor.send("abortTile",{uid:d.uid,type:this.type,source:this.id},void 0)},v.prototype.unloadTile=function(d){d.unloadVectorData(),d.actor&&d.actor.send("removeTile",{uid:d.uid,type:this.type,source:this.id},void 0)},v.prototype.hasTransition=function(){return!1},v}(a.Evented),Zt=function(p){function v(d,y,S,C){p.call(this),this.id=d,this.dispatcher=S,this.setEventedParent(C),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=a.extend({type:"raster"},y),a.extend(this,a.pick(y,["url","scheme","tileSize"]))}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.load=function(){var d=this;this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Rt(this._options,this.map._requestManager,function(y,S){d._tileJSONRequest=null,d._loaded=!0,y?d.fire(new a.ErrorEvent(y)):S&&(a.extend(d,S),S.bounds&&(d.tileBounds=new Lt(S.bounds,d.minzoom,d.maxzoom)),a.postTurnstileEvent(S.tiles),a.postMapLoadEvent(S.tiles,d.map._getMapId(),d.map._requestManager._skuToken),d.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),d.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})))})},v.prototype.loaded=function(){return this._loaded},v.prototype.onAdd=function(d){this.map=d,this.load()},v.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},v.prototype.serialize=function(){return a.extend({},this._options)},v.prototype.hasTile=function(d){return!this.tileBounds||this.tileBounds.contains(d.canonical)},v.prototype.loadTile=function(d,y){var S=this,C=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);d.request=a.getImage(this.map._requestManager.transformRequest(C,a.ResourceType.Tile),function(I,O){if(delete d.request,d.aborted)d.state="unloaded",y(null);else if(I)d.state="errored",y(I);else if(O){S.map._refreshExpiredTiles&&d.setExpiryData(O),delete O.cacheControl,delete O.expires;var z=S.map.painter.context,X=z.gl;d.texture=S.map.painter.getTileTexture(O.width),d.texture?d.texture.update(O,{useMipmap:!0}):(d.texture=new a.Texture(z,O,X.RGBA,{useMipmap:!0}),d.texture.bind(X.LINEAR,X.CLAMP_TO_EDGE,X.LINEAR_MIPMAP_NEAREST),z.extTextureFilterAnisotropic&&X.texParameterf(X.TEXTURE_2D,z.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,z.extTextureFilterAnisotropicMax)),d.state="loaded",a.cacheEntryPossiblyAdded(S.dispatcher),y(null)}})},v.prototype.abortTile=function(d,y){d.request&&(d.request.cancel(),delete d.request),y()},v.prototype.unloadTile=function(d,y){d.texture&&this.map.painter.saveTileTexture(d.texture),y()},v.prototype.hasTransition=function(){return!1},v}(a.Evented),st=function(p){function v(d,y,S,C){p.call(this,d,y,S,C),this.type="raster-dem",this.maxzoom=22,this._options=a.extend({type:"raster-dem"},y),this.encoding=y.encoding||"mapbox"}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},v.prototype.loadTile=function(d,y){var S=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function C(I,O){I&&(d.state="errored",y(I)),O&&(d.dem=O,d.needsHillshadePrepare=!0,d.state="loaded",y(null))}d.request=a.getImage(this.map._requestManager.transformRequest(S,a.ResourceType.Tile),(function(I,O){if(delete d.request,d.aborted)d.state="unloaded",y(null);else if(I)d.state="errored",y(I);else if(O){this.map._refreshExpiredTiles&&d.setExpiryData(O),delete O.cacheControl,delete O.expires;var z=a.window.ImageBitmap&&O instanceof a.window.ImageBitmap&&a.offscreenCanvasSupported()?O:a.browser.getImageData(O,1),X={uid:d.uid,coord:d.tileID,source:this.id,rawImageData:z,encoding:this.encoding};d.actor&&d.state!=="expired"||(d.actor=this.dispatcher.getActor(),d.actor.send("loadDEMTile",X,C.bind(this)))}}).bind(this)),d.neighboringTiles=this._getNeighboringTiles(d.tileID)},v.prototype._getNeighboringTiles=function(d){var y=d.canonical,S=Math.pow(2,y.z),C=(y.x-1+S)%S,I=y.x===0?d.wrap-1:d.wrap,O=(y.x+1+S)%S,z=y.x+1===S?d.wrap+1:d.wrap,X={};return X[new a.OverscaledTileID(d.overscaledZ,I,y.z,C,y.y).key]={backfilled:!1},X[new a.OverscaledTileID(d.overscaledZ,z,y.z,O,y.y).key]={backfilled:!1},y.y>0&&(X[new a.OverscaledTileID(d.overscaledZ,I,y.z,C,y.y-1).key]={backfilled:!1},X[new a.OverscaledTileID(d.overscaledZ,d.wrap,y.z,y.x,y.y-1).key]={backfilled:!1},X[new a.OverscaledTileID(d.overscaledZ,z,y.z,O,y.y-1).key]={backfilled:!1}),y.y+1<S&&(X[new a.OverscaledTileID(d.overscaledZ,I,y.z,C,y.y+1).key]={backfilled:!1},X[new a.OverscaledTileID(d.overscaledZ,d.wrap,y.z,y.x,y.y+1).key]={backfilled:!1},X[new a.OverscaledTileID(d.overscaledZ,z,y.z,O,y.y+1).key]={backfilled:!1}),X},v.prototype.unloadTile=function(d){d.demTexture&&this.map.painter.saveTileTexture(d.demTexture),d.fbo&&(d.fbo.destroy(),delete d.fbo),d.dem&&delete d.dem,delete d.neighboringTiles,d.state="unloaded",d.actor&&d.actor.send("removeDEMTile",{uid:d.uid,source:this.id})},v}(Zt),tt=function(p){function v(d,y,S,C){p.call(this),this.id=d,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=S.getActor(),this.setEventedParent(C),this._data=y.data,this._options=a.extend({},y),this._collectResourceTiming=y.collectResourceTiming,this._resourceTiming=[],y.maxzoom!==void 0&&(this.maxzoom=y.maxzoom),y.type&&(this.type=y.type),y.attribution&&(this.attribution=y.attribution),this.promoteId=y.promoteId;var I=a.EXTENT/this.tileSize;this.workerOptions=a.extend({source:this.id,cluster:y.cluster||!1,geojsonVtOptions:{buffer:(y.buffer!==void 0?y.buffer:128)*I,tolerance:(y.tolerance!==void 0?y.tolerance:.375)*I,extent:a.EXTENT,maxZoom:this.maxzoom,lineMetrics:y.lineMetrics||!1,generateId:y.generateId||!1},superclusterOptions:{maxZoom:y.clusterMaxZoom!==void 0?Math.min(y.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,y.clusterMinPoints||2),extent:a.EXTENT,radius:(y.clusterRadius||50)*I,log:!1,generateId:y.generateId||!1},clusterProperties:y.clusterProperties,filter:y.filter},y.workerOptions)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.load=function(){var d=this;this.fire(new a.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(y){if(y)d.fire(new a.ErrorEvent(y));else{var S={dataType:"source",sourceDataType:"metadata"};d._collectResourceTiming&&d._resourceTiming&&d._resourceTiming.length>0&&(S.resourceTiming=d._resourceTiming,d._resourceTiming=[]),d.fire(new a.Event("data",S))}})},v.prototype.onAdd=function(d){this.map=d,this.load()},v.prototype.setData=function(d){var y=this;return this._data=d,this.fire(new a.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(S){if(S)y.fire(new a.ErrorEvent(S));else{var C={dataType:"source",sourceDataType:"content"};y._collectResourceTiming&&y._resourceTiming&&y._resourceTiming.length>0&&(C.resourceTiming=y._resourceTiming,y._resourceTiming=[]),y.fire(new a.Event("data",C))}}),this},v.prototype.getClusterExpansionZoom=function(d,y){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:d,source:this.id},y),this},v.prototype.getClusterChildren=function(d,y){return this.actor.send("geojson.getClusterChildren",{clusterId:d,source:this.id},y),this},v.prototype.getClusterLeaves=function(d,y,S,C){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:d,limit:y,offset:S},C),this},v.prototype._updateWorkerData=function(d){var y=this;this._loaded=!1;var S=a.extend({},this.workerOptions),C=this._data;typeof C=="string"?(S.request=this.map._requestManager.transformRequest(a.browser.resolveURL(C),a.ResourceType.Source),S.request.collectResourceTiming=this._collectResourceTiming):S.data=JSON.stringify(C),this.actor.send(this.type+".loadData",S,function(I,O){y._removed||O&&O.abandoned||(y._loaded=!0,O&&O.resourceTiming&&O.resourceTiming[y.id]&&(y._resourceTiming=O.resourceTiming[y.id].slice(0)),y.actor.send(y.type+".coalesce",{source:S.source},null),d(I))})},v.prototype.loaded=function(){return this._loaded},v.prototype.loadTile=function(d,y){var S=this,C=d.actor?"reloadTile":"loadTile";d.actor=this.actor,d.request=this.actor.send(C,{type:this.type,uid:d.uid,tileID:d.tileID,zoom:d.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:a.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},function(I,O){return delete d.request,d.unloadVectorData(),d.aborted?y(null):I?y(I):(d.loadVectorData(O,S.map.painter,C==="reloadTile"),y(null))})},v.prototype.abortTile=function(d){d.request&&(d.request.cancel(),delete d.request),d.aborted=!0},v.prototype.unloadTile=function(d){d.unloadVectorData(),this.actor.send("removeTile",{uid:d.uid,type:this.type,source:this.id})},v.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},v.prototype.serialize=function(){return a.extend({},this._options,{type:this.type,data:this._data})},v.prototype.hasTransition=function(){return!1},v}(a.Evented),dt=a.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),nt=function(p){function v(d,y,S,C){p.call(this),this.id=d,this.dispatcher=S,this.coordinates=y.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(C),this.options=y}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.load=function(d,y){var S=this;this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this.url=this.options.url,a.getImage(this.map._requestManager.transformRequest(this.url,a.ResourceType.Image),function(C,I){S._loaded=!0,C?S.fire(new a.ErrorEvent(C)):I&&(S.image=I,d&&(S.coordinates=d),y&&y(),S._finishLoading())})},v.prototype.loaded=function(){return this._loaded},v.prototype.updateImage=function(d){var y=this;return this.image&&d.url?(this.options.url=d.url,this.load(d.coordinates,function(){y.texture=null}),this):this},v.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})))},v.prototype.onAdd=function(d){this.map=d,this.load()},v.prototype.setCoordinates=function(d){var y=this;this.coordinates=d;var S=d.map(a.MercatorCoordinate.fromLngLat);this.tileID=function(I){for(var O=1/0,z=1/0,X=-1/0,ne=-1/0,ae=0,oe=I;ae<oe.length;ae+=1){var we=oe[ae];O=Math.min(O,we.x),z=Math.min(z,we.y),X=Math.max(X,we.x),ne=Math.max(ne,we.y)}var be=Math.max(X-O,ne-z),Fe=Math.max(0,Math.floor(-Math.log(be)/Math.LN2)),_e=Math.pow(2,Fe);return new a.CanonicalTileID(Fe,Math.floor((O+X)/2*_e),Math.floor((z+ne)/2*_e))}(S),this.minzoom=this.maxzoom=this.tileID.z;var C=S.map(function(I){return y.tileID.getTilePoint(I)._round()});return this._boundsArray=new a.StructArrayLayout4i8,this._boundsArray.emplaceBack(C[0].x,C[0].y,0,0),this._boundsArray.emplaceBack(C[1].x,C[1].y,a.EXTENT,0),this._boundsArray.emplaceBack(C[3].x,C[3].y,0,a.EXTENT),this._boundsArray.emplaceBack(C[2].x,C[2].y,a.EXTENT,a.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})),this},v.prototype.prepare=function(){if(Object.keys(this.tiles).length!==0&&this.image){var d=this.map.painter.context,y=d.gl;for(var S in this.boundsBuffer||(this.boundsBuffer=d.createVertexBuffer(this._boundsArray,dt.members)),this.boundsSegments||(this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new a.Texture(d,this.image,y.RGBA),this.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE)),this.tiles){var C=this.tiles[S];C.state!=="loaded"&&(C.state="loaded",C.texture=this.texture)}}},v.prototype.loadTile=function(d,y){this.tileID&&this.tileID.equals(d.tileID.canonical)?(this.tiles[String(d.tileID.wrap)]=d,d.buckets={},y(null)):(d.state="errored",y(null))},v.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},v.prototype.hasTransition=function(){return!1},v}(a.Evented),pr=function(p){function v(d,y,S,C){p.call(this,d,y,S,C),this.roundZoom=!0,this.type="video",this.options=y}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.load=function(){var d=this;this._loaded=!1;var y=this.options;this.urls=[];for(var S=0,C=y.urls;S<C.length;S+=1)this.urls.push(this.map._requestManager.transformRequest(C[S],a.ResourceType.Source).url);a.getVideo(this.urls,function(I,O){d._loaded=!0,I?d.fire(new a.ErrorEvent(I)):O&&(d.video=O,d.video.loop=!0,d.video.setAttribute("playsinline",""),d.video.addEventListener("playing",function(){d.map.triggerRepaint()}),d.map&&d.video.play(),d._finishLoading())})},v.prototype.pause=function(){this.video&&this.video.pause()},v.prototype.play=function(){this.video&&this.video.play()},v.prototype.seek=function(d){if(this.video){var y=this.video.seekable;d<y.start(0)||d>y.end(0)?this.fire(new a.ErrorEvent(new a.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+y.start(0)+" and "+y.end(0)+"-second mark."))):this.video.currentTime=d}},v.prototype.getVideo=function(){return this.video},v.prototype.onAdd=function(d){this.map||(this.map=d,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},v.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var d=this.map.painter.context,y=d.gl;for(var S in this.boundsBuffer||(this.boundsBuffer=d.createVertexBuffer(this._boundsArray,dt.members)),this.boundsSegments||(this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE),y.texSubImage2D(y.TEXTURE_2D,0,0,0,y.RGBA,y.UNSIGNED_BYTE,this.video)):(this.texture=new a.Texture(d,this.video,y.RGBA),this.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE)),this.tiles){var C=this.tiles[S];C.state!=="loaded"&&(C.state="loaded",C.texture=this.texture)}}},v.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},v.prototype.hasTransition=function(){return this.video&&!this.video.paused},v}(nt),ur=function(p){function v(d,y,S,C){p.call(this,d,y,S,C),y.coordinates?Array.isArray(y.coordinates)&&y.coordinates.length===4&&!y.coordinates.some(function(I){return!Array.isArray(I)||I.length!==2||I.some(function(O){return typeof O!="number"})})||this.fire(new a.ErrorEvent(new a.ValidationError("sources."+d,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new a.ErrorEvent(new a.ValidationError("sources."+d,null,'missing required property "coordinates"'))),y.animate&&typeof y.animate!="boolean"&&this.fire(new a.ErrorEvent(new a.ValidationError("sources."+d,null,'optional "animate" property must be a boolean value'))),y.canvas?typeof y.canvas=="string"||y.canvas instanceof a.window.HTMLCanvasElement||this.fire(new a.ErrorEvent(new a.ValidationError("sources."+d,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 a.ErrorEvent(new a.ValidationError("sources."+d,null,'missing required property "canvas"'))),this.options=y,this.animate=y.animate===void 0||y.animate}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof a.window.HTMLCanvasElement?this.options.canvas:a.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new a.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},v.prototype.getCanvas=function(){return this.canvas},v.prototype.onAdd=function(d){this.map=d,this.load(),this.canvas&&this.animate&&this.play()},v.prototype.onRemove=function(){this.pause()},v.prototype.prepare=function(){var d=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,d=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,d=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var y=this.map.painter.context,S=y.gl;for(var C in this.boundsBuffer||(this.boundsBuffer=y.createVertexBuffer(this._boundsArray,dt.members)),this.boundsSegments||(this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(d||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new a.Texture(y,this.canvas,S.RGBA,{premultiply:!0}),this.tiles){var I=this.tiles[C];I.state!=="loaded"&&(I.state="loaded",I.texture=this.texture)}}},v.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},v.prototype.hasTransition=function(){return this._playing},v.prototype._hasInvalidDimensions=function(){for(var d=0,y=[this.canvas.width,this.canvas.height];d<y.length;d+=1){var S=y[d];if(isNaN(S)||S<=0)return!0}return!1},v}(nt),Ar={vector:Gt,raster:Zt,"raster-dem":st,geojson:tt,video:pr,image:nt,canvas:ur};function Xn(p,v){var d=a.identity([]);return a.translate(d,d,[1,1,0]),a.scale(d,d,[.5*p.width,.5*p.height,1]),a.multiply(d,d,p.calculatePosMatrix(v.toUnwrapped()))}function pn(p,v,d,y,S,C){var I=function(Fe,_e,De){if(Fe)for(var Xe=0,ot=Fe;Xe<ot.length;Xe+=1){var Ct=_e[ot[Xe]];if(Ct&&Ct.source===De&&Ct.type==="fill-extrusion")return!0}else for(var mt in _e){var kt=_e[mt];if(kt.source===De&&kt.type==="fill-extrusion")return!0}return!1}(S&&S.layers,v,p.id),O=C.maxPitchScaleFactor(),z=p.tilesIn(y,O,I);z.sort(gi);for(var X=[],ne=0,ae=z;ne<ae.length;ne+=1){var oe=ae[ne];X.push({wrappedTileID:oe.tileID.wrapped().key,queryResults:oe.tile.queryRenderedFeatures(v,d,p._state,oe.queryGeometry,oe.cameraQueryGeometry,oe.scale,S,C,O,Xn(p.transform,oe.tileID))})}var we=function(Fe){for(var _e={},De={},Xe=0,ot=Fe;Xe<ot.length;Xe+=1){var Ct=ot[Xe],mt=Ct.queryResults,kt=Ct.wrappedTileID,qt=De[kt]=De[kt]||{};for(var Tr in mt)for(var yr=mt[Tr],$r=qt[Tr]=qt[Tr]||{},vn=_e[Tr]=_e[Tr]||[],bn=0,xn=yr;bn<xn.length;bn+=1){var Si=xn[bn];$r[Si.featureIndex]||($r[Si.featureIndex]=!0,vn.push(Si))}}return _e}(X);for(var be in we)we[be].forEach(function(Fe){var _e=Fe.feature,De=p.getFeatureState(_e.layer["source-layer"],_e.id);_e.source=_e.layer.source,_e.layer["source-layer"]&&(_e.sourceLayer=_e.layer["source-layer"]),_e.state=De});return we}function gi(p,v){var d=p.tileID,y=v.tileID;return d.overscaledZ-y.overscaledZ||d.canonical.y-y.canonical.y||d.wrap-y.wrap||d.canonical.x-y.canonical.x}var Je=function(p,v){this.max=p,this.onRemove=v,this.reset()};Je.prototype.reset=function(){for(var p in this.data)for(var v=0,d=this.data[p];v<d.length;v+=1){var y=d[v];y.timeout&&clearTimeout(y.timeout),this.onRemove(y.value)}return this.data={},this.order=[],this},Je.prototype.add=function(p,v,d){var y=this,S=p.wrapped().key;this.data[S]===void 0&&(this.data[S]=[]);var C={value:v,timeout:void 0};if(d!==void 0&&(C.timeout=setTimeout(function(){y.remove(p,C)},d)),this.data[S].push(C),this.order.push(S),this.order.length>this.max){var I=this._getAndRemoveByKey(this.order[0]);I&&this.onRemove(I)}return this},Je.prototype.has=function(p){return p.wrapped().key in this.data},Je.prototype.getAndRemove=function(p){return this.has(p)?this._getAndRemoveByKey(p.wrapped().key):null},Je.prototype._getAndRemoveByKey=function(p){var v=this.data[p].shift();return v.timeout&&clearTimeout(v.timeout),this.data[p].length===0&&delete this.data[p],this.order.splice(this.order.indexOf(p),1),v.value},Je.prototype.getByKey=function(p){var v=this.data[p];return v?v[0].value:null},Je.prototype.get=function(p){return this.has(p)?this.data[p.wrapped().key][0].value:null},Je.prototype.remove=function(p,v){if(!this.has(p))return this;var d=p.wrapped().key,y=v===void 0?0:this.data[d].indexOf(v),S=this.data[d][y];return this.data[d].splice(y,1),S.timeout&&clearTimeout(S.timeout),this.data[d].length===0&&delete this.data[d],this.onRemove(S.value),this.order.splice(this.order.indexOf(d),1),this},Je.prototype.setMaxSize=function(p){for(this.max=p;this.order.length>this.max;){var v=this._getAndRemoveByKey(this.order[0]);v&&this.onRemove(v)}return this},Je.prototype.filter=function(p){var v=[];for(var d in this.data)for(var y=0,S=this.data[d];y<S.length;y+=1){var C=S[y];p(C.value)||v.push(C)}for(var I=0,O=v;I<O.length;I+=1){var z=O[I];this.remove(z.value.tileID,z)}};var Qt=function(p,v,d){this.context=p;var y=p.gl;this.buffer=y.createBuffer(),this.dynamicDraw=!!d,this.context.unbindVAO(),p.bindElementBuffer.set(this.buffer),y.bufferData(y.ELEMENT_ARRAY_BUFFER,v.arrayBuffer,this.dynamicDraw?y.DYNAMIC_DRAW:y.STATIC_DRAW),this.dynamicDraw||delete v.arrayBuffer};Qt.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Qt.prototype.updateData=function(p){var v=this.context.gl;this.context.unbindVAO(),this.bind(),v.bufferSubData(v.ELEMENT_ARRAY_BUFFER,0,p.arrayBuffer)},Qt.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Xr={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Ut=function(p,v,d,y){this.length=v.length,this.attributes=d,this.itemSize=v.bytesPerElement,this.dynamicDraw=y,this.context=p;var S=p.gl;this.buffer=S.createBuffer(),p.bindVertexBuffer.set(this.buffer),S.bufferData(S.ARRAY_BUFFER,v.arrayBuffer,this.dynamicDraw?S.DYNAMIC_DRAW:S.STATIC_DRAW),this.dynamicDraw||delete v.arrayBuffer};Ut.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Ut.prototype.updateData=function(p){var v=this.context.gl;this.bind(),v.bufferSubData(v.ARRAY_BUFFER,0,p.arrayBuffer)},Ut.prototype.enableAttributes=function(p,v){for(var d=0;d<this.attributes.length;d++){var y=v.attributes[this.attributes[d].name];y!==void 0&&p.enableVertexAttribArray(y)}},Ut.prototype.setVertexAttribPointers=function(p,v,d){for(var y=0;y<this.attributes.length;y++){var S=this.attributes[y],C=v.attributes[S.name];C!==void 0&&p.vertexAttribPointer(C,S.components,p[Xr[S.type]],!1,this.itemSize,S.offset+this.itemSize*(d||0))}},Ut.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var ge=function(p){this.gl=p.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};ge.prototype.get=function(){return this.current},ge.prototype.set=function(p){},ge.prototype.getDefault=function(){return this.default},ge.prototype.setDefault=function(){this.set(this.default)};var Be=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return a.Color.transparent},v.prototype.set=function(d){var y=this.current;(d.r!==y.r||d.g!==y.g||d.b!==y.b||d.a!==y.a||this.dirty)&&(this.gl.clearColor(d.r,d.g,d.b,d.a),this.current=d,this.dirty=!1)},v}(ge),ft=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return 1},v.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.clearDepth(d),this.current=d,this.dirty=!1)},v}(ge),At=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return 0},v.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.clearStencil(d),this.current=d,this.dirty=!1)},v}(ge),bt=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return[!0,!0,!0,!0]},v.prototype.set=function(d){var y=this.current;(d[0]!==y[0]||d[1]!==y[1]||d[2]!==y[2]||d[3]!==y[3]||this.dirty)&&(this.gl.colorMask(d[0],d[1],d[2],d[3]),this.current=d,this.dirty=!1)},v}(ge),$t=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return!0},v.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.depthMask(d),this.current=d,this.dirty=!1)},v}(ge),Mr=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return 255},v.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.stencilMask(d),this.current=d,this.dirty=!1)},v}(ge),tr=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},v.prototype.set=function(d){var y=this.current;(d.func!==y.func||d.ref!==y.ref||d.mask!==y.mask||this.dirty)&&(this.gl.stencilFunc(d.func,d.ref,d.mask),this.current=d,this.dirty=!1)},v}(ge),lr=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){var d=this.gl;return[d.KEEP,d.KEEP,d.KEEP]},v.prototype.set=function(d){var y=this.current;(d[0]!==y[0]||d[1]!==y[1]||d[2]!==y[2]||this.dirty)&&(this.gl.stencilOp(d[0],d[1],d[2]),this.current=d,this.dirty=!1)},v}(ge),or=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return!1},v.prototype.set=function(d){if(d!==this.current||this.dirty){var y=this.gl;d?y.enable(y.STENCIL_TEST):y.disable(y.STENCIL_TEST),this.current=d,this.dirty=!1}},v}(ge),Q=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return[0,1]},v.prototype.set=function(d){var y=this.current;(d[0]!==y[0]||d[1]!==y[1]||this.dirty)&&(this.gl.depthRange(d[0],d[1]),this.current=d,this.dirty=!1)},v}(ge),Ge=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return!1},v.prototype.set=function(d){if(d!==this.current||this.dirty){var y=this.gl;d?y.enable(y.DEPTH_TEST):y.disable(y.DEPTH_TEST),this.current=d,this.dirty=!1}},v}(ge),at=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return this.gl.LESS},v.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.depthFunc(d),this.current=d,this.dirty=!1)},v}(ge),yt=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return!1},v.prototype.set=function(d){if(d!==this.current||this.dirty){var y=this.gl;d?y.enable(y.BLEND):y.disable(y.BLEND),this.current=d,this.dirty=!1}},v}(ge),rr=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){var d=this.gl;return[d.ONE,d.ZERO]},v.prototype.set=function(d){var y=this.current;(d[0]!==y[0]||d[1]!==y[1]||this.dirty)&&(this.gl.blendFunc(d[0],d[1]),this.current=d,this.dirty=!1)},v}(ge),hr=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return a.Color.transparent},v.prototype.set=function(d){var y=this.current;(d.r!==y.r||d.g!==y.g||d.b!==y.b||d.a!==y.a||this.dirty)&&(this.gl.blendColor(d.r,d.g,d.b,d.a),this.current=d,this.dirty=!1)},v}(ge),Cn=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return this.gl.FUNC_ADD},v.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.blendEquation(d),this.current=d,this.dirty=!1)},v}(ge),rn=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return!1},v.prototype.set=function(d){if(d!==this.current||this.dirty){var y=this.gl;d?y.enable(y.CULL_FACE):y.disable(y.CULL_FACE),this.current=d,this.dirty=!1}},v}(ge),Ne=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return this.gl.BACK},v.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.cullFace(d),this.current=d,this.dirty=!1)},v}(ge),qe=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return this.gl.CCW},v.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.frontFace(d),this.current=d,this.dirty=!1)},v}(ge),ct=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.useProgram(d),this.current=d,this.dirty=!1)},v}(ge),Vt=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return this.gl.TEXTURE0},v.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.activeTexture(d),this.current=d,this.dirty=!1)},v}(ge),Qr=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){var d=this.gl;return[0,0,d.drawingBufferWidth,d.drawingBufferHeight]},v.prototype.set=function(d){var y=this.current;(d[0]!==y[0]||d[1]!==y[1]||d[2]!==y[2]||d[3]!==y[3]||this.dirty)&&(this.gl.viewport(d[0],d[1],d[2],d[3]),this.current=d,this.dirty=!1)},v}(ge),Jn=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v.prototype.set=function(d){if(d!==this.current||this.dirty){var y=this.gl;y.bindFramebuffer(y.FRAMEBUFFER,d),this.current=d,this.dirty=!1}},v}(ge),Ri=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v.prototype.set=function(d){if(d!==this.current||this.dirty){var y=this.gl;y.bindRenderbuffer(y.RENDERBUFFER,d),this.current=d,this.dirty=!1}},v}(ge),qn=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v.prototype.set=function(d){if(d!==this.current||this.dirty){var y=this.gl;y.bindTexture(y.TEXTURE_2D,d),this.current=d,this.dirty=!1}},v}(ge),en=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v.prototype.set=function(d){if(d!==this.current||this.dirty){var y=this.gl;y.bindBuffer(y.ARRAY_BUFFER,d),this.current=d,this.dirty=!1}},v}(ge),fn=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v.prototype.set=function(d){var y=this.gl;y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,d),this.current=d,this.dirty=!1},v}(ge),an=function(p){function v(d){p.call(this,d),this.vao=d.extVertexArrayObject}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v.prototype.set=function(d){this.vao&&(d!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(d),this.current=d,this.dirty=!1)},v}(ge),un=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return 4},v.prototype.set=function(d){if(d!==this.current||this.dirty){var y=this.gl;y.pixelStorei(y.UNPACK_ALIGNMENT,d),this.current=d,this.dirty=!1}},v}(ge),ti=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return!1},v.prototype.set=function(d){if(d!==this.current||this.dirty){var y=this.gl;y.pixelStorei(y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),this.current=d,this.dirty=!1}},v}(ge),Hi=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return!1},v.prototype.set=function(d){if(d!==this.current||this.dirty){var y=this.gl;y.pixelStorei(y.UNPACK_FLIP_Y_WEBGL,d),this.current=d,this.dirty=!1}},v}(ge),Fn=function(p){function v(d,y){p.call(this,d),this.context=d,this.parent=y}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v}(ge),j=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.setDirty=function(){this.dirty=!0},v.prototype.set=function(d){if(d!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var y=this.gl;y.framebufferTexture2D(y.FRAMEBUFFER,y.COLOR_ATTACHMENT0,y.TEXTURE_2D,d,0),this.current=d,this.dirty=!1}},v}(Fn),Y=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.set=function(d){if(d!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var y=this.gl;y.framebufferRenderbuffer(y.FRAMEBUFFER,y.DEPTH_ATTACHMENT,y.RENDERBUFFER,d),this.current=d,this.dirty=!1}},v}(Fn),J=function(p,v,d,y){this.context=p,this.width=v,this.height=d;var S=this.framebuffer=p.gl.createFramebuffer();this.colorAttachment=new j(p,S),y&&(this.depthAttachment=new Y(p,S))};J.prototype.destroy=function(){var p=this.context.gl,v=this.colorAttachment.get();if(v&&p.deleteTexture(v),this.depthAttachment){var d=this.depthAttachment.get();d&&p.deleteRenderbuffer(d)}p.deleteFramebuffer(this.framebuffer)};var ce=function(p,v,d){this.func=p,this.mask=v,this.range=d};ce.ReadOnly=!1,ce.ReadWrite=!0,ce.disabled=new ce(519,ce.ReadOnly,[0,1]);var Ee=function(p,v,d,y,S,C){this.test=p,this.ref=v,this.mask=d,this.fail=y,this.depthFail=S,this.pass=C};Ee.disabled=new Ee({func:519,mask:0},0,0,7680,7680,7680);var je=function(p,v,d){this.blendFunction=p,this.blendColor=v,this.mask=d};je.disabled=new je(je.Replace=[1,0],a.Color.transparent,[!1,!1,!1,!1]),je.unblended=new je(je.Replace,a.Color.transparent,[!0,!0,!0,!0]),je.alphaBlended=new je([1,771],a.Color.transparent,[!0,!0,!0,!0]);var Ye=function(p,v,d){this.enable=p,this.mode=v,this.frontFace=d};Ye.disabled=new Ye(!1,1029,2305),Ye.backCCW=new Ye(!0,1029,2305);var ie=function(p){this.gl=p,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new Be(this),this.clearDepth=new ft(this),this.clearStencil=new At(this),this.colorMask=new bt(this),this.depthMask=new $t(this),this.stencilMask=new Mr(this),this.stencilFunc=new tr(this),this.stencilOp=new lr(this),this.stencilTest=new or(this),this.depthRange=new Q(this),this.depthTest=new Ge(this),this.depthFunc=new at(this),this.blend=new yt(this),this.blendFunc=new rr(this),this.blendColor=new hr(this),this.blendEquation=new Cn(this),this.cullFace=new rn(this),this.cullFaceSide=new Ne(this),this.frontFace=new qe(this),this.program=new ct(this),this.activeTexture=new Vt(this),this.viewport=new Qr(this),this.bindFramebuffer=new Jn(this),this.bindRenderbuffer=new Ri(this),this.bindTexture=new qn(this),this.bindVertexBuffer=new en(this),this.bindElementBuffer=new fn(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new an(this),this.pixelStoreUnpack=new un(this),this.pixelStoreUnpackPremultiplyAlpha=new ti(this),this.pixelStoreUnpackFlipY=new Hi(this),this.extTextureFilterAnisotropic=p.getExtension("EXT_texture_filter_anisotropic")||p.getExtension("MOZ_EXT_texture_filter_anisotropic")||p.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=p.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=p.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(p.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=p.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=p.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=p.getParameter(p.MAX_TEXTURE_SIZE)};ie.prototype.setDefault=function(){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()},ie.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},ie.prototype.createIndexBuffer=function(p,v){return new Qt(this,p,v)},ie.prototype.createVertexBuffer=function(p,v,d){return new Ut(this,p,v,d)},ie.prototype.createRenderbuffer=function(p,v,d){var y=this.gl,S=y.createRenderbuffer();return this.bindRenderbuffer.set(S),y.renderbufferStorage(y.RENDERBUFFER,p,v,d),this.bindRenderbuffer.set(null),S},ie.prototype.createFramebuffer=function(p,v,d){return new J(this,p,v,d)},ie.prototype.clear=function(p){var v=p.color,d=p.depth,y=this.gl,S=0;v&&(S|=y.COLOR_BUFFER_BIT,this.clearColor.set(v),this.colorMask.set([!0,!0,!0,!0])),d!==void 0&&(S|=y.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(d),this.depthMask.set(!0)),y.clear(S)},ie.prototype.setCullFace=function(p){p.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(p.mode),this.frontFace.set(p.frontFace))},ie.prototype.setDepthMode=function(p){p.func!==this.gl.ALWAYS||p.mask?(this.depthTest.set(!0),this.depthFunc.set(p.func),this.depthMask.set(p.mask),this.depthRange.set(p.range)):this.depthTest.set(!1)},ie.prototype.setStencilMode=function(p){p.test.func!==this.gl.ALWAYS||p.mask?(this.stencilTest.set(!0),this.stencilMask.set(p.mask),this.stencilOp.set([p.fail,p.depthFail,p.pass]),this.stencilFunc.set({func:p.test.func,ref:p.ref,mask:p.test.mask})):this.stencilTest.set(!1)},ie.prototype.setColorMode=function(p){a.deepEqual(p.blendFunction,je.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(p.blendFunction),this.blendColor.set(p.blendColor)),this.colorMask.set(p.mask)},ie.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Ce=function(p){function v(d,y,S){var C=this;p.call(this),this.id=d,this.dispatcher=S,this.on("data",function(I){I.dataType==="source"&&I.sourceDataType==="metadata"&&(C._sourceLoaded=!0),C._sourceLoaded&&!C._paused&&I.dataType==="source"&&I.sourceDataType==="content"&&(C.reload(),C.transform&&C.update(C.transform))}),this.on("error",function(){C._sourceErrored=!0}),this._source=function(I,O,z,X){var ne=new Ar[O.type](I,O,z,X);if(ne.id!==I)throw new Error("Expected Source id to be "+I+" instead of "+ne.id);return a.bindAll(["load","abort","unload","serialize","prepare"],ne),ne}(d,y,S,this),this._tiles={},this._cache=new Je(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new a.SourceFeatureState}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.onAdd=function(d){this.map=d,this._maxTileCacheSize=d?d._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(d)},v.prototype.onRemove=function(d){this._source&&this._source.onRemove&&this._source.onRemove(d)},v.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var d in this._tiles){var y=this._tiles[d];if(y.state!=="loaded"&&y.state!=="errored")return!1}return!0},v.prototype.getSource=function(){return this._source},v.prototype.pause=function(){this._paused=!0},v.prototype.resume=function(){if(this._paused){var d=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,d&&this.reload(),this.transform&&this.update(this.transform)}},v.prototype._loadTile=function(d,y){return this._source.loadTile(d,y)},v.prototype._unloadTile=function(d){if(this._source.unloadTile)return this._source.unloadTile(d,function(){})},v.prototype._abortTile=function(d){if(this._source.abortTile)return this._source.abortTile(d,function(){})},v.prototype.serialize=function(){return this._source.serialize()},v.prototype.prepare=function(d){for(var y in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var S=this._tiles[y];S.upload(d),S.prepare(this.map.style.imageManager)}},v.prototype.getIds=function(){return a.values(this._tiles).map(function(d){return d.tileID}).sort(it).map(function(d){return d.key})},v.prototype.getRenderableIds=function(d){var y=this,S=[];for(var C in this._tiles)this._isIdRenderable(C,d)&&S.push(this._tiles[C]);return d?S.sort(function(I,O){var z=I.tileID,X=O.tileID,ne=new a.Point(z.canonical.x,z.canonical.y)._rotate(y.transform.angle),ae=new a.Point(X.canonical.x,X.canonical.y)._rotate(y.transform.angle);return z.overscaledZ-X.overscaledZ||ae.y-ne.y||ae.x-ne.x}).map(function(I){return I.tileID.key}):S.map(function(I){return I.tileID}).sort(it).map(function(I){return I.key})},v.prototype.hasRenderableParent=function(d){var y=this.findLoadedParent(d,0);return!!y&&this._isIdRenderable(y.tileID.key)},v.prototype._isIdRenderable=function(d,y){return this._tiles[d]&&this._tiles[d].hasData()&&!this._coveredTiles[d]&&(y||!this._tiles[d].holdingForFade())},v.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var d in this._cache.reset(),this._tiles)this._tiles[d].state!=="errored"&&this._reloadTile(d,"reloading")},v.prototype._reloadTile=function(d,y){var S=this._tiles[d];S&&(S.state!=="loading"&&(S.state=y),this._loadTile(S,this._tileLoaded.bind(this,S,d,y)))},v.prototype._tileLoaded=function(d,y,S,C){if(C)return d.state="errored",void(C.status!==404?this._source.fire(new a.ErrorEvent(C,{tile:d})):this.update(this.transform));d.timeAdded=a.browser.now(),S==="expired"&&(d.refreshedUponExpiration=!0),this._setTileReloadTimer(y,d),this.getSource().type==="raster-dem"&&d.dem&&this._backfillDEM(d),this._state.initializeTileState(d,this.map?this.map.painter:null),this._source.fire(new a.Event("data",{dataType:"source",tile:d,coord:d.tileID}))},v.prototype._backfillDEM=function(d){for(var y=this.getRenderableIds(),S=0;S<y.length;S++){var C=y[S];if(d.neighboringTiles&&d.neighboringTiles[C]){var I=this.getTileByID(C);O(d,I),O(I,d)}}function O(z,X){z.needsHillshadePrepare=!0;var ne=X.tileID.canonical.x-z.tileID.canonical.x,ae=X.tileID.canonical.y-z.tileID.canonical.y,oe=Math.pow(2,z.tileID.canonical.z),we=X.tileID.key;ne===0&&ae===0||Math.abs(ae)>1||(Math.abs(ne)>1&&(Math.abs(ne+oe)===1?ne+=oe:Math.abs(ne-oe)===1&&(ne-=oe)),X.dem&&z.dem&&(z.dem.backfillBorder(X.dem,ne,ae),z.neighboringTiles&&z.neighboringTiles[we]&&(z.neighboringTiles[we].backfilled=!0)))}},v.prototype.getTile=function(d){return this.getTileByID(d.key)},v.prototype.getTileByID=function(d){return this._tiles[d]},v.prototype._retainLoadedChildren=function(d,y,S,C){for(var I in this._tiles){var O=this._tiles[I];if(!(C[I]||!O.hasData()||O.tileID.overscaledZ<=y||O.tileID.overscaledZ>S)){for(var z=O.tileID;O&&O.tileID.overscaledZ>y+1;){var X=O.tileID.scaledTo(O.tileID.overscaledZ-1);(O=this._tiles[X.key])&&O.hasData()&&(z=X)}for(var ne=z;ne.overscaledZ>y;)if(d[(ne=ne.scaledTo(ne.overscaledZ-1)).key]){C[z.key]=z;break}}}},v.prototype.findLoadedParent=function(d,y){if(d.key in this._loadedParentTiles){var S=this._loadedParentTiles[d.key];return S&&S.tileID.overscaledZ>=y?S:null}for(var C=d.overscaledZ-1;C>=y;C--){var I=d.scaledTo(C),O=this._getLoadedTile(I);if(O)return O}},v.prototype._getLoadedTile=function(d){var y=this._tiles[d.key];return y&&y.hasData()?y:this._cache.getByKey(d.wrapped().key)},v.prototype.updateCacheSize=function(d){var y=Math.ceil(d.width/this._source.tileSize)+1,S=Math.ceil(d.height/this._source.tileSize)+1,C=Math.floor(y*S*5),I=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,C):C;this._cache.setMaxSize(I)},v.prototype.handleWrapJump=function(d){var y=Math.round((d-(this._prevLng===void 0?d:this._prevLng))/360);if(this._prevLng=d,y){var S={};for(var C in this._tiles){var I=this._tiles[C];I.tileID=I.tileID.unwrapTo(I.tileID.wrap+y),S[I.tileID.key]=I}for(var O in this._tiles=S,this._timers)clearTimeout(this._timers[O]),delete this._timers[O];for(var z in this._tiles)this._setTileReloadTimer(z,this._tiles[z])}},v.prototype.update=function(d){var y=this;if(this.transform=d,this._sourceLoaded&&!this._paused){var S;this.updateCacheSize(d),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?S=d.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(qt){return new a.OverscaledTileID(qt.canonical.z,qt.wrap,qt.canonical.z,qt.canonical.x,qt.canonical.y)}):(S=d.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(S=S.filter(function(qt){return y._source.hasTile(qt)}))):S=[];var C=d.coveringZoomLevel(this._source),I=Math.max(C-v.maxOverzooming,this._source.minzoom),O=Math.max(C+v.maxUnderzooming,this._source.minzoom),z=this._updateRetainedTiles(S,C);if(Nt(this._source.type)){for(var X={},ne={},ae=0,oe=Object.keys(z);ae<oe.length;ae+=1){var we=oe[ae],be=z[we],Fe=this._tiles[we];if(Fe&&!(Fe.fadeEndTime&&Fe.fadeEndTime<=a.browser.now())){var _e=this.findLoadedParent(be,I);_e&&(this._addTile(_e.tileID),X[_e.tileID.key]=_e.tileID),ne[we]=be}}for(var De in this._retainLoadedChildren(ne,C,O,z),X)z[De]||(this._coveredTiles[De]=!0,z[De]=X[De])}for(var Xe in z)this._tiles[Xe].clearFadeHold();for(var ot=0,Ct=a.keysDifference(this._tiles,z);ot<Ct.length;ot+=1){var mt=Ct[ot],kt=this._tiles[mt];kt.hasSymbolBuckets&&!kt.holdingForFade()?kt.setHoldDuration(this.map._fadeDuration):kt.hasSymbolBuckets&&!kt.symbolFadeFinished()||this._removeTile(mt)}this._updateLoadedParentTileCache()}},v.prototype.releaseSymbolFadeTiles=function(){for(var d in this._tiles)this._tiles[d].holdingForFade()&&this._removeTile(d)},v.prototype._updateRetainedTiles=function(d,y){for(var S={},C={},I=Math.max(y-v.maxOverzooming,this._source.minzoom),O=Math.max(y+v.maxUnderzooming,this._source.minzoom),z={},X=0,ne=d;X<ne.length;X+=1){var ae=ne[X],oe=this._addTile(ae);S[ae.key]=ae,oe.hasData()||y<this._source.maxzoom&&(z[ae.key]=ae)}this._retainLoadedChildren(z,y,O,S);for(var we=0,be=d;we<be.length;we+=1){var Fe=be[we],_e=this._tiles[Fe.key];if(!_e.hasData()){if(y+1>this._source.maxzoom){var De=Fe.children(this._source.maxzoom)[0],Xe=this.getTile(De);if(Xe&&Xe.hasData()){S[De.key]=De;continue}}else{var ot=Fe.children(this._source.maxzoom);if(S[ot[0].key]&&S[ot[1].key]&&S[ot[2].key]&&S[ot[3].key])continue}for(var Ct=_e.wasRequested(),mt=Fe.overscaledZ-1;mt>=I;--mt){var kt=Fe.scaledTo(mt);if(C[kt.key]||(C[kt.key]=!0,!(_e=this.getTile(kt))&&Ct&&(_e=this._addTile(kt)),_e&&(S[kt.key]=kt,Ct=_e.wasRequested(),_e.hasData())))break}}}return S},v.prototype._updateLoadedParentTileCache=function(){for(var d in this._loadedParentTiles={},this._tiles){for(var y=[],S=void 0,C=this._tiles[d].tileID;C.overscaledZ>0;){if(C.key in this._loadedParentTiles){S=this._loadedParentTiles[C.key];break}y.push(C.key);var I=C.scaledTo(C.overscaledZ-1);if(S=this._getLoadedTile(I))break;C=I}for(var O=0,z=y;O<z.length;O+=1)this._loadedParentTiles[z[O]]=S}},v.prototype._addTile=function(d){var y=this._tiles[d.key];if(y)return y;(y=this._cache.getAndRemove(d))&&(this._setTileReloadTimer(d.key,y),y.tileID=d,this._state.initializeTileState(y,this.map?this.map.painter:null),this._cacheTimers[d.key]&&(clearTimeout(this._cacheTimers[d.key]),delete this._cacheTimers[d.key],this._setTileReloadTimer(d.key,y)));var S=!!y;return S||(y=new a.Tile(d,this._source.tileSize*d.overscaleFactor()),this._loadTile(y,this._tileLoaded.bind(this,y,d.key,y.state))),y?(y.uses++,this._tiles[d.key]=y,S||this._source.fire(new a.Event("dataloading",{tile:y,coord:y.tileID,dataType:"source"})),y):null},v.prototype._setTileReloadTimer=function(d,y){var S=this;d in this._timers&&(clearTimeout(this._timers[d]),delete this._timers[d]);var C=y.getExpiryTimeout();C&&(this._timers[d]=setTimeout(function(){S._reloadTile(d,"expired"),delete S._timers[d]},C))},v.prototype._removeTile=function(d){var y=this._tiles[d];y&&(y.uses--,delete this._tiles[d],this._timers[d]&&(clearTimeout(this._timers[d]),delete this._timers[d]),y.uses>0||(y.hasData()&&y.state!=="reloading"?this._cache.add(y.tileID,y,y.getExpiryTimeout()):(y.aborted=!0,this._abortTile(y),this._unloadTile(y))))},v.prototype.clearTiles=function(){for(var d in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(d);this._cache.reset()},v.prototype.tilesIn=function(d,y,S){var C=this,I=[],O=this.transform;if(!O)return I;for(var z=S?O.getCameraQueryGeometry(d):d,X=d.map(function(mt){return O.pointCoordinate(mt)}),ne=z.map(function(mt){return O.pointCoordinate(mt)}),ae=this.getIds(),oe=1/0,we=1/0,be=-1/0,Fe=-1/0,_e=0,De=ne;_e<De.length;_e+=1){var Xe=De[_e];oe=Math.min(oe,Xe.x),we=Math.min(we,Xe.y),be=Math.max(be,Xe.x),Fe=Math.max(Fe,Xe.y)}for(var ot=function(mt){var kt=C._tiles[ae[mt]];if(!kt.holdingForFade()){var qt=kt.tileID,Tr=Math.pow(2,O.zoom-kt.tileID.overscaledZ),yr=y*kt.queryPadding*a.EXTENT/kt.tileSize/Tr,$r=[qt.getTilePoint(new a.MercatorCoordinate(oe,we)),qt.getTilePoint(new a.MercatorCoordinate(be,Fe))];if($r[0].x-yr<a.EXTENT&&$r[0].y-yr<a.EXTENT&&$r[1].x+yr>=0&&$r[1].y+yr>=0){var vn=X.map(function(xn){return qt.getTilePoint(xn)}),bn=ne.map(function(xn){return qt.getTilePoint(xn)});I.push({tile:kt,tileID:qt,queryGeometry:vn,cameraQueryGeometry:bn,scale:Tr})}}},Ct=0;Ct<ae.length;Ct++)ot(Ct);return I},v.prototype.getVisibleCoordinates=function(d){for(var y=this,S=this.getRenderableIds(d).map(function(z){return y._tiles[z].tileID}),C=0,I=S;C<I.length;C+=1){var O=I[C];O.posMatrix=this.transform.calculatePosMatrix(O.toUnwrapped())}return S},v.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Nt(this._source.type))for(var d in this._tiles){var y=this._tiles[d];if(y.fadeEndTime!==void 0&&y.fadeEndTime>=a.browser.now())return!0}return!1},v.prototype.setFeatureState=function(d,y,S){this._state.updateState(d=d||"_geojsonTileLayer",y,S)},v.prototype.removeFeatureState=function(d,y,S){this._state.removeFeatureState(d=d||"_geojsonTileLayer",y,S)},v.prototype.getFeatureState=function(d,y){return this._state.getState(d=d||"_geojsonTileLayer",y)},v.prototype.setDependencies=function(d,y,S){var C=this._tiles[d];C&&C.setDependencies(y,S)},v.prototype.reloadTilesForDependencies=function(d,y){for(var S in this._tiles)this._tiles[S].hasDependency(d,y)&&this._reloadTile(S,"reloading");this._cache.filter(function(C){return!C.hasDependency(d,y)})},v}(a.Evented);function it(p,v){var d=Math.abs(2*p.wrap)-+(p.wrap<0),y=Math.abs(2*v.wrap)-+(v.wrap<0);return p.overscaledZ-v.overscaledZ||y-d||v.canonical.y-p.canonical.y||v.canonical.x-p.canonical.x}function Nt(p){return p==="raster"||p==="image"||p==="video"}function vr(){return new a.window.Worker(Dh.workerUrl)}Ce.maxOverzooming=10,Ce.maxUnderzooming=3;var Ot="mapboxgl_preloaded_worker_pool",ar=function(){this.active={}};ar.prototype.acquire=function(p){if(!this.workers)for(this.workers=[];this.workers.length<ar.workerCount;)this.workers.push(new vr);return this.active[p]=!0,this.workers.slice()},ar.prototype.release=function(p){delete this.active[p],this.numActive()===0&&(this.workers.forEach(function(v){v.terminate()}),this.workers=null)},ar.prototype.isPreloaded=function(){return!!this.active[Ot]},ar.prototype.numActive=function(){return Object.keys(this.active).length};var tn,qr=Math.floor(a.browser.hardwareConcurrency/2);function Dt(){return tn||(tn=new ar),tn}function zr(p,v){var d={};for(var y in p)y!=="ref"&&(d[y]=p[y]);return a.refProperties.forEach(function(S){S in v&&(d[S]=v[S])}),d}function Rr(p){p=p.slice();for(var v=Object.create(null),d=0;d<p.length;d++)v[p[d].id]=p[d];for(var y=0;y<p.length;y++)"ref"in p[y]&&(p[y]=zr(p[y],v[p[y].ref]));return p}ar.workerCount=Math.max(Math.min(qr,6),1);var Pr={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Hn(p,v,d){d.push({command:Pr.addSource,args:[p,v[p]]})}function Lr(p,v,d){v.push({command:Pr.removeSource,args:[p]}),d[p]=!0}function ci(p,v,d,y){Lr(p,d,y),Hn(p,v,d)}function Gi(p,v,d){var y;for(y in p[d])if(p[d].hasOwnProperty(y)&&y!=="data"&&!a.deepEqual(p[d][y],v[d][y]))return!1;for(y in v[d])if(v[d].hasOwnProperty(y)&&y!=="data"&&!a.deepEqual(p[d][y],v[d][y]))return!1;return!0}function oi(p,v,d,y,S,C){var I;for(I in v=v||{},p=p||{})p.hasOwnProperty(I)&&(a.deepEqual(p[I],v[I])||d.push({command:C,args:[y,I,v[I],S]}));for(I in v)v.hasOwnProperty(I)&&!p.hasOwnProperty(I)&&(a.deepEqual(p[I],v[I])||d.push({command:C,args:[y,I,v[I],S]}))}function _i(p){return p.id}function Gn(p,v){return p[v.id]=v,p}var ka=function(p,v){this.reset(p,v)};ka.prototype.reset=function(p,v){this.points=p||[],this._distances=[0];for(var d=1;d<this.points.length;d++)this._distances[d]=this._distances[d-1]+this.points[d].dist(this.points[d-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(v||0,.5*this.length),this.paddedLength=this.length-2*this.padding},ka.prototype.lerp=function(p){if(this.points.length===1)return this.points[0];p=a.clamp(p,0,1);for(var v=1,d=this._distances[v],y=p*this.paddedLength+this.padding;d<y&&v<this._distances.length;)d=this._distances[++v];var S=v-1,C=this._distances[S],I=d-C,O=I>0?(y-C)/I:0;return this.points[S].mult(1-O).add(this.points[v].mult(O))};var hi=function(p,v,d){var y=this.boxCells=[],S=this.circleCells=[];this.xCellCount=Math.ceil(p/d),this.yCellCount=Math.ceil(v/d);for(var C=0;C<this.xCellCount*this.yCellCount;C++)y.push([]),S.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=p,this.height=v,this.xScale=this.xCellCount/p,this.yScale=this.yCellCount/v,this.boxUid=0,this.circleUid=0};function Wi(p,v,d,y,S){var C=a.create();return v?(a.scale(C,C,[1/S,1/S,1]),d||a.rotateZ(C,C,y.angle)):a.multiply(C,y.labelPlaneMatrix,p),C}function Ii(p,v,d,y,S){if(v){var C=a.clone(p);return a.scale(C,C,[S,S,1]),d||a.rotateZ(C,C,-y.angle),C}return y.glCoordMatrix}function Wn(p,v){var d=[p.x,p.y,0,1];ua(d,d,v);var y=d[3];return{point:new a.Point(d[0]/y,d[1]/y),signedDistanceFromCamera:y}}function si(p,v){return .5+p/v*.5}function To(p,v){var d=p[0]/p[3],y=p[1]/p[3];return d>=-v[0]&&d<=v[0]&&y>=-v[1]&&y<=v[1]}function dl(p,v,d,y,S,C,I,O){var z=y?p.textSizeData:p.iconSizeData,X=a.evaluateSizeForZoom(z,d.transform.zoom),ne=[256/d.width*2+1,256/d.height*2+1],ae=y?p.text.dynamicLayoutVertexArray:p.icon.dynamicLayoutVertexArray;ae.clear();for(var oe=p.lineVertexArray,we=y?p.text.placedSymbolArray:p.icon.placedSymbolArray,be=d.transform.width/d.transform.height,Fe=!1,_e=0;_e<we.length;_e++){var De=we.get(_e);if(De.hidden||De.writingMode===a.WritingMode.vertical&&!Fe)ro(De.numGlyphs,ae);else{Fe=!1;var Xe=[De.anchorX,De.anchorY,0,1];if(a.transformMat4(Xe,Xe,v),To(Xe,ne)){var ot=si(d.transform.cameraToCenterDistance,Xe[3]),Ct=a.evaluateSizeForFeature(z,X,De),mt=I?Ct/ot:Ct*ot,kt=new a.Point(De.anchorX,De.anchorY),qt=Wn(kt,S).point,Tr={},yr=vl(De,mt,!1,O,v,S,C,p.glyphOffsetArray,oe,ae,qt,kt,Tr,be);Fe=yr.useVertical,(yr.notEnoughRoom||Fe||yr.needsFlipping&&vl(De,mt,!0,O,v,S,C,p.glyphOffsetArray,oe,ae,qt,kt,Tr,be).notEnoughRoom)&&ro(De.numGlyphs,ae)}else ro(De.numGlyphs,ae)}}y?p.text.dynamicLayoutVertexBuffer.updateData(ae):p.icon.dynamicLayoutVertexBuffer.updateData(ae)}function wa(p,v,d,y,S,C,I,O,z,X,ne){var ae=O.glyphStartIndex+O.numGlyphs,oe=O.lineStartIndex,we=O.lineStartIndex+O.lineLength,be=v.getoffsetX(O.glyphStartIndex),Fe=v.getoffsetX(ae-1),_e=sa(p*be,d,y,S,C,I,O.segment,oe,we,z,X,ne);if(!_e)return null;var De=sa(p*Fe,d,y,S,C,I,O.segment,oe,we,z,X,ne);return De?{first:_e,last:De}:null}function fa(p,v,d,y){return p===a.WritingMode.horizontal&&Math.abs(d.y-v.y)>Math.abs(d.x-v.x)*y?{useVertical:!0}:(p===a.WritingMode.vertical?v.y<d.y:v.x>d.x)?{needsFlipping:!0}:null}function vl(p,v,d,y,S,C,I,O,z,X,ne,ae,oe,we){var be,Fe=v/24,_e=p.lineOffsetX*Fe,De=p.lineOffsetY*Fe;if(p.numGlyphs>1){var Xe=p.glyphStartIndex+p.numGlyphs,ot=p.lineStartIndex,Ct=p.lineStartIndex+p.lineLength,mt=wa(Fe,O,_e,De,d,ne,ae,p,z,C,oe);if(!mt)return{notEnoughRoom:!0};var kt=Wn(mt.first.point,I).point,qt=Wn(mt.last.point,I).point;if(y&&!d){var Tr=fa(p.writingMode,kt,qt,we);if(Tr)return Tr}be=[mt.first];for(var yr=p.glyphStartIndex+1;yr<Xe-1;yr++)be.push(sa(Fe*O.getoffsetX(yr),_e,De,d,ne,ae,p.segment,ot,Ct,z,C,oe));be.push(mt.last)}else{if(y&&!d){var $r=Wn(ae,S).point,vn=p.lineStartIndex+p.segment+1,bn=new a.Point(z.getx(vn),z.gety(vn)),xn=Wn(bn,S),Si=xn.signedDistanceFromCamera>0?xn.point:$s(ae,bn,$r,1,S),Yr=fa(p.writingMode,$r,Si,we);if(Yr)return Yr}var Un=sa(Fe*O.getoffsetX(p.glyphStartIndex),_e,De,d,ne,ae,p.segment,p.lineStartIndex,p.lineStartIndex+p.lineLength,z,C,oe);if(!Un)return{notEnoughRoom:!0};be=[Un]}for(var Kn=0,Bn=be;Kn<Bn.length;Kn+=1){var On=Bn[Kn];a.addDynamicAttributes(X,On.point,On.angle)}return{}}function $s(p,v,d,y,S){var C=Wn(p.add(p.sub(v)._unit()),S).point,I=d.sub(C);return d.add(I._mult(y/I.mag()))}function sa(p,v,d,y,S,C,I,O,z,X,ne,ae){var oe=y?p-v:p+v,we=oe>0?1:-1,be=0;y&&(we*=-1,be=Math.PI),we<0&&(be+=Math.PI);for(var Fe=we>0?O+I:O+I+1,_e=S,De=S,Xe=0,ot=0,Ct=Math.abs(oe),mt=[];Xe+ot<=Ct;){if((Fe+=we)<O||Fe>=z)return null;if(De=_e,mt.push(_e),(_e=ae[Fe])===void 0){var kt=new a.Point(X.getx(Fe),X.gety(Fe)),qt=Wn(kt,ne);if(qt.signedDistanceFromCamera>0)_e=ae[Fe]=qt.point;else{var Tr=Fe-we;_e=$s(Xe===0?C:new a.Point(X.getx(Tr),X.gety(Tr)),kt,De,Ct-Xe+1,ne)}}Xe+=ot,ot=De.dist(_e)}var yr=(Ct-Xe)/ot,$r=_e.sub(De),vn=$r.mult(yr)._add(De);vn._add($r._unit()._perp()._mult(d*we));var bn=be+Math.atan2(_e.y-De.y,_e.x-De.x);return mt.push(vn),{point:vn,angle:bn,path:mt}}hi.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},hi.prototype.insert=function(p,v,d,y,S){this._forEachCell(v,d,y,S,this._insertBoxCell,this.boxUid++),this.boxKeys.push(p),this.bboxes.push(v),this.bboxes.push(d),this.bboxes.push(y),this.bboxes.push(S)},hi.prototype.insertCircle=function(p,v,d,y){this._forEachCell(v-y,d-y,v+y,d+y,this._insertCircleCell,this.circleUid++),this.circleKeys.push(p),this.circles.push(v),this.circles.push(d),this.circles.push(y)},hi.prototype._insertBoxCell=function(p,v,d,y,S,C){this.boxCells[S].push(C)},hi.prototype._insertCircleCell=function(p,v,d,y,S,C){this.circleCells[S].push(C)},hi.prototype._query=function(p,v,d,y,S,C){if(d<0||p>this.width||y<0||v>this.height)return!S&&[];var I=[];if(p<=0&&v<=0&&this.width<=d&&this.height<=y){if(S)return!0;for(var O=0;O<this.boxKeys.length;O++)I.push({key:this.boxKeys[O],x1:this.bboxes[4*O],y1:this.bboxes[4*O+1],x2:this.bboxes[4*O+2],y2:this.bboxes[4*O+3]});for(var z=0;z<this.circleKeys.length;z++){var X=this.circles[3*z],ne=this.circles[3*z+1],ae=this.circles[3*z+2];I.push({key:this.circleKeys[z],x1:X-ae,y1:ne-ae,x2:X+ae,y2:ne+ae})}return C?I.filter(C):I}return this._forEachCell(p,v,d,y,this._queryCell,I,{hitTest:S,seenUids:{box:{},circle:{}}},C),S?I.length>0:I},hi.prototype._queryCircle=function(p,v,d,y,S){var C=p-d,I=p+d,O=v-d,z=v+d;if(I<0||C>this.width||z<0||O>this.height)return!y&&[];var X=[];return this._forEachCell(C,O,I,z,this._queryCellCircle,X,{hitTest:y,circle:{x:p,y:v,radius:d},seenUids:{box:{},circle:{}}},S),y?X.length>0:X},hi.prototype.query=function(p,v,d,y,S){return this._query(p,v,d,y,!1,S)},hi.prototype.hitTest=function(p,v,d,y,S){return this._query(p,v,d,y,!0,S)},hi.prototype.hitTestCircle=function(p,v,d,y){return this._queryCircle(p,v,d,!0,y)},hi.prototype._queryCell=function(p,v,d,y,S,C,I,O){var z=I.seenUids,X=this.boxCells[S];if(X!==null)for(var ne=this.bboxes,ae=0,oe=X;ae<oe.length;ae+=1){var we=oe[ae];if(!z.box[we]){z.box[we]=!0;var be=4*we;if(p<=ne[be+2]&&v<=ne[be+3]&&d>=ne[be+0]&&y>=ne[be+1]&&(!O||O(this.boxKeys[we]))){if(I.hitTest)return C.push(!0),!0;C.push({key:this.boxKeys[we],x1:ne[be],y1:ne[be+1],x2:ne[be+2],y2:ne[be+3]})}}}var Fe=this.circleCells[S];if(Fe!==null)for(var _e=this.circles,De=0,Xe=Fe;De<Xe.length;De+=1){var ot=Xe[De];if(!z.circle[ot]){z.circle[ot]=!0;var Ct=3*ot;if(this._circleAndRectCollide(_e[Ct],_e[Ct+1],_e[Ct+2],p,v,d,y)&&(!O||O(this.circleKeys[ot]))){if(I.hitTest)return C.push(!0),!0;var mt=_e[Ct],kt=_e[Ct+1],qt=_e[Ct+2];C.push({key:this.circleKeys[ot],x1:mt-qt,y1:kt-qt,x2:mt+qt,y2:kt+qt})}}}},hi.prototype._queryCellCircle=function(p,v,d,y,S,C,I,O){var z=I.circle,X=I.seenUids,ne=this.boxCells[S];if(ne!==null)for(var ae=this.bboxes,oe=0,we=ne;oe<we.length;oe+=1){var be=we[oe];if(!X.box[be]){X.box[be]=!0;var Fe=4*be;if(this._circleAndRectCollide(z.x,z.y,z.radius,ae[Fe+0],ae[Fe+1],ae[Fe+2],ae[Fe+3])&&(!O||O(this.boxKeys[be])))return C.push(!0),!0}}var _e=this.circleCells[S];if(_e!==null)for(var De=this.circles,Xe=0,ot=_e;Xe<ot.length;Xe+=1){var Ct=ot[Xe];if(!X.circle[Ct]){X.circle[Ct]=!0;var mt=3*Ct;if(this._circlesCollide(De[mt],De[mt+1],De[mt+2],z.x,z.y,z.radius)&&(!O||O(this.circleKeys[Ct])))return C.push(!0),!0}}},hi.prototype._forEachCell=function(p,v,d,y,S,C,I,O){for(var z=this._convertToXCellCoord(p),X=this._convertToYCellCoord(v),ne=this._convertToXCellCoord(d),ae=this._convertToYCellCoord(y),oe=z;oe<=ne;oe++)for(var we=X;we<=ae;we++)if(S.call(this,p,v,d,y,this.xCellCount*we+oe,C,I,O))return},hi.prototype._convertToXCellCoord=function(p){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(p*this.xScale)))},hi.prototype._convertToYCellCoord=function(p){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(p*this.yScale)))},hi.prototype._circlesCollide=function(p,v,d,y,S,C){var I=y-p,O=S-v,z=d+C;return z*z>I*I+O*O},hi.prototype._circleAndRectCollide=function(p,v,d,y,S,C,I){var O=(C-y)/2,z=Math.abs(p-(y+O));if(z>O+d)return!1;var X=(I-S)/2,ne=Math.abs(v-(S+X));if(ne>X+d)return!1;if(z<=O||ne<=X)return!0;var ae=z-O,oe=ne-X;return ae*ae+oe*oe<=d*d};var Hu=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ro(p,v){for(var d=0;d<p;d++){var y=v.length;v.resize(y+4),v.float32.set(Hu,3*y)}}function ua(p,v,d){var y=v[0],S=v[1];return p[0]=d[0]*y+d[4]*S+d[12],p[1]=d[1]*y+d[5]*S+d[13],p[3]=d[3]*y+d[7]*S+d[15],p}var Ca=function(p,v,d){v===void 0&&(v=new hi(p.width+200,p.height+200,25)),d===void 0&&(d=new hi(p.width+200,p.height+200,25)),this.transform=p,this.grid=v,this.ignoredGrid=d,this.pitchfactor=Math.cos(p._pitch)*p.cameraToCenterDistance,this.screenRightBoundary=p.width+100,this.screenBottomBoundary=p.height+100,this.gridRightBoundary=p.width+200,this.gridBottomBoundary=p.height+200};function Qi(p,v,d){return v*(a.EXTENT/(p.tileSize*Math.pow(2,d-p.tileID.overscaledZ)))}Ca.prototype.placeCollisionBox=function(p,v,d,y,S){var C=this.projectAndGetPerspectiveRatio(y,p.anchorPointX,p.anchorPointY),I=d*C.perspectiveRatio,O=p.x1*I+C.point.x,z=p.y1*I+C.point.y,X=p.x2*I+C.point.x,ne=p.y2*I+C.point.y;return!this.isInsideGrid(O,z,X,ne)||!v&&this.grid.hitTest(O,z,X,ne,S)?{box:[],offscreen:!1}:{box:[O,z,X,ne],offscreen:this.isOffscreen(O,z,X,ne)}},Ca.prototype.placeCollisionCircles=function(p,v,d,y,S,C,I,O,z,X,ne,ae,oe){var we=[],be=new a.Point(v.anchorX,v.anchorY),Fe=Wn(be,C),_e=si(this.transform.cameraToCenterDistance,Fe.signedDistanceFromCamera),De=(X?S/_e:S*_e)/a.ONE_EM,Xe=Wn(be,I).point,ot=wa(De,y,v.lineOffsetX*De,v.lineOffsetY*De,!1,Xe,be,v,d,I,{}),Ct=!1,mt=!1,kt=!0;if(ot){for(var qt=.5*ae*_e+oe,Tr=new a.Point(-100,-100),yr=new a.Point(this.screenRightBoundary,this.screenBottomBoundary),$r=new ka,vn=ot.first,bn=ot.last,xn=[],Si=vn.path.length-1;Si>=1;Si--)xn.push(vn.path[Si]);for(var Yr=1;Yr<bn.path.length;Yr++)xn.push(bn.path[Yr]);var Un=2.5*qt;if(O){var Kn=xn.map(function(bs){return Wn(bs,O)});xn=Kn.some(function(bs){return bs.signedDistanceFromCamera<=0})?[]:Kn.map(function(bs){return bs.point})}var Bn=[];if(xn.length>0){for(var On=xn[0].clone(),Yn=xn[0].clone(),kn=1;kn<xn.length;kn++)On.x=Math.min(On.x,xn[kn].x),On.y=Math.min(On.y,xn[kn].y),Yn.x=Math.max(Yn.x,xn[kn].x),Yn.y=Math.max(Yn.y,xn[kn].y);Bn=On.x>=Tr.x&&Yn.x<=yr.x&&On.y>=Tr.y&&Yn.y<=yr.y?[xn]:Yn.x<Tr.x||On.x>yr.x||Yn.y<Tr.y||On.y>yr.y?[]:a.clipLine([xn],Tr.x,Tr.y,yr.x,yr.y)}for(var In=0,$a=Bn;In<$a.length;In+=1){var xa;$r.reset($a[In],.25*qt),xa=$r.length<=.5*qt?1:Math.ceil($r.paddedLength/Un)+1;for(var _o=0;_o<xa;_o++){var oo=_o/Math.max(xa-1,1),_a=$r.lerp(oo),ba=_a.x+100,Yo=_a.y+100;we.push(ba,Yo,qt,0);var Uo=ba-qt,Ru=Yo-qt,Zo=ba+qt,Zs=Yo+qt;if(kt=kt&&this.isOffscreen(Uo,Ru,Zo,Zs),mt=mt||this.isInsideGrid(Uo,Ru,Zo,Zs),!p&&this.grid.hitTestCircle(ba,Yo,qt,ne)&&(Ct=!0,!z))return{circles:[],offscreen:!1,collisionDetected:Ct}}}}return{circles:!z&&Ct||!mt?[]:we,offscreen:kt,collisionDetected:Ct}},Ca.prototype.queryRenderedSymbols=function(p){if(p.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var v=[],d=1/0,y=1/0,S=-1/0,C=-1/0,I=0,O=p;I<O.length;I+=1){var z=O[I],X=new a.Point(z.x+100,z.y+100);d=Math.min(d,X.x),y=Math.min(y,X.y),S=Math.max(S,X.x),C=Math.max(C,X.y),v.push(X)}for(var ne={},ae={},oe=0,we=this.grid.query(d,y,S,C).concat(this.ignoredGrid.query(d,y,S,C));oe<we.length;oe+=1){var be=we[oe],Fe=be.key;if(ne[Fe.bucketInstanceId]===void 0&&(ne[Fe.bucketInstanceId]={}),!ne[Fe.bucketInstanceId][Fe.featureIndex]){var _e=[new a.Point(be.x1,be.y1),new a.Point(be.x2,be.y1),new a.Point(be.x2,be.y2),new a.Point(be.x1,be.y2)];a.polygonIntersectsPolygon(v,_e)&&(ne[Fe.bucketInstanceId][Fe.featureIndex]=!0,ae[Fe.bucketInstanceId]===void 0&&(ae[Fe.bucketInstanceId]=[]),ae[Fe.bucketInstanceId].push(Fe.featureIndex))}}return ae},Ca.prototype.insertCollisionBox=function(p,v,d,y,S){(v?this.ignoredGrid:this.grid).insert({bucketInstanceId:d,featureIndex:y,collisionGroupID:S},p[0],p[1],p[2],p[3])},Ca.prototype.insertCollisionCircles=function(p,v,d,y,S){for(var C=v?this.ignoredGrid:this.grid,I={bucketInstanceId:d,featureIndex:y,collisionGroupID:S},O=0;O<p.length;O+=4)C.insertCircle(I,p[O],p[O+1],p[O+2])},Ca.prototype.projectAndGetPerspectiveRatio=function(p,v,d){var y=[v,d,0,1];return ua(y,y,p),{point:new a.Point((y[0]/y[3]+1)/2*this.transform.width+100,(-y[1]/y[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/y[3]*.5}},Ca.prototype.isOffscreen=function(p,v,d,y){return d<100||p>=this.screenRightBoundary||y<100||v>this.screenBottomBoundary},Ca.prototype.isInsideGrid=function(p,v,d,y){return d>=0&&p<this.gridRightBoundary&&y>=0&&v<this.gridBottomBoundary},Ca.prototype.getViewportMatrix=function(){var p=a.identity([]);return a.translate(p,p,[-100,-100,0]),p};var Go=function(p,v,d,y){this.opacity=p?Math.max(0,Math.min(1,p.opacity+(p.placed?v:-v))):y&&d?1:0,this.placed=d};Go.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var Bo=function(p,v,d,y,S){this.text=new Go(p?p.text:null,v,d,S),this.icon=new Go(p?p.icon:null,v,y,S)};Bo.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var yf=function(p,v,d){this.text=p,this.icon=v,this.skipFade=d},vs=function(){this.invProjMatrix=a.create(),this.viewportMatrix=a.create(),this.circles=[]},Tp=function(p,v,d,y,S){this.bucketInstanceId=p,this.featureIndex=v,this.sourceLayerIndex=d,this.bucketIndex=y,this.tileID=S},ee=function(p){this.crossSourceCollisions=p,this.maxGroupID=0,this.collisionGroups={}};function ue(p,v,d,y,S){var C=a.getAnchorAlignment(p),I=-(C.horizontalAlign-.5)*v,O=-(C.verticalAlign-.5)*d,z=a.evaluateVariableOffset(p,y);return new a.Point(I+z[0]*S,O+z[1]*S)}function Ue(p,v,d,y,S,C){var I=p.x1,O=p.x2,z=p.y1,X=p.y2,ne=p.anchorPointX,ae=p.anchorPointY,oe=new a.Point(v,d);return y&&oe._rotate(S?C:-C),{x1:I+oe.x,y1:z+oe.y,x2:O+oe.x,y2:X+oe.y,anchorPointX:ne,anchorPointY:ae}}ee.prototype.get=function(p){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[p]){var v=++this.maxGroupID;this.collisionGroups[p]={ID:v,predicate:function(d){return d.collisionGroupID===v}}}return this.collisionGroups[p]};var _t=function(p,v,d,y){this.transform=p.clone(),this.collisionIndex=new Ca(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=v,this.retainedQueryData={},this.collisionGroups=new ee(d),this.collisionCircleArrays={},this.prevPlacement=y,y&&(y.prevPlacement=void 0),this.placedOrientations={}};function Sr(p,v,d,y,S){p.emplaceBack(v?1:0,d?1:0,y||0,S||0),p.emplaceBack(v?1:0,d?1:0,y||0,S||0),p.emplaceBack(v?1:0,d?1:0,y||0,S||0),p.emplaceBack(v?1:0,d?1:0,y||0,S||0)}_t.prototype.getBucketParts=function(p,v,d,y){var S=d.getBucket(v),C=d.latestFeatureIndex;if(S&&C&&v.id===S.layerIds[0]){var I=d.collisionBoxArray,O=S.layers[0].layout,z=Math.pow(2,this.transform.zoom-d.tileID.overscaledZ),X=d.tileSize/a.EXTENT,ne=this.transform.calculatePosMatrix(d.tileID.toUnwrapped()),ae=O.get("text-pitch-alignment")==="map",oe=O.get("text-rotation-alignment")==="map",we=Qi(d,1,this.transform.zoom),be=Wi(ne,ae,oe,this.transform,we),Fe=null;if(ae){var _e=Ii(ne,ae,oe,this.transform,we);Fe=a.multiply([],this.transform.labelPlaneMatrix,_e)}this.retainedQueryData[S.bucketInstanceId]=new Tp(S.bucketInstanceId,C,S.sourceLayerIndex,S.index,d.tileID);var De={bucket:S,layout:O,posMatrix:ne,textLabelPlaneMatrix:be,labelToScreenMatrix:Fe,scale:z,textPixelRatio:X,holdingForFade:d.holdingForFade(),collisionBoxArray:I,partiallyEvaluatedTextSize:a.evaluateSizeForZoom(S.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(S.sourceID)};if(y)for(var Xe=0,ot=S.sortKeyRanges;Xe<ot.length;Xe+=1){var Ct=ot[Xe];p.push({sortKey:Ct.sortKey,symbolInstanceStart:Ct.symbolInstanceStart,symbolInstanceEnd:Ct.symbolInstanceEnd,parameters:De})}else p.push({symbolInstanceStart:0,symbolInstanceEnd:S.symbolInstances.length,parameters:De})}},_t.prototype.attemptAnchorPlacement=function(p,v,d,y,S,C,I,O,z,X,ne,ae,oe,we,be){var Fe,_e=[ae.textOffset0,ae.textOffset1],De=ue(p,d,y,_e,S),Xe=this.collisionIndex.placeCollisionBox(Ue(v,De.x,De.y,C,I,this.transform.angle),ne,O,z,X.predicate);if(!be||this.collisionIndex.placeCollisionBox(Ue(be,De.x,De.y,C,I,this.transform.angle),ne,O,z,X.predicate).box.length!==0)return Xe.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[ae.crossTileID]&&this.prevPlacement.placements[ae.crossTileID]&&this.prevPlacement.placements[ae.crossTileID].text&&(Fe=this.prevPlacement.variableOffsets[ae.crossTileID].anchor),this.variableOffsets[ae.crossTileID]={textOffset:_e,width:d,height:y,anchor:p,textBoxScale:S,prevAnchor:Fe},this.markUsedJustification(oe,p,ae,we),oe.allowVerticalPlacement&&(this.markUsedOrientation(oe,we,ae),this.placedOrientations[ae.crossTileID]=we),{shift:De,placedGlyphBoxes:Xe}):void 0},_t.prototype.placeLayerBucketPart=function(p,v,d){var y=this,S=p.parameters,C=S.bucket,I=S.layout,O=S.posMatrix,z=S.textLabelPlaneMatrix,X=S.labelToScreenMatrix,ne=S.textPixelRatio,ae=S.holdingForFade,oe=S.collisionBoxArray,we=S.partiallyEvaluatedTextSize,be=S.collisionGroup,Fe=I.get("text-optional"),_e=I.get("icon-optional"),De=I.get("text-allow-overlap"),Xe=I.get("icon-allow-overlap"),ot=I.get("text-rotation-alignment")==="map",Ct=I.get("text-pitch-alignment")==="map",mt=I.get("icon-text-fit")!=="none",kt=I.get("symbol-z-order")==="viewport-y",qt=De&&(Xe||!C.hasIconData()||_e),Tr=Xe&&(De||!C.hasTextData()||Fe);!C.collisionArrays&&oe&&C.deserializeCollisionBoxes(oe);var yr=function(Yr,Un){if(!v[Yr.crossTileID])if(ae)y.placements[Yr.crossTileID]=new yf(!1,!1,!1);else{var Kn,Bn=!1,On=!1,Yn=!0,kn=null,In={box:null,offscreen:null},$a={box:null,offscreen:null},xa=null,_o=null,oo=0,_a=0,ba=0;Un.textFeatureIndex?oo=Un.textFeatureIndex:Yr.useRuntimeCollisionCircles&&(oo=Yr.featureIndex),Un.verticalTextFeatureIndex&&(_a=Un.verticalTextFeatureIndex);var Yo=Un.textBox;if(Yo){var Uo=function(vi){var yo=a.WritingMode.horizontal;if(C.allowVerticalPlacement&&!vi&&y.prevPlacement){var Va=y.prevPlacement.placedOrientations[Yr.crossTileID];Va&&(y.placedOrientations[Yr.crossTileID]=Va,y.markUsedOrientation(C,yo=Va,Yr))}return yo},Ru=function(vi,yo){if(C.allowVerticalPlacement&&Yr.numVerticalGlyphVertices>0&&Un.verticalTextBox)for(var Va=0,Mu=C.writingModes;Va<Mu.length&&(Mu[Va]===a.WritingMode.vertical?(In=yo(),$a=In):In=vi(),!(In&&In.box&&In.box.length));Va+=1);else In=vi()};if(I.get("text-variable-anchor")){var Zo=I.get("text-variable-anchor");if(y.prevPlacement&&y.prevPlacement.variableOffsets[Yr.crossTileID]){var Zs=y.prevPlacement.variableOffsets[Yr.crossTileID];Zo.indexOf(Zs.anchor)>0&&(Zo=Zo.filter(function(vi){return vi!==Zs.anchor})).unshift(Zs.anchor)}var bs=function(vi,yo,Va){for(var Mu=vi.x2-vi.x1,Fh=vi.y2-vi.y1,Bl=Yr.textBoxScale,Xp=mt&&!Xe?yo:null,uc={box:[],offscreen:!1},lc=De?2*Zo.length:Zo.length,fu=0;fu<lc;++fu){var Bh=y.attemptAnchorPlacement(Zo[fu%Zo.length],vi,Mu,Fh,Bl,ot,Ct,ne,O,be,fu>=Zo.length,Yr,C,Va,Xp);if(Bh&&(uc=Bh.placedGlyphBoxes)&&uc.box&&uc.box.length){Bn=!0,kn=Bh.shift;break}}return uc};Ru(function(){return bs(Yo,Un.iconBox,a.WritingMode.horizontal)},function(){var vi=Un.verticalTextBox;return C.allowVerticalPlacement&&!(In&&In.box&&In.box.length)&&Yr.numVerticalGlyphVertices>0&&vi?bs(vi,Un.verticalIconBox,a.WritingMode.vertical):{box:null,offscreen:null}}),In&&(Bn=In.box,Yn=In.offscreen);var Bc=Uo(In&&In.box);if(!Bn&&y.prevPlacement){var sc=y.prevPlacement.variableOffsets[Yr.crossTileID];sc&&(y.variableOffsets[Yr.crossTileID]=sc,y.markUsedJustification(C,sc.anchor,Yr,Bc))}}else{var Iu=function(vi,yo){var Va=y.collisionIndex.placeCollisionBox(vi,De,ne,O,be.predicate);return Va&&Va.box&&Va.box.length&&(y.markUsedOrientation(C,yo,Yr),y.placedOrientations[Yr.crossTileID]=yo),Va};Ru(function(){return Iu(Yo,a.WritingMode.horizontal)},function(){var vi=Un.verticalTextBox;return C.allowVerticalPlacement&&Yr.numVerticalGlyphVertices>0&&vi?Iu(vi,a.WritingMode.vertical):{box:null,offscreen:null}}),Uo(In&&In.box&&In.box.length)}}if(Bn=(Kn=In)&&Kn.box&&Kn.box.length>0,Yn=Kn&&Kn.offscreen,Yr.useRuntimeCollisionCircles){var Dl=C.text.placedSymbolArray.get(Yr.centerJustifiedTextSymbolIndex),rl=a.evaluateSizeForFeature(C.textSizeData,we,Dl),lu=I.get("text-padding");xa=y.collisionIndex.placeCollisionCircles(De,Dl,C.lineVertexArray,C.glyphOffsetArray,rl,O,z,X,d,Ct,be.predicate,Yr.collisionCircleDiameter,lu),Bn=De||xa.circles.length>0&&!xa.collisionDetected,Yn=Yn&&xa.offscreen}if(Un.iconFeatureIndex&&(ba=Un.iconFeatureIndex),Un.iconBox){var Fl=function(vi){var yo=mt&&kn?Ue(vi,kn.x,kn.y,ot,Ct,y.transform.angle):vi;return y.collisionIndex.placeCollisionBox(yo,Xe,ne,O,be.predicate)};On=$a&&$a.box&&$a.box.length&&Un.verticalIconBox?(_o=Fl(Un.verticalIconBox)).box.length>0:(_o=Fl(Un.iconBox)).box.length>0,Yn=Yn&&_o.offscreen}var Ro=Fe||Yr.numHorizontalGlyphVertices===0&&Yr.numVerticalGlyphVertices===0,Ma=_e||Yr.numIconVertices===0;if(Ro||Ma?Ma?Ro||(On=On&&Bn):Bn=On&&Bn:On=Bn=On&&Bn,Bn&&Kn&&Kn.box&&y.collisionIndex.insertCollisionBox(Kn.box,I.get("text-ignore-placement"),C.bucketInstanceId,$a&&$a.box&&_a?_a:oo,be.ID),On&&_o&&y.collisionIndex.insertCollisionBox(_o.box,I.get("icon-ignore-placement"),C.bucketInstanceId,ba,be.ID),xa&&(Bn&&y.collisionIndex.insertCollisionCircles(xa.circles,I.get("text-ignore-placement"),C.bucketInstanceId,oo,be.ID),d)){var as=C.bucketInstanceId,qs=y.collisionCircleArrays[as];qs===void 0&&(qs=y.collisionCircleArrays[as]=new vs);for(var cu=0;cu<xa.circles.length;cu+=4)qs.circles.push(xa.circles[cu+0]),qs.circles.push(xa.circles[cu+1]),qs.circles.push(xa.circles[cu+2]),qs.circles.push(xa.collisionDetected?1:0)}y.placements[Yr.crossTileID]=new yf(Bn||qt,On||Tr,Yn||C.justReloaded),v[Yr.crossTileID]=!0}};if(kt)for(var $r=C.getSortedSymbolIndexes(this.transform.angle),vn=$r.length-1;vn>=0;--vn){var bn=$r[vn];yr(C.symbolInstances.get(bn),C.collisionArrays[bn])}else for(var xn=p.symbolInstanceStart;xn<p.symbolInstanceEnd;xn++)yr(C.symbolInstances.get(xn),C.collisionArrays[xn]);if(d&&C.bucketInstanceId in this.collisionCircleArrays){var Si=this.collisionCircleArrays[C.bucketInstanceId];a.invert(Si.invProjMatrix,O),Si.viewportMatrix=this.collisionIndex.getViewportMatrix()}C.justReloaded=!1},_t.prototype.markUsedJustification=function(p,v,d,y){var S;S=y===a.WritingMode.vertical?d.verticalPlacedTextSymbolIndex:{left:d.leftJustifiedTextSymbolIndex,center:d.centerJustifiedTextSymbolIndex,right:d.rightJustifiedTextSymbolIndex}[a.getAnchorJustification(v)];for(var C=0,I=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex,d.verticalPlacedTextSymbolIndex];C<I.length;C+=1){var O=I[C];O>=0&&(p.text.placedSymbolArray.get(O).crossTileID=S>=0&&O!==S?0:d.crossTileID)}},_t.prototype.markUsedOrientation=function(p,v,d){for(var y=v===a.WritingMode.horizontal||v===a.WritingMode.horizontalOnly?v:0,S=v===a.WritingMode.vertical?v:0,C=0,I=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex];C<I.length;C+=1)p.text.placedSymbolArray.get(I[C]).placedOrientation=y;d.verticalPlacedTextSymbolIndex&&(p.text.placedSymbolArray.get(d.verticalPlacedTextSymbolIndex).placedOrientation=S)},_t.prototype.commit=function(p){this.commitTime=p,this.zoomAtLastRecencyCheck=this.transform.zoom;var v=this.prevPlacement,d=!1;this.prevZoomAdjustment=v?v.zoomAdjustment(this.transform.zoom):0;var y=v?v.symbolFadeChange(p):1,S=v?v.opacities:{},C=v?v.variableOffsets:{},I=v?v.placedOrientations:{};for(var O in this.placements){var z=this.placements[O],X=S[O];X?(this.opacities[O]=new Bo(X,y,z.text,z.icon),d=d||z.text!==X.text.placed||z.icon!==X.icon.placed):(this.opacities[O]=new Bo(null,y,z.text,z.icon,z.skipFade),d=d||z.text||z.icon)}for(var ne in S){var ae=S[ne];if(!this.opacities[ne]){var oe=new Bo(ae,y,!1,!1);oe.isHidden()||(this.opacities[ne]=oe,d=d||ae.text.placed||ae.icon.placed)}}for(var we in C)this.variableOffsets[we]||!this.opacities[we]||this.opacities[we].isHidden()||(this.variableOffsets[we]=C[we]);for(var be in I)this.placedOrientations[be]||!this.opacities[be]||this.opacities[be].isHidden()||(this.placedOrientations[be]=I[be]);d?this.lastPlacementChangeTime=p:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=v?v.lastPlacementChangeTime:p)},_t.prototype.updateLayerOpacities=function(p,v){for(var d={},y=0,S=v;y<S.length;y+=1){var C=S[y],I=C.getBucket(p);I&&C.latestFeatureIndex&&p.id===I.layerIds[0]&&this.updateBucketOpacities(I,d,C.collisionBoxArray)}},_t.prototype.updateBucketOpacities=function(p,v,d){var y=this;p.hasTextData()&&p.text.opacityVertexArray.clear(),p.hasIconData()&&p.icon.opacityVertexArray.clear(),p.hasIconCollisionBoxData()&&p.iconCollisionBox.collisionVertexArray.clear(),p.hasTextCollisionBoxData()&&p.textCollisionBox.collisionVertexArray.clear();var S=p.layers[0].layout,C=new Bo(null,0,!1,!1,!0),I=S.get("text-allow-overlap"),O=S.get("icon-allow-overlap"),z=S.get("text-variable-anchor"),X=S.get("text-rotation-alignment")==="map",ne=S.get("text-pitch-alignment")==="map",ae=S.get("icon-text-fit")!=="none",oe=new Bo(null,0,I&&(O||!p.hasIconData()||S.get("icon-optional")),O&&(I||!p.hasTextData()||S.get("text-optional")),!0);!p.collisionArrays&&d&&(p.hasIconCollisionBoxData()||p.hasTextCollisionBoxData())&&p.deserializeCollisionBoxes(d);for(var we=function(De,Xe,ot){for(var Ct=0;Ct<Xe/4;Ct++)De.opacityVertexArray.emplaceBack(ot)},be=function(De){var Xe=p.symbolInstances.get(De),ot=Xe.numHorizontalGlyphVertices,Ct=Xe.numVerticalGlyphVertices,mt=Xe.crossTileID,kt=y.opacities[mt];v[mt]?kt=C:kt||(y.opacities[mt]=kt=oe),v[mt]=!0;var qt=Xe.numIconVertices>0,Tr=y.placedOrientations[Xe.crossTileID],yr=Tr===a.WritingMode.vertical,$r=Tr===a.WritingMode.horizontal||Tr===a.WritingMode.horizontalOnly;if(ot>0||Ct>0){var vn=B1(kt.text);we(p.text,ot,yr?Tc:vn),we(p.text,Ct,$r?Tc:vn);var bn=kt.text.isHidden();[Xe.rightJustifiedTextSymbolIndex,Xe.centerJustifiedTextSymbolIndex,Xe.leftJustifiedTextSymbolIndex].forEach(function(In){In>=0&&(p.text.placedSymbolArray.get(In).hidden=bn||yr?1:0)}),Xe.verticalPlacedTextSymbolIndex>=0&&(p.text.placedSymbolArray.get(Xe.verticalPlacedTextSymbolIndex).hidden=bn||$r?1:0);var xn=y.variableOffsets[Xe.crossTileID];xn&&y.markUsedJustification(p,xn.anchor,Xe,Tr);var Si=y.placedOrientations[Xe.crossTileID];Si&&(y.markUsedJustification(p,"left",Xe,Si),y.markUsedOrientation(p,Si,Xe))}if(qt){var Yr=B1(kt.icon),Un=!(ae&&Xe.verticalPlacedIconSymbolIndex&&yr);Xe.placedIconSymbolIndex>=0&&(we(p.icon,Xe.numIconVertices,Un?Yr:Tc),p.icon.placedSymbolArray.get(Xe.placedIconSymbolIndex).hidden=kt.icon.isHidden()),Xe.verticalPlacedIconSymbolIndex>=0&&(we(p.icon,Xe.numVerticalIconVertices,Un?Tc:Yr),p.icon.placedSymbolArray.get(Xe.verticalPlacedIconSymbolIndex).hidden=kt.icon.isHidden())}if(p.hasIconCollisionBoxData()||p.hasTextCollisionBoxData()){var Kn=p.collisionArrays[De];if(Kn){var Bn=new a.Point(0,0);if(Kn.textBox||Kn.verticalTextBox){var On=!0;if(z){var Yn=y.variableOffsets[mt];Yn?(Bn=ue(Yn.anchor,Yn.width,Yn.height,Yn.textOffset,Yn.textBoxScale),X&&Bn._rotate(ne?y.transform.angle:-y.transform.angle)):On=!1}Kn.textBox&&Sr(p.textCollisionBox.collisionVertexArray,kt.text.placed,!On||yr,Bn.x,Bn.y),Kn.verticalTextBox&&Sr(p.textCollisionBox.collisionVertexArray,kt.text.placed,!On||$r,Bn.x,Bn.y)}var kn=!!(!$r&&Kn.verticalIconBox);Kn.iconBox&&Sr(p.iconCollisionBox.collisionVertexArray,kt.icon.placed,kn,ae?Bn.x:0,ae?Bn.y:0),Kn.verticalIconBox&&Sr(p.iconCollisionBox.collisionVertexArray,kt.icon.placed,!kn,ae?Bn.x:0,ae?Bn.y:0)}}},Fe=0;Fe<p.symbolInstances.length;Fe++)be(Fe);if(p.sortFeatures(this.transform.angle),this.retainedQueryData[p.bucketInstanceId]&&(this.retainedQueryData[p.bucketInstanceId].featureSortOrder=p.featureSortOrder),p.hasTextData()&&p.text.opacityVertexBuffer&&p.text.opacityVertexBuffer.updateData(p.text.opacityVertexArray),p.hasIconData()&&p.icon.opacityVertexBuffer&&p.icon.opacityVertexBuffer.updateData(p.icon.opacityVertexArray),p.hasIconCollisionBoxData()&&p.iconCollisionBox.collisionVertexBuffer&&p.iconCollisionBox.collisionVertexBuffer.updateData(p.iconCollisionBox.collisionVertexArray),p.hasTextCollisionBoxData()&&p.textCollisionBox.collisionVertexBuffer&&p.textCollisionBox.collisionVertexBuffer.updateData(p.textCollisionBox.collisionVertexArray),p.bucketInstanceId in this.collisionCircleArrays){var _e=this.collisionCircleArrays[p.bucketInstanceId];p.placementInvProjMatrix=_e.invProjMatrix,p.placementViewportMatrix=_e.viewportMatrix,p.collisionCircleArray=_e.circles,delete this.collisionCircleArrays[p.bucketInstanceId]}},_t.prototype.symbolFadeChange=function(p){return this.fadeDuration===0?1:(p-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},_t.prototype.zoomAdjustment=function(p){return Math.max(0,(this.transform.zoom-p)/1.5)},_t.prototype.hasTransitions=function(p){return this.stale||p-this.lastPlacementChangeTime<this.fadeDuration},_t.prototype.stillRecent=function(p,v){var d=this.zoomAtLastRecencyCheck===v?1-this.zoomAdjustment(v):1;return this.zoomAtLastRecencyCheck=v,this.commitTime+this.fadeDuration*d>p},_t.prototype.setStale=function(){this.stale=!0};var hn=Math.pow(2,25),Ei=Math.pow(2,24),La=Math.pow(2,17),mo=Math.pow(2,16),no=Math.pow(2,9),Vs=Math.pow(2,8),F1=Math.pow(2,1);function B1(p){if(p.opacity===0&&!p.placed)return 0;if(p.opacity===1&&p.placed)return 4294967295;var v=p.placed?1:0,d=Math.floor(127*p.opacity);return d*hn+v*Ei+d*La+v*mo+d*no+v*Vs+d*F1+v}var Tc=0,wp=function(p){this._sortAcrossTiles=p.layout.get("symbol-z-order")!=="viewport-y"&&p.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};wp.prototype.continuePlacement=function(p,v,d,y,S){for(var C=this._bucketParts;this._currentTileIndex<p.length;)if(v.getBucketParts(C,y,p[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,S())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,C.sort(function(I,O){return I.sortKey-O.sortKey}));this._currentPartIndex<C.length;)if(v.placeLayerBucketPart(C[this._currentPartIndex],this._seenCrossTileIDs,d),this._currentPartIndex++,S())return!0;return!1};var xf=function(p,v,d,y,S,C,I){this.placement=new _t(p,S,C,I),this._currentPlacementIndex=v.length-1,this._forceFullPlacement=d,this._showCollisionBoxes=y,this._done=!1};xf.prototype.isDone=function(){return this._done},xf.prototype.continuePlacement=function(p,v,d){for(var y=this,S=a.browser.now(),C=function(){var z=a.browser.now()-S;return!y._forceFullPlacement&&z>2};this._currentPlacementIndex>=0;){var I=v[p[this._currentPlacementIndex]],O=this.placement.collisionIndex.transform.zoom;if(I.type==="symbol"&&(!I.minzoom||I.minzoom<=O)&&(!I.maxzoom||I.maxzoom>O)){if(this._inProgressLayer||(this._inProgressLayer=new wp(I)),this._inProgressLayer.continuePlacement(d[I.source],this.placement,this._showCollisionBoxes,I,C))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},xf.prototype.commit=function(p){return this.placement.commit(p),this.placement};var L1=512/a.EXTENT/2,hh=function(p,v,d){this.tileID=p,this.indexedSymbolInstances={},this.bucketInstanceId=d;for(var y=0;y<v.length;y++){var S=v.get(y),C=S.key;this.indexedSymbolInstances[C]||(this.indexedSymbolInstances[C]=[]),this.indexedSymbolInstances[C].push({crossTileID:S.crossTileID,coord:this.getScaledCoordinates(S,p)})}};hh.prototype.getScaledCoordinates=function(p,v){var d=L1/Math.pow(2,v.canonical.z-this.tileID.canonical.z);return{x:Math.floor((v.canonical.x*a.EXTENT+p.anchorX)*d),y:Math.floor((v.canonical.y*a.EXTENT+p.anchorY)*d)}},hh.prototype.findMatches=function(p,v,d){for(var y=this.tileID.canonical.z<v.canonical.z?1:Math.pow(2,this.tileID.canonical.z-v.canonical.z),S=0;S<p.length;S++){var C=p.get(S);if(!C.crossTileID){var I=this.indexedSymbolInstances[C.key];if(I)for(var O=this.getScaledCoordinates(C,v),z=0,X=I;z<X.length;z+=1){var ne=X[z];if(Math.abs(ne.coord.x-O.x)<=y&&Math.abs(ne.coord.y-O.y)<=y&&!d[ne.crossTileID]){d[ne.crossTileID]=!0,C.crossTileID=ne.crossTileID;break}}}}};var wo=function(){this.maxCrossTileID=0};wo.prototype.generate=function(){return++this.maxCrossTileID};var ml=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};ml.prototype.handleWrapJump=function(p){var v=Math.round((p-this.lng)/360);if(v!==0)for(var d in this.indexes){var y=this.indexes[d],S={};for(var C in y){var I=y[C];I.tileID=I.tileID.unwrapTo(I.tileID.wrap+v),S[I.tileID.key]=I}this.indexes[d]=S}this.lng=p},ml.prototype.addBucket=function(p,v,d){if(this.indexes[p.overscaledZ]&&this.indexes[p.overscaledZ][p.key]){if(this.indexes[p.overscaledZ][p.key].bucketInstanceId===v.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(p.overscaledZ,this.indexes[p.overscaledZ][p.key])}for(var y=0;y<v.symbolInstances.length;y++)v.symbolInstances.get(y).crossTileID=0;this.usedCrossTileIDs[p.overscaledZ]||(this.usedCrossTileIDs[p.overscaledZ]={});var S=this.usedCrossTileIDs[p.overscaledZ];for(var C in this.indexes){var I=this.indexes[C];if(Number(C)>p.overscaledZ)for(var O in I){var z=I[O];z.tileID.isChildOf(p)&&z.findMatches(v.symbolInstances,p,S)}else{var X=I[p.scaledTo(Number(C)).key];X&&X.findMatches(v.symbolInstances,p,S)}}for(var ne=0;ne<v.symbolInstances.length;ne++){var ae=v.symbolInstances.get(ne);ae.crossTileID||(ae.crossTileID=d.generate(),S[ae.crossTileID]=!0)}return this.indexes[p.overscaledZ]===void 0&&(this.indexes[p.overscaledZ]={}),this.indexes[p.overscaledZ][p.key]=new hh(p,v.symbolInstances,v.bucketInstanceId),!0},ml.prototype.removeBucketCrossTileIDs=function(p,v){for(var d in v.indexedSymbolInstances)for(var y=0,S=v.indexedSymbolInstances[d];y<S.length;y+=1)delete this.usedCrossTileIDs[p][S[y].crossTileID]},ml.prototype.removeStaleBuckets=function(p){var v=!1;for(var d in this.indexes){var y=this.indexes[d];for(var S in y)p[y[S].bucketInstanceId]||(this.removeBucketCrossTileIDs(d,y[S]),delete y[S],v=!0)}return v};var gl=function(){this.layerIndexes={},this.crossTileIDs=new wo,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};gl.prototype.addLayer=function(p,v,d){var y=this.layerIndexes[p.id];y===void 0&&(y=this.layerIndexes[p.id]=new ml);var S=!1,C={};y.handleWrapJump(d);for(var I=0,O=v;I<O.length;I+=1){var z=O[I],X=z.getBucket(p);X&&p.id===X.layerIds[0]&&(X.bucketInstanceId||(X.bucketInstanceId=++this.maxBucketInstanceId),y.addBucket(z.tileID,X,this.crossTileIDs)&&(S=!0),C[X.bucketInstanceId]=!0)}return y.removeStaleBuckets(C)&&(S=!0),S},gl.prototype.pruneUnusedLayers=function(p){var v={};for(var d in p.forEach(function(y){v[y]=!0}),this.layerIndexes)v[d]||delete this.layerIndexes[d]};var yu=function(p,v){return a.emitValidationErrors(p,v&&v.filter(function(d){return d.identifier!=="source.canvas"}))},xu=a.pick(Pr,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Gu=a.pick(Pr,["setCenter","setZoom","setBearing","setPitch"]),bf=function(){var p={},v=a.styleSpec.$version;for(var d in a.styleSpec.$root){var y,S=a.styleSpec.$root[d];S.required&&(y=d==="version"?v:S.type==="array"?[]:{})!=null&&(p[d]=y)}return p}(),ms=function(p){function v(d,y){var S=this;y===void 0&&(y={}),p.call(this),this.map=d,this.dispatcher=new ke(Dt(),this),this.imageManager=new L,this.imageManager.setEventedParent(this),this.glyphManager=new Ie(d._requestManager,y.localIdeographFontFamily),this.lineAtlas=new ye(256,512),this.crossTileSymbolIndex=new gl,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new a.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",a.getReferrer());var C=this;this._rtlTextPluginCallback=v.registerForPluginStateChange(function(I){C.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:I.pluginStatus,pluginURL:I.pluginURL},function(O,z){if(a.triggerPluginCompletionEvent(O),z&&z.every(function(ne){return ne}))for(var X in C.sourceCaches)C.sourceCaches[X].reload()})}),this.on("data",function(I){if(I.dataType==="source"&&I.sourceDataType==="metadata"){var O=S.sourceCaches[I.sourceId];if(O){var z=O.getSource();if(z&&z.vectorLayerIds)for(var X in S._layers){var ne=S._layers[X];ne.source===z.id&&S._validateLayer(ne)}}}})}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.loadURL=function(d,y){var S=this;y===void 0&&(y={}),this.fire(new a.Event("dataloading",{dataType:"style"}));var C=typeof y.validate=="boolean"?y.validate:!a.isMapboxURL(d);d=this.map._requestManager.normalizeStyleURL(d,y.accessToken);var I=this.map._requestManager.transformRequest(d,a.ResourceType.Style);this._request=a.getJSON(I,function(O,z){S._request=null,O?S.fire(new a.ErrorEvent(O)):z&&S._load(z,C)})},v.prototype.loadJSON=function(d,y){var S=this;y===void 0&&(y={}),this.fire(new a.Event("dataloading",{dataType:"style"})),this._request=a.browser.frame(function(){S._request=null,S._load(d,y.validate!==!1)})},v.prototype.loadEmpty=function(){this.fire(new a.Event("dataloading",{dataType:"style"})),this._load(bf,!1)},v.prototype._load=function(d,y){if(!y||!yu(this,a.validateStyle(d))){for(var S in this._loaded=!0,this.stylesheet=d,d.sources)this.addSource(S,d.sources[S],{validate:!1});d.sprite?this._loadSprite(d.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(d.glyphs);var C=Rr(this.stylesheet.layers);this._order=C.map(function(X){return X.id}),this._layers={},this._serializedLayers={};for(var I=0,O=C;I<O.length;I+=1){var z=O[I];(z=a.createStyleLayer(z)).setEventedParent(this,{layer:{id:z.id}}),this._layers[z.id]=z,this._serializedLayers[z.id]=z.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new le(this.stylesheet.light),this.fire(new a.Event("data",{dataType:"style"})),this.fire(new a.Event("style.load"))}},v.prototype._loadSprite=function(d){var y=this;this._spriteRequest=function(S,C,I){var O,z,X,ne=a.browser.devicePixelRatio>1?"@2x":"",ae=a.getJSON(C.transformRequest(C.normalizeSpriteURL(S,ne,".json"),a.ResourceType.SpriteJSON),function(be,Fe){ae=null,X||(X=be,O=Fe,we())}),oe=a.getImage(C.transformRequest(C.normalizeSpriteURL(S,ne,".png"),a.ResourceType.SpriteImage),function(be,Fe){oe=null,X||(X=be,z=Fe,we())});function we(){if(X)I(X);else if(O&&z){var be=a.browser.getImageData(z),Fe={};for(var _e in O){var De=O[_e],Xe=De.width,ot=De.height,Ct=De.x,mt=De.y,kt=De.sdf,qt=De.pixelRatio,Tr=De.stretchX,yr=De.stretchY,$r=De.content,vn=new a.RGBAImage({width:Xe,height:ot});a.RGBAImage.copy(be,vn,{x:Ct,y:mt},{x:0,y:0},{width:Xe,height:ot}),Fe[_e]={data:vn,pixelRatio:qt,sdf:kt,stretchX:Tr,stretchY:yr,content:$r}}I(null,Fe)}}return{cancel:function(){ae&&(ae.cancel(),ae=null),oe&&(oe.cancel(),oe=null)}}}(d,this.map._requestManager,function(S,C){if(y._spriteRequest=null,S)y.fire(new a.ErrorEvent(S));else if(C)for(var I in C)y.imageManager.addImage(I,C[I]);y.imageManager.setLoaded(!0),y._availableImages=y.imageManager.listImages(),y.dispatcher.broadcast("setImages",y._availableImages),y.fire(new a.Event("data",{dataType:"style"}))})},v.prototype._validateLayer=function(d){var y=this.sourceCaches[d.source];if(y){var S=d.sourceLayer;if(S){var C=y.getSource();(C.type==="geojson"||C.vectorLayerIds&&C.vectorLayerIds.indexOf(S)===-1)&&this.fire(new a.ErrorEvent(new Error('Source layer "'+S+'" does not exist on source "'+C.id+'" as specified by style layer "'+d.id+'"')))}}},v.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var d in this.sourceCaches)if(!this.sourceCaches[d].loaded())return!1;return!!this.imageManager.isLoaded()},v.prototype._serializeLayers=function(d){for(var y=[],S=0,C=d;S<C.length;S+=1){var I=this._layers[C[S]];I.type!=="custom"&&y.push(I.serialize())}return y},v.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var d in this.sourceCaches)if(this.sourceCaches[d].hasTransition())return!0;for(var y in this._layers)if(this._layers[y].hasTransition())return!0;return!1},v.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},v.prototype.update=function(d){if(this._loaded){var y=this._changed;if(this._changed){var S=Object.keys(this._updatedLayers),C=Object.keys(this._removedLayers);for(var I in(S.length||C.length)&&this._updateWorkerLayers(S,C),this._updatedSources){var O=this._updatedSources[I];O==="reload"?this._reloadSource(I):O==="clear"&&this._clearSource(I)}for(var z in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[z].updateTransitions(d);this.light.updateTransitions(d),this._resetUpdates()}var X={};for(var ne in this.sourceCaches){var ae=this.sourceCaches[ne];X[ne]=ae.used,ae.used=!1}for(var oe=0,we=this._order;oe<we.length;oe+=1){var be=this._layers[we[oe]];be.recalculate(d,this._availableImages),!be.isHidden(d.zoom)&&be.source&&(this.sourceCaches[be.source].used=!0)}for(var Fe in X){var _e=this.sourceCaches[Fe];X[Fe]!==_e.used&&_e.fire(new a.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:Fe}))}this.light.recalculate(d),this.z=d.zoom,y&&this.fire(new a.Event("data",{dataType:"style"}))}},v.prototype._updateTilesForChangedImages=function(){var d=Object.keys(this._changedImages);if(d.length){for(var y in this.sourceCaches)this.sourceCaches[y].reloadTilesForDependencies(["icons","patterns"],d);this._changedImages={}}},v.prototype._updateWorkerLayers=function(d,y){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(d),removedIds:y})},v.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},v.prototype.setState=function(d){var y=this;if(this._checkLoaded(),yu(this,a.validateStyle(d)))return!1;(d=a.clone$1(d)).layers=Rr(d.layers);var S=function(I,O){if(!I)return[{command:Pr.setStyle,args:[O]}];var z=[];try{if(!a.deepEqual(I.version,O.version))return[{command:Pr.setStyle,args:[O]}];a.deepEqual(I.center,O.center)||z.push({command:Pr.setCenter,args:[O.center]}),a.deepEqual(I.zoom,O.zoom)||z.push({command:Pr.setZoom,args:[O.zoom]}),a.deepEqual(I.bearing,O.bearing)||z.push({command:Pr.setBearing,args:[O.bearing]}),a.deepEqual(I.pitch,O.pitch)||z.push({command:Pr.setPitch,args:[O.pitch]}),a.deepEqual(I.sprite,O.sprite)||z.push({command:Pr.setSprite,args:[O.sprite]}),a.deepEqual(I.glyphs,O.glyphs)||z.push({command:Pr.setGlyphs,args:[O.glyphs]}),a.deepEqual(I.transition,O.transition)||z.push({command:Pr.setTransition,args:[O.transition]}),a.deepEqual(I.light,O.light)||z.push({command:Pr.setLight,args:[O.light]});var X={},ne=[];(function(oe,we,be,Fe){var _e;for(_e in we=we||{},oe=oe||{})oe.hasOwnProperty(_e)&&(we.hasOwnProperty(_e)||Lr(_e,be,Fe));for(_e in we)we.hasOwnProperty(_e)&&(oe.hasOwnProperty(_e)?a.deepEqual(oe[_e],we[_e])||(oe[_e].type==="geojson"&&we[_e].type==="geojson"&&Gi(oe,we,_e)?be.push({command:Pr.setGeoJSONSourceData,args:[_e,we[_e].data]}):ci(_e,we,be,Fe)):Hn(_e,we,be))})(I.sources,O.sources,ne,X);var ae=[];I.layers&&I.layers.forEach(function(oe){X[oe.source]?z.push({command:Pr.removeLayer,args:[oe.id]}):ae.push(oe)}),z=z.concat(ne),function(oe,we,be){we=we||[];var Fe,_e,De,Xe,ot,Ct,mt,kt=(oe=oe||[]).map(_i),qt=we.map(_i),Tr=oe.reduce(Gn,{}),yr=we.reduce(Gn,{}),$r=kt.slice(),vn=Object.create(null);for(Fe=0,_e=0;Fe<kt.length;Fe++)yr.hasOwnProperty(De=kt[Fe])?_e++:(be.push({command:Pr.removeLayer,args:[De]}),$r.splice($r.indexOf(De,_e),1));for(Fe=0,_e=0;Fe<qt.length;Fe++)$r[$r.length-1-Fe]!==(De=qt[qt.length-1-Fe])&&(Tr.hasOwnProperty(De)?(be.push({command:Pr.removeLayer,args:[De]}),$r.splice($r.lastIndexOf(De,$r.length-_e),1)):_e++,be.push({command:Pr.addLayer,args:[yr[De],Ct=$r[$r.length-Fe]]}),$r.splice($r.length-Fe,0,De),vn[De]=!0);for(Fe=0;Fe<qt.length;Fe++)if(Xe=Tr[De=qt[Fe]],ot=yr[De],!vn[De]&&!a.deepEqual(Xe,ot))if(a.deepEqual(Xe.source,ot.source)&&a.deepEqual(Xe["source-layer"],ot["source-layer"])&&a.deepEqual(Xe.type,ot.type)){for(mt in oi(Xe.layout,ot.layout,be,De,null,Pr.setLayoutProperty),oi(Xe.paint,ot.paint,be,De,null,Pr.setPaintProperty),a.deepEqual(Xe.filter,ot.filter)||be.push({command:Pr.setFilter,args:[De,ot.filter]}),a.deepEqual(Xe.minzoom,ot.minzoom)&&a.deepEqual(Xe.maxzoom,ot.maxzoom)||be.push({command:Pr.setLayerZoomRange,args:[De,ot.minzoom,ot.maxzoom]}),Xe)Xe.hasOwnProperty(mt)&&mt!=="layout"&&mt!=="paint"&&mt!=="filter"&&mt!=="metadata"&&mt!=="minzoom"&&mt!=="maxzoom"&&(mt.indexOf("paint.")===0?oi(Xe[mt],ot[mt],be,De,mt.slice(6),Pr.setPaintProperty):a.deepEqual(Xe[mt],ot[mt])||be.push({command:Pr.setLayerProperty,args:[De,mt,ot[mt]]}));for(mt in ot)ot.hasOwnProperty(mt)&&!Xe.hasOwnProperty(mt)&&mt!=="layout"&&mt!=="paint"&&mt!=="filter"&&mt!=="metadata"&&mt!=="minzoom"&&mt!=="maxzoom"&&(mt.indexOf("paint.")===0?oi(Xe[mt],ot[mt],be,De,mt.slice(6),Pr.setPaintProperty):a.deepEqual(Xe[mt],ot[mt])||be.push({command:Pr.setLayerProperty,args:[De,mt,ot[mt]]}))}else be.push({command:Pr.removeLayer,args:[De]}),Ct=$r[$r.lastIndexOf(De)+1],be.push({command:Pr.addLayer,args:[ot,Ct]})}(ae,O.layers,z)}catch(oe){console.warn("Unable to compute style diff:",oe),z=[{command:Pr.setStyle,args:[O]}]}return z}(this.serialize(),d).filter(function(I){return!(I.command in Gu)});if(S.length===0)return!1;var C=S.filter(function(I){return!(I.command in xu)});if(C.length>0)throw new Error("Unimplemented: "+C.map(function(I){return I.command}).join(", ")+".");return S.forEach(function(I){I.command!=="setTransition"&&y[I.command].apply(y,I.args)}),this.stylesheet=d,!0},v.prototype.addImage=function(d,y){if(this.getImage(d))return this.fire(new a.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(d,y),this._afterImageUpdated(d)},v.prototype.updateImage=function(d,y){this.imageManager.updateImage(d,y)},v.prototype.getImage=function(d){return this.imageManager.getImage(d)},v.prototype.removeImage=function(d){if(!this.getImage(d))return this.fire(new a.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(d),this._afterImageUpdated(d)},v.prototype._afterImageUpdated=function(d){this._availableImages=this.imageManager.listImages(),this._changedImages[d]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.Event("data",{dataType:"style"}))},v.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},v.prototype.addSource=function(d,y,S){var C=this;if(S===void 0&&(S={}),this._checkLoaded(),this.sourceCaches[d]!==void 0)throw new Error("There is already a source with this ID");if(!y.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(y).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(y.type)>=0&&this._validate(a.validateStyle.source,"sources."+d,y,null,S))){this.map&&this.map._collectResourceTiming&&(y.collectResourceTiming=!0);var I=this.sourceCaches[d]=new Ce(d,y,this.dispatcher);I.style=this,I.setEventedParent(this,function(){return{isSourceLoaded:C.loaded(),source:I.serialize(),sourceId:d}}),I.onAdd(this.map),this._changed=!0}},v.prototype.removeSource=function(d){if(this._checkLoaded(),this.sourceCaches[d]===void 0)throw new Error("There is no source with this ID");for(var y in this._layers)if(this._layers[y].source===d)return this.fire(new a.ErrorEvent(new Error('Source "'+d+'" cannot be removed while layer "'+y+'" is using it.')));var S=this.sourceCaches[d];delete this.sourceCaches[d],delete this._updatedSources[d],S.fire(new a.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:d})),S.setEventedParent(null),S.clearTiles(),S.onRemove&&S.onRemove(this.map),this._changed=!0},v.prototype.setGeoJSONSourceData=function(d,y){this._checkLoaded(),this.sourceCaches[d].getSource().setData(y),this._changed=!0},v.prototype.getSource=function(d){return this.sourceCaches[d]&&this.sourceCaches[d].getSource()},v.prototype.addLayer=function(d,y,S){S===void 0&&(S={}),this._checkLoaded();var C=d.id;if(this.getLayer(C))this.fire(new a.ErrorEvent(new Error('Layer with id "'+C+'" already exists on this map')));else{var I;if(d.type==="custom"){if(yu(this,a.validateCustomStyleLayer(d)))return;I=a.createStyleLayer(d)}else{if(typeof d.source=="object"&&(this.addSource(C,d.source),d=a.clone$1(d),d=a.extend(d,{source:C})),this._validate(a.validateStyle.layer,"layers."+C,d,{arrayIndex:-1},S))return;I=a.createStyleLayer(d),this._validateLayer(I),I.setEventedParent(this,{layer:{id:C}}),this._serializedLayers[I.id]=I.serialize()}var O=y?this._order.indexOf(y):this._order.length;if(y&&O===-1)this.fire(new a.ErrorEvent(new Error('Layer with id "'+y+'" does not exist on this map.')));else{if(this._order.splice(O,0,C),this._layerOrderChanged=!0,this._layers[C]=I,this._removedLayers[C]&&I.source&&I.type!=="custom"){var z=this._removedLayers[C];delete this._removedLayers[C],z.type!==I.type?this._updatedSources[I.source]="clear":(this._updatedSources[I.source]="reload",this.sourceCaches[I.source].pause())}this._updateLayer(I),I.onAdd&&I.onAdd(this.map)}}},v.prototype.moveLayer=function(d,y){if(this._checkLoaded(),this._changed=!0,this._layers[d]){if(d!==y){var S=this._order.indexOf(d);this._order.splice(S,1);var C=y?this._order.indexOf(y):this._order.length;y&&C===-1?this.fire(new a.ErrorEvent(new Error('Layer with id "'+y+'" does not exist on this map.'))):(this._order.splice(C,0,d),this._layerOrderChanged=!0)}}else this.fire(new a.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be moved.")))},v.prototype.removeLayer=function(d){this._checkLoaded();var y=this._layers[d];if(y){y.setEventedParent(null);var S=this._order.indexOf(d);this._order.splice(S,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[d]=y,delete this._layers[d],delete this._serializedLayers[d],delete this._updatedLayers[d],delete this._updatedPaintProps[d],y.onRemove&&y.onRemove(this.map)}else this.fire(new a.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be removed.")))},v.prototype.getLayer=function(d){return this._layers[d]},v.prototype.hasLayer=function(d){return d in this._layers},v.prototype.setLayerZoomRange=function(d,y,S){this._checkLoaded();var C=this.getLayer(d);C?C.minzoom===y&&C.maxzoom===S||(y!=null&&(C.minzoom=y),S!=null&&(C.maxzoom=S),this._updateLayer(C)):this.fire(new a.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot have zoom extent.")))},v.prototype.setFilter=function(d,y,S){S===void 0&&(S={}),this._checkLoaded();var C=this.getLayer(d);if(C){if(!a.deepEqual(C.filter,y))return y==null?(C.filter=void 0,void this._updateLayer(C)):void(this._validate(a.validateStyle.filter,"layers."+C.id+".filter",y,null,S)||(C.filter=a.clone$1(y),this._updateLayer(C)))}else this.fire(new a.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be filtered.")))},v.prototype.getFilter=function(d){return a.clone$1(this.getLayer(d).filter)},v.prototype.setLayoutProperty=function(d,y,S,C){C===void 0&&(C={}),this._checkLoaded();var I=this.getLayer(d);I?a.deepEqual(I.getLayoutProperty(y),S)||(I.setLayoutProperty(y,S,C),this._updateLayer(I)):this.fire(new a.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be styled.")))},v.prototype.getLayoutProperty=function(d,y){var S=this.getLayer(d);if(S)return S.getLayoutProperty(y);this.fire(new a.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style.")))},v.prototype.setPaintProperty=function(d,y,S,C){C===void 0&&(C={}),this._checkLoaded();var I=this.getLayer(d);I?a.deepEqual(I.getPaintProperty(y),S)||(I.setPaintProperty(y,S,C)&&this._updateLayer(I),this._changed=!0,this._updatedPaintProps[d]=!0):this.fire(new a.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be styled.")))},v.prototype.getPaintProperty=function(d,y){return this.getLayer(d).getPaintProperty(y)},v.prototype.setFeatureState=function(d,y){this._checkLoaded();var S=d.source,C=d.sourceLayer,I=this.sourceCaches[S];if(I!==void 0){var O=I.getSource().type;O==="geojson"&&C?this.fire(new a.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):O!=="vector"||C?(d.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided."))),I.setFeatureState(C,d.id,y)):this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new a.ErrorEvent(new Error("The source '"+S+"' does not exist in the map's style.")))},v.prototype.removeFeatureState=function(d,y){this._checkLoaded();var S=d.source,C=this.sourceCaches[S];if(C!==void 0){var I=C.getSource().type,O=I==="vector"?d.sourceLayer:void 0;I!=="vector"||O?y&&typeof d.id!="string"&&typeof d.id!="number"?this.fire(new a.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):C.removeFeatureState(O,d.id,y):this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new a.ErrorEvent(new Error("The source '"+S+"' does not exist in the map's style.")))},v.prototype.getFeatureState=function(d){this._checkLoaded();var y=d.source,S=d.sourceLayer,C=this.sourceCaches[y];if(C!==void 0){if(C.getSource().type!=="vector"||S)return d.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided."))),C.getFeatureState(S,d.id);this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new a.ErrorEvent(new Error("The source '"+y+"' does not exist in the map's style.")))},v.prototype.getTransition=function(){return a.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},v.prototype.serialize=function(){return a.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:a.mapObject(this.sourceCaches,function(d){return d.serialize()}),layers:this._serializeLayers(this._order)},function(d){return d!==void 0})},v.prototype._updateLayer=function(d){this._updatedLayers[d.id]=!0,d.source&&!this._updatedSources[d.source]&&this.sourceCaches[d.source].getSource().type!=="raster"&&(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause()),this._changed=!0},v.prototype._flattenAndSortRenderedFeatures=function(d){for(var y=this,S=function(Tr){return y._layers[Tr].type==="fill-extrusion"},C={},I=[],O=this._order.length-1;O>=0;O--){var z=this._order[O];if(S(z)){C[z]=O;for(var X=0,ne=d;X<ne.length;X+=1){var ae=ne[X][z];if(ae)for(var oe=0,we=ae;oe<we.length;oe+=1)I.push(we[oe])}}}I.sort(function(Tr,yr){return yr.intersectionZ-Tr.intersectionZ});for(var be=[],Fe=this._order.length-1;Fe>=0;Fe--){var _e=this._order[Fe];if(S(_e))for(var De=I.length-1;De>=0;De--){var Xe=I[De].feature;if(C[Xe.layer.id]<Fe)break;be.push(Xe),I.pop()}else for(var ot=0,Ct=d;ot<Ct.length;ot+=1){var mt=Ct[ot][_e];if(mt)for(var kt=0,qt=mt;kt<qt.length;kt+=1)be.push(qt[kt].feature)}}return be},v.prototype.queryRenderedFeatures=function(d,y,S){y&&y.filter&&this._validate(a.validateStyle.filter,"queryRenderedFeatures.filter",y.filter,null,y);var C={};if(y&&y.layers){if(!Array.isArray(y.layers))return this.fire(new a.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var I=0,O=y.layers;I<O.length;I+=1){var z=O[I],X=this._layers[z];if(!X)return this.fire(new a.ErrorEvent(new Error("The layer '"+z+"' does not exist in the map's style and cannot be queried for features."))),[];C[X.source]=!0}}var ne=[];for(var ae in y.availableImages=this._availableImages,this.sourceCaches)y.layers&&!C[ae]||ne.push(pn(this.sourceCaches[ae],this._layers,this._serializedLayers,d,y,S));return this.placement&&ne.push(function(oe,we,be,Fe,_e,De,Xe){for(var ot={},Ct=De.queryRenderedSymbols(Fe),mt=[],kt=0,qt=Object.keys(Ct).map(Number);kt<qt.length;kt+=1)mt.push(Xe[qt[kt]]);mt.sort(gi);for(var Tr=function(){var xn=$r[yr],Si=xn.featureIndex.lookupSymbolFeatures(Ct[xn.bucketInstanceId],we,xn.bucketIndex,xn.sourceLayerIndex,_e.filter,_e.layers,_e.availableImages,oe);for(var Yr in Si){var Un=ot[Yr]=ot[Yr]||[],Kn=Si[Yr];Kn.sort(function(Yn,kn){var In=xn.featureSortOrder;if(In){var $a=In.indexOf(Yn.featureIndex);return In.indexOf(kn.featureIndex)-$a}return kn.featureIndex-Yn.featureIndex});for(var Bn=0,On=Kn;Bn<On.length;Bn+=1)Un.push(On[Bn])}},yr=0,$r=mt;yr<$r.length;yr+=1)Tr();var vn=function(xn){ot[xn].forEach(function(Si){var Yr=Si.feature,Un=be[oe[xn].source].getFeatureState(Yr.layer["source-layer"],Yr.id);Yr.source=Yr.layer.source,Yr.layer["source-layer"]&&(Yr.sourceLayer=Yr.layer["source-layer"]),Yr.state=Un})};for(var bn in ot)vn(bn);return ot}(this._layers,this._serializedLayers,this.sourceCaches,d,y,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(ne)},v.prototype.querySourceFeatures=function(d,y){y&&y.filter&&this._validate(a.validateStyle.filter,"querySourceFeatures.filter",y.filter,null,y);var S=this.sourceCaches[d];return S?function(C,I){for(var O=C.getRenderableIds().map(function(we){return C.getTileByID(we)}),z=[],X={},ne=0;ne<O.length;ne++){var ae=O[ne],oe=ae.tileID.canonical.key;X[oe]||(X[oe]=!0,ae.querySourceFeatures(z,I))}return z}(S,y):[]},v.prototype.addSourceType=function(d,y,S){return v.getSourceType(d)?S(new Error('A source type called "'+d+'" already exists.')):(v.setSourceType(d,y),y.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:d,url:y.workerSourceURL},S):S(null,null))},v.prototype.getLight=function(){return this.light.getLight()},v.prototype.setLight=function(d,y){y===void 0&&(y={}),this._checkLoaded();var S=this.light.getLight(),C=!1;for(var I in d)if(!a.deepEqual(d[I],S[I])){C=!0;break}if(C){var O={now:a.browser.now(),transition:a.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(d,y),this.light.updateTransitions(O)}},v.prototype._validate=function(d,y,S,C,I){return I===void 0&&(I={}),(!I||I.validate!==!1)&&yu(this,d.call(a.validateStyle,a.extend({key:y,style:this.serialize(),value:S,styleSpec:a.styleSpec},C)))},v.prototype._remove=function(){for(var d in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),a.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[d].setEventedParent(null);for(var y in this.sourceCaches)this.sourceCaches[y].clearTiles(),this.sourceCaches[y].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},v.prototype._clearSource=function(d){this.sourceCaches[d].clearTiles()},v.prototype._reloadSource=function(d){this.sourceCaches[d].resume(),this.sourceCaches[d].reload()},v.prototype._updateSources=function(d){for(var y in this.sourceCaches)this.sourceCaches[y].update(d)},v.prototype._generateCollisionBoxes=function(){for(var d in this.sourceCaches)this._reloadSource(d)},v.prototype._updatePlacement=function(d,y,S,C,I){I===void 0&&(I=!1);for(var O=!1,z=!1,X={},ne=0,ae=this._order;ne<ae.length;ne+=1){var oe=this._layers[ae[ne]];if(oe.type==="symbol"){if(!X[oe.source]){var we=this.sourceCaches[oe.source];X[oe.source]=we.getRenderableIds(!0).map(function(Xe){return we.getTileByID(Xe)}).sort(function(Xe,ot){return ot.tileID.overscaledZ-Xe.tileID.overscaledZ||(Xe.tileID.isLessThan(ot.tileID)?-1:1)})}var be=this.crossTileSymbolIndex.addLayer(oe,X[oe.source],d.center.lng);O=O||be}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((I=I||this._layerOrderChanged||S===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.browser.now(),d.zoom))&&(this.pauseablePlacement=new xf(d,this._order,I,y,S,C,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,X),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.browser.now()),z=!0),O&&this.pauseablePlacement.placement.setStale()),z||O)for(var Fe=0,_e=this._order;Fe<_e.length;Fe+=1){var De=this._layers[_e[Fe]];De.type==="symbol"&&this.placement.updateLayerOpacities(De,X[De.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.browser.now())},v.prototype._releaseSymbolFadeTiles=function(){for(var d in this.sourceCaches)this.sourceCaches[d].releaseSymbolFadeTiles()},v.prototype.getImages=function(d,y,S){this.imageManager.getImages(y.icons,S),this._updateTilesForChangedImages();var C=this.sourceCaches[y.source];C&&C.setDependencies(y.tileID.key,y.type,y.icons)},v.prototype.getGlyphs=function(d,y,S){this.glyphManager.getGlyphs(y.stacks,S)},v.prototype.getResource=function(d,y,S){return a.makeRequest(y,S)},v}(a.Evented);ms.getSourceType=function(p){return Ar[p]},ms.setSourceType=function(p,v){Ar[p]=v},ms.registerForPluginStateChange=a.registerForPluginStateChange;var Ra=a.createLayout([{name:"a_pos",type:"Int16",components:2}]),_l=Xi(`#ifdef GL_ES
|
|
precision mediump float;
|
|
#else
|
|
#if !defined(lowp)
|
|
#define lowp
|
|
#endif
|
|
#if !defined(mediump)
|
|
#define mediump
|
|
#endif
|
|
#if !defined(highp)
|
|
#define highp
|
|
#endif
|
|
#endif`,`#ifdef GL_ES
|
|
precision highp float;
|
|
#else
|
|
#if !defined(lowp)
|
|
#define lowp
|
|
#endif
|
|
#if !defined(mediump)
|
|
#define mediump
|
|
#endif
|
|
#if !defined(highp)
|
|
#define highp
|
|
#endif
|
|
#endif
|
|
vec2 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(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
|
|
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}`),Wu=Xi(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),ph=Xi(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),N1=Xi(`varying vec3 v_data;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define mediump float radius
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define highp vec4 stroke_color
|
|
#pragma mapbox: define mediump float stroke_width
|
|
#pragma mapbox: define lowp float stroke_opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize mediump float radius
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize highp vec4 stroke_color
|
|
#pragma mapbox: initialize mediump float stroke_width
|
|
#pragma mapbox: initialize lowp float stroke_opacity
|
|
vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define mediump float radius
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define highp vec4 stroke_color
|
|
#pragma mapbox: define mediump float stroke_width
|
|
#pragma mapbox: define lowp float stroke_opacity
|
|
void main(void) {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize mediump float radius
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize highp vec4 stroke_color
|
|
#pragma mapbox: initialize mediump float stroke_width
|
|
#pragma mapbox: initialize lowp float stroke_opacity
|
|
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),dh=Xi("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Cp=Xi(`uniform highp float u_intensity;varying vec2 v_extrude;
|
|
#pragma mapbox: define highp float weight
|
|
#define GAUSS_COEF 0.3989422804014327
|
|
void main() {
|
|
#pragma mapbox: initialize highp float weight
|
|
float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
|
|
#pragma mapbox: define highp float weight
|
|
#pragma mapbox: define mediump float radius
|
|
const highp float ZERO=1.0/255.0/16.0;
|
|
#define GAUSS_COEF 0.3989422804014327
|
|
void main(void) {
|
|
#pragma mapbox: initialize highp float weight
|
|
#pragma mapbox: initialize mediump float radius
|
|
vec2 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;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),Rp=Xi(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(0.0);
|
|
#endif
|
|
}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),Ip=Xi("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),U1=Xi("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-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(0.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);}"),z1=Xi("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),O0=Xi(`#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
gl_FragColor=color*opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
gl_Position=u_matrix*vec4(a_pos,0,1);}`),Ef=Xi(`varying vec2 v_pos;
|
|
#pragma mapbox: define highp vec4 outline_color
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 outline_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
|
|
#pragma mapbox: define highp vec4 outline_color
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 outline_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),bu=Xi(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),$1=Xi(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),Co=Xi(`varying vec4 v_color;void main() {gl_FragColor=v_color;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;
|
|
#pragma mapbox: define highp float base
|
|
#pragma mapbox: define highp float height
|
|
#pragma mapbox: define highp vec4 color
|
|
void main() {
|
|
#pragma mapbox: initialize highp float base
|
|
#pragma mapbox: initialize highp float height
|
|
#pragma mapbox: initialize highp vec4 color
|
|
vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),Ql=Xi(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|
#pragma mapbox: define lowp float base
|
|
#pragma mapbox: define lowp float height
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float base
|
|
#pragma mapbox: initialize lowp float height
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|
#pragma mapbox: define lowp float base
|
|
#pragma mapbox: define lowp float height
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float base
|
|
#pragma mapbox: initialize lowp float height
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
|
|
? a_pos
|
|
: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),yl=Xi(`#ifdef GL_ES
|
|
precision highp float;
|
|
#endif
|
|
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);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((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),Cs=Xi(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
|
|
#define PI 3.141592653589793
|
|
void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),xl=Xi(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`
|
|
#define scale 0.015873016
|
|
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define mediump float gapwidth
|
|
#pragma mapbox: define lowp float offset
|
|
#pragma mapbox: define mediump float width
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
#pragma mapbox: initialize lowp float offset
|
|
#pragma mapbox: initialize mediump float width
|
|
float 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;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),js=Xi(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`
|
|
#define scale 0.015873016
|
|
attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define mediump float gapwidth
|
|
#pragma mapbox: define lowp float offset
|
|
#pragma mapbox: define mediump float width
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
#pragma mapbox: initialize lowp float offset
|
|
#pragma mapbox: initialize mediump float width
|
|
float 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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),Xu=Xi(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`
|
|
#define scale 0.015873016
|
|
#define LINE_DISTANCE_SCALE 2.0
|
|
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp float offset
|
|
#pragma mapbox: define mediump float gapwidth
|
|
#pragma mapbox: define mediump float width
|
|
#pragma mapbox: define lowp float floorwidth
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize lowp float offset
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
#pragma mapbox: initialize mediump float width
|
|
#pragma mapbox: initialize lowp float floorwidth
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
float 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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),Rs=Xi(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define mediump float width
|
|
#pragma mapbox: define lowp float floorwidth
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump float width
|
|
#pragma mapbox: initialize lowp float floorwidth
|
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`
|
|
#define scale 0.015873016
|
|
#define LINE_DISTANCE_SCALE 2.0
|
|
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define mediump float gapwidth
|
|
#pragma mapbox: define lowp float offset
|
|
#pragma mapbox: define mediump float width
|
|
#pragma mapbox: define lowp float floorwidth
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
#pragma mapbox: initialize lowp float offset
|
|
#pragma mapbox: initialize mediump float width
|
|
#pragma mapbox: initialize lowp float floorwidth
|
|
float 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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),Yu=Xi(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(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);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),bl=Xi(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];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;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp 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);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`),V1=Xi(`#define SDF_PX 8.0
|
|
uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp float halo_width
|
|
#pragma mapbox: define lowp float halo_blur
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;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;varying vec2 v_data0;varying vec3 v_data1;
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp float halo_width
|
|
#pragma mapbox: define lowp float halo_blur
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];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;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp 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);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),j1=Xi(`#define SDF_PX 8.0
|
|
#define SDF 1.0
|
|
#define ICON 0.0
|
|
uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp float halo_width
|
|
#pragma mapbox: define lowp float halo_blur
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;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 vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp float halo_width
|
|
#pragma mapbox: define lowp float halo_blur
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];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;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp 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);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`);function Xi(p,v){var d=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,y=v.match(/attribute ([\w]+) ([\w]+)/g),S=p.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),C=v.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),I=C?C.concat(S):S,O={};return{fragmentSource:p=p.replace(d,function(z,X,ne,ae,oe){return O[oe]=!0,X==="define"?`
|
|
#ifndef HAS_UNIFORM_u_`+oe+`
|
|
varying `+ne+" "+ae+" "+oe+`;
|
|
#else
|
|
uniform `+ne+" "+ae+" u_"+oe+`;
|
|
#endif
|
|
`:`
|
|
#ifdef HAS_UNIFORM_u_`+oe+`
|
|
`+ne+" "+ae+" "+oe+" = u_"+oe+`;
|
|
#endif
|
|
`}),vertexSource:v=v.replace(d,function(z,X,ne,ae,oe){var we=ae==="float"?"vec2":"vec4",be=oe.match(/color/)?"color":we;return O[oe]?X==="define"?`
|
|
#ifndef HAS_UNIFORM_u_`+oe+`
|
|
uniform lowp float u_`+oe+`_t;
|
|
attribute `+ne+" "+we+" a_"+oe+`;
|
|
varying `+ne+" "+ae+" "+oe+`;
|
|
#else
|
|
uniform `+ne+" "+ae+" u_"+oe+`;
|
|
#endif
|
|
`:be==="vec4"?`
|
|
#ifndef HAS_UNIFORM_u_`+oe+`
|
|
`+oe+" = a_"+oe+`;
|
|
#else
|
|
`+ne+" "+ae+" "+oe+" = u_"+oe+`;
|
|
#endif
|
|
`:`
|
|
#ifndef HAS_UNIFORM_u_`+oe+`
|
|
`+oe+" = unpack_mix_"+be+"(a_"+oe+", u_"+oe+`_t);
|
|
#else
|
|
`+ne+" "+ae+" "+oe+" = u_"+oe+`;
|
|
#endif
|
|
`:X==="define"?`
|
|
#ifndef HAS_UNIFORM_u_`+oe+`
|
|
uniform lowp float u_`+oe+`_t;
|
|
attribute `+ne+" "+we+" a_"+oe+`;
|
|
#else
|
|
uniform `+ne+" "+ae+" u_"+oe+`;
|
|
#endif
|
|
`:be==="vec4"?`
|
|
#ifndef HAS_UNIFORM_u_`+oe+`
|
|
`+ne+" "+ae+" "+oe+" = a_"+oe+`;
|
|
#else
|
|
`+ne+" "+ae+" "+oe+" = u_"+oe+`;
|
|
#endif
|
|
`:`
|
|
#ifndef HAS_UNIFORM_u_`+oe+`
|
|
`+ne+" "+ae+" "+oe+" = unpack_mix_"+be+"(a_"+oe+", u_"+oe+`_t);
|
|
#else
|
|
`+ne+" "+ae+" "+oe+" = u_"+oe+`;
|
|
#endif
|
|
`}),staticAttributes:y,staticUniforms:I}}var k0=Object.freeze({__proto__:null,prelude:_l,background:Wu,backgroundPattern:ph,circle:N1,clippingMask:dh,heatmap:Cp,heatmapTexture:Rp,collisionBox:Ip,collisionCircle:U1,debug:z1,fill:O0,fillOutline:Ef,fillOutlinePattern:bu,fillPattern:$1,fillExtrusion:Co,fillExtrusionPattern:Ql,hillshadePrepare:yl,hillshade:Cs,line:xl,lineGradient:js,linePattern:Xu,lineSDF:Rs,raster:Yu,symbolIcon:bl,symbolSDF:V1,symbolTextAndIcon:j1}),vh=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function Mp(p){for(var v=[],d=0;d<p.length;d++)if(p[d]!==null){var y=p[d].split(" ");v.push(y.pop())}return v}vh.prototype.bind=function(p,v,d,y,S,C,I,O){this.context=p;for(var z=this.boundPaintVertexBuffers.length!==y.length,X=0;!z&&X<y.length;X++)this.boundPaintVertexBuffers[X]!==y[X]&&(z=!0);p.extVertexArrayObject&&this.vao&&this.boundProgram===v&&this.boundLayoutVertexBuffer===d&&!z&&this.boundIndexBuffer===S&&this.boundVertexOffset===C&&this.boundDynamicVertexBuffer===I&&this.boundDynamicVertexBuffer2===O?(p.bindVertexArrayOES.set(this.vao),I&&I.bind(),S&&S.dynamicDraw&&S.bind(),O&&O.bind()):this.freshBind(v,d,y,S,C,I,O)},vh.prototype.freshBind=function(p,v,d,y,S,C,I){var O,z=p.numAttributes,X=this.context,ne=X.gl;if(X.extVertexArrayObject)this.vao&&this.destroy(),this.vao=X.extVertexArrayObject.createVertexArrayOES(),X.bindVertexArrayOES.set(this.vao),O=0,this.boundProgram=p,this.boundLayoutVertexBuffer=v,this.boundPaintVertexBuffers=d,this.boundIndexBuffer=y,this.boundVertexOffset=S,this.boundDynamicVertexBuffer=C,this.boundDynamicVertexBuffer2=I;else{O=X.currentNumAttributes||0;for(var ae=z;ae<O;ae++)ne.disableVertexAttribArray(ae)}v.enableAttributes(ne,p);for(var oe=0,we=d;oe<we.length;oe+=1)we[oe].enableAttributes(ne,p);C&&C.enableAttributes(ne,p),I&&I.enableAttributes(ne,p),v.bind(),v.setVertexAttribPointers(ne,p,S);for(var be=0,Fe=d;be<Fe.length;be+=1){var _e=Fe[be];_e.bind(),_e.setVertexAttribPointers(ne,p,S)}C&&(C.bind(),C.setVertexAttribPointers(ne,p,S)),y&&y.bind(),I&&(I.bind(),I.setVertexAttribPointers(ne,p,S)),X.currentNumAttributes=z},vh.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var Ia=function(p,v,d,y,S,C){var I=p.gl;this.program=I.createProgram();for(var O=Mp(d.staticAttributes),z=y?y.getBinderAttributes():[],X=O.concat(z),ne=d.staticUniforms?Mp(d.staticUniforms):[],ae=y?y.getBinderUniforms():[],oe=[],we=0,be=ne.concat(ae);we<be.length;we+=1){var Fe=be[we];oe.indexOf(Fe)<0&&oe.push(Fe)}var _e=y?y.defines():[];C&&_e.push("#define OVERDRAW_INSPECTOR;");var De=_e.concat(_l.fragmentSource,d.fragmentSource).join(`
|
|
`),Xe=_e.concat(_l.vertexSource,d.vertexSource).join(`
|
|
`),ot=I.createShader(I.FRAGMENT_SHADER);if(I.isContextLost())this.failedToCreate=!0;else{I.shaderSource(ot,De),I.compileShader(ot),I.attachShader(this.program,ot);var Ct=I.createShader(I.VERTEX_SHADER);if(I.isContextLost())this.failedToCreate=!0;else{I.shaderSource(Ct,Xe),I.compileShader(Ct),I.attachShader(this.program,Ct),this.attributes={};var mt={};this.numAttributes=X.length;for(var kt=0;kt<this.numAttributes;kt++)X[kt]&&(I.bindAttribLocation(this.program,kt,X[kt]),this.attributes[X[kt]]=kt);I.linkProgram(this.program),I.deleteShader(Ct),I.deleteShader(ot);for(var qt=0;qt<oe.length;qt++){var Tr=oe[qt];if(Tr&&!mt[Tr]){var yr=I.getUniformLocation(this.program,Tr);yr&&(mt[Tr]=yr)}}this.fixedUniforms=S(p,mt),this.binderUniforms=y?y.getUniforms(p,mt):[]}}};function Pp(p,v,d){var y=1/Qi(d,1,v.transform.tileZoom),S=Math.pow(2,d.tileID.overscaledZ),C=d.tileSize*Math.pow(2,v.transform.tileZoom)/S,I=C*(d.tileID.canonical.x+d.tileID.wrap*S),O=C*d.tileID.canonical.y;return{u_image:0,u_texsize:d.imageAtlasTexture.size,u_scale:[y,p.fromScale,p.toScale],u_fade:p.t,u_pixel_coord_upper:[I>>16,O>>16],u_pixel_coord_lower:[65535&I,65535&O]}}Ia.prototype.draw=function(p,v,d,y,S,C,I,O,z,X,ne,ae,oe,we,be,Fe){var _e,De=p.gl;if(!this.failedToCreate){for(var Xe in p.program.set(this.program),p.setDepthMode(d),p.setStencilMode(y),p.setColorMode(S),p.setCullFace(C),this.fixedUniforms)this.fixedUniforms[Xe].set(I[Xe]);we&&we.setUniforms(p,this.binderUniforms,ae,{zoom:oe});for(var ot=(_e={},_e[De.LINES]=2,_e[De.TRIANGLES]=3,_e[De.LINE_STRIP]=1,_e)[v],Ct=0,mt=ne.get();Ct<mt.length;Ct+=1){var kt=mt[Ct],qt=kt.vaos||(kt.vaos={});(qt[O]||(qt[O]=new vh)).bind(p,this,z,we?we.getPaintVertexBuffers():[],X,kt.vertexOffset,be,Fe),De.drawElements(v,kt.primitiveLength*ot,De.UNSIGNED_SHORT,kt.primitiveOffset*ot*2)}}};var H1=function(p,v,d,y){var S=v.style.light,C=S.properties.get("position"),I=[C.x,C.y,C.z],O=a.create$1();S.properties.get("anchor")==="viewport"&&a.fromRotation(O,-v.transform.angle),a.transformMat3(I,I,O);var z=S.properties.get("color");return{u_matrix:p,u_lightpos:I,u_lightintensity:S.properties.get("intensity"),u_lightcolor:[z.r,z.g,z.b],u_vertical_gradient:+d,u_opacity:y}},ns=function(p,v,d,y,S,C,I){return a.extend(H1(p,v,d,y),Pp(C,v,I),{u_height_factor:-Math.pow(2,S.overscaledZ)/I.tileSize/8})},Zu=function(p){return{u_matrix:p}},Eu=function(p,v,d,y){return a.extend(Zu(p),Pp(d,v,y))},El=function(p,v){return{u_matrix:p,u_world:v}},mh=function(p,v,d,y,S){return a.extend(Eu(p,v,d,y),{u_world:S})},wc=function(p,v,d,y){var S,C,I=p.transform;if(y.paint.get("circle-pitch-alignment")==="map"){var O=Qi(d,1,I.zoom);S=!0,C=[O,O]}else S=!1,C=I.pixelsToGLUnits;return{u_camera_to_center_distance:I.cameraToCenterDistance,u_scale_with_map:+(y.paint.get("circle-pitch-scale")==="map"),u_matrix:p.translatePosMatrix(v.posMatrix,d,y.paint.get("circle-translate"),y.paint.get("circle-translate-anchor")),u_pitch_with_map:+S,u_device_pixel_ratio:a.browser.devicePixelRatio,u_extrude_scale:C}},ou=function(p,v,d){var y=Qi(d,1,v.zoom),S=Math.pow(2,v.zoom-d.tileID.overscaledZ),C=d.tileID.overscaleFactor();return{u_matrix:p,u_camera_to_center_distance:v.cameraToCenterDistance,u_pixels_to_tile_units:y,u_extrude_scale:[v.pixelsToGLUnits[0]/(y*S),v.pixelsToGLUnits[1]/(y*S)],u_overscale_factor:C}},Sf=function(p,v,d){return{u_matrix:p,u_inv_matrix:v,u_camera_to_center_distance:d.cameraToCenterDistance,u_viewport_size:[d.width,d.height]}},Sl=function(p,v,d){return d===void 0&&(d=1),{u_matrix:p,u_color:v,u_overlay:0,u_overlay_scale:d}},qu=function(p){return{u_matrix:p}},Op=function(p,v,d,y){return{u_matrix:p,u_extrude_scale:Qi(v,1,d),u_intensity:y}},Af=function(p,v,d){var y=p.transform;return{u_matrix:Tf(p,v,d),u_ratio:1/Qi(v,1,y.zoom),u_device_pixel_ratio:a.browser.devicePixelRatio,u_units_to_pixels:[1/y.pixelsToGLUnits[0],1/y.pixelsToGLUnits[1]]}},ta=function(p,v,d,y){return a.extend(Af(p,v,d),{u_image:0,u_image_height:y})},gh=function(p,v,d,y){var S=p.transform,C=Al(v,S);return{u_matrix:Tf(p,v,d),u_texsize:v.imageAtlasTexture.size,u_ratio:1/Qi(v,1,S.zoom),u_device_pixel_ratio:a.browser.devicePixelRatio,u_image:0,u_scale:[C,y.fromScale,y.toScale],u_fade:y.t,u_units_to_pixels:[1/S.pixelsToGLUnits[0],1/S.pixelsToGLUnits[1]]}},D0=function(p,v,d,y,S){var C=p.lineAtlas,I=Al(v,p.transform),O=d.layout.get("line-cap")==="round",z=C.getDash(y.from,O),X=C.getDash(y.to,O),ne=z.width*S.fromScale,ae=X.width*S.toScale;return a.extend(Af(p,v,d),{u_patternscale_a:[I/ne,-z.height/2],u_patternscale_b:[I/ae,-X.height/2],u_sdfgamma:C.width/(256*Math.min(ne,ae)*a.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:z.y,u_tex_y_b:X.y,u_mix:S.t})};function Al(p,v){return 1/Qi(p,1,v.tileZoom)}function Tf(p,v,d){return p.translatePosMatrix(v.tileID.posMatrix,v,d.paint.get("line-translate"),d.paint.get("line-translate-anchor"))}var kp=function(p,v,d,y,S){return{u_matrix:p,u_tl_parent:v,u_scale_parent:d,u_buffer_scale:1,u_fade_t:y.mix,u_opacity:y.opacity*S.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:S.paint.get("raster-brightness-min"),u_brightness_high:S.paint.get("raster-brightness-max"),u_saturation_factor:(I=S.paint.get("raster-saturation"),I>0?1-1/(1.001-I):-I),u_contrast_factor:(C=S.paint.get("raster-contrast"),C>0?1/(1-C):1+C),u_spin_weights:_h(S.paint.get("raster-hue-rotate"))};var C,I};function _h(p){p*=Math.PI/180;var v=Math.sin(p),d=Math.cos(p);return[(2*d+1)/3,(-Math.sqrt(3)*v-d+1)/3,(Math.sqrt(3)*v-d+1)/3]}var Ku,Tl=function(p,v,d,y,S,C,I,O,z,X){var ne=S.transform;return{u_is_size_zoom_constant:+(p==="constant"||p==="source"),u_is_size_feature_constant:+(p==="constant"||p==="camera"),u_size_t:v?v.uSizeT:0,u_size:v?v.uSize:0,u_camera_to_center_distance:ne.cameraToCenterDistance,u_pitch:ne.pitch/360*2*Math.PI,u_rotate_symbol:+d,u_aspect_ratio:ne.width/ne.height,u_fade_change:S.options.fadeDuration?S.symbolFadeChange:1,u_matrix:C,u_label_plane_matrix:I,u_coord_matrix:O,u_is_text:+z,u_pitch_with_map:+y,u_texsize:X,u_texture:0}},Jl=function(p,v,d,y,S,C,I,O,z,X,ne){var ae=S.transform;return a.extend(Tl(p,v,d,y,S,C,I,O,z,X),{u_gamma_scale:y?Math.cos(ae._pitch)*ae.cameraToCenterDistance:1,u_device_pixel_ratio:a.browser.devicePixelRatio,u_is_halo:+ne})},Cc=function(p,v,d,y,S,C,I,O,z,X){return a.extend(Jl(p,v,d,y,S,C,I,O,!0,z,!0),{u_texsize_icon:X,u_texture_icon:1})},ec=function(p,v,d){return{u_matrix:p,u_opacity:v,u_color:d}},tc=function(p,v,d,y,S,C){return a.extend(function(I,O,z,X){var ne=z.imageManager.getPattern(I.from.toString()),ae=z.imageManager.getPattern(I.to.toString()),oe=z.imageManager.getPixelSize(),we=oe.width,be=oe.height,Fe=Math.pow(2,X.tileID.overscaledZ),_e=X.tileSize*Math.pow(2,z.transform.tileZoom)/Fe,De=_e*(X.tileID.canonical.x+X.tileID.wrap*Fe),Xe=_e*X.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:ne.tl,u_pattern_br_a:ne.br,u_pattern_tl_b:ae.tl,u_pattern_br_b:ae.br,u_texsize:[we,be],u_mix:O.t,u_pattern_size_a:ne.displaySize,u_pattern_size_b:ae.displaySize,u_scale_a:O.fromScale,u_scale_b:O.toScale,u_tile_units_to_pixels:1/Qi(X,1,z.transform.tileZoom),u_pixel_coord_upper:[De>>16,Xe>>16],u_pixel_coord_lower:[65535&De,65535&Xe]}}(y,C,d,S),{u_matrix:p,u_opacity:v})},Dp={fillExtrusion:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_lightpos:new a.Uniform3f(p,v.u_lightpos),u_lightintensity:new a.Uniform1f(p,v.u_lightintensity),u_lightcolor:new a.Uniform3f(p,v.u_lightcolor),u_vertical_gradient:new a.Uniform1f(p,v.u_vertical_gradient),u_opacity:new a.Uniform1f(p,v.u_opacity)}},fillExtrusionPattern:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_lightpos:new a.Uniform3f(p,v.u_lightpos),u_lightintensity:new a.Uniform1f(p,v.u_lightintensity),u_lightcolor:new a.Uniform3f(p,v.u_lightcolor),u_vertical_gradient:new a.Uniform1f(p,v.u_vertical_gradient),u_height_factor:new a.Uniform1f(p,v.u_height_factor),u_image:new a.Uniform1i(p,v.u_image),u_texsize:new a.Uniform2f(p,v.u_texsize),u_pixel_coord_upper:new a.Uniform2f(p,v.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(p,v.u_pixel_coord_lower),u_scale:new a.Uniform3f(p,v.u_scale),u_fade:new a.Uniform1f(p,v.u_fade),u_opacity:new a.Uniform1f(p,v.u_opacity)}},fill:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix)}},fillPattern:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_image:new a.Uniform1i(p,v.u_image),u_texsize:new a.Uniform2f(p,v.u_texsize),u_pixel_coord_upper:new a.Uniform2f(p,v.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(p,v.u_pixel_coord_lower),u_scale:new a.Uniform3f(p,v.u_scale),u_fade:new a.Uniform1f(p,v.u_fade)}},fillOutline:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_world:new a.Uniform2f(p,v.u_world)}},fillOutlinePattern:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_world:new a.Uniform2f(p,v.u_world),u_image:new a.Uniform1i(p,v.u_image),u_texsize:new a.Uniform2f(p,v.u_texsize),u_pixel_coord_upper:new a.Uniform2f(p,v.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(p,v.u_pixel_coord_lower),u_scale:new a.Uniform3f(p,v.u_scale),u_fade:new a.Uniform1f(p,v.u_fade)}},circle:function(p,v){return{u_camera_to_center_distance:new a.Uniform1f(p,v.u_camera_to_center_distance),u_scale_with_map:new a.Uniform1i(p,v.u_scale_with_map),u_pitch_with_map:new a.Uniform1i(p,v.u_pitch_with_map),u_extrude_scale:new a.Uniform2f(p,v.u_extrude_scale),u_device_pixel_ratio:new a.Uniform1f(p,v.u_device_pixel_ratio),u_matrix:new a.UniformMatrix4f(p,v.u_matrix)}},collisionBox:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_camera_to_center_distance:new a.Uniform1f(p,v.u_camera_to_center_distance),u_pixels_to_tile_units:new a.Uniform1f(p,v.u_pixels_to_tile_units),u_extrude_scale:new a.Uniform2f(p,v.u_extrude_scale),u_overscale_factor:new a.Uniform1f(p,v.u_overscale_factor)}},collisionCircle:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_inv_matrix:new a.UniformMatrix4f(p,v.u_inv_matrix),u_camera_to_center_distance:new a.Uniform1f(p,v.u_camera_to_center_distance),u_viewport_size:new a.Uniform2f(p,v.u_viewport_size)}},debug:function(p,v){return{u_color:new a.UniformColor(p,v.u_color),u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_overlay:new a.Uniform1i(p,v.u_overlay),u_overlay_scale:new a.Uniform1f(p,v.u_overlay_scale)}},clippingMask:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix)}},heatmap:function(p,v){return{u_extrude_scale:new a.Uniform1f(p,v.u_extrude_scale),u_intensity:new a.Uniform1f(p,v.u_intensity),u_matrix:new a.UniformMatrix4f(p,v.u_matrix)}},heatmapTexture:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_world:new a.Uniform2f(p,v.u_world),u_image:new a.Uniform1i(p,v.u_image),u_color_ramp:new a.Uniform1i(p,v.u_color_ramp),u_opacity:new a.Uniform1f(p,v.u_opacity)}},hillshade:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_image:new a.Uniform1i(p,v.u_image),u_latrange:new a.Uniform2f(p,v.u_latrange),u_light:new a.Uniform2f(p,v.u_light),u_shadow:new a.UniformColor(p,v.u_shadow),u_highlight:new a.UniformColor(p,v.u_highlight),u_accent:new a.UniformColor(p,v.u_accent)}},hillshadePrepare:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_image:new a.Uniform1i(p,v.u_image),u_dimension:new a.Uniform2f(p,v.u_dimension),u_zoom:new a.Uniform1f(p,v.u_zoom),u_unpack:new a.Uniform4f(p,v.u_unpack)}},line:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_ratio:new a.Uniform1f(p,v.u_ratio),u_device_pixel_ratio:new a.Uniform1f(p,v.u_device_pixel_ratio),u_units_to_pixels:new a.Uniform2f(p,v.u_units_to_pixels)}},lineGradient:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_ratio:new a.Uniform1f(p,v.u_ratio),u_device_pixel_ratio:new a.Uniform1f(p,v.u_device_pixel_ratio),u_units_to_pixels:new a.Uniform2f(p,v.u_units_to_pixels),u_image:new a.Uniform1i(p,v.u_image),u_image_height:new a.Uniform1f(p,v.u_image_height)}},linePattern:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_texsize:new a.Uniform2f(p,v.u_texsize),u_ratio:new a.Uniform1f(p,v.u_ratio),u_device_pixel_ratio:new a.Uniform1f(p,v.u_device_pixel_ratio),u_image:new a.Uniform1i(p,v.u_image),u_units_to_pixels:new a.Uniform2f(p,v.u_units_to_pixels),u_scale:new a.Uniform3f(p,v.u_scale),u_fade:new a.Uniform1f(p,v.u_fade)}},lineSDF:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_ratio:new a.Uniform1f(p,v.u_ratio),u_device_pixel_ratio:new a.Uniform1f(p,v.u_device_pixel_ratio),u_units_to_pixels:new a.Uniform2f(p,v.u_units_to_pixels),u_patternscale_a:new a.Uniform2f(p,v.u_patternscale_a),u_patternscale_b:new a.Uniform2f(p,v.u_patternscale_b),u_sdfgamma:new a.Uniform1f(p,v.u_sdfgamma),u_image:new a.Uniform1i(p,v.u_image),u_tex_y_a:new a.Uniform1f(p,v.u_tex_y_a),u_tex_y_b:new a.Uniform1f(p,v.u_tex_y_b),u_mix:new a.Uniform1f(p,v.u_mix)}},raster:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_tl_parent:new a.Uniform2f(p,v.u_tl_parent),u_scale_parent:new a.Uniform1f(p,v.u_scale_parent),u_buffer_scale:new a.Uniform1f(p,v.u_buffer_scale),u_fade_t:new a.Uniform1f(p,v.u_fade_t),u_opacity:new a.Uniform1f(p,v.u_opacity),u_image0:new a.Uniform1i(p,v.u_image0),u_image1:new a.Uniform1i(p,v.u_image1),u_brightness_low:new a.Uniform1f(p,v.u_brightness_low),u_brightness_high:new a.Uniform1f(p,v.u_brightness_high),u_saturation_factor:new a.Uniform1f(p,v.u_saturation_factor),u_contrast_factor:new a.Uniform1f(p,v.u_contrast_factor),u_spin_weights:new a.Uniform3f(p,v.u_spin_weights)}},symbolIcon:function(p,v){return{u_is_size_zoom_constant:new a.Uniform1i(p,v.u_is_size_zoom_constant),u_is_size_feature_constant:new a.Uniform1i(p,v.u_is_size_feature_constant),u_size_t:new a.Uniform1f(p,v.u_size_t),u_size:new a.Uniform1f(p,v.u_size),u_camera_to_center_distance:new a.Uniform1f(p,v.u_camera_to_center_distance),u_pitch:new a.Uniform1f(p,v.u_pitch),u_rotate_symbol:new a.Uniform1i(p,v.u_rotate_symbol),u_aspect_ratio:new a.Uniform1f(p,v.u_aspect_ratio),u_fade_change:new a.Uniform1f(p,v.u_fade_change),u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_label_plane_matrix:new a.UniformMatrix4f(p,v.u_label_plane_matrix),u_coord_matrix:new a.UniformMatrix4f(p,v.u_coord_matrix),u_is_text:new a.Uniform1i(p,v.u_is_text),u_pitch_with_map:new a.Uniform1i(p,v.u_pitch_with_map),u_texsize:new a.Uniform2f(p,v.u_texsize),u_texture:new a.Uniform1i(p,v.u_texture)}},symbolSDF:function(p,v){return{u_is_size_zoom_constant:new a.Uniform1i(p,v.u_is_size_zoom_constant),u_is_size_feature_constant:new a.Uniform1i(p,v.u_is_size_feature_constant),u_size_t:new a.Uniform1f(p,v.u_size_t),u_size:new a.Uniform1f(p,v.u_size),u_camera_to_center_distance:new a.Uniform1f(p,v.u_camera_to_center_distance),u_pitch:new a.Uniform1f(p,v.u_pitch),u_rotate_symbol:new a.Uniform1i(p,v.u_rotate_symbol),u_aspect_ratio:new a.Uniform1f(p,v.u_aspect_ratio),u_fade_change:new a.Uniform1f(p,v.u_fade_change),u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_label_plane_matrix:new a.UniformMatrix4f(p,v.u_label_plane_matrix),u_coord_matrix:new a.UniformMatrix4f(p,v.u_coord_matrix),u_is_text:new a.Uniform1i(p,v.u_is_text),u_pitch_with_map:new a.Uniform1i(p,v.u_pitch_with_map),u_texsize:new a.Uniform2f(p,v.u_texsize),u_texture:new a.Uniform1i(p,v.u_texture),u_gamma_scale:new a.Uniform1f(p,v.u_gamma_scale),u_device_pixel_ratio:new a.Uniform1f(p,v.u_device_pixel_ratio),u_is_halo:new a.Uniform1i(p,v.u_is_halo)}},symbolTextAndIcon:function(p,v){return{u_is_size_zoom_constant:new a.Uniform1i(p,v.u_is_size_zoom_constant),u_is_size_feature_constant:new a.Uniform1i(p,v.u_is_size_feature_constant),u_size_t:new a.Uniform1f(p,v.u_size_t),u_size:new a.Uniform1f(p,v.u_size),u_camera_to_center_distance:new a.Uniform1f(p,v.u_camera_to_center_distance),u_pitch:new a.Uniform1f(p,v.u_pitch),u_rotate_symbol:new a.Uniform1i(p,v.u_rotate_symbol),u_aspect_ratio:new a.Uniform1f(p,v.u_aspect_ratio),u_fade_change:new a.Uniform1f(p,v.u_fade_change),u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_label_plane_matrix:new a.UniformMatrix4f(p,v.u_label_plane_matrix),u_coord_matrix:new a.UniformMatrix4f(p,v.u_coord_matrix),u_is_text:new a.Uniform1i(p,v.u_is_text),u_pitch_with_map:new a.Uniform1i(p,v.u_pitch_with_map),u_texsize:new a.Uniform2f(p,v.u_texsize),u_texsize_icon:new a.Uniform2f(p,v.u_texsize_icon),u_texture:new a.Uniform1i(p,v.u_texture),u_texture_icon:new a.Uniform1i(p,v.u_texture_icon),u_gamma_scale:new a.Uniform1f(p,v.u_gamma_scale),u_device_pixel_ratio:new a.Uniform1f(p,v.u_device_pixel_ratio),u_is_halo:new a.Uniform1i(p,v.u_is_halo)}},background:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_opacity:new a.Uniform1f(p,v.u_opacity),u_color:new a.UniformColor(p,v.u_color)}},backgroundPattern:function(p,v){return{u_matrix:new a.UniformMatrix4f(p,v.u_matrix),u_opacity:new a.Uniform1f(p,v.u_opacity),u_image:new a.Uniform1i(p,v.u_image),u_pattern_tl_a:new a.Uniform2f(p,v.u_pattern_tl_a),u_pattern_br_a:new a.Uniform2f(p,v.u_pattern_br_a),u_pattern_tl_b:new a.Uniform2f(p,v.u_pattern_tl_b),u_pattern_br_b:new a.Uniform2f(p,v.u_pattern_br_b),u_texsize:new a.Uniform2f(p,v.u_texsize),u_mix:new a.Uniform1f(p,v.u_mix),u_pattern_size_a:new a.Uniform2f(p,v.u_pattern_size_a),u_pattern_size_b:new a.Uniform2f(p,v.u_pattern_size_b),u_scale_a:new a.Uniform1f(p,v.u_scale_a),u_scale_b:new a.Uniform1f(p,v.u_scale_b),u_pixel_coord_upper:new a.Uniform2f(p,v.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(p,v.u_pixel_coord_lower),u_tile_units_to_pixels:new a.Uniform1f(p,v.u_tile_units_to_pixels)}}};function rc(p,v,d,y,S,C,I){for(var O=p.context,z=O.gl,X=p.useProgram("collisionBox"),ne=[],ae=0,oe=0,we=0;we<y.length;we++){var be=y[we],Fe=v.getTile(be),_e=Fe.getBucket(d);if(_e){var De=be.posMatrix;S[0]===0&&S[1]===0||(De=p.translatePosMatrix(be.posMatrix,Fe,S,C));var Xe=I?_e.textCollisionBox:_e.iconCollisionBox,ot=_e.collisionCircleArray;if(ot.length>0){var Ct=a.create(),mt=De;a.mul(Ct,_e.placementInvProjMatrix,p.transform.glCoordMatrix),a.mul(Ct,Ct,_e.placementViewportMatrix),ne.push({circleArray:ot,circleOffset:oe,transform:mt,invTransform:Ct}),oe=ae+=ot.length/4}Xe&&X.draw(O,z.LINES,ce.disabled,Ee.disabled,p.colorModeForRenderPass(),Ye.disabled,ou(De,p.transform,Fe),d.id,Xe.layoutVertexBuffer,Xe.indexBuffer,Xe.segments,null,p.transform.zoom,null,null,Xe.collisionVertexBuffer)}}if(I&&ne.length){var kt=p.useProgram("collisionCircle"),qt=new a.StructArrayLayout2f1f2i16;qt.resize(4*ae),qt._trim();for(var Tr=0,yr=0,$r=ne;yr<$r.length;yr+=1)for(var vn=$r[yr],bn=0;bn<vn.circleArray.length/4;bn++){var xn=4*bn,Si=vn.circleArray[xn+0],Yr=vn.circleArray[xn+1],Un=vn.circleArray[xn+2],Kn=vn.circleArray[xn+3];qt.emplace(Tr++,Si,Yr,Un,Kn,0),qt.emplace(Tr++,Si,Yr,Un,Kn,1),qt.emplace(Tr++,Si,Yr,Un,Kn,2),qt.emplace(Tr++,Si,Yr,Un,Kn,3)}(!Ku||Ku.length<2*ae)&&(Ku=function(xa){var _o=2*xa,oo=new a.StructArrayLayout3ui6;oo.resize(_o),oo._trim();for(var _a=0;_a<_o;_a++){var ba=6*_a;oo.uint16[ba+0]=4*_a+0,oo.uint16[ba+1]=4*_a+1,oo.uint16[ba+2]=4*_a+2,oo.uint16[ba+3]=4*_a+2,oo.uint16[ba+4]=4*_a+3,oo.uint16[ba+5]=4*_a+0}return oo}(ae));for(var Bn=O.createIndexBuffer(Ku,!0),On=O.createVertexBuffer(qt,a.collisionCircleLayout.members,!0),Yn=0,kn=ne;Yn<kn.length;Yn+=1){var In=kn[Yn],$a=Sf(In.transform,In.invTransform,p.transform);kt.draw(O,z.TRIANGLES,ce.disabled,Ee.disabled,p.colorModeForRenderPass(),Ye.disabled,$a,d.id,On,Bn,a.SegmentVector.simpleSegment(0,2*In.circleOffset,In.circleArray.length,In.circleArray.length/2),null,p.transform.zoom,null,null,null)}On.destroy(),Bn.destroy()}}var Hs=a.identity(new Float32Array(16));function Fp(p,v,d,y,S,C){var I=a.getAnchorAlignment(p),O=-(I.horizontalAlign-.5)*v,z=-(I.verticalAlign-.5)*d,X=a.evaluateVariableOffset(p,y);return new a.Point((O/S+X[0])*C,(z/S+X[1])*C)}function Bp(p,v,d,y,S,C,I,O,z,X,ne){var ae=p.text.placedSymbolArray,oe=p.text.dynamicLayoutVertexArray,we=p.icon.dynamicLayoutVertexArray,be={};oe.clear();for(var Fe=0;Fe<ae.length;Fe++){var _e=ae.get(Fe),De=_e.hidden||!_e.crossTileID||p.allowVerticalPlacement&&!_e.placedOrientation?null:y[_e.crossTileID];if(De){var Xe=new a.Point(_e.anchorX,_e.anchorY),ot=Wn(Xe,d?O:I),Ct=si(C.cameraToCenterDistance,ot.signedDistanceFromCamera),mt=S.evaluateSizeForFeature(p.textSizeData,X,_e)*Ct/a.ONE_EM;d&&(mt*=p.tilePixelRatio/z);for(var kt=Fp(De.anchor,De.width,De.height,De.textOffset,De.textBoxScale,mt),qt=d?Wn(Xe.add(kt),I).point:ot.point.add(v?kt.rotate(-C.angle):kt),Tr=p.allowVerticalPlacement&&_e.placedOrientation===a.WritingMode.vertical?Math.PI/2:0,yr=0;yr<_e.numGlyphs;yr++)a.addDynamicAttributes(oe,qt,Tr);ne&&_e.associatedIconIndex>=0&&(be[_e.associatedIconIndex]={shiftedAnchor:qt,angle:Tr})}else ro(_e.numGlyphs,oe)}if(ne){we.clear();for(var $r=p.icon.placedSymbolArray,vn=0;vn<$r.length;vn++){var bn=$r.get(vn);if(bn.hidden)ro(bn.numGlyphs,we);else{var xn=be[vn];if(xn)for(var Si=0;Si<bn.numGlyphs;Si++)a.addDynamicAttributes(we,xn.shiftedAnchor,xn.angle);else ro(bn.numGlyphs,we)}}p.icon.dynamicLayoutVertexBuffer.updateData(we)}p.text.dynamicLayoutVertexBuffer.updateData(oe)}function Lp(p,v,d){return d.iconsInText&&v?"symbolTextAndIcon":p?"symbolSDF":"symbolIcon"}function wl(p,v,d,y,S,C,I,O,z,X,ne,ae){for(var oe=p.context,we=oe.gl,be=p.transform,Fe=O==="map",_e=z==="map",De=Fe&&d.layout.get("symbol-placement")!=="point",Xe=Fe&&!_e&&!De,ot=d.layout.get("symbol-sort-key").constantOr(1)!==void 0,Ct=!1,mt=p.depthModeForSublayer(0,ce.ReadOnly),kt=d.layout.get("text-variable-anchor"),qt=[],Tr=0,yr=y;Tr<yr.length;Tr+=1){var $r=yr[Tr],vn=v.getTile($r),bn=vn.getBucket(d);if(bn){var xn=S?bn.text:bn.icon;if(xn&&xn.segments.get().length){var Si=xn.programConfigurations.get(d.id),Yr=S||bn.sdfIcons,Un=S?bn.textSizeData:bn.iconSizeData,Kn=_e||be.pitch!==0,Bn=p.useProgram(Lp(Yr,S,bn),Si),On=a.evaluateSizeForZoom(Un,be.zoom),Yn=void 0,kn=[0,0],In=void 0,$a=void 0,xa=null,_o=void 0;if(S)In=vn.glyphAtlasTexture,$a=we.LINEAR,Yn=vn.glyphAtlasTexture.size,bn.iconsInText&&(kn=vn.imageAtlasTexture.size,xa=vn.imageAtlasTexture,_o=Kn||p.options.rotating||p.options.zooming||Un.kind==="composite"||Un.kind==="camera"?we.LINEAR:we.NEAREST);else{var oo=d.layout.get("icon-size").constantOr(0)!==1||bn.iconsNeedLinear;In=vn.imageAtlasTexture,$a=Yr||p.options.rotating||p.options.zooming||oo||Kn?we.LINEAR:we.NEAREST,Yn=vn.imageAtlasTexture.size}var _a=Qi(vn,1,p.transform.zoom),ba=Wi($r.posMatrix,_e,Fe,p.transform,_a),Yo=Ii($r.posMatrix,_e,Fe,p.transform,_a),Uo=kt&&bn.hasTextData(),Ru=d.layout.get("icon-text-fit")!=="none"&&Uo&&bn.hasIconData();De&&dl(bn,$r.posMatrix,p,S,ba,Yo,_e,X);var Zo=p.translatePosMatrix($r.posMatrix,vn,C,I),Zs=De||S&&kt||Ru?Hs:ba,bs=p.translatePosMatrix(Yo,vn,C,I,!0),Bc=Yr&&d.paint.get(S?"text-halo-width":"icon-halo-width").constantOr(1)!==0,sc={program:Bn,buffers:xn,uniformValues:Yr?bn.iconsInText?Cc(Un.kind,On,Xe,_e,p,Zo,Zs,bs,Yn,kn):Jl(Un.kind,On,Xe,_e,p,Zo,Zs,bs,S,Yn,!0):Tl(Un.kind,On,Xe,_e,p,Zo,Zs,bs,S,Yn),atlasTexture:In,atlasTextureIcon:xa,atlasInterpolation:$a,atlasInterpolationIcon:_o,isSDF:Yr,hasHalo:Bc};if(ot&&bn.canOverlap){Ct=!0;for(var Iu=0,Dl=xn.segments.get();Iu<Dl.length;Iu+=1){var rl=Dl[Iu];qt.push({segments:new a.SegmentVector([rl]),sortKey:rl.sortKey,state:sc})}}else qt.push({segments:xn.segments,sortKey:0,state:sc})}}}Ct&&qt.sort(function(qs,cu){return qs.sortKey-cu.sortKey});for(var lu=0,Fl=qt;lu<Fl.length;lu+=1){var Ro=Fl[lu],Ma=Ro.state;if(oe.activeTexture.set(we.TEXTURE0),Ma.atlasTexture.bind(Ma.atlasInterpolation,we.CLAMP_TO_EDGE),Ma.atlasTextureIcon&&(oe.activeTexture.set(we.TEXTURE1),Ma.atlasTextureIcon&&Ma.atlasTextureIcon.bind(Ma.atlasInterpolationIcon,we.CLAMP_TO_EDGE)),Ma.isSDF){var as=Ma.uniformValues;Ma.hasHalo&&(as.u_is_halo=1,Su(Ma.buffers,Ro.segments,d,p,Ma.program,mt,ne,ae,as)),as.u_is_halo=0}Su(Ma.buffers,Ro.segments,d,p,Ma.program,mt,ne,ae,Ma.uniformValues)}}function Su(p,v,d,y,S,C,I,O,z){var X=y.context;S.draw(X,X.gl.TRIANGLES,C,I,O,Ye.disabled,z,d.id,p.layoutVertexBuffer,p.indexBuffer,v,d.paint,y.transform.zoom,p.programConfigurations.get(d.id),p.dynamicLayoutVertexBuffer,p.opacityVertexBuffer)}function Rc(p,v,d,y,S,C,I){var O,z,X,ne,ae,oe=p.context.gl,we=d.paint.get("fill-pattern"),be=we&&we.constantOr(1),Fe=d.getCrossfadeParameters();I?(z=be&&!d.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",O=oe.LINES):(z=be?"fillPattern":"fill",O=oe.TRIANGLES);for(var _e=0,De=y;_e<De.length;_e+=1){var Xe=De[_e],ot=v.getTile(Xe);if(!be||ot.patternsLoaded()){var Ct=ot.getBucket(d);if(Ct){var mt=Ct.programConfigurations.get(d.id),kt=p.useProgram(z,mt);be&&(p.context.activeTexture.set(oe.TEXTURE0),ot.imageAtlasTexture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE),mt.updatePaintBuffers(Fe));var qt=we.constantOr(null);if(qt&&ot.imageAtlas){var Tr=ot.imageAtlas,yr=Tr.patternPositions[qt.to.toString()],$r=Tr.patternPositions[qt.from.toString()];yr&&$r&&mt.setConstantPatternPositions(yr,$r)}var vn=p.translatePosMatrix(Xe.posMatrix,ot,d.paint.get("fill-translate"),d.paint.get("fill-translate-anchor"));if(I){ne=Ct.indexBuffer2,ae=Ct.segments2;var bn=[oe.drawingBufferWidth,oe.drawingBufferHeight];X=z==="fillOutlinePattern"&&be?mh(vn,p,Fe,ot,bn):El(vn,bn)}else ne=Ct.indexBuffer,ae=Ct.segments,X=be?Eu(vn,p,Fe,ot):Zu(vn);kt.draw(p.context,O,S,p.stencilModeForClipping(Xe),C,Ye.disabled,X,d.id,Ct.layoutVertexBuffer,ne,ae,d.paint,p.transform.zoom,mt)}}}}function wf(p,v,d,y,S,C,I){for(var O=p.context,z=O.gl,X=d.paint.get("fill-extrusion-pattern"),ne=X.constantOr(1),ae=d.getCrossfadeParameters(),oe=d.paint.get("fill-extrusion-opacity"),we=0,be=y;we<be.length;we+=1){var Fe=be[we],_e=v.getTile(Fe),De=_e.getBucket(d);if(De){var Xe=De.programConfigurations.get(d.id),ot=p.useProgram(ne?"fillExtrusionPattern":"fillExtrusion",Xe);ne&&(p.context.activeTexture.set(z.TEXTURE0),_e.imageAtlasTexture.bind(z.LINEAR,z.CLAMP_TO_EDGE),Xe.updatePaintBuffers(ae));var Ct=X.constantOr(null);if(Ct&&_e.imageAtlas){var mt=_e.imageAtlas,kt=mt.patternPositions[Ct.to.toString()],qt=mt.patternPositions[Ct.from.toString()];kt&&qt&&Xe.setConstantPatternPositions(kt,qt)}var Tr=p.translatePosMatrix(Fe.posMatrix,_e,d.paint.get("fill-extrusion-translate"),d.paint.get("fill-extrusion-translate-anchor")),yr=d.paint.get("fill-extrusion-vertical-gradient"),$r=ne?ns(Tr,p,yr,oe,Fe,ae,_e):H1(Tr,p,yr,oe);ot.draw(O,O.gl.TRIANGLES,S,C,I,Ye.backCCW,$r,d.id,De.layoutVertexBuffer,De.indexBuffer,De.segments,d.paint,p.transform.zoom,Xe)}}}function Cl(p,v,d,y,S,C){var I=p.context,O=I.gl,z=v.fbo;if(z){var X=p.useProgram("hillshade");I.activeTexture.set(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,z.colorAttachment.get());var ne=function(ae,oe,we){var be=we.paint.get("hillshade-shadow-color"),Fe=we.paint.get("hillshade-highlight-color"),_e=we.paint.get("hillshade-accent-color"),De=we.paint.get("hillshade-illumination-direction")*(Math.PI/180);we.paint.get("hillshade-illumination-anchor")==="viewport"&&(De-=ae.transform.angle);var Xe,ot,Ct,mt=!ae.options.moving;return{u_matrix:ae.transform.calculatePosMatrix(oe.tileID.toUnwrapped(),mt),u_image:0,u_latrange:(Xe=oe.tileID,ot=Math.pow(2,Xe.canonical.z),Ct=Xe.canonical.y,[new a.MercatorCoordinate(0,Ct/ot).toLngLat().lat,new a.MercatorCoordinate(0,(Ct+1)/ot).toLngLat().lat]),u_light:[we.paint.get("hillshade-exaggeration"),De],u_shadow:be,u_highlight:Fe,u_accent:_e}}(p,v,d);X.draw(I,O.TRIANGLES,y,S,C,Ye.disabled,ne,d.id,p.rasterBoundsBuffer,p.quadTriangleIndexBuffer,p.rasterBoundsSegments)}}function F0(p,v,d,y,S,C){var I=p.context,O=I.gl,z=v.dem;if(z&&z.data){var X=z.dim,ne=z.stride,ae=z.getPixels();if(I.activeTexture.set(O.TEXTURE1),I.pixelStoreUnpackPremultiplyAlpha.set(!1),v.demTexture=v.demTexture||p.getTileTexture(ne),v.demTexture){var oe=v.demTexture;oe.update(ae,{premultiply:!1}),oe.bind(O.NEAREST,O.CLAMP_TO_EDGE)}else v.demTexture=new a.Texture(I,ae,O.RGBA,{premultiply:!1}),v.demTexture.bind(O.NEAREST,O.CLAMP_TO_EDGE);I.activeTexture.set(O.TEXTURE0);var we=v.fbo;if(!we){var be=new a.Texture(I,{width:X,height:X,data:null},O.RGBA);be.bind(O.LINEAR,O.CLAMP_TO_EDGE),(we=v.fbo=I.createFramebuffer(X,X,!0)).colorAttachment.set(be.texture)}I.bindFramebuffer.set(we.framebuffer),I.viewport.set([0,0,X,X]),p.useProgram("hillshadePrepare").draw(I,O.TRIANGLES,y,S,C,Ye.disabled,function(Fe,_e){var De=_e.stride,Xe=a.create();return a.ortho(Xe,0,a.EXTENT,-a.EXTENT,0,0,1),a.translate(Xe,Xe,[0,-a.EXTENT,0]),{u_matrix:Xe,u_image:1,u_dimension:[De,De],u_zoom:Fe.overscaledZ,u_unpack:_e.getUnpackVector()}}(v.tileID,z),d.id,p.rasterBoundsBuffer,p.quadTriangleIndexBuffer,p.rasterBoundsSegments),v.needsHillshadePrepare=!1}}function yh(p,v,d,y,S){var C=y.paint.get("raster-fade-duration");if(C>0){var I=a.browser.now(),O=(I-p.timeAdded)/C,z=v?(I-v.timeAdded)/C:-1,X=d.getSource(),ne=S.coveringZoomLevel({tileSize:X.tileSize,roundZoom:X.roundZoom}),ae=!v||Math.abs(v.tileID.overscaledZ-ne)>Math.abs(p.tileID.overscaledZ-ne),oe=ae&&p.refreshedUponExpiration?1:a.clamp(ae?O:1-z,0,1);return p.refreshedUponExpiration&&O>=1&&(p.refreshedUponExpiration=!1),v?{opacity:1,mix:1-oe}:{opacity:oe,mix:0}}return{opacity:1,mix:0}}var Np=new a.Color(1,0,0,1),xh=new a.Color(0,1,0,1),G1=new a.Color(0,0,1,1),bh=new a.Color(1,0,1,1),Up=new a.Color(0,1,1,1);function Cf(p,v,d,y){nc(p,0,v+d/2,p.transform.width,d,y)}function zp(p,v,d,y){nc(p,v-d/2,0,d,p.transform.height,y)}function nc(p,v,d,y,S,C){var I=p.context,O=I.gl;O.enable(O.SCISSOR_TEST),O.scissor(v*a.browser.devicePixelRatio,d*a.browser.devicePixelRatio,y*a.browser.devicePixelRatio,S*a.browser.devicePixelRatio),I.clear({color:C}),O.disable(O.SCISSOR_TEST)}function $p(p,v,d){var y=p.context,S=y.gl,C=d.posMatrix,I=p.useProgram("debug"),O=ce.disabled,z=Ee.disabled,X=p.colorModeForRenderPass();y.activeTexture.set(S.TEXTURE0),p.emptyTexture.bind(S.LINEAR,S.CLAMP_TO_EDGE),I.draw(y,S.LINE_STRIP,O,z,X,Ye.disabled,Sl(C,a.Color.red),"$debug",p.debugBuffer,p.tileBorderIndexBuffer,p.debugSegments);var ne=v.getTileByID(d.key).latestRawTileData,ae=Math.floor((ne&&ne.byteLength||0)/1024),oe=v.getTile(d).tileSize,we=512/Math.min(oe,512)*(d.overscaledZ/p.transform.zoom)*.5,be=d.canonical.toString();d.overscaledZ!==d.canonical.z&&(be+=" => "+d.overscaledZ),function(Fe,_e){Fe.initDebugOverlayCanvas();var De=Fe.debugOverlayCanvas,Xe=Fe.context.gl,ot=Fe.debugOverlayCanvas.getContext("2d");ot.clearRect(0,0,De.width,De.height),ot.shadowColor="white",ot.shadowBlur=2,ot.lineWidth=1.5,ot.strokeStyle="white",ot.textBaseline="top",ot.font="bold 36px Open Sans, sans-serif",ot.fillText(_e,5,5),ot.strokeText(_e,5,5),Fe.debugOverlayTexture.update(De),Fe.debugOverlayTexture.bind(Xe.LINEAR,Xe.CLAMP_TO_EDGE)}(p,be+" "+ae+"kb"),I.draw(y,S.TRIANGLES,O,z,je.alphaBlended,Ye.disabled,Sl(C,a.Color.transparent,we),"$debug",p.debugBuffer,p.quadTriangleIndexBuffer,p.debugSegments)}var Rl={symbol:function(p,v,d,y,S){if(p.renderPass==="translucent"){var C=Ee.disabled,I=p.colorModeForRenderPass();d.layout.get("text-variable-anchor")&&function(O,z,X,ne,ae,oe,we){for(var be=z.transform,Fe=ae==="map",_e=oe==="map",De=0,Xe=O;De<Xe.length;De+=1){var ot=Xe[De],Ct=ne.getTile(ot),mt=Ct.getBucket(X);if(mt&&mt.text&&mt.text.segments.get().length){var kt=a.evaluateSizeForZoom(mt.textSizeData,be.zoom),qt=Qi(Ct,1,z.transform.zoom),Tr=Wi(ot.posMatrix,_e,Fe,z.transform,qt),yr=X.layout.get("icon-text-fit")!=="none"&&mt.hasIconData();if(kt){var $r=Math.pow(2,be.zoom-Ct.tileID.overscaledZ);Bp(mt,Fe,_e,we,a.symbolSize,be,Tr,ot.posMatrix,$r,kt,yr)}}}}(y,p,d,v,d.layout.get("text-rotation-alignment"),d.layout.get("text-pitch-alignment"),S),d.paint.get("icon-opacity").constantOr(1)!==0&&wl(p,v,d,y,!1,d.paint.get("icon-translate"),d.paint.get("icon-translate-anchor"),d.layout.get("icon-rotation-alignment"),d.layout.get("icon-pitch-alignment"),d.layout.get("icon-keep-upright"),C,I),d.paint.get("text-opacity").constantOr(1)!==0&&wl(p,v,d,y,!0,d.paint.get("text-translate"),d.paint.get("text-translate-anchor"),d.layout.get("text-rotation-alignment"),d.layout.get("text-pitch-alignment"),d.layout.get("text-keep-upright"),C,I),v.map.showCollisionBoxes&&(rc(p,v,d,y,d.paint.get("text-translate"),d.paint.get("text-translate-anchor"),!0),rc(p,v,d,y,d.paint.get("icon-translate"),d.paint.get("icon-translate-anchor"),!1))}},circle:function(p,v,d,y){if(p.renderPass==="translucent"){var S=d.paint.get("circle-opacity"),C=d.paint.get("circle-stroke-width"),I=d.paint.get("circle-stroke-opacity"),O=d.layout.get("circle-sort-key").constantOr(1)!==void 0;if(S.constantOr(1)!==0||C.constantOr(1)!==0&&I.constantOr(1)!==0){for(var z=p.context,X=z.gl,ne=p.depthModeForSublayer(0,ce.ReadOnly),ae=Ee.disabled,oe=p.colorModeForRenderPass(),we=[],be=0;be<y.length;be++){var Fe=y[be],_e=v.getTile(Fe),De=_e.getBucket(d);if(De){var Xe=De.programConfigurations.get(d.id),ot={programConfiguration:Xe,program:p.useProgram("circle",Xe),layoutVertexBuffer:De.layoutVertexBuffer,indexBuffer:De.indexBuffer,uniformValues:wc(p,Fe,_e,d)};if(O)for(var Ct=0,mt=De.segments.get();Ct<mt.length;Ct+=1){var kt=mt[Ct];we.push({segments:new a.SegmentVector([kt]),sortKey:kt.sortKey,state:ot})}else we.push({segments:De.segments,sortKey:0,state:ot})}}O&&we.sort(function(vn,bn){return vn.sortKey-bn.sortKey});for(var qt=0,Tr=we;qt<Tr.length;qt+=1){var yr=Tr[qt],$r=yr.state;$r.program.draw(z,X.TRIANGLES,ne,ae,oe,Ye.disabled,$r.uniformValues,d.id,$r.layoutVertexBuffer,$r.indexBuffer,yr.segments,d.paint,p.transform.zoom,$r.programConfiguration)}}}},heatmap:function(p,v,d,y){if(d.paint.get("heatmap-opacity")!==0)if(p.renderPass==="offscreen"){var S=p.context,C=S.gl,I=Ee.disabled,O=new je([C.ONE,C.ONE],a.Color.transparent,[!0,!0,!0,!0]);(function(we,be,Fe){var _e=we.gl;we.activeTexture.set(_e.TEXTURE1),we.viewport.set([0,0,be.width/4,be.height/4]);var De=Fe.heatmapFbo;if(De)_e.bindTexture(_e.TEXTURE_2D,De.colorAttachment.get()),we.bindFramebuffer.set(De.framebuffer);else{var Xe=_e.createTexture();_e.bindTexture(_e.TEXTURE_2D,Xe),_e.texParameteri(_e.TEXTURE_2D,_e.TEXTURE_WRAP_S,_e.CLAMP_TO_EDGE),_e.texParameteri(_e.TEXTURE_2D,_e.TEXTURE_WRAP_T,_e.CLAMP_TO_EDGE),_e.texParameteri(_e.TEXTURE_2D,_e.TEXTURE_MIN_FILTER,_e.LINEAR),_e.texParameteri(_e.TEXTURE_2D,_e.TEXTURE_MAG_FILTER,_e.LINEAR),De=Fe.heatmapFbo=we.createFramebuffer(be.width/4,be.height/4,!1),function(ot,Ct,mt,kt){var qt=ot.gl;qt.texImage2D(qt.TEXTURE_2D,0,qt.RGBA,Ct.width/4,Ct.height/4,0,qt.RGBA,ot.extRenderToTextureHalfFloat?ot.extTextureHalfFloat.HALF_FLOAT_OES:qt.UNSIGNED_BYTE,null),kt.colorAttachment.set(mt)}(we,be,Xe,De)}})(S,p,d),S.clear({color:a.Color.transparent});for(var z=0;z<y.length;z++){var X=y[z];if(!v.hasRenderableParent(X)){var ne=v.getTile(X),ae=ne.getBucket(d);if(ae){var oe=ae.programConfigurations.get(d.id);p.useProgram("heatmap",oe).draw(S,C.TRIANGLES,ce.disabled,I,O,Ye.disabled,Op(X.posMatrix,ne,p.transform.zoom,d.paint.get("heatmap-intensity")),d.id,ae.layoutVertexBuffer,ae.indexBuffer,ae.segments,d.paint,p.transform.zoom,oe)}}}S.viewport.set([0,0,p.width,p.height])}else p.renderPass==="translucent"&&(p.context.setColorMode(p.colorModeForRenderPass()),function(we,be){var Fe=we.context,_e=Fe.gl,De=be.heatmapFbo;if(De){Fe.activeTexture.set(_e.TEXTURE0),_e.bindTexture(_e.TEXTURE_2D,De.colorAttachment.get()),Fe.activeTexture.set(_e.TEXTURE1);var Xe=be.colorRampTexture;Xe||(Xe=be.colorRampTexture=new a.Texture(Fe,be.colorRamp,_e.RGBA)),Xe.bind(_e.LINEAR,_e.CLAMP_TO_EDGE),we.useProgram("heatmapTexture").draw(Fe,_e.TRIANGLES,ce.disabled,Ee.disabled,we.colorModeForRenderPass(),Ye.disabled,function(ot,Ct,mt,kt){var qt=a.create();a.ortho(qt,0,ot.width,ot.height,0,0,1);var Tr=ot.context.gl;return{u_matrix:qt,u_world:[Tr.drawingBufferWidth,Tr.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:Ct.paint.get("heatmap-opacity")}}(we,be),be.id,we.viewportBuffer,we.quadTriangleIndexBuffer,we.viewportSegments,be.paint,we.transform.zoom)}}(p,d))},line:function(p,v,d,y){if(p.renderPass==="translucent"){var S=d.paint.get("line-opacity"),C=d.paint.get("line-width");if(S.constantOr(1)!==0&&C.constantOr(1)!==0)for(var I=p.depthModeForSublayer(0,ce.ReadOnly),O=p.colorModeForRenderPass(),z=d.paint.get("line-dasharray"),X=d.paint.get("line-pattern"),ne=X.constantOr(1),ae=d.paint.get("line-gradient"),oe=d.getCrossfadeParameters(),we=ne?"linePattern":z?"lineSDF":ae?"lineGradient":"line",be=p.context,Fe=be.gl,_e=!0,De=0,Xe=y;De<Xe.length;De+=1){var ot=Xe[De],Ct=v.getTile(ot);if(!ne||Ct.patternsLoaded()){var mt=Ct.getBucket(d);if(mt){var kt=mt.programConfigurations.get(d.id),qt=p.context.program.get(),Tr=p.useProgram(we,kt),yr=_e||Tr.program!==qt,$r=X.constantOr(null);if($r&&Ct.imageAtlas){var vn=Ct.imageAtlas,bn=vn.patternPositions[$r.to.toString()],xn=vn.patternPositions[$r.from.toString()];bn&&xn&&kt.setConstantPatternPositions(bn,xn)}var Si=ne?gh(p,Ct,d,oe):z?D0(p,Ct,d,z,oe):ae?ta(p,Ct,d,mt.lineClipsArray.length):Af(p,Ct,d);if(ne)be.activeTexture.set(Fe.TEXTURE0),Ct.imageAtlasTexture.bind(Fe.LINEAR,Fe.CLAMP_TO_EDGE),kt.updatePaintBuffers(oe);else if(z&&(yr||p.lineAtlas.dirty))be.activeTexture.set(Fe.TEXTURE0),p.lineAtlas.bind(be);else if(ae){var Yr=mt.gradients[d.id],Un=Yr.texture;if(d.gradientVersion!==Yr.version){var Kn=256;if(d.stepInterpolant){var Bn=v.getSource().maxzoom,On=ot.canonical.z===Bn?Math.ceil(1<<p.transform.maxZoom-ot.canonical.z):1;Kn=a.clamp(a.nextPowerOfTwo(mt.maxLineLength/a.EXTENT*1024*On),256,be.maxTextureSize)}Yr.gradient=a.renderColorRamp({expression:d.gradientExpression(),evaluationKey:"lineProgress",resolution:Kn,image:Yr.gradient||void 0,clips:mt.lineClipsArray}),Yr.texture?Yr.texture.update(Yr.gradient):Yr.texture=new a.Texture(be,Yr.gradient,Fe.RGBA),Yr.version=d.gradientVersion,Un=Yr.texture}be.activeTexture.set(Fe.TEXTURE0),Un.bind(d.stepInterpolant?Fe.NEAREST:Fe.LINEAR,Fe.CLAMP_TO_EDGE)}Tr.draw(be,Fe.TRIANGLES,I,p.stencilModeForClipping(ot),O,Ye.disabled,Si,d.id,mt.layoutVertexBuffer,mt.indexBuffer,mt.segments,d.paint,p.transform.zoom,kt,mt.layoutVertexBuffer2),_e=!1}}}}},fill:function(p,v,d,y){var S=d.paint.get("fill-color"),C=d.paint.get("fill-opacity");if(C.constantOr(1)!==0){var I=p.colorModeForRenderPass(),O=d.paint.get("fill-pattern"),z=p.opaquePassEnabledForLayer()&&!O.constantOr(1)&&S.constantOr(a.Color.transparent).a===1&&C.constantOr(0)===1?"opaque":"translucent";if(p.renderPass===z){var X=p.depthModeForSublayer(1,p.renderPass==="opaque"?ce.ReadWrite:ce.ReadOnly);Rc(p,v,d,y,X,I,!1)}if(p.renderPass==="translucent"&&d.paint.get("fill-antialias")){var ne=p.depthModeForSublayer(d.getPaintProperty("fill-outline-color")?2:0,ce.ReadOnly);Rc(p,v,d,y,ne,I,!0)}}},"fill-extrusion":function(p,v,d,y){var S=d.paint.get("fill-extrusion-opacity");if(S!==0&&p.renderPass==="translucent"){var C=new ce(p.context.gl.LEQUAL,ce.ReadWrite,p.depthRangeFor3D);if(S!==1||d.paint.get("fill-extrusion-pattern").constantOr(1))wf(p,v,d,y,C,Ee.disabled,je.disabled),wf(p,v,d,y,C,p.stencilModeFor3D(),p.colorModeForRenderPass());else{var I=p.colorModeForRenderPass();wf(p,v,d,y,C,Ee.disabled,I)}}},hillshade:function(p,v,d,y){if(p.renderPass==="offscreen"||p.renderPass==="translucent"){for(var S=p.context,C=p.depthModeForSublayer(0,ce.ReadOnly),I=p.colorModeForRenderPass(),O=p.renderPass==="translucent"?p.stencilConfigForOverlap(y):[{},y],z=O[0],X=0,ne=O[1];X<ne.length;X+=1){var ae=ne[X],oe=v.getTile(ae);oe.needsHillshadePrepare&&p.renderPass==="offscreen"?F0(p,oe,d,C,Ee.disabled,I):p.renderPass==="translucent"&&Cl(p,oe,d,C,z[ae.overscaledZ],I)}S.viewport.set([0,0,p.width,p.height])}},raster:function(p,v,d,y){if(p.renderPass==="translucent"&&d.paint.get("raster-opacity")!==0&&y.length)for(var S=p.context,C=S.gl,I=v.getSource(),O=p.useProgram("raster"),z=p.colorModeForRenderPass(),X=I instanceof nt?[{},y]:p.stencilConfigForOverlap(y),ne=X[0],ae=X[1],oe=ae[ae.length-1].overscaledZ,we=!p.options.moving,be=0,Fe=ae;be<Fe.length;be+=1){var _e=Fe[be],De=p.depthModeForSublayer(_e.overscaledZ-oe,d.paint.get("raster-opacity")===1?ce.ReadWrite:ce.ReadOnly,C.LESS),Xe=v.getTile(_e),ot=p.transform.calculatePosMatrix(_e.toUnwrapped(),we);Xe.registerFadeDuration(d.paint.get("raster-fade-duration"));var Ct=v.findLoadedParent(_e,0),mt=yh(Xe,Ct,v,d,p.transform),kt=void 0,qt=void 0,Tr=d.paint.get("raster-resampling")==="nearest"?C.NEAREST:C.LINEAR;S.activeTexture.set(C.TEXTURE0),Xe.texture.bind(Tr,C.CLAMP_TO_EDGE,C.LINEAR_MIPMAP_NEAREST),S.activeTexture.set(C.TEXTURE1),Ct?(Ct.texture.bind(Tr,C.CLAMP_TO_EDGE,C.LINEAR_MIPMAP_NEAREST),kt=Math.pow(2,Ct.tileID.overscaledZ-Xe.tileID.overscaledZ),qt=[Xe.tileID.canonical.x*kt%1,Xe.tileID.canonical.y*kt%1]):Xe.texture.bind(Tr,C.CLAMP_TO_EDGE,C.LINEAR_MIPMAP_NEAREST);var yr=kp(ot,qt||[0,0],kt||1,mt,d);I instanceof nt?O.draw(S,C.TRIANGLES,De,Ee.disabled,z,Ye.disabled,yr,d.id,I.boundsBuffer,p.quadTriangleIndexBuffer,I.boundsSegments):O.draw(S,C.TRIANGLES,De,ne[_e.overscaledZ],z,Ye.disabled,yr,d.id,p.rasterBoundsBuffer,p.quadTriangleIndexBuffer,p.rasterBoundsSegments)}},background:function(p,v,d){var y=d.paint.get("background-color"),S=d.paint.get("background-opacity");if(S!==0){var C=p.context,I=C.gl,O=p.transform,z=O.tileSize,X=d.paint.get("background-pattern");if(!p.isPatternMissing(X)){var ne=!X&&y.a===1&&S===1&&p.opaquePassEnabledForLayer()?"opaque":"translucent";if(p.renderPass===ne){var ae=Ee.disabled,oe=p.depthModeForSublayer(0,ne==="opaque"?ce.ReadWrite:ce.ReadOnly),we=p.colorModeForRenderPass(),be=p.useProgram(X?"backgroundPattern":"background"),Fe=O.coveringTiles({tileSize:z});X&&(C.activeTexture.set(I.TEXTURE0),p.imageManager.bind(p.context));for(var _e=d.getCrossfadeParameters(),De=0,Xe=Fe;De<Xe.length;De+=1){var ot=Xe[De],Ct=p.transform.calculatePosMatrix(ot.toUnwrapped()),mt=X?tc(Ct,S,p,X,{tileID:ot,tileSize:z},_e):ec(Ct,S,y);be.draw(C,I.TRIANGLES,oe,ae,we,Ye.disabled,mt,d.id,p.tileExtentBuffer,p.quadTriangleIndexBuffer,p.tileExtentSegments)}}}}},debug:function(p,v,d){for(var y=0;y<d.length;y++)$p(p,v,d[y])},custom:function(p,v,d){var y=p.context,S=d.implementation;if(p.renderPass==="offscreen"){var C=S.prerender;C&&(p.setCustomLayerDefaults(),y.setColorMode(p.colorModeForRenderPass()),C.call(S,y.gl,p.transform.customLayerMatrix()),y.setDirty(),p.setBaseState())}else if(p.renderPass==="translucent"){p.setCustomLayerDefaults(),y.setColorMode(p.colorModeForRenderPass()),y.setStencilMode(Ee.disabled);var I=S.renderingMode==="3d"?new ce(p.context.gl.LEQUAL,ce.ReadWrite,p.depthRangeFor3D):p.depthModeForSublayer(0,ce.ReadOnly);y.setDepthMode(I),S.render(y.gl,p.transform.customLayerMatrix()),y.setDirty(),p.setBaseState(),y.bindFramebuffer.set(null)}}},ra=function(p,v){this.context=new ie(p),this.transform=v,this._tileTextures={},this.setup(),this.numSublayers=Ce.maxUnderzooming+Ce.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new gl,this.gpuTimers={}};ra.prototype.resize=function(p,v){if(this.width=p*a.browser.devicePixelRatio,this.height=v*a.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var d=0,y=this.style._order;d<y.length;d+=1)this.style._layers[y[d]].resize()},ra.prototype.setup=function(){var p=this.context,v=new a.StructArrayLayout2i4;v.emplaceBack(0,0),v.emplaceBack(a.EXTENT,0),v.emplaceBack(0,a.EXTENT),v.emplaceBack(a.EXTENT,a.EXTENT),this.tileExtentBuffer=p.createVertexBuffer(v,Ra.members),this.tileExtentSegments=a.SegmentVector.simpleSegment(0,0,4,2);var d=new a.StructArrayLayout2i4;d.emplaceBack(0,0),d.emplaceBack(a.EXTENT,0),d.emplaceBack(0,a.EXTENT),d.emplaceBack(a.EXTENT,a.EXTENT),this.debugBuffer=p.createVertexBuffer(d,Ra.members),this.debugSegments=a.SegmentVector.simpleSegment(0,0,4,5);var y=new a.StructArrayLayout4i8;y.emplaceBack(0,0,0,0),y.emplaceBack(a.EXTENT,0,a.EXTENT,0),y.emplaceBack(0,a.EXTENT,0,a.EXTENT),y.emplaceBack(a.EXTENT,a.EXTENT,a.EXTENT,a.EXTENT),this.rasterBoundsBuffer=p.createVertexBuffer(y,dt.members),this.rasterBoundsSegments=a.SegmentVector.simpleSegment(0,0,4,2);var S=new a.StructArrayLayout2i4;S.emplaceBack(0,0),S.emplaceBack(1,0),S.emplaceBack(0,1),S.emplaceBack(1,1),this.viewportBuffer=p.createVertexBuffer(S,Ra.members),this.viewportSegments=a.SegmentVector.simpleSegment(0,0,4,2);var C=new a.StructArrayLayout1ui2;C.emplaceBack(0),C.emplaceBack(1),C.emplaceBack(3),C.emplaceBack(2),C.emplaceBack(0),this.tileBorderIndexBuffer=p.createIndexBuffer(C);var I=new a.StructArrayLayout3ui6;I.emplaceBack(0,1,2),I.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=p.createIndexBuffer(I),this.emptyTexture=new a.Texture(p,{width:1,height:1,data:new Uint8Array([0,0,0,0])},p.gl.RGBA);var O=this.context.gl;this.stencilClearMode=new Ee({func:O.ALWAYS,mask:0},0,255,O.ZERO,O.ZERO,O.ZERO)},ra.prototype.clearStencil=function(){var p=this.context,v=p.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var d=a.create();a.ortho(d,0,this.width,this.height,0,0,1),a.scale(d,d,[v.drawingBufferWidth,v.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(p,v.TRIANGLES,ce.disabled,this.stencilClearMode,je.disabled,Ye.disabled,qu(d),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},ra.prototype._renderTileClippingMasks=function(p,v){if(this.currentStencilSource!==p.source&&p.isTileClipped()&&v&&v.length){this.currentStencilSource=p.source;var d=this.context,y=d.gl;this.nextStencilID+v.length>256&&this.clearStencil(),d.setColorMode(je.disabled),d.setDepthMode(ce.disabled);var S=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var C=0,I=v;C<I.length;C+=1){var O=I[C],z=this._tileClippingMaskIDs[O.key]=this.nextStencilID++;S.draw(d,y.TRIANGLES,ce.disabled,new Ee({func:y.ALWAYS,mask:0},z,255,y.KEEP,y.KEEP,y.REPLACE),je.disabled,Ye.disabled,qu(O.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},ra.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var p=this.nextStencilID++,v=this.context.gl;return new Ee({func:v.NOTEQUAL,mask:255},p,255,v.KEEP,v.KEEP,v.REPLACE)},ra.prototype.stencilModeForClipping=function(p){var v=this.context.gl;return new Ee({func:v.EQUAL,mask:255},this._tileClippingMaskIDs[p.key],0,v.KEEP,v.KEEP,v.REPLACE)},ra.prototype.stencilConfigForOverlap=function(p){var v,d=this.context.gl,y=p.sort(function(z,X){return X.overscaledZ-z.overscaledZ}),S=y[y.length-1].overscaledZ,C=y[0].overscaledZ-S+1;if(C>1){this.currentStencilSource=void 0,this.nextStencilID+C>256&&this.clearStencil();for(var I={},O=0;O<C;O++)I[O+S]=new Ee({func:d.GEQUAL,mask:255},O+this.nextStencilID,255,d.KEEP,d.KEEP,d.REPLACE);return this.nextStencilID+=C,[I,y]}return[(v={},v[S]=Ee.disabled,v),y]},ra.prototype.colorModeForRenderPass=function(){var p=this.context.gl;return this._showOverdrawInspector?new je([p.CONSTANT_COLOR,p.ONE],new a.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?je.unblended:je.alphaBlended},ra.prototype.depthModeForSublayer=function(p,v,d){if(!this.opaquePassEnabledForLayer())return ce.disabled;var y=1-((1+this.currentLayer)*this.numSublayers+p)*this.depthEpsilon;return new ce(d||this.context.gl.LEQUAL,v,[y,y])},ra.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},ra.prototype.render=function(p,v){var d=this;this.style=p,this.options=v,this.lineAtlas=p.lineAtlas,this.imageManager=p.imageManager,this.glyphManager=p.glyphManager,this.symbolFadeChange=p.placement.symbolFadeChange(a.browser.now()),this.imageManager.beginFrame();var y=this.style._order,S=this.style.sourceCaches;for(var C in S){var I=S[C];I.used&&I.prepare(this.context)}var O,z,X={},ne={},ae={};for(var oe in S){var we=S[oe];X[oe]=we.getVisibleCoordinates(),ne[oe]=X[oe].slice().reverse(),ae[oe]=we.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var be=0;be<y.length;be++)if(this.style._layers[y[be]].is3D()){this.opaquePassCutoff=be;break}this.renderPass="offscreen";for(var Fe=0,_e=y;Fe<_e.length;Fe+=1){var De=this.style._layers[_e[Fe]];if(De.hasOffscreenPass()&&!De.isHidden(this.transform.zoom)){var Xe=ne[De.source];(De.type==="custom"||Xe.length)&&this.renderLayer(this,S[De.source],De,Xe)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:v.showOverdrawInspector?a.Color.black:a.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=v.showOverdrawInspector,this.depthRangeFor3D=[0,1-(p._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=y.length-1;this.currentLayer>=0;this.currentLayer--){var ot=this.style._layers[y[this.currentLayer]],Ct=S[ot.source],mt=X[ot.source];this._renderTileClippingMasks(ot,mt),this.renderLayer(this,Ct,ot,mt)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<y.length;this.currentLayer++){var kt=this.style._layers[y[this.currentLayer]],qt=S[kt.source],Tr=(kt.type==="symbol"?ae:ne)[kt.source];this._renderTileClippingMasks(kt,X[kt.source]),this.renderLayer(this,qt,kt,Tr)}this.options.showTileBoundaries&&(a.values(this.style._layers).forEach(function(yr){yr.source&&!yr.isHidden(d.transform.zoom)&&(yr.source!==(z&&z.id)&&(z=d.style.sourceCaches[yr.source]),(!O||O.getSource().maxzoom<z.getSource().maxzoom)&&(O=z))}),O&&Rl.debug(this,O,O.getVisibleCoordinates())),this.options.showPadding&&function(yr){var $r=yr.transform.padding;Cf(yr,yr.transform.height-($r.top||0),3,Np),Cf(yr,$r.bottom||0,3,xh),zp(yr,$r.left||0,3,G1),zp(yr,yr.transform.width-($r.right||0),3,bh);var vn=yr.transform.centerPoint;(function(bn,xn,Si,Yr){nc(bn,xn-1,Si-10,2,20,Yr),nc(bn,xn-10,Si-1,20,2,Yr)})(yr,vn.x,yr.transform.height-vn.y,Up)}(this),this.context.setDefault()},ra.prototype.renderLayer=function(p,v,d,y){d.isHidden(this.transform.zoom)||(d.type==="background"||d.type==="custom"||y.length)&&(this.id=d.id,this.gpuTimingStart(d),Rl[d.type](p,v,d,y,this.style.placement.variableOffsets),this.gpuTimingEnd())},ra.prototype.gpuTimingStart=function(p){if(this.options.gpuTiming){var v=this.context.extTimerQuery,d=this.gpuTimers[p.id];d||(d=this.gpuTimers[p.id]={calls:0,cpuTime:0,query:v.createQueryEXT()}),d.calls++,v.beginQueryEXT(v.TIME_ELAPSED_EXT,d.query)}},ra.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var p=this.context.extTimerQuery;p.endQueryEXT(p.TIME_ELAPSED_EXT)}},ra.prototype.collectGpuTimers=function(){var p=this.gpuTimers;return this.gpuTimers={},p},ra.prototype.queryGpuTimers=function(p){var v={};for(var d in p){var y=p[d],S=this.context.extTimerQuery,C=S.getQueryObjectEXT(y.query,S.QUERY_RESULT_EXT)/1e6;S.deleteQueryEXT(y.query),v[d]=C}return v},ra.prototype.translatePosMatrix=function(p,v,d,y,S){if(!d[0]&&!d[1])return p;var C=S?y==="map"?this.transform.angle:0:y==="viewport"?-this.transform.angle:0;if(C){var I=Math.sin(C),O=Math.cos(C);d=[d[0]*O-d[1]*I,d[0]*I+d[1]*O]}var z=[S?d[0]:Qi(v,d[0],this.transform.zoom),S?d[1]:Qi(v,d[1],this.transform.zoom),0],X=new Float32Array(16);return a.translate(X,p,z),X},ra.prototype.saveTileTexture=function(p){var v=this._tileTextures[p.size[0]];v?v.push(p):this._tileTextures[p.size[0]]=[p]},ra.prototype.getTileTexture=function(p){var v=this._tileTextures[p];return v&&v.length>0?v.pop():null},ra.prototype.isPatternMissing=function(p){if(!p)return!1;if(!p.from||!p.to)return!0;var v=this.imageManager.getPattern(p.from.toString()),d=this.imageManager.getPattern(p.to.toString());return!v||!d},ra.prototype.useProgram=function(p,v){this.cache=this.cache||{};var d=""+p+(v?v.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[d]||(this.cache[d]=new Ia(this.context,p,k0[p],v,Dp[p],this._showOverdrawInspector)),this.cache[d]},ra.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},ra.prototype.setBaseState=function(){var p=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(p.FUNC_ADD)},ra.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=a.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new a.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},ra.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Eh=function(p,v){this.points=p,this.planes=v};Eh.fromInvProjectionMatrix=function(p,v,d){var y=Math.pow(2,d),S=[[-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(function(I){return a.transformMat4([],I,p)}).map(function(I){return a.scale$1([],I,1/I[3]/v*y)}),C=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(I){var O=a.sub([],S[I[0]],S[I[1]]),z=a.sub([],S[I[2]],S[I[1]]),X=a.normalize([],a.cross([],O,z)),ne=-a.dot(X,S[I[1]]);return X.concat(ne)});return new Eh(S,C)};var Au=function(p,v){this.min=p,this.max=v,this.center=a.scale$2([],a.add([],this.min,this.max),.5)};Au.prototype.quadrant=function(p){for(var v=[p%2==0,p<2],d=a.clone$2(this.min),y=a.clone$2(this.max),S=0;S<v.length;S++)d[S]=v[S]?this.min[S]:this.center[S],y[S]=v[S]?this.center[S]:this.max[S];return y[2]=this.max[2],new Au(d,y)},Au.prototype.distanceX=function(p){return Math.max(Math.min(this.max[0],p[0]),this.min[0])-p[0]},Au.prototype.distanceY=function(p){return Math.max(Math.min(this.max[1],p[1]),this.min[1])-p[1]},Au.prototype.intersects=function(p){for(var v=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],d=!0,y=0;y<p.planes.length;y++){for(var S=p.planes[y],C=0,I=0;I<v.length;I++)C+=a.dot$1(S,v[I])>=0;if(C===0)return 0;C!==v.length&&(d=!1)}if(d)return 2;for(var O=0;O<3;O++){for(var z=Number.MAX_VALUE,X=-Number.MAX_VALUE,ne=0;ne<p.points.length;ne++){var ae=p.points[ne][O]-this.min[O];z=Math.min(z,ae),X=Math.max(X,ae)}if(X<0||z>this.max[O]-this.min[O])return 0}return 1};var Il=function(p,v,d,y){if(p===void 0&&(p=0),v===void 0&&(v=0),d===void 0&&(d=0),y===void 0&&(y=0),isNaN(p)||p<0||isNaN(v)||v<0||isNaN(d)||d<0||isNaN(y)||y<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=p,this.bottom=v,this.left=d,this.right=y};Il.prototype.interpolate=function(p,v,d){return v.top!=null&&p.top!=null&&(this.top=a.number(p.top,v.top,d)),v.bottom!=null&&p.bottom!=null&&(this.bottom=a.number(p.bottom,v.bottom,d)),v.left!=null&&p.left!=null&&(this.left=a.number(p.left,v.left,d)),v.right!=null&&p.right!=null&&(this.right=a.number(p.right,v.right,d)),this},Il.prototype.getCenter=function(p,v){var d=a.clamp((this.left+p-this.right)/2,0,p),y=a.clamp((this.top+v-this.bottom)/2,0,v);return new a.Point(d,y)},Il.prototype.equals=function(p){return this.top===p.top&&this.bottom===p.bottom&&this.left===p.left&&this.right===p.right},Il.prototype.clone=function(){return new Il(this.top,this.bottom,this.left,this.right)},Il.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var yi=function(p,v,d,y,S){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=S===void 0||S,this._minZoom=p||0,this._maxZoom=v||22,this._minPitch=d??0,this._maxPitch=y??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new a.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Il,this._posMatrixCache={},this._alignedPosMatrixCache={}},na={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};yi.prototype.clone=function(){var p=new yi(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return p.tileSize=this.tileSize,p.latRange=this.latRange,p.width=this.width,p.height=this.height,p._center=this._center,p.zoom=this.zoom,p.angle=this.angle,p._fov=this._fov,p._pitch=this._pitch,p._unmodified=this._unmodified,p._edgeInsets=this._edgeInsets.clone(),p._calcMatrices(),p},na.minZoom.get=function(){return this._minZoom},na.minZoom.set=function(p){this._minZoom!==p&&(this._minZoom=p,this.zoom=Math.max(this.zoom,p))},na.maxZoom.get=function(){return this._maxZoom},na.maxZoom.set=function(p){this._maxZoom!==p&&(this._maxZoom=p,this.zoom=Math.min(this.zoom,p))},na.minPitch.get=function(){return this._minPitch},na.minPitch.set=function(p){this._minPitch!==p&&(this._minPitch=p,this.pitch=Math.max(this.pitch,p))},na.maxPitch.get=function(){return this._maxPitch},na.maxPitch.set=function(p){this._maxPitch!==p&&(this._maxPitch=p,this.pitch=Math.min(this.pitch,p))},na.renderWorldCopies.get=function(){return this._renderWorldCopies},na.renderWorldCopies.set=function(p){p===void 0?p=!0:p===null&&(p=!1),this._renderWorldCopies=p},na.worldSize.get=function(){return this.tileSize*this.scale},na.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},na.size.get=function(){return new a.Point(this.width,this.height)},na.bearing.get=function(){return-this.angle/Math.PI*180},na.bearing.set=function(p){var v=-a.wrap(p,-180,180)*Math.PI/180;this.angle!==v&&(this._unmodified=!1,this.angle=v,this._calcMatrices(),this.rotationMatrix=a.create$2(),a.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},na.pitch.get=function(){return this._pitch/Math.PI*180},na.pitch.set=function(p){var v=a.clamp(p,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==v&&(this._unmodified=!1,this._pitch=v,this._calcMatrices())},na.fov.get=function(){return this._fov/Math.PI*180},na.fov.set=function(p){p=Math.max(.01,Math.min(60,p)),this._fov!==p&&(this._unmodified=!1,this._fov=p/180*Math.PI,this._calcMatrices())},na.zoom.get=function(){return this._zoom},na.zoom.set=function(p){var v=Math.min(Math.max(p,this.minZoom),this.maxZoom);this._zoom!==v&&(this._unmodified=!1,this._zoom=v,this.scale=this.zoomScale(v),this.tileZoom=Math.floor(v),this.zoomFraction=v-this.tileZoom,this._constrain(),this._calcMatrices())},na.center.get=function(){return this._center},na.center.set=function(p){p.lat===this._center.lat&&p.lng===this._center.lng||(this._unmodified=!1,this._center=p,this._constrain(),this._calcMatrices())},na.padding.get=function(){return this._edgeInsets.toJSON()},na.padding.set=function(p){this._edgeInsets.equals(p)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,p,1),this._calcMatrices())},na.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},yi.prototype.isPaddingEqual=function(p){return this._edgeInsets.equals(p)},yi.prototype.interpolatePadding=function(p,v,d){this._unmodified=!1,this._edgeInsets.interpolate(p,v,d),this._constrain(),this._calcMatrices()},yi.prototype.coveringZoomLevel=function(p){var v=(p.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/p.tileSize));return Math.max(0,v)},yi.prototype.getVisibleUnwrappedCoordinates=function(p){var v=[new a.UnwrappedTileID(0,p)];if(this._renderWorldCopies)for(var d=this.pointCoordinate(new a.Point(0,0)),y=this.pointCoordinate(new a.Point(this.width,0)),S=this.pointCoordinate(new a.Point(this.width,this.height)),C=this.pointCoordinate(new a.Point(0,this.height)),I=Math.floor(Math.min(d.x,y.x,S.x,C.x)),O=Math.floor(Math.max(d.x,y.x,S.x,C.x)),z=I-1;z<=O+1;z++)z!==0&&v.push(new a.UnwrappedTileID(z,p));return v},yi.prototype.coveringTiles=function(p){var v=this.coveringZoomLevel(p),d=v;if(p.minzoom!==void 0&&v<p.minzoom)return[];p.maxzoom!==void 0&&v>p.maxzoom&&(v=p.maxzoom);var y=a.MercatorCoordinate.fromLngLat(this.center),S=Math.pow(2,v),C=[S*y.x,S*y.y,0],I=Eh.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,v),O=p.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(O=v);var z=function(yr){return{aabb:new Au([yr*S,0,0],[(yr+1)*S,S,0]),zoom:0,x:0,y:0,wrap:yr,fullyVisible:!1}},X=[],ne=[],ae=v,oe=p.reparseOverscaled?d:v;if(this._renderWorldCopies)for(var we=1;we<=3;we++)X.push(z(-we)),X.push(z(we));for(X.push(z(0));X.length>0;){var be=X.pop(),Fe=be.x,_e=be.y,De=be.fullyVisible;if(!De){var Xe=be.aabb.intersects(I);if(Xe===0)continue;De=Xe===2}var ot=be.aabb.distanceX(C),Ct=be.aabb.distanceY(C),mt=Math.max(Math.abs(ot),Math.abs(Ct));if(be.zoom===ae||mt>3+(1<<ae-be.zoom)-2&&be.zoom>=O)ne.push({tileID:new a.OverscaledTileID(be.zoom===ae?oe:be.zoom,be.wrap,be.zoom,Fe,_e),distanceSq:a.sqrLen([C[0]-.5-Fe,C[1]-.5-_e])});else for(var kt=0;kt<4;kt++){var qt=(Fe<<1)+kt%2,Tr=(_e<<1)+(kt>>1);X.push({aabb:be.aabb.quadrant(kt),zoom:be.zoom+1,x:qt,y:Tr,wrap:be.wrap,fullyVisible:De})}}return ne.sort(function(yr,$r){return yr.distanceSq-$r.distanceSq}).map(function(yr){return yr.tileID})},yi.prototype.resize=function(p,v){this.width=p,this.height=v,this.pixelsToGLUnits=[2/p,-2/v],this._constrain(),this._calcMatrices()},na.unmodified.get=function(){return this._unmodified},yi.prototype.zoomScale=function(p){return Math.pow(2,p)},yi.prototype.scaleZoom=function(p){return Math.log(p)/Math.LN2},yi.prototype.project=function(p){var v=a.clamp(p.lat,-this.maxValidLatitude,this.maxValidLatitude);return new a.Point(a.mercatorXfromLng(p.lng)*this.worldSize,a.mercatorYfromLat(v)*this.worldSize)},yi.prototype.unproject=function(p){return new a.MercatorCoordinate(p.x/this.worldSize,p.y/this.worldSize).toLngLat()},na.point.get=function(){return this.project(this.center)},yi.prototype.setLocationAtPoint=function(p,v){var d=this.pointCoordinate(v),y=this.pointCoordinate(this.centerPoint),S=this.locationCoordinate(p),C=new a.MercatorCoordinate(S.x-(d.x-y.x),S.y-(d.y-y.y));this.center=this.coordinateLocation(C),this._renderWorldCopies&&(this.center=this.center.wrap())},yi.prototype.locationPoint=function(p){return this.coordinatePoint(this.locationCoordinate(p))},yi.prototype.pointLocation=function(p){return this.coordinateLocation(this.pointCoordinate(p))},yi.prototype.locationCoordinate=function(p){return a.MercatorCoordinate.fromLngLat(p)},yi.prototype.coordinateLocation=function(p){return p.toLngLat()},yi.prototype.pointCoordinate=function(p){var v=[p.x,p.y,0,1],d=[p.x,p.y,1,1];a.transformMat4(v,v,this.pixelMatrixInverse),a.transformMat4(d,d,this.pixelMatrixInverse);var y=v[3],S=d[3],C=v[1]/y,I=d[1]/S,O=v[2]/y,z=d[2]/S,X=O===z?0:(0-O)/(z-O);return new a.MercatorCoordinate(a.number(v[0]/y,d[0]/S,X)/this.worldSize,a.number(C,I,X)/this.worldSize)},yi.prototype.coordinatePoint=function(p){var v=[p.x*this.worldSize,p.y*this.worldSize,0,1];return a.transformMat4(v,v,this.pixelMatrix),new a.Point(v[0]/v[3],v[1]/v[3])},yi.prototype.getBounds=function(){return new a.LngLatBounds().extend(this.pointLocation(new a.Point(0,0))).extend(this.pointLocation(new a.Point(this.width,0))).extend(this.pointLocation(new a.Point(this.width,this.height))).extend(this.pointLocation(new a.Point(0,this.height)))},yi.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new a.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},yi.prototype.setMaxBounds=function(p){p?(this.lngRange=[p.getWest(),p.getEast()],this.latRange=[p.getSouth(),p.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},yi.prototype.calculatePosMatrix=function(p,v){v===void 0&&(v=!1);var d=p.key,y=v?this._alignedPosMatrixCache:this._posMatrixCache;if(y[d])return y[d];var S=p.canonical,C=this.worldSize/this.zoomScale(S.z),I=S.x+Math.pow(2,S.z)*p.wrap,O=a.identity(new Float64Array(16));return a.translate(O,O,[I*C,S.y*C,0]),a.scale(O,O,[C/a.EXTENT,C/a.EXTENT,1]),a.multiply(O,v?this.alignedProjMatrix:this.projMatrix,O),y[d]=new Float32Array(O),y[d]},yi.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},yi.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var p,v,d,y,S=-90,C=90,I=-180,O=180,z=this.size,X=this._unmodified;if(this.latRange){var ne=this.latRange;S=a.mercatorYfromLat(ne[1])*this.worldSize,p=(C=a.mercatorYfromLat(ne[0])*this.worldSize)-S<z.y?z.y/(C-S):0}if(this.lngRange){var ae=this.lngRange;I=a.mercatorXfromLng(ae[0])*this.worldSize,v=(O=a.mercatorXfromLng(ae[1])*this.worldSize)-I<z.x?z.x/(O-I):0}var oe=this.point,we=Math.max(v||0,p||0);if(we)return this.center=this.unproject(new a.Point(v?(O+I)/2:oe.x,p?(C+S)/2:oe.y)),this.zoom+=this.scaleZoom(we),this._unmodified=X,void(this._constraining=!1);if(this.latRange){var be=oe.y,Fe=z.y/2;be-Fe<S&&(y=S+Fe),be+Fe>C&&(y=C-Fe)}if(this.lngRange){var _e=oe.x,De=z.x/2;_e-De<I&&(d=I+De),_e+De>O&&(d=O-De)}d===void 0&&y===void 0||(this.center=this.unproject(new a.Point(d!==void 0?d:oe.x,y!==void 0?y:oe.y))),this._unmodified=X,this._constraining=!1}},yi.prototype._calcMatrices=function(){if(this.height){var p=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var v=Math.PI/2+this._pitch,d=this._fov*(.5+p.y/this.height),y=Math.sin(d)*this.cameraToCenterDistance/Math.sin(a.clamp(Math.PI-v-d,.01,Math.PI-.01)),S=this.point,C=S.x,I=S.y,O=1.01*(Math.cos(Math.PI/2-this._pitch)*y+this.cameraToCenterDistance),z=this.height/50,X=new Float64Array(16);a.perspective(X,this._fov,this.width/this.height,z,O),X[8]=2*-p.x/this.width,X[9]=2*p.y/this.height,a.scale(X,X,[1,-1,1]),a.translate(X,X,[0,0,-this.cameraToCenterDistance]),a.rotateX(X,X,this._pitch),a.rotateZ(X,X,this.angle),a.translate(X,X,[-C,-I,0]),this.mercatorMatrix=a.scale([],X,[this.worldSize,this.worldSize,this.worldSize]),a.scale(X,X,[1,1,a.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=X,this.invProjMatrix=a.invert([],this.projMatrix);var ne=this.width%2/2,ae=this.height%2/2,oe=Math.cos(this.angle),we=Math.sin(this.angle),be=C-Math.round(C)+oe*ne+we*ae,Fe=I-Math.round(I)+oe*ae+we*ne,_e=new Float64Array(X);if(a.translate(_e,_e,[be>.5?be-1:be,Fe>.5?Fe-1:Fe,0]),this.alignedProjMatrix=_e,X=a.create(),a.scale(X,X,[this.width/2,-this.height/2,1]),a.translate(X,X,[1,-1,0]),this.labelPlaneMatrix=X,X=a.create(),a.scale(X,X,[1,-1,1]),a.translate(X,X,[-1,-1,0]),a.scale(X,X,[2/this.width,2/this.height,1]),this.glCoordMatrix=X,this.pixelMatrix=a.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(X=a.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=X,this._posMatrixCache={},this._alignedPosMatrixCache={}}},yi.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var p=this.pointCoordinate(new a.Point(0,0)),v=[p.x*this.worldSize,p.y*this.worldSize,0,1];return a.transformMat4(v,v,this.pixelMatrix)[3]/this.cameraToCenterDistance},yi.prototype.getCameraPoint=function(){var p=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new a.Point(0,p))},yi.prototype.getCameraQueryGeometry=function(p){var v=this.getCameraPoint();if(p.length===1)return[p[0],v];for(var d=v.x,y=v.y,S=v.x,C=v.y,I=0,O=p;I<O.length;I+=1){var z=O[I];d=Math.min(d,z.x),y=Math.min(y,z.y),S=Math.max(S,z.x),C=Math.max(C,z.y)}return[new a.Point(d,y),new a.Point(S,y),new a.Point(S,C),new a.Point(d,C),new a.Point(d,y)]},Object.defineProperties(yi.prototype,na);var Is=function(p){var v,d,y,S;this._hashName=p&&encodeURIComponent(p),a.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(v=this._updateHashUnthrottled.bind(this),d=!1,y=null,S=function(){y=null,d&&(v(),y=setTimeout(S,300),d=!1)},function(){return d=!0,y||S(),y})};Is.prototype.addTo=function(p){return this._map=p,a.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Is.prototype.remove=function(){return a.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Is.prototype.getHashString=function(p){var v=this._map.getCenter(),d=Math.round(100*this._map.getZoom())/100,y=Math.ceil((d*Math.LN2+Math.log(512/360/.5))/Math.LN10),S=Math.pow(10,y),C=Math.round(v.lng*S)/S,I=Math.round(v.lat*S)/S,O=this._map.getBearing(),z=this._map.getPitch(),X="";if(X+=p?"/"+C+"/"+I+"/"+d:d+"/"+I+"/"+C,(O||z)&&(X+="/"+Math.round(10*O)/10),z&&(X+="/"+Math.round(z)),this._hashName){var ne=this._hashName,ae=!1,oe=a.window.location.hash.slice(1).split("&").map(function(we){var be=we.split("=")[0];return be===ne?(ae=!0,be+"="+X):we}).filter(function(we){return we});return ae||oe.push(ne+"="+X),"#"+oe.join("&")}return"#"+X},Is.prototype._getCurrentHash=function(){var p,v=this,d=a.window.location.hash.replace("#","");return this._hashName?(d.split("&").map(function(y){return y.split("=")}).forEach(function(y){y[0]===v._hashName&&(p=y)}),(p&&p[1]||"").split("/")):d.split("/")},Is.prototype._onHashChange=function(){var p=this._getCurrentHash();if(p.length>=3&&!p.some(function(d){return isNaN(d)})){var v=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(p[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+p[2],+p[1]],zoom:+p[0],bearing:v,pitch:+(p[4]||0)}),!0}return!1},Is.prototype._updateHashUnthrottled=function(){var p=a.window.location.href.replace(/(#.+)?$/,this.getHashString());try{a.window.history.replaceState(a.window.history.state,null,p)}catch{}};var Rf={linearity:.3,easing:a.bezier(0,0,.3,1)},Ic=a.extend({deceleration:2500,maxSpeed:1400},Rf),If=a.extend({deceleration:20,maxSpeed:1400},Rf),W1=a.extend({deceleration:1e3,maxSpeed:360},Rf),Sh=a.extend({deceleration:1e3,maxSpeed:90},Rf),Mf=function(p){this._map=p,this.clear()};function Ml(p,v){(!p.duration||p.duration<v.duration)&&(p.duration=v.duration,p.easing=v.easing)}function io(p,v,d){var y=d.maxSpeed,S=d.linearity,C=d.deceleration,I=a.clamp(p*S/(v/1e3),-y,y),O=Math.abs(I)/(C*S);return{easing:d.easing,duration:1e3*O,amount:I*(O/2)}}Mf.prototype.clear=function(){this._inertiaBuffer=[]},Mf.prototype.record=function(p){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.browser.now(),settings:p})},Mf.prototype._drainInertiaBuffer=function(){for(var p=this._inertiaBuffer,v=a.browser.now();p.length>0&&v-p[0].time>160;)p.shift()},Mf.prototype._onMoveEnd=function(p){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var v={zoom:0,bearing:0,pitch:0,pan:new a.Point(0,0),pinchAround:void 0,around:void 0},d=0,y=this._inertiaBuffer;d<y.length;d+=1){var S=y[d].settings;v.zoom+=S.zoomDelta||0,v.bearing+=S.bearingDelta||0,v.pitch+=S.pitchDelta||0,S.panDelta&&v.pan._add(S.panDelta),S.around&&(v.around=S.around),S.pinchAround&&(v.pinchAround=S.pinchAround)}var C=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,I={};if(v.pan.mag()){var O=io(v.pan.mag(),C,a.extend({},Ic,p||{}));I.offset=v.pan.mult(O.amount/v.pan.mag()),I.center=this._map.transform.center,Ml(I,O)}if(v.zoom){var z=io(v.zoom,C,If);I.zoom=this._map.transform.zoom+z.amount,Ml(I,z)}if(v.bearing){var X=io(v.bearing,C,W1);I.bearing=this._map.transform.bearing+a.clamp(X.amount,-179,179),Ml(I,X)}if(v.pitch){var ne=io(v.pitch,C,Sh);I.pitch=this._map.transform.pitch+ne.amount,Ml(I,ne)}if(I.zoom||I.bearing){var ae=v.pinchAround===void 0?v.around:v.pinchAround;I.around=ae?this._map.unproject(ae):this._map.getCenter()}return this.clear(),a.extend(I,{noMoveStart:!0})}};var ma=function(p){function v(y,S,C,I){I===void 0&&(I={});var O=c.mousePos(S.getCanvasContainer(),C),z=S.unproject(O);p.call(this,y,a.extend({point:O,lngLat:z,originalEvent:C},I)),this._defaultPrevented=!1,this.target=S}p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v;var d={defaultPrevented:{configurable:!0}};return v.prototype.preventDefault=function(){this._defaultPrevented=!0},d.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(v.prototype,d),v}(a.Event),Mc=function(p){function v(y,S,C){var I=y==="touchend"?C.changedTouches:C.touches,O=c.touchPos(S.getCanvasContainer(),I),z=O.map(function(ae){return S.unproject(ae)}),X=O.reduce(function(ae,oe,we,be){return ae.add(oe.div(be.length))},new a.Point(0,0)),ne=S.unproject(X);p.call(this,y,{points:O,point:X,lngLats:z,lngLat:ne,originalEvent:C}),this._defaultPrevented=!1}p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v;var d={defaultPrevented:{configurable:!0}};return v.prototype.preventDefault=function(){this._defaultPrevented=!0},d.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(v.prototype,d),v}(a.Event),Vp=function(p){function v(y,S,C){p.call(this,y,{originalEvent:C}),this._defaultPrevented=!1}p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v;var d={defaultPrevented:{configurable:!0}};return v.prototype.preventDefault=function(){this._defaultPrevented=!0},d.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(v.prototype,d),v}(a.Event),Da=function(p,v){this._map=p,this._clickTolerance=v.clickTolerance};Da.prototype.reset=function(){delete this._mousedownPos},Da.prototype.wheel=function(p){return this._firePreventable(new Vp(p.type,this._map,p))},Da.prototype.mousedown=function(p,v){return this._mousedownPos=v,this._firePreventable(new ma(p.type,this._map,p))},Da.prototype.mouseup=function(p){this._map.fire(new ma(p.type,this._map,p))},Da.prototype.click=function(p,v){this._mousedownPos&&this._mousedownPos.dist(v)>=this._clickTolerance||this._map.fire(new ma(p.type,this._map,p))},Da.prototype.dblclick=function(p){return this._firePreventable(new ma(p.type,this._map,p))},Da.prototype.mouseover=function(p){this._map.fire(new ma(p.type,this._map,p))},Da.prototype.mouseout=function(p){this._map.fire(new ma(p.type,this._map,p))},Da.prototype.touchstart=function(p){return this._firePreventable(new Mc(p.type,this._map,p))},Da.prototype.touchmove=function(p){this._map.fire(new Mc(p.type,this._map,p))},Da.prototype.touchend=function(p){this._map.fire(new Mc(p.type,this._map,p))},Da.prototype.touchcancel=function(p){this._map.fire(new Mc(p.type,this._map,p))},Da.prototype._firePreventable=function(p){if(this._map.fire(p),p.defaultPrevented)return{}},Da.prototype.isEnabled=function(){return!0},Da.prototype.isActive=function(){return!1},Da.prototype.enable=function(){},Da.prototype.disable=function(){};var Kr=function(p){this._map=p};Kr.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Kr.prototype.mousemove=function(p){this._map.fire(new ma(p.type,this._map,p))},Kr.prototype.mousedown=function(){this._delayContextMenu=!0},Kr.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ma("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Kr.prototype.contextmenu=function(p){this._delayContextMenu?this._contextMenuEvent=p:this._map.fire(new ma(p.type,this._map,p)),this._map.listens("contextmenu")&&p.preventDefault()},Kr.prototype.isEnabled=function(){return!0},Kr.prototype.isActive=function(){return!1},Kr.prototype.enable=function(){},Kr.prototype.disable=function(){};var is=function(p,v){this._map=p,this._el=p.getCanvasContainer(),this._container=p.getContainer(),this._clickTolerance=v.clickTolerance||1};function Pf(p,v){for(var d={},y=0;y<p.length;y++)d[p[y].identifier]=v[y];return d}is.prototype.isEnabled=function(){return!!this._enabled},is.prototype.isActive=function(){return!!this._active},is.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},is.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},is.prototype.mousedown=function(p,v){this.isEnabled()&&p.shiftKey&&p.button===0&&(c.disableDrag(),this._startPos=this._lastPos=v,this._active=!0)},is.prototype.mousemoveWindow=function(p,v){if(this._active){var d=v;if(!(this._lastPos.equals(d)||!this._box&&d.dist(this._startPos)<this._clickTolerance)){var y=this._startPos;this._lastPos=d,this._box||(this._box=c.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",p));var S=Math.min(y.x,d.x),C=Math.max(y.x,d.x),I=Math.min(y.y,d.y),O=Math.max(y.y,d.y);c.setTransform(this._box,"translate("+S+"px,"+I+"px)"),this._box.style.width=C-S+"px",this._box.style.height=O-I+"px"}}},is.prototype.mouseupWindow=function(p,v){var d=this;if(this._active&&p.button===0){var y=this._startPos,S=v;if(this.reset(),c.suppressClick(),y.x!==S.x||y.y!==S.y)return this._map.fire(new a.Event("boxzoomend",{originalEvent:p})),{cameraAnimation:function(C){return C.fitScreenCoordinates(y,S,d._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",p)}},is.prototype.keydown=function(p){this._active&&p.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",p))},is.prototype.blur=function(){this.reset()},is.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(c.remove(this._box),this._box=null),c.enableDrag(),delete this._startPos,delete this._lastPos},is.prototype._fireEvent=function(p,v){return this._map.fire(new a.Event(p,{originalEvent:v}))};var Pc=function(p){this.reset(),this.numTouches=p.numTouches};Pc.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Pc.prototype.touchstart=function(p,v,d){(this.centroid||d.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=p.timeStamp),d.length===this.numTouches&&(this.centroid=function(y){for(var S=new a.Point(0,0),C=0,I=y;C<I.length;C+=1)S._add(I[C]);return S.div(y.length)}(v),this.touches=Pf(d,v)))},Pc.prototype.touchmove=function(p,v,d){if(!this.aborted&&this.centroid){var y=Pf(d,v);for(var S in this.touches){var C=y[S];(!C||C.dist(this.touches[S])>30)&&(this.aborted=!0)}}},Pc.prototype.touchend=function(p,v,d){if((!this.centroid||p.timeStamp-this.startTime>500)&&(this.aborted=!0),d.length===0){var y=!this.aborted&&this.centroid;if(this.reset(),y)return y}};var Wo=function(p){this.singleTap=new Pc(p),this.numTaps=p.numTaps,this.reset()};Wo.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Wo.prototype.touchstart=function(p,v,d){this.singleTap.touchstart(p,v,d)},Wo.prototype.touchmove=function(p,v,d){this.singleTap.touchmove(p,v,d)},Wo.prototype.touchend=function(p,v,d){var y=this.singleTap.touchend(p,v,d);if(y){var S=p.timeStamp-this.lastTime<500,C=!this.lastTap||this.lastTap.dist(y)<30;if(S&&C||this.reset(),this.count++,this.lastTime=p.timeStamp,this.lastTap=y,this.count===this.numTaps)return this.reset(),y}};var Yi=function(){this._zoomIn=new Wo({numTouches:1,numTaps:2}),this._zoomOut=new Wo({numTouches:2,numTaps:1}),this.reset()};Yi.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Yi.prototype.touchstart=function(p,v,d){this._zoomIn.touchstart(p,v,d),this._zoomOut.touchstart(p,v,d)},Yi.prototype.touchmove=function(p,v,d){this._zoomIn.touchmove(p,v,d),this._zoomOut.touchmove(p,v,d)},Yi.prototype.touchend=function(p,v,d){var y=this,S=this._zoomIn.touchend(p,v,d),C=this._zoomOut.touchend(p,v,d);return S?(this._active=!0,p.preventDefault(),setTimeout(function(){return y.reset()},0),{cameraAnimation:function(I){return I.easeTo({duration:300,zoom:I.getZoom()+1,around:I.unproject(S)},{originalEvent:p})}}):C?(this._active=!0,p.preventDefault(),setTimeout(function(){return y.reset()},0),{cameraAnimation:function(I){return I.easeTo({duration:300,zoom:I.getZoom()-1,around:I.unproject(C)},{originalEvent:p})}}):void 0},Yi.prototype.touchcancel=function(){this.reset()},Yi.prototype.enable=function(){this._enabled=!0},Yi.prototype.disable=function(){this._enabled=!1,this.reset()},Yi.prototype.isEnabled=function(){return this._enabled},Yi.prototype.isActive=function(){return this._active};var Ah={0:1,2:2},Dr=function(p){this.reset(),this._clickTolerance=p.clickTolerance||1};Dr.prototype.blur=function(){this.reset()},Dr.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Dr.prototype._correctButton=function(p,v){return!1},Dr.prototype._move=function(p,v){return{}},Dr.prototype.mousedown=function(p,v){if(!this._lastPoint){var d=c.mouseButton(p);this._correctButton(p,d)&&(this._lastPoint=v,this._eventButton=d)}},Dr.prototype.mousemoveWindow=function(p,v){var d=this._lastPoint;if(d){if(p.preventDefault(),function(y,S){var C=Ah[S];return y.buttons===void 0||(y.buttons&C)!==C}(p,this._eventButton))this.reset();else if(this._moved||!(v.dist(d)<this._clickTolerance))return this._moved=!0,this._lastPoint=v,this._move(d,v)}},Dr.prototype.mouseupWindow=function(p){this._lastPoint&&c.mouseButton(p)===this._eventButton&&(this._moved&&c.suppressClick(),this.reset())},Dr.prototype.enable=function(){this._enabled=!0},Dr.prototype.disable=function(){this._enabled=!1,this.reset()},Dr.prototype.isEnabled=function(){return this._enabled},Dr.prototype.isActive=function(){return this._active};var Qu=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.mousedown=function(d,y){p.prototype.mousedown.call(this,d,y),this._lastPoint&&(this._active=!0)},v.prototype._correctButton=function(d,y){return y===0&&!d.ctrlKey},v.prototype._move=function(d,y){return{around:y,panDelta:y.sub(d)}},v}(Dr),Of=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype._correctButton=function(d,y){return y===0&&d.ctrlKey||y===2},v.prototype._move=function(d,y){var S=.8*(y.x-d.x);if(S)return this._active=!0,{bearingDelta:S}},v.prototype.contextmenu=function(d){d.preventDefault()},v}(Dr),Th=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype._correctButton=function(d,y){return y===0&&d.ctrlKey||y===2},v.prototype._move=function(d,y){var S=-.5*(y.y-d.y);if(S)return this._active=!0,{pitchDelta:S}},v.prototype.contextmenu=function(d){d.preventDefault()},v}(Dr),Gs=function(p){this._minTouches=1,this._clickTolerance=p.clickTolerance||1,this.reset()};Gs.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new a.Point(0,0)},Gs.prototype.touchstart=function(p,v,d){return this._calculateTransform(p,v,d)},Gs.prototype.touchmove=function(p,v,d){if(this._active&&!(d.length<this._minTouches))return p.preventDefault(),this._calculateTransform(p,v,d)},Gs.prototype.touchend=function(p,v,d){this._calculateTransform(p,v,d),this._active&&d.length<this._minTouches&&this.reset()},Gs.prototype.touchcancel=function(){this.reset()},Gs.prototype._calculateTransform=function(p,v,d){d.length>0&&(this._active=!0);var y=Pf(d,v),S=new a.Point(0,0),C=new a.Point(0,0),I=0;for(var O in y){var z=y[O],X=this._touches[O];X&&(S._add(z),C._add(z.sub(X)),I++,y[O]=z)}if(this._touches=y,!(I<this._minTouches)&&C.mag()){var ne=C.div(I);if(this._sum._add(ne),!(this._sum.mag()<this._clickTolerance))return{around:S.div(I),panDelta:ne}}},Gs.prototype.enable=function(){this._enabled=!0},Gs.prototype.disable=function(){this._enabled=!1,this.reset()},Gs.prototype.isEnabled=function(){return this._enabled},Gs.prototype.isActive=function(){return this._active};var gs=function(){this.reset()};function wh(p,v,d){for(var y=0;y<p.length;y++)if(p[y].identifier===d)return v[y]}function Ch(p,v){return Math.log(p/v)/Math.LN2}gs.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},gs.prototype._start=function(p){},gs.prototype._move=function(p,v,d){return{}},gs.prototype.touchstart=function(p,v,d){this._firstTwoTouches||d.length<2||(this._firstTwoTouches=[d[0].identifier,d[1].identifier],this._start([v[0],v[1]]))},gs.prototype.touchmove=function(p,v,d){if(this._firstTwoTouches){p.preventDefault();var y=this._firstTwoTouches,S=y[1],C=wh(d,v,y[0]),I=wh(d,v,S);if(C&&I){var O=this._aroundCenter?null:C.add(I).div(2);return this._move([C,I],O,p)}}},gs.prototype.touchend=function(p,v,d){if(this._firstTwoTouches){var y=this._firstTwoTouches,S=y[1],C=wh(d,v,y[0]),I=wh(d,v,S);C&&I||(this._active&&c.suppressClick(),this.reset())}},gs.prototype.touchcancel=function(){this.reset()},gs.prototype.enable=function(p){this._enabled=!0,this._aroundCenter=!!p&&p.around==="center"},gs.prototype.disable=function(){this._enabled=!1,this.reset()},gs.prototype.isEnabled=function(){return this._enabled},gs.prototype.isActive=function(){return this._active};var Xo=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.reset=function(){p.prototype.reset.call(this),delete this._distance,delete this._startDistance},v.prototype._start=function(d){this._startDistance=this._distance=d[0].dist(d[1])},v.prototype._move=function(d,y){var S=this._distance;if(this._distance=d[0].dist(d[1]),this._active||!(Math.abs(Ch(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Ch(this._distance,S),pinchAround:y}},v}(gs);function Tu(p,v){return 180*p.angleWith(v)/Math.PI}var X1=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.reset=function(){p.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},v.prototype._start=function(d){this._startVector=this._vector=d[0].sub(d[1]),this._minDiameter=d[0].dist(d[1])},v.prototype._move=function(d,y){var S=this._vector;if(this._vector=d[0].sub(d[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Tu(this._vector,S),pinchAround:y}},v.prototype._isBelowThreshold=function(d){this._minDiameter=Math.min(this._minDiameter,d.mag());var y=25/(Math.PI*this._minDiameter)*360,S=Tu(d,this._startVector);return Math.abs(S)<y},v}(gs);function Oc(p){return Math.abs(p.y)>Math.abs(p.x)}var Rh=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.reset=function(){p.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},v.prototype._start=function(d){this._lastPoints=d,Oc(d[0].sub(d[1]))&&(this._valid=!1)},v.prototype._move=function(d,y,S){var C=d[0].sub(this._lastPoints[0]),I=d[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(C,I,S.timeStamp),this._valid)return this._lastPoints=d,this._active=!0,{pitchDelta:(C.y+I.y)/2*-.5}},v.prototype.gestureBeginsVertically=function(d,y,S){if(this._valid!==void 0)return this._valid;var C=d.mag()>=2,I=y.mag()>=2;if(C||I){if(!C||!I)return this._firstMove===void 0&&(this._firstMove=S),S-this._firstMove<100&&void 0;var O=d.y>0==y.y>0;return Oc(d)&&Oc(y)&&O}},v}(gs),jp={panStep:100,bearingStep:15,pitchStep:10},_s=function(){var p=jp;this._panStep=p.panStep,this._bearingStep=p.bearingStep,this._pitchStep=p.pitchStep,this._rotationDisabled=!1};function Ms(p){return p*(2-p)}_s.prototype.blur=function(){this.reset()},_s.prototype.reset=function(){this._active=!1},_s.prototype.keydown=function(p){var v=this;if(!(p.altKey||p.ctrlKey||p.metaKey)){var d=0,y=0,S=0,C=0,I=0;switch(p.keyCode){case 61:case 107:case 171:case 187:d=1;break;case 189:case 109:case 173:d=-1;break;case 37:p.shiftKey?y=-1:(p.preventDefault(),C=-1);break;case 39:p.shiftKey?y=1:(p.preventDefault(),C=1);break;case 38:p.shiftKey?S=1:(p.preventDefault(),I=-1);break;case 40:p.shiftKey?S=-1:(p.preventDefault(),I=1);break;default:return}return this._rotationDisabled&&(y=0,S=0),{cameraAnimation:function(O){var z=O.getZoom();O.easeTo({duration:300,easeId:"keyboardHandler",easing:Ms,zoom:d?Math.round(z)+d*(p.shiftKey?2:1):z,bearing:O.getBearing()+y*v._bearingStep,pitch:O.getPitch()+S*v._pitchStep,offset:[-C*v._panStep,-I*v._panStep],center:O.getCenter()},{originalEvent:p})}}}},_s.prototype.enable=function(){this._enabled=!0},_s.prototype.disable=function(){this._enabled=!1,this.reset()},_s.prototype.isEnabled=function(){return this._enabled},_s.prototype.isActive=function(){return this._active},_s.prototype.disableRotation=function(){this._rotationDisabled=!0},_s.prototype.enableRotation=function(){this._rotationDisabled=!1};var Zn=function(p,v){this._map=p,this._el=p.getCanvasContainer(),this._handler=v,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,a.bindAll(["_onTimeout"],this)};Zn.prototype.setZoomRate=function(p){this._defaultZoomRate=p},Zn.prototype.setWheelZoomRate=function(p){this._wheelZoomRate=p},Zn.prototype.isEnabled=function(){return!!this._enabled},Zn.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},Zn.prototype.isZooming=function(){return!!this._zooming},Zn.prototype.enable=function(p){this.isEnabled()||(this._enabled=!0,this._aroundCenter=p&&p.around==="center")},Zn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Zn.prototype.wheel=function(p){if(this.isEnabled()){var v=p.deltaMode===a.window.WheelEvent.DOM_DELTA_LINE?40*p.deltaY:p.deltaY,d=a.browser.now(),y=d-(this._lastWheelEventTime||0);this._lastWheelEventTime=d,v!==0&&v%4.000244140625==0?this._type="wheel":v!==0&&Math.abs(v)<4?this._type="trackpad":y>400?(this._type=null,this._lastValue=v,this._timeout=setTimeout(this._onTimeout,40,p)):this._type||(this._type=Math.abs(y*v)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,v+=this._lastValue)),p.shiftKey&&v&&(v/=4),this._type&&(this._lastWheelEvent=p,this._delta-=v,this._active||this._start(p)),p.preventDefault()}},Zn.prototype._onTimeout=function(p){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(p)},Zn.prototype._start=function(p){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var v=c.mousePos(this._el,p);this._around=a.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(v)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},Zn.prototype.renderFrame=function(){var p=this;if(this._frameId&&(this._frameId=null,this.isActive())){var v=this._map.transform;if(this._delta!==0){var d=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,y=2/(1+Math.exp(-Math.abs(this._delta*d)));this._delta<0&&y!==0&&(y=1/y);var S=typeof this._targetZoom=="number"?v.zoomScale(this._targetZoom):v.scale;this._targetZoom=Math.min(v.maxZoom,Math.max(v.minZoom,v.scaleZoom(S*y))),this._type==="wheel"&&(this._startZoom=v.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var C,I=typeof this._targetZoom=="number"?this._targetZoom:v.zoom,O=this._startZoom,z=this._easing,X=!1;if(this._type==="wheel"&&O&&z){var ne=Math.min((a.browser.now()-this._lastWheelEventTime)/200,1),ae=z(ne);C=a.number(O,I,ae),ne<1?this._frameId||(this._frameId=!0):X=!0}else C=I,X=!0;return this._active=!0,X&&(this._active=!1,this._finishTimeout=setTimeout(function(){p._zooming=!1,p._handler._triggerRenderFrame(),delete p._targetZoom,delete p._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!X,zoomDelta:C-v.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},Zn.prototype._smoothOutEasing=function(p){var v=a.ease;if(this._prevEase){var d=this._prevEase,y=(a.browser.now()-d.start)/d.duration,S=d.easing(y+.01)-d.easing(y),C=.27/Math.sqrt(S*S+1e-4)*.01,I=Math.sqrt(.0729-C*C);v=a.bezier(C,I,.25,1)}return this._prevEase={start:a.browser.now(),duration:p,easing:v},v},Zn.prototype.blur=function(){this.reset()},Zn.prototype.reset=function(){this._active=!1};var Ps=function(p,v){this._clickZoom=p,this._tapZoom=v};Ps.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Ps.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Ps.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Ps.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var Os=function(){this.reset()};Os.prototype.reset=function(){this._active=!1},Os.prototype.blur=function(){this.reset()},Os.prototype.dblclick=function(p,v){return p.preventDefault(),{cameraAnimation:function(d){d.easeTo({duration:300,zoom:d.getZoom()+(p.shiftKey?-1:1),around:d.unproject(v)},{originalEvent:p})}}},Os.prototype.enable=function(){this._enabled=!0},Os.prototype.disable=function(){this._enabled=!1,this.reset()},Os.prototype.isEnabled=function(){return this._enabled},Os.prototype.isActive=function(){return this._active};var go=function(){this._tap=new Wo({numTouches:1,numTaps:1}),this.reset()};go.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},go.prototype.touchstart=function(p,v,d){this._swipePoint||(this._tapTime&&p.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?d.length>0&&(this._swipePoint=v[0],this._swipeTouch=d[0].identifier):this._tap.touchstart(p,v,d))},go.prototype.touchmove=function(p,v,d){if(this._tapTime){if(this._swipePoint){if(d[0].identifier!==this._swipeTouch)return;var y=v[0],S=y.y-this._swipePoint.y;return this._swipePoint=y,p.preventDefault(),this._active=!0,{zoomDelta:S/128}}}else this._tap.touchmove(p,v,d)},go.prototype.touchend=function(p,v,d){this._tapTime?this._swipePoint&&d.length===0&&this.reset():this._tap.touchend(p,v,d)&&(this._tapTime=p.timeStamp)},go.prototype.touchcancel=function(){this.reset()},go.prototype.enable=function(){this._enabled=!0},go.prototype.disable=function(){this._enabled=!1,this.reset()},go.prototype.isEnabled=function(){return this._enabled},go.prototype.isActive=function(){return this._active};var Pl=function(p,v,d){this._el=p,this._mousePan=v,this._touchPan=d};Pl.prototype.enable=function(p){this._inertiaOptions=p||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Pl.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Pl.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Pl.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Ju=function(p,v,d){this._pitchWithRotate=p.pitchWithRotate,this._mouseRotate=v,this._mousePitch=d};Ju.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Ju.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Ju.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Ju.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Ws=function(p,v,d,y){this._el=p,this._touchZoom=v,this._touchRotate=d,this._tapDragZoom=y,this._rotationDisabled=!1,this._enabled=!0};Ws.prototype.enable=function(p){this._touchZoom.enable(p),this._rotationDisabled||this._touchRotate.enable(p),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Ws.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Ws.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Ws.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Ws.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Ws.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Lo=function(p){return p.zoom||p.drag||p.pitch||p.rotate},kc=function(p){function v(){p.apply(this,arguments)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v}(a.Event);function dn(p){return p.panDelta&&p.panDelta.mag()||p.zoomDelta||p.bearingDelta||p.pitchDelta}var nn=function(p,v){this._map=p,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Mf(p),this._bearingSnap=v.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(v),a.bindAll(["handleEvent","handleWindowEvent"],this);var d=this._el;this._listeners=[[d,"touchstart",{passive:!0}],[d,"touchmove",{passive:!1}],[d,"touchend",void 0],[d,"touchcancel",void 0],[d,"mousedown",void 0],[d,"mousemove",void 0],[d,"mouseup",void 0],[a.window.document,"mousemove",{capture:!0}],[a.window.document,"mouseup",void 0],[d,"mouseover",void 0],[d,"mouseout",void 0],[d,"dblclick",void 0],[d,"click",void 0],[d,"keydown",{capture:!1}],[d,"keyup",void 0],[d,"wheel",{passive:!1}],[d,"contextmenu",void 0],[a.window,"blur",void 0]];for(var y=0,S=this._listeners;y<S.length;y+=1){var C=S[y],I=C[0];c.addEventListener(I,C[1],I===a.window.document?this.handleWindowEvent:this.handleEvent,C[2])}};nn.prototype.destroy=function(){for(var p=0,v=this._listeners;p<v.length;p+=1){var d=v[p],y=d[0];c.removeEventListener(y,d[1],y===a.window.document?this.handleWindowEvent:this.handleEvent,d[2])}},nn.prototype._addDefaultHandlers=function(p){var v=this._map,d=v.getCanvasContainer();this._add("mapEvent",new Da(v,p));var y=v.boxZoom=new is(v,p);this._add("boxZoom",y);var S=new Yi,C=new Os;v.doubleClickZoom=new Ps(C,S),this._add("tapZoom",S),this._add("clickZoom",C);var I=new go;this._add("tapDragZoom",I);var O=v.touchPitch=new Rh;this._add("touchPitch",O);var z=new Of(p),X=new Th(p);v.dragRotate=new Ju(p,z,X),this._add("mouseRotate",z,["mousePitch"]),this._add("mousePitch",X,["mouseRotate"]);var ne=new Qu(p),ae=new Gs(p);v.dragPan=new Pl(d,ne,ae),this._add("mousePan",ne),this._add("touchPan",ae,["touchZoom","touchRotate"]);var oe=new X1,we=new Xo;v.touchZoomRotate=new Ws(d,we,oe,I),this._add("touchRotate",oe,["touchPan","touchZoom"]),this._add("touchZoom",we,["touchPan","touchRotate"]);var be=v.scrollZoom=new Zn(v,this);this._add("scrollZoom",be,["mousePan"]);var Fe=v.keyboard=new _s;this._add("keyboard",Fe),this._add("blockableMapEvent",new Kr(v));for(var _e=0,De=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];_e<De.length;_e+=1){var Xe=De[_e];p.interactive&&p[Xe]&&v[Xe].enable(p[Xe])}},nn.prototype._add=function(p,v,d){this._handlers.push({handlerName:p,handler:v,allowed:d}),this._handlersById[p]=v},nn.prototype.stop=function(p){if(!this._updatingCamera){for(var v=0,d=this._handlers;v<d.length;v+=1)d[v].handler.reset();this._inertia.clear(),this._fireEvents({},{},p),this._changes=[]}},nn.prototype.isActive=function(){for(var p=0,v=this._handlers;p<v.length;p+=1)if(v[p].handler.isActive())return!0;return!1},nn.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},nn.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},nn.prototype.isMoving=function(){return!!Lo(this._eventsInProgress)||this.isZooming()},nn.prototype._blockedByActive=function(p,v,d){for(var y in p)if(y!==d&&(!v||v.indexOf(y)<0))return!0;return!1},nn.prototype.handleWindowEvent=function(p){this.handleEvent(p,p.type+"Window")},nn.prototype._getMapTouches=function(p){for(var v=[],d=0,y=p;d<y.length;d+=1){var S=y[d];this._el.contains(S.target)&&v.push(S)}return v},nn.prototype.handleEvent=function(p,v){this._updatingCamera=!0;for(var d=p.type==="renderFrame"?void 0:p,y={needsRenderFrame:!1},S={},C={},I=p.touches?this._getMapTouches(p.touches):void 0,O=I?c.touchPos(this._el,I):c.mousePos(this._el,p),z=0,X=this._handlers;z<X.length;z+=1){var ne=X[z],ae=ne.handlerName,oe=ne.handler,we=ne.allowed;if(oe.isEnabled()){var be=void 0;this._blockedByActive(C,we,ae)?oe.reset():oe[v||p.type]&&(be=oe[v||p.type](p,O,I),this.mergeHandlerResult(y,S,be,ae,d),be&&be.needsRenderFrame&&this._triggerRenderFrame()),(be||oe.isActive())&&(C[ae]=oe)}}var Fe={};for(var _e in this._previousActiveHandlers)C[_e]||(Fe[_e]=d);this._previousActiveHandlers=C,(Object.keys(Fe).length||dn(y))&&(this._changes.push([y,S,Fe]),this._triggerRenderFrame()),(Object.keys(C).length||dn(y))&&this._map._stop(!0),this._updatingCamera=!1;var De=y.cameraAnimation;De&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],De(this._map))},nn.prototype.mergeHandlerResult=function(p,v,d,y,S){if(d){a.extend(p,d);var C={handlerName:y,originalEvent:d.originalEvent||S};d.zoomDelta!==void 0&&(v.zoom=C),d.panDelta!==void 0&&(v.drag=C),d.pitchDelta!==void 0&&(v.pitch=C),d.bearingDelta!==void 0&&(v.rotate=C)}},nn.prototype._applyChanges=function(){for(var p={},v={},d={},y=0,S=this._changes;y<S.length;y+=1){var C=S[y],I=C[0],O=C[1],z=C[2];I.panDelta&&(p.panDelta=(p.panDelta||new a.Point(0,0))._add(I.panDelta)),I.zoomDelta&&(p.zoomDelta=(p.zoomDelta||0)+I.zoomDelta),I.bearingDelta&&(p.bearingDelta=(p.bearingDelta||0)+I.bearingDelta),I.pitchDelta&&(p.pitchDelta=(p.pitchDelta||0)+I.pitchDelta),I.around!==void 0&&(p.around=I.around),I.pinchAround!==void 0&&(p.pinchAround=I.pinchAround),I.noInertia&&(p.noInertia=I.noInertia),a.extend(v,O),a.extend(d,z)}this._updateMapTransform(p,v,d),this._changes=[]},nn.prototype._updateMapTransform=function(p,v,d){var y=this._map,S=y.transform;if(!dn(p))return this._fireEvents(v,d,!0);var C=p.panDelta,I=p.zoomDelta,O=p.bearingDelta,z=p.pitchDelta,X=p.around,ne=p.pinchAround;ne!==void 0&&(X=ne),y._stop(!0),X=X||y.transform.centerPoint;var ae=S.pointLocation(C?X.sub(C):X);O&&(S.bearing+=O),z&&(S.pitch+=z),I&&(S.zoom+=I),S.setLocationAtPoint(ae,X),this._map._update(),p.noInertia||this._inertia.record(p),this._fireEvents(v,d,!0)},nn.prototype._fireEvents=function(p,v,d){var y=this,S=Lo(this._eventsInProgress),C=Lo(p),I={};for(var O in p)this._eventsInProgress[O]||(I[O+"start"]=p[O].originalEvent),this._eventsInProgress[O]=p[O];for(var z in!S&&C&&this._fireEvent("movestart",C.originalEvent),I)this._fireEvent(z,I[z]);for(var X in C&&this._fireEvent("move",C.originalEvent),p)this._fireEvent(X,p[X].originalEvent);var ne,ae={};for(var oe in this._eventsInProgress){var we=this._eventsInProgress[oe],be=we.handlerName,Fe=we.originalEvent;this._handlersById[be].isActive()||(delete this._eventsInProgress[oe],ae[oe+"end"]=ne=v[be]||Fe)}for(var _e in ae)this._fireEvent(_e,ae[_e]);var De=Lo(this._eventsInProgress);if(d&&(S||C)&&!De){this._updatingCamera=!0;var Xe=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ot=function(Ct){return Ct!==0&&-y._bearingSnap<Ct&&Ct<y._bearingSnap};Xe?(ot(Xe.bearing||this._map.getBearing())&&(Xe.bearing=0),this._map.easeTo(Xe,{originalEvent:ne})):(this._map.fire(new a.Event("moveend",{originalEvent:ne})),ot(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},nn.prototype._fireEvent=function(p,v){this._map.fire(new a.Event(p,v?{originalEvent:v}:{}))},nn.prototype._requestFrame=function(){var p=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(v){delete p._frameId,p.handleEvent(new kc("renderFrame",{timeStamp:v})),p._applyChanges()})},nn.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var ys=function(p){function v(d,y){p.call(this),this._moving=!1,this._zooming=!1,this.transform=d,this._bearingSnap=y.bearingSnap,a.bindAll(["_renderFrameCallback"],this)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.getCenter=function(){return new a.LngLat(this.transform.center.lng,this.transform.center.lat)},v.prototype.setCenter=function(d,y){return this.jumpTo({center:d},y)},v.prototype.panBy=function(d,y,S){return d=a.Point.convert(d).mult(-1),this.panTo(this.transform.center,a.extend({offset:d},y),S)},v.prototype.panTo=function(d,y,S){return this.easeTo(a.extend({center:d},y),S)},v.prototype.getZoom=function(){return this.transform.zoom},v.prototype.setZoom=function(d,y){return this.jumpTo({zoom:d},y),this},v.prototype.zoomTo=function(d,y,S){return this.easeTo(a.extend({zoom:d},y),S)},v.prototype.zoomIn=function(d,y){return this.zoomTo(this.getZoom()+1,d,y),this},v.prototype.zoomOut=function(d,y){return this.zoomTo(this.getZoom()-1,d,y),this},v.prototype.getBearing=function(){return this.transform.bearing},v.prototype.setBearing=function(d,y){return this.jumpTo({bearing:d},y),this},v.prototype.getPadding=function(){return this.transform.padding},v.prototype.setPadding=function(d,y){return this.jumpTo({padding:d},y),this},v.prototype.rotateTo=function(d,y,S){return this.easeTo(a.extend({bearing:d},y),S)},v.prototype.resetNorth=function(d,y){return this.rotateTo(0,a.extend({duration:1e3},d),y),this},v.prototype.resetNorthPitch=function(d,y){return this.easeTo(a.extend({bearing:0,pitch:0,duration:1e3},d),y),this},v.prototype.snapToNorth=function(d,y){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(d,y):this},v.prototype.getPitch=function(){return this.transform.pitch},v.prototype.setPitch=function(d,y){return this.jumpTo({pitch:d},y),this},v.prototype.cameraForBounds=function(d,y){d=a.LngLatBounds.convert(d);var S=y&&y.bearing||0;return this._cameraForBoxAndBearing(d.getNorthWest(),d.getSouthEast(),S,y)},v.prototype._cameraForBoxAndBearing=function(d,y,S,C){var I={top:0,bottom:0,right:0,left:0};if(typeof(C=a.extend({padding:I,offset:[0,0],maxZoom:this.transform.maxZoom},C)).padding=="number"){var O=C.padding;C.padding={top:O,bottom:O,right:O,left:O}}C.padding=a.extend(I,C.padding);var z=this.transform,X=z.padding,ne=z.project(a.LngLat.convert(d)),ae=z.project(a.LngLat.convert(y)),oe=ne.rotate(-S*Math.PI/180),we=ae.rotate(-S*Math.PI/180),be=new a.Point(Math.max(oe.x,we.x),Math.max(oe.y,we.y)),Fe=new a.Point(Math.min(oe.x,we.x),Math.min(oe.y,we.y)),_e=be.sub(Fe),De=(z.width-(X.left+X.right+C.padding.left+C.padding.right))/_e.x,Xe=(z.height-(X.top+X.bottom+C.padding.top+C.padding.bottom))/_e.y;if(!(Xe<0||De<0)){var ot=Math.min(z.scaleZoom(z.scale*Math.min(De,Xe)),C.maxZoom),Ct=typeof C.offset.x=="number"?new a.Point(C.offset.x,C.offset.y):a.Point.convert(C.offset),mt=new a.Point((C.padding.left-C.padding.right)/2,(C.padding.top-C.padding.bottom)/2).rotate(S*Math.PI/180),kt=Ct.add(mt).mult(z.scale/z.zoomScale(ot));return{center:z.unproject(ne.add(ae).div(2).sub(kt)),zoom:ot,bearing:S}}a.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},v.prototype.fitBounds=function(d,y,S){return this._fitInternal(this.cameraForBounds(d,y),y,S)},v.prototype.fitScreenCoordinates=function(d,y,S,C,I){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(a.Point.convert(d)),this.transform.pointLocation(a.Point.convert(y)),S,C),C,I)},v.prototype._fitInternal=function(d,y,S){return d?(delete(y=a.extend(d,y)).padding,y.linear?this.easeTo(y,S):this.flyTo(y,S)):this},v.prototype.jumpTo=function(d,y){this.stop();var S=this.transform,C=!1,I=!1,O=!1;return"zoom"in d&&S.zoom!==+d.zoom&&(C=!0,S.zoom=+d.zoom),d.center!==void 0&&(S.center=a.LngLat.convert(d.center)),"bearing"in d&&S.bearing!==+d.bearing&&(I=!0,S.bearing=+d.bearing),"pitch"in d&&S.pitch!==+d.pitch&&(O=!0,S.pitch=+d.pitch),d.padding==null||S.isPaddingEqual(d.padding)||(S.padding=d.padding),this.fire(new a.Event("movestart",y)).fire(new a.Event("move",y)),C&&this.fire(new a.Event("zoomstart",y)).fire(new a.Event("zoom",y)).fire(new a.Event("zoomend",y)),I&&this.fire(new a.Event("rotatestart",y)).fire(new a.Event("rotate",y)).fire(new a.Event("rotateend",y)),O&&this.fire(new a.Event("pitchstart",y)).fire(new a.Event("pitch",y)).fire(new a.Event("pitchend",y)),this.fire(new a.Event("moveend",y))},v.prototype.easeTo=function(d,y){var S=this;this._stop(!1,d.easeId),((d=a.extend({offset:[0,0],duration:500,easing:a.ease},d)).animate===!1||!d.essential&&a.browser.prefersReducedMotion)&&(d.duration=0);var C=this.transform,I=this.getZoom(),O=this.getBearing(),z=this.getPitch(),X=this.getPadding(),ne="zoom"in d?+d.zoom:I,ae="bearing"in d?this._normalizeBearing(d.bearing,O):O,oe="pitch"in d?+d.pitch:z,we="padding"in d?d.padding:C.padding,be=a.Point.convert(d.offset),Fe=C.centerPoint.add(be),_e=C.pointLocation(Fe),De=a.LngLat.convert(d.center||_e);this._normalizeCenter(De);var Xe,ot,Ct=C.project(_e),mt=C.project(De).sub(Ct),kt=C.zoomScale(ne-I);d.around&&(Xe=a.LngLat.convert(d.around),ot=C.locationPoint(Xe));var qt={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||ne!==I,this._rotating=this._rotating||O!==ae,this._pitching=this._pitching||oe!==z,this._padding=!C.isPaddingEqual(we),this._easeId=d.easeId,this._prepareEase(y,d.noMoveStart,qt),this._ease(function(Tr){if(S._zooming&&(C.zoom=a.number(I,ne,Tr)),S._rotating&&(C.bearing=a.number(O,ae,Tr)),S._pitching&&(C.pitch=a.number(z,oe,Tr)),S._padding&&(C.interpolatePadding(X,we,Tr),Fe=C.centerPoint.add(be)),Xe)C.setLocationAtPoint(Xe,ot);else{var yr=C.zoomScale(C.zoom-I),$r=ne>I?Math.min(2,kt):Math.max(.5,kt),vn=Math.pow($r,1-Tr),bn=C.unproject(Ct.add(mt.mult(Tr*vn)).mult(yr));C.setLocationAtPoint(C.renderWorldCopies?bn.wrap():bn,Fe)}S._fireMoveEvents(y)},function(Tr){S._afterEase(y,Tr)},d),this},v.prototype._prepareEase=function(d,y,S){S===void 0&&(S={}),this._moving=!0,y||S.moving||this.fire(new a.Event("movestart",d)),this._zooming&&!S.zooming&&this.fire(new a.Event("zoomstart",d)),this._rotating&&!S.rotating&&this.fire(new a.Event("rotatestart",d)),this._pitching&&!S.pitching&&this.fire(new a.Event("pitchstart",d))},v.prototype._fireMoveEvents=function(d){this.fire(new a.Event("move",d)),this._zooming&&this.fire(new a.Event("zoom",d)),this._rotating&&this.fire(new a.Event("rotate",d)),this._pitching&&this.fire(new a.Event("pitch",d))},v.prototype._afterEase=function(d,y){if(!this._easeId||!y||this._easeId!==y){delete this._easeId;var S=this._zooming,C=this._rotating,I=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,S&&this.fire(new a.Event("zoomend",d)),C&&this.fire(new a.Event("rotateend",d)),I&&this.fire(new a.Event("pitchend",d)),this.fire(new a.Event("moveend",d))}},v.prototype.flyTo=function(d,y){var S=this;if(!d.essential&&a.browser.prefersReducedMotion){var C=a.pick(d,["center","zoom","bearing","pitch","around"]);return this.jumpTo(C,y)}this.stop(),d=a.extend({offset:[0,0],speed:1.2,curve:1.42,easing:a.ease},d);var I=this.transform,O=this.getZoom(),z=this.getBearing(),X=this.getPitch(),ne=this.getPadding(),ae="zoom"in d?a.clamp(+d.zoom,I.minZoom,I.maxZoom):O,oe="bearing"in d?this._normalizeBearing(d.bearing,z):z,we="pitch"in d?+d.pitch:X,be="padding"in d?d.padding:I.padding,Fe=I.zoomScale(ae-O),_e=a.Point.convert(d.offset),De=I.centerPoint.add(_e),Xe=I.pointLocation(De),ot=a.LngLat.convert(d.center||Xe);this._normalizeCenter(ot);var Ct=I.project(Xe),mt=I.project(ot).sub(Ct),kt=d.curve,qt=Math.max(I.width,I.height),Tr=qt/Fe,yr=mt.mag();if("minZoom"in d){var $r=a.clamp(Math.min(d.minZoom,O,ae),I.minZoom,I.maxZoom),vn=qt/I.zoomScale($r-O);kt=Math.sqrt(vn/yr*2)}var bn=kt*kt;function xn(kn){var In=(Tr*Tr-qt*qt+(kn?-1:1)*bn*bn*yr*yr)/(2*(kn?Tr:qt)*bn*yr);return Math.log(Math.sqrt(In*In+1)-In)}function Si(kn){return(Math.exp(kn)-Math.exp(-kn))/2}function Yr(kn){return(Math.exp(kn)+Math.exp(-kn))/2}var Un=xn(0),Kn=function(kn){return Yr(Un)/Yr(Un+kt*kn)},Bn=function(kn){return qt*((Yr(Un)*(Si(In=Un+kt*kn)/Yr(In))-Si(Un))/bn)/yr;var In},On=(xn(1)-Un)/kt;if(Math.abs(yr)<1e-6||!isFinite(On)){if(Math.abs(qt-Tr)<1e-6)return this.easeTo(d,y);var Yn=Tr<qt?-1:1;On=Math.abs(Math.log(Tr/qt))/kt,Bn=function(){return 0},Kn=function(kn){return Math.exp(Yn*kt*kn)}}return d.duration="duration"in d?+d.duration:1e3*On/("screenSpeed"in d?+d.screenSpeed/kt:+d.speed),d.maxDuration&&d.duration>d.maxDuration&&(d.duration=0),this._zooming=!0,this._rotating=z!==oe,this._pitching=we!==X,this._padding=!I.isPaddingEqual(be),this._prepareEase(y,!1),this._ease(function(kn){var In=kn*On,$a=1/Kn(In);I.zoom=kn===1?ae:O+I.scaleZoom($a),S._rotating&&(I.bearing=a.number(z,oe,kn)),S._pitching&&(I.pitch=a.number(X,we,kn)),S._padding&&(I.interpolatePadding(ne,be,kn),De=I.centerPoint.add(_e));var xa=kn===1?ot:I.unproject(Ct.add(mt.mult(Bn(In))).mult($a));I.setLocationAtPoint(I.renderWorldCopies?xa.wrap():xa,De),S._fireMoveEvents(y)},function(){return S._afterEase(y)},d),this},v.prototype.isEasing=function(){return!!this._easeFrameId},v.prototype.stop=function(){return this._stop()},v.prototype._stop=function(d,y){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var S=this._onEaseEnd;delete this._onEaseEnd,S.call(this,y)}if(!d){var C=this.handlers;C&&C.stop(!1)}return this},v.prototype._ease=function(d,y,S){S.animate===!1||S.duration===0?(d(1),y()):(this._easeStart=a.browser.now(),this._easeOptions=S,this._onEaseFrame=d,this._onEaseEnd=y,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},v.prototype._renderFrameCallback=function(){var d=Math.min((a.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(d)),d<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},v.prototype._normalizeBearing=function(d,y){d=a.wrap(d,-180,180);var S=Math.abs(d-y);return Math.abs(d-360-y)<S&&(d-=360),Math.abs(d+360-y)<S&&(d+=360),d},v.prototype._normalizeCenter=function(d){var y=this.transform;if(y.renderWorldCopies&&!y.lngRange){var S=d.lng-y.center.lng;d.lng+=S>180?-360:S<-180?360:0}},v}(a.Evented),No=function(p){p===void 0&&(p={}),this.options=p,a.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};No.prototype.getDefaultPosition=function(){return"bottom-right"},No.prototype.onAdd=function(p){var v=this.options&&this.options.compact;return this._map=p,this._container=c.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=c.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=c.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),v&&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),v===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},No.prototype.onRemove=function(){c.remove(this._container),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},No.prototype._setElementTitle=function(p,v){var d=this._map._getUIString("AttributionControl."+v);p.title=d,p.setAttribute("aria-label",d)},No.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},No.prototype._updateEditLink=function(){var p=this._editLink;p||(p=this._editLink=this._container.querySelector(".mapbox-improve-map"));var v=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||a.config.ACCESS_TOKEN}];if(p){var d=v.reduce(function(y,S,C){return S.value&&(y+=S.key+"="+S.value+(C<v.length-1?"&":"")),y},"?");p.href=a.config.FEEDBACK_URL+"/"+d+(this._map._hash?this._map._hash.getHashString(!0):""),p.rel="noopener nofollow",this._setElementTitle(p,"MapFeedback")}},No.prototype._updateData=function(p){!p||p.sourceDataType!=="metadata"&&p.sourceDataType!=="visibility"&&p.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())},No.prototype._updateAttributions=function(){if(this._map.style){var p=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?p=p.concat(this.options.customAttribution.map(function(O){return typeof O!="string"?"":O})):typeof this.options.customAttribution=="string"&&p.push(this.options.customAttribution)),this._map.style.stylesheet){var v=this._map.style.stylesheet;this.styleOwner=v.owner,this.styleId=v.id}var d=this._map.style.sourceCaches;for(var y in d){var S=d[y];if(S.used){var C=S.getSource();C.attribution&&p.indexOf(C.attribution)<0&&p.push(C.attribution)}}p.sort(function(O,z){return O.length-z.length});var I=(p=p.filter(function(O,z){for(var X=z+1;X<p.length;X++)if(p[X].indexOf(O)>=0)return!1;return!0})).join(" | ");I!==this._attribHTML&&(this._attribHTML=I,p.length?(this._innerContainer.innerHTML=I,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},No.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var su=function(){a.bindAll(["_updateLogo"],this),a.bindAll(["_updateCompact"],this)};su.prototype.onAdd=function(p){this._map=p,this._container=c.create("div","mapboxgl-ctrl");var v=c.create("a","mapboxgl-ctrl-logo");return v.target="_blank",v.rel="noopener nofollow",v.href="https://www.mapbox.com/",v.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),v.setAttribute("rel","noopener nofollow"),this._container.appendChild(v),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},su.prototype.onRemove=function(){c.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},su.prototype.getDefaultPosition=function(){return"bottom-left"},su.prototype._updateLogo=function(p){p&&p.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},su.prototype._logoRequired=function(){if(this._map.style){var p=this._map.style.sourceCaches;for(var v in p)if(p[v].getSource().mapbox_logo)return!0;return!1}},su.prototype._updateCompact=function(){var p=this._container.children;if(p.length){var v=p[0];this._map.getCanvasContainer().offsetWidth<250?v.classList.add("mapboxgl-compact"):v.classList.remove("mapboxgl-compact")}};var ga=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};ga.prototype.add=function(p){var v=++this._id;return this._queue.push({callback:p,id:v,cancelled:!1}),v},ga.prototype.remove=function(p){for(var v=this._currentlyRunning,d=0,y=v?this._queue.concat(v):this._queue;d<y.length;d+=1){var S=y[d];if(S.id===p)return void(S.cancelled=!0)}},ga.prototype.run=function(p){p===void 0&&(p=0);var v=this._currentlyRunning=this._queue;this._queue=[];for(var d=0,y=v;d<y.length;d+=1){var S=y[d];if(!S.cancelled&&(S.callback(p),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},ga.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Xs={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},el=a.window.HTMLImageElement,ic=a.window.HTMLElement,Li=a.window.ImageBitmap,ao={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Hp=function(p){function v(y){var S=this;if((y=a.extend({},ao,y)).minZoom!=null&&y.maxZoom!=null&&y.minZoom>y.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(y.minPitch!=null&&y.maxPitch!=null&&y.minPitch>y.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(y.minPitch!=null&&y.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(y.maxPitch!=null&&y.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var C=new yi(y.minZoom,y.maxZoom,y.minPitch,y.maxPitch,y.renderWorldCopies);if(p.call(this,C,y),this._interactive=y.interactive,this._maxTileCacheSize=y.maxTileCacheSize,this._failIfMajorPerformanceCaveat=y.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=y.preserveDrawingBuffer,this._antialias=y.antialias,this._trackResize=y.trackResize,this._bearingSnap=y.bearingSnap,this._refreshExpiredTiles=y.refreshExpiredTiles,this._fadeDuration=y.fadeDuration,this._crossSourceCollisions=y.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=y.collectResourceTiming,this._renderTaskQueue=new ga,this._controls=[],this._mapId=a.uniqueId(),this._locale=a.extend({},Xs,y.locale),this._clickTolerance=y.clickTolerance,this._requestManager=new a.RequestManager(y.transformRequest,y.accessToken),typeof y.container=="string"){if(this._container=a.window.document.getElementById(y.container),!this._container)throw new Error("Container '"+y.container+"' not found.")}else{if(!(y.container instanceof ic))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=y.container}if(y.maxBounds&&this.setMaxBounds(y.maxBounds),a.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return S._update(!1)}),this.on("moveend",function(){return S._update(!1)}),this.on("zoom",function(){return S._update(!0)}),a.window!==void 0&&(a.window.addEventListener("online",this._onWindowOnline,!1),a.window.addEventListener("resize",this._onWindowResize,!1),a.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new nn(this,y),this._hash=y.hash&&new Is(typeof y.hash=="string"&&y.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:y.center,zoom:y.zoom,bearing:y.bearing,pitch:y.pitch}),y.bounds&&(this.resize(),this.fitBounds(y.bounds,a.extend({},y.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=y.localIdeographFontFamily,y.style&&this.setStyle(y.style,{localIdeographFontFamily:y.localIdeographFontFamily}),y.attributionControl&&this.addControl(new No({customAttribution:y.customAttribution})),this.addControl(new su,y.logoPosition),this.on("style.load",function(){S.transform.unmodified&&S.jumpTo(S.style.stylesheet)}),this.on("data",function(I){S._update(I.dataType==="style"),S.fire(new a.Event(I.dataType+"data",I))}),this.on("dataloading",function(I){S.fire(new a.Event(I.dataType+"dataloading",I))})}p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v;var d={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return v.prototype._getMapId=function(){return this._mapId},v.prototype.addControl=function(y,S){if(S===void 0&&(S=y.getDefaultPosition?y.getDefaultPosition():"top-right"),!y||!y.onAdd)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var C=y.onAdd(this);this._controls.push(y);var I=this._controlPositions[S];return S.indexOf("bottom")!==-1?I.insertBefore(C,I.firstChild):I.appendChild(C),this},v.prototype.removeControl=function(y){if(!y||!y.onRemove)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var S=this._controls.indexOf(y);return S>-1&&this._controls.splice(S,1),y.onRemove(this),this},v.prototype.hasControl=function(y){return this._controls.indexOf(y)>-1},v.prototype.resize=function(y){var S=this._containerDimensions(),C=S[0],I=S[1];if(C===this.transform.width&&I===this.transform.height)return this;this._resizeCanvas(C,I),this.transform.resize(C,I),this.painter.resize(C,I);var O=!this._moving;return O&&this.fire(new a.Event("movestart",y)).fire(new a.Event("move",y)),this.fire(new a.Event("resize",y)),O&&this.fire(new a.Event("moveend",y)),this},v.prototype.getBounds=function(){return this.transform.getBounds()},v.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},v.prototype.setMaxBounds=function(y){return this.transform.setMaxBounds(a.LngLatBounds.convert(y)),this._update()},v.prototype.setMinZoom=function(y){if((y=y??-2)>=-2&&y<=this.transform.maxZoom)return this.transform.minZoom=y,this._update(),this.getZoom()<y&&this.setZoom(y),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},v.prototype.getMinZoom=function(){return this.transform.minZoom},v.prototype.setMaxZoom=function(y){if((y=y??22)>=this.transform.minZoom)return this.transform.maxZoom=y,this._update(),this.getZoom()>y&&this.setZoom(y),this;throw new Error("maxZoom must be greater than the current minZoom")},v.prototype.getMaxZoom=function(){return this.transform.maxZoom},v.prototype.setMinPitch=function(y){if((y=y??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(y>=0&&y<=this.transform.maxPitch)return this.transform.minPitch=y,this._update(),this.getPitch()<y&&this.setPitch(y),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},v.prototype.getMinPitch=function(){return this.transform.minPitch},v.prototype.setMaxPitch=function(y){if((y=y??60)>60)throw new Error("maxPitch must be less than or equal to 60");if(y>=this.transform.minPitch)return this.transform.maxPitch=y,this._update(),this.getPitch()>y&&this.setPitch(y),this;throw new Error("maxPitch must be greater than the current minPitch")},v.prototype.getMaxPitch=function(){return this.transform.maxPitch},v.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},v.prototype.setRenderWorldCopies=function(y){return this.transform.renderWorldCopies=y,this._update()},v.prototype.project=function(y){return this.transform.locationPoint(a.LngLat.convert(y))},v.prototype.unproject=function(y){return this.transform.pointLocation(a.Point.convert(y))},v.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},v.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},v.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},v.prototype._createDelegatedListener=function(y,S,C){var I,O=this;if(y==="mouseenter"||y==="mouseover"){var z=!1;return{layer:S,listener:C,delegates:{mousemove:function(ne){var ae=O.getLayer(S)?O.queryRenderedFeatures(ne.point,{layers:[S]}):[];ae.length?z||(z=!0,C.call(O,new ma(y,O,ne.originalEvent,{features:ae}))):z=!1},mouseout:function(){z=!1}}}}if(y==="mouseleave"||y==="mouseout"){var X=!1;return{layer:S,listener:C,delegates:{mousemove:function(ne){(O.getLayer(S)?O.queryRenderedFeatures(ne.point,{layers:[S]}):[]).length?X=!0:X&&(X=!1,C.call(O,new ma(y,O,ne.originalEvent)))},mouseout:function(ne){X&&(X=!1,C.call(O,new ma(y,O,ne.originalEvent)))}}}}return{layer:S,listener:C,delegates:(I={},I[y]=function(ne){var ae=O.getLayer(S)?O.queryRenderedFeatures(ne.point,{layers:[S]}):[];ae.length&&(ne.features=ae,C.call(O,ne),delete ne.features)},I)}},v.prototype.on=function(y,S,C){if(C===void 0)return p.prototype.on.call(this,y,S);var I=this._createDelegatedListener(y,S,C);for(var O in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[y]=this._delegatedListeners[y]||[],this._delegatedListeners[y].push(I),I.delegates)this.on(O,I.delegates[O]);return this},v.prototype.once=function(y,S,C){if(C===void 0)return p.prototype.once.call(this,y,S);var I=this._createDelegatedListener(y,S,C);for(var O in I.delegates)this.once(O,I.delegates[O]);return this},v.prototype.off=function(y,S,C){var I=this;return C===void 0?p.prototype.off.call(this,y,S):(this._delegatedListeners&&this._delegatedListeners[y]&&function(O){for(var z=O[y],X=0;X<z.length;X++){var ne=z[X];if(ne.layer===S&&ne.listener===C){for(var ae in ne.delegates)I.off(ae,ne.delegates[ae]);return z.splice(X,1),I}}}(this._delegatedListeners),this)},v.prototype.queryRenderedFeatures=function(y,S){if(!this.style)return[];var C;if(S!==void 0||y===void 0||y instanceof a.Point||Array.isArray(y)||(S=y,y=void 0),S=S||{},(y=y||[[0,0],[this.transform.width,this.transform.height]])instanceof a.Point||typeof y[0]=="number")C=[a.Point.convert(y)];else{var I=a.Point.convert(y[0]),O=a.Point.convert(y[1]);C=[I,new a.Point(O.x,I.y),O,new a.Point(I.x,O.y),I]}return this.style.queryRenderedFeatures(C,S,this.transform)},v.prototype.querySourceFeatures=function(y,S){return this.style.querySourceFeatures(y,S)},v.prototype.setStyle=function(y,S){return(S=a.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},S)).diff!==!1&&S.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&y?(this._diffStyle(y,S),this):(this._localIdeographFontFamily=S.localIdeographFontFamily,this._updateStyle(y,S))},v.prototype._getUIString=function(y){var S=this._locale[y];if(S==null)throw new Error("Missing UI string '"+y+"'");return S},v.prototype._updateStyle=function(y,S){return this.style&&(this.style.setEventedParent(null),this.style._remove()),y?(this.style=new ms(this,S||{}),this.style.setEventedParent(this,{style:this.style}),typeof y=="string"?this.style.loadURL(y):this.style.loadJSON(y),this):(delete this.style,this)},v.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new ms(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},v.prototype._diffStyle=function(y,S){var C=this;if(typeof y=="string"){var I=this._requestManager.normalizeStyleURL(y),O=this._requestManager.transformRequest(I,a.ResourceType.Style);a.getJSON(O,function(z,X){z?C.fire(new a.ErrorEvent(z)):X&&C._updateDiff(X,S)})}else typeof y=="object"&&this._updateDiff(y,S)},v.prototype._updateDiff=function(y,S){try{this.style.setState(y)&&this._update(!0)}catch(C){a.warnOnce("Unable to perform style diff: "+(C.message||C.error||C)+". Rebuilding the style from scratch."),this._updateStyle(y,S)}},v.prototype.getStyle=function(){if(this.style)return this.style.serialize()},v.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():a.warnOnce("There is no style added to the map.")},v.prototype.addSource=function(y,S){return this._lazyInitEmptyStyle(),this.style.addSource(y,S),this._update(!0)},v.prototype.isSourceLoaded=function(y){var S=this.style&&this.style.sourceCaches[y];if(S!==void 0)return S.loaded();this.fire(new a.ErrorEvent(new Error("There is no source with ID '"+y+"'")))},v.prototype.areTilesLoaded=function(){var y=this.style&&this.style.sourceCaches;for(var S in y){var C=y[S]._tiles;for(var I in C){var O=C[I];if(O.state!=="loaded"&&O.state!=="errored")return!1}}return!0},v.prototype.addSourceType=function(y,S,C){return this._lazyInitEmptyStyle(),this.style.addSourceType(y,S,C)},v.prototype.removeSource=function(y){return this.style.removeSource(y),this._update(!0)},v.prototype.getSource=function(y){return this.style.getSource(y)},v.prototype.addImage=function(y,S,C){C===void 0&&(C={});var I=C.pixelRatio;I===void 0&&(I=1);var O=C.sdf;O===void 0&&(O=!1);var z=C.stretchX,X=C.stretchY,ne=C.content;if(this._lazyInitEmptyStyle(),S instanceof el||Li&&S instanceof Li){var ae=a.browser.getImageData(S);this.style.addImage(y,{data:new a.RGBAImage({width:ae.width,height:ae.height},ae.data),pixelRatio:I,stretchX:z,stretchY:X,content:ne,sdf:O,version:0})}else{if(S.width===void 0||S.height===void 0)return this.fire(new a.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var oe=S;this.style.addImage(y,{data:new a.RGBAImage({width:S.width,height:S.height},new Uint8Array(S.data)),pixelRatio:I,stretchX:z,stretchY:X,content:ne,sdf:O,version:0,userImage:oe}),oe.onAdd&&oe.onAdd(this,y)}},v.prototype.updateImage=function(y,S){var C=this.style.getImage(y);if(!C)return this.fire(new a.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var I=S instanceof el||Li&&S instanceof Li?a.browser.getImageData(S):S,O=I.width,z=I.height,X=I.data;return O===void 0||z===void 0?this.fire(new a.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):O!==C.data.width||z!==C.data.height?this.fire(new a.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(C.data.replace(X,!(S instanceof el||Li&&S instanceof Li)),void this.style.updateImage(y,C))},v.prototype.hasImage=function(y){return y?!!this.style.getImage(y):(this.fire(new a.ErrorEvent(new Error("Missing required image id"))),!1)},v.prototype.removeImage=function(y){this.style.removeImage(y)},v.prototype.loadImage=function(y,S){a.getImage(this._requestManager.transformRequest(y,a.ResourceType.Image),S)},v.prototype.listImages=function(){return this.style.listImages()},v.prototype.addLayer=function(y,S){return this._lazyInitEmptyStyle(),this.style.addLayer(y,S),this._update(!0)},v.prototype.moveLayer=function(y,S){return this.style.moveLayer(y,S),this._update(!0)},v.prototype.removeLayer=function(y){return this.style.removeLayer(y),this._update(!0)},v.prototype.getLayer=function(y){return this.style.getLayer(y)},v.prototype.setLayerZoomRange=function(y,S,C){return this.style.setLayerZoomRange(y,S,C),this._update(!0)},v.prototype.setFilter=function(y,S,C){return C===void 0&&(C={}),this.style.setFilter(y,S,C),this._update(!0)},v.prototype.getFilter=function(y){return this.style.getFilter(y)},v.prototype.setPaintProperty=function(y,S,C,I){return I===void 0&&(I={}),this.style.setPaintProperty(y,S,C,I),this._update(!0)},v.prototype.getPaintProperty=function(y,S){return this.style.getPaintProperty(y,S)},v.prototype.setLayoutProperty=function(y,S,C,I){return I===void 0&&(I={}),this.style.setLayoutProperty(y,S,C,I),this._update(!0)},v.prototype.getLayoutProperty=function(y,S){return this.style.getLayoutProperty(y,S)},v.prototype.setLight=function(y,S){return S===void 0&&(S={}),this._lazyInitEmptyStyle(),this.style.setLight(y,S),this._update(!0)},v.prototype.getLight=function(){return this.style.getLight()},v.prototype.setFeatureState=function(y,S){return this.style.setFeatureState(y,S),this._update()},v.prototype.removeFeatureState=function(y,S){return this.style.removeFeatureState(y,S),this._update()},v.prototype.getFeatureState=function(y){return this.style.getFeatureState(y)},v.prototype.getContainer=function(){return this._container},v.prototype.getCanvasContainer=function(){return this._canvasContainer},v.prototype.getCanvas=function(){return this._canvas},v.prototype._containerDimensions=function(){var y=0,S=0;return this._container&&(y=this._container.clientWidth||400,S=this._container.clientHeight||300),[y,S]},v.prototype._detectMissingCSS=function(){a.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&a.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},v.prototype._setupContainer=function(){var y=this._container;y.classList.add("mapboxgl-map"),(this._missingCSSCanary=c.create("div","mapboxgl-canary",y)).style.visibility="hidden",this._detectMissingCSS();var S=this._canvasContainer=c.create("div","mapboxgl-canvas-container",y);this._interactive&&S.classList.add("mapboxgl-interactive"),this._canvas=c.create("canvas","mapboxgl-canvas",S),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var C=this._containerDimensions();this._resizeCanvas(C[0],C[1]);var I=this._controlContainer=c.create("div","mapboxgl-control-container",y),O=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(z){O[z]=c.create("div","mapboxgl-ctrl-"+z,I)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},v.prototype._resizeCanvas=function(y,S){var C=a.browser.devicePixelRatio||1;this._canvas.width=C*y,this._canvas.height=C*S,this._canvas.style.width=y+"px",this._canvas.style.height=S+"px"},v.prototype._setupPainter=function(){var y=a.extend({},u.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),S=this._canvas.getContext("webgl",y)||this._canvas.getContext("experimental-webgl",y);S?(this.painter=new ra(S,this.transform),a.webpSupported.testSupport(S)):this.fire(new a.ErrorEvent(new Error("Failed to initialize WebGL")))},v.prototype._contextLost=function(y){y.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new a.Event("webglcontextlost",{originalEvent:y}))},v.prototype._contextRestored=function(y){this._setupPainter(),this.resize(),this._update(),this.fire(new a.Event("webglcontextrestored",{originalEvent:y}))},v.prototype._onMapScroll=function(y){if(y.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},v.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},v.prototype._update=function(y){return this.style?(this._styleDirty=this._styleDirty||y,this._sourcesDirty=!0,this.triggerRepaint(),this):this},v.prototype._requestRenderFrame=function(y){return this._update(),this._renderTaskQueue.add(y)},v.prototype._cancelRenderFrame=function(y){this._renderTaskQueue.remove(y)},v.prototype._render=function(y){var S,C=this,I=0,O=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(S=O.createQueryEXT(),O.beginQueryEXT(O.TIME_ELAPSED_EXT,S),I=a.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(y),!this._removed){var z=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var X=this.transform.zoom,ne=a.browser.now();this.style.zoomHistory.update(X,ne);var ae=new a.EvaluationParameters(X,{now:ne,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),oe=ae.crossFadingFactor();oe===1&&oe===this._crossFadingFactor||(z=!0,this._crossFadingFactor=oe),this.style.update(ae)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new a.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new a.Event("load"))),this.style&&(this.style.hasTransitions()||z)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var we=a.browser.now()-I;O.endQueryEXT(O.TIME_ELAPSED_EXT,S),setTimeout(function(){var _e=O.getQueryObjectEXT(S,O.QUERY_RESULT_EXT)/1e6;O.deleteQueryEXT(S),C.fire(new a.Event("gpu-timing-frame",{cpuTime:we,gpuTime:_e}))},50)}if(this.listens("gpu-timing-layer")){var be=this.painter.collectGpuTimers();setTimeout(function(){var _e=C.painter.queryGpuTimers(be);C.fire(new a.Event("gpu-timing-layer",{layerTimes:_e}))},50)}var Fe=this._sourcesDirty||this._styleDirty||this._placementDirty;return Fe||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new a.Event("idle")),!this._loaded||this._fullyLoaded||Fe||(this._fullyLoaded=!0),this}},v.prototype.remove=function(){this._hash&&this._hash.remove();for(var y=0,S=this._controls;y<S.length;y+=1)S[y].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),a.window!==void 0&&(a.window.removeEventListener("resize",this._onWindowResize,!1),a.window.removeEventListener("orientationchange",this._onWindowResize,!1),a.window.removeEventListener("online",this._onWindowOnline,!1));var C=this.painter.context.gl.getExtension("WEBGL_lose_context");C&&C.loseContext(),Ol(this._canvasContainer),Ol(this._controlContainer),Ol(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new a.Event("remove"))},v.prototype.triggerRepaint=function(){var y=this;this.style&&!this._frame&&(this._frame=a.browser.frame(function(S){y._frame=null,y._render(S)}))},v.prototype._onWindowOnline=function(){this._update()},v.prototype._onWindowResize=function(y){this._trackResize&&this.resize({originalEvent:y})._update()},d.showTileBoundaries.get=function(){return!!this._showTileBoundaries},d.showTileBoundaries.set=function(y){this._showTileBoundaries!==y&&(this._showTileBoundaries=y,this._update())},d.showPadding.get=function(){return!!this._showPadding},d.showPadding.set=function(y){this._showPadding!==y&&(this._showPadding=y,this._update())},d.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},d.showCollisionBoxes.set=function(y){this._showCollisionBoxes!==y&&(this._showCollisionBoxes=y,y?this.style._generateCollisionBoxes():this._update())},d.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},d.showOverdrawInspector.set=function(y){this._showOverdrawInspector!==y&&(this._showOverdrawInspector=y,this._update())},d.repaint.get=function(){return!!this._repaint},d.repaint.set=function(y){this._repaint!==y&&(this._repaint=y,this.triggerRepaint())},d.vertices.get=function(){return!!this._vertices},d.vertices.set=function(y){this._vertices=y,this._update()},v.prototype._setCacheLimits=function(y,S){a.setCacheLimits(y,S)},d.version.get=function(){return a.version},Object.defineProperties(v.prototype,d),v}(ys);function Ol(p){p.parentNode&&p.parentNode.removeChild(p)}var Ih={showCompass:!0,showZoom:!0,visualizePitch:!1},tl=function(p){var v=this;this.options=a.extend({},Ih,p),this._container=c.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(d){return d.preventDefault()}),this.options.showZoom&&(a.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(d){return v._map.zoomIn({},{originalEvent:d})}),c.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(d){return v._map.zoomOut({},{originalEvent:d})}),c.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(a.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(d){v.options.visualizePitch?v._map.resetNorthPitch({},{originalEvent:d}):v._map.resetNorth({},{originalEvent:d})}),this._compassIcon=c.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};tl.prototype._updateZoomButtons=function(){var p=this._map.getZoom(),v=p===this._map.getMaxZoom(),d=p===this._map.getMinZoom();this._zoomInButton.disabled=v,this._zoomOutButton.disabled=d,this._zoomInButton.setAttribute("aria-disabled",v.toString()),this._zoomOutButton.setAttribute("aria-disabled",d.toString())},tl.prototype._rotateCompassArrow=function(){var p=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=p},tl.prototype.onAdd=function(p){return this._map=p,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new xs(this._map,this._compass,this.options.visualizePitch)),this._container},tl.prototype.onRemove=function(){c.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},tl.prototype._createButton=function(p,v){var d=c.create("button",p,this._container);return d.type="button",d.addEventListener("click",v),d},tl.prototype._setButtonTitle=function(p,v){var d=this._map._getUIString("NavigationControl."+v);p.title=d,p.setAttribute("aria-label",d)};var xs=function(p,v,d){d===void 0&&(d=!1),this._clickTolerance=10,this.element=v,this.mouseRotate=new Of({clickTolerance:p.dragRotate._mouseRotate._clickTolerance}),this.map=p,d&&(this.mousePitch=new Th({clickTolerance:p.dragRotate._mousePitch._clickTolerance})),a.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),c.addEventListener(v,"mousedown",this.mousedown),c.addEventListener(v,"touchstart",this.touchstart,{passive:!1}),c.addEventListener(v,"touchmove",this.touchmove),c.addEventListener(v,"touchend",this.touchend),c.addEventListener(v,"touchcancel",this.reset)};function Dc(p,v,d){if(p=new a.LngLat(p.lng,p.lat),v){var y=new a.LngLat(p.lng-360,p.lat),S=new a.LngLat(p.lng+360,p.lat),C=d.locationPoint(p).distSqr(v);d.locationPoint(y).distSqr(v)<C?p=y:d.locationPoint(S).distSqr(v)<C&&(p=S)}for(;Math.abs(p.lng-d.center.lng)>180;){var I=d.locationPoint(p);if(I.x>=0&&I.y>=0&&I.x<=d.width&&I.y<=d.height)break;p.lng>d.center.lng?p.lng-=360:p.lng+=360}return p}xs.prototype.down=function(p,v){this.mouseRotate.mousedown(p,v),this.mousePitch&&this.mousePitch.mousedown(p,v),c.disableDrag()},xs.prototype.move=function(p,v){var d=this.map,y=this.mouseRotate.mousemoveWindow(p,v);if(y&&y.bearingDelta&&d.setBearing(d.getBearing()+y.bearingDelta),this.mousePitch){var S=this.mousePitch.mousemoveWindow(p,v);S&&S.pitchDelta&&d.setPitch(d.getPitch()+S.pitchDelta)}},xs.prototype.off=function(){var p=this.element;c.removeEventListener(p,"mousedown",this.mousedown),c.removeEventListener(p,"touchstart",this.touchstart,{passive:!1}),c.removeEventListener(p,"touchmove",this.touchmove),c.removeEventListener(p,"touchend",this.touchend),c.removeEventListener(p,"touchcancel",this.reset),this.offTemp()},xs.prototype.offTemp=function(){c.enableDrag(),c.removeEventListener(a.window,"mousemove",this.mousemove),c.removeEventListener(a.window,"mouseup",this.mouseup)},xs.prototype.mousedown=function(p){this.down(a.extend({},p,{ctrlKey:!0,preventDefault:function(){return p.preventDefault()}}),c.mousePos(this.element,p)),c.addEventListener(a.window,"mousemove",this.mousemove),c.addEventListener(a.window,"mouseup",this.mouseup)},xs.prototype.mousemove=function(p){this.move(p,c.mousePos(this.element,p))},xs.prototype.mouseup=function(p){this.mouseRotate.mouseupWindow(p),this.mousePitch&&this.mousePitch.mouseupWindow(p),this.offTemp()},xs.prototype.touchstart=function(p){p.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=c.touchPos(this.element,p.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return p.preventDefault()}},this._startPos))},xs.prototype.touchmove=function(p){p.targetTouches.length!==1?this.reset():(this._lastPos=c.touchPos(this.element,p.targetTouches)[0],this.move({preventDefault:function(){return p.preventDefault()}},this._lastPos))},xs.prototype.touchend=function(p){p.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},xs.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var wu={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Mh(p,v,d){var y=p.classList;for(var S in wu)y.remove("mapboxgl-"+d+"-anchor-"+S);y.add("mapboxgl-"+d+"-anchor-"+v)}var Fc,kf=function(p){function v(d,y){if(p.call(this),(d instanceof a.window.HTMLElement||y)&&(d=a.extend({element:d},y)),a.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=d&&d.anchor||"center",this._color=d&&d.color||"#3FB1CE",this._scale=d&&d.scale||1,this._draggable=d&&d.draggable||!1,this._clickTolerance=d&&d.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=d&&d.rotation||0,this._rotationAlignment=d&&d.rotationAlignment||"auto",this._pitchAlignment=d&&d.pitchAlignment&&d.pitchAlignment!=="auto"?d.pitchAlignment:this._rotationAlignment,d&&d.element)this._element=d.element,this._offset=a.Point.convert(d&&d.offset||[0,0]);else{this._defaultMarker=!0,this._element=c.create("div"),this._element.setAttribute("aria-label","Map marker");var S=c.createNS("http://www.w3.org/2000/svg","svg");S.setAttributeNS(null,"display","block"),S.setAttributeNS(null,"height","41px"),S.setAttributeNS(null,"width","27px"),S.setAttributeNS(null,"viewBox","0 0 27 41");var C=c.createNS("http://www.w3.org/2000/svg","g");C.setAttributeNS(null,"stroke","none"),C.setAttributeNS(null,"stroke-width","1"),C.setAttributeNS(null,"fill","none"),C.setAttributeNS(null,"fill-rule","evenodd");var I=c.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"fill-rule","nonzero");var O=c.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"transform","translate(3.0, 29.0)"),O.setAttributeNS(null,"fill","#000000");for(var z=0,X=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];z<X.length;z+=1){var ne=X[z],ae=c.createNS("http://www.w3.org/2000/svg","ellipse");ae.setAttributeNS(null,"opacity","0.04"),ae.setAttributeNS(null,"cx","10.5"),ae.setAttributeNS(null,"cy","5.80029008"),ae.setAttributeNS(null,"rx",ne.rx),ae.setAttributeNS(null,"ry",ne.ry),O.appendChild(ae)}var oe=c.createNS("http://www.w3.org/2000/svg","g");oe.setAttributeNS(null,"fill",this._color);var we=c.createNS("http://www.w3.org/2000/svg","path");we.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),oe.appendChild(we);var be=c.createNS("http://www.w3.org/2000/svg","g");be.setAttributeNS(null,"opacity","0.25"),be.setAttributeNS(null,"fill","#000000");var Fe=c.createNS("http://www.w3.org/2000/svg","path");Fe.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),be.appendChild(Fe);var _e=c.createNS("http://www.w3.org/2000/svg","g");_e.setAttributeNS(null,"transform","translate(6.0, 7.0)"),_e.setAttributeNS(null,"fill","#FFFFFF");var De=c.createNS("http://www.w3.org/2000/svg","g");De.setAttributeNS(null,"transform","translate(8.0, 8.0)");var Xe=c.createNS("http://www.w3.org/2000/svg","circle");Xe.setAttributeNS(null,"fill","#000000"),Xe.setAttributeNS(null,"opacity","0.25"),Xe.setAttributeNS(null,"cx","5.5"),Xe.setAttributeNS(null,"cy","5.5"),Xe.setAttributeNS(null,"r","5.4999962");var ot=c.createNS("http://www.w3.org/2000/svg","circle");ot.setAttributeNS(null,"fill","#FFFFFF"),ot.setAttributeNS(null,"cx","5.5"),ot.setAttributeNS(null,"cy","5.5"),ot.setAttributeNS(null,"r","5.4999962"),De.appendChild(Xe),De.appendChild(ot),I.appendChild(O),I.appendChild(oe),I.appendChild(be),I.appendChild(_e),I.appendChild(De),S.appendChild(I),S.setAttributeNS(null,"height",41*this._scale+"px"),S.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(S),this._offset=a.Point.convert(d&&d.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(Ct){Ct.preventDefault()}),this._element.addEventListener("mousedown",function(Ct){Ct.preventDefault()}),Mh(this._element,this._anchor,"marker"),this._popup=null}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.addTo=function(d){return this.remove(),this._map=d,d.getCanvasContainer().appendChild(this._element),d.on("move",this._update),d.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},v.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),c.remove(this._element),this._popup&&this._popup.remove(),this},v.prototype.getLngLat=function(){return this._lngLat},v.prototype.setLngLat=function(d){return this._lngLat=a.LngLat.convert(d),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},v.prototype.getElement=function(){return this._element},v.prototype.setPopup=function(d){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),d){if(!("offset"in d.options)){var y=Math.sqrt(Math.pow(13.5,2)/2);d.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[y,-1*(24.6+y)],"bottom-right":[-y,-1*(24.6+y)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=d,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},v.prototype._onKeyPress=function(d){var y=d.code,S=d.charCode||d.keyCode;y!=="Space"&&y!=="Enter"&&S!==32&&S!==13||this.togglePopup()},v.prototype._onMapClick=function(d){var y=d.originalEvent.target,S=this._element;this._popup&&(y===S||S.contains(y))&&this.togglePopup()},v.prototype.getPopup=function(){return this._popup},v.prototype.togglePopup=function(){var d=this._popup;return d?(d.isOpen()?d.remove():d.addTo(this._map),this):this},v.prototype._update=function(d){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Dc(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var y="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?y="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(y="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var S="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?S="rotateX(0deg)":this._pitchAlignment==="map"&&(S="rotateX("+this._map.getPitch()+"deg)"),d&&d.type!=="moveend"||(this._pos=this._pos.round()),c.setTransform(this._element,wu[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+S+" "+y)}},v.prototype.getOffset=function(){return this._offset},v.prototype.setOffset=function(d){return this._offset=a.Point.convert(d),this._update(),this},v.prototype._onMove=function(d){if(!this._isDragging){var y=this._clickTolerance||this._map._clickTolerance;this._isDragging=d.point.dist(this._pointerdownPos)>=y}this._isDragging&&(this._pos=d.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new a.Event("dragstart"))),this.fire(new a.Event("drag")))},v.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new a.Event("dragend")),this._state="inactive"},v.prototype._addDragHandler=function(d){this._element.contains(d.originalEvent.target)&&(d.preventDefault(),this._positionDelta=d.point.sub(this._pos).add(this._offset),this._pointerdownPos=d.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},v.prototype.setDraggable=function(d){return this._draggable=!!d,this._map&&(d?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},v.prototype.isDraggable=function(){return this._draggable},v.prototype.setRotation=function(d){return this._rotation=d||0,this._update(),this},v.prototype.getRotation=function(){return this._rotation},v.prototype.setRotationAlignment=function(d){return this._rotationAlignment=d||"auto",this._update(),this},v.prototype.getRotationAlignment=function(){return this._rotationAlignment},v.prototype.setPitchAlignment=function(d){return this._pitchAlignment=d&&d!=="auto"?d:this._rotationAlignment,this._update(),this},v.prototype.getPitchAlignment=function(){return this._pitchAlignment},v}(a.Evented),Ph={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ac=0,oc=!1,Gp=function(p){function v(d){p.call(this),this.options=a.extend({},Ph,d),a.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.onAdd=function(d){var y;return this._map=d,this._container=c.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),y=this._setupUI,Fc!==void 0?y(Fc):a.window.navigator.permissions!==void 0?a.window.navigator.permissions.query({name:"geolocation"}).then(function(S){y(Fc=S.state!=="denied")}):y(Fc=!!a.window.navigator.geolocation),this._container},v.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(a.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),c.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ac=0,oc=!1},v.prototype._isOutOfMapMaxBounds=function(d){var y=this._map.getMaxBounds(),S=d.coords;return y&&(S.longitude<y.getWest()||S.longitude>y.getEast()||S.latitude<y.getSouth()||S.latitude>y.getNorth())},v.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},v.prototype._onSuccess=function(d){if(this._map){if(this._isOutOfMapMaxBounds(d))return this._setErrorState(),this.fire(new a.Event("outofmaxbounds",d)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=d,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(d),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(d),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new a.Event("geolocate",d)),this._finish()}},v.prototype._updateCamera=function(d){var y=new a.LngLat(d.coords.longitude,d.coords.latitude),S=d.coords.accuracy,C=this._map.getBearing(),I=a.extend({bearing:C},this.options.fitBoundsOptions);this._map.fitBounds(y.toBounds(S),I,{geolocateSource:!0})},v.prototype._updateMarker=function(d){if(d){var y=new a.LngLat(d.coords.longitude,d.coords.latitude);this._accuracyCircleMarker.setLngLat(y).addTo(this._map),this._userLocationDotMarker.setLngLat(y).addTo(this._map),this._accuracy=d.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},v.prototype._updateCircleRadius=function(){var d=this._map._container.clientHeight/2,y=this._map.unproject([0,d]),S=this._map.unproject([1,d]),C=y.distanceTo(S),I=Math.ceil(2*this._accuracy/C);this._circleElement.style.width=I+"px",this._circleElement.style.height=I+"px"},v.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},v.prototype._onError=function(d){if(this._map){if(this.options.trackUserLocation)if(d.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;var y=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=y,this._geolocateButton.setAttribute("aria-label",y),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(d.code===3&&oc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new a.Event("error",d)),this._finish()}},v.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},v.prototype._setupUI=function(d){var y=this;if(this._container.addEventListener("contextmenu",function(I){return I.preventDefault()}),this._geolocateButton=c.create("button","mapboxgl-ctrl-geolocate",this._container),c.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",d===!1){a.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var S=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=S,this._geolocateButton.setAttribute("aria-label",S)}else{var C=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=C,this._geolocateButton.setAttribute("aria-label",C)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=c.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new kf(this._dotElement),this._circleElement=c.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new kf({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",function(I){I.geolocateSource||y._watchState!=="ACTIVE_LOCK"||I.originalEvent&&I.originalEvent.type==="resize"||(y._watchState="BACKGROUND",y._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),y._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),y.fire(new a.Event("trackuserlocationend")))})},v.prototype.trigger=function(){if(!this._setup)return a.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new a.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ac--,oc=!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 a.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new a.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var d;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++ac>1?(d={maximumAge:6e5,timeout:0},oc=!0):(d=this.options.positionOptions,oc=!1),this._geolocationWatchID=a.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,d)}}else a.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},v.prototype._clearWatch=function(){a.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},v}(a.Evented),Cu={maxWidth:100,unit:"metric"},uu=function(p){this.options=a.extend({},Cu,p),a.bindAll(["_onMove","setUnit"],this)};function Oh(p,v,d){var y=d&&d.maxWidth||100,S=p._container.clientHeight/2,C=p.unproject([0,S]),I=p.unproject([y,S]),O=C.distanceTo(I);if(d&&d.unit==="imperial"){var z=3.2808*O;z>5280?kl(v,y,z/5280,p._getUIString("ScaleControl.Miles")):kl(v,y,z,p._getUIString("ScaleControl.Feet"))}else d&&d.unit==="nautical"?kl(v,y,O/1852,p._getUIString("ScaleControl.NauticalMiles")):O>=1e3?kl(v,y,O/1e3,p._getUIString("ScaleControl.Kilometers")):kl(v,y,O,p._getUIString("ScaleControl.Meters"))}function kl(p,v,d,y){var S,C,I,O=(S=d,(C=Math.pow(10,(""+Math.floor(S)).length-1))*(I=(I=S/C)>=10?10:I>=5?5:I>=3?3:I>=2?2:I>=1?1:function(z){var X=Math.pow(10,Math.ceil(-Math.log(z)/Math.LN10));return Math.round(z*X)/X}(I)));p.style.width=v*(O/d)+"px",p.innerHTML=O+" "+y}uu.prototype.getDefaultPosition=function(){return"bottom-left"},uu.prototype._onMove=function(){Oh(this._map,this._container,this.options)},uu.prototype.onAdd=function(p){return this._map=p,this._container=c.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",p.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},uu.prototype.onRemove=function(){c.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},uu.prototype.setUnit=function(p){this.options.unit=p,Oh(this._map,this._container,this.options)};var Ys=function(p){this._fullscreen=!1,p&&p.container&&(p.container instanceof a.window.HTMLElement?this._container=p.container:a.warnOnce("Full screen control 'container' must be a DOM element.")),a.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in a.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in a.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in a.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in a.window.document&&(this._fullscreenchange="MSFullscreenChange")};Ys.prototype.onAdd=function(p){return this._map=p,this._container||(this._container=this._map.getContainer()),this._controlContainer=c.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",a.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Ys.prototype.onRemove=function(){c.remove(this._controlContainer),this._map=null,a.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Ys.prototype._checkFullscreenSupport=function(){return!!(a.window.document.fullscreenEnabled||a.window.document.mozFullScreenEnabled||a.window.document.msFullscreenEnabled||a.window.document.webkitFullscreenEnabled)},Ys.prototype._setupUI=function(){var p=this._fullscreenButton=c.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);c.create("span","mapboxgl-ctrl-icon",p).setAttribute("aria-hidden",!0),p.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),a.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Ys.prototype._updateTitle=function(){var p=this._getTitle();this._fullscreenButton.setAttribute("aria-label",p),this._fullscreenButton.title=p},Ys.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Ys.prototype._isFullscreen=function(){return this._fullscreen},Ys.prototype._changeIcon=function(){(a.window.document.fullscreenElement||a.window.document.mozFullScreenElement||a.window.document.webkitFullscreenElement||a.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Ys.prototype._onClickFullscreen=function(){this._isFullscreen()?a.window.document.exitFullscreen?a.window.document.exitFullscreen():a.window.document.mozCancelFullScreen?a.window.document.mozCancelFullScreen():a.window.document.msExitFullscreen?a.window.document.msExitFullscreen():a.window.document.webkitCancelFullScreen&&a.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Wp={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Df=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),kh=function(p){function v(d){p.call(this),this.options=a.extend(Object.create(Wp),d),a.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return p&&(v.__proto__=p),(v.prototype=Object.create(p&&p.prototype)).constructor=v,v.prototype.addTo=function(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new a.Event("open")),this},v.prototype.isOpen=function(){return!!this._map},v.prototype.remove=function(){return this._content&&c.remove(this._content),this._container&&(c.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new a.Event("close")),this},v.prototype.getLngLat=function(){return this._lngLat},v.prototype.setLngLat=function(d){return this._lngLat=a.LngLat.convert(d),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},v.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},v.prototype.getElement=function(){return this._container},v.prototype.setText=function(d){return this.setDOMContent(a.window.document.createTextNode(d))},v.prototype.setHTML=function(d){var y,S=a.window.document.createDocumentFragment(),C=a.window.document.createElement("body");for(C.innerHTML=d;y=C.firstChild;)S.appendChild(y);return this.setDOMContent(S)},v.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},v.prototype.setMaxWidth=function(d){return this.options.maxWidth=d,this._update(),this},v.prototype.setDOMContent=function(d){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=c.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(d),this._createCloseButton(),this._update(),this._focusFirstElement(),this},v.prototype.addClassName=function(d){this._container&&this._container.classList.add(d)},v.prototype.removeClassName=function(d){this._container&&this._container.classList.remove(d)},v.prototype.setOffset=function(d){return this.options.offset=d,this._update(),this},v.prototype.toggleClassName=function(d){if(this._container)return this._container.classList.toggle(d)},v.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=c.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},v.prototype._onMouseUp=function(d){this._update(d.point)},v.prototype._onMouseMove=function(d){this._update(d.point)},v.prototype._onDrag=function(d){this._update(d.point)},v.prototype._update=function(d){var y=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=c.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=c.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(ae){return y._container.classList.add(ae)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Dc(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||d)){var S=this._pos=this._trackPointer&&d?d:this._map.project(this._lngLat),C=this.options.anchor,I=function ae(oe){if(oe){if(typeof oe=="number"){var we=Math.round(Math.sqrt(.5*Math.pow(oe,2)));return{center:new a.Point(0,0),top:new a.Point(0,oe),"top-left":new a.Point(we,we),"top-right":new a.Point(-we,we),bottom:new a.Point(0,-oe),"bottom-left":new a.Point(we,-we),"bottom-right":new a.Point(-we,-we),left:new a.Point(oe,0),right:new a.Point(-oe,0)}}if(oe instanceof a.Point||Array.isArray(oe)){var be=a.Point.convert(oe);return{center:be,top:be,"top-left":be,"top-right":be,bottom:be,"bottom-left":be,"bottom-right":be,left:be,right:be}}return{center:a.Point.convert(oe.center||[0,0]),top:a.Point.convert(oe.top||[0,0]),"top-left":a.Point.convert(oe["top-left"]||[0,0]),"top-right":a.Point.convert(oe["top-right"]||[0,0]),bottom:a.Point.convert(oe.bottom||[0,0]),"bottom-left":a.Point.convert(oe["bottom-left"]||[0,0]),"bottom-right":a.Point.convert(oe["bottom-right"]||[0,0]),left:a.Point.convert(oe.left||[0,0]),right:a.Point.convert(oe.right||[0,0])}}return ae(new a.Point(0,0))}(this.options.offset);if(!C){var O,z=this._container.offsetWidth,X=this._container.offsetHeight;O=S.y+I.bottom.y<X?["top"]:S.y>this._map.transform.height-X?["bottom"]:[],S.x<z/2?O.push("left"):S.x>this._map.transform.width-z/2&&O.push("right"),C=O.length===0?"bottom":O.join("-")}var ne=S.add(I[C]).round();c.setTransform(this._container,wu[C]+" translate("+ne.x+"px,"+ne.y+"px)"),Mh(this._container,C,"popup")}},v.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var d=this._container.querySelector(Df);d&&d.focus()}},v.prototype._onClose=function(){this.remove()},v}(a.Evented),Dh={version:a.version,supported:u,setRTLTextPlugin:a.setRTLTextPlugin,getRTLTextPluginStatus:a.getRTLTextPluginStatus,Map:Hp,NavigationControl:tl,GeolocateControl:Gp,AttributionControl:No,ScaleControl:uu,FullscreenControl:Ys,Popup:kh,Marker:kf,Style:ms,LngLat:a.LngLat,LngLatBounds:a.LngLatBounds,Point:a.Point,MercatorCoordinate:a.MercatorCoordinate,Evented:a.Evented,config:a.config,prewarm:function(){Dt().acquire(Ot)},clearPrewarmedResources:function(){var p=tn;p&&(p.isPreloaded()&&p.numActive()===1?(p.release(Ot),tn=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return a.config.ACCESS_TOKEN},set accessToken(p){a.config.ACCESS_TOKEN=p},get baseApiUrl(){return a.config.API_URL},set baseApiUrl(p){a.config.API_URL=p},get workerCount(){return ar.workerCount},set workerCount(p){ar.workerCount=p},get maxParallelImageRequests(){return a.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(p){a.config.MAX_PARALLEL_IMAGE_REQUESTS=p},clearStorage:function(p){a.clearTileCache(p)},workerUrl:""};return Dh}),i})})(kO);var ame=kO.exports;const qv=oa(ame);var ome=function(){function e(){Ht(this,e)}return jt(e,[{key:"syncWithMapCamera",value:function(r){var n=r.center,i=r.zoom,o=r.pitch,a=r.bearing,u=r.viewportHeight,c=r.viewportWidth;this.viewport=new OO({width:c,height:u,longitude:n&&n[0],latitude:n&&n[1],zoom:i,pitch:o,bearing:a})}},{key:"getZoom",value:function(){return this.viewport.zoom}},{key:"getZoomScale",value:function(){return Math.pow(2,this.getZoom())}},{key:"getCenter",value:function(){return[this.viewport.longitude,this.viewport.latitude]}},{key:"getProjectionMatrix",value:function(){return this.viewport.projectionMatrix}},{key:"getModelMatrix",value:function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}},{key:"getViewMatrix",value:function(){return this.viewport.viewMatrix}},{key:"getViewMatrixUncentered",value:function(){return this.viewport.viewMatrixUncentered}},{key:"getViewProjectionMatrix",value:function(){return this.viewport.viewProjectionMatrix}},{key:"getViewProjectionMatrixUncentered",value:function(){return this.viewport.viewProjectionMatrix}},{key:"getFocalDistance",value:function(){return 1}},{key:"projectFlat",value:function(r,n){return this.viewport.projectFlat(r,n)}}]),e}(),sme=["id","attributionControl","style","token","rotation","mapInstance"],x9,b9;function ume(e){var t=lme();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function lme(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function cme(e,t){var r=typeof my<"u"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx<"u"&&wx!==null&&(typeof wx.request<"u"||typeof wx.miniProgram<"u");if(!(r||n)&&(t||(t=document),!!t)){var i=t.head||t.getElementsByTagName("head")[0];if(!i){i=t.createElement("head");var o=t.body||t.getElementsByTagName("body")[0];o?o.parentNode.insertBefore(i,o):t.documentElement.appendChild(i)}var a=t.createElement("style");return a.type="text/css",a.styleSheet?a.styleSheet.cssText=e:a.appendChild(t.createTextNode(e)),i.appendChild(a),a}}cme(`.mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mapboxgl-canvas{position:absolute;left:0;top:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{-ms-touch-action:pinch-zoom;touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{-ms-touch-action:none;touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;-webkit-transform:translate(0);transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){-webkit-box-shadow:0 0 0 2px ButtonText;box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{-webkit-box-shadow:0 0 2px 2px #0096ff;box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{-webkit-box-shadow:0 0 2px 2px #0096ff;box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){-webkit-box-shadow:none;box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;-webkit-box-sizing:border-box;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-box;display:-ms-flexbox;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.1);box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:-webkit-box;display:-ms-flexbox;display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:"";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 0 3px rgba(0,0,0,.35);box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);transform:scale(3);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}`);window.mapboxgl=qv;var fme=0,E9="101MlGsZ2AmmA&access_token=pk.eyJ1IjoiZXhhbXBsZXMiLCJhIjoiY2p0MG01MXRqMW45cjQzb2R6b2ptc3J4MSJ9.zA2W0IkI0c6KaAhJfk9bWg",hme=(x9=ai(),x9(b9=function(e){_n(r,e);var t=ume(r);function r(){var n;Ht(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=t.call.apply(t,[this].concat(o)),F($e(n),"version","MAPBOX"),n}return jt(r,[{key:"getType",value:function(){return"mapbox"}},{key:"lngLatToCoord",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{x:0,y:0,z:0},a=this.lngLatToMercator(i,0),u=a.x,c=a.y;return[u-o.x,c-o.y]}},{key:"lngLatToMercator",value:function(i,o){var a=window.mapboxgl.MercatorCoordinate.fromLngLat(i,o),u=a.x,c=u===void 0?0:u,f=a.y,m=f===void 0?0:f,_=a.z,b=_===void 0?0:_;return{x:c,y:m,z:b}}},{key:"getModelMatrix",value:function(i,o,a){var u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[1,1,1],c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{x:0,y:0,z:0},f=window.mapboxgl.MercatorCoordinate.fromLngLat(i,o),m=f.meterInMercatorCoordinateUnits(),_=v1();return Em(_,_,Gl(f.x-c.x,f.y-c.y,f.z||0-c.z)),Sm(_,_,Gl(m*u[0],-m*u[1],m*u[2])),sy(_,_,a[0]),j5(_,_,a[1]),H5(_,_,a[2]),_}},{key:"init",value:function(){var n=Mt(he.mark(function o(){var a=this,u,c,f,m,_,b,A,w,R,P,k,L,B;return he.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:u=this.config,c=u.id,f=c===void 0?"map":c,m=u.attributionControl,_=m===void 0?!1:m,b=u.style,A=b===void 0?"light":b,w=u.token,R=w===void 0?E9:w,P=u.rotation,k=P===void 0?0:P,L=u.mapInstance,B=hl(u,sme),this.viewport=new ome,!L&&!window.mapboxgl&&console.error(this.configService.getSceneWarninfo("SDK")),R===E9&&A!=="blank"&&!window.mapboxgl.accessToken&&!L&&console.warn(this.configService.getSceneWarninfo("MapToken")),!L&&!window.mapboxgl.accessToken&&(window.mapboxgl.accessToken=R),L?(this.map=L,this.$mapContainer=this.map.getContainer()):(this.$mapContainer=this.creatMapContainer(f),this.map=new window.mapboxgl.Map(Qe({container:this.$mapContainer,style:this.getMapStyleValue(A),attributionControl:_,bearing:k},B))),this.map.on("load",function(){a.handleCameraChanged()}),this.map.on("move",this.handleCameraChanged),this.handleCameraChanged();case 9:case"end":return G.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"destroy",value:function(){var i;(i=this.$mapContainer)===null||i===void 0||(i=i.parentNode)===null||i===void 0||i.removeChild(this.$mapContainer),this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}},{key:"emit",value:function(i){for(var o,a=arguments.length,u=new Array(a>1?a-1:0),c=1;c<a;c++)u[c-1]=arguments[c];(o=this.eventEmitter).emit.apply(o,[i].concat(u))}},{key:"once",value:function(i){for(var o,a=arguments.length,u=new Array(a>1?a-1:0),c=1;c<a;c++)u[c-1]=arguments[c];(o=this.eventEmitter).once.apply(o,[i].concat(u))}},{key:"getMapContainer",value:function(){return this.$mapContainer}},{key:"meterToCoord",value:function(i,o){var a=new qv.LngLat(i[0],i[1]),u=new qv.LngLat(o[0],o[1]),c=a.distanceTo(u),f=qv.MercatorCoordinate.fromLngLat({lng:i[0],lat:i[1]}),m=qv.MercatorCoordinate.fromLngLat({lng:o[0],lat:o[1]}),_=f.x,b=f.y,A=m.x,w=m.y,R=Math.sqrt(Math.pow(_-A,2)+Math.pow(b-w,2))*4194304*2;return R/c}},{key:"exportMap",value:function(i){var o=this.map.getCanvas(),a=i==="jpg"?o==null?void 0:o.toDataURL("image/jpeg"):o==null?void 0:o.toDataURL("image/png");return a}},{key:"creatMapContainer",value:function(i){var o=i;typeof i=="string"&&(o=document.getElementById(i));var a=document.createElement("div");return a.style.cssText+=`
|
|
position: absolute;
|
|
top: 0;
|
|
height: 100%;
|
|
width: 100%;
|
|
`,a.id="l7_mapbox_div"+fme++,o.appendChild(a),a}}]),r}(ime))||b9);function pme(e){var t=dme();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function dme(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vme(e,t){var r=typeof my<"u"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx<"u"&&wx!==null&&(typeof wx.request<"u"||typeof wx.miniProgram<"u");if(!(r||n)&&(t||(t=document),!!t)){var i=t.head||t.getElementsByTagName("head")[0];if(!i){i=t.createElement("head");var o=t.body||t.getElementsByTagName("body")[0];o?o.parentNode.insertBefore(i,o):t.documentElement.appendChild(i)}var a=t.createElement("style");return a.type="text/css",a.styleSheet?a.styleSheet.cssText=e:a.appendChild(t.createTextNode(e)),i.appendChild(a),a}}vme(`.mapboxgl-ctrl-logo {
|
|
display: none !important;
|
|
}
|
|
`);var mme=function(e){_n(r,e);var t=pme(r);function r(){return Ht(this,r),t.apply(this,arguments)}return jt(r,[{key:"getServiceConstructor",value:function(){return hme}}]),r}(Wve),gme=function(e){return e==null};const Xl=gme;var _me={}.toString,yme=function(e,t){return _me.call(e)==="[object "+t+"]"},xme=function(e,t,r){return e<t?t:e>r?r:e};const bme=xme;var jd=function(e){return yme(e,"Number")},Lx=function(e,t){return Lx=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Lx(e,t)};function to(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Lx(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Ka=function(){return Ka=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Ka.apply(this,arguments)};function Eme(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function t0(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function u(m){try{f(n.next(m))}catch(_){a(_)}}function c(m){try{f(n.throw(m))}catch(_){a(_)}}function f(m){m.done?o(m.value):i(m.value).then(u,c)}f((n=n.apply(e,t||[])).next())})}function r0(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(f){return function(m){return c([f,m])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(r=0)),r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=t.call(e,r)}catch(m){f=[6,m],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function C1(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function af(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(u){a={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function Pv(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var DO={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,f,m){this.fn=c,this.context=f,this.once=m||!1}function o(c,f,m,_,b){if(typeof m!="function")throw new TypeError("The listener must be a function");var A=new i(m,_||c,b),w=r?r+f:f;return c._events[w]?c._events[w].fn?c._events[w]=[c._events[w],A]:c._events[w].push(A):(c._events[w]=A,c._eventsCount++),c}function a(c,f){--c._eventsCount===0?c._events=new n:delete c._events[f]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],m,_;if(this._eventsCount===0)return f;for(_ in m=this._events)t.call(m,_)&&f.push(r?_.slice(1):_);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(m)):f},u.prototype.listeners=function(f){var m=r?r+f:f,_=this._events[m];if(!_)return[];if(_.fn)return[_.fn];for(var b=0,A=_.length,w=new Array(A);b<A;b++)w[b]=_[b].fn;return w},u.prototype.listenerCount=function(f){var m=r?r+f:f,_=this._events[m];return _?_.fn?1:_.length:0},u.prototype.emit=function(f,m,_,b,A,w){var R=r?r+f:f;if(!this._events[R])return!1;var P=this._events[R],k=arguments.length,L,B;if(P.fn){switch(P.once&&this.removeListener(f,P.fn,void 0,!0),k){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,m),!0;case 3:return P.fn.call(P.context,m,_),!0;case 4:return P.fn.call(P.context,m,_,b),!0;case 5:return P.fn.call(P.context,m,_,b,A),!0;case 6:return P.fn.call(P.context,m,_,b,A,w),!0}for(B=1,L=new Array(k-1);B<k;B++)L[B-1]=arguments[B];P.fn.apply(P.context,L)}else{var V=P.length,G;for(B=0;B<V;B++)switch(P[B].once&&this.removeListener(f,P[B].fn,void 0,!0),k){case 1:P[B].fn.call(P[B].context);break;case 2:P[B].fn.call(P[B].context,m);break;case 3:P[B].fn.call(P[B].context,m,_);break;case 4:P[B].fn.call(P[B].context,m,_,b);break;default:if(!L)for(G=1,L=new Array(k-1);G<k;G++)L[G-1]=arguments[G];P[B].fn.apply(P[B].context,L)}}return!0},u.prototype.on=function(f,m,_){return o(this,f,m,_,!1)},u.prototype.once=function(f,m,_){return o(this,f,m,_,!0)},u.prototype.removeListener=function(f,m,_,b){var A=r?r+f:f;if(!this._events[A])return this;if(!m)return a(this,A),this;var w=this._events[A];if(w.fn)w.fn===m&&(!b||w.once)&&(!_||w.context===_)&&a(this,A);else{for(var R=0,P=[],k=w.length;R<k;R++)(w[R].fn!==m||b&&!w[R].once||_&&w[R].context!==_)&&P.push(w[R]);P.length?this._events[A]=P.length===1?P[0]:P:a(this,A)}return this},u.prototype.removeAllListeners=function(f){var m;return f?(m=r?r+f:f,this._events[m]&&a(this,m)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=r,u.EventEmitter=u,e.exports=u})(DO);var Sme=DO.exports;const FO=oa(Sme);var Re;(function(e){e[e.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",e[e.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",e[e.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN",e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",e[e.FUNC_ADD=32774]="FUNC_ADD",e[e.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",e[e.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",e[e.BLEND_EQUATION=32777]="BLEND_EQUATION",e[e.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",e[e.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",e[e.BLEND_DST_RGB=32968]="BLEND_DST_RGB",e[e.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",e[e.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",e[e.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",e[e.BLEND_COLOR=32773]="BLEND_COLOR",e[e.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",e[e.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",e[e.LINE_WIDTH=2849]="LINE_WIDTH",e[e.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",e[e.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",e[e.CULL_FACE_MODE=2885]="CULL_FACE_MODE",e[e.FRONT_FACE=2886]="FRONT_FACE",e[e.DEPTH_RANGE=2928]="DEPTH_RANGE",e[e.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",e[e.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",e[e.DEPTH_FUNC=2932]="DEPTH_FUNC",e[e.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",e[e.STENCIL_FUNC=2962]="STENCIL_FUNC",e[e.STENCIL_FAIL=2964]="STENCIL_FAIL",e[e.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",e[e.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",e[e.STENCIL_REF=2967]="STENCIL_REF",e[e.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",e[e.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",e[e.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",e[e.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",e[e.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",e[e.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",e[e.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",e[e.VIEWPORT=2978]="VIEWPORT",e[e.SCISSOR_BOX=3088]="SCISSOR_BOX",e[e.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",e[e.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",e[e.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",e[e.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",e[e.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",e[e.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",e[e.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",e[e.RED_BITS=3410]="RED_BITS",e[e.GREEN_BITS=3411]="GREEN_BITS",e[e.BLUE_BITS=3412]="BLUE_BITS",e[e.ALPHA_BITS=3413]="ALPHA_BITS",e[e.DEPTH_BITS=3414]="DEPTH_BITS",e[e.STENCIL_BITS=3415]="STENCIL_BITS",e[e.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",e[e.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",e[e.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",e[e.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",e[e.SAMPLES=32937]="SAMPLES",e[e.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",e[e.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",e[e.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",e[e.VENDOR=7936]="VENDOR",e[e.RENDERER=7937]="RENDERER",e[e.VERSION=7938]="VERSION",e[e.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",e[e.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",e[e.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",e[e.STATIC_DRAW=35044]="STATIC_DRAW",e[e.STREAM_DRAW=35040]="STREAM_DRAW",e[e.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.BUFFER_SIZE=34660]="BUFFER_SIZE",e[e.BUFFER_USAGE=34661]="BUFFER_USAGE",e[e.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",e[e.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",e[e.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",e[e.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",e[e.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",e[e.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",e[e.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",e[e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",e[e.CULL_FACE=2884]="CULL_FACE",e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK",e[e.BLEND=3042]="BLEND",e[e.DEPTH_TEST=2929]="DEPTH_TEST",e[e.DITHER=3024]="DITHER",e[e.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",e[e.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",e[e.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",e[e.SCISSOR_TEST=3089]="SCISSOR_TEST",e[e.STENCIL_TEST=2960]="STENCIL_TEST",e[e.NO_ERROR=0]="NO_ERROR",e[e.INVALID_ENUM=1280]="INVALID_ENUM",e[e.INVALID_VALUE=1281]="INVALID_VALUE",e[e.INVALID_OPERATION=1282]="INVALID_OPERATION",e[e.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",e[e.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",e[e.CW=2304]="CW",e[e.CCW=2305]="CCW",e[e.DONT_CARE=4352]="DONT_CARE",e[e.FASTEST=4353]="FASTEST",e[e.NICEST=4354]="NICEST",e[e.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.DOUBLE=5130]="DOUBLE",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",e[e.VERTEX_SHADER=35633]="VERTEX_SHADER",e[e.COMPILE_STATUS=35713]="COMPILE_STATUS",e[e.DELETE_STATUS=35712]="DELETE_STATUS",e[e.LINK_STATUS=35714]="LINK_STATUS",e[e.VALIDATE_STATUS=35715]="VALIDATE_STATUS",e[e.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",e[e.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",e[e.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",e[e.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",e[e.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",e[e.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",e[e.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",e[e.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",e[e.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",e[e.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",e[e.SHADER_TYPE=35663]="SHADER_TYPE",e[e.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",e[e.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",e[e.NEVER=512]="NEVER",e[e.ALWAYS=519]="ALWAYS",e[e.LESS=513]="LESS",e[e.EQUAL=514]="EQUAL",e[e.LEQUAL=515]="LEQUAL",e[e.GREATER=516]="GREATER",e[e.GEQUAL=518]="GEQUAL",e[e.NOTEQUAL=517]="NOTEQUAL",e[e.KEEP=7680]="KEEP",e[e.REPLACE=7681]="REPLACE",e[e.INCR=7682]="INCR",e[e.DECR=7683]="DECR",e[e.INVERT=5386]="INVERT",e[e.INCR_WRAP=34055]="INCR_WRAP",e[e.DECR_WRAP=34056]="DECR_WRAP",e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9729]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",e[e.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",e[e.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",e[e.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",e[e.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE=5890]="TEXTURE",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e[e.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",e[e.TEXTURE0=33984]="TEXTURE0",e[e.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",e[e.REPEAT=10497]="REPEAT",e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",e[e.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D",e[e.SAMPLER_CUBE=35680]="SAMPLER_CUBE",e[e.LOW_FLOAT=36336]="LOW_FLOAT",e[e.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",e[e.HIGH_FLOAT=36338]="HIGH_FLOAT",e[e.LOW_INT=36339]="LOW_INT",e[e.MEDIUM_INT=36340]="MEDIUM_INT",e[e.HIGH_INT=36341]="HIGH_INT",e[e.FRAMEBUFFER=36160]="FRAMEBUFFER",e[e.RENDERBUFFER=36161]="RENDERBUFFER",e[e.RGBA4=32854]="RGBA4",e[e.RGB5_A1=32855]="RGB5_A1",e[e.RGB565=36194]="RGB565",e[e.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",e[e.STENCIL_INDEX=6401]="STENCIL_INDEX",e[e.STENCIL_INDEX8=36168]="STENCIL_INDEX8",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e[e.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",e[e.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",e[e.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",e[e.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",e[e.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",e[e.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",e[e.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",e[e.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",e[e.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",e[e.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",e[e.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",e[e.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",e[e.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",e[e.NONE=0]="NONE",e[e.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",e[e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",e[e.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",e[e.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",e[e.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",e[e.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",e[e.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",e[e.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",e[e.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",e[e.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",e[e.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",e[e.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",e[e.READ_BUFFER=3074]="READ_BUFFER",e[e.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",e[e.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",e[e.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",e[e.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",e[e.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",e[e.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",e[e.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",e[e.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",e[e.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",e[e.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",e[e.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",e[e.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",e[e.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",e[e.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",e[e.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",e[e.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",e[e.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",e[e.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",e[e.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",e[e.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",e[e.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",e[e.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",e[e.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",e[e.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",e[e.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",e[e.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",e[e.RED=6403]="RED",e[e.RGB8=32849]="RGB8",e[e.RGBA8=32856]="RGBA8",e[e.RGB10_A2=32857]="RGB10_A2",e[e.TEXTURE_3D=32879]="TEXTURE_3D",e[e.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",e[e.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",e[e.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",e[e.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",e[e.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",e[e.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",e[e.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",e[e.SRGB=35904]="SRGB",e[e.SRGB8=35905]="SRGB8",e[e.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",e[e.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",e[e.RGBA32F=34836]="RGBA32F",e[e.RGB32F=34837]="RGB32F",e[e.RGBA16F=34842]="RGBA16F",e[e.RGB16F=34843]="RGB16F",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",e[e.R11F_G11F_B10F=35898]="R11F_G11F_B10F",e[e.RGB9_E5=35901]="RGB9_E5",e[e.RGBA32UI=36208]="RGBA32UI",e[e.RGB32UI=36209]="RGB32UI",e[e.RGBA16UI=36214]="RGBA16UI",e[e.RGB16UI=36215]="RGB16UI",e[e.RGBA8UI=36220]="RGBA8UI",e[e.RGB8UI=36221]="RGB8UI",e[e.RGBA32I=36226]="RGBA32I",e[e.RGB32I=36227]="RGB32I",e[e.RGBA16I=36232]="RGBA16I",e[e.RGB16I=36233]="RGB16I",e[e.RGBA8I=36238]="RGBA8I",e[e.RGB8I=36239]="RGB8I",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.R8=33321]="R8",e[e.RG8=33323]="RG8",e[e.R16F=33325]="R16F",e[e.R32F=33326]="R32F",e[e.RG16F=33327]="RG16F",e[e.RG32F=33328]="RG32F",e[e.R8I=33329]="R8I",e[e.R8UI=33330]="R8UI",e[e.R16I=33331]="R16I",e[e.R16UI=33332]="R16UI",e[e.R32I=33333]="R32I",e[e.R32UI=33334]="R32UI",e[e.RG8I=33335]="RG8I",e[e.RG8UI=33336]="RG8UI",e[e.RG16I=33337]="RG16I",e[e.RG16UI=33338]="RG16UI",e[e.RG32I=33339]="RG32I",e[e.RG32UI=33340]="RG32UI",e[e.R8_SNORM=36756]="R8_SNORM",e[e.RG8_SNORM=36757]="RG8_SNORM",e[e.RGB8_SNORM=36758]="RGB8_SNORM",e[e.RGBA8_SNORM=36759]="RGBA8_SNORM",e[e.RGB10_A2UI=36975]="RGB10_A2UI",e[e.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",e[e.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.HALF_FLOAT=5131]="HALF_FLOAT",e[e.RG=33319]="RG",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",e[e.CURRENT_QUERY=34917]="CURRENT_QUERY",e[e.QUERY_RESULT=34918]="QUERY_RESULT",e[e.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",e[e.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",e[e.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",e[e.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",e[e.DRAW_BUFFER0=34853]="DRAW_BUFFER0",e[e.DRAW_BUFFER1=34854]="DRAW_BUFFER1",e[e.DRAW_BUFFER2=34855]="DRAW_BUFFER2",e[e.DRAW_BUFFER3=34856]="DRAW_BUFFER3",e[e.DRAW_BUFFER4=34857]="DRAW_BUFFER4",e[e.DRAW_BUFFER5=34858]="DRAW_BUFFER5",e[e.DRAW_BUFFER6=34859]="DRAW_BUFFER6",e[e.DRAW_BUFFER7=34860]="DRAW_BUFFER7",e[e.DRAW_BUFFER8=34861]="DRAW_BUFFER8",e[e.DRAW_BUFFER9=34862]="DRAW_BUFFER9",e[e.DRAW_BUFFER10=34863]="DRAW_BUFFER10",e[e.DRAW_BUFFER11=34864]="DRAW_BUFFER11",e[e.DRAW_BUFFER12=34865]="DRAW_BUFFER12",e[e.DRAW_BUFFER13=34866]="DRAW_BUFFER13",e[e.DRAW_BUFFER14=34867]="DRAW_BUFFER14",e[e.DRAW_BUFFER15=34868]="DRAW_BUFFER15",e[e.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",e[e.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",e[e.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",e[e.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",e[e.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",e[e.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",e[e.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",e[e.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",e[e.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",e[e.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",e[e.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",e[e.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",e[e.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",e[e.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",e[e.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",e[e.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",e[e.SAMPLER_3D=35679]="SAMPLER_3D",e[e.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",e[e.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",e[e.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",e[e.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",e[e.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",e[e.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",e[e.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",e[e.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",e[e.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",e[e.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",e[e.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",e[e.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",e[e.MAX_SAMPLES=36183]="MAX_SAMPLES",e[e.SAMPLER_BINDING=35097]="SAMPLER_BINDING",e[e.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",e[e.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",e[e.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",e[e.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",e[e.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",e[e.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",e[e.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",e[e.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",e[e.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",e[e.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",e[e.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",e[e.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",e[e.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",e[e.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",e[e.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",e[e.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",e[e.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",e[e.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",e[e.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",e[e.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",e[e.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",e[e.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",e[e.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",e[e.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",e[e.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",e[e.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",e[e.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",e[e.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",e[e.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",e[e.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",e[e.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",e[e.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",e[e.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",e[e.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",e[e.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",e[e.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",e[e.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",e[e.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",e[e.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",e[e.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",e[e.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",e[e.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",e[e.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",e[e.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",e[e.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",e[e.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",e[e.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",e[e.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",e[e.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",e[e.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",e[e.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",e[e.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",e[e.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",e[e.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",e[e.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",e[e.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",e[e.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",e[e.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",e[e.UNIFORM_TYPE=35383]="UNIFORM_TYPE",e[e.UNIFORM_SIZE=35384]="UNIFORM_SIZE",e[e.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",e[e.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",e[e.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",e[e.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",e[e.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",e[e.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",e[e.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",e[e.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",e[e.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",e[e.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",e[e.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",e[e.OBJECT_TYPE=37138]="OBJECT_TYPE",e[e.SYNC_CONDITION=37139]="SYNC_CONDITION",e[e.SYNC_STATUS=37140]="SYNC_STATUS",e[e.SYNC_FLAGS=37141]="SYNC_FLAGS",e[e.SYNC_FENCE=37142]="SYNC_FENCE",e[e.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",e[e.UNSIGNALED=37144]="UNSIGNALED",e[e.SIGNALED=37145]="SIGNALED",e[e.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",e[e.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",e[e.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",e[e.WAIT_FAILED=37149]="WAIT_FAILED",e[e.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",e[e.COLOR=6144]="COLOR",e[e.DEPTH=6145]="DEPTH",e[e.STENCIL=6146]="STENCIL",e[e.MIN=32775]="MIN",e[e.MAX=32776]="MAX",e[e.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",e[e.STREAM_READ=35041]="STREAM_READ",e[e.STREAM_COPY=35042]="STREAM_COPY",e[e.STATIC_READ=35045]="STATIC_READ",e[e.STATIC_COPY=35046]="STATIC_COPY",e[e.DYNAMIC_READ=35049]="DYNAMIC_READ",e[e.DYNAMIC_COPY=35050]="DYNAMIC_COPY",e[e.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",e[e.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",e[e.INVALID_INDEX=4294967295]="INVALID_INDEX",e[e.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",e[e.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",e[e.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",e[e.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",e[e.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",e[e.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",e[e.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",e[e.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",e[e.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",e[e.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",e[e.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",e[e.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",e[e.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",e[e.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",e[e.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",e[e.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",e[e.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",e[e.UNSIGNED_INT_24_8_WEBGL=34042]="UNSIGNED_INT_24_8_WEBGL",e[e.HALF_FLOAT_OES=36193]="HALF_FLOAT_OES",e[e.RGBA32F_EXT=34836]="RGBA32F_EXT",e[e.RGB32F_EXT=34837]="RGB32F_EXT",e[e.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",e[e.UNSIGNED_NORMALIZED_EXT=35863]="UNSIGNED_NORMALIZED_EXT",e[e.MIN_EXT=32775]="MIN_EXT",e[e.MAX_EXT=32776]="MAX_EXT",e[e.SRGB_EXT=35904]="SRGB_EXT",e[e.SRGB_ALPHA_EXT=35906]="SRGB_ALPHA_EXT",e[e.SRGB8_ALPHA8_EXT=35907]="SRGB8_ALPHA8_EXT",e[e.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",e[e.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT_OES",e[e.COLOR_ATTACHMENT0_WEBGL=36064]="COLOR_ATTACHMENT0_WEBGL",e[e.COLOR_ATTACHMENT1_WEBGL=36065]="COLOR_ATTACHMENT1_WEBGL",e[e.COLOR_ATTACHMENT2_WEBGL=36066]="COLOR_ATTACHMENT2_WEBGL",e[e.COLOR_ATTACHMENT3_WEBGL=36067]="COLOR_ATTACHMENT3_WEBGL",e[e.COLOR_ATTACHMENT4_WEBGL=36068]="COLOR_ATTACHMENT4_WEBGL",e[e.COLOR_ATTACHMENT5_WEBGL=36069]="COLOR_ATTACHMENT5_WEBGL",e[e.COLOR_ATTACHMENT6_WEBGL=36070]="COLOR_ATTACHMENT6_WEBGL",e[e.COLOR_ATTACHMENT7_WEBGL=36071]="COLOR_ATTACHMENT7_WEBGL",e[e.COLOR_ATTACHMENT8_WEBGL=36072]="COLOR_ATTACHMENT8_WEBGL",e[e.COLOR_ATTACHMENT9_WEBGL=36073]="COLOR_ATTACHMENT9_WEBGL",e[e.COLOR_ATTACHMENT10_WEBGL=36074]="COLOR_ATTACHMENT10_WEBGL",e[e.COLOR_ATTACHMENT11_WEBGL=36075]="COLOR_ATTACHMENT11_WEBGL",e[e.COLOR_ATTACHMENT12_WEBGL=36076]="COLOR_ATTACHMENT12_WEBGL",e[e.COLOR_ATTACHMENT13_WEBGL=36077]="COLOR_ATTACHMENT13_WEBGL",e[e.COLOR_ATTACHMENT14_WEBGL=36078]="COLOR_ATTACHMENT14_WEBGL",e[e.COLOR_ATTACHMENT15_WEBGL=36079]="COLOR_ATTACHMENT15_WEBGL",e[e.DRAW_BUFFER0_WEBGL=34853]="DRAW_BUFFER0_WEBGL",e[e.DRAW_BUFFER1_WEBGL=34854]="DRAW_BUFFER1_WEBGL",e[e.DRAW_BUFFER2_WEBGL=34855]="DRAW_BUFFER2_WEBGL",e[e.DRAW_BUFFER3_WEBGL=34856]="DRAW_BUFFER3_WEBGL",e[e.DRAW_BUFFER4_WEBGL=34857]="DRAW_BUFFER4_WEBGL",e[e.DRAW_BUFFER5_WEBGL=34858]="DRAW_BUFFER5_WEBGL",e[e.DRAW_BUFFER6_WEBGL=34859]="DRAW_BUFFER6_WEBGL",e[e.DRAW_BUFFER7_WEBGL=34860]="DRAW_BUFFER7_WEBGL",e[e.DRAW_BUFFER8_WEBGL=34861]="DRAW_BUFFER8_WEBGL",e[e.DRAW_BUFFER9_WEBGL=34862]="DRAW_BUFFER9_WEBGL",e[e.DRAW_BUFFER10_WEBGL=34863]="DRAW_BUFFER10_WEBGL",e[e.DRAW_BUFFER11_WEBGL=34864]="DRAW_BUFFER11_WEBGL",e[e.DRAW_BUFFER12_WEBGL=34865]="DRAW_BUFFER12_WEBGL",e[e.DRAW_BUFFER13_WEBGL=34866]="DRAW_BUFFER13_WEBGL",e[e.DRAW_BUFFER14_WEBGL=34867]="DRAW_BUFFER14_WEBGL",e[e.DRAW_BUFFER15_WEBGL=34868]="DRAW_BUFFER15_WEBGL",e[e.MAX_COLOR_ATTACHMENTS_WEBGL=36063]="MAX_COLOR_ATTACHMENTS_WEBGL",e[e.MAX_DRAW_BUFFERS_WEBGL=34852]="MAX_DRAW_BUFFERS_WEBGL",e[e.VERTEX_ARRAY_BINDING_OES=34229]="VERTEX_ARRAY_BINDING_OES",e[e.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",e[e.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",e[e.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",e[e.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",e[e.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",e[e.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",e[e.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT"})(Re||(Re={}));var ji;(function(e){e[e.Buffer=0]="Buffer",e[e.Texture=1]="Texture",e[e.RenderTarget=2]="RenderTarget",e[e.Sampler=3]="Sampler",e[e.Program=4]="Program",e[e.Bindings=5]="Bindings",e[e.InputLayout=6]="InputLayout",e[e.RenderPipeline=7]="RenderPipeline",e[e.ComputePipeline=8]="ComputePipeline",e[e.Readback=9]="Readback",e[e.QueryPool=10]="QueryPool",e[e.RenderBundle=11]="RenderBundle"})(ji||(ji={}));var Ki;(function(e){e[e.NEVER=512]="NEVER",e[e.LESS=513]="LESS",e[e.EQUAL=514]="EQUAL",e[e.LEQUAL=515]="LEQUAL",e[e.GREATER=516]="GREATER",e[e.NOTEQUAL=517]="NOTEQUAL",e[e.GEQUAL=518]="GEQUAL",e[e.ALWAYS=519]="ALWAYS"})(Ki||(Ki={}));var Bm;(function(e){e[e.CCW=2305]="CCW",e[e.CW=2304]="CW"})(Bm||(Bm={}));var Uu;(function(e){e[e.NONE=0]="NONE",e[e.FRONT=1]="FRONT",e[e.BACK=2]="BACK",e[e.FRONT_AND_BACK=3]="FRONT_AND_BACK"})(Uu||(Uu={}));var Ai;(function(e){e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC=768]="SRC",e[e.ONE_MINUS_SRC=769]="ONE_MINUS_SRC",e[e.DST=774]="DST",e[e.ONE_MINUS_DST=775]="ONE_MINUS_DST",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.CONST=32769]="CONST",e[e.ONE_MINUS_CONSTANT=32770]="ONE_MINUS_CONSTANT",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE"})(Ai||(Ai={}));var hs;(function(e){e[e.ADD=32774]="ADD",e[e.SUBSTRACT=32778]="SUBSTRACT",e[e.REVERSE_SUBSTRACT=32779]="REVERSE_SUBSTRACT",e[e.MIN=32775]="MIN",e[e.MAX=32776]="MAX"})(hs||(hs={}));var gu;(function(e){e[e.CLAMP_TO_EDGE=0]="CLAMP_TO_EDGE",e[e.REPEAT=1]="REPEAT",e[e.MIRRORED_REPEAT=2]="MIRRORED_REPEAT"})(gu||(gu={}));var vo;(function(e){e[e.POINT=0]="POINT",e[e.BILINEAR=1]="BILINEAR"})(vo||(vo={}));var ts;(function(e){e[e.NO_MIP=0]="NO_MIP",e[e.NEAREST=1]="NEAREST",e[e.LINEAR=2]="LINEAR"})(ts||(ts={}));var Fo;(function(e){e[e.POINTS=0]="POINTS",e[e.TRIANGLES=1]="TRIANGLES",e[e.TRIANGLE_STRIP=2]="TRIANGLE_STRIP",e[e.LINES=3]="LINES",e[e.LINE_STRIP=4]="LINE_STRIP"})(Fo||(Fo={}));var da;(function(e){e[e.MAP_READ=1]="MAP_READ",e[e.MAP_WRITE=2]="MAP_WRITE",e[e.COPY_SRC=4]="COPY_SRC",e[e.COPY_DST=8]="COPY_DST",e[e.INDEX=16]="INDEX",e[e.VERTEX=32]="VERTEX",e[e.UNIFORM=64]="UNIFORM",e[e.STORAGE=128]="STORAGE",e[e.INDIRECT=256]="INDIRECT",e[e.QUERY_RESOLVE=512]="QUERY_RESOLVE"})(da||(da={}));var Ec;(function(e){e[e.STATIC=1]="STATIC",e[e.DYNAMIC=2]="DYNAMIC"})(Ec||(Ec={}));var R1;(function(e){e[e.VERTEX=1]="VERTEX",e[e.INSTANCE=2]="INSTANCE"})(R1||(R1={}));var S9;(function(e){e.LOADED="loaded"})(S9||(S9={}));var Ti;(function(e){e[e.TEXTURE_2D=0]="TEXTURE_2D",e[e.TEXTURE_2D_ARRAY=1]="TEXTURE_2D_ARRAY",e[e.TEXTURE_3D=2]="TEXTURE_3D",e[e.TEXTURE_CUBE_MAP=3]="TEXTURE_CUBE_MAP"})(Ti||(Ti={}));var nu;(function(e){e[e.SAMPLED=1]="SAMPLED",e[e.RENDER_TARGET=2]="RENDER_TARGET",e[e.STORAGE=4]="STORAGE"})(nu||(nu={}));var fs;(function(e){e[e.NONE=0]="NONE",e[e.RED=1]="RED",e[e.GREEN=2]="GREEN",e[e.BLUE=4]="BLUE",e[e.ALPHA=8]="ALPHA",e[e.RGB=7]="RGB",e[e.ALL=15]="ALL"})(fs||(fs={}));var eo;(function(e){e[e.KEEP=7680]="KEEP",e[e.ZERO=0]="ZERO",e[e.REPLACE=7681]="REPLACE",e[e.INVERT=5386]="INVERT",e[e.INCREMENT_CLAMP=7682]="INCREMENT_CLAMP",e[e.DECREMENT_CLAMP=7683]="DECREMENT_CLAMP",e[e.INCREMENT_WRAP=34055]="INCREMENT_WRAP",e[e.DECREMENT_WRAP=34056]="DECREMENT_WRAP"})(eo||(eo={}));var Qa;(function(e){e[e.Float=0]="Float",e[e.UnfilterableFloat=1]="UnfilterableFloat",e[e.Uint=2]="Uint",e[e.Sint=3]="Sint",e[e.Depth=4]="Depth"})(Qa||(Qa={}));var vf;(function(e){e[e.LOWER_LEFT=0]="LOWER_LEFT",e[e.UPPER_LEFT=1]="UPPER_LEFT"})(vf||(vf={}));var m0;(function(e){e[e.NEGATIVE_ONE=0]="NEGATIVE_ONE",e[e.ZERO=1]="ZERO"})(m0||(m0={}));var x_;(function(e){e[e.OcclusionConservative=0]="OcclusionConservative"})(x_||(x_={}));var Kt;(function(e){e[e.U8=1]="U8",e[e.U16=2]="U16",e[e.U32=3]="U32",e[e.S8=4]="S8",e[e.S16=5]="S16",e[e.S32=6]="S32",e[e.F16=7]="F16",e[e.F32=8]="F32",e[e.BC1=65]="BC1",e[e.BC2=66]="BC2",e[e.BC3=67]="BC3",e[e.BC4_UNORM=68]="BC4_UNORM",e[e.BC4_SNORM=69]="BC4_SNORM",e[e.BC5_UNORM=70]="BC5_UNORM",e[e.BC5_SNORM=71]="BC5_SNORM",e[e.U16_PACKED_5551=97]="U16_PACKED_5551",e[e.U16_PACKED_565=98]="U16_PACKED_565",e[e.D24=129]="D24",e[e.D32F=130]="D32F",e[e.D24S8=131]="D24S8",e[e.D32FS8=132]="D32FS8"})(Kt||(Kt={}));var ln;(function(e){e[e.R=1]="R",e[e.RG=2]="RG",e[e.RGB=3]="RGB",e[e.RGBA=4]="RGBA",e[e.A=5]="A"})(ln||(ln={}));var Wr;(function(e){e[e.None=0]="None",e[e.Normalized=1]="Normalized",e[e.sRGB=2]="sRGB",e[e.Depth=4]="Depth",e[e.Stencil=8]="Stencil",e[e.RenderTarget=16]="RenderTarget",e[e.Luminance=32]="Luminance"})(Wr||(Wr={}));function Rn(e,t,r){return e<<16|t<<8|r}var Ke;(function(e){e[e.ALPHA=Rn(Kt.U8,ln.A,Wr.None)]="ALPHA",e[e.U8_LUMINANCE=Rn(Kt.U8,ln.A,Wr.Luminance)]="U8_LUMINANCE",e[e.F16_LUMINANCE=Rn(Kt.F16,ln.A,Wr.Luminance)]="F16_LUMINANCE",e[e.F32_LUMINANCE=Rn(Kt.F32,ln.A,Wr.Luminance)]="F32_LUMINANCE",e[e.F16_R=Rn(Kt.F16,ln.R,Wr.None)]="F16_R",e[e.F16_RG=Rn(Kt.F16,ln.RG,Wr.None)]="F16_RG",e[e.F16_RGB=Rn(Kt.F16,ln.RGB,Wr.None)]="F16_RGB",e[e.F16_RGBA=Rn(Kt.F16,ln.RGBA,Wr.None)]="F16_RGBA",e[e.F32_R=Rn(Kt.F32,ln.R,Wr.None)]="F32_R",e[e.F32_RG=Rn(Kt.F32,ln.RG,Wr.None)]="F32_RG",e[e.F32_RGB=Rn(Kt.F32,ln.RGB,Wr.None)]="F32_RGB",e[e.F32_RGBA=Rn(Kt.F32,ln.RGBA,Wr.None)]="F32_RGBA",e[e.U8_R=Rn(Kt.U8,ln.R,Wr.None)]="U8_R",e[e.U8_R_NORM=Rn(Kt.U8,ln.R,Wr.Normalized)]="U8_R_NORM",e[e.U8_RG=Rn(Kt.U8,ln.RG,Wr.None)]="U8_RG",e[e.U8_RG_NORM=Rn(Kt.U8,ln.RG,Wr.Normalized)]="U8_RG_NORM",e[e.U8_RGB=Rn(Kt.U8,ln.RGB,Wr.None)]="U8_RGB",e[e.U8_RGB_NORM=Rn(Kt.U8,ln.RGB,Wr.Normalized)]="U8_RGB_NORM",e[e.U8_RGB_SRGB=Rn(Kt.U8,ln.RGB,Wr.sRGB|Wr.Normalized)]="U8_RGB_SRGB",e[e.U8_RGBA=Rn(Kt.U8,ln.RGBA,Wr.None)]="U8_RGBA",e[e.U8_RGBA_NORM=Rn(Kt.U8,ln.RGBA,Wr.Normalized)]="U8_RGBA_NORM",e[e.U8_RGBA_SRGB=Rn(Kt.U8,ln.RGBA,Wr.sRGB|Wr.Normalized)]="U8_RGBA_SRGB",e[e.U16_R=Rn(Kt.U16,ln.R,Wr.None)]="U16_R",e[e.U16_R_NORM=Rn(Kt.U16,ln.R,Wr.Normalized)]="U16_R_NORM",e[e.U16_RG_NORM=Rn(Kt.U16,ln.RG,Wr.Normalized)]="U16_RG_NORM",e[e.U16_RGBA_NORM=Rn(Kt.U16,ln.RGBA,Wr.Normalized)]="U16_RGBA_NORM",e[e.U16_RGBA=Rn(Kt.U16,ln.RGBA,Wr.None)]="U16_RGBA",e[e.U16_RGB=Rn(Kt.U16,ln.RGB,Wr.None)]="U16_RGB",e[e.U16_RG=Rn(Kt.U16,ln.RG,Wr.None)]="U16_RG",e[e.U32_R=Rn(Kt.U32,ln.R,Wr.None)]="U32_R",e[e.U32_RG=Rn(Kt.U32,ln.RG,Wr.None)]="U32_RG",e[e.U32_RGB=Rn(Kt.U32,ln.RGB,Wr.None)]="U32_RGB",e[e.U32_RGBA=Rn(Kt.U32,ln.RGBA,Wr.None)]="U32_RGBA",e[e.S8_R=Rn(Kt.S8,ln.R,Wr.None)]="S8_R",e[e.S8_R_NORM=Rn(Kt.S8,ln.R,Wr.Normalized)]="S8_R_NORM",e[e.S8_RG_NORM=Rn(Kt.S8,ln.RG,Wr.Normalized)]="S8_RG_NORM",e[e.S8_RGB_NORM=Rn(Kt.S8,ln.RGB,Wr.Normalized)]="S8_RGB_NORM",e[e.S8_RGBA_NORM=Rn(Kt.S8,ln.RGBA,Wr.Normalized)]="S8_RGBA_NORM",e[e.S16_R=Rn(Kt.S16,ln.R,Wr.None)]="S16_R",e[e.S16_RG=Rn(Kt.S16,ln.RG,Wr.None)]="S16_RG",e[e.S16_RG_NORM=Rn(Kt.S16,ln.RG,Wr.Normalized)]="S16_RG_NORM",e[e.S16_RGB_NORM=Rn(Kt.S16,ln.RGB,Wr.Normalized)]="S16_RGB_NORM",e[e.S16_RGBA=Rn(Kt.S16,ln.RGBA,Wr.None)]="S16_RGBA",e[e.S16_RGBA_NORM=Rn(Kt.S16,ln.RGBA,Wr.Normalized)]="S16_RGBA_NORM",e[e.S32_R=Rn(Kt.S32,ln.R,Wr.None)]="S32_R",e[e.S32_RG=Rn(Kt.S32,ln.RG,Wr.None)]="S32_RG",e[e.S32_RGB=Rn(Kt.S32,ln.RGB,Wr.None)]="S32_RGB",e[e.S32_RGBA=Rn(Kt.S32,ln.RGBA,Wr.None)]="S32_RGBA",e[e.U16_RGBA_5551=Rn(Kt.U16_PACKED_5551,ln.RGBA,Wr.Normalized)]="U16_RGBA_5551",e[e.U16_RGB_565=Rn(Kt.U16_PACKED_565,ln.RGB,Wr.Normalized)]="U16_RGB_565",e[e.BC1=Rn(Kt.BC1,ln.RGBA,Wr.Normalized)]="BC1",e[e.BC1_SRGB=Rn(Kt.BC1,ln.RGBA,Wr.Normalized|Wr.sRGB)]="BC1_SRGB",e[e.BC2=Rn(Kt.BC2,ln.RGBA,Wr.Normalized)]="BC2",e[e.BC2_SRGB=Rn(Kt.BC2,ln.RGBA,Wr.Normalized|Wr.sRGB)]="BC2_SRGB",e[e.BC3=Rn(Kt.BC3,ln.RGBA,Wr.Normalized)]="BC3",e[e.BC3_SRGB=Rn(Kt.BC3,ln.RGBA,Wr.Normalized|Wr.sRGB)]="BC3_SRGB",e[e.BC4_UNORM=Rn(Kt.BC4_UNORM,ln.R,Wr.Normalized)]="BC4_UNORM",e[e.BC4_SNORM=Rn(Kt.BC4_SNORM,ln.R,Wr.Normalized)]="BC4_SNORM",e[e.BC5_UNORM=Rn(Kt.BC5_UNORM,ln.RG,Wr.Normalized)]="BC5_UNORM",e[e.BC5_SNORM=Rn(Kt.BC5_SNORM,ln.RG,Wr.Normalized)]="BC5_SNORM",e[e.D24=Rn(Kt.D24,ln.R,Wr.Depth)]="D24",e[e.D24_S8=Rn(Kt.D24S8,ln.RG,Wr.Depth|Wr.Stencil)]="D24_S8",e[e.D32F=Rn(Kt.D32F,ln.R,Wr.Depth)]="D32F",e[e.D32F_S8=Rn(Kt.D32FS8,ln.RG,Wr.Depth|Wr.Stencil)]="D32F_S8",e[e.U8_RGB_RT=Rn(Kt.U8,ln.RGB,Wr.RenderTarget|Wr.Normalized)]="U8_RGB_RT",e[e.U8_RGBA_RT=Rn(Kt.U8,ln.RGBA,Wr.RenderTarget|Wr.Normalized)]="U8_RGBA_RT",e[e.U8_RGBA_RT_SRGB=Rn(Kt.U8,ln.RGBA,Wr.RenderTarget|Wr.Normalized|Wr.sRGB)]="U8_RGBA_RT_SRGB"})(Ke||(Ke={}));function bb(e){return e>>>8&255}function _f(e){return e>>>16&255}function g0(e){return e&255}function BO(e){switch(e){case Kt.F32:case Kt.U32:case Kt.S32:return 4;case Kt.U16:case Kt.S16:case Kt.F16:return 2;case Kt.U8:case Kt.S8:return 1;default:throw new Error("whoops")}}function LO(e){return BO(_f(e))}function Ame(e){var t=BO(_f(e)),r=bb(e);return t*r}function NO(e){var t=g0(e);if(t&Wr.Depth)return Qa.Depth;if(t&Wr.Normalized)return Qa.Float;var r=_f(e);if(r===Kt.F16||r===Kt.F32)return Qa.Float;if(r===Kt.U8||r===Kt.U16||r===Kt.U32)return Qa.Uint;if(r===Kt.S8||r===Kt.S16||r===Kt.S32)return Qa.Sint;throw new Error("whoops")}function ii(e,t){if(t===void 0&&(t=""),!e)throw new Error("Assert fail: ".concat(t))}function g1(e){if(e!=null)return e;throw new Error("Missing object")}function UO(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}function zO(e,t){e.r=t.r,e.g=t.g,e.b=t.b,e.a=t.a}function $O(e){var t=e.r,r=e.g,n=e.b,i=e.a;return{r:t,g:r,b:n,a:i}}function Jm(e,t,r,n){return n===void 0&&(n=1),{r:e,g:t,b:r,a:n}}var xy=Jm(0,0,0,0);Jm(0,0,0,1);var Tme=Jm(1,1,1,0);Jm(1,1,1,1);function b_(e){return!!(e&&!(e&e-1))}function Pd(e,t){return e??t}function wme(e){return e===void 0?null:e}function E_(e,t){var r=t-1;return e+r&~r}function Cme(e,t){for(var r=new Array(e),n=0;n<e;n++)r[n]=t();return r}function Rme(e,t){t===void 0&&(t=1);var r=e.split(`
|
|
`);return r.map(function(n,i){return"".concat(Ime(""+(t+i),4," ")," ").concat(n)}).join(`
|
|
`)}function Ime(e,t,r){for(r===void 0&&(r="0");e.length<t;)e="".concat(r).concat(e);return e}function A9(e,t){e.blendDstFactor=t.blendDstFactor,e.blendSrcFactor=t.blendSrcFactor,e.blendMode=t.blendMode}function S_(e,t){return e===void 0&&(e={}),e.compare=t.compare,e.depthFailOp=t.depthFailOp,e.passOp=t.passOp,e.failOp=t.failOp,e.mask=t.mask,e}function VO(e,t){return e===void 0&&(e={rgbBlendState:{},alphaBlendState:{},channelWriteMask:0}),A9(e.rgbBlendState,t.rgbBlendState),A9(e.alphaBlendState,t.alphaBlendState),e.channelWriteMask=t.channelWriteMask,e}function jO(e,t){e.length!==t.length&&(e.length=t.length);for(var r=0;r<t.length;r++)e[r]=VO(e[r],t[r])}function Mme(e,t){t.attachmentsState!==void 0&&jO(e.attachmentsState,t.attachmentsState),e.blendConstant&&t.blendConstant&&zO(e.blendConstant,t.blendConstant),e.depthCompare=Pd(t.depthCompare,e.depthCompare),e.depthWrite=Pd(t.depthWrite,e.depthWrite),e.stencilWrite=Pd(t.stencilWrite,e.stencilWrite),e.stencilFront&&t.stencilFront&&S_(e.stencilFront,t.stencilFront),e.stencilBack&&t.stencilBack&&S_(e.stencilBack,t.stencilBack),e.cullMode=Pd(t.cullMode,e.cullMode),e.frontFace=Pd(t.frontFace,e.frontFace),e.polygonOffset=Pd(t.polygonOffset,e.polygonOffset)}function _0(e){var t=Object.assign({},e);return t.attachmentsState=[],jO(t.attachmentsState,e.attachmentsState),t.blendConstant=t.blendConstant&&$O(t.blendConstant),t.stencilFront=S_(void 0,e.stencilFront),t.stencilBack=S_(void 0,e.stencilBack),t}var T9={blendMode:hs.ADD,blendSrcFactor:Ai.ONE,blendDstFactor:Ai.ZERO},y0={attachmentsState:[{channelWriteMask:fs.ALL,rgbBlendState:T9,alphaBlendState:T9}],blendConstant:$O(xy),depthWrite:!0,depthCompare:Ki.LEQUAL,stencilWrite:!1,stencilFront:{compare:Ki.ALWAYS,passOp:eo.KEEP,depthFailOp:eo.KEEP,failOp:eo.KEEP},stencilBack:{compare:Ki.ALWAYS,passOp:eo.KEEP,depthFailOp:eo.KEEP,failOp:eo.KEEP},cullMode:Uu.NONE,frontFace:Bm.CCW,polygonOffset:!1};function Pme(e,t){e===void 0&&(e=null),t===void 0&&(t=y0);var r=_0(t);return e!==null&&Mme(r,e),r}Pme({depthCompare:Ki.ALWAYS,depthWrite:!1},y0);var HO={texture:null,sampler:null,formatKind:Qa.Float,dimension:Ti.TEXTURE_2D};function hp(e,t,r){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1;return!0}function Hd(e,t){for(var r=Array(e.length),n=0;n<e.length;n++)r[n]=t(e[n]);return r}function Ome(e,t){return e.texture===t.texture&&e.binding===t.binding}function w9(e,t){return e.buffer===t.buffer&&e.size===t.size&&e.binding===t.binding&&e.offset===t.offset}function kme(e,t){return e===null?t===null:t===null?!1:e.sampler===t.sampler&&e.texture===t.texture&&e.dimension===t.dimension&&e.formatKind===t.formatKind&&e.comparison===t.comparison}function Dme(e,t){return e.samplerBindings=e.samplerBindings||[],e.uniformBufferBindings=e.uniformBufferBindings||[],e.storageBufferBindings=e.storageBufferBindings||[],e.storageTextureBindings=e.storageTextureBindings||[],t.samplerBindings=t.samplerBindings||[],t.uniformBufferBindings=t.uniformBufferBindings||[],t.storageBufferBindings=t.storageBufferBindings||[],t.storageTextureBindings=t.storageTextureBindings||[],!(e.samplerBindings.length!==t.samplerBindings.length||!hp(e.samplerBindings,t.samplerBindings,kme)||!hp(e.uniformBufferBindings,t.uniformBufferBindings,w9)||!hp(e.storageBufferBindings,t.storageBufferBindings,w9)||!hp(e.storageTextureBindings,t.storageTextureBindings,Ome))}function C9(e,t){return e.blendMode==t.blendMode&&e.blendSrcFactor===t.blendSrcFactor&&e.blendDstFactor===t.blendDstFactor}function Fme(e,t){return!(!C9(e.rgbBlendState,t.rgbBlendState)||!C9(e.alphaBlendState,t.alphaBlendState)||e.channelWriteMask!==t.channelWriteMask)}function A_(e,t){return e.compare==t.compare&&e.depthFailOp===t.depthFailOp&&e.failOp===t.failOp&&e.passOp===t.passOp&&e.mask===t.mask}function Bme(e,t){return!hp(e.attachmentsState,t.attachmentsState,Fme)||e.blendConstant&&t.blendConstant&&!UO(e.blendConstant,t.blendConstant)||e.stencilFront&&t.stencilFront&&!A_(e.stencilFront,t.stencilFront)||e.stencilBack&&t.stencilBack&&!A_(e.stencilBack,t.stencilBack)?!1:e.depthCompare===t.depthCompare&&e.depthWrite===t.depthWrite&&e.stencilWrite===t.stencilWrite&&e.cullMode===t.cullMode&&e.frontFace===t.frontFace&&e.polygonOffset===t.polygonOffset}function GO(e,t){return e.id===t.id}function Lme(e,t){return e===t}function Nme(e,t){return!(e.topology!==t.topology||e.inputLayout!==t.inputLayout||e.sampleCount!==t.sampleCount||e.megaStateDescriptor&&t.megaStateDescriptor&&!Bme(e.megaStateDescriptor,t.megaStateDescriptor)||!GO(e.program,t.program)||!hp(e.colorAttachmentFormats,t.colorAttachmentFormats,Lme)||e.depthStencilAttachmentFormat!==t.depthStencilAttachmentFormat)}function Ume(e,t){return e.offset===t.offset&&e.shaderLocation===t.shaderLocation&&e.format===t.format&&e.divisor===t.divisor}function zme(e,t){return Xl(e)?Xl(t):Xl(t)?!1:e.arrayStride===t.arrayStride&&e.stepMode===t.stepMode&&hp(e.attributes,t.attributes,Ume)}function $me(e,t){return!(e.indexBufferFormat!==t.indexBufferFormat||!hp(e.vertexBufferDescriptors,t.vertexBufferDescriptors,zme)||!GO(e.program,t.program))}function Vme(e){var t=e.sampler,r=e.texture,n=e.dimension,i=e.formatKind,o=e.comparison;return{sampler:t,texture:r,dimension:n,formatKind:i,comparison:o}}function R9(e){var t=e.buffer,r=e.size,n=e.binding,i=e.offset;return{binding:n,buffer:t,offset:i,size:r}}function jme(e){var t=e.binding,r=e.texture;return{binding:t,texture:r}}function Hme(e){var t=e.samplerBindings&&Hd(e.samplerBindings,Vme),r=e.uniformBufferBindings&&Hd(e.uniformBufferBindings,R9),n=e.storageBufferBindings&&Hd(e.storageBufferBindings,R9),i=e.storageTextureBindings&&Hd(e.storageTextureBindings,jme);return{samplerBindings:t,uniformBufferBindings:r,storageBufferBindings:n,storageTextureBindings:i,pipeline:e.pipeline}}function Gme(e){var t=e.inputLayout,r=e.program,n=e.topology,i=e.megaStateDescriptor&&_0(e.megaStateDescriptor),o=e.colorAttachmentFormats.slice(),a=e.depthStencilAttachmentFormat,u=e.sampleCount;return{inputLayout:t,megaStateDescriptor:i,program:r,topology:n,colorAttachmentFormats:o,depthStencilAttachmentFormat:a,sampleCount:u}}function Wme(e){var t=e.shaderLocation,r=e.format,n=e.offset,i=e.divisor;return{shaderLocation:t,format:r,offset:n,divisor:i}}function Xme(e){if(Xl(e))return e;var t=e.arrayStride,r=e.stepMode,n=Hd(e.attributes,Wme);return{arrayStride:t,stepMode:r,attributes:n}}function Yme(e){var t=Hd(e.vertexBufferDescriptors,Xme),r=e.indexBufferFormat,n=e.program;return{vertexBufferDescriptors:t,indexBufferFormat:r,program:n}}var Oi,Zme=/([^[]*)(\[[0-9]+\])?/;function qme(e){if(e[e.length-1]!=="]")return{name:e,length:1,isArray:!1};var t=e.match(Zme);if(!t||t.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(e));return{name:t[1],length:Number(t[2])||1,isArray:!!t[2]}}function pu(){var e=null;return function(t,r,n){var i=e!==n;return i&&(t.uniform1i(r,n),e=n),i}}function Za(e,t,r,n){var i=null,o=null;return function(a,u,c){var f=t(c,r),m=f.length,_=!1;if(i===null)i=new Float32Array(m),o=m,_=!0;else{ii(o===m,"Uniform length cannot change.");for(var b=0;b<m;++b)if(f[b]!==i[b]){_=!0;break}}return _&&(n(a,e,u,f),i.set(f)),_}}function Js(e,t,r,n){e[t](r,n)}function Zf(e,t,r,n){e[t](r,!1,n)}var Kme={},Qme={},Jme={},I9=[0];function Eb(e,t,r,n){t===1&&typeof e=="boolean"&&(e=e?1:0),Number.isFinite(e)&&(I9[0]=e,e=I9);var i=e.length;if(e instanceof r)return e;var o=n[i];o||(o=new r(i),n[i]=o);for(var a=0;a<i;a++)o[a]=e[a];return o}function sl(e,t){return Eb(e,t,Float32Array,Kme)}function ep(e,t){return Eb(e,t,Int32Array,Qme)}function ag(e,t){return Eb(e,t,Uint32Array,Jme)}var e2e=(Oi={},Oi[Re.FLOAT]=Za.bind(null,"uniform1fv",sl,1,Js),Oi[Re.FLOAT_VEC2]=Za.bind(null,"uniform2fv",sl,2,Js),Oi[Re.FLOAT_VEC3]=Za.bind(null,"uniform3fv",sl,3,Js),Oi[Re.FLOAT_VEC4]=Za.bind(null,"uniform4fv",sl,4,Js),Oi[Re.INT]=Za.bind(null,"uniform1iv",ep,1,Js),Oi[Re.INT_VEC2]=Za.bind(null,"uniform2iv",ep,2,Js),Oi[Re.INT_VEC3]=Za.bind(null,"uniform3iv",ep,3,Js),Oi[Re.INT_VEC4]=Za.bind(null,"uniform4iv",ep,4,Js),Oi[Re.BOOL]=Za.bind(null,"uniform1iv",ep,1,Js),Oi[Re.BOOL_VEC2]=Za.bind(null,"uniform2iv",ep,2,Js),Oi[Re.BOOL_VEC3]=Za.bind(null,"uniform3iv",ep,3,Js),Oi[Re.BOOL_VEC4]=Za.bind(null,"uniform4iv",ep,4,Js),Oi[Re.FLOAT_MAT2]=Za.bind(null,"uniformMatrix2fv",sl,4,Zf),Oi[Re.FLOAT_MAT3]=Za.bind(null,"uniformMatrix3fv",sl,9,Zf),Oi[Re.FLOAT_MAT4]=Za.bind(null,"uniformMatrix4fv",sl,16,Zf),Oi[Re.UNSIGNED_INT]=Za.bind(null,"uniform1uiv",ag,1,Js),Oi[Re.UNSIGNED_INT_VEC2]=Za.bind(null,"uniform2uiv",ag,2,Js),Oi[Re.UNSIGNED_INT_VEC3]=Za.bind(null,"uniform3uiv",ag,3,Js),Oi[Re.UNSIGNED_INT_VEC4]=Za.bind(null,"uniform4uiv",ag,4,Js),Oi[Re.FLOAT_MAT2x3]=Za.bind(null,"uniformMatrix2x3fv",sl,6,Zf),Oi[Re.FLOAT_MAT2x4]=Za.bind(null,"uniformMatrix2x4fv",sl,8,Zf),Oi[Re.FLOAT_MAT3x2]=Za.bind(null,"uniformMatrix3x2fv",sl,6,Zf),Oi[Re.FLOAT_MAT3x4]=Za.bind(null,"uniformMatrix3x4fv",sl,12,Zf),Oi[Re.FLOAT_MAT4x2]=Za.bind(null,"uniformMatrix4x2fv",sl,8,Zf),Oi[Re.FLOAT_MAT4x3]=Za.bind(null,"uniformMatrix4x3fv",sl,12,Zf),Oi[Re.SAMPLER_2D]=pu,Oi[Re.SAMPLER_CUBE]=pu,Oi[Re.SAMPLER_3D]=pu,Oi[Re.SAMPLER_2D_SHADOW]=pu,Oi[Re.SAMPLER_2D_ARRAY]=pu,Oi[Re.SAMPLER_2D_ARRAY_SHADOW]=pu,Oi[Re.SAMPLER_CUBE_SHADOW]=pu,Oi[Re.INT_SAMPLER_2D]=pu,Oi[Re.INT_SAMPLER_3D]=pu,Oi[Re.INT_SAMPLER_CUBE]=pu,Oi[Re.INT_SAMPLER_2D_ARRAY]=pu,Oi[Re.UNSIGNED_INT_SAMPLER_2D]=pu,Oi[Re.UNSIGNED_INT_SAMPLER_3D]=pu,Oi[Re.UNSIGNED_INT_SAMPLER_CUBE]=pu,Oi[Re.UNSIGNED_INT_SAMPLER_2D_ARRAY]=pu,Oi);function M9(e,t,r){var n=e2e[r.type];if(!n)throw new Error("Unknown GLSL uniform type ".concat(r.type));return n().bind(null,e,t)}var t2e={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121};function r2e(e){return Object.prototype.toString.call(e)in t2e}function Ov(e,t){return"#define ".concat(e," ").concat(t)}function n2e(e){var t={};return e.replace(/^\s*#define\s*(\S*)\s*(\S*)\s*$/gm,function(r,n,i){var o=Number(i);return t[n]=isNaN(o)?i:o,""}),t}function i2e(e,t){var r=[];return e.replace(/^\s*layout\(location\s*=\s*(\S*)\)\s*in\s+\S+\s*(.*);$/gm,function(n,i,o){var a=Number(i);return r.push({location:isNaN(a)?t[i]:a,name:o}),""}),r}function P9(e){if(e===void 0)return null;var t=/binding\s*=\s*(\d+)/.exec(e);if(t!==null){var r=parseInt(t[1],10);if(!Number.isNaN(r))return r}return null}function a2e(e){var t="",r=e;return[r,t]}function x0(e,t,r,n,i){var o;n===void 0&&(n=null),i===void 0&&(i=!0);var a=e.glslVersion==="#version 100",u=t==="frag"&&((o=r.match(/^\s*layout\(location\s*=\s*\d*\)\s*out\s+vec4\s*(.*);$/gm))===null||o===void 0?void 0:o.length)>1,c=r.replace(`\r
|
|
`,`
|
|
`).split(`
|
|
`).map(function(K){return K.replace(/[/][/].*$/,"")}).filter(function(K){var Z=!K||/^\s+$/.test(K);return!Z}),f="";n!==null&&(f=Object.keys(n).map(function(K){return Ov(K,n[K])}).join(`
|
|
`));var m=c.find(function(K){return K.startsWith("precision")})||"precision mediump float;",_=i?c.filter(function(K){return!K.startsWith("precision")}).join(`
|
|
`):c.join(`
|
|
`),b="";if(e.viewportOrigin===vf.UPPER_LEFT&&(b+="".concat(Ov("VIEWPORT_ORIGIN_TL","1"),`
|
|
`)),e.clipSpaceNearZ===m0.ZERO&&(b+="".concat(Ov("CLIPSPACE_NEAR_ZERO","1"),`
|
|
`)),e.explicitBindingLocations){var A=0,w=0,R=0;_=_.replace(/^\s*(layout\((.*)\))?\s*uniform(.+{)$/gm,function(K,Z,ve,Ie){var de=ve?"".concat(ve,", "):"";return"layout(".concat(de,"set = ").concat(A,", binding = ").concat(w++,") uniform ").concat(Ie)}),A++,w=0,ii(e.separateSamplerTextures),_=_.replace(/^\s*(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm,function(K,Z,ve,Ie,de){var se=P9(ve);se===null&&(se=w++);var le=af(a2e(Ie),2),ye=le[0],ke=le[1];return t==="frag"?`
|
|
layout(set = `.concat(A,", binding = ").concat(se*2+0,") uniform texture").concat(ye," T_").concat(de,`;
|
|
layout(set = `).concat(A,", binding = ").concat(se*2+1,") uniform sampler").concat(ke," S_").concat(de,";").trim():""}),_=_.replace(t==="frag"?/^\s*\b(varying|in)\b/gm:/^\s*\b(varying|out)\b/gm,function(K,Z){return"layout(location = ".concat(R++,") ").concat(Z)}),b+="".concat(Ov("gl_VertexID","gl_VertexIndex"),`
|
|
`),b+="".concat(Ov("gl_InstanceID","gl_InstanceIndex"),`
|
|
`),m=m.replace(/^precision (.*) sampler(.*);$/gm,"")}else{var P=0;_=_.replace(/^\s*(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm,function(K,Z,ve,Ie,de){var se=P9(ve);return se===null&&(se=P++),"uniform sampler".concat(Ie," ").concat(de,"; // BINDING=").concat(se)})}if(e.separateSamplerTextures)_=_.replace(/\bSAMPLER_(\w+)\((.*?)\)/g,function(K,Z,ve){return"sampler".concat(Z,"(T_").concat(ve,", S_").concat(ve,")")}),_=_.replace(/\bTEXTURE\((.*?)\)/g,function(K,Z){return"T_".concat(Z)});else{var k=[];_=_.replace(/\bSAMPLER_(\w+)\((.*?)\)/g,function(K,Z,ve){return k.push([ve,Z]),ve}),a&&k.forEach(function(K){var Z=af(K,2),ve=Z[0],Ie=Z[1];_=_.replace(new RegExp("texture\\(".concat(ve),"g"),function(){return"texture".concat(Ie,"(").concat(ve)})}),_=_.replace(/\bTEXTURE\((.*?)\)/g,function(K,Z){return Z})}var L="".concat(a?"":e.glslVersion,`
|
|
`).concat(a&&u?`#extension GL_EXT_draw_buffers : require
|
|
`:"",`
|
|
`).concat(a&&t==="frag"?`#extension GL_OES_standard_derivatives : enable
|
|
`:"").concat(i?m:"",`
|
|
`).concat(b||"").concat(f?f+`
|
|
`:"",`
|
|
`).concat(_,`
|
|
`).trim();if(e.explicitBindingLocations&&t==="frag"&&(L=L.replace(/^\b(out)\b/g,function(K,Z){return"layout(location = 0) ".concat(Z)})),a){if(t==="frag"&&(L=L.replace(/^\s*in\s+(\S+)\s*(.*);$/gm,function(K,Z,ve){return"varying ".concat(Z," ").concat(ve,`;
|
|
`)})),t==="vert"&&(L=L.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,function(K,Z,ve){return"varying ".concat(Z," ").concat(ve,`;
|
|
`)}),L=L.replace(/^\s*layout\(location\s*=\s*\S*\)\s*in\s+(\S+)\s*(.*);$/gm,function(K,Z,ve){return"attribute ".concat(Z," ").concat(ve,`;
|
|
`)})),L=L.replace(/\s*uniform\s*.*\s*{((?:\s*.*\s*)*?)};/g,function(K,Z){return Z.trim().replace(/^.*$/gm,function(ve){var Ie=ve.trim();return Ie.startsWith("#")?Ie:ve?"uniform ".concat(Ie):""})}),t==="frag")if(u){var B=[];L=L.replace(/^\s*layout\(location\s*=\s*\d*\)\s*out\s+vec4\s*(.*);$/gm,function(K,Z){return B.push(Z),"vec4 ".concat(Z,`;
|
|
`)});var V=L.lastIndexOf("}");L=L.substring(0,V)+`
|
|
`.concat(B.map(function(K,Z){return"gl_FragData[".concat(Z,"] = ").concat(K,`;
|
|
`)}).join(`
|
|
`))+L.substring(V)}else{var G;if(L=L.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,function(K,Z,ve){return G=ve,"".concat(Z," ").concat(ve,`;
|
|
`)}),G){var V=L.lastIndexOf("}");L=L.substring(0,V)+`
|
|
gl_FragColor = vec4(`.concat(G,`);
|
|
`)+L.substring(V)}}L=L.replace(/^\s*layout\((.*)\)/gm,"")}return L}var Kl=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=e.call(this)||this;return o.id=n,o.device=i,o.device.resourceCreationTracker!==null&&o.device.resourceCreationTracker.trackResourceCreated(o),o}return t.prototype.destroy=function(){this.device.resourceCreationTracker!==null&&this.device.resourceCreationTracker.trackResourceDestroyed(this)},t}(FO),o2e=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a=e.call(this,{id:n,device:i})||this;a.type=ji.Bindings;var u=o.uniformBufferBindings,c=o.samplerBindings;return a.uniformBufferBindings=u||[],a.samplerBindings=c||[],a.bindingLayouts=a.createBindingLayouts(),a}return t.prototype.createBindingLayouts=function(){var r=0,n=0,i=[],o=this.uniformBufferBindings.length,a=this.samplerBindings.length;return i.push({firstUniformBuffer:r,numUniformBuffers:o,firstSampler:n,numSamplers:a}),r+=o,n+=a,{numUniformBuffers:r,numSamplers:n,bindingLayoutTables:i}},t}(Kl);function gn(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:!!(e&&e._version===2)}function WO(e){var t=_f(e);switch(t){case Kt.BC1:case Kt.BC2:case Kt.BC3:case Kt.BC4_UNORM:case Kt.BC4_SNORM:case Kt.BC5_UNORM:case Kt.BC5_SNORM:return!0;default:return!1}}function XO(e){var t=g0(e);if(t&Wr.Normalized)return!1;var r=_f(e);return r===Kt.S8||r===Kt.S16||r===Kt.S32||r===Kt.U8||r===Kt.U16||r===Kt.U32}function s2e(e){switch(e){case Ec.STATIC:return Re.STATIC_DRAW;case Ec.DYNAMIC:return Re.DYNAMIC_DRAW}}function O9(e){if(e&da.INDEX)return Re.ELEMENT_ARRAY_BUFFER;if(e&da.VERTEX)return Re.ARRAY_BUFFER;if(e&da.UNIFORM)return Re.UNIFORM_BUFFER}function u2e(e){switch(e){case Fo.TRIANGLES:return Re.TRIANGLES;case Fo.POINTS:return Re.POINTS;case Fo.TRIANGLE_STRIP:return Re.TRIANGLE_STRIP;case Fo.LINES:return Re.LINES;case Fo.LINE_STRIP:return Re.LINE_STRIP;default:throw new Error("Unknown primitive topology mode")}}function l2e(e){switch(e){case Kt.U8:return Re.UNSIGNED_BYTE;case Kt.U16:return Re.UNSIGNED_SHORT;case Kt.U32:return Re.UNSIGNED_INT;case Kt.S8:return Re.BYTE;case Kt.S16:return Re.SHORT;case Kt.S32:return Re.INT;case Kt.F16:return Re.HALF_FLOAT;case Kt.F32:return Re.FLOAT;default:throw new Error("whoops")}}function c2e(e){switch(e){case ln.R:return 1;case ln.RG:return 2;case ln.RGB:return 3;case ln.RGBA:return 4;default:return 1}}function f2e(e){var t=_f(e),r=bb(e),n=g0(e),i=l2e(t),o=c2e(r),a=!!(n&Wr.Normalized);return{size:o,type:i,normalized:a}}function h2e(e){switch(e){case Ke.U8_R:return Re.UNSIGNED_BYTE;case Ke.U16_R:return Re.UNSIGNED_SHORT;case Ke.U32_R:return Re.UNSIGNED_INT;default:throw new Error("whoops")}}function kv(e){switch(e){case gu.CLAMP_TO_EDGE:return Re.CLAMP_TO_EDGE;case gu.REPEAT:return Re.REPEAT;case gu.MIRRORED_REPEAT:return Re.MIRRORED_REPEAT;default:throw new Error("whoops")}}function og(e,t){if(t===ts.LINEAR&&e===vo.BILINEAR)return Re.LINEAR_MIPMAP_LINEAR;if(t===ts.LINEAR&&e===vo.POINT)return Re.NEAREST_MIPMAP_LINEAR;if(t===ts.NEAREST&&e===vo.BILINEAR)return Re.LINEAR_MIPMAP_NEAREST;if(t===ts.NEAREST&&e===vo.POINT)return Re.NEAREST_MIPMAP_NEAREST;if(t===ts.NO_MIP&&e===vo.BILINEAR)return Re.LINEAR;if(t===ts.NO_MIP&&e===vo.POINT)return Re.NEAREST;throw new Error("Unknown texture filter mode")}function n0(e,t){t===void 0&&(t=0);var r=e;return r.gl_buffer_pages[t/r.pageByteSize|0]}function Nd(e){var t=e;return t.gl_texture}function Nx(e){var t=e;return t.gl_sampler}function Dv(e,t){e.name=t,e.__SPECTOR_Metadata={name:t}}function k9(e,t){for(var r=[];;){var n=t.exec(e);if(!n)break;r.push(n)}return r}function tp(e){return e.blendMode==hs.ADD&&e.blendSrcFactor==Ai.ONE&&e.blendDstFactor===Ai.ZERO}function p2e(e){switch(e){case x_.OcclusionConservative:return Re.ANY_SAMPLES_PASSED_CONSERVATIVE;default:throw new Error("whoops")}}function d2e(e){if(e===Ti.TEXTURE_2D)return Re.TEXTURE_2D;if(e===Ti.TEXTURE_2D_ARRAY)return Re.TEXTURE_2D_ARRAY;if(e===Ti.TEXTURE_CUBE_MAP)return Re.TEXTURE_CUBE_MAP;if(e===Ti.TEXTURE_3D)return Re.TEXTURE_3D;throw new Error("whoops")}function h6(e,t,r,n){return!(e%r!==0||t%n!==0)}var v2e=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a=e.call(this,{id:n,device:i})||this;a.type=ji.Buffer;var u=o.viewOrSize,c=o.usage,f=o.hint,m=f===void 0?Ec.STATIC:f,_=i.uniformBufferMaxPageByteSize,b=i.gl,A=c&da.UNIFORM;A||(gn(b)?b.bindVertexArray(null):i.OES_vertex_array_object.bindVertexArrayOES(null));var w=jd(u)?E_(u,4):E_(u.byteLength,4);a.gl_buffer_pages=[];var R;if(A){for(var P=w;P>0;)a.gl_buffer_pages.push(a.createBufferPage(Math.min(P,_),c,m)),P-=_;R=_}else a.gl_buffer_pages.push(a.createBufferPage(w,c,m)),R=w;return a.pageByteSize=R,a.byteSize=w,a.usage=c,a.gl_target=O9(c),jd(u)||a.setSubData(0,new Uint8Array(u.buffer)),A||(gn(b)?b.bindVertexArray(a.device.currentBoundVAO):i.OES_vertex_array_object.bindVertexArrayOES(a.device.currentBoundVAO)),a}return t.prototype.setSubData=function(r,n,i,o){i===void 0&&(i=0),o===void 0&&(o=n.byteLength-i);for(var a=this.device.gl,u=this.pageByteSize,c=r+o,f=r,m=r%u;f<c;){var _=gn(a)?a.COPY_WRITE_BUFFER:this.gl_target,b=n0(this,f);if(b.ubo)return;a.bindBuffer(_,b),gn(a)?a.bufferSubData(_,m,n,i,Math.min(c-f,u)):a.bufferSubData(_,m,n),f+=u,m=0,i+=u,this.device.debugGroupStatisticsBufferUpload()}},t.prototype.destroy=function(){e.prototype.destroy.call(this);for(var r=0;r<this.gl_buffer_pages.length;r++)this.gl_buffer_pages[r].ubo||this.device.gl.deleteBuffer(this.gl_buffer_pages[r]);this.gl_buffer_pages=[]},t.prototype.createBufferPage=function(r,n,i){var o=this.device.gl,a=n&da.UNIFORM;if(!gn(o)&&a)return{ubo:!0};var u=this.device.ensureResourceExists(o.createBuffer()),c=O9(n),f=s2e(i);return o.bindBuffer(c,u),o.bufferData(c,r,f),u},t}(Kl),m2e=function(e){to(t,e);function t(r){var n,i,o,a,u=r.id,c=r.device,f=r.descriptor,m,_=e.call(this,{id:u,device:c})||this;_.type=ji.InputLayout;var b=f.vertexBufferDescriptors,A=f.indexBufferFormat,w=f.program;ii(A===Ke.U16_R||A===Ke.U32_R||A===null);var R=A!==null?h2e(A):null,P=A!==null?LO(A):null,k=_.device.gl,L=_.device.ensureResourceExists(gn(k)?k.createVertexArray():c.OES_vertex_array_object.createVertexArrayOES());gn(k)?k.bindVertexArray(L):c.OES_vertex_array_object.bindVertexArrayOES(L),k.bindBuffer(k.ARRAY_BUFFER,n0(_.device.fallbackVertexBuffer));try{for(var B=C1(f.vertexBufferDescriptors),V=B.next();!V.done;V=B.next()){var G=V.value,K=G.stepMode,Z=G.attributes;try{for(var ve=(o=void 0,C1(Z)),Ie=ve.next();!Ie.done;Ie=ve.next()){var de=Ie.value,se=de.shaderLocation,le=de.format,ye=de.divisor,ke=ye===void 0?1:ye,Rt=gn(k)?se:(m=w.attributes[se])===null||m===void 0?void 0:m.location,Lt=f2e(le);if(de.vertexFormat=Lt,!Xl(Rt)){XO(le);var Gt=Lt.size,Zt=Lt.type,st=Lt.normalized;k.vertexAttribPointer(Rt,Gt,Zt,st,0,0),K===R1.INSTANCE&&(gn(k)?k.vertexAttribDivisor(Rt,ke):c.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(Rt,ke)),k.enableVertexAttribArray(Rt)}}}catch(tt){o={error:tt}}finally{try{Ie&&!Ie.done&&(a=ve.return)&&a.call(ve)}finally{if(o)throw o.error}}}}catch(tt){n={error:tt}}finally{try{V&&!V.done&&(i=B.return)&&i.call(B)}finally{if(n)throw n.error}}return gn(k)?k.bindVertexArray(null):c.OES_vertex_array_object.bindVertexArrayOES(null),_.vertexBufferDescriptors=b,_.vao=L,_.indexBufferFormat=A,_.indexBufferType=R,_.indexBufferCompByteSize=P,_.program=w,_}return t.prototype.destroy=function(){e.prototype.destroy.call(this),this.device.currentBoundVAO===this.vao&&(gn(this.device.gl)?(this.device.gl.bindVertexArray(null),this.device.gl.deleteVertexArray(this.vao)):(this.device.OES_vertex_array_object.bindVertexArrayOES(null),this.device.OES_vertex_array_object.deleteVertexArrayOES(this.vao)),this.device.currentBoundVAO=null)},t}(Kl),Ux=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a=r.fake,u=e.call(this,{id:n,device:i})||this;u.type=ji.Texture,o=Ka({dimension:Ti.TEXTURE_2D,depthOrArrayLayers:1,mipLevelCount:1},o);var c=u.device.gl,f,m,_=u.clampmipLevelCount(o);if(u.immutable=o.usage===nu.RENDER_TARGET,u.pixelStore=o.pixelStore,u.format=o.format,u.dimension=o.dimension,u.formatKind=NO(o.format),u.width=o.width,u.height=o.height,u.depthOrArrayLayers=o.depthOrArrayLayers,u.mipmaps=_>=1,!a){m=u.device.ensureResourceExists(c.createTexture());var b=u.device.translateTextureType(o.format),A=u.device.translateTextureInternalFormat(o.format);if(u.device.setActiveTexture(c.TEXTURE0),u.device.currentTextures[0]=null,u.preprocessImage(),o.dimension===Ti.TEXTURE_2D){if(f=Re.TEXTURE_2D,c.bindTexture(f,m),u.immutable)if(gn(c))c.texStorage2D(f,_,A,o.width,o.height);else{var w=(A===Re.DEPTH_COMPONENT||u.isNPOT(),0);(u.format===Ke.D32F||u.format===Ke.D24_S8)&&!gn(c)&&!i.WEBGL_depth_texture||(c.texImage2D(f,w,A,o.width,o.height,0,A,b,null),u.mipmaps&&(u.mipmaps=!1,c.texParameteri(Re.TEXTURE_2D,Re.TEXTURE_MIN_FILTER,Re.LINEAR),c.texParameteri(Re.TEXTURE_2D,Re.TEXTURE_WRAP_S,Re.CLAMP_TO_EDGE),c.texParameteri(Re.TEXTURE_2D,Re.TEXTURE_WRAP_T,Re.CLAMP_TO_EDGE)))}ii(o.depthOrArrayLayers===1)}else if(o.dimension===Ti.TEXTURE_2D_ARRAY)f=Re.TEXTURE_2D_ARRAY,c.bindTexture(f,m),u.immutable&&gn(c)&&c.texStorage3D(f,_,A,o.width,o.height,o.depthOrArrayLayers);else if(o.dimension===Ti.TEXTURE_3D)f=Re.TEXTURE_3D,c.bindTexture(f,m),u.immutable&&gn(c)&&c.texStorage3D(f,_,A,o.width,o.height,o.depthOrArrayLayers);else if(o.dimension===Ti.TEXTURE_CUBE_MAP)f=Re.TEXTURE_CUBE_MAP,c.bindTexture(f,m),u.immutable&&gn(c)&&c.texStorage2D(f,_,A,o.width,o.height),ii(o.depthOrArrayLayers===6);else throw new Error("whoops")}return u.gl_texture=m,u.gl_target=f,u.mipLevelCount=_,u}return t.prototype.setImageData=function(r,n){n===void 0&&(n=0);var i=this.device.gl;WO(this.format);var o=this.gl_target===Re.TEXTURE_3D||this.gl_target===Re.TEXTURE_2D_ARRAY,a=this.gl_target===Re.TEXTURE_CUBE_MAP,u=r2e(r[0]);this.device.setActiveTexture(i.TEXTURE0),this.device.currentTextures[0]=null;var c=r[0],f,m;u?(f=this.width,m=this.height):(f=c.width,m=c.height,this.width=f,this.height=m),i.bindTexture(this.gl_target,this.gl_texture);var _=this.device.translateTextureFormat(this.format),b=gn(i)?this.device.translateInternalTextureFormat(this.format):_,A=this.device.translateTextureType(this.format);this.preprocessImage();for(var w=0;w<this.depthOrArrayLayers;w++){var R=r[w],P=this.gl_target;a&&(P=Re.TEXTURE_CUBE_MAP_POSITIVE_X+w%6),this.immutable?i.texSubImage2D(P,n,0,0,f,m,_,A,R):gn(i)?o?i.texImage3D(P,n,b,f,m,this.depthOrArrayLayers,0,_,A,R):i.texImage2D(P,n,b,f,m,0,_,A,R):u?i.texImage2D(P,n,_,f,m,0,_,A,R):i.texImage2D(P,n,_,_,A,R)}this.mipmaps&&this.generateMipmap(o)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.device.gl.deleteTexture(Nd(this))},t.prototype.clampmipLevelCount=function(r){if(r.dimension===Ti.TEXTURE_2D_ARRAY&&r.depthOrArrayLayers>1){var n=_f(r.format);if(n===Kt.BC1)for(var i=r.width,o=r.height,a=0;a<r.mipLevelCount;a++){if(i<=2||o<=2)return a-1;i=Math.max(i/2|0,1),o=Math.max(o/2|0,1)}}return r.mipLevelCount},t.prototype.preprocessImage=function(){var r=this.device.gl;this.pixelStore&&(this.pixelStore.unpackFlipY&&r.pixelStorei(Re.UNPACK_FLIP_Y_WEBGL,!0),this.pixelStore.packAlignment&&r.pixelStorei(Re.PACK_ALIGNMENT,this.pixelStore.packAlignment),this.pixelStore.unpackAlignment&&r.pixelStorei(Re.UNPACK_ALIGNMENT,this.pixelStore.unpackAlignment))},t.prototype.generateMipmap=function(r){r===void 0&&(r=!1);var n=this.device.gl;return!gn(n)&&this.isNPOT()?this:(this.gl_texture&&this.gl_target&&(n.bindTexture(this.gl_target,this.gl_texture),r?(n.texParameteri(this.gl_target,Re.TEXTURE_BASE_LEVEL,0),n.texParameteri(this.gl_target,Re.TEXTURE_MAX_LEVEL,Math.log2(this.width)),n.texParameteri(this.gl_target,Re.TEXTURE_MIN_FILTER,Re.LINEAR_MIPMAP_LINEAR),n.texParameteri(this.gl_target,Re.TEXTURE_MAG_FILTER,Re.LINEAR)):n.texParameteri(Re.TEXTURE_2D,Re.TEXTURE_MIN_FILTER,Re.NEAREST_MIPMAP_LINEAR),n.generateMipmap(this.gl_target),n.bindTexture(this.gl_target,null)),this)},t.prototype.isNPOT=function(){var r=this.device.gl;return gn(r)?!1:!b_(this.width)||!b_(this.height)},t}(Kl),g2e=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a=e.call(this,{id:n,device:i})||this;a.type=ji.RenderTarget,a.gl_renderbuffer=null,a.texture=null;var u=a.device.gl,c=o.format,f=o.width,m=o.height,_=o.sampleCount,b=_===void 0?1:_,A=o.texture,w=!1;if((c===Ke.D32F||c===Ke.D24_S8)&&A&&!gn(u)&&!i.WEBGL_depth_texture&&(A.destroy(),a.texture=null,w=!0),!w&&A)a.texture=A;else{a.gl_renderbuffer=a.device.ensureResourceExists(u.createRenderbuffer()),u.bindRenderbuffer(u.RENDERBUFFER,a.gl_renderbuffer);var R=a.device.translateTextureInternalFormat(c,!0);gn(u)&&b>1?u.renderbufferStorageMultisample(Re.RENDERBUFFER,b,R,f,m):u.renderbufferStorage(Re.RENDERBUFFER,R,f,m)}return a.format=c,a.width=f,a.height=m,a.sampleCount=b,a}return t.prototype.destroy=function(){e.prototype.destroy.call(this),this.gl_renderbuffer!==null&&this.device.gl.deleteRenderbuffer(this.gl_renderbuffer),this.texture&&this.texture.destroy()},t}(Kl),Lu;(function(e){e[e.NeedsCompile=0]="NeedsCompile",e[e.Compiling=1]="Compiling",e[e.NeedsBind=2]="NeedsBind",e[e.ReadyToUse=3]="ReadyToUse"})(Lu||(Lu={}));var _2e=function(e){to(t,e);function t(r,n){var i=r.id,o=r.device,a=r.descriptor,u=e.call(this,{id:i,device:o})||this;u.rawVertexGLSL=n,u.type=ji.Program,u.uniformSetters={},u.attributes=[];var c=u.device.gl;return u.descriptor=a,u.gl_program=u.device.ensureResourceExists(c.createProgram()),u.gl_shader_vert=null,u.gl_shader_frag=null,u.compileState=Lu.NeedsCompile,u.tryCompileProgram(),u}return t.prototype.destroy=function(){e.prototype.destroy.call(this),this.device.gl.deleteProgram(this.gl_program),this.device.gl.deleteShader(this.gl_shader_vert),this.device.gl.deleteShader(this.gl_shader_frag)},t.prototype.tryCompileProgram=function(){ii(this.compileState===Lu.NeedsCompile);var r=this.descriptor,n=r.vertex,i=r.fragment,o=this.device.gl;n!=null&&n.glsl&&(i!=null&&i.glsl)&&(this.gl_shader_vert=this.compileShader(n.postprocess?n.postprocess(n.glsl):n.glsl,o.VERTEX_SHADER),this.gl_shader_frag=this.compileShader(i.postprocess?i.postprocess(i.glsl):i.glsl,o.FRAGMENT_SHADER),o.attachShader(this.gl_program,this.gl_shader_vert),o.attachShader(this.gl_program,this.gl_shader_frag),o.linkProgram(this.gl_program),this.compileState=Lu.Compiling,gn(o)||(this.readUniformLocationsFromLinkedProgram(),this.readAttributesFromLinkedProgram()))},t.prototype.readAttributesFromLinkedProgram=function(){for(var r,n=this.device.gl,i=n.getProgramParameter(this.gl_program,n.ACTIVE_ATTRIBUTES),o=n2e(this.descriptor.vertex.glsl),a=i2e(this.rawVertexGLSL,o),u=function(m){var _=n.getActiveAttrib(c.gl_program,m),b=_.name,A=_.type,w=_.size,R=n.getAttribLocation(c.gl_program,b),P=(r=a.find(function(k){return k.name===b}))===null||r===void 0?void 0:r.location;R>=0&&!Xl(P)&&(c.attributes[P]={name:b,location:R,type:A,size:w})},c=this,f=0;f<i;f++)u(f)},t.prototype.readUniformLocationsFromLinkedProgram=function(){for(var r=this.device.gl,n=r.getProgramParameter(this.gl_program,r.ACTIVE_UNIFORMS),i=0;i<n;i++){var o=r.getActiveUniform(this.gl_program,i),a=qme(o.name).name,u=r.getUniformLocation(this.gl_program,a);if(this.uniformSetters[a]=M9(r,u,o),o&&o.size>1)for(var c=0;c<o.size;c++)u=r.getUniformLocation(this.gl_program,"".concat(a,"[").concat(c,"]")),this.uniformSetters["".concat(a,"[").concat(c,"]")]=M9(r,u,o)}},t.prototype.compileShader=function(r,n){var i=this.device.gl,o=this.device.ensureResourceExists(i.createShader(n));return i.shaderSource(o,r),i.compileShader(o),o},t.prototype.setUniformsLegacy=function(r){r===void 0&&(r={});var n=this.device.gl;if(!gn(n)){var i=!1;for(var o in r){i||(n.useProgram(this.gl_program),i=!0);var a=r[o],u=this.uniformSetters[o];if(u){var c=a;c instanceof Ux&&(c=c.textureIndex),u(c)}}}return this},t}(Kl),y2e=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a=e.call(this,{id:n,device:i})||this;a.type=ji.QueryPool;var u=a.device.gl;if(gn(u)){var c=o.elemCount,f=o.type;a.gl_query=Cme(c,function(){return a.device.ensureResourceExists(u.createQuery())}),a.gl_query_type=p2e(f)}return a}return t.prototype.queryResultOcclusion=function(r){var n=this.device.gl;if(gn(n)){var i=this.gl_query[r];return n.getQueryParameter(i,n.QUERY_RESULT_AVAILABLE)?!!n.getQueryParameter(i,n.QUERY_RESULT):null}return null},t.prototype.destroy=function(){e.prototype.destroy.call(this);var r=this.device.gl;if(gn(r))for(var n=0;n<this.gl_query.length;n++)r.deleteQuery(this.gl_query[n])},t}(Kl),x2e=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=e.call(this,{id:n,device:i})||this;return o.type=ji.Readback,o.gl_pbo=null,o.gl_sync=null,o}return t.prototype.clientWaitAsync=function(r,n,i){n===void 0&&(n=0),i===void 0&&(i=10);var o=this.device.gl;return new Promise(function(a,u){function c(){var f=o.clientWaitSync(r,n,0);if(f==o.WAIT_FAILED){u();return}if(f==o.TIMEOUT_EXPIRED){setTimeout(c,bme(i,0,o.MAX_CLIENT_WAIT_TIMEOUT_WEBGL));return}a()}c()})},t.prototype.getBufferSubDataAsync=function(r,n,i,o,a,u){return t0(this,void 0,void 0,function(){var c;return r0(this,function(f){switch(f.label){case 0:return c=this.device.gl,gn(c)?(this.gl_sync=c.fenceSync(c.SYNC_GPU_COMMANDS_COMPLETE,0),c.flush(),[4,this.clientWaitAsync(this.gl_sync,0,10)]):[3,2];case 1:return f.sent(),c.bindBuffer(r,n),c.getBufferSubData(r,i,o,a,u),c.bindBuffer(r,null),[2,o];case 2:return[2]}})})},t.prototype.readTexture=function(r,n,i,o,a,u,c,f){return c===void 0&&(c=0),f===void 0&&(f=u.byteLength||0),t0(this,void 0,void 0,function(){var m,_,b,A,w;return r0(this,function(R){return m=this.device.gl,_=r,b=this.device.translateTextureFormat(_.format),A=this.device.translateTextureType(_.format),w=Ame(_.format),gn(m)?(this.gl_pbo=this.device.ensureResourceExists(m.createBuffer()),m.bindBuffer(m.PIXEL_PACK_BUFFER,this.gl_pbo),m.bufferData(m.PIXEL_PACK_BUFFER,f,m.STREAM_READ),m.bindBuffer(m.PIXEL_PACK_BUFFER,null),m.bindFramebuffer(Re.READ_FRAMEBUFFER,this.device.readbackFramebuffer),m.framebufferTexture2D(Re.READ_FRAMEBUFFER,Re.COLOR_ATTACHMENT0,Re.TEXTURE_2D,_.gl_texture,0),m.bindBuffer(m.PIXEL_PACK_BUFFER,this.gl_pbo),m.readPixels(n,i,o,a,b,A,c*w),m.bindBuffer(m.PIXEL_PACK_BUFFER,null),[2,this.getBufferSubDataAsync(m.PIXEL_PACK_BUFFER,this.gl_pbo,0,u,c,0)]):[2,this.readTextureSync(r,n,i,o,a,u,c,f)]})})},t.prototype.readTextureSync=function(r,n,i,o,a,u,c,f){f===void 0&&(f=u.byteLength||0);var m=this.device.gl,_=r,b=this.device.translateTextureType(_.format);return m.bindFramebuffer(Re.FRAMEBUFFER,this.device.readbackFramebuffer),m.framebufferTexture2D(Re.FRAMEBUFFER,Re.COLOR_ATTACHMENT0,Re.TEXTURE_2D,_.gl_texture,0),m.pixelStorei(m.PACK_ALIGNMENT,4),m.readPixels(n,i,o,a,m.RGBA,b,u),u},t.prototype.readBuffer=function(r,n,i,o,a){return t0(this,void 0,void 0,function(){var u;return r0(this,function(c){return u=this.device.gl,gn(u)?[2,this.getBufferSubDataAsync(u.ARRAY_BUFFER,n0(r,n),n,i,o,a)]:[2,Promise.reject()]})})},t.prototype.destroy=function(){e.prototype.destroy.call(this),gn(this.device.gl)&&(this.gl_sync!==null&&this.device.gl.deleteSync(this.gl_sync),this.gl_pbo!==null&&this.device.gl.deleteBuffer(this.gl_pbo))},t}(Kl),b2e=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a,u,c=e.call(this,{id:n,device:i})||this;return c.type=ji.RenderPipeline,c.drawMode=u2e((a=o.topology)!==null&&a!==void 0?a:Fo.TRIANGLES),c.program=o.program,c.inputLayout=o.inputLayout,c.megaState=Ka(Ka({},_0(y0)),o.megaStateDescriptor),c.colorAttachmentFormats=o.colorAttachmentFormats.slice(),c.depthStencilAttachmentFormat=o.depthStencilAttachmentFormat,c.sampleCount=(u=o.sampleCount)!==null&&u!==void 0?u:1,c}return t}(Kl),E2e=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a=e.call(this,{id:n,device:i})||this;return a.type=ji.ComputePipeline,a.descriptor=o,a}return t}(Kl),S2e=function(){function e(){this.liveObjects=new Set,this.creationStacks=new Map,this.deletionStacks=new Map}return e.prototype.trackResourceCreated=function(t){this.creationStacks.set(t,new Error().stack),this.liveObjects.add(t)},e.prototype.trackResourceDestroyed=function(t){this.deletionStacks.has(t)&&console.warn("Object double freed:",t,`
|
|
|
|
Creation stack: `,this.creationStacks.get(t),`
|
|
|
|
Deletion stack: `,this.deletionStacks.get(t),`
|
|
|
|
This stack: `,new Error().stack),this.deletionStacks.set(t,new Error().stack),this.liveObjects.delete(t)},e.prototype.checkForLeaks=function(){var t,r;try{for(var n=C1(this.liveObjects.values()),i=n.next();!i.done;i=n.next()){var o=i.value;console.warn("Object leaked:",o,"Creation stack:",this.creationStacks.get(o))}}catch(a){t={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.setResourceLeakCheck=function(t,r){r?this.liveObjects.add(t):this.liveObjects.delete(t)},e}(),A2e=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a,u,c=e.call(this,{id:n,device:i})||this;c.type=ji.Sampler;var f=c.device.gl;if(gn(f)){var m=c.device.ensureResourceExists(f.createSampler());f.samplerParameteri(m,Re.TEXTURE_WRAP_S,kv(o.addressModeU)),f.samplerParameteri(m,Re.TEXTURE_WRAP_T,kv(o.addressModeV)),f.samplerParameteri(m,Re.TEXTURE_WRAP_R,kv((a=o.addressModeW)!==null&&a!==void 0?a:o.addressModeU)),f.samplerParameteri(m,Re.TEXTURE_MIN_FILTER,og(o.minFilter,o.mipmapFilter)),f.samplerParameteri(m,Re.TEXTURE_MAG_FILTER,og(o.magFilter,ts.NO_MIP)),o.lodMinClamp!==void 0&&f.samplerParameterf(m,Re.TEXTURE_MIN_LOD,o.lodMinClamp),o.lodMaxClamp!==void 0&&f.samplerParameterf(m,Re.TEXTURE_MAX_LOD,o.lodMaxClamp),o.compareFunction!==void 0&&(f.samplerParameteri(m,f.TEXTURE_COMPARE_MODE,f.COMPARE_REF_TO_TEXTURE),f.samplerParameteri(m,f.TEXTURE_COMPARE_FUNC,o.compareFunction));var _=(u=o.maxAnisotropy)!==null&&u!==void 0?u:1;_>1&&c.device.EXT_texture_filter_anisotropic!==null&&(ii(o.minFilter===vo.BILINEAR&&o.magFilter===vo.BILINEAR&&o.mipmapFilter===ts.LINEAR),f.samplerParameterf(m,c.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT,_)),c.gl_sampler=m}else c.descriptor=o;return c}return t.prototype.setTextureParameters=function(r,n,i){var o,a=this.device.gl,u=this.descriptor;this.isNPOT(n,i)?a.texParameteri(Re.TEXTURE_2D,Re.TEXTURE_MIN_FILTER,Re.LINEAR):a.texParameteri(r,Re.TEXTURE_MIN_FILTER,og(u.minFilter,u.mipmapFilter)),a.texParameteri(Re.TEXTURE_2D,Re.TEXTURE_WRAP_S,kv(u.addressModeU)),a.texParameteri(Re.TEXTURE_2D,Re.TEXTURE_WRAP_T,kv(u.addressModeV)),a.texParameteri(r,Re.TEXTURE_MAG_FILTER,og(u.magFilter,ts.NO_MIP));var c=(o=u.maxAnisotropy)!==null&&o!==void 0?o:1;c>1&&this.device.EXT_texture_filter_anisotropic!==null&&(ii(u.minFilter===vo.BILINEAR&&u.magFilter===vo.BILINEAR&&u.mipmapFilter===ts.LINEAR),a.texParameteri(r,this.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT,c))},t.prototype.destroy=function(){e.prototype.destroy.call(this),gn(this.device.gl)&&this.device.gl.deleteSampler(Nx(this))},t.prototype.isNPOT=function(r,n){return!b_(r)||!b_(n)},t}(Kl),T2e=function(){function e(){}return e.prototype.dispatchWorkgroups=function(t,r,n){},e.prototype.dispatchWorkgroupsIndirect=function(t,r){},e.prototype.setPipeline=function(t){},e.prototype.setBindings=function(t){},e.prototype.pushDebugGroup=function(t){},e.prototype.popDebugGroup=function(){},e.prototype.insertDebugMarker=function(t){},e}(),w2e=function(e){to(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=ji.RenderBundle,r.commands=[],r}return t.prototype.push=function(r){this.commands.push(r)},t.prototype.replay=function(){this.commands.forEach(function(r){return r()})},t}(Kl),D9=65536,C2e=/uniform(?:\s+)(\w+)(?:\s?){([^]*?)}/g,R2e=function(){function e(t,r){r===void 0&&(r={}),this.shaderDebug=!1,this.OES_vertex_array_object=null,this.ANGLE_instanced_arrays=null,this.OES_texture_float=null,this.OES_draw_buffers_indexed=null,this.WEBGL_draw_buffers=null,this.WEBGL_depth_texture=null,this.WEBGL_color_buffer_float=null,this.EXT_color_buffer_half_float=null,this.WEBGL_compressed_texture_s3tc=null,this.WEBGL_compressed_texture_s3tc_srgb=null,this.EXT_texture_compression_rgtc=null,this.EXT_texture_filter_anisotropic=null,this.KHR_parallel_shader_compile=null,this.EXT_texture_norm16=null,this.EXT_color_buffer_float=null,this.OES_texture_float_linear=null,this.OES_texture_half_float_linear=null,this.scTexture=null,this.scPlatformFramebuffer=null,this.currentActiveTexture=null,this.currentBoundVAO=null,this.currentProgram=null,this.resourceCreationTracker=null,this.resourceUniqueId=0,this.currentColorAttachments=[],this.currentColorAttachmentLevels=[],this.currentColorResolveTos=[],this.currentColorResolveToLevels=[],this.currentSampleCount=-1,this.currentIndexBufferByteOffset=null,this.currentMegaState=_0(y0),this.currentSamplers=[],this.currentTextures=[],this.currentUniformBuffers=[],this.currentUniformBufferByteOffsets=[],this.currentUniformBufferByteSizes=[],this.currentScissorEnabled=!1,this.currentStencilRef=null,this.currentRenderPassDescriptor=null,this.currentRenderPassDescriptorStack=[],this.debugGroupStack=[],this.resolveColorAttachmentsChanged=!1,this.resolveDepthStencilAttachmentsChanged=!1,this.explicitBindingLocations=!1,this.separateSamplerTextures=!1,this.viewportOrigin=vf.LOWER_LEFT,this.clipSpaceNearZ=m0.NEGATIVE_ONE,this.supportMRT=!1,this.inBlitRenderPass=!1,this.supportedSampleCounts=[],this.occlusionQueriesRecommended=!1,this.computeShadersSupported=!1,this.gl=t,this.contextAttributes=g1(t.getContextAttributes()),gn(t)?(this.EXT_texture_norm16=t.getExtension("EXT_texture_norm16"),this.EXT_color_buffer_float=t.getExtension("EXT_color_buffer_float")):(this.OES_vertex_array_object=t.getExtension("OES_vertex_array_object"),this.ANGLE_instanced_arrays=t.getExtension("ANGLE_instanced_arrays"),this.OES_texture_float=t.getExtension("OES_texture_float"),this.WEBGL_draw_buffers=t.getExtension("WEBGL_draw_buffers"),this.WEBGL_depth_texture=t.getExtension("WEBGL_depth_texture"),this.WEBGL_color_buffer_float=t.getExtension("WEBGL_color_buffer_float"),this.EXT_color_buffer_half_float=t.getExtension("EXT_color_buffer_half_float"),t.getExtension("EXT_frag_depth"),t.getExtension("OES_element_index_uint"),t.getExtension("OES_standard_derivatives")),this.WEBGL_compressed_texture_s3tc=t.getExtension("WEBGL_compressed_texture_s3tc"),this.WEBGL_compressed_texture_s3tc_srgb=t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),this.EXT_texture_compression_rgtc=t.getExtension("EXT_texture_compression_rgtc"),this.EXT_texture_filter_anisotropic=t.getExtension("EXT_texture_filter_anisotropic"),this.EXT_texture_norm16=t.getExtension("EXT_texture_norm16"),this.OES_texture_float_linear=t.getExtension("OES_texture_float_linear"),this.OES_texture_half_float_linear=t.getExtension("OES_texture_half_float_linear"),this.KHR_parallel_shader_compile=t.getExtension("KHR_parallel_shader_compile"),gn(t)?(this.platformString="WebGL2",this.glslVersion="#version 300 es"):(this.platformString="WebGL1",this.glslVersion="#version 100"),this.scTexture=new Ux({id:this.getNextUniqueId(),device:this,descriptor:{width:0,height:0,depthOrArrayLayers:1,dimension:Ti.TEXTURE_2D,mipLevelCount:1,usage:nu.RENDER_TARGET,format:this.contextAttributes.alpha===!1?Ke.U8_RGB_RT:Ke.U8_RGBA_RT},fake:!0}),this.scTexture.formatKind=Qa.Float,this.scTexture.gl_target=null,this.scTexture.gl_texture=null,this.resolveColorReadFramebuffer=this.ensureResourceExists(t.createFramebuffer()),this.resolveColorDrawFramebuffer=this.ensureResourceExists(t.createFramebuffer()),this.resolveDepthStencilReadFramebuffer=this.ensureResourceExists(t.createFramebuffer()),this.resolveDepthStencilDrawFramebuffer=this.ensureResourceExists(t.createFramebuffer()),this.renderPassDrawFramebuffer=this.ensureResourceExists(t.createFramebuffer()),this.readbackFramebuffer=this.ensureResourceExists(t.createFramebuffer()),this.fallbackTexture2D=this.createFallbackTexture(Ti.TEXTURE_2D,Qa.Float),this.fallbackTexture2DDepth=this.createFallbackTexture(Ti.TEXTURE_2D,Qa.Depth),this.fallbackVertexBuffer=this.createBuffer({viewOrSize:1,usage:da.VERTEX,hint:Ec.STATIC}),gn(t)&&(this.fallbackTexture2DArray=this.createFallbackTexture(Ti.TEXTURE_2D_ARRAY,Qa.Float),this.fallbackTexture3D=this.createFallbackTexture(Ti.TEXTURE_3D,Qa.Float),this.fallbackTextureCube=this.createFallbackTexture(Ti.TEXTURE_CUBE_MAP,Qa.Float)),this.currentMegaState.depthCompare=Ki.LESS,this.currentMegaState.depthWrite=!1,this.currentMegaState.attachmentsState[0].channelWriteMask=fs.ALL,t.enable(t.DEPTH_TEST),t.enable(t.STENCIL_TEST),this.checkLimits(),r.shaderDebug&&(this.shaderDebug=!0),r.trackResources&&(this.resourceCreationTracker=new S2e)}return e.prototype.destroy=function(){this.blitBindings&&this.blitBindings.destroy(),this.blitInputLayout&&this.blitInputLayout.destroy(),this.blitRenderPipeline&&this.blitRenderPipeline.destroy(),this.blitVertexBuffer&&this.blitVertexBuffer.destroy(),this.blitProgram&&this.blitProgram.destroy()},e.prototype.createFallbackTexture=function(t,r){var n=t===Ti.TEXTURE_CUBE_MAP?6:1,i=r===Qa.Depth?Ke.D32F:Ke.U8_RGBA_NORM,o=this.createTexture({dimension:t,format:i,usage:nu.SAMPLED,width:1,height:1,depthOrArrayLayers:n,mipLevelCount:1});return r===Qa.Float&&o.setImageData([new Uint8Array(4*n)]),Nd(o)},e.prototype.getNextUniqueId=function(){return++this.resourceUniqueId},e.prototype.checkLimits=function(){var t=this.gl;if(this.maxVertexAttribs=t.getParameter(Re.MAX_VERTEX_ATTRIBS),gn(t)){this.uniformBufferMaxPageByteSize=Math.min(t.getParameter(Re.MAX_UNIFORM_BLOCK_SIZE),D9),this.uniformBufferWordAlignment=t.getParameter(t.UNIFORM_BUFFER_OFFSET_ALIGNMENT)/4;var r=t.getInternalformatParameter(t.RENDERBUFFER,t.DEPTH32F_STENCIL8,t.SAMPLES);this.supportedSampleCounts=r?Pv([],af(r),!1):[],this.occlusionQueriesRecommended=!0}else this.uniformBufferWordAlignment=64,this.uniformBufferMaxPageByteSize=D9;this.uniformBufferMaxPageWordSize=this.uniformBufferMaxPageByteSize/4,this.supportedSampleCounts.includes(1)||this.supportedSampleCounts.push(1),this.supportedSampleCounts.sort(function(n,i){return n-i})},e.prototype.configureSwapChain=function(t,r,n){var i=this.scTexture;i.width=t,i.height=r,this.scPlatformFramebuffer=wme(n)},e.prototype.getDevice=function(){return this},e.prototype.getCanvas=function(){return this.gl.canvas},e.prototype.getOnscreenTexture=function(){return this.scTexture},e.prototype.beginFrame=function(){},e.prototype.endFrame=function(){},e.prototype.translateTextureInternalFormat=function(t,r){switch(r===void 0&&(r=!1),t){case Ke.ALPHA:return Re.ALPHA;case Ke.U8_LUMINANCE:case Ke.F16_LUMINANCE:case Ke.F32_LUMINANCE:return Re.LUMINANCE;case Ke.F16_R:return Re.R16F;case Ke.F16_RG:return Re.RG16F;case Ke.F16_RGB:return Re.RGB16F;case Ke.F16_RGBA:return Re.RGBA16F;case Ke.F32_R:return Re.R32F;case Ke.F32_RG:return Re.RG32F;case Ke.F32_RGB:return Re.RGB32F;case Ke.F32_RGBA:return gn(this.gl)?Re.RGBA32F:r?this.WEBGL_color_buffer_float.RGBA32F_EXT:Re.RGBA;case Ke.U8_R_NORM:return Re.R8;case Ke.U8_RG_NORM:return Re.RG8;case Ke.U8_RGB_NORM:case Ke.U8_RGB_RT:return Re.RGB8;case Ke.U8_RGB_SRGB:return Re.SRGB8;case Ke.U8_RGBA_NORM:case Ke.U8_RGBA_RT:return gn(this.gl)?Re.RGBA8:r?Re.RGBA4:Re.RGBA;case Ke.U8_RGBA:return Re.RGBA;case Ke.U8_RGBA_SRGB:case Ke.U8_RGBA_RT_SRGB:return Re.SRGB8_ALPHA8;case Ke.U16_R:return Re.R16UI;case Ke.U16_R_NORM:return this.EXT_texture_norm16.R16_EXT;case Ke.U16_RG_NORM:return this.EXT_texture_norm16.RG16_EXT;case Ke.U16_RGBA_NORM:return this.EXT_texture_norm16.RGBA16_EXT;case Ke.U16_RGBA_5551:return Re.RGB5_A1;case Ke.U16_RGB_565:return Re.RGB565;case Ke.U32_R:return Re.R32UI;case Ke.S8_RGBA_NORM:return Re.RGBA8_SNORM;case Ke.S8_RG_NORM:return Re.RG8_SNORM;case Ke.BC1:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT;case Ke.BC1_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;case Ke.BC2:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT;case Ke.BC2_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;case Ke.BC3:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT;case Ke.BC3_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;case Ke.BC4_UNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_RED_RGTC1_EXT;case Ke.BC4_SNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT;case Ke.BC5_UNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT;case Ke.BC5_SNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;case Ke.D32F_S8:return gn(this.gl)?Re.DEPTH32F_STENCIL8:this.WEBGL_depth_texture?Re.DEPTH_STENCIL:Re.DEPTH_COMPONENT16;case Ke.D24_S8:return gn(this.gl)?Re.DEPTH24_STENCIL8:this.WEBGL_depth_texture?Re.DEPTH_STENCIL:Re.DEPTH_COMPONENT16;case Ke.D32F:return gn(this.gl)?Re.DEPTH_COMPONENT32F:this.WEBGL_depth_texture?Re.DEPTH_COMPONENT:Re.DEPTH_COMPONENT16;case Ke.D24:return gn(this.gl)?Re.DEPTH_COMPONENT24:this.WEBGL_depth_texture?Re.DEPTH_COMPONENT:Re.DEPTH_COMPONENT16;default:throw new Error("whoops")}},e.prototype.translateTextureType=function(t){var r=_f(t);switch(r){case Kt.U8:return Re.UNSIGNED_BYTE;case Kt.U16:return Re.UNSIGNED_SHORT;case Kt.U32:return Re.UNSIGNED_INT;case Kt.S8:return Re.BYTE;case Kt.F16:return Re.HALF_FLOAT;case Kt.F32:return Re.FLOAT;case Kt.U16_PACKED_5551:return Re.UNSIGNED_SHORT_5_5_5_1;case Kt.D32F:return gn(this.gl)?Re.FLOAT:this.WEBGL_depth_texture?Re.UNSIGNED_INT:Re.UNSIGNED_BYTE;case Kt.D24:return gn(this.gl)?Re.UNSIGNED_INT_24_8:this.WEBGL_depth_texture?Re.UNSIGNED_SHORT:Re.UNSIGNED_BYTE;case Kt.D24S8:return gn(this.gl)?Re.UNSIGNED_INT_24_8:this.WEBGL_depth_texture?Re.UNSIGNED_INT_24_8_WEBGL:Re.UNSIGNED_BYTE;case Kt.D32FS8:return Re.FLOAT_32_UNSIGNED_INT_24_8_REV;default:throw new Error("whoops")}},e.prototype.translateInternalTextureFormat=function(t){switch(t){case Ke.F32_R:return Re.R32F;case Ke.F32_RG:return Re.RG32F;case Ke.F32_RGB:return Re.RGB32F;case Ke.F32_RGBA:return Re.RGBA32F;case Ke.F16_R:return Re.R16F;case Ke.F16_RG:return Re.RG16F;case Ke.F16_RGB:return Re.RGB16F;case Ke.F16_RGBA:return Re.RGBA16F}return this.translateTextureFormat(t)},e.prototype.translateTextureFormat=function(t){if(WO(t)||t===Ke.F32_LUMINANCE||t===Ke.U8_LUMINANCE)return this.translateTextureInternalFormat(t);var r=gn(this.gl)||!gn(this.gl)&&!!this.WEBGL_depth_texture;switch(t){case Ke.D24_S8:case Ke.D32F_S8:return r?Re.DEPTH_STENCIL:Re.RGBA;case Ke.D24:case Ke.D32F:return r?Re.DEPTH_COMPONENT:Re.RGBA}var n=XO(t),i=bb(t);switch(i){case ln.A:return Re.ALPHA;case ln.R:return n?Re.RED_INTEGER:Re.RED;case ln.RG:return n?Re.RG_INTEGER:Re.RG;case ln.RGB:return n?Re.RGB_INTEGER:Re.RGB;case ln.RGBA:return Re.RGBA}},e.prototype.setActiveTexture=function(t){this.currentActiveTexture!==t&&(this.gl.activeTexture(t),this.currentActiveTexture=t)},e.prototype.bindVAO=function(t){this.currentBoundVAO!==t&&(gn(this.gl)?this.gl.bindVertexArray(t):this.OES_vertex_array_object.bindVertexArrayOES(t),this.currentBoundVAO=t)},e.prototype.programCompiled=function(t){ii(t.compileState!==Lu.NeedsCompile),t.compileState===Lu.Compiling&&(t.compileState=Lu.NeedsBind,this.shaderDebug&&this.checkProgramCompilationForErrors(t))},e.prototype.useProgram=function(t){this.currentProgram!==t&&(this.programCompiled(t),this.gl.useProgram(t.gl_program),this.currentProgram=t)},e.prototype.ensureResourceExists=function(t){if(t===null){var r=this.gl.getError();throw new Error("Created resource is null; GL error encountered: ".concat(r))}else return t},e.prototype.createBuffer=function(t){return new v2e({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createTexture=function(t){return new Ux({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createSampler=function(t){return new A2e({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createRenderTarget=function(t){return new g2e({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createRenderTargetFromTexture=function(t){var r=t,n=r.format,i=r.width,o=r.height,a=r.mipLevelCount;return ii(a===1),this.createRenderTarget({format:n,width:i,height:o,sampleCount:1,texture:t})},e.prototype.createProgram=function(t){var r,n,i,o=(r=t.vertex)===null||r===void 0?void 0:r.glsl;return!((n=t.vertex)===null||n===void 0)&&n.glsl&&(t.vertex.glsl=x0(this.queryVendorInfo(),"vert",t.vertex.glsl)),!((i=t.fragment)===null||i===void 0)&&i.glsl&&(t.fragment.glsl=x0(this.queryVendorInfo(),"frag",t.fragment.glsl)),this.createProgramSimple(t,o)},e.prototype.createProgramSimple=function(t,r){var n=new _2e({id:this.getNextUniqueId(),device:this,descriptor:t},r);return n},e.prototype.createBindings=function(t){return new o2e({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createInputLayout=function(t){return new m2e({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createRenderPipeline=function(t){return new b2e({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createComputePass=function(){return new T2e},e.prototype.createComputePipeline=function(t){return new E2e({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createReadback=function(){return new x2e({id:this.getNextUniqueId(),device:this})},e.prototype.createQueryPool=function(t,r){return new y2e({id:this.getNextUniqueId(),device:this,descriptor:{type:t,elemCount:r}})},e.prototype.formatRenderPassDescriptor=function(t){var r,n,i,o,a,u,c=t.colorAttachment;t.depthClearValue=(r=t.depthClearValue)!==null&&r!==void 0?r:"load",t.stencilClearValue=(n=t.stencilClearValue)!==null&&n!==void 0?n:"load";for(var f=0;f<c.length;f++)t.colorAttachmentLevel||(t.colorAttachmentLevel=[]),t.colorAttachmentLevel[f]=(i=t.colorAttachmentLevel[f])!==null&&i!==void 0?i:0,t.colorResolveToLevel||(t.colorResolveToLevel=[]),t.colorResolveToLevel[f]=(o=t.colorResolveToLevel[f])!==null&&o!==void 0?o:0,t.colorClearColor||(t.colorClearColor=[]),t.colorClearColor[f]=(a=t.colorClearColor[f])!==null&&a!==void 0?a:"load",t.colorStore||(t.colorStore=[]),t.colorStore[f]=(u=t.colorStore[f])!==null&&u!==void 0?u:!1},e.prototype.createRenderBundle=function(){return new w2e({id:this.getNextUniqueId(),device:this})},e.prototype.beginBundle=function(t){this.renderBundle=t},e.prototype.endBundle=function(){this.renderBundle=void 0},e.prototype.executeBundles=function(t){t.forEach(function(r){r.replay()})},e.prototype.createRenderPass=function(t){this.currentRenderPassDescriptor!==null&&this.currentRenderPassDescriptorStack.push(this.currentRenderPassDescriptor),this.currentRenderPassDescriptor=t,this.formatRenderPassDescriptor(t);var r=t.colorAttachment,n=t.colorAttachmentLevel,i=t.colorClearColor,o=t.colorResolveTo,a=t.colorResolveToLevel,u=t.depthStencilAttachment,c=t.depthClearValue,f=t.stencilClearValue,m=t.depthStencilResolveTo;this.setRenderPassParametersBegin(r.length);for(var _=0;_<r.length;_++)this.setRenderPassParametersColor(_,r[_],n[_],o[_],a[_]);this.setRenderPassParametersDepthStencil(u,m),this.validateCurrentAttachments();for(var _=0;_<r.length;_++){var b=i[_];b!=="load"&&this.setRenderPassParametersClearColor(_,b.r,b.g,b.b,b.a)}return this.setRenderPassParametersClearDepthStencil(c,f),this},e.prototype.submitPass=function(t){ii(this.currentRenderPassDescriptor!==null),this.endPass(),this.currentRenderPassDescriptorStack.length?this.currentRenderPassDescriptor=this.currentRenderPassDescriptorStack.pop():this.currentRenderPassDescriptor=null},e.prototype.copySubTexture2D=function(t,r,n,i,o,a){var u=this.gl,c=t,f=i;if(ii(f.mipLevelCount===1),ii(c.mipLevelCount===1),gn(u))c===this.scTexture?u.bindFramebuffer(u.DRAW_FRAMEBUFFER,this.scPlatformFramebuffer):(u.bindFramebuffer(u.DRAW_FRAMEBUFFER,this.resolveColorDrawFramebuffer),this.bindFramebufferAttachment(u.DRAW_FRAMEBUFFER,u.COLOR_ATTACHMENT0,c,0)),u.bindFramebuffer(u.READ_FRAMEBUFFER,this.resolveColorReadFramebuffer),this.bindFramebufferAttachment(u.READ_FRAMEBUFFER,u.COLOR_ATTACHMENT0,f,0),u.blitFramebuffer(o,a,o+f.width,a+f.height,r,n,r+f.width,n+f.height,u.COLOR_BUFFER_BIT,u.LINEAR),u.bindFramebuffer(u.READ_FRAMEBUFFER,null),u.bindFramebuffer(u.DRAW_FRAMEBUFFER,null);else if(c===this.scTexture){var m=this.createRenderTargetFromTexture(i);this.submitBlitRenderPass(m,c)}},e.prototype.queryLimits=function(){return this},e.prototype.queryTextureFormatSupported=function(t,r,n){switch(t){case Ke.BC1_SRGB:case Ke.BC2_SRGB:case Ke.BC3_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb!==null?h6(r,n,4,4):!1;case Ke.BC1:case Ke.BC2:case Ke.BC3:return this.WEBGL_compressed_texture_s3tc!==null?h6(r,n,4,4):!1;case Ke.BC4_UNORM:case Ke.BC4_SNORM:case Ke.BC5_UNORM:case Ke.BC5_SNORM:return this.EXT_texture_compression_rgtc!==null?h6(r,n,4,4):!1;case Ke.U16_R_NORM:case Ke.U16_RG_NORM:case Ke.U16_RGBA_NORM:return this.EXT_texture_norm16!==null;case Ke.F32_R:case Ke.F32_RG:case Ke.F32_RGB:case Ke.F32_RGBA:return this.OES_texture_float_linear!==null;case Ke.F16_R:case Ke.F16_RG:case Ke.F16_RGB:case Ke.F16_RGBA:return this.OES_texture_half_float_linear!==null;default:return!0}},e.prototype.queryProgramReady=function(t){var r=this.gl;if(t.compileState===Lu.NeedsCompile)throw new Error("whoops");if(t.compileState===Lu.Compiling){var n=void 0;return this.KHR_parallel_shader_compile!==null?n=r.getProgramParameter(t.gl_program,this.KHR_parallel_shader_compile.COMPLETION_STATUS_KHR):n=!0,n&&this.programCompiled(t),n}return t.compileState===Lu.NeedsBind||t.compileState===Lu.ReadyToUse},e.prototype.queryPlatformAvailable=function(){return this.gl.isContextLost()},e.prototype.queryVendorInfo=function(){return this},e.prototype.queryRenderPass=function(t){return this.currentRenderPassDescriptor},e.prototype.queryRenderTarget=function(t){var r=t;return r},e.prototype.setResourceName=function(t,r){if(t.name=r,t.type===ji.Buffer)for(var n=t.gl_buffer_pages,i=0;i<n.length;i++)Dv(n[i],"".concat(r," Page ").concat(i));else if(t.type===ji.Texture)Dv(Nd(t),r);else if(t.type===ji.Sampler)Dv(Nx(t),r);else if(t.type===ji.RenderTarget){var o=t.gl_renderbuffer;o!==null&&Dv(o,r)}else t.type===ji.InputLayout&&Dv(t.vao,r)},e.prototype.setResourceLeakCheck=function(t,r){this.resourceCreationTracker!==null&&this.resourceCreationTracker.setResourceLeakCheck(t,r)},e.prototype.checkForLeaks=function(){this.resourceCreationTracker!==null&&this.resourceCreationTracker.checkForLeaks()},e.prototype.pushDebugGroup=function(t){},e.prototype.popDebugGroup=function(){},e.prototype.insertDebugMarker=function(t){},e.prototype.programPatched=function(t,r){ii(this.shaderDebug)},e.prototype.getBufferData=function(t,r,n){n===void 0&&(n=0);var i=this.gl;gn(i)&&(i.bindBuffer(i.COPY_READ_BUFFER,n0(t,n*4)),i.getBufferSubData(i.COPY_READ_BUFFER,n*4,r))},e.prototype.debugGroupStatisticsDrawCall=function(t){t===void 0&&(t=1);for(var r=this.debugGroupStack.length-1;r>=0;r--)this.debugGroupStack[r].drawCallCount+=t},e.prototype.debugGroupStatisticsBufferUpload=function(t){t===void 0&&(t=1);for(var r=this.debugGroupStack.length-1;r>=0;r--)this.debugGroupStack[r].bufferUploadCount+=t},e.prototype.debugGroupStatisticsTextureBind=function(t){t===void 0&&(t=1);for(var r=this.debugGroupStack.length-1;r>=0;r--)this.debugGroupStack[r].textureBindCount+=t},e.prototype.debugGroupStatisticsTriangles=function(t){for(var r=this.debugGroupStack.length-1;r>=0;r--)this.debugGroupStack[r].triangleCount+=t},e.prototype.reportShaderError=function(t,r){var n=this.gl,i=n.getShaderParameter(t,n.COMPILE_STATUS);if(!i){console.error(Rme(r));var o=n.getExtension("WEBGL_debug_shaders");o&&console.error(o.getTranslatedShaderSource(t)),console.error(n.getShaderInfoLog(t))}return i},e.prototype.checkProgramCompilationForErrors=function(t){var r=this.gl,n=t.gl_program;if(!r.getProgramParameter(n,r.LINK_STATUS)){var i=t.descriptor;if(!this.reportShaderError(t.gl_shader_vert,i.vertex.glsl)||!this.reportShaderError(t.gl_shader_frag,i.fragment.glsl))return;console.error(r.getProgramInfoLog(t.gl_program))}},e.prototype.bindFramebufferAttachment=function(t,r,n,i){var o=this.gl;if(Xl(n))o.framebufferRenderbuffer(t,r,o.RENDERBUFFER,null);else if(n.type===ji.RenderTarget)n.gl_renderbuffer!==null?o.framebufferRenderbuffer(t,r,o.RENDERBUFFER,n.gl_renderbuffer):n.texture!==null&&o.framebufferTexture2D(t,r,Re.TEXTURE_2D,Nd(n.texture),i);else if(n.type===ji.Texture){var a=Nd(n);n.dimension===Ti.TEXTURE_2D?o.framebufferTexture2D(t,r,Re.TEXTURE_2D,a,i):gn(o)&&(n.dimension,Ti.TEXTURE_2D_ARRAY)}},e.prototype.bindFramebufferDepthStencilAttachment=function(t,r){var n=this.gl,i=Xl(r)?Wr.Depth|Wr.Stencil:g0(r.format),o=!!(i&Wr.Depth),a=!!(i&Wr.Stencil);if(o&&a){var u=gn(this.gl)||!gn(this.gl)&&!!this.WEBGL_depth_texture;u?this.bindFramebufferAttachment(t,n.DEPTH_STENCIL_ATTACHMENT,r,0):this.bindFramebufferAttachment(t,n.DEPTH_ATTACHMENT,r,0)}else o?(this.bindFramebufferAttachment(t,n.DEPTH_ATTACHMENT,r,0),this.bindFramebufferAttachment(t,n.STENCIL_ATTACHMENT,null,0)):a&&(this.bindFramebufferAttachment(t,n.STENCIL_ATTACHMENT,r,0),this.bindFramebufferAttachment(t,n.DEPTH_ATTACHMENT,null,0))},e.prototype.validateCurrentAttachments=function(){for(var t=-1,r=-1,n=-1,i=0;i<this.currentColorAttachments.length;i++){var o=this.currentColorAttachments[i];o!==null&&(t===-1?(t=o.sampleCount,r=o.width,n=o.height):(ii(t===o.sampleCount),ii(r===o.width),ii(n===o.height)))}this.currentDepthStencilAttachment&&(t===-1?t=this.currentDepthStencilAttachment.sampleCount:(ii(t===this.currentDepthStencilAttachment.sampleCount),ii(r===this.currentDepthStencilAttachment.width),ii(n===this.currentDepthStencilAttachment.height))),this.currentSampleCount=t},e.prototype.setRenderPassParametersBegin=function(t){var r=this.gl;if(gn(r)?r.bindFramebuffer(Re.DRAW_FRAMEBUFFER,this.renderPassDrawFramebuffer):this.inBlitRenderPass||r.bindFramebuffer(Re.FRAMEBUFFER,this.renderPassDrawFramebuffer),gn(r)?r.drawBuffers([Re.COLOR_ATTACHMENT0,Re.COLOR_ATTACHMENT1,Re.COLOR_ATTACHMENT2,Re.COLOR_ATTACHMENT3]):!this.inBlitRenderPass&&this.WEBGL_draw_buffers&&this.WEBGL_draw_buffers.drawBuffersWEBGL([Re.COLOR_ATTACHMENT0_WEBGL,Re.COLOR_ATTACHMENT1_WEBGL,Re.COLOR_ATTACHMENT2_WEBGL,Re.COLOR_ATTACHMENT3_WEBGL]),!this.inBlitRenderPass)for(var n=t;n<this.currentColorAttachments.length;n++){var i=gn(r)?Re.DRAW_FRAMEBUFFER:Re.FRAMEBUFFER,o=gn(r)?Re.COLOR_ATTACHMENT0:Re.COLOR_ATTACHMENT0_WEBGL;r.framebufferRenderbuffer(i,o+n,Re.RENDERBUFFER,null),r.framebufferTexture2D(i,o+n,Re.TEXTURE_2D,null,0)}this.currentColorAttachments.length=t},e.prototype.setRenderPassParametersColor=function(t,r,n,i,o){var a=this.gl,u=gn(a);(this.currentColorAttachments[t]!==r||this.currentColorAttachmentLevels[t]!==n)&&(this.currentColorAttachments[t]=r,this.currentColorAttachmentLevels[t]=n,(u||!u&&this.WEBGL_draw_buffers)&&this.bindFramebufferAttachment(u?Re.DRAW_FRAMEBUFFER:Re.FRAMEBUFFER,(u?Re.COLOR_ATTACHMENT0:Re.COLOR_ATTACHMENT0_WEBGL)+t,r,n),this.resolveColorAttachmentsChanged=!0),(this.currentColorResolveTos[t]!==i||this.currentColorResolveToLevels[t]!==o)&&(this.currentColorResolveTos[t]=i,this.currentColorResolveToLevels[t]=o,i!==null&&(this.resolveColorAttachmentsChanged=!0))},e.prototype.setRenderPassParametersDepthStencil=function(t,r){var n=this.gl;this.currentDepthStencilAttachment!==t&&(this.currentDepthStencilAttachment=t,this.inBlitRenderPass||this.bindFramebufferDepthStencilAttachment(gn(n)?Re.DRAW_FRAMEBUFFER:Re.FRAMEBUFFER,this.currentDepthStencilAttachment),this.resolveDepthStencilAttachmentsChanged=!0),this.currentDepthStencilResolveTo!==r&&(this.currentDepthStencilResolveTo=r,r&&(this.resolveDepthStencilAttachmentsChanged=!0))},e.prototype.setRenderPassParametersClearColor=function(t,r,n,i,o){var a=this.gl;if(this.OES_draw_buffers_indexed!==null){var u=this.currentMegaState.attachmentsState[t];u&&u.channelWriteMask!==fs.ALL&&(this.OES_draw_buffers_indexed.colorMaskiOES(t,!0,!0,!0,!0),u.channelWriteMask=fs.ALL)}else{var u=this.currentMegaState.attachmentsState[0];u&&u.channelWriteMask!==fs.ALL&&(a.colorMask(!0,!0,!0,!0),u.channelWriteMask=fs.ALL)}this.setScissorRectEnabled(!1),gn(a)?a.clearBufferfv(a.COLOR,t,[r,n,i,o]):(a.clearColor(r,n,i,o),a.clear(a.COLOR_BUFFER_BIT))},e.prototype.setRenderPassParametersClearDepthStencil=function(t,r){t===void 0&&(t="load"),r===void 0&&(r="load");var n=this.gl;t!=="load"&&(ii(!!this.currentDepthStencilAttachment),this.currentMegaState.depthWrite||(n.depthMask(!0),this.currentMegaState.depthWrite=!0),gn(n)?n.clearBufferfv(n.DEPTH,0,[t]):(n.clearDepth(t),n.clear(n.DEPTH_BUFFER_BIT))),r!=="load"&&(ii(!!this.currentDepthStencilAttachment),this.currentMegaState.stencilWrite||(n.enable(n.STENCIL_TEST),n.stencilMask(255),this.currentMegaState.stencilWrite=!0),gn(n)?n.clearBufferiv(n.STENCIL,0,[r]):(n.clearStencil(r),n.clear(n.STENCIL_BUFFER_BIT)))},e.prototype.setBindings=function(t){var r=this,n;if(this.renderBundle){this.renderBundle.push(function(){return r.setBindings(t)});return}var i=this.gl,o=t,a=o.uniformBufferBindings,u=o.samplerBindings,c=o.bindingLayouts;ii(0<c.bindingLayoutTables.length);var f=c.bindingLayoutTables[0];ii(a.length>=f.numUniformBuffers),ii(u.length>=f.numSamplers);for(var m=0;m<a.length;m++){var _=a[m];if(_.size!==0){var b=f.firstUniformBuffer+m,A=_.buffer,w=_.offset||0,R=_.size||A.byteSize;if(A!==this.currentUniformBuffers[b]||w!==this.currentUniformBufferByteOffsets[b]||R!==this.currentUniformBufferByteSizes[b]){var P=w%A.pageByteSize,k=A.gl_buffer_pages[w/A.pageByteSize|0];ii(P+R<=A.pageByteSize),gn(i)&&i.bindBufferRange(i.UNIFORM_BUFFER,b,k,P,R),this.currentUniformBuffers[b]=A,this.currentUniformBufferByteOffsets[b]=w,this.currentUniformBufferByteSizes[b]=R}}}for(var m=0;m<f.numSamplers;m++){var _=u[m],L=f.firstSampler+m,B=_!==null&&_.sampler!==null?Nx(_.sampler):null,V=_!==null&&_.texture!==null?Nd(_.texture):null;if(this.currentSamplers[L]!==B&&(gn(i)&&i.bindSampler(L,B),this.currentSamplers[L]=B),this.currentTextures[L]!==V){if(this.setActiveTexture(i.TEXTURE0+L),V!==null){var G=g1(_).texture,K=G.gl_target,Z=G.width,ve=G.height;_.texture.textureIndex=L,i.bindTexture(K,V),gn(i)||(n=_.sampler)===null||n===void 0||n.setTextureParameters(K,Z,ve),this.debugGroupStatisticsTextureBind()}else{var Ie=Ka(Ka({},_),HO),de=Ie.dimension,se=Ie.formatKind,K=d2e(de);i.bindTexture(K,this.getFallbackTexture(Ka({gl_target:K,formatKind:se},Ie)))}this.currentTextures[L]=V}}},e.prototype.setViewport=function(t,r,n,i){var o=this.gl;o.viewport(t,r,n,i)},e.prototype.setScissorRect=function(t,r,n,i){var o=this.gl;this.setScissorRectEnabled(!0),o.scissor(t,r,n,i)},e.prototype.applyAttachmentStateIndexed=function(t,r,n){var i=this.gl,o=this.OES_draw_buffers_indexed;r.channelWriteMask!==n.channelWriteMask&&(o.colorMaskiOES(t,!!(n.channelWriteMask&fs.RED),!!(n.channelWriteMask&fs.GREEN),!!(n.channelWriteMask&fs.BLUE),!!(n.channelWriteMask&fs.ALPHA)),r.channelWriteMask=n.channelWriteMask);var a=r.rgbBlendState.blendMode!==n.rgbBlendState.blendMode||r.alphaBlendState.blendMode!==n.alphaBlendState.blendMode,u=r.rgbBlendState.blendSrcFactor!==n.rgbBlendState.blendSrcFactor||r.alphaBlendState.blendSrcFactor!==n.alphaBlendState.blendSrcFactor||r.rgbBlendState.blendDstFactor!==n.rgbBlendState.blendDstFactor||r.alphaBlendState.blendDstFactor!==n.alphaBlendState.blendDstFactor;(u||a)&&(tp(r.rgbBlendState)&&tp(r.alphaBlendState)?o.enableiOES(t,i.BLEND):tp(n.rgbBlendState)&&tp(n.alphaBlendState)&&o.disableiOES(t,i.BLEND)),a&&(o.blendEquationSeparateiOES(t,n.rgbBlendState.blendMode,n.alphaBlendState.blendMode),r.rgbBlendState.blendMode=n.rgbBlendState.blendMode,r.alphaBlendState.blendMode=n.alphaBlendState.blendMode),u&&(o.blendFuncSeparateiOES(t,n.rgbBlendState.blendSrcFactor,n.rgbBlendState.blendDstFactor,n.alphaBlendState.blendSrcFactor,n.alphaBlendState.blendDstFactor),r.rgbBlendState.blendSrcFactor=n.rgbBlendState.blendSrcFactor,r.alphaBlendState.blendSrcFactor=n.alphaBlendState.blendSrcFactor,r.rgbBlendState.blendDstFactor=n.rgbBlendState.blendDstFactor,r.alphaBlendState.blendDstFactor=n.alphaBlendState.blendDstFactor)},e.prototype.applyAttachmentState=function(t,r){var n=this.gl;t.channelWriteMask!==r.channelWriteMask&&(n.colorMask(!!(r.channelWriteMask&fs.RED),!!(r.channelWriteMask&fs.GREEN),!!(r.channelWriteMask&fs.BLUE),!!(r.channelWriteMask&fs.ALPHA)),t.channelWriteMask=r.channelWriteMask);var i=t.rgbBlendState.blendMode!==r.rgbBlendState.blendMode||t.alphaBlendState.blendMode!==r.alphaBlendState.blendMode,o=t.rgbBlendState.blendSrcFactor!==r.rgbBlendState.blendSrcFactor||t.alphaBlendState.blendSrcFactor!==r.alphaBlendState.blendSrcFactor||t.rgbBlendState.blendDstFactor!==r.rgbBlendState.blendDstFactor||t.alphaBlendState.blendDstFactor!==r.alphaBlendState.blendDstFactor;(o||i)&&(tp(t.rgbBlendState)&&tp(t.alphaBlendState)?n.enable(n.BLEND):tp(r.rgbBlendState)&&tp(r.alphaBlendState)&&n.disable(n.BLEND)),i&&(n.blendEquationSeparate(r.rgbBlendState.blendMode,r.alphaBlendState.blendMode),t.rgbBlendState.blendMode=r.rgbBlendState.blendMode,t.alphaBlendState.blendMode=r.alphaBlendState.blendMode),o&&(n.blendFuncSeparate(r.rgbBlendState.blendSrcFactor,r.rgbBlendState.blendDstFactor,r.alphaBlendState.blendSrcFactor,r.alphaBlendState.blendDstFactor),t.rgbBlendState.blendSrcFactor=r.rgbBlendState.blendSrcFactor,t.alphaBlendState.blendSrcFactor=r.alphaBlendState.blendSrcFactor,t.rgbBlendState.blendDstFactor=r.rgbBlendState.blendDstFactor,t.alphaBlendState.blendDstFactor=r.alphaBlendState.blendDstFactor)},e.prototype.setMegaState=function(t){var r=this.gl,n=this.currentMegaState;if(this.OES_draw_buffers_indexed!==null)for(var i=0;i<t.attachmentsState.length;i++)this.applyAttachmentStateIndexed(i,n.attachmentsState[0],t.attachmentsState[0]);else ii(t.attachmentsState.length===1),this.applyAttachmentState(n.attachmentsState[0],t.attachmentsState[0]);if(UO(n.blendConstant,t.blendConstant)||(r.blendColor(t.blendConstant.r,t.blendConstant.g,t.blendConstant.b,t.blendConstant.a),zO(n.blendConstant,t.blendConstant)),n.depthCompare!==t.depthCompare&&(r.depthFunc(t.depthCompare),n.depthCompare=t.depthCompare),!!n.depthWrite!=!!t.depthWrite&&(r.depthMask(t.depthWrite),n.depthWrite=t.depthWrite),!!n.stencilWrite!=!!t.stencilWrite&&(r.stencilMask(t.stencilWrite?255:0),n.stencilWrite=t.stencilWrite),!A_(n.stencilFront,t.stencilFront)){var o=t.stencilFront,a=o.passOp,u=o.failOp,c=o.depthFailOp,f=o.compare;(n.stencilFront.passOp!==a||n.stencilFront.failOp!==u||n.stencilFront.depthFailOp!==c)&&(r.stencilOpSeparate(r.FRONT,u,c,a),n.stencilFront.passOp=a,n.stencilFront.failOp=u,n.stencilFront.depthFailOp=c),n.stencilFront.compare!==f&&(this.setStencilReference(0),n.stencilFront.compare=f)}if(!A_(n.stencilBack,t.stencilBack)){var m=t.stencilBack,a=m.passOp,u=m.failOp,c=m.depthFailOp,f=m.compare;(n.stencilBack.passOp!==a||n.stencilBack.failOp!==u||n.stencilBack.depthFailOp!==c)&&(r.stencilOpSeparate(r.BACK,u,c,a),n.stencilBack.passOp=a,n.stencilBack.failOp=u,n.stencilBack.depthFailOp=c),n.stencilBack.compare!==f&&(this.setStencilReference(0),n.stencilBack.compare=f)}(n.stencilFront.mask!==t.stencilFront.mask||n.stencilBack.mask!==t.stencilBack.mask)&&(n.stencilFront.mask=t.stencilFront.mask,n.stencilBack.mask=t.stencilBack.mask,this.applyStencil()),n.cullMode!==t.cullMode&&(n.cullMode===Uu.NONE?r.enable(r.CULL_FACE):t.cullMode===Uu.NONE&&r.disable(r.CULL_FACE),t.cullMode===Uu.BACK?r.cullFace(r.BACK):t.cullMode===Uu.FRONT?r.cullFace(r.FRONT):t.cullMode===Uu.FRONT_AND_BACK&&r.cullFace(r.FRONT_AND_BACK),n.cullMode=t.cullMode),n.frontFace!==t.frontFace&&(r.frontFace(t.frontFace),n.frontFace=t.frontFace),n.polygonOffset!==t.polygonOffset&&(t.polygonOffset?(r.polygonOffset(1,1),r.enable(r.POLYGON_OFFSET_FILL)):r.disable(r.POLYGON_OFFSET_FILL),n.polygonOffset=t.polygonOffset)},e.prototype.validatePipelineFormats=function(t){for(var r=0;r<this.currentColorAttachments.length;r++)var n=this.currentColorAttachments[r];this.currentDepthStencilAttachment&&ii(this.currentDepthStencilAttachment.format===t.depthStencilAttachmentFormat),this.currentSampleCount!==-1&&ii(this.currentSampleCount===t.sampleCount)},e.prototype.setPipeline=function(t){var r=this;if(this.renderBundle){this.renderBundle.push(function(){return r.setPipeline(t)});return}this.currentPipeline=t,this.validatePipelineFormats(this.currentPipeline),this.setMegaState(this.currentPipeline.megaState);var n=this.currentPipeline.program;if(this.useProgram(n),n.compileState===Lu.NeedsBind){var i=this.gl,o=n.gl_program,a=n.descriptor,u=k9(a.vertex.glsl,C2e);if(gn(i))for(var c=0;c<u.length;c++){var f=af(u[c],2),m=f[1],_=i.getUniformBlockIndex(o,m);_!==-1&&_!==4294967295&&i.uniformBlockBinding(o,_,c)}for(var b=k9(a.fragment.glsl,/^uniform .*sampler\S+ (\w+);\s* \/\/ BINDING=(\d+)$/gm),c=0;c<b.length;c++){var A=af(b[c],3),w=A[1],R=A[2],P=i.getUniformLocation(o,w);i.uniform1i(P,parseInt(R))}n.compileState=Lu.ReadyToUse}},e.prototype.setVertexInput=function(t,r,n){var i,o,a=this,u;if(this.renderBundle){this.renderBundle.push(function(){return a.setVertexInput(t,r,n)});return}if(t!==null){ii(this.currentPipeline.inputLayout===t);var c=t;this.bindVAO(c.vao);for(var f=this.gl,m=0;m<c.vertexBufferDescriptors.length;m++){var _=c.vertexBufferDescriptors[m],b=_.arrayStride,A=_.attributes;try{for(var w=(i=void 0,C1(A)),R=w.next();!R.done;R=w.next()){var P=R.value,k=P.shaderLocation,L=P.offset,B=gn(f)?k:(u=c.program.attributes[k])===null||u===void 0?void 0:u.location;if(!Xl(B)){var V=r[m];if(V===null)continue;var G=P.vertexFormat;f.bindBuffer(f.ARRAY_BUFFER,n0(V.buffer));var K=(V.offset||0)+L;f.vertexAttribPointer(B,G.size,G.type,G.normalized,b,K)}}}catch(ve){i={error:ve}}finally{try{R&&!R.done&&(o=w.return)&&o.call(w)}finally{if(i)throw i.error}}}if(ii(n!==null==(c.indexBufferFormat!==null)),n!==null){var Z=n.buffer;ii(Z.usage===da.INDEX),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,n0(Z)),this.currentIndexBufferByteOffset=n.offset||0}else this.currentIndexBufferByteOffset=null}else ii(this.currentPipeline.inputLayout===null),ii(n===null),this.bindVAO(null),this.currentIndexBufferByteOffset=0},e.prototype.setStencilReference=function(t){this.currentStencilRef!==t&&(this.currentStencilRef=t,this.applyStencil())},e.prototype.draw=function(t,r,n,i){var o,a=this;if(this.renderBundle){this.renderBundle.push(function(){return a.draw(t,r,n,i)});return}var u=this.gl,c=this.currentPipeline;if(r){var f=[c.drawMode,n||0,t,r];gn(u)?u.drawArraysInstanced.apply(u,Pv([],af(f),!1)):(o=this.ANGLE_instanced_arrays).drawArraysInstancedANGLE.apply(o,Pv([],af(f),!1))}else u.drawArrays(c.drawMode,n,t);this.debugGroupStatisticsDrawCall(),this.debugGroupStatisticsTriangles(t/3*Math.max(r,1))},e.prototype.drawIndexed=function(t,r,n,i,o){var a,u=this;if(this.renderBundle){this.renderBundle.push(function(){return u.drawIndexed(t,r,n,i,o)});return}var c=this.gl,f=this.currentPipeline,m=g1(f.inputLayout),_=g1(this.currentIndexBufferByteOffset)+n*m.indexBufferCompByteSize;if(r){var b=[f.drawMode,t,m.indexBufferType,_,r];gn(c)?c.drawElementsInstanced.apply(c,Pv([],af(b),!1)):(a=this.ANGLE_instanced_arrays).drawElementsInstancedANGLE.apply(a,Pv([],af(b),!1))}else c.drawElements(f.drawMode,t,m.indexBufferType,_);this.debugGroupStatisticsDrawCall(),this.debugGroupStatisticsTriangles(t/3*Math.max(r,1))},e.prototype.drawIndirect=function(t,r){},e.prototype.drawIndexedIndirect=function(t,r){},e.prototype.beginOcclusionQuery=function(t){var r=this.gl;if(gn(r)){var n=this.currentRenderPassDescriptor.occlusionQueryPool;r.beginQuery(n.gl_query_type,n.gl_query[t])}},e.prototype.endOcclusionQuery=function(){var t=this.gl;if(gn(t)){var r=this.currentRenderPassDescriptor.occlusionQueryPool;t.endQuery(r.gl_query_type)}},e.prototype.pipelineQueryReady=function(t){var r=t;return this.queryProgramReady(r.program)},e.prototype.pipelineForceReady=function(t){},e.prototype.endPass=function(){for(var t=this.gl,r=gn(t),n=!1,i=0;i<this.currentColorAttachments.length;i++){var o=this.currentColorAttachments[i];if(o!==null){var a=this.currentColorResolveTos[i],u=!1;a!==null&&(ii(o.width===a.width&&o.height===a.height),this.setScissorRectEnabled(!1),r&&t.bindFramebuffer(t.READ_FRAMEBUFFER,this.resolveColorReadFramebuffer),this.resolveColorAttachmentsChanged&&r&&this.bindFramebufferAttachment(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,o,this.currentColorAttachmentLevels[i]),u=!0,a===this.scTexture?t.bindFramebuffer(r?Re.DRAW_FRAMEBUFFER:Re.FRAMEBUFFER,this.scPlatformFramebuffer):(t.bindFramebuffer(r?Re.DRAW_FRAMEBUFFER:Re.FRAMEBUFFER,this.resolveColorDrawFramebuffer),this.resolveColorAttachmentsChanged&&t.framebufferTexture2D(r?Re.DRAW_FRAMEBUFFER:Re.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,a.gl_texture,this.currentColorResolveToLevels[i])),r?(t.blitFramebuffer(0,0,o.width,o.height,0,0,a.width,a.height,t.COLOR_BUFFER_BIT,t.LINEAR),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null)):this.submitBlitRenderPass(o,a),n=!0),this.currentRenderPassDescriptor.colorStore[i]||u||(t.bindFramebuffer(r?Re.READ_FRAMEBUFFER:Re.FRAMEBUFFER,this.resolveColorReadFramebuffer),this.resolveColorAttachmentsChanged&&this.bindFramebufferAttachment(r?Re.READ_FRAMEBUFFER:Re.FRAMEBUFFER,t.COLOR_ATTACHMENT0,o,this.currentColorAttachmentLevels[i])),t.bindFramebuffer(r?Re.READ_FRAMEBUFFER:Re.FRAMEBUFFER,null)}}this.resolveColorAttachmentsChanged=!1;var c=this.currentDepthStencilAttachment;if(c){var f=this.currentDepthStencilResolveTo,u=!1;f&&(ii(c.width===f.width&&c.height===f.height),this.setScissorRectEnabled(!1),t.bindFramebuffer(r?Re.READ_FRAMEBUFFER:Re.FRAMEBUFFER,this.resolveDepthStencilReadFramebuffer),t.bindFramebuffer(r?Re.DRAW_FRAMEBUFFER:Re.FRAMEBUFFER,this.resolveDepthStencilDrawFramebuffer),this.resolveDepthStencilAttachmentsChanged&&(this.bindFramebufferDepthStencilAttachment(r?Re.READ_FRAMEBUFFER:Re.FRAMEBUFFER,c),this.bindFramebufferDepthStencilAttachment(r?Re.DRAW_FRAMEBUFFER:Re.FRAMEBUFFER,f)),u=!0,r&&t.blitFramebuffer(0,0,c.width,c.height,0,0,f.width,f.height,t.DEPTH_BUFFER_BIT,t.NEAREST),t.bindFramebuffer(r?Re.DRAW_FRAMEBUFFER:Re.FRAMEBUFFER,null),n=!0),this.currentRenderPassDescriptor.depthStencilStore||(u||(t.bindFramebuffer(r?Re.READ_FRAMEBUFFER:Re.FRAMEBUFFER,this.resolveDepthStencilReadFramebuffer),this.resolveDepthStencilAttachmentsChanged&&this.bindFramebufferDepthStencilAttachment(r?Re.READ_FRAMEBUFFER:Re.FRAMEBUFFER,c),u=!0),r&&t.invalidateFramebuffer(t.READ_FRAMEBUFFER,[t.DEPTH_STENCIL_ATTACHMENT])),u&&t.bindFramebuffer(r?Re.READ_FRAMEBUFFER:Re.FRAMEBUFFER,null),this.resolveDepthStencilAttachmentsChanged=!1}n||t.bindFramebuffer(r?Re.DRAW_FRAMEBUFFER:Re.FRAMEBUFFER,null)},e.prototype.setScissorRectEnabled=function(t){if(this.currentScissorEnabled!==t){var r=this.gl;t?r.enable(r.SCISSOR_TEST):r.disable(r.SCISSOR_TEST),this.currentScissorEnabled=t}},e.prototype.applyStencil=function(){Xl(this.currentStencilRef)||(this.gl.stencilFuncSeparate(Re.FRONT,this.currentMegaState.stencilFront.compare,this.currentStencilRef,this.currentMegaState.stencilFront.mask||255),this.gl.stencilFuncSeparate(Re.BACK,this.currentMegaState.stencilBack.compare,this.currentStencilRef,this.currentMegaState.stencilBack.mask||255))},e.prototype.getFallbackTexture=function(t){var r=t.gl_target,n=t.formatKind;if(r===Re.TEXTURE_2D)return n===Qa.Depth?this.fallbackTexture2DDepth:this.fallbackTexture2D;if(r===Re.TEXTURE_2D_ARRAY)return this.fallbackTexture2DArray;if(r===Re.TEXTURE_3D)return this.fallbackTexture3D;if(r===Re.TEXTURE_CUBE_MAP)return this.fallbackTextureCube;throw new Error("whoops")},e.prototype.submitBlitRenderPass=function(t,r){this.blitRenderPipeline||(this.blitProgram=this.createProgram({vertex:{glsl:`layout(location = 0) in vec2 a_Position;
|
|
out vec2 v_TexCoord;
|
|
void main() {
|
|
v_TexCoord = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
|
|
#ifdef VIEWPORT_ORIGIN_TL
|
|
v_TexCoord.y = 1.0 - v_TexCoord.y;
|
|
#endif
|
|
}`},fragment:{glsl:`uniform sampler2D u_Texture;
|
|
in vec2 v_TexCoord;
|
|
out vec4 outputColor;
|
|
void main() {
|
|
outputColor = texture(SAMPLER_2D(u_Texture), v_TexCoord);
|
|
}`}}),this.blitVertexBuffer=this.createBuffer({usage:da.VERTEX|da.COPY_DST,viewOrSize:new Float32Array([-4,-4,4,-4,0,4])}),this.blitInputLayout=this.createInputLayout({vertexBufferDescriptors:[{arrayStride:4*2,stepMode:R1.VERTEX,attributes:[{format:Ke.F32_RG,offset:4*0,shaderLocation:0}]}],indexBufferFormat:null,program:this.blitProgram}),this.blitRenderPipeline=this.createRenderPipeline({topology:Fo.TRIANGLES,sampleCount:1,program:this.blitProgram,colorAttachmentFormats:[Ke.U8_RGBA_RT],depthStencilAttachmentFormat:null,inputLayout:this.blitInputLayout,megaStateDescriptor:_0(y0)}),this.blitBindings=this.createBindings({samplerBindings:[{sampler:null,texture:t.texture}],uniformBufferBindings:[]}),this.blitProgram.setUniformsLegacy({u_Texture:t}));var n=this.currentRenderPassDescriptor;this.currentRenderPassDescriptor=null,this.inBlitRenderPass=!0;var i=this.createRenderPass({colorAttachment:[t],colorResolveTo:[r],colorClearColor:[Tme]}),o=this.getCanvas(),a=o.width,u=o.height;i.setPipeline(this.blitRenderPipeline),i.setBindings(this.blitBindings),i.setVertexInput(this.blitInputLayout,[{buffer:this.blitVertexBuffer}],null),i.setViewport(0,0,a,u),this.gl.disable(this.gl.BLEND),i.draw(3,0),this.gl.enable(this.gl.BLEND),this.currentRenderPassDescriptor=n,this.inBlitRenderPass=!1},e}(),I2e=function(){function e(t){this.pluginOptions=t}return e.prototype.createSwapChain=function(t){return t0(this,void 0,void 0,function(){var r,n,i,o,a,u,c,f,m,_,b,A,w;return r0(this,function(R){return r=this.pluginOptions,n=r.targets,i=r.xrCompatible,o=r.antialias,a=o===void 0?!1:o,u=r.preserveDrawingBuffer,c=u===void 0?!1:u,f=r.premultipliedAlpha,m=f===void 0?!0:f,_=r.shaderDebug,b=r.trackResources,A={antialias:a,preserveDrawingBuffer:c,stencil:!0,premultipliedAlpha:m,xrCompatible:i},this.handleContextEvents(t),n.includes("webgl2")&&(w=t.getContext("webgl2",A)||t.getContext("experimental-webgl2",A)),!w&&n.includes("webgl1")&&(w=t.getContext("webgl",A)||t.getContext("experimental-webgl",A)),[2,new R2e(w,{shaderDebug:_,trackResources:b})]})})},e.prototype.handleContextEvents=function(t){var r=this.pluginOptions,n=r.onContextLost,i=r.onContextRestored,o=r.onContextCreationError;o&&t.addEventListener("webglcontextcreationerror",o,!1),n&&t.addEventListener("webglcontextlost",n,!1),i&&t.addEventListener("webglcontextrestored",i,!1)},e}();let Do;const YO=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&YO.decode();let Kv=null;function Lg(){return(Kv===null||Kv.byteLength===0)&&(Kv=new Uint8Array(Do.memory.buffer)),Kv}function T_(e,t){return e=e>>>0,YO.decode(Lg().subarray(e,e+t))}const eh=new Array(128).fill(void 0);eh.push(void 0,null,!0,!1);let um=eh.length;function M2e(e){um===eh.length&&eh.push(eh.length+1);const t=um;return um=eh[t],eh[t]=e,t}function Ng(e){return eh[e]}function P2e(e){e<132||(eh[e]=um,um=e)}function O2e(e){const t=Ng(e);return P2e(e),t}let Lm=0;const Ug=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},k2e=typeof Ug.encodeInto=="function"?function(e,t){return Ug.encodeInto(e,t)}:function(e,t){const r=Ug.encode(e);return t.set(r),{read:e.length,written:r.length}};function zx(e,t,r){if(r===void 0){const u=Ug.encode(e),c=t(u.length,1)>>>0;return Lg().subarray(c,c+u.length).set(u),Lm=u.length,c}let n=e.length,i=t(n,1)>>>0;const o=Lg();let a=0;for(;a<n;a++){const u=e.charCodeAt(a);if(u>127)break;o[i+a]=u}if(a!==n){a!==0&&(e=e.slice(a)),i=r(i,n,n=a+e.length*3,1)>>>0;const u=Lg().subarray(i+a,i+n),c=k2e(e,u);a+=c.written}return Lm=a,i}let Qv=null;function w_(){return(Qv===null||Qv.byteLength===0)&&(Qv=new Int32Array(Do.memory.buffer)),Qv}function D2e(e,t,r){let n,i;try{const u=Do.__wbindgen_add_to_stack_pointer(-16),c=zx(e,Do.__wbindgen_malloc,Do.__wbindgen_realloc),f=Lm,m=zx(t,Do.__wbindgen_malloc,Do.__wbindgen_realloc),_=Lm;Do.glsl_compile(u,c,f,m,_,r);var o=w_()[u/4+0],a=w_()[u/4+1];return n=o,i=a,T_(o,a)}finally{Do.__wbindgen_add_to_stack_pointer(16),Do.__wbindgen_free(n,i,1)}}class Nm{static __wrap(t){t=t>>>0;const r=Object.create(Nm.prototype);return r.__wbg_ptr=t,r}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();Do.__wbg_wgslcomposer_free(t)}constructor(){const t=Do.wgslcomposer_new();return Nm.__wrap(t)}wgsl_compile(t){let r,n;try{const a=Do.__wbindgen_add_to_stack_pointer(-16),u=zx(t,Do.__wbindgen_malloc,Do.__wbindgen_realloc),c=Lm;Do.wgslcomposer_wgsl_compile(a,this.__wbg_ptr,u,c);var i=w_()[a/4+0],o=w_()[a/4+1];return r=i,n=o,T_(i,o)}finally{Do.__wbindgen_add_to_stack_pointer(16),Do.__wbindgen_free(r,n,1)}}}async function F2e(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(n){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}const r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{const r=await WebAssembly.instantiate(e,t);return r instanceof WebAssembly.Instance?{instance:r,module:e}:r}}function B2e(){const e={};return e.wbg={},e.wbg.__wbindgen_string_new=function(t,r){const n=T_(t,r);return M2e(n)},e.wbg.__wbindgen_object_drop_ref=function(t){O2e(t)},e.wbg.__wbg_log_1d3ae0273d8f4f8a=function(t){console.log(Ng(t))},e.wbg.__wbg_log_576ca876af0d4a77=function(t,r){console.log(Ng(t),Ng(r))},e.wbg.__wbindgen_throw=function(t,r){throw new Error(T_(t,r))},e}function L2e(e,t){return Do=e.exports,ZO.__wbindgen_wasm_module=t,Qv=null,Kv=null,Do}async function ZO(e){if(Do!==void 0)return Do;const t=B2e();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));const{instance:r,module:n}=await F2e(await e,t);return L2e(r,n)}var es;(function(e){e[e.COPY_SRC=1]="COPY_SRC",e[e.COPY_DST=2]="COPY_DST",e[e.TEXTURE_BINDING=4]="TEXTURE_BINDING",e[e.STORAGE_BINDING=8]="STORAGE_BINDING",e[e.STORAGE=8]="STORAGE",e[e.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"})(es||(es={}));var $x;(function(e){e[e.READ=1]="READ",e[e.WRITE=2]="WRITE"})($x||($x={}));function N2e(e){var t=0;return e&nu.SAMPLED&&(t|=es.TEXTURE_BINDING|es.COPY_DST|es.COPY_SRC),e&nu.STORAGE&&(t|=es.TEXTURE_BINDING|es.STORAGE_BINDING|es.COPY_SRC|es.COPY_DST),e&nu.RENDER_TARGET&&(t|=es.RENDER_ATTACHMENT|es.TEXTURE_BINDING|es.COPY_SRC|es.COPY_DST),t}function Sb(e){if(e===Ke.U8_R_NORM)return"r8unorm";if(e===Ke.S8_R_NORM)return"r8snorm";if(e===Ke.U8_RG_NORM)return"rg8unorm";if(e===Ke.S8_RG_NORM)return"rg8snorm";if(e===Ke.U32_R)return"r32uint";if(e===Ke.S32_R)return"r32sint";if(e===Ke.F32_R)return"r32float";if(e===Ke.U16_RG)return"rg16uint";if(e===Ke.S16_RG)return"rg16sint";if(e===Ke.F16_RG)return"rg16float";if(e===Ke.U8_RGBA_RT)return"bgra8unorm";if(e===Ke.U8_RGBA_RT_SRGB)return"bgra8unorm-srgb";if(e===Ke.U8_RGBA_NORM)return"rgba8unorm";if(e===Ke.U8_RGBA_SRGB)return"rgba8unorm-srgb";if(e===Ke.S8_RGBA_NORM)return"rgba8snorm";if(e===Ke.F32_RGB)return"rgb9e5ufloat";if(e===Ke.U32_RG)return"rg32uint";if(e===Ke.S32_RG)return"rg32sint";if(e===Ke.F32_RG)return"rg32float";if(e===Ke.U16_RGBA)return"rgba16uint";if(e===Ke.S16_RGBA)return"rgba16sint";if(e===Ke.F16_RGBA)return"rgba16float";if(e===Ke.F32_RGBA)return"rgba32float";if(e===Ke.U32_RGBA)return"rgba32uint";if(e===Ke.S32_RGBA)return"rgba32sint";if(e===Ke.D24)return"depth24plus";if(e===Ke.D24_S8)return"depth24plus-stencil8";if(e===Ke.D32F)return"depth32float";if(e===Ke.D32F_S8)return"depth32float-stencil8";if(e===Ke.BC1)return"bc1-rgba-unorm";if(e===Ke.BC1_SRGB)return"bc1-rgba-unorm-srgb";if(e===Ke.BC2)return"bc2-rgba-unorm";if(e===Ke.BC2_SRGB)return"bc2-rgba-unorm-srgb";if(e===Ke.BC3)return"bc3-rgba-unorm";if(e===Ke.BC3_SRGB)return"bc3-rgba-unorm-srgb";if(e===Ke.BC4_SNORM)return"bc4-r-snorm";if(e===Ke.BC4_UNORM)return"bc4-r-unorm";if(e===Ke.BC5_SNORM)return"bc5-rg-snorm";if(e===Ke.BC5_UNORM)return"bc5-rg-unorm";throw"whoops"}function U2e(e){if(e===Ti.TEXTURE_2D)return"2d";if(e===Ti.TEXTURE_CUBE_MAP)return"2d";if(e===Ti.TEXTURE_2D_ARRAY)return"2d";if(e===Ti.TEXTURE_3D)return"3d";throw new Error("whoops")}function z2e(e){if(e===Ti.TEXTURE_2D)return"2d";if(e===Ti.TEXTURE_CUBE_MAP)return"cube";if(e===Ti.TEXTURE_2D_ARRAY)return"2d-array";if(e===Ti.TEXTURE_3D)return"3d";throw new Error("whoops")}function $2e(e){var t=0;return e&da.INDEX&&(t|=GPUBufferUsage.INDEX),e&da.VERTEX&&(t|=GPUBufferUsage.VERTEX),e&da.UNIFORM&&(t|=GPUBufferUsage.UNIFORM),e&da.STORAGE&&(t|=GPUBufferUsage.STORAGE),e&da.COPY_SRC&&(t|=GPUBufferUsage.COPY_SRC),e&da.INDIRECT&&(t|=GPUBufferUsage.INDIRECT),t|=GPUBufferUsage.COPY_DST,t}function p6(e){if(e===gu.CLAMP_TO_EDGE)return"clamp-to-edge";if(e===gu.REPEAT)return"repeat";if(e===gu.MIRRORED_REPEAT)return"mirror-repeat";throw new Error("whoops")}function F9(e){if(e===vo.BILINEAR)return"linear";if(e===vo.POINT)return"nearest";throw new Error("whoops")}function V2e(e){if(e===ts.LINEAR)return"linear";if(e===ts.NEAREST)return"nearest";if(e===ts.NO_MIP)return"nearest";throw new Error("whoops")}function Gd(e){var t=e;return t.gpuBuffer}function j2e(e){var t=e;return t.gpuSampler}function H2e(e){var t=e;return t.querySet}function G2e(e){if(e===x_.OcclusionConservative)return"occlusion";throw new Error("whoops")}function W2e(e){switch(e){case Fo.TRIANGLES:return"triangle-list";case Fo.POINTS:return"point-list";case Fo.TRIANGLE_STRIP:return"triangle-strip";case Fo.LINES:return"line-list";case Fo.LINE_STRIP:return"line-strip";default:throw new Error("Unknown primitive topology mode")}}function X2e(e){if(e===Uu.NONE)return"none";if(e===Uu.FRONT)return"front";if(e===Uu.BACK)return"back";throw new Error("whoops")}function Y2e(e){if(e===Bm.CCW)return"ccw";if(e===Bm.CW)return"cw";throw new Error("whoops")}function Z2e(e,t){return{topology:W2e(e),cullMode:X2e(t.cullMode),frontFace:Y2e(t.frontFace)}}function B9(e){if(e===Ai.ZERO)return"zero";if(e===Ai.ONE)return"one";if(e===Ai.SRC)return"src";if(e===Ai.ONE_MINUS_SRC)return"one-minus-src";if(e===Ai.DST)return"dst";if(e===Ai.ONE_MINUS_DST)return"one-minus-dst";if(e===Ai.SRC_ALPHA)return"src-alpha";if(e===Ai.ONE_MINUS_SRC_ALPHA)return"one-minus-src-alpha";if(e===Ai.DST_ALPHA)return"dst-alpha";if(e===Ai.ONE_MINUS_DST_ALPHA)return"one-minus-dst-alpha";if(e===Ai.CONST)return"constant";if(e===Ai.ONE_MINUS_CONSTANT)return"one-minus-constant";if(e===Ai.SRC_ALPHA_SATURATE)return"src-alpha-saturated";throw new Error("whoops")}function q2e(e){if(e===hs.ADD)return"add";if(e===hs.SUBSTRACT)return"subtract";if(e===hs.REVERSE_SUBSTRACT)return"reverse-subtract";if(e===hs.MIN)return"min";if(e===hs.MAX)return"max";throw new Error("whoops")}function L9(e){return{operation:q2e(e.blendMode),srcFactor:B9(e.blendSrcFactor),dstFactor:B9(e.blendDstFactor)}}function N9(e){return e.blendMode===hs.ADD&&e.blendSrcFactor===Ai.ONE&&e.blendDstFactor===Ai.ZERO}function K2e(e){if(!(N9(e.rgbBlendState)&&N9(e.alphaBlendState)))return{color:L9(e.rgbBlendState),alpha:L9(e.alphaBlendState)}}function Q2e(e,t){return{format:Sb(t),blend:K2e(e),writeMask:e.channelWriteMask}}function J2e(e,t){return t.attachmentsState.map(function(r,n){return Q2e(r,e[n])})}function zg(e){if(e===Ki.NEVER)return"never";if(e===Ki.LESS)return"less";if(e===Ki.EQUAL)return"equal";if(e===Ki.LEQUAL)return"less-equal";if(e===Ki.GREATER)return"greater";if(e===Ki.NOTEQUAL)return"not-equal";if(e===Ki.GEQUAL)return"greater-equal";if(e===Ki.ALWAYS)return"always";throw new Error("whoops")}function Od(e){if(e===eo.KEEP)return"keep";if(e===eo.REPLACE)return"replace";if(e===eo.ZERO)return"zero";if(e===eo.DECREMENT_CLAMP)return"decrement-clamp";if(e===eo.DECREMENT_WRAP)return"decrement-wrap";if(e===eo.INCREMENT_CLAMP)return"increment-clamp";if(e===eo.INCREMENT_WRAP)return"increment-wrap";if(e===eo.INVERT)return"invert";throw new Error("whoops")}function ege(e,t){if(!Xl(e))return{format:Sb(e),depthWriteEnabled:!!t.depthWrite,depthCompare:zg(t.depthCompare),depthBias:t.polygonOffset?1:0,depthBiasSlopeScale:t.polygonOffset?1:0,stencilFront:{compare:zg(t.stencilFront.compare),passOp:Od(t.stencilFront.passOp),failOp:Od(t.stencilFront.failOp),depthFailOp:Od(t.stencilFront.depthFailOp)},stencilBack:{compare:zg(t.stencilBack.compare),passOp:Od(t.stencilBack.passOp),failOp:Od(t.stencilBack.failOp),depthFailOp:Od(t.stencilBack.depthFailOp)},stencilReadMask:1,stencilWriteMask:1}}function tge(e){if(e!==null){if(e===Ke.U16_R)return"uint16";if(e===Ke.U32_R)return"uint32";throw new Error("whoops")}}function rge(e){if(e===R1.VERTEX)return"vertex";if(e===R1.INSTANCE)return"instance";throw new Error("whoops")}function nge(e){if(e===Ke.U8_R)return"uint8x2";if(e===Ke.U8_RG)return"uint8x2";if(e===Ke.U8_RGB)return"uint8x4";if(e===Ke.U8_RGBA)return"uint8x4";if(e===Ke.U8_RG_NORM)return"unorm8x2";if(e===Ke.U8_RGBA_NORM)return"unorm8x4";if(e===Ke.S8_RGB_NORM)return"snorm8x4";if(e===Ke.S8_RGBA_NORM)return"snorm8x4";if(e===Ke.U16_RG_NORM)return"unorm16x2";if(e===Ke.U16_RGBA_NORM)return"unorm16x4";if(e===Ke.S16_RG_NORM)return"snorm16x2";if(e===Ke.S16_RGBA_NORM)return"snorm16x4";if(e===Ke.S16_RG)return"uint16x2";if(e===Ke.F16_RG)return"float16x2";if(e===Ke.F16_RGBA)return"float16x4";if(e===Ke.F32_R)return"float32";if(e===Ke.F32_RG)return"float32x2";if(e===Ke.F32_RGB)return"float32x3";if(e===Ke.F32_RGBA)return"float32x4";throw"whoops"}function ige(e){var t=_f(e);switch(t){case Kt.BC1:case Kt.BC2:case Kt.BC3:case Kt.BC4_SNORM:case Kt.BC4_UNORM:case Kt.BC5_SNORM:case Kt.BC5_UNORM:return!0;default:return!1}}function age(e){var t=_f(e);switch(t){case Kt.BC1:case Kt.BC2:case Kt.BC3:case Kt.BC4_SNORM:case Kt.BC4_UNORM:case Kt.BC5_SNORM:case Kt.BC5_UNORM:return 4;default:return 1}}function U9(e,t,r,n){switch(r===void 0&&(r=!1),e){case Ke.S8_R:case Ke.S8_R_NORM:case Ke.S8_RG_NORM:case Ke.S8_RGB_NORM:case Ke.S8_RGBA_NORM:{var i=t instanceof ArrayBuffer?new Int8Array(t):new Int8Array(t);return n&&i.set(new Int8Array(n)),i}case Ke.U8_R:case Ke.U8_R_NORM:case Ke.U8_RG:case Ke.U8_RG_NORM:case Ke.U8_RGB:case Ke.U8_RGB_NORM:case Ke.U8_RGB_SRGB:case Ke.U8_RGBA:case Ke.U8_RGBA_NORM:case Ke.U8_RGBA_SRGB:{var o=t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t);return n&&o.set(new Uint8Array(n)),o}case Ke.S16_R:case Ke.S16_RG:case Ke.S16_RG_NORM:case Ke.S16_RGB_NORM:case Ke.S16_RGBA:case Ke.S16_RGBA_NORM:{var a=t instanceof ArrayBuffer?new Int16Array(t):new Int16Array(r?t/2:t);return n&&a.set(new Int16Array(n)),a}case Ke.U16_R:case Ke.U16_RGB:case Ke.U16_RGBA_5551:case Ke.U16_RGBA_NORM:case Ke.U16_RG_NORM:case Ke.U16_R_NORM:{var u=t instanceof ArrayBuffer?new Uint16Array(t):new Uint16Array(r?t/2:t);return n&&u.set(new Uint16Array(n)),u}case Ke.S32_R:{var c=t instanceof ArrayBuffer?new Int32Array(t):new Int32Array(r?t/4:t);return n&&c.set(new Int32Array(n)),c}case Ke.U32_R:case Ke.U32_RG:{var f=t instanceof ArrayBuffer?new Uint32Array(t):new Uint32Array(r?t/4:t);return n&&f.set(new Uint32Array(n)),f}case Ke.F32_R:case Ke.F32_RG:case Ke.F32_RGB:case Ke.F32_RGBA:{var m=t instanceof ArrayBuffer?new Float32Array(t):new Float32Array(r?t/4:t);return n&&m.set(new Float32Array(n)),m}}var _=t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t);return n&&_.set(new Uint8Array(n)),_}function oge(e){var t=(e&32768)>>15,r=(e&31744)>>10,n=e&1023;return r===0?(t?-1:1)*Math.pow(2,-14)*(n/Math.pow(2,10)):r==31?n?NaN:(t?-1:1)*(1/0):(t?-1:1)*Math.pow(2,r-15)*(1+n/Math.pow(2,10))}function qO(e){switch(e){case"r8unorm":case"r8snorm":case"r8uint":case"r8sint":return{width:1,height:1,length:1};case"r16uint":case"r16sint":case"r16float":case"rg8unorm":case"rg8snorm":case"rg8uint":case"rg8sint":return{width:1,height:1,length:2};case"r32uint":case"r32sint":case"r32float":case"rg16uint":case"rg16sint":case"rg16float":case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8snorm":case"rgba8uint":case"rgba8sint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgb9e5ufloat":case"rgb10a2unorm":case"rg11b10ufloat":return{width:1,height:1,length:4};case"rg32uint":case"rg32sint":case"rg32float":case"rgba16uint":case"rgba16sint":case"rgba16float":return{width:1,height:1,length:8};case"rgba32uint":case"rgba32sint":case"rgba32float":return{width:1,height:1,length:16};case"stencil8":throw new Error("No fixed size for Stencil8 format!");case"depth16unorm":return{width:1,height:1,length:2};case"depth24plus":throw new Error("No fixed size for Depth24Plus format!");case"depth24plus-stencil8":throw new Error("No fixed size for Depth24PlusStencil8 format!");case"depth32float":return{width:1,height:1,length:4};case"depth32float-stencil8":return{width:1,height:1,length:5};case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc6h-rgb-ufloat":case"bc6h-rgb-float":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc5-rg-unorm":case"bc5-rg-snorm":return{width:4,height:4,length:16};case"bc4-r-unorm":case"bc4-r-snorm":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":return{width:4,height:4,length:8};default:return{width:1,height:1,length:4}}}var Ac=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=e.call(this)||this;return o.id=n,o.device=i,o}return t.prototype.destroy=function(){},t}(FO),sge=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a,u,c=e.call(this,{id:n,device:i})||this;c.type=ji.Bindings;var f=o.pipeline;ii(!!f);var m=o.uniformBufferBindings,_=o.storageBufferBindings,b=o.samplerBindings,A=o.storageTextureBindings;c.numUniformBuffers=(m==null?void 0:m.length)||0;var w=[[],[],[],[]],R=0;if(m&&m.length)for(var P=0;P<m.length;P++){var k=o.uniformBufferBindings[P],L=k.binding,B=k.size,V=k.offset,G=k.buffer,K={buffer:Gd(G),offset:V??0,size:B};w[0].push({binding:L??R++,resource:K})}if(b&&b.length){R=0;for(var P=0;P<b.length;P++){var Z=Ka(Ka({},b[P]),HO),L=o.samplerBindings[P],ve=L.texture!==null?L.texture:c.device.getFallbackTexture(Z);Z.dimension=ve.dimension,Z.formatKind=NO(ve.format);var Ie=ve.gpuTextureView;if(w[1].push({binding:(a=L.textureBinding)!==null&&a!==void 0?a:R++,resource:Ie}),L.samplerBinding!==-1){var de=L.sampler!==null?L.sampler:c.device.getFallbackSampler(Z),se=j2e(de);w[1].push({binding:(u=L.samplerBinding)!==null&&u!==void 0?u:R++,resource:se})}}}if(_&&_.length){R=0;for(var P=0;P<_.length;P++){var le=o.storageBufferBindings[P],L=le.binding,B=le.size,V=le.offset,G=le.buffer,K={buffer:Gd(G),offset:V??0,size:B};w[2].push({binding:L??R++,resource:K})}}if(A&&A.length){R=0;for(var P=0;P<A.length;P++){var ye=o.storageTextureBindings[P],L=ye.binding,ve=ye.texture,Ie=ve.gpuTextureView;w[3].push({binding:L??R++,resource:Ie})}}var ke=w.findLastIndex(function(Rt){return!!Rt.length});return c.gpuBindGroup=w.map(function(Rt,Lt){return Lt<=ke&&c.device.device.createBindGroup({layout:f.getBindGroupLayout(Lt),entries:Rt})}),c}return t}(Ac),uge=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a=e.call(this,{id:n,device:i})||this;a.type=ji.Buffer;var u=o.usage,c=o.viewOrSize,f=!!(u&da.MAP_READ);a.usage=$2e(u),f&&(a.usage=da.MAP_READ|da.COPY_DST);var m=!jd(c);if(a.view=jd(c)?null:c,a.size=jd(c)?E_(c,4):E_(c.byteLength,4),jd(c))a.gpuBuffer=a.device.device.createBuffer({usage:a.usage,size:a.size,mappedAtCreation:f?m:!1});else{a.gpuBuffer=a.device.device.createBuffer({usage:a.usage,size:a.size,mappedAtCreation:!0});var _=c&&c.constructor||Float32Array;new _(a.gpuBuffer.getMappedRange()).set(c),a.gpuBuffer.unmap()}return a}return t.prototype.setSubData=function(r,n,i,o){i===void 0&&(i=0),o===void 0&&(o=0);var a=this.gpuBuffer;o=o||n.byteLength,o=Math.min(o,this.size-r);var u=n.byteOffset+i,c=u+o,f=o+3&-4;if(f!==o){var m=new Uint8Array(n.buffer.slice(u,c));n=new Uint8Array(f),n.set(m),i=0,u=0,c=f,o=f}for(var _=1024*1024*15,b=0;c-(u+b)>_;)this.device.device.queue.writeBuffer(a,r+b,n.buffer,u+b,_),b+=_;this.device.device.queue.writeBuffer(a,r+b,n.buffer,u+b,o-b)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.gpuBuffer.destroy()},t}(Ac),z9=function(){function e(){this.gpuComputePassEncoder=null}return e.prototype.dispatchWorkgroups=function(t,r,n){this.gpuComputePassEncoder.dispatchWorkgroups(t,r,n)},e.prototype.dispatchWorkgroupsIndirect=function(t,r){this.gpuComputePassEncoder.dispatchWorkgroupsIndirect(t.gpuBuffer,r)},e.prototype.finish=function(){this.gpuComputePassEncoder.end(),this.gpuComputePassEncoder=null,this.frameCommandEncoder=null},e.prototype.beginComputePass=function(t){ii(this.gpuComputePassEncoder===null),this.frameCommandEncoder=t,this.gpuComputePassEncoder=this.frameCommandEncoder.beginComputePass(this.gpuComputePassDescriptor)},e.prototype.setPipeline=function(t){var r=t,n=g1(r.gpuComputePipeline);this.gpuComputePassEncoder.setPipeline(n)},e.prototype.setBindings=function(t){var r=this,n=t;n.gpuBindGroup.forEach(function(i,o){i&&r.gpuComputePassEncoder.setBindGroup(o,n.gpuBindGroup[o])})},e.prototype.pushDebugGroup=function(t){this.gpuComputePassEncoder.pushDebugGroup(t)},e.prototype.popDebugGroup=function(){this.gpuComputePassEncoder.popDebugGroup()},e.prototype.insertDebugMarker=function(t){this.gpuComputePassEncoder.insertDebugMarker(t)},e}(),lge=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a=e.call(this,{id:n,device:i})||this;a.type=ji.ComputePipeline,a.gpuComputePipeline=null,a.descriptor=o;var u=o.program,c=u.computeStage;if(c===null)return a;var f={layout:"auto",compute:Ka({},c)};return a.gpuComputePipeline=a.device.device.createComputePipeline(f),a.name!==void 0&&(a.gpuComputePipeline.label=a.name),a}return t.prototype.getBindGroupLayout=function(r){return this.gpuComputePipeline.getBindGroupLayout(r)},t}(Ac),cge=function(e){to(t,e);function t(r){var n,i,o,a,u=r.id,c=r.device,f=r.descriptor,m=e.call(this,{id:u,device:c})||this;m.type=ji.InputLayout;var _=[];try{for(var b=C1(f.vertexBufferDescriptors),A=b.next();!A.done;A=b.next()){var w=A.value,R=w.arrayStride,P=w.stepMode,k=w.attributes;_.push({arrayStride:R,stepMode:rge(P),attributes:[]});try{for(var L=(o=void 0,C1(k)),B=L.next();!B.done;B=L.next()){var V=B.value,G=V.shaderLocation,K=V.format,Z=V.offset;_[_.length-1].attributes.push({shaderLocation:G,format:nge(K),offset:Z})}}catch(ve){o={error:ve}}finally{try{B&&!B.done&&(a=L.return)&&a.call(L)}finally{if(o)throw o.error}}}}catch(ve){n={error:ve}}finally{try{A&&!A.done&&(i=b.return)&&i.call(b)}finally{if(n)throw n.error}}return m.indexFormat=tge(f.indexBufferFormat),m.buffers=_,m}return t}(Ac),$9=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a=e.call(this,{id:n,device:i})||this;return a.type=ji.Program,a.vertexStage=null,a.fragmentStage=null,a.computeStage=null,a.descriptor=o,o.vertex&&(a.vertexStage=a.createShaderStage(o.vertex,"vertex")),o.fragment&&(a.fragmentStage=a.createShaderStage(o.fragment,"fragment")),o.compute&&(a.computeStage=a.createShaderStage(o.compute,"compute")),a}return t.prototype.setUniformsLegacy=function(r){},t.prototype.createShaderStage=function(r,n){var i,o,a=r.glsl,u=r.wgsl,c=r.entryPoint,f=r.postprocess,m=!1,_=u;if(!_)try{_=this.device.glsl_compile(a,n,m)}catch(k){throw console.error(k,a),new Error("whoops")}var b=function(k){if(!_.includes(k))return"continue";_=_.replace("var T_".concat(k,": texture_2d<f32>;"),"var T_".concat(k,": texture_depth_2d;")),_=_.replace(new RegExp("textureSample\\(T_".concat(k,"(.*)\\);$"),"gm"),function(L,B){return"vec4<f32>(textureSample(T_".concat(k).concat(B,"), 0.0, 0.0, 0.0);")})};try{for(var A=C1(["u_TextureFramebufferDepth"]),w=A.next();!w.done;w=A.next()){var R=w.value;b(R)}}catch(k){i={error:k}}finally{try{w&&!w.done&&(o=A.return)&&o.call(A)}finally{if(i)throw i.error}}f&&(_=f(_));var P=this.device.device.createShaderModule({code:_});return{module:P,entryPoint:c||"main"}},t}(Ac),fge=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a=e.call(this,{id:n,device:i})||this;a.type=ji.QueryPool;var u=o.elemCount,c=o.type;return a.querySet=a.device.device.createQuerySet({type:G2e(c),count:u}),a.resolveBuffer=a.device.device.createBuffer({size:u*8,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),a.cpuBuffer=a.device.device.createBuffer({size:u*8,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),a.results=null,a}return t.prototype.queryResultOcclusion=function(r){return this.results===null?null:this.results[r]!==BigInt(0)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.querySet.destroy(),this.resolveBuffer.destroy(),this.cpuBuffer.destroy()},t}(Ac),hge=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=e.call(this,{id:n,device:i})||this;return o.type=ji.Readback,o}return t.prototype.readTexture=function(r,n,i,o,a,u,c,f){return c===void 0&&(c=0),t0(this,void 0,void 0,function(){var m,_,b,A,w,R,P,k;return r0(this,function(L){return m=r,_=0,b=qO(m.gpuTextureformat),A=Math.ceil(o/b.width)*b.length,w=Math.ceil(A/256)*256,R=w*a,P=this.device.createBuffer({usage:da.STORAGE|da.MAP_READ|da.COPY_DST,hint:Ec.STATIC,viewOrSize:R}),k=this.device.device.createCommandEncoder(),k.copyTextureToBuffer({texture:m.gpuTexture,mipLevel:0,origin:{x:n,y:i,z:Math.max(_,0)}},{buffer:P.gpuBuffer,offset:0,bytesPerRow:w},{width:o,height:a,depthOrArrayLayers:1}),this.device.device.queue.submit([k.finish()]),[2,this.readBuffer(P,0,u.byteLength===R?u:null,c,R,m.format,!0,!1,A,w,a)]})})},t.prototype.readTextureSync=function(r,n,i,o,a,u,c,f){throw new Error("ERROR_MSG_METHOD_NOT_IMPLEMENTED")},t.prototype.readBuffer=function(r,n,i,o,a,u,c,f,m,_,b){var A=this;n===void 0&&(n=0),i===void 0&&(i=null),a===void 0&&(a=0),u===void 0&&(u=Ke.U8_RGB),c===void 0&&(c=!1),m===void 0&&(m=0),_===void 0&&(_=0),b===void 0&&(b=0);var w=r,R=a||w.size,P=i||w.view,k=P&&P.constructor&&P.constructor.BYTES_PER_ELEMENT||LO(u),L=w;if(!(w.usage&da.MAP_READ&&w.usage&da.COPY_DST)){var B=this.device.device.createCommandEncoder();L=this.device.createBuffer({usage:da.STORAGE|da.MAP_READ|da.COPY_DST,hint:Ec.STATIC,viewOrSize:R}),B.copyBufferToBuffer(w.gpuBuffer,n,L.gpuBuffer,0,R),this.device.device.queue.submit([B.finish()])}return new Promise(function(V,G){L.gpuBuffer.mapAsync($x.READ,n,R).then(function(){var K=L.gpuBuffer.getMappedRange(n,R),Z=P;if(c)Z===null?Z=U9(u,R,!0,K):Z=U9(u,Z.buffer,void 0,K);else if(Z===null)switch(k){case 1:Z=new Uint8Array(R),Z.set(new Uint8Array(K));break;case 2:Z=A.getHalfFloatAsFloatRGBAArrayBuffer(R/2,K);break;case 4:Z=new Float32Array(R/4),Z.set(new Float32Array(K));break}else switch(k){case 1:Z=new Uint8Array(Z.buffer),Z.set(new Uint8Array(K));break;case 2:Z=A.getHalfFloatAsFloatRGBAArrayBuffer(R/2,K,P);break;case 4:var ve=P&&P.constructor||Float32Array;Z=new ve(Z.buffer),Z.set(new ve(K));break}if(m!==_){k===1&&!c&&(m*=2,_*=2);for(var Ie=new Uint8Array(Z.buffer),de=m,se=0,le=1;le<b;++le){se=le*_;for(var ye=0;ye<m;++ye)Ie[de++]=Ie[se++]}k!==0&&!c?Z=new Float32Array(Ie.buffer,0,de/4):Z=new Uint8Array(Ie.buffer,0,de)}L.gpuBuffer.unmap(),V(Z)},function(K){return G(K)})})},t.prototype.getHalfFloatAsFloatRGBAArrayBuffer=function(r,n,i){i||(i=new Float32Array(r));for(var o=new Uint16Array(n);r--;)i[r]=oge(o[r]);return i},t}(Ac),V9=function(){function e(t){this.device=t,this.gpuRenderPassEncoder=null,this.gfxColorAttachment=[],this.gfxColorAttachmentLevel=[],this.gfxColorResolveTo=[],this.gfxColorResolveToLevel=[],this.gfxDepthStencilAttachment=null,this.gfxDepthStencilResolveTo=null,this.gpuColorAttachments=[],this.gpuDepthStencilAttachment={view:null,depthLoadOp:"load",depthStoreOp:"store",stencilLoadOp:"load",stencilStoreOp:"store"},this.gpuRenderPassDescriptor={colorAttachments:this.gpuColorAttachments,depthStencilAttachment:this.gpuDepthStencilAttachment}}return e.prototype.getEncoder=function(){var t;return((t=this.renderBundle)===null||t===void 0?void 0:t.renderBundleEncoder)||this.gpuRenderPassEncoder},e.prototype.getTextureView=function(t,r){return ii(r<t.mipLevelCount),t.mipLevelCount===1?t.gpuTextureView:t.gpuTexture.createView({baseMipLevel:r,mipLevelCount:1})},e.prototype.setRenderPassDescriptor=function(t){var r,n,i,o,a,u;this.descriptor=t,this.gpuRenderPassDescriptor.colorAttachments=this.gpuColorAttachments;var c=t.colorAttachment.length;this.gfxColorAttachment.length=c,this.gfxColorResolveTo.length=c;for(var f=0;f<t.colorAttachment.length;f++){var m=t.colorAttachment[f],_=t.colorResolveTo[f];if(m===null&&_!==null&&(m=_,_=null),this.gfxColorAttachment[f]=m,this.gfxColorResolveTo[f]=_,this.gfxColorAttachmentLevel[f]=((r=t.colorAttachmentLevel)===null||r===void 0?void 0:r[f])||0,this.gfxColorResolveToLevel[f]=((n=t.colorResolveToLevel)===null||n===void 0?void 0:n[f])||0,m!==null){this.gpuColorAttachments[f]===void 0&&(this.gpuColorAttachments[f]={});var b=this.gpuColorAttachments[f];b.view=this.getTextureView(m,((i=this.gfxColorAttachmentLevel)===null||i===void 0?void 0:i[f])||0);var A=(a=(o=t.colorClearColor)===null||o===void 0?void 0:o[f])!==null&&a!==void 0?a:"load";A==="load"?b.loadOp="load":(b.loadOp="clear",b.clearValue=A),b.storeOp=!((u=t.colorStore)===null||u===void 0)&&u[f]?"store":"discard",b.resolveTarget=void 0,_!==null&&(m.sampleCount>1?b.resolveTarget=this.getTextureView(_,this.gfxColorResolveToLevel[f]):b.storeOp="store")}else{this.gpuColorAttachments.length=f,this.gfxColorAttachment.length=f,this.gfxColorResolveTo.length=f;break}}if(this.gfxDepthStencilAttachment=t.depthStencilAttachment,this.gfxDepthStencilResolveTo=t.depthStencilResolveTo,t.depthStencilAttachment){var w=t.depthStencilAttachment,b=this.gpuDepthStencilAttachment;b.view=w.gpuTextureView;var R=!!(g0(w.format)&Wr.Depth);R?(t.depthClearValue==="load"?b.depthLoadOp="load":(b.depthLoadOp="clear",b.depthClearValue=t.depthClearValue),t.depthStencilStore||this.gfxDepthStencilResolveTo!==null?b.depthStoreOp="store":b.depthStoreOp="discard"):(b.depthLoadOp=void 0,b.depthStoreOp=void 0);var P=!!(g0(w.format)&Wr.Stencil);P?(t.stencilClearValue==="load"?b.stencilLoadOp="load":(b.stencilLoadOp="clear",b.stencilClearValue=t.stencilClearValue),t.depthStencilStore||this.gfxDepthStencilResolveTo!==null?b.stencilStoreOp="store":b.stencilStoreOp="discard"):(b.stencilLoadOp=void 0,b.stencilStoreOp=void 0),this.gpuRenderPassDescriptor.depthStencilAttachment=this.gpuDepthStencilAttachment}else this.gpuRenderPassDescriptor.depthStencilAttachment=void 0;this.gpuRenderPassDescriptor.occlusionQuerySet=Xl(t.occlusionQueryPool)?void 0:H2e(t.occlusionQueryPool)},e.prototype.beginRenderPass=function(t,r){ii(this.gpuRenderPassEncoder===null),this.setRenderPassDescriptor(r),this.frameCommandEncoder=t,this.gpuRenderPassEncoder=this.frameCommandEncoder.beginRenderPass(this.gpuRenderPassDescriptor)},e.prototype.flipY=function(t,r){var n=this.device.swapChainHeight;return n-t-r},e.prototype.setViewport=function(t,r,n,i,o,a){o===void 0&&(o=0),a===void 0&&(a=1),this.gpuRenderPassEncoder.setViewport(t,this.flipY(r,i),n,i,o,a)},e.prototype.setScissorRect=function(t,r,n,i){this.gpuRenderPassEncoder.setScissorRect(t,this.flipY(r,i),n,i)},e.prototype.setPipeline=function(t){var r=t,n=g1(r.gpuRenderPipeline);this.getEncoder().setPipeline(n)},e.prototype.setVertexInput=function(t,r,n){if(t!==null){var i=this.getEncoder(),o=t;n!==null&&i.setIndexBuffer(Gd(n.buffer),g1(o.indexFormat),n.offset);for(var a=0;a<r.length;a++){var u=r[a];u!==null&&i.setVertexBuffer(a,Gd(u.buffer),u.offset)}}},e.prototype.setBindings=function(t){var r=t,n=this.getEncoder();r.gpuBindGroup.forEach(function(i,o){i&&n.setBindGroup(o,r.gpuBindGroup[o])})},e.prototype.setStencilReference=function(t){this.gpuRenderPassEncoder.setStencilReference(t)},e.prototype.draw=function(t,r,n,i){this.getEncoder().draw(t,r,n,i)},e.prototype.drawIndexed=function(t,r,n,i,o){this.getEncoder().drawIndexed(t,r,n,i,o)},e.prototype.drawIndirect=function(t,r){this.getEncoder().drawIndirect(Gd(t),r)},e.prototype.drawIndexedIndirect=function(t,r){this.getEncoder().drawIndexedIndirect(Gd(t),r)},e.prototype.beginOcclusionQuery=function(t){this.gpuRenderPassEncoder.beginOcclusionQuery(t)},e.prototype.endOcclusionQuery=function(){this.gpuRenderPassEncoder.endOcclusionQuery()},e.prototype.pushDebugGroup=function(t){this.gpuRenderPassEncoder.pushDebugGroup(t)},e.prototype.popDebugGroup=function(){this.gpuRenderPassEncoder.popDebugGroup()},e.prototype.insertDebugMarker=function(t){this.gpuRenderPassEncoder.insertDebugMarker(t)},e.prototype.beginBundle=function(t){this.renderBundle=t},e.prototype.endBundle=function(){this.renderBundle.finish()},e.prototype.executeBundles=function(t){this.gpuRenderPassEncoder.executeBundles(t.map(function(r){return r.renderBundle}))},e.prototype.finish=function(){var t;(t=this.gpuRenderPassEncoder)===null||t===void 0||t.end(),this.gpuRenderPassEncoder=null;for(var r=0;r<this.gfxColorAttachment.length;r++){var n=this.gfxColorAttachment[r],i=this.gfxColorResolveTo[r];n!==null&&i!==null&&n.sampleCount===1&&this.copyAttachment(i,this.gfxColorAttachmentLevel[r],n,this.gfxColorResolveToLevel[r])}this.gfxDepthStencilAttachment&&this.gfxDepthStencilResolveTo&&(this.gfxDepthStencilAttachment.sampleCount>1||this.copyAttachment(this.gfxDepthStencilResolveTo,0,this.gfxDepthStencilAttachment,0)),this.frameCommandEncoder=null},e.prototype.copyAttachment=function(t,r,n,i){ii(n.sampleCount===1);var o={texture:n.gpuTexture,mipLevel:i},a={texture:t.gpuTexture,mipLevel:r};ii(n.width>>>i===t.width>>>r),ii(n.height>>>i===t.height>>>r),ii(!!(n.usage&es.COPY_SRC)),ii(!!(t.usage&es.COPY_DST)),this.frameCommandEncoder.copyTextureToTexture(o,a,[t.width,t.height,1])},e}(),pge=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a=e.call(this,{id:n,device:i})||this;return a.type=ji.RenderPipeline,a.isCreatingAsync=!1,a.gpuRenderPipeline=null,a.descriptor=o,a.device.createRenderPipelineInternal(a,!1),a}return t.prototype.getBindGroupLayout=function(r){return this.gpuRenderPipeline.getBindGroupLayout(r)},t}(Ac),dge=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a,u,c=e.call(this,{id:n,device:i})||this;c.type=ji.Sampler;var f=o.lodMinClamp,m=o.mipmapFilter===ts.NO_MIP?o.lodMinClamp:o.lodMaxClamp,_=(a=o.maxAnisotropy)!==null&&a!==void 0?a:1;return _>1&&ii(o.minFilter===vo.BILINEAR&&o.magFilter===vo.BILINEAR&&o.mipmapFilter===ts.LINEAR),c.gpuSampler=c.device.device.createSampler({addressModeU:p6(o.addressModeU),addressModeV:p6(o.addressModeV),addressModeW:p6((u=o.addressModeW)!==null&&u!==void 0?u:o.addressModeU),lodMinClamp:f,lodMaxClamp:m,minFilter:F9(o.minFilter),magFilter:F9(o.magFilter),mipmapFilter:V2e(o.mipmapFilter),compare:o.compareFunction!==void 0?zg(o.compareFunction):void 0,maxAnisotropy:_}),c}return t}(Ac),sg=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=r.descriptor,a=r.skipCreate,u=r.sampleCount,c=e.call(this,{id:n,device:i})||this;c.type=ji.Texture,c.flipY=!1;var f=o.format,m=o.dimension,_=o.width,b=o.height,A=o.depthOrArrayLayers,w=o.mipLevelCount,R=o.usage,P=o.pixelStore;return c.flipY=!!(P!=null&&P.unpackFlipY),c.device.createTextureShared({format:f,dimension:m??Ti.TEXTURE_2D,width:_,height:b,depthOrArrayLayers:A??1,mipLevelCount:w??1,usage:R,sampleCount:u??1},c,a),c}return t.prototype.textureFromImageBitmapOrCanvas=function(r,n,i){for(var o=n[0].width,a=n[0].height,u={size:{width:o,height:a,depthOrArrayLayers:i},format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT},c=r.createTexture(u),f=0;f<n.length;f++)r.queue.copyExternalImageToTexture({source:n[f],flipY:this.flipY},{texture:c,origin:[0,0,f]},[o,a]);return[c,o,a]},t.prototype.isImageBitmapOrCanvases=function(r){var n=r[0];return n instanceof ImageBitmap||n instanceof HTMLCanvasElement||n instanceof OffscreenCanvas},t.prototype.isVideo=function(r){var n=r[0];return n instanceof HTMLVideoElement},t.prototype.setImageData=function(r,n){var i,o=this,a=this.device.device,u,c,f;if(this.isImageBitmapOrCanvases(r))i=af(this.textureFromImageBitmapOrCanvas(a,r,this.depthOrArrayLayers),3),u=i[0],c=i[1],f=i[2];else if(this.isVideo(r))u=a.importExternalTexture({source:r[0]});else{var m=qO(this.gpuTextureformat),_=Math.ceil(this.width/m.width)*m.length;r.forEach(function(b){a.queue.writeTexture({texture:o.gpuTexture},b,{bytesPerRow:_},{width:o.width,height:o.height})})}this.width=c,this.height=f,u&&(this.gpuTexture=u),this.gpuTextureView=this.gpuTexture.createView({dimension:z2e(this.dimension)})},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.gpuTexture.destroy()},t}(Ac),vge=function(e){to(t,e);function t(r){var n=r.id,i=r.device,o=e.call(this,{id:n,device:i})||this;return o.type=ji.RenderBundle,o.renderBundleEncoder=o.device.device.createRenderBundleEncoder({colorFormats:[o.device.swapChainFormat]}),o}return t.prototype.finish=function(){this.renderBundle=this.renderBundleEncoder.finish()},t}(Ac),mge=function(){function e(t,r,n,i,o,a){this.swapChainWidth=0,this.swapChainHeight=0,this.swapChainTextureUsage=es.RENDER_ATTACHMENT|es.COPY_DST,this._resourceUniqueId=0,this.renderPassPool=[],this.computePassPool=[],this.frameCommandEncoderPool=[],this.featureTextureCompressionBC=!1,this.platformString="WebGPU",this.glslVersion="#version 440",this.explicitBindingLocations=!0,this.separateSamplerTextures=!0,this.viewportOrigin=vf.UPPER_LEFT,this.clipSpaceNearZ=m0.ZERO,this.supportsSyncPipelineCompilation=!1,this.supportMRT=!0,this.device=r,this.canvas=n,this.canvasContext=i,this.glsl_compile=o,this.WGSLComposer=a,this.fallbackTexture2D=this.createFallbackTexture(Ti.TEXTURE_2D,Qa.Float),this.setResourceName(this.fallbackTexture2D,"Fallback Texture2D"),this.fallbackTexture2DDepth=this.createFallbackTexture(Ti.TEXTURE_2D,Qa.Depth),this.setResourceName(this.fallbackTexture2DDepth,"Fallback Depth Texture2D"),this.fallbackTexture2DArray=this.createFallbackTexture(Ti.TEXTURE_2D_ARRAY,Qa.Float),this.setResourceName(this.fallbackTexture2DArray,"Fallback Texture2DArray"),this.fallbackTexture3D=this.createFallbackTexture(Ti.TEXTURE_3D,Qa.Float),this.setResourceName(this.fallbackTexture3D,"Fallback Texture3D"),this.fallbackTextureCube=this.createFallbackTexture(Ti.TEXTURE_CUBE_MAP,Qa.Float),this.setResourceName(this.fallbackTextureCube,"Fallback TextureCube"),this.fallbackSamplerFiltering=this.createSampler({addressModeU:gu.REPEAT,addressModeV:gu.REPEAT,minFilter:vo.POINT,magFilter:vo.POINT,mipmapFilter:ts.NEAREST}),this.setResourceName(this.fallbackSamplerFiltering,"Fallback Sampler Filtering"),this.fallbackSamplerComparison=this.createSampler({addressModeU:gu.REPEAT,addressModeV:gu.REPEAT,minFilter:vo.POINT,magFilter:vo.POINT,mipmapFilter:ts.NEAREST,compareFunction:Ki.ALWAYS}),this.setResourceName(this.fallbackSamplerComparison,"Fallback Sampler Comparison Filtering"),this.device.features&&(this.featureTextureCompressionBC=this.device.features.has("texture-compression-bc")),this.device.onuncapturederror=function(u){console.error(u.error)},this.swapChainFormat=navigator.gpu.getPreferredCanvasFormat(),this.canvasContext.configure({device:this.device,format:this.swapChainFormat,usage:this.swapChainTextureUsage,alphaMode:"premultiplied"})}return e.prototype.destroy=function(){},e.prototype.configureSwapChain=function(t,r){this.swapChainWidth===t&&this.swapChainHeight===r||(this.swapChainWidth=t,this.swapChainHeight=r)},e.prototype.getOnscreenTexture=function(){var t=this.canvasContext.getCurrentTexture(),r=t.createView(),n=new sg({id:0,device:this,descriptor:{format:Ke.U8_RGBA_RT,width:this.swapChainWidth,height:this.swapChainHeight,depthOrArrayLayers:0,dimension:Ti.TEXTURE_2D,mipLevelCount:1,usage:this.swapChainTextureUsage},skipCreate:!0});return n.depthOrArrayLayers=1,n.sampleCount=1,n.gpuTexture=t,n.gpuTextureView=r,n.name="Onscreen",this.setResourceName(n,"Onscreen Texture"),n},e.prototype.getDevice=function(){return this},e.prototype.getCanvas=function(){return this.canvas},e.prototype.beginFrame=function(){ii(this.frameCommandEncoderPool.length===0)},e.prototype.endFrame=function(){ii(this.frameCommandEncoderPool.every(function(t){return t!==null})),this.device.queue.submit(this.frameCommandEncoderPool.map(function(t){return t.finish()})),this.frameCommandEncoderPool=[]},e.prototype.getNextUniqueId=function(){return++this._resourceUniqueId},e.prototype.createBuffer=function(t){return new uge({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createTexture=function(t){return new sg({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createSampler=function(t){return new dge({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createRenderTarget=function(t){var r=new sg({id:this.getNextUniqueId(),device:this,descriptor:Ka(Ka({},t),{dimension:Ti.TEXTURE_2D,mipLevelCount:1,depthOrArrayLayers:1,usage:nu.RENDER_TARGET}),sampleCount:t.sampleCount});return r.depthOrArrayLayers=1,r.type=ji.RenderTarget,r},e.prototype.createRenderTargetFromTexture=function(t){var r=t,n=r.format,i=r.width,o=r.height,a=r.depthOrArrayLayers,u=r.sampleCount,c=r.mipLevelCount,f=r.gpuTexture,m=r.gpuTextureView,_=r.usage;ii(!!(_&es.RENDER_ATTACHMENT));var b=new sg({id:this.getNextUniqueId(),device:this,descriptor:{format:n,width:i,height:o,depthOrArrayLayers:a,dimension:Ti.TEXTURE_2D,mipLevelCount:c,usage:_},skipCreate:!0});return b.depthOrArrayLayers=a,b.sampleCount=u,b.gpuTexture=f,b.gpuTextureView=m,b},e.prototype.createProgram=function(t){var r,n;return!((r=t.vertex)===null||r===void 0)&&r.glsl&&(t.vertex.glsl=x0(this.queryVendorInfo(),"vert",t.vertex.glsl)),!((n=t.fragment)===null||n===void 0)&&n.glsl&&(t.fragment.glsl=x0(this.queryVendorInfo(),"frag",t.fragment.glsl)),new $9({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createProgramSimple=function(t){return new $9({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createTextureShared=function(t,r,n){var i={width:t.width,height:t.height,depthOrArrayLayers:t.depthOrArrayLayers},o=t.mipLevelCount,a=Sb(t.format),u=U2e(t.dimension),c=N2e(t.usage);if(r.gpuTextureformat=a,r.dimension=t.dimension,r.format=t.format,r.width=t.width,r.height=t.height,r.depthOrArrayLayers=t.depthOrArrayLayers,r.mipLevelCount=o,r.usage=c,r.sampleCount=t.sampleCount,!n){var f=this.device.createTexture({size:i,mipLevelCount:o,format:a,dimension:u,sampleCount:t.sampleCount,usage:c}),m=f.createView();r.gpuTexture=f,r.gpuTextureView=m}},e.prototype.getFallbackSampler=function(t){var r=t.formatKind;return r===Qa.Depth&&t.comparison?this.fallbackSamplerComparison:this.fallbackSamplerFiltering},e.prototype.getFallbackTexture=function(t){var r=t.dimension,n=t.formatKind;if(r===Ti.TEXTURE_2D)return n===Qa.Depth?this.fallbackTexture2DDepth:this.fallbackTexture2D;if(r===Ti.TEXTURE_2D_ARRAY)return this.fallbackTexture2DArray;if(r===Ti.TEXTURE_3D)return this.fallbackTexture3D;if(r===Ti.TEXTURE_CUBE_MAP)return this.fallbackTextureCube;throw new Error("whoops")},e.prototype.createFallbackTexture=function(t,r){var n=t===Ti.TEXTURE_CUBE_MAP?6:1,i=r===Qa.Float?Ke.U8_RGBA_NORM:Ke.D24;return this.createTexture({dimension:t,format:i,usage:nu.SAMPLED,width:1,height:1,depthOrArrayLayers:n,mipLevelCount:1})},e.prototype.createBindings=function(t){return new sge({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createInputLayout=function(t){return new cge({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createComputePipeline=function(t){return new lge({id:this.getNextUniqueId(),device:this,descriptor:t})},e.prototype.createRenderPipeline=function(t){return new pge({id:this.getNextUniqueId(),device:this,descriptor:Ka({},t)})},e.prototype.createQueryPool=function(t,r){return new fge({id:this.getNextUniqueId(),device:this,descriptor:{type:t,elemCount:r}})},e.prototype.createRenderPipelineInternal=function(t,r){var n;if(t.gpuRenderPipeline===null){var i=t.descriptor,o=i.program,a=o.vertexStage,u=o.fragmentStage;if(!(a===null||u===null)){var c=i.megaStateDescriptor||{},f=c.stencilBack,m=c.stencilFront,_=Eme(c,["stencilBack","stencilFront"]),b=_0(y0);i.megaStateDescriptor=Ka(Ka(Ka({},b),{stencilBack:Ka(Ka({},b.stencilBack),f),stencilFront:Ka(Ka({},b.stencilFront),m)}),_);var A=i.megaStateDescriptor.attachmentsState[0];i.colorAttachmentFormats.forEach(function(V,G){i.megaStateDescriptor.attachmentsState[G]||(i.megaStateDescriptor.attachmentsState[G]=VO(void 0,A))});var w=Z2e((n=i.topology)!==null&&n!==void 0?n:Fo.TRIANGLES,i.megaStateDescriptor),R=J2e(i.colorAttachmentFormats,i.megaStateDescriptor),P=ege(i.depthStencilAttachmentFormat,i.megaStateDescriptor),k=void 0;i.inputLayout!==null&&(k=i.inputLayout.buffers);var L=i.sampleCount,B={layout:"auto",vertex:Ka(Ka({},a),{buffers:k}),primitive:w,depthStencil:P,multisample:{count:L},fragment:Ka(Ka({},u),{targets:R})};t.gpuRenderPipeline=this.device.createRenderPipeline(B)}}},e.prototype.createReadback=function(){return new hge({id:this.getNextUniqueId(),device:this})},e.prototype.createRenderBundle=function(){return new vge({id:this.getNextUniqueId(),device:this})},e.prototype.createRenderPass=function(t){var r=this.renderPassPool.pop();r===void 0&&(r=new V9(this));var n=this.frameCommandEncoderPool.pop();return n===void 0&&(n=this.device.createCommandEncoder()),r.beginRenderPass(n,t),r},e.prototype.createComputePass=function(){var t=this.computePassPool.pop();t===void 0&&(t=new z9);var r=this.frameCommandEncoderPool.pop();return r===void 0&&(r=this.device.createCommandEncoder()),t.beginComputePass(r),t},e.prototype.submitPass=function(t){var r=t;r instanceof V9?(this.frameCommandEncoderPool.push(r.frameCommandEncoder),r.finish(),this.renderPassPool.push(r)):r instanceof z9&&(this.frameCommandEncoderPool.push(r.frameCommandEncoder),r.finish(),this.computePassPool.push(r))},e.prototype.copySubTexture2D=function(t,r,n,i,o,a,u){var c=this.device.createCommandEncoder(),f=t,m=i,_={texture:m.gpuTexture,origin:[o,a,0],mipLevel:0,aspect:"all"},b={texture:f.gpuTexture,origin:[r,n,0],mipLevel:0,aspect:"all"};ii(!!(m.usage&es.COPY_SRC)),ii(!!(f.usage&es.COPY_DST)),c.copyTextureToTexture(_,b,[m.width,m.height,u||1]),this.device.queue.submit([c.finish()])},e.prototype.queryLimits=function(){return{uniformBufferMaxPageWordSize:this.device.limits.maxUniformBufferBindingSize>>>2,uniformBufferWordAlignment:this.device.limits.minUniformBufferOffsetAlignment>>>2,supportedSampleCounts:[1],occlusionQueriesRecommended:!0,computeShadersSupported:!0}},e.prototype.queryTextureFormatSupported=function(t,r,n){if(ige(t)){if(!this.featureTextureCompressionBC)return!1;var i=age(t);return r%i!==0||n%i!==0?!1:this.featureTextureCompressionBC}switch(t){case Ke.U16_RGBA_NORM:return!1;case Ke.F32_RGBA:return!1}return!0},e.prototype.queryPlatformAvailable=function(){return!0},e.prototype.queryVendorInfo=function(){return this},e.prototype.queryRenderPass=function(t){var r=t;return r.descriptor},e.prototype.queryRenderTarget=function(t){var r=t;return r},e.prototype.setResourceName=function(t,r){if(t.name=r,t.type===ji.Buffer){var n=t;n.gpuBuffer.label=r}else if(t.type===ji.Texture){var n=t;n.gpuTexture.label=r,n.gpuTextureView.label=r}else if(t.type===ji.RenderTarget){var n=t;n.gpuTexture.label=r,n.gpuTextureView.label=r}else if(t.type===ji.Sampler){var n=t;n.gpuSampler.label=r}else if(t.type===ji.RenderPipeline){var n=t;n.gpuRenderPipeline!==null&&(n.gpuRenderPipeline.label=r)}},e.prototype.setResourceLeakCheck=function(t,r){},e.prototype.checkForLeaks=function(){},e.prototype.programPatched=function(t){},e.prototype.pipelineQueryReady=function(t){var r=t;return r.gpuRenderPipeline!==null},e.prototype.pipelineForceReady=function(t){var r=t;this.createRenderPipelineInternal(r,!1)},e}(),gge=function(){function e(t){this.pluginOptions=t}return e.prototype.createSwapChain=function(t){return t0(this,void 0,void 0,function(){var r,n,i,o,a,u,c,f;return r0(this,function(m){switch(m.label){case 0:if(globalThis.navigator.gpu===void 0)return[2,null];r=null,m.label=1;case 1:return m.trys.push([1,3,,4]),n=this.pluginOptions.xrCompatible,[4,globalThis.navigator.gpu.requestAdapter({xrCompatible:n})];case 2:return r=m.sent(),[3,4];case 3:return i=m.sent(),console.log(i),[3,4];case 4:return r===null?[2,null]:(o=["depth32float-stencil8","texture-compression-bc","float32-filterable"],a=o.filter(function(_){return r.features.has(_)}),[4,r.requestDevice({requiredFeatures:a})]);case 5:if(u=m.sent(),u&&(c=this.pluginOptions.onContextLost,u.lost.then(function(){c&&c()})),u===null)return[2,null];if(f=t.getContext("webgpu"),!f)return[2,null];m.label=6;case 6:return m.trys.push([6,8,,9]),[4,ZO(this.pluginOptions.shaderCompilerPath)];case 7:return m.sent(),[3,9];case 8:return m.sent(),[3,9];case 9:return[2,new mge(r,u,t,f,D2e,Nm&&new Nm)]}})})},e}(),_ge=function(){function e(t,r){Ht(this,e);var n=r.buffer,i=r.offset,o=r.stride,a=r.normalized,u=r.size,c=r.divisor,f=r.shaderLocation;this.buffer=n,this.attribute={shaderLocation:f,buffer:n.get(),offset:i||0,stride:o||0,normalized:a||!1,divisor:c||0},u&&(this.attribute.size=u)}return jt(e,[{key:"get",value:function(){return this.buffer}},{key:"updateBuffer",value:function(r){this.buffer.subData(r)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),e}(),rp,qf,kd,Fv,Bv,Kc,ug,c1,Fs,Qc,Jc,C_=(rp={},F(rp,W.FLOAT,Float32Array),F(rp,W.UNSIGNED_BYTE,Uint8Array),F(rp,W.SHORT,Int16Array),F(rp,W.UNSIGNED_SHORT,Uint16Array),F(rp,W.INT,Int32Array),F(rp,W.UNSIGNED_INT,Uint32Array),rp),yge=(qf={},F(qf,W.POINTS,Fo.POINTS),F(qf,W.LINES,Fo.LINES),F(qf,W.LINE_LOOP,Fo.LINES),F(qf,W.LINE_STRIP,Fo.LINE_STRIP),F(qf,W.TRIANGLES,Fo.TRIANGLES),F(qf,W.TRIANGLE_FAN,Fo.TRIANGLES),F(qf,W.TRIANGLE_STRIP,Fo.TRIANGLE_STRIP),qf),xge=(kd={},F(kd,1,Ke.F32_R),F(kd,2,Ke.F32_RG),F(kd,3,Ke.F32_RGB),F(kd,4,Ke.F32_RGBA),kd),bge=(Fv={},F(Fv,W.STATIC_DRAW,Ec.STATIC),F(Fv,W.DYNAMIC_DRAW,Ec.DYNAMIC),F(Fv,W.STREAM_DRAW,Ec.DYNAMIC),Fv),j9=(Bv={},F(Bv,W.REPEAT,gu.REPEAT),F(Bv,W.CLAMP_TO_EDGE,gu.CLAMP_TO_EDGE),F(Bv,W.MIRRORED_REPEAT,gu.MIRRORED_REPEAT),Bv),Ege=(Kc={},F(Kc,W.NEVER,Ki.NEVER),F(Kc,W.ALWAYS,Ki.ALWAYS),F(Kc,W.LESS,Ki.LESS),F(Kc,W.LEQUAL,Ki.LEQUAL),F(Kc,W.GREATER,Ki.GREATER),F(Kc,W.GEQUAL,Ki.GEQUAL),F(Kc,W.EQUAL,Ki.EQUAL),F(Kc,W.NOTEQUAL,Ki.NOTEQUAL),Kc),Sge=(ug={},F(ug,W.FRONT,Uu.FRONT),F(ug,W.BACK,Uu.BACK),ug),H9=(c1={},F(c1,W.FUNC_ADD,hs.ADD),F(c1,W.MIN_EXT,hs.MIN),F(c1,W.MAX_EXT,hs.MAX),F(c1,W.FUNC_SUBTRACT,hs.SUBSTRACT),F(c1,W.FUNC_REVERSE_SUBTRACT,hs.REVERSE_SUBSTRACT),c1),lg=(Fs={},F(Fs,W.ZERO,Ai.ZERO),F(Fs,W.ONE,Ai.ONE),F(Fs,W.SRC_COLOR,Ai.SRC),F(Fs,W.ONE_MINUS_SRC_COLOR,Ai.ONE_MINUS_SRC),F(Fs,W.SRC_ALPHA,Ai.SRC_ALPHA),F(Fs,W.ONE_MINUS_SRC_ALPHA,Ai.ONE_MINUS_SRC_ALPHA),F(Fs,W.DST_COLOR,Ai.DST),F(Fs,W.ONE_MINUS_DST_COLOR,Ai.ONE_MINUS_DST),F(Fs,W.DST_ALPHA,Ai.DST_ALPHA),F(Fs,W.ONE_MINUS_DST_ALPHA,Ai.ONE_MINUS_DST_ALPHA),F(Fs,W.CONSTANT_COLOR,Ai.CONST),F(Fs,W.ONE_MINUS_CONSTANT_COLOR,Ai.ONE_MINUS_CONSTANT),F(Fs,W.CONSTANT_ALPHA,Ai.CONST),F(Fs,W.ONE_MINUS_CONSTANT_ALPHA,Ai.ONE_MINUS_CONSTANT),F(Fs,W.SRC_ALPHA_SATURATE,Ai.SRC_ALPHA_SATURATE),Fs),Dd=(Qc={},F(Qc,W.REPLACE,eo.REPLACE),F(Qc,W.KEEP,eo.KEEP),F(Qc,W.ZERO,eo.ZERO),F(Qc,W.INVERT,eo.INVERT),F(Qc,W.INCR,eo.INCREMENT_CLAMP),F(Qc,W.DECR,eo.DECREMENT_CLAMP),F(Qc,W.INCR_WRAP,eo.INCREMENT_WRAP),F(Qc,W.DECR_WRAP,eo.DECREMENT_WRAP),Qc),Age=(Jc={},F(Jc,W.ALWAYS,Ki.ALWAYS),F(Jc,W.EQUAL,Ki.EQUAL),F(Jc,W.GEQUAL,Ki.GEQUAL),F(Jc,W.GREATER,Ki.GREATER),F(Jc,W.LEQUAL,Ki.LEQUAL),F(Jc,W.LESS,Ki.LESS),F(Jc,W.NEVER,Ki.NEVER),F(Jc,W.NOTEQUAL,Ki.NOTEQUAL),Jc),Tge={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121};function R_(e){return Object.prototype.toString.call(e)in Tge}function wge(e,t){for(var r=e.length,n=Math.ceil(r/3),i=r+n,o=new Float32Array(i),a=0;a<i;a+=4)o[a]=e[a/4*3],o[a+1]=e[a/4*3+1],o[a+2]=e[a/4*3+2],o[a+3]=t;return o}var Cge=function(){function e(t,r){Ht(this,e),F(this,"isDestroyed",!1);var n=r.data,i=r.usage,o=r.type,a=r.isUBO,u=r.label,c;R_(n)?c=n:c=new C_[this.type||W.FLOAT](n),this.type=o,this.size=c.byteLength,this.buffer=t.createBuffer({viewOrSize:c,usage:a?da.UNIFORM:da.VERTEX,hint:bge[i||W.STATIC_DRAW]}),u&&t.setResourceName(this.buffer,u)}return jt(e,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.isDestroyed||this.buffer.destroy(),this.isDestroyed=!0}},{key:"subData",value:function(r){var n=r.data,i=r.offset,o;R_(n)?o=n:o=new C_[this.type||W.FLOAT](n),this.buffer.setSubData(i,new Uint8Array(o.buffer))}}]),e}();function G9(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Rge(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Rge(e,t){if(e){if(typeof e=="string")return W9(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return W9(e,t)}}function W9(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ji(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e+=t,e+=e<<10,e+=e>>>6,e>>>0}function KO(e){return e+=e<<3,e^=e>>>11,e+=e<<15,e>>>0}function X9(e){return 0}var Ige=jt(function e(){Ht(this,e),F(this,"keys",[]),F(this,"values",[])}),cg=function(){function e(t,r){Ht(this,e),F(this,"buckets",new Map),this.keyEqualFunc=t,this.keyHashFunc=r}return jt(e,[{key:"findBucketIndex",value:function(r,n){for(var i=0;i<r.keys.length;i++)if(this.keyEqualFunc(n,r.keys[i]))return i;return-1}},{key:"findBucket",value:function(r){var n=this.keyHashFunc(r);return this.buckets.get(n)}},{key:"get",value:function(r){var n=this.findBucket(r);if(n===void 0)return null;var i=this.findBucketIndex(n,r);return i<0?null:n.values[i]}},{key:"add",value:function(r,n){var i=this.keyHashFunc(r);this.buckets.get(i)===void 0&&this.buckets.set(i,new Ige);var o=this.buckets.get(i);o.keys.push(r),o.values.push(n)}},{key:"delete",value:function(r){var n=this.findBucket(r);if(n!==void 0){var i=this.findBucketIndex(n,r);i!==-1&&(n.keys.splice(i,1),n.values.splice(i,1))}}},{key:"clear",value:function(){this.buckets.clear()}},{key:"size",value:function(){var r=0,n=G9(this.buckets.values()),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;r+=o.values.length}}catch(a){n.e(a)}finally{n.f()}return r}},{key:"values",value:he.mark(function t(){var r,n,i,o;return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=G9(this.buckets.values()),u.prev=1,r.s();case 3:if((n=r.n()).done){u.next=14;break}i=n.value,o=i.values.length-1;case 6:if(!(o>=0)){u.next=12;break}return u.next=9,i.values[o];case 9:o--,u.next=6;break;case 12:u.next=3;break;case 14:u.next=19;break;case 16:u.prev=16,u.t0=u.catch(1),r.e(u.t0);case 19:return u.prev=19,r.f(),u.finish(19);case 22:case"end":return u.stop()}},t,this,[[1,16,19,22]])})}]),e}();function fg(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Mge(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,u;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){a=!0,u=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}}}function Mge(e,t){if(e){if(typeof e=="string")return Y9(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Y9(e,t)}}function Y9(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Z9(e,t){return e=Ji(e,t.blendMode),e=Ji(e,t.blendSrcFactor),e=Ji(e,t.blendDstFactor),e}function Pge(e,t){return e=Z9(e,t.rgbBlendState),e=Z9(e,t.alphaBlendState),e=Ji(e,t.channelWriteMask),e}function Oge(e,t){return e=Ji(e,t.r<<24|t.g<<16|t.b<<8|t.a),e}function kge(e,t){for(var r,n,i,o,a,u,c,f,m=0;m<t.attachmentsState.length;m++)e=Pge(e,t.attachmentsState[m]);return e=Oge(e,t.blendConstant||xy),e=Ji(e,t.depthCompare),e=Ji(e,t.depthWrite?1:0),e=Ji(e,(r=t.stencilFront)===null||r===void 0?void 0:r.compare),e=Ji(e,(n=t.stencilFront)===null||n===void 0?void 0:n.passOp),e=Ji(e,(i=t.stencilFront)===null||i===void 0?void 0:i.failOp),e=Ji(e,(o=t.stencilFront)===null||o===void 0?void 0:o.depthFailOp),e=Ji(e,(a=t.stencilBack)===null||a===void 0?void 0:a.compare),e=Ji(e,(u=t.stencilBack)===null||u===void 0?void 0:u.passOp),e=Ji(e,(c=t.stencilBack)===null||c===void 0?void 0:c.failOp),e=Ji(e,(f=t.stencilBack)===null||f===void 0?void 0:f.depthFailOp),e=Ji(e,t.stencilWrite?1:0),e=Ji(e,t.cullMode),e=Ji(e,t.frontFace?1:0),e=Ji(e,t.polygonOffset?1:0),e}function Dge(e){var t=0;t=Ji(t,e.program.id),e.inputLayout!==null&&(t=Ji(t,e.inputLayout.id)),t=kge(t,e.megaStateDescriptor);for(var r=0;r<e.colorAttachmentFormats.length;r++)t=Ji(t,e.colorAttachmentFormats[r]||0);return t=Ji(t,e.depthStencilAttachmentFormat||0),KO(t)}function Fge(e){var t=0;if(e.samplerBindings)for(var r=0;r<e.samplerBindings.length;r++){var n=e.samplerBindings[r];n!==null&&n.texture!==null&&(t=Ji(t,n.texture.id))}if(e.uniformBufferBindings)for(var i=0;i<e.uniformBufferBindings.length;i++){var o=e.uniformBufferBindings[i];o!==null&&o.buffer!==null&&(t=Ji(t,o.buffer.id),t=Ji(t,o.binding),t=Ji(t,o.offset),t=Ji(t,o.size))}if(e.storageBufferBindings)for(var a=0;a<e.storageBufferBindings.length;a++){var u=e.storageBufferBindings[a];u!==null&&u.buffer!==null&&(t=Ji(t,u.buffer.id),t=Ji(t,u.binding),t=Ji(t,u.offset),t=Ji(t,u.size))}if(e.storageTextureBindings)for(var c=0;c<e.storageTextureBindings.length;c++){var f=e.storageTextureBindings[c];f!==null&&f.texture!==null&&(t=Ji(t,f.texture.id),t=Ji(t,f.binding))}return KO(t)}function Bge(e,t){var r,n,i,o;return((r=e.vertex)===null||r===void 0?void 0:r.glsl)===((n=t.vertex)===null||n===void 0?void 0:n.glsl)&&((i=e.fragment)===null||i===void 0?void 0:i.glsl)===((o=t.fragment)===null||o===void 0?void 0:o.glsl)}function Lge(e){var t,r;return{vertex:{glsl:(t=e.vertex)===null||t===void 0?void 0:t.glsl},fragment:{glsl:(r=e.fragment)===null||r===void 0?void 0:r.glsl}}}var Nge=function(){function e(t){Ht(this,e),F(this,"bindingsCache",new cg(Dme,Fge)),F(this,"renderPipelinesCache",new cg(Nme,Dge)),F(this,"inputLayoutsCache",new cg($me,X9)),F(this,"programCache",new cg(Bge,X9)),this.device=t}return jt(e,[{key:"createBindings",value:function(r){var n=this.bindingsCache.get(r);if(n===null){var i,o=Hme(r);o.uniformBufferBindings=(i=o.uniformBufferBindings)===null||i===void 0?void 0:i.filter(function(a){var u=a.size;return u&&u>0}),n=this.device.createBindings(o),this.bindingsCache.add(o,n)}return n}},{key:"createRenderPipeline",value:function(r){var n=this.renderPipelinesCache.get(r);if(n===null){var i=Gme(r);i.colorAttachmentFormats=i.colorAttachmentFormats.filter(function(o){return o}),n=this.device.createRenderPipeline(i),this.renderPipelinesCache.add(i,n)}return n}},{key:"createInputLayout",value:function(r){r.vertexBufferDescriptors=r.vertexBufferDescriptors.filter(function(o){return!!o});var n=this.inputLayoutsCache.get(r);if(n===null){var i=Yme(r);n=this.device.createInputLayout(i),this.inputLayoutsCache.add(i,n)}return n}},{key:"createProgram",value:function(r){var n=this.programCache.get(r);if(n===null){var i=Lge(r);n=this.device.createProgram(r),this.programCache.add(i,n)}return n}},{key:"destroy",value:function(){var r=fg(this.bindingsCache.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.destroy()}}catch(w){r.e(w)}finally{r.f()}var o=fg(this.renderPipelinesCache.values()),a;try{for(o.s();!(a=o.n()).done;){var u=a.value;u.destroy()}}catch(w){o.e(w)}finally{o.f()}var c=fg(this.inputLayoutsCache.values()),f;try{for(c.s();!(f=c.n()).done;){var m=f.value;m.destroy()}}catch(w){c.e(w)}finally{c.f()}var _=fg(this.programCache.values()),b;try{for(_.s();!(b=_.n()).done;){var A=b.value;A.destroy()}}catch(w){_.e(w)}finally{_.f()}this.bindingsCache.clear(),this.renderPipelinesCache.clear(),this.inputLayoutsCache.clear(),this.programCache.clear()}}]),e}(),Uge=function(){function e(t,r){Ht(this,e);var n=r.data,i=r.type,o=r.count,a=o===void 0?0:o,u;R_(n)?u=n:u=new C_[this.type||W.UNSIGNED_INT](n),this.type=i,this.count=a,this.indexBuffer=t.createBuffer({viewOrSize:u,usage:da.INDEX})}return jt(e,[{key:"get",value:function(){return this.indexBuffer}},{key:"subData",value:function(r){var n=r.data,i;R_(n)?i=n:i=new C_[this.type||W.UNSIGNED_INT](n),this.indexBuffer.setSubData(0,new Uint8Array(i.buffer))}},{key:"destroy",value:function(){this.indexBuffer.destroy()}}]),e}();function q9(e){return!!(e&&e.texture)}var QO=function(){function e(t,r){Ht(this,e),F(this,"isDestroy",!1),this.device=t,this.options=r;var n=r.wrapS,i=n===void 0?W.CLAMP_TO_EDGE:n,o=r.wrapT,a=o===void 0?W.CLAMP_TO_EDGE:o,u=r.aniso;r.mipmap;var c=r.mag,f=c===void 0?W.NEAREST:c,m=r.min,_=m===void 0?W.NEAREST:m;this.createTexture(r),this.sampler=t.createSampler({addressModeU:j9[i],addressModeV:j9[a],minFilter:_===W.NEAREST?vo.POINT:vo.BILINEAR,magFilter:f===W.NEAREST?vo.POINT:vo.BILINEAR,mipmapFilter:ts.NO_MIP,maxAnisotropy:u})}return jt(e,[{key:"createTexture",value:function(r){var n=r.type,i=n===void 0?W.UNSIGNED_BYTE:n,o=r.width,a=r.height,u=r.flipY,c=u===void 0?!1:u,f=r.format,m=f===void 0?W.RGBA:f;r.aniso;var _=r.alignment,b=_===void 0?1:_,A=r.usage,w=A===void 0?fx.SAMPLED:A,R=r.unorm,P=R===void 0?!1:R,k=r.label,L=r.data;this.width=o,this.height=a;var B=Ke.U8_RGBA_RT;if(i===W.UNSIGNED_BYTE&&m===W.RGBA)B=P?Ke.U8_RGBA_NORM:Ke.U8_RGBA_RT;else if(i===W.UNSIGNED_BYTE&&m===W.LUMINANCE)B=Ke.U8_LUMINANCE;else if(i===W.FLOAT&&m===W.RGB)this.device.queryVendorInfo().platformString==="WebGPU"?(L&&(L=wge(L,0)),B=Ke.F32_RGBA):B=Ke.F32_RGB;else if(i===W.FLOAT&&m===W.RGBA)B=Ke.F32_RGBA;else if(i===W.FLOAT&&m===W.RED)B=Ke.F32_R;else throw new Error("create texture error, type: ".concat(i,", format: ").concat(m));this.texture=this.device.createTexture({format:B,width:o,height:a,usage:w===fx.SAMPLED?nu.SAMPLED:nu.RENDER_TARGET,pixelStore:{unpackFlipY:c,packAlignment:b},mipLevelCount:1}),k&&this.device.setResourceName(this.texture,k),L&&this.texture.setImageData([L])}},{key:"get",value:function(){return this.texture}},{key:"update",value:function(r){var n=r.data;this.texture.setImageData([n])}},{key:"bind",value:function(){}},{key:"resize",value:function(r){var n=r.width,i=r.height;(this.width!==n||this.height!==i)&&this.destroy(),this.options.width=n,this.options.height=i,this.createTexture(this.options),this.isDestroy=!1}},{key:"getSize",value:function(){return[this.width,this.height]}},{key:"destroy",value:function(){if(!this.isDestroy&&!this.texture.destroyed){var r;(r=this.texture)===null||r===void 0||r.destroy()}this.isDestroy=!0}}]),e}(),JO=function(){function e(t,r){Ht(this,e),this.device=t,this.options=r,this.createColorRenderTarget(),this.createDepthRenderTarget()}return jt(e,[{key:"createColorRenderTarget",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=this.options,i=n.width,o=n.height,a=n.color;a&&(q9(a)?(r&&a.resize({width:i,height:o}),this.colorTexture=a.get(),this.colorRenderTarget=this.device.createRenderTargetFromTexture(this.colorTexture),this.width=a.width,this.height=a.height):i&&o&&(this.colorTexture=this.device.createTexture({format:Ke.U8_RGBA_RT,usage:nu.RENDER_TARGET,width:i,height:o}),this.colorRenderTarget=this.device.createRenderTargetFromTexture(this.colorTexture),this.width=i,this.height=o))}},{key:"createDepthRenderTarget",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=this.options,i=n.width,o=n.height,a=n.depth;a&&(q9(a)?(r&&a.resize({width:i,height:o}),this.depthTexture=a.get(),this.depthRenderTarget=this.device.createRenderTargetFromTexture(this.depthTexture),this.width=a.width,this.height=a.height):i&&o&&(this.depthTexture=this.device.createTexture({format:Ke.D24_S8,usage:nu.RENDER_TARGET,width:i,height:o}),this.depthRenderTarget=this.device.createRenderTargetFromTexture(this.depthTexture),this.width=i,this.height=o))}},{key:"get",value:function(){return this.colorRenderTarget}},{key:"destroy",value:function(){var r,n;(r=this.colorRenderTarget)===null||r===void 0||r.destroy(),(n=this.depthRenderTarget)===null||n===void 0||n.destroy()}},{key:"resize",value:function(r){var n=r.width,i=r.height;(this.width!==n||this.height!==i)&&(this.destroy(),this.colorTexture.destroyed=!0,this.depthTexture.destroyed=!0,this.options.width=n,this.options.height=i,this.createColorRenderTarget(!0),this.createDepthRenderTarget(!0))}}]),e}(),zge=Ci.isPlainObject,$ge=Ci.isTypedArray,Vge=function(){function e(t,r,n){var i=this;Ht(this,e),F(this,"destroyed",!1),F(this,"uniforms",{}),F(this,"vertexBuffers",[]),this.device=t,this.options=r,this.service=n;var o=r.vs,a=r.fs,u=r.attributes,c=r.uniforms,f=r.count,m=r.elements,_=r.diagnosticDerivativeUniformityEnabled;this.options=r;var b=_?"":this.service.viewportOrigin===vf.UPPER_LEFT?"diagnostic(off,derivative_uniformity);":"";this.program=n.renderCache.createProgram({vertex:{glsl:o},fragment:{glsl:a,postprocess:function(k){return b+k}}}),c&&(this.uniforms=this.extractUniforms(c));var A=[],w=0;Object.keys(u).forEach(function(P){var k=u[P],L=k.get();i.vertexBuffers.push(L.get());var B=k.attribute,V=B.offset,G=V===void 0?0:V,K=B.stride,Z=K===void 0?0:K,ve=B.size,Ie=ve===void 0?1:ve,de=B.divisor,se=de===void 0?0:de,le=B.shaderLocation,ye=le===void 0?0:le;A.push({arrayStride:Z||Ie*4,stepMode:R1.VERTEX,attributes:[{format:xge[Ie],shaderLocation:ye,offset:G,divisor:se}]}),w=L.size/Ie}),f||(this.options.count=w),m&&(this.indexBuffer=m.get());var R=n.renderCache.createInputLayout({vertexBufferDescriptors:A,indexBufferFormat:m?Ke.U32_R:null,program:this.program});this.inputLayout=R,this.pipeline=this.createPipeline(r)}return jt(e,[{key:"createPipeline",value:function(r,n){var i=r.primitive,o=i===void 0?W.TRIANGLES:i,a=r.depth,u=r.cull,c=r.blend,f=r.stencil,m=this.initDepthDrawParams({depth:a}),_=!!(m&&m.enable),b=this.initCullDrawParams({cull:u}),A=!!(b&&b.enable),w=this.getBlendDrawParams({blend:c}),R=!!(w&&w.enable),P=this.getStencilDrawParams({stencil:f}),k=!!(P&&P.enable);return this.device.createRenderPipeline({inputLayout:this.inputLayout,program:this.program,topology:yge[o],colorAttachmentFormats:[Ke.U8_RGBA_RT],depthStencilAttachmentFormat:Ke.D24_S8,megaStateDescriptor:{attachmentsState:[n?{channelWriteMask:fs.ALL,rgbBlendState:{blendMode:hs.ADD,blendSrcFactor:Ai.ONE,blendDstFactor:Ai.ZERO},alphaBlendState:{blendMode:hs.ADD,blendSrcFactor:Ai.ONE,blendDstFactor:Ai.ZERO}}:{channelWriteMask:k&&P.opFront.zpass===eo.REPLACE?fs.NONE:fs.ALL,rgbBlendState:{blendMode:R&&w.equation.rgb||hs.ADD,blendSrcFactor:R&&w.func.srcRGB||Ai.SRC_ALPHA,blendDstFactor:R&&w.func.dstRGB||Ai.ONE_MINUS_SRC_ALPHA},alphaBlendState:{blendMode:R&&w.equation.alpha||hs.ADD,blendSrcFactor:R&&w.func.srcAlpha||Ai.ONE,blendDstFactor:R&&w.func.dstAlpha||Ai.ONE}}],blendConstant:R?xy:void 0,depthWrite:_,depthCompare:_&&m.func||Ki.LESS,cullMode:A&&b.face||Uu.NONE,stencilWrite:k,stencilFront:{compare:k?P.func.cmp:Ki.ALWAYS,passOp:P.opFront.zpass,failOp:P.opFront.fail,depthFailOp:P.opFront.zfail,mask:P.opFront.mask},stencilBack:{compare:k?P.func.cmp:Ki.ALWAYS,passOp:P.opBack.zpass,failOp:P.opBack.fail,depthFailOp:P.opBack.zfail,mask:P.opBack.mask}}})}},{key:"updateAttributesAndElements",value:function(){}},{key:"updateAttributes",value:function(){}},{key:"addUniforms",value:function(r){this.uniforms=Qe(Qe({},this.uniforms),this.extractUniforms(r))}},{key:"draw",value:function(r,n){var i=this,o=Qe(Qe({},this.options),r),a=o.count,u=a===void 0?0:a,c=o.instances,f=o.elements,m=o.uniforms,_=m===void 0?{}:m,b=o.uniformBuffers,A=o.textures;this.uniforms=Qe(Qe({},this.uniforms),this.extractUniforms(_));var w=this.service,R=w.renderPass,P=w.currentFramebuffer,k=w.width,L=w.height,B=w.renderCache;this.pipeline=this.createPipeline(o,n);var V=this.service.device,G=V.swapChainHeight;if(V.swapChainHeight=(P==null?void 0:P.height)||L,R.setViewport(0,0,(P==null?void 0:P.width)||k,(P==null?void 0:P.height)||L),V.swapChainHeight=G,R.setPipeline(this.pipeline),R.setStencilReference(1),R.setVertexInput(this.inputLayout,this.vertexBuffers.map(function(Z){return{buffer:Z}}),f?{buffer:this.indexBuffer,offset:0}:null),b&&(this.bindings=B.createBindings({pipeline:this.pipeline,uniformBufferBindings:b.map(function(Z,ve){var Ie=Z;return{binding:ve,buffer:Ie.get(),size:Ie.size}}),samplerBindings:A==null?void 0:A.map(function(Z){return{texture:Z.texture,sampler:Z.sampler}})})),this.bindings&&(R.setBindings(this.bindings),Object.keys(this.uniforms).forEach(function(Z){var ve=i.uniforms[Z];ve instanceof QO?i.uniforms[Z]=ve.get():ve instanceof JO&&(i.uniforms[Z]=ve.get().texture)}),this.program.setUniformsLegacy(this.uniforms)),f){var K=f.count;K===0?R.draw(u,c):R.drawIndexed(K,c)}else R.draw(u,c)}},{key:"destroy",value:function(){var r,n,i;this.program.destroy(),(r=this.vertexBuffers)===null||r===void 0||r.forEach(function(o){return o.destroy()}),(n=this.indexBuffer)===null||n===void 0||n.destroy(),(i=this.bindings)===null||i===void 0||i.destroy(),this.inputLayout.destroy(),this.pipeline.destroy(),this.destroyed=!0}},{key:"initDepthDrawParams",value:function(r){var n=r.depth;if(n)return{enable:n.enable===void 0?!0:!!n.enable,mask:n.mask===void 0?!0:!!n.mask,func:Ege[n.func||W.LESS],range:n.range||[0,1]}}},{key:"getBlendDrawParams",value:function(r){var n=r.blend,i=n||{},o=i.enable,a=i.func,u=i.equation,c=i.color,f=c===void 0?[0,0,0,0]:c;return{enable:!!o,func:{srcRGB:lg[a&&a.srcRGB||W.SRC_ALPHA],srcAlpha:lg[a&&a.srcAlpha||W.SRC_ALPHA],dstRGB:lg[a&&a.dstRGB||W.ONE_MINUS_SRC_ALPHA],dstAlpha:lg[a&&a.dstAlpha||W.ONE_MINUS_SRC_ALPHA]},equation:{rgb:H9[u&&u.rgb||W.FUNC_ADD],alpha:H9[u&&u.alpha||W.FUNC_ADD]},color:f}}},{key:"getStencilDrawParams",value:function(r){var n=r.stencil,i=n||{},o=i.enable,a=i.mask,u=a===void 0?4294967295:a,c=i.func,f=c===void 0?{cmp:W.ALWAYS,ref:0,mask:4294967295}:c,m=i.opFront,_=m===void 0?{fail:W.KEEP,zfail:W.KEEP,zpass:W.KEEP}:m,b=i.opBack,A=b===void 0?{fail:W.KEEP,zfail:W.KEEP,zpass:W.KEEP}:b;return{enable:!!o,mask:u,func:Qe(Qe({},f),{},{cmp:Age[f.cmp]}),opFront:{fail:Dd[_.fail],zfail:Dd[_.zfail],zpass:Dd[_.zpass],mask:f.mask},opBack:{fail:Dd[A.fail],zfail:Dd[A.zfail],zpass:Dd[A.zpass],mask:f.mask}}}},{key:"initCullDrawParams",value:function(r){var n=r.cull;if(n){var i=n.enable,o=n.face,a=o===void 0?W.BACK:o;return{enable:!!i,face:Sge[a]}}}},{key:"extractUniforms",value:function(r){var n=this,i={};return Object.keys(r).forEach(function(o){n.extractUniformsRecursively(o,r[o],i,"")}),i}},{key:"extractUniformsRecursively",value:function(r,n,i,o){var a=this;if(n===null||typeof n=="number"||typeof n=="boolean"||Array.isArray(n)&&typeof n[0]=="number"||$ge(n)||n===""||"resize"in n){i["".concat(o&&o+".").concat(r)]=n;return}zge(n)&&Object.keys(n).forEach(function(u){a.extractUniformsRecursively(u,n[u],i,"".concat(o&&o+".").concat(r))}),Array.isArray(n)&&n.forEach(function(u,c){Object.keys(u).forEach(function(f){a.extractUniformsRecursively(f,u[f],i,"".concat(o&&o+".").concat(r,"[").concat(c,"]"))})})}}]),e}();function jge(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:!!(e&&e._version===2)}var K9,Q9,hg=Ci.isUndefined,Hge=(K9=ai(),K9(Q9=function(){function e(){var t=this;Ht(this,e),F(this,"uniformBuffers",[]),F(this,"queryVerdorInfo",function(){return t.device.queryVendorInfo().platformString}),F(this,"createModel",function(r){return new Vge(t.device,r,t)}),F(this,"createAttribute",function(r){return new _ge(t.device,r)}),F(this,"createBuffer",function(r){return new Cge(t.device,r)}),F(this,"createElements",function(r){return new Uge(t.device,r)}),F(this,"createTexture2D",function(r){return new QO(t.device,r)}),F(this,"createFramebuffer",function(r){return new JO(t.device,r)}),F(this,"useFramebuffer",function(r,n){t.currentFramebuffer=r,t.beginFrame(),n(),t.endFrame(),t.currentFramebuffer=null}),F(this,"useFramebufferAsync",function(){var r=Mt(he.mark(function n(i,o){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return t.currentFramebuffer=i,t.preRenderPass=t.renderPass,t.beginFrame(),u.next=5,o();case 5:t.endFrame(),t.currentFramebuffer=null,t.renderPass=t.preRenderPass;case 8:case"end":return u.stop()}},n)}));return function(n,i){return r.apply(this,arguments)}}()),F(this,"clear",function(r){var n=r.color,i=r.depth,o=r.stencil,a=r.framebuffer,u=a===void 0?null:a;if(u)u.clearOptions={color:n,depth:i,stencil:o};else{var c=t.queryVerdorInfo();if(c==="WebGL1"){var f=t.getGLContext();hg(o)?hg(i)||(f.clearDepth(i),f.clear(f.DEPTH_BUFFER_BIT)):(f.clearStencil(o),f.clear(f.STENCIL_BUFFER_BIT))}else if(c==="WebGL2"){var m=t.getGLContext();hg(o)?hg(i)||m.clearBufferfv(m.DEPTH,0,[i]):m.clearBufferiv(m.STENCIL,0,[o])}}}),F(this,"viewport",function(r){var n=r.width,i=r.height;t.swapChain.configureSwapChain(n,i),t.createMainColorDepthRT(n,i),t.width=n,t.height=i}),F(this,"readPixels",function(r){var n=r.framebuffer,i=r.x,o=r.y,a=r.width,u=r.height,c=t.device.createReadback(),f=n.colorTexture,m=c.readTextureSync(f,i,t.viewportOrigin===vf.LOWER_LEFT?o:t.height-o,a,u,new Uint8Array(a*u*4));return c.destroy(),m}),F(this,"readPixelsAsync",function(){var r=Mt(he.mark(function n(i){var o,a,u,c,f,m,_,b,A,w;return he.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return o=i.framebuffer,a=i.x,u=i.y,c=i.width,f=i.height,m=t.device.createReadback(),_=o.colorTexture,P.next=5,m.readTexture(_,a,t.viewportOrigin===vf.LOWER_LEFT?u:t.height-u,c,f,new Uint8Array(c*f*4));case 5:if(b=P.sent,t.viewportOrigin!==vf.LOWER_LEFT)for(A=0;A<b.length;A+=4)w=b[A],b[A]=b[A+2],b[A+2]=w;return m.destroy(),P.abrupt("return",b);case 9:case"end":return P.stop()}},n)}));return function(n){return r.apply(this,arguments)}}()),F(this,"getViewportSize",function(){return{width:t.width,height:t.height}}),F(this,"getContainer",function(){var r;return(r=t.canvas)===null||r===void 0?void 0:r.parentElement}),F(this,"getCanvas",function(){return t.canvas}),F(this,"getGLContext",function(){return t.device.gl}),F(this,"destroy",function(){var r;t.canvas=null,(r=t.uniformBuffers)===null||r===void 0||r.forEach(function(n){n.destroy()}),t.device.destroy(),t.renderCache.destroy()})}return jt(e,[{key:"init",value:function(){var t=Mt(he.mark(function n(i,o){var a,u,c,f,m;return he.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return a=o.enableWebGPU,u=o.shaderCompilerPath,this.canvas=i,c=a?new gge({shaderCompilerPath:u}):new I2e({targets:["webgl2","webgl1"],onContextLost:function(w){console.warn("context lost",w)},onContextCreationError:function(w){console.warn("context creation error",w)},onContextRestored:function(w){console.warn("context restored",w)}}),b.next=5,c.createSwapChain(i);case 5:f=b.sent,f.configureSwapChain(i.width,i.height),this.device=f.getDevice(),this.swapChain=f,this.renderCache=new Nge(this.device),this.currentFramebuffer=null,this.viewportOrigin=this.device.queryVendorInfo().viewportOrigin,m=this.device.gl,this.extensionObject={OES_texture_float:!jge(m)&&this.device.OES_texture_float},this.createMainColorDepthRT(i.width,i.height);case 15:case"end":return b.stop()}},n,this)}));function r(n,i){return t.apply(this,arguments)}return r}()},{key:"createMainColorDepthRT",value:function(r,n){this.mainColorRT&&this.mainColorRT.destroy(),this.mainDepthRT&&this.mainDepthRT.destroy(),this.mainColorRT=this.device.createRenderTargetFromTexture(this.device.createTexture({format:Ke.U8_RGBA_RT,width:r,height:n,usage:nu.RENDER_TARGET})),this.mainDepthRT=this.device.createRenderTargetFromTexture(this.device.createTexture({format:Ke.D24_S8,width:r,height:n,usage:nu.RENDER_TARGET}))}},{key:"beginFrame",value:function(){this.device.beginFrame();var r=this.currentFramebuffer,n=this.swapChain,i=this.mainColorRT,o=this.mainDepthRT,a=r?r.colorRenderTarget:i,u=r?null:n.getOnscreenTexture(),c=r?r.depthRenderTarget:o,f=(r==null?void 0:r.clearOptions)||{},m=f.color,_=m===void 0?[0,0,0,0]:m,b=f.depth,A=b===void 0?1:b,w=f.stencil,R=w===void 0?0:w,P=a?Jm(_[0]*255,_[1]*255,_[2]*255,_[3]):xy,k=c?A:void 0,L=c?R:void 0,B=this.device.createRenderPass({colorAttachment:[a],colorResolveTo:[u],colorClearColor:[P],colorStore:[!0],depthStencilAttachment:c,depthClearValue:k,stencilClearValue:L});this.renderPass=B}},{key:"endFrame",value:function(){this.device.submitPass(this.renderPass),this.device.endFrame()}},{key:"getPointSizeRange",value:function(){var r=this.device.gl;return r.getParameter(r.ALIASED_POINT_SIZE_RANGE)}},{key:"testExtension",value:function(r){return!!this.getGLContext().getExtension(r)}},{key:"setState",value:function(){}},{key:"setBaseState",value:function(){}},{key:"setCustomLayerDefaults",value:function(){}},{key:"setDirty",value:function(r){this.isDirty=r}},{key:"getDirty",value:function(){return this.isDirty}}]),e}())||Q9),ek={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(_c,function(){var r=function(U){return U instanceof Uint8Array||U instanceof Uint16Array||U instanceof Uint32Array||U instanceof Int8Array||U instanceof Int16Array||U instanceof Int32Array||U instanceof Float32Array||U instanceof Float64Array||U instanceof Uint8ClampedArray},n=function(U,fe){for(var Me=Object.keys(fe),gt=0;gt<Me.length;++gt)U[Me[gt]]=fe[Me[gt]];return U},i=`
|
|
`;function o(U){return typeof atob<"u"?atob(U):"base64:"+U}function a(U){var fe=new Error("(regl) "+U);throw console.error(fe),fe}function u(U,fe){U||a(fe)}function c(U){return U?": "+U:""}function f(U,fe,Me){U in fe||a("unknown parameter ("+U+")"+c(Me)+". possible values: "+Object.keys(fe).join())}function m(U,fe){r(U)||a("invalid parameter type"+c(fe)+". must be a typed array")}function _(U,fe){switch(fe){case"number":return typeof U=="number";case"object":return typeof U=="object";case"string":return typeof U=="string";case"boolean":return typeof U=="boolean";case"function":return typeof U=="function";case"undefined":return typeof U>"u";case"symbol":return typeof U=="symbol"}}function b(U,fe,Me){_(U,fe)||a("invalid parameter type"+c(Me)+". expected "+fe+", got "+typeof U)}function A(U,fe){U>=0&&(U|0)===U||a("invalid parameter type, ("+U+")"+c(fe)+". must be a nonnegative integer")}function w(U,fe,Me){fe.indexOf(U)<0&&a("invalid value"+c(Me)+". must be one of: "+fe)}var R=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function P(U){Object.keys(U).forEach(function(fe){R.indexOf(fe)<0&&a('invalid regl constructor argument "'+fe+'". must be one of '+R)})}function k(U,fe){for(U=U+"";U.length<fe;)U=" "+U;return U}function L(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function B(U,fe){this.number=U,this.line=fe,this.errors=[]}function V(U,fe,Me){this.file=U,this.line=fe,this.message=Me}function G(){var U=new Error,fe=(U.stack||U).toString(),Me=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(fe);if(Me)return Me[1];var gt=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(fe);return gt?gt[1]:"unknown"}function K(){var U=new Error,fe=(U.stack||U).toString(),Me=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(fe);if(Me)return Me[1];var gt=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(fe);return gt?gt[1]:"unknown"}function Z(U,fe){var Me=U.split(`
|
|
`),gt=1,zt=0,xt={unknown:new L,0:new L};xt.unknown.name=xt[0].name=fe||G(),xt.unknown.lines.push(new B(0,""));for(var lt=0;lt<Me.length;++lt){var gr=Me[lt],sr=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(gr);if(sr)switch(sr[1]){case"line":var Ir=/(\d+)(\s+\d+)?/.exec(sr[2]);Ir&&(gt=Ir[1]|0,Ir[2]&&(zt=Ir[2]|0,zt in xt||(xt[zt]=new L)));break;case"define":var xr=/SHADER_NAME(_B64)?\s+(.*)$/.exec(sr[2]);xr&&(xt[zt].name=xr[1]?o(xr[2]):xr[2]);break}xt[zt].lines.push(new B(gt++,gr))}return Object.keys(xt).forEach(function(wr){var Or=xt[wr];Or.lines.forEach(function(cr){Or.index[cr.number]=cr})}),xt}function ve(U){var fe=[];return U.split(`
|
|
`).forEach(function(Me){if(!(Me.length<5)){var gt=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(Me);gt?fe.push(new V(gt[1]|0,gt[2]|0,gt[3].trim())):Me.length>0&&fe.push(new V("unknown",0,Me))}}),fe}function Ie(U,fe){fe.forEach(function(Me){var gt=U[Me.file];if(gt){var zt=gt.index[Me.line];if(zt){zt.errors.push(Me),gt.hasErrors=!0;return}}U.unknown.hasErrors=!0,U.unknown.lines[0].errors.push(Me)})}function de(U,fe,Me,gt,zt){if(!U.getShaderParameter(fe,U.COMPILE_STATUS)){var xt=U.getShaderInfoLog(fe),lt=gt===U.FRAGMENT_SHADER?"fragment":"vertex";Gt(Me,"string",lt+" shader source must be a string",zt);var gr=Z(Me,zt),sr=ve(xt);Ie(gr,sr),Object.keys(gr).forEach(function(Ir){var xr=gr[Ir];if(!xr.hasErrors)return;var wr=[""],Or=[""];function cr(Cr,rt){wr.push(Cr),Or.push(rt||"")}cr("file number "+Ir+": "+xr.name+`
|
|
`,"color:red;text-decoration:underline;font-weight:bold"),xr.lines.forEach(function(Cr){if(Cr.errors.length>0){cr(k(Cr.number,4)+"| ","background-color:yellow; font-weight:bold"),cr(Cr.line+i,"color:red; background-color:yellow; font-weight:bold");var rt=0;Cr.errors.forEach(function(Pt){var _r=Pt.message,Nr=/^\s*'(.*)'\s*:\s*(.*)$/.exec(_r);if(Nr){var Jt=Nr[1];switch(_r=Nr[2],Jt){case"assign":Jt="=";break}rt=Math.max(Cr.line.indexOf(Jt,rt),0)}else rt=0;cr(k("| ",6)),cr(k("^^^",rt+3)+i,"font-weight:bold"),cr(k("| ",6)),cr(_r+i,"font-weight:bold")}),cr(k("| ",6)+i)}else cr(k(Cr.number,4)+"| "),cr(Cr.line+i,"color:red")}),typeof document<"u"&&!window.chrome?(Or[0]=wr.join("%c"),console.log.apply(console,Or)):console.log(wr.join(""))}),u.raise("Error compiling "+lt+" shader, "+gr[0].name)}}function se(U,fe,Me,gt,zt){if(!U.getProgramParameter(fe,U.LINK_STATUS)){var xt=U.getProgramInfoLog(fe),lt=Z(Me,zt),gr=Z(gt,zt),sr='Error linking program with vertex shader, "'+gr[0].name+'", and fragment shader "'+lt[0].name+'"';typeof document<"u"?console.log("%c"+sr+i+"%c"+xt,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(sr+i+xt),u.raise(sr)}}function le(U){U._commandRef=G()}function ye(U,fe,Me,gt){le(U);function zt(sr){return sr?gt.id(sr):0}U._fragId=zt(U.static.frag),U._vertId=zt(U.static.vert);function xt(sr,Ir){Object.keys(Ir).forEach(function(xr){sr[gt.id(xr)]=!0})}var lt=U._uniformSet={};xt(lt,fe.static),xt(lt,fe.dynamic);var gr=U._attributeSet={};xt(gr,Me.static),xt(gr,Me.dynamic),U._hasCount="count"in U.static||"count"in U.dynamic||"elements"in U.static||"elements"in U.dynamic}function ke(U,fe){var Me=K();a(U+" in command "+(fe||G())+(Me==="unknown"?"":" called from "+Me))}function Rt(U,fe,Me){U||ke(fe,Me||G())}function Lt(U,fe,Me,gt){U in fe||ke("unknown parameter ("+U+")"+c(Me)+". possible values: "+Object.keys(fe).join(),gt||G())}function Gt(U,fe,Me,gt){_(U,fe)||ke("invalid parameter type"+c(Me)+". expected "+fe+", got "+typeof U,gt||G())}function Zt(U){U()}function st(U,fe,Me){U.texture?w(U.texture._texture.internalformat,fe,"unsupported texture format for attachment"):w(U.renderbuffer._renderbuffer.format,Me,"unsupported renderbuffer format for attachment")}var tt=33071,dt=9728,nt=9984,pr=9985,ur=9986,Ar=9987,Xn=5120,pn=5121,gi=5122,Je=5123,Qt=5124,Xr=5125,Ut=5126,ge=32819,Be=32820,ft=33635,At=34042,bt=36193,$t={};$t[Xn]=$t[pn]=1,$t[gi]=$t[Je]=$t[bt]=$t[ft]=$t[ge]=$t[Be]=2,$t[Qt]=$t[Xr]=$t[Ut]=$t[At]=4;function Mr(U,fe){return U===Be||U===ge||U===ft?2:U===At?4:$t[U]*fe}function tr(U){return!(U&U-1)&&!!U}function lr(U,fe,Me){var gt,zt=fe.width,xt=fe.height,lt=fe.channels;u(zt>0&&zt<=Me.maxTextureSize&&xt>0&&xt<=Me.maxTextureSize,"invalid texture shape"),(U.wrapS!==tt||U.wrapT!==tt)&&u(tr(zt)&&tr(xt),"incompatible wrap mode for texture, both width and height must be power of 2"),fe.mipmask===1?zt!==1&&xt!==1&&u(U.minFilter!==nt&&U.minFilter!==ur&&U.minFilter!==pr&&U.minFilter!==Ar,"min filter requires mipmap"):(u(tr(zt)&&tr(xt),"texture must be a square power of 2 to support mipmapping"),u(fe.mipmask===(zt<<1)-1,"missing or incomplete mipmap data")),fe.type===Ut&&(Me.extensions.indexOf("oes_texture_float_linear")<0&&u(U.minFilter===dt&&U.magFilter===dt,"filter not supported, must enable oes_texture_float_linear"),u(!U.genMipmaps,"mipmap generation not supported with float textures"));var gr=fe.images;for(gt=0;gt<16;++gt)if(gr[gt]){var sr=zt>>gt,Ir=xt>>gt;u(fe.mipmask&1<<gt,"missing mipmap data");var xr=gr[gt];if(u(xr.width===sr&&xr.height===Ir,"invalid shape for mip images"),u(xr.format===fe.format&&xr.internalformat===fe.internalformat&&xr.type===fe.type,"incompatible type for mip image"),!xr.compressed)if(xr.data){var wr=Math.ceil(Mr(xr.type,lt)*sr/xr.unpackAlignment)*xr.unpackAlignment;u(xr.data.byteLength===wr*Ir,"invalid data for image, buffer size is inconsistent with image format")}else xr.element||xr.copy}else U.genMipmaps||u((fe.mipmask&1<<gt)===0,"extra mipmap data");fe.compressed&&u(!U.genMipmaps,"mipmap generation for compressed images not supported")}function or(U,fe,Me,gt){var zt=U.width,xt=U.height,lt=U.channels;u(zt>0&&zt<=gt.maxTextureSize&&xt>0&&xt<=gt.maxTextureSize,"invalid texture shape"),u(zt===xt,"cube map must be square"),u(fe.wrapS===tt&&fe.wrapT===tt,"wrap mode not supported by cube map");for(var gr=0;gr<Me.length;++gr){var sr=Me[gr];u(sr.width===zt&&sr.height===xt,"inconsistent cube map face shape"),fe.genMipmaps&&(u(!sr.compressed,"can not generate mipmap for compressed textures"),u(sr.mipmask===1,"can not specify mipmaps and generate mipmaps"));for(var Ir=sr.images,xr=0;xr<16;++xr){var wr=Ir[xr];if(wr){var Or=zt>>xr,cr=xt>>xr;u(sr.mipmask&1<<xr,"missing mipmap data"),u(wr.width===Or&&wr.height===cr,"invalid shape for mip images"),u(wr.format===U.format&&wr.internalformat===U.internalformat&&wr.type===U.type,"incompatible type for mip image"),wr.compressed||(wr.data?u(wr.data.byteLength===Or*cr*Math.max(Mr(wr.type,lt),wr.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):wr.element||wr.copy)}}}}var Q=n(u,{optional:Zt,raise:a,commandRaise:ke,command:Rt,parameter:f,commandParameter:Lt,constructor:P,type:b,commandType:Gt,isTypedArray:m,nni:A,oneOf:w,shaderError:de,linkError:se,callSite:K,saveCommandRef:le,saveDrawInfo:ye,framebufferFormat:st,guessCommand:G,texture2D:lr,textureCube:or}),Ge=0,at=0;function yt(U,fe){this.id=Ge++,this.type=U,this.data=fe}function rr(U){return U.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function hr(U){if(U.length===0)return[];var fe=U.charAt(0),Me=U.charAt(U.length-1);if(U.length>1&&fe===Me&&(fe==='"'||fe==="'"))return['"'+rr(U.substr(1,U.length-2))+'"'];var gt=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(U);if(gt)return hr(U.substr(0,gt.index)).concat(hr(gt[1])).concat(hr(U.substr(gt.index+gt[0].length)));var zt=U.split(".");if(zt.length===1)return['"'+rr(U)+'"'];for(var xt=[],lt=0;lt<zt.length;++lt)xt=xt.concat(hr(zt[lt]));return xt}function Cn(U){return"["+hr(U).join("][")+"]"}function rn(U,fe){return new yt(U,Cn(fe+""))}function Ne(U){return typeof U=="function"&&!U._reglType||U instanceof yt}function qe(U,fe){return typeof U=="function"?new yt(at,U):U}var ct={DynamicVariable:yt,define:rn,isDynamic:Ne,unbox:qe,accessor:Cn},Vt={next:typeof requestAnimationFrame=="function"?function(U){return requestAnimationFrame(U)}:function(U){return setTimeout(U,16)},cancel:typeof cancelAnimationFrame=="function"?function(U){return cancelAnimationFrame(U)}:clearTimeout},Qr=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function Jn(){var U={"":0},fe=[""];return{id:function(Me){var gt=U[Me];return gt||(gt=U[Me]=fe.length,fe.push(Me),gt)},str:function(Me){return fe[Me]}}}function Ri(U,fe,Me){var gt=document.createElement("canvas");n(gt.style,{border:0,margin:0,padding:0,top:0,left:0}),U.appendChild(gt),U===document.body&&(gt.style.position="absolute",n(U.style,{margin:0,padding:0}));function zt(){var gr=window.innerWidth,sr=window.innerHeight;if(U!==document.body){var Ir=U.getBoundingClientRect();gr=Ir.right-Ir.left,sr=Ir.bottom-Ir.top}gt.width=Me*gr,gt.height=Me*sr,n(gt.style,{width:gr+"px",height:sr+"px"})}var xt;U!==document.body&&typeof ResizeObserver=="function"?(xt=new ResizeObserver(function(){setTimeout(zt)}),xt.observe(U)):window.addEventListener("resize",zt,!1);function lt(){xt?xt.disconnect():window.removeEventListener("resize",zt),U.removeChild(gt)}return zt(),{canvas:gt,onDestroy:lt}}function qn(U,fe){function Me(gt){try{return U.getContext(gt,fe)}catch{return null}}return Me("webgl")||Me("experimental-webgl")||Me("webgl-experimental")}function en(U){return typeof U.nodeName=="string"&&typeof U.appendChild=="function"&&typeof U.getBoundingClientRect=="function"}function fn(U){return typeof U.drawArrays=="function"||typeof U.drawElements=="function"}function an(U){return typeof U=="string"?U.split():(Q(Array.isArray(U),"invalid extension array"),U)}function un(U){return typeof U=="string"?(Q(typeof document<"u","not supported outside of DOM"),document.querySelector(U)):U}function ti(U){var fe=U||{},Me,gt,zt,xt,lt={},gr=[],sr=[],Ir=typeof window>"u"?1:window.devicePixelRatio,xr=!1,wr=function(Cr){Cr&&Q.raise(Cr)},Or=function(){};if(typeof fe=="string"?(Q(typeof document<"u","selector queries only supported in DOM enviroments"),Me=document.querySelector(fe),Q(Me,"invalid query string for element")):typeof fe=="object"?en(fe)?Me=fe:fn(fe)?(xt=fe,zt=xt.canvas):(Q.constructor(fe),"gl"in fe?xt=fe.gl:"canvas"in fe?zt=un(fe.canvas):"container"in fe&&(gt=un(fe.container)),"attributes"in fe&&(lt=fe.attributes,Q.type(lt,"object","invalid context attributes")),"extensions"in fe&&(gr=an(fe.extensions)),"optionalExtensions"in fe&&(sr=an(fe.optionalExtensions)),"onDone"in fe&&(Q.type(fe.onDone,"function","invalid or missing onDone callback"),wr=fe.onDone),"profile"in fe&&(xr=!!fe.profile),"pixelRatio"in fe&&(Ir=+fe.pixelRatio,Q(Ir>0,"invalid pixel ratio"))):Q.raise("invalid arguments to regl"),Me&&(Me.nodeName.toLowerCase()==="canvas"?zt=Me:gt=Me),!xt){if(!zt){Q(typeof document<"u","must manually specify webgl context outside of DOM environments");var cr=Ri(gt||document.body,wr,Ir);if(!cr)return null;zt=cr.canvas,Or=cr.onDestroy}lt.premultipliedAlpha===void 0&&(lt.premultipliedAlpha=!0),xt=qn(zt,lt)}return xt?{gl:xt,canvas:zt,container:gt,extensions:gr,optionalExtensions:sr,pixelRatio:Ir,profile:xr,onDone:wr,onDestroy:Or}:(Or(),wr("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function Hi(U,fe){var Me={};function gt(lt){Q.type(lt,"string","extension name must be string");var gr=lt.toLowerCase(),sr;try{sr=Me[gr]=U.getExtension(gr)}catch{}return!!sr}for(var zt=0;zt<fe.extensions.length;++zt){var xt=fe.extensions[zt];if(!gt(xt))return fe.onDestroy(),fe.onDone('"'+xt+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return fe.optionalExtensions.forEach(gt),{extensions:Me,restore:function(){Object.keys(Me).forEach(function(lt){if(Me[lt]&&!gt(lt))throw new Error("(regl): error restoring extension "+lt)})}}}function Fn(U,fe){for(var Me=Array(U),gt=0;gt<U;++gt)Me[gt]=fe(gt);return Me}var j=5120,Y=5121,J=5122,ce=5123,Ee=5124,je=5125,Ye=5126;function ie(U){for(var fe=16;fe<=1<<28;fe*=16)if(U<=fe)return fe;return 0}function Ce(U){var fe,Me;return fe=(U>65535)<<4,U>>>=fe,Me=(U>255)<<3,U>>>=Me,fe|=Me,Me=(U>15)<<2,U>>>=Me,fe|=Me,Me=(U>3)<<1,U>>>=Me,fe|=Me,fe|U>>1}function it(){var U=Fn(8,function(){return[]});function fe(xt){var lt=ie(xt),gr=U[Ce(lt)>>2];return gr.length>0?gr.pop():new ArrayBuffer(lt)}function Me(xt){U[Ce(xt.byteLength)>>2].push(xt)}function gt(xt,lt){var gr=null;switch(xt){case j:gr=new Int8Array(fe(lt),0,lt);break;case Y:gr=new Uint8Array(fe(lt),0,lt);break;case J:gr=new Int16Array(fe(2*lt),0,lt);break;case ce:gr=new Uint16Array(fe(2*lt),0,lt);break;case Ee:gr=new Int32Array(fe(4*lt),0,lt);break;case je:gr=new Uint32Array(fe(4*lt),0,lt);break;case Ye:gr=new Float32Array(fe(4*lt),0,lt);break;default:return null}return gr.length!==lt?gr.subarray(0,lt):gr}function zt(xt){Me(xt.buffer)}return{alloc:fe,free:Me,allocType:gt,freeType:zt}}var Nt=it();Nt.zero=it();var vr=3408,Ot=3410,ar=3411,tn=3412,qr=3413,Dt=3414,zr=3415,Rr=33901,Pr=33902,Hn=3379,Lr=3386,ci=34921,Gi=36347,oi=36348,_i=35661,Gn=35660,ka=34930,hi=36349,Wi=34076,Ii=34024,Wn=7936,si=7937,To=7938,dl=35724,wa=34047,fa=36063,vl=34852,$s=3553,sa=34067,Hu=34069,ro=33984,ua=6408,Ca=5126,Qi=5121,Go=36160,Bo=36053,yf=36064,vs=16384,Tp=function(U,fe){var Me=1;fe.ext_texture_filter_anisotropic&&(Me=U.getParameter(wa));var gt=1,zt=1;fe.webgl_draw_buffers&&(gt=U.getParameter(vl),zt=U.getParameter(fa));var xt=!!fe.oes_texture_float;if(xt){var lt=U.createTexture();U.bindTexture($s,lt),U.texImage2D($s,0,ua,1,1,0,ua,Ca,null);var gr=U.createFramebuffer();if(U.bindFramebuffer(Go,gr),U.framebufferTexture2D(Go,yf,$s,lt,0),U.bindTexture($s,null),U.checkFramebufferStatus(Go)!==Bo)xt=!1;else{U.viewport(0,0,1,1),U.clearColor(1,0,0,1),U.clear(vs);var sr=Nt.allocType(Ca,4);U.readPixels(0,0,1,1,ua,Ca,sr),U.getError()?xt=!1:(U.deleteFramebuffer(gr),U.deleteTexture(lt),xt=sr[0]===1),Nt.freeType(sr)}}var Ir=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),xr=!0;if(!Ir){var wr=U.createTexture(),Or=Nt.allocType(Qi,36);U.activeTexture(ro),U.bindTexture(sa,wr),U.texImage2D(Hu,0,ua,3,3,0,ua,Qi,Or),Nt.freeType(Or),U.bindTexture(sa,null),U.deleteTexture(wr),xr=!U.getError()}return{colorBits:[U.getParameter(Ot),U.getParameter(ar),U.getParameter(tn),U.getParameter(qr)],depthBits:U.getParameter(Dt),stencilBits:U.getParameter(zr),subpixelBits:U.getParameter(vr),extensions:Object.keys(fe).filter(function(cr){return!!fe[cr]}),maxAnisotropic:Me,maxDrawbuffers:gt,maxColorAttachments:zt,pointSizeDims:U.getParameter(Rr),lineWidthDims:U.getParameter(Pr),maxViewportDims:U.getParameter(Lr),maxCombinedTextureUnits:U.getParameter(_i),maxCubeMapSize:U.getParameter(Wi),maxRenderbufferSize:U.getParameter(Ii),maxTextureUnits:U.getParameter(ka),maxTextureSize:U.getParameter(Hn),maxAttributes:U.getParameter(ci),maxVertexUniforms:U.getParameter(Gi),maxVertexTextureUnits:U.getParameter(Gn),maxVaryingVectors:U.getParameter(oi),maxFragmentUniforms:U.getParameter(hi),glsl:U.getParameter(dl),renderer:U.getParameter(si),vendor:U.getParameter(Wn),version:U.getParameter(To),readFloat:xt,npotTextureCube:xr}};function ee(U){return!!U&&typeof U=="object"&&Array.isArray(U.shape)&&Array.isArray(U.stride)&&typeof U.offset=="number"&&U.shape.length===U.stride.length&&(Array.isArray(U.data)||r(U.data))}var ue=function(U){return Object.keys(U).map(function(fe){return U[fe]})},Ue={shape:mo,flatten:La};function _t(U,fe,Me){for(var gt=0;gt<fe;++gt)Me[gt]=U[gt]}function Sr(U,fe,Me,gt){for(var zt=0,xt=0;xt<fe;++xt)for(var lt=U[xt],gr=0;gr<Me;++gr)gt[zt++]=lt[gr]}function hn(U,fe,Me,gt,zt,xt){for(var lt=xt,gr=0;gr<fe;++gr)for(var sr=U[gr],Ir=0;Ir<Me;++Ir)for(var xr=sr[Ir],wr=0;wr<gt;++wr)zt[lt++]=xr[wr]}function Ei(U,fe,Me,gt,zt){for(var xt=1,lt=Me+1;lt<fe.length;++lt)xt*=fe[lt];var gr=fe[Me];if(fe.length-Me===4){var sr=fe[Me+1],Ir=fe[Me+2],xr=fe[Me+3];for(lt=0;lt<gr;++lt)hn(U[lt],sr,Ir,xr,gt,zt),zt+=xt}else for(lt=0;lt<gr;++lt)Ei(U[lt],fe,Me+1,gt,zt),zt+=xt}function La(U,fe,Me,gt){var zt=1;if(fe.length)for(var xt=0;xt<fe.length;++xt)zt*=fe[xt];else zt=0;var lt=gt||Nt.allocType(Me,zt);switch(fe.length){case 0:break;case 1:_t(U,fe[0],lt);break;case 2:Sr(U,fe[0],fe[1],lt);break;case 3:hn(U,fe[0],fe[1],fe[2],lt,0);break;default:Ei(U,fe,0,lt,0)}return lt}function mo(U){for(var fe=[],Me=U;Me.length;Me=Me[0])fe.push(Me.length);return fe}var no={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},Vs=5120,F1=5122,B1=5124,Tc=5121,wp=5123,xf=5125,L1=5126,hh=5126,wo={int8:Vs,int16:F1,int32:B1,uint8:Tc,uint16:wp,uint32:xf,float:L1,float32:hh},ml=35048,gl=35040,yu={dynamic:ml,stream:gl,static:35044},xu=Ue.flatten,Gu=Ue.shape,bf=35044,ms=35040,Ra=5121,_l=5126,Wu=[];Wu[5120]=1,Wu[5122]=2,Wu[5124]=4,Wu[5121]=1,Wu[5123]=2,Wu[5125]=4,Wu[5126]=4;function ph(U){return no[Object.prototype.toString.call(U)]|0}function N1(U,fe){for(var Me=0;Me<fe.length;++Me)U[Me]=fe[Me]}function dh(U,fe,Me,gt,zt,xt,lt){for(var gr=0,sr=0;sr<Me;++sr)for(var Ir=0;Ir<gt;++Ir)U[gr++]=fe[zt*sr+xt*Ir+lt]}function Cp(U,fe,Me,gt){var zt=0,xt={};function lt(rt){this.id=zt++,this.buffer=U.createBuffer(),this.type=rt,this.usage=bf,this.byteLength=0,this.dimension=1,this.dtype=Ra,this.persistentData=null,Me.profile&&(this.stats={size:0})}lt.prototype.bind=function(){U.bindBuffer(this.type,this.buffer)},lt.prototype.destroy=function(){Or(this)};var gr=[];function sr(rt,Pt){var _r=gr.pop();return _r||(_r=new lt(rt)),_r.bind(),wr(_r,Pt,ms,0,1,!1),_r}function Ir(rt){gr.push(rt)}function xr(rt,Pt,_r){rt.byteLength=Pt.byteLength,U.bufferData(rt.type,Pt,_r)}function wr(rt,Pt,_r,Nr,Jt,Vr){var dr;if(rt.usage=_r,Array.isArray(Pt)){if(rt.dtype=Nr||_l,Pt.length>0){var Ur;if(Array.isArray(Pt[0])){dr=Gu(Pt);for(var er=1,Fr=1;Fr<dr.length;++Fr)er*=dr[Fr];rt.dimension=er,Ur=xu(Pt,dr,rt.dtype),xr(rt,Ur,_r),Vr?rt.persistentData=Ur:Nt.freeType(Ur)}else if(typeof Pt[0]=="number"){rt.dimension=Jt;var En=Nt.allocType(rt.dtype,Pt.length);N1(En,Pt),xr(rt,En,_r),Vr?rt.persistentData=En:Nt.freeType(En)}else r(Pt[0])?(rt.dimension=Pt[0].length,rt.dtype=Nr||ph(Pt[0])||_l,Ur=xu(Pt,[Pt.length,Pt[0].length],rt.dtype),xr(rt,Ur,_r),Vr?rt.persistentData=Ur:Nt.freeType(Ur)):Q.raise("invalid buffer data")}}else if(r(Pt))rt.dtype=Nr||ph(Pt),rt.dimension=Jt,xr(rt,Pt,_r),Vr&&(rt.persistentData=new Uint8Array(new Uint8Array(Pt.buffer)));else if(ee(Pt)){dr=Pt.shape;var jn=Pt.stride,Br=Pt.offset,mr=0,Wt=0,Sn=0,ui=0;dr.length===1?(mr=dr[0],Wt=1,Sn=jn[0],ui=0):dr.length===2?(mr=dr[0],Wt=dr[1],Sn=jn[0],ui=jn[1]):Q.raise("invalid shape"),rt.dtype=Nr||ph(Pt.data)||_l,rt.dimension=Wt;var jr=Nt.allocType(rt.dtype,mr*Wt);dh(jr,Pt.data,mr,Wt,Sn,ui,Br),xr(rt,jr,_r),Vr?rt.persistentData=jr:Nt.freeType(jr)}else Pt instanceof ArrayBuffer?(rt.dtype=Ra,rt.dimension=Jt,xr(rt,Pt,_r),Vr&&(rt.persistentData=new Uint8Array(new Uint8Array(Pt)))):Q.raise("invalid buffer data")}function Or(rt){fe.bufferCount--,gt(rt);var Pt=rt.buffer;Q(Pt,"buffer must not be deleted already"),U.deleteBuffer(Pt),rt.buffer=null,delete xt[rt.id]}function cr(rt,Pt,_r,Nr){fe.bufferCount++;var Jt=new lt(Pt);xt[Jt.id]=Jt;function Vr(er){var Fr=bf,En=null,jn=0,Br=0,mr=1;return Array.isArray(er)||r(er)||ee(er)||er instanceof ArrayBuffer?En=er:typeof er=="number"?jn=er|0:er&&(Q.type(er,"object","buffer arguments must be an object, a number or an array"),"data"in er&&(Q(En===null||Array.isArray(En)||r(En)||ee(En),"invalid data for buffer"),En=er.data),"usage"in er&&(Q.parameter(er.usage,yu,"invalid buffer usage"),Fr=yu[er.usage]),"type"in er&&(Q.parameter(er.type,wo,"invalid buffer type"),Br=wo[er.type]),"dimension"in er&&(Q.type(er.dimension,"number","invalid dimension"),mr=er.dimension|0),"length"in er&&(Q.nni(jn,"buffer length must be a nonnegative integer"),jn=er.length|0)),Jt.bind(),En?wr(Jt,En,Fr,Br,mr,Nr):(jn&&U.bufferData(Jt.type,jn,Fr),Jt.dtype=Br||Ra,Jt.usage=Fr,Jt.dimension=mr,Jt.byteLength=jn),Me.profile&&(Jt.stats.size=Jt.byteLength*Wu[Jt.dtype]),Vr}function dr(er,Fr){Q(Fr+er.byteLength<=Jt.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+er.byteLength+" starting from offset "+Fr+" to a buffer of size "+Jt.byteLength),U.bufferSubData(Jt.type,Fr,er)}function Ur(er,Fr){var En=(Fr||0)|0,jn;if(Jt.bind(),r(er)||er instanceof ArrayBuffer)dr(er,En);else if(Array.isArray(er)){if(er.length>0)if(typeof er[0]=="number"){var Br=Nt.allocType(Jt.dtype,er.length);N1(Br,er),dr(Br,En),Nt.freeType(Br)}else if(Array.isArray(er[0])||r(er[0])){jn=Gu(er);var mr=xu(er,jn,Jt.dtype);dr(mr,En),Nt.freeType(mr)}else Q.raise("invalid buffer data")}else if(ee(er)){jn=er.shape;var Wt=er.stride,Sn=0,ui=0,jr=0,ri=0;jn.length===1?(Sn=jn[0],ui=1,jr=Wt[0],ri=0):jn.length===2?(Sn=jn[0],ui=jn[1],jr=Wt[0],ri=Wt[1]):Q.raise("invalid shape");var $n=Array.isArray(er.data)?Jt.dtype:ph(er.data),Dn=Nt.allocType($n,Sn*ui);dh(Dn,er.data,Sn,ui,jr,ri,er.offset),dr(Dn,En),Nt.freeType(Dn)}else Q.raise("invalid data for buffer subdata");return Vr}return _r||Vr(rt),Vr._reglType="buffer",Vr._buffer=Jt,Vr.subdata=Ur,Me.profile&&(Vr.stats=Jt.stats),Vr.destroy=function(){Or(Jt)},Vr}function Cr(){ue(xt).forEach(function(rt){rt.buffer=U.createBuffer(),U.bindBuffer(rt.type,rt.buffer),U.bufferData(rt.type,rt.persistentData||rt.byteLength,rt.usage)})}return Me.profile&&(fe.getTotalBufferSize=function(){var rt=0;return Object.keys(xt).forEach(function(Pt){rt+=xt[Pt].stats.size}),rt}),{create:cr,createStream:sr,destroyStream:Ir,clear:function(){ue(xt).forEach(Or),gr.forEach(Or)},getBuffer:function(rt){return rt&&rt._buffer instanceof lt?rt._buffer:null},restore:Cr,_initBuffer:wr}}var Rp=0,Ip=0,U1=1,z1=1,O0=4,Ef=4,bu={points:Rp,point:Ip,lines:U1,line:z1,triangles:O0,triangle:Ef,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},$1=0,Co=1,Ql=4,yl=5120,Cs=5121,xl=5122,js=5123,Xu=5124,Rs=5125,Yu=34963,bl=35040,V1=35044;function j1(U,fe,Me,gt){var zt={},xt=0,lt={uint8:Cs,uint16:js};fe.oes_element_index_uint&&(lt.uint32=Rs);function gr(Cr){this.id=xt++,zt[this.id]=this,this.buffer=Cr,this.primType=Ql,this.vertCount=0,this.type=0}gr.prototype.bind=function(){this.buffer.bind()};var sr=[];function Ir(Cr){var rt=sr.pop();return rt||(rt=new gr(Me.create(null,Yu,!0,!1)._buffer)),wr(rt,Cr,bl,-1,-1,0,0),rt}function xr(Cr){sr.push(Cr)}function wr(Cr,rt,Pt,_r,Nr,Jt,Vr){Cr.buffer.bind();var dr;if(rt){var Ur=Vr;!Vr&&(!r(rt)||ee(rt)&&!r(rt.data))&&(Ur=fe.oes_element_index_uint?Rs:js),Me._initBuffer(Cr.buffer,rt,Pt,Ur,3)}else U.bufferData(Yu,Jt,Pt),Cr.buffer.dtype=dr||Cs,Cr.buffer.usage=Pt,Cr.buffer.dimension=3,Cr.buffer.byteLength=Jt;if(dr=Vr,!Vr){switch(Cr.buffer.dtype){case Cs:case yl:dr=Cs;break;case js:case xl:dr=js;break;case Rs:case Xu:dr=Rs;break;default:Q.raise("unsupported type for element array")}Cr.buffer.dtype=dr}Cr.type=dr,Q(dr!==Rs||!!fe.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var er=Nr;er<0&&(er=Cr.buffer.byteLength,dr===js?er>>=1:dr===Rs&&(er>>=2)),Cr.vertCount=er;var Fr=_r;if(_r<0){Fr=Ql;var En=Cr.buffer.dimension;En===1&&(Fr=$1),En===2&&(Fr=Co),En===3&&(Fr=Ql)}Cr.primType=Fr}function Or(Cr){gt.elementsCount--,Q(Cr.buffer!==null,"must not double destroy elements"),delete zt[Cr.id],Cr.buffer.destroy(),Cr.buffer=null}function cr(Cr,rt){var Pt=Me.create(null,Yu,!0),_r=new gr(Pt._buffer);gt.elementsCount++;function Nr(Jt){if(!Jt)Pt(),_r.primType=Ql,_r.vertCount=0,_r.type=Cs;else if(typeof Jt=="number")Pt(Jt),_r.primType=Ql,_r.vertCount=Jt|0,_r.type=Cs;else{var Vr=null,dr=V1,Ur=-1,er=-1,Fr=0,En=0;Array.isArray(Jt)||r(Jt)||ee(Jt)?Vr=Jt:(Q.type(Jt,"object","invalid arguments for elements"),"data"in Jt&&(Vr=Jt.data,Q(Array.isArray(Vr)||r(Vr)||ee(Vr),"invalid data for element buffer")),"usage"in Jt&&(Q.parameter(Jt.usage,yu,"invalid element buffer usage"),dr=yu[Jt.usage]),"primitive"in Jt&&(Q.parameter(Jt.primitive,bu,"invalid element buffer primitive"),Ur=bu[Jt.primitive]),"count"in Jt&&(Q(typeof Jt.count=="number"&&Jt.count>=0,"invalid vertex count for elements"),er=Jt.count|0),"type"in Jt&&(Q.parameter(Jt.type,lt,"invalid buffer type"),En=lt[Jt.type]),"length"in Jt?Fr=Jt.length|0:(Fr=er,En===js||En===xl?Fr*=2:(En===Rs||En===Xu)&&(Fr*=4))),wr(_r,Vr,dr,Ur,er,Fr,En)}return Nr}return Nr(Cr),Nr._reglType="elements",Nr._elements=_r,Nr.subdata=function(Jt,Vr){return Pt.subdata(Jt,Vr),Nr},Nr.destroy=function(){Or(_r)},Nr}return{create:cr,createStream:Ir,destroyStream:xr,getElements:function(Cr){return typeof Cr=="function"&&Cr._elements instanceof gr?Cr._elements:null},clear:function(){ue(zt).forEach(Or)}}}var Xi=new Float32Array(1),k0=new Uint32Array(Xi.buffer),vh=5123;function Mp(U){for(var fe=Nt.allocType(vh,U.length),Me=0;Me<U.length;++Me)if(isNaN(U[Me]))fe[Me]=65535;else if(U[Me]===1/0)fe[Me]=31744;else if(U[Me]===-1/0)fe[Me]=64512;else{Xi[0]=U[Me];var gt=k0[0],zt=gt>>>31<<15,xt=(gt<<1>>>24)-127,lt=gt>>13&1023;if(xt<-24)fe[Me]=zt;else if(xt<-14){var gr=-14-xt;fe[Me]=zt+(lt+1024>>gr)}else xt>15?fe[Me]=zt+31744:fe[Me]=zt+(xt+15<<10)+lt}return fe}function Ia(U){return Array.isArray(U)||r(U)}var Pp=function(U){return!(U&U-1)&&!!U},H1=34467,ns=3553,Zu=34067,Eu=34069,El=6408,mh=6406,wc=6407,ou=6409,Sf=6410,Sl=32854,qu=32855,Op=36194,Af=32819,ta=32820,gh=33635,D0=34042,Al=6402,Tf=34041,kp=35904,_h=35906,Ku=36193,Tl=33776,Jl=33777,Cc=33778,ec=33779,tc=35986,Dp=35987,rc=34798,Hs=35840,Fp=35841,Bp=35842,Lp=35843,wl=36196,Su=5121,Rc=5123,wf=5125,Cl=5126,F0=10242,yh=10243,Np=10497,xh=33071,G1=33648,bh=10240,Up=10241,Cf=9728,zp=9729,nc=9984,$p=9985,Rl=9986,ra=9987,Eh=33170,Au=4352,Il=4353,yi=4354,na=34046,Is=3317,Rf=37440,Ic=37441,If=37443,W1=37444,Sh=33984,Mf=[nc,Rl,$p,ra],Ml=[0,ou,Sf,wc,El],io={};io[ou]=io[mh]=io[Al]=1,io[Tf]=io[Sf]=2,io[wc]=io[kp]=3,io[El]=io[_h]=4;function ma(U){return"[object "+U+"]"}var Mc=ma("HTMLCanvasElement"),Vp=ma("OffscreenCanvas"),Da=ma("CanvasRenderingContext2D"),Kr=ma("ImageBitmap"),is=ma("HTMLImageElement"),Pf=ma("HTMLVideoElement"),Pc=Object.keys(no).concat([Mc,Vp,Da,Kr,is,Pf]),Wo=[];Wo[Su]=1,Wo[Cl]=4,Wo[Ku]=2,Wo[Rc]=2,Wo[wf]=4;var Yi=[];Yi[Sl]=2,Yi[qu]=2,Yi[Op]=2,Yi[Tf]=4,Yi[Tl]=.5,Yi[Jl]=.5,Yi[Cc]=1,Yi[ec]=1,Yi[tc]=.5,Yi[Dp]=1,Yi[rc]=1,Yi[Hs]=.5,Yi[Fp]=.25,Yi[Bp]=.5,Yi[Lp]=.25,Yi[wl]=.5;function Ah(U){return Array.isArray(U)&&(U.length===0||typeof U[0]=="number")}function Dr(U){if(!Array.isArray(U))return!1;var fe=U.length;return!(fe===0||!Ia(U[0]))}function Qu(U){return Object.prototype.toString.call(U)}function Of(U){return Qu(U)===Mc}function Th(U){return Qu(U)===Vp}function Gs(U){return Qu(U)===Da}function gs(U){return Qu(U)===Kr}function wh(U){return Qu(U)===is}function Ch(U){return Qu(U)===Pf}function Xo(U){if(!U)return!1;var fe=Qu(U);return Pc.indexOf(fe)>=0?!0:Ah(U)||Dr(U)||ee(U)}function Tu(U){return no[Object.prototype.toString.call(U)]|0}function X1(U,fe){var Me=fe.length;switch(U.type){case Su:case Rc:case wf:case Cl:var gt=Nt.allocType(U.type,Me);gt.set(fe),U.data=gt;break;case Ku:U.data=Mp(fe);break;default:Q.raise("unsupported texture type, must specify a typed array")}}function Oc(U,fe){return Nt.allocType(U.type===Ku?Cl:U.type,fe)}function Rh(U,fe){U.type===Ku?(U.data=Mp(fe),Nt.freeType(fe)):U.data=fe}function jp(U,fe,Me,gt,zt,xt){for(var lt=U.width,gr=U.height,sr=U.channels,Ir=lt*gr*sr,xr=Oc(U,Ir),wr=0,Or=0;Or<gr;++Or)for(var cr=0;cr<lt;++cr)for(var Cr=0;Cr<sr;++Cr)xr[wr++]=fe[Me*cr+gt*Or+zt*Cr+xt];Rh(U,xr)}function _s(U,fe,Me,gt,zt,xt){var lt;if(typeof Yi[U]<"u"?lt=Yi[U]:lt=io[U]*Wo[fe],xt&&(lt*=6),zt){for(var gr=0,sr=Me;sr>=1;)gr+=lt*sr*sr,sr/=2;return gr}else return lt*Me*gt}function Ms(U,fe,Me,gt,zt,xt,lt){var gr={"don't care":Au,"dont care":Au,nice:yi,fast:Il},sr={repeat:Np,clamp:xh,mirror:G1},Ir={nearest:Cf,linear:zp},xr=n({mipmap:ra,"nearest mipmap nearest":nc,"linear mipmap nearest":$p,"nearest mipmap linear":Rl,"linear mipmap linear":ra},Ir),wr={none:0,browser:W1},Or={uint8:Su,rgba4:Af,rgb565:gh,"rgb5 a1":ta},cr={alpha:mh,luminance:ou,"luminance alpha":Sf,rgb:wc,rgba:El,rgba4:Sl,"rgb5 a1":qu,rgb565:Op},Cr={};fe.ext_srgb&&(cr.srgb=kp,cr.srgba=_h),fe.oes_texture_float&&(Or.float32=Or.float=Cl),fe.oes_texture_half_float&&(Or.float16=Or["half float"]=Ku),fe.webgl_depth_texture&&(n(cr,{depth:Al,"depth stencil":Tf}),n(Or,{uint16:Rc,uint32:wf,"depth stencil":D0})),fe.webgl_compressed_texture_s3tc&&n(Cr,{"rgb s3tc dxt1":Tl,"rgba s3tc dxt1":Jl,"rgba s3tc dxt3":Cc,"rgba s3tc dxt5":ec}),fe.webgl_compressed_texture_atc&&n(Cr,{"rgb atc":tc,"rgba atc explicit alpha":Dp,"rgba atc interpolated alpha":rc}),fe.webgl_compressed_texture_pvrtc&&n(Cr,{"rgb pvrtc 4bppv1":Hs,"rgb pvrtc 2bppv1":Fp,"rgba pvrtc 4bppv1":Bp,"rgba pvrtc 2bppv1":Lp}),fe.webgl_compressed_texture_etc1&&(Cr["rgb etc1"]=wl);var rt=Array.prototype.slice.call(U.getParameter(H1));Object.keys(Cr).forEach(function(Ae){var Et=Cr[Ae];rt.indexOf(Et)>=0&&(cr[Ae]=Et)});var Pt=Object.keys(cr);Me.textureFormats=Pt;var _r=[];Object.keys(cr).forEach(function(Ae){var Et=cr[Ae];_r[Et]=Ae});var Nr=[];Object.keys(Or).forEach(function(Ae){var Et=Or[Ae];Nr[Et]=Ae});var Jt=[];Object.keys(Ir).forEach(function(Ae){var Et=Ir[Ae];Jt[Et]=Ae});var Vr=[];Object.keys(xr).forEach(function(Ae){var Et=xr[Ae];Vr[Et]=Ae});var dr=[];Object.keys(sr).forEach(function(Ae){var Et=sr[Ae];dr[Et]=Ae});var Ur=Pt.reduce(function(Ae,Et){var pt=cr[Et];return pt===ou||pt===mh||pt===ou||pt===Sf||pt===Al||pt===Tf||fe.ext_srgb&&(pt===kp||pt===_h)?Ae[pt]=pt:pt===qu||Et.indexOf("rgba")>=0?Ae[pt]=El:Ae[pt]=wc,Ae},{});function er(){this.internalformat=El,this.format=El,this.type=Su,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=W1,this.width=0,this.height=0,this.channels=0}function Fr(Ae,Et){Ae.internalformat=Et.internalformat,Ae.format=Et.format,Ae.type=Et.type,Ae.compressed=Et.compressed,Ae.premultiplyAlpha=Et.premultiplyAlpha,Ae.flipY=Et.flipY,Ae.unpackAlignment=Et.unpackAlignment,Ae.colorSpace=Et.colorSpace,Ae.width=Et.width,Ae.height=Et.height,Ae.channels=Et.channels}function En(Ae,Et){if(!(typeof Et!="object"||!Et)){if("premultiplyAlpha"in Et&&(Q.type(Et.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),Ae.premultiplyAlpha=Et.premultiplyAlpha),"flipY"in Et&&(Q.type(Et.flipY,"boolean","invalid texture flip"),Ae.flipY=Et.flipY),"alignment"in Et&&(Q.oneOf(Et.alignment,[1,2,4,8],"invalid texture unpack alignment"),Ae.unpackAlignment=Et.alignment),"colorSpace"in Et&&(Q.parameter(Et.colorSpace,wr,"invalid colorSpace"),Ae.colorSpace=wr[Et.colorSpace]),"type"in Et){var pt=Et.type;Q(fe.oes_texture_float||!(pt==="float"||pt==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),Q(fe.oes_texture_half_float||!(pt==="half float"||pt==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),Q(fe.webgl_depth_texture||!(pt==="uint16"||pt==="uint32"||pt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Q.parameter(pt,Or,"invalid texture type"),Ae.type=Or[pt]}var Hr=Ae.width,ni=Ae.height,Zi=Ae.channels,te=!1;"shape"in Et?(Q(Array.isArray(Et.shape)&&Et.shape.length>=2,"shape must be an array"),Hr=Et.shape[0],ni=Et.shape[1],Et.shape.length===3&&(Zi=Et.shape[2],Q(Zi>0&&Zi<=4,"invalid number of channels"),te=!0),Q(Hr>=0&&Hr<=Me.maxTextureSize,"invalid width"),Q(ni>=0&&ni<=Me.maxTextureSize,"invalid height")):("radius"in Et&&(Hr=ni=Et.radius,Q(Hr>=0&&Hr<=Me.maxTextureSize,"invalid radius")),"width"in Et&&(Hr=Et.width,Q(Hr>=0&&Hr<=Me.maxTextureSize,"invalid width")),"height"in Et&&(ni=Et.height,Q(ni>=0&&ni<=Me.maxTextureSize,"invalid height")),"channels"in Et&&(Zi=Et.channels,Q(Zi>0&&Zi<=4,"invalid number of channels"),te=!0)),Ae.width=Hr|0,Ae.height=ni|0,Ae.channels=Zi|0;var me=!1;if("format"in Et){var Pe=Et.format;Q(fe.webgl_depth_texture||!(Pe==="depth"||Pe==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Q.parameter(Pe,cr,"invalid texture format");var vt=Ae.internalformat=cr[Pe];Ae.format=Ur[vt],Pe in Or&&("type"in Et||(Ae.type=Or[Pe])),Pe in Cr&&(Ae.compressed=!0),me=!0}!te&&me?Ae.channels=io[Ae.format]:te&&!me?Ae.channels!==Ml[Ae.format]&&(Ae.format=Ae.internalformat=Ml[Ae.channels]):me&&te&&Q(Ae.channels===io[Ae.format],"number of channels inconsistent with specified format")}}function jn(Ae){U.pixelStorei(Rf,Ae.flipY),U.pixelStorei(Ic,Ae.premultiplyAlpha),U.pixelStorei(If,Ae.colorSpace),U.pixelStorei(Is,Ae.unpackAlignment)}function Br(){er.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function mr(Ae,Et){var pt=null;if(Xo(Et)?pt=Et:Et&&(Q.type(Et,"object","invalid pixel data type"),En(Ae,Et),"x"in Et&&(Ae.xOffset=Et.x|0),"y"in Et&&(Ae.yOffset=Et.y|0),Xo(Et.data)&&(pt=Et.data)),Q(!Ae.compressed||pt instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),Et.copy){Q(!pt,"can not specify copy and data field for the same texture");var Hr=zt.viewportWidth,ni=zt.viewportHeight;Ae.width=Ae.width||Hr-Ae.xOffset,Ae.height=Ae.height||ni-Ae.yOffset,Ae.needsCopy=!0,Q(Ae.xOffset>=0&&Ae.xOffset<Hr&&Ae.yOffset>=0&&Ae.yOffset<ni&&Ae.width>0&&Ae.width<=Hr&&Ae.height>0&&Ae.height<=ni,"copy texture read out of bounds")}else if(!pt)Ae.width=Ae.width||1,Ae.height=Ae.height||1,Ae.channels=Ae.channels||4;else if(r(pt))Ae.channels=Ae.channels||4,Ae.data=pt,!("type"in Et)&&Ae.type===Su&&(Ae.type=Tu(pt));else if(Ah(pt))Ae.channels=Ae.channels||4,X1(Ae,pt),Ae.alignment=1,Ae.needsFree=!0;else if(ee(pt)){var Zi=pt.data;!Array.isArray(Zi)&&Ae.type===Su&&(Ae.type=Tu(Zi));var te=pt.shape,me=pt.stride,Pe,vt,ht,Le,We,Ze;te.length===3?(ht=te[2],Ze=me[2]):(Q(te.length===2,"invalid ndarray pixel data, must be 2 or 3D"),ht=1,Ze=1),Pe=te[0],vt=te[1],Le=me[0],We=me[1],Ae.alignment=1,Ae.width=Pe,Ae.height=vt,Ae.channels=ht,Ae.format=Ae.internalformat=Ml[ht],Ae.needsFree=!0,jp(Ae,Zi,Le,We,Ze,pt.offset)}else if(Of(pt)||Th(pt)||Gs(pt))Of(pt)||Th(pt)?Ae.element=pt:Ae.element=pt.canvas,Ae.width=Ae.element.width,Ae.height=Ae.element.height,Ae.channels=4;else if(gs(pt))Ae.element=pt,Ae.width=pt.width,Ae.height=pt.height,Ae.channels=4;else if(wh(pt))Ae.element=pt,Ae.width=pt.naturalWidth,Ae.height=pt.naturalHeight,Ae.channels=4;else if(Ch(pt))Ae.element=pt,Ae.width=pt.videoWidth,Ae.height=pt.videoHeight,Ae.channels=4;else if(Dr(pt)){var Te=Ae.width||pt[0].length,Ve=Ae.height||pt.length,pe=Ae.channels;Ia(pt[0][0])?pe=pe||pt[0][0].length:pe=pe||1;for(var He=Ue.shape(pt),Tt=1,Ft=0;Ft<He.length;++Ft)Tt*=He[Ft];var ir=Oc(Ae,Tt);Ue.flatten(pt,He,"",ir),Rh(Ae,ir),Ae.alignment=1,Ae.width=Te,Ae.height=Ve,Ae.channels=pe,Ae.format=Ae.internalformat=Ml[pe],Ae.needsFree=!0}Ae.type===Cl?Q(Me.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):Ae.type===Ku&&Q(Me.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function Wt(Ae,Et,pt){var Hr=Ae.element,ni=Ae.data,Zi=Ae.internalformat,te=Ae.format,me=Ae.type,Pe=Ae.width,vt=Ae.height;jn(Ae),Hr?U.texImage2D(Et,pt,te,te,me,Hr):Ae.compressed?U.compressedTexImage2D(Et,pt,Zi,Pe,vt,0,ni):Ae.needsCopy?(gt(),U.copyTexImage2D(Et,pt,te,Ae.xOffset,Ae.yOffset,Pe,vt,0)):U.texImage2D(Et,pt,te,Pe,vt,0,te,me,ni||null)}function Sn(Ae,Et,pt,Hr,ni){var Zi=Ae.element,te=Ae.data,me=Ae.internalformat,Pe=Ae.format,vt=Ae.type,ht=Ae.width,Le=Ae.height;jn(Ae),Zi?U.texSubImage2D(Et,ni,pt,Hr,Pe,vt,Zi):Ae.compressed?U.compressedTexSubImage2D(Et,ni,pt,Hr,me,ht,Le,te):Ae.needsCopy?(gt(),U.copyTexSubImage2D(Et,ni,pt,Hr,Ae.xOffset,Ae.yOffset,ht,Le)):U.texSubImage2D(Et,ni,pt,Hr,ht,Le,Pe,vt,te)}var ui=[];function jr(){return ui.pop()||new Br}function ri(Ae){Ae.needsFree&&Nt.freeType(Ae.data),Br.call(Ae),ui.push(Ae)}function $n(){er.call(this),this.genMipmaps=!1,this.mipmapHint=Au,this.mipmask=0,this.images=Array(16)}function Dn(Ae,Et,pt){var Hr=Ae.images[0]=jr();Ae.mipmask=1,Hr.width=Ae.width=Et,Hr.height=Ae.height=pt,Hr.channels=Ae.channels=4}function Di(Ae,Et){var pt=null;if(Xo(Et))pt=Ae.images[0]=jr(),Fr(pt,Ae),mr(pt,Et),Ae.mipmask=1;else if(En(Ae,Et),Array.isArray(Et.mipmap))for(var Hr=Et.mipmap,ni=0;ni<Hr.length;++ni)pt=Ae.images[ni]=jr(),Fr(pt,Ae),pt.width>>=ni,pt.height>>=ni,mr(pt,Hr[ni]),Ae.mipmask|=1<<ni;else pt=Ae.images[0]=jr(),Fr(pt,Ae),mr(pt,Et),Ae.mipmask=1;Fr(Ae,Ae.images[0]),Ae.compressed&&(Ae.internalformat===Tl||Ae.internalformat===Jl||Ae.internalformat===Cc||Ae.internalformat===ec)&&Q(Ae.width%4===0&&Ae.height%4===0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function ja(Ae,Et){for(var pt=Ae.images,Hr=0;Hr<pt.length;++Hr){if(!pt[Hr])return;Wt(pt[Hr],Et,Hr)}}var Io=[];function pi(){var Ae=Io.pop()||new $n;er.call(Ae),Ae.mipmask=0;for(var Et=0;Et<16;++Et)Ae.images[Et]=null;return Ae}function Ha(Ae){for(var Et=Ae.images,pt=0;pt<Et.length;++pt)Et[pt]&&ri(Et[pt]),Et[pt]=null;Io.push(Ae)}function la(){this.minFilter=Cf,this.magFilter=Cf,this.wrapS=xh,this.wrapT=xh,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Au}function uo(Ae,Et){if("min"in Et){var pt=Et.min;Q.parameter(pt,xr),Ae.minFilter=xr[pt],Mf.indexOf(Ae.minFilter)>=0&&!("faces"in Et)&&(Ae.genMipmaps=!0)}if("mag"in Et){var Hr=Et.mag;Q.parameter(Hr,Ir),Ae.magFilter=Ir[Hr]}var ni=Ae.wrapS,Zi=Ae.wrapT;if("wrap"in Et){var te=Et.wrap;typeof te=="string"?(Q.parameter(te,sr),ni=Zi=sr[te]):Array.isArray(te)&&(Q.parameter(te[0],sr),Q.parameter(te[1],sr),ni=sr[te[0]],Zi=sr[te[1]])}else{if("wrapS"in Et){var me=Et.wrapS;Q.parameter(me,sr),ni=sr[me]}if("wrapT"in Et){var Pe=Et.wrapT;Q.parameter(Pe,sr),Zi=sr[Pe]}}if(Ae.wrapS=ni,Ae.wrapT=Zi,"anisotropic"in Et){var vt=Et.anisotropic;Q(typeof vt=="number"&&vt>=1&&vt<=Me.maxAnisotropic,"aniso samples must be between 1 and "),Ae.anisotropic=Et.anisotropic}if("mipmap"in Et){var ht=!1;switch(typeof Et.mipmap){case"string":Q.parameter(Et.mipmap,gr,"invalid mipmap hint"),Ae.mipmapHint=gr[Et.mipmap],Ae.genMipmaps=!0,ht=!0;break;case"boolean":ht=Ae.genMipmaps=Et.mipmap;break;case"object":Q(Array.isArray(Et.mipmap),"invalid mipmap type"),Ae.genMipmaps=!1,ht=!0;break;default:Q.raise("invalid mipmap type")}ht&&!("min"in Et)&&(Ae.minFilter=nc)}}function lo(Ae,Et){U.texParameteri(Et,Up,Ae.minFilter),U.texParameteri(Et,bh,Ae.magFilter),U.texParameteri(Et,F0,Ae.wrapS),U.texParameteri(Et,yh,Ae.wrapT),fe.ext_texture_filter_anisotropic&&U.texParameteri(Et,na,Ae.anisotropic),Ae.genMipmaps&&(U.hint(Eh,Ae.mipmapHint),U.generateMipmap(Et))}var Oa=0,xo={},Ko=Me.maxTextureUnits,co=Array(Ko).map(function(){return null});function ei(Ae){er.call(this),this.mipmask=0,this.internalformat=El,this.id=Oa++,this.refCount=1,this.target=Ae,this.texture=U.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new la,lt.profile&&(this.stats={size:0})}function zo(Ae){U.activeTexture(Sh),U.bindTexture(Ae.target,Ae.texture)}function Ni(){var Ae=co[0];Ae?U.bindTexture(Ae.target,Ae.texture):U.bindTexture(ns,null)}function Mn(Ae){var Et=Ae.texture;Q(Et,"must not double destroy texture");var pt=Ae.unit,Hr=Ae.target;pt>=0&&(U.activeTexture(Sh+pt),U.bindTexture(Hr,null),co[pt]=null),U.deleteTexture(Et),Ae.texture=null,Ae.params=null,Ae.pixels=null,Ae.refCount=0,delete xo[Ae.id],xt.textureCount--}n(ei.prototype,{bind:function(){var Ae=this;Ae.bindCount+=1;var Et=Ae.unit;if(Et<0){for(var pt=0;pt<Ko;++pt){var Hr=co[pt];if(Hr){if(Hr.bindCount>0)continue;Hr.unit=-1}co[pt]=Ae,Et=pt;break}Et>=Ko&&Q.raise("insufficient number of texture units"),lt.profile&&xt.maxTextureUnits<Et+1&&(xt.maxTextureUnits=Et+1),Ae.unit=Et,U.activeTexture(Sh+Et),U.bindTexture(Ae.target,Ae.texture)}return Et},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&Mn(this)}});function fi(Ae,Et){var pt=new ei(ns);xo[pt.id]=pt,xt.textureCount++;function Hr(te,me){var Pe=pt.texInfo;la.call(Pe);var vt=pi();return typeof te=="number"?typeof me=="number"?Dn(vt,te|0,me|0):Dn(vt,te|0,te|0):te?(Q.type(te,"object","invalid arguments to regl.texture"),uo(Pe,te),Di(vt,te)):Dn(vt,1,1),Pe.genMipmaps&&(vt.mipmask=(vt.width<<1)-1),pt.mipmask=vt.mipmask,Fr(pt,vt),Q.texture2D(Pe,vt,Me),pt.internalformat=vt.internalformat,Hr.width=vt.width,Hr.height=vt.height,zo(pt),ja(vt,ns),lo(Pe,ns),Ni(),Ha(vt),lt.profile&&(pt.stats.size=_s(pt.internalformat,pt.type,vt.width,vt.height,Pe.genMipmaps,!1)),Hr.format=_r[pt.internalformat],Hr.type=Nr[pt.type],Hr.mag=Jt[Pe.magFilter],Hr.min=Vr[Pe.minFilter],Hr.wrapS=dr[Pe.wrapS],Hr.wrapT=dr[Pe.wrapT],Hr}function ni(te,me,Pe,vt){Q(!!te,"must specify image data");var ht=me|0,Le=Pe|0,We=vt|0,Ze=jr();return Fr(Ze,pt),Ze.width=0,Ze.height=0,mr(Ze,te),Ze.width=Ze.width||(pt.width>>We)-ht,Ze.height=Ze.height||(pt.height>>We)-Le,Q(pt.type===Ze.type&&pt.format===Ze.format&&pt.internalformat===Ze.internalformat,"incompatible format for texture.subimage"),Q(ht>=0&&Le>=0&&ht+Ze.width<=pt.width&&Le+Ze.height<=pt.height,"texture.subimage write out of bounds"),Q(pt.mipmask&1<<We,"missing mipmap data"),Q(Ze.data||Ze.element||Ze.needsCopy,"missing image data"),zo(pt),Sn(Ze,ns,ht,Le,We),Ni(),ri(Ze),Hr}function Zi(te,me){var Pe=te|0,vt=me|0||Pe;if(Pe===pt.width&&vt===pt.height)return Hr;Hr.width=pt.width=Pe,Hr.height=pt.height=vt,zo(pt);for(var ht=0;pt.mipmask>>ht;++ht){var Le=Pe>>ht,We=vt>>ht;if(!Le||!We)break;U.texImage2D(ns,ht,pt.format,Le,We,0,pt.format,pt.type,null)}return Ni(),lt.profile&&(pt.stats.size=_s(pt.internalformat,pt.type,Pe,vt,!1,!1)),Hr}return Hr(Ae,Et),Hr.subimage=ni,Hr.resize=Zi,Hr._reglType="texture2d",Hr._texture=pt,lt.profile&&(Hr.stats=pt.stats),Hr.destroy=function(){pt.decRef()},Hr}function Mi(Ae,Et,pt,Hr,ni,Zi){var te=new ei(Zu);xo[te.id]=te,xt.cubeCount++;var me=new Array(6);function Pe(Le,We,Ze,Te,Ve,pe){var He,Tt=te.texInfo;for(la.call(Tt),He=0;He<6;++He)me[He]=pi();if(typeof Le=="number"||!Le){var Ft=Le|0||1;for(He=0;He<6;++He)Dn(me[He],Ft,Ft)}else if(typeof Le=="object")if(We)Di(me[0],Le),Di(me[1],We),Di(me[2],Ze),Di(me[3],Te),Di(me[4],Ve),Di(me[5],pe);else if(uo(Tt,Le),En(te,Le),"faces"in Le){var ir=Le.faces;for(Q(Array.isArray(ir)&&ir.length===6,"cube faces must be a length 6 array"),He=0;He<6;++He)Q(typeof ir[He]=="object"&&!!ir[He],"invalid input for cube map face"),Fr(me[He],te),Di(me[He],ir[He])}else for(He=0;He<6;++He)Di(me[He],Le);else Q.raise("invalid arguments to cube map");for(Fr(te,me[0]),Me.npotTextureCube||Q(Pp(te.width)&&Pp(te.height),"your browser does not support non power or two texture dimensions"),Tt.genMipmaps?te.mipmask=(me[0].width<<1)-1:te.mipmask=me[0].mipmask,Q.textureCube(te,Tt,me,Me),te.internalformat=me[0].internalformat,Pe.width=me[0].width,Pe.height=me[0].height,zo(te),He=0;He<6;++He)ja(me[He],Eu+He);for(lo(Tt,Zu),Ni(),lt.profile&&(te.stats.size=_s(te.internalformat,te.type,Pe.width,Pe.height,Tt.genMipmaps,!0)),Pe.format=_r[te.internalformat],Pe.type=Nr[te.type],Pe.mag=Jt[Tt.magFilter],Pe.min=Vr[Tt.minFilter],Pe.wrapS=dr[Tt.wrapS],Pe.wrapT=dr[Tt.wrapT],He=0;He<6;++He)Ha(me[He]);return Pe}function vt(Le,We,Ze,Te,Ve){Q(!!We,"must specify image data"),Q(typeof Le=="number"&&Le===(Le|0)&&Le>=0&&Le<6,"invalid face");var pe=Ze|0,He=Te|0,Tt=Ve|0,Ft=jr();return Fr(Ft,te),Ft.width=0,Ft.height=0,mr(Ft,We),Ft.width=Ft.width||(te.width>>Tt)-pe,Ft.height=Ft.height||(te.height>>Tt)-He,Q(te.type===Ft.type&&te.format===Ft.format&&te.internalformat===Ft.internalformat,"incompatible format for texture.subimage"),Q(pe>=0&&He>=0&&pe+Ft.width<=te.width&&He+Ft.height<=te.height,"texture.subimage write out of bounds"),Q(te.mipmask&1<<Tt,"missing mipmap data"),Q(Ft.data||Ft.element||Ft.needsCopy,"missing image data"),zo(te),Sn(Ft,Eu+Le,pe,He,Tt),Ni(),ri(Ft),Pe}function ht(Le){var We=Le|0;if(We!==te.width){Pe.width=te.width=We,Pe.height=te.height=We,zo(te);for(var Ze=0;Ze<6;++Ze)for(var Te=0;te.mipmask>>Te;++Te)U.texImage2D(Eu+Ze,Te,te.format,We>>Te,We>>Te,0,te.format,te.type,null);return Ni(),lt.profile&&(te.stats.size=_s(te.internalformat,te.type,Pe.width,Pe.height,!1,!0)),Pe}}return Pe(Ae,Et,pt,Hr,ni,Zi),Pe.subimage=vt,Pe.resize=ht,Pe._reglType="textureCube",Pe._texture=te,lt.profile&&(Pe.stats=te.stats),Pe.destroy=function(){te.decRef()},Pe}function Ga(){for(var Ae=0;Ae<Ko;++Ae)U.activeTexture(Sh+Ae),U.bindTexture(ns,null),co[Ae]=null;ue(xo).forEach(Mn),xt.cubeCount=0,xt.textureCount=0}lt.profile&&(xt.getTotalTextureSize=function(){var Ae=0;return Object.keys(xo).forEach(function(Et){Ae+=xo[Et].stats.size}),Ae});function il(){for(var Ae=0;Ae<Ko;++Ae){var Et=co[Ae];Et&&(Et.bindCount=0,Et.unit=-1,co[Ae]=null)}ue(xo).forEach(function(pt){pt.texture=U.createTexture(),U.bindTexture(pt.target,pt.texture);for(var Hr=0;Hr<32;++Hr)if(pt.mipmask&1<<Hr)if(pt.target===ns)U.texImage2D(ns,Hr,pt.internalformat,pt.width>>Hr,pt.height>>Hr,0,pt.internalformat,pt.type,null);else for(var ni=0;ni<6;++ni)U.texImage2D(Eu+ni,Hr,pt.internalformat,pt.width>>Hr,pt.height>>Hr,0,pt.internalformat,pt.type,null);lo(pt.texInfo,pt.target)})}return{create2D:fi,createCube:Mi,clear:Ga,getTexture:function(Ae){return null},restore:il}}var Zn=36161,Ps=32854,Os=32855,go=36194,Pl=33189,Ju=36168,Ws=34041,Lo=35907,kc=34836,dn=34842,nn=34843,ys=[];ys[Ps]=2,ys[Os]=2,ys[go]=2,ys[Pl]=2,ys[Ju]=1,ys[Ws]=4,ys[Lo]=4,ys[kc]=16,ys[dn]=8,ys[nn]=6;function No(U,fe,Me){return ys[U]*fe*Me}var su=function(U,fe,Me,gt,zt){var xt={rgba4:Ps,rgb565:go,"rgb5 a1":Os,depth:Pl,stencil:Ju,"depth stencil":Ws};fe.ext_srgb&&(xt.srgba=Lo),fe.ext_color_buffer_half_float&&(xt.rgba16f=dn,xt.rgb16f=nn),fe.webgl_color_buffer_float&&(xt.rgba32f=kc);var lt=[];Object.keys(xt).forEach(function(cr){var Cr=xt[cr];lt[Cr]=cr});var gr=0,sr={};function Ir(cr){this.id=gr++,this.refCount=1,this.renderbuffer=cr,this.format=Ps,this.width=0,this.height=0,zt.profile&&(this.stats={size:0})}Ir.prototype.decRef=function(){--this.refCount<=0&&xr(this)};function xr(cr){var Cr=cr.renderbuffer;Q(Cr,"must not double destroy renderbuffer"),U.bindRenderbuffer(Zn,null),U.deleteRenderbuffer(Cr),cr.renderbuffer=null,cr.refCount=0,delete sr[cr.id],gt.renderbufferCount--}function wr(cr,Cr){var rt=new Ir(U.createRenderbuffer());sr[rt.id]=rt,gt.renderbufferCount++;function Pt(Nr,Jt){var Vr=0,dr=0,Ur=Ps;if(typeof Nr=="object"&&Nr){var er=Nr;if("shape"in er){var Fr=er.shape;Q(Array.isArray(Fr)&&Fr.length>=2,"invalid renderbuffer shape"),Vr=Fr[0]|0,dr=Fr[1]|0}else"radius"in er&&(Vr=dr=er.radius|0),"width"in er&&(Vr=er.width|0),"height"in er&&(dr=er.height|0);"format"in er&&(Q.parameter(er.format,xt,"invalid renderbuffer format"),Ur=xt[er.format])}else typeof Nr=="number"?(Vr=Nr|0,typeof Jt=="number"?dr=Jt|0:dr=Vr):Nr?Q.raise("invalid arguments to renderbuffer constructor"):Vr=dr=1;if(Q(Vr>0&&dr>0&&Vr<=Me.maxRenderbufferSize&&dr<=Me.maxRenderbufferSize,"invalid renderbuffer size"),!(Vr===rt.width&&dr===rt.height&&Ur===rt.format))return Pt.width=rt.width=Vr,Pt.height=rt.height=dr,rt.format=Ur,U.bindRenderbuffer(Zn,rt.renderbuffer),U.renderbufferStorage(Zn,Ur,Vr,dr),Q(U.getError()===0,"invalid render buffer format"),zt.profile&&(rt.stats.size=No(rt.format,rt.width,rt.height)),Pt.format=lt[rt.format],Pt}function _r(Nr,Jt){var Vr=Nr|0,dr=Jt|0||Vr;return Vr===rt.width&&dr===rt.height||(Q(Vr>0&&dr>0&&Vr<=Me.maxRenderbufferSize&&dr<=Me.maxRenderbufferSize,"invalid renderbuffer size"),Pt.width=rt.width=Vr,Pt.height=rt.height=dr,U.bindRenderbuffer(Zn,rt.renderbuffer),U.renderbufferStorage(Zn,rt.format,Vr,dr),Q(U.getError()===0,"invalid render buffer format"),zt.profile&&(rt.stats.size=No(rt.format,rt.width,rt.height))),Pt}return Pt(cr,Cr),Pt.resize=_r,Pt._reglType="renderbuffer",Pt._renderbuffer=rt,zt.profile&&(Pt.stats=rt.stats),Pt.destroy=function(){rt.decRef()},Pt}zt.profile&&(gt.getTotalRenderbufferSize=function(){var cr=0;return Object.keys(sr).forEach(function(Cr){cr+=sr[Cr].stats.size}),cr});function Or(){ue(sr).forEach(function(cr){cr.renderbuffer=U.createRenderbuffer(),U.bindRenderbuffer(Zn,cr.renderbuffer),U.renderbufferStorage(Zn,cr.format,cr.width,cr.height)}),U.bindRenderbuffer(Zn,null)}return{create:wr,clear:function(){ue(sr).forEach(xr)},restore:Or}},ga=36160,Xs=36161,el=3553,ic=34069,Li=36064,ao=36096,Hp=36128,Ol=33306,Ih=36053,tl=36054,xs=36055,Dc=36057,wu=36061,Mh=36193,Fc=5121,kf=5126,Ph=6407,ac=6408,oc=6402,Gp=[Ph,ac],Cu=[];Cu[ac]=4,Cu[Ph]=3;var uu=[];uu[Fc]=1,uu[kf]=4,uu[Mh]=2;var Oh=32854,kl=32855,Ys=36194,Wp=33189,Df=36168,kh=34041,Dh=35907,p=34836,v=34842,d=34843,y=[Oh,kl,Ys,Dh,v,d,p],S={};S[Ih]="complete",S[tl]="incomplete attachment",S[Dc]="incomplete dimensions",S[xs]="incomplete, missing attachment",S[wu]="unsupported";function C(U,fe,Me,gt,zt,xt){var lt={cur:null,next:null,dirty:!1,setFBO:null},gr=["rgba"],sr=["rgba4","rgb565","rgb5 a1"];fe.ext_srgb&&sr.push("srgba"),fe.ext_color_buffer_half_float&&sr.push("rgba16f","rgb16f"),fe.webgl_color_buffer_float&&sr.push("rgba32f");var Ir=["uint8"];fe.oes_texture_half_float&&Ir.push("half float","float16"),fe.oes_texture_float&&Ir.push("float","float32");function xr(Br,mr,Wt){this.target=Br,this.texture=mr,this.renderbuffer=Wt;var Sn=0,ui=0;mr?(Sn=mr.width,ui=mr.height):Wt&&(Sn=Wt.width,ui=Wt.height),this.width=Sn,this.height=ui}function wr(Br){Br&&(Br.texture&&Br.texture._texture.decRef(),Br.renderbuffer&&Br.renderbuffer._renderbuffer.decRef())}function Or(Br,mr,Wt){if(Br)if(Br.texture){var Sn=Br.texture._texture,ui=Math.max(1,Sn.width),jr=Math.max(1,Sn.height);Q(ui===mr&&jr===Wt,"inconsistent width/height for supplied texture"),Sn.refCount+=1}else{var ri=Br.renderbuffer._renderbuffer;Q(ri.width===mr&&ri.height===Wt,"inconsistent width/height for renderbuffer"),ri.refCount+=1}}function cr(Br,mr){mr&&(mr.texture?U.framebufferTexture2D(ga,Br,mr.target,mr.texture._texture.texture,0):U.framebufferRenderbuffer(ga,Br,Xs,mr.renderbuffer._renderbuffer.renderbuffer))}function Cr(Br){var mr=el,Wt=null,Sn=null,ui=Br;typeof Br=="object"&&(ui=Br.data,"target"in Br&&(mr=Br.target|0)),Q.type(ui,"function","invalid attachment data");var jr=ui._reglType;return jr==="texture2d"?(Wt=ui,Q(mr===el)):jr==="textureCube"?(Wt=ui,Q(mr>=ic&&mr<ic+6,"invalid cube map target")):jr==="renderbuffer"?(Sn=ui,mr=Xs):Q.raise("invalid regl object for attachment"),new xr(mr,Wt,Sn)}function rt(Br,mr,Wt,Sn,ui){if(Wt){var jr=gt.create2D({width:Br,height:mr,format:Sn,type:ui});return jr._texture.refCount=0,new xr(el,jr,null)}else{var ri=zt.create({width:Br,height:mr,format:Sn});return ri._renderbuffer.refCount=0,new xr(Xs,null,ri)}}function Pt(Br){return Br&&(Br.texture||Br.renderbuffer)}function _r(Br,mr,Wt){Br&&(Br.texture?Br.texture.resize(mr,Wt):Br.renderbuffer&&Br.renderbuffer.resize(mr,Wt),Br.width=mr,Br.height=Wt)}var Nr=0,Jt={};function Vr(){this.id=Nr++,Jt[this.id]=this,this.framebuffer=U.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function dr(Br){Br.colorAttachments.forEach(wr),wr(Br.depthAttachment),wr(Br.stencilAttachment),wr(Br.depthStencilAttachment)}function Ur(Br){var mr=Br.framebuffer;Q(mr,"must not double destroy framebuffer"),U.deleteFramebuffer(mr),Br.framebuffer=null,xt.framebufferCount--,delete Jt[Br.id]}function er(Br){var mr;U.bindFramebuffer(ga,Br.framebuffer);var Wt=Br.colorAttachments;for(mr=0;mr<Wt.length;++mr)cr(Li+mr,Wt[mr]);for(mr=Wt.length;mr<Me.maxColorAttachments;++mr)U.framebufferTexture2D(ga,Li+mr,el,null,0);U.framebufferTexture2D(ga,Ol,el,null,0),U.framebufferTexture2D(ga,ao,el,null,0),U.framebufferTexture2D(ga,Hp,el,null,0),cr(ao,Br.depthAttachment),cr(Hp,Br.stencilAttachment),cr(Ol,Br.depthStencilAttachment);var Sn=U.checkFramebufferStatus(ga);!U.isContextLost()&&Sn!==Ih&&Q.raise("framebuffer configuration not supported, status = "+S[Sn]),U.bindFramebuffer(ga,lt.next?lt.next.framebuffer:null),lt.cur=lt.next,U.getError()}function Fr(Br,mr){var Wt=new Vr;xt.framebufferCount++;function Sn(jr,ri){var $n;Q(lt.next!==Wt,"can not update framebuffer which is currently in use");var Dn=0,Di=0,ja=!0,Io=!0,pi=null,Ha=!0,la="rgba",uo="uint8",lo=1,Oa=null,xo=null,Ko=null,co=!1;if(typeof jr=="number")Dn=jr|0,Di=ri|0||Dn;else if(!jr)Dn=Di=1;else{Q.type(jr,"object","invalid arguments for framebuffer");var ei=jr;if("shape"in ei){var zo=ei.shape;Q(Array.isArray(zo)&&zo.length>=2,"invalid shape for framebuffer"),Dn=zo[0],Di=zo[1]}else"radius"in ei&&(Dn=Di=ei.radius),"width"in ei&&(Dn=ei.width),"height"in ei&&(Di=ei.height);("color"in ei||"colors"in ei)&&(pi=ei.color||ei.colors,Array.isArray(pi)&&Q(pi.length===1||fe.webgl_draw_buffers,"multiple render targets not supported")),pi||("colorCount"in ei&&(lo=ei.colorCount|0,Q(lo>0,"invalid color buffer count")),"colorTexture"in ei&&(Ha=!!ei.colorTexture,la="rgba4"),"colorType"in ei&&(uo=ei.colorType,Ha?(Q(fe.oes_texture_float||!(uo==="float"||uo==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),Q(fe.oes_texture_half_float||!(uo==="half float"||uo==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):uo==="half float"||uo==="float16"?(Q(fe.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),la="rgba16f"):(uo==="float"||uo==="float32")&&(Q(fe.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),la="rgba32f"),Q.oneOf(uo,Ir,"invalid color type")),"colorFormat"in ei&&(la=ei.colorFormat,gr.indexOf(la)>=0?Ha=!0:sr.indexOf(la)>=0?Ha=!1:Ha?Q.oneOf(ei.colorFormat,gr,"invalid color format for texture"):Q.oneOf(ei.colorFormat,sr,"invalid color format for renderbuffer"))),("depthTexture"in ei||"depthStencilTexture"in ei)&&(co=!!(ei.depthTexture||ei.depthStencilTexture),Q(!co||fe.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in ei&&(typeof ei.depth=="boolean"?ja=ei.depth:(Oa=ei.depth,Io=!1)),"stencil"in ei&&(typeof ei.stencil=="boolean"?Io=ei.stencil:(xo=ei.stencil,ja=!1)),"depthStencil"in ei&&(typeof ei.depthStencil=="boolean"?ja=Io=ei.depthStencil:(Ko=ei.depthStencil,ja=!1,Io=!1))}var Ni=null,Mn=null,fi=null,Mi=null;if(Array.isArray(pi))Ni=pi.map(Cr);else if(pi)Ni=[Cr(pi)];else for(Ni=new Array(lo),$n=0;$n<lo;++$n)Ni[$n]=rt(Dn,Di,Ha,la,uo);Q(fe.webgl_draw_buffers||Ni.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),Q(Ni.length<=Me.maxColorAttachments,"too many color attachments, not supported"),Dn=Dn||Ni[0].width,Di=Di||Ni[0].height,Oa?Mn=Cr(Oa):ja&&!Io&&(Mn=rt(Dn,Di,co,"depth","uint32")),xo?fi=Cr(xo):Io&&!ja&&(fi=rt(Dn,Di,!1,"stencil","uint8")),Ko?Mi=Cr(Ko):!Oa&&!xo&&Io&&ja&&(Mi=rt(Dn,Di,co,"depth stencil","depth stencil")),Q(!!Oa+!!xo+!!Ko<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var Ga=null;for($n=0;$n<Ni.length;++$n)if(Or(Ni[$n],Dn,Di),Q(!Ni[$n]||Ni[$n].texture&&Gp.indexOf(Ni[$n].texture._texture.format)>=0||Ni[$n].renderbuffer&&y.indexOf(Ni[$n].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+$n+" is invalid"),Ni[$n]&&Ni[$n].texture){var il=Cu[Ni[$n].texture._texture.format]*uu[Ni[$n].texture._texture.type];Ga===null?Ga=il:Q(Ga===il,"all color attachments much have the same number of bits per pixel.")}return Or(Mn,Dn,Di),Q(!Mn||Mn.texture&&Mn.texture._texture.format===oc||Mn.renderbuffer&&Mn.renderbuffer._renderbuffer.format===Wp,"invalid depth attachment for framebuffer object"),Or(fi,Dn,Di),Q(!fi||fi.renderbuffer&&fi.renderbuffer._renderbuffer.format===Df,"invalid stencil attachment for framebuffer object"),Or(Mi,Dn,Di),Q(!Mi||Mi.texture&&Mi.texture._texture.format===kh||Mi.renderbuffer&&Mi.renderbuffer._renderbuffer.format===kh,"invalid depth-stencil attachment for framebuffer object"),dr(Wt),Wt.width=Dn,Wt.height=Di,Wt.colorAttachments=Ni,Wt.depthAttachment=Mn,Wt.stencilAttachment=fi,Wt.depthStencilAttachment=Mi,Sn.color=Ni.map(Pt),Sn.depth=Pt(Mn),Sn.stencil=Pt(fi),Sn.depthStencil=Pt(Mi),Sn.width=Wt.width,Sn.height=Wt.height,er(Wt),Sn}function ui(jr,ri){Q(lt.next!==Wt,"can not resize a framebuffer which is currently in use");var $n=Math.max(jr|0,1),Dn=Math.max(ri|0||$n,1);if($n===Wt.width&&Dn===Wt.height)return Sn;for(var Di=Wt.colorAttachments,ja=0;ja<Di.length;++ja)_r(Di[ja],$n,Dn);return _r(Wt.depthAttachment,$n,Dn),_r(Wt.stencilAttachment,$n,Dn),_r(Wt.depthStencilAttachment,$n,Dn),Wt.width=Sn.width=$n,Wt.height=Sn.height=Dn,er(Wt),Sn}return Sn(Br,mr),n(Sn,{resize:ui,_reglType:"framebuffer",_framebuffer:Wt,destroy:function(){Ur(Wt),dr(Wt)},use:function(jr){lt.setFBO({framebuffer:Sn},jr)}})}function En(Br){var mr=Array(6);function Wt(ui){var jr;Q(mr.indexOf(lt.next)<0,"can not update framebuffer which is currently in use");var ri={color:null},$n=0,Dn=null,Di="rgba",ja="uint8",Io=1;if(typeof ui=="number")$n=ui|0;else if(!ui)$n=1;else{Q.type(ui,"object","invalid arguments for framebuffer");var pi=ui;if("shape"in pi){var Ha=pi.shape;Q(Array.isArray(Ha)&&Ha.length>=2,"invalid shape for framebuffer"),Q(Ha[0]===Ha[1],"cube framebuffer must be square"),$n=Ha[0]}else"radius"in pi&&($n=pi.radius|0),"width"in pi?($n=pi.width|0,"height"in pi&&Q(pi.height===$n,"must be square")):"height"in pi&&($n=pi.height|0);("color"in pi||"colors"in pi)&&(Dn=pi.color||pi.colors,Array.isArray(Dn)&&Q(Dn.length===1||fe.webgl_draw_buffers,"multiple render targets not supported")),Dn||("colorCount"in pi&&(Io=pi.colorCount|0,Q(Io>0,"invalid color buffer count")),"colorType"in pi&&(Q.oneOf(pi.colorType,Ir,"invalid color type"),ja=pi.colorType),"colorFormat"in pi&&(Di=pi.colorFormat,Q.oneOf(pi.colorFormat,gr,"invalid color format for texture"))),"depth"in pi&&(ri.depth=pi.depth),"stencil"in pi&&(ri.stencil=pi.stencil),"depthStencil"in pi&&(ri.depthStencil=pi.depthStencil)}var la;if(Dn)if(Array.isArray(Dn))for(la=[],jr=0;jr<Dn.length;++jr)la[jr]=Dn[jr];else la=[Dn];else{la=Array(Io);var uo={radius:$n,format:Di,type:ja};for(jr=0;jr<Io;++jr)la[jr]=gt.createCube(uo)}for(ri.color=Array(la.length),jr=0;jr<la.length;++jr){var lo=la[jr];Q(typeof lo=="function"&&lo._reglType==="textureCube","invalid cube map"),$n=$n||lo.width,Q(lo.width===$n&&lo.height===$n,"invalid cube map shape"),ri.color[jr]={target:ic,data:la[jr]}}for(jr=0;jr<6;++jr){for(var Oa=0;Oa<la.length;++Oa)ri.color[Oa].target=ic+jr;jr>0&&(ri.depth=mr[0].depth,ri.stencil=mr[0].stencil,ri.depthStencil=mr[0].depthStencil),mr[jr]?mr[jr](ri):mr[jr]=Fr(ri)}return n(Wt,{width:$n,height:$n,color:la})}function Sn(ui){var jr,ri=ui|0;if(Q(ri>0&&ri<=Me.maxCubeMapSize,"invalid radius for cube fbo"),ri===Wt.width)return Wt;var $n=Wt.color;for(jr=0;jr<$n.length;++jr)$n[jr].resize(ri);for(jr=0;jr<6;++jr)mr[jr].resize(ri);return Wt.width=Wt.height=ri,Wt}return Wt(Br),n(Wt,{faces:mr,resize:Sn,_reglType:"framebufferCube",destroy:function(){mr.forEach(function(ui){ui.destroy()})}})}function jn(){lt.cur=null,lt.next=null,lt.dirty=!0,ue(Jt).forEach(function(Br){Br.framebuffer=U.createFramebuffer(),er(Br)})}return n(lt,{getFramebuffer:function(Br){if(typeof Br=="function"&&Br._reglType==="framebuffer"){var mr=Br._framebuffer;if(mr instanceof Vr)return mr}return null},create:Fr,createCube:En,clear:function(){ue(Jt).forEach(Ur)},restore:jn})}var I=5126,O=34962;function z(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=I,this.offset=0,this.stride=0,this.divisor=0}function X(U,fe,Me,gt,zt){for(var xt=Me.maxAttributes,lt=new Array(xt),gr=0;gr<xt;++gr)lt[gr]=new z;var sr=0,Ir={},xr={Record:z,scope:{},state:lt,currentVAO:null,targetVAO:null,restore:Or()?Jt:function(){},createVAO:Vr,getVAO:Cr,destroyBuffer:wr,setVAO:Or()?rt:Pt,clear:Or()?_r:function(){}};function wr(dr){for(var Ur=0;Ur<lt.length;++Ur){var er=lt[Ur];er.buffer===dr&&(U.disableVertexAttribArray(Ur),er.buffer=null)}}function Or(){return fe.oes_vertex_array_object}function cr(){return fe.angle_instanced_arrays}function Cr(dr){return typeof dr=="function"&&dr._vao?dr._vao:null}function rt(dr){if(dr!==xr.currentVAO){var Ur=Or();dr?Ur.bindVertexArrayOES(dr.vao):Ur.bindVertexArrayOES(null),xr.currentVAO=dr}}function Pt(dr){if(dr!==xr.currentVAO){if(dr)dr.bindAttrs();else for(var Ur=cr(),er=0;er<lt.length;++er){var Fr=lt[er];Fr.buffer?(U.enableVertexAttribArray(er),U.vertexAttribPointer(er,Fr.size,Fr.type,Fr.normalized,Fr.stride,Fr.offfset),Ur&&Ur.vertexAttribDivisorANGLE(er,Fr.divisor)):(U.disableVertexAttribArray(er),U.vertexAttrib4f(er,Fr.x,Fr.y,Fr.z,Fr.w))}xr.currentVAO=dr}}function _r(){ue(Ir).forEach(function(dr){dr.destroy()})}function Nr(){this.id=++sr,this.attributes=[];var dr=Or();dr?this.vao=dr.createVertexArrayOES():this.vao=null,Ir[this.id]=this,this.buffers=[]}Nr.prototype.bindAttrs=function(){for(var dr=cr(),Ur=this.attributes,er=0;er<Ur.length;++er){var Fr=Ur[er];Fr.buffer?(U.enableVertexAttribArray(er),U.bindBuffer(O,Fr.buffer.buffer),U.vertexAttribPointer(er,Fr.size,Fr.type,Fr.normalized,Fr.stride,Fr.offset),dr&&dr.vertexAttribDivisorANGLE(er,Fr.divisor)):(U.disableVertexAttribArray(er),U.vertexAttrib4f(er,Fr.x,Fr.y,Fr.z,Fr.w))}for(var En=Ur.length;En<xt;++En)U.disableVertexAttribArray(En)},Nr.prototype.refresh=function(){var dr=Or();dr&&(dr.bindVertexArrayOES(this.vao),this.bindAttrs(),xr.currentVAO=this)},Nr.prototype.destroy=function(){if(this.vao){var dr=Or();this===xr.currentVAO&&(xr.currentVAO=null,dr.bindVertexArrayOES(null)),dr.deleteVertexArrayOES(this.vao),this.vao=null}Ir[this.id]&&(delete Ir[this.id],gt.vaoCount-=1)};function Jt(){var dr=Or();dr&&ue(Ir).forEach(function(Ur){Ur.refresh()})}function Vr(dr){var Ur=new Nr;gt.vaoCount+=1;function er(Fr){Q(Array.isArray(Fr),"arguments to vertex array constructor must be an array"),Q(Fr.length<xt,"too many attributes"),Q(Fr.length>0,"must specify at least one attribute");for(var En=0;En<Ur.buffers.length;++En)Ur.buffers[En].destroy();Ur.buffers.length=0;var jn=Ur.attributes;jn.length=Fr.length;for(var Br=0;Br<Fr.length;++Br){var mr=Fr[Br],Wt=jn[Br]=new z;if(Array.isArray(mr)||r(mr)||ee(mr)){var Sn=zt.create(mr,O,!1,!0);Wt.buffer=zt.getBuffer(Sn),Wt.size=Wt.buffer.dimension|0,Wt.normalized=!1,Wt.type=Wt.buffer.dtype,Wt.offset=0,Wt.stride=0,Wt.divisor=0,Wt.state=1,Ur.buffers.push(Sn)}else zt.getBuffer(mr)?(Wt.buffer=zt.getBuffer(mr),Wt.size=Wt.buffer.dimension|0,Wt.normalized=!1,Wt.type=Wt.buffer.dtype,Wt.offset=0,Wt.stride=0,Wt.divisor=0,Wt.state=1):zt.getBuffer(mr.buffer)?(Wt.buffer=zt.getBuffer(mr.buffer),Wt.size=(+mr.size||Wt.buffer.dimension)|0,Wt.normalized=!!mr.normalized||!1,"type"in mr?(Q.parameter(mr.type,wo,"invalid buffer type"),Wt.type=wo[mr.type]):Wt.type=Wt.buffer.dtype,Wt.offset=(mr.offset||0)|0,Wt.stride=(mr.stride||0)|0,Wt.divisor=(mr.divisor||0)|0,Wt.state=1,Q(Wt.size>=1&&Wt.size<=4,"size must be between 1 and 4"),Q(Wt.offset>=0,"invalid offset"),Q(Wt.stride>=0&&Wt.stride<=255,"stride must be between 0 and 255"),Q(Wt.divisor>=0,"divisor must be positive"),Q(!Wt.divisor||!!fe.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in mr?(Q(Br>0,"first attribute must not be a constant"),Wt.x=+mr.x||0,Wt.y=+mr.y||0,Wt.z=+mr.z||0,Wt.w=+mr.w||0,Wt.state=2):Q(!1,"invalid attribute spec for location "+Br)}return Ur.refresh(),er}return er.destroy=function(){Ur.destroy()},er._vao=Ur,er._reglType="vao",er(dr)}return xr}var ne=35632,ae=35633,oe=35718,we=35721;function be(U,fe,Me,gt){var zt={},xt={};function lt(rt,Pt,_r,Nr){this.name=rt,this.id=Pt,this.location=_r,this.info=Nr}function gr(rt,Pt){for(var _r=0;_r<rt.length;++_r)if(rt[_r].id===Pt.id){rt[_r].location=Pt.location;return}rt.push(Pt)}function sr(rt,Pt,_r){var Nr=rt===ne?zt:xt,Jt=Nr[Pt];if(!Jt){var Vr=fe.str(Pt);Jt=U.createShader(rt),U.shaderSource(Jt,Vr),U.compileShader(Jt),Q.shaderError(U,Jt,Vr,rt,_r),Nr[Pt]=Jt}return Jt}var Ir={},xr=[],wr=0;function Or(rt,Pt){this.id=wr++,this.fragId=rt,this.vertId=Pt,this.program=null,this.uniforms=[],this.attributes=[],gt.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function cr(rt,Pt,_r){var Nr,Jt,Vr=sr(ne,rt.fragId),dr=sr(ae,rt.vertId),Ur=rt.program=U.createProgram();if(U.attachShader(Ur,Vr),U.attachShader(Ur,dr),_r)for(Nr=0;Nr<_r.length;++Nr){var er=_r[Nr];U.bindAttribLocation(Ur,er[0],er[1])}U.linkProgram(Ur),Q.linkError(U,Ur,fe.str(rt.fragId),fe.str(rt.vertId),Pt);var Fr=U.getProgramParameter(Ur,oe);gt.profile&&(rt.stats.uniformsCount=Fr);var En=rt.uniforms;for(Nr=0;Nr<Fr;++Nr)if(Jt=U.getActiveUniform(Ur,Nr),Jt)if(Jt.size>1)for(var jn=0;jn<Jt.size;++jn){var Br=Jt.name.replace("[0]","["+jn+"]");gr(En,new lt(Br,fe.id(Br),U.getUniformLocation(Ur,Br),Jt))}else gr(En,new lt(Jt.name,fe.id(Jt.name),U.getUniformLocation(Ur,Jt.name),Jt));var mr=U.getProgramParameter(Ur,we);gt.profile&&(rt.stats.attributesCount=mr);var Wt=rt.attributes;for(Nr=0;Nr<mr;++Nr)Jt=U.getActiveAttrib(Ur,Nr),Jt&&gr(Wt,new lt(Jt.name,fe.id(Jt.name),U.getAttribLocation(Ur,Jt.name),Jt))}gt.profile&&(Me.getMaxUniformsCount=function(){var rt=0;return xr.forEach(function(Pt){Pt.stats.uniformsCount>rt&&(rt=Pt.stats.uniformsCount)}),rt},Me.getMaxAttributesCount=function(){var rt=0;return xr.forEach(function(Pt){Pt.stats.attributesCount>rt&&(rt=Pt.stats.attributesCount)}),rt});function Cr(){zt={},xt={};for(var rt=0;rt<xr.length;++rt)cr(xr[rt],null,xr[rt].attributes.map(function(Pt){return[Pt.location,Pt.name]}))}return{clear:function(){var rt=U.deleteShader.bind(U);ue(zt).forEach(rt),zt={},ue(xt).forEach(rt),xt={},xr.forEach(function(Pt){U.deleteProgram(Pt.program)}),xr.length=0,Ir={},Me.shaderCount=0},program:function(rt,Pt,_r,Nr){Q.command(rt>=0,"missing vertex shader",_r),Q.command(Pt>=0,"missing fragment shader",_r);var Jt=Ir[Pt];Jt||(Jt=Ir[Pt]={});var Vr=Jt[rt];if(Vr&&!Nr)return Vr;var dr=new Or(Pt,rt);return Me.shaderCount++,cr(dr,_r,Nr),Vr||(Jt[rt]=dr),xr.push(dr),dr},restore:Cr,shader:sr,frag:-1,vert:-1}}var Fe=6408,_e=5121,De=3333,Xe=5126;function ot(U,fe,Me,gt,zt,xt,lt){function gr(xr){var wr;fe.next===null?(Q(zt.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),wr=_e):(Q(fe.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),wr=fe.next.colorAttachments[0].texture._texture.type,xt.oes_texture_float?(Q(wr===_e||wr===Xe,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),wr===Xe&&Q(lt.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):Q(wr===_e,"Reading from a framebuffer is only allowed for the type 'uint8'"));var Or=0,cr=0,Cr=gt.framebufferWidth,rt=gt.framebufferHeight,Pt=null;r(xr)?Pt=xr:xr&&(Q.type(xr,"object","invalid arguments to regl.read()"),Or=xr.x|0,cr=xr.y|0,Q(Or>=0&&Or<gt.framebufferWidth,"invalid x offset for regl.read"),Q(cr>=0&&cr<gt.framebufferHeight,"invalid y offset for regl.read"),Cr=(xr.width||gt.framebufferWidth-Or)|0,rt=(xr.height||gt.framebufferHeight-cr)|0,Pt=xr.data||null),Pt&&(wr===_e?Q(Pt instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):wr===Xe&&Q(Pt instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),Q(Cr>0&&Cr+Or<=gt.framebufferWidth,"invalid width for read pixels"),Q(rt>0&&rt+cr<=gt.framebufferHeight,"invalid height for read pixels"),Me();var _r=Cr*rt*4;return Pt||(wr===_e?Pt=new Uint8Array(_r):wr===Xe&&(Pt=Pt||new Float32Array(_r))),Q.isTypedArray(Pt,"data buffer for regl.read() must be a typedarray"),Q(Pt.byteLength>=_r,"data buffer for regl.read() too small"),U.pixelStorei(De,4),U.readPixels(Or,cr,Cr,rt,Fe,wr,Pt),Pt}function sr(xr){var wr;return fe.setFBO({framebuffer:xr.framebuffer},function(){wr=gr(xr)}),wr}function Ir(xr){return!xr||!("framebuffer"in xr)?gr(xr):sr(xr)}return Ir}function Ct(U){return Array.prototype.slice.call(U)}function mt(U){return Ct(U).join("")}function kt(){var U=0,fe=[],Me=[];function gt(wr){for(var Or=0;Or<Me.length;++Or)if(Me[Or]===wr)return fe[Or];var cr="g"+U++;return fe.push(cr),Me.push(wr),cr}function zt(){var wr=[];function Or(){wr.push.apply(wr,Ct(arguments))}var cr=[];function Cr(){var rt="v"+U++;return cr.push(rt),arguments.length>0&&(wr.push(rt,"="),wr.push.apply(wr,Ct(arguments)),wr.push(";")),rt}return n(Or,{def:Cr,toString:function(){return mt([cr.length>0?"var "+cr.join(",")+";":"",mt(wr)])}})}function xt(){var wr=zt(),Or=zt(),cr=wr.toString,Cr=Or.toString;function rt(Pt,_r){Or(Pt,_r,"=",wr.def(Pt,_r),";")}return n(function(){wr.apply(wr,Ct(arguments))},{def:wr.def,entry:wr,exit:Or,save:rt,set:function(Pt,_r,Nr){rt(Pt,_r),wr(Pt,_r,"=",Nr,";")},toString:function(){return cr()+Cr()}})}function lt(){var wr=mt(arguments),Or=xt(),cr=xt(),Cr=Or.toString,rt=cr.toString;return n(Or,{then:function(){return Or.apply(Or,Ct(arguments)),this},else:function(){return cr.apply(cr,Ct(arguments)),this},toString:function(){var Pt=rt();return Pt&&(Pt="else{"+Pt+"}"),mt(["if(",wr,"){",Cr(),"}",Pt])}})}var gr=zt(),sr={};function Ir(wr,Or){var cr=[];function Cr(){var Jt="a"+cr.length;return cr.push(Jt),Jt}Or=Or||0;for(var rt=0;rt<Or;++rt)Cr();var Pt=xt(),_r=Pt.toString,Nr=sr[wr]=n(Pt,{arg:Cr,toString:function(){return mt(["function(",cr.join(),"){",_r(),"}"])}});return Nr}function xr(){var wr=['"use strict";',gr,"return {"];Object.keys(sr).forEach(function(Cr){wr.push('"',Cr,'":',sr[Cr].toString(),",")}),wr.push("}");var Or=mt(wr).replace(/;/g,`;
|
|
`).replace(/}/g,`}
|
|
`).replace(/{/g,`{
|
|
`),cr=Function.apply(null,fe.concat(Or));return cr.apply(null,Me)}return{global:gr,link:gt,block:zt,proc:Ir,scope:xt,cond:lt,compile:xr}}var qt="xyzw".split(""),Tr=5121,yr=1,$r=2,vn=0,bn=1,xn=2,Si=3,Yr=4,Un="dither",Kn="blend.enable",Bn="blend.color",On="blend.equation",Yn="blend.func",kn="depth.enable",In="depth.func",$a="depth.range",xa="depth.mask",_o="colorMask",oo="cull.enable",_a="cull.face",ba="frontFace",Yo="lineWidth",Uo="polygonOffset.enable",Ru="polygonOffset.offset",Zo="sample.alpha",Zs="sample.enable",bs="sample.coverage",Bc="stencil.enable",sc="stencil.mask",Iu="stencil.func",Dl="stencil.opFront",rl="stencil.opBack",lu="scissor.enable",Fl="scissor.box",Ro="viewport",Ma="profile",as="framebuffer",qs="vert",cu="frag",vi="elements",yo="primitive",Va="count",Mu="offset",Fh="instances",Bl="vao",Xp="Width",uc="Height",lc=as+Xp,fu=as+uc,Bh=Ro+Xp,B0=Ro+uc,Lc="drawingBuffer",os=Lc+Xp,e2=Lc+uc,t2=[Yn,On,Iu,Dl,rl,bs,Ro,Fl,Ru],Lh=34962,by=34963,Ey=35632,Sy=35633,Y1=3553,Ay=34067,Z1=2884,r2=3042,Nc=3024,Yp=2960,Ty=2929,wy=3089,Cy=32823,Ry=32926,Iy=32928,L0=5126,q1=35664,Nh=35665,K1=35666,Uc=5124,Q1=35667,Pa=35668,Ff=35669,J1=35670,Bf=35671,Lf=35672,zc=35673,Uh=35674,zh=35675,cc=35676,Nf=35678,Uf=35680,n2=4,fc=1028,zf=1029,ed=2304,N0=2305,U0=32775,z0=32776,nl=519,$c=7680,i2=0,a2=1,o2=32774,s2=513,$f=36160,My=36064,Ll={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},$0=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Vf={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Vc={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},u2={frag:Ey,vert:Sy},jc={cw:ed,ccw:N0};function td(U){return Array.isArray(U)||r(U)||ee(U)}function rd(U){return U.sort(function(fe,Me){return fe===Ro?-1:Me===Ro?1:fe<Me?-1:1})}function ss(U,fe,Me,gt){this.thisDep=U,this.contextDep=fe,this.propDep=Me,this.append=gt}function qo(U){return U&&!(U.thisDep||U.contextDep||U.propDep)}function so(U){return new ss(!1,!1,!1,U)}function Ks(U,fe){var Me=U.type;if(Me===vn){var gt=U.data.length;return new ss(!0,gt>=1,gt>=2,fe)}else if(Me===Yr){var zt=U.data;return new ss(zt.thisDep,zt.contextDep,zt.propDep,fe)}else return new ss(Me===Si,Me===xn,Me===bn,fe)}var l2=new ss(!1,!1,!1,function(){});function Zp(U,fe,Me,gt,zt,xt,lt,gr,sr,Ir,xr,wr,Or,cr,Cr){var rt=Ir.Record,Pt={add:32774,subtract:32778,"reverse subtract":32779};Me.ext_blend_minmax&&(Pt.min=U0,Pt.max=z0);var _r=Me.angle_instanced_arrays,Nr=Me.webgl_draw_buffers,Jt={dirty:!0,profile:Cr.profile},Vr={},dr=[],Ur={},er={};function Fr(te){return te.replace(".","_")}function En(te,me,Pe){var vt=Fr(te);dr.push(te),Vr[vt]=Jt[vt]=!!Pe,Ur[vt]=me}function jn(te,me,Pe){var vt=Fr(te);dr.push(te),Array.isArray(Pe)?(Jt[vt]=Pe.slice(),Vr[vt]=Pe.slice()):Jt[vt]=Vr[vt]=Pe,er[vt]=me}En(Un,Nc),En(Kn,r2),jn(Bn,"blendColor",[0,0,0,0]),jn(On,"blendEquationSeparate",[o2,o2]),jn(Yn,"blendFuncSeparate",[a2,i2,a2,i2]),En(kn,Ty,!0),jn(In,"depthFunc",s2),jn($a,"depthRange",[0,1]),jn(xa,"depthMask",!0),jn(_o,_o,[!0,!0,!0,!0]),En(oo,Z1),jn(_a,"cullFace",zf),jn(ba,ba,N0),jn(Yo,Yo,1),En(Uo,Cy),jn(Ru,"polygonOffset",[0,0]),En(Zo,Ry),En(Zs,Iy),jn(bs,"sampleCoverage",[1,!1]),En(Bc,Yp),jn(sc,"stencilMask",-1),jn(Iu,"stencilFunc",[nl,0,-1]),jn(Dl,"stencilOpSeparate",[fc,$c,$c,$c]),jn(rl,"stencilOpSeparate",[zf,$c,$c,$c]),En(lu,wy),jn(Fl,"scissor",[0,0,U.drawingBufferWidth,U.drawingBufferHeight]),jn(Ro,Ro,[0,0,U.drawingBufferWidth,U.drawingBufferHeight]);var Br={gl:U,context:Or,strings:fe,next:Vr,current:Jt,draw:wr,elements:xt,buffer:zt,shader:xr,attributes:Ir.state,vao:Ir,uniforms:sr,framebuffer:gr,extensions:Me,timer:cr,isBufferArgs:td},mr={primTypes:bu,compareFuncs:Vf,blendFuncs:Ll,blendEquations:Pt,stencilOps:Vc,glTypes:wo,orientationType:jc};Q.optional(function(){Br.isArrayLike=Ia}),Nr&&(mr.backBuffer=[zf],mr.drawBuffer=Fn(gt.maxDrawbuffers,function(te){return te===0?[0]:Fn(te,function(me){return My+me})}));var Wt=0;function Sn(){var te=kt(),me=te.link,Pe=te.global;te.id=Wt++,te.batchId="0";var vt=me(Br),ht=te.shared={props:"a0"};Object.keys(Br).forEach(function(Ve){ht[Ve]=Pe.def(vt,".",Ve)}),Q.optional(function(){te.CHECK=me(Q),te.commandStr=Q.guessCommand(),te.command=me(te.commandStr),te.assert=function(Ve,pe,He){Ve("if(!(",pe,"))",this.CHECK,".commandRaise(",me(He),",",this.command,");")},mr.invalidBlendCombinations=$0});var Le=te.next={},We=te.current={};Object.keys(er).forEach(function(Ve){Array.isArray(Jt[Ve])&&(Le[Ve]=Pe.def(ht.next,".",Ve),We[Ve]=Pe.def(ht.current,".",Ve))});var Ze=te.constants={};Object.keys(mr).forEach(function(Ve){Ze[Ve]=Pe.def(JSON.stringify(mr[Ve]))}),te.invoke=function(Ve,pe){switch(pe.type){case vn:var He=["this",ht.context,ht.props,te.batchId];return Ve.def(me(pe.data),".call(",He.slice(0,Math.max(pe.data.length+1,4)),")");case bn:return Ve.def(ht.props,pe.data);case xn:return Ve.def(ht.context,pe.data);case Si:return Ve.def("this",pe.data);case Yr:return pe.data.append(te,Ve),pe.data.ref}},te.attribCache={};var Te={};return te.scopeAttrib=function(Ve){var pe=fe.id(Ve);if(pe in Te)return Te[pe];var He=Ir.scope[pe];He||(He=Ir.scope[pe]=new rt);var Tt=Te[pe]=me(He);return Tt},te}function ui(te){var me=te.static,Pe=te.dynamic,vt;if(Ma in me){var ht=!!me[Ma];vt=so(function(We,Ze){return ht}),vt.enable=ht}else if(Ma in Pe){var Le=Pe[Ma];vt=Ks(Le,function(We,Ze){return We.invoke(Ze,Le)})}return vt}function jr(te,me){var Pe=te.static,vt=te.dynamic;if(as in Pe){var ht=Pe[as];return ht?(ht=gr.getFramebuffer(ht),Q.command(ht,"invalid framebuffer object"),so(function(We,Ze){var Te=We.link(ht),Ve=We.shared;Ze.set(Ve.framebuffer,".next",Te);var pe=Ve.context;return Ze.set(pe,"."+lc,Te+".width"),Ze.set(pe,"."+fu,Te+".height"),Te})):so(function(We,Ze){var Te=We.shared;Ze.set(Te.framebuffer,".next","null");var Ve=Te.context;return Ze.set(Ve,"."+lc,Ve+"."+os),Ze.set(Ve,"."+fu,Ve+"."+e2),"null"})}else if(as in vt){var Le=vt[as];return Ks(Le,function(We,Ze){var Te=We.invoke(Ze,Le),Ve=We.shared,pe=Ve.framebuffer,He=Ze.def(pe,".getFramebuffer(",Te,")");Q.optional(function(){We.assert(Ze,"!"+Te+"||"+He,"invalid framebuffer object")}),Ze.set(pe,".next",He);var Tt=Ve.context;return Ze.set(Tt,"."+lc,He+"?"+He+".width:"+Tt+"."+os),Ze.set(Tt,"."+fu,He+"?"+He+".height:"+Tt+"."+e2),He})}else return null}function ri(te,me,Pe){var vt=te.static,ht=te.dynamic;function Le(Te){if(Te in vt){var Ve=vt[Te];Q.commandType(Ve,"object","invalid "+Te,Pe.commandStr);var pe=!0,He=Ve.x|0,Tt=Ve.y|0,Ft,ir;return"width"in Ve?(Ft=Ve.width|0,Q.command(Ft>=0,"invalid "+Te,Pe.commandStr)):pe=!1,"height"in Ve?(ir=Ve.height|0,Q.command(ir>=0,"invalid "+Te,Pe.commandStr)):pe=!1,new ss(!pe&&me&&me.thisDep,!pe&&me&&me.contextDep,!pe&&me&&me.propDep,function(cn,Jr){var on=cn.shared.context,Pn=Ft;"width"in Ve||(Pn=Jr.def(on,".",lc,"-",He));var zn=ir;return"height"in Ve||(zn=Jr.def(on,".",fu,"-",Tt)),[He,Tt,Pn,zn]})}else if(Te in ht){var Yt=ht[Te],fr=Ks(Yt,function(cn,Jr){var on=cn.invoke(Jr,Yt);Q.optional(function(){cn.assert(Jr,on+"&&typeof "+on+'==="object"',"invalid "+Te)});var Pn=cn.shared.context,zn=Jr.def(on,".x|0"),Ui=Jr.def(on,".y|0"),fo=Jr.def('"width" in ',on,"?",on,".width|0:","(",Pn,".",lc,"-",zn,")"),al=Jr.def('"height" in ',on,"?",on,".height|0:","(",Pn,".",fu,"-",Ui,")");return Q.optional(function(){cn.assert(Jr,fo+">=0&&"+al+">=0","invalid "+Te)}),[zn,Ui,fo,al]});return me&&(fr.thisDep=fr.thisDep||me.thisDep,fr.contextDep=fr.contextDep||me.contextDep,fr.propDep=fr.propDep||me.propDep),fr}else return me?new ss(me.thisDep,me.contextDep,me.propDep,function(cn,Jr){var on=cn.shared.context;return[0,0,Jr.def(on,".",lc),Jr.def(on,".",fu)]}):null}var We=Le(Ro);if(We){var Ze=We;We=new ss(We.thisDep,We.contextDep,We.propDep,function(Te,Ve){var pe=Ze.append(Te,Ve),He=Te.shared.context;return Ve.set(He,"."+Bh,pe[2]),Ve.set(He,"."+B0,pe[3]),pe})}return{viewport:We,scissor_box:Le(Fl)}}function $n(te,me){var Pe=te.static,vt=typeof Pe[cu]=="string"&&typeof Pe[qs]=="string";if(vt){if(Object.keys(me.dynamic).length>0)return null;var ht=me.static,Le=Object.keys(ht);if(Le.length>0&&typeof ht[Le[0]]=="number"){for(var We=[],Ze=0;Ze<Le.length;++Ze)Q(typeof ht[Le[Ze]]=="number","must specify all vertex attribute locations when using vaos"),We.push([ht[Le[Ze]]|0,Le[Ze]]);return We}}return null}function Dn(te,me,Pe){var vt=te.static,ht=te.dynamic;function Le(pe){if(pe in vt){var He=fe.id(vt[pe]);Q.optional(function(){xr.shader(u2[pe],He,Q.guessCommand())});var Tt=so(function(){return He});return Tt.id=He,Tt}else if(pe in ht){var Ft=ht[pe];return Ks(Ft,function(ir,Yt){var fr=ir.invoke(Yt,Ft),cn=Yt.def(ir.shared.strings,".id(",fr,")");return Q.optional(function(){Yt(ir.shared.shader,".shader(",u2[pe],",",cn,",",ir.command,");")}),cn})}return null}var We=Le(cu),Ze=Le(qs),Te=null,Ve;return qo(We)&&qo(Ze)?(Te=xr.program(Ze.id,We.id,null,Pe),Ve=so(function(pe,He){return pe.link(Te)})):Ve=new ss(We&&We.thisDep||Ze&&Ze.thisDep,We&&We.contextDep||Ze&&Ze.contextDep,We&&We.propDep||Ze&&Ze.propDep,function(pe,He){var Tt=pe.shared.shader,Ft;We?Ft=We.append(pe,He):Ft=He.def(Tt,".",cu);var ir;Ze?ir=Ze.append(pe,He):ir=He.def(Tt,".",qs);var Yt=Tt+".program("+ir+","+Ft;return Q.optional(function(){Yt+=","+pe.command}),He.def(Yt+")")}),{frag:We,vert:Ze,progVar:Ve,program:Te}}function Di(te,me){var Pe=te.static,vt=te.dynamic;function ht(){if(vi in Pe){var pe=Pe[vi];td(pe)?pe=xt.getElements(xt.create(pe,!0)):pe&&(pe=xt.getElements(pe),Q.command(pe,"invalid elements",me.commandStr));var He=so(function(Ft,ir){if(pe){var Yt=Ft.link(pe);return Ft.ELEMENTS=Yt,Yt}return Ft.ELEMENTS=null,null});return He.value=pe,He}else if(vi in vt){var Tt=vt[vi];return Ks(Tt,function(Ft,ir){var Yt=Ft.shared,fr=Yt.isBufferArgs,cn=Yt.elements,Jr=Ft.invoke(ir,Tt),on=ir.def("null"),Pn=ir.def(fr,"(",Jr,")"),zn=Ft.cond(Pn).then(on,"=",cn,".createStream(",Jr,");").else(on,"=",cn,".getElements(",Jr,");");return Q.optional(function(){Ft.assert(zn.else,"!"+Jr+"||"+on,"invalid elements")}),ir.entry(zn),ir.exit(Ft.cond(Pn).then(cn,".destroyStream(",on,");")),Ft.ELEMENTS=on,on})}return null}var Le=ht();function We(){if(yo in Pe){var pe=Pe[yo];return Q.commandParameter(pe,bu,"invalid primitve",me.commandStr),so(function(Tt,Ft){return bu[pe]})}else if(yo in vt){var He=vt[yo];return Ks(He,function(Tt,Ft){var ir=Tt.constants.primTypes,Yt=Tt.invoke(Ft,He);return Q.optional(function(){Tt.assert(Ft,Yt+" in "+ir,"invalid primitive, must be one of "+Object.keys(bu))}),Ft.def(ir,"[",Yt,"]")})}else if(Le)return qo(Le)?Le.value?so(function(Tt,Ft){return Ft.def(Tt.ELEMENTS,".primType")}):so(function(){return n2}):new ss(Le.thisDep,Le.contextDep,Le.propDep,function(Tt,Ft){var ir=Tt.ELEMENTS;return Ft.def(ir,"?",ir,".primType:",n2)});return null}function Ze(pe,He){if(pe in Pe){var Tt=Pe[pe]|0;return Q.command(!He||Tt>=0,"invalid "+pe,me.commandStr),so(function(ir,Yt){return He&&(ir.OFFSET=Tt),Tt})}else if(pe in vt){var Ft=vt[pe];return Ks(Ft,function(ir,Yt){var fr=ir.invoke(Yt,Ft);return He&&(ir.OFFSET=fr,Q.optional(function(){ir.assert(Yt,fr+">=0","invalid "+pe)})),fr})}else if(He&&Le)return so(function(ir,Yt){return ir.OFFSET="0",0});return null}var Te=Ze(Mu,!0);function Ve(){if(Va in Pe){var pe=Pe[Va]|0;return Q.command(typeof pe=="number"&&pe>=0,"invalid vertex count",me.commandStr),so(function(){return pe})}else if(Va in vt){var He=vt[Va];return Ks(He,function(ir,Yt){var fr=ir.invoke(Yt,He);return Q.optional(function(){ir.assert(Yt,"typeof "+fr+'==="number"&&'+fr+">=0&&"+fr+"===("+fr+"|0)","invalid vertex count")}),fr})}else if(Le)if(qo(Le)){if(Le)return Te?new ss(Te.thisDep,Te.contextDep,Te.propDep,function(ir,Yt){var fr=Yt.def(ir.ELEMENTS,".vertCount-",ir.OFFSET);return Q.optional(function(){ir.assert(Yt,fr+">=0","invalid vertex offset/element buffer too small")}),fr}):so(function(ir,Yt){return Yt.def(ir.ELEMENTS,".vertCount")});var Tt=so(function(){return-1});return Q.optional(function(){Tt.MISSING=!0}),Tt}else{var Ft=new ss(Le.thisDep||Te.thisDep,Le.contextDep||Te.contextDep,Le.propDep||Te.propDep,function(ir,Yt){var fr=ir.ELEMENTS;return ir.OFFSET?Yt.def(fr,"?",fr,".vertCount-",ir.OFFSET,":-1"):Yt.def(fr,"?",fr,".vertCount:-1")});return Q.optional(function(){Ft.DYNAMIC=!0}),Ft}return null}return{elements:Le,primitive:We(),count:Ve(),instances:Ze(Fh,!1),offset:Te}}function ja(te,me){var Pe=te.static,vt=te.dynamic,ht={};return dr.forEach(function(Le){var We=Fr(Le);function Ze(Te,Ve){if(Le in Pe){var pe=Te(Pe[Le]);ht[We]=so(function(){return pe})}else if(Le in vt){var He=vt[Le];ht[We]=Ks(He,function(Tt,Ft){return Ve(Tt,Ft,Tt.invoke(Ft,He))})}}switch(Le){case oo:case Kn:case Un:case Bc:case kn:case lu:case Uo:case Zo:case Zs:case xa:return Ze(function(Te){return Q.commandType(Te,"boolean",Le,me.commandStr),Te},function(Te,Ve,pe){return Q.optional(function(){Te.assert(Ve,"typeof "+pe+'==="boolean"',"invalid flag "+Le,Te.commandStr)}),pe});case In:return Ze(function(Te){return Q.commandParameter(Te,Vf,"invalid "+Le,me.commandStr),Vf[Te]},function(Te,Ve,pe){var He=Te.constants.compareFuncs;return Q.optional(function(){Te.assert(Ve,pe+" in "+He,"invalid "+Le+", must be one of "+Object.keys(Vf))}),Ve.def(He,"[",pe,"]")});case $a:return Ze(function(Te){return Q.command(Ia(Te)&&Te.length===2&&typeof Te[0]=="number"&&typeof Te[1]=="number"&&Te[0]<=Te[1],"depth range is 2d array",me.commandStr),Te},function(Te,Ve,pe){Q.optional(function(){Te.assert(Ve,Te.shared.isArrayLike+"("+pe+")&&"+pe+".length===2&&typeof "+pe+'[0]==="number"&&typeof '+pe+'[1]==="number"&&'+pe+"[0]<="+pe+"[1]","depth range must be a 2d array")});var He=Ve.def("+",pe,"[0]"),Tt=Ve.def("+",pe,"[1]");return[He,Tt]});case Yn:return Ze(function(Te){Q.commandType(Te,"object","blend.func",me.commandStr);var Ve="srcRGB"in Te?Te.srcRGB:Te.src,pe="srcAlpha"in Te?Te.srcAlpha:Te.src,He="dstRGB"in Te?Te.dstRGB:Te.dst,Tt="dstAlpha"in Te?Te.dstAlpha:Te.dst;return Q.commandParameter(Ve,Ll,We+".srcRGB",me.commandStr),Q.commandParameter(pe,Ll,We+".srcAlpha",me.commandStr),Q.commandParameter(He,Ll,We+".dstRGB",me.commandStr),Q.commandParameter(Tt,Ll,We+".dstAlpha",me.commandStr),Q.command($0.indexOf(Ve+", "+He)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+Ve+", "+He+")",me.commandStr),[Ll[Ve],Ll[He],Ll[pe],Ll[Tt]]},function(Te,Ve,pe){var He=Te.constants.blendFuncs;Q.optional(function(){Te.assert(Ve,pe+"&&typeof "+pe+'==="object"',"invalid blend func, must be an object")});function Tt(on,Pn){var zn=Ve.def('"',on,Pn,'" in ',pe,"?",pe,".",on,Pn,":",pe,".",on);return Q.optional(function(){Te.assert(Ve,zn+" in "+He,"invalid "+Le+"."+on+Pn+", must be one of "+Object.keys(Ll))}),zn}var Ft=Tt("src","RGB"),ir=Tt("dst","RGB");Q.optional(function(){var on=Te.constants.invalidBlendCombinations;Te.assert(Ve,on+".indexOf("+Ft+'+", "+'+ir+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var Yt=Ve.def(He,"[",Ft,"]"),fr=Ve.def(He,"[",Tt("src","Alpha"),"]"),cn=Ve.def(He,"[",ir,"]"),Jr=Ve.def(He,"[",Tt("dst","Alpha"),"]");return[Yt,cn,fr,Jr]});case On:return Ze(function(Te){if(typeof Te=="string")return Q.commandParameter(Te,Pt,"invalid "+Le,me.commandStr),[Pt[Te],Pt[Te]];if(typeof Te=="object")return Q.commandParameter(Te.rgb,Pt,Le+".rgb",me.commandStr),Q.commandParameter(Te.alpha,Pt,Le+".alpha",me.commandStr),[Pt[Te.rgb],Pt[Te.alpha]];Q.commandRaise("invalid blend.equation",me.commandStr)},function(Te,Ve,pe){var He=Te.constants.blendEquations,Tt=Ve.def(),Ft=Ve.def(),ir=Te.cond("typeof ",pe,'==="string"');return Q.optional(function(){function Yt(fr,cn,Jr){Te.assert(fr,Jr+" in "+He,"invalid "+cn+", must be one of "+Object.keys(Pt))}Yt(ir.then,Le,pe),Te.assert(ir.else,pe+"&&typeof "+pe+'==="object"',"invalid "+Le),Yt(ir.else,Le+".rgb",pe+".rgb"),Yt(ir.else,Le+".alpha",pe+".alpha")}),ir.then(Tt,"=",Ft,"=",He,"[",pe,"];"),ir.else(Tt,"=",He,"[",pe,".rgb];",Ft,"=",He,"[",pe,".alpha];"),Ve(ir),[Tt,Ft]});case Bn:return Ze(function(Te){return Q.command(Ia(Te)&&Te.length===4,"blend.color must be a 4d array",me.commandStr),Fn(4,function(Ve){return+Te[Ve]})},function(Te,Ve,pe){return Q.optional(function(){Te.assert(Ve,Te.shared.isArrayLike+"("+pe+")&&"+pe+".length===4","blend.color must be a 4d array")}),Fn(4,function(He){return Ve.def("+",pe,"[",He,"]")})});case sc:return Ze(function(Te){return Q.commandType(Te,"number",We,me.commandStr),Te|0},function(Te,Ve,pe){return Q.optional(function(){Te.assert(Ve,"typeof "+pe+'==="number"',"invalid stencil.mask")}),Ve.def(pe,"|0")});case Iu:return Ze(function(Te){Q.commandType(Te,"object",We,me.commandStr);var Ve=Te.cmp||"keep",pe=Te.ref||0,He="mask"in Te?Te.mask:-1;return Q.commandParameter(Ve,Vf,Le+".cmp",me.commandStr),Q.commandType(pe,"number",Le+".ref",me.commandStr),Q.commandType(He,"number",Le+".mask",me.commandStr),[Vf[Ve],pe,He]},function(Te,Ve,pe){var He=Te.constants.compareFuncs;Q.optional(function(){function Yt(){Te.assert(Ve,Array.prototype.join.call(arguments,""),"invalid stencil.func")}Yt(pe+"&&typeof ",pe,'==="object"'),Yt('!("cmp" in ',pe,")||(",pe,".cmp in ",He,")")});var Tt=Ve.def('"cmp" in ',pe,"?",He,"[",pe,".cmp]",":",$c),Ft=Ve.def(pe,".ref|0"),ir=Ve.def('"mask" in ',pe,"?",pe,".mask|0:-1");return[Tt,Ft,ir]});case Dl:case rl:return Ze(function(Te){Q.commandType(Te,"object",We,me.commandStr);var Ve=Te.fail||"keep",pe=Te.zfail||"keep",He=Te.zpass||"keep";return Q.commandParameter(Ve,Vc,Le+".fail",me.commandStr),Q.commandParameter(pe,Vc,Le+".zfail",me.commandStr),Q.commandParameter(He,Vc,Le+".zpass",me.commandStr),[Le===rl?zf:fc,Vc[Ve],Vc[pe],Vc[He]]},function(Te,Ve,pe){var He=Te.constants.stencilOps;Q.optional(function(){Te.assert(Ve,pe+"&&typeof "+pe+'==="object"',"invalid "+Le)});function Tt(Ft){return Q.optional(function(){Te.assert(Ve,'!("'+Ft+'" in '+pe+")||("+pe+"."+Ft+" in "+He+")","invalid "+Le+"."+Ft+", must be one of "+Object.keys(Vc))}),Ve.def('"',Ft,'" in ',pe,"?",He,"[",pe,".",Ft,"]:",$c)}return[Le===rl?zf:fc,Tt("fail"),Tt("zfail"),Tt("zpass")]});case Ru:return Ze(function(Te){Q.commandType(Te,"object",We,me.commandStr);var Ve=Te.factor|0,pe=Te.units|0;return Q.commandType(Ve,"number",We+".factor",me.commandStr),Q.commandType(pe,"number",We+".units",me.commandStr),[Ve,pe]},function(Te,Ve,pe){Q.optional(function(){Te.assert(Ve,pe+"&&typeof "+pe+'==="object"',"invalid "+Le)});var He=Ve.def(pe,".factor|0"),Tt=Ve.def(pe,".units|0");return[He,Tt]});case _a:return Ze(function(Te){var Ve=0;return Te==="front"?Ve=fc:Te==="back"&&(Ve=zf),Q.command(!!Ve,We,me.commandStr),Ve},function(Te,Ve,pe){return Q.optional(function(){Te.assert(Ve,pe+'==="front"||'+pe+'==="back"',"invalid cull.face")}),Ve.def(pe,'==="front"?',fc,":",zf)});case Yo:return Ze(function(Te){return Q.command(typeof Te=="number"&&Te>=gt.lineWidthDims[0]&&Te<=gt.lineWidthDims[1],"invalid line width, must be a positive number between "+gt.lineWidthDims[0]+" and "+gt.lineWidthDims[1],me.commandStr),Te},function(Te,Ve,pe){return Q.optional(function(){Te.assert(Ve,"typeof "+pe+'==="number"&&'+pe+">="+gt.lineWidthDims[0]+"&&"+pe+"<="+gt.lineWidthDims[1],"invalid line width")}),pe});case ba:return Ze(function(Te){return Q.commandParameter(Te,jc,We,me.commandStr),jc[Te]},function(Te,Ve,pe){return Q.optional(function(){Te.assert(Ve,pe+'==="cw"||'+pe+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),Ve.def(pe+'==="cw"?'+ed+":"+N0)});case _o:return Ze(function(Te){return Q.command(Ia(Te)&&Te.length===4,"color.mask must be length 4 array",me.commandStr),Te.map(function(Ve){return!!Ve})},function(Te,Ve,pe){return Q.optional(function(){Te.assert(Ve,Te.shared.isArrayLike+"("+pe+")&&"+pe+".length===4","invalid color.mask")}),Fn(4,function(He){return"!!"+pe+"["+He+"]"})});case bs:return Ze(function(Te){Q.command(typeof Te=="object"&&Te,We,me.commandStr);var Ve="value"in Te?Te.value:1,pe=!!Te.invert;return Q.command(typeof Ve=="number"&&Ve>=0&&Ve<=1,"sample.coverage.value must be a number between 0 and 1",me.commandStr),[Ve,pe]},function(Te,Ve,pe){Q.optional(function(){Te.assert(Ve,pe+"&&typeof "+pe+'==="object"',"invalid sample.coverage")});var He=Ve.def('"value" in ',pe,"?+",pe,".value:1"),Tt=Ve.def("!!",pe,".invert");return[He,Tt]})}}),ht}function Io(te,me){var Pe=te.static,vt=te.dynamic,ht={};return Object.keys(Pe).forEach(function(Le){var We=Pe[Le],Ze;if(typeof We=="number"||typeof We=="boolean")Ze=so(function(){return We});else if(typeof We=="function"){var Te=We._reglType;Te==="texture2d"||Te==="textureCube"?Ze=so(function(Ve){return Ve.link(We)}):Te==="framebuffer"||Te==="framebufferCube"?(Q.command(We.color.length>0,'missing color attachment for framebuffer sent to uniform "'+Le+'"',me.commandStr),Ze=so(function(Ve){return Ve.link(We.color[0])})):Q.commandRaise('invalid data for uniform "'+Le+'"',me.commandStr)}else Ia(We)?Ze=so(function(Ve){var pe=Ve.global.def("[",Fn(We.length,function(He){return Q.command(typeof We[He]=="number"||typeof We[He]=="boolean","invalid uniform "+Le,Ve.commandStr),We[He]}),"]");return pe}):Q.commandRaise('invalid or missing data for uniform "'+Le+'"',me.commandStr);Ze.value=We,ht[Le]=Ze}),Object.keys(vt).forEach(function(Le){var We=vt[Le];ht[Le]=Ks(We,function(Ze,Te){return Ze.invoke(Te,We)})}),ht}function pi(te,me){var Pe=te.static,vt=te.dynamic,ht={};return Object.keys(Pe).forEach(function(Le){var We=Pe[Le],Ze=fe.id(Le),Te=new rt;if(td(We))Te.state=yr,Te.buffer=zt.getBuffer(zt.create(We,Lh,!1,!0)),Te.type=0;else{var Ve=zt.getBuffer(We);if(Ve)Te.state=yr,Te.buffer=Ve,Te.type=0;else if(Q.command(typeof We=="object"&&We,"invalid data for attribute "+Le,me.commandStr),"constant"in We){var pe=We.constant;Te.buffer="null",Te.state=$r,typeof pe=="number"?Te.x=pe:(Q.command(Ia(pe)&&pe.length>0&&pe.length<=4,"invalid constant for attribute "+Le,me.commandStr),qt.forEach(function(cn,Jr){Jr<pe.length&&(Te[cn]=pe[Jr])}))}else{td(We.buffer)?Ve=zt.getBuffer(zt.create(We.buffer,Lh,!1,!0)):Ve=zt.getBuffer(We.buffer),Q.command(!!Ve,'missing buffer for attribute "'+Le+'"',me.commandStr);var He=We.offset|0;Q.command(He>=0,'invalid offset for attribute "'+Le+'"',me.commandStr);var Tt=We.stride|0;Q.command(Tt>=0&&Tt<256,'invalid stride for attribute "'+Le+'", must be integer betweeen [0, 255]',me.commandStr);var Ft=We.size|0;Q.command(!("size"in We)||Ft>0&&Ft<=4,'invalid size for attribute "'+Le+'", must be 1,2,3,4',me.commandStr);var ir=!!We.normalized,Yt=0;"type"in We&&(Q.commandParameter(We.type,wo,"invalid type for attribute "+Le,me.commandStr),Yt=wo[We.type]);var fr=We.divisor|0;"divisor"in We&&(Q.command(fr===0||_r,'cannot specify divisor for attribute "'+Le+'", instancing not supported',me.commandStr),Q.command(fr>=0,'invalid divisor for attribute "'+Le+'"',me.commandStr)),Q.optional(function(){var cn=me.commandStr,Jr=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(We).forEach(function(on){Q.command(Jr.indexOf(on)>=0,'unknown parameter "'+on+'" for attribute pointer "'+Le+'" (valid parameters are '+Jr+")",cn)})}),Te.buffer=Ve,Te.state=yr,Te.size=Ft,Te.normalized=ir,Te.type=Yt||Ve.dtype,Te.offset=He,Te.stride=Tt,Te.divisor=fr}}ht[Le]=so(function(cn,Jr){var on=cn.attribCache;if(Ze in on)return on[Ze];var Pn={isStream:!1};return Object.keys(Te).forEach(function(zn){Pn[zn]=Te[zn]}),Te.buffer&&(Pn.buffer=cn.link(Te.buffer),Pn.type=Pn.type||Pn.buffer+".dtype"),on[Ze]=Pn,Pn})}),Object.keys(vt).forEach(function(Le){var We=vt[Le];function Ze(Te,Ve){var pe=Te.invoke(Ve,We),He=Te.shared,Tt=Te.constants,Ft=He.isBufferArgs,ir=He.buffer;Q.optional(function(){Te.assert(Ve,pe+"&&(typeof "+pe+'==="object"||typeof '+pe+'==="function")&&('+Ft+"("+pe+")||"+ir+".getBuffer("+pe+")||"+ir+".getBuffer("+pe+".buffer)||"+Ft+"("+pe+'.buffer)||("constant" in '+pe+"&&(typeof "+pe+'.constant==="number"||'+He.isArrayLike+"("+pe+".constant))))",'invalid dynamic attribute "'+Le+'"')});var Yt={isStream:Ve.def(!1)},fr=new rt;fr.state=yr,Object.keys(fr).forEach(function(Pn){Yt[Pn]=Ve.def(""+fr[Pn])});var cn=Yt.buffer,Jr=Yt.type;Ve("if(",Ft,"(",pe,")){",Yt.isStream,"=true;",cn,"=",ir,".createStream(",Lh,",",pe,");",Jr,"=",cn,".dtype;","}else{",cn,"=",ir,".getBuffer(",pe,");","if(",cn,"){",Jr,"=",cn,".dtype;",'}else if("constant" in ',pe,"){",Yt.state,"=",$r,";","if(typeof "+pe+'.constant === "number"){',Yt[qt[0]],"=",pe,".constant;",qt.slice(1).map(function(Pn){return Yt[Pn]}).join("="),"=0;","}else{",qt.map(function(Pn,zn){return Yt[Pn]+"="+pe+".constant.length>"+zn+"?"+pe+".constant["+zn+"]:0;"}).join(""),"}}else{","if(",Ft,"(",pe,".buffer)){",cn,"=",ir,".createStream(",Lh,",",pe,".buffer);","}else{",cn,"=",ir,".getBuffer(",pe,".buffer);","}",Jr,'="type" in ',pe,"?",Tt.glTypes,"[",pe,".type]:",cn,".dtype;",Yt.normalized,"=!!",pe,".normalized;");function on(Pn){Ve(Yt[Pn],"=",pe,".",Pn,"|0;")}return on("size"),on("offset"),on("stride"),on("divisor"),Ve("}}"),Ve.exit("if(",Yt.isStream,"){",ir,".destroyStream(",cn,");","}"),Yt}ht[Le]=Ks(We,Ze)}),ht}function Ha(te,me){var Pe=te.static,vt=te.dynamic;if(Bl in Pe){var ht=Pe[Bl];return ht!==null&&Ir.getVAO(ht)===null&&(ht=Ir.createVAO(ht)),so(function(We){return We.link(Ir.getVAO(ht))})}else if(Bl in vt){var Le=vt[Bl];return Ks(Le,function(We,Ze){var Te=We.invoke(Ze,Le);return Ze.def(We.shared.vao+".getVAO("+Te+")")})}return null}function la(te){var me=te.static,Pe=te.dynamic,vt={};return Object.keys(me).forEach(function(ht){var Le=me[ht];vt[ht]=so(function(We,Ze){return typeof Le=="number"||typeof Le=="boolean"?""+Le:We.link(Le)})}),Object.keys(Pe).forEach(function(ht){var Le=Pe[ht];vt[ht]=Ks(Le,function(We,Ze){return We.invoke(Ze,Le)})}),vt}function uo(te,me,Pe,vt,ht){var Le=te.static,We=te.dynamic;Q.optional(function(){var on=[as,qs,cu,vi,yo,Mu,Va,Fh,Ma,Bl].concat(dr);function Pn(zn){Object.keys(zn).forEach(function(Ui){Q.command(on.indexOf(Ui)>=0,'unknown parameter "'+Ui+'"',ht.commandStr)})}Pn(Le),Pn(We)});var Ze=$n(te,me),Te=jr(te),Ve=ri(te,Te,ht),pe=Di(te,ht),He=ja(te,ht),Tt=Dn(te,ht,Ze);function Ft(on){var Pn=Ve[on];Pn&&(He[on]=Pn)}Ft(Ro),Ft(Fr(Fl));var ir=Object.keys(He).length>0,Yt={framebuffer:Te,draw:pe,shader:Tt,state:He,dirty:ir,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Yt.profile=ui(te),Yt.uniforms=Io(Pe,ht),Yt.drawVAO=Yt.scopeVAO=Ha(te),!Yt.drawVAO&&Tt.program&&!Ze&&Me.angle_instanced_arrays){var fr=!0,cn=Tt.program.attributes.map(function(on){var Pn=me.static[on];return fr=fr&&!!Pn,Pn});if(fr&&cn.length>0){var Jr=Ir.getVAO(Ir.createVAO(cn));Yt.drawVAO=new ss(null,null,null,function(on,Pn){return on.link(Jr)}),Yt.useVAO=!0}}return Ze?Yt.useVAO=!0:Yt.attributes=pi(me,ht),Yt.context=la(vt),Yt}function lo(te,me,Pe){var vt=te.shared,ht=vt.context,Le=te.scope();Object.keys(Pe).forEach(function(We){me.save(ht,"."+We);var Ze=Pe[We];Le(ht,".",We,"=",Ze.append(te,me),";")}),me(Le)}function Oa(te,me,Pe,vt){var ht=te.shared,Le=ht.gl,We=ht.framebuffer,Ze;Nr&&(Ze=me.def(ht.extensions,".webgl_draw_buffers"));var Te=te.constants,Ve=Te.drawBuffer,pe=Te.backBuffer,He;Pe?He=Pe.append(te,me):He=me.def(We,".next"),vt||me("if(",He,"!==",We,".cur){"),me("if(",He,"){",Le,".bindFramebuffer(",$f,",",He,".framebuffer);"),Nr&&me(Ze,".drawBuffersWEBGL(",Ve,"[",He,".colorAttachments.length]);"),me("}else{",Le,".bindFramebuffer(",$f,",null);"),Nr&&me(Ze,".drawBuffersWEBGL(",pe,");"),me("}",We,".cur=",He,";"),vt||me("}")}function xo(te,me,Pe){var vt=te.shared,ht=vt.gl,Le=te.current,We=te.next,Ze=vt.current,Te=vt.next,Ve=te.cond(Ze,".dirty");dr.forEach(function(pe){var He=Fr(pe);if(!(He in Pe.state)){var Tt,Ft;if(He in We){Tt=We[He],Ft=Le[He];var ir=Fn(Jt[He].length,function(fr){return Ve.def(Tt,"[",fr,"]")});Ve(te.cond(ir.map(function(fr,cn){return fr+"!=="+Ft+"["+cn+"]"}).join("||")).then(ht,".",er[He],"(",ir,");",ir.map(function(fr,cn){return Ft+"["+cn+"]="+fr}).join(";"),";"))}else{Tt=Ve.def(Te,".",He);var Yt=te.cond(Tt,"!==",Ze,".",He);Ve(Yt),He in Ur?Yt(te.cond(Tt).then(ht,".enable(",Ur[He],");").else(ht,".disable(",Ur[He],");"),Ze,".",He,"=",Tt,";"):Yt(ht,".",er[He],"(",Tt,");",Ze,".",He,"=",Tt,";")}}}),Object.keys(Pe.state).length===0&&Ve(Ze,".dirty=false;"),me(Ve)}function Ko(te,me,Pe,vt){var ht=te.shared,Le=te.current,We=ht.current,Ze=ht.gl;rd(Object.keys(Pe)).forEach(function(Te){var Ve=Pe[Te];if(!(vt&&!vt(Ve))){var pe=Ve.append(te,me);if(Ur[Te]){var He=Ur[Te];qo(Ve)?pe?me(Ze,".enable(",He,");"):me(Ze,".disable(",He,");"):me(te.cond(pe).then(Ze,".enable(",He,");").else(Ze,".disable(",He,");")),me(We,".",Te,"=",pe,";")}else if(Ia(pe)){var Tt=Le[Te];me(Ze,".",er[Te],"(",pe,");",pe.map(function(Ft,ir){return Tt+"["+ir+"]="+Ft}).join(";"),";")}else me(Ze,".",er[Te],"(",pe,");",We,".",Te,"=",pe,";")}})}function co(te,me){_r&&(te.instancing=me.def(te.shared.extensions,".angle_instanced_arrays"))}function ei(te,me,Pe,vt,ht){var Le=te.shared,We=te.stats,Ze=Le.current,Te=Le.timer,Ve=Pe.profile;function pe(){return typeof performance>"u"?"Date.now()":"performance.now()"}var He,Tt;function Ft(on){He=me.def(),on(He,"=",pe(),";"),typeof ht=="string"?on(We,".count+=",ht,";"):on(We,".count++;"),cr&&(vt?(Tt=me.def(),on(Tt,"=",Te,".getNumPendingQueries();")):on(Te,".beginQuery(",We,");"))}function ir(on){on(We,".cpuTime+=",pe(),"-",He,";"),cr&&(vt?on(Te,".pushScopeStats(",Tt,",",Te,".getNumPendingQueries(),",We,");"):on(Te,".endQuery();"))}function Yt(on){var Pn=me.def(Ze,".profile");me(Ze,".profile=",on,";"),me.exit(Ze,".profile=",Pn,";")}var fr;if(Ve){if(qo(Ve)){Ve.enable?(Ft(me),ir(me.exit),Yt("true")):Yt("false");return}fr=Ve.append(te,me),Yt(fr)}else fr=me.def(Ze,".profile");var cn=te.block();Ft(cn),me("if(",fr,"){",cn,"}");var Jr=te.block();ir(Jr),me.exit("if(",fr,"){",Jr,"}")}function zo(te,me,Pe,vt,ht){var Le=te.shared;function We(Te){switch(Te){case q1:case Q1:case Bf:return 2;case Nh:case Pa:case Lf:return 3;case K1:case Ff:case zc:return 4;default:return 1}}function Ze(Te,Ve,pe){var He=Le.gl,Tt=me.def(Te,".location"),Ft=me.def(Le.attributes,"[",Tt,"]"),ir=pe.state,Yt=pe.buffer,fr=[pe.x,pe.y,pe.z,pe.w],cn=["buffer","normalized","offset","stride"];function Jr(){me("if(!",Ft,".buffer){",He,".enableVertexAttribArray(",Tt,");}");var Pn=pe.type,zn;if(pe.size?zn=me.def(pe.size,"||",Ve):zn=Ve,me("if(",Ft,".type!==",Pn,"||",Ft,".size!==",zn,"||",cn.map(function(fo){return Ft+"."+fo+"!=="+pe[fo]}).join("||"),"){",He,".bindBuffer(",Lh,",",Yt,".buffer);",He,".vertexAttribPointer(",[Tt,zn,Pn,pe.normalized,pe.stride,pe.offset],");",Ft,".type=",Pn,";",Ft,".size=",zn,";",cn.map(function(fo){return Ft+"."+fo+"="+pe[fo]+";"}).join(""),"}"),_r){var Ui=pe.divisor;me("if(",Ft,".divisor!==",Ui,"){",te.instancing,".vertexAttribDivisorANGLE(",[Tt,Ui],");",Ft,".divisor=",Ui,";}")}}function on(){me("if(",Ft,".buffer){",He,".disableVertexAttribArray(",Tt,");",Ft,".buffer=null;","}if(",qt.map(function(Pn,zn){return Ft+"."+Pn+"!=="+fr[zn]}).join("||"),"){",He,".vertexAttrib4f(",Tt,",",fr,");",qt.map(function(Pn,zn){return Ft+"."+Pn+"="+fr[zn]+";"}).join(""),"}")}ir===yr?Jr():ir===$r?on():(me("if(",ir,"===",yr,"){"),Jr(),me("}else{"),on(),me("}"))}vt.forEach(function(Te){var Ve=Te.name,pe=Pe.attributes[Ve],He;if(pe){if(!ht(pe))return;He=pe.append(te,me)}else{if(!ht(l2))return;var Tt=te.scopeAttrib(Ve);Q.optional(function(){te.assert(me,Tt+".state","missing attribute "+Ve)}),He={},Object.keys(new rt).forEach(function(Ft){He[Ft]=me.def(Tt,".",Ft)})}Ze(te.link(Te),We(Te.info.type),He)})}function Ni(te,me,Pe,vt,ht){for(var Le=te.shared,We=Le.gl,Ze,Te=0;Te<vt.length;++Te){var Ve=vt[Te],pe=Ve.name,He=Ve.info.type,Tt=Pe.uniforms[pe],Ft=te.link(Ve),ir=Ft+".location",Yt;if(Tt){if(!ht(Tt))continue;if(qo(Tt)){var fr=Tt.value;if(Q.command(fr!==null&&typeof fr<"u",'missing uniform "'+pe+'"',te.commandStr),He===Nf||He===Uf){Q.command(typeof fr=="function"&&(He===Nf&&(fr._reglType==="texture2d"||fr._reglType==="framebuffer")||He===Uf&&(fr._reglType==="textureCube"||fr._reglType==="framebufferCube")),"invalid texture for uniform "+pe,te.commandStr);var cn=te.link(fr._texture||fr.color[0]._texture);me(We,".uniform1i(",ir,",",cn+".bind());"),me.exit(cn,".unbind();")}else if(He===Uh||He===zh||He===cc){Q.optional(function(){Q.command(Ia(fr),"invalid matrix for uniform "+pe,te.commandStr),Q.command(He===Uh&&fr.length===4||He===zh&&fr.length===9||He===cc&&fr.length===16,"invalid length for matrix uniform "+pe,te.commandStr)});var Jr=te.global.def("new Float32Array(["+Array.prototype.slice.call(fr)+"])"),on=2;He===zh?on=3:He===cc&&(on=4),me(We,".uniformMatrix",on,"fv(",ir,",false,",Jr,");")}else{switch(He){case L0:Q.commandType(fr,"number","uniform "+pe,te.commandStr),Ze="1f";break;case q1:Q.command(Ia(fr)&&fr.length===2,"uniform "+pe,te.commandStr),Ze="2f";break;case Nh:Q.command(Ia(fr)&&fr.length===3,"uniform "+pe,te.commandStr),Ze="3f";break;case K1:Q.command(Ia(fr)&&fr.length===4,"uniform "+pe,te.commandStr),Ze="4f";break;case J1:Q.commandType(fr,"boolean","uniform "+pe,te.commandStr),Ze="1i";break;case Uc:Q.commandType(fr,"number","uniform "+pe,te.commandStr),Ze="1i";break;case Bf:Q.command(Ia(fr)&&fr.length===2,"uniform "+pe,te.commandStr),Ze="2i";break;case Q1:Q.command(Ia(fr)&&fr.length===2,"uniform "+pe,te.commandStr),Ze="2i";break;case Lf:Q.command(Ia(fr)&&fr.length===3,"uniform "+pe,te.commandStr),Ze="3i";break;case Pa:Q.command(Ia(fr)&&fr.length===3,"uniform "+pe,te.commandStr),Ze="3i";break;case zc:Q.command(Ia(fr)&&fr.length===4,"uniform "+pe,te.commandStr),Ze="4i";break;case Ff:Q.command(Ia(fr)&&fr.length===4,"uniform "+pe,te.commandStr),Ze="4i";break}me(We,".uniform",Ze,"(",ir,",",Ia(fr)?Array.prototype.slice.call(fr):fr,");")}continue}else Yt=Tt.append(te,me)}else{if(!ht(l2))continue;Yt=me.def(Le.uniforms,"[",fe.id(pe),"]")}He===Nf?me("if(",Yt,"&&",Yt,'._reglType==="framebuffer"){',Yt,"=",Yt,".color[0];","}"):He===Uf&&me("if(",Yt,"&&",Yt,'._reglType==="framebufferCube"){',Yt,"=",Yt,".color[0];","}"),Q.optional(function(){function al(hc,G0){te.assert(me,hc,'bad data or missing for uniform "'+pe+'". '+G0)}function H0(hc){al("typeof "+Yt+'==="'+hc+'"',"invalid type, expected "+hc)}function Pu(hc,G0){al(Le.isArrayLike+"("+Yt+")&&"+Yt+".length==="+hc,"invalid vector, should have length "+hc,te.commandStr)}function g2(hc){al("typeof "+Yt+'==="function"&&'+Yt+'._reglType==="texture'+(hc===Y1?"2d":"Cube")+'"',"invalid texture type",te.commandStr)}switch(He){case Uc:H0("number");break;case Q1:Pu(2);break;case Pa:Pu(3);break;case Ff:Pu(4);break;case L0:H0("number");break;case q1:Pu(2);break;case Nh:Pu(3);break;case K1:Pu(4);break;case J1:H0("boolean");break;case Bf:Pu(2);break;case Lf:Pu(3);break;case zc:Pu(4);break;case Uh:Pu(4);break;case zh:Pu(9);break;case cc:Pu(16);break;case Nf:g2(Y1);break;case Uf:g2(Ay);break}});var Pn=1;switch(He){case Nf:case Uf:var zn=me.def(Yt,"._texture");me(We,".uniform1i(",ir,",",zn,".bind());"),me.exit(zn,".unbind();");continue;case Uc:case J1:Ze="1i";break;case Q1:case Bf:Ze="2i",Pn=2;break;case Pa:case Lf:Ze="3i",Pn=3;break;case Ff:case zc:Ze="4i",Pn=4;break;case L0:Ze="1f";break;case q1:Ze="2f",Pn=2;break;case Nh:Ze="3f",Pn=3;break;case K1:Ze="4f",Pn=4;break;case Uh:Ze="Matrix2fv";break;case zh:Ze="Matrix3fv";break;case cc:Ze="Matrix4fv";break}if(me(We,".uniform",Ze,"(",ir,","),Ze.charAt(0)==="M"){var Ui=Math.pow(He-Uh+2,2),fo=te.global.def("new Float32Array(",Ui,")");me("false,(Array.isArray(",Yt,")||",Yt," instanceof Float32Array)?",Yt,":(",Fn(Ui,function(al){return fo+"["+al+"]="+Yt+"["+al+"]"}),",",fo,")")}else Pn>1?me(Fn(Pn,function(al){return Yt+"["+al+"]"})):me(Yt);me(");")}}function Mn(te,me,Pe,vt){var ht=te.shared,Le=ht.gl,We=ht.draw,Ze=vt.draw;function Te(){var zn=Ze.elements,Ui,fo=me;return zn?((zn.contextDep&&vt.contextDynamic||zn.propDep)&&(fo=Pe),Ui=zn.append(te,fo)):Ui=fo.def(We,".",vi),Ui&&fo("if("+Ui+")"+Le+".bindBuffer("+by+","+Ui+".buffer.buffer);"),Ui}function Ve(){var zn=Ze.count,Ui,fo=me;return zn?((zn.contextDep&&vt.contextDynamic||zn.propDep)&&(fo=Pe),Ui=zn.append(te,fo),Q.optional(function(){zn.MISSING&&te.assert(me,"false","missing vertex count"),zn.DYNAMIC&&te.assert(fo,Ui+">=0","missing vertex count")})):(Ui=fo.def(We,".",Va),Q.optional(function(){te.assert(fo,Ui+">=0","missing vertex count")})),Ui}var pe=Te();function He(zn){var Ui=Ze[zn];return Ui?Ui.contextDep&&vt.contextDynamic||Ui.propDep?Ui.append(te,Pe):Ui.append(te,me):me.def(We,".",zn)}var Tt=He(yo),Ft=He(Mu),ir=Ve();if(typeof ir=="number"){if(ir===0)return}else Pe("if(",ir,"){"),Pe.exit("}");var Yt,fr;_r&&(Yt=He(Fh),fr=te.instancing);var cn=pe+".type",Jr=Ze.elements&&qo(Ze.elements);function on(){function zn(){Pe(fr,".drawElementsInstancedANGLE(",[Tt,ir,cn,Ft+"<<(("+cn+"-"+Tr+")>>1)",Yt],");")}function Ui(){Pe(fr,".drawArraysInstancedANGLE(",[Tt,Ft,ir,Yt],");")}pe?Jr?zn():(Pe("if(",pe,"){"),zn(),Pe("}else{"),Ui(),Pe("}")):Ui()}function Pn(){function zn(){Pe(Le+".drawElements("+[Tt,ir,cn,Ft+"<<(("+cn+"-"+Tr+")>>1)"]+");")}function Ui(){Pe(Le+".drawArrays("+[Tt,Ft,ir]+");")}pe?Jr?zn():(Pe("if(",pe,"){"),zn(),Pe("}else{"),Ui(),Pe("}")):Ui()}_r&&(typeof Yt!="number"||Yt>=0)?typeof Yt=="string"?(Pe("if(",Yt,">0){"),on(),Pe("}else if(",Yt,"<0){"),Pn(),Pe("}")):on():Pn()}function fi(te,me,Pe,vt,ht){var Le=Sn(),We=Le.proc("body",ht);return Q.optional(function(){Le.commandStr=me.commandStr,Le.command=Le.link(me.commandStr)}),_r&&(Le.instancing=We.def(Le.shared.extensions,".angle_instanced_arrays")),te(Le,We,Pe,vt),Le.compile().body}function Mi(te,me,Pe,vt){co(te,me),Pe.useVAO?Pe.drawVAO?me(te.shared.vao,".setVAO(",Pe.drawVAO.append(te,me),");"):me(te.shared.vao,".setVAO(",te.shared.vao,".targetVAO);"):(me(te.shared.vao,".setVAO(null);"),zo(te,me,Pe,vt.attributes,function(){return!0})),Ni(te,me,Pe,vt.uniforms,function(){return!0}),Mn(te,me,me,Pe)}function Ga(te,me){var Pe=te.proc("draw",1);co(te,Pe),lo(te,Pe,me.context),Oa(te,Pe,me.framebuffer),xo(te,Pe,me),Ko(te,Pe,me.state),ei(te,Pe,me,!1,!0);var vt=me.shader.progVar.append(te,Pe);if(Pe(te.shared.gl,".useProgram(",vt,".program);"),me.shader.program)Mi(te,Pe,me,me.shader.program);else{Pe(te.shared.vao,".setVAO(null);");var ht=te.global.def("{}"),Le=Pe.def(vt,".id"),We=Pe.def(ht,"[",Le,"]");Pe(te.cond(We).then(We,".call(this,a0);").else(We,"=",ht,"[",Le,"]=",te.link(function(Ze){return fi(Mi,te,me,Ze,1)}),"(",vt,");",We,".call(this,a0);"))}Object.keys(me.state).length>0&&Pe(te.shared.current,".dirty=true;")}function il(te,me,Pe,vt){te.batchId="a1",co(te,me);function ht(){return!0}zo(te,me,Pe,vt.attributes,ht),Ni(te,me,Pe,vt.uniforms,ht),Mn(te,me,me,Pe)}function Ae(te,me,Pe,vt){co(te,me);var ht=Pe.contextDep,Le=me.def(),We="a0",Ze="a1",Te=me.def();te.shared.props=Te,te.batchId=Le;var Ve=te.scope(),pe=te.scope();me(Ve.entry,"for(",Le,"=0;",Le,"<",Ze,";++",Le,"){",Te,"=",We,"[",Le,"];",pe,"}",Ve.exit);function He(cn){return cn.contextDep&&ht||cn.propDep}function Tt(cn){return!He(cn)}if(Pe.needsContext&&lo(te,pe,Pe.context),Pe.needsFramebuffer&&Oa(te,pe,Pe.framebuffer),Ko(te,pe,Pe.state,He),Pe.profile&&He(Pe.profile)&&ei(te,pe,Pe,!1,!0),vt)Pe.useVAO?Pe.drawVAO?He(Pe.drawVAO)?pe(te.shared.vao,".setVAO(",Pe.drawVAO.append(te,pe),");"):Ve(te.shared.vao,".setVAO(",Pe.drawVAO.append(te,Ve),");"):Ve(te.shared.vao,".setVAO(",te.shared.vao,".targetVAO);"):(Ve(te.shared.vao,".setVAO(null);"),zo(te,Ve,Pe,vt.attributes,Tt),zo(te,pe,Pe,vt.attributes,He)),Ni(te,Ve,Pe,vt.uniforms,Tt),Ni(te,pe,Pe,vt.uniforms,He),Mn(te,Ve,pe,Pe);else{var Ft=te.global.def("{}"),ir=Pe.shader.progVar.append(te,pe),Yt=pe.def(ir,".id"),fr=pe.def(Ft,"[",Yt,"]");pe(te.shared.gl,".useProgram(",ir,".program);","if(!",fr,"){",fr,"=",Ft,"[",Yt,"]=",te.link(function(cn){return fi(il,te,Pe,cn,2)}),"(",ir,");}",fr,".call(this,a0[",Le,"],",Le,");")}}function Et(te,me){var Pe=te.proc("batch",2);te.batchId="0",co(te,Pe);var vt=!1,ht=!0;Object.keys(me.context).forEach(function(Ft){vt=vt||me.context[Ft].propDep}),vt||(lo(te,Pe,me.context),ht=!1);var Le=me.framebuffer,We=!1;Le?(Le.propDep?vt=We=!0:Le.contextDep&&vt&&(We=!0),We||Oa(te,Pe,Le)):Oa(te,Pe,null),me.state.viewport&&me.state.viewport.propDep&&(vt=!0);function Ze(Ft){return Ft.contextDep&&vt||Ft.propDep}xo(te,Pe,me),Ko(te,Pe,me.state,function(Ft){return!Ze(Ft)}),(!me.profile||!Ze(me.profile))&&ei(te,Pe,me,!1,"a1"),me.contextDep=vt,me.needsContext=ht,me.needsFramebuffer=We;var Te=me.shader.progVar;if(Te.contextDep&&vt||Te.propDep)Ae(te,Pe,me,null);else{var Ve=Te.append(te,Pe);if(Pe(te.shared.gl,".useProgram(",Ve,".program);"),me.shader.program)Ae(te,Pe,me,me.shader.program);else{Pe(te.shared.vao,".setVAO(null);");var pe=te.global.def("{}"),He=Pe.def(Ve,".id"),Tt=Pe.def(pe,"[",He,"]");Pe(te.cond(Tt).then(Tt,".call(this,a0,a1);").else(Tt,"=",pe,"[",He,"]=",te.link(function(Ft){return fi(Ae,te,me,Ft,2)}),"(",Ve,");",Tt,".call(this,a0,a1);"))}}Object.keys(me.state).length>0&&Pe(te.shared.current,".dirty=true;")}function pt(te,me){var Pe=te.proc("scope",3);te.batchId="a2";var vt=te.shared,ht=vt.current;lo(te,Pe,me.context),me.framebuffer&&me.framebuffer.append(te,Pe),rd(Object.keys(me.state)).forEach(function(We){var Ze=me.state[We],Te=Ze.append(te,Pe);Ia(Te)?Te.forEach(function(Ve,pe){Pe.set(te.next[We],"["+pe+"]",Ve)}):Pe.set(vt.next,"."+We,Te)}),ei(te,Pe,me,!0,!0),[vi,Mu,Va,Fh,yo].forEach(function(We){var Ze=me.draw[We];Ze&&Pe.set(vt.draw,"."+We,""+Ze.append(te,Pe))}),Object.keys(me.uniforms).forEach(function(We){Pe.set(vt.uniforms,"["+fe.id(We)+"]",me.uniforms[We].append(te,Pe))}),Object.keys(me.attributes).forEach(function(We){var Ze=me.attributes[We].append(te,Pe),Te=te.scopeAttrib(We);Object.keys(new rt).forEach(function(Ve){Pe.set(Te,"."+Ve,Ze[Ve])})}),me.scopeVAO&&Pe.set(vt.vao,".targetVAO",me.scopeVAO.append(te,Pe));function Le(We){var Ze=me.shader[We];Ze&&Pe.set(vt.shader,"."+We,Ze.append(te,Pe))}Le(qs),Le(cu),Object.keys(me.state).length>0&&(Pe(ht,".dirty=true;"),Pe.exit(ht,".dirty=true;")),Pe("a1(",te.shared.context,",a0,",te.batchId,");")}function Hr(te){if(!(typeof te!="object"||Ia(te))){for(var me=Object.keys(te),Pe=0;Pe<me.length;++Pe)if(ct.isDynamic(te[me[Pe]]))return!0;return!1}}function ni(te,me,Pe){var vt=me.static[Pe];if(!vt||!Hr(vt))return;var ht=te.global,Le=Object.keys(vt),We=!1,Ze=!1,Te=!1,Ve=te.global.def("{}");Le.forEach(function(He){var Tt=vt[He];if(ct.isDynamic(Tt)){typeof Tt=="function"&&(Tt=vt[He]=ct.unbox(Tt));var Ft=Ks(Tt,null);We=We||Ft.thisDep,Te=Te||Ft.propDep,Ze=Ze||Ft.contextDep}else{switch(ht(Ve,".",He,"="),typeof Tt){case"number":ht(Tt);break;case"string":ht('"',Tt,'"');break;case"object":Array.isArray(Tt)&&ht("[",Tt.join(),"]");break;default:ht(te.link(Tt));break}ht(";")}});function pe(He,Tt){Le.forEach(function(Ft){var ir=vt[Ft];if(ct.isDynamic(ir)){var Yt=He.invoke(Tt,ir);Tt(Ve,".",Ft,"=",Yt,";")}})}me.dynamic[Pe]=new ct.DynamicVariable(Yr,{thisDep:We,contextDep:Ze,propDep:Te,ref:Ve,append:pe}),delete me.static[Pe]}function Zi(te,me,Pe,vt,ht){var Le=Sn();Le.stats=Le.link(ht),Object.keys(me.static).forEach(function(Ze){ni(Le,me,Ze)}),t2.forEach(function(Ze){ni(Le,te,Ze)});var We=uo(te,me,Pe,vt,Le);return Ga(Le,We),pt(Le,We),Et(Le,We),Le.compile()}return{next:Vr,current:Jt,procs:function(){var te=Sn(),me=te.proc("poll"),Pe=te.proc("refresh"),vt=te.block();me(vt),Pe(vt);var ht=te.shared,Le=ht.gl,We=ht.next,Ze=ht.current;vt(Ze,".dirty=false;"),Oa(te,me),Oa(te,Pe,null,!0);var Te;_r&&(Te=te.link(_r)),Me.oes_vertex_array_object&&Pe(te.link(Me.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var Ve=0;Ve<gt.maxAttributes;++Ve){var pe=Pe.def(ht.attributes,"[",Ve,"]"),He=te.cond(pe,".buffer");He.then(Le,".enableVertexAttribArray(",Ve,");",Le,".bindBuffer(",Lh,",",pe,".buffer.buffer);",Le,".vertexAttribPointer(",Ve,",",pe,".size,",pe,".type,",pe,".normalized,",pe,".stride,",pe,".offset);").else(Le,".disableVertexAttribArray(",Ve,");",Le,".vertexAttrib4f(",Ve,",",pe,".x,",pe,".y,",pe,".z,",pe,".w);",pe,".buffer=null;"),Pe(He),_r&&Pe(Te,".vertexAttribDivisorANGLE(",Ve,",",pe,".divisor);")}return Pe(te.shared.vao,".currentVAO=null;",te.shared.vao,".setVAO(",te.shared.vao,".targetVAO);"),Object.keys(Ur).forEach(function(Tt){var Ft=Ur[Tt],ir=vt.def(We,".",Tt),Yt=te.block();Yt("if(",ir,"){",Le,".enable(",Ft,")}else{",Le,".disable(",Ft,")}",Ze,".",Tt,"=",ir,";"),Pe(Yt),me("if(",ir,"!==",Ze,".",Tt,"){",Yt,"}")}),Object.keys(er).forEach(function(Tt){var Ft=er[Tt],ir=Jt[Tt],Yt,fr,cn=te.block();if(cn(Le,".",Ft,"("),Ia(ir)){var Jr=ir.length;Yt=te.global.def(We,".",Tt),fr=te.global.def(Ze,".",Tt),cn(Fn(Jr,function(on){return Yt+"["+on+"]"}),");",Fn(Jr,function(on){return fr+"["+on+"]="+Yt+"["+on+"];"}).join("")),me("if(",Fn(Jr,function(on){return Yt+"["+on+"]!=="+fr+"["+on+"]"}).join("||"),"){",cn,"}")}else Yt=vt.def(We,".",Tt),fr=vt.def(Ze,".",Tt),cn(Yt,");",Ze,".",Tt,"=",Yt,";"),me("if(",Yt,"!==",fr,"){",cn,"}");Pe(cn)}),te.compile()}(),compile:Zi}}function c2(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var Py=34918,Oy=34919,f2=35007,ky=function(U,fe){if(!fe.ext_disjoint_timer_query)return null;var Me=[];function gt(){return Me.pop()||fe.ext_disjoint_timer_query.createQueryEXT()}function zt(_r){Me.push(_r)}var xt=[];function lt(_r){var Nr=gt();fe.ext_disjoint_timer_query.beginQueryEXT(f2,Nr),xt.push(Nr),cr(xt.length-1,xt.length,_r)}function gr(){fe.ext_disjoint_timer_query.endQueryEXT(f2)}function sr(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var Ir=[];function xr(){return Ir.pop()||new sr}function wr(_r){Ir.push(_r)}var Or=[];function cr(_r,Nr,Jt){var Vr=xr();Vr.startQueryIndex=_r,Vr.endQueryIndex=Nr,Vr.sum=0,Vr.stats=Jt,Or.push(Vr)}var Cr=[],rt=[];function Pt(){var _r,Nr,Jt=xt.length;if(Jt!==0){rt.length=Math.max(rt.length,Jt+1),Cr.length=Math.max(Cr.length,Jt+1),Cr[0]=0,rt[0]=0;var Vr=0;for(_r=0,Nr=0;Nr<xt.length;++Nr){var dr=xt[Nr];fe.ext_disjoint_timer_query.getQueryObjectEXT(dr,Oy)?(Vr+=fe.ext_disjoint_timer_query.getQueryObjectEXT(dr,Py),zt(dr)):xt[_r++]=dr,Cr[Nr+1]=Vr,rt[Nr+1]=_r}for(xt.length=_r,_r=0,Nr=0;Nr<Or.length;++Nr){var Ur=Or[Nr],er=Ur.startQueryIndex,Fr=Ur.endQueryIndex;Ur.sum+=Cr[Fr]-Cr[er];var En=rt[er],jn=rt[Fr];jn===En?(Ur.stats.gpuTime+=Ur.sum/1e6,wr(Ur)):(Ur.startQueryIndex=En,Ur.endQueryIndex=jn,Or[_r++]=Ur)}Or.length=_r}}return{beginQuery:lt,endQuery:gr,pushScopeStats:cr,update:Pt,getNumPendingQueries:function(){return xt.length},clear:function(){Me.push.apply(Me,xt);for(var _r=0;_r<Me.length;_r++)fe.ext_disjoint_timer_query.deleteQueryEXT(Me[_r]);xt.length=0,Me.length=0},restore:function(){xt.length=0,Me.length=0}}},h2=16384,us=256,Dy=1024,p2=34962,V0="webglcontextlost",d2="webglcontextrestored",j0=1,Fy=2,By=3;function v2(U,fe){for(var Me=0;Me<U.length;++Me)if(U[Me]===fe)return Me;return-1}function m2(U){var fe=ti(U);if(!fe)return null;var Me=fe.gl,gt=Me.getContextAttributes(),zt=Me.isContextLost(),xt=Hi(Me,fe);if(!xt)return null;var lt=Jn(),gr=c2(),sr=xt.extensions,Ir=ky(Me,sr),xr=Qr(),wr=Me.drawingBufferWidth,Or=Me.drawingBufferHeight,cr={tick:0,time:0,viewportWidth:wr,viewportHeight:Or,framebufferWidth:wr,framebufferHeight:Or,drawingBufferWidth:wr,drawingBufferHeight:Or,pixelRatio:fe.pixelRatio},Cr={},rt={elements:null,primitive:4,count:-1,offset:0,instances:-1},Pt=Tp(Me,sr),_r=Cp(Me,gr,fe,Jt),Nr=X(Me,sr,Pt,gr,_r);function Jt(Mn){return Nr.destroyBuffer(Mn)}var Vr=j1(Me,sr,_r,gr),dr=be(Me,lt,gr,fe),Ur=Ms(Me,sr,Pt,function(){En.procs.poll()},cr,gr,fe),er=su(Me,sr,Pt,gr,fe),Fr=C(Me,sr,Pt,Ur,er,gr),En=Zp(Me,lt,sr,Pt,_r,Vr,Ur,Fr,Cr,Nr,dr,rt,cr,Ir,fe),jn=ot(Me,Fr,En.procs.poll,cr,gt,sr,Pt),Br=En.next,mr=Me.canvas,Wt=[],Sn=[],ui=[],jr=[fe.onDestroy],ri=null;function $n(){if(Wt.length===0){Ir&&Ir.update(),ri=null;return}ri=Vt.next($n),Ko();for(var Mn=Wt.length-1;Mn>=0;--Mn){var fi=Wt[Mn];fi&&fi(cr,null,0)}Me.flush(),Ir&&Ir.update()}function Dn(){!ri&&Wt.length>0&&(ri=Vt.next($n))}function Di(){ri&&(Vt.cancel($n),ri=null)}function ja(Mn){Mn.preventDefault(),zt=!0,Di(),Sn.forEach(function(fi){fi()})}function Io(Mn){Me.getError(),zt=!1,xt.restore(),dr.restore(),_r.restore(),Ur.restore(),er.restore(),Fr.restore(),Nr.restore(),Ir&&Ir.restore(),En.procs.refresh(),Dn(),ui.forEach(function(fi){fi()})}mr&&(mr.addEventListener(V0,ja,!1),mr.addEventListener(d2,Io,!1));function pi(){Wt.length=0,Di(),mr&&(mr.removeEventListener(V0,ja),mr.removeEventListener(d2,Io)),dr.clear(),Fr.clear(),er.clear(),Ur.clear(),Vr.clear(),_r.clear(),Nr.clear(),Ir&&Ir.clear(),jr.forEach(function(Mn){Mn()})}function Ha(Mn){Q(!!Mn,"invalid args to regl({...})"),Q.type(Mn,"object","invalid args to regl({...})");function fi(ht){var Le=n({},ht);delete Le.uniforms,delete Le.attributes,delete Le.context,delete Le.vao,"stencil"in Le&&Le.stencil.op&&(Le.stencil.opBack=Le.stencil.opFront=Le.stencil.op,delete Le.stencil.op);function We(Ze){if(Ze in Le){var Te=Le[Ze];delete Le[Ze],Object.keys(Te).forEach(function(Ve){Le[Ze+"."+Ve]=Te[Ve]})}}return We("blend"),We("depth"),We("cull"),We("stencil"),We("polygonOffset"),We("scissor"),We("sample"),"vao"in ht&&(Le.vao=ht.vao),Le}function Mi(ht){var Le={},We={};return Object.keys(ht).forEach(function(Ze){var Te=ht[Ze];ct.isDynamic(Te)?We[Ze]=ct.unbox(Te,Ze):Le[Ze]=Te}),{dynamic:We,static:Le}}var Ga=Mi(Mn.context||{}),il=Mi(Mn.uniforms||{}),Ae=Mi(Mn.attributes||{}),Et=Mi(fi(Mn)),pt={gpuTime:0,cpuTime:0,count:0},Hr=En.compile(Et,Ae,il,Ga,pt),ni=Hr.draw,Zi=Hr.batch,te=Hr.scope,me=[];function Pe(ht){for(;me.length<ht;)me.push(null);return me}function vt(ht,Le){var We;if(zt&&Q.raise("context lost"),typeof ht=="function")return te.call(this,null,ht,0);if(typeof Le=="function")if(typeof ht=="number")for(We=0;We<ht;++We)te.call(this,null,Le,We);else if(Array.isArray(ht))for(We=0;We<ht.length;++We)te.call(this,ht[We],Le,We);else return te.call(this,ht,Le,0);else if(typeof ht=="number"){if(ht>0)return Zi.call(this,Pe(ht|0),ht|0)}else if(Array.isArray(ht)){if(ht.length)return Zi.call(this,ht,ht.length)}else return ni.call(this,ht)}return n(vt,{stats:pt})}var la=Fr.setFBO=Ha({framebuffer:ct.define.call(null,j0,"framebuffer")});function uo(Mn,fi){var Mi=0;En.procs.poll();var Ga=fi.color;Ga&&(Me.clearColor(+Ga[0]||0,+Ga[1]||0,+Ga[2]||0,+Ga[3]||0),Mi|=h2),"depth"in fi&&(Me.clearDepth(+fi.depth),Mi|=us),"stencil"in fi&&(Me.clearStencil(fi.stencil|0),Mi|=Dy),Q(!!Mi,"called regl.clear with no buffer specified"),Me.clear(Mi)}function lo(Mn){if(Q(typeof Mn=="object"&&Mn,"regl.clear() takes an object as input"),"framebuffer"in Mn)if(Mn.framebuffer&&Mn.framebuffer_reglType==="framebufferCube")for(var fi=0;fi<6;++fi)la(n({framebuffer:Mn.framebuffer.faces[fi]},Mn),uo);else la(Mn,uo);else uo(null,Mn)}function Oa(Mn){Q.type(Mn,"function","regl.frame() callback must be a function"),Wt.push(Mn);function fi(){var Mi=v2(Wt,Mn);Q(Mi>=0,"cannot cancel a frame twice");function Ga(){var il=v2(Wt,Ga);Wt[il]=Wt[Wt.length-1],Wt.length-=1,Wt.length<=0&&Di()}Wt[Mi]=Ga}return Dn(),{cancel:fi}}function xo(){var Mn=Br.viewport,fi=Br.scissor_box;Mn[0]=Mn[1]=fi[0]=fi[1]=0,cr.viewportWidth=cr.framebufferWidth=cr.drawingBufferWidth=Mn[2]=fi[2]=Me.drawingBufferWidth,cr.viewportHeight=cr.framebufferHeight=cr.drawingBufferHeight=Mn[3]=fi[3]=Me.drawingBufferHeight}function Ko(){cr.tick+=1,cr.time=ei(),xo(),En.procs.poll()}function co(){xo(),En.procs.refresh(),Ir&&Ir.update()}function ei(){return(Qr()-xr)/1e3}co();function zo(Mn,fi){Q.type(fi,"function","listener callback must be a function");var Mi;switch(Mn){case"frame":return Oa(fi);case"lost":Mi=Sn;break;case"restore":Mi=ui;break;case"destroy":Mi=jr;break;default:Q.raise("invalid event, must be one of frame,lost,restore,destroy")}return Mi.push(fi),{cancel:function(){for(var Ga=0;Ga<Mi.length;++Ga)if(Mi[Ga]===fi){Mi[Ga]=Mi[Mi.length-1],Mi.pop();return}}}}var Ni=n(Ha,{clear:lo,prop:ct.define.bind(null,j0),context:ct.define.bind(null,Fy),this:ct.define.bind(null,By),draw:Ha({}),buffer:function(Mn){return _r.create(Mn,p2,!1,!1)},elements:function(Mn){return Vr.create(Mn,!1)},texture:Ur.create2D,cube:Ur.createCube,renderbuffer:er.create,framebuffer:Fr.create,framebufferCube:Fr.createCube,vao:Nr.createVAO,attributes:gt,frame:Oa,on:zo,limits:Pt,hasExtension:function(Mn){return Pt.extensions.indexOf(Mn.toLowerCase())>=0},read:jn,destroy:pi,_gl:Me,_refresh:co,poll:function(){Ko(),Ir&&Ir.update()},now:ei,stats:gr});return fe.onDone(null,Ni),Ni}return m2})})(ek);var Gge=ek.exports;const Wge=oa(Gge);var Xge=function(){function e(t,r){Ht(this,e);var n=r.buffer,i=r.offset,o=r.stride,a=r.normalized,u=r.size,c=r.divisor;this.buffer=n,this.attribute={buffer:n.get(),offset:i||0,stride:o||0,normalized:a||!1,divisor:c||0},u&&(this.attribute.size=u)}return jt(e,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(r){this.buffer.subData(r)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),e}(),Kf,Lv,np,zl,Nv,ip,Uv,pg,ef,f1,Bs,tf,rf,dg,Yge=(Kf={},F(Kf,W.POINTS,"points"),F(Kf,W.LINES,"lines"),F(Kf,W.LINE_LOOP,"line loop"),F(Kf,W.LINE_STRIP,"line strip"),F(Kf,W.TRIANGLES,"triangles"),F(Kf,W.TRIANGLE_FAN,"triangle fan"),F(Kf,W.TRIANGLE_STRIP,"triangle strip"),Kf),tk=(Lv={},F(Lv,W.STATIC_DRAW,"static"),F(Lv,W.DYNAMIC_DRAW,"dynamic"),F(Lv,W.STREAM_DRAW,"stream"),Lv),Ab=(np={},F(np,W.BYTE,"int8"),F(np,W.INT,"int32"),F(np,W.UNSIGNED_BYTE,"uint8"),F(np,W.UNSIGNED_SHORT,"uint16"),F(np,W.UNSIGNED_INT,"uint32"),F(np,W.FLOAT,"float"),np),Zge=(zl={},F(zl,W.ALPHA,"alpha"),F(zl,W.LUMINANCE,"luminance"),F(zl,W.LUMINANCE_ALPHA,"luminance alpha"),F(zl,W.RGB,"rgb"),F(zl,W.RGBA,"rgba"),F(zl,W.RGBA4,"rgba4"),F(zl,W.RGB5_A1,"rgb5 a1"),F(zl,W.RGB565,"rgb565"),F(zl,W.DEPTH_COMPONENT,"depth"),F(zl,W.DEPTH_STENCIL,"depth stencil"),zl),qge=(Nv={},F(Nv,W.DONT_CARE,"dont care"),F(Nv,W.NICEST,"nice"),F(Nv,W.FASTEST,"fast"),Nv),J9=(ip={},F(ip,W.NEAREST,"nearest"),F(ip,W.LINEAR,"linear"),F(ip,W.LINEAR_MIPMAP_LINEAR,"mipmap"),F(ip,W.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),F(ip,W.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),F(ip,W.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),ip),eC=(Uv={},F(Uv,W.REPEAT,"repeat"),F(Uv,W.CLAMP_TO_EDGE,"clamp"),F(Uv,W.MIRRORED_REPEAT,"mirror"),Uv),Kge=(pg={},F(pg,W.NONE,"none"),F(pg,W.BROWSER_DEFAULT_WEBGL,"browser"),pg),Qge=(ef={},F(ef,W.NEVER,"never"),F(ef,W.ALWAYS,"always"),F(ef,W.LESS,"less"),F(ef,W.LEQUAL,"lequal"),F(ef,W.GREATER,"greater"),F(ef,W.GEQUAL,"gequal"),F(ef,W.EQUAL,"equal"),F(ef,W.NOTEQUAL,"notequal"),ef),tC=(f1={},F(f1,W.FUNC_ADD,"add"),F(f1,W.MIN_EXT,"min"),F(f1,W.MAX_EXT,"max"),F(f1,W.FUNC_SUBTRACT,"subtract"),F(f1,W.FUNC_REVERSE_SUBTRACT,"reverse subtract"),f1),vg=(Bs={},F(Bs,W.ZERO,"zero"),F(Bs,W.ONE,"one"),F(Bs,W.SRC_COLOR,"src color"),F(Bs,W.ONE_MINUS_SRC_COLOR,"one minus src color"),F(Bs,W.SRC_ALPHA,"src alpha"),F(Bs,W.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),F(Bs,W.DST_COLOR,"dst color"),F(Bs,W.ONE_MINUS_DST_COLOR,"one minus dst color"),F(Bs,W.DST_ALPHA,"dst alpha"),F(Bs,W.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),F(Bs,W.CONSTANT_COLOR,"constant color"),F(Bs,W.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),F(Bs,W.CONSTANT_ALPHA,"constant alpha"),F(Bs,W.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),F(Bs,W.SRC_ALPHA_SATURATE,"src alpha saturate"),Bs),Jge=(tf={},F(tf,W.NEVER,"never"),F(tf,W.ALWAYS,"always"),F(tf,W.LESS,"less"),F(tf,W.LEQUAL,"lequal"),F(tf,W.GREATER,"greater"),F(tf,W.GEQUAL,"gequal"),F(tf,W.EQUAL,"equal"),F(tf,W.NOTEQUAL,"notequal"),tf),Fd=(rf={},F(rf,W.ZERO,"zero"),F(rf,W.KEEP,"keep"),F(rf,W.REPLACE,"replace"),F(rf,W.INVERT,"invert"),F(rf,W.INCR,"increment"),F(rf,W.DECR,"decrement"),F(rf,W.INCR_WRAP,"increment wrap"),F(rf,W.DECR_WRAP,"decrement wrap"),rf),e_e=(dg={},F(dg,W.FRONT,"front"),F(dg,W.BACK,"back"),dg),t_e=function(){function e(t,r){Ht(this,e),F(this,"isDestroyed",!1);var n=r.data,i=r.usage,o=r.type;this.buffer=t.buffer({data:n,usage:tk[i||W.STATIC_DRAW],type:Ab[o||W.UNSIGNED_BYTE]})}return jt(e,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.isDestroyed||this.buffer.destroy(),this.isDestroyed=!0}},{key:"subData",value:function(r){var n=r.data,i=r.offset;this.buffer.subdata(n,i)}}]),e}(),r_e=function(){function e(t,r){Ht(this,e);var n=r.data,i=r.usage,o=r.type,a=r.count;this.elements=t.elements({data:n,usage:tk[i||W.STATIC_DRAW],type:Ab[o||W.UNSIGNED_BYTE],count:a})}return jt(e,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(r){var n=r.data;this.elements.subdata(n)}},{key:"destroy",value:function(){}}]),e}(),n_e=function(){function e(t,r){Ht(this,e);var n=r.width,i=r.height,o=r.color,a=r.colors,u={width:n,height:i};Array.isArray(a)&&(u.colors=a.map(function(c){return c.get()})),o&&typeof o!="boolean"&&(u.color=o.get()),this.framebuffer=t.framebuffer(u)}return jt(e,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(r){var n=r.width,i=r.height;this.framebuffer.resize(n,i)}}]),e}(),i_e=Ci.isPlainObject,a_e=Ci.isTypedArray,o_e=function(){function e(t,r){Ht(this,e),F(this,"destroyed",!1),F(this,"uniforms",{}),this.reGl=t;var n=r.vs,i=r.fs,o=r.attributes,a=r.uniforms,u=r.primitive,c=r.count,f=r.elements,m=r.depth,_=r.cull,b=r.instances,A={platformString:"WebGL1",glslVersion:"#version 100",explicitBindingLocations:!1,separateSamplerTextures:!1,viewportOrigin:vf.LOWER_LEFT,clipSpaceNearZ:m0.NEGATIVE_ONE,supportMRT:!1},w={};this.options=r,a&&(this.uniforms=this.extractUniforms(a),Object.keys(a).forEach(function(B){w[B]=t.prop(B)}));var R={};Object.keys(o).forEach(function(B){R[B]=o[B].get()});var P=LS(x0(A,"frag",i,null,!1)),k=LS(x0(A,"vert",n,null,!1)),L={attributes:R,frag:P,uniforms:w,vert:k,colorMask:t.prop("colorMask"),lineWidth:1,blend:{enable:t.prop("blend.enable"),func:t.prop("blend.func"),equation:t.prop("blend.equation"),color:t.prop("blend.color")},stencil:{enable:t.prop("stencil.enable"),mask:t.prop("stencil.mask"),func:t.prop("stencil.func"),opFront:t.prop("stencil.opFront"),opBack:t.prop("stencil.opBack")},primitive:Yge[u===void 0?W.TRIANGLES:u]};b&&(L.instances=b),c?L.count=c:f&&(L.elements=f.get()),this.initDepthDrawParams({depth:m},L),this.initCullDrawParams({cull:_},L),this.drawCommand=t(L),this.drawParams=L}return jt(e,[{key:"updateAttributesAndElements",value:function(r,n){var i={};Object.keys(r).forEach(function(o){i[o]=r[o].get()}),this.drawParams.attributes=i,this.drawParams.elements=n.get(),this.drawCommand=this.reGl(this.drawParams)}},{key:"updateAttributes",value:function(r){var n={};Object.keys(r).forEach(function(i){n[i]=r[i].get()}),this.drawParams.attributes=n,this.drawCommand=this.reGl(this.drawParams)}},{key:"addUniforms",value:function(r){this.uniforms=Qe(Qe({},this.uniforms),this.extractUniforms(r))}},{key:"draw",value:function(r,n){if(!(this.drawParams.attributes&&Object.keys(this.drawParams.attributes).length===0)){var i=Qe(Qe({},this.uniforms),this.extractUniforms(r.uniforms||{})),o={};Object.keys(i).forEach(function(a){var u=mu(i[a]);u==="boolean"||u==="number"||Array.isArray(i[a])||i[a].BYTES_PER_ELEMENT?o[a]=i[a]:o[a]=i[a].get()}),o.blend=n?this.getBlendDrawParams({blend:{enable:!1}}):this.getBlendDrawParams(r),o.stencil=this.getStencilDrawParams(r),o.colorMask=this.getColorMaskDrawParams(r,n),this.drawCommand(o)}}},{key:"destroy",value:function(){var r;(r=this.drawParams)===null||r===void 0||(r=r.elements)===null||r===void 0||r.destroy(),this.options.attributes&&Object.values(this.options.attributes).forEach(function(n){n==null||n.destroy()}),this.destroyed=!0}},{key:"initDepthDrawParams",value:function(r,n){var i=r.depth;i&&(n.depth={enable:i.enable===void 0?!0:!!i.enable,mask:i.mask===void 0?!0:!!i.mask,func:Qge[i.func||W.LESS],range:i.range||[0,1]})}},{key:"getBlendDrawParams",value:function(r){var n=r.blend,i=n||{},o=i.enable,a=i.func,u=i.equation,c=i.color,f=c===void 0?[0,0,0,0]:c;return{enable:!!o,func:{srcRGB:vg[a&&a.srcRGB||W.SRC_ALPHA],srcAlpha:vg[a&&a.srcAlpha||W.SRC_ALPHA],dstRGB:vg[a&&a.dstRGB||W.ONE_MINUS_SRC_ALPHA],dstAlpha:vg[a&&a.dstAlpha||W.ONE_MINUS_SRC_ALPHA]},equation:{rgb:tC[u&&u.rgb||W.FUNC_ADD],alpha:tC[u&&u.alpha||W.FUNC_ADD]},color:f}}},{key:"getStencilDrawParams",value:function(r){var n=r.stencil,i=n||{},o=i.enable,a=i.mask,u=a===void 0?-1:a,c=i.func,f=c===void 0?{cmp:W.ALWAYS,ref:0,mask:-1}:c,m=i.opFront,_=m===void 0?{fail:W.KEEP,zfail:W.KEEP,zpass:W.KEEP}:m,b=i.opBack,A=b===void 0?{fail:W.KEEP,zfail:W.KEEP,zpass:W.KEEP}:b;return{enable:!!o,mask:u,func:Qe(Qe({},f),{},{cmp:Jge[f.cmp]}),opFront:{fail:Fd[_.fail],zfail:Fd[_.zfail],zpass:Fd[_.zpass]},opBack:{fail:Fd[A.fail],zfail:Fd[A.zfail],zpass:Fd[A.zpass]}}}},{key:"getColorMaskDrawParams",value:function(r,n){var i=r.stencil,o=i!=null&&i.enable&&i.opFront&&!n?[!1,!1,!1,!1]:[!0,!0,!0,!0];return o}},{key:"initCullDrawParams",value:function(r,n){var i=r.cull;if(i){var o=i.enable,a=i.face,u=a===void 0?W.BACK:a;n.cull={enable:!!o,face:e_e[u]}}}},{key:"extractUniforms",value:function(r){var n=this,i={};return Object.keys(r).forEach(function(o){n.extractUniformsRecursively(o,r[o],i,"")}),i}},{key:"extractUniformsRecursively",value:function(r,n,i,o){var a=this;if(n===null||typeof n=="number"||typeof n=="boolean"||Array.isArray(n)&&typeof n[0]=="number"||a_e(n)||n===""||"resize"in n){i["".concat(o&&o+".").concat(r)]=n;return}i_e(n)&&Object.keys(n).forEach(function(u){a.extractUniformsRecursively(u,n[u],i,"".concat(o&&o+".").concat(r))}),Array.isArray(n)&&n.forEach(function(u,c){Object.keys(u).forEach(function(f){a.extractUniformsRecursively(f,u[f],i,"".concat(o&&o+".").concat(r,"[").concat(c,"]"))})})}}]),e}(),s_e=function(){function e(t,r){Ht(this,e),F(this,"isDestroy",!1);var n=r.data,i=r.type,o=i===void 0?W.UNSIGNED_BYTE:i,a=r.width,u=r.height,c=r.flipY,f=c===void 0?!1:c,m=r.format,_=m===void 0?W.RGBA:m,b=r.mipmap,A=b===void 0?!1:b,w=r.wrapS,R=w===void 0?W.CLAMP_TO_EDGE:w,P=r.wrapT,k=P===void 0?W.CLAMP_TO_EDGE:P,L=r.aniso,B=L===void 0?0:L,V=r.alignment,G=V===void 0?1:V,K=r.premultiplyAlpha,Z=K===void 0?!1:K,ve=r.mag,Ie=ve===void 0?W.NEAREST:ve,de=r.min,se=de===void 0?W.NEAREST:de,le=r.colorSpace,ye=le===void 0?W.BROWSER_DEFAULT_WEBGL:le,ke=r.x,Rt=ke===void 0?0:ke,Lt=r.y,Gt=Lt===void 0?0:Lt,Zt=r.copy,st=Zt===void 0?!1:Zt;this.width=a,this.height=u;var tt={width:a,height:u,type:Ab[o],format:Zge[_],wrapS:eC[R],wrapT:eC[k],mag:J9[Ie],min:J9[se],alignment:G,flipY:f,colorSpace:Kge[ye],premultiplyAlpha:Z,aniso:B,x:Rt,y:Gt,copy:st};n&&(tt.data=n),typeof A=="number"?tt.mipmap=qge[A]:typeof A=="boolean"&&(tt.mipmap=A),this.texture=t.texture(tt)}return jt(e,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.texture(r)}},{key:"bind",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(r){var n=r.width,i=r.height;this.texture.resize(n,i),this.width=n,this.height=i}},{key:"getSize",value:function(){return[this.width,this.height]}},{key:"destroy",value:function(){if(!this.isDestroy){var r;(r=this.texture)===null||r===void 0||r.destroy()}this.isDestroy=!0}}]),e}(),rC,nC,u_e=(rC=ai(),rC(nC=function(){function e(){var t=this;Ht(this,e),F(this,"uniformBuffers",[]),F(this,"queryVerdorInfo",function(){return"WebGL1"}),F(this,"createModel",function(r){return new o_e(t.gl,r)}),F(this,"createAttribute",function(r){return new Xge(t.gl,r)}),F(this,"createBuffer",function(r){return new t_e(t.gl,r)}),F(this,"createElements",function(r){return new r_e(t.gl,r)}),F(this,"createTexture2D",function(r){return new s_e(t.gl,r)}),F(this,"createFramebuffer",function(r){return new n_e(t.gl,r)}),F(this,"useFramebuffer",function(r,n){t.gl({framebuffer:r?r.get():null})(n)}),F(this,"useFramebufferAsync",function(){var r=Mt(he.mark(function n(i,o){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:t.gl({framebuffer:i?i.get():null})(o);case 1:case"end":return u.stop()}},n)}));return function(n,i){return r.apply(this,arguments)}}()),F(this,"clear",function(r){var n,i=r.color,o=r.depth,a=r.stencil,u=r.framebuffer,c=u===void 0?null:u,f={color:i,depth:o,stencil:a};f.framebuffer=c===null?c:c.get(),(n=t.gl)===null||n===void 0||n.clear(f)}),F(this,"viewport",function(r){var n=r.x,i=r.y,o=r.width,a=r.height;t.gl._gl.viewport(n,i,o,a),t.width=o,t.height=a,t.gl._refresh()}),F(this,"readPixels",function(r){var n=r.framebuffer,i=r.x,o=r.y,a=r.width,u=r.height,c={x:i,y:o,width:a,height:u};return n&&(c.framebuffer=n.get()),t.gl.read(c)}),F(this,"readPixelsAsync",function(){var r=Mt(he.mark(function n(i){return he.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",t.readPixels(i));case 1:case"end":return a.stop()}},n)}));return function(n){return r.apply(this,arguments)}}()),F(this,"getViewportSize",function(){return{width:t.gl._gl.drawingBufferWidth,height:t.gl._gl.drawingBufferHeight}}),F(this,"getContainer",function(){var r;return(r=t.canvas)===null||r===void 0?void 0:r.parentElement}),F(this,"getCanvas",function(){return t.canvas}),F(this,"getGLContext",function(){return t.gl._gl}),F(this,"destroy",function(){var r;t.canvas=null,(r=t.gl)===null||r===void 0||(r=r._gl)===null||r===void 0||(r=r.getExtension("WEBGL_lose_context"))===null||r===void 0||r.loseContext(),t.gl.destroy(),t.gl=null})}return jt(e,[{key:"init",value:function(){var t=Mt(he.mark(function n(i,o,a){var u=this;return he.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(this.canvas=i,!a){f.next=5;break}this.gl=a,f.next=8;break;case 5:return f.next=7,new Promise(function(m,_){Wge({canvas:u.canvas,attributes:{alpha:!0,antialias:o.antialias,premultipliedAlpha:!0,preserveDrawingBuffer:o.preserveDrawingBuffer,stencil:o.stencil},extensions:["OES_element_index_uint","OES_standard_derivatives","ANGLE_instanced_arrays"],optionalExtensions:["oes_texture_float_linear","OES_texture_float","EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture","WEBGL_lose_context"],profile:!0,onDone:function(A,w){(A||!w)&&_(A),m(w)}})});case 7:this.gl=f.sent;case 8:this.extensionObject={OES_texture_float:this.testExtension("OES_texture_float")};case 9:case"end":return f.stop()}},n,this)}));function r(n,i,o){return t.apply(this,arguments)}return r}()},{key:"getPointSizeRange",value:function(){return this.gl._gl.getParameter(this.gl._gl.ALIASED_POINT_SIZE_RANGE)}},{key:"testExtension",value:function(r){return!!this.getGLContext().getExtension(r)}},{key:"setState",value:function(){this.gl({cull:{enable:!1,face:"back"},viewport:{x:0,y:0,height:this.width,width:this.height},blend:{enable:!0,equation:"add"},framebuffer:null}),this.gl._refresh()}},{key:"setBaseState",value:function(){this.gl({cull:{enable:!1,face:"back"},viewport:{x:0,y:0,height:this.width,width:this.height},blend:{enable:!1,equation:"add"},framebuffer:null}),this.gl._refresh()}},{key:"setCustomLayerDefaults",value:function(){var r=this.getGLContext();r.disable(r.CULL_FACE)}},{key:"setDirty",value:function(r){this.isDirty=r}},{key:"getDirty",value:function(){return this.isDirty}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}}]),e}())||nC);function l_e(e){var t=c_e();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yn(this,i)}}function c_e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var d6=["selectstart","selecting","selectend"],f_e=function(e){_n(r,e);var t=l_e(r);function r(n){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ht(this,r),i=t.call(this),F($e(i),"isEnable",!1),F($e(i),"onDragStart",function(a){i.box.style.display="block",i.startEvent=i.endEvent=a,i.syncBoxBound(),i.emit("selectstart",i.getLngLatBox(),i.startEvent,i.endEvent)}),F($e(i),"onDragging",function(a){i.endEvent=a,i.syncBoxBound(),i.emit("selecting",i.getLngLatBox(),i.startEvent,i.endEvent)}),F($e(i),"onDragEnd",function(a){i.endEvent=a,i.box.style.display="none",i.emit("selectend",i.getLngLatBox(),i.startEvent,i.endEvent)}),i.scene=n,i.options=o,i}return jt(r,[{key:"container",get:function(){return this.scene.getMapService().getMarkerContainer()}},{key:"enable",value:function(){if(!this.isEnable){var i=this.options.className;if(this.scene.setMapStatus({dragEnable:!1}),this.container.style.cursor="crosshair",!this.box){var o=fl("div",void 0,this.container);o.classList.add("l7-select-box"),i&&o.classList.add(i),o.style.display="none",this.box=o}this.scene.on("dragstart",this.onDragStart),this.scene.on("dragging",this.onDragging),this.scene.on("dragend",this.onDragEnd),this.isEnable=!0}}},{key:"disable",value:function(){this.isEnable&&(this.scene.setMapStatus({dragEnable:!0}),this.container.style.cursor="auto",this.scene.off("dragstart",this.onDragStart),this.scene.off("dragging",this.onDragging),this.scene.off("dragend",this.onDragEnd),this.isEnable=!1)}},{key:"syncBoxBound",value:function(){var i=this.startEvent,o=i.x,a=i.y,u=this.endEvent,c=u.x,f=u.y,m=Math.min(o,c),_=Math.min(a,f),b=Math.abs(o-c),A=Math.abs(a-f);this.box.style.top="".concat(_,"px"),this.box.style.left="".concat(m,"px"),this.box.style.width="".concat(b,"px"),this.box.style.height="".concat(A,"px")}},{key:"getLngLatBox",value:function(){var i=this.startEvent.lngLat,o=i.lng,a=i.lat,u=this.endEvent.lngLat,c=u.lng,f=u.lat;return Oee([[o,a],[c,f]])}}]),r}(ju.EventEmitter),h_e=function(){function e(t){Ht(this,e);var r=t.id,n=t.map,i=t.canvas,o=t.renderer,a=o===void 0?"regl":o,u=nle();this.container=u,n.setContainer(u,r,i),u.bind(wt.IRendererService).to(a==="regl"?u_e:Hge).inSingletonScope(),this.sceneService=u.get(wt.ISceneService),this.mapService=u.get(wt.IMapService),this.iconService=u.get(wt.IIconService),this.fontService=u.get(wt.IFontService),this.controlService=u.get(wt.IControlService),this.layerService=u.get(wt.ILayerService),this.debugService=u.get(wt.IDebugService),this.debugService.setEnable(t.debug),this.markerService=u.get(wt.IMarkerService),this.interactionService=u.get(wt.IInteractionService),this.popupService=u.get(wt.IPopupService),this.boxSelect=new f_e(this,{}),this.initComponent(r),this.sceneService.init(t),this.initControl()}return jt(e,[{key:"map",get:function(){return this.mapService.map}},{key:"loaded",get:function(){return this.sceneService.loaded}},{key:"getServiceContainer",value:function(){return this.container}},{key:"getSize",value:function(){return this.mapService.getSize()}},{key:"getMinZoom",value:function(){return this.mapService.getMinZoom()}},{key:"getMaxZoom",value:function(){return this.mapService.getMaxZoom()}},{key:"getType",value:function(){return this.mapService.getType()}},{key:"getMapContainer",value:function(){return this.mapService.getMapContainer()}},{key:"getMapCanvasContainer",value:function(){return this.mapService.getMapCanvasContainer()}},{key:"getMapService",value:function(){return this.mapService}},{key:"getDebugService",value:function(){return this.debugService}},{key:"exportPng",value:function(){var t=Mt(he.mark(function n(i){return he.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",this.sceneService.exportPng(i));case 1:case"end":return a.stop()}},n,this)}));function r(n){return t.apply(this,arguments)}return r}()},{key:"exportMap",value:function(){var t=Mt(he.mark(function n(i){return he.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",this.sceneService.exportPng(i));case 1:case"end":return a.stop()}},n,this)}));function r(n){return t.apply(this,arguments)}return r}()},{key:"registerRenderService",value:function(r){var n=this;if(this.sceneService.loaded){var i=new r(this);i.init()}else this.on("loaded",function(){var o=new r(n);o.init()})}},{key:"setBgColor",value:function(r){this.mapService.setBgColor(r)}},{key:"addLayer",value:function(r){var n=this,i=om(this.container);if(r.setContainer(i,this.container),this.sceneService.addLayer(r),r.inited){var o=this.initMask(r);this.addMask(o,r.id)}else r.on("inited",function(){var a=n.initMask(r);n.addMask(a,r.id)})}},{key:"initMask",value:function(r){var n=r.getLayerConfig(),i=n.mask,o=n.maskfence,a=n.maskColor,u=a===void 0?"#000":a,c=n.maskOpacity,f=c===void 0?0:c;if(!(!i||!o)){var m=new WP().source(o).shape("fill").style({color:u,opacity:f});return m}}},{key:"addMask",value:function(r,n){if(r){var i=this.getLayer(n);if(i){var o=om(this.container);r.setContainer(o,this.container),i.addMaskLayer(r),this.sceneService.addMask(r)}else console.warn("parent layer not find!")}}},{key:"getPickedLayer",value:function(){return this.layerService.pickedLayerId}},{key:"getLayers",value:function(){return this.layerService.getLayers()}},{key:"getLayer",value:function(r){return this.layerService.getLayer(r)}},{key:"getLayerByName",value:function(r){return this.layerService.getLayerByName(r)}},{key:"removeLayer",value:function(){var t=Mt(he.mark(function n(i,o){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.layerService.remove(i,o);case 2:case"end":return u.stop()}},n,this)}));function r(n,i){return t.apply(this,arguments)}return r}()},{key:"removeAllLayer",value:function(){var t=Mt(he.mark(function n(){return he.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.layerService.removeAllLayers();case 2:case"end":return o.stop()}},n,this)}));function r(){return t.apply(this,arguments)}return r}()},{key:"render",value:function(){this.sceneService.render()}},{key:"setEnableRender",value:function(r){this.layerService.setEnableRender(r)}},{key:"addIconFont",value:function(r,n){this.fontService.addIconFont(r,n)}},{key:"addIconFonts",value:function(r){var n=this;r.forEach(function(i){var o=Nn(i,2),a=o[0],u=o[1];n.fontService.addIconFont(a,u)})}},{key:"addFontFace",value:function(r,n){var i=this;this.fontService.once("fontloaded",function(o){i.emit("fontloaded",o)}),this.fontService.addFontFace(r,n)}},{key:"addImage",value:function(){var t=Mt(he.mark(function n(i,o){return he.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.iconService.addImage(i,o);case 2:case"end":return u.stop()}},n,this)}));function r(n,i){return t.apply(this,arguments)}return r}()},{key:"hasImage",value:function(r){return this.iconService.hasImage(r)}},{key:"removeImage",value:function(r){this.iconService.removeImage(r)}},{key:"addIconFontGlyphs",value:function(r,n){this.fontService.addIconGlyphs(n)}},{key:"addControl",value:function(r){this.controlService.addControl(r,this.container)}},{key:"removeControl",value:function(r){this.controlService.removeControl(r)}},{key:"getControlByName",value:function(r){return this.controlService.getControlByName(r)}},{key:"addMarker",value:function(r){this.markerService.addMarker(r)}},{key:"addMarkerLayer",value:function(r){this.markerService.addMarkerLayer(r)}},{key:"removeMarkerLayer",value:function(r){this.markerService.removeMarkerLayer(r)}},{key:"removeAllMarkers",value:function(){this.markerService.removeAllMarkers()}},{key:"removeAllMakers",value:function(){console.warn("removeAllMakers 已废弃,请使用 removeAllMarkers"),this.markerService.removeAllMarkers()}},{key:"addPopup",value:function(r){this.popupService.addPopup(r)}},{key:"removePopup",value:function(r){this.popupService.removePopup(r)}},{key:"on",value:function(r,n){if(d6.includes(r)){var i;(i=this.boxSelect)===null||i===void 0||i.on(r,n)}else Q2.includes(r)?this.sceneService.on(r,n):this.mapService.on(r,n)}},{key:"once",value:function(r,n){if(d6.includes(r)){var i;(i=this.boxSelect)===null||i===void 0||i.once(r,n)}else Q2.includes(r)?this.sceneService.once(r,n):this.mapService.once(r,n)}},{key:"emit",value:function(r,n){Q2.indexOf(r)===-1?this.mapService.on(r,n):this.sceneService.emit(r,n)}},{key:"off",value:function(r,n){if(d6.includes(r)){var i;(i=this.boxSelect)===null||i===void 0||i.off(r,n)}else Q2.includes(r)?this.sceneService.off(r,n):this.mapService.off(r,n)}},{key:"getZoom",value:function(){return this.mapService.getZoom()}},{key:"getCenter",value:function(r){return this.mapService.getCenter(r)}},{key:"setCenter",value:function(r,n){return this.mapService.setCenter(r,n)}},{key:"getPitch",value:function(){return this.mapService.getPitch()}},{key:"setPitch",value:function(r){return this.mapService.setPitch(r)}},{key:"getRotation",value:function(){return this.mapService.getRotation()}},{key:"getBounds",value:function(){return this.mapService.getBounds()}},{key:"setRotation",value:function(r){this.mapService.setRotation(r)}},{key:"zoomIn",value:function(){this.mapService.zoomIn()}},{key:"zoomOut",value:function(){this.mapService.zoomOut()}},{key:"panTo",value:function(r){this.mapService.panTo(r)}},{key:"panBy",value:function(r,n){this.mapService.panBy(r,n)}},{key:"getContainer",value:function(){return this.mapService.getContainer()}},{key:"setZoom",value:function(r){this.mapService.setZoom(r)}},{key:"fitBounds",value:function(r,n){var i=this.sceneService.getSceneConfig(),o=i.fitBoundsOptions,a=i.animate;this.mapService.fitBounds(r,n||Qe(Qe({},o),{},{animate:a}))}},{key:"setZoomAndCenter",value:function(r,n){this.mapService.setZoomAndCenter(r,n)}},{key:"setMapStyle",value:function(r){this.mapService.setMapStyle(r)}},{key:"setMapStatus",value:function(r){this.mapService.setMapStatus(r)}},{key:"pixelToLngLat",value:function(r){return this.mapService.pixelToLngLat(r)}},{key:"lngLatToPixel",value:function(r){return this.mapService.lngLatToPixel(r)}},{key:"containerToLngLat",value:function(r){return this.mapService.containerToLngLat(r)}},{key:"lngLatToContainer",value:function(r){return this.mapService.lngLatToContainer(r)}},{key:"destroy",value:function(){this.sceneService.destroy()}},{key:"registerPostProcessingPass",value:function(r,n){this.container.bind(wt.IPostProcessingPass).to(r).whenTargetNamed(n)}},{key:"enableShaderPick",value:function(){this.layerService.enableShaderPick()}},{key:"diasbleShaderPick",value:function(){this.layerService.disableShaderPick()}},{key:"enableBoxSelect",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.boxSelect.enable(),n&&this.boxSelect.once("selectend",function(){r.disableBoxSelect()})}},{key:"disableBoxSelect",value:function(){this.boxSelect.disable()}},{key:"getProtocol",value:function(r){return wg.REGISTERED_PROTOCOLS[r]}},{key:"startAnimate",value:function(){this.layerService.startAnimate()}},{key:"stopAnimate",value:function(){this.layerService.stopAnimate()}},{key:"getPointSizeRange",value:function(){return this.sceneService.getPointSizeRange()}},{key:"initComponent",value:function(r){this.controlService.init({container:dee(r)},this.container),this.markerService.init(this.container),this.popupService.init(this.container)}},{key:"initControl",value:function(){var r=this.sceneService.getSceneConfig(),n=r.logoVisible,i=r.logoPosition;n&&this.addControl(new uce({position:i}))}}],[{key:"addProtocol",value:function(r,n){wg.REGISTERED_PROTOCOLS[r]=n}},{key:"removeProtocol",value:function(r){delete wg.REGISTERED_PROTOCOLS[r]}}]),e}();const p_e=""+new URL("弹框背景--kXyqrr2.png",import.meta.url).href,d_e=""+new URL("背景-BcUmP26b.png",import.meta.url).href,v_e={class:"title"},m_e={class:"info"},g_e={class:"name"},__e={class:"val"},y_e={__name:"Tooltip",props:{info:{type:Object,default:()=>({})},projectType:{type:String,default:"photovoltaic"}},setup(e,{expose:t}){const r={站点数量:"zdsl",装机容量:"zjrl",年发电量:"nfdl",发电功率:"fdgl",性能比:"xnb",充电枪数量:"cdqsl",正在充电:"zzcd",今日充电量:"jrcdl",今日充电时长:"jrcdsc",今日充电次数:"jrcdcs"},n=o=>o&&(+o).toFixed(2)||"",i=zv(null);return t({tooltipRef:i}),(o,a)=>(yg(),xg("div",{ref_key:"tooltipRef",ref:i,style:O_({position:"absolute",zIndex:3999,width:"300px",height:e.projectType==="photovoltaic"?"249px":"332px",padding:"10px 20px",boxSizing:"border-box",color:"#ffffff",backgroundImage:`url(${e.projectType==="photovoltaic"?jl(p_e):jl(d_e)})`,backgroundSize:"100% 100%"}),class:"map-tooltip"},[eu("div",v_e,[eu("h3",null,B2(e.info.type===1?e.info.name+"省":e.info.name),1)]),eu("div",m_e,[(yg(!0),xg(mc,null,MD(e.info.data,u=>(yg(),xg("div",{key:u.attrName,class:"info-row"},[eu("span",{class:k_({icon:!0,[r[u.attrName]]:!0})},null,2),eu("span",g_e,B2(u.attrName)+"("+B2(u.attrUnit)+"): ",1),eu("span",__e,B2(n(u.attrValue)),1)]))),128))])],4))}},x_e="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1706079614471'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='4220'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M947.4%20864C893.2%20697.7%20736.2%20578.9%20551%20575.5c-23.1-0.4-44.9%200.1-65.6%201.5v164.3c0.1%200.5%200.2%201%200.2%201.5%200%204-3.3%207.3-7.3%207.3-2.7%200-5-1.4-6.2-3.5v0.7L68.8%20465.4h2.1c-4%200-7.3-3.3-7.3-7.3%200-2.9%201.7-5.4%204.1-6.6L472%20169v0.7c1.3-2.1%203.6-3.5%206.2-3.5%204%200%207.3%203.3%207.3%207.3%200%200.5-0.1%201-0.2%201.5v159.4c18.5-0.9%2037.9-1.2%2058.3-0.8%20230.1%203.9%20416.7%20196.9%20416.7%20427.1%200.1%2035.5-4.5%2070.2-12.9%20103.3z%20m-462-704.4v0.2h-0.4l0.4-0.2z%20m0%20596.9l-0.3-0.2h0.3v0.2z'%20fill='%23376DB8'%20p-id='4221'%3e%3c/path%3e%3c/svg%3e",iC=""+new URL("purplePoint-BscC0hsv.png",import.meta.url).href,aC=""+new URL("yellowPoint-tOz4zFvb.png",import.meta.url).href,b_e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFIAAAB1CAYAAADdhbYVAAAH3klEQVR4nO2dCfBVUxzHP/9/9a9/ZYv6GypSJGWyFZIa0RhSjS0jDVpsocEwkyU7g2RpMyo02TWWaKYk2creYkuSEBmhpFKS+psz833mer3/6973znnv3vc/n5k7b7nbOd97lt/5nXvOKStfWT0M6I0nF5oC5cDpdYEDgRO8jHmxU93A2aOBVxIYiTCcBFwINM7h3DuBNzL8Xwm8rO9bgkIuAWa7iUfRqACeBM5QAGYAVwF/hwjQmcBdwH7A9Rn2HxH8ERSyMnk67ZAHJeJa4DKJGpbXdVybGo7vGvxhhKzSd5OE2wKTgfeB6qJEPX8aK/LHA+crHj2AhTleuayG/4YG/6gbEKxC5YjZfgZaAX8VWIR0jgLuADYCk4Bpgf0HAccAzYHVwJESryrtGuNzFHGVPlvr4WwI7GsP7G/KRqAeEvIX7bwROE5Pb0/gZOCFnCXIHxPAqRLKsBiYDnRWlu1Uwx1M+fcDMF9ZOdcK1FzjAz2gccAgYKv2HapP84B3Ia2MNE/1Qwk5BXi1AGJlY4sqhud0zMXApUAj5aKVwCxFeC/gW+BZYLnFYsnc723gXGPiAOcAm5QbUI7dTkgU6OFAH0XiT0sBisquisRpgfN21ucy4ClgFLDOcTjmq7HyInAq8BbQE+ig/ZtTB6YLuVAmkDHQbwcucRzQdEx2vgC4BdhD+9YDd8tmM6lwTYHDNAc4WvfvpOImVaxsSh2ULiRKiR8rK/2kSISxu/KhAXCecsO+uo4xgu8B3oxBpbdYRd4ipUiUOpukDsgk5GfARcAjwK0S9i2ZRJ8D3wPtVKub7DYPmAlsAw4AeskG+zREAFsCQ3S/ZoFA36DsFCdWAMcCl8suvVeptUYhkS2ZSo2HAH211cRS4CEV+teoouisJ5iivmq7Dmrfm+/dgTrabyq6kbIUtsVMxBRfKKemU68mIVGNOEtNpK6KuEmJ+wDfKMUZc6C/UuL9gXNNWTdYqdk8wdNVrtRLu8dm1bTmIcx1EvXC0D2bkCmWa5tSw/6bZXP2U6HcWjXq1RJ9lI7bJvEXKvt+JfFWJ0y0TMwOI+SOMKnyFW3DZCzvonNMefou0AW4VpVHSVJuOVIpd1PvQPmbEm9QqYqIAyE/U81eFfC6T5dh3zZgG5YctoU0PKpPYxM2lMnQUI3+tV7I8ExU+7ezUuIbcjsZL8w/riJSQFoE2tr/4ULIDWpaLpbzwLRKPpHtOCRuquTAGLW7/4eNWjtIhdzyw/UdNf86alsnv2JS6aUEcZZLIY2z82ngYNmMU+Xaai2D3Bjf9yVYxHI1OoYGvT4pbAlp/HQTVKl8LVNnrsrGBTpmVB7u/jhgEseJShzbYaOM7AY8LhEnq22eau711e+V6jJIOhlFxJKQphFfpmw7UO531C5PGeMjA/+XJDaENHYi8mHWD4i7SB1Epk39cCmLiKUyMtW79pRS3Udyj1XLOL8uBo5Z59hIkQPUW7dEpk53+SPPlyttVYhrxJXQr7jYSJEmCw/Q933VrTsz0PuXVOrLK94sTIssXyFNT9/eyr6G70rIy9NeDphQzdp8s/YcecgzvdaRdDqqayEU+Qr5JfC7bMlSY0sNr/NlxEYZmer0KjWeiBIfG0KapmGtx4UbrVbihbSEF9ISXkhLeCEzU5mpXyYbNoVsKQdvKWC8Vs8US8iKEnHeorfs/ohygk0hl8lL3jzEsXGnQaZ+mWzYLiPn6T2fpLMm6uAt292xN6ntnXQWBDrtiiJkmLd0SxJv/ljCC2kJL6QlvJCW8EJmpqlaaqFxIeRpgV7FpDI46qg3F0I2zzJytWRxIeRaDcqsVdg2yFHLZreEi7hEfoPQuBDyzajNqxjyUtQguRByvbZahTd/LOGFtIQX0hJeSEt4ITNTFXUeNRdCmjd2Rzi4biGZEJi7IhQuhGynl0+TzGEa6VtUIc2gxx8TLOKBGkiwLMpJLoRslW1gTwJoERgqHRoXLZuBgZlTkshr2oouZKSO9VLBmz+W8EJawgtpCS+kJWwJWaHaOqkPZlxgltKcsBXxkZpdOa6Tw2Wji+aq+DKfi9gwf8ycaGYG1MMtXKvQlCkRjMh3KLSNFGnmfuxfhJlGbdBCnXVR5ifPiI0UaaasTipmGPEpNsLua21LeCEt4YW0hBfSErVNyN1dDV/JRchGWucliYzVcizWycX86ak+jaRxqqYXGxgXIfskcEmrhlqKq5+ryZyiZu1ytUunhTg2TmxUw+E9V2GKKmS1svYKR+FxyVKXF89FyFo7uisb3o60hBfSEqUqZKtCx60UhTQLv71TaEdzqQlZR1NxTdKEoAUjipDzA6uCxJWLFafbCh2+sEJWaZLNSBNmFIHH1HrZWuhbhxXyV2WbuK/+YVowvxXjxmGF3KYF1JLcP+OUKE6LK5QyPRmIImSSXx51TpLNn+7yL8aCpArZRquTNAlxbEFIopBNtQT+lcGVMotNEoXspkUp837NxCa5ClmmidsrQhxrm+e1tmysyCdF9lDKKIaYsSNXIauVIjdrKEXSR3rlTT4p0qy5fbYW8HYxoXsDB9d0Rr6VTbXW8rLlsqrUavNjtLZiO0vXdY6LAUvpTNT0NSu0cvHowGJC6YzVEtMz5JhNTG9lIYR8QK7/5ioCslVOgwsQHicUQsgvoixnklR8L6IlvJCW8EJaIlhGjtfmyQGfIm0A/Asl/VuWcBpLegAAAABJRU5ErkJggg==",E_e=eu("div",{id:"map",style:{width:"100%",height:"100%"}},null,-1),S_e={class:"map-helpers"},A_e=["src"],T_e=["src"],w_e=["src"],C_e=["src"],R_e=["src"],I_e=["src"],M_e={__name:"App",setup(e){let t=null,r=window.parent?window.parent.location.origin:window.location.origin,n=zv({}),i=zv(!1),o=zv(null);const a=window.location.href.split("?")[1];let c=new URLSearchParams(a).get("projectType")||"charge",f=zv(c),m=c==="photovoltaic"?"/thing/v1/manage/board/map":"/thing/v1/charge/board/map",_="",b=r+m;const A=r+"/changshumap/marker.png";let w=[1e5,{adcode:32e4,name:"江苏省",center:[118.767413,32.041544],centroid:[119.486506,32.983991],childrenNum:13,level:"province",subFeatureIndex:9,acroutes:[1e5]},{adcode:320500,name:"苏州市",center:[120.619585,31.299379],centroid:[120.660806,31.382865],childrenNum:9,level:"city",subFeatureIndex:4,acroutes:[1e5,32e4]},{adcode:320581,name:"常熟市",center:[120.74852,31.658156],centroid:[120.822992,31.658797],childrenNum:0,level:"district",subFeatureIndex:5,acroutes:[1e5,32e4,320500]}],R={center:[120.74852,31.658156],pitch:45,zoom:7,maxZoom:10,minZoom:5,level:"district",mapAdCode:320581,mapSize:12e3,mapRHeight:800,topFaceRHeight:6800,borderLineRHeight:13600},P={cityName:"常熟市",type:4},k=null;function L(le,ye,ke){k=new h_e({id:"map",logoVisible:!1,map:new mme({center:le.center,zoom:le.zoom,maxZoom:le.maxZoom,minZoom:le.minZoom,pitch:le.pitch,style:"blank",interact:!1})}),k.addImage("triangleIcon",A);const Rt=new Om({zIndex:3}).source(t).shape("triangleIcon").size(6).active(!0).style({raisingHeight:50});k.addLayer(Rt),Rt.on("click",nt=>{const pr=nt.target.clientX+300>=window.innerWidth,ur=c==="photovoltaic"?249:332,Ar=nt.target.clientY+ur>=window.innerHeight;pr&&!Ar?(o.value.tooltipRef.style.left=nt.target.clientX-300+"px",o.value.tooltipRef.style.top=nt.target.clientY+"px"):Ar&&!pr?(o.value.tooltipRef.style.left=nt.target.clientX+"px",o.value.tooltipRef.style.top=nt.target.clientY-ur+"px"):Ar&&pr?(o.value.tooltipRef.style.left=nt.target.clientX-300+"px",o.value.tooltipRef.style.top=nt.target.clientY-ur+"px"):(o.value.tooltipRef.style.left=nt.target.clientX+"px",o.value.tooltipRef.style.top=nt.target.clientY+"px"),i.value=!0,n.value=nt.feature.properties,window.parent.postMessage(nt.feature.properties,"*")}),Rt.on("unpick",nt=>{i.value=!1});const Lt=ke===320581?cL:ke===1e5?fL:hL,Gt=new s_({zIndex:0,autoFit:!0}).source(ye).shape("extrude").size(le.mapSize).style({mapTexture:Lt,heightfixed:!0,raisingHeight:le.mapRHeight,sourceColor:"#0096FF",targetColor:"#122C61",opacity:1}),Zt=new s_({zIndex:1,autoFit:!0}).source(ye).shape("fill").color("#022857").style({opacity:.58,heightfixed:!0,raisingHeight:le.topFaceRHeight});ke!==320581&&Zt.active({color:"#56FEB4"}),Zt.on("click",nt=>{const pr=nt.feature.properties;if(pr.level==="district"&&pr.adcode!==320581)if(window.parent.layer)window.parent.layer.msg("无法下探");else return window.alert("无法下探");pr.level==="province"&&!pr.name.includes("省")&&(pr.name=pr.name+"省"),de(pr,pr.adcode),w.push(pr)});const st=new sb({zIndex:2}).source(ye).color("#00ffff").size(.5).style({raisingHeight:le.borderLineRHeight}),tt=ke===320581?lL:ye,dt=new Om({zIndex:4}).source(tt).shape("name","text").size(10).color("#ffffff");k.addLayer(dt),k.addLayer(Gt),k.addLayer(Zt),k.addLayer(st)}const B=window.location.search.split("token="),V=sessionStorage.getItem("v1@CacheToken"),G=JSON.parse(V||"{}"),K=window.iframeNodeToken,Z=Z7.create({timeout:1e3*30,headers:{"Content-Type":"application/json",token:B[1]||G.token||K||"1e1365578832462b7c8ec7def8ecc0f4",tenantCode:localStorage.getItem("v1@CacheTenantCode")||"",companyId:localStorage.getItem("v1@CacheTenantCode")||""}}),ve=async(le,ye,ke,Rt)=>{const Lt=await Z.post(b,le);if(Lt.data.code!==0)return;let Gt={type:"FeatureCollection",features:[]};Lt.data.data.forEach(Zt=>{if(Zt.lon&&Zt.lat)Gt.features.push({type:"Feature",properties:{...Zt},geometry:{type:"Point",coordinates:[Zt.lon,Zt.lat]}});else{let st=[120.74852,31.658156];const tt=le.type===1;if(ke!==1e5){const dt=Rt.features.find(nt=>tt?nt.properties.name+"省"===Zt.name:nt.properties.name===Zt.name);dt&&(st=dt.properties.centroid)}Gt.features.push({type:"Feature",properties:{...Zt},geometry:{type:"Point",coordinates:st}})}}),t=Gt},Ie=async le=>{const ye=window.top!==window?"/changshumap/chinaGeoJson.json":"./chinaGeoJson.json";_||(_=(await Z.get(r+"/thing/sys/oss/getMapBucketUrl")).data.data);const ke=_||"http://58.211.128.22:8100/thingmanager/geojson/";if(ke){const Rt=await Z7.get(le===1e5?ye:`${ke}${le}.json`),{data:Lt}=Rt;return Lt}},de=async(le,ye)=>{const ke=await Ie(ye);k&&(k.removeAllLayer(),k.destroy(),k=null),R.mapAdCode=ye,ye===1e5?(R.minZoom=2,R.zoom=4,R.maxZoom=7,R.mapSize=24e5,R.mapRHeight=16e4,R.topFaceRHeight=136e4,R.borderLineRHeight=272e4,R.pitch=30,P.type=1,P.cityName=""):ye===320581?(R.minZoom=5,R.zoom=7,R.maxZoom=13,R.mapSize=12e3,R.mapRHeight=800,R.topFaceRHeight=6800,R.borderLineRHeight=13600,R.pitch=45,P.type=4,P.cityName="常熟市"):le.level==="city"?(R.minZoom=8,R.zoom=10,R.maxZoom=13,R.mapSize=6e4,R.mapRHeight=4e3,R.topFaceRHeight=34e3,R.borderLineRHeight=68e3,R.pitch=30,P.type=3,P.cityName=le.name):le.level==="province"&&(R.minZoom=2,R.zoom=4,R.maxZoom=7,R.mapSize=12e4,R.mapRHeight=8e3,R.topFaceRHeight=68e3,R.borderLineRHeight=136e3,R.pitch=45,P.type=2,P.cityName=le.name),await ve(P,le,ye,ke),L(R,ye===320581?oL:ke,R.mapAdCode)},se=async()=>{if(w.pop(),w.length===0){w.push(1e5);return}const le=w[w.length-1];let ye=le.adcode;le===1e5&&(ye=1e5),de(le,ye)};return $C(async()=>{de(w[w.length-1],320581)}),(le,ye)=>(yg(),xg(mc,null,[E_e,_D(vp(y_e,{ref_key:"tooltip",ref:o,info:jl(n),projectType:jl(f)},null,8,["info","projectType"]),[[_F,jl(i)]]),eu("div",S_e,[eu("img",{src:jl(x_e),alt:"返回",className:"return-icon",onClick:se},null,8,A_e),eu("img",{alt:"紫色星光1",src:jl(iC),className:"purple-one"},null,8,T_e),eu("img",{alt:"紫色星光2",src:jl(iC),className:"purple-two"},null,8,w_e),eu("img",{alt:"黄色星光1",src:jl(aC),className:"yellow-one"},null,8,C_e),eu("img",{alt:"黄色星光2",src:jl(aC),className:"yellow-two"},null,8,R_e),eu("img",{alt:"南海诸岛",src:jl(b_e),className:"southSea"},null,8,I_e)])],64))}};LF(M_e).mount("#app");
|