|
|
(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* @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
* @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
`).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 _&&_.getAl
`+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.prototyp
\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
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.*?")+"$");functio
`.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
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
Copyright (C) Microsoft. All rights reserved.Licensed under the Apache License, Version 2.0 (the "License"); you may not usethis file except in compliance with the License. You may obtain a copy of theLicense at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANYKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIEDWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissionsand 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))}reRegistered 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
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}
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.pus
* 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
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)}));fun
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.p
`;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: absolu
`)}),{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.718281828459045vec2 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&&_===
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,
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:"reset
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,ty
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("ari
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({},th
`):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<
Copyright (C) Microsoft. All rights reserved.Licensed under the Apache License, Version 2.0 (the "License"); you may not usethis file except in compliance with the License. You may obtain a copy of theLicense at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANYKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIEDWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissionsand 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=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.0uniform 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.0layout(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.0layout(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
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
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.0layout(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.c
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
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:fun
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
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
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===
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.c
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:"generateM
* 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 usethis file except in compliance with the License. You may obtain a copy of theLicense at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANYKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIEDWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissionsand 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
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
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_ESprecision highp float;#else#if !defined(lowp)#define lowp#endif#if !defined(mediump)#define mediump#endif#if !defined(highp)#define highp#endif#endifvec2 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_INSPECTORgl_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_INSPECTORgl_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_opacityvoid 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_opacityvec2 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_INSPECTORgl_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_opacityvoid 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_opacityvec2 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.3989422804014327void main() {#pragma mapbox: initialize highp float weightfloat 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_INSPECTORgl_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 radiusconst highp float ZERO=1.0/255.0/16.0;#define GAUSS_COEF 0.3989422804014327void main(void) {#pragma mapbox: initialize highp float weight#pragma mapbox: initialize mediump float radiusvec2 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_INSPECTORgl_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 opacityvoid main() {#pragma mapbox: initialize highp vec4 color#pragma mapbox: initialize lowp float opacitygl_FragColor=color*opacity;#ifdef OVERDRAW_INSPECTORgl_FragColor=vec4(1.0);#endif}`,`attribute vec2 a_pos;uniform mat4 u_matrix;#pragma mapbox: define highp vec4 color#pragma mapbox: define lowp float opacityvoid main() {#pragma mapbox: initialize highp vec4 color#pragma mapbox: initialize lowp float opacitygl_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 opacityvoid main() {#pragma mapbox: initialize highp vec4 outline_color#pragma mapbox: initialize lowp float opacityfloat 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_INSPECTORgl_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 opacityvoid main() {#pragma mapbox: initialize highp vec4 outline_color#pragma mapbox: initialize lowp float opacitygl_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_tovoid main() {#pragma mapbox: initialize lowp float opacity#pragma mapbox: initialize mediump vec4 pattern_from#pragma mapbox: initialize mediump vec4 pattern_tovec2 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_INSPECTORgl_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_tovoid 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_tovec2 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_tovoid main() {#pragma mapbox: initialize lowp float opacity#pragma mapbox: initialize mediump vec4 pattern_from#pragma mapbox: initialize mediump vec4 pattern_tovec2 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_INSPECTORgl_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_tovoid 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_tovec2 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_INSPECTORgl_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 colorvoid main() {#pragma mapbox: initialize highp float base#pragma mapbox: initialize highp float height#pragma mapbox: initialize highp vec4 colorvec3 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_tovoid 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_tovec2 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_INSPECTORgl_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_tovoid 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_tovec2 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_ESprecision highp float;#endifuniform 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_INSPECTORgl_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.141592653589793void 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_INSPECTORgl_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 opacityvoid main() {#pragma mapbox: initialize highp vec4 color#pragma mapbox: initialize lowp float blur#pragma mapbox: initialize lowp float opacityfloat 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_INSPECTORgl_FragColor=vec4(1.0);#endif}`,`#define scale 0.015873016attribute 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 widthvoid 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 widthfloat 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 opacityvoid main() {#pragma mapbox: initialize lowp float blur#pragma mapbox: initialize lowp float opacityfloat 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_INSPECTORgl_FragColor=vec4(1.0);#endif}`,`#define scale 0.015873016attribute 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 widthvoid 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 widthfloat 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 opacityvoid 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 opacityvec2 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_INSPECTORgl_FragColor=vec4(1.0);#endif}`,`#define scale 0.015873016#define LINE_DISTANCE_SCALE 2.0attribute 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_tovoid 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_tofloat 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 floorwidthvoid 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 floorwidthfloat 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_INSPECTORgl_FragColor=vec4(1.0);#endif}`,`#define scale 0.015873016#define LINE_DISTANCE_SCALE 2.0attribute 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 floorwidthvoid 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 floorwidthfloat 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_INSPECTORgl_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 opacityvoid main() {#pragma mapbox: initialize lowp float opacitylowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;#ifdef OVERDRAW_INSPECTORgl_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 opacityvoid main() {#pragma mapbox: initialize lowp float opacityvec2 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.0uniform 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_blurvoid 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_blurfloat 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_INSPECTORgl_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_blurvoid 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_blurvec2 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.0uniform 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_blurvoid 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_blurfloat 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_INSPECTORgl_FragColor=vec4(1.0);#endifreturn;}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_INSPECTORgl_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_blurvoid 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_blurvec2 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+`;#elseuniform `+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+`;#elseuniform `+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+`;#elseuniform `+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_rati
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
`);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.dep
`,``).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
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.currentActiveTextu
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)}
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.filte
`;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
`).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])
|