@next-bricks/data-view 1.10.11 → 1.10.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/bricks.json +6 -6
  2. package/dist/chunks/3171.58807427.js +2 -0
  3. package/dist/chunks/{5552.c7abf709.js.map → 3171.58807427.js.map} +1 -1
  4. package/dist/chunks/{6314.2caa1846.js → 3933.f2b54556.js} +2 -2
  5. package/dist/chunks/{6314.2caa1846.js.map → 3933.f2b54556.js.map} +1 -1
  6. package/dist/chunks/4291.66178472.js +2 -0
  7. package/dist/chunks/4291.66178472.js.map +1 -0
  8. package/dist/chunks/5552.87da9878.js +2 -0
  9. package/dist/chunks/{3171.4ec49a67.js.map → 5552.87da9878.js.map} +1 -1
  10. package/dist/chunks/5902.549535f9.js +3 -0
  11. package/dist/chunks/5902.549535f9.js.map +1 -0
  12. package/dist/chunks/{3933.e1a5baea.js → 6314.a27d2069.js} +2 -2
  13. package/dist/chunks/{3933.e1a5baea.js.map → 6314.a27d2069.js.map} +1 -1
  14. package/dist/chunks/6773.5f152984.js +2 -0
  15. package/dist/chunks/6773.5f152984.js.map +1 -0
  16. package/dist/chunks/8097.e14d0f64.js +2 -0
  17. package/dist/chunks/{8097.790cb624.js.map → 8097.e14d0f64.js.map} +1 -1
  18. package/dist/chunks/871.b8aa19b8.js +2 -0
  19. package/dist/chunks/871.b8aa19b8.js.map +1 -0
  20. package/dist/chunks/8826.a293b47f.js +2 -0
  21. package/dist/chunks/{8826.58e3e455.js.map → 8826.a293b47f.js.map} +1 -1
  22. package/dist/chunks/9140.3c21ab5b.js +3 -0
  23. package/dist/chunks/9140.3c21ab5b.js.map +1 -0
  24. package/dist/chunks/complex-search.c53d6876.js +2 -0
  25. package/dist/chunks/{complex-search.96805f23.js.map → complex-search.c53d6876.js.map} +1 -1
  26. package/dist/chunks/graph-text.35673faa.js +2 -0
  27. package/dist/chunks/{graph-text.68c50603.js.map → graph-text.35673faa.js.map} +1 -1
  28. package/dist/chunks/main.44488957.js +2 -0
  29. package/dist/chunks/{main.17ec0a6e.js.map → main.44488957.js.map} +1 -1
  30. package/dist/chunks/{modern-style-treemap.e7d66b7e.js → modern-style-treemap.3836ca2d.js} +3 -3
  31. package/dist/chunks/{modern-style-treemap.e7d66b7e.js.map → modern-style-treemap.3836ca2d.js.map} +1 -1
  32. package/dist/examples.json +15 -15
  33. package/dist/index.8fb268dd.js +2 -0
  34. package/dist/index.8fb268dd.js.map +1 -0
  35. package/dist/manifest.json +120 -120
  36. package/dist/types.json +193 -193
  37. package/package.json +2 -2
  38. package/dist/chunks/3171.4ec49a67.js +0 -2
  39. package/dist/chunks/4185.e62f1747.js +0 -3
  40. package/dist/chunks/4185.e62f1747.js.map +0 -1
  41. package/dist/chunks/4291.8a2ae0f7.js +0 -2
  42. package/dist/chunks/4291.8a2ae0f7.js.map +0 -1
  43. package/dist/chunks/5552.c7abf709.js +0 -2
  44. package/dist/chunks/5902.8d260dd5.js +0 -3
  45. package/dist/chunks/5902.8d260dd5.js.map +0 -1
  46. package/dist/chunks/6773.12284ad6.js +0 -2
  47. package/dist/chunks/6773.12284ad6.js.map +0 -1
  48. package/dist/chunks/8097.790cb624.js +0 -2
  49. package/dist/chunks/871.f5aa7aaf.js +0 -2
  50. package/dist/chunks/871.f5aa7aaf.js.map +0 -1
  51. package/dist/chunks/8826.58e3e455.js +0 -2
  52. package/dist/chunks/complex-search.96805f23.js +0 -2
  53. package/dist/chunks/graph-text.68c50603.js +0 -2
  54. package/dist/chunks/main.17ec0a6e.js +0 -2
  55. package/dist/index.ac36a5ef.js +0 -2
  56. package/dist/index.ac36a5ef.js.map +0 -1
  57. /package/dist/chunks/{5902.8d260dd5.js.LICENSE.txt → 5902.549535f9.js.LICENSE.txt} +0 -0
  58. /package/dist/chunks/{4185.e62f1747.js.LICENSE.txt → 9140.3c21ab5b.js.LICENSE.txt} +0 -0
  59. /package/dist/chunks/{modern-style-treemap.e7d66b7e.js.LICENSE.txt → modern-style-treemap.3836ca2d.js.LICENSE.txt} +0 -0
@@ -1,3 +0,0 @@
1
- /*! For license information please see 5902.8d260dd5.js.LICENSE.txt */
2
- (globalThis.webpackChunk_next_bricks_data_view=globalThis.webpackChunk_next_bricks_data_view||[]).push([[5902],{195:(e,t,n)=>{var r=n(84882),i=n(98121),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},1386:(e,t,n)=>{var r=n(12393),i=n(62049),o=n(7144),a=n(7452),s=n(13964);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},1877:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1976:(e,t,n)=>{"use strict";n.d(t,{dv:()=>r,qK:()=>wt,ep:()=>i,xP:()=>o,qZ:()=>un,se:()=>bt,Gv:()=>L,_O:()=>C,_B:()=>O,IU:()=>Rt,vJ:()=>ut,rB:()=>St,fi:()=>Lt,gP:()=>Ot,dG:()=>w,Jh:()=>pn,Z8:()=>P,Xx:()=>yt,vy:()=>R,qk:()=>mt,K3:()=>B,vj:()=>N,zz:()=>U,Jj:()=>D,x6:()=>F,Y8:()=>E,tp:()=>Mt,bQ:()=>A,Er:()=>G,Qp:()=>S,g8:()=>dn,ZG:()=>fn,Os:()=>It,Fw:()=>st,qQ:()=>ct,KL:()=>vt,wU:()=>At,kC:()=>Tt,uG:()=>Ie,iD:()=>v,S8:()=>Ct,ng:()=>xt,HR:()=>I});var r={};n.r(r),n.d(r,{DPR:()=>Ke,addClass:()=>Ue,addStyle:()=>Qe,appendElementType:()=>ot,clearChildren:()=>rt,create:()=>Be,css2Style:()=>et,empty:()=>He,findParentElement:()=>at,getClass:()=>Ve,getContainer:()=>Pe,getDiffRect:()=>tt,getStyleList:()=>$e,getViewPortScale:()=>qe,hasClass:()=>Ge,printCanvas:()=>Ye,remove:()=>Fe,removeClass:()=>ke,removeStyle:()=>Je,setChecked:()=>nt,setClass:()=>ze,setTransform:()=>Xe,setUnDraggable:()=>it,splitWords:()=>De,toggleClass:()=>je,triggerResize:()=>Ze,trim:()=>Ne});var i={};n.r(i),n.d(i,{getColumn:()=>kt,getSatByColumn:()=>Gt,max:()=>Pt,mean:()=>Bt,min:()=>Nt,mode:()=>Ft,statMap:()=>Ut,sum:()=>Dt});var o={REGISTERED_PROTOCOLS:{}},a=Object.defineProperty,s=Object.defineProperties,l=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,d=(e,t,n)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,f=(e,t)=>{for(var n in t||(t={}))u.call(t,n)&&d(e,n,t[n]);if(c)for(var n of c(t))h.call(t,n)&&d(e,n,t[n]);return e},p=(e,t)=>s(e,l(t)),g=e=>o.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))],m=class extends Error{constructor(e,t,n,r){super(`AJAXError: ${t} (${e}): ${n}`),this.status=e,this.statusText=t,this.url=n,this.body=r}};function _(e,t){const n=new XMLHttpRequest,r=Array.isArray(e.url)?e.url[0]:e.url;n.open(e.method||"GET",r,!0),"arrayBuffer"===e.type&&(n.responseType="arraybuffer");for(const t in e.headers)e.headers.hasOwnProperty(t)&&n.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===e.credentials,n.onerror=()=>{t(new Error(n.statusText))},n.onload=()=>{if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let r=n.response;if("json"===e.type)try{r=JSON.parse(n.response)}catch(e){return t(e)}t(null,r,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"),n)}else{const e=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});t(new m(n.status,n.statusText,r.toString(),e))}},n.cancel=n.abort,n.send(e.body),n}function v(e){return new Promise(((t,n)=>{_(e,((e,r,i,o,a)=>{e?n({err:e,data:null,xhr:a}):t({err:null,data:r,cacheControl:i,expires:o,xhr:a})}))}))}function y(e,t){return _(e,t)}var E=(e,t)=>(g(e.url)||y)(p(f({},e),{type:"arrayBuffer"}),t),A=(e,t)=>y(p(f({},e),{method:"GET"}),t),b="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function T(e,t){const n=new window.Image,r=window.URL||window.webkitURL;n.crossOrigin="anonymous",n.onload=()=>{t(null,n),r.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame((()=>{n.src=b}))},n.onerror=()=>t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const i=new Blob([new Uint8Array(e)],{type:"image/png"});n.src=e.byteLength?r.createObjectURL(i):b}function x(e,t){const n=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(n).then((e=>{t(null,e)})).catch((e=>{t(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}var S=(e,t,n)=>{const r=(e,r)=>{if(e)t(e);else if(r){const e="function"==typeof createImageBitmap,i=n?n(r):r;e?x(i,t):T(i,t)}};return"json"===e.type?((e,t)=>(g(e.url)||y)(p(f({},e),{type:"json"}),t))(e,r):E(e,r)},R=(e,t)=>{"function"==typeof createImageBitmap?x(e,t):T(e,t)},C=(e=>(e.CENTER="center",e.TOP="top",e["TOP-LEFT"]="top-left",e["TOP-RIGHT"]="top-right",e.BOTTOM="bottom",e["BOTTOM-LEFT"]="bottom-left",e["BOTTOM-RIGHT"]="bottom-right",e.LEFT="left",e.RIGHT="right",e))(C||{}),L={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function O(e,t,n){const r=e.classList;for(const e in L)L.hasOwnProperty(e)&&r.remove(`l7-${n}-anchor-${e}`);r.add(`l7-${n}-anchor-${t}`)}var M=n(66424);function I(e){const t=M.Ay(e),n=[0,0,0,0];return null!=t&&(n[0]=t.r/255,n[1]=t.g/255,n[2]=t.b/255,n[3]=t.opacity),n}function w(e){return(e&&e[0])+256*(e&&e[1])+65536*(e&&e[2])-1}function P(e){return[e+1&255,e+1>>8&255,e+1>>8>>8&255]}function N(e){let t=window.document.createElement("canvas"),n=t.getContext("2d");t.width=256,t.height=1;let r=null;const i=n.createLinearGradient(0,0,256,1),o=e.positions[0],a=e.positions[e.positions.length-1];for(let t=0;t<e.colors.length;++t){const n=(e.positions[t]-o)/(a-o);i.addColorStop(n,e.colors[t])}return n.fillStyle=i,n.fillRect(0,0,256,1),r=new Uint8ClampedArray(n.getImageData(0,0,256,1).data),t=null,n=null,{data:r,width:256,height:1}}function D(e,t){let n=window.document.createElement("canvas"),r=n.getContext("2d");n.width=256,n.height=1;const i=r.createLinearGradient(0,0,256,1),o=t[1]-t[0];for(let n=0;n<e.colors.length;++n){const r=Math.max((e.positions[n]-t[0])/o,0);i.addColorStop(r,e.colors[n])}r.fillStyle=i,r.fillRect(0,0,256,1);const a=r.getImageData(0,0,256,1).data,s=k(r,a);return n=null,r=null,s}function B(e){let t=window.document.createElement("canvas"),n=t.getContext("2d");t.width=256,t.height=1;const r=n.createImageData(256,1);return r.data.fill(0),e.positions.forEach(((t,n)=>{const i=I(e.colors[n]);r.data[4*t+0]=255*i[0],r.data[4*t+1]=255*i[1],r.data[4*t+2]=255*i[2],r.data[4*t+3]=255*i[3]})),t=null,n=null,r}function F(e){let t=window.document.createElement("canvas"),n=t.getContext("2d");n.globalAlpha=1,t.width=256,t.height=1;const r=256/e.colors.length;for(let t=0;t<e.colors.length;t++)n.beginPath(),n.lineWidth=2,n.strokeStyle=e.colors[t],n.moveTo(t*r,0),n.lineTo((t+1)*r,0),n.stroke();const i=n.getImageData(0,0,256,1).data,o=k(n,i);return t=null,n=null,o}function U(e,t){let n=window.document.createElement("canvas"),r=n.getContext("2d");r.globalAlpha=1,n.width=256,n.height=1;const i=t[1]-t[0];e.positions.length-e.colors.length!=1&&console.warn("positions 的数字个数应当比 colors 的样式多一个,poisitions 的首尾值一般为数据的最大最新值");for(let n=0;n<e.colors.length;n++)r.beginPath(),r.lineWidth=2,r.strokeStyle=e.colors[n],r.moveTo((e.positions[n]-t[0])/i*255,0),r.lineTo((e.positions[n+1]-t[0])/i*255,0),r.stroke();const o=r.getImageData(0,0,256,1).data,a=k(r,o);return n=null,r=null,a}function k(e,t){const n=e.createImageData(256,1);for(let e=0;e<n.data.length;e+=4)n.data[e+0]=t[e+0],n.data[e+1]=t[e+1],n.data[e+2]=t[e+2],n.data[e+3]=t[e+3];return n}function G(e){return"cat"===(null==e?void 0:e.type)?[0,255]:[0,1]}var z=n(17228),j=n.n(z),V=n(46108),H=n.n(V),W=n(12784),X=n.n(W),Z=n(46123),Y=n.n(Z),q=n(22563),K=n.n(q),Q=n(46343),$=n.n(Q),J=n(3668),ee=n.n(J),te=n(60986),ne=n.n(te),re=n(48360),ie=n.n(re),oe=n(8138),ae=n.n(oe),se=n(8666),le=n.n(se),ce=n(82451),ue=n.n(ce),he=n(48875),de=n.n(he),fe=n(7292),pe=n.n(fe),ge=n(97331),me=n.n(ge),_e=n(82438),ve=n.n(_e),ye=n(5485),Ee=n.n(ye),Ae=n(93655),be=n.n(Ae),Te=n(41580),xe=n.n(Te),Se=n(58771),Re=n.n(Se),Ce=n(99677),Le=n.n(Ce),Oe=n(38285),Me=n.n(Oe),Ie={isNil:ee(),merge:ue(),throttle:me(),isString:ae(),debounce:X(),pull:pe(),isTypedArray:le(),isPlainObject:ie(),isNumber:ne(),isBoolean:K(),isEqual:$(),cloneDeep:H(),uniq:ve(),clamp:j(),upperFirst:Ee(),get:Y(),mergeWith:de(),isFunction:be(),isObject:xe(),isUndefined:Re(),camelCase:Le(),uniqueId:Me()},{pull:we}=Ie;function Pe(e){let t=e;return"string"==typeof e&&(t=window.document.getElementById(e)),t}function Ne(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function De(e){return Ne(e).split(/\s+/)}function Be(e,t,n){const r=window.document.createElement(e);return t&&(r.className=t||""),n&&n.appendChild(r),r}function Fe(e){const t=e.parentNode;t&&t.removeChild(e)}function Ue(e,t){if(void 0!==e.classList){const n=De(t);for(let t=0,r=n.length;t<r;t++)e.classList.add(n[t])}else if(!Ge(e,t)){const n=Ve(e);ze(e,(n?n+" ":"")+t)}}function ke(e,t){void 0!==e.classList?De(t).forEach((t=>{e.classList.remove(t)})):ze(e,Ne((" "+Ve(e)+" ").replace(" "+t+" "," ")))}function Ge(e,t){if(void 0!==e.classList)return e.classList.contains(t);const n=Ve(e);return n.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(n)}function ze(e,t){e instanceof HTMLElement?e.className=t:e.className.baseVal=t}function je(e,t,n){void 0===n?Ge(e,t)?ke(e,t):Ue(e,t):n?Ue(e,t):ke(e,t)}function Ve(e){return e instanceof SVGElement&&(e=e.correspondingElement),void 0===e.className.baseVal?e.className:e.className.baseVal}function He(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}var We=function(e){var t;const n=null==(t=null==document?void 0:document.documentElement)?void 0:t.style;if(!n)return e[0];for(const t in e)if(e[t]&&e[t]in n)return e[t];return e[0]}(["transform","WebkitTransform"]);function Xe(e,t){e.style[We]=t}function Ze(){if("function"==typeof Event)window.dispatchEvent(new Event("resize"));else{const e=window.document.createEvent("UIEvents");e.initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(e)}}function Ye(e){const t=["padding: "+(e.height/2-8)+"px "+e.width/2+"px;","line-height: "+e.height+"px;","background-image: url("+e.toDataURL()+");"];console.log("%c\n",t.join(""))}function qe(){var e;const t=window.document.querySelector('meta[name="viewport"]');if(!t)return 1;const n=(null==(e=t.content)?void 0:e.split(",")).find((e=>{const[t]=e.split("=");return"initial-scale"===t}));return n?1*n.split("=")[1]:1}var Ke=qe()<1?1:window.devicePixelRatio;function Qe(e,t){e.setAttribute("style",`${e.style.cssText}${t}`)}function $e(e){return e.split(";").map((e=>e.trim())).filter((e=>e))}function Je(e,t){var n;const r=$e(null!=(n=e.getAttribute("style"))?n:""),i=$e(t),o=we(r,...i);e.setAttribute("style",o.join(";"))}function et(e){return Object.entries(e).map((([e,t])=>`${e}: ${t}`)).join(";")}function tt(e,t){return{left:e.left-t.left,top:e.top-t.top,right:t.left+t.width-e.left-e.width,bottom:t.top+t.height-e.top-e.height}}function nt(e,t){e.checked=t,t?e.setAttribute("checked","true"):e.removeAttribute("checked")}function rt(e){e.innerHTML=""}function it(e){e.setAttribute("draggable","false")}function ot(e,t){if("string"==typeof t){const n=document.createElement("div");for(n.innerHTML=t;n.firstChild;)e.append(n.firstChild)}else Array.isArray(t)?e.append(...t):e.append(t)}function at(e,t){var n;const r=Array.isArray(t)?t:[t];let i=e;for(;i instanceof Element&&i!==window.document.body;){if(r.find((e=>null==i?void 0:i.matches(e))))return i;i=null!=(n=null==i?void 0:i.parentElement)?n:null}}function st(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap}var lt=null==navigator?void 0:navigator.userAgent;function ct(){const e=lt,t=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"];let n=!0;for(const r of t)if(e.indexOf(r)>0){n=!1;break}return n}function ut(e,t){e.forEach((e=>{t[e]&&(t[e]=t[e].bind(t))}))}lt.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),lt.indexOf("Android")>-1||lt.indexOf("Adr");var ht=n(19004);function dt(e){var t=[1/0,1/0,-1/0,-1/0];return(0,ht.Fh)(e,(function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])})),t}dt.default=dt;const ft=dt;var pt=n(33270);function gt(e){return"number"==typeof e}function mt(e){return e-Math.fround(e)}var _t=2*Math.PI*6378137/2;function vt(e,t){const[n,r,i,o]=t;return e.lng>n&&e.lng<=i&&e.lat>r&&e.lat<=o}function yt(e){const t=[1/0,1/0,-1/0,-1/0];return e.forEach((e=>{const{coordinates:n}=e;Et(t,n)})),t}function Et(e,t){return Array.isArray(t[0])?t.forEach((t=>{Et(e,t)})):(e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])),e}function At(e,t=!0,n={enable:!0,decimal:1}){e=function(e,t){if(!1===t)return e;const n=function(e){if(null==e)throw new Error("lng is required");return(e>180||e<-180)&&((e%=360)>180&&(e=-360+e),e<-180&&(e=360+e),0===e&&(e=0)),e}(e[0]);let r=function(e){if(null==e)throw new Error("lat is required");return(e>90||e<-90)&&((e%=180)>90&&(e=-180+e),e<-90&&(e=180+e),0===e&&(e=0)),e}(e[1]);return r>85&&(r=85),r<-85&&(r=-85),3===e.length?[n,r,e[2]]:[n,r]}(e,t);const r=e[0],i=e[1];let o=r*_t/180,a=Math.log(Math.tan((90+i)*Math.PI/360))/(Math.PI/180);return a=a*_t/180,n.enable&&(o=Number(o.toFixed(n.decimal)),a=Number(a.toFixed(n.decimal))),3===e.length?[o,a,e[2]]:[o,a]}function bt(e){const t=85.0511287798,n=Math.max(Math.min(t,e[1]),-t),r=256<<20;let i=Math.PI/180,o=e[0]*i,a=n*i;return a=Math.log(Math.tan(Math.PI/4+a/2)),i=.5,o=r*(.5/Math.PI*o+.5),a=r*(-.5/Math.PI*a+i),[Math.floor(o),Math.floor(a)]}function Tt(e,t,n){const r=(0,pt.tR)(t[1]-e[1]),i=(0,pt.tR)(t[0]-e[0]),o=(0,pt.tR)(e[1]),a=(0,pt.tR)(t[1]),s=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(i/2),2)*Math.cos(o)*Math.cos(a);return(0,pt.cJ)(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)),"meters")}function xt(e,t){const n=Math.abs(e[1][1]-e[0][1])*t,r=Math.abs(e[1][0]-e[0][0])*t;return[[e[0][0]-r,e[0][1]-n],[e[1][0]+r,e[1][1]+n]]}function St(e,t){return e[0][0]<=t[0][0]&&e[0][1]<=t[0][1]&&e[1][0]>=t[1][0]&&e[1][1]>=t[1][1]}function Rt(e){return[[e[0],e[1]],[e[2],e[3]]]}function Ct(e){const t=(n=e,r=[0,0],Math.sqrt(Math.pow(n[0]-r[0],2)+Math.pow(n[1]-r[1],2)));var n,r;return[e[0]/t,e[1]/t]}function Lt(e){if(gt(e[0]))return e;if(gt(e[0][0]))throw new Error("当前数据不支持标注");if(gt(e[0][0][0])){let t=0,n=0,r=0;return e.forEach((e=>{e.forEach((e=>{t+=e[0],n+=e[1],r++}))})),[t/r,n/r,0]}throw new Error("当前数据不支持标注")}function Ot(e){let t=e[0],n=e[1],r=e[0],i=e[1],o=0,a=0,s=0;for(let l=0;l<e.length;l+=2){const c=e[l],u=e[l+1];c&&u&&(t=Math.max(c,t),n=Math.max(u,n),r=Math.min(c,r),i=Math.min(u,i),o+=c,a+=u,s++)}return{center:[o/s,a/s],radius:Math.sqrt(Math.pow(t-r,2)+Math.pow(n-i,2))/2}}function Mt(e){return ft((0,pt.Lr)([(0,pt.wi)(e)]))}function It(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var wt=class{constructor(e=50,t){this.limit=e,this.destroy=t||this.defaultDestroy,this.order=[],this.clear()}clear(){this.order.forEach((e=>{this.delete(e)})),this.cache={},this.order=[]}get(e){const t=this.cache[e];return t&&(this.deleteOrder(e),this.appendOrder(e)),t}set(e,t){this.cache[e]?(this.delete(e),this.cache[e]=t,this.appendOrder(e)):(Object.keys(this.cache).length===this.limit&&this.delete(this.order[0]),this.cache[e]=t,this.appendOrder(e))}delete(e){const t=this.cache[e];t&&(this.deleteCache(e),this.deleteOrder(e),this.destroy(t,e))}deleteCache(e){delete this.cache[e]}deleteOrder(e){const t=this.order.findIndex((t=>t===e));t>=0&&this.order.splice(t,1)}appendOrder(e){this.order.push(e)}defaultDestroy(e,t){return null}};function Pt(e){if(0===e.length)throw new Error("max requires at least one data point");let t=e[0];for(let n=1;n<e.length;n++)e[n]>t&&(t=e[n]);return 1*t}function Nt(e){if(0===e.length)throw new Error("min requires at least one data point");let t=e[0];for(let n=1;n<e.length;n++)e[n]<t&&(t=e[n]);return 1*t}function Dt(e){if(0===e.length)return 0;let t=1*e[0];for(let n=1;n<e.length;n++)t+=1*e[n];return t}function Bt(e){if(0===e.length)throw new Error("mean requires at least one data point");return Dt(e)/e.length}function Ft(e){if(0===e.length)throw new Error("mean requires at least one data point");if(e.length<3)return e[0];e.sort();let t=e[0],n=NaN,r=0,i=1;for(let o=1;o<e.length+1;o++)e[o]!==t?(i>r&&(r=i,n=t),i=1,t=e[o]):i++;return 1*n}var Ut={min:Nt,max:Pt,mean:Bt,sum:Dt,mode:Ft};function kt(e,t){return e.map((e=>e[t]))}function Gt(e,t){return Ut[e](t)}var zt=n(28985),jt=n.n(zt),Vt=(e=>(e.Realtime="realtime",e.Overlap="overlap",e.Replace="replace",e))(Vt||{}),Ht=(e=>(e.Loading="Loading",e.Loaded="Loaded",e.Failure="Failure",e.Cancelled="Cancelled",e))(Ht||{});function Wt(e){for(;e;){if(e.isLoaded)return e.properties.state|=2,!0;e=e.parent}return!1}function Xt(e){e.children.forEach((e=>{e.isLoaded?e.properties.state|=2:Xt(e)}))}var Zt=[-1/0,-1/0,1/0,1/0],Yt={[Vt.Realtime]:function(e){e.forEach((e=>{e.isCurrent&&(e.isVisible=e.isLoaded)}))},[Vt.Overlap]:function(e){e.forEach((e=>{e.properties.state=0})),e.forEach((e=>{e.isCurrent&&!Wt(e)&&Xt(e)})),e.forEach((e=>{e.isVisible=Boolean(2&e.properties.state)}))},[Vt.Replace]:function(e){e.forEach((e=>{e.properties.state=0})),e.forEach((e=>{e.isCurrent&&Wt(e)})),e.slice().sort(((e,t)=>e.z-t.z)).forEach((e=>{e.isVisible=Boolean(2&e.properties.state),e.children.length&&(e.isVisible||1&e.properties.state)?e.children.forEach((e=>{e.properties.state=1})):e.isCurrent&&Xt(e)}))}},qt=()=>{};function Kt(e,t,n){return[Math.floor((e+180)/360*Math.pow(2,n)),Math.floor((1-Math.log(Math.tan(t*Math.PI/180)+1/Math.cos(t*Math.PI/180))/Math.PI)/2*Math.pow(2,n))]}function Qt(e,t,n){const r=e/Math.pow(2,n)*360-180,i=Math.PI-2*Math.PI*t/Math.pow(2,n);return[r,180/Math.PI*Math.atan(.5*(Math.exp(i)-Math.exp(-i)))]}var $t=(e,t,n)=>{const[r,i]=Qt(e,t,n),[o,a]=Qt(e+1,t+1,n);return[r,a,o,i]},Jt=class extends zt.EventEmitter{constructor(e){super(),this.tileSize=256,this.isVisible=!1,this.isCurrent=!1,this.isVisibleChange=!1,this.loadedLayers=0,this.isLayerLoaded=!1,this.isLoad=!1,this.isChildLoad=!1,this.parent=null,this.children=[],this.data=null,this.properties={},this.loadDataId=0;const{x:t,y:n,z:r,tileSize:i,warp:o=!0}=e;this.x=t,this.y=n,this.z=r,this.warp=o||!0,this.tileSize=i}get isLoading(){return this.loadStatus===Ht.Loading}get isLoaded(){return this.loadStatus===Ht.Loaded}get isFailure(){return this.loadStatus===Ht.Failure}setTileLayerLoaded(){this.isLayerLoaded=!0}get isCancelled(){return this.loadStatus===Ht.Cancelled}get isDone(){return[Ht.Loaded,Ht.Cancelled,Ht.Failure].includes(this.loadStatus)}get bounds(){return $t(this.x,this.y,this.z)}get bboxPolygon(){const[e,t,n,r]=this.bounds,i=[(n-e)/2,(r-t)/2],o=function(e,t){void 0===t&&(t={});var n=Number(e[0]),r=Number(e[1]),i=Number(e[2]),o=Number(e[3]);if(6===e.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var a=[n,r],s=[n,o],l=[i,o],c=[i,r];return(0,pt.n1)([[a,c,l,s,a]],t.properties,{bbox:e,id:t.id})}(this.bounds,{properties:{key:this.key,id:this.key,bbox:this.bounds,center:i,meta:`\n ${this.key}\n `}});return o}get key(){return`${this.x}_${this.y}_${this.z}`}layerLoad(){this.loadedLayers++,this.emit("layerLoaded")}loadData(e){return t=this,n=arguments,r=function*({getData:e,onLoad:t,onError:n}){this.loadDataId++;const r=this.loadDataId;this.isLoading&&this.abortLoad(),this.abortController=new AbortController,this.loadStatus=Ht.Loading;let i,o=null;try{const{x:t,y:n,z:r,bounds:i,tileSize:a,warp:s}=this,{warpX:l,warpY:c}=((e,t,n,r=!0)=>{const i=Math.pow(2,n);let o=e;return r&&(o<0?o+=i:o>i-1&&(o%=i)),{warpX:o,warpY:t}})(t,n,r,s),{signal:u}=this.abortController,h={x:l,y:c,z:r,bounds:i,tileSize:a,signal:u,warp:s};o=yield e(h,this)}catch(e){i=e}if(r===this.loadDataId&&(!this.isCancelled||o)){if(i||!o)return this.loadStatus=Ht.Failure,void n(i,this);this.loadStatus=Ht.Loaded,this.data=o,t(this)}},new Promise(((e,i)=>{var o=e=>{try{s(r.next(e))}catch(e){i(e)}},a=e=>{try{s(r.throw(e))}catch(e){i(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,a);s((r=r.apply(t,n)).next())}));var t,n,r}reloadData(e){this.isLoading&&this.abortLoad(),this.loadData(e)}abortLoad(){this.isLoaded||this.isCancelled||(this.loadStatus=Ht.Cancelled,this.abortController.abort(),this.xhrCancel&&this.xhrCancel())}},en=Object.defineProperty,tn=Object.defineProperties,nn=Object.getOwnPropertyDescriptors,rn=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable,sn=(e,t,n)=>t in e?en(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ln=(e,t)=>{for(var n in t||(t={}))on.call(t,n)&&sn(e,n,t[n]);if(rn)for(var n of rn(t))an.call(t,n)&&sn(e,n,t[n]);return e},{throttle:cn}=Ie,un=class extends(jt()){constructor(e){super(),this.currentTiles=[],this.cacheTiles=new Map,this.throttleUpdate=cn(((e,t)=>{this.update(e,t)}),16),this.onTileLoad=e=>{this.emit("tile-loaded",e),this.updateTileVisible(),this.loadFinished()},this.onTileError=(e,t)=>{this.emit("tile-error",{error:e,tile:t}),this.updateTileVisible(),this.loadFinished()},this.onTileUnload=e=>{this.emit("tile-unload",e),this.loadFinished()},this.options={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,extent:Zt,getTileData:qt,warp:!0,updateStrategy:Vt.Replace},this.updateOptions(e)}get isLoaded(){return this.currentTiles.every((e=>e.isDone))}get tiles(){return Array.from(this.cacheTiles.values()).sort(((e,t)=>e.z-t.z))}updateOptions(e){const t=void 0===e.minZoom?this.options.minZoom:Math.ceil(e.minZoom),n=void 0===e.maxZoom?this.options.maxZoom:Math.floor(e.maxZoom);var r;this.options=(r=ln(ln({},this.options),e),tn(r,nn({minZoom:t,maxZoom:n})))}update(e,t){const n=Math.max(0,Math.ceil(e));if(this.lastViewStates&&this.lastViewStates.zoom===n&&((e,t)=>St(Rt(e),Rt(t)))(this.lastViewStates.latLonBoundsBuffer,t))return;const r=(e=>{const t=xt(Rt(e),.2),n=85.0511287798065;return[Math.max(t[0][0],-900),Math.max(t[0][1],-n),Math.min(t[1][0],900),Math.min(t[1][1],n)]})(t);this.lastViewStates={zoom:n,latLonBounds:t,latLonBoundsBuffer:r},this.currentZoom=n;let i=!1;const o=this.getTileIndices(n,r).filter((e=>this.options.warp||e.x>=0&&e.x<Math.pow(2,n)));this.emit("tiles-load-start"),this.currentTiles=o.map((({x:e,y:t,z:n})=>{let r=this.getTile(e,t,n);return r?(((null==r?void 0:r.isFailure)||(null==r?void 0:r.isCancelled))&&r.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}),r):(r=this.createTile(e,t,n),i=!0,r)})),i&&this.resizeCacheTiles(),this.updateTileVisible(),this.pruneRequests()}reloadAll(){for(const[e,t]of this.cacheTiles){if(!this.currentTiles.includes(t))return this.cacheTiles.delete(e),void this.onTileUnload(t);this.onTileUnload(t),t.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError})}}reloadTileById(e,t,n){const r=this.cacheTiles.get(`${t},${n},${e}`);r&&(this.onTileUnload(r),r.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}))}reloadTileByLnglat(e,t,n){const r=this.getTileByLngLat(e,t,n);r&&this.reloadTileById(r.z,r.x,r.y)}reloadTileByExtent(e,t){this.getTileIndices(t,e).forEach((e=>{this.reloadTileById(e.z,e.x,e.y)}))}pruneRequests(){const e=[];for(const t of this.cacheTiles.values())t.isLoading&&(t.isCurrent||t.isVisible||e.push(t));for(;e.length>0;)e.shift().abortLoad()}getTileByLngLat(e,t,n){const{zoomOffset:r}=this.options,i=Math.ceil(n)+r,o=Kt(e,t,i);return this.tiles.filter((e=>e.key===`${o[0]}_${o[1]}_${i}`))[0]}getTileExtent(e,t){return this.getTileIndices(t,e)}getTileByZXY(e,t,n){return this.tiles.filter((r=>r.key===`${t}_${n}_${e}`))[0]}clear(){for(const e of this.cacheTiles.values())e.isLoading?e.abortLoad():this.onTileUnload(e);this.lastViewStates=void 0,this.cacheTiles.clear(),this.currentTiles=[]}destroy(){this.clear(),this.removeAllListeners()}updateTileVisible(){const e=this.options.updateStrategy,t=new Map;for(const e of this.cacheTiles.values())t.set(e.key,e.isVisible),e.isCurrent=!1,e.isVisible=!1;for(const e of this.currentTiles)e.isCurrent=!0,e.isVisible=!0;const n=Array.from(this.cacheTiles.values());"function"==typeof e?e(n):Yt[e](n);let r=!1;Array.from(this.cacheTiles.values()).forEach((e=>{e.isVisible!==t.get(e.key)?(e.isVisibleChange=!0,r=!0):e.isVisibleChange=!1})),r&&this.emit("tile-update")}getTileIndices(e,t){const{tileSize:n,extent:r,zoomOffset:i}=this.options,o=function({zoom:e,latLonBounds:t,maxZoom:n=1/0,minZoom:r=0,zoomOffset:i=0,extent:o=Zt}){let a=Math.ceil(e)+i;if(Number.isFinite(r)&&a<r)return[];Number.isFinite(n)&&a>n&&(a=n);const[s,l,c,u]=t,h=[Math.max(s,o[0]),Math.max(l,o[1]),Math.min(c,o[2]),Math.min(u,o[3])],d=[],[f,p]=Kt(h[0],h[1],a),[g,m]=Kt(h[2],h[3],a);for(let e=f;e<=g;e++)for(let t=m;t<=p;t++)d.push({x:e,y:t,z:a});const _=(g+f)/2,v=(p+m)/2,y=(e,t)=>Math.abs(e-_)+Math.abs(t-v);return d.sort(((e,t)=>y(e.x,e.y)-y(t.x,t.y))),d}({maxZoom:Math.floor(this.options.maxZoom),minZoom:Math.ceil(this.options.minZoom),zoomOffset:i,tileSize:n,zoom:e,latLonBounds:t,extent:r});return o}getTileId(e,t,n){return`${e},${t},${n}`}loadFinished(){const e=!this.currentTiles.some((e=>!e.isDone));return e&&this.emit("tiles-load-finished"),e}getTile(e,t,n){const r=this.getTileId(e,t,n);return this.cacheTiles.get(r)}createTile(e,t,n){const r=this.getTileId(e,t,n),i=new Jt({x:e,y:t,z:n,tileSize:this.options.tileSize,warp:this.options.warp});return this.cacheTiles.set(r,i),i.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}),i}resizeCacheTiles(){const e=5*this.currentTiles.length;if(this.cacheTiles.size>e)for(const[t,n]of this.cacheTiles)if(n.isVisible||this.currentTiles.includes(n)||(this.cacheTiles.delete(t),this.onTileUnload(n)),this.cacheTiles.size<=e)break;this.rebuildTileTree()}rebuildTileTree(){for(const e of this.cacheTiles.values())e.parent=null,e.children.length=0;for(const e of this.cacheTiles.values()){const t=this.getNearestAncestor(e.x,e.y,e.z);e.parent=t,(null==t?void 0:t.children)&&t.children.push(e)}}getNearestAncestor(e,t,n){for(;n>this.options.minZoom;){e=Math.floor(e/2),t=Math.floor(t/2),n-=1;const r=this.getTile(e,t,n);if(r)return r}return null}};function hn(e){const t=[];let n=/\{([a-z])-([a-z])\}/.exec(e);if(n){const r=n[1].charCodeAt(0),i=n[2].charCodeAt(0);let o;for(o=r;o<=i;++o)t.push(e.replace(n[0],String.fromCharCode(o)));return t}if(n=/\{(\d+)-(\d+)\}/.exec(e),n){const r=parseInt(n[2],10);for(let i=parseInt(n[1],10);i<=r;i++)t.push(e.replace(n[0],i.toString()));return t}return t.push(e),t}function dn(e,t){if(!e||!e.length)throw new Error("url is not allowed to be empty");const{x:n,y:r,z:i}=t,o=hn(e),a=Math.abs(n+r)%o.length;return(g(o[a])?`${o[a]}/{z}/{x}/{y}`:o[a]).replace(/\{x\}/g,n.toString()).replace(/\{y\}/g,r.toString()).replace(/\{z\}/g,i.toString()).replace(/\{bbox\}/g,$t(n,r,i).join(",")).replace(/\{-y\}/g,(Math.pow(2,i)-r-1).toString())}function fn(e,t){const{x:n,y:r,z:i,layer:o,version:a="1.0.0",style:s="default",format:l,service:c="WMTS",tileMatrixset:u}=t,h=hn(e);return`${h[Math.abs(n+r)%h.length]}&SERVICE=${c}&REQUEST=GetTile&VERSION=${a}&LAYER=${o}&STYLE=${s}&TILEMATRIXSET=${u}&FORMAT=${l}&TILECOL=${n}&TILEROW=${r}&TILEMATRIX=${i}`}function pn(e,t){return null==e?t:e}},2235:function(e){e.exports=function(){"use strict";function e(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var t=function(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null};function n(e,t){return e>t?1:e<t?-1:0}function r(e,n,r){for(var i=new t(null,null),o=i,a=i;;){var s=r(e,n.key);if(s<0){if(null===n.left)break;if(r(e,n.left.key)<0){var l=n.left;if(n.left=l.right,l.right=n,null===(n=l).left)break}a.left=n,a=n,n=n.left}else{if(!(s>0))break;if(null===n.right)break;if(r(e,n.right.key)>0&&(l=n.right,n.right=l.left,l.left=n,null===(n=l).right))break;o.right=n,o=n,n=n.right}}return o.right=n.left,a.left=n.right,n.left=i.right,n.right=i.left,n}function i(e,n,i,o){var a=new t(e,n);if(null===i)return a.left=a.right=null,a;var s=o(e,(i=r(e,i,o)).key);return s<0?(a.left=i.left,a.right=i,i.left=null):s>=0&&(a.right=i.right,a.left=i,i.right=null),a}function o(e,t,n){var i=null,o=null;if(t){var a=n((t=r(e,t,n)).key,e);0===a?(i=t.left,o=t.right):a<0?(o=t.right,t.right=null,i=t):(i=t.left,t.left=null,o=t)}return{left:i,right:o}}function a(e,t,n,r,i){if(e){r(t+(n?"└── ":"├── ")+i(e)+"\n");var o=t+(n?" ":"│ ");e.left&&a(e.left,o,!1,r,i),e.right&&a(e.right,o,!0,r,i)}}var s=function(){function s(e){void 0===e&&(e=n),this._root=null,this._size=0,this._comparator=e}return s.prototype.insert=function(e,t){return this._size++,this._root=i(e,t,this._root,this._comparator)},s.prototype.add=function(e,n){var i=new t(e,n);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,a=r(e,this._root,o),s=o(e,a.key);return 0===s?this._root=a:(s<0?(i.left=a.left,i.right=a,a.left=null):s>0&&(i.right=a.right,i.left=a,a.right=null),this._size++,this._root=i),this._root},s.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},s.prototype._remove=function(e,t,n){var i;return null===t?null:0===n(e,(t=r(e,t,n)).key)?(null===t.left?i=t.right:(i=r(e,t.left,n)).right=t.right,this._size--,i):t},s.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=r(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},s.prototype.findStatic=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(0===r)return t;t=r<0?t.left:t.right}return null},s.prototype.find=function(e){return this._root&&(this._root=r(e,this._root,this._comparator),0!==this._comparator(e,this._root.key))?null:this._root},s.prototype.contains=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(0===r)return!0;t=r<0?t.left:t.right}return!1},s.prototype.forEach=function(e,t){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),e.call(t,n),n=n.right):i=!0;return this},s.prototype.range=function(e,t,n,r){for(var i=[],o=this._comparator,a=this._root;0!==i.length||a;)if(a)i.push(a),a=a.left;else{if(o((a=i.pop()).key,t)>0)break;if(o(a.key,e)>=0&&n.call(r,a))return this;a=a.right}return this},s.prototype.keys=function(){var e=[];return this.forEach((function(t){var n=t.key;return e.push(n)})),e},s.prototype.values=function(){var e=[];return this.forEach((function(t){var n=t.data;return e.push(n)})),e},s.prototype.min=function(){return this._root?this.minNode(this._root).key:null},s.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},s.prototype.minNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.left;)e=e.left;return e},s.prototype.maxNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.right;)e=e.right;return e},s.prototype.at=function(e){for(var t=this._root,n=!1,r=0,i=[];!n;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),r===e)return t;r++,t=t.right}else n=!0;return null},s.prototype.next=function(e){var t=this._root,n=null;if(e.right){for(n=e.right;n.left;)n=n.left;return n}for(var r=this._comparator;t;){var i=r(e.key,t.key);if(0===i)break;i<0?(n=t,t=t.left):t=t.right}return n},s.prototype.prev=function(e){var t=this._root,n=null;if(null!==e.left){for(n=e.left;n.right;)n=n.right;return n}for(var r=this._comparator;t;){var i=r(e.key,t.key);if(0===i)break;i<0?t=t.left:(n=t,t=t.right)}return n},s.prototype.clear=function(){return this._root=null,this._size=0,this},s.prototype.toList=function(){return function(e){for(var n=e,r=[],i=!1,o=new t(null,null),a=o;!i;)n?(r.push(n),n=n.left):r.length>0?n=(n=a=a.next=r.pop()).right:i=!0;return a.next=null,o.next}(this._root)},s.prototype.load=function(e,n,r){void 0===n&&(n=[]),void 0===r&&(r=!1);var i=e.length,o=this._comparator;if(r&&u(e,n,0,i-1,o),null===this._root)this._root=l(e,n,0,i),this._size=i;else{var a=function(e,n,r){for(var i=new t(null,null),o=i,a=e,s=n;null!==a&&null!==s;)r(a.key,s.key)<0?(o.next=a,a=a.next):(o.next=s,s=s.next),o=o.next;return null!==a?o.next=a:null!==s&&(o.next=s),i.next}(this.toList(),function(e,n){for(var r=new t(null,null),i=r,o=0;o<e.length;o++)i=i.next=new t(e[o],n[o]);return i.next=null,r.next}(e,n),o);i=this._size+i,this._root=c({head:a},0,i)}return this},s.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(s.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),s.prototype.toString=function(e){void 0===e&&(e=function(e){return String(e.key)});var t=[];return a(this._root,"",!0,(function(e){return t.push(e)}),e),t.join("")},s.prototype.update=function(e,t,n){var a=this._comparator,s=o(e,this._root,a),l=s.left,c=s.right;a(e,t)<0?c=i(t,n,c,a):l=i(t,n,l,a),this._root=function(e,t,n){return null===t?e:(null===e||((t=r(e.key,t,n)).left=e),t)}(l,c,a)},s.prototype.split=function(e){return o(e,this._root,this._comparator)},s.prototype[Symbol.iterator]=function(){var t,n,r;return e(this,(function(e){switch(e.label){case 0:t=this._root,n=[],r=!1,e.label=1;case 1:return r?[3,6]:null===t?[3,2]:(n.push(t),t=t.left,[3,5]);case 2:return 0===n.length?[3,4]:[4,t=n.pop()];case 3:return e.sent(),t=t.right,[3,5];case 4:r=!0,e.label=5;case 5:return[3,1];case 6:return[2]}}))},s}();function l(e,n,r,i){var o=i-r;if(o>0){var a=r+Math.floor(o/2),s=e[a],c=n[a],u=new t(s,c);return u.left=l(e,n,r,a),u.right=l(e,n,a+1,i),u}return null}function c(e,t,n){var r=n-t;if(r>0){var i=t+Math.floor(r/2),o=c(e,t,i),a=e.head;return a.left=o,e.head=e.head.next,a.right=c(e,i+1,n),a}return null}function u(e,t,n,r,i){if(!(n>=r)){for(var o=e[n+r>>1],a=n-1,s=r+1;;){do{a++}while(i(e[a],o)<0);do{s--}while(i(e[s],o)>0);if(a>=s)break;var l=e[a];e[a]=e[s],e[s]=l,l=t[a],t[a]=t[s],t[s]=l}u(e,t,n,s,i),u(e,t,s+1,r,i)}}const h=(e,t)=>e.ll.x<=t.x&&t.x<=e.ur.x&&e.ll.y<=t.y&&t.y<=e.ur.y,d=(e,t)=>{if(t.ur.x<e.ll.x||e.ur.x<t.ll.x||t.ur.y<e.ll.y||e.ur.y<t.ll.y)return null;const n=e.ll.x<t.ll.x?t.ll.x:e.ll.x,r=e.ur.x<t.ur.x?e.ur.x:t.ur.x;return{ll:{x:n,y:e.ll.y<t.ll.y?t.ll.y:e.ll.y},ur:{x:r,y:e.ur.y<t.ur.y?e.ur.y:t.ur.y}}};let f=Number.EPSILON;void 0===f&&(f=Math.pow(2,-52));const p=f*f,g=(e,t)=>{if(-f<e&&e<f&&-f<t&&t<f)return 0;const n=e-t;return n*n<p*e*t?0:e<t?-1:1};class m{constructor(){this.tree=new s,this.round(0)}round(e){const t=this.tree.add(e),n=this.tree.prev(t);if(null!==n&&0===g(t.key,n.key))return this.tree.remove(e),n.key;const r=this.tree.next(t);return null!==r&&0===g(t.key,r.key)?(this.tree.remove(e),r.key):e}}const _=new class{constructor(){this.reset()}reset(){this.xRounder=new m,this.yRounder=new m}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}},v=11102230246251565e-32,y=134217729,E=(3+8*v)*v;function A(e,t,n,r,i){let o,a,s,l,c=t[0],u=r[0],h=0,d=0;u>c==u>-c?(o=c,c=t[++h]):(o=u,u=r[++d]);let f=0;if(h<e&&d<n)for(u>c==u>-c?(a=c+o,s=o-(a-c),c=t[++h]):(a=u+o,s=o-(a-u),u=r[++d]),o=a,0!==s&&(i[f++]=s);h<e&&d<n;)u>c==u>-c?(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=t[++h]):(a=o+u,l=a-o,s=o-(a-l)+(u-l),u=r[++d]),o=a,0!==s&&(i[f++]=s);for(;h<e;)a=o+c,l=a-o,s=o-(a-l)+(c-l),c=t[++h],o=a,0!==s&&(i[f++]=s);for(;d<n;)a=o+u,l=a-o,s=o-(a-l)+(u-l),u=r[++d],o=a,0!==s&&(i[f++]=s);return 0===o&&0!==f||(i[f++]=o),f}function b(e){return new Float64Array(e)}const T=b(4),x=b(8),S=b(12),R=b(16),C=b(4);function L(e,t,n,r,i,o){const a=(t-o)*(n-i),s=(e-i)*(r-o),l=a-s,c=Math.abs(a+s);return Math.abs(l)>=33306690738754716e-32*c?l:-function(e,t,n,r,i,o,a){let s,l,c,u,h,d,f,p,g,m,_,v,b,L,O,M,I,w;const P=e-i,N=n-i,D=t-o,B=r-o;L=P*B,d=y*P,f=d-(d-P),p=P-f,d=y*B,g=d-(d-B),m=B-g,O=p*m-(L-f*g-p*g-f*m),M=D*N,d=y*D,f=d-(d-D),p=D-f,d=y*N,g=d-(d-N),m=N-g,I=p*m-(M-f*g-p*g-f*m),_=O-I,h=O-_,T[0]=O-(_+h)+(h-I),v=L+_,h=v-L,b=L-(v-h)+(_-h),_=b-M,h=b-_,T[1]=b-(_+h)+(h-M),w=v+_,h=w-v,T[2]=v-(w-h)+(_-h),T[3]=w;let F=function(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}(4,T),U=22204460492503146e-32*a;if(F>=U||-F>=U)return F;if(h=e-P,s=e-(P+h)+(h-i),h=n-N,c=n-(N+h)+(h-i),h=t-D,l=t-(D+h)+(h-o),h=r-B,u=r-(B+h)+(h-o),0===s&&0===l&&0===c&&0===u)return F;if(U=11093356479670487e-47*a+E*Math.abs(F),F+=P*u+B*s-(D*c+N*l),F>=U||-F>=U)return F;L=s*B,d=y*s,f=d-(d-s),p=s-f,d=y*B,g=d-(d-B),m=B-g,O=p*m-(L-f*g-p*g-f*m),M=l*N,d=y*l,f=d-(d-l),p=l-f,d=y*N,g=d-(d-N),m=N-g,I=p*m-(M-f*g-p*g-f*m),_=O-I,h=O-_,C[0]=O-(_+h)+(h-I),v=L+_,h=v-L,b=L-(v-h)+(_-h),_=b-M,h=b-_,C[1]=b-(_+h)+(h-M),w=v+_,h=w-v,C[2]=v-(w-h)+(_-h),C[3]=w;const k=A(4,T,4,C,x);L=P*u,d=y*P,f=d-(d-P),p=P-f,d=y*u,g=d-(d-u),m=u-g,O=p*m-(L-f*g-p*g-f*m),M=D*c,d=y*D,f=d-(d-D),p=D-f,d=y*c,g=d-(d-c),m=c-g,I=p*m-(M-f*g-p*g-f*m),_=O-I,h=O-_,C[0]=O-(_+h)+(h-I),v=L+_,h=v-L,b=L-(v-h)+(_-h),_=b-M,h=b-_,C[1]=b-(_+h)+(h-M),w=v+_,h=w-v,C[2]=v-(w-h)+(_-h),C[3]=w;const G=A(k,x,4,C,S);L=s*u,d=y*s,f=d-(d-s),p=s-f,d=y*u,g=d-(d-u),m=u-g,O=p*m-(L-f*g-p*g-f*m),M=l*c,d=y*l,f=d-(d-l),p=l-f,d=y*c,g=d-(d-c),m=c-g,I=p*m-(M-f*g-p*g-f*m),_=O-I,h=O-_,C[0]=O-(_+h)+(h-I),v=L+_,h=v-L,b=L-(v-h)+(_-h),_=b-M,h=b-_,C[1]=b-(_+h)+(h-M),w=v+_,h=w-v,C[2]=v-(w-h)+(_-h),C[3]=w;const z=A(G,S,4,C,R);return R[z-1]}(e,t,n,r,i,o,c)}const O=(e,t)=>e.x*t.y-e.y*t.x,M=(e,t)=>e.x*t.x+e.y*t.y,I=(e,t,n)=>{const r=L(e.x,e.y,t.x,t.y,n.x,n.y);return r>0?-1:r<0?1:0},w=e=>Math.sqrt(M(e,e)),P=(e,t,n)=>{const r={x:t.x-e.x,y:t.y-e.y},i={x:n.x-e.x,y:n.y-e.y};return O(i,r)/w(i)/w(r)},N=(e,t,n)=>{const r={x:t.x-e.x,y:t.y-e.y},i={x:n.x-e.x,y:n.y-e.y};return M(i,r)/w(i)/w(r)},D=(e,t,n)=>0===t.y?null:{x:e.x+t.x/t.y*(n-e.y),y:n},B=(e,t,n)=>0===t.x?null:{x:n,y:e.y+t.y/t.x*(n-e.x)};class F{static compare(e,t){const n=F.comparePoints(e.point,t.point);return 0!==n?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:k.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let e=0,n=t.length;e<n;e++){const n=t[e];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const n=this.point.events[t];if(void 0===n.segment.consumedBy)for(let r=t+1;r<e;r++){const e=this.point.events[r];void 0===e.consumedBy&&n.otherSE.point.events===e.otherSE.point.events&&n.segment.consume(e.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,n=this.point.events.length;t<n;t++){const n=this.point.events[t];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&e.push(n)}return e}getLeftmostComparator(e){const t=new Map,n=n=>{const r=n.otherSE;t.set(n,{sine:P(this.point,e.point,r.point),cosine:N(this.point,e.point,r.point)})};return(e,r)=>{t.has(e)||n(e),t.has(r)||n(r);const{sine:i,cosine:o}=t.get(e),{sine:a,cosine:s}=t.get(r);return i>=0&&a>=0?o<s?1:o>s?-1:0:i<0&&a<0?o<s?-1:o>s?1:0:a<i?-1:a>i?1:0}}}let U=0;class k{static compare(e,t){const n=e.leftSE.point.x,r=t.leftSE.point.x,i=e.rightSE.point.x,o=t.rightSE.point.x;if(o<n)return 1;if(i<r)return-1;const a=e.leftSE.point.y,s=t.leftSE.point.y,l=e.rightSE.point.y,c=t.rightSE.point.y;if(n<r){if(s<a&&s<l)return 1;if(s>a&&s>l)return-1;const n=e.comparePoint(t.leftSE.point);if(n<0)return 1;if(n>0)return-1;const r=t.comparePoint(e.rightSE.point);return 0!==r?r:-1}if(n>r){if(a<s&&a<c)return-1;if(a>s&&a>c)return 1;const n=t.comparePoint(e.leftSE.point);if(0!==n)return n;const r=e.comparePoint(t.rightSE.point);return r<0?1:r>0?-1:1}if(a<s)return-1;if(a>s)return 1;if(i<o){const n=t.comparePoint(e.rightSE.point);if(0!==n)return n}if(i>o){const n=e.comparePoint(t.rightSE.point);if(n<0)return 1;if(n>0)return-1}if(i!==o){const e=l-a,t=i-n,u=c-s,h=o-r;if(e>t&&u<h)return 1;if(e<t&&u>h)return-1}return i>o?1:i<o||l<c?-1:l>c?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,n,r){this.id=++U,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=r}static fromRing(e,t,n){let r,i,o;const a=F.comparePoints(e,t);if(a<0)r=e,i=t,o=1;else{if(!(a>0))throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);r=t,i=e,o=-1}const s=new F(r,!0),l=new F(i,!1);return new k(s,l,[n],[o])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(t.x===n.x)return e.x===t.x?0:e.x<t.x?1:-1;const i=(e.y-t.y)/r.y,o=t.x+i*r.x;if(e.x===o)return 0;const a=(e.x-t.x)/r.x,s=t.y+a*r.y;return e.y===s?0:e.y<s?-1:1}getIntersection(e){const t=this.bbox(),n=e.bbox(),r=d(t,n);if(null===r)return null;const i=this.leftSE.point,o=this.rightSE.point,a=e.leftSE.point,s=e.rightSE.point,l=h(t,a)&&0===this.comparePoint(a),c=h(n,i)&&0===e.comparePoint(i),u=h(t,s)&&0===this.comparePoint(s),f=h(n,o)&&0===e.comparePoint(o);if(c&&l)return f&&!u?o:!f&&u?s:null;if(c)return u&&i.x===s.x&&i.y===s.y?null:i;if(l)return f&&o.x===a.x&&o.y===a.y?null:a;if(f&&u)return null;if(f)return o;if(u)return s;const p=((e,t,n,r)=>{if(0===t.x)return B(n,r,e.x);if(0===r.x)return B(e,t,n.x);if(0===t.y)return D(n,r,e.y);if(0===r.y)return D(e,t,n.y);const i=O(t,r);if(0==i)return null;const o={x:n.x-e.x,y:n.y-e.y},a=O(o,t)/i,s=O(o,r)/i;return{x:(e.x+s*t.x+(n.x+a*r.x))/2,y:(e.y+s*t.y+(n.y+a*r.y))/2}})(i,this.vector(),a,e.vector());return null===p?null:h(r,p)?_.round(p.x,p.y):null}split(e){const t=[],n=void 0!==e.events,r=new F(e,!0),i=new F(e,!1),o=this.rightSE;this.replaceRightSE(i),t.push(i),t.push(r);const a=new k(r,o,this.rings.slice(),this.windings.slice());return F.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),F.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),i.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,t=this.windings.length;e<t;e++)this.windings[e]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=k.compare(t,n);if(0!==r){if(r>0){const e=t;t=n,n=e}if(t.prev===n){const e=t;t=n,n=e}for(let e=0,r=n.rings.length;e<r;e++){const r=n.rings[e],i=n.windings[e],o=t.rings.indexOf(r);-1===o?(t.rings.push(r),t.windings.push(i)):t.windings[o]+=i}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.rightSE.consumedBy=t.rightSE}}prevInResult(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}beforeState(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}afterState(){if(void 0!==this._afterState)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let e=0,r=this.rings.length;e<r;e++){const r=this.rings[e],i=this.windings[e],o=t.indexOf(r);-1===o?(t.push(r),n.push(i)):n[o]+=i}const i=[],o=[];for(let e=0,r=t.length;e<r;e++){if(0===n[e])continue;const r=t[e],a=r.poly;if(-1===o.indexOf(a))if(r.isExterior)i.push(a);else{-1===o.indexOf(a)&&o.push(a);const e=i.indexOf(r.poly);-1!==e&&i.splice(e,1)}}for(let e=0,t=i.length;e<t;e++){const t=i[e].multiPoly;-1===r.indexOf(t)&&r.push(t)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(q.type){case"union":{const n=0===e.length,r=0===t.length;this._isInResult=n!==r;break}case"intersection":{let n,r;e.length<t.length?(n=e.length,r=t.length):(n=t.length,r=e.length),this._isInResult=r===q.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(e.length-t.length);this._isInResult=n%2==1;break}case"difference":{const n=e=>1===e.length&&e[0].isSubject;this._isInResult=n(e)!==n(t);break}default:throw new Error(`Unrecognized operation type found ${q.type}`)}return this._isInResult}}class G{constructor(e,t,n){if(!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=n,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=_.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let i=r;for(let t=1,n=e.length;t<n;t++){if("number"!=typeof e[t][0]||"number"!=typeof e[t][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let n=_.round(e[t][0],e[t][1]);n.x===i.x&&n.y===i.y||(this.segments.push(k.fromRing(i,n,this)),n.x<this.bbox.ll.x&&(this.bbox.ll.x=n.x),n.y<this.bbox.ll.y&&(this.bbox.ll.y=n.y),n.x>this.bbox.ur.x&&(this.bbox.ur.x=n.x),n.y>this.bbox.ur.y&&(this.bbox.ur.y=n.y),i=n)}r.x===i.x&&r.y===i.y||this.segments.push(k.fromRing(i,r,this))}getSweepEvents(){const e=[];for(let t=0,n=this.segments.length;t<n;t++){const n=this.segments[t];e.push(n.leftSE),e.push(n.rightSE)}return e}}class z{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new G(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let t=1,n=e.length;t<n;t++){const n=new G(e[t],this,!1);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.interiorRings.push(n)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,n=this.interiorRings.length;t<n;t++){const n=this.interiorRings[t].getSweepEvents();for(let t=0,r=n.length;t<r;t++)e.push(n[t])}return e}}class j{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(e){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let t=0,n=e.length;t<n;t++){const n=new z(e[t],this);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.polys.push(n)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const n=this.polys[t].getSweepEvents();for(let t=0,r=n.length;t<r;t++)e.push(n[t])}return e}}class V{static factory(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];if(!r.isInResult()||r.ringOut)continue;let i=null,o=r.leftSE,a=r.rightSE;const s=[o],l=o.point,c=[];for(;i=o,o=a,s.push(o),o.point!==l;)for(;;){const e=o.getAvailableLinkedEvents();if(0===e.length){const e=s[0].point,t=s[s.length-1].point;throw new Error(`Unable to complete output ring starting at [${e.x}, ${e.y}]. Last matching segment found ends at [${t.x}, ${t.y}].`)}if(1===e.length){a=e[0].otherSE;break}let n=null;for(let e=0,t=c.length;e<t;e++)if(c[e].point===o.point){n=e;break}if(null!==n){const e=c.splice(n)[0],r=s.splice(e.index);r.unshift(r[0].otherSE),t.push(new V(r.reverse()));continue}c.push({index:s.length,point:o.point});const r=o.getLeftmostComparator(i);a=e.sort(r)[0].otherSE;break}t.push(new V(s))}return t}constructor(e){this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let n=1,r=this.events.length-1;n<r;n++){const r=this.events[n].point,i=this.events[n+1].point;0!==I(r,e,i)&&(t.push(r),e=r)}if(1===t.length)return null;const n=t[0],r=t[1];0===I(n,e,r)&&t.shift(),t.push(t[0]);const i=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:t.length-1,a=this.isExteriorRing()?t.length:-1,s=[];for(let e=o;e!=a;e+=i)s.push([t[e].x,t[e].y]);return s}isExteriorRing(){if(void 0===this._isExteriorRing){const e=this.enclosingRing();this._isExteriorRing=!e||!e.isExteriorRing()}return this._isExteriorRing}enclosingRing(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let t=1,n=this.events.length;t<n;t++){const n=this.events[t];F.compare(e,n)>0&&(e=n)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return n.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}}class H{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(null===e[0])return null;for(let t=0,n=this.interiorRings.length;t<n;t++){const n=this.interiorRings[t].getGeom();null!==n&&e.push(n)}return e}}class W{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const n=this.polys[t].getGeom();null!==n&&e.push(n)}return e}_composePolys(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];if(!r.poly)if(r.isExteriorRing())t.push(new H(r));else{const e=r.enclosingRing();e.poly||t.push(new H(e)),e.poly.addInterior(r)}}return t}}class X{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.compare;this.queue=e,this.tree=new s(t),this.segments=[]}process(e){const t=e.segment,n=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),n;const r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let i,o,a=r,s=r;for(;void 0===i;)a=this.tree.prev(a),null===a?i=null:void 0===a.key.consumedBy&&(i=a.key);for(;void 0===o;)s=this.tree.next(s),null===s?o=null:void 0===s.key.consumedBy&&(o=s.key);if(e.isLeft){let r=null;if(i){const e=i.getIntersection(t);if(null!==e&&(t.isAnEndpoint(e)||(r=e),!i.isAnEndpoint(e))){const t=this._splitSafely(i,e);for(let e=0,r=t.length;e<r;e++)n.push(t[e])}}let a=null;if(o){const e=o.getIntersection(t);if(null!==e&&(t.isAnEndpoint(e)||(a=e),!o.isAnEndpoint(e))){const t=this._splitSafely(o,e);for(let e=0,r=t.length;e<r;e++)n.push(t[e])}}if(null!==r||null!==a){let e=null;e=null===r?a:null===a||F.comparePoints(r,a)<=0?r:a,this.queue.remove(t.rightSE),n.push(t.rightSE);const i=t.split(e);for(let e=0,t=i.length;e<t;e++)n.push(i[e])}n.length>0?(this.tree.remove(t),n.push(e)):(this.segments.push(t),t.prev=i)}else{if(i&&o){const e=i.getIntersection(o);if(null!==e){if(!i.isAnEndpoint(e)){const t=this._splitSafely(i,e);for(let e=0,r=t.length;e<r;e++)n.push(t[e])}if(!o.isAnEndpoint(e)){const t=this._splitSafely(o,e);for(let e=0,r=t.length;e<r;e++)n.push(t[e])}}}this.tree.remove(t)}return n}_splitSafely(e,t){this.tree.remove(e);const n=e.rightSE;this.queue.remove(n);const r=e.split(t);return r.push(n),void 0===e.consumedBy&&this.tree.add(e),r}}const Z="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Y="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;const q=new class{run(e,t,n){q.type=e,_.reset();const r=[new j(t,!0)];for(let e=0,t=n.length;e<t;e++)r.push(new j(n[e],!1));if(q.numMultiPolys=r.length,"difference"===q.type){const e=r[0];let t=1;for(;t<r.length;)null!==d(r[t].bbox,e.bbox)?t++:r.splice(t,1)}if("intersection"===q.type)for(let e=0,t=r.length;e<t;e++){const t=r[e];for(let n=e+1,i=r.length;n<i;n++)if(null===d(t.bbox,r[n].bbox))return[]}const i=new s(F.compare);for(let e=0,t=r.length;e<t;e++){const t=r[e].getSweepEvents();for(let e=0,n=t.length;e<n;e++)if(i.insert(t[e]),i.size>Z)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const o=new X(i);let a=i.size,l=i.pop();for(;l;){const e=l.key;if(i.size===a){const t=e.segment;throw new Error(`Unable to pop() ${e.isLeft?"left":"right"} SweepEvent [${e.point.x}, ${e.point.y}] from segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] from queue.`)}if(i.size>Z)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(o.segments.length>Y)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const t=o.process(e);for(let e=0,n=t.length;e<n;e++){const n=t[e];void 0===n.consumedBy&&i.insert(n)}a=i.size,l=i.pop()}_.reset();const c=V.factory(o.segments);return new W(c).getGeom()}};return{union:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return q.run("union",e,n)},intersection:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return q.run("intersection",e,n)},xor:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return q.run("xor",e,n)},difference:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return q.run("difference",e,n)}}}()},2306:(e,t,n)=>{e=n.nmd(e);var r=n(74967),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},2474:(e,t,n)=>{"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{A:()=>r})},2478:(e,t,n)=>{var r=n(37250),i=n(69454),o=n(97706);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},3283:(e,t,n)=>{var r=n(56027),i=n(80547),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},3316:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},3422:(e,t,n)=>{var r=n(57073),i=n(46285),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},3668:e=>{e.exports=function(e){return null==e}},3766:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},4326:(e,t,n)=>{var r=n(28931),i=n(83417),o=n(82237),a=n(95243);e.exports=function(e){return function(t){t=a(t);var n=i(t)?o(t):void 0,s=n?n[0]:t.charAt(0),l=n?r(n,1).join(""):t.slice(1);return s[e]()+l}}},5405:(e,t,n)=>{"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,{A:()=>r})},5485:(e,t,n)=>{var r=n(4326)("toUpperCase");e.exports=r},5536:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(12559);function i(e,t,n){return n((0,r.A)(e,t))}},5681:(e,t,n)=>{var r=n(44700);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6131:(e,t,n)=>{var r=n(86403),i=n(41580),o=n(51187),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):a.test(e)?NaN:+e}},7144:(e,t,n)=>{var r=n(97034);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},7292:(e,t,n)=>{var r=n(23945)(n(70581));e.exports=r},7452:(e,t,n)=>{var r=n(97034);e.exports=function(e){return r(this.__data__,e)>-1}},7462:e=>{e.exports=function(e){return this.__data__.has(e)}},8006:e=>{e.exports=function(e){return this.__data__.has(e)}},8138:(e,t,n)=>{var r=n(87379),i=n(53142),o=n(80547);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},8666:(e,t,n)=>{var r=n(70674),i=n(49460),o=n(2306),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},8870:(e,t,n)=>{var r=n(65650),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},9158:e=>{"use strict";e.exports=function(){var e=1;return{generate:function(){return e++}}}},10358:(e,t,n)=>{var r=n(26137),i=n(3283),o=n(53142),a=n(75853),s=n(69632),l=n(8666),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),u=!n&&i(e),h=!n&&!u&&a(e),d=!n&&!u&&!h&&l(e),f=n||u||h||d,p=f?r(e.length,String):[],g=p.length;for(var m in e)!t&&!c.call(e,m)||f&&("length"==m||h&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,g))||p.push(m);return p}},10482:e=>{var t="\\ud800-\\udfff",n="\\u2700-\\u27bf",r="a-z\\xdf-\\xf6\\xf8-\\xff",i="A-Z\\xc0-\\xd6\\xd8-\\xde",o="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",a="["+o+"]",s="\\d+",l="["+n+"]",c="["+r+"]",u="[^"+t+o+s+n+r+i+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",d="[\\ud800-\\udbff][\\udc00-\\udfff]",f="["+i+"]",p="(?:"+c+"|"+u+")",g="(?:"+f+"|"+u+")",m="(?:['’](?:d|ll|m|re|s|t|ve))?",_="(?:['’](?:D|LL|M|RE|S|T|VE))?",v="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",y="[\\ufe0e\\ufe0f]?",E=y+v+"(?:\\u200d(?:"+["[^"+t+"]",h,d].join("|")+")"+y+v+")*",A="(?:"+[l,h,d].join("|")+")"+E,b=RegExp([f+"?"+c+"+"+m+"(?="+[a,f,"$"].join("|")+")",g+"+"+_+"(?="+[a,f+p,"$"].join("|")+")",f+"?"+p+"+"+m,f+"+"+_,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",s,A].join("|"),"g");e.exports=function(e){return e.match(b)||[]}},11112:(e,t,n)=>{var r=n(94497),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},11129:e=>{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},12393:e=>{e.exports=function(){this.__data__=[],this.size=0}},12593:()=>{},12784:(e,t,n)=>{var r=n(41580),i=n(94495),o=n(6131),a=Math.max,s=Math.min;e.exports=function(e,t,n){var l,c,u,h,d,f,p=0,g=!1,m=!1,_=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=l,r=c;return l=c=void 0,p=t,h=e.apply(r,n)}function y(e){var n=e-f;return void 0===f||n>=t||n<0||m&&e-p>=u}function E(){var e=i();if(y(e))return A(e);d=setTimeout(E,function(e){var n=t-(e-f);return m?s(n,u-(e-p)):n}(e))}function A(e){return d=void 0,_&&l?v(e):(l=c=void 0,h)}function b(){var e=i(),n=y(e);if(l=arguments,c=this,f=e,n){if(void 0===d)return function(e){return p=e,d=setTimeout(E,t),g?v(e):h}(f);if(m)return clearTimeout(d),d=setTimeout(E,t),v(f)}return void 0===d&&(d=setTimeout(E,t)),h}return t=o(t)||0,r(n)&&(g=!!n.leading,u=(m="maxWait"in n)?a(o(n.maxWait)||0,t):u,_="trailing"in n?!!n.trailing:_),b.cancel=function(){void 0!==d&&clearTimeout(d),p=0,l=f=c=d=void 0},b.flush=function(){return void 0===d?h:A(i())},b}},13964:(e,t,n)=>{var r=n(97034);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},14223:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,{A:()=>r})},15630:(e,t,n)=>{var r=n(23212),i=n(59756),o=n(43316),a=n(65568),s=n(36208),l=n(49828);e.exports=function(e,t,n){var c=-1,u=i,h=e.length,d=!0,f=[],p=f;if(n)d=!1,u=o;else if(h>=200){var g=t?null:s(e);if(g)return l(g);d=!1,u=a,p=new r}else p=t?[]:f;e:for(;++c<h;){var m=e[c],_=t?t(m):m;if(m=n||0!==m?m:0,d&&_==_){for(var v=p.length;v--;)if(p[v]===_)continue e;t&&p.push(_),f.push(m)}else u(p,_,n)||(p!==f&&p.push(_),f.push(m))}return f}},15813:e=>{var t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return t.test(e)}},17099:(e,t,n)=>{e=n.nmd(e);var r=n(78942),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},17228:(e,t,n)=>{var r=n(94436),i=n(6131);e.exports=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=i(n))==n?n:0),void 0!==t&&(t=(t=i(t))==t?t:0),r(i(e),t,n)}},18069:(e,t,n)=>{var r=n(65650),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},19004:(e,t,n)=>{"use strict";n.d(t,{Fh:()=>i,iw:()=>o});var r=n(33270);function i(e,t,n){if(null!==e)for(var r,o,a,s,l,c,u,h,d=0,f=0,p=e.type,g="FeatureCollection"===p,m="Feature"===p,_=g?e.features.length:1,v=0;v<_;v++){l=(h=!!(u=g?e.features[v].geometry:m?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var y=0;y<l;y++){var E=0,A=0;if(null!==(s=h?u.geometries[y]:u)){c=s.coordinates;var b=s.type;switch(d=!n||"Polygon"!==b&&"MultiPolygon"!==b?0:1,b){case null:break;case"Point":if(!1===t(c,f,v,E,A))return!1;f++,E++;break;case"LineString":case"MultiPoint":for(r=0;r<c.length;r++){if(!1===t(c[r],f,v,E,A))return!1;f++,"MultiPoint"===b&&E++}"LineString"===b&&E++;break;case"Polygon":case"MultiLineString":for(r=0;r<c.length;r++){for(o=0;o<c[r].length-d;o++){if(!1===t(c[r][o],f,v,E,A))return!1;f++}"MultiLineString"===b&&E++,"Polygon"===b&&A++}"Polygon"===b&&E++;break;case"MultiPolygon":for(r=0;r<c.length;r++){for(A=0,o=0;o<c[r].length;o++){for(a=0;a<c[r][o].length-d;a++){if(!1===t(c[r][o][a],f,v,E,A))return!1;f++}A++}E++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===i(s.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function o(e,t){!function(e,t){var n,r,i,o,a,s,l,c,u,h,d=0,f="FeatureCollection"===e.type,p="Feature"===e.type,g=f?e.features.length:1;for(n=0;n<g;n++){for(s=f?e.features[n].geometry:p?e.geometry:e,c=f?e.features[n].properties:p?e.properties:{},u=f?e.features[n].bbox:p?e.bbox:void 0,h=f?e.features[n].id:p?e.id:void 0,a=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=l?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(o,d,c,u,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===t(o.geometries[r],d,c,u,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,d,c,u,h))return!1;d++}}(e,(function(e,n,i,o,a){var s,l=null===e?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==t((0,r.N4)(e,i,{bbox:o,id:a}),n,0)&&void 0}switch(l){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var c=0;c<e.coordinates.length;c++){var u={type:s,coordinates:e.coordinates[c]};if(!1===t((0,r.N4)(u,i),n,c))return!1}}))}},19270:(e,t,n)=>{var r=n(94715)(n(78942),"WeakMap");e.exports=r},19770:(e,t,n)=>{var r=n(94715)(n(78942),"Map");e.exports=r},20062:e=>{"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},20155:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},21779:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},22053:e=>{e.exports=function(e){return e}},22563:(e,t,n)=>{var r=n(87379),i=n(80547);e.exports=function(e){return!0===e||!1===e||i(e)&&"[object Boolean]"==r(e)}},23057:(e,t,n)=>{"use strict";var r=n(38008);function i(e,t,n){if(3===e){var i=new r(n,n.readVarint()+n.pos);i.length&&(t[i.name]=i)}}e.exports=function(e,t){this.layers=e.readFields(i,{},t)}},23172:(e,t,n)=>{"use strict";n.d(t,{p8:()=>r,tb:()=>i});var r=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array;Math.random,Math.PI,Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)})},23212:(e,t,n)=>{var r=n(68250),i=n(1877),o=n(8006);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},23305:(e,t,n)=>{var r=n(94497);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},23766:e=>{"use strict";e.exports=function(e){function t(){}var n={log:t,warn:t,error:t};if(!e&&window.console){var r=function(e,t){e[t]=function(){var e=console[t];if(e.apply)e.apply(console,arguments);else for(var n=0;n<arguments.length;n++)e(arguments[n])}};r(n,"log"),r(n,"warn"),r(n,"error")}return n}},23945:(e,t,n)=>{var r=n(22053),i=n(75234),o=n(80796);e.exports=function(e,t){return o(i(e,t,r),e+"")}},24586:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(11369);function i(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},24733:(e,t,n)=>{var r=n(39032),i=n(85832);e.exports=function(e,t){return r(e,i(e),t)}},24810:(e,t,n)=>{var r=n(57073),i=n(46285);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},25098:(e,t,n)=>{var r=n(23305),i=n(39361),o=n(11112),a=n(25276),s=n(57452);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},25276:(e,t,n)=>{var r=n(94497),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},25288:(e,t,n)=>{var r=n(10358),i=n(57200),o=n(36529);e.exports=function(e){return o(e)?r(e,!0):i(e)}},25337:(e,t,n)=>{"use strict";n.d(t,{A:()=>Ct});var r=n(69740),i=n(24586);class o{constructor(e){(0,i.A)(this,"configService",void 0),(0,i.A)(this,"config",void 0),this.config=e}setContainer(e,t){this.configService=e.globalConfigService,e.mapConfig=(0,r.A)((0,r.A)({},this.config),{},{id:t}),e.mapService=new(this.getServiceConstructor())(e)}getServiceConstructor(){throw new Error("Method not implemented.")}}var a=n(14223),s=n(86330),l=n(88435),c=n.n(l);const u=function(e,t,n){return e+n*(t-e)};function h(e,t,n){return Math.min(n,Math.max(t,e))}function d(e,t,n){const r=n-t,i=((e-t)%r+r)%r+t;return i===t?n:i}let f=1;function p(e,...t){for(const n of t)for(const t in n)e[t]=n[t];return e}function g(e,t,n,r){const i=new(c())(e,t,n,r);return e=>i.solve(e)}const m=g(.25,.1,.25,1),_={};function v(e){return e*Math.PI/180}const y=6371008.8;class E{constructor(e,t){if((0,i.A)(this,"lng",void 0),(0,i.A)(this,"lat",void 0),isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new E(d(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,n=this.lat*t,r=e.lat*t,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((e.lng-this.lng)*t);return y*Math.acos(Math.min(i,1))}static convert(e){if(e instanceof E)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new E(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new E(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const A=2*Math.PI*y;function b(e){return A*Math.cos(e*Math.PI/180)}function T(e){return(180+e)/360}function x(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function S(e,t){return e/b(t)}function R(e){const t=180-360*e;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}class C{constructor(e,t,n=0){(0,i.A)(this,"x",void 0),(0,i.A)(this,"y",void 0),(0,i.A)(this,"z",void 0),this.x=+e,this.y=+t,this.z=+n}static fromLngLat(e,t=0){const n=E.convert(e);return new C(T(n.lng),x(n.lat),S(t,n.lat))}toLngLat(){return new E(360*this.x-180,R(this.y))}toAltitude(){return this.z*b(R(this.y))}meterInMercatorCoordinateUnits(){return 1/A*(e=R(this.y),1/Math.cos(e*Math.PI/180));var e}}var L=n(27835),O=n.n(L);class M{constructor(e,t){(0,i.A)(this,"_ne",void 0),(0,i.A)(this,"_sw",void 0),e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&(4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof E?new E(e.lng,e.lat):E.convert(e),this}setSouthWest(e){return this._sw=e instanceof E?new E(e.lng,e.lat):E.convert(e),this}extend(e){const t=this._sw,n=this._ne;let r,i;if(e instanceof E)r=e,i=e;else{if(!(e instanceof M)){if(Array.isArray(e)){if(4===e.length||e.every(Array.isArray)){const t=e;return this.extend(M.convert(t))}{const t=e;return this.extend(E.convert(t))}}return e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(E.convert(e)):this}if(r=e._sw,i=e._ne,!r||!i)return this}return t||n?(t.lng=Math.min(r.lng,t.lng),t.lat=Math.min(r.lat,t.lat),n.lng=Math.max(i.lng,n.lng),n.lat=Math.max(i.lat,n.lat)):(this._sw=new E(r.lng,r.lat),this._ne=new E(i.lng,i.lat)),this}getCenter(){return new E((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new E(this.getWest(),this.getNorth())}getSouthEast(){return new E(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:t,lat:n}=E.convert(e),r=this._sw.lat<=n&&n<=this._ne.lat;let i=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=t&&t>=this._ne.lng),r&&i}static convert(e){return e instanceof M?e:new M(e)}static fromLngLat(e,t=0){const n=360*t/40075017,r=n/Math.cos(Math.PI/180*e.lat);return new M(new E(e.lng-r,e.lat-n),new E(e.lng+r,e.lat+n))}}let I;const w={now:"undefined"!=typeof performance&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:e=>new Promise(((t,n)=>{const r=requestAnimationFrame(t);e.signal.addEventListener("abort",(()=>{cancelAnimationFrame(r),n(new Error("AbortError"))}))})),get prefersReducedMotion(){return!!window.matchMedia&&(null==I&&(I=window.matchMedia("(prefers-reduced-motion: reduce)")),I.matches)}};function P(e,t,n){n[e]&&-1!==n[e].indexOf(t)||(n[e]=n[e]||[],n[e].push(t))}function N(e,t,n){if(n&&n[e]){const r=n[e].indexOf(t);-1!==r&&n[e].splice(r,1)}}class D{constructor(e,t={}){(0,i.A)(this,"type",void 0),p(this,t),this.type=e}}class B extends D{constructor(e,t={}){super("error",t),(0,i.A)(this,"error",void 0),this.error=e}}class F{constructor(){(0,i.A)(this,"_listeners",void 0),(0,i.A)(this,"_oneTimeListeners",void 0),(0,i.A)(this,"_eventedParent",void 0),(0,i.A)(this,"_eventedParentData",void 0)}on(e,t){return this._listeners=this._listeners||{},P(e,t,this._listeners),this}off(e,t){return N(e,t,this._listeners),N(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},P(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new D(e,t||{}));const n=e.type;if(this.listens(n)){e.target=this;const t=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(const n of t)n.call(this,e);const r=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const t of r)N(n,t,this._oneTimeListeners),t.call(this,e);const i=this._eventedParent;i&&(p(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(e))}else e instanceof B&&console.error(e.error);return this}emit(e,t){return this.fire(e,t)}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,t){return e&&(this._eventedParent=e),this._eventedParentData=t,this}}class U extends F{constructor(e,t){super(),(0,i.A)(this,"transform",void 0),(0,i.A)(this,"handlers",void 0),(0,i.A)(this,"_moving",void 0),(0,i.A)(this,"_zooming",void 0),(0,i.A)(this,"_rotating",void 0),(0,i.A)(this,"_pitching",void 0),(0,i.A)(this,"_padding",void 0),(0,i.A)(this,"_bearingSnap",void 0),(0,i.A)(this,"_easeStart",void 0),(0,i.A)(this,"_easeOptions",void 0),(0,i.A)(this,"_easeId",void 0),(0,i.A)(this,"_onEaseFrame",void 0),(0,i.A)(this,"_onEaseEnd",void 0),(0,i.A)(this,"_easeFrameId",void 0),(0,i.A)(this,"_requestedCameraState",void 0),(0,i.A)(this,"transformCameraUpdate",void 0),(0,i.A)(this,"_renderFrameCallback",(()=>{const e=Math.min((w.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()})),this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=t.bearingSnap,this.on("moveend",(()=>{delete this._requestedCameraState}))}getCenter(){return new E(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(e,t,n){return e=O().convert(e).mult(-1),this.panTo(this.transform.center,p({offset:e},t),n)}panTo(e,t,n){return this.easeTo(p({center:e},t),n)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,t,n){return this.easeTo(p({zoom:e},t),n)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,t,n){return this.easeTo(p({bearing:e},t),n)}resetNorth(e,t){return this.rotateTo(0,p({duration:1e3},e),t),this}resetNorthPitch(e,t){return this.easeTo(p({bearing:0,pitch:0,duration:1e3},e),t),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}cameraForBounds(e,t){e=M.convert(e);const n=t&&t.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),n,t)}_cameraForBoxAndBearing(e,t,n,r){const i={top:0,bottom:0,right:0,left:0};if("number"==typeof(r=p({padding:i,offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding){const e=r.padding;r.padding={top:e,bottom:e,right:e,left:e}}r.padding=p(i,r.padding);const o=this.transform,a=o.padding,s=new M(e,t),l=o.project(s.getNorthWest()),c=o.project(s.getNorthEast()),u=o.project(s.getSouthEast()),h=o.project(s.getSouthWest()),d=v(-n),f=l.rotate(d),g=c.rotate(d),m=u.rotate(d),y=h.rotate(d),E=new(O())(Math.max(f.x,g.x,y.x,m.x),Math.max(f.y,g.y,y.y,m.y)),A=new(O())(Math.min(f.x,g.x,y.x,m.x),Math.min(f.y,g.y,y.y,m.y)),b=E.sub(A),T=(o.width-(a.left+a.right+r.padding.left+r.padding.right))/b.x,x=(o.height-(a.top+a.bottom+r.padding.top+r.padding.bottom))/b.y;if(x<0||T<0)return void(_[S="Map cannot fit within canvas with the given bounds, padding, and/or offset."]||("undefined"!=typeof console&&console.warn(S),_[S]=!0));var S;const R=Math.min(o.scaleZoom(o.scale*Math.min(T,x)),r.maxZoom),C=O().convert(r.offset),L=(r.padding.left-r.padding.right)/2,I=(r.padding.top-r.padding.bottom)/2,w=new(O())(L,I).rotate(v(n)),P=C.add(w).mult(o.scale/o.zoomScale(R));return{center:o.unproject(l.add(u).div(2).sub(P)),zoom:R,bearing:n}}fitBounds(e,t,n){return this._fitInternal(this.cameraForBounds(e,t),t,n)}fitScreenCoordinates(e,t,n,r,i){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(O().convert(e)),this.transform.pointLocation(O().convert(t)),n,r),r,i)}_fitInternal(e,t,n){return e?(delete(t=p(e,t)).padding,t.linear?this.easeTo(t,n):this.flyTo(t,n)):this}jumpTo(e,t){this.stop();const n=this._getTransformForUpdate();let r=!1,i=!1,o=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(r=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=E.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(i=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(o=!0,n.pitch=+e.pitch),null==e.padding||n.isPaddingEqual(e.padding)||(n.padding=e.padding),this._applyUpdatedTransform(n),this.fire(new D("movestart",t)).fire(new D("move",t)),r&&this.fire(new D("zoomstart",t)).fire(new D("zoom",t)).fire(new D("zoomend",t)),i&&this.fire(new D("rotatestart",t)).fire(new D("rotate",t)).fire(new D("rotateend",t)),o&&this.fire(new D("pitchstart",t)).fire(new D("pitch",t)).fire(new D("pitchend",t)),this.fire(new D("moveend",t))}calculateCameraOptionsFromTo(e,t,n,r=0){const i=C.fromLngLat(e,t),o=C.fromLngLat(n,r),a=o.x-i.x,s=o.y-i.y,l=o.z-i.z,c=Math.hypot(a,s,l);if(0===c)throw new Error("Can't calculate camera options with same From and To");const u=Math.hypot(a,s),h=this.transform.scaleZoom(this.transform.cameraToCenterDistance/c/this.transform.tileSize),d=180*Math.atan2(a,-s)/Math.PI;let f=180*Math.acos(u/c)/Math.PI;return f=l<0?90-f:90+f,{center:o.toLngLat(),zoom:h,pitch:f,bearing:d}}easeTo(e,t){var n;this._stop(!1,e.easeId),(!1===(e=p({offset:[0,0],duration:500,easing:m},e)).animate||!e.essential&&w.prefersReducedMotion)&&(e.duration=0);const r=this._getTransformForUpdate(),i=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="bearing"in e?this._normalizeBearing(e.bearing,o):o,c="pitch"in e?+e.pitch:a,h="padding"in e?e.padding:r.padding,d=O().convert(e.offset);let f=r.centerPoint.add(d);const g=r.pointLocation(f),{center:_,zoom:v}=r.getConstrained(E.convert(e.center||g),null!==(n=e.zoom)&&void 0!==n?n:i);this._normalizeCenter(_);const y=r.project(g),A=r.project(_).sub(y),b=r.zoomScale(v-i);let T,x;e.around&&(T=E.convert(e.around),x=r.locationPoint(T));const S={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||v!==i,this._rotating=this._rotating||o!==l,this._pitching=this._pitching||c!==a,this._padding=!r.isPaddingEqual(h),this._easeId=e.easeId,this._prepareEase(t,e.noMoveStart,S),this._ease((e=>{if(this._zooming&&(r.zoom=u(i,v,e)),this._rotating&&(r.bearing=u(o,l,e)),this._pitching&&(r.pitch=u(a,c,e)),this._padding&&(r.interpolatePadding(s,h,e),f=r.centerPoint.add(d)),T)r.setLocationAtPoint(T,x);else{const t=r.zoomScale(r.zoom-i),n=v>i?Math.min(2,b):Math.max(.5,b),o=Math.pow(n,1-e),a=r.unproject(y.add(A.mult(e*o)).mult(t));r.setLocationAtPoint(r.renderWorldCopies?a.wrap():a,f)}this._applyUpdatedTransform(r),this._fireMoveEvents(t)}),(e=>{this._afterEase(t,e)}),e),this}_prepareEase(e,t,n={}){this._moving=!0,t||n.moving||this.fire(new D("movestart",e)),this._zooming&&!n.zooming&&this.fire(new D("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new D("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new D("pitchstart",e))}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(e){if(!this.transformCameraUpdate)return;const t=e.clone(),{center:n,zoom:r,pitch:i,bearing:o,elevation:a}=this.transformCameraUpdate(t);n&&(t.center=n),void 0!==r&&(t.zoom=r),void 0!==i&&(t.pitch=i),void 0!==o&&(t.bearing=o),void 0!==a&&(t.elevation=a),this.transform.apply(t)}_fireMoveEvents(e){this.fire(new D("move",e)),this._zooming&&this.fire(new D("zoom",e)),this._rotating&&this.fire(new D("rotate",e)),this._pitching&&this.fire(new D("pitch",e))}_afterEase(e,t){if(this._easeId&&t&&this._easeId===t)return;delete this._easeId;const n=this._zooming,r=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new D("zoomend",e)),r&&this.fire(new D("rotateend",e)),i&&this.fire(new D("pitchend",e)),this.fire(new D("moveend",e))}flyTo(e,t){var n;if(!e.essential&&w.prefersReducedMotion){const n=function(e,t){const n={};for(let r=0;r<t.length;r++){const i=t[r];i in e&&(n[i]=e[i])}return n}(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,t)}this.stop(),e=p({offset:[0,0],speed:1.2,curve:1.42,easing:m},e);const r=this._getTransformForUpdate(),i=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="bearing"in e?this._normalizeBearing(e.bearing,o):o,c="pitch"in e?+e.pitch:a,d="padding"in e?e.padding:r.padding,f=O().convert(e.offset);let g=r.centerPoint.add(f);const _=r.pointLocation(g),{center:v,zoom:y}=r.getConstrained(E.convert(e.center||_),null!==(n=e.zoom)&&void 0!==n?n:i);this._normalizeCenter(v);const A=r.zoomScale(y-i),b=r.project(_),T=r.project(v).sub(b);let x=e.curve;const S=Math.max(r.width,r.height),R=S/A,C=T.mag();if("minZoom"in e){const t=h(Math.min(e.minZoom,i,y),r.minZoom,r.maxZoom),n=S/r.zoomScale(t-i);x=Math.sqrt(n/C*2)}const L=x*x;function M(e){const t=(R*R-S*S+(e?-1:1)*L*L*C*C)/(2*(e?R:S)*L*C);return Math.log(Math.sqrt(t*t+1)-t)}function I(e){return(Math.exp(e)-Math.exp(-e))/2}function P(e){return(Math.exp(e)+Math.exp(-e))/2}const N=M(!1);let D=function(e){return P(N)/P(N+x*e)},B=function(e){return S*((P(N)*(I(t=N+x*e)/P(t))-I(N))/L)/C;var t},F=(M(!0)-N)/x;if(Math.abs(C)<1e-6||!isFinite(F)){if(Math.abs(S-R)<1e-6)return this.easeTo(e,t);const n=R<S?-1:1;F=Math.abs(Math.log(R/S))/x,B=()=>0,D=e=>Math.exp(n*x*e)}if("duration"in e)e.duration=+e.duration;else{const t="screenSpeed"in e?+e.screenSpeed/x:+e.speed;e.duration=1e3*F/t}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=o!==l,this._pitching=c!==a,this._padding=!r.isPaddingEqual(d),this._prepareEase(t,!1),this._ease((e=>{const n=e*F,h=1/D(n);r.zoom=1===e?y:i+r.scaleZoom(h),this._rotating&&(r.bearing=u(o,l,e)),this._pitching&&(r.pitch=u(a,c,e)),this._padding&&(r.interpolatePadding(s,d,e),g=r.centerPoint.add(f));const p=1===e?v:r.unproject(b.add(T.mult(B(n))).mult(h));r.setLocationAtPoint(r.renderWorldCopies?p.wrap():p,g),this._applyUpdatedTransform(r),this._fireMoveEvents(t)}),(()=>{this._afterEase(t)}),e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const e=this._onEaseEnd;delete this._onEaseEnd,e.call(this,t)}var n;return e||null===(n=this.handlers)||void 0===n||n.stop(!1),this}_ease(e,t,n){!1===n.animate||0===n.duration?(e(1),t()):(this._easeStart=w.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,t){e=d(e,-180,180);const n=Math.abs(e-t);return Math.abs(e-360-t)<n&&(e-=360),Math.abs(e+360-t)<n&&(e+=360),e}_normalizeCenter(e){const t=this.transform;if(!t.renderWorldCopies||t.lngRange)return;const n=e.lng-t.center.lng;e.lng+=n>180?-360:n<-180?360:0}}var k=n(23172),G=n(70911),z=n(39095);class j{constructor(e=0,t=0,n=0,r=0){if((0,i.A)(this,"top",void 0),(0,i.A)(this,"bottom",void 0),(0,i.A)(this,"left",void 0),(0,i.A)(this,"right",void 0),isNaN(e)||e<0||isNaN(t)||t<0||isNaN(n)||n<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=n,this.right=r}interpolate(e,t,n){return null!=t.top&&null!=e.top&&(this.top=u(e.top,t.top,n)),null!=t.bottom&&null!=e.bottom&&(this.bottom=u(e.bottom,t.bottom,n)),null!=t.left&&null!=e.left&&(this.left=u(e.left,t.left,n)),null!=t.right&&null!=e.right&&(this.right=u(e.right,t.right,n)),this}getCenter(e,t){const n=h((this.left+e-this.right)/2,0,e),r=h((this.top+t-this.bottom)/2,0,t);return new(O())(n,r)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new j(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const V=85.051129;class H{constructor(e,t,n,r,o){(0,i.A)(this,"tileSize",void 0),(0,i.A)(this,"tileZoom",void 0),(0,i.A)(this,"lngRange",void 0),(0,i.A)(this,"latRange",void 0),(0,i.A)(this,"scale",void 0),(0,i.A)(this,"width",void 0),(0,i.A)(this,"height",void 0),(0,i.A)(this,"angle",void 0),(0,i.A)(this,"rotationMatrix",void 0),(0,i.A)(this,"pixelsToGLUnits",void 0),(0,i.A)(this,"cameraToCenterDistance",void 0),(0,i.A)(this,"mercatorMatrix",void 0),(0,i.A)(this,"projMatrix",void 0),(0,i.A)(this,"invProjMatrix",void 0),(0,i.A)(this,"alignedProjMatrix",void 0),(0,i.A)(this,"pixelMatrix",void 0),(0,i.A)(this,"pixelMatrix3D",void 0),(0,i.A)(this,"pixelMatrixInverse",void 0),(0,i.A)(this,"glCoordMatrix",void 0),(0,i.A)(this,"labelPlaneMatrix",void 0),(0,i.A)(this,"minElevationForCurrentTile",void 0),(0,i.A)(this,"_fov",void 0),(0,i.A)(this,"_pitch",void 0),(0,i.A)(this,"_zoom",void 0),(0,i.A)(this,"_unmodified",void 0),(0,i.A)(this,"_renderWorldCopies",void 0),(0,i.A)(this,"_minZoom",void 0),(0,i.A)(this,"_maxZoom",void 0),(0,i.A)(this,"_minPitch",void 0),(0,i.A)(this,"_maxPitch",void 0),(0,i.A)(this,"_center",void 0),(0,i.A)(this,"_elevation",void 0),(0,i.A)(this,"_pixelPerMeter",void 0),(0,i.A)(this,"_edgeInsets",void 0),(0,i.A)(this,"_constraining",void 0),(0,i.A)(this,"_posMatrixCache",void 0),(0,i.A)(this,"_alignedPosMatrixCache",void 0),this.tileSize=512,this._renderWorldCopies=void 0===o||!!o,this._minZoom=e||0,this._maxZoom=t||22,this._minPitch=null==n?0:n,this._maxPitch=null==r?60:r,this.setMaxBounds(),this.width=0,this.height=0,this._center=new E(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new j,this._posMatrixCache={},this._alignedPosMatrixCache={},this.minElevationForCurrentTile=0}clone(){const e=new H(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this.minElevationForCurrentTile=e.minElevationForCurrentTile,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new(O())(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){const t=-d(e,-180,180)*Math.PI/180;var n;this.angle!==t&&(this._unmodified=!1,this.angle=t,this._calcMatrices(),this.rotationMatrix=(n=new k.tb(4),k.tb!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n),function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);e[0]=r*l+o*s,e[1]=i*l+a*s,e[2]=r*-s+o*l,e[3]=i*-s+a*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const t=h(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==t&&(this._unmodified=!1,this._pitch=t,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){const t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.tileZoom=Math.max(0,Math.floor(t)),this.scale=this.zoomScale(t),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,n){this._unmodified=!1,this._edgeInsets.interpolate(e,t,n),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){const t=h(e.lat,-85.051129,V);return new(O())(T(e.lng)*this.worldSize,x(t)*this.worldSize)}unproject(e){return new C(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}setLocationAtPoint(e,t){const n=this.pointCoordinate(t),r=this.pointCoordinate(this.centerPoint),i=this.locationCoordinate(e),o=new C(i.x-(n.x-r.x),i.y-(n.y-r.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e){return this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e){return this.coordinateLocation(this.pointCoordinate(e))}locationCoordinate(e){return C.fromLngLat(e)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(e){const t=[e.x,e.y,0,1],n=[e.x,e.y,1,1];G.Z0(t,t,this.pixelMatrixInverse),G.Z0(n,n,this.pixelMatrixInverse);const r=t[3],i=n[3],o=t[1]/r,a=n[1]/i,s=t[2]/r,l=n[2]/i,c=s===l?0:(0-s)/(l-s);return new C(u(t[0]/r,n[0]/i,c)/this.worldSize,u(o,a,c)/this.worldSize)}coordinatePoint(e,t=0,n=this.pixelMatrix){const r=[e.x*this.worldSize,e.y*this.worldSize,t,1];return G.Z0(r,r,n),new(O())(r[0]/r[3],r[1]/r[3])}getBounds(){const e=Math.max(0,this.height/2-this.getHorizon());return(new M).extend(this.pointLocation(new(O())(0,e))).extend(this.pointLocation(new(O())(this.width,e))).extend(this.pointLocation(new(O())(this.width,this.height))).extend(this.pointLocation(new(O())(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new M([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,V])}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(e,t){t=h(+t,this.minZoom,this.maxZoom);const n={center:new E(e.lng,e.lat),zoom:t};let r=this.lngRange;if(!this._renderWorldCopies&&null===r){const e=180-1e-10;r=[-e,e]}const i=this.tileSize*this.zoomScale(n.zoom);let o=0,a=i,s=0,l=i,c=0,u=0;const{x:f,y:p}=this.size;if(this.latRange){const e=this.latRange;o=x(e[1])*i,a=x(e[0])*i,a-o<p&&(c=p/(a-o))}r&&(s=d(T(r[0])*i,0,i),l=d(T(r[1])*i,0,i),l<s&&(l+=i),l-s<f&&(u=f/(l-s)));const{x:g,y:m}=this.project.call({worldSize:i},e);let _,v;const y=Math.max(u||0,c||0);if(y){const e=new(O())(u?(l+s)/2:g,c?(a+o)/2:m);return n.center=this.unproject.call({worldSize:i},e).wrap(),n.zoom+=this.scaleZoom(y),n}if(this.latRange){const e=p/2;m-e<o&&(v=o+e),m+e>a&&(v=a-e)}if(r){const e=(s+l)/2;let t=g;this._renderWorldCopies&&(t=d(g,e-i/2,e+i/2));const n=f/2;t-n<s&&(_=s+n),t+n>l&&(_=l-n)}if(void 0!==_||void 0!==v){var A,b;const e=new(O())(null!==(A=_)&&void 0!==A?A:g,null!==(b=v)&&void 0!==b?b:m);n.center=this.unproject.call({worldSize:i},e).wrap()}return n}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const e=this._unmodified,{center:t,zoom:n}=this.getConstrained(this.center,this.zoom);this.center=t,this.zoom=n,this._unmodified=e,this._constraining=!1}_calcMatrices(){if(!this.height)return;const e=this._fov/2,t=this.centerOffset,n=this.point.x,r=this.point.y;this.cameraToCenterDistance=.5/Math.tan(e)*this.height,this._pixelPerMeter=S(1,this.center.lat)*this.worldSize;let i=z.D_(new Float64Array(16));z.hs(i,i,[this.width/2,-this.height/2,1]),z.Tl(i,i,[1,-1,0]),this.labelPlaneMatrix=i,i=z.D_(new Float64Array(16)),z.hs(i,i,[1,-1,1]),z.Tl(i,i,[-1,-1,0]),z.hs(i,i,[2/this.width,2/this.height,1]),this.glCoordMatrix=i;const o=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),a=Math.min(this.elevation,this.minElevationForCurrentTile),s=o-a*this._pixelPerMeter/Math.cos(this._pitch),l=a<0?s:o,c=Math.PI/2+this._pitch,u=this._fov*(.5+t.y/this.height),d=Math.sin(u)*l/Math.sin(h(Math.PI-c-u,.01,Math.PI-.01)),f=this.getHorizon(),p=2*Math.atan(f/this.cameraToCenterDistance)*(.5+t.y/(2*f)),g=Math.sin(p)*l/Math.sin(h(Math.PI-c-p,.01,Math.PI-.01)),m=Math.min(d,g),_=1.01*(Math.cos(Math.PI/2-this._pitch)*m+l),v=this.height/50;i=new Float64Array(16),z.fN(i,this._fov,this.width/this.height,v,_),i[8]=2*-t.x/this.width,i[9]=2*t.y/this.height,z.hs(i,i,[1,-1,1]),z.Tl(i,i,[0,0,-this.cameraToCenterDistance]),z.eL(i,i,this._pitch),z.Qr(i,i,this.angle),z.Tl(i,i,[-n,-r,0]),this.mercatorMatrix=z.hs([],i,[this.worldSize,this.worldSize,this.worldSize]),z.hs(i,i,[1,1,this._pixelPerMeter]),this.pixelMatrix=z.lw(new Float64Array(16),this.labelPlaneMatrix,i),z.Tl(i,i,[0,0,-this.elevation]),this.projMatrix=i,this.invProjMatrix=z.B8([],i),this.pixelMatrix3D=z.lw(new Float64Array(16),this.labelPlaneMatrix,i);const y=this.width%2/2,E=this.height%2/2,A=Math.cos(this.angle),b=Math.sin(this.angle),T=n-Math.round(n)+A*y+b*E,x=r-Math.round(r)+A*E+b*y,R=new Float64Array(i);if(z.Tl(R,R,[T>.5?T-1:T,x>.5?x-1:x,0]),this.alignedProjMatrix=R,i=z.B8(new Float64Array(16),this.pixelMatrix),!i)throw new Error("failed to invert matrix");this.pixelMatrixInverse=i,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const e=this.pointCoordinate(new(O())(0,0)),t=[e.x*this.worldSize,e.y*this.worldSize,0,1];return G.Z0(t,t,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const e=this._pitch,t=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new(O())(0,t))}getCameraQueryGeometry(e){const t=this.getCameraPoint();if(1===e.length)return[e[0],t];{let n=t.x,r=t.y,i=t.x,o=t.y;for(const t of e)n=Math.min(n,t.x),r=Math.min(r,t.y),i=Math.max(i,t.x),o=Math.max(o,t.y);return[new(O())(n,r),new(O())(i,r),new(O())(i,o),new(O())(n,o),new(O())(n,r)]}}lngLatToCameraDepth(e,t){const n=this.locationCoordinate(e),r=[n.x*this.worldSize,n.y*this.worldSize,t,1];return G.Z0(r,r,this.projMatrix),r[2]/r[3]}}var W;class X{static testProp(e){if(!X.docStyle)return e[0];for(let t=0;t<e.length;t++)if(e[t]in X.docStyle)return e[t];return e[0]}static create(e,t,n){const r=window.document.createElement(e);return void 0!==t&&(r.className=t),n&&n.appendChild(r),r}static createNS(e,t){return window.document.createElementNS(e,t)}static disableDrag(){X.docStyle&&X.selectProp&&(X.userSelect=X.docStyle[X.selectProp],X.docStyle[X.selectProp]="none")}static enableDrag(){X.docStyle&&X.selectProp&&(X.docStyle[X.selectProp]=X.userSelect)}static setTransform(e,t){e.style[X.transformProp]=t}static addEventListener(e,t,n,r={}){"passive"in r?e.addEventListener(t,n,r):e.addEventListener(t,n,r.capture)}static removeEventListener(e,t,n,r={}){"passive"in r?e.removeEventListener(t,n,r):e.removeEventListener(t,n,r.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",X.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",X.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",X.suppressClickInternal,!0)}),0)}static getScale(e){const t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}static getPoint(e,t,n){const r=t.boundingClientRect;return new(O())((n.clientX-r.left)/t.x-e.clientLeft,(n.clientY-r.top)/t.y-e.clientTop)}static mousePos(e,t){const n=X.getScale(e);return X.getPoint(e,n,t)}static touchPos(e,t){const n=[],r=X.getScale(e);for(let i=0;i<t.length;i++)n.push(X.getPoint(e,r,t[i]));return n}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}}W=X,(0,i.A)(X,"docStyle","undefined"!=typeof window&&window.document&&window.document.documentElement.style),(0,i.A)(X,"userSelect",void 0),(0,i.A)(X,"selectProp",W.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"])),(0,i.A)(X,"transformProp",W.testProp(["transform","WebkitTransform"]));class Z{constructor(e){(0,i.A)(this,"_map",void 0),this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.pointLocation(O().convert(e))}}class Y{constructor(e,t){(0,i.A)(this,"_map",void 0),(0,i.A)(this,"_tr",void 0),(0,i.A)(this,"_el",void 0),(0,i.A)(this,"_container",void 0),(0,i.A)(this,"_enabled",void 0),(0,i.A)(this,"_active",void 0),(0,i.A)(this,"_startPos",void 0),(0,i.A)(this,"_lastPos",void 0),(0,i.A)(this,"_box",void 0),(0,i.A)(this,"_clickTolerance",void 0),this._map=e,this._tr=new Z(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(X.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;const n=t;if(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)return;const r=this._startPos;this._lastPos=n,this._box||(this._box=X.create("div","l7-boxzoom",this._container),this._container.classList.add("l7-crosshair"),this._fireEvent("boxzoomstart",e));const i=Math.min(r.x,n.x),o=Math.max(r.x,n.x),a=Math.min(r.y,n.y),s=Math.max(r.y,n.y);X.setTransform(this._box,`translate(${i}px,${a}px)`),this._box.style.width=o-i+"px",this._box.style.height=s-a+"px"}mouseupWindow(e,t){if(!this._active)return;if(0!==e.button)return;const n=this._startPos,r=t;if(this.reset(),X.suppressClick(),n.x!==r.x||n.y!==r.y)return this._map.fire(new D("boxzoomend",{originalEvent:e})),{cameraAnimation:e=>e.fitScreenCoordinates(n,r,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("l7-crosshair"),this._box&&(X.remove(this._box),this._box=null),X.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,t){return this._map.fire(new D(e,{originalEvent:t}))}}class q{constructor(e){(0,i.A)(this,"_tr",void 0),(0,i.A)(this,"_enabled",void 0),(0,i.A)(this,"_active",void 0),this._tr=new Z(e),this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:n=>{n.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class K{constructor(e,t){(0,i.A)(this,"_options",void 0),(0,i.A)(this,"_map",void 0),(0,i.A)(this,"_container",void 0),(0,i.A)(this,"_bypassKey",-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey"),(0,i.A)(this,"_enabled",void 0),this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("l7-cooperative-gestures"),this._container=X.create("div","l7-cooperative-gesture-screen",e);const t=document.createElement("div");t.className="l7-desktop-message",t.textContent="Missing UI string",this._container.appendChild(t);const n=document.createElement("div");n.className="l7-mobile-message",n.textContent="Missing UI string",this._container.appendChild(n),this._container.setAttribute("aria-hidden","true")}_destoryUI(){this._container&&(X.remove(this._container),this._map.getCanvasContainer().classList.remove("l7-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destoryUI()}isEnabled(){return this._enabled}touchmove(e){this._onCooperativeGesture(1===e.touches.length)}wheel(e){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!e[this._bypassKey])}_onCooperativeGesture(e){this._enabled&&e&&(this._container.classList.add("l7-show"),setTimeout((()=>{this._container.classList.remove("l7-show")}),100))}}const Q={panStep:100,bearingStep:15,pitchStep:10};class ${constructor(e){(0,i.A)(this,"_tr",void 0),(0,i.A)(this,"_enabled",void 0),(0,i.A)(this,"_active",void 0),(0,i.A)(this,"_panStep",void 0),(0,i.A)(this,"_bearingStep",void 0),(0,i.A)(this,"_pitchStep",void 0),(0,i.A)(this,"_rotationDisabled",void 0),this._tr=new Z(e);const t=Q;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,n=0,r=0,i=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),i=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),i=1);break;case 38:e.shiftKey?r=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?r=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(n=0,r=0),{cameraAnimation:a=>{const s=this._tr;a.easeTo({duration:300,easeId:"keyboardHandler",easing:J,zoom:t?Math.round(s.zoom)+t*(e.shiftKey?2:1):s.zoom,bearing:s.bearing+n*this._bearingStep,pitch:s.pitch+r*this._pitchStep,offset:[-i*this._panStep,-o*this._panStep],center:s.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function J(e){return e*(2-e)}class ee extends D{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,n,r={}){super(e,r),(0,i.A)(this,"target",void 0),(0,i.A)(this,"originalEvent",void 0),(0,i.A)(this,"point",void 0),(0,i.A)(this,"lngLat",void 0),(0,i.A)(this,"_defaultPrevented",void 0);const o=X.mousePos(t.getCanvasContainer(),n),a=t.unproject(o);this.point=o,this.lngLat=a,this.originalEvent=n,this._defaultPrevented=!1,this.target=t}}class te extends D{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,n){super(e),(0,i.A)(this,"target",void 0),(0,i.A)(this,"originalEvent",void 0),(0,i.A)(this,"lngLat",void 0),(0,i.A)(this,"point",void 0),(0,i.A)(this,"points",void 0),(0,i.A)(this,"lngLats",void 0),(0,i.A)(this,"_defaultPrevented",void 0);const r="touchend"===e?n.changedTouches:n.touches,o=X.touchPos(t.getCanvasContainer(),r),a=o.map((e=>t.unproject(e))),s=o.reduce(((e,t,n,r)=>e.add(t.div(r.length))),new(O())(0,0)),l=t.unproject(s);this.target=t,this.points=o,this.point=s,this.lngLats=a,this.lngLat=l,this.originalEvent=n,this._defaultPrevented=!1}}class ne extends D{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,n){super(e),(0,i.A)(this,"target",void 0),(0,i.A)(this,"originalEvent",void 0),(0,i.A)(this,"_defaultPrevented",void 0),this.target=t,this._defaultPrevented=!1,this.originalEvent=n}}class re{constructor(e,t){(0,i.A)(this,"_mousedownPos",void 0),(0,i.A)(this,"_clickTolerance",void 0),(0,i.A)(this,"_map",void 0),this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new ne(e.type,this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new ee(e.type,this._map,e))}mouseup(e){this._map.fire(new ee(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new ee(e.type,this._map,e))}dblclick(e){return this._firePreventable(new ee(e.type,this._map,e))}mouseover(e){this._map.fire(new ee(e.type,this._map,e))}mouseout(e){this._map.fire(new ee(e.type,this._map,e))}touchstart(e){return this._firePreventable(new te(e.type,this._map,e))}touchmove(e){this._map.fire(new te(e.type,this._map,e))}touchend(e){this._map.fire(new te(e.type,this._map,e))}touchcancel(e){this._map.fire(new te(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ie{constructor(e){(0,i.A)(this,"_map",void 0),(0,i.A)(this,"_delayContextMenu",void 0),(0,i.A)(this,"_ignoreContextMenu",void 0),(0,i.A)(this,"_contextMenuEvent",void 0),this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new ee(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ee("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new ee(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class oe{constructor(e){(0,i.A)(this,"contextmenu",void 0),(0,i.A)(this,"mousedown",void 0),(0,i.A)(this,"mousemoveWindow",void 0),(0,i.A)(this,"mouseup",void 0),(0,i.A)(this,"touchstart",void 0),(0,i.A)(this,"touchmoveWindow",void 0),(0,i.A)(this,"touchend",void 0),(0,i.A)(this,"_clickTolerance",void 0),(0,i.A)(this,"_moveFunction",void 0),(0,i.A)(this,"_activateOnStart",void 0),(0,i.A)(this,"_active",void 0),(0,i.A)(this,"_enabled",void 0),(0,i.A)(this,"_moved",void 0),(0,i.A)(this,"_lastPoint",void 0),(0,i.A)(this,"_moveStateManager",void 0),this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){const t=this._moveFunction(...e);if(t.bearingDelta||t.pitchDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(e,t){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=t.length?t[0]:t,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;const n=this._lastPoint;if(!n)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const r=t.length?t[0]:t;return!this._moved&&r.dist(n)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=r,this._move(n,r))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&X.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const ae=0,se=2,le={[ae]:1,[se]:2};class ce{constructor(e){(0,i.A)(this,"_eventButton",void 0),(0,i.A)(this,"_correctEvent",void 0),this._correctEvent=e.checkCorrectEvent}startMove(e){const t=X.mouseButton(e);this._eventButton=t}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(e,t){const n=le[t];return void 0===e.buttons||(e.buttons&n)!==n}(e,this._eventButton)}isValidEndEvent(e){return X.mouseButton(e)===this._eventButton}}const ue=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=e=>{e.preventDefault()}},he=4.000244140625,de=1/450;class fe{constructor(e,t){(0,i.A)(this,"_map",void 0),(0,i.A)(this,"_tr",void 0),(0,i.A)(this,"_enabled",void 0),(0,i.A)(this,"_active",void 0),(0,i.A)(this,"_zooming",void 0),(0,i.A)(this,"_aroundCenter",void 0),(0,i.A)(this,"_around",void 0),(0,i.A)(this,"_aroundPoint",void 0),(0,i.A)(this,"_type",void 0),(0,i.A)(this,"_lastValue",void 0),(0,i.A)(this,"_timeout",void 0),(0,i.A)(this,"_finishTimeout",void 0),(0,i.A)(this,"_lastWheelEvent",void 0),(0,i.A)(this,"_lastWheelEventTime",void 0),(0,i.A)(this,"_startZoom",void 0),(0,i.A)(this,"_targetZoom",void 0),(0,i.A)(this,"_delta",void 0),(0,i.A)(this,"_easing",void 0),(0,i.A)(this,"_prevEase",void 0),(0,i.A)(this,"_frameId",void 0),(0,i.A)(this,"_triggerRenderFrame",void 0),(0,i.A)(this,"_defaultZoomRate",void 0),(0,i.A)(this,"_wheelZoomRate",void 0),(0,i.A)(this,"_onTimeout",(e=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)})),this._map=e,this._tr=new Z(e),this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=de}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around)}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(e){if(!this.isEnabled())return;if(this._map.cooperativeGestures.isEnabled()&&!e[this._map.cooperativeGestures._bypassKey])return;let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const n=w.now(),r=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==t&&t%he==0?this._type="wheel":0!==t&&Math.abs(t)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(r*t)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const t=X.mousePos(this._map.getCanvasContainer(),e),n=this._tr;t.y>n.transform.height/2-n.transform.getHorizon()?this._around=E.convert(this._aroundCenter?n.center:n.unproject(t)):this._around=E.convert(n.center),this._aroundPoint=n.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const e=this._tr.transform;if(0!==this._delta){const t="wheel"===this._type&&Math.abs(this._delta)>he?this._wheelZoomRate:this._defaultZoomRate;let n=2/(1+Math.exp(-Math.abs(this._delta*t)));this._delta<0&&0!==n&&(n=1/n);const r="number"==typeof this._targetZoom?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(r*n))),"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const t="number"==typeof this._targetZoom?this._targetZoom:e.zoom,n=this._startZoom,r=this._easing;let i,o=!1;if("wheel"===this._type&&n&&r){const e=Math.min((w.now()-this._lastWheelEventTime)/200,1),a=r(e);i=u(n,t,a),e<1?this._frameId||(this._frameId=!0):o=!0}else i=t,o=!0;return this._active=!0,o&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!o,zoomDelta:i-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let t=m;if(this._prevEase){const e=this._prevEase,n=(w.now()-e.start)/e.duration,r=e.easing(n+.01)-e.easing(n),i=.27/Math.sqrt(r*r+1e-4)*.01;t=g(i,Math.sqrt(.0729-i*i),.25,1)}return this._prevEase={start:w.now(),duration:e,easing:t},t}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class pe{constructor(e,t){(0,i.A)(this,"_clickZoom",void 0),(0,i.A)(this,"_tapZoom",void 0),this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class ge{constructor(e,t,n){(0,i.A)(this,"_el",void 0),(0,i.A)(this,"_mousePan",void 0),(0,i.A)(this,"_touchPan",void 0),(0,i.A)(this,"_inertiaOptions",void 0),this._el=e,this._mousePan=t,this._touchPan=n}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("l7-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("l7-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class me{constructor(e,t,n){(0,i.A)(this,"_mouseRotate",void 0),(0,i.A)(this,"_mousePitch",void 0),(0,i.A)(this,"_pitchWithRotate",void 0),this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=n}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class _e{constructor(e,t,n,r){(0,i.A)(this,"_el",void 0),(0,i.A)(this,"_touchZoom",void 0),(0,i.A)(this,"_touchRotate",void 0),(0,i.A)(this,"_tapDragZoom",void 0),(0,i.A)(this,"_rotationDisabled",void 0),(0,i.A)(this,"_enabled",void 0),this._el=e,this._touchZoom=t,this._touchRotate=n,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("l7-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("l7-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}function ve(e,t){if(e.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);const n={};for(let r=0;r<e.length;r++)n[e[r].identifier]=t[r];return n}class ye{constructor(e){(0,i.A)(this,"numTouches",void 0),(0,i.A)(this,"centroid",void 0),(0,i.A)(this,"startTime",void 0),(0,i.A)(this,"aborted",void 0),(0,i.A)(this,"touches",void 0),this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,t,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){const t=new(O())(0,0);for(const n of e)t._add(n);return t.div(e.length)}(t),this.touches=ve(n,t)))}touchmove(e,t,n){if(this.aborted||!this.centroid)return;const r=ve(n,t);for(const e in this.touches){const t=this.touches[e],n=r[e];(!n||n.dist(t)>30)&&(this.aborted=!0)}}touchend(e,t,n){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===n.length){const e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class Ee{constructor(e){(0,i.A)(this,"singleTap",void 0),(0,i.A)(this,"numTaps",void 0),(0,i.A)(this,"lastTime",void 0),(0,i.A)(this,"lastTap",void 0),(0,i.A)(this,"count",void 0),this.singleTap=new ye(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,n){this.singleTap.touchstart(e,t,n)}touchmove(e,t,n){this.singleTap.touchmove(e,t,n)}touchend(e,t,n){const r=this.singleTap.touchend(e,t,n);if(r){const t=e.timeStamp-this.lastTime<500,n=!this.lastTap||this.lastTap.dist(r)<30;if(t&&n||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}class Ae{constructor(){(0,i.A)(this,"_enabled",void 0),(0,i.A)(this,"_active",void 0),(0,i.A)(this,"_swipePoint",void 0),(0,i.A)(this,"_swipeTouch",void 0),(0,i.A)(this,"_tapTime",void 0),(0,i.A)(this,"_tapPoint",void 0),(0,i.A)(this,"_tap",void 0),this._tap=new Ee({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,t,n){if(!this._swipePoint)if(this._tapTime){const r=t[0],i=e.timeStamp-this._tapTime<500,o=this._tapPoint.dist(r)<30;i&&o?n.length>0&&(this._swipePoint=r,this._swipeTouch=n[0].identifier):this.reset()}else this._tap.touchstart(e,t,n)}touchmove(e,t,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;const r=t[0],i=r.y-this._swipePoint.y;return this._swipePoint=r,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,n)}touchend(e,t,n){if(this._tapTime)this._swipePoint&&0===n.length&&this.reset();else{const r=this._tap.touchend(e,t,n);r&&(this._tapTime=e.timeStamp,this._tapPoint=r)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class be{constructor(e){(0,i.A)(this,"_tr",void 0),(0,i.A)(this,"_enabled",void 0),(0,i.A)(this,"_active",void 0),(0,i.A)(this,"_zoomIn",void 0),(0,i.A)(this,"_zoomOut",void 0),this._tr=new Z(e),this._zoomIn=new Ee({numTouches:1,numTaps:2}),this._zoomOut=new Ee({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,n){this._zoomIn.touchstart(e,t,n),this._zoomOut.touchstart(e,t,n)}touchmove(e,t,n){this._zoomIn.touchmove(e,t,n),this._zoomOut.touchmove(e,t,n)}touchend(e,t,n){const r=this._zoomIn.touchend(e,t,n),i=this._zoomOut.touchend(e,t,n),o=this._tr;return r?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:o.zoom+1,around:o.unproject(r)},{originalEvent:e})}):i?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:o.zoom-1,around:o.unproject(i)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Te{constructor(e,t){(0,i.A)(this,"_enabled",void 0),(0,i.A)(this,"_active",void 0),(0,i.A)(this,"_touches",void 0),(0,i.A)(this,"_clickTolerance",void 0),(0,i.A)(this,"_sum",void 0),(0,i.A)(this,"_map",void 0),this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new(O())(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(e,t,n){return this._calculateTransform(e,t,n)}touchmove(e,t,n){if(this._active&&!(n.length<this.minTouchs()))return e.preventDefault(),this._calculateTransform(e,t,n)}touchend(e,t,n){this._calculateTransform(e,t,n),this._active&&n.length<this.minTouchs()&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,t,n){n.length>0&&(this._active=!0);const r=ve(n,t),i=new(O())(0,0),o=new(O())(0,0);let a=0;for(const e in r){const t=r[e],n=this._touches[e];n&&(i._add(t),o._add(t.sub(n)),a++,r[e]=t)}if(this._touches=r,a<this.minTouchs()||!o.mag())return;const s=o.div(a);return this._sum._add(s),this._sum.mag()<this._clickTolerance?void 0:{around:i.div(a),panDelta:s}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class xe{constructor(){(0,i.A)(this,"_enabled",void 0),(0,i.A)(this,"_active",void 0),(0,i.A)(this,"_firstTwoTouches",void 0),(0,i.A)(this,"_vector",void 0),(0,i.A)(this,"_startVector",void 0),(0,i.A)(this,"_aroundCenter",void 0),this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,t,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,n){if(!this._firstTwoTouches)return;e.preventDefault();const[r,i]=this._firstTwoTouches,o=Se(n,t,r),a=Se(n,t,i);if(!o||!a)return;const s=this._aroundCenter?null:o.add(a).div(2);return this._move([o,a],s,e)}touchend(e,t,n){if(!this._firstTwoTouches)return;const[r,i]=this._firstTwoTouches,o=Se(n,t,r),a=Se(n,t,i);o&&a||(this._active&&X.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function Se(e,t,n){for(let r=0;r<e.length;r++)if(e[r].identifier===n)return t[r]}function Re(e,t){return Math.log(e/t)/Math.LN2}class Ce extends xe{constructor(...e){super(...e),(0,i.A)(this,"_distance",void 0),(0,i.A)(this,"_startDistance",void 0)}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){const n=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(Re(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Re(this._distance,n),pinchAround:t}}}function Le(e,t){return 180*e.angleWith(t)/Math.PI}class Oe extends xe{constructor(...e){super(...e),(0,i.A)(this,"_minDiameter",void 0)}reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t,n){const r=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Le(this._vector,r),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const t=25/(Math.PI*this._minDiameter)*360,n=Le(e,this._startVector);return Math.abs(n)<t}}function Me(e){return Math.abs(e.y)>Math.abs(e.x)}class Ie extends xe{constructor(e){super(),(0,i.A)(this,"_valid",void 0),(0,i.A)(this,"_firstMove",void 0),(0,i.A)(this,"_lastPoints",void 0),(0,i.A)(this,"_map",void 0),(0,i.A)(this,"_currentTouchCount",0),this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,n){super.touchstart(e,t,n),this._currentTouchCount=n.length}_start(e){this._lastPoints=e,Me(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,n){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const r=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(r,i,n.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(r.y+i.y)/2*-.5}):void 0}gestureBeginsVertically(e,t,n){if(void 0!==this._valid)return this._valid;const r=e.mag()>=2,i=t.mag()>=2;if(!r&&!i)return;if(!r||!i)return void 0===this._firstMove&&(this._firstMove=n),n-this._firstMove<100&&void 0;const o=e.y>0==t.y>0;return Me(e)&&Me(t)&&o}}const we={linearity:.3,easing:g(0,0,.3,1)},Pe=p({deceleration:2500,maxSpeed:1400},we),Ne=p({deceleration:20,maxSpeed:1400},we),De=p({deceleration:1e3,maxSpeed:360},we),Be=p({deceleration:1e3,maxSpeed:90},we);class Fe{constructor(e){(0,i.A)(this,"_map",void 0),(0,i.A)(this,"_inertiaBuffer",void 0),this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:w.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,t=w.now();for(;e.length>0&&t-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const t={zoom:0,bearing:0,pitch:0,pan:new(O())(0,0),pinchAround:void 0,around:void 0};for(const{settings:e}of this._inertiaBuffer)t.zoom+=e.zoomDelta||0,t.bearing+=e.bearingDelta||0,t.pitch+=e.pitchDelta||0,e.panDelta&&t.pan._add(e.panDelta),e.around&&(t.around=e.around),e.pinchAround&&(t.pinchAround=e.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,r={};if(t.pan.mag()){const i=ke(t.pan.mag(),n,p({},Pe,e||{}));r.offset=t.pan.mult(i.amount/t.pan.mag()),r.center=this._map.transform.center,Ue(r,i)}if(t.zoom){const e=ke(t.zoom,n,Ne);r.zoom=this._map.transform.zoom+e.amount,Ue(r,e)}if(t.bearing){const e=ke(t.bearing,n,De);r.bearing=this._map.transform.bearing+h(e.amount,-179,179),Ue(r,e)}if(t.pitch){const e=ke(t.pitch,n,Be);r.pitch=this._map.transform.pitch+e.amount,Ue(r,e)}if(r.zoom||r.bearing){const e=void 0===t.pinchAround?t.around:t.pinchAround;r.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),p(r,{noMoveStart:!0})}}function Ue(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function ke(e,t,n){const{maxSpeed:r,linearity:i,deceleration:o}=n,a=h(e*i/(t/1e3),-r,r),s=Math.abs(a)/(o*i);return{easing:n.easing,duration:1e3*s,amount:a*(s/2)}}const Ge=e=>e.zoom||e.drag||e.pitch||e.rotate;class ze extends D{constructor(e,t){super(e),(0,i.A)(this,"type","renderFrame"),(0,i.A)(this,"timeStamp",void 0),this.timeStamp=t}}function je(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class Ve{constructor(e,t){(0,i.A)(this,"_map",void 0),(0,i.A)(this,"_el",void 0),(0,i.A)(this,"_handlers",void 0),(0,i.A)(this,"_eventsInProgress",void 0),(0,i.A)(this,"_frameId",void 0),(0,i.A)(this,"_inertia",void 0),(0,i.A)(this,"_bearingSnap",void 0),(0,i.A)(this,"_handlersById",void 0),(0,i.A)(this,"_updatingCamera",void 0),(0,i.A)(this,"_changes",void 0),(0,i.A)(this,"_zoom",void 0),(0,i.A)(this,"_previousActiveHandlers",void 0),(0,i.A)(this,"_listeners",void 0),(0,i.A)(this,"handleWindowEvent",(e=>{this.handleEvent(e,`${e.type}Window`)})),(0,i.A)(this,"handleEvent",((e,t)=>{if("blur"===e.type)return void this.stop(!0);this._updatingCamera=!0;const n="renderFrame"===e.type?void 0:e,r={needsRenderFrame:!1},i={},o={},a=e.touches,s=a?this._getMapTouches(a):void 0,l=s?X.touchPos(this._map.getCanvasContainer(),s):X.mousePos(this._map.getCanvasContainer(),e);for(const{handlerName:a,handler:c,allowed:u}of this._handlers){if(!c.isEnabled())continue;let h;this._blockedByActive(o,u,a)?c.reset():c[t||e.type]&&(h=c[t||e.type](e,l,s),this.mergeHandlerResult(r,i,h,a,n),h&&h.needsRenderFrame&&this._triggerRenderFrame()),(h||c.isActive())&&(o[a]=c)}const c={};for(const e in this._previousActiveHandlers)o[e]||(c[e]=n);this._previousActiveHandlers=o,(Object.keys(c).length||je(r))&&(this._changes.push([r,i,c]),this._triggerRenderFrame()),(Object.keys(o).length||je(r))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:u}=r;u&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],u(this._map))})),this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Fe(e),this._bearingSnap=t.bearingSnap||7,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(t);const n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[window,"blur",void 0]];for(const[e,t,n]of this._listeners)X.addEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,n)}destroy(){for(const[e,t,n]of this._listeners)X.removeEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,n)}_addDefaultHandlers(e){const t=this._map,n=t.getCanvasContainer();this._add("mapEvent",new re(t,e));const r=t.boxZoom=new Y(t,e);this._add("boxZoom",r),e.interactive&&e.boxZoom&&r.enable();const i=t.cooperativeGestures=new K(t,e.cooperativeGestures);this._add("cooperativeGestures",i),e.cooperativeGestures&&i.enable();const o=new be(t),a=new q(t);t.doubleClickZoom=new pe(a,o),this._add("tapZoom",o),this._add("clickZoom",a),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();const s=new Ae;this._add("tapDragZoom",s);const l=t.touchPitch=new Ie(t);this._add("touchPitch",l),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);const c=(({enable:e,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>{const r=new ce({checkCorrectEvent:e=>0===X.mouseButton(e)&&e.ctrlKey||2===X.mouseButton(e)});return new oe({clickTolerance:t,move:(e,t)=>({bearingDelta:(t.x-e.x)*n}),moveStateManager:r,enable:e,assignEvents:ue})})(e),u=(({enable:e,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>{const r=new ce({checkCorrectEvent:e=>0===X.mouseButton(e)&&e.ctrlKey||2===X.mouseButton(e)});return new oe({clickTolerance:t,move:(e,t)=>({pitchDelta:(t.y-e.y)*n}),moveStateManager:r,enable:e,assignEvents:ue})})(e);t.dragRotate=new me(e,c,u),this._add("mouseRotate",c,["mousePitch"]),this._add("mousePitch",u,["mouseRotate"]),e.interactive&&e.dragRotate&&t.dragRotate.enable();const h=(({enable:e,clickTolerance:t})=>{const n=new ce({checkCorrectEvent:e=>0===X.mouseButton(e)&&!e.ctrlKey});return new oe({clickTolerance:t,move:(e,t)=>({around:t,panDelta:t.sub(e)}),activateOnStart:!0,moveStateManager:n,enable:e,assignEvents:ue})})(e),d=new Te(e,t);t.dragPan=new ge(n,h,d),this._add("mousePan",h),this._add("touchPan",d,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);const f=new Oe,p=new Ce;t.touchZoomRotate=new _e(n,p,f,s),this._add("touchRotate",f,["touchPan","touchZoom"]),this._add("touchZoom",p,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate);const g=t.scrollZoom=new fe(t,(()=>this._triggerRenderFrame()));this._add("scrollZoom",g,["mousePan"]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);const m=t.keyboard=new $(t);this._add("keyboard",m),e.interactive&&e.keyboard&&t.keyboard.enable(),this._add("blockableMapEvent",new ie(t))}_add(e,t,n){this._handlers.push({handlerName:e,handler:t,allowed:n}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(const{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(Ge(this._eventsInProgress))||this.isZooming()}_blockedByActive(e,t,n){for(const r in e)if(r!==n&&(!t||t.indexOf(r)<0))return!0;return!1}_getMapTouches(e){const t=[];for(const n of e){const e=n.target;this._el.contains(e)&&t.push(n)}return t}mergeHandlerResult(e,t,n,r,i){if(!n)return;p(e,n);const o={handlerName:r,originalEvent:n.originalEvent||i};void 0!==n.zoomDelta&&(t.zoom=o),void 0!==n.panDelta&&(t.drag=o),void 0!==n.pitchDelta&&(t.pitch=o),void 0!==n.bearingDelta&&(t.rotate=o)}_applyChanges(){const e={},t={},n={};for(const[r,i,o]of this._changes)r.panDelta&&(e.panDelta=(e.panDelta||new(O())(0,0))._add(r.panDelta)),r.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+r.zoomDelta),r.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+r.bearingDelta),r.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+r.pitchDelta),void 0!==r.around&&(e.around=r.around),void 0!==r.pinchAround&&(e.pinchAround=r.pinchAround),r.noInertia&&(e.noInertia=r.noInertia),p(t,i),p(n,o);this._updateMapTransform(e,t,n),this._changes=[]}_updateMapTransform(e,t,n){const r=this._map,i=r._getTransformForUpdate();if(!je(e))return this._fireEvents(t,n,!0);const{panDelta:o,zoomDelta:a,bearingDelta:s,pitchDelta:l,pinchAround:c}=e;let{around:u}=e;void 0!==c&&(u=c),r._stop(!0),u=u||r.transform.centerPoint;const h=i.pointLocation(o?u.sub(o):u);s&&(i.bearing+=s),l&&(i.pitch+=l),a&&(i.zoom+=a),i.setLocationAtPoint(h,u),r._applyUpdatedTransform(i),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,n,!0)}_fireEvents(e,t,n){const r=Ge(this._eventsInProgress),i=Ge(e),o={};for(const t in e){const{originalEvent:n}=e[t];this._eventsInProgress[t]||(o[`${t}start`]=n),this._eventsInProgress[t]=e[t]}!r&&i&&this._fireEvent("movestart",i.originalEvent);for(const e in o)this._fireEvent(e,o[e]);i&&this._fireEvent("move",i.originalEvent);for(const t in e){const{originalEvent:n}=e[t];this._fireEvent(t,n)}const a={};let s;for(const e in this._eventsInProgress){const{handlerName:n,originalEvent:r}=this._eventsInProgress[e];this._handlersById[n].isActive()||(delete this._eventsInProgress[e],s=t[n]||r,a[`${e}end`]=s)}for(const e in a)this._fireEvent(e,a[e]);const l=Ge(this._eventsInProgress);if(n&&(r||i)&&!l){this._updatingCamera=!0;const e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),t=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;!e||!e.essential&&w.prefersReducedMotion?(this._map.fire(new D("moveend",{originalEvent:s})),t(this._map.getBearing())&&this._map.resetNorth()):(t(e.bearing||this._map.getBearing())&&(e.bearing=0),e.freezeElevation=!0,this._map.easeTo(e,{originalEvent:s})),this._updatingCamera=!1}}_fireEvent(e,t){this._map.fire(new D(e,t?{originalEvent:t}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((e=>{delete this._frameId,this.handleEvent(new ze("renderFrame",e)),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class He{constructor(){(0,i.A)(this,"_queue",void 0),(0,i.A)(this,"_id",void 0),(0,i.A)(this,"_cleared",void 0),(0,i.A)(this,"_currentlyRunning",void 0),this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){const t=this._currentlyRunning,n=t?this._queue.concat(t):this._queue;for(const t of n)if(t.id===e)return void(t.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const t=this._currentlyRunning=this._queue;this._queue=[];for(const n of t)if(!n.cancelled&&(n.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var We=n(1976);!function(e,t){var n="undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM,r="undefined"!=typeof wx&&null!==wx&&(void 0!==wx.request||void 0!==wx.miniProgram);if(!n&&!r&&(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");a.type="text/css",a.styleSheet?a.styleSheet.cssText=e:a.appendChild(t.createTextNode(e)),i.appendChild(a)}}(".l7-map {\n font:\n 12px/20px 'Helvetica Neue',\n Arial,\n Helvetica,\n sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n.l7-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.l7-map:-webkit-full-screen {\n width: 100%;\n height: 100%;\n}\n\n.l7-canary {\n background-color: salmon;\n}\n\n.l7-canvas-container.l7-interactive,\n.l7-ctrl-group button.l7-ctrl-compass {\n cursor: grab;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.l7-canvas-container.l7-interactive.l7-track-pointer {\n cursor: pointer;\n}\n\n.l7-canvas-container.l7-interactive:active,\n.l7-ctrl-group button.l7-ctrl-compass:active {\n cursor: grabbing;\n}\n\n.l7-canvas-container.l7-touch-zoom-rotate,\n.l7-canvas-container.l7-touch-zoom-rotate .l7-canvas {\n touch-action: pan-x pan-y;\n}\n\n.l7-canvas-container.l7-touch-drag-pan,\n.l7-canvas-container.l7-touch-drag-pan .l7-canvas {\n touch-action: pinch-zoom;\n}\n\n.l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan,\n.l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan .l7-canvas {\n touch-action: none;\n}\n\n.l7-canvas-container.l7-touch-drag-pan.l7-cooperative-gestures,\n.l7-canvas-container.l7-touch-drag-pan.l7-cooperative-gestures .l7-canvas {\n touch-action: pan-x pan-y;\n}\n\n.l7-cooperative-gesture-screen {\n background: rgba(0 0 0 / 40%);\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n padding: 1rem;\n font-size: 1.4em;\n line-height: 1.2;\n opacity: 0;\n pointer-events: none;\n transition: opacity 1s ease 1s;\n z-index: 99999;\n}\n\n.l7-cooperative-gesture-screen.l7-show {\n opacity: 1;\n transition: opacity 0.05s;\n}\n\n.l7-cooperative-gesture-screen .l7-mobile-message {\n display: none;\n}\n\n@media (hover: none), (width <= 480px) {\n .l7-cooperative-gesture-screen .l7-desktop-message {\n display: none;\n }\n\n .l7-cooperative-gesture-screen .l7-mobile-message {\n display: block;\n }\n}\n\n.l7-ctrl-top-left,\n.l7-ctrl-top-right,\n.l7-ctrl-bottom-left,\n.l7-ctrl-bottom-right {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n}\n.l7-ctrl-top-left {\n top: 0;\n left: 0;\n}\n.l7-ctrl-top-right {\n top: 0;\n right: 0;\n}\n.l7-ctrl-bottom-left {\n bottom: 0;\n left: 0;\n}\n.l7-ctrl-bottom-right {\n right: 0;\n bottom: 0;\n}\n\n.l7-ctrl {\n clear: both;\n pointer-events: auto;\n\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0);\n}\n.l7-ctrl-top-left .l7-ctrl {\n margin: 10px 0 0 10px;\n float: left;\n}\n.l7-ctrl-top-right .l7-ctrl {\n margin: 10px 10px 0 0;\n float: right;\n}\n.l7-ctrl-bottom-left .l7-ctrl {\n margin: 0 0 10px 10px;\n float: left;\n}\n.l7-ctrl-bottom-right .l7-ctrl {\n margin: 0 10px 10px 0;\n float: right;\n}\n\n.l7-crosshair,\n.l7-crosshair .l7-interactive,\n.l7-crosshair .l7-interactive:active {\n cursor: crosshair;\n}\n\n.l7-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: 0.5;\n z-index: 10;\n}\n");const Xe={interactive:!0,bearingSnap:7,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,fadeDuration:300,clickTolerance:3,pitchWithRotate:!0};class Ze extends U{constructor(e){const t=(0,r.A)((0,r.A)({},Xe),e);if(null!=t.minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new H(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies),{bearingSnap:t.bearingSnap}),(0,i.A)(this,"_container",void 0),(0,i.A)(this,"_canvasContainer",void 0),(0,i.A)(this,"_interactive",void 0),(0,i.A)(this,"_frameRequest",void 0),(0,i.A)(this,"_loaded",void 0),(0,i.A)(this,"_idleTriggered",!1),(0,i.A)(this,"_fullyLoaded",void 0),(0,i.A)(this,"_trackResize",void 0),(0,i.A)(this,"_resizeObserver",void 0),(0,i.A)(this,"_preserveDrawingBuffer",void 0),(0,i.A)(this,"_failIfMajorPerformanceCaveat",void 0),(0,i.A)(this,"_fadeDuration",void 0),(0,i.A)(this,"_crossSourceCollisions",void 0),(0,i.A)(this,"_crossFadingFactor",1),(0,i.A)(this,"_collectResourceTiming",void 0),(0,i.A)(this,"_renderTaskQueue",new He),(0,i.A)(this,"_mapId",f++),(0,i.A)(this,"_removed",void 0),(0,i.A)(this,"_clickTolerance",void 0),(0,i.A)(this,"scrollZoom",void 0),(0,i.A)(this,"boxZoom",void 0),(0,i.A)(this,"dragRotate",void 0),(0,i.A)(this,"dragPan",void 0),(0,i.A)(this,"keyboard",void 0),(0,i.A)(this,"doubleClickZoom",void 0),(0,i.A)(this,"touchZoomRotate",void 0),(0,i.A)(this,"touchPitch",void 0),(0,i.A)(this,"cooperativeGestures",void 0),(0,i.A)(this,"_onMapScroll",(e=>{if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1})),this._interactive=t.interactive,this._trackResize=!0===t.trackResize,this._bearingSnap=t.bearingSnap,this._fadeDuration=t.fadeDuration,this._clickTolerance=t.clickTolerance,"string"==typeof t.container){if(this._container=document.getElementById(t.container),!this._container)throw new Error(`Container '${t.container}' not found.`)}else{if(!(t.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),this._setupContainer(),this.on("move",(()=>this._update())).on("moveend",(()=>this._update())).on("zoom",(()=>this._update())).once("idle",(()=>{this._idleTriggered=!0})),"undefined"!=typeof window){let e=!1;const t=We.uG.throttle((e=>{this._trackResize&&!this._removed&&this.resize(e)._update()}),50);this._resizeObserver=new ResizeObserver((n=>{e?t(n):e=!0})),this._resizeObserver.observe(this._container)}this.handlers=new Ve(this,t),this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,p({},t.fitBoundsOptions,{duration:0}))),this.resize()}_getMapId(){return this._mapId}calculateCameraOptionsFromTo(e,t,n,r){return super.calculateCameraOptionsFromTo(e,t,n,r)}resize(e){var t;const n=this._containerDimensions(),r=n[0],i=n[1];this.transform.resize(r,i),null===(t=this._requestedCameraState)||void 0===t||t.resize(r,i);const o=!this._moving;return o&&(this.stop(),this.fire(new D("movestart",e)).fire(new D("move",e))),this.fire(new D("resize",e)),o&&this.fire(new D("moveend",e)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(e){return this.transform.setMaxBounds(e&&M.convert(e)),this._update()}setMinZoom(e){if((e=null==e?-2:e)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()<e&&this.setZoom(e),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(e){if((e=null==e?22:e)>=this.transform.minZoom)return this.transform.maxZoom=e,this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if((e=null==e?0:e)<0)throw new Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this.getPitch()<e&&this.setPitch(e),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(e){if((e=null==e?60:e)>85)throw new Error("maxPitch must be less than or equal to 85");if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){this.transform.renderWorldCopies=e}project(e){return this.transform.locationPoint(E.convert(e))}unproject(e){return this.transform.pointLocation(O().convert(e))}isMoving(){var e;return this._moving||(null===(e=this.handlers)||void 0===e?void 0:e.isMoving())}isZooming(){var e;return this._zooming||(null===(e=this.handlers)||void 0===e?void 0:e.isZooming())}isRotating(){var e;return this._rotating||(null===(e=this.handlers)||void 0===e?void 0:e.isRotating())}on(e,t){return super.on(e,t)}once(e,t){return super.once(e,t)}off(e,t){return super.off(e,t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}_containerDimensions(){let e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]}_setupContainer(){const e=this._container;e.classList.add("l7-map");const t=this._canvasContainer=X.create("div","l7-canvas-container",e);this._interactive&&t.classList.add("l7-interactive"),this._container.addEventListener("scroll",this._onMapScroll,!1)}_update(){return this.triggerRepaint(),this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(e){if(this._renderTaskQueue.run(e),!this._removed)return this.fire(new D("render")),this.isMoving()||this.fire(new D("idle")),this}remove(){var e;this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.handlers.destroy(),delete this.handlers,null===(e=this._resizeObserver)||void 0===e||e.disconnect(),X.remove(this._canvasContainer),this._container.classList.remove("l7-map"),this._removed=!0,this.fire(new D("remove"))}triggerRepaint(){this._frameRequest||(this._frameRequest=new AbortController,w.frameAsync(this._frameRequest).then((e=>{this._frameRequest=null,this._render(e)})).catch((()=>{})))}getCameraTargetElevation(){return this.transform.elevation}}var Ye=n(64062),qe=n(55152),Ke=n(30414),Qe=n(95309),$e=n(72715),Je=n(48926),et=n(2474),tt=n(90689);function nt(e,t){var n=G.Z0([],t,e);return G.hs(n,n,1/n[3]),n}var rt=n(90333);function it(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}var ot=Math.PI,at=ot/4,st=ot/180,lt=180/ot,ct=4003e4;function ut(e){return Math.pow(2,e)}function ht(e,t){var n=(0,tt.A)(e,2),r=n[0],i=n[1];it(Number.isFinite(r)&&Number.isFinite(t)),it(Number.isFinite(i)&&i>=-90&&i<=90,"invalid latitude");var o=i*st;return[(t*=512)*(r*st+ot)/(2*ot),t*(ot-Math.log(Math.tan(at+.5*o)))/(2*ot)]}function dt(e,t){var n=(0,tt.A)(e,2),r=n[0],i=n[1],o=r/(t*=512)*(2*ot)-ot,a=2*(Math.atan(Math.exp(ot-i/t*(2*ot)))-at);return[o*lt,a*lt]}function ft(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(0,tt.A)(e,3),i=r[0],o=r[1],a=r[2];if(it(Number.isFinite(i)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(a))return nt(t,[i,o,a,1]);var s=nt(t,[i,o,0,1]),l=nt(t,[i,o,1,1]),c=s[2],u=l[2],h=c===u?0:((n||0)-c)/(u-c);return rt.Cc([],s,l,h)}var pt=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function gt(e){var t=e.width,n=e.height,r=e.bounds,i=e.minExtent,o=void 0===i?0:i,a=e.maxZoom,s=void 0===a?24:a,l=e.padding,c=void 0===l?0:l,u=e.offset,h=void 0===u?[0,0]:u,d=(0,tt.A)(r,2),f=(0,tt.A)(d[0],2),p=f[0],g=f[1],m=(0,tt.A)(d[1],2),_=m[0],v=m[1];Number.isFinite(c)?c={top:c,bottom:c,left:c,right:c}:it(Number.isFinite(c.top)&&Number.isFinite(c.bottom)&&Number.isFinite(c.left)&&Number.isFinite(c.right));var y=new mt({width:t,height:n,longitude:0,latitude:0,zoom:0}),E=y.project([p,v]),A=y.project([_,g]),b=[Math.max(Math.abs(A[0]-E[0]),o),Math.max(Math.abs(A[1]-E[1]),o)],T=[t-c.left-c.right-2*Math.abs(h[0]),n-c.top-c.bottom-2*Math.abs(h[1])];it(T[0]>0&&T[1]>0);var x=T[0]/b[0],S=T[1]/b[1],R=(c.right-c.left)/2/x,C=(c.bottom-c.top)/2/S,L=[(A[0]+E[0])/2+R,(A[1]+E[1])/2+C],O=y.unproject(L),M=y.zoom+Math.log2(Math.abs(Math.min(x,S)));return{longitude:O[0],latitude:O[1],zoom:Math.min(M,s)}}var mt=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,i=n.height,o=n.latitude,a=void 0===o?0:o,s=n.longitude,l=void 0===s?0:s,c=n.zoom,u=void 0===c?0:c,h=n.pitch,d=void 0===h?0:h,f=n.bearing,p=void 0===f?0:f,g=n.altitude,m=void 0===g?1.5:g,_=n.nearZMultiplier,v=n.farZMultiplier;(0,qe.A)(this,t),r=r||1,i=i||1;var y=ut(u);m=Math.max(.75,m);var E=ht([l,a],y);E[2]=0;var A=function(e){var t=e.width,n=e.height,r=e.pitch,i=function(e){var t=e.width,n=e.height,r=e.altitude,i=void 0===r?1.5:r,o=e.pitch,a=e.nearZMultiplier,s=void 0===a?1:a,l=e.farZMultiplier,c=void 0===l?1:l,u=(void 0===o?0:o)*st,h=Math.atan(.5/i),d=Math.sin(h)*i/Math.sin(Math.PI/2-u-h),f=Math.cos(Math.PI/2-u)*d+i;return{fov:2*Math.atan(n/2/i),aspect:t/n,focalDistance:i,near:s,far:f*c}}({width:t,height:n,altitude:e.altitude,pitch:r,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),o=i.fov,a=i.aspect,s=i.near,l=i.far;return z.fN([],o,a,s,l)}({width:r,height:i,pitch:d,bearing:p,altitude:m,nearZMultiplier:_||1/i,farZMultiplier:v||1.01}),b=function(e){var t=e.height,n=e.pitch,r=e.bearing,i=e.altitude,o=e.center,a=void 0===o?null:o,s=e.flipY,l=void 0!==s&&s,c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return z.Tl(c,c,[0,0,-i]),z.hs(c,c,[1,1,1/t]),z.eL(c,c,-n*st),z.Qr(c,c,r*st),l&&z.hs(c,c,[1,-1,1]),a&&z.Tl(c,c,Ye.ze([],a)),c}({height:i,center:E,pitch:d,bearing:p,altitude:m,flipY:!0});return(e=(0,Qe.A)(this,(0,$e.A)(t).call(this,{width:r,height:i,viewMatrix:b,projectionMatrix:A}))).latitude=a,e.longitude=l,e.zoom=u,e.pitch=d,e.bearing=p,e.altitude=m,e.scale=y,e.center=E,e.pixelsPerMeter=function(e){var t=e.latitude,n=e.longitude,r=e.zoom,i=e.scale,o=e.highPrecision,a=void 0!==o&&o;i=void 0!==i?i:ut(r),it(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(i));var s={},l=512*i,c=Math.cos(t*st),u=l/360,h=u/c,d=l/ct/c;if(s.pixelsPerMeter=[d,-d,d],s.metersPerPixel=[1/d,-1/d,1/d],s.pixelsPerDegree=[u,-h,d],s.degreesPerPixel=[1/u,-1/h,1/d],a){var f=st*Math.tan(t*st)/c,p=u*f/2,g=l/ct*f,m=g/h*d;s.pixelsPerDegree2=[0,-p,g],s.pixelsPerMeter2=[m,0,m]}return s}((0,et.A)((0,et.A)(e))).pixelsPerMeter[2],Object.freeze((0,et.A)((0,et.A)(e))),e}return(0,Je.A)(t,e),(0,Ke.A)(t,[{key:"projectFlat",value:function(e){return ht(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale)}},{key:"unprojectFlat",value:function(e){return dt(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=ft(e.pos,this.pixelUnprojectionMatrix),r=ht(t,this.scale),i=rt.WQ([],r,rt.ze([],n));return dt(rt.WQ([],this.center,i),this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,i=this.height,o=gt(Object.assign({width:r,height:i,bounds:e},n));return new t({width:r,height:i,longitude:o.longitude,latitude:o.latitude,zoom:o.zoom})}}]),t}(function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width,r=t.height,i=t.viewMatrix,o=void 0===i?pt:i,a=t.projectionMatrix,s=void 0===a?pt:a;(0,qe.A)(this,e),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=s;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];z.lw(l,l,this.projectionMatrix),z.lw(l,l,this.viewMatrix),this.viewProjectionMatrix=l;var c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];z.hs(c,c,[this.width/2,-this.height/2,1]),z.Tl(c,c,[1,-1,0]),z.lw(c,c,this.viewProjectionMatrix);var u=z.B8([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],c);if(!u)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=c,this.pixelUnprojectionMatrix=u,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(0,Ke.A)(e,[{key:"equals",value:function(t){return t instanceof e&&t.width===this.width&&t.height===this.height&&z.aI(t.projectionMatrix,this.projectionMatrix)&&z.aI(t.viewMatrix,this.viewMatrix)}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,r=function(e,t){var n=(0,tt.A)(e,3),r=n[0],i=n[1],o=n[2],a=void 0===o?0:o;return it(Number.isFinite(r)&&Number.isFinite(i)&&Number.isFinite(a)),nt(t,[r,i,a,1])}(this.projectPosition(e),this.pixelProjectionMatrix),i=(0,tt.A)(r,2),o=i[0],a=i[1],s=n?a:this.height-a;return 2===e.length?[o,s]:[o,s,r[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,r=void 0===n||n,i=t.targetZ,o=(0,tt.A)(e,3),a=o[0],s=o[1],l=o[2],c=r?s:this.height-s,u=i&&i*this.pixelsPerMeter,h=ft([a,c,l],this.pixelUnprojectionMatrix,u),d=this.unprojectPosition(h),f=(0,tt.A)(d,3),p=f[0],g=f[1],m=f[2];return Number.isFinite(l)?[p,g,m]:Number.isFinite(i)?[p,g,i]:[p,g]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=(0,tt.A)(t,2);return[n[0],n[1],(e[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=(0,tt.A)(t,2);return[n[0],n[1],(e[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(e){return arguments.length>1&&void 0!==arguments[1]||this.scale,e}},{key:"unprojectFlat",value:function(e){return arguments.length>1&&void 0!==arguments[1]||this.scale,e}}]),e}());class _t{constructor(){(0,i.A)(this,"viewport",new mt)}syncWithMapCamera(e){const{center:t,zoom:n,pitch:i,bearing:o,viewportHeight:a,viewportWidth:s}=e,l={width:this.viewport.width,height:this.viewport.height,longitude:this.viewport.center[0],latitude:this.viewport.center[1],zoom:this.viewport.zoom,pitch:this.viewport.pitch,bearing:this.viewport.bearing};this.viewport=new mt((0,r.A)((0,r.A)({},l),{},{width:s,height:a,longitude:t&&t[0],latitude:t&&t[1],zoom:n,pitch:i,bearing:o}))}getZoom(){return this.viewport.zoom}getZoomScale(){return Math.pow(2,this.getZoom())}getCenter(){return[this.viewport.longitude,this.viewport.latitude]}getProjectionMatrix(){return this.viewport.projectionMatrix}getModelMatrix(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}getViewMatrix(){return this.viewport.viewMatrix}getViewMatrixUncentered(){return this.viewport.viewMatrixUncentered}getViewProjectionMatrix(){return this.viewport.viewProjectionMatrix}getViewProjectionMatrixUncentered(){return this.viewport.viewProjectionMatrix}getFocalDistance(){return 1}projectFlat(e,t){return this.viewport.projectFlat(e,t)}}let vt=function(e){return e.GAODE="GAODE",e.MAPBOX="MAPBOX",e.DEFAULT="DEFAUlTMAP",e.SIMPLE="SIMPLE",e.GLOBEL="GLOBEL",e}({});var yt=n(74630),Et=n(28985);class At{constructor(e){(0,i.A)(this,"size",1e4),this.size=e||1e4}setSize(e){this.size=e}getSize(){return[this.size,this.size]}mercatorXfromLng(e){return(180+e)/360*this.size}mercatorYfromLat(e){return(1-(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360)*this.size}lngFromMercatorX(e){return e/this.size*360-180}latFromMercatorY(e){const t=180-360*(1-e/this.size);return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}project(e){return[this.mercatorXfromLng(e[0]),this.mercatorYfromLat(e[1])]}unproject(e){return[this.lngFromMercatorX(e[0]),this.latFromMercatorY(e[1])]}}const bt={light:"mapbox://styles/zcxduo/ck2ypyb1r3q9o1co1766dex29",dark:"mapbox://styles/zcxduo/ck241p6413s0b1cpayzldv7x7",normal:"mapbox://styles/mapbox/streets-v11",blank:{version:8,sources:{},layers:[{id:"background",type:"background",layout:{visibility:"none"}}]}},Tt={mapmove:"move",camerachange:"move",zoomchange:"zoom",dragging:"drag"};class xt{constructor(e){(0,i.A)(this,"version","DEFAUlTMAP"),(0,i.A)(this,"map",void 0),(0,i.A)(this,"simpleMapCoord",new At),(0,i.A)(this,"bgColor","rgba(0.0, 0.0, 0.0, 0.0)"),(0,i.A)(this,"config",void 0),(0,i.A)(this,"configService",void 0),(0,i.A)(this,"coordinateSystemService",void 0),(0,i.A)(this,"eventEmitter",void 0),(0,i.A)(this,"markerContainer",void 0),(0,i.A)(this,"cameraChangedCallback",void 0),(0,i.A)(this,"$mapContainer",void 0),(0,i.A)(this,"handleCameraChanged",(e=>{const{lat:t,lng:n}=this.map.getCenter();this.emit("mapchange"),this.viewport.syncWithMapCamera({bearing:this.map.getBearing(),center:[n,t],viewportHeight:this.map.transform.height,pitch:this.map.getPitch(),viewportWidth:this.map.transform.width,zoom:this.map.getZoom(),cameraHeight:0}),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport)})),this.config=e.mapConfig,this.configService=e.globalConfigService,this.coordinateSystemService=e.coordinateSystemService,this.eventEmitter=new Et.EventEmitter}setBgColor(e){this.bgColor=e}addMarkerContainer(){const e=this.map.getCanvasContainer();this.markerContainer=We.dv.create("div","l7-marker-container",e),this.markerContainer.setAttribute("tabindex","-1")}getMarkerContainer(){return this.markerContainer}getOverlayContainer(){}getCanvasOverlays(){}on(e,t){-1!==yt.SA.indexOf(e)?this.eventEmitter.on(e,t):this.map.on(Tt[e]||e,t)}off(e,t){this.map.off(Tt[e]||e,t),this.eventEmitter.off(e,t)}getContainer(){return this.map.getContainer()}getMapCanvasContainer(){return this.map.getCanvasContainer()}getSize(){if("SIMPLE"===this.version)return this.simpleMapCoord.getSize();const e=this.map.transform;return[e.width,e.height]}getType(){return"default"}getZoom(){return this.map.getZoom()}setZoom(e){return this.map.setZoom(e)}getCenter(){return this.map.getCenter()}setCenter(e){this.map.setCenter(e)}getPitch(){return this.map.getPitch()}getRotation(){return this.map.getBearing()}getBounds(){return this.map.getBounds().toArray()}getMinZoom(){return this.map.getMinZoom()}getMaxZoom(){return this.map.getMaxZoom()}setRotation(e){this.map.setBearing(e)}zoomIn(e,t){this.map.zoomIn(e,t)}zoomOut(e,t){this.map.zoomOut(e,t)}setPitch(e){return this.map.setPitch(e)}panTo(e){this.map.panTo(e)}panBy(e=0,t=0){this.map.panBy([e,t])}fitBounds(e,t){this.map.fitBounds(e,t)}setMaxZoom(e){this.map.setMaxZoom(e)}setMinZoom(e){this.map.setMinZoom(e)}setMapStatus(e){!0===e.doubleClickZoom&&this.map.doubleClickZoom.enable(),!1===e.doubleClickZoom&&this.map.doubleClickZoom.disable(),!1===e.dragEnable&&this.map.dragPan.disable(),!0===e.dragEnable&&this.map.dragPan.enable(),!1===e.rotateEnable&&this.map.dragRotate.disable(),!0===e.dragEnable&&this.map.dragRotate.enable(),!1===e.keyboardEnable&&this.map.keyboard.disable(),!0===e.keyboardEnable&&this.map.keyboard.enable(),!1===e.zoomEnable&&this.map.scrollZoom.disable(),!0===e.zoomEnable&&this.map.scrollZoom.enable()}setZoomAndCenter(e,t){this.map.flyTo({zoom:e,center:t})}setMapStyle(e){var t;null===(t=this.map)||void 0===t||t.setStyle(this.getMapStyleValue(e))}meterToCoord(e,t){return 1}pixelToLngLat(e){return this.map.unproject(e)}lngLatToPixel(e){return this.map.project(e)}containerToLngLat(e){return this.map.unproject(e)}lngLatToContainer(e){return this.map.project(e)}getMapStyle(){try{var e;const t=null!==(e=this.map.getStyle().sprite)&&void 0!==e?e:"";return/^mapbox:\/\/sprites\/zcxduo\/\w+\/\w+$/.test(t)?null==t?void 0:t.replace(/\/\w+$/,"").replace(/sprites/,"styles"):t}catch(e){return""}}getMapStyleConfig(){return bt}getMapStyleValue(e){var t;return null!==(t=this.getMapStyleConfig()[e])&&void 0!==t?t:e}destroy(){this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}emit(e,...t){this.eventEmitter.emit(e,...t)}once(e,...t){this.eventEmitter.once(e,...t)}getMapContainer(){return this.$mapContainer}exportMap(e){var t;const n=null===(t=this.map)||void 0===t?void 0:t.getCanvas();return"jpg"===e?null==n?void 0:n.toDataURL("image/jpeg"):null==n?void 0:n.toDataURL("image/png")}onCameraChanged(e){this.cameraChangedCallback=e}creatMapContainer(e){let t=e;return"string"==typeof e&&(t=document.getElementById(e)),t}updateView(e){this.emit("mapchange"),this.viewport.syncWithMapCamera({bearing:e.bearing,center:e.center,viewportHeight:e.viewportHeight,pitch:e.pitch,viewportWidth:e.viewportWidth,zoom:e.zoom,cameraHeight:0}),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport)}updateCoordinateSystemService(){const{offsetCoordinate:e=!0}=this.config;this.viewport.getZoom()>12&&e?this.coordinateSystemService.setCoordinateSystem(yt.gq.LNGLAT_OFFSET):this.coordinateSystemService.setCoordinateSystem(yt.gq.LNGLAT)}}const St=["id","style","rotation","mapInstance","version","mapSize","interactive"];class Rt extends xt{constructor(...e){super(...e),(0,i.A)(this,"version",vt.DEFAULT),(0,i.A)(this,"viewport",void 0)}lngLatToCoord(e,t={x:0,y:0,z:0}){const{x:n,y:r}=this.lngLatToMercator(e,0);return[n-t.x,r-t.y]}lngLatToMercator(e,t){const{x:n=0,y:r=0,z:i=0}=C.fromLngLat(e,t);return{x:n,y:r,z:i}}getModelMatrix(e,t,n,r=[1,1,1],i={x:0,y:0,z:0}){const o=C.fromLngLat(e,t),a=o.meterInMercatorCoordinateUnits(),s=z.vt();return z.Tl(s,s,Ye.fA(o.x-i.x,o.y-i.y,o.z||0-i.z)),z.hs(s,s,Ye.fA(a*r[0],-a*r[1],a*r[2])),z.eL(s,s,n[0]),z.Z8(s,s,n[1]),z.Qr(s,s,n[2]),s}init(){var e=this;return(0,s.A)((function*(){const t=e.config,{id:n="map",style:i="light",rotation:o=0,mapInstance:s,version:l="DEFAULTMAP",mapSize:c=1e4,interactive:u=!0}=t,h=(0,a.A)(t,St);e.viewport=new _t,e.version=l,e.simpleMapCoord.setSize(c),"SIMPLE"===l&&h.center&&(h.center=e.simpleMapCoord.unproject(h.center)),s?(e.map=s,e.$mapContainer=e.map.getContainer()):(e.$mapContainer=e.creatMapContainer(n),e.map=new Ze((0,r.A)({container:e.$mapContainer,bearing:o},h))),e.map.on("load",(()=>{e.handleCameraChanged()})),u&&e.map.on("move",e.handleCameraChanged),setTimeout((()=>{e.handleCameraChanged()}),100),e.handleCameraChanged()}))()}creatMapContainer(e){let t=e;"string"==typeof e&&(t=document.getElementById(e));const n=document.createElement("div");return n.style.cssText+="\n position: absolute;\n top: 0;\n height: 100%;\n width: 100%;\n ",t.appendChild(n),n}exportMap(e){return""}setMapStyle(e){}getCanvasOverlays(){return this.getContainer()}}class Ct extends o{getServiceConstructor(){return Rt}}},26137:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},26919:(e,t,n)=>{"use strict";var r=n(27835);function i(e,t,n,r,i){this.properties={},this.extent=n,this.type=0,this._pbf=e,this._geometry=-1,this._keys=r,this._values=i,e.readFields(o,this,t)}function o(e,t,n){1==e?t.id=n.readVarint():2==e?function(e,t){for(var n=e.readVarint()+e.pos;e.pos<n;){var r=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[r]=i}}(n,t):3==e?t.type=n.readVarint():4==e&&(t._geometry=n.pos)}function a(e){for(var t,n,r=0,i=0,o=e.length,a=o-1;i<o;a=i++)t=e[i],r+=((n=e[a]).x-t.x)*(t.y+n.y);return r}e.exports=i,i.types=["Unknown","Point","LineString","Polygon"],i.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,n=e.readVarint()+e.pos,i=1,o=0,a=0,s=0,l=[];e.pos<n;){if(o<=0){var c=e.readVarint();i=7&c,o=c>>3}if(o--,1===i||2===i)a+=e.readSVarint(),s+=e.readSVarint(),1===i&&(t&&l.push(t),t=[]),t.push(new r(a,s));else{if(7!==i)throw new Error("unknown command "+i);t&&t.push(t[0].clone())}}return t&&l.push(t),l},i.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,n=1,r=0,i=0,o=0,a=1/0,s=-1/0,l=1/0,c=-1/0;e.pos<t;){if(r<=0){var u=e.readVarint();n=7&u,r=u>>3}if(r--,1===n||2===n)(i+=e.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=e.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==n)throw new Error("unknown command "+n)}return[a,l,s,c]},i.prototype.toGeoJSON=function(e,t,n){var r,o,s=this.extent*Math.pow(2,n),l=this.extent*e,c=this.extent*t,u=this.loadGeometry(),h=i.types[this.type];function d(e){for(var t=0;t<e.length;t++){var n=e[t],r=180-360*(n.y+c)/s;e[t]=[360*(n.x+l)/s-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var f=[];for(r=0;r<u.length;r++)f[r]=u[r][0];d(u=f);break;case 2:for(r=0;r<u.length;r++)d(u[r]);break;case 3:for(u=function(e){var t=e.length;if(t<=1)return[e];for(var n,r,i=[],o=0;o<t;o++){var s=a(e[o]);0!==s&&(void 0===r&&(r=s<0),r===s<0?(n&&i.push(n),n=[e[o]]):n.push(e[o]))}return n&&i.push(n),i}(u),r=0;r<u.length;r++)for(o=0;o<u[r].length;o++)d(u[r][o])}1===u.length?u=u[0]:h="Multi"+h;var p={type:"Feature",geometry:{type:h,coordinates:u},properties:this.properties};return"id"in this&&(p.id=this.id),p}},27835:e=>{"use strict";function t(e,t){this.x=e,this.y=t}e.exports=t,t.prototype={clone:function(){return new t(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=n,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=t*this.x-n*this.y,i=n*this.x+t*this.y;return this.x=r,this.y=i,this},_rotateAround:function(e,t){var n=Math.cos(e),r=Math.sin(e),i=t.x+n*(this.x-t.x)-r*(this.y-t.y),o=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},t.convert=function(e){return e instanceof t?e:Array.isArray(e)?new t(e[0],e[1]):e}},28486:(e,t,n)=>{var r=n(33103),i=n(19770),o=n(89413),a=n(64512),s=n(19270),l=n(87379),c=n(64066),u="[object Map]",h="[object Promise]",d="[object Set]",f="[object WeakMap]",p="[object DataView]",g=c(r),m=c(i),_=c(o),v=c(a),y=c(s),E=l;(r&&E(new r(new ArrayBuffer(1)))!=p||i&&E(new i)!=u||o&&E(o.resolve())!=h||a&&E(new a)!=d||s&&E(new s)!=f)&&(E=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case g:return p;case m:return u;case _:return h;case v:return d;case y:return f}return t}),e.exports=E},28931:(e,t,n)=>{var r=n(73501);e.exports=function(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:r(e,t,n)}},28985:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,i),!0;case 5:return u.fn.call(u.context,t,r,i,o),!0;case 6:return u.fn.call(u.context,t,r,i,o,a),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,i);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||i&&!s[l].once||r&&s[l].context!==r)&&c.push(s[l]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s},29005:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},30125:(e,t,n)=>{var r=n(39032),i=n(25288);e.exports=function(e,t){return e&&r(t,i(t),e)}},30414:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(11369);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(0,r.A)(i.key),i)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},31182:(e,t,n)=>{var r=n(80393),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,c=r(e),u=c.length;if(u!=r(t).length&&!l)return!1;for(var h=u;h--;){var d=c[h];if(!(l?d in t:i.call(t,d)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=l;++h<u;){var _=e[d=c[h]],v=t[d];if(o)var y=l?o(v,_,d,t,e,s):o(_,v,d,e,t,s);if(!(void 0===y?_===v||a(_,v,n,o,s):y)){g=!1;break}m||(m="constructor"==d)}if(g&&!m){var E=e.constructor,A=t.constructor;E==A||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof A&&A instanceof A||(g=!1)}return s.delete(e),s.delete(t),g}},31623:(e,t,n)=>{var r=n(78942).Uint8Array;e.exports=r},33103:(e,t,n)=>{var r=n(94715)(n(78942),"DataView");e.exports=r},33270:(e,t,n)=>{"use strict";n.d(t,{Lr:()=>l,N4:()=>o,cJ:()=>u,g5:()=>c,n1:()=>a,tR:()=>h,wi:()=>s});var r=6371008.8,i={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*r,kilometers:6371.0088,kilometres:6371.0088,meters:r,metres:r,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:r/1852,radians:1,yards:6967335.223679999};function o(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function a(e,t,n){void 0===n&&(n={});for(var r=0,i=e;r<i.length;r++){var a=i[r];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw new Error("First and last Position are not equivalent.")}return o({type:"Polygon",coordinates:e},t,n)}function s(e,t,n){if(void 0===n&&(n={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return o({type:"LineString",coordinates:e},t,n)}function l(e,t){void 0===t&&(t={});var n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}function c(e,t,n){return void 0===n&&(n={}),o({type:"MultiPolygon",coordinates:e},t,n)}function u(e,t){void 0===t&&(t="kilometers");var n=i[t];if(!n)throw new Error(t+" units is invalid");return e*n}function h(e){return e%360*Math.PI/180}},33787:e=>{"use strict";var t="_erd";function n(e){return e[t]}e.exports={initState:function(e){return e[t]={},n(e)},getState:n,cleanState:function(e){delete e[t]}}},33934:(e,t,n)=>{var r=n(23212),i=n(36465),o=n(65568);e.exports=function(e,t,n,a,s,l){var c=1&n,u=e.length,h=t.length;if(u!=h&&!(c&&h>u))return!1;var d=l.get(e),f=l.get(t);if(d&&f)return d==t&&f==e;var p=-1,g=!0,m=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++p<u;){var _=e[p],v=t[p];if(a)var y=c?a(v,_,p,t,e,l):a(_,v,p,e,t,l);if(void 0!==y){if(y)continue;g=!1;break}if(m){if(!i(t,(function(e,t){if(!o(m,t)&&(_===e||s(_,e,n,a,l)))return m.push(t)}))){g=!1;break}}else if(_!==v&&!s(_,v,n,a,l)){g=!1;break}}return l.delete(e),l.delete(t),g}},34162:e=>{e.exports=function(e){return this.__data__.get(e)}},34772:e=>{e.exports=function(){return!1}},35379:e=>{"use strict";(e.exports={}).forEach=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n]);if(r)return r}}},35461:(e,t,n)=>{"use strict";function r(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function i(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function a(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}n.d(t,{FU:()=>H,Jk:()=>F,Sq:()=>X,jJ:()=>V,nx:()=>W});var l,c,u={exports:{}},h={exports:{}},d={exports:{}};l=d,c=d.exports,Object.defineProperty(c,"__esModule",{value:!0}),c.default=function(e){return e&&"number"==typeof e.length&&e.length>=0&&e.length%1==0},l.exports=c.default;var f={},p={exports:{}},g={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=t.pop();return e.call(this,t,r)}},e.exports=t.default}(g,g.exports);var m={};Object.defineProperty(m,"__esModule",{value:!0}),m.fallback=A,m.wrap=b;var _,v=m.hasQueueMicrotask="function"==typeof queueMicrotask&&queueMicrotask,y=m.hasSetImmediate="function"==typeof setImmediate&&setImmediate,E=m.hasNextTick="object"==typeof process&&"function"==typeof process.nextTick;function A(e){setTimeout(e,0)}function b(e){return function(t){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return e((function(){return t.apply(void 0,n)}))}}_=v?queueMicrotask:y?setImmediate:E?process.nextTick:A,m.default=b(_),function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.isAsync)(e)?function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=t.pop();return a(e.apply(this,t),r)}:(0,n.default)((function(t,n){var r;try{r=e.apply(this,t)}catch(e){return n(e)}if(r&&"function"==typeof r.then)return a(r,n);n(null,r)}))};var n=o(g.exports),r=o(m),i=f;function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){return e.then((function(e){s(t,null,e)}),(function(e){s(t,e&&e.message?e:new Error(e))}))}function s(e,t,n){try{e(t,n)}catch(e){(0,r.default)((function(e){throw e}),e)}}e.exports=t.default}(p,p.exports),Object.defineProperty(f,"__esModule",{value:!0}),f.isAsyncIterable=f.isAsyncGenerator=f.isAsync=void 0;var T,x=(T=p.exports)&&T.__esModule?T:{default:T};function S(e){return"AsyncFunction"===e[Symbol.toStringTag]}f.default=function(e){if("function"!=typeof e)throw new Error("expected a function");return S(e)?(0,x.default)(e):e},f.isAsync=S,f.isAsyncGenerator=function(e){return"AsyncGenerator"===e[Symbol.toStringTag]},f.isAsyncIterable=function(e){return"function"==typeof e[Symbol.asyncIterator]};var R={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(void 0===t&&(t=e.length),!t)throw new Error("arity is undefined");return function(){for(var n=this,r=[],i=arguments.length;i--;)r[i]=arguments[i];return"function"==typeof r[t-1]?e.apply(this,r):new Promise((function(i,o){r[t-1]=function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(e)return o(e);i(t.length>1?t:t[0])},e.apply(n,r)}))}},e.exports=t.default}(R,R.exports),function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=o(d.exports),r=o(f),i=o(R.exports);function o(e){return e&&e.__esModule?e:{default:e}}t.default=(0,i.default)((function(e,t,i){var o=(0,n.default)(t)?[]:{};e(t,(function(e,t,n){(0,r.default)(e)((function(e){for(var r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];r.length<2&&(r=r[0]),o[t]=r,n(e)}))}),(function(e){return i(e,o)}))}),3),e.exports=t.default}(h,h.exports);var C={exports:{}},L={exports:{}},O={exports:{}},M={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];if(null!==e){var r=e;e=null,r.apply(this,t)}}return Object.assign(t,e),t},e.exports=t.default}(M,M.exports);var I={exports:{}},w={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()},e.exports=t.default}(w,w.exports),function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if((0,n.default)(e))return function(e){var t=-1,n=e.length;return function(){return++t<n?{value:e[t],key:t}:null}}(e);var t=(0,r.default)(e);return t?function(e){var t=-1;return function(){var n=e.next();return n.done?null:(t++,{value:n.value,key:t})}}(t):function(e){var t=e?Object.keys(e):[],n=-1,r=t.length;return function i(){var o=t[++n];return"__proto__"===o?i():n<r?{value:e[o],key:o}:null}}(e)};var n=i(d.exports),r=i(w.exports);function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(I,I.exports);var P={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];if(null===e)throw new Error("Callback was already called.");var r=e;e=null,r.apply(this,t)}},e.exports=t.default}(P,P.exports);var N={exports:{}},D={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default}(D,D.exports),function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,i){var o=!1,a=!1,s=!1,l=0,c=0;function u(){l>=t||s||o||(s=!0,e.next().then((function(e){var t=e.value,n=e.done;if(!a&&!o){if(s=!1,n)return o=!0,void(l<=0&&i(null));l++,r(t,c,h),c++,u()}})).catch(d))}function h(e,t){if(l-=1,!a)return e?d(e):!1===e?(o=!0,void(a=!0)):t===n.default||o&&l<=0?(o=!0,i(null)):void u()}function d(e){a||(s=!1,o=!0,i(e))}u()};var n=function(e){return e&&e.__esModule?e:{default:e}}(D.exports);e.exports=t.default}(N,N.exports),function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=l(M.exports),r=l(I.exports),i=l(P.exports),o=f,a=l(N.exports),s=l(D.exports);function l(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){return function(t,l,c){if(c=(0,n.default)(c),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return c(null);if((0,o.isAsyncGenerator)(t))return(0,a.default)(t,e,l,c);if((0,o.isAsyncIterable)(t))return(0,a.default)(t[Symbol.asyncIterator](),e,l,c);var u=(0,r.default)(t),h=!1,d=!1,f=0,p=!1;function g(e,t){if(!d)if(f-=1,e)h=!0,c(e);else if(!1===e)h=!0,d=!0;else{if(t===s.default||h&&f<=0)return h=!0,c(null);p||m()}}function m(){for(p=!0;f<e&&!h;){var t=u();if(null===t)return h=!0,void(f<=0&&c(null));f+=1,l(t.value,t.key,(0,i.default)(g))}p=!1}m()}},e.exports=t.default}(O,O.exports),function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=o(O.exports),r=o(f),i=o(R.exports);function o(e){return e&&e.__esModule?e:{default:e}}t.default=(0,i.default)((function(e,t,i,o){return(0,n.default)(t)(e,(0,r.default)(i),o)}),4),e.exports=t.default}(L,L.exports),function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=i(L.exports),r=i(R.exports);function i(e){return e&&e.__esModule?e:{default:e}}t.default=(0,r.default)((function(e,t,r){return(0,n.default)(e,1,t,r)}),3),e.exports=t.default}(C,C.exports),function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,n.default)(r.default,e,t)};var n=i(h.exports),r=i(C.exports);function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(u,u.exports);var B=s(u.exports),F=function(){function e(){this.args=[],this.tasks=[]}return e.prototype.call=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];return this.args=t,B(this.tasks)},e.prototype.tap=function(e,t){var n=this;this.tasks.push((function(r){t.apply(void 0,a([],o(n.args),!1)),r(null,e)}))},e}(),U={exports:{}},k={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=c(d.exports),r=c(D.exports),i=c(L.exports),o=c(M.exports),a=c(P.exports),s=c(f),l=c(R.exports);function c(e){return e&&e.__esModule?e:{default:e}}function u(e,t,n){n=(0,o.default)(n);var i=0,s=0,l=e.length,c=!1;function u(e,t){!1===e&&(c=!0),!0!==c&&(e?n(e):++s!==l&&t!==r.default||n(null))}for(0===l&&n(null);i<l;i++)t(e[i],i,(0,a.default)(u))}function h(e,t,n){return(0,i.default)(e,1/0,t,n)}t.default=(0,l.default)((function(e,t,r){return((0,n.default)(e)?u:h)(e,(0,s.default)(t),r)}),3),e.exports=t.default}(k,k.exports),function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,r.default)(n.default,e,t)};var n=i(k.exports),r=i(h.exports);function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(U,U.exports);var G=s(U.exports),z=(function(){function e(){this.tasks=[]}e.prototype.promise=function(){return G(this.tasks)},e.prototype.tapPromise=function(e,t){var n=this;this.tasks.push((function(o){return r(n,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,t()];case 1:return n.sent(),o(null,e),[2]}}))}))}))}}(),{exports:{}});!function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=a(M.exports),r=a(P.exports),i=a(f),o=a(R.exports);function a(e){return e&&e.__esModule?e:{default:e}}t.default=(0,o.default)((function(e,t){if(t=(0,n.default)(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var o=0;function a(t){(0,i.default)(e[o++]).apply(void 0,t.concat([(0,r.default)(s)]))}function s(n){for(var r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];if(!1!==n)return n||o===e.length?t.apply(void 0,[n].concat(r)):void a(r)}a([])})),e.exports=t.default}(z,z.exports);var j=s(z.exports),V=(function(){function e(){this.tasks=[]}e.prototype.call=function(){return j(this.tasks)},e.prototype.tap=function(e,t){0===this.tasks.length?this.tasks.push((function(e){var n=t();e(!!n&&null,n)})):this.tasks.push((function(n,r){r(!!t.apply(void 0,a([],o(n),!1))&&null,e)}))}}(),function(){function e(){this.tasks=[]}return e.prototype.call=function(){return B(this.tasks)},e.prototype.tap=function(e,t){this.tasks.push((function(n){n(t(),e)}))},e}()),H=function(){function e(){this.args=[],this.tasks=[]}return e.prototype.promise=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];return this.args=t,B(this.tasks)},e.prototype.tapPromise=function(e,t){var n=this;this.tasks.push((function(s){return r(n,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,t.apply(void 0,a([],o(this.args),!1))];case 1:return n.sent(),s(null,e),[2]}}))}))}))},e}(),W=function(){function e(){this.args=[],this.tasks=[]}return e.prototype.promise=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];return this.args=t,B(this.tasks)},e.prototype.tapPromise=function(e,t){var n=this;this.tasks.push((function(s){return r(n,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,t.apply(void 0,a([],o(this.args),!1))];case 1:return n=r.sent(),s(n,e),[2]}}))}))}))},e}(),X=function(){function e(){this.tasks=[]}return e.prototype.promise=function(){return j(this.tasks)},e.prototype.tapPromise=function(e,t){0===this.tasks.length?this.tasks.push((function(e){t().then((function(t){e(null,t)}))})):this.tasks.push((function(e,n){t(e).then((function(e){n(null,e)}))}))},e}()},35636:(e,t,n)=>{var r=n(86596)();e.exports=r},36208:(e,t,n)=>{var r=n(64512),i=n(79071),o=n(49828),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},36465:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},36529:(e,t,n)=>{var r=n(93655),i=n(65387);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},37250:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},37681:(e,t,n)=>{var r=n(80777),i=n(49460),o=n(2306),a=o&&o.isMap,s=a?i(a):r;e.exports=s},37930:(e,t,n)=>{var r=n(39032),i=n(81211);e.exports=function(e,t){return e&&r(t,i(t),e)}},38008:(e,t,n)=>{"use strict";var r=n(26919);function i(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(o,this,t),this.length=this._features.length}function o(e,t,n){15===e?t.version=n.readVarint():1===e?t.name=n.readString():5===e?t.extent=n.readVarint():2===e?t._features.push(n.pos):3===e?t._keys.push(n.readString()):4===e&&t._values.push(function(e){for(var t=null,n=e.readVarint()+e.pos;e.pos<n;){var r=e.readVarint()>>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}return t}(n))}e.exports=i,i.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new r(this._pbf,t,this.extent,this._keys,this._values)}},38250:e=>{e.exports=function(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}},38285:(e,t,n)=>{var r=n(95243),i=0;e.exports=function(e){var t=++i;return r(e)+t}},38286:(e,t,n)=>{"use strict";e.exports=i;var r=n(39318);function i(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var o=4294967296,a=1/o,s="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");function l(e){return e.type===i.Bytes?e.readVarint()+e.pos:e.pos+1}function c(e,t,n){return n?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function u(e,t,n){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=e;i--)n.buf[i+r]=n.buf[i]}function h(e,t){for(var n=0;n<e.length;n++)t.writeVarint(e[n])}function d(e,t){for(var n=0;n<e.length;n++)t.writeSVarint(e[n])}function f(e,t){for(var n=0;n<e.length;n++)t.writeFloat(e[n])}function p(e,t){for(var n=0;n<e.length;n++)t.writeDouble(e[n])}function g(e,t){for(var n=0;n<e.length;n++)t.writeBoolean(e[n])}function m(e,t){for(var n=0;n<e.length;n++)t.writeFixed32(e[n])}function _(e,t){for(var n=0;n<e.length;n++)t.writeSFixed32(e[n])}function v(e,t){for(var n=0;n<e.length;n++)t.writeFixed64(e[n])}function y(e,t){for(var n=0;n<e.length;n++)t.writeSFixed64(e[n])}function E(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function A(e,t,n){e[n]=t,e[n+1]=t>>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function b(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(e,t,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,e(i,t,this),this.pos===o&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=E(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=b(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=E(this.buf,this.pos)+E(this.buf,this.pos+4)*o;return this.pos+=8,e},readSFixed64:function(){var e=E(this.buf,this.pos)+b(this.buf,this.pos+4)*o;return this.pos+=8,e},readFloat:function(){var e=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,n,r=this.buf;return t=127&(n=r[this.pos++]),n<128?t:(t|=(127&(n=r[this.pos++]))<<7,n<128?t:(t|=(127&(n=r[this.pos++]))<<14,n<128?t:(t|=(127&(n=r[this.pos++]))<<21,n<128?t:function(e,t,n){var r,i,o=n.buf;if(r=(112&(i=o[n.pos++]))>>4,i<128)return c(e,r,t);if(r|=(127&(i=o[n.pos++]))<<3,i<128)return c(e,r,t);if(r|=(127&(i=o[n.pos++]))<<10,i<128)return c(e,r,t);if(r|=(127&(i=o[n.pos++]))<<17,i<128)return c(e,r,t);if(r|=(127&(i=o[n.pos++]))<<24,i<128)return c(e,r,t);if(r|=(1&(i=o[n.pos++]))<<31,i<128)return c(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(n=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&s?function(e,t,n){return s.decode(e.subarray(t,n))}(this.buf,t,e):function(e,t,n){for(var r="",i=t;i<n;){var o,a,s,l=e[i],c=null,u=l>239?4:l>223?3:l>191?2:1;if(i+u>n)break;1===u?l<128&&(c=l):2===u?128==(192&(o=e[i+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&((c=(15&l)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((c=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),i+=u}return r}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==i.Bytes)return e.push(this.readVarint(t));var n=l(this);for(e=e||[];this.pos<n;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==i.Bytes)return e.push(this.readSVarint());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==i.Bytes)return e.push(this.readBoolean());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==i.Bytes)return e.push(this.readFloat());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==i.Bytes)return e.push(this.readDouble());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==i.Bytes)return e.push(this.readFixed32());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed32());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==i.Bytes)return e.push(this.readFixed64());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed64());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===i.Varint)for(;this.buf[this.pos++]>127;);else if(t===i.Bytes)this.pos=this.readVarint()+this.pos;else if(t===i.Fixed32)this.pos+=4;else{if(t!==i.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var n=new Uint8Array(t);n.set(this.buf),this.buf=n,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),A(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),A(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),A(this.buf,-1&e,this.pos),A(this.buf,Math.floor(e*a),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),A(this.buf,-1&e,this.pos),A(this.buf,Math.floor(e*a),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(n=~(-e%4294967296))?n=n+1|0:(n=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,n){n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos]=127&e}(n,0,t),function(e,t){var n=(7&e)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,n){for(var r,i,o=0;o<t.length;o++){if((r=t.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):i=r;continue}if(r<56320){e[n++]=239,e[n++]=191,e[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(e[n++]=239,e[n++]=191,e[n++]=189,i=null);r<128?e[n++]=r:(r<2048?e[n++]=r>>6|192:(r<65536?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return n}(this.buf,e,this.pos);var n=this.pos-t;n>=128&&u(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeFloat:function(e){this.realloc(4),r.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),r.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n<t;n++)this.buf[this.pos++]=e[n]},writeRawMessage:function(e,t){this.pos++;var n=this.pos;e(t,this);var r=this.pos-n;r>=128&&u(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,n){this.writeTag(e,i.Bytes),this.writeRawMessage(t,n)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,h,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,d,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,g,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,f,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,p,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,m,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,_,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,v,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,y,t)},writeBytesField:function(e,t){this.writeTag(e,i.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,i.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,i.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,i.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,i.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,i.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,i.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,i.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,i.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,i.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}}},38546:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},39032:(e,t,n)=>{var r=n(3422),i=n(57073);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,l=t.length;++s<l;){var c=t[s],u=o?o(n[c],e[c],c,n,e):void 0;void 0===u&&(u=e[c]),a?i(n,c,u):r(n,c,u)}return n}},39095:(e,t,n)=>{"use strict";n.d(t,{B8:()=>s,D_:()=>a,Qr:()=>f,Tl:()=>c,Z8:()=>d,aI:()=>g,eL:()=>h,fA:()=>o,fN:()=>p,hs:()=>u,lw:()=>l,vt:()=>i});var r=n(23172);function i(){var e=new r.tb(16);return r.tb!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function o(e,t,n,i,o,a,s,l,c,u,h,d,f,p,g,m){var _=new r.tb(16);return _[0]=e,_[1]=t,_[2]=n,_[3]=i,_[4]=o,_[5]=a,_[6]=s,_[7]=l,_[8]=c,_[9]=u,_[10]=h,_[11]=d,_[12]=f,_[13]=p,_[14]=g,_[15]=m,_}function a(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function s(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],p=t[12],g=t[13],m=t[14],_=t[15],v=n*s-r*a,y=n*l-i*a,E=n*c-o*a,A=r*l-i*s,b=r*c-o*s,T=i*c-o*l,x=u*g-h*p,S=u*m-d*p,R=u*_-f*p,C=h*m-d*g,L=h*_-f*g,O=d*_-f*m,M=v*O-y*L+E*C+A*R-b*S+T*x;return M?(M=1/M,e[0]=(s*O-l*L+c*C)*M,e[1]=(i*L-r*O-o*C)*M,e[2]=(g*T-m*b+_*A)*M,e[3]=(d*b-h*T-f*A)*M,e[4]=(l*R-a*O-c*S)*M,e[5]=(n*O-i*R+o*S)*M,e[6]=(m*E-p*T-_*y)*M,e[7]=(u*T-d*E+f*y)*M,e[8]=(a*L-s*R+c*x)*M,e[9]=(r*R-n*L-o*x)*M,e[10]=(p*b-g*E+_*v)*M,e[11]=(h*E-u*b-f*v)*M,e[12]=(s*S-a*C-l*x)*M,e[13]=(n*C-r*S+i*x)*M,e[14]=(g*y-p*A-m*v)*M,e[15]=(u*A-h*y+d*v)*M,e):null}function l(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],g=t[12],m=t[13],_=t[14],v=t[15],y=n[0],E=n[1],A=n[2],b=n[3];return e[0]=y*r+E*s+A*h+b*g,e[1]=y*i+E*l+A*d+b*m,e[2]=y*o+E*c+A*f+b*_,e[3]=y*a+E*u+A*p+b*v,y=n[4],E=n[5],A=n[6],b=n[7],e[4]=y*r+E*s+A*h+b*g,e[5]=y*i+E*l+A*d+b*m,e[6]=y*o+E*c+A*f+b*_,e[7]=y*a+E*u+A*p+b*v,y=n[8],E=n[9],A=n[10],b=n[11],e[8]=y*r+E*s+A*h+b*g,e[9]=y*i+E*l+A*d+b*m,e[10]=y*o+E*c+A*f+b*_,e[11]=y*a+E*u+A*p+b*v,y=n[12],E=n[13],A=n[14],b=n[15],e[12]=y*r+E*s+A*h+b*g,e[13]=y*i+E*l+A*d+b*m,e[14]=y*o+E*c+A*f+b*_,e[15]=y*a+E*u+A*p+b*v,e}function c(e,t,n){var r,i,o,a,s,l,c,u,h,d,f,p,g=n[0],m=n[1],_=n[2];return t===e?(e[12]=t[0]*g+t[4]*m+t[8]*_+t[12],e[13]=t[1]*g+t[5]*m+t[9]*_+t[13],e[14]=t[2]*g+t[6]*m+t[10]*_+t[14],e[15]=t[3]*g+t[7]*m+t[11]*_+t[15]):(r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=d,e[10]=f,e[11]=p,e[12]=r*g+s*m+h*_+t[12],e[13]=i*g+l*m+d*_+t[13],e[14]=o*g+c*m+f*_+t[14],e[15]=a*g+u*m+p*_+t[15]),e}function u(e,t,n){var r=n[0],i=n[1],o=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function h(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[4],a=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+c*r,e[5]=a*i+u*r,e[6]=s*i+h*r,e[7]=l*i+d*r,e[8]=c*i-o*r,e[9]=u*i-a*r,e[10]=h*i-s*r,e[11]=d*i-l*r,e}function d(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-c*r,e[1]=a*i-u*r,e[2]=s*i-h*r,e[3]=l*i-d*r,e[8]=o*r+c*i,e[9]=a*r+u*i,e[10]=s*r+h*i,e[11]=l*r+d*i,e}function f(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],c=t[4],u=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+c*r,e[1]=a*i+u*r,e[2]=s*i+h*r,e[3]=l*i+d*r,e[4]=c*i-o*r,e[5]=u*i-a*r,e[6]=h*i-s*r,e[7]=d*i-l*r,e}var p=function(e,t,n,r,i){var o,a=1/Math.tan(t/2);return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(o=1/(r-i),e[10]=(i+r)*o,e[14]=2*i*r*o):(e[10]=-1,e[14]=-2*r),e};function g(e,t){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],_=e[14],v=e[15],y=t[0],E=t[1],A=t[2],b=t[3],T=t[4],x=t[5],S=t[6],R=t[7],C=t[8],L=t[9],O=t[10],M=t[11],I=t[12],w=t[13],P=t[14],N=t[15];return Math.abs(n-y)<=r.p8*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-E)<=r.p8*Math.max(1,Math.abs(i),Math.abs(E))&&Math.abs(o-A)<=r.p8*Math.max(1,Math.abs(o),Math.abs(A))&&Math.abs(a-b)<=r.p8*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(s-T)<=r.p8*Math.max(1,Math.abs(s),Math.abs(T))&&Math.abs(l-x)<=r.p8*Math.max(1,Math.abs(l),Math.abs(x))&&Math.abs(c-S)<=r.p8*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(u-R)<=r.p8*Math.max(1,Math.abs(u),Math.abs(R))&&Math.abs(h-C)<=r.p8*Math.max(1,Math.abs(h),Math.abs(C))&&Math.abs(d-L)<=r.p8*Math.max(1,Math.abs(d),Math.abs(L))&&Math.abs(f-O)<=r.p8*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(p-M)<=r.p8*Math.max(1,Math.abs(p),Math.abs(M))&&Math.abs(g-I)<=r.p8*Math.max(1,Math.abs(g),Math.abs(I))&&Math.abs(m-w)<=r.p8*Math.max(1,Math.abs(m),Math.abs(w))&&Math.abs(_-P)<=r.p8*Math.max(1,Math.abs(_),Math.abs(P))&&Math.abs(v-N)<=r.p8*Math.max(1,Math.abs(v),Math.abs(N))}},39318:(e,t)=>{t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<<s)-1,c=l>>1,u=-7,h=n?i-1:0,d=n?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+e[t+h],h+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,l,c=8*o-i-1,u=(1<<c)-1,h=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(t*l-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[n+f]=255&a,f+=p,a/=256,c-=8);e[n+f-p]|=128*g}},39361:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},39546:e=>{var t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(t)||[]}},39747:(e,t,n)=>{var r=n(41580),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},39850:(e,t,n)=>{var r=n(39546),i=n(15813),o=n(95243),a=n(10482);e.exports=function(e,t,n){return e=o(e),void 0===(t=n?void 0:t)?i(e)?a(e):r(e):e.match(t)||[]}},40091:(e,t,n)=>{var r=n(51340),i=n(24810),o=n(35636),a=n(49266),s=n(41580),l=n(25288),c=n(78763);e.exports=function e(t,n,u,h,d){t!==n&&o(n,(function(o,l){if(d||(d=new r),s(o))a(t,n,l,u,e,h,d);else{var f=h?h(c(t,l),o,l+"",t,n,d):void 0;void 0===f&&(f=o),i(t,l,f)}}),l)}},41580:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},41850:e=>{"use strict";e.exports=function(e){var t={};function n(n){var r=e.get(n);return void 0===r?[]:t[r]||[]}return{get:n,add:function(n,r){var i=e.get(n);t[i]||(t[i]=[]),t[i].push(r)},removeListener:function(e,t){for(var r=n(e),i=0,o=r.length;i<o;++i)if(r[i]===t){r.splice(i,1);break}},removeAllListeners:function(e){var t=n(e);t&&(t.length=0)}}}},41950:(e,t,n)=>{var r=n(78942)["__core-js_shared__"];e.exports=r},43316:e=>{e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}},44187:e=>{e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}},44700:(e,t,n)=>{var r=n(79067);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},45881:(e,t,n)=>{var r=n(69968),i=n(95243),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=i(e))&&e.replace(o,r).replace(a,"")}},46108:(e,t,n)=>{var r=n(69334);e.exports=function(e){return r(e,5)}},46123:(e,t,n)=>{var r=n(57923);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},46285:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},46343:(e,t,n)=>{var r=n(94687);e.exports=function(e,t){return r(e,t)}},47403:(e,t,n)=>{var r=n(82619),i=n(72532),o=n(22053),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},48244:(e,t,n)=>{var r=n(11129),i=n(53142);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},48360:(e,t,n)=>{var r=n(87379),i=n(74784),o=n(80547),a=Function.prototype,s=Object.prototype,l=a.toString,c=s.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==u}},48458:(e,t,n)=>{"use strict";n.d(t,{PQ:()=>Cc,S6:()=>jc,pH:()=>Gr,qH:()=>lu,Z5:()=>tm});var r={},i={},o=e=>i[e],a=(e,t)=>{i[e]=t},s=(e,t)=>{r[e]=t},l={},c={};function u(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function h(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var r in e)r in t||n.push(t[r]=r)})),n}function d(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}var f=function(e){var t=new RegExp('[",\n\r]'),n=e.charCodeAt(0);function r(e,t){var r,i=[],o=e.length,a=0,s=0,u=o<=0,h=!1;function d(){if(u)return c;if(h)return h=!1,l;var t,r,i=a;if(34===e.charCodeAt(i)){for(;a++<o&&34!==e.charCodeAt(a)||34===e.charCodeAt(++a););return(t=a)>=o?u=!0:10===(r=e.charCodeAt(a++))?h=!0:13===r&&(h=!0,10===e.charCodeAt(a)&&++a),e.slice(i+1,t-1).replace(/""/g,'"')}for(;a<o;){if(10===(r=e.charCodeAt(t=a++)))h=!0;else if(13===r)h=!0,10===e.charCodeAt(a)&&++a;else if(r!==n)continue;return e.slice(i,t)}return u=!0,e.slice(i,o)}for(10===e.charCodeAt(o-1)&&--o,13===e.charCodeAt(o-1)&&--o;(r=d())!==c;){for(var f=[];r!==l&&r!==c;)f.push(r),r=d();t&&null==(f=t(f,s++))||i.push(f)}return i}function i(t,n){return t.map((function(t){return n.map((function(e){return a(t[e])})).join(e)}))}function o(t){return t.map(a).join(e)}function a(e){return null==e?"":e instanceof Date?function(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":function(e){return e<0?"-"+d(-e,6):e>9999?"+"+d(e,6):d(e,4)}(e.getUTCFullYear())+"-"+d(e.getUTCMonth()+1,2)+"-"+d(e.getUTCDate(),2)+(i?"T"+d(t,2)+":"+d(n,2)+":"+d(r,2)+"."+d(i,3)+"Z":r?"T"+d(t,2)+":"+d(n,2)+":"+d(r,2)+"Z":n||t?"T"+d(t,2)+":"+d(n,2)+"Z":"")}(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function(e,t){var n,i,o=r(e,(function(e,r){if(n)return n(e,r-1);i=e,n=t?function(e,t){var n=u(e);return function(r,i){return t(n(r),i,e)}}(e,t):u(e)}));return o.columns=i||[],o},parseRows:r,format:function(t,n){return null==n&&(n=h(t)),[n.map(a).join(e)].concat(i(t,n)).join("\n")},formatBody:function(e,t){return null==t&&(t=h(e)),i(e,t).join("\n")},formatRows:function(e){return e.map(o).join("\n")},formatRow:o,formatValue:a}}(","),p=f.parse,g=(f.parseRows,f.format,f.formatBody,f.formatRows,f.formatRow,f.formatValue,n(33270));function m(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)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 _(e){return"Feature"===e.type?e.geometry:e}var v=n(19004),y=n(1976),E=n(98167),A=n.n(E);function b(e){return!!Array.isArray(e)&&(0===e.length||"number"==typeof e[0])}function T(e){const t=Object.isFrozen(e)?y.uG.cloneDeep(e):e;return A()(t,!0),t}function x(e,t){return e||[[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]]}var S=Object.defineProperty,R=Object.defineProperties,C=Object.getOwnPropertyDescriptors,L=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable,I=(e,t,n)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w=(e,t)=>{for(var n in t||(t={}))O.call(t,n)&&I(e,n,t[n]);if(L)for(var n of L(t))M.call(t,n)&&I(e,n,t[n]);return e},P=(e,t)=>R(e,C(t));function N(e,t){const{x:n,y:r,x1:i,y1:o,coordinates:a,geometry:s}=t,l=[];if(!Array.isArray(e))return{dataArray:[]};if(s)return e.filter((e=>e[s]&&e[s].type&&e[s].coordinates&&e[s].coordinates.length>0)).forEach(((e,t)=>{const n=T(e[s]);(0,v.iw)(n,(n=>{const r=m(n),i=P(w({},e),{_id:t,coordinates:r});l.push(i)}))})),{dataArray:l};for(let t=0;t<e.length;t++){const s=e[t];let c=[];if(a){let e="Polygon";Array.isArray(a[0])||(e="Point"),Array.isArray(a[0])&&!Array.isArray(a[0][0])&&(e="LineString"),c=T({type:e,coordinates:s[a]}).coordinates}else n&&r&&i&&o?c=[[parseFloat(s[n]),parseFloat(s[r])],[parseFloat(s[i]),parseFloat(s[o])]]:n&&r&&(c=[parseFloat(s[n]),parseFloat(s[r])]);const u=P(w({},s),{_id:t,coordinates:c});l.push(u)}return{dataArray:l}}var D=Object.defineProperty,B=Object.defineProperties,F=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,z=(e,t,n)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function j(e,t,n,r){for(var i,o=r,a=n-t>>1,s=n-t,l=e[t],c=e[t+1],u=e[n],h=e[n+1],d=t+3;d<n;d+=3){var f=V(e[d],e[d+1],l,c,u,h);if(f>o)i=d,o=f;else if(f===o){var p=Math.abs(d-a);p<s&&(i=d,s=p)}}o>r&&(i-t>3&&j(e,t,i,r),e[i+2]=o,n-i>3&&j(e,i,n,r))}function V(e,t,n,r,i,o){var a=i-n,s=o-r;if(0!==a||0!==s){var l=((e-n)*a+(t-r)*s)/(a*a+s*s);l>1?(n=i,r=o):l>0&&(n+=a*l,r+=s*l)}return(a=e-n)*a+(s=t-r)*s}function H(e,t,n,r){var i={id:void 0===e?null:e,type:t,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,n=e.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)W(e,t);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r<t.length;r++)W(e,t[r]);else if("MultiPolygon"===n)for(r=0;r<t.length;r++)for(var i=0;i<t[r].length;i++)W(e,t[r][i])}(i),i}function W(e,t){for(var n=0;n<t.length;n+=3)e.minX=Math.min(e.minX,t[n]),e.minY=Math.min(e.minY,t[n+1]),e.maxX=Math.max(e.maxX,t[n]),e.maxY=Math.max(e.maxY,t[n+1])}function X(e,t,n,r){if(t.geometry){var i=t.geometry.coordinates,o=t.geometry.type,a=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),s=[],l=t.id;if(n.promoteId?l=t.properties[n.promoteId]:n.generateId&&(l=r||0),"Point"===o)Z(i,s);else if("MultiPoint"===o)for(var c=0;c<i.length;c++)Z(i[c],s);else if("LineString"===o)Y(i,s,a,!1);else if("MultiLineString"===o){if(n.lineMetrics){for(c=0;c<i.length;c++)s=[],Y(i[c],s,a,!1),e.push(H(l,"LineString",s,t.properties));return}q(i,s,a,!1)}else if("Polygon"===o)q(i,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(c=0;c<t.geometry.geometries.length;c++)X(e,{id:l,geometry:t.geometry.geometries[c],properties:t.properties},n,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<i.length;c++){var u=[];q(i[c],u,a,!0),s.push(u)}}e.push(H(l,o,s,t.properties))}}function Z(e,t){t.push(K(e[0])),t.push(Q(e[1])),t.push(0)}function Y(e,t,n,r){for(var i,o,a=0,s=0;s<e.length;s++){var l=K(e[s][0]),c=Q(e[s][1]);t.push(l),t.push(c),t.push(0),s>0&&(a+=r?(i*c-l*o)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-o,2))),i=l,o=c}var u=t.length-3;t[2]=1,j(t,0,u,n),t[u+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size}function q(e,t,n,r){for(var i=0;i<e.length;i++){var o=[];Y(e[i],o,n,r),t.push(o)}}function K(e){return e/360+.5}function Q(e){var t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function $(e,t,n,r,i,o,a,s){if(r/=t,o>=(n/=t)&&a<r)return e;if(a<n||o>=r)return null;for(var l=[],c=0;c<e.length;c++){var u=e[c],h=u.geometry,d=u.type,f=0===i?u.minX:u.minY,p=0===i?u.maxX:u.maxY;if(f>=n&&p<r)l.push(u);else if(!(p<n||f>=r)){var g=[];if("Point"===d||"MultiPoint"===d)J(h,g,n,r,i);else if("LineString"===d)ee(h,g,n,r,i,!1,s.lineMetrics);else if("MultiLineString"===d)ne(h,g,n,r,i,!1);else if("Polygon"===d)ne(h,g,n,r,i,!0);else if("MultiPolygon"===d)for(var m=0;m<h.length;m++){var _=[];ne(h[m],_,n,r,i,!0),_.length&&g.push(_)}if(g.length){if(s.lineMetrics&&"LineString"===d){for(m=0;m<g.length;m++)l.push(H(u.id,d,g[m],u.tags));continue}"LineString"!==d&&"MultiLineString"!==d||(1===g.length?(d="LineString",g=g[0]):d="MultiLineString"),"Point"!==d&&"MultiPoint"!==d||(d=3===g.length?"Point":"MultiPoint"),l.push(H(u.id,d,g,u.tags))}}}return l.length?l:null}function J(e,t,n,r,i){for(var o=0;o<e.length;o+=3){var a=e[o+i];a>=n&&a<=r&&(t.push(e[o]),t.push(e[o+1]),t.push(e[o+2]))}}function ee(e,t,n,r,i,o,a){for(var s,l,c=te(e),u=0===i?ie:oe,h=e.start,d=0;d<e.length-3;d+=3){var f=e[d],p=e[d+1],g=e[d+2],m=e[d+3],_=e[d+4],v=0===i?f:p,y=0===i?m:_,E=!1;a&&(s=Math.sqrt(Math.pow(f-m,2)+Math.pow(p-_,2))),v<n?y>n&&(l=u(c,f,p,m,_,n),a&&(c.start=h+s*l)):v>r?y<r&&(l=u(c,f,p,m,_,r),a&&(c.start=h+s*l)):re(c,f,p,g),y<n&&v>=n&&(l=u(c,f,p,m,_,n),E=!0),y>r&&v<=r&&(l=u(c,f,p,m,_,r),E=!0),!o&&E&&(a&&(c.end=h+s*l),t.push(c),c=te(e)),a&&(h+=s)}var A=e.length-3;f=e[A],p=e[A+1],g=e[A+2],(v=0===i?f:p)>=n&&v<=r&&re(c,f,p,g),A=c.length-3,o&&A>=3&&(c[A]!==c[0]||c[A+1]!==c[1])&&re(c,c[0],c[1],c[2]),c.length&&t.push(c)}function te(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function ne(e,t,n,r,i,o){for(var a=0;a<e.length;a++)ee(e[a],t,n,r,i,o,!1)}function re(e,t,n,r){e.push(t),e.push(n),e.push(r)}function ie(e,t,n,r,i,o){var a=(o-t)/(r-t);return e.push(o),e.push(n+(i-n)*a),e.push(1),a}function oe(e,t,n,r,i,o){var a=(o-n)/(i-n);return e.push(t+(r-t)*a),e.push(o),e.push(1),a}function ae(e,t){for(var n=[],r=0;r<e.length;r++){var i,o=e[r],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)i=se(o.geometry,t);else if("MultiLineString"===a||"Polygon"===a){i=[];for(var s=0;s<o.geometry.length;s++)i.push(se(o.geometry[s],t))}else if("MultiPolygon"===a)for(i=[],s=0;s<o.geometry.length;s++){for(var l=[],c=0;c<o.geometry[s].length;c++)l.push(se(o.geometry[s][c],t));i.push(l)}n.push(H(o.id,a,i,o.tags))}return n}function se(e,t){var n=[];n.size=e.size,void 0!==e.start&&(n.start=e.start,n.end=e.end);for(var r=0;r<e.length;r+=3)n.push(e[r]+t,e[r+1],e[r+2]);return n}function le(e,t){if(e.transformed)return e;var n,r,i,o=1<<e.z,a=e.x,s=e.y;for(n=0;n<e.features.length;n++){var l=e.features[n],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(r=0;r<c.length;r+=2)l.geometry.push(ce(c[r],c[r+1],t,o,a,s));else for(r=0;r<c.length;r++){var h=[];for(i=0;i<c[r].length;i+=2)h.push(ce(c[r][i],c[r][i+1],t,o,a,s));l.geometry.push(h)}}return e.transformed=!0,e}function ce(e,t,n,r,i,o){return[Math.round(n*(e*r-i)),Math.round(n*(t*r-o))]}function ue(e,t,n,r,i){for(var o=t===i.maxZoom?0:i.tolerance/((1<<t)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:n,y:r,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<e.length;s++){a.numFeatures++,he(a,e[s],o,i);var l=e[s].minX,c=e[s].minY,u=e[s].maxX,h=e[s].maxY;l<a.minX&&(a.minX=l),c<a.minY&&(a.minY=c),u>a.maxX&&(a.maxX=u),h>a.maxY&&(a.maxY=h)}return a}function he(e,t,n,r){var i=t.geometry,o=t.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),e.numPoints++,e.numSimplified++;else if("LineString"===o)de(a,i,e,n,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)de(a,i[s],e,n,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var l=0;l<i.length;l++){var c=i[l];for(s=0;s<c.length;s++)de(a,c[s],e,n,!0,0===s)}if(a.length){var u=t.tags||null;if("LineString"===o&&r.lineMetrics){for(var h in u={},t.tags)u[h]=t.tags[h];u.mapbox_clip_start=i.start/i.size,u.mapbox_clip_end=i.end/i.size}var d={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:u};null!==t.id&&(d.id=t.id),e.features.push(d)}}function de(e,t,n,r,i,o){var a=r*r;if(r>0&&t.size<(i?a:r))n.numPoints+=t.length/3;else{for(var s=[],l=0;l<t.length;l+=3)(0===r||t[l+2]>a)&&(n.numSimplified++,s.push(t[l]),s.push(t[l+1])),n.numPoints++;i&&function(e,t){for(var n=0,r=0,i=e.length,o=i-2;r<i;o=r,r+=2)n+=(e[r]-e[o])*(e[r+1]+e[o+1]);if(n>0===t)for(r=0,i=e.length;r<i/2;r+=2){var a=e[r],s=e[r+1];e[r]=e[i-2-r],e[r+1]=e[i-1-r],e[i-2-r]=a,e[i-1-r]=s}}(s,o),e.push(s)}}function fe(e,t){var n=(t=this.options=function(e,t){for(var n in t)e[n]=t[n];return e}(Object.create(this.options),t)).debug;if(n&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var r=function(e,t){var n=[];if("FeatureCollection"===e.type)for(var r=0;r<e.features.length;r++)X(n,e.features[r],t,r);else"Feature"===e.type?X(n,e,t):X(n,{geometry:e},t);return n}(e,t);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=function(e,t){var n=t.buffer/t.extent,r=e,i=$(e,1,-1-n,n,0,-1,2,t),o=$(e,1,1-n,2+n,0,-1,2,t);return(i||o)&&(r=$(e,1,-n,1+n,0,-1,2,t)||[],i&&(r=ae(i,1).concat(r)),o&&(r=r.concat(ae(o,-1)))),r}(r,t),r.length&&this.splitTile(r,0,0,0),n&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function pe(e,t,n){return 32*((1<<e)*n+t)+e}fe.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},fe.prototype.splitTile=function(e,t,n,r,i,o,a){for(var s=[e,t,n,r],l=this.options,c=l.debug;s.length;){r=s.pop(),n=s.pop(),t=s.pop(),e=s.pop();var u=1<<t,h=pe(t,n,r),d=this.tiles[h];if(!d&&(c>1&&console.time("creation"),d=this.tiles[h]=ue(e,t,n,r,l),this.tileCoords.push({z:t,x:n,y:r}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,n,r,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));var f="z"+t;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(d.source=e,i){if(t===l.maxZoom||t===i)continue;var p=1<<i-t;if(n!==Math.floor(o/p)||r!==Math.floor(a/p))continue}else if(t===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue;if(d.source=null,0!==e.length){c>1&&console.time("clipping");var g,m,_,v,y,E,A=.5*l.buffer/l.extent,b=.5-A,T=.5+A,x=1+A;g=m=_=v=null,y=$(e,u,n-A,n+T,0,d.minX,d.maxX,l),E=$(e,u,n+b,n+x,0,d.minX,d.maxX,l),e=null,y&&(g=$(y,u,r-A,r+T,1,d.minY,d.maxY,l),m=$(y,u,r+b,r+x,1,d.minY,d.maxY,l),y=null),E&&(_=$(E,u,r-A,r+T,1,d.minY,d.maxY,l),v=$(E,u,r+b,r+x,1,d.minY,d.maxY,l),E=null),c>1&&console.timeEnd("clipping"),s.push(g||[],t+1,2*n,2*r),s.push(m||[],t+1,2*n,2*r+1),s.push(_||[],t+1,2*n+1,2*r),s.push(v||[],t+1,2*n+1,2*r+1)}}},fe.prototype.getTile=function(e,t,n){var r=this.options,i=r.extent,o=r.debug;if(e<0||e>24)return null;var a=1<<e,s=pe(e,t=(t%a+a)%a,n);if(this.tiles[s])return le(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",e,t,n);for(var l,c=e,u=t,h=n;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[pe(c,u,h)];return l&&l.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,u,h),o>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,e,t,n),o>1&&console.timeEnd("drilling down"),this.tiles[s]?le(this.tiles[s],i):null):null};var ge=class{constructor(e,t,n,r){this.vectorLayerCache={},this.x=t,this.y=n,this.z=r,this.vectorTile=e}getTileData(e){return e&&this.vectorTile.layers[e]?this.vectorLayerCache[e]?this.vectorLayerCache[e]:this.vectorTile.layers[e].features:[]}getFeatureById(){throw new Error("Method not implemented.")}},me=Object.defineProperty,_e=Object.defineProperties,ve=Object.getOwnPropertyDescriptors,ye=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,be=(e,t,n)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Te=(e,t)=>{for(var n in t||(t={}))Ee.call(t,n)&&be(e,n,t[n]);if(ye)for(var n of ye(t))Ae.call(t,n)&&be(e,n,t[n]);return e},xe={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0};function Se(e){let t=0;for(let n,r,i=0,o=e.length,a=o-1;i<o;a=i++)n=e[i],r=e[a],t+=(r.x-n.x)*(n.y+r.y);return t}var Re=["Unknown","Point","LineString","Polygon"];var Ce=(e,t,n,r)=>{return i=function*(){return new Promise((i=>{const o=t.getTile(e.z,e.x,e.y),a=o?o.features.map((e=>function(e,t,n,r,i){let o=i.geometry;const a=i.type,s=i.tags,l=i.id,c=e*Math.pow(2,r),u=e*t,h=e*n;let d,f,p=Re[a];function g(e){for(let t=0;t<e.length;t++){const n=e[t];if(n[3])break;const r=180-360*(n[1]+h)/c,i=360*(n[0]+u)/c-180,o=360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90;e[t]=[i,o,0,1]}}switch(a){case 1:const e=[];for(d=0;d<o.length;d++)e[d]=o[d][0];o=e,g(o);break;case 2:for(d=0;d<o.length;d++)g(o[d]);break;case 3:for(o=function(e){const t=e.length;if(t<=1)return[e];const n=[];let r,i;for(let o=0;o<t;o++){const t=Se(e[o]);0!==t&&(void 0===i&&(i=t<0),i===t<0?(r&&n.push(r),r=[e[o]]):r.push(e[o]))}return r&&n.push(r),n}(o),d=0;d<o.length;d++)for(f=0;f<o[d].length;f++)g(o[d][f])}return 1===o.length?o=o[0]:p="Multi"+p,{type:"Feature",geometry:{type:p,coordinates:o},properties:s,id:l,tileOrigin:[0,0],coord:""}}(r,n.x,n.y,n.z,e))):[];i(new ge({layers:{defaultLayer:{features:a}}},e.x,e.y,e.z))}))},new Promise(((e,t)=>{var n=e=>{try{o(i.next(e))}catch(e){t(e)}},r=e=>{try{o(i.throw(e))}catch(e){t(e)}},o=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,r);o((i=i.apply(undefined,null)).next())}));var i},Le=Object.defineProperty,Oe=Object.defineProperties,Me=Object.getOwnPropertyDescriptors,Ie=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,Ne=(e,t,n)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,De=(e,t)=>{for(var n in t||(t={}))we.call(t,n)&&Ne(e,n,t[n]);if(Ie)for(var n of Ie(t))Pe.call(t,n)&&Ne(e,n,t[n]);return e},Be=(e,t)=>Oe(e,Me(t));var Fe=Object.defineProperty,Ue=Object.defineProperties,ke=Object.getOwnPropertyDescriptors,Ge=Object.getOwnPropertySymbols,ze=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,Ve=(e,t,n)=>t in e?Fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,He=(e,t)=>{for(var n in t||(t={}))ze.call(t,n)&&Ve(e,n,t[n]);if(Ge)for(var n of Ge(t))je.call(t,n)&&Ve(e,n,t[n]);return e},We=(e,t)=>Ue(e,ke(t)),Xe=n(53260),Ze=n(38286),Ye=n.n(Ze),qe=Object.defineProperty,Ke=Object.defineProperties,Qe=Object.getOwnPropertyDescriptors,$e=Object.getOwnPropertySymbols,Je=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,tt=(e,t,n)=>t in e?qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nt=(e,t)=>{for(var n in t||(t={}))Je.call(t,n)&&tt(e,n,t[n]);if($e)for(var n of $e(t))et.call(t,n)&&tt(e,n,t[n]);return e},rt=class{constructor(e,t,n,r){this.vectorLayerCache={},this.x=t,this.y=n,this.z=r,this.vectorTile=new Xe.VectorTile(new(Ye())(e))}getTileData(e){if(!e||!this.vectorTile.layers[e])return[];if(this.vectorLayerCache[e])return this.vectorLayerCache[e];const t=this.vectorTile.layers[e];if(Array.isArray(t.features))return this.vectorLayerCache[e]=t.features,t.features;const n=[];for(let e=0;e<t.length;e++){const o=t.feature(e).toGeoJSON(this.x,this.y,this.z);n.push((r=nt({},o),i={properties:nt({id:o.id},o.properties)},Ke(r,Qe(i))))}var r,i;return this.vectorLayerCache[e]=n,n}getFeatureById(){throw new Error("Method not implemented.")}},it=Object.defineProperty,ot=Object.defineProperties,at=Object.getOwnPropertyDescriptors,st=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,ct=Object.prototype.propertyIsEnumerable,ut=(e,t,n)=>t in e?it(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ht=(e,t)=>{for(var n in t||(t={}))lt.call(t,n)&&ut(e,n,t[n]);if(st)for(var n of st(t))ct.call(t,n)&&ut(e,n,t[n]);return e},dt=(e,t)=>ot(e,at(t)),ft={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,warp:!0};function pt(e,t){const{width:n,height:r}=t[0],i=t.map((e=>e.rasterData)),o=n*r,a=[],s=JSON.stringify(e);for(let e=0;e<o;e++){const t=JSON.parse(s),n=gt(t,i,e);if("number"==typeof n)a.push(n);else{const e=mt(t);a.push(e)}}return a}function gt(e,t,n){if(2===e.length&&"band"===e[0]&&"number"==typeof e[1])try{return t[e[1]][n]}catch(e){return console.warn("Raster Data err!"),0}e.map(((r,i)=>{if(Array.isArray(r)&&r.length>0)if("band"===r[0])try{e[i]=t[r[1]][n]}catch(t){console.warn("Raster Data err!"),e[i]=0}else gt(r,t,n)}))}function mt(e){const t=function(e){const[t,n=-1,r=-1]=e;return void 0===t?(console.warn("Express err!"),["+",0,0]):[t.replace(/\s+/g,""),n,r]}(e),n=t[0];let r=t[1],i=t[2];return Array.isArray(r)&&(r=mt(e[1])),Array.isArray(i)&&(i=mt(e[2])),function(e,t,n){switch(e){case"+":return t+n;case"-":return t-n;case"*":return t*n;case"/":return t/n;case"%":return t%n;case"^":return Math.pow(t,n);case"abs":return Math.abs(t);case"floor":return Math.floor(t);case"round":return Math.round(t);case"ceil":return Math.ceil(t);case"sin":return Math.sin(t);case"cos":return Math.cos(t);case"atan":return-1===n?Math.atan(t):Math.atan2(t,n);case"min":return Math.min(t,n);case"max":return Math.max(t,n);case"log10":return Math.log(t);case"log2":return Math.log2(t);default:return console.warn("Calculate symbol err! Return default 0"),0}}(n,r,i)}var _t={nd:{type:"operation",expression:["/",["-",["band",1],["band",0]],["+",["band",1],["band",0]]]},rgb:{type:"function",method:function(e,t){const n=e[0].rasterData,r=e[1].rasterData,i=e[2].rasterData,o=[],[a,s]=(null==t?void 0:t.countCut)||[2,98],l=(null==t?void 0:t.RMinMax)||vt(n,a,s),c=(null==t?void 0:t.GMinMax)||vt(r,a,s),u=(null==t?void 0:t.BMinMax)||vt(i,a,s);for(let e=0;e<n.length;e++)o.push(Math.max(0,n[e]-l[0])),o.push(Math.max(0,r[e]-c[0])),o.push(Math.max(0,i[e]-u[0]));return{rasterData:o,rMinMax:l,gMinMax:c,bMinMax:u}}}};function vt(e,t,n){const r=e.slice().sort(((e,t)=>e-t)),i=r.length;return[r[Math.ceil(i*t/100)],r[Math.ceil(i*n/100)]]}var yt=Object.defineProperty,Et=Object.defineProperties,At=Object.getOwnPropertyDescriptors,bt=Object.getOwnPropertySymbols,Tt=Object.prototype.hasOwnProperty,xt=Object.prototype.propertyIsEnumerable,St=(e,t,n)=>t in e?yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rt=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{s(n.next(e))}catch(e){i(e)}},a=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,a);s((n=n.apply(e,t)).next())}));function Ct(e,t,n){return Rt(this,null,(function*(){if(0===e.length)return{rasterData:[0],width:1,heigh:1};const r=yield Promise.all(e.map((({data:e,bands:n=[0]})=>t(e,n)))),i=[];r.forEach((e=>{Array.isArray(e)?i.push(...e):i.push(e)}));const{width:o,height:a}=i[0];let s;switch(typeof n){case"function":s=n(i);break;case"object":s=Array.isArray(n)?{rasterData:pt(n,i)}:function(e,t){const n=_t[e.type];return"function"===n.type?n.method(t,null==e?void 0:e.options):"operation"===n.type?"rgb"===e.type?function(e,t){void 0===e.r&&console.warn("Channel R lost in Operation! Use band[0] to fill!"),void 0===e.g&&console.warn("Channel G lost in Operation! Use band[0] to fill!"),void 0===e.b&&console.warn("Channel B lost in Operation! Use band[0] to fill!");return[pt(e.r||["band",0],t),pt(e.g||["band",0],t),pt(e.b||["band",0],t)]}(n.expression,t):{rasterData:pt(n.expression,t)}:void 0}(n,i);break;default:s={rasterData:i[0].rasterData}}return l=((e,t)=>{for(var n in t||(t={}))Tt.call(t,n)&&St(e,n,t[n]);if(bt)for(var n of bt(t))xt.call(t,n)&&St(e,n,t[n]);return e})({},s),Et(l,At({width:o,height:a}));var l}))}function Lt(e,t,n,r){return Rt(this,null,(function*(){const i=yield Ct(e,t,n);r(null,{data:i})}))}var Ot=n(74630),Mt=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{s(n.next(e))}catch(e){i(e)}},a=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,a);s((n=n.apply(e,t)).next())}));function It(e,t){return Array.isArray(e)?"string"==typeof e[0]?e.map((e=>(0,y.g8)(e,t))):e.map((e=>({url:(0,y.g8)(e.url,t),bands:e.bands||[0]}))):(0,y.g8)(e,t)}function wt(e,t){e.xhrCancel=()=>{t.map((e=>{e.abort()}))}}var Pt=Object.defineProperty,Nt=Object.defineProperties,Dt=Object.getOwnPropertyDescriptors,Bt=Object.getOwnPropertySymbols,Ft=Object.prototype.hasOwnProperty,Ut=Object.prototype.propertyIsEnumerable,kt=(e,t,n)=>t in e?Pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gt=(e,t)=>{for(var n in t||(t={}))Ft.call(t,n)&&kt(e,n,t[n]);if(Bt)for(var n of Bt(t))Ut.call(t,n)&&kt(e,n,t[n]);return e},zt=(e,t)=>Nt(e,Dt(t)),jt=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{s(n.next(e))}catch(e){i(e)}},a=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,a);s((n=n.apply(e,t)).next())})),Vt=(e,t,n,r,i)=>jt(void 0,null,(function*(){const o="string"==typeof(a=t.url)?[{url:a,bands:[0]}]:"string"==typeof a[0]?a.map((e=>({url:e,bands:[0]}))):a;var a;if(o.length>1){const{rasterFiles:a,xhrList:s,errList:l}=yield function(e,t){return jt(this,null,(function*(){const n=[],r=[],i=[];for(let o=0;o<e.length;o++){const a=e[o],s=zt(Gt({},t),{url:a.url}),l=a.bands,{err:c,data:u,xhr:h}=yield(0,y.iD)(zt(Gt({},s),{type:"arrayBuffer"}));c&&i.push(c),r.push(h),n.push({data:u,bands:l})}return{rasterFiles:n,xhrList:r,errList:i}}))}(o,t);if(wt(e,s),l.length>0)return void n(l,null);Lt(a,r,i,n)}else{const a=(0,y.Y8)(t,((e,t)=>{e?n(e):t&&Lt([{data:t,bands:o[0].bands}],r,i,n)}));wt(e,[a])}})),Ht=Object.defineProperty,Wt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,Zt=Object.getOwnPropertySymbols,Yt=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,Kt=(e,t,n)=>t in e?Ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qt=(e,t)=>{for(var n in t||(t={}))Yt.call(t,n)&&Kt(e,n,t[n]);if(Zt)for(var n of Zt(t))qt.call(t,n)&&Kt(e,n,t[n]);return e},$t=(e,t)=>Wt(e,Xt(t)),Jt=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{s(n.next(e))}catch(e){i(e)}},a=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,a);s((n=n.apply(e,t)).next())})),en=(e,t,n,r)=>Jt(void 0,null,(function*(){let i;const o=Array.isArray(e)?e[0]:e;if(r.wmtsOptions){const e=(null==r?void 0:r.getURLFromTemplate)||y.ZG;i=e(o,Qt(Qt({},t),r.wmtsOptions))}else{const e=(null==r?void 0:r.getURLFromTemplate)||y.g8;i=e(o,t)}return new Promise(((e,t)=>{var o;const a=(0,y.Qp)($t(Qt({},null==r?void 0:r.requestParameters),{url:i,type:(null==(o=null==r?void 0:r.requestParameters)?void 0:o.type)||"arrayBuffer"}),((n,r)=>{n?t(n):r&&e(r)}),r.transformResponse);n.xhrCancel=()=>a.cancel()}))})),tn=()=>({rasterData:new Uint8Array([0]),width:1,height:1}),nn=Object.defineProperty,rn=Object.defineProperties,on=Object.getOwnPropertyDescriptors,an=Object.getOwnPropertySymbols,sn=Object.prototype.hasOwnProperty,ln=Object.prototype.propertyIsEnumerable,cn=(e,t,n)=>t in e?nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,un=(e,t)=>{for(var n in t||(t={}))sn.call(t,n)&&cn(e,n,t[n]);if(an)for(var n of an(t))ln.call(t,n)&&cn(e,n,t[n]);return e},hn={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,warp:!0};Ot.Gc.ARRAYBUFFER,Ot.Gc.RGB;var dn=Object.defineProperty,fn=Object.defineProperties,pn=Object.getOwnPropertyDescriptors,gn=Object.getOwnPropertySymbols,mn=Object.prototype.hasOwnProperty,_n=Object.prototype.propertyIsEnumerable,vn=(e,t,n)=>t in e?dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yn=(e,t)=>{for(var n in t||(t={}))mn.call(t,n)&&vn(e,n,t[n]);if(gn)for(var n of gn(t))_n.call(t,n)&&vn(e,n,t[n]);return e},En=Object.defineProperty,An=Object.defineProperties,bn=Object.getOwnPropertyDescriptors,Tn=Object.getOwnPropertySymbols,xn=Object.prototype.hasOwnProperty,Sn=Object.prototype.propertyIsEnumerable,Rn=(e,t,n)=>t in e?En(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cn=(e,t)=>{for(var n in t||(t={}))xn.call(t,n)&&Rn(e,n,t[n]);if(Tn)for(var n of Tn(t))Sn.call(t,n)&&Rn(e,n,t[n]);return e},Ln=(e,t)=>An(e,bn(t)),On=Object.defineProperty,Mn=Object.defineProperties,In=Object.getOwnPropertyDescriptors,wn=Object.getOwnPropertySymbols,Pn=Object.prototype.hasOwnProperty,Nn=Object.prototype.propertyIsEnumerable,Dn=(e,t,n)=>t in e?On(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bn=(e,t)=>{for(var n in t||(t={}))Pn.call(t,n)&&Dn(e,n,t[n]);if(wn)for(var n of wn(t))Nn.call(t,n)&&Dn(e,n,t[n]);return e},Fn=Object.defineProperty,Un=Object.defineProperties,kn=Object.getOwnPropertyDescriptors,Gn=Object.getOwnPropertySymbols,zn=Object.prototype.hasOwnProperty,jn=Object.prototype.propertyIsEnumerable,Vn=(e,t,n)=>t in e?Fn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hn=(e,t)=>{for(var n in t||(t={}))zn.call(t,n)&&Vn(e,n,t[n]);if(Gn)for(var n of Gn(t))jn.call(t,n)&&Vn(e,n,t[n]);return e},Wn={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0},Xn=n(35461),Zn=n(28985),Yn=n.n(Zn),qn=n(96323),Kn=n.n(qn),Qn=Object.defineProperty,$n=Object.getOwnPropertySymbols,Jn=Object.prototype.hasOwnProperty,er=Object.prototype.propertyIsEnumerable,tr=(e,t,n)=>t in e?Qn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nr=(e,t)=>{for(var n in t||(t={}))Jn.call(t,n)&&tr(e,n,t[n]);if($n)for(var n of $n(t))er.call(t,n)&&tr(e,n,t[n]);return e};function rr(e,t){const{radius:n=40,maxZoom:r=18,minZoom:i=0,zoom:o=2}=t;if(e.pointIndex){const t=e.pointIndex.getClusters(e.extent,Math.floor(o));return e.dataArray=t.map(((e,t)=>nr({coordinates:e.geometry.coordinates,_id:t+1},e.properties))),e}const a=new(Kn())({radius:n,minZoom:i,maxZoom:r}),s={type:"FeatureCollection",features:[]};return s.features=e.dataArray.map((e=>({type:"Feature",geometry:{type:"Point",coordinates:e.coordinates},properties:nr({},e)}))),a.load(s.features),a}function ir(e){if(0===e.length)return 0;let t,n=e[0],r=0;for(let i=1;i<e.length;i++)t=n+1*e[i],Math.abs(n)>=Math.abs(e[i])?r+=n-t+e[i]:r+=e[i]-t+n,n=t;return n+1*r}var or={min:function(e){if(0===e.length)throw new Error("min requires at least one data point");let t=e[0];for(let n=1;n<e.length;n++)e[n]<t&&(t=e[n]);return t},max:function(e){if(0===e.length)throw new Error("max requires at least one data point");let t=e[0];for(let n=1;n<e.length;n++)e[n]>t&&(t=e[n]);return t},mean:function(e){if(0===e.length)throw new Error("mean requires at least one data point");return ir(e)/e.length},sum:ir},ar=Object.defineProperty,sr=Object.getOwnPropertySymbols,lr=Object.prototype.hasOwnProperty,cr=Object.prototype.propertyIsEnumerable,ur=(e,t,n)=>t in e?ar(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hr=(e,t)=>{for(var n in t||(t={}))lr.call(t,n)&&ur(e,n,t[n]);if(sr)for(var n of sr(t))cr.call(t,n)&&ur(e,n,t[n]);return e},dr=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{s(n.next(e))}catch(e){i(e)}},a=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,a);s((n=n.apply(e,t)).next())})),{cloneDeep:fr,isFunction:pr,isString:gr,mergeWith:mr}=y.uG;function _r(e,t){if(Array.isArray(t))return t}var vr=class extends Zn.EventEmitter{constructor(e,t){super(),this.type="source",this.isTile=!1,this.inited=!1,this.hooks={init:new Xn.Jk},this.parser={type:"geojson"},this.transforms=[],this.cluster=!1,this.clusterOptions={enable:!1,radius:40,maxZoom:20,zoom:-99,method:"count"},this.invalidExtent=!1,this.dataArrayChanged=!1,this.cfg={autoRender:!0},this.originData=e,this.initCfg(t),this.init().then((()=>{this.inited=!0,this.emit("update",{type:"inited"})}))}getSourceCfg(){return this.cfg}getClusters(e){return this.clusterIndex.getClusters(this.caculClusterExtent(2),e)}getClustersLeaves(e){return this.clusterIndex.getLeaves(e,1/0)}getParserType(){return this.parser.type}updateClusterData(e){const{method:t="sum",field:n}=this.clusterOptions;let r=this.clusterIndex.getClusters(this.caculClusterExtent(2),Math.floor(e));this.clusterOptions.zoom=e,r.forEach((e=>{e.id||(e.properties.point_count=1)})),(n||pr(t))&&(r=r.map((e=>{const r=e.id;if(r){const i=this.clusterIndex.getLeaves(r,1/0).map((e=>e.properties));let o;if(gr(t)&&n){const e=function(e,t){return e.map((e=>1*e[t]))}(i,n);o=or[t](e)}pr(t)&&(o=t(i)),e.properties.stat=o}else e.properties.point_count=1;return e}))),this.data=o("geojson")({type:"FeatureCollection",features:r}),this.executeTrans()}getFeatureById(e){const{type:t="geojson",geometry:n}=this.parser;if("geojson"!==t||this.cluster)return"json"===t&&n?this.data.dataArray.find((t=>t._id===e)):e<this.data.dataArray.length?this.data.dataArray[e]:"null";{const t=e<this.originData.features.length?this.originData.features[e]:"null",n=fr(t);if((null==n?void 0:n.properties)&&(0!==this.transforms.length||this.dataArrayChanged)){const t=this.data.dataArray.find((t=>t._id===e));n.properties=t}return n}}updateFeaturePropertiesById(e,t){this.data.dataArray=this.data.dataArray.map((n=>n._id===e?hr(hr({},n),t):n)),this.dataArrayChanged=!0,this.emit("update",{type:"update"})}getFeatureId(e,t){const n=this.data.dataArray.find((n=>n[e]===t));return null==n?void 0:n._id}setData(e,t){this.originData=e,this.dataArrayChanged=!1,this.initCfg(t),this.init().then((()=>{this.emit("update",{type:"update"})}))}reloadAllTile(){var e;null==(e=this.tileset)||e.reloadAll()}reloadTilebyId(e,t,n){var r;null==(r=this.tileset)||r.reloadTileById(e,t,n)}reloadTileByLnglat(e,t,n){var r;null==(r=this.tileset)||r.reloadTileByLnglat(e,t,n)}getTileExtent(e,t){var n;return null==(n=this.tileset)?void 0:n.getTileExtent(e,t)}getTileByZXY(e,t,n){var r;return null==(r=this.tileset)?void 0:r.getTileByZXY(e,t,n)}reloadTileByExtent(e,t){var n;null==(n=this.tileset)||n.reloadTileByExtent(e,t)}destroy(){var e;this.removeAllListeners(),this.originData=null,this.clusterIndex=null,this.data=null,null==(e=this.tileset)||e.destroy()}processData(){return dr(this,null,(function*(){return new Promise(((e,t)=>{try{this.excuteParser(),this.initCluster(),this.executeTrans(),e({})}catch(e){t(e)}}))}))}initCfg(e){this.cfg=mr(this.cfg,e,_r);const t=this.cfg;t&&(t.parser&&(this.parser=t.parser),t.transforms&&(this.transforms=t.transforms),this.cluster=t.cluster||!1,t.clusterOptions&&(this.cluster=!0,this.clusterOptions=hr(hr({},this.clusterOptions),t.clusterOptions)))}init(){return dr(this,null,(function*(){this.inited=!1,yield this.processData(),this.inited=!0}))}excuteParser(){const e=this.parser,t=e.type||"geojson",n=o(t);this.data=n(this.originData,e),this.tileset=this.initTileset(),e.cancelExtent||(this.extent=(0,y.Xx)(this.data.dataArray),this.setCenter(this.extent),this.invalidExtent=this.extent[0]===this.extent[2]||this.extent[1]===this.extent[3])}setCenter(e){this.center=[(e[0]+e[2])/2,(e[1]+e[3])/2],(isNaN(this.center[0])||isNaN(this.center[1]))&&(this.center=[108.92361111111111,34.54083333333333])}initTileset(){const{tilesetOptions:e}=this.data;if(e)return this.isTile=!0,this.tileset?(this.tileset.updateOptions(e),this.tileset):new y.qZ(hr({},e))}executeTrans(){this.transforms.forEach((e=>{const{type:t}=e,n=(e=>r[e])(t)(this.data,e);Object.assign(this.data,n)}))}initCluster(){if(!this.cluster)return;const e=this.clusterOptions||{};this.clusterIndex=rr(this.data,e)}caculClusterExtent(e){let t=[[-1/0,-1/0],[1/0,1/0]];return this.invalidExtent||(t=(0,y.ng)((0,y.IU)(this.extent),e)),t[0].concat(t[1])}},yr=6378e3,Er=Math.PI/3,Ar=[0,Er,2*Er,3*Er,4*Er,5*Er];function br(e){return e[0]}function Tr(e){return e[1]}var xr=Object.defineProperty,Sr=Object.defineProperties,Rr=Object.getOwnPropertyDescriptors,Cr=Object.getOwnPropertySymbols,Lr=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable,Mr=(e,t,n)=>t in e?xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ir=Object.defineProperty,wr=Object.getOwnPropertySymbols,Pr=Object.prototype.hasOwnProperty,Nr=Object.prototype.propertyIsEnumerable,Dr=(e,t,n)=>t in e?Ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Br=(e,t)=>{for(var n in t||(t={}))Pr.call(t,n)&&Dr(e,n,t[n]);if(wr)for(var n of wr(t))Nr.call(t,n)&&Dr(e,n,t[n]);return e};n(12593),a("rasterTile",(function(e,t={}){if(n=e,Array.isArray(n)&&0===n.length||!Array.isArray(n)&&"string"!=typeof n)throw new Error("tile server url is error");var n;let r=(null==t?void 0:t.dataType)||Ot.Gc.IMAGE;r===Ot.Gc.RGB&&(r=Ot.Gc.ARRAYBUFFER);const i=(o=un(un({},hn),t),a={getTileData:(n,i)=>{switch(r){case Ot.Gc.IMAGE:return en(e,n,i,t);case Ot.Gc.CUSTOMIMAGE:case Ot.Gc.CUSTOMTERRAINRGB:return((e,t)=>Mt(void 0,null,(function*(){return new Promise(((n,r)=>{t({x:e.x,y:e.y,z:e.z},((e,t)=>{!e&&t?t instanceof ArrayBuffer?(0,y.vy)(t,((e,t)=>{e&&r(e),n(t)})):t instanceof HTMLImageElement?n(t):r(e):r(e)}))}))})))(i,null==t?void 0:t.getCustomData);case Ot.Gc.ARRAYBUFFER:return((e,t,n,r)=>Jt(void 0,null,(function*(){const{format:i=tn,operation:o,requestParameters:a={}}=r,s=$t(Qt({},a),{url:It(e,t)});return new Promise(((e,t)=>{Vt(n,s,((n,r)=>{n?t(n):r&&e(r)}),i,o)}))})))(e,n,i,t);case Ot.Gc.CUSTOMARRAYBUFFER:case Ot.Gc.CUSTOMRGB:return((e,t,n,r)=>Mt(void 0,null,(function*(){return new Promise(((i,o)=>{t({x:e.x,y:e.y,z:e.z},((e,t)=>{e||0===t.length?o(e):t&&Lt([{data:t,bands:[0]}],n,r,((e,t)=>{e?o(e):t&&i(t)}))}))}))})))(i,null==t?void 0:t.getCustomData,(null==t?void 0:t.format)||tn,null==t?void 0:t.operation);default:return en(e,n,i,t)}}},rn(o,on(a)));var o,a;return{data:e,dataArray:[],tilesetOptions:i,isTile:!0}})),a("mvt",(function(e,t){const n=Array.isArray(e)?e[0]:e,r=dt(ht(ht({},ft),t),{getTileData:(e,r)=>((e,t,n,r,i)=>{return o=function*(){const o=(0,y.g8)(e,t);return new Promise((e=>{if(i)i({x:n.x,y:n.y,z:n.z},((t,r)=>{if(t||!r)e(void 0);else{const t=new rt(r,n.x,n.y,n.z);e(t)}}));else{const t=(0,y.Y8)(dt(ht({},r),{url:o}),((t,r)=>{if(t||!r)e(void 0);else{const t=new rt(r,n.x,n.y,n.z);e(t)}}));n.xhrCancel=()=>t.cancel()}}))},new Promise(((e,t)=>{var n=e=>{try{i(o.next(e))}catch(e){t(e)}},r=e=>{try{i(o.throw(e))}catch(e){t(e)}},i=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,r);i((o=o.apply(void 0,null)).next())}));var o})(n,e,r,null==t?void 0:t.requestParameters,null==t?void 0:t.getCustomData)});return{data:n,dataArray:[],tilesetOptions:r,isTile:!0}})),a("geojsonvt",(function(e,t){const n=function(e){const t={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!0,debug:0};return void 0===e||void 0===e.geojsonvtOptions?t:Te(Te({},t),e.geojsonvtOptions)}(t),r=n.extent||4096,i=function(e,t){return new fe(e,t)}(e,n);var o;return{data:e,dataArray:[],tilesetOptions:(o=Te(Te({},xe),t),_e(o,ve({getTileData:(e,t)=>Ce(t,i,e,r)}))),isTile:!0}})),a("testTile",(function(e,t){var n;return{data:e,dataArray:[],tilesetOptions:(n=Hn(Hn({},Wn),t),Un(n,kn({getTileData:e=>(e=>{return t=function*(){return new Promise((t=>{const[n,r,i,o]=e.bounds;t({layers:{testTile:{features:[{type:"Feature",properties:{key:e.x+"/"+e.y+"/"+e.z,x:(n+i)/2,y:(r+o)/2},geometry:{type:"LineString",coordinates:[[i,o],[i,r],[n,r],[n,r]]}}]}}})}))},new Promise(((e,n)=>{var r=e=>{try{o(t.next(e))}catch(e){n(e)}},i=e=>{try{o(t.throw(e))}catch(e){n(e)}},o=t=>t.done?e(t.value):Promise.resolve(t.value).then(r,i);o((t=t.apply(void 0,null)).next())}));var t})(e)}))),isTile:!0}})),a("geojson",(function(e,t){const n=[],r={};return e.features?(e.features=e.features.filter((e=>{const t=e.geometry;return null!=e&&t&&t.type&&t.coordinates&&t.coordinates.length>0})),0===(e=T(e)).features.length?{dataArray:[],featureKeys:r}:((0,v.iw)(e,((e,r)=>{let i=(o=e,void 0===(a=null==t?void 0:t.featureId)?null:"number"==typeof(1*o.properties[a])?1*o.properties[a]:o.properties&&o.properties[a]?function(e){const t=e.toString();let n=5381,r=t.length;for(;r;)n=33*n^t.charCodeAt(--r);return n>>>0}(o.properties[a]+"")%1000019:null);var o,a;null===i&&(i=r);const s=i,l=m(e),c=(u=((e,t)=>{for(var n in t||(t={}))k.call(t,n)&&z(e,n,t[n]);if(U)for(var n of U(t))G.call(t,n)&&z(e,n,t[n]);return e})({},e.properties),B(u,F({coordinates:l,_id:s})));var u;n.push(c)})),{dataArray:n,featureKeys:r})):(e.features=[],{dataArray:[]})})),a("jsonTile",(function(e,t){return{dataArray:[],tilesetOptions:We(He({},t),{getTileData:(n,r)=>((e,t,n,r)=>{return i=function*(){const i={x:t.x,y:t.y,z:t.z},o=(0,y.g8)(e,i);return new Promise((e=>{r?r(i,((n,r)=>{if(n||!r){const n=new ge({layers:{defaultLayer:{features:[]}}},t.x,t.y,t.z);e(n)}else{const n={layers:{defaultLayer:{features:r.features}}},i=new ge(n,t.x,t.y,t.z);e(i)}})):(0,y.bQ)(We(He({},n),{url:o}),((n,r)=>{if(n||!r){const n=new ge({layers:{defaultLayer:{features:[]}}},t.x,t.y,t.z);e(n)}else{const n=JSON.parse(r),i=new ge({layers:{defaultLayer:{features:n}}},t.x,t.y,t.z);e(i)}}))}))},new Promise(((e,t)=>{var n=e=>{try{o(i.next(e))}catch(e){t(e)}},r=e=>{try{o(i.throw(e))}catch(e){t(e)}},o=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,r);o((i=i.apply(void 0,null)).next())}));var i})(e,r,null==t?void 0:t.requestParameters,t.getCustomData)}),isTile:!0}})),a("image",(function(e,t){const{extent:n=[121.168,30.2828,121.384,30.4219],coordinates:r,requestParameters:i={}}=t,o=new Promise((t=>{e instanceof HTMLImageElement||(0,y.Fw)(e)?t([e]):function(e,t,n){const r=[];if("string"==typeof e)(0,y.Qp)(Be(De({},t),{url:e}),((e,t)=>{t&&(r.push(t),n(r))}));else{const i=e.length;let o=0;e.forEach((e=>{(0,y.Qp)(Be(De({},t),{url:e}),((e,t)=>{o++,t&&r.push(t),o===i&&n(r)}))}))}}(e,i,(e=>{t(e)}))})),a=x(r,n);return{originData:e,images:o,_id:1,dataArray:[{_id:0,coordinates:a}]}})),a("csv",(function(e,t){return N(p(e),t)})),a("json",N),a("raster",(function(e,t){const{extent:n=[121.168,30.2828,121.384,30.4219],coordinates:r,width:i,height:o,min:a,max:s,format:l,operation:c}=t;let u,h,d;return void 0===l||b(e)?(u=Array.from(e),h=i,d=o):u=Ct(Array.isArray(e)?e:[e],l,c),{_id:1,dataArray:[{_id:1,data:u,width:h,height:d,min:a,max:s,coordinates:x(r,n)}]}})),a("rasterRgb",(function(e,t){const n=t,{extent:r,coordinates:i,min:o,max:a,width:s,height:l,format:c,operation:u}=n,h=((e,t)=>{var n={};for(var r in e)Pn.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&wn)for(var r of wn(e))t.indexOf(r)<0&&Nn.call(e,r)&&(n[r]=e[r]);return n})(n,["extent","coordinates","min","max","width","height","format","operation"]);let d;d=void 0===c||b(e)?Array.from(e):Ct(Array.isArray(e)?e:[e],c,u);const f=x(i,r);var p,g;return{_id:1,dataArray:[(p=Bn({_id:1,data:d,width:s,height:l},h),g={min:o,max:a,coordinates:f},Mn(p,In(g)))]}})),a("rgb",(function(e,t){const n=t,{extent:r,coordinates:i,width:o,height:a}=n,s=((e,t)=>{var n={};for(var r in e)xn.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Tn)for(var r of Tn(e))t.indexOf(r)<0&&Sn.call(e,r)&&(n[r]=e[r]);return n})(n,["extent","coordinates","width","height"]);e.length<3&&console.warn("RGB解析需要三个波段的数据");const[l,c,u]=s.bands||[0,1,2],h=[e[l],e[c],e[u]],d=[],[f,p]=(null==s?void 0:s.countCut)||[2,98],g=(null==s?void 0:s.RMinMax)||vt(h[0],f,p),m=(null==s?void 0:s.GMinMax)||vt(h[1],f,p),_=(null==s?void 0:s.BMinMax)||vt(h[2],f,p);for(let e=0;e<h[0].length;e++)d.push(Math.max(0,h[0][e]-g[0])),d.push(Math.max(0,h[1][e]-m[0])),d.push(Math.max(0,h[2][e]-_[0]));const v=x(i,r);return{_id:1,dataArray:[Ln(Cn({_id:1,data:d,width:o,height:a,rMinMax:g,gMinMax:m,bMinMax:_},s),{coordinates:v})]}})),a("ndi",(function(e,t){const n=t,{extent:r=[121.168,30.2828,121.384,30.4219],coordinates:i,width:o,height:a}=n,s=((e,t)=>{var n={};for(var r in e)mn.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&gn)for(var r of gn(e))t.indexOf(r)<0&&_n.call(e,r)&&(n[r]=e[r]);return n})(n,["extent","coordinates","width","height"]);e.length<2&&console.warn("RGB解析需要2个波段的数据");const[l,c]=s.bands||[0,1],u=[e[l],e[c]],h=[];for(let e=0;e<u[0].length;e++)h.push((u[1][e]-u[0][e])/(u[1][e]+u[0][e]));const d=x(i,r);var f,p;return{_id:1,dataArray:[(f=yn({_id:1,data:h,width:o,height:a},s),p={coordinates:d},fn(f,pn(p)))]}})),s("cluster",rr),s("filter",(function(e,t){const{callback:n}=t;return n&&(e.dataArray=e.dataArray.filter(n)),e})),s("join",(function(e,t){const{sourceField:n,targetField:r,data:i}=t,o={};return i.forEach((e=>{o[e[n]]=e})),e.dataArray=e.dataArray.map((e=>{const t=e[r];return Br(Br({},e),o[t])})),e})),s("map",(function(e,t){const{callback:n}=t;return n&&(e.dataArray=e.dataArray.map(n)),e})),s("grid",(function(e,t){const n=e.dataArray,{size:r=10}=t,i=r/(2*Math.PI*yr)*(256<<20)/2,{gridHash:o,gridOffset:a}=function(e,t){let n,r=1/0,i=-1/0;for(const t of e)n=t.coordinates[1],Number.isFinite(n)&&(r=n<r?n:r,i=n>i?n:i);const o=(s=(r+i)/2,{yOffset:(a=t)/yr*(180/Math.PI),xOffset:(l=s,a/yr*(180/Math.PI)/Math.cos(l*Math.PI/180))});var a,s,l;if(o.xOffset<=0||o.yOffset<=0)return{gridHash:{},gridOffset:o};const c={};for(const t of e){const e=t.coordinates[1],n=t.coordinates[0];if(Number.isFinite(e)&&Number.isFinite(n)){const r=`${Math.floor((e+90)/o.yOffset)}-${Math.floor((n+180)/o.xOffset)}`;c[r]=c[r]||{count:0,points:[]},c[r].count+=1,c[r].points.push(t)}}return{gridHash:c,gridOffset:o}}(n,r),s=function(e,t,n){return Object.keys(e).reduce(((r,i,o)=>{const a=i.split("-"),s=parseInt(a[0],10),l=parseInt(a[1],10),c={};if(n.field&&n.method){const t=y.ep.getColumn(e[i].points,n.field);c[n.method]=y.ep.statMap[n.method](t)}return Object.assign(c,{_id:o,coordinates:(0,y.se)([t.xOffset*(l+.5)-180,t.yOffset*(s+.5)-90]),rawData:e[i].points,count:e[i].count}),r.push(c),r}),[])}(o,a,t);return{yOffset:i,xOffset:i,radius:i,type:"grid",dataArray:s}})),s("hexagon",(function(e,t){const n=e.dataArray,{size:r=10,method:i="sum"}=t,o=r/(2*Math.PI*6378e3)*(256<<20)/2,a=n.map((e=>{const[t,n]=(0,y.se)(e.coordinates);return r=((e,t)=>{for(var n in t||(t={}))Lr.call(t,n)&&Mr(e,n,t[n]);if(Cr)for(var n of Cr(t))Or.call(t,n)&&Mr(e,n,t[n]);return e})({},e),Sr(r,Rr({coordinates:[t,n]}));var r})),s=function(){var e,t,n,r=0,i=0,o=1,a=1,s=br,l=Tr;function c(e){var r,i={},o=[],a=e.length;for(r=0;r<a;++r)if(!isNaN(u=+s.call(null,c=e[r],r,e))&&!isNaN(h=+l.call(null,c,r,e))){var c,u,h,d=Math.round(h/=n),f=Math.round(u=u/t-(1&d)/2),p=h-d;if(3*Math.abs(p)>1){var g=u-f,m=f+(u<f?-1:1)/2,_=d+(h<d?-1:1),v=u-m,y=h-_;g*g+p*p>v*v+y*y&&(f=m+(1&d?1:-1)/2,d=_)}var E=f+"-"+d,A=i[E];A?A.push(c):(o.push(A=i[E]=[c]),A.x=(f+(1&d)/2)*t,A.y=d*n)}return o}function u(e){var t=0,n=0;return Ar.map((function(r){var i=Math.sin(r)*e,o=-Math.cos(r)*e,a=i-t,s=o-n;return t=i,n=o,[a,s]}))}return c.hexagon=function(t){return"m"+u(null==t?e:+t).join("l")+"z"},c.centers=function(){for(var s=[],l=Math.round(i/n),c=Math.round(r/t),u=l*n;u<a+e;u+=n,++l)for(var h=c*t+(1&l)*t/2;h<o+t/2;h+=t)s.push([h,u]);return s},c.mesh=function(){var t=u(e).slice(0,4).join("l");return c.centers().map((function(e){return"M"+e+"m"+t})).join("")},c.x=function(e){return arguments.length?(s=e,c):s},c.y=function(e){return arguments.length?(l=e,c):l},c.radius=function(r){return arguments.length?(t=2*(e=+r)*Math.sin(Er),n=1.5*e,c):e},c.size=function(e){return arguments.length?(r=i=0,o=+e[0],a=+e[1],c):[o-r,a-i]},c.extent=function(e){return arguments.length?(r=+e[0][0],i=+e[0][1],o=+e[1][0],a=+e[1][1],c):[[r,i],[o,a]]},c.radius(1)}().radius(o).x((e=>e.coordinates[0])).y((e=>e.coordinates[1]));return{dataArray:s(a).map(((e,n)=>{if(t.field&&i){const n=y.ep.getColumn(e,t.field);e[i]=y.ep.statMap[i](n)}return{[t.method]:e[i],count:e.length,rawData:e,coordinates:[e.x,e.y],_id:n}})),radius:o,xOffset:o,yOffset:o,type:"hexagon"}}));var Fr=vr,Ur=n(69740),kr=n(24586);class Gr extends Zn.EventEmitter{getMarkerLayerContainerSize(){}constructor(e){super(),(0,kr.A)(this,"markerOption",void 0),(0,kr.A)(this,"popup",void 0),(0,kr.A)(this,"mapsService",void 0),(0,kr.A)(this,"lngLat",void 0),(0,kr.A)(this,"scene",void 0),(0,kr.A)(this,"added",!1),(0,kr.A)(this,"preLngLat",{lng:0,lat:0}),(0,kr.A)(this,"onMarkerDragStart",(e=>{const t=this.mapsService.getContainer();if(!t)return;this.mapsService.setMapStatus({dragEnable:!1,zoomEnable:!1});const{left:n,top:r}=t.getClientRects()[0],{x:i,y:o}=e;this.preLngLat=this.mapsService.containerToLngLat([i-n,o-r]),this.mapsService.on("mousemove",this.onMarkerDragMove),document.addEventListener("mouseup",this.onMarkerDragEnd),this.emit("dragstart",this.lngLat)})),(0,kr.A)(this,"onMarkerDragMove",(e=>{const t=e.lngLat||e.lnglat,{lng:n,lat:r}=this.preLngLat,{lng:i,lat:o}=t,a={lng:this.lngLat.lng+i-n,lat:this.lngLat.lat+o-r};this.setLnglat(a),this.preLngLat=t,this.emit("dragging",a)})),(0,kr.A)(this,"onMarkerDragEnd",(()=>{this.mapsService.setMapStatus({dragEnable:!0,zoomEnable:!0}),this.mapsService.off("mousemove",this.onMarkerDragMove),document.removeEventListener("mouseup",this.onMarkerDragEnd),this.emit("dragend",this.lngLat)})),(0,kr.A)(this,"eventHandle",(e=>{this.polyfillEvent(e),this.emit(e.type,{target:e,data:this.markerOption.extData,lngLat:this.lngLat})})),(0,kr.A)(this,"touchStartTime",void 0),this.markerOption=(0,Ur.A)((0,Ur.A)({},this.getDefault()),e),(0,y.vJ)(["update","onMove","onMapClick","updatePositionWhenZoom"],this),this.init()}getDefault(){return{element:void 0,anchor:y._O.BOTTOM,offsets:[0,0],color:"#5B8FF9",draggable:!1}}addTo(e){this.scene=e,this.mapsService=e.mapService;const{element:t}=this.markerOption;return this.mapsService.getMarkerContainer().appendChild(t),this.registerMarkerEvent(t),this.mapsService.on("camerachange",this.update),this.update(),this.updateDraggable(),this.added=!0,this.emit("added"),this}remove(){this.mapsService&&(this.mapsService.off("click",this.onMapClick),this.mapsService.off("move",this.update),this.mapsService.off("moveend",this.update),this.mapsService.off("camerachange",this.update)),this.unRegisterMarkerEvent(),this.removeAllListeners();const{element:e}=this.markerOption;return e&&y.dv.remove(e),this.popup&&this.popup.remove(),this}setLnglat(e){return this.lngLat=e,Array.isArray(e)&&(this.lngLat={lng:e[0],lat:e[1]}),this.popup&&this.popup.setLnglat(this.lngLat),this.update(),this}getLnglat(){return this.lngLat}getElement(){return this.markerOption.element}setElement(e){if(!this.added)return this.once("added",(()=>{this.setElement(e)})),this;const{element:t}=this.markerOption;return t&&y.dv.remove(t),this.markerOption.element=e,this.init(),this.mapsService.getMarkerContainer().appendChild(e),this.registerMarkerEvent(e),this.updateDraggable(),this.update(),this}openPopup(){if(!this.added)return this.once("added",(()=>{this.openPopup()})),this;const e=this.popup;return e?(e.isOpen()||e.addTo(this.scene),this):this}closePopup(){this.added||this.once("added",(()=>{this.closePopup()}));const e=this.popup;return e&&e.remove(),this}setPopup(e){return this.popup=e,this.lngLat&&this.popup.setLnglat(this.lngLat),this}togglePopup(){const e=this.popup;return e?(e.isOpen()?e.remove():e.addTo(this.scene),this):this}getPopup(){return this.popup}getOffset(){return this.markerOption.offsets}setDraggable(e){this.markerOption.draggable=e,this.updateDraggable()}getDraggable(){return this.markerOption.draggable}getExtData(){return this.markerOption.extData}setExtData(e){this.markerOption.extData=e}update(){if(!this.mapsService)return;const{element:e,anchor:t}=this.markerOption;this.updatePosition(),y.dv.setTransform(e,`${y.Gv[t]}`)}updatePositionWhenZoom(e){if(!this.mapsService)return;const{element:t,offsets:n}=this.markerOption,{lng:r,lat:i}=this.lngLat;if(t){t.style.display="block",t.style.whiteSpace="nowrap";const{containerHeight:o,containerWidth:a,bounds:s}=this.getMarkerLayerContainerSize()||this.getCurrentContainerSize();if(!s)return;const l=e.map,c=e.center,u=e.zoom,h=l.DE(this.lngLat,u,c);if(h.x=Math.round(h.x+n[0]),h.y=Math.round(h.y-n[1]),Math.abs(s[0][0])>180||Math.abs(s[1][0])>180){if(h.x>a){const e=this.mapsService.lngLatToContainer([r-360,i]);h.x=e.x}if(h.x<0){const e=this.mapsService.lngLatToContainer([r+360,i]);h.x=e.x}}(h.x>a||h.x<0||h.y>o||h.y<0)&&(t.style.display="none"),t.style.left=h.x+"px",t.style.top=h.y+"px",t.style.transition="left 0.25s cubic-bezier(0,0,0.25,1), top 0.25s cubic-bezier(0,0,0.25,1)"}}onMapClick(e){const{element:t}=this.markerOption;this.popup&&t&&this.togglePopup()}getCurrentContainerSize(){const e=this.mapsService.getContainer();return{containerHeight:(null==e?void 0:e.scrollHeight)||0,containerWidth:(null==e?void 0:e.scrollWidth)||0,bounds:this.mapsService.getBounds()}}updateDraggable(){const{element:e}=this.markerOption;null==e||e.removeEventListener("mousedown",this.onMarkerDragStart),this.mapsService.off("mousemove",this.onMarkerDragMove),document.removeEventListener("mouseup",this.onMarkerDragEnd),this.markerOption.draggable&&(null==e||e.addEventListener("mousedown",this.onMarkerDragStart))}updatePosition(){if(!this.mapsService)return;const{element:e,offsets:t}=this.markerOption,{lng:n,lat:r}=this.lngLat,i=this.mapsService.lngLatToContainer([n,r]);if(e){e.style.display="block",e.style.whiteSpace="nowrap";const{containerHeight:o,containerWidth:a,bounds:s}=this.getMarkerLayerContainerSize()||this.getCurrentContainerSize();if(!s)return;if(Math.abs(s[0][0])>180||Math.abs(s[1][0])>180){if(i.x>a){const e=this.mapsService.lngLatToContainer([n-360,r]);i.x=e.x}if(i.x<0){const e=this.mapsService.lngLatToContainer([n+360,r]);i.x=e.x}}(i.x>a||i.x<0||i.y>o||i.y<0)&&(e.style.display="none"),e.style.left=i.x+t[0]+"px",e.style.top=i.y-t[1]+"px"}}init(){let{element:e}=this.markerOption;const{color:t,anchor:n}=this.markerOption;if(!e){e=y.dv.create("div"),this.markerOption.element=e;const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height","48px"),n.setAttributeNS(null,"width","48px"),n.setAttributeNS(null,"viewBox","0 0 1024 1024");const r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"d","M512 490.666667C453.12 490.666667 405.333333 442.88 405.333333 384 405.333333 325.12 453.12 277.333333 512 277.333333 570.88 277.333333 618.666667 325.12 618.666667 384 618.666667 442.88 570.88 490.666667 512 490.666667M512 85.333333C346.88 85.333333 213.333333 218.88 213.333333 384 213.333333 608 512 938.666667 512 938.666667 512 938.666667 810.666667 608 810.666667 384 810.666667 218.88 677.12 85.333333 512 85.333333Z"),r.setAttributeNS(null,"fill",t),n.appendChild(r),e.appendChild(n)}y.dv.addClass(e,"l7-marker"),Object.keys(this.markerOption.style||{}).forEach((t=>{var n,r;const i=(null===(n=this.markerOption)||void 0===n?void 0:n.style)&&(null===(r=this.markerOption)||void 0===r?void 0:r.style[t]);e&&(e.style[t]=i)})),(0,y._B)(e,n,"marker")}registerMarkerEvent(e){e.addEventListener("click",this.onMapClick),e.addEventListener("mousemove",this.eventHandle),e.addEventListener("click",this.eventHandle),e.addEventListener("mousedown",this.eventHandle),e.addEventListener("mouseup",this.eventHandle),e.addEventListener("dblclick",this.eventHandle),e.addEventListener("contextmenu",this.eventHandle),e.addEventListener("mouseover",this.eventHandle),e.addEventListener("mouseout",this.eventHandle),e.addEventListener("touchstart",this.eventHandle),e.addEventListener("touchend",this.eventHandle)}unRegisterMarkerEvent(){const e=this.getElement();e.removeEventListener("click",this.onMapClick),e.removeEventListener("mousemove",this.eventHandle),e.removeEventListener("click",this.eventHandle),e.removeEventListener("mousedown",this.eventHandle),e.removeEventListener("mouseup",this.eventHandle),e.removeEventListener("dblclick",this.eventHandle),e.removeEventListener("contextmenu",this.eventHandle),e.removeEventListener("mouseover",this.eventHandle),e.removeEventListener("mouseout",this.eventHandle),e.removeEventListener("touchstart",this.eventHandle),e.removeEventListener("touchend",this.eventHandle)}polyfillEvent(e){this.mapsService&&"amap"===this.mapsService.getType()&&((0,y.qQ)()||("touchstart"===e.type&&(this.touchStartTime=Date.now()),"touchend"===e.type&&Date.now()-this.touchStartTime<300&&this.emit("click",{target:e,data:this.markerOption.extData,lngLat:this.lngLat})))}addDragHandler(e){return null}onUp(e){throw new Error("Method not implemented.")}}const{merge:zr}=y.uG;Zn.EventEmitter,n(83061);class jr extends(Yn()){constructor(e){super(),(0,kr.A)(this,"controlOption",void 0),(0,kr.A)(this,"container",void 0),(0,kr.A)(this,"isShow",void 0),(0,kr.A)(this,"sceneContainer",void 0),(0,kr.A)(this,"scene",void 0),(0,kr.A)(this,"mapsService",void 0),(0,kr.A)(this,"renderService",void 0),(0,kr.A)(this,"layerService",void 0),(0,kr.A)(this,"controlService",void 0),(0,kr.A)(this,"configService",void 0),jr.controlCount++,this.controlOption=(0,Ur.A)((0,Ur.A)({},this.getDefault(e)),e||{})}getOptions(){return this.controlOption}setOptions(e){const t=this.getDefault(e);Object.entries(e).forEach((([n,r])=>{void 0===r&&(e[n]=t[n])})),"position"in e&&this.setPosition(e.position),"className"in e&&this.setClassName(e.className),"style"in e&&this.setStyle(e.style),this.controlOption=(0,Ur.A)((0,Ur.A)({},this.controlOption),e)}addTo(e){this.mapsService=e.mapService,this.renderService=e.rendererService,this.layerService=e.layerService,this.controlService=e.controlService,this.configService=e.globalConfigService,this.scene=e.sceneService,this.sceneContainer=e,this.isShow=!0,this.container=this.onAdd(),y.dv.addClass(this.container,"l7-control");const{className:t,style:n}=this.controlOption;return t&&this.setClassName(t),n&&this.setStyle(n),this.insertContainer(),this.emit("add",this),this}remove(){if(!this.mapsService)return this;y.dv.remove(this.container),this.onRemove(),this.emit("remove",this)}onAdd(){return y.dv.create("div")}onRemove(){}show(){const e=this.container;y.dv.removeClass(e,"l7-control--hide"),this.isShow=!0,this.emit("show",this)}hide(){const e=this.container;y.dv.addClass(e,"l7-control--hide"),this.isShow=!1,this.emit("hide",this)}getDefault(e){return{position:Ot.CR.TOPRIGHT,name:`${jr.controlCount}`}}getContainer(){return this.container}getIsShow(){return this.isShow}_refocusOnMap(e){if(this.mapsService&&e&&e.screenX>0&&e.screenY>0){const e=this.mapsService.getContainer();null!==e&&e.focus()}}setPosition(e=Ot.CR.TOPLEFT){const t=this.controlService;return t&&t.removeControl(this),this.controlOption.position=e,t&&t.addControl(this,this.sceneContainer),this}setClassName(e){const t=this.container,{className:n}=this.controlOption;n&&y.dv.removeClass(t,n),e&&y.dv.addClass(t,e)}setStyle(e){const t=this.container;e?t.setAttribute("style",e):t.removeAttribute("style")}insertContainer(){const e=this.controlOption.position,t=this.container;if(e instanceof Element)e.appendChild(t);else{const n=this.controlService.controlCorners[e];["bottomleft","bottomright","righttop","rightbottom"].includes(e)?n.insertBefore(t,n.firstChild):n.appendChild(t)}}checkUpdateOption(e,t){return t.some((t=>t in e))}}(0,kr.A)(jr,"controlCount",0);class Vr extends Zn.EventEmitter{get buttonRect(){return this.button.getBoundingClientRect()}constructor(e,t){super(),(0,kr.A)(this,"popperDOM",void 0),(0,kr.A)(this,"contentDOM",void 0),(0,kr.A)(this,"button",void 0),(0,kr.A)(this,"option",void 0),(0,kr.A)(this,"isShow",!1),(0,kr.A)(this,"content",void 0),(0,kr.A)(this,"timeout",null),(0,kr.A)(this,"show",(()=>(this.isShow||!this.contentDOM.innerHTML||(this.resetPopperPosition(),y.dv.removeClass(this.popperDOM,"l7-popper-hide"),this.isShow=!0,this.option.unique&&Vr.conflictPopperList.forEach((e=>{e!==this&&e.isShow&&e.hide()})),this.emit("show"),window.addEventListener("pointerdown",this.onPopperUnClick)),this))),(0,kr.A)(this,"hide",(()=>this.isShow?(y.dv.addClass(this.popperDOM,"l7-popper-hide"),this.isShow=!1,this.emit("hide"),window.removeEventListener("pointerdown",this.onPopperUnClick),this):this)),(0,kr.A)(this,"setHideTimeout",(()=>{this.timeout||(this.timeout=window.setTimeout((()=>{this.isShow&&(this.hide(),this.timeout=null)}),300))})),(0,kr.A)(this,"clearHideTimeout",(()=>{this.timeout&&(window.clearTimeout(this.timeout),this.timeout=null)})),(0,kr.A)(this,"onBtnClick",(()=>{this.isShow?this.hide():this.show()})),(0,kr.A)(this,"onPopperUnClick",(e=>{y.dv.findParentElement(e.target,[".l7-button-control",".l7-popper-content"])||this.hide()})),(0,kr.A)(this,"onBtnMouseLeave",(()=>{this.setHideTimeout()})),(0,kr.A)(this,"onBtnMouseMove",(()=>{this.clearHideTimeout(),this.isShow||this.show()})),this.button=e,this.option=t,this.init(),t.unique&&Vr.conflictPopperList.push(this)}getPopperDOM(){return this.popperDOM}getIsShow(){return this.isShow}getContent(){return this.content}setContent(e){"string"==typeof e?this.contentDOM.innerHTML=e:e instanceof HTMLElement&&(y.dv.clearChildren(this.contentDOM),this.contentDOM.appendChild(e)),this.content=e}init(){const{trigger:e}=this.option;this.popperDOM=this.createPopper(),"click"===e?this.button.addEventListener("click",this.onBtnClick):(this.button.addEventListener("mousemove",this.onBtnMouseMove),this.button.addEventListener("mouseleave",this.onBtnMouseLeave),this.popperDOM.addEventListener("mousemove",this.onBtnMouseMove),this.popperDOM.addEventListener("mouseleave",this.onBtnMouseLeave))}destroy(){this.button.removeEventListener("click",this.onBtnClick),this.button.removeEventListener("mousemove",this.onBtnMouseMove),this.button.removeEventListener("mousemove",this.onBtnMouseLeave),this.popperDOM.removeEventListener("mousemove",this.onBtnMouseMove),this.popperDOM.removeEventListener("mouseleave",this.onBtnMouseLeave),y.dv.remove(this.popperDOM)}resetPopperPosition(){const e={},{container:t,offset:n=[0,0],placement:r}=this.option,[i,o]=n,a=this.button.getBoundingClientRect(),s=t.getBoundingClientRect(),{left:l,right:c,top:u,bottom:h}=y.dv.getDiffRect(a,s);let d=!1,f=!1;/^(left|right)/.test(r)?(r.includes("left")?e.right=`${a.width+c}px`:r.includes("right")&&(e.left=`${a.width+l}px`),r.includes("start")?e.top=`${u}px`:r.includes("end")?e.bottom=`${h}px`:(e.top=`${u+a.height/2}px`,f=!0,e.transform=`translate(${i}px, calc(${o}px - 50%))`)):/^(top|bottom)/.test(r)&&(r.includes("top")?e.bottom=`${a.height+h}px`:r.includes("bottom")&&(e.top=`${a.height+u}px`),r.includes("start")?e.left=`${l}px`:r.includes("end")?e.right=`${c}px`:(e.left=`${l+a.width/2}px`,d=!0,e.transform=`translate(calc(${i}px - 50%), ${o}px)`)),e.transform=`translate(calc(${i}px - ${d?"50%":"0%"}), calc(${o}px - ${f?"50%":"0%"})`;const p=r.split("-");p.length&&y.dv.addClass(this.popperDOM,p.map((e=>`l7-popper-${e}`)).join(" ")),y.dv.addStyle(this.popperDOM,y.dv.css2Style(e))}createPopper(){const{container:e,className:t="",content:n}=this.option,r=y.dv.create("div",`l7-popper l7-popper-hide ${t}`),i=y.dv.create("div","l7-popper-content"),o=y.dv.create("div","l7-popper-arrow");return r.appendChild(i),r.appendChild(o),e.appendChild(r),this.popperDOM=r,this.contentDOM=i,n&&this.setContent(n),r}}(0,kr.A)(Vr,"conflictPopperList",[]);var Hr=n(86330);const Wr=[["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"]],Xr=(()=>{if("undefined"==typeof document)return!1;const e=Wr[0],t={};for(const n of Wr)if((null==n?void 0:n[1])in document){for(const[r,i]of n.entries())t[e[r]]=i;return t}return!1})(),Zr={change:Xr.fullscreenchange,error:Xr.fullscreenerror};let Yr={request:(e=document.documentElement,t)=>new Promise(((n,r)=>{const i=()=>{Yr.off("change",i),n()};Yr.on("change",i);const o=e[Xr.requestFullscreen](t);o instanceof Promise&&o.then(i).catch(r)})),exit:()=>new Promise(((e,t)=>{if(!Yr.isFullscreen)return void e();const n=()=>{Yr.off("change",n),e()};Yr.on("change",n);const r=document[Xr.exitFullscreen]();r instanceof Promise&&r.then(n).catch(t)})),toggle:(e,t)=>Yr.isFullscreen?Yr.exit():Yr.request(e,t),onchange(e){Yr.on("change",e)},onerror(e){Yr.on("error",e)},on(e,t){const n=Zr[e];n&&document.addEventListener(n,t,!1)},off(e,t){const n=Zr[e];n&&document.removeEventListener(n,t,!1)},raw:Xr};Object.defineProperties(Yr,{isFullscreen:{get:()=>Boolean(document[Xr.fullscreenElement])},element:{enumerable:!0,get:()=>{var e;return null!==(e=document[Xr.fullscreenElement])&&void 0!==e?e:void 0}},isEnabled:{enumerable:!0,get:()=>Boolean(document[Xr.fullscreenEnabled])}}),Xr||(Yr={isEnabled:!1});class qr extends jr{getDefault(){return{position:Ot.CR.BOTTOMLEFT,name:"logo",href:"https://l7.antv.antgroup.com/",img:"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*GRb1TKp4HcMAAAAAAAAAAAAAARQnAQ"}}onAdd(){const e=y.dv.create("div","l7-control-logo");return this.setLogoContent(e),e}onRemove(){return null}setOptions(e){super.setOptions(e),this.checkUpdateOption(e,["img","href"])&&(y.dv.clearChildren(this.container),this.setLogoContent(this.container))}setLogoContent(e){const{href:t,img:n}=this.controlOption,r=y.dv.create("img");if(r.setAttribute("src",n),r.setAttribute("aria-label","AntV logo"),y.dv.setUnDraggable(r),t){const n=y.dv.create("a","l7-control-logo-link");n.target="_blank",n.href=t,n.rel="noopener nofollow",n.setAttribute("rel","noopener nofollow"),n.appendChild(r),e.appendChild(n)}else e.appendChild(r)}}var Kr=n(14223);class Qr{constructor(){(0,kr.A)(this,"mapService",void 0),(0,kr.A)(this,"fontService",void 0)}apply(e,{styleAttributeService:t,mapService:n,fontService:r}){var i=this;this.mapService=n,this.fontService=r,e.hooks.init.tapPromise("DataMappingPlugin",(0,Hr.A)((function*(){e.log(Ot.L2.MappingStart,Ot.X$.INIT),i.generateMaping(e,{styleAttributeService:t}),e.log(Ot.L2.MappingEnd,Ot.X$.INIT)}))),e.hooks.beforeRenderData.tapPromise("DataMappingPlugin",function(){var n=(0,Hr.A)((function*(n){if(!n)return n;e.dataState.dataMappingNeedUpdate=!1,e.log(Ot.L2.MappingStart,Ot.X$.UPDATE);const r=i.generateMaping(e,{styleAttributeService:t});return e.log(Ot.L2.MappingEnd,Ot.X$.UPDATE),r}));return function(e){return n.apply(this,arguments)}}()),e.hooks.beforeRender.tap("DataMappingPlugin",(()=>{const n=e.getSource();if(e.layerModelNeedUpdate||!n||!n.inited)return;const r=t.getLayerStyleAttributes()||[],i=t.getLayerStyleAttribute("filter"),{dataArray:o}=n.data;if(Array.isArray(o)&&0===o.length)return;const a=r.filter((e=>e.needRemapping));let s=o;if(null!=i&&i.needRemapping&&null!=i&&i.scale&&(s=o.filter((e=>this.applyAttributeMapping(i,e)[0]))),a.length){const t=this.mapping(e,a,s,e.getEncodedData());e.setEncodedData(t)}}))}generateMaping(e,{styleAttributeService:t}){const n=t.getLayerStyleAttributes()||[],r=t.getLayerStyleAttribute("filter"),{dataArray:i}=e.getSource().data;let o=i;null!=r&&r.scale&&(o=i.filter((e=>this.applyAttributeMapping(r,e)[0]))),o=e.processData(o);const a=this.mapping(e,n,o,void 0);return e.setEncodedData(a),e.emit("dataUpdate",null),!0}mapping(e,t,n,r){const i=t.filter((e=>void 0!==e.scale)).filter((e=>"filter"!==e.name)),o=n.map(((e,t)=>{const n=r?r[t]:{},o=(0,Ur.A)({id:e._id,coordinates:e.coordinates},n);return i.forEach((t=>{let n=this.applyAttributeMapping(t,e);"color"!==t.name&&"stroke"!==t.name||(n=n.map((e=>(0,y.HR)(e)))),o[t.name]=Array.isArray(n)&&1===n.length?n[0]:n,"shape"===t.name&&(o.shape=this.fontService.getIconFontKey(o[t.name]))})),o}));return t.forEach((e=>{e.needRemapping=!1})),this.adjustData2SimpleCoordinates(o),o}adjustData2SimpleCoordinates(e){e.length>0&&"SIMPLE"===this.mapService.version&&e.map((e=>{e.simpleCoordinate||(e.coordinates=this.unProjectCoordinates(e.coordinates),e.simpleCoordinate=!0)}))}unProjectCoordinates(e){if("number"==typeof e[0])return this.mapService.simpleMapCoord.unproject(e);if(e[0]&&e[0][0]instanceof Array){const t=[];return e.map((e=>{const n=[];e.map((e=>{n.push(this.mapService.simpleMapCoord.unproject(e))})),t.push(n)})),t}{const t=[];return e.map((e=>{t.push(this.mapService.simpleMapCoord.unproject(e))})),t}}applyAttributeMapping(e,t){var n;if(!e.scale)return[];const r=(null==e||null===(n=e.scale)||void 0===n?void 0:n.scalers)||[],i=[];return r.forEach((({field:n})=>{var r;(t.hasOwnProperty(n)||"variable"===(null===(r=e.scale)||void 0===r?void 0:r.type))&&i.push(t[n])})),e.mapping?e.mapping(i):[]}getArrowPoints(e,t){const n=[t[0]-e[0],t[1]-e[1]],r=(0,y.S8)(n);return[e[0]+1e-4*r[0],e[1]+1e-4*r[1]]}}class $r{constructor(){(0,kr.A)(this,"mapService",void 0)}apply(e){var t=this;this.mapService=e.getContainer().mapService,e.hooks.init.tapPromise("DataSourcePlugin",(0,Hr.A)((function*(){e.log(Ot.L2.SourceInitStart,Ot.X$.INIT);let n=e.getSource();if(!n){const{data:t,options:r}=e.sourceOption||e.defaultSourceConfig;n=new Fr(t,r),e.setSource(n)}n.inited?(t.updateClusterData(e),e.log(Ot.L2.SourceInitEnd,Ot.X$.INIT)):yield new Promise((r=>{n.on("update",(n=>{"inited"===n.type&&(t.updateClusterData(e),e.log(Ot.L2.SourceInitEnd,Ot.X$.INIT)),r(null)}))}))}))),e.hooks.beforeRenderData.tapPromise("DataSourcePlugin",(0,Hr.A)((function*(){const n=t.updateClusterData(e),r=e.dataState.dataSourceNeedUpdate;return e.dataState.dataSourceNeedUpdate=!1,n||r})))}updateClusterData(e){if(e.isTileLayer||e.tileLayer||!e.getSource())return!1;const t=e.getSource(),n=t.cluster,{zoom:r=0}=t.clusterOptions,i=this.mapService.getZoom()-1,o=e.dataState.dataSourceNeedUpdate;return n&&o&&t.updateClusterData(Math.floor(i)),!!(n&&Math.abs(e.clusterZoom-i)>=1)&&(r!==Math.floor(i)&&t.updateClusterData(Math.floor(i)),e.clusterZoom=i,!0)}}function Jr(e,t){let n,r;if(void 0===t)for(const t of e)null!=t&&(void 0===n?t>=t&&(n=r=t):(n>t&&(n=t),r<t&&(r=t)));else{let i=-1;for(let o of e)null!=(o=t(o,++i,e))&&(void 0===n?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}var ei=n(66424);function ti(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}function ni(e){return function(){return e}}function ri(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):ni(isNaN(e)?t:e)}function ii(e){return function(t){var n,r,i=t.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=(0,ei.Qh)(t[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=e(o),a=e(a),s=e(s),r.opacity=1,function(e){return r.r=o(e),r.g=a(e),r.b=s(e),r+""}}}!function e(t){var n=function(e){return 1==(e=+e)?ri:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):ni(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=(0,ei.Qh)(e)).r,(t=(0,ei.Qh)(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=ri(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);var oi=ii((function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],a=r>0?e[r-1]:2*i-o,s=r<t-1?e[r+2]:2*o-i;return ti((n-r/t)*t,a,i,o,s)}}));function ai(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function si(e){var t;return 1===e.length&&(t=e,e=function(e,n){return ai(t(e),n)}),{left:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}ii((function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],o=e[r%t],a=e[(r+1)%t],s=e[(r+2)%t];return ti((n-r/t)*t,i,o,a,s)}}));var li=si(ai),ci=li.right;li.left;const ui=ci;var hi=Array.prototype,di=(hi.slice,hi.map,Math.sqrt(50)),fi=Math.sqrt(10),pi=Math.sqrt(2);function gi(e,t,n){var r,i,o,a,s=-1;if(n=+n,(e=+e)==(t=+t)&&n>0)return[e];if((r=t<e)&&(i=e,e=t,t=i),0===(a=mi(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(e-s)/a;return r&&o.reverse(),o}function mi(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=di?10:o>=fi?5:o>=pi?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=di?10:o>=fi?5:o>=pi?2:1)}function _i(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=di?i*=10:o>=fi?i*=5:o>=pi&&(i*=2),t<e?-i:i}function vi(e){return null===e?NaN:+e}function yi(e,t,n){if(null==n&&(n=vi),r=e.length){if((t=+t)<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e);return a+(+n(e[o+1],o+1,e)-a)*(i-o)}}var Ei="$";function Ai(){}function bi(e,t){var n=new Ai;if(e instanceof Ai)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}Ai.prototype=bi.prototype={constructor:Ai,has:function(e){return Ei+e in this},get:function(e){return this[Ei+e]},set:function(e,t){return this[Ei+e]=t,this},remove:function(e){var t=Ei+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===Ei&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===Ei&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===Ei&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===Ei&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===Ei&&++e;return e},empty:function(){for(var e in this)if(e[0]===Ei)return!1;return!0},each:function(e){for(var t in this)t[0]===Ei&&e(this[t],t.slice(1),this)}};const Ti=bi;function xi(){}var Si=Ti.prototype;xi.prototype=function(e,t){var n=new xi;if(e instanceof xi)e.each((function(e){n.add(e)}));else if(e){var r=-1,i=e.length;if(null==t)for(;++r<i;)n.add(e[r]);else for(;++r<i;)n.add(t(e[r],r,e))}return n}.prototype={constructor:xi,has:Si.has,add:function(e){return this[Ei+(e+="")]=e,this},remove:Si.remove,clear:Si.clear,values:Si.keys,size:Si.size,empty:Si.empty,each:Si.each};var Ri=Array.prototype,Ci=Ri.map,Li=Ri.slice;function Oi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Mi(e,t){switch(arguments.length){case 0:break;case 1:this.interpolator(e);break;default:this.interpolator(t).domain(e)}return this}var Ii={name:"implicit"};function wi(){var e=Ti(),t=[],n=[],r=Ii;function i(i){var o=i+"",a=e.get(o);if(!a){if(r!==Ii)return r;e.set(o,a=t.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=Ti();for(var r,o,a=-1,s=n.length;++a<s;)e.has(o=(r=n[a])+"")||e.set(o,t.push(r));return i},i.range=function(e){return arguments.length?(n=Li.call(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return wi(t,n).unknown(r)},Oi.apply(i,arguments),i}function Pi(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}function Ni(e){return function(){return e}}function Di(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Ni(isNaN(e)?t:e)}const Bi=function e(t){var n=function(e){return 1==(e=+e)?Di:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Ni(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=(0,ei.Qh)(e)).r,(t=(0,ei.Qh)(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Di(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Fi(e){return function(t){var n,r,i=t.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=(0,ei.Qh)(t[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=e(o),a=e(a),s=e(s),r.opacity=1,function(e){return r.r=o(e),r.g=a(e),r.b=s(e),r+""}}}function Ui(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Xi(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function ki(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Gi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function zi(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Xi(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}Fi((function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],a=r>0?e[r-1]:2*i-o,s=r<t-1?e[r+2]:2*o-i;return Pi((n-r/t)*t,a,i,o,s)}})),Fi((function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],o=e[r%t],a=e[(r+1)%t],s=e[(r+2)%t];return Pi((n-r/t)*t,i,o,a,s)}}));var ji=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Vi=new RegExp(ji.source,"g");function Hi(e,t){var n,r,i,o=ji.lastIndex=Vi.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=ji.exec(e))&&(r=Vi.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:Gi(n,r)})),o=Vi.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function Wi(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function Xi(e,t){var n,r,i=typeof t;return null==t||"boolean"===i?Ni(t):("number"===i?Gi:"string"===i?(n=(0,ei.Ay)(t))?(t=n,Bi):Hi:t instanceof ei.Ay?Bi:t instanceof Date?ki:(r=t,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(t)?Ui:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?zi:Gi:Wi))(e,t)}function Zi(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Yi(e){return+e}var qi=[0,1];function Ki(e){return e}function Qi(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n});var n}function $i(e){var t,n=e[0],r=e[e.length-1];return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function Ji(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=Qi(i,r),o=n(a,o)):(r=Qi(r,i),o=n(o,a)),function(e){return o(r(e))}}function eo(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Qi(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=ui(e,t,1,r)-1;return o[n](i[n](t))}}function to(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function no(){var e,t,n,r,i,o,a=qi,s=qi,l=Xi,c=Ki;function u(){return r=Math.min(a.length,s.length)>2?eo:Ji,i=o=null,h}function h(t){return isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return h.invert=function(n){return c(t((o||(o=r(s,a.map(e),Gi)))(n)))},h.domain=function(e){return arguments.length?(a=Ci.call(e,Yi),c===Ki||(c=$i(a)),u()):a.slice()},h.range=function(e){return arguments.length?(s=Li.call(e),u()):s.slice()},h.rangeRound=function(e){return s=Li.call(e),l=Zi,u()},h.clamp=function(e){return arguments.length?(c=e?$i(a):Ki,h):c!==Ki},h.interpolate=function(e){return arguments.length?(l=e,u()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,r){return e=n,t=r,u()}}function ro(e,t){return no()(e,t)}var io,oo=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ao(e){if(!(t=oo.exec(e)))throw new Error("invalid format: "+e);var t;return new so({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function so(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function lo(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function co(e){return(e=lo(Math.abs(e)))?e[1]:NaN}function uo(e,t){var n=lo(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}ao.prototype=so.prototype,so.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const ho={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return uo(100*e,t)},r:uo,s:function(e,t){var n=lo(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(io=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+lo(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function fo(e){return e}var po,go,mo,_o=Array.prototype.map,vo=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yo(e){var t=e.domain;return e.ticks=function(e){var n=t();return gi(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return function(e,t,n,r){var i,o=_i(e,t,n);switch((r=ao(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(co(t)/3)))-co(Math.abs(e)))}(o,a))||(r.precision=i),mo(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,co(t)-co(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-co(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return go(r)}(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i=t(),o=0,a=i.length-1,s=i[o],l=i[a];return l<s&&(r=s,s=l,l=r,r=o,o=a,a=r),(r=mi(s,l,n))>0?r=mi(s=Math.floor(s/r)*r,l=Math.ceil(l/r)*r,n):r<0&&(r=mi(s=Math.ceil(s*r)/r,l=Math.floor(l*r)/r,n)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(l/r)*r,t(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(l*r)/r,t(i)),e},e}function Eo(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),e[r]=t.floor(o),e[i]=t.ceil(a),e}function Ao(e){return Math.log(e)}function bo(e){return Math.exp(e)}function To(e){return-Math.log(-e)}function xo(e){return-Math.exp(-e)}function So(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Ro(e){return function(t){return-e(-t)}}function Co(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Lo(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Oo(e){return e<0?-e*e:e*e}po=function(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?fo:(t=_o.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?fo:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(_o.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"-":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=ao(e)).fill,n=e.align,h=e.sign,d=e.symbol,f=e.zero,p=e.width,g=e.comma,m=e.precision,_=e.trim,v=e.type;"n"===v?(g=!0,v="g"):ho[v]||(void 0===m&&(m=12),_=!0,v="g"),(f||"0"===t&&"="===n)&&(f=!0,t="0",n="=");var y="$"===d?i:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",E="$"===d?o:/[%p]/.test(v)?l:"",A=ho[v],b=/[defgprs%]/.test(v);function T(e){var i,o,l,d=y,T=E;if("c"===v)T=A(e)+T,e="";else{var x=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:A(Math.abs(e),m),_&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),x&&0==+e&&"+"!==h&&(x=!1),d=(x?"("===h?h:c:"-"===h||"("===h?"":h)+d,T=("s"===v?vo[8+io/3]:"")+T+(x&&"("===h?")":""),b)for(i=-1,o=e.length;++i<o;)if(48>(l=e.charCodeAt(i))||l>57){T=(46===l?a+e.slice(i+1):e.slice(i))+T,e=e.slice(0,i);break}}g&&!f&&(e=r(e,1/0));var S=d.length+e.length+T.length,R=S<p?new Array(p-S+1).join(t):"";switch(g&&f&&(e=r(R+e,R.length?p-T.length:1/0),R=""),n){case"<":e=d+e+T+R;break;case"=":e=d+R+e+T;break;case"^":e=R.slice(0,S=R.length>>1)+d+e+T+R.slice(S);break;default:e=R+d+e+T}return s(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),T.toString=function(){return e+""},T}return{format:h,formatPrefix:function(e,t){var n=h(((e=ao(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(co(t)/3))),i=Math.pow(10,-r),o=vo[8+r/3];return function(e){return n(i*e)+o}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),go=po.format,mo=po.formatPrefix;var Mo=new Date,Io=new Date;function wo(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return wo((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return Mo.setTime(+t),Io.setTime(+r),e(Mo),e(Io),Math.floor(n(Mo,Io))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var Po=wo((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));Po.every=function(e){return isFinite(e=Math.floor(e))&&e>0?wo((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};const No=Po;Po.range;var Do=wo((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()}));const Bo=Do;Do.range;var Fo=1e3,Uo=6e4,ko=36e5,Go=864e5,zo=6048e5;function jo(e){return wo((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Uo)/zo}))}var Vo=jo(0),Ho=jo(1),Wo=jo(2),Xo=jo(3),Zo=jo(4),Yo=jo(5),qo=jo(6),Ko=(Vo.range,Ho.range,Wo.range,Xo.range,Zo.range,Yo.range,qo.range,wo((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Uo)/Go}),(function(e){return e.getDate()-1})));const Qo=Ko;Ko.range;var $o=wo((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Fo-e.getMinutes()*Uo)}),(function(e,t){e.setTime(+e+t*ko)}),(function(e,t){return(t-e)/ko}),(function(e){return e.getHours()}));const Jo=$o;$o.range;var ea=wo((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Fo)}),(function(e,t){e.setTime(+e+t*Uo)}),(function(e,t){return(t-e)/Uo}),(function(e){return e.getMinutes()}));const ta=ea;ea.range;var na=wo((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+t*Fo)}),(function(e,t){return(t-e)/Fo}),(function(e){return e.getUTCSeconds()}));const ra=na;na.range;var ia=wo((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));ia.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?wo((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):ia:null};const oa=ia;function aa(e){return wo((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/zo}))}ia.range;var sa=aa(0),la=aa(1),ca=aa(2),ua=aa(3),ha=aa(4),da=aa(5),fa=aa(6),pa=(sa.range,la.range,ca.range,ua.range,ha.range,da.range,fa.range,wo((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/Go}),(function(e){return e.getUTCDate()-1})));const ga=pa;pa.range;var ma=wo((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));ma.every=function(e){return isFinite(e=Math.floor(e))&&e>0?wo((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};const _a=ma;function va(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function ya(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Ea(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}ma.range;var Aa,ba,Ta={"-":"",_:" ",0:"0"},xa=/^\s*\d+/,Sa=/^%/,Ra=/[\\^$*+?|[\]().{}]/g;function Ca(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function La(e){return e.replace(Ra,"\\$&")}function Oa(e){return new RegExp("^(?:"+e.map(La).join("|")+")","i")}function Ma(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function Ia(e,t,n){var r=xa.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function wa(e,t,n){var r=xa.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Pa(e,t,n){var r=xa.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Na(e,t,n){var r=xa.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Da(e,t,n){var r=xa.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Ba(e,t,n){var r=xa.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Fa(e,t,n){var r=xa.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Ua(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ka(e,t,n){var r=xa.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function Ga(e,t,n){var r=xa.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function za(e,t,n){var r=xa.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function ja(e,t,n){var r=xa.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Va(e,t,n){var r=xa.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ha(e,t,n){var r=xa.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Wa(e,t,n){var r=xa.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Xa(e,t,n){var r=xa.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Za(e,t,n){var r=xa.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ya(e,t,n){var r=Sa.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function qa(e,t,n){var r=xa.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Ka(e,t,n){var r=xa.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Qa(e,t){return Ca(e.getDate(),t,2)}function $a(e,t){return Ca(e.getHours(),t,2)}function Ja(e,t){return Ca(e.getHours()%12||12,t,2)}function es(e,t){return Ca(1+Qo.count(No(e),e),t,3)}function ts(e,t){return Ca(e.getMilliseconds(),t,3)}function ns(e,t){return ts(e,t)+"000"}function rs(e,t){return Ca(e.getMonth()+1,t,2)}function is(e,t){return Ca(e.getMinutes(),t,2)}function os(e,t){return Ca(e.getSeconds(),t,2)}function as(e){var t=e.getDay();return 0===t?7:t}function ss(e,t){return Ca(Vo.count(No(e)-1,e),t,2)}function ls(e){var t=e.getDay();return t>=4||0===t?Zo(e):Zo.ceil(e)}function cs(e,t){return e=ls(e),Ca(Zo.count(No(e),e)+(4===No(e).getDay()),t,2)}function us(e){return e.getDay()}function hs(e,t){return Ca(Ho.count(No(e)-1,e),t,2)}function ds(e,t){return Ca(e.getFullYear()%100,t,2)}function fs(e,t){return Ca((e=ls(e)).getFullYear()%100,t,2)}function ps(e,t){return Ca(e.getFullYear()%1e4,t,4)}function gs(e,t){var n=e.getDay();return Ca((e=n>=4||0===n?Zo(e):Zo.ceil(e)).getFullYear()%1e4,t,4)}function ms(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ca(t/60|0,"0",2)+Ca(t%60,"0",2)}function _s(e,t){return Ca(e.getUTCDate(),t,2)}function vs(e,t){return Ca(e.getUTCHours(),t,2)}function ys(e,t){return Ca(e.getUTCHours()%12||12,t,2)}function Es(e,t){return Ca(1+ga.count(_a(e),e),t,3)}function As(e,t){return Ca(e.getUTCMilliseconds(),t,3)}function bs(e,t){return As(e,t)+"000"}function Ts(e,t){return Ca(e.getUTCMonth()+1,t,2)}function xs(e,t){return Ca(e.getUTCMinutes(),t,2)}function Ss(e,t){return Ca(e.getUTCSeconds(),t,2)}function Rs(e){var t=e.getUTCDay();return 0===t?7:t}function Cs(e,t){return Ca(sa.count(_a(e)-1,e),t,2)}function Ls(e){var t=e.getUTCDay();return t>=4||0===t?ha(e):ha.ceil(e)}function Os(e,t){return e=Ls(e),Ca(ha.count(_a(e),e)+(4===_a(e).getUTCDay()),t,2)}function Ms(e){return e.getUTCDay()}function Is(e,t){return Ca(la.count(_a(e)-1,e),t,2)}function ws(e,t){return Ca(e.getUTCFullYear()%100,t,2)}function Ps(e,t){return Ca((e=Ls(e)).getUTCFullYear()%100,t,2)}function Ns(e,t){return Ca(e.getUTCFullYear()%1e4,t,4)}function Ds(e,t){var n=e.getUTCDay();return Ca((e=n>=4||0===n?ha(e):ha.ceil(e)).getUTCFullYear()%1e4,t,4)}function Bs(){return"+0000"}function Fs(){return"%"}function Us(e){return+e}function ks(e){return Math.floor(+e/1e3)}Aa=function(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=Oa(i),u=Ma(i),h=Oa(o),d=Ma(o),f=Oa(a),p=Ma(a),g=Oa(s),m=Ma(s),_=Oa(l),v=Ma(l),y={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:Qa,e:Qa,f:ns,g:fs,G:gs,H:$a,I:Ja,j:es,L:ts,m:rs,M:is,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Us,s:ks,S:os,u:as,U:ss,V:cs,w:us,W:hs,x:null,X:null,y:ds,Y:ps,Z:ms,"%":Fs},E={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:_s,e:_s,f:bs,g:Ps,G:Ds,H:vs,I:ys,j:Es,L:As,m:Ts,M:xs,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Us,s:ks,S:Ss,u:Rs,U:Cs,V:Os,w:Ms,W:Is,x:null,X:null,y:ws,Y:Ns,Z:Bs,"%":Fs},A={a:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=d[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=g.exec(t.slice(n));return r?(e.m=m[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return x(e,t,n,r)},d:za,e:za,f:Za,g:Fa,G:Ba,H:Va,I:Va,j:ja,L:Xa,m:Ga,M:Ha,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u[r[0].toLowerCase()],n+r[0].length):-1},q:ka,Q:qa,s:Ka,S:Wa,u:wa,U:Pa,V:Na,w:Ia,W:Da,x:function(e,t,r){return x(e,n,t,r)},X:function(e,t,n){return x(e,r,t,n)},y:Fa,Y:Ba,Z:Ua,"%":Ya};function b(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=Ta[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function T(e,t){return function(n){var r,i,o=Ea(1900,void 0,1);if(x(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=ya(Ea(o.y,0,1))).getUTCDay(),r=i>4||0===i?la.ceil(r):la(r),r=ga.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=va(Ea(o.y,0,1))).getDay(),r=i>4||0===i?Ho.ceil(r):Ho(r),r=Qo.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?ya(Ea(o.y,0,1)).getUTCDay():va(Ea(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,ya(o)):va(o)}}function x(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=A[i in Ta?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return y.x=b(n,y),y.X=b(r,y),y.c=b(t,y),E.x=b(n,E),E.X=b(r,E),E.c=b(t,E),{format:function(e){var t=b(e+="",y);return t.toString=function(){return e},t},parse:function(e){var t=T(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=b(e+="",E);return t.toString=function(){return e},t},utcParse:function(e){var t=T(e+="",!0);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),ba=Aa.format,Aa.parse,Aa.utcFormat,Aa.utcParse;var Gs=31536e6;function zs(e){return new Date(e)}function js(e){return e instanceof Date?+e:+new Date(+e)}function Vs(e,t,n,r,i,o,a,s,l){var c=ro(Ki,Ki),u=c.invert,h=c.domain,d=l(".%L"),f=l(":%S"),p=l("%I:%M"),g=l("%I %p"),m=l("%a %d"),_=l("%b %d"),v=l("%B"),y=l("%Y"),E=[[a,1,1e3],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[t,1,2592e6],[t,3,7776e6],[e,1,Gs]];function A(s){return(a(s)<s?d:o(s)<s?f:i(s)<s?p:r(s)<s?g:t(s)<s?n(s)<s?m:_:e(s)<s?v:y)(s)}function b(t,n,r,i){if(null==t&&(t=10),"number"==typeof t){var o=Math.abs(r-n)/t,a=si((function(e){return e[2]})).right(E,o);a===E.length?(i=_i(n/Gs,r/Gs,t),t=e):a?(i=(a=E[o/E[a-1][2]<E[a][2]/o?a-1:a])[1],t=a[0]):(i=Math.max(_i(n,r,t),1),t=s)}return null==i?t:t.every(i)}return c.invert=function(e){return new Date(u(e))},c.domain=function(e){return arguments.length?h(Ci.call(e,js)):h().map(zs)},c.ticks=function(e,t){var n,r=h(),i=r[0],o=r[r.length-1],a=o<i;return a&&(n=i,i=o,o=n),n=(n=b(e,i,o,t))?n.range(i,o+1):[],a?n.reverse():n},c.tickFormat=function(e,t){return null==t?A:l(t)},c.nice=function(e,t){var n=h();return(e=b(e,n[0],n[n.length-1],t))?h(Eo(n,e)):c},c.copy=function(){return to(c,Vs(e,t,n,r,i,o,a,s,l))},c}function Hs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}const{isNil:Ws,isString:Xs,uniq:Zs}=y.uG,Ys=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/,qs={[Ot.Wh.LINEAR]:function e(){var t=ro(Ki,Ki);return t.copy=function(){return to(t,e())},Oi.apply(t,arguments),yo(t)},[Ot.Wh.POWER]:function e(){var t=function(e){var t=e(Ki,Ki),n=1;return t.exponent=function(t){return arguments.length?1==(n=+t)?e(Ki,Ki):.5===n?e(Lo,Oo):e(Co(n),Co(1/n)):n},yo(t)}(no());return t.copy=function(){return to(t,e()).exponent(t.exponent())},Oi.apply(t,arguments),t},[Ot.Wh.LOG]:function e(){var t=function(e){var t,n,r=e(Ao,bo),i=r.domain,o=10;function a(){return t=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),function(t){return Math.log(t)/e})}(o),n=function(e){return 10===e?So:e===Math.E?Math.exp:function(t){return Math.pow(e,t)}}(o),i()[0]<0?(t=Ro(t),n=Ro(n),e(To,xo)):e(Ao,bo),r}return r.base=function(e){return arguments.length?(o=+e,a()):o},r.domain=function(e){return arguments.length?(i(e),a()):i()},r.ticks=function(e){var r,a=i(),s=a[0],l=a[a.length-1];(r=l<s)&&(d=s,s=l,l=d);var c,u,h,d=t(s),f=t(l),p=null==e?10:+e,g=[];if(!(o%1)&&f-d<p){if(d=Math.round(d)-1,f=Math.round(f)+1,s>0){for(;d<f;++d)for(u=1,c=n(d);u<o;++u)if(!((h=c*u)<s)){if(h>l)break;g.push(h)}}else for(;d<f;++d)for(u=o-1,c=n(d);u>=1;--u)if(!((h=c*u)<s)){if(h>l)break;g.push(h)}}else g=gi(d,f,Math.min(f-d,p)).map(n);return r?g.reverse():g},r.tickFormat=function(e,i){if(null==i&&(i=10===o?".0e":","),"function"!=typeof i&&(i=go(i)),e===1/0)return i;null==e&&(e=10);var a=Math.max(1,o*e/r.ticks().length);return function(e){var r=e/n(Math.round(t(e)));return r*o<o-.5&&(r*=o),r<=a?i(e):""}},r.nice=function(){return i(Eo(i(),{floor:function(e){return n(Math.floor(t(e)))},ceil:function(e){return n(Math.ceil(t(e)))}}))},r}(no()).domain([1,10]);return t.copy=function(){return to(t,e()).base(t.base())},Oi.apply(t,arguments),t},[Ot.Wh.IDENTITY]:function e(t){let n,r=[];function i(e){return null==e?n:e}return i.invert=i,i.domain=i.range=e=>e?(r=e,e):r,i.unknown=e=>e?(n=e,e):n,i.copy=()=>e(t).unknown(n),i},[Ot.Wh.SEQUENTIAL]:function e(){var t=yo(function(){var e,t,n,r,i,o=0,a=1,s=Ki,l=!1;function c(t){return isNaN(t=+t)?i:s(0===n?.5:(t=(r(t)-e)*n,l?Math.max(0,Math.min(1,t)):t))}return c.domain=function(i){return arguments.length?(e=r(o=+i[0]),t=r(a=+i[1]),n=e===t?0:1/(t-e),c):[o,a]},c.clamp=function(e){return arguments.length?(l=!!e,c):l},c.interpolator=function(e){return arguments.length?(s=e,c):s},c.unknown=function(e){return arguments.length?(i=e,c):i},function(i){return r=i,e=i(o),t=i(a),n=e===t?0:1/(t-e),c}}()(Ki));return t.copy=function(){return Hs(t,e())},Mi.apply(t,arguments)},[Ot.Wh.TIME]:function(){return Oi.apply(Vs(No,Bo,Vo,Qo,Jo,ta,ra,oa,ba).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},[Ot.Wh.QUANTILE]:function e(){var t,n=[],r=[],i=[];function o(){var e=0,t=Math.max(1,r.length);for(i=new Array(t-1);++e<t;)i[e-1]=yi(n,e/t);return a}function a(e){return isNaN(e=+e)?t:r[ui(i,e)]}return a.invertExtent=function(e){var t=r.indexOf(e);return t<0?[NaN,NaN]:[t>0?i[t-1]:n[0],t<i.length?i[t]:n[n.length-1]]},a.domain=function(e){if(!arguments.length)return n.slice();n=[];for(var t,r=0,i=e.length;r<i;++r)null==(t=e[r])||isNaN(t=+t)||n.push(t);return n.sort(ai),o()},a.range=function(e){return arguments.length?(r=Li.call(e),o()):r.slice()},a.unknown=function(e){return arguments.length?(t=e,a):t},a.quantiles=function(){return i.slice()},a.copy=function(){return e().domain(n).range(r).unknown(t)},Oi.apply(a,arguments)},[Ot.Wh.QUANTIZE]:function e(){var t,n=0,r=1,i=1,o=[.5],a=[0,1];function s(e){return e<=e?a[ui(o,e,0,i)]:t}function l(){var e=-1;for(o=new Array(i);++e<i;)o[e]=((e+1)*r-(e-i)*n)/(i+1);return s}return s.domain=function(e){return arguments.length?(n=+e[0],r=+e[1],l()):[n,r]},s.range=function(e){return arguments.length?(i=(a=Li.call(e)).length-1,l()):a.slice()},s.invertExtent=function(e){var t=a.indexOf(e);return t<0?[NaN,NaN]:t<1?[n,o[0]]:t>=i?[o[i-1],r]:[o[t-1],o[t]]},s.unknown=function(e){return arguments.length?(t=e,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return e().domain([n,r]).range(a).unknown(t)},Oi.apply(yo(s),arguments)},[Ot.Wh.THRESHOLD]:function e(){var t,n=[.5],r=[0,1],i=1;function o(e){return e<=e?r[ui(n,e,0,i)]:t}return o.domain=function(e){return arguments.length?(n=Li.call(e),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(e){return arguments.length?(r=Li.call(e),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(e){var t=r.indexOf(e);return[n[t-1],n[t]]},o.unknown=function(e){return arguments.length?(t=e,o):t},o.copy=function(){return e().domain(n).range(r).unknown(t)},Oi.apply(o,arguments)},[Ot.Wh.CAT]:wi,[Ot.Wh.DIVERGING]:function e(){var t=yo(function(){var e,t,n,r,i,o,a,s=0,l=.5,c=1,u=Ki,h=!1;function d(e){return isNaN(e=+e)?a:(e=.5+((e=+o(e))-t)*(e<t?r:i),u(h?Math.max(0,Math.min(1,e)):e))}return d.domain=function(a){return arguments.length?(e=o(s=+a[0]),t=o(l=+a[1]),n=o(c=+a[2]),r=e===t?0:.5/(t-e),i=t===n?0:.5/(n-t),d):[s,l,c]},d.clamp=function(e){return arguments.length?(h=!!e,d):h},d.interpolator=function(e){return arguments.length?(u=e,d):u},d.unknown=function(e){return arguments.length?(a=e,d):a},function(a){return o=a,e=a(s),t=a(l),n=a(c),r=e===t?0:.5/(t-e),i=t===n?0:.5/(n-t),d}}()(Ki));return t.copy=function(){return Hs(t,e())},Mi.apply(t,arguments)}};class Ks{constructor(){(0,kr.A)(this,"scaleOptions",{})}apply(e,{styleAttributeService:t}){var n=this;e.hooks.init.tapPromise("FeatureScalePlugin",(0,Hr.A)((function*(){var r;e.log(Ot.L2.ScaleInitStart,Ot.X$.INIT),n.scaleOptions=e.getScaleOptions();const i=t.getLayerStyleAttributes(),o=null===(r=e.getSource())||void 0===r?void 0:r.data.dataArray;Array.isArray(o)&&0===o.length||(n.caculateScalesForAttributes(i||[],o),e.log(Ot.L2.ScaleInitEnd,Ot.X$.INIT))}))),e.hooks.beforeRenderData.tapPromise("FeatureScalePlugin",function(){var r=(0,Hr.A)((function*(r){if(!r)return r;e.log(Ot.L2.ScaleInitStart,Ot.X$.UPDATE),n.scaleOptions=e.getScaleOptions();const i=t.getLayerStyleAttributes(),o=e.getSource().data.dataArray;return Array.isArray(o)&&0===o.length||(n.caculateScalesForAttributes(i||[],o),e.log(Ot.L2.ScaleInitEnd,Ot.X$.UPDATE),e.layerModelNeedUpdate=!0),!0}));return function(e){return r.apply(this,arguments)}}()),e.hooks.beforeRender.tap("FeatureScalePlugin",(()=>{if(e.layerModelNeedUpdate)return;this.scaleOptions=e.getScaleOptions();const n=t.getLayerStyleAttributes(),r=e.getSource().data.dataArray;if((!Array.isArray(r)||0!==r.length)&&n){const e=n.filter((e=>e.needRescale));e.length&&this.caculateScalesForAttributes(e,r)}}))}isNumber(e){return!isNaN(parseFloat(e))&&isFinite(e)}caculateScalesForAttributes(e,t){e.forEach((e=>{if(e.scale){const n=e.scale,r=e.scale.field;n.names=this.parseFields(Ws(r)?[]:r);const i=[];n.names.forEach((n=>{var r;i.push(this.createScale(n,e.name,null===(r=e.scale)||void 0===r?void 0:r.values,t))})),i.some((e=>e.type===Ot.gT.VARIABLE))?(n.type=Ot.gT.VARIABLE,i.forEach((e=>{var t,r;if(!n.callback&&"text"!==n.values)switch(null===(t=e.option)||void 0===t?void 0:t.type){case Ot.Wh.LOG:case Ot.Wh.LINEAR:case Ot.Wh.POWER:if(n.values&&n.values.length>2){const t=e.scale.ticks(n.values.length);e.scale.domain(t)}n.values?e.scale.range(n.values):e.scale.range(e.option.domain);break;case Ot.Wh.QUANTILE:case Ot.Wh.QUANTIZE:case Ot.Wh.THRESHOLD:e.scale.range(n.values);break;case Ot.Wh.IDENTITY:break;case Ot.Wh.CAT:n.values?e.scale.range(n.values):e.scale.range(e.option.domain);break;case Ot.Wh.DIVERGING:case Ot.Wh.SEQUENTIAL:e.scale.interpolator(oi(n.values))}"text"===n.values&&e.scale.range(null===(r=e.option)||void 0===r?void 0:r.domain)}))):(n.type=Ot.gT.CONSTANT,n.defaultValues=i.map(((e,t)=>e.scale(n.names[t])))),n.scalers=i.map((e=>({field:e.field,func:e.scale,option:e.option}))),e.needRescale=!1}}))}parseFields(e){return Array.isArray(e)?e:Xs(e)?e.split("*"):[e]}createScale(e,t,n,r){var i,o;const a=this.scaleOptions[t]&&(null===(i=this.scaleOptions[t])||void 0===i?void 0:i.field)===e?this.scaleOptions[t]:this.scaleOptions[e],s={field:e,scale:void 0,type:Ot.gT.VARIABLE,option:a};if(!r||!r.length)return a&&a.type?s.scale=this.createDefaultScale(a):(s.scale=wi([e]),s.type=Ot.gT.CONSTANT),s;const l=null===(o=r.find((t=>!Ws(t[e]))))||void 0===o?void 0:o[e];if(this.isNumber(e)||Ws(l)&&!a)s.scale=wi([e]),s.type=Ot.gT.CONSTANT;else{let t=a&&a.type||this.getDefaultType(l);"text"===n&&(t=Ot.Wh.CAT),void 0===n&&(t=Ot.Wh.IDENTITY);const i=this.createScaleConfig(t,e,a,r);s.scale=this.createDefaultScale(i),s.option=i}return s}getDefaultType(e){let t=Ot.Wh.LINEAR;return"string"==typeof e&&(t=Ys.test(e)?Ot.Wh.TIME:Ot.Wh.CAT),t}createScaleConfig(e,t,n,r){const i={type:e};let o=[];if(e===Ot.Wh.QUANTILE){const e=new Map;null==r||r.forEach((n=>{e.set(n._id,n[t])})),o=Array.from(e.values())}else o=(null==r?void 0:r.map((e=>e[t])))||[];if(null!=n&&n.domain)i.domain=null==n?void 0:n.domain;else if(e===Ot.Wh.CAT||e===Ot.Wh.IDENTITY)i.domain=Zs(o);else if(e===Ot.Wh.QUANTILE)i.domain=o;else if(e===Ot.Wh.DIVERGING){const e=Jr(o),t=void 0!==(null==n?void 0:n.neutral)?null==n?void 0:n.neutral:(e[0]+e[1])/2;i.domain=[e[0],t,e[1]]}else i.domain=Jr(o);return(0,Ur.A)((0,Ur.A)({},i),n)}createDefaultScale({type:e,domain:t,unknown:n,clamp:r,nice:i}){const o=qs[e]();return t&&o.domain&&o.domain(t),n&&o.unknown(n),void 0!==r&&o.clamp&&o.clamp(r),void 0!==i&&o.nice&&o.nice(i),o}}class Qs{apply(e){e.hooks.beforeRender.tap("LayerAnimateStylePlugin",(()=>{e.animateStatus&&e.models.forEach((t=>{t.addUniforms((0,Ur.A)({},e.layerModel.getAnimateUniforms()))}))}))}}class $s{apply(e){e.hooks.afterInit.tap("LayerMaskPlugin",(()=>{const{maskLayers:t,enableMask:n}=e.getLayerConfig();!e.tileLayer&&t&&t.length>0&&e.updateLayerConfig({mask:n})}))}}class Js{build(e){return(0,Hr.A)((function*(){e.prepareBuildModel(),yield e.buildModels()}))()}initLayerModel(e){var t=this;return(0,Hr.A)((function*(){yield t.build(e),e.styleNeedUpdate=!1}))()}prepareLayerModel(e){var t=this;return(0,Hr.A)((function*(){yield t.build(e),e.styleNeedUpdate=!1}))()}apply(e){var t=this;e.hooks.init.tapPromise("LayerModelPlugin",(0,Hr.A)((function*(){e.getSource().isTile?e.prepareBuildModel():(e.log(Ot.L2.BuildModelStart,Ot.X$.INIT),yield t.initLayerModel(e),e.log(Ot.L2.BuildModelEnd,Ot.X$.INIT))}))),e.hooks.beforeRenderData.tapPromise("LayerModelPlugin",function(){var n=(0,Hr.A)((function*(n){return!!n&&!e.getSource().isTile&&(e.log(Ot.L2.BuildModelStart,Ot.X$.UPDATE),yield t.prepareLayerModel(e),e.log(Ot.L2.BuildModelEnd,Ot.X$.UPDATE),!0)}));return function(e){return n.apply(this,arguments)}}())}}class el{apply(e){e.hooks.afterInit.tap("LayerStylePlugin",(()=>{const{autoFit:t,fitBoundsOptions:n}=e.getLayerConfig();t&&e.fitBounds(n),e.styleNeedUpdate=!1}))}}const tl=["type"],nl={directional:{lights:"u_DirectionalLights",num:"u_NumOfDirectionalLights"},spot:{lights:"u_SpotLights",num:"u_NumOfSpotLights"}},rl={type:"directional",direction:[1,10.5,12],ambient:[.2,.2,.2],diffuse:[.6,.6,.6],specular:[.1,.1,.1]},il={direction:[0,0,0],ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0]},ol={position:[0,0,0],direction:[0,0,0],ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],constant:1,linear:0,quadratic:0,angle:14,exponent:40,blur:5};class al{apply(e){e.hooks.beforeRender.tap("LightingPlugin",(()=>{const{enableLighting:t}=e.getLayerConfig();t&&e.models.forEach((e=>e.addUniforms((0,Ur.A)({},function(e){const t={u_DirectionalLights:new Array(3).fill((0,Ur.A)({},il)),u_NumOfDirectionalLights:0,u_SpotLights:new Array(3).fill((0,Ur.A)({},ol)),u_NumOfSpotLights:0};return e&&e.length||(e=[rl]),e.forEach((e=>{let{type:n="directional"}=e,r=(0,Kr.A)(e,tl);const i=nl[n].lights,o=nl[n].num,a=t[o];t[i][a]=(0,Ur.A)((0,Ur.A)({},t[i][a]),r),t[o]++})),t}()))))}))}}function sl(e){return e.map((e=>("string"==typeof e&&(e=[e,{}]),e)))}function ll(e,t,n,r){const i=e.multiPassRenderer;return i.add(r("render")),sl(t).forEach((e=>{const[t,r]=e;i.add(n(t),r)})),i.add(n("copy")),i}class cl{constructor(){(0,kr.A)(this,"enabled",void 0)}apply(e,{rendererService:t,postProcessingPassFactory:n,normalPassFactory:r}){e.hooks.init.tapPromise("MultiPassRendererPlugin",(()=>{const{enableMultiPassRenderer:t,passes:i=[]}=e.getLayerConfig();this.enabled=!!t&&!1!==e.getLayerConfig().enableMultiPassRenderer,this.enabled&&(e.multiPassRenderer=ll(e,i,n,r),e.multiPassRenderer.setRenderFlag(!0))})),e.hooks.beforeRender.tap("MultiPassRendererPlugin",(()=>{if(this.enabled){const{width:n,height:r}=t.getViewportSize();e.multiPassRenderer.resize(n,r)}}))}}const ul={POSITION:0,POSITION_64LOW:1,COLOR:2,PICKING_COLOR:3,STROKE:4,OPACITY:5,OFFSETS:6,ROTATION:7,MAX:8},{isNumber:hl}=y.uG;class dl{constructor(){(0,kr.A)(this,"pickingUniformMap",void 0)}pickOption2Array(){const e=[];return this.pickingUniformMap.forEach((t=>{hl(t)?e.push(t):e.push(...t)})),e}updatePickOption(e,t){Object.keys(e).forEach((t=>{this.pickingUniformMap.set(t,e[t])}));const n=t.getLayerConfig().pickingBuffer||0,r=Number(t.getShaderPickStat());this.pickingUniformMap.set("u_PickingBuffer",n),this.pickingUniformMap.set("u_shaderPick",r),t.getPickingUniformBuffer().subData({offset:0,data:this.pickOption2Array()})}apply(e,{styleAttributeService:t}){this.pickingUniformMap=new Map([["u_HighlightColor",[1,0,0,1]],["u_SelectColor",[1,0,0,1]],["u_PickingColor",[0,0,0]],["u_PickingStage",0],["u_CurrentSelectedId",[0,0,0]],["u_PickingThreshold",10],["u_PickingBuffer",0],["u_shaderPick",0],["u_activeMix",0]]),e.hooks.init.tapPromise("PixelPickingPlugin",(()=>{const{enablePicking:n}=e.getLayerConfig();t.registerStyleAttribute({name:"pickingColor",type:Ot.jQ.Attribute,descriptor:{name:"a_PickingColor",shaderLocation:ul.PICKING_COLOR,buffer:{data:[],type:Ot.gl.FLOAT},size:3,update:e=>{const{id:t}=e;return n?(0,y.Z8)(t):[0,0,0]}}})})),e.hooks.beforePickingEncode.tap("PixelPickingPlugin",(()=>{const{enablePicking:t}=e.getLayerConfig();t&&e.isVisible()&&(this.updatePickOption({u_PickingStage:1},e),e.models.forEach((e=>e.addUniforms({u_PickingStage:1}))))})),e.hooks.afterPickingEncode.tap("PixelPickingPlugin",(()=>{const{enablePicking:t}=e.getLayerConfig();t&&e.isVisible()&&(this.updatePickOption({u_PickingStage:2},e),e.models.forEach((e=>e.addUniforms({u_PickingStage:2}))))})),e.hooks.beforeHighlight.tap("PixelPickingPlugin",(t=>{const{highlightColor:n,activeMix:r=0}=e.getLayerConfig(),i="string"==typeof n?(0,y.HR)(n):n||[1,0,0,1];e.updateLayerConfig({pickedFeatureID:(0,y.dG)(new Uint8Array(t))});const o={u_PickingStage:2,u_PickingColor:t,u_HighlightColor:i.map((e=>255*e)),u_activeMix:r};this.updatePickOption(o,e),e.models.forEach((e=>e.addUniforms(o)))})),e.hooks.beforeSelect.tap("PixelPickingPlugin",(t=>{const{selectColor:n,selectMix:r=0}=e.getLayerConfig(),i="string"==typeof n?(0,y.HR)(n):n||[1,0,0,1];e.updateLayerConfig({pickedFeatureID:(0,y.dG)(new Uint8Array(t))});const o={u_PickingStage:2,u_PickingColor:t,u_HighlightColor:i.map((e=>255*e)),u_activeMix:r,u_CurrentSelectedId:t,u_SelectColor:i.map((e=>255*e))};this.updatePickOption(o,e),e.models.forEach((e=>e.addUniforms(o)))}))}}const fl=["mvt","geojsonvt","testTile"];class pl{apply(e,{styleAttributeService:t}){e.hooks.init.tapPromise("RegisterStyleAttributePlugin",(()=>{(function(e){const t=e.getSource();return fl.includes(t.parser.type)})(e)||this.registerBuiltinAttributes(t,e)}))}registerBuiltinAttributes(e,t){"MaskLayer"!==t.type?(this.registerPositionAttribute(e),this.registerColorAttribute(e)):this.registerPositionAttribute(e)}registerPositionAttribute(e){e.registerStyleAttribute({name:"position",type:Ot.jQ.Attribute,descriptor:{name:"a_Position",shaderLocation:ul.POSITION,buffer:{data:[],type:Ot.gl.FLOAT},size:3,update:(e,t,n)=>2===n.length?[n[0],n[1],0]:[n[0],n[1],n[2]]}})}registerColorAttribute(e){e.registerStyleAttribute({name:"color",type:Ot.jQ.Attribute,descriptor:{name:"a_Color",shaderLocation:ul.COLOR,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:4,update:e=>{const{color:t}=e;return t&&t.length?t:[1,1,1,1]}}})}}class gl{constructor(){(0,kr.A)(this,"cameraService",void 0),(0,kr.A)(this,"coordinateSystemService",void 0),(0,kr.A)(this,"rendererService",void 0),(0,kr.A)(this,"mapService",void 0),(0,kr.A)(this,"layerService",void 0)}apply(e,{rendererService:t,mapService:n,layerService:r,coordinateSystemService:i,cameraService:o}){let a;this.rendererService=t,this.mapService=n,this.layerService=r,this.coordinateSystemService=i,this.cameraService=o,this.rendererService.uniformBuffers[0]||(a=this.rendererService.createBuffer({data:new Float32Array(92),isUBO:!0,label:"renderUniformBuffer"}),this.rendererService.uniformBuffers[0]=a),e.hooks.beforeRender.tap("ShaderUniformPlugin",(()=>{const t=e.getLayerConfig().tileOrigin;this.coordinateSystemService.refresh(t);const{width:n,height:r}=this.rendererService.getViewportSize(),{data:i,uniforms:o}=this.generateUBO(n,r);this.layerService.alreadyInRendering&&this.rendererService.uniformBuffers[0]&&this.rendererService.uniformBuffers[0].subData({offset:0,data:i}),"WebGL1"===this.rendererService.queryVerdorInfo()&&e.models.forEach((t=>{t.addUniforms((0,Ur.A)((0,Ur.A)({},o),{},{u_PickingBuffer:e.getLayerConfig().pickingBuffer||0,u_shaderPick:Number(e.getShaderPickStat())}))}))}))}generateUBO(e,t){const n=this.cameraService.getProjectionMatrix(),r=this.cameraService.getViewMatrix(),i=this.cameraService.getViewProjectionMatrix(),o=this.cameraService.getModelMatrix(),a=this.coordinateSystemService.getViewportCenterProjection(),s=this.coordinateSystemService.getPixelsPerDegree(),l=this.cameraService.getZoom(),c=this.coordinateSystemService.getPixelsPerDegree2(),u=this.cameraService.getZoomScale(),h=this.coordinateSystemService.getPixelsPerMeter(),d=this.coordinateSystemService.getCoordinateSystem(),f=this.cameraService.getCameraPosition(),p=window.devicePixelRatio,g=this.coordinateSystemService.getViewportCenter(),m=[e,t],_=this.cameraService.getFocalDistance();return{data:[...r,...n,...i,...o,...a,...s,l,...c,u,...h,d,...f,p,...g,...m,_,0,0,0],uniforms:{[Ot.sY.ProjectionMatrix]:n,[Ot.sY.ViewMatrix]:r,[Ot.sY.ViewProjectionMatrix]:i,[Ot.sY.Zoom]:l,[Ot.sY.ZoomScale]:u,[Ot.sY.FocalDistance]:_,[Ot.sY.CameraPosition]:f,[Ot.bT.CoordinateSystem]:d,[Ot.bT.ViewportCenter]:g,[Ot.bT.ViewportCenterProjection]:a,[Ot.bT.PixelsPerDegree]:s,[Ot.bT.PixelsPerDegree2]:c,[Ot.bT.PixelsPerMeter]:h,u_ViewportSize:m,u_ModelMatrix:o,u_DevicePixelRatio:p}}}}class ml{apply(e){e.hooks.beforeRender.tap("UpdateModelPlugin",(()=>{e.layerModel&&e.layerModel.needUpdate().then((t=>{t&&e.renderLayers()}))})),e.hooks.afterRender.tap("UpdateModelPlugin",(()=>{e.layerModelNeedUpdate=!1}))}}class _l{apply(e,{styleAttributeService:t}){e.hooks.init.tapPromise("UpdateStyleAttributePlugin",(()=>{this.initStyleAttribute(e,{styleAttributeService:t})})),e.hooks.beforeRender.tap("UpdateStyleAttributePlugin",(()=>{e.layerModelNeedUpdate||e.inited&&this.updateStyleAttribute(e,{styleAttributeService:t})}))}updateStyleAttribute(e,{styleAttributeService:t}){const n=t.getLayerStyleAttributes()||[],r=t.getLayerStyleAttribute("filter");if(r&&r.needRegenerateVertices)return e.layerModelNeedUpdate=!0,void n.forEach((e=>e.needRegenerateVertices=!1));n.filter((e=>e.needRegenerateVertices)).forEach((n=>{t.updateAttributeByFeatureRange(n.name,e.getEncodedData(),n.featureRange.startIndex,n.featureRange.endIndex,e),n.needRegenerateVertices=!1}))}initStyleAttribute(e,{styleAttributeService:t}){(t.getLayerStyleAttributes()||[]).filter((e=>e.needRegenerateVertices)).forEach((n=>{t.updateAttributeByFeatureRange(n.name,e.getEncodedData(),n.featureRange.startIndex,n.featureRange.endIndex),n.needRegenerateVertices=!1}))}}const vl={[Ot.c9.additive]:{enable:!0,func:{srcRGB:Ot.gl.ONE,dstRGB:Ot.gl.ONE,srcAlpha:1,dstAlpha:1}},[Ot.c9.none]:{enable:!1},[Ot.c9.normal]:{enable:!0,func:{srcRGB:Ot.gl.SRC_ALPHA,dstRGB:Ot.gl.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}},[Ot.c9.subtractive]:{enable:!0,func:{srcRGB:Ot.gl.ONE,dstRGB:Ot.gl.ONE,srcAlpha:Ot.gl.ZERO,dstAlpha:Ot.gl.ONE_MINUS_SRC_COLOR},equation:{rgb:Ot.gl.FUNC_SUBTRACT,alpha:Ot.gl.FUNC_SUBTRACT}},[Ot.c9.max]:{enable:!0,func:{srcRGB:Ot.gl.ONE,dstRGB:Ot.gl.ONE},equation:{rgb:Ot.gl.MAX_EXT}},[Ot.c9.min]:{enable:!0,func:{srcRGB:Ot.gl.ONE,dstRGB:Ot.gl.ONE},equation:{rgb:Ot.gl.MIN_EXT}}};class yl{constructor(e){(0,kr.A)(this,"layer",void 0),this.layer=e}pickRender(e){const t=this.layer.getContainer().layerService,n=this.layer;if(n.tileLayer)return n.tileLayer.pickRender(e);n.hooks.beforePickingEncode.call(),t.renderTileLayerMask(n),n.renderModels({ispick:!0}),n.hooks.afterPickingEncode.call()}pick(e,t){var n=this;return(0,Hr.A)((function*(){const r=n.layer.getContainer().pickingService;return"RasterLayer"===e.type?n.pickRasterLayer(e,t):(n.pickRender(t),r.pickFromPickingFBO(e,t))}))()}pickRasterLayer(e,t,n){const r=this.layer.getContainer(),i=r.pickingService,o=r.mapService,a=this.layer.getSource().extent,s=(0,y.KL)(t.lngLat,a),l={x:t.x,y:t.y,type:t.type,lngLat:t.lngLat,target:t,rasterValue:null},c=n||e;if(s){const n=this.readRasterValue(e,a,o,t.x,t.y);return l.rasterValue=n,i.triggerHoverOnLayer(c,l),!0}return l.type="mousemove"===t.type?"mouseout":"un"+t.type,i.triggerHoverOnLayer(c,(0,Ur.A)((0,Ur.A)({},l),{},{type:"unpick"})),i.triggerHoverOnLayer(c,l),!1}readRasterValue(e,t,n,r,i){const o=e.getSource().data.dataArray[0],[a=0,s=0,l=10,c=-10]=t,u=n.lngLatToContainer([a,s]),h=n.lngLatToContainer([l,c]),d=h.x-u.x,f=u.y-h.y,p=[(r-u.x)/d,(i-h.y)/f],g=o.width||1,m=o.height||1,_=Math.floor(p[0]*g),v=Math.floor(p[1]*m),y=Math.max(0,v-1)*g+_;return o.data[y]}selectFeature(e){const t=this.layer,[n,r,i]=e;t.hooks.beforeSelect.call([n,r,i])}highlightPickedFeature(e){const[t,n,r]=e;this.layer.hooks.beforeHighlight.call([t,n,r])}getFeatureById(e){return this.layer.getSource().getFeatureById(e)}}class El{constructor(e){(0,kr.A)(this,"layer",void 0),(0,kr.A)(this,"rendererService",void 0),(0,kr.A)(this,"colorTexture",void 0),(0,kr.A)(this,"key",void 0),this.layer=e;const t=this.layer.getContainer();this.rendererService=t.rendererService}getColorTexture(e,t){const n=this.getTextureKey(e,t);return this.key===n||(this.createColorTexture(e,t),this.key=n),this.colorTexture}createColorTexture(e,t){const{createTexture2D:n}=this.rendererService,r=this.getColorRampBar(e,t),i=n({data:new Uint8Array(r.data),width:r.width,height:r.height,flipY:!1,unorm:!0});return this.colorTexture=i,i}setColorTexture(e,t,n){this.key=this.getTextureKey(t,n),this.colorTexture=e}destroy(){var e;null===(e=this.colorTexture)||void 0===e||e.destroy()}getColorRampBar(e,t){switch(e.type){case"cat":return(0,y.K3)(e);case"quantize":return(0,y.x6)(e);case"custom":return(0,y.zz)(e,t);case"linear":return(0,y.Jj)(e,t);default:return(0,y.vj)(e)}}getTextureKey(e,t){var n;return`${e.colors.join("_")}_${null==e||null===(n=e.positions)||void 0===n?void 0:n.join("_")}_${e.type}_${null==t?void 0:t.join("_")}`}}const Al=["passes"],bl=["moduleName","vertexShader","fragmentShader","defines","inject","triangulation","styleOption","pickingEnabled"],{isEqual:Tl,isFunction:xl,isNumber:Sl,isObject:Rl,isPlainObject:Cl,isUndefined:Ll}=y.uG;let Ol=0;class Ml extends Zn.EventEmitter{get shaderModuleService(){return this.container.shaderModuleService}get cameraService(){return this.container.cameraService}get coordinateService(){return this.container.coordinateSystemService}get iconService(){return this.container.iconService}get fontService(){return this.container.fontService}get pickingService(){return this.container.pickingService}get rendererService(){return this.container.rendererService}get layerService(){return this.container.layerService}get debugService(){return this.container.debugService}get interactionService(){return this.container.interactionService}get mapService(){var e;return null===(e=this.container)||void 0===e?void 0:e.mapService}get normalPassFactory(){return this.container.normalPassFactory}constructor(e={}){super(),(0,kr.A)(this,"id",""+Ol++),(0,kr.A)(this,"name",`${Ol}`),(0,kr.A)(this,"parent",void 0),(0,kr.A)(this,"coordCenter",void 0),(0,kr.A)(this,"type",void 0),(0,kr.A)(this,"visible",!0),(0,kr.A)(this,"zIndex",0),(0,kr.A)(this,"minZoom",void 0),(0,kr.A)(this,"maxZoom",void 0),(0,kr.A)(this,"inited",!1),(0,kr.A)(this,"layerModelNeedUpdate",!1),(0,kr.A)(this,"pickedFeatureID",null),(0,kr.A)(this,"selectedFeatureID",null),(0,kr.A)(this,"styleNeedUpdate",!1),(0,kr.A)(this,"rendering",void 0),(0,kr.A)(this,"forceRender",!1),(0,kr.A)(this,"clusterZoom",0),(0,kr.A)(this,"layerType",void 0),(0,kr.A)(this,"triangulation",void 0),(0,kr.A)(this,"layerPickService",void 0),(0,kr.A)(this,"textureService",void 0),(0,kr.A)(this,"defaultSourceConfig",{data:[],options:{parser:{type:"json"}}}),(0,kr.A)(this,"dataState",{dataSourceNeedUpdate:!1,dataMappingNeedUpdate:!1,filterNeedUpdate:!1,featureScaleNeedUpdate:!1,StyleAttrNeedUpdate:!1}),(0,kr.A)(this,"hooks",{init:new Xn.nx,afterInit:new Xn.jJ,beforeRender:new Xn.jJ,beforeRenderData:new Xn.Sq,afterRender:new Xn.Jk,beforePickingEncode:new Xn.Jk,afterPickingEncode:new Xn.Jk,beforeHighlight:new Xn.Jk(["pickedColor"]),afterHighlight:new Xn.Jk,beforeSelect:new Xn.Jk(["pickedColor"]),afterSelect:new Xn.Jk,beforeDestroy:new Xn.Jk,afterDestroy:new Xn.Jk}),(0,kr.A)(this,"models",[]),(0,kr.A)(this,"multiPassRenderer",void 0),(0,kr.A)(this,"plugins",void 0),(0,kr.A)(this,"startInit",!1),(0,kr.A)(this,"sourceOption",void 0),(0,kr.A)(this,"layerModel",void 0),(0,kr.A)(this,"shapeOption",void 0),(0,kr.A)(this,"tileLayer",void 0),(0,kr.A)(this,"layerChildren",[]),(0,kr.A)(this,"masks",[]),(0,kr.A)(this,"configService",Ot.FZ),(0,kr.A)(this,"styleAttributeService",void 0),(0,kr.A)(this,"layerSource",void 0),(0,kr.A)(this,"postProcessingPassFactory",void 0),(0,kr.A)(this,"animateOptions",{enable:!1}),(0,kr.A)(this,"container",void 0),(0,kr.A)(this,"encodedData",void 0),(0,kr.A)(this,"currentPickId",null),(0,kr.A)(this,"rawConfig",void 0),(0,kr.A)(this,"needUpdateConfig",void 0),(0,kr.A)(this,"encodeStyleAttribute",{}),(0,kr.A)(this,"enableShaderEncodeStyles",[]),(0,kr.A)(this,"enableDataEncodeStyles",[]),(0,kr.A)(this,"pendingStyleAttributes",[]),(0,kr.A)(this,"scaleOptions",{}),(0,kr.A)(this,"animateStartTime",void 0),(0,kr.A)(this,"animateStatus",!1),(0,kr.A)(this,"isDestroyed",!1),(0,kr.A)(this,"uniformBuffers",[]),(0,kr.A)(this,"encodeDataLength",0),(0,kr.A)(this,"sourceEvent",(()=>{this.dataState.dataSourceNeedUpdate=!0;const e=this.getLayerConfig();e&&e.autoFit&&this.fitBounds(e.fitBoundsOptions),this.layerSource.getSourceCfg().autoRender&&setTimeout((()=>{this.reRender()}),10)})),this.name=e.name||this.id,this.zIndex=e.zIndex||0,this.rawConfig=e,this.masks=e.maskLayers||[]}addMask(e){this.masks.push(e),this.updateLayerConfig({maskLayers:this.masks}),this.enableMask()}removeMask(e){const t=this.masks.indexOf(e);t>-1&&this.masks.splice(t,1),this.updateLayerConfig({maskLayers:this.masks})}disableMask(){this.updateLayerConfig({enableMask:!1})}enableMask(){this.updateLayerConfig({enableMask:!0})}addMaskLayer(e){this.masks.push(e)}removeMaskLayer(e){const t=this.masks.indexOf(e);t>-1&&this.masks.splice(t,1),e.destroy()}getAttribute(e){return this.styleAttributeService.getLayerStyleAttribute(e)}getLayerConfig(){return this.configService.getLayerConfig(this.id)}updateLayerConfig(e){if(Object.keys(e).map((t=>{t in this.rawConfig&&(this.rawConfig[t]=e[t])})),this.startInit){const t=this.container.id;this.configService.setLayerConfig(t,this.id,(0,Ur.A)((0,Ur.A)((0,Ur.A)({},this.configService.getLayerConfig(this.id)),this.needUpdateConfig),e)),this.needUpdateConfig={}}else this.needUpdateConfig=(0,Ur.A)((0,Ur.A)({},this.needUpdateConfig),e)}setContainer(e){this.container=e}getContainer(){return this.container}addPlugin(e){return this.plugins.push(e),this}init(){var e=this;return(0,Hr.A)((function*(){const t=e.container.id;e.startInit=!0,e.configService.setLayerConfig(t,e.id,e.rawConfig),e.layerType=e.rawConfig.layerType;const{enableMultiPassRenderer:n,passes:r}=e.getLayerConfig();n&&null!=r&&r.length&&r.length>0&&e.mapService.on("mapAfterFrameChange",(()=>{e.renderLayers()})),e.postProcessingPassFactory=e.container.postProcessingPassFactory,e.styleAttributeService=e.container.styleAttributeService,n&&(e.multiPassRenderer=e.container.multiPassRenderer,e.multiPassRenderer.setLayer(e)),e.pendingStyleAttributes.forEach((({attributeName:t,attributeField:n,attributeValues:r,updateOptions:i})=>{e.styleAttributeService.updateStyleAttribute(t,{scale:(0,Ur.A)({field:n},e.splitValuesAndCallbackInAttribute(r,n?void 0:e.getLayerConfig()[t]))},i)})),e.pendingStyleAttributes=[],e.plugins=[new $r,new pl,new Ks,new Qr,new el,new $s,new _l,new ml,new cl,new gl,new Qs,new al,new dl,new Js];for(const t of e.plugins)t.apply(e,e.container);e.layerPickService=new yl(e),e.textureService=new El(e),e.log(Ot.L2.LayerInitStart),yield e.hooks.init.promise(),e.log(Ot.L2.LayerInitEnd),e.inited=!0,e.emit("inited",{target:e,type:"inited"}),e.emit("add",{target:e,type:"add"}),e.hooks.afterInit.call()}))()}log(e,t="init"){var n;if(this.tileLayer||this.isTileLayer)return;const r=`${this.id}.${t}.${e}`,i={id:this.id,type:this.type};null===(n=this.debugService)||void 0===n||n.log(r,i)}updateModelData(e){e.attributes&&e.elements?this.models.map((t=>{t.updateAttributesAndElements(e.attributes,e.elements)})):console.warn("data error")}setLayerPickService(e){this.layerPickService=e}prepareBuildModel(){0!==Object.keys(this.needUpdateConfig||{}).length&&this.updateLayerConfig({});const{animateOption:e}=this.getLayerConfig();null!=e&&e.enable&&(this.layerService.startAnimate(),this.animateStatus=!0)}color(e,t,n){return this.updateStyleAttribute("color",e,t,n),this}texture(e,t,n){return this.updateStyleAttribute("texture",e,t,n),this}rotate(e,t,n){return this.updateStyleAttribute("rotate",e,t,n),this}size(e,t,n){return this.updateStyleAttribute("size",e,t,n),this}filter(e,t,n){const r=this.updateStyleAttribute("filter",e,t,n);return this.dataState.dataSourceNeedUpdate=r&&this.inited,this}shape(e,t,n){this.shapeOption={field:e,values:t};const r=this.updateStyleAttribute("shape",e,t,n);return this.dataState.dataSourceNeedUpdate=r&&this.inited,this}label(e,t,n){return this.pendingStyleAttributes.push({attributeName:"label",attributeField:e,attributeValues:t,updateOptions:n}),this}animate(e){let t={};return Rl(e)?(t.enable=!0,t=(0,Ur.A)((0,Ur.A)({},t),e)):t.enable=e,this.updateLayerConfig({animateOption:t}),this}source(e,t){return"source"===(null==e?void 0:e.type)?(this.setSource(e),this):(this.sourceOption={data:e,options:t},this.clusterZoom=0,this)}setData(e,t){return this.inited?(this.dataUpdatelog(),this.layerSource.setData(e,t)):this.on("inited",(()=>{this.dataUpdatelog(),this.layerSource.setData(e,t)})),this}dataUpdatelog(){this.log(Ot.L2.SourceInitStart,Ot.X$.UPDATE),this.layerSource.once("update",(()=>{this.log(Ot.L2.SourceInitEnd,Ot.X$.UPDATE)}))}style(e){const{passes:t}=e,n=(0,Kr.A)(e,Al);t&&sl(t).forEach((e=>{const t=this.multiPassRenderer.getPostProcessor().getPostProcessingPassByName(e[0]);t&&t.updateOptions(e[1])})),n.borderColor&&(n.stroke=n.borderColor),n.borderWidth&&(n.strokeWidth=n.borderWidth);const r=n;return Object.keys(n).forEach((e=>{const t=n[e];!Array.isArray(t)||2!==t.length||Sl(t[0])||Sl(t[1])||(r[e]={field:t[0],value:t[1]})})),this.encodeStyle(r),this.updateLayerConfig(r),this}encodeStyle(e){Object.keys(e).forEach((t=>{[...this.enableShaderEncodeStyles,...this.enableDataEncodeStyles].includes(t)&&Cl(e[t])&&(e[t].field||e[t].value)&&!Tl(this.encodeStyleAttribute[t],e[t])?(this.encodeStyleAttribute[t]=e[t],this.updateStyleAttribute(t,e[t].field,e[t].value),this.inited&&(this.dataState.dataMappingNeedUpdate=!0)):this.encodeStyleAttribute[t]&&(delete this.encodeStyleAttribute[t],this.dataState.dataSourceNeedUpdate=!0)}))}scale(e,t){const n=(0,Ur.A)({},this.scaleOptions);if(Rl(e)?this.scaleOptions=(0,Ur.A)((0,Ur.A)({},this.scaleOptions),e):this.scaleOptions[e]=t,this.styleAttributeService&&!Tl(n,this.scaleOptions)){const n=Rl(e)?e:{[e]:t};this.styleAttributeService.updateScaleAttribute(n)}return this}renderLayers(){this.rendering=!0,this.layerService.reRender(),this.rendering=!1}prerender(){}render(e={}){return this.tileLayer?(this.tileLayer.render(),this):(this.layerService.beforeRenderData(this),this.encodeDataLength<=0&&!this.forceRender||this.renderModels(e),this)}renderMultiPass(){var e=this;return(0,Hr.A)((function*(){e.encodeDataLength<=0&&!e.forceRender||(e.multiPassRenderer&&e.multiPassRenderer.getRenderFlag()?yield e.multiPassRenderer.render():e.renderModels())}))()}active(e){const t={};return t.enableHighlight=!!Rl(e)||e,Rl(e)?(t.enableHighlight=!0,e.color&&(t.highlightColor=e.color),e.mix&&(t.activeMix=e.mix)):t.enableHighlight=!!e,this.updateLayerConfig(t),this}setActive(e,t){if(Rl(e)){const{x:n=0,y:r=0}=e;this.updateLayerConfig({highlightColor:Rl(t)?t.color:this.getLayerConfig().highlightColor,activeMix:Rl(t)?t.mix:this.getLayerConfig().activeMix}),this.pick({x:n,y:r})}else this.updateLayerConfig({pickedFeatureID:e,highlightColor:Rl(t)?t.color:this.getLayerConfig().highlightColor,activeMix:Rl(t)?t.mix:this.getLayerConfig().activeMix}),this.hooks.beforeHighlight.call((0,y.Z8)(e)).then((()=>{setTimeout((()=>{this.reRender()}),1)}))}select(e){const t={};return t.enableSelect=!!Rl(e)||e,Rl(e)?(t.enableSelect=!0,e.color&&(t.selectColor=e.color),e.mix&&(t.selectMix=e.mix)):t.enableSelect=!!e,this.updateLayerConfig(t),this}setSelect(e,t){if(Rl(e)){const{x:n=0,y:r=0}=e;this.updateLayerConfig({selectColor:Rl(t)?t.color:this.getLayerConfig().selectColor,selectMix:Rl(t)?t.mix:this.getLayerConfig().selectMix}),this.pick({x:n,y:r})}else this.updateLayerConfig({pickedFeatureID:e,selectColor:Rl(t)?t.color:this.getLayerConfig().selectColor,selectMix:Rl(t)?t.mix:this.getLayerConfig().selectMix}),this.hooks.beforeSelect.call((0,y.Z8)(e)).then((()=>{setTimeout((()=>{this.reRender()}),1)}))}setBlend(e){return this.updateLayerConfig({blend:e}),this.reRender(),this}show(){return this.updateLayerConfig({visible:!0}),this.reRender(),this.emit("show"),this}hide(){return this.updateLayerConfig({visible:!1}),this.reRender(),this.emit("hide"),this}setIndex(e){return this.zIndex=e,this.layerService.updateLayerRenderList(),this.layerService.renderLayers(),this}setCurrentPickId(e){this.currentPickId=e}getCurrentPickId(){return this.currentPickId}setCurrentSelectedId(e){this.selectedFeatureID=e}getCurrentSelectedId(){return this.selectedFeatureID}isVisible(){const e=this.mapService.getZoom(),{visible:t,minZoom:n=-1/0,maxZoom:r=1/0}=this.getLayerConfig();return!!t&&e>=n&&e<r}setMultiPass(e,t){if(this.updateLayerConfig({enableMultiPassRenderer:e}),t&&this.updateLayerConfig({passes:t}),e){const{passes:e=[]}=this.getLayerConfig();this.multiPassRenderer=ll(this,e,this.postProcessingPassFactory,this.normalPassFactory),this.multiPassRenderer.setRenderFlag(!0);const{width:t,height:n}=this.rendererService.getViewportSize();this.multiPassRenderer.resize(t,n)}return this}setMinZoom(e){return this.updateLayerConfig({minZoom:e}),this}getMinZoom(){const{minZoom:e}=this.getLayerConfig();return e}getMaxZoom(){const{maxZoom:e}=this.getLayerConfig();return e}get(e){return this.getLayerConfig()[e]}setMaxZoom(e){return this.updateLayerConfig({maxZoom:e}),this}setAutoFit(e){return this.updateLayerConfig({autoFit:e}),this}fitBounds(e){if(!this.inited)return this.updateLayerConfig({autoFit:!0}),this;const t=this.getSource().extent;return t.some((e=>Math.abs(e)===1/0))||this.mapService.fitBounds([[t[0],t[1]],[t[2],t[3]]],e),this}destroy(e=!0){var t,n,r,i,o;if(this.isDestroyed)return;null===(t=this.layerModel)||void 0===t||t.uniformBuffers.forEach((e=>{e.destroy()})),this.layerChildren.map((e=>e.destroy(!1))),this.layerChildren=[];const{maskfence:a}=this.getLayerConfig();a&&(this.masks.map((e=>e.destroy(!1))),this.masks=[]),this.hooks.beforeDestroy.call(),this.layerSource.off("update",this.sourceEvent),null===(n=this.multiPassRenderer)||void 0===n||n.destroy(),this.textureService.destroy(),this.styleAttributeService.clearAllAttributes(),this.hooks.afterDestroy.call(),null===(r=this.layerModel)||void 0===r||r.clearModels(e),null===(i=this.tileLayer)||void 0===i||i.destroy(),this.models=[],null===(o=this.debugService)||void 0===o||o.removeLog(this.id),this.emit("remove",{target:this,type:"remove"}),this.emit("destroy",{target:this,type:"destroy"}),this.removeAllListeners(),this.isDestroyed=!0}clear(){this.styleAttributeService.clearAllAttributes()}clearModels(){var e;this.models.forEach((e=>e.destroy())),null===(e=this.layerModel)||void 0===e||e.clearModels(),this.models=[]}isDirty(){return!!(this.styleAttributeService.getLayerStyleAttributes()||[]).filter((e=>e.needRescale||e.needRemapping||e.needRegenerateVertices)).length}setSource(e){if(this.layerSource&&this.layerSource.off("update",this.sourceEvent),this.layerSource=e,this.clusterZoom=0,this.inited&&this.layerSource.cluster){const e=this.mapService.getZoom();this.layerSource.updateClusterData(e)}this.layerSource.inited&&this.sourceEvent(),this.layerSource.on("update",(({type:e})=>{if(void 0===this.coordCenter){const e=this.layerSource.center;this.coordCenter=e}if("update"===e){if(this.tileLayer)return void this.tileLayer.reload();this.sourceEvent()}}))}getSource(){return this.layerSource}getScaleOptions(){return this.scaleOptions}setEncodedData(e){this.encodedData=e,this.encodeDataLength=e.length}getEncodedData(){return this.encodedData}getScale(e){return this.styleAttributeService.getLayerAttributeScale(e)}getLegend(e){var t,n,r;const i=this.styleAttributeService.getLayerStyleAttribute(e);return{type:null===(n=((null==i||null===(t=i.scale)||void 0===t?void 0:t.scalers)||[])[0])||void 0===n||null===(n=n.option)||void 0===n?void 0:n.type,field:null==i||null===(r=i.scale)||void 0===r?void 0:r.field,items:this.getLegendItems(e)}}getLegendItems(e){const t=this.styleAttributeService.getLayerAttributeScale(e);return t?t.invertExtent?t.range().map((n=>({value:t.invertExtent(n),[e]:n}))):t.ticks?t.ticks().map((n=>({value:n,[e]:t(n)}))):null!=t&&t.domain?t.domain().filter((e=>!Ll(e))).map((n=>({value:n,[e]:t(n)}))):[]:[]}pick({x:e,y:t}){this.interactionService.triggerHover({x:e,y:t})}boxSelect(e,t){this.pickingService.boxPickLayer(this,e,t)}buildLayerModel(e){var t=this;return(0,Hr.A)((function*(){const{moduleName:n,vertexShader:r,fragmentShader:i,defines:o,inject:a,triangulation:s,styleOption:l,pickingEnabled:c=!0}=e,u=(0,Kr.A)(e,bl);t.shaderModuleService.registerModule(n,{vs:r,fs:i,defines:o,inject:a});const{vs:h,fs:d,uniforms:f}=t.shaderModuleService.getModule(n),{createModel:p}=t.rendererService;return new Promise((e=>{const{attributes:n,elements:r,count:i}=t.styleAttributeService.createAttributesAndIndices(t.encodedData,s,l,t),o=[...t.layerModel.uniformBuffers,...t.rendererService.uniformBuffers];c&&o.push(t.getPickingUniformBuffer());const a=(0,Ur.A)({attributes:n,uniforms:f,fs:d,vs:h,elements:r,blend:vl[Ot.c9.normal],uniformBuffers:o,textures:t.layerModel.textures},u);i&&(a.count=i),e(p(a))}))}))()}createAttributes(e){const{triangulation:t}=e,{attributes:n}=this.styleAttributeService.createAttributes(this.encodedData,t);return n}getTime(){return this.layerService.clock.getDelta()}setAnimateStartTime(){this.animateStartTime=this.layerService.clock.getElapsedTime()}stopAnimate(){this.animateStatus&&(this.layerService.stopAnimate(),this.animateStatus=!1,this.updateLayerConfig({animateOption:{enable:!1}}))}getLayerAnimateTime(){return this.layerService.clock.getElapsedTime()-this.animateStartTime}needPick(e){const{enableHighlight:t=!0,enableSelect:n=!0}=this.getLayerConfig();let r=-1!==this.eventNames().indexOf(e)||-1!==this.eventNames().indexOf("un"+e);return"click"!==e&&"dblclick"!==e||!n||(r=!0),"mousemove"!==e||!t&&-1===this.eventNames().indexOf("mouseenter")&&-1===this.eventNames().indexOf("unmousemove")&&-1===this.eventNames().indexOf("mouseout")||(r=!0),this.isVisible()&&r}buildModels(){return(0,Hr.A)((function*(){throw new Error("Method not implemented.")}))()}rebuildModels(){var e=this;return(0,Hr.A)((function*(){yield e.buildModels()}))()}renderMulPass(e){return(0,Hr.A)((function*(){yield e.render()}))()}renderModels(e={}){return this.encodeDataLength<=0&&!this.forceRender?(this.clearModels(),this):(this.hooks.beforeRender.call(),this.models.forEach((t=>{t.draw({uniforms:this.layerModel.getUninforms(),blend:this.layerModel.getBlend(),stencil:this.layerModel.getStencil(e),textures:this.layerModel.textures},(null==e?void 0:e.ispick)||!1)})),this.hooks.afterRender.call(),this)}updateStyleAttribute(e,t,n,r){const i=this.configService.getAttributeConfig(this.id)||{};return!Tl(i[e],{field:t,values:n})&&(-1!==["color","size","texture","rotate","filter","label","shape"].indexOf(e)&&this.configService.setAttributeConfig(this.id,{[e]:{field:t,values:n}}),this.startInit?this.styleAttributeService.updateStyleAttribute(e,{scale:(0,Ur.A)({field:t},this.splitValuesAndCallbackInAttribute(n,this.getLayerConfig()[t]))},r):this.pendingStyleAttributes.push({attributeName:e,attributeField:t,attributeValues:n,updateOptions:r}),!0)}getLayerAttributeConfig(){return this.configService.getAttributeConfig(this.id)}getShaderPickStat(){return this.layerService.getShaderPickStat()}setEarthTime(e){console.warn("empty fn")}processData(e){return e}getModelType(){throw new Error("Method not implemented.")}getDefaultConfig(){return{}}initLayerModels(){var e=this;return(0,Hr.A)((function*(){e.models.forEach((e=>e.destroy())),e.models=[],e.uniformBuffers.forEach((e=>{e.destroy()})),e.uniformBuffers=[];const t=e.rendererService.createBuffer({data:new Float32Array(20).fill(0),isUBO:!0,label:"pickingUniforms"});e.uniformBuffers.push(t),e.models=yield e.layerModel.initModels()}))()}getPickingUniformBuffer(){return this.uniformBuffers[0]}reRender(){this.inited&&this.layerService.reRender()}splitValuesAndCallbackInAttribute(e){return{values:xl(e)?void 0:e,callback:xl(e)?e:void 0}}}function Il(e){return e.maskOperation===Ot.S7.OR?{enable:!0,mask:255,func:{cmp:Ot.gl.ALWAYS,ref:1,mask:255},opFront:{fail:Ot.gl.KEEP,zfail:Ot.gl.REPLACE,zpass:Ot.gl.REPLACE}}:{enable:!0,mask:255,func:{cmp:e.stencilType===Ot.RH.SINGLE||0===e.stencilIndex?Ot.gl.ALWAYS:Ot.gl.LESS,ref:e.stencilType===Ot.RH.SINGLE?1:0===e.stencilIndex?2:1,mask:255},opFront:{fail:Ot.gl.KEEP,zfail:Ot.gl.REPLACE,zpass:Ot.gl.REPLACE}}}const wl={opacity:1,stroke:[1,0,0,1],offsets:[0,0],rotation:0,extrusionBase:0,strokeOpacity:1,thetaOffset:.314},Pl={opacity:"float",stroke:"vec4",offsets:"vec2",textOffset:"vec2",rotation:"float",extrusionBase:"float",strokeOpacity:"float",thetaOffset:"float"};var Nl=n(91767),Dl=n.n(Nl);function Bl(e){return Math.max(4*Math.ceil(e/4),4)}function Fl(e,t,n,r=!0){const i=3===n;if(r){e=e.slice();const t=[];for(let r=0;r<e.length;r+=n){t[0]=e[r],t[1]=e[r+1],i&&(t[2]=e[r+2]);const n=(0,y.wU)(t,!0,{enable:!1,decimal:1});e[r]=n[0],e[r+1]=n[1],i&&(e[r+2]=n[2])}}return Dl()(e,t,n)}const Ul="ATTRIBUTE_LOCATION_";class kl{get attributeLocation(){return(0,Ur.A)({},ul)}constructor(e){(0,kr.A)(this,"triangulation",void 0),(0,kr.A)(this,"uniformBuffers",[]),(0,kr.A)(this,"textures",[]),(0,kr.A)(this,"createTexture2D",void 0),(0,kr.A)(this,"preStyleAttribute",{}),(0,kr.A)(this,"encodeStyleAttribute",{}),(0,kr.A)(this,"layer",void 0),(0,kr.A)(this,"dataTexture",void 0),(0,kr.A)(this,"DATA_TEXTURE_WIDTH",void 0),(0,kr.A)(this,"dataTextureTest",void 0),(0,kr.A)(this,"configService",void 0),(0,kr.A)(this,"shaderModuleService",void 0),(0,kr.A)(this,"rendererService",void 0),(0,kr.A)(this,"iconService",void 0),(0,kr.A)(this,"fontService",void 0),(0,kr.A)(this,"styleAttributeService",void 0),(0,kr.A)(this,"mapService",void 0),(0,kr.A)(this,"cameraService",void 0),(0,kr.A)(this,"layerService",void 0),(0,kr.A)(this,"pickingService",void 0),(0,kr.A)(this,"attributeUnifoms",void 0),(0,kr.A)(this,"commonUnifoms",void 0),this.layer=e,this.configService=e.getContainer().globalConfigService,this.rendererService=e.getContainer().rendererService,this.pickingService=e.getContainer().pickingService,this.shaderModuleService=e.getContainer().shaderModuleService,this.styleAttributeService=e.getContainer().styleAttributeService,this.mapService=e.getContainer().mapService,this.iconService=e.getContainer().iconService,this.fontService=e.getContainer().fontService,this.cameraService=e.getContainer().cameraService,this.layerService=e.getContainer().layerService,this.registerStyleAttribute(),this.registerBuiltinAttributes(),this.startModelAnimate();const{createTexture2D:t}=this.rendererService;this.createTexture2D=t}getBlend(){const{blend:e="normal"}=this.layer.getLayerConfig();return vl[Ot.c9[e]]}getStencil(e){const{mask:t=!1,maskInside:n=!0,enableMask:r,maskOperation:i=Ot.S7.AND}=this.layer.getLayerConfig();return"MaskLayer"===this.layer.type?Il({isStencil:!0,stencilType:Ot.RH.SINGLE}):e.isStencil?Il((0,Ur.A)((0,Ur.A)({},e),{},{maskOperation:i})):function(e,t){return{enable:e,mask:255,func:{cmp:Ot.gl.EQUAL,ref:t?1:0,mask:1}}}(t||r&&0!==this.layer.masks.length||void 0!==this.layer.tileMask,n)}getDefaultStyle(){return{}}getUninforms(){const e=this.getCommonUniformsInfo(),t=this.getUniformsBufferInfo(this.getStyleAttribute());this.updateStyleUnifoms();const n=(0,Ur.A)((0,Ur.A)({},t.uniformsOption),e.uniformsOption);return Object.keys(n).forEach((e=>{"boolean"==typeof n[e]&&(n[e]=n[e]?1:0)})),!this.rendererService.hasOwnProperty("device")&&this.textures&&1===this.textures.length&&(n.u_texture=this.textures[0]),n}getAnimateUniforms(){return{}}needUpdate(){return(0,Hr.A)((function*(){return!1}))()}buildModels(){return(0,Hr.A)((function*(){throw new Error("Method not implemented.")}))()}initModels(){return(0,Hr.A)((function*(){throw new Error("Method not implemented.")}))()}clearModels(e=!0){}getAttribute(){throw new Error("Method not implemented.")}prerender(){}render(e){throw new Error("Method not implemented.")}registerBuiltinAttributes(){throw new Error("Method not implemented.")}animateOption2Array(e){return[e.enable?0:1,e.duration||4,e.interval||.2,e.trailLength||.1]}startModelAnimate(){const{animateOption:e}=this.layer.getLayerConfig();e.enable&&this.layer.setAnimateStartTime()}getInject(){return function(e,t){const n=[];let r="";e.forEach((e=>{const i=e.replace(/([a-z])([A-Z])/g,"$1_$2").toUpperCase(),o=Ul+i;t[e]?r+=`#define USE_ATTRIBUTE_${i} 0.0 \n`:n.push(` ${Pl[e]} u_${e};`),r+=`\n#ifdef USE_ATTRIBUTE_${i}\nlayout(location = ${o}) in ${Pl[e]} a_${e.charAt(0).toUpperCase()+e.slice(1)};\n#endif \n`}));const i=n.length?`\nlayout(std140) uniform AttributeUniforms {\n ${n.join("\n")}\n};\n`:"";r+=i;let o="";return e.forEach((e=>{const t=e.replace(/([a-z])([A-Z])/g,"$1_$2").toUpperCase();o+=`\n #ifdef USE_ATTRIBUTE_${t}\n ${Pl[e]} ${e} = a_${e.charAt(0).toUpperCase()+e.slice(1)};\n #else\n ${Pl[e]} ${e} = u_${e};\n #endif\n `})),{"vs:#decl":r,"fs:#decl":i,"vs:#main-start":o}}(this.layer.enableShaderEncodeStyles,this.layer.encodeStyleAttribute)}getDefines(){const e=Object.keys(this.attributeLocation).reduce(((e,t)=>(e[Ul+t]=this.attributeLocation[t],e)),{});return(0,Ur.A)({},e)}getStyleAttribute(){const e={};return this.layer.enableShaderEncodeStyles.forEach((t=>{if(!this.layer.encodeStyleAttribute[t]){const n=this.layer.getLayerConfig()[t];let r=void 0===n?wl[t]:n;"stroke"===t&&(r=(0,y.HR)(r)),e["u_"+t]=r}})),e}registerStyleAttribute(){Object.keys(this.layer.encodeStyleAttribute).forEach((e=>{const t=function(e){switch(e){case"rotation":return{name:"Rotation",type:Ot.jQ.Attribute,descriptor:{name:"a_Rotation",shaderLocation:ul.ROTATION,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{rotation:t=0}=e;return Array.isArray(t)?[t[0]]:[t]}}};case"stroke":return{name:"stroke",type:Ot.jQ.Attribute,descriptor:{name:"a_Stroke",shaderLocation:ul.STROKE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:4,update:e=>{const{stroke:t=[1,1,1,1]}=e;return t}}};case"opacity":return{name:"opacity",type:Ot.jQ.Attribute,descriptor:{name:"a_Opacity",shaderLocation:ul.OPACITY,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{opacity:t=1}=e;return[t]}}};case"offsets":return{name:"offsets",type:Ot.jQ.Attribute,descriptor:{name:"a_Offsets",shaderLocation:ul.OFFSETS,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:e=>{const{offsets:t}=e;return t}}};default:return}}(e);t&&this.styleAttributeService.registerStyleAttribute(t)}))}registerPosition64LowAttribute(e=!0){this.styleAttributeService.registerStyleAttribute({name:"position64Low",type:Ot.jQ.Attribute,descriptor:{name:"a_Position64Low",shaderLocation:this.attributeLocation.POSITION_64LOW,buffer:{data:[],type:Ot.gl.FLOAT},size:2,update:(t,n,r)=>e?[(0,y.qk)(r[0]),(0,y.qk)(r[1])]:[0,0]}})}updateEncodeAttribute(e,t){this.encodeStyleAttribute[e]=t}initUniformsBuffer(){const e=this.getUniformsBufferInfo(this.getStyleAttribute()),t=this.getCommonUniformsInfo();0!==e.uniformsLength&&(this.attributeUnifoms=this.rendererService.createBuffer({data:new Float32Array(Bl(e.uniformsLength)).fill(0),isUBO:!0,label:"layerModelAttributeUnifoms"}),this.uniformBuffers.push(this.attributeUnifoms)),0!==t.uniformsLength&&(this.commonUnifoms=this.rendererService.createBuffer({data:new Float32Array(Bl(t.uniformsLength)).fill(0),isUBO:!0,label:"layerModelCommonUnifoms"}),this.uniformBuffers.push(this.commonUnifoms))}getUniformsBufferInfo(e){let t=0;const n=[];return Object.values(e).forEach((e=>{Array.isArray(e)?(n.push(...e),t+=e.length):"number"==typeof e?(n.push(e),t+=1):"boolean"==typeof e&&(n.push(Number(e)),t+=1)})),{uniformsOption:e,uniformsLength:t,uniformsArray:n}}getCommonUniformsInfo(){return{uniformsLength:0,uniformsArray:[],uniformsOption:{}}}updateStyleUnifoms(){var e,t;const{uniformsArray:n}=this.getUniformsBufferInfo(this.getStyleAttribute()),{uniformsArray:r}=this.getCommonUniformsInfo();null===(e=this.attributeUnifoms)||void 0===e||e.subData({offset:0,data:new Uint8Array(new Float32Array(n).buffer)}),null===(t=this.commonUnifoms)||void 0===t||t.subData({offset:0,data:new Uint8Array(new Float32Array(r).buffer)})}}function Gl(e){return e/180*Math.acos(-1)}function zl(e){const t=Gl(e[0])+Math.PI/2,n=Gl(e[1]),r=100+.4*Math.random(),i=r*Math.cos(n)*Math.cos(t);return[r*Math.cos(n)*Math.sin(t),r*Math.sin(n),i]}var jl=n(90333);const Vl=jl.vt(),Hl=(jl.vt(),jl.vt()),Wl=jl.vt(),Xl=jl.vt();function Zl(e,t,n,r,i){jl.WQ(e,n,r),jl.S8(e,e),t=jl.fA(-e[1],e[0]);const o=jl.fA(-n[1],n[0]);return[i/jl.Om(t,o),t]}function Yl(e,t){return jl.hZ(e,-t[1],t[0])}function ql(e,t,n){return jl.jb(e,t,n),jl.S8(e,e),e}function Kl(e,t){return e[0]===t[0]&&e[1]===t[1]}class Ql{constructor(e={}){(0,kr.A)(this,"complex",void 0),(0,kr.A)(this,"join",void 0),(0,kr.A)(this,"cap",void 0),(0,kr.A)(this,"miterLimit",void 0),(0,kr.A)(this,"thickness",void 0),(0,kr.A)(this,"normal",void 0),(0,kr.A)(this,"lastFlip",-1),(0,kr.A)(this,"miter",jl.fA(0,0)),(0,kr.A)(this,"started",!1),(0,kr.A)(this,"dash",!1),(0,kr.A)(this,"totalDistance",0),(0,kr.A)(this,"currentIndex",0),this.join=e.join||"miter",this.cap=e.cap||"butt",this.miterLimit=e.miterLimit||10,this.thickness=e.thickness||1,this.dash=e.dash||!1,this.complex={positions:[],indices:[],normals:[],startIndex:0,indexes:[]}}simpleExtrude(e){const t=this.complex;if(e.length<=1)return t;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;const n=e.length;let r=t.startIndex;for(let i=1;i<n;i++){const n=e[i-1],o=e[i],a=i<e.length-1?e[i+1]:null;r+=this.simpleSegment(t,r,n,o,a)}if(this.dash)for(let e=0;e<t.positions.length/6;e++)t.positions[6*e+5]=this.totalDistance;return t.startIndex=t.positions.length/6,t}extrude(e){const t=this.complex;if(e.length<=1)return t;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;const n=e.length;let r=t.startIndex;for(let i=1;i<n;i++){const n=e[i-1],o=e[i],a=i<e.length-1?e[i+1]:null;r+=this.segment(t,r,n,o,a)}if(this.dash)for(let e=0;e<t.positions.length/6;e++)t.positions[6*e+5]=this.totalDistance;return t.startIndex=t.positions.length/6,t}simpleSegment(e,t,n,r,i){let o=0;const a=e.indices,s=e.positions,l=e.normals,c=(0,y.se)([r[0],r[1]]),u=(0,y.se)([n[0],n[1]]);ql(Hl,c,u);let h=0;if(this.dash&&(h=this.lineSegmentDistance(c,u),this.totalDistance+=h),this.normal||(this.normal=jl.vt(),Yl(this.normal,Hl)),this.started||(this.started=!0,this.extrusions(s,l,n,this.normal,this.thickness,this.totalDistance-h)),a.push(t+0,t+1,t+2),i){const e=(0,y.se)([i[0],i[1]]);Kl(c,e)&&jl.WQ(e,c,jl.S8(e,jl.Re(e,c,u))),ql(Wl,e,c);const[n,h]=Zl(Xl,jl.vt(),Hl,Wl,this.thickness);let d=jl.Om(Xl,this.normal)<0?-1:1;this.extrusions(s,l,r,h,n,this.totalDistance),a.push(...1===this.lastFlip?[t,t+2,t+3]:[t+2,t+1,t+3]),d=-1,jl.C(this.normal,h),o+=2,this.lastFlip=d}else Yl(this.normal,Hl),this.extrusions(s,l,r,this.normal,this.thickness,this.totalDistance),a.push(...1===this.lastFlip?[t,t+2,t+3]:[t+2,t+1,t+3]),o+=2;return o}segment(e,t,n,r,i){let o=0;const a=e.indices,s=e.positions,l=e.normals,c="square"===this.cap,u="bevel"===this.join,h=(0,y.se)([r[0],r[1]]),d=(0,y.se)([n[0],n[1]]);ql(Hl,h,d);let f=0;if(this.dash&&(f=this.lineSegmentDistance(h,d),this.totalDistance+=f),this.normal||(this.normal=jl.vt(),Yl(this.normal,Hl)),!this.started)if(this.started=!0,c){const e=jl.vt(),t=jl.vt();jl.WQ(e,this.normal,Hl),jl.WQ(t,this.normal,Hl),l.push(t[0],t[1],0),l.push(e[0],e[1],0),s.push(n[0],n[1],0|n[2],this.totalDistance-f,-this.thickness,0|n[2]),this.complex.indexes.push(this.currentIndex),s.push(n[0],n[1],0|n[2],this.totalDistance-f,this.thickness,0|n[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(s,l,n,this.normal,this.thickness,this.totalDistance-f);if(a.push(t+0,t+1,t+2),i){const e=(0,y.se)([i[0],i[1]]);Kl(h,e)&&jl.WQ(e,h,jl.S8(e,jl.Re(e,h,d))),ql(Wl,e,h);const[n,c]=Zl(Xl,jl.vt(),Hl,Wl,this.thickness);let f=jl.Om(Xl,this.normal)<0?-1:1,p=u;p||"miter"!==this.join||n>this.miterLimit&&(p=!0),p?(l.push(this.normal[0],this.normal[1],0),l.push(c[0],c[1],0),s.push(r[0],r[1],0|r[2],this.totalDistance,-this.thickness*f,0|r[2]),this.complex.indexes.push(this.currentIndex),s.push(r[0],r[1],0|r[2],this.totalDistance,this.thickness*f,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++,a.push(...this.lastFlip!==-f?[t,t+2,t+3]:[t+2,t+1,t+3]),a.push(t+2,t+3,t+4),Yl(Vl,Wl),jl.C(this.normal,Vl),l.push(this.normal[0],this.normal[1],0),s.push(r[0],r[1],0|r[2],this.totalDistance,-this.thickness*f,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++,o+=3):(this.extrusions(s,l,r,c,n,this.totalDistance),a.push(...1===this.lastFlip?[t,t+2,t+3]:[t+2,t+1,t+3]),f=-1,jl.C(this.normal,c),o+=2),this.lastFlip=f}else{if(Yl(this.normal,Hl),c){const e=jl.vt(),t=jl.vt();jl.jb(t,Hl,this.normal),jl.WQ(e,Hl,this.normal),l.push(t[0],t[1],0),l.push(e[0],e[1],0),s.push(r[0],r[1],0|r[2],this.totalDistance,this.thickness,0|r[2]),this.complex.indexes.push(this.currentIndex),s.push(r[0],r[1],0|r[2],this.totalDistance,this.thickness,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(s,l,r,this.normal,this.thickness,this.totalDistance);a.push(...1===this.lastFlip?[t,t+2,t+3]:[t+2,t+1,t+3]),o+=2}return o}extrusions(e,t,n,r,i,o){t.push(r[0],r[1],0),t.push(r[0],r[1],0),e.push(n[0],n[1],0|n[2],o,-i,0|n[2]),this.complex.indexes.push(this.currentIndex),e.push(n[0],n[1],0|n[2],o,i,0|n[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}lineSegmentDistance(e,t){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}}let $l=function(e){return e.CYLINDER="cylinder",e.SQUARECOLUMN="squareColumn",e.TRIANGLECOLUMN="triangleColumn",e.HEXAGONCOLUMN="hexagonColumn",e.PENTAGONCOLUMN="pentagonColumn",e}({}),Jl=function(e){return e.CIRCLE="circle",e.SQUARE="square",e.TRIANGLE="triangle",e.HEXAGON="hexagon",e.PENTAGON="pentagon",e}({});function ec(e,t=0){const n=2*Math.PI/e,r=[];for(let i=0;i<e;i++)r.push(n*i+t*Math.PI/12);return r.map((e=>[Math.sin(e+Math.PI/4),Math.cos(e+Math.PI/4),0]))}function tc(){return ec(30)}function nc(){return ec(4)}function rc(){return ec(3)}function ic(){return ec(6,1)}function oc(){return ec(5)}const ac={[Jl.CIRCLE]:tc,[Jl.HEXAGON]:ic,[Jl.TRIANGLE]:rc,[Jl.SQUARE]:nc,[Jl.PENTAGON]:oc,[$l.CYLINDER]:tc,[$l.HEXAGONCOLUMN]:ic,[$l.TRIANGLECOLUMN]:rc,[$l.SQUARECOLUMN]:nc,[$l.PENTAGONCOLUMN]:oc};var sc=n(64062);function lc(e,t=!1){const n=e[0][0],r=e[0][e[0].length-1];n[0]===r[0]&&n[1]===r[1]&&(e[0]=e[0].slice(0,e[0].length-1));const i=e[0].length,o=Dl().flatten(e),{vertices:a,dimensions:s,holes:l}=o,c=[],u=[],h=[];for(let e=0;e<a.length/s;e++)c.push(a[e*s],a[e*s+1],1,-1,-1),h.push(0,0,1);const d=Fl(a,l,s,t);u.push(...d);for(let e=0;e<i;e++){const n=o.vertices.slice(e*s,(e+1)*s);let r=o.vertices.slice((e+1)*s,(e+2)*s);0===r.length&&(r=o.vertices.slice(0,s));const i=c.length/5;c.push(n[0],n[1],1,0,0,r[0],r[1],1,.1,0,n[0],n[1],0,0,.8,r[0],r[1],0,.1,.8);const a=cc([r[0],r[1],1],[n[0],n[1],0],[n[0],n[1],1],t);h.push(...a,...a,...a,...a),u.push(...[1,2,0,3,2,1].map((e=>e+i)))}return{positions:c,index:u,normals:h}}function cc(e,t,n,r=!1){const i=sc.vt(),o=sc.vt(),a=sc.vt();r&&(e=(0,y.wU)(e),t=(0,y.wU)(t),n=(0,y.wU)(n));const s=sc.fA(...e),l=sc.fA(...t),c=sc.fA(...n);sc.jb(i,c,l),sc.jb(o,s,l),sc.$A(a,i,o);const u=sc.vt();return sc.S8(u,a),u}const uc={};function hc(e){const t=(0,y.fi)(e.coordinates);return{vertices:[...t,...t,...t,...t],indices:[0,1,2,2,3,0],size:t.length}}function dc(e){const t=zl((0,y.fi)(e.coordinates));return{vertices:[...t,...t,...t,...t],indices:[0,1,2,2,3,0],size:t.length}}function fc(e){const{shape:t}=e,{positions:n,index:r,normals:i}=function(e,t=!1){if(uc&&uc[e])return uc[e];const n=lc([ac[e]?ac[e]():ac.cylinder()],t);return uc[e]=n,n}(t,!1);return{vertices:n,indices:r,normals:i,size:5}}function pc(e){const t=(0,y.fi)(e.coordinates);return{vertices:[...t],indices:[0],size:t.length}}function gc(e){const{coordinates:t}=e,n=new Ql({dash:!0,join:"bevel"});let r=t;r[0]&&!Array.isArray(r[0][0])&&(r=[t]),r.forEach((e=>{n.extrude(e)}));const i=n.complex;return{vertices:i.positions,indices:i.indices,normals:i.normals,indexes:i.indexes,size:6}}function mc(e){const{coordinates:t}=e,n=[];if(!Array.isArray(t[0]))return{vertices:[],indices:[],normals:[],size:6,count:0};const{results:r,totalDistance:i}=function(e){let t=e;Array.isArray(t)&&Array.isArray(t[0])&&Array.isArray(t[0][0])&&(t=e.flat());let n=0;if(t.length<2)return{results:t,totalDistance:0};{const e=[],r=vc(t[0],n);e.push(r);for(let r=1;r<t.length-1;r++){n+=_c((0,y.se)(t[r-1]),(0,y.se)(t[r]));const i=vc(t[r],n);e.push(i),e.push(i)}return n+=_c((0,y.se)(t[t.length-2]),(0,y.se)(t[t.length-1])),e.push(vc(t[t.length-1],n)),{results:e,totalDistance:n}}}(t);return r.map((e=>{n.push(e[0],e[1],e[2],e[3],0,i)})),{vertices:n,indices:[],normals:[],size:6,count:r.length}}function _c(e,t){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}function vc(e,t){return e.length<3&&e.push(0),void 0!==t&&e.push(t),e}function yc(e){const{coordinates:t}=e,n=Dl().flatten(t),{vertices:r,dimensions:i,holes:o}=n;return{indices:Fl(r,o,i),vertices:r,size:i}}function Ec(e){const{indices:t,vertices:n,size:r}=yc(e);return{indices:t,vertices:Ac(n),size:r+4}}function Ac(e){const t=[],{center:n,radius:r}=(0,y.gP)(e);for(let i=0;i<e.length;i+=2){const o=e[i],a=e[i+1];t.push(o,a,0,...n,r)}return t}function bc(e){const t=e.coordinates,{positions:n,index:r,normals:i}=lc(t,!0);return{vertices:n,indices:r,normals:i,size:5}}function Tc(e){const t=e.coordinates;return{vertices:[...t[0],0,0,0,...t[1],0,1,0,...t[2],0,1,1,...t[3],0,0,1],indices:[0,1,2,0,2,3],size:5}}function xc(e,t){const{segmentNumber:n=30}=t,r=e.coordinates,i=[],o=[];for(let e=0;e<n;e++)i.push(e,1,e,r[0][0],r[0][1],r[1][0],r[1][1],e,-1,e,r[0][0],r[0][1],r[1][0],r[1][1]),e!==n-1&&o.push(...[0,1,2,1,3,2].map((t=>2*e+t)));return{vertices:i,indices:o,size:7}}const Sc={image:class extends kl{constructor(...e){super(...e),(0,kr.A)(this,"texture",void 0)}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,UV:9})}getCommonUniformsInfo(){const{opacity:e,brightness:t,contrast:n,saturation:r,gamma:i}=this.layer.getLayerConfig(),o={u_opacity:(0,y.Jh)(e,1),u_brightness:(0,y.Jh)(t,1),u_contrast:(0,y.Jh)(n,1),u_saturation:(0,y.Jh)(r,1),u_gamma:(0,y.Jh)(i,1)};return this.textures=[this.texture],this.getUniformsBufferInfo(o)}initModels(){var e=this;return(0,Hr.A)((function*(){return yield e.loadTexture(),e.buildModels()}))()}clearModels(){var e;null===(e=this.texture)||void 0===e||e.destroy()}loadTexture(){var e=this;return(0,Hr.A)((function*(){const{createTexture2D:t}=e.rendererService,n=e.layer.getSource(),r=yield n.data.images;e.texture=t({data:r[0],width:r[0].width,height:r[0].height,mag:Ot.gl.LINEAR,min:Ot.gl.LINEAR})}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"rasterImage",vertexShader:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_Uv;\n\nlayout(std140) uniform commonUniforms {\n float u_opacity:1.0;\n float u_brightness:1.0;\n float u_contrast:1.0;\n float u_saturation:1.0;\n float u_gamma:1.0;\n};\n\nout vec2 v_texCoord;\n#pragma include "projection"\n\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0.0, 1.0));\n}\n',fragmentShader:"uniform sampler2D u_texture;\nlayout(std140) uniform commonUniforms {\n float u_opacity:1.0;\n float u_brightness:1.0;\n float u_contrast:1.0;\n float u_saturation:1.0;\n float u_gamma:1.0;\n};\n\nin vec2 v_texCoord;\nout vec4 outputColor;\nvec3 setContrast(vec3 rgb, float contrast) {\n vec3 color = mix(vec3(0.5), rgb, contrast);\n color = clamp(color, 0.0, 1.0);\n return color;\n}\nvec3 setSaturation(vec3 rgb, float adjustment) {\n const vec3 grayVector = vec3(0.2125, 0.7154, 0.0721);\n vec3 intensity = vec3(dot(rgb, grayVector));\n vec3 color = mix(intensity, rgb, adjustment);\n color = clamp(color, 0.0, 1.0);\n return color;\n}\nvoid main() {\n vec4 color = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y));\n //brightness\n color.rgb = mix(vec3(0.0, 0.0, 0.0), color.rgb, u_brightness);\n //contrast\n color.rgb = setContrast(color.rgb, u_contrast);\n // saturation\n color.rgb = setSaturation(color.rgb, u_saturation);\n // gamma\n color.rgb = pow(color.rgb, vec3(u_gamma));\n outputColor = color;\n outputColor.a *= u_opacity;\n if(outputColor.a < 0.01)\n discard;\n}\n",defines:e.getDefines(),triangulation:Tc,primitive:Ot.gl.TRIANGLES,blend:{enable:!0},depth:{enable:!1},pickingEnabled:!1})]}))()}registerBuiltinAttributes(){this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Ot.jQ.Attribute,descriptor:{name:"a_Uv",shaderLocation:this.attributeLocation.UV,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:(e,t,n)=>[n[3],n[4]]}})}}},Rc=Sc;class Cc extends Ml{constructor(...e){super(...e),(0,kr.A)(this,"type","ImageLayer")}buildModels(){var e=this;return(0,Hr.A)((function*(){const t=e.getModelType();e.layerModel=new Rc[t](e),yield e.initLayerModels()}))()}getDefaultConfig(){return{image:{}}[this.getModelType()]}getModelType(){return"image"}}const Lc={solid:0,dash:1},Oc={solid:0,dash:1};class Mc extends kl{constructor(...e){super(...e),(0,kr.A)(this,"texture",void 0),(0,kr.A)(this,"updateTexture",(()=>{const{createTexture2D:e}=this.rendererService;if(this.texture)return this.texture.update({data:this.iconService.getCanvas()}),void this.layer.render();this.texture=e({data:this.iconService.getCanvas(),mag:Ot.gl.NEAREST,min:Ot.gl.NEAREST,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128}),this.textures=[this.texture]}))}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,INSTANCE:10,INSTANCE_64LOW:11,UV:12,THETA_OFFSET:13})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:t,textureBlend:n="normal",lineType:r="solid",dashArray:i=[10,5],lineTexture:o=!1,iconStep:a=100,segmentNumber:s=30,globalArcHeight:l=10}=this.layer.getLayerConfig(),{animateOption:c}=this.layer.getLayerConfig();2===i.length&&i.push(0,0);let u=0,h=[0,0,0,0],d=[0,0,0,0];var f;e&&t&&(h=(0,y.HR)(e),d=(0,y.HR)(t),u=1),this.rendererService.getDirty()&&(null===(f=this.texture)||void 0===f||f.bind());const p={u_animate:this.animateOption2Array(c),u_dash_array:i,u_sourceColor:h,u_targetColor:d,u_textSize:[1024,this.iconService.canvasHeight||128],u_globel:"GLOBEL"===this.mapService.version?1:0,u_globel_radius:100,u_global_height:l,segmentNumber:s,u_line_type:Oc[r]||0,u_icon_step:a,u_line_texture:o?1:0,u_textureBlend:"normal"===n?0:1,u_time:this.layer.getLayerAnimateTime()||0,u_linearColor:u};return this.getUniformsBufferInfo(p)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.initUniformsBuffer(),e.updateTexture(),e.iconService.on("imageUpdate",e.updateTexture),e.buildModels()}))()}clearModels(){var e;null===(e=this.texture)||void 0===e||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}getShaders(){return{frag:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform sampler2D u_texture;\n\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array: [10.0, 5., 0, 0];\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_globel;\n float u_globel_radius;\n float u_global_height: 10;\n float segmentNumber;\n float u_line_type: 0.0;\n float u_icon_step: 100;\n float u_line_texture: 0.0;\n float u_textureBlend;\n float u_time;\n float u_linearColor: 0.0;\n};\n\nin vec4 v_color;\nin vec4 v_dash_array;\nin float v_segmentIndex;\nin vec2 v_iconMapUV;\nin vec4 v_line_data;\n\nout vec4 outputColor;\n\n#pragma include "picking"\n\nvoid main() {\n float animateSpeed = 0.0; // 运动速度\n float d_distance_ratio = v_line_data.g; // 当前点位距离占线总长的比例\n outputColor = v_color;\n\n if(u_line_type == LineTypeDash) {\n float flag = 0.;\n float dashLength = mod(d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n 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)) {\n flag = 1.;\n }\n outputColor.a *=flag;\n }\n\n if(u_animate.x == Animate && u_line_texture != LineTexture) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);\n\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n // alpha = smoothstep(0., 1., alpha);\n alpha = clamp(alpha, 0.0, 1.0);\n outputColor.a *= alpha;\n\n // u_animate\n // x enable\n // y duration\n // z interval\n // w trailLength\n }\n\n if(u_line_texture == LineTexture && u_line_type != LineTypeDash) { // while load texture\n // float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / segmentNumber));\n float arcRadio = v_segmentIndex / (segmentNumber - 1.0);\n float count = v_line_data.b; // // 贴图在弧线上重复的数量\n\n float time = 0.0;\n if(u_animate.x == Animate) {\n time = u_time / u_animate.y;\n }\n float redioCount = arcRadio * count;\n\n float u = fract(redioCount - time);\n\n float v = v_line_data.a; // 线图层贴图部分的 v 坐标值\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture(SAMPLER_2D(u_texture), uv);\n\n if(u_animate.x == Animate) {\n float currentPlane = floor(redioCount - time);\n float textureStep = floor(count * u_animate.z);\n float a = mod(currentPlane, textureStep);\n if(a < textureStep - 1.0) {\n pattern = vec4(0.0);\n }\n }\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n outputColor = filterColor(outputColor + pattern);\n } else { // replace\n pattern.a *= v_color.a;\n if(outputColor.a <= 0.0) {\n pattern.a = 0.0;\n discard;\n } else {\n outputColor = filterColor(pattern);\n }\n }\n\n } else {\n outputColor = filterColor(outputColor);\n }\n}\n',vert:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nlayout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_INSTANCE) in vec4 a_Instance;\nlayout(location = ATTRIBUTE_LOCATION_INSTANCE_64LOW) in vec4 a_Instance64Low;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_iconMapUV;\n\n\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array: [10.0, 5., 0, 0];\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_globel;\n float u_globel_radius;\n float u_global_height: 10;\n float segmentNumber;\n float u_line_type: 0.0;\n float u_icon_step: 100;\n float u_line_texture: 0.0;\n float u_textureBlend;\n float u_time;\n float u_linearColor: 0.0;\n};\nout vec4 v_color;\nout vec4 v_dash_array;\nout float v_segmentIndex;\nout vec2 v_iconMapUV;\nout vec4 v_line_data;\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\n\nfloat maps (float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(\n mix(source, target, segmentRatio),\n sqrt(max(0.0, vertex_height))\n );\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\n\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return dir_screenspace.xy * sign(offset_direction);\n}\n\nfloat torad(float deg) {\n return (deg / 180.0) * acos(-1.0);\n}\n\nvec3 lglt2xyz(vec2 lnglat) {\n float pi = 3.1415926;\n // + Math.PI/2 是为了对齐坐标\n float lng = torad(lnglat.x) + pi / 2.0;\n float lat = torad(lnglat.y);\n\n // 手动增加一些偏移,减轻面的冲突\n float radius = u_globel_radius;\n\n float z = radius * cos(lat) * cos(lng);\n float x = radius * cos(lat) * sin(lng);\n float y = radius * sin(lat);\n return vec3(x, y, z);\n}\n\nvoid main() {\n //vs中计算渐变色\n if(u_linearColor==1.0){\n float d_segmentIndex = a_Position.x + 1.0; // 当前顶点在弧线中所处的分段位置\n v_color = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);\n }\n else{\n v_color = a_Color;\n }\n v_color.a = v_color.a * opacity;\n vec2 source = project_position(vec4(a_Instance.rg, 0, 0), a_Instance64Low.xy).xy;\n vec2 target = project_position(vec4(a_Instance.ba, 0, 0), a_Instance64Low.zw).xy;\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n\n float d_distance_ratio;\n if(u_line_type == LineTypeDash) {\n d_distance_ratio = segmentIndex / segmentNumber;\n float total_Distance = pixelDistance(source, target) / 2.0 * PI;\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);\n }\n if(u_animate.x == Animate) {\n d_distance_ratio = segmentIndex / segmentNumber;\n }\n v_line_data.g = d_distance_ratio; // 当前点位距离占线总长的比例\n\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n vec3 curr = getPos(source, target, segmentRatio);\n vec3 next = getPos(source, target, nextSegmentRatio);\n vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y);\n // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\n\n\n v_segmentIndex = a_Position.x;\n if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { // 开启贴图模式\n\n float arcDistrance = length(source - target);\n float pixelLen = project_pixel_texture(u_icon_step);\n v_line_data.b = floor(arcDistrance/pixelLen); // 贴图在弧线上重复的数量\n\n vec2 projectOffset = project_pixel(offset);\n float lineOffsetWidth = length(projectOffset + projectOffset * sign(a_Position.y)); // 线横向偏移的距离\n float linePixelSize = project_pixel(a_Size); // 定点位置偏移,按地图等级缩放后的距离\n v_line_data.a = lineOffsetWidth/linePixelSize; // 线图层贴图部分的 v 坐标值\n\n v_iconMapUV = a_iconMapUV;\n }\n\n\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z * thetaOffset, 1.0));\n\n // 地球模式\n if(u_globel > 0.0) {\n vec3 startLngLat = lglt2xyz(a_Instance.rg);\n vec3 endLngLat = lglt2xyz(a_Instance.ba);\n float globalRadius = length(startLngLat);\n\n vec3 lineDir = normalize(endLngLat - startLngLat);\n vec3 midPointDir = normalize((startLngLat + endLngLat)/2.0);\n\n // 线的偏移\n vec3 lnglatOffset = cross(lineDir, midPointDir) * a_Position.y;\n // 计算起始点和终止点的距离\n float lnglatLength = length(a_Instance.rg - a_Instance.ba)/50.0;\n // 计算飞线各个节点相应的高度\n float lineHeight = u_global_height * (-4.0*segmentRatio*segmentRatio + 4.0 * segmentRatio) * lnglatLength;\n // 地球点位\n vec3 globalPoint = normalize(mix(startLngLat, endLngLat, segmentRatio)) * (globalRadius + lineHeight) + lnglatOffset * a_Size;\n\n gl_Position = u_ViewProjectionMatrix * vec4(globalPoint, 1.0);\n }\n\n\n setPickingColor(a_PickingColor);\n}\n',type:""}}buildModels(){var e=this;return(0,Hr.A)((function*(){const{segmentNumber:t=30}=e.layer.getLayerConfig(),{frag:n,vert:r,type:i}=e.getShaders();return[yield e.layer.buildLayerModel({moduleName:"lineArc3d"+i,vertexShader:r,fragmentShader:n,defines:e.getDefines(),inject:e.getInject(),triangulation:xc,styleOption:{segmentNumber:t}})]}))()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{size:t=1}=e;return Array.isArray(t)?[t[0]]:[t]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:Ot.jQ.Attribute,descriptor:{name:"a_Instance",shaderLocation:this.attributeLocation.INSTANCE,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:4,update:(e,t,n)=>[n[3],n[4],n[5],n[6]]}}),this.styleAttributeService.registerStyleAttribute({name:"instance64Low",type:Ot.jQ.Attribute,descriptor:{name:"a_Instance64Low",shaderLocation:this.attributeLocation.INSTANCE_64LOW,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:4,update:(e,t,n)=>[(0,y.qk)(n[3]),(0,y.qk)(n[4]),(0,y.qk)(n[5]),(0,y.qk)(n[6])]}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Ot.jQ.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:this.attributeLocation.UV,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:e=>{const t=this.iconService.getIconMap(),{texture:n}=e,{x:r,y:i}=t[n]||{x:0,y:0};return[r,i]}}}),this.styleAttributeService.registerStyleAttribute({name:"thetaOffset",type:Ot.jQ.Attribute,descriptor:{name:"a_ThetaOffset",shaderLocation:this.attributeLocation.THETA_OFFSET,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{thetaOffset:t=1}=e;return[t]}}})}}const Ic={circle:2,triangle:2,diamond:4,rect:2,classic:3,halfTriangle:2,none:0},wc=.5;function Pc(e,t){const n="source"===t?1:-1,r="object"==typeof e?e:{};switch("object"==typeof e?e.type:e){case"circle":return function(e,t){const{width:n=2,height:r=2}=t,i=tc(),o=Dl().flatten([i]),a=Dl()(o.vertices,o.holes,o.dimensions),s=i.map((t=>[t[0]*n*e,t[1]*r])).flat();return{vertices:[...s,...s],dimensions:2,indices:a.map((e=>e+i.length)),outLineIndices:a,normals:[...i.map((t=>[t[1]*r,t[0]*n*e,1])).flat(),...new Array(3*i.length).fill(0)]}}(n,r);case"triangle":return function(e,t){const{width:n=2,height:r=3}=t;return{vertices:[0,0,1*e*n,1*r,1*e*n,-1*r,0,0,1*e*n,1*r,1*e*n,-1*r],outLineIndices:[0,1,2],indices:[3,4,5],normals:[0,-1.5*e,1,2,1*e,1,-2,1*e,1,0,0,0,0,0,0,0,0,0],dimensions:2}}(n,r);case"diamond":return function(e,t){const{width:n=2,height:r=3}=t;return{vertices:[0,0,1*n*e,.5*r,2*n*e,0,1*n*e,-.5*r,0,0,1*n*e,.5*r,2*n*e,0,1*n*e,-.5*r],dimensions:2,indices:[4,5,6,4,6,7],outLineIndices:[0,1,2,0,2,3],normals:[0,-e,1,1,0,1,0,-e,1,-1,-0,1,0,0,0,0,0,0,0,0,0,0,0,0]}}(n,r);case"rect":return function(e,t){const{width:n=2,height:r=2}=t;return{vertices:[0,r/2,e*n*1,r/2,e*n*1,-r/2,0,-r/2,0,r/2,e*n*1,r/2,e*n*1,-r/2,0,-r/2],dimensions:2,indices:[4,5,6,4,6,7],outLineIndices:[0,1,2,0,2,3],normals:[0,-e,1,1,0,1,0,-e,1,-1,-0,1,0,0,0,0,0,0,0,0,0,0,0,0]}}(n,r);case"classic":return function(e,t){const{width:n=2,height:r=3}=t;return{vertices:[0,0,2*e*n,1*r,1.5*e*n,0,2*e*n,-1*r,0,0,2*e*n,1*r,1.5*e*n,0,2*e*n,-1*r],dimensions:2,indices:[4,5,6,4,6,7],outLineIndices:[0,1,2,0,2,3],normals:[0,-e,1,1,0,1,0,-e,1,-1,-0,1,0,0,0,0,0,0,0,0,0,0,0,0]}}(n,r);case"halfTriangle":return function(e,t){const{width:n=2,height:r=1}=t;return{vertices:[0,wc*e,1*e*n,-(r+wc)*e,1*e*n,(r-wc)*e,0,wc*e,1*e*n,-(r+wc)*e,1*e*n,(r-wc)*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}}(n,r);default:return{vertices:[],indices:[],normals:[],dimensions:2,outLineIndices:[],outLineNormals:[]}}}function Nc(e,t){return t?function(e,t){const n=e.coordinates.flat(),{target:r="classic",source:i="circle"}=t,o=Dc(Pc(i,"source"),n,0,0),a=function(e,t=0,n){const r="object"==typeof n.source?n.source.type:n.source,i="object"==typeof n.target?n.target.type:n.target,{width:o=(r?Ic[r]:0)}="object"==typeof n.source?n.source:{},{width:a=(i?Ic[i]:0)}="object"==typeof n.target?n.target:{};return{vertices:[0,wc,1*o,...e,1,wc,-1*a,...e,1,-.5,-1*a,...e,0,-.5,1*o,...e,0,wc,1*o,...e,1,wc,-1*a,...e,1,-.5,-1*a,...e,0,-.5,1*o,...e],outLineIndices:[0,1,2,0,2,3].map((e=>e+t)),indices:[4,5,6,4,6,7].map((e=>e+t)),normals:[1,-1,1,1,1,1,-1,0,1,-1,0,1,0,0,0,0,0,0,0,0,0,0,0,0],dimensions:2}}(n,o.vertices.length/7,t),s=Dc(Pc(r,"target"),n,1,o.vertices.length/7+a.vertices.length/7);return{vertices:[...o.vertices,...a.vertices,...s.vertices],indices:[...o.outLineIndices,...a.outLineIndices,...s.outLineIndices,...o.indices,...a.indices,...s.indices],normals:[...o.normals,...a.normals,...s.normals],size:7}}(e,t):function(e){const t=e.coordinates.flat();return{vertices:[1,0,0,...t,1,2,-3,...t,1,1,-3,...t,0,1,0,...t,0,0,0,...t,1,0,0,...t,1,2,-3,...t,1,1,-3,...t,0,1,0,...t,0,0,0,...t],normals:[-1,2,1,2,-1,1,1,-1,1,1,-1,1,-1,-1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],indices:[0,1,2,0,2,3,0,3,4,5,6,7,5,7,8,5,8,9],size:7}}(e)}function Dc(e,t,n=1,r=0){const i=[],{vertices:o,indices:a,dimensions:s,outLineIndices:l}=e;for(let e=0;e<o.length;e+=s)i.push(n,o[e+1],o[e],...t);return(0,Ur.A)((0,Ur.A)({},e),{},{vertices:i,indices:a.map((e=>e+r)),outLineIndices:l.map((e=>e+r))})}const Bc={solid:0,dash:1};let Fc=function(e){return e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e}({}),Uc=function(e){return e.NORMAL="normal",e.REPLACE="replace",e}({}),kc=function(e){return e[e.pixel=0]="pixel",e[e.meter=1]="meter",e}({});class Gc extends kl{constructor(...e){super(...e),(0,kr.A)(this,"textureEventFlag",!1),(0,kr.A)(this,"texture",this.createTexture2D({data:new Uint8Array([0,0,0,0]),width:1,height:1})),(0,kr.A)(this,"updateTexture",(()=>{const{createTexture2D:e}=this.rendererService;if(0===this.textures.length&&(this.textures=[this.texture]),this.texture)return this.texture.update({data:this.iconService.getCanvas()}),void this.layer.render();this.texture=e({data:this.iconService.getCanvas(),mag:Ot.gl.NEAREST,min:Ot.gl.NEAREST,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128})}))}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,DISTANCE_INDEX:10,NORMAL:11,UV:12})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:t,textureBlend:n="normal",lineType:r="solid",dashArray:i=[10,5,0,0],lineTexture:o=!1,iconStep:a=100,vertexHeightScale:s=20,strokeWidth:l=0,raisingHeight:c=0,heightfixed:u=!1,linearDir:h=Fc.VERTICAL,blur:d=[1,1,1,0]}=this.layer.getLayerConfig();let f=i;var p;"dash"!==r&&(f=[0,0,0,0]),2===f.length&&f.push(0,0),this.rendererService.getDirty()&&this.texture&&(null===(p=this.texture)||void 0===p||p.bind());const{animateOption:g}=this.layer.getLayerConfig();let m=0,_=[0,0,0,0],v=[0,0,0,0];e&&t&&(_=(0,y.HR)(e),v=(0,y.HR)(t),m=1);const E={u_animate:this.animateOption2Array(g),u_dash_array:f,u_blur:d,u_sourceColor:_,u_targetColor:v,u_textSize:[1024,this.iconService.canvasHeight||128],u_icon_step:a,u_heightfixed:Number(u),u_vertexScale:s,u_raisingHeight:Number(c),u_strokeWidth:l,u_textureBlend:n===Uc.NORMAL?0:1,u_line_texture:o?1:0,u_linearDir:h===Fc.VERTICAL?1:0,u_linearColor:m,u_time:this.layer.getLayerAnimateTime()||0};return this.getUniformsBufferInfo(E)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.initUniformsBuffer(),e.textureEventFlag||(e.textureEventFlag=!0,e.updateTexture(),e.iconService.on("imageUpdate",e.updateTexture)),e.buildModels()}))()}clearModels(){var e;null===(e=this.texture)||void 0===e||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}buildModels(){var e=this;return(0,Hr.A)((function*(){const{depth:t=!1}=e.layer.getLayerConfig(),{frag:n,vert:r,type:i}=e.getShaders();return e.layer.triangulation=gc,[yield e.layer.buildLayerModel({moduleName:"line"+i,vertexShader:r,fragmentShader:n,triangulation:gc,defines:e.getDefines(),inject:e.getInject(),depth:{enable:t}})]}))()}getShaders(){return{frag:'// #extension GL_OES_standard_derivatives : enable\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform sampler2D u_texture;\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array;\n vec4 u_blur;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed: 0.0;\n float u_vertexScale: 1.0;\n float u_raisingHeight: 0.0;\n float u_strokeWidth: 0.0;\n float u_textureBlend;\n float u_line_texture;\n float u_linearDir: 1.0;\n float u_linearColor: 0;\n float u_time;\n};\n\nin vec4 v_color;\nin vec4 v_stroke;\n// dash\nin vec4 v_dash_array;\nin float v_d_distance_ratio;\nin vec2 v_iconMapUV;\nin vec4 v_texture_data;\n\nout vec4 outputColor;\n#pragma include "picking"\n\n// [animate, duration, interval, trailLength],\nvoid main() {\n if(u_dash_array!=vec4(0.0)){\n float dashLength = mod(v_d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n 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))) {\n // 虚线部分\n discard;\n };\n }\n float animateSpeed = 0.0; // 运动速度\n float d_distance_ratio = v_texture_data.r; // 当前点位距离占线总长的比例\n if(u_linearDir < 1.0) {\n d_distance_ratio = v_texture_data.a;\n }\n if(u_linearColor == 1.0) { // 使用渐变颜色\n outputColor = mix(u_sourceColor, u_targetColor, d_distance_ratio);\n outputColor.a *= v_color.a;\n } else { // 使用 color 方法传入的颜色\n outputColor = v_color;\n }\n // anti-alias\n // float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy));\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n alpha = smoothstep(0., 1., alpha);\n outputColor.a *= alpha;\n }\n\n if(u_line_texture == LineTexture) { // while load texture\n float aDistance = v_texture_data.g; // 当前顶点的距离\n float d_texPixelLen = v_texture_data.b; // 贴图的像素长度,根据地图层级缩放\n float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);\n float v = v_texture_data.a; // 线图层贴图部分的 v 坐标值\n\n // v = max(smoothstep(0.95, 1.0, v), v);\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture(SAMPLER_2D(u_texture), uv);\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n outputColor += pattern;\n } else { // replace\n pattern.a *= v_color.a;\n if(outputColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n outputColor = pattern;\n }\n } \n\n float v = v_texture_data.a;\n float strokeWidth = min(0.5, u_strokeWidth);\n // 绘制 border\n if(strokeWidth > 0.01) {\n float borderOuterWidth = strokeWidth / 2.0;\n\n\n if(v >= 1.0 - strokeWidth || v <= strokeWidth) {\n if(v > strokeWidth) { // 外侧\n float linear = smoothstep(0.0, 1.0, (v - (1.0 - strokeWidth))/strokeWidth);\n // float linear = step(0.0, (v - (1.0 - borderWidth))/borderWidth);\n outputColor.rgb = mix(outputColor.rgb, v_stroke.rgb, linear);\n } else if(v <= strokeWidth) {\n float linear = smoothstep(0.0, 1.0, v/strokeWidth);\n outputColor.rgb = mix(v_stroke.rgb, outputColor.rgb, linear);\n }\n }\n\n if(v < borderOuterWidth) {\n outputColor.a = mix(0.0, outputColor.a, v/borderOuterWidth);\n } else if(v > 1.0 - borderOuterWidth) {\n outputColor.a = mix(outputColor.a, 0.0, (v - (1.0 - borderOuterWidth))/borderOuterWidth);\n }\n }\n\n // blur\n float blurV = v_texture_data.a;\n if(blurV < 0.5) {\n outputColor.a *= mix(u_blur.r, u_blur.g, blurV/0.5);\n } else {\n outputColor.a *= mix(u_blur.g, u_blur.b, (blurV - 0.5)/0.5);\n }\n \n outputColor = filterColor(outputColor);\n}\n',vert:'#define Animate (0.0)\n\nlayout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in vec2 a_Size;\nlayout(location = ATTRIBUTE_LOCATION_DISTANCE_INDEX) in vec3 a_DistanceAndIndexAndMiter;\nlayout(location = ATTRIBUTE_LOCATION_NORMAL) in vec4 a_Normal_Total_Distance;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_iconMapUV;\n\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array;\n vec4 u_blur;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed: 0.0;\n float u_vertexScale: 1.0;\n float u_raisingHeight: 0.0;\n float u_strokeWidth: 0.0;\n float u_textureBlend;\n float u_line_texture;\n float u_linearDir: 1.0;\n float u_linearColor: 0;\n float u_time;\n};\n\nout vec4 v_color;\nout vec4 v_stroke;\n//dash\nout vec4 v_dash_array;\nout float v_d_distance_ratio;\n// texV 线图层 - 贴图部分的 v 坐标(线的宽度方向)\nout vec2 v_iconMapUV;\nout vec4 v_texture_data;\n\n#pragma include "projection"\n#pragma include "picking"\n\nvoid main() {\n vec2 a_DistanceAndIndex = a_DistanceAndIndexAndMiter.xy;\n float a_Miter = a_DistanceAndIndexAndMiter.z;\n vec3 a_Normal = a_Normal_Total_Distance.xyz;\n float a_Total_Distance = a_Normal_Total_Distance.w;\n //dash输出\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance;\n v_d_distance_ratio = a_DistanceAndIndex.x / a_Total_Distance;\n\n // cal style mapping - 数据纹理映射部分的计算\n float d_texPixelLen; // 贴图的像素长度,根据地图层级缩放\n v_iconMapUV = a_iconMapUV;\n d_texPixelLen = project_float_pixel(u_icon_step);\n\n v_color = a_Color;\n v_color.a *= opacity;\n v_stroke = stroke;\n\n vec3 size = a_Miter * setPickingSize(a_Size.x) * a_Normal;\n\n vec2 offset = project_pixel(size.xy);\n\n float lineDistance = a_DistanceAndIndex.x;\n float currentLinePointRatio = lineDistance / a_Total_Distance;\n\n float lineOffsetWidth = length(offset + offset * sign(a_Miter)); // 线横向偏移的距离(向两侧偏移的和)\n float linePixelSize = project_pixel(a_Size.x) * 2.0; // 定点位置偏移,按地图等级缩放后的距离 单侧 * 2\n float texV = lineOffsetWidth / linePixelSize; // 线图层贴图部分的 v 坐标值\n\n v_texture_data = vec4(currentLinePointRatio, lineDistance, d_texPixelLen, texV);\n // 设置数据集的参数\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0), a_Position64Low);\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));\n\n float h = float(a_Position.z) * u_vertexScale; // 线顶点的高度 - 兼容不存在第三个数值的情况 vertex height\n float lineHeight = a_Size.y; // size 第二个参数代表的高度 [linewidth, lineheight]\n\n // 兼容 mapbox 在线高度上的效果表现基本一致\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n // mapbox\n // 保持高度相对不变\n float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom);\n h *= mapboxZoomScale;\n h += u_raisingHeight * mapboxZoomScale;\n if (u_heightfixed > 0.0) {\n lineHeight *= mapboxZoomScale;\n }\n }\n\n gl_Position = project_common_position_to_clipspace(\n vec4(project_pos.xy + offset, lineHeight + h, 1.0)\n );\n\n setPickingColor(a_PickingColor);\n}\n',type:""}}registerBuiltinAttributes(){this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"distanceAndIndex",type:Ot.jQ.Attribute,descriptor:{name:"a_DistanceAndIndexAndMiter",shaderLocation:this.attributeLocation.DISTANCE_INDEX,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:(e,t,n,r,i,o)=>void 0===o?[n[3],10,n[4]]:[n[3],o,n[4]]}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:e=>{const{size:t=1}=e;return Array.isArray(t)?[t[0],t[1]]:[t,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal_total_distance",type:Ot.jQ.Attribute,descriptor:{name:"a_Normal_Total_Distance",shaderLocation:this.attributeLocation.NORMAL,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:4,update:(e,t,n,r,i)=>[...i,n[5]]}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Ot.jQ.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:this.attributeLocation.UV,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:e=>{const t=this.iconService.getIconMap(),{texture:n}=e,{x:r,y:i}=t[n]||{x:0,y:0};return[r,i]}}})}}const zc={arc:class extends kl{constructor(...e){super(...e),(0,kr.A)(this,"texture",void 0),(0,kr.A)(this,"updateTexture",(()=>{const{createTexture2D:e}=this.rendererService;if(this.texture)return this.texture.update({data:this.iconService.getCanvas()}),void this.layer.render();this.texture=e({data:this.iconService.getCanvas(),mag:Ot.gl.NEAREST,min:Ot.gl.NEAREST,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128}),this.textures=[this.texture]}))}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,INSTANCE:10,INSTANCE_64LOW:11,UV:12,THETA_OFFSET:13})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:t,textureBlend:n="normal",lineType:r="solid",dashArray:i=[10,5],forward:o=!0,lineTexture:a=!1,iconStep:s=100,segmentNumber:l=30}=this.layer.getLayerConfig(),{animateOption:c}=this.layer.getLayerConfig();let u=i;"dash"!==r&&(u=[0,0]),2===u.length&&u.push(0,0);let h=0,d=[0,0,0,0],f=[0,0,0,0];var p;e&&t&&(d=(0,y.HR)(e),f=(0,y.HR)(t),h=1),this.rendererService.getDirty()&&(null===(p=this.texture)||void 0===p||p.bind());const g={u_animate:this.animateOption2Array(c),u_dash_array:u,u_sourceColor:d,u_targetColor:f,u_textSize:[1024,this.iconService.canvasHeight||128],segmentNumber:l,u_lineDir:o?1:-1,u_icon_step:s,u_line_texture:a?1:0,u_textureBlend:"normal"===n?0:1,u_blur:.9,u_line_type:Lc[r||"solid"],u_time:this.layer.getLayerAnimateTime()||0,u_linearColor:h};return this.getUniformsBufferInfo(g)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.updateTexture(),e.iconService.on("imageUpdate",e.updateTexture),e.buildModels()}))()}clearModels(){var e;null===(e=this.texture)||void 0===e||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}getShaders(){return{frag:'\n#define Animate 0.0\n#define LineTexture 1.0\nuniform sampler2D u_texture;\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float segmentNumber;\n float u_lineDir: 1.0;\n float u_icon_step: 100;\n float u_line_texture: 0.0;\n float u_textureBlend;\n float u_blur : 0.9;\n float u_line_type: 0.0;\n float u_time;\n float u_linearColor: 0.0;\n};\n\nin vec4 v_color;\nin vec2 v_iconMapUV;\nin vec4 v_lineData;\n//dash\nin vec4 v_dash_array;\nin float v_distance_ratio;\n\nout vec4 outputColor;\n#pragma include "picking"\n\nvoid main() {\n if(u_dash_array!=vec4(0.0)){\n float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n 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))) {\n discard;\n };\n }\n float animateSpeed = 0.0; // 运动速度\n outputColor = v_color;\n if(u_animate.x == Animate && u_line_texture != LineTexture) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- v_lineData.b, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n // alpha = smoothstep(0., 1., alpha);\n alpha = clamp(alpha, 0.0, 1.0);\n outputColor.a *= alpha;\n }\n\n // 当存在贴图时在底色上贴上贴图\n if(u_line_texture == LineTexture) { // while load texture\n float arcRadio = smoothstep( 0.0, 1.0, (v_lineData.r / segmentNumber));\n // float arcRadio = smoothstep( 0.0, 1.0, d_distance_ratio);\n\n float count = v_lineData.g; // 贴图在弧线上重复的数量\n\n float time = 0.0;\n if(u_animate.x == Animate) {\n time = u_time / u_animate.y;\n }\n float redioCount = arcRadio * count;\n\n float u = fract(redioCount - time);\n float v = v_lineData.a; // 横向 v\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n\n vec4 pattern = texture(SAMPLER_2D(u_texture), uv);\n\n if(u_animate.x == Animate) {\n float currentPlane = floor(redioCount - time);\n float textureStep = floor(count * u_animate.z);\n float a = mod(currentPlane, textureStep);\n if(a < textureStep - 1.0) {\n pattern = vec4(0.0);\n }\n }\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n outputColor = filterColor(outputColor + pattern);\n } else { // replace\n pattern.a *= v_color.a;\n if(outputColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n outputColor = filterColor(pattern);\n }\n \n } else {\n outputColor = filterColor(outputColor);\n }\n}',vert:'#define Animate (0.0)\n#define LineTexture (1.0)\n\nlayout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_INSTANCE) in vec4 a_Instance;\nlayout(location = ATTRIBUTE_LOCATION_INSTANCE_64LOW) in vec4 a_Instance64Low;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_iconMapUV;\n\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float segmentNumber;\n float u_lineDir: 1.0;\n float u_icon_step: 100;\n float u_line_texture: 0.0;\n float u_textureBlend;\n float u_blur : 0.9;\n float u_line_type: 0.0;\n float u_time;\n float u_linearColor: 0.0;\n};\n\nout vec4 v_color;\nout vec2 v_iconMapUV;\nout vec4 v_lineData;\n//dash\nout vec4 v_dash_array;\nout float v_distance_ratio;\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\n\nfloat bezier3(vec3 arr, float t) {\n float ut = 1.0 - t;\n return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;\n}\nvec2 midPoint(vec2 source, vec2 target, float arcThetaOffset) {\n vec2 center = target - source;\n float r = length(center);\n float theta = atan(center.y, center.x);\n float thetaOffset = arcThetaOffset;\n float r2 = r / 2.0 / cos(thetaOffset);\n float theta2 = theta + thetaOffset;\n vec2 mid = vec2(r2 * cos(theta2) + source.x, r2 * sin(theta2) + source.y);\n if (u_lineDir == 1.0) {\n // 正向\n return mid;\n } else {\n // 逆向\n // (mid + vmin)/2 = (s + t)/2\n vec2 vmid = source + target - mid;\n return vmid;\n }\n // return mid;\n}\nfloat getSegmentRatio(float index) {\n // dash: index / (segmentNumber - 1.);\n // normal: smoothstep(0.0, 1.0, index / (segmentNumber - 1.));\n return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));\n // return index / (segmentNumber - 1.);\n}\nvec2 interpolate(vec2 source, vec2 target, float t, float arcThetaOffset) {\n // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation\n vec2 mid = midPoint(source, target, arcThetaOffset);\n vec3 x = vec3(source.x, mid.x, target.x);\n vec3 y = vec3(source.y, mid.y, target.y);\n return vec2(bezier3(x, t), bezier3(y, t));\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return dir_screenspace.xy * sign(offset_direction);\n}\n\nvoid main() {\n //vs中计算渐变色\n if (u_linearColor == 1.0) {\n float d_segmentIndex = a_Position.x + 1.0; // 当前顶点在弧线中所处的分段位置\n v_color = mix(u_sourceColor, u_targetColor, d_segmentIndex / segmentNumber);\n } else {\n v_color = a_Color;\n }\n v_color.a = v_color.a * opacity;\n\n vec2 source_world = a_Instance.rg; // 起始点\n vec2 target_world = a_Instance.ba; // 终点\n\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n\n // 计算 dashArray 和 distanceRatio 输出到片元\n float total_Distance = pixelDistance(source_world, target_world) / 2.0 * PI;\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;\n v_distance_ratio = segmentIndex / segmentNumber;\n\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n float d_distance_ratio;\n\n if(u_animate.x == Animate) {\n d_distance_ratio = segmentIndex / segmentNumber;\n if(u_lineDir != 1.0) {\n d_distance_ratio = 1.0 - d_distance_ratio;\n }\n }\n\n v_lineData.b = d_distance_ratio;\n\n vec4 source = project_position(vec4(source_world, 0, 1.), a_Instance64Low.xy);\n vec4 target = project_position(vec4(target_world, 0, 1.), a_Instance64Low.zw);\n\n vec2 currPos = interpolate(source.xy, target.xy, segmentRatio, thetaOffset);\n vec2 nextPos = interpolate(source.xy, target.xy, nextSegmentRatio, thetaOffset);\n\n vec2 offset = project_pixel(\n getExtrusionOffset((nextPos.xy - currPos.xy) * indexDir, a_Position.y)\n );\n\n float d_segmentIndex = a_Position.x + 1.0; // 当前顶点在弧线中所处的分段位置\n v_lineData.r = d_segmentIndex;\n\n if(LineTexture == u_line_texture) { // 开启贴图模式\n float arcDistrance = length(source - target); // 起始点和终点的距离\n arcDistrance = project_pixel(arcDistrance);\n\n v_iconMapUV = a_iconMapUV;\n\n float pixelLen = project_pixel_texture(u_icon_step); // 贴图沿弧线方向的长度 - 随地图缩放改变\n float texCount = floor(arcDistrance / pixelLen); // 贴图在弧线上重复的数量\n v_lineData.g = texCount;\n\n float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // 线横向偏移的距离\n float linePixelSize = project_pixel(a_Size); // 定点位置偏移\n v_lineData.a = lineOffsetWidth / linePixelSize; // 线图层贴图部分的 v 坐标值\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(currPos.xy + offset, 0, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n',type:""}}buildModels(){var e=this;return(0,Hr.A)((function*(){e.initUniformsBuffer();const{segmentNumber:t=30}=e.layer.getLayerConfig(),{frag:n,vert:r,type:i}=e.getShaders();return[yield e.layer.buildLayerModel({moduleName:"lineArc2d"+i,vertexShader:r,fragmentShader:n,defines:e.getDefines(),inject:e.getInject(),triangulation:xc,depth:{enable:!1},styleOption:{segmentNumber:t}})]}))()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{size:t=1}=e;return Array.isArray(t)?[t[0]]:[t]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:Ot.jQ.Attribute,descriptor:{name:"a_Instance",shaderLocation:this.attributeLocation.INSTANCE,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:4,update:(e,t,n)=>[n[3],n[4],n[5],n[6]]}}),this.styleAttributeService.registerStyleAttribute({name:"instance64Low",type:Ot.jQ.Attribute,descriptor:{name:"a_Instance64Low",shaderLocation:this.attributeLocation.INSTANCE_64LOW,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:4,update:(e,t,n)=>[(0,y.qk)(n[3]),(0,y.qk)(n[4]),(0,y.qk)(n[5]),(0,y.qk)(n[6])]}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Ot.jQ.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:this.attributeLocation.UV,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:e=>{const t=this.iconService.getIconMap(),{texture:n}=e,{x:r,y:i}=t[n]||{x:0,y:0};return[r,i]}}}),this.styleAttributeService.registerStyleAttribute({name:"thetaOffset",type:Ot.jQ.Attribute,descriptor:{name:"a_ThetaOffset",shaderLocation:this.attributeLocation.THETA_OFFSET,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{thetaOffset:t=1}=e;return[t]}}})}},arc3d:Mc,greatcircle:class extends kl{constructor(...e){super(...e),(0,kr.A)(this,"texture",void 0),(0,kr.A)(this,"updateTexture",(()=>{const{createTexture2D:e}=this.rendererService;if(this.texture)return this.texture.update({data:this.iconService.getCanvas()}),void this.layer.render();this.texture=e({data:this.iconService.getCanvas(),mag:Ot.gl.NEAREST,min:Ot.gl.NEAREST,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128}),this.textures=[this.texture]}))}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,INSTANCE:10,INSTANCE_64LOW:11,UV:12})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:t,textureBlend:n="normal",lineType:r="solid",dashArray:i=[10,5],lineTexture:o=!1,iconStep:a=100,segmentNumber:s=30}=this.layer.getLayerConfig(),{animateOption:l}=this.layer.getLayerConfig();var c;2===i.length&&i.push(0,0),this.rendererService.getDirty()&&(null===(c=this.texture)||void 0===c||c.bind());let u=0,h=[0,0,0,0],d=[0,0,0,0];e&&t&&(h=(0,y.HR)(e),d=(0,y.HR)(t),u=1);let f=this.layer.getLayerAnimateTime();isNaN(f)&&(f=0);const p={u_animate:this.animateOption2Array(l),u_dash_array:i,u_sourceColor:h,u_targetColor:d,u_textSize:[1024,this.iconService.canvasHeight||128],segmentNumber:s,u_line_type:Bc[r]||0,u_icon_step:a,u_line_texture:o?1:0,u_textureBlend:"normal"===n?0:1,u_time:f,u_linearColor:u};return this.getUniformsBufferInfo(p)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.initUniformsBuffer(),e.updateTexture(),e.iconService.on("imageUpdate",e.updateTexture),e.buildModels()}))()}clearModels(){var e;null===(e=this.texture)||void 0===e||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}buildModels(){var e=this;return(0,Hr.A)((function*(){const{segmentNumber:t=30}=e.layer.getLayerConfig();return[yield e.layer.buildLayerModel({moduleName:"lineGreatCircle",vertexShader:'#define LineTypeSolid (0.0)\n#define LineTypeDash (1.0)\n#define Animate (0.0)\n#define LineTexture (1.0)\n\nlayout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_INSTANCE) in vec4 a_Instance;\nlayout(location = ATTRIBUTE_LOCATION_INSTANCE_64LOW) in vec4 a_Instance64Low;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_iconMapUV;\n\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array: [10.0, 5., 0, 0];\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float segmentNumber;\n float u_line_type: 0.0;\n float u_icon_step: 100;\n float u_line_texture: 0.0;\n float u_textureBlend;\n float u_time;\n float u_linearColor: 0;\n};\n\nout vec4 v_dash_array;\nout vec4 v_color;\nout vec2 v_iconMapUV;\nout vec4 v_line_data;\nout float v_distance_ratio;\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\n\nfloat maps(float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return index / (segmentNumber - 1.0);\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(mix(source, target, segmentRatio), sqrt(max(0.0, vertex_height)));\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return dir_screenspace.xy * sign(offset_direction);\n}\nfloat getAngularDist(vec2 source, vec2 target) {\n vec2 delta = source - target;\n vec2 sin_half_delta = sin(delta / 2.0);\n float a =\n sin_half_delta.y * sin_half_delta.y +\n cos(source.y) * cos(target.y) * sin_half_delta.x * sin_half_delta.x;\n return 2.0 * atan(sqrt(a), sqrt(1.0 - a));\n}\n\nvec2 midPoint(vec2 source, vec2 target) {\n vec2 center = target - source;\n float r = length(center);\n float theta = atan(center.y, center.x);\n float thetaOffset = 0.314;\n float r2 = r / 2.0 / cos(thetaOffset);\n float theta2 = theta + thetaOffset;\n vec2 mid = vec2(r2 * cos(theta2) + source.x, r2 * sin(theta2) + source.y);\n return mid;\n}\nfloat bezier3(vec3 arr, float t) {\n float ut = 1.0 - t;\n return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;\n}\n\nvec2 interpolate(vec2 source, vec2 target, float angularDist, float t) {\n if (abs(angularDist - PI) < 0.001) {\n return (1.0 - t) * source + t * target;\n }\n float a = sin((1.0 - t) * angularDist) / sin(angularDist);\n float b = sin(t * angularDist) / sin(angularDist);\n vec2 sin_source = sin(source);\n vec2 cos_source = cos(source);\n vec2 sin_target = sin(target);\n vec2 cos_target = cos(target);\n float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;\n float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;\n float z = a * sin_source.y + b * sin_target.y;\n return vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));\n\n}\n\nvoid main() {\n v_color = a_Color;\n v_color.a = v_color.a * opacity;\n vec2 source = radians(a_Instance.rg);\n vec2 target = radians(a_Instance.ba);\n float angularDist = getAngularDist(source, target);\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n\n if (u_line_type == LineTypeDash) {\n v_distance_ratio = segmentIndex / segmentNumber;\n float total_Distance = pixelDistance(source, target) / 2.0 * PI;\n total_Distance = total_Distance * 16.0; // total_Distance*16.0 调整默认的效果\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;\n }\n\n if (u_animate.x == Animate) {\n v_distance_ratio = segmentIndex / segmentNumber;\n }\n\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n v_distance_ratio = segmentIndex / segmentNumber;\n\n vec4 curr = project_position(vec4(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0, 1.0), a_Instance64Low.xy);\n vec4 next = project_position(vec4(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0, 1.0), a_Instance64Low.zw);\n\n // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\n vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));\n // vec4 project_pos = project_position(vec4(curr.xy, 0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));\n\n v_line_data.g = a_Position.x; // 该顶点在弧线上的分段排序\n if (LineTexture == u_line_texture) {\n float d_arcDistrance = length(source - target);\n d_arcDistrance = project_pixel(d_arcDistrance);\n\n float d_pixelLen = project_pixel(u_icon_step) / 8.0;\n v_line_data.b = floor(d_arcDistrance / d_pixelLen); // 贴图在弧线上重复的数量\n\n float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // 线横向偏移的距离\n float linePixelSize = project_pixel(a_Size); // 定点位置偏移,按地图等级缩放后的距离\n v_line_data.a = lineOffsetWidth / linePixelSize; // 线图层贴图部分的 v 坐标值\n\n v_iconMapUV = a_iconMapUV;\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, 0, 1.0));\n setPickingColor(a_PickingColor);\n}\n\n',fragmentShader:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform sampler2D u_texture;\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array: [10.0, 5., 0, 0];\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float segmentNumber;\n float u_line_type: 0.0;\n float u_icon_step: 100;\n float u_line_texture: 0.0;\n float u_textureBlend;\n float u_time;\n float u_linearColor: 0;\n};\n\nin vec4 v_dash_array;\nin vec4 v_color;\nin vec2 v_iconMapUV;\nin vec4 v_line_data;\nin float v_distance_ratio;\n\nout vec4 outputColor;\n#pragma include "picking"\n#pragma include "project"\n#pragma include "projection"\n\nvoid main() {\n\n float animateSpeed = 0.0;\n float d_segmentIndex = v_line_data.g;\n\n // 设置弧线的底色\n if(u_linearColor == 1.0) { // 使用渐变颜色\n outputColor = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);\n outputColor.a *= v_color.a;\n } else { // 使用 color 方法传入的颜色\n outputColor = v_color;\n }\n\n // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy));\n // float blur = smoothstep(1.0, u_blur, length(v_normal.xy));\n if(u_line_type == LineTypeDash) {\n float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n 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)) {\n // 实线部分\n } else {\n // 虚线部分\n discard;\n };\n }\n\n // 设置弧线的动画模式\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n alpha = smoothstep(0., 1., alpha);\n outputColor.a *= alpha;\n }\n\n // 设置弧线的贴图\n if(LineTexture == u_line_texture && u_line_type != LineTypeDash) {\n float arcRadio = smoothstep( 0.0, 1.0, (d_segmentIndex / (segmentNumber - 1.0)));\n // float arcRadio = d_segmentIndex / (segmentNumber - 1.0);\n float count = v_line_data.b; // 贴图在弧线上重复的数量\n float u = fract(arcRadio * count - animateSpeed * count);\n // float u = fract(arcRadio * count - animateSpeed);\n if(u_animate.x == Animate) {\n u = outputColor.a/v_color.a;\n }\n\n float v = v_line_data.a; // 线图层贴图部分的 v 坐标值\n\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture(SAMPLER_2D(u_texture), uv);\n\n // 设置贴图和底色的叠加模式\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n outputColor = filterColor(outputColor + pattern);\n } else { // replace\n pattern.a *= v_color.a;\n if(outputColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n outputColor = filterColor(pattern);\n }\n } else {\n outputColor = filterColor(outputColor);\n }\n\n // gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:xc,styleOption:{segmentNumber:t},defines:e.getDefines(),inject:e.getInject(),depth:{enable:!1}})]}))()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{size:t=1}=e;return Array.isArray(t)?[t[0]]:[t]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:Ot.jQ.Attribute,descriptor:{name:"a_Instance",shaderLocation:this.attributeLocation.INSTANCE,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:4,update:(e,t,n)=>[n[3],n[4],n[5],n[6]]}}),this.styleAttributeService.registerStyleAttribute({name:"instance64Low",type:Ot.jQ.Attribute,descriptor:{name:"a_Instance64Low",shaderLocation:this.attributeLocation.INSTANCE_64LOW,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:4,update:(e,t,n)=>[(0,y.qk)(n[3]),(0,y.qk)(n[4]),(0,y.qk)(n[5]),(0,y.qk)(n[6])]}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Ot.jQ.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:this.attributeLocation.UV,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:e=>{const t=this.iconService.getIconMap(),{texture:n}=e,{x:r,y:i}=t[n]||{x:0,y:0};return[r,i]}}})}},wall:class extends kl{constructor(...e){super(...e),(0,kr.A)(this,"texture",void 0),(0,kr.A)(this,"updateTexture",(()=>{const{createTexture2D:e}=this.rendererService;if(this.texture)return this.texture.update({data:this.iconService.getCanvas()}),void this.layer.render();this.texture=e({data:this.iconService.getCanvas(),mag:Ot.gl.NEAREST,min:Ot.gl.NEAREST,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128}),this.textures=[this.texture]}))}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,NORMAL:12,UV:13,DISTANCE_MITER_TOTAL:15})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:t,textureBlend:n="normal",heightfixed:r=!1,lineTexture:i=!1,iconStep:o=100,iconStepCount:a=1}=this.layer.getLayerConfig(),{animateOption:s}=this.layer.getLayerConfig();var l;this.rendererService.getDirty()&&(null===(l=this.texture)||void 0===l||l.bind());let c=0,u=[0,0,0,0],h=[0,0,0,0];e&&t&&(u=(0,y.HR)(e),h=(0,y.HR)(t),c=1);const d={u_animate:this.animateOption2Array(s),u_sourceColor:u,u_targetColor:h,u_textSize:[1024,this.iconService.canvasHeight||128],u_icon_step:o,u_heightfixed:Number(r),u_linearColor:c,u_line_texture:i?1:0,u_textureBlend:"normal"===n?0:1,u_iconStepCount:a,u_time:this.layer.getLayerAnimateTime()||0};return this.getUniformsBufferInfo(d)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.initUniformsBuffer(),e.updateTexture(),e.iconService.on("imageUpdate",e.updateTexture),e.buildModels()}))()}clearModels(){var e;null===(e=this.texture)||void 0===e||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}buildModels(){var e=this;return(0,Hr.A)((function*(){return[yield e.layer.buildLayerModel({moduleName:"lineWall",vertexShader:'#define Animate 0.0\nlayout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in vec2 a_Size;\nlayout(location = ATTRIBUTE_LOCATION_NORMAL) in vec3 a_Normal;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_iconMapUV;\nlayout(location = ATTRIBUTE_LOCATION_DISTANCE_MITER_TOTAL) in vec3 a_Distance_Total_Miter;\n\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed;\n float u_linearColor: 0;\n float u_line_texture;\n float u_textureBlend;\n float u_iconStepCount;\n float u_time;\n};\n\n// texV 线图层 - 贴图部分的 v 坐标(线的宽度方向)\nout vec2 v_iconMapUV;\nout vec4 v_color;\nout float v_blur;\nout vec4 v_dataset;\n\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\n\nvoid main() {\n float a_Distance = a_Distance_Total_Miter.x;\n float a_Miter = a_Distance_Total_Miter.y;\n float a_Total_Distance = a_Distance_Total_Miter.z;\n\n float d_distance_ratio; // 当前点位距离占线总长的比例\n float d_texPixelLen; // 贴图的像素长度,根据地图层级缩放\n\n v_iconMapUV = a_iconMapUV;\n if (u_heightfixed < 1.0) {\n // 高度随 zoom 调整\n d_texPixelLen = project_pixel(u_icon_step);\n } else {\n d_texPixelLen = u_icon_step;\n }\n\n if (u_animate.x == Animate || u_linearColor == 1.0) {\n d_distance_ratio = a_Distance / a_Total_Distance;\n }\n\n float miter = (a_Miter + 1.0) / 2.0;\n // 设置数据集的参数\n v_dataset[0] = d_distance_ratio; // 当前点位距离占线总长的比例\n v_dataset[1] = a_Distance; // 当前顶点的距离\n v_dataset[2] = d_texPixelLen; // 贴图的像素长度,根据地图层级缩放\n v_dataset[3] = miter; // 线图层贴图部分的 v 坐标值 0 - 1\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0), a_Position64Low);\n\n float originSize = a_Size.x; // 固定高度\n if (u_heightfixed < 1.0) {\n originSize = project_float_meter(a_Size.x); // 高度随 zoom 调整\n }\n\n float wallHeight = originSize * miter;\n float lightWeight = calc_lighting(vec4(project_pos.xy, wallHeight, 1.0));\n\n v_blur = min(project_float_pixel(2.0) / originSize, 0.05);\n v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);\n\n // 兼容 mapbox 在线高度上的效果表现基本一致\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n // mapbox\n // 保持高度相对不变\n float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom);\n if (u_heightfixed > 0.0) {\n wallHeight *= mapboxZoomScale;\n }\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, wallHeight, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'#define Animate 0.0\n#define LineTexture 1.0\n\n// line texture\n\nuniform sampler2D u_texture;\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed;\n float u_linearColor: 0;\n float u_line_texture;\n float u_textureBlend;\n float u_iconStepCount;\n float u_time;\n};\n\n\nin vec2 v_iconMapUV;\nin vec4 v_color;\nin float v_blur;\nin vec4 v_dataset;\n\nout vec4 outputColor;\n\n#pragma include "picking"\n\nvoid main() {\n float animateSpeed = 0.0; // 运动速度\n float d_distance_ratio = v_dataset.r; // 当前点位距离占线总长的比例\n float v = v_dataset.a;\n\n if(u_linearColor == 1.0) { // 使用渐变颜色\n outputColor = mix(u_sourceColor, u_targetColor, v);\n } else { // 使用 color 方法传入的颜色\n outputColor = v_color;\n }\n\n outputColor.a *= v_color.a; // 全局透明度\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n alpha = smoothstep(0., 1., alpha);\n outputColor.a *= alpha;\n }\n\n if(u_line_texture == LineTexture) { // while load texture\n float aDistance = v_dataset.g; // 当前顶点的距离\n float d_texPixelLen = v_dataset.b; // 贴图的像素长度,根据地图层级缩放\n float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);\n float v = v_dataset.a; // 线图层贴图部分的 v 坐标值\n\n // 计算纹理间隔 start\n float flag = 0.0;\n if(u > 1.0/u_iconStepCount) {\n flag = 1.0;\n }\n u = fract(u*u_iconStepCount);\n // 计算纹理间隔 end\n\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture(SAMPLER_2D(u_texture), uv);\n\n // Tip: 判断纹理间隔\n if(flag > 0.0) {\n pattern = vec4(0.0);\n }\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n outputColor = filterColor(outputColor + pattern);\n } else { // replace\n pattern.a *= v_color.a;\n if(outputColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n outputColor = filterColor(pattern);\n }\n }\n\n\n // blur - AA\n if(v < v_blur) {\n outputColor.a = mix(0.0, outputColor.a, v/v_blur);\n } else if(v > 1.0 - v_blur) {\n outputColor.a = mix(outputColor.a, 0.0, (v - (1.0 - v_blur))/v_blur);\n }\n\n outputColor = filterColor(outputColor);\n}\n',triangulation:gc,defines:e.getDefines(),inject:e.getInject(),depth:{enable:!1},blend:e.getBlend()})]}))()}registerBuiltinAttributes(){this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:e=>{const{size:t=1}=e;return Array.isArray(t)?[t[0],t[1]]:[t,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Ot.jQ.Attribute,descriptor:{name:"a_Normal",shaderLocation:this.attributeLocation.NORMAL,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:(e,t,n,r,i)=>i}}),this.styleAttributeService.registerStyleAttribute({name:"distanceAndTotalAndMiter",type:Ot.jQ.Attribute,descriptor:{name:"a_Distance_Total_Miter",shaderLocation:this.attributeLocation.DISTANCE_MITER_TOTAL,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:(e,t,n)=>[n[3],n[4],n[5]]}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Ot.jQ.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:this.attributeLocation.UV,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:e=>{const t=this.iconService.getIconMap(),{texture:n}=e,{x:r,y:i}=t[n]||{x:0,y:0};return[r,i]}}})}},line:Gc,simple:class extends kl{get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:t,lineType:n="solid",dashArray:r=[10,5,0,0],vertexHeightScale:i=20}=this.layer.getLayerConfig();let o=r;"dash"!==n&&(o=[0,0,0,0]),2===o.length&&o.push(0,0);let a=0,s=[0,0,0,0],l=[0,0,0,0];e&&t&&(s=(0,y.HR)(e),l=(0,y.HR)(t),a=1);const c={u_sourceColor:s,u_targetColor:l,u_dash_array:o,u_vertexScale:i,u_linearColor:a};return this.getUniformsBufferInfo(c)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.buildModels()}))()}getShaders(){return{frag:"\nlayout(std140) uniform commonUniorm {\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec4 u_dash_array;\n float u_vertexScale: 1.0;\n float u_linearColor: 0;\n};\nin float v_distanceScale;\nin vec4 v_color;\n//dash\nin vec4 v_dash_array;\n\nout vec4 outputColor;\nvoid main() {\n if(u_dash_array!=vec4(0.0)){\n float dashLength = mod(v_distanceScale, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n 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))) {\n // 虚线部分\n discard;\n };\n }\n if(u_linearColor==1.0){\n outputColor = mix(u_sourceColor, u_targetColor, v_distanceScale);\n outputColor.a *= v_color.a; // 全局透明度\n }\n else{\n outputColor = v_color;\n }\n}\n",vert:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in vec4 a_SizeDistanceAndTotalDistance;\n\nlayout(std140) uniform commonUniorm {\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec4 u_dash_array;\n float u_vertexScale: 1.0;\n float u_linearColor: 0;\n};\n\n#pragma include "projection"\n#pragma include "picking"\n\nout vec4 v_color;\nout float v_distanceScale;\nout vec4 v_dash_array;\n\nvoid main() {\n //dash输出\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_SizeDistanceAndTotalDistance.a;\n\n v_color = a_Color;\n v_distanceScale = a_SizeDistanceAndTotalDistance.b / a_SizeDistanceAndTotalDistance.a;\n v_color.a = v_color.a * opacity;\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0), a_Position64Low);\n\n float h = float(a_Position.z) * u_vertexScale; // 线顶点的高度 - 兼容不存在第三个数值的情况\n\n float lineHeight = a_SizeDistanceAndTotalDistance.y;\n // 兼容 mapbox 在线高度上的效果表现基本一致\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n // 保持高度相对不变\n h *= 2.0 / pow(2.0, 20.0 - u_Zoom);\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, lineHeight + h, 1.0));\n gl_PointSize = 10.0;\n\n}\n',type:"lineSimpleNormal"}}buildModels(){var e=this;return(0,Hr.A)((function*(){e.initUniformsBuffer();const{frag:t,vert:n,type:r}=e.getShaders();return[yield e.layer.buildLayerModel({moduleName:r,vertexShader:n,fragmentShader:t,triangulation:mc,defines:e.getDefines(),inject:e.getInject(),primitive:Ot.gl.LINES,depth:{enable:!1},pick:!1})]}))()}registerBuiltinAttributes(){this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"sizeDistanceAndTotalDistance",type:Ot.jQ.Attribute,descriptor:{name:"a_SizeDistanceAndTotalDistance",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:4,update:(e,t,n)=>{const{size:r=1}=e,i=Array.isArray(r)?[r[0],r[1]]:[r,0];return[i[0],i[1],n[3],n[5]]}}})}},flowline:class extends kl{get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,INSTANCE:10,INSTANCE_64LOW:11,NORMAL:12})}getCommonUniformsInfo(){const{gapWidth:e=2,strokeWidth:t=1,strokeOpacity:n=1}=this.layer.getLayerConfig(),r={u_gap_width:e,u_stroke_width:t,u_stroke_opacity:n};return this.getUniformsBufferInfo(r)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.initUniformsBuffer(),e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){return[yield e.layer.buildLayerModel({moduleName:"flow_line",vertexShader:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in vec2 a_Size;\nlayout(location = ATTRIBUTE_LOCATION_INSTANCE) in vec4 a_Instance;\nlayout(location = ATTRIBUTE_LOCATION_INSTANCE_64LOW) in vec4 a_Instance64Low;\nlayout(location = ATTRIBUTE_LOCATION_NORMAL) in vec3 a_Normal;\n\nlayout(std140) uniform commonUniorm {\n float u_gap_width: 1.0;\n float u_stroke_width: 1.0;\n float u_stroke_opacity: 1.0;\n};\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\n\nout vec4 v_color;\n\nvec2 project_pixel_offset(vec2 offsets) {\n vec2 data = project_pixel(offsets);\n\n return vec2(data.x, -data.y);\n}\n\nvec2 line_dir(vec2 target, vec2 source) {\n return normalize(ProjectFlat(target) - ProjectFlat(source));\n}\n\n\nvoid main() {\n // 透明度计算\n vec2 source_world = a_Instance.rg; // 起点\n vec2 target_world = a_Instance.ba; // 终点\n vec2 flowlineDir = line_dir(target_world, source_world);\n vec2 perpendicularDir = vec2(-flowlineDir.y, flowlineDir.x);\n\n vec2 position = mix(source_world, target_world, a_Position.x);\n vec2 position64Low = mix(a_Instance64Low.rg, a_Instance64Low.ba, a_Position.x);\n\n float lengthCommon = length(\n project_position(vec4(target_world, 0, 1)) - project_position(vec4(source_world, 0, 1))\n );\n vec2 offsetDistances = a_Size.x * project_pixel_offset(vec2(a_Position.y, a_Position.z)); // Mapbox || 高德\n vec2 limitedOffsetDistances = clamp(\n offsetDistances,\n project_pixel(-lengthCommon * 0.2),\n project_pixel(lengthCommon * 0.2)\n );\n\n float startOffsetCommon = project_pixel(offsets[0]);\n float endOffsetCommon = project_pixel(offsets[1]);\n float endpointOffset = mix(\n clamp(startOffsetCommon, 0.0, lengthCommon * 0.2),\n -clamp(endOffsetCommon, 0.0, lengthCommon * 0.2),\n a_Position.x\n );\n\n vec2 normalsCommon = u_stroke_width * project_pixel_offset(vec2(a_Normal.x, a_Normal.y));\n\n float gapCommon = -1. * project_pixel(u_gap_width);\n vec3 offsetCommon = vec3(\n flowlineDir * (limitedOffsetDistances[1] + normalsCommon.y + endpointOffset * 1.05) -\n perpendicularDir * (limitedOffsetDistances[0] + gapCommon + normalsCommon.x),\n 0.0\n );\n\n vec4 project_pos = project_position(vec4(position.xy, 0, 1.0), position64Low);\n\n vec4 fillColor = vec4(a_Color.rgb, a_Color.a * opacity);\n v_color = mix(fillColor, vec4(u_stroke.xyz, u_stroke.w * fillColor.w * u_stroke_opacity), a_Normal.z);\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offsetCommon.xy, 0., 1.0));\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'// #extension GL_OES_standard_derivatives : enable\n\nin vec4 v_color;\nout vec4 outputColor;\n\n\n// line texture\n\n#pragma include "picking"\n\nvoid main() {\n outputColor = v_color;\n outputColor = filterColor(outputColor);\n}\n',defines:e.getDefines(),inject:e.getInject(),triangulation:Nc,styleOption:e.layer.getLayerConfig().symbol,primitive:Ot.gl.TRIANGLES,depth:{enable:!1},pick:!1})]}))()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:e=>{const{size:t=1}=e;return Array.isArray(t)?[t[0],t[1]]:[t,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:Ot.jQ.Attribute,descriptor:{name:"a_Instance",shaderLocation:this.attributeLocation.INSTANCE,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:4,update:(e,t,n)=>[n[3],n[4],n[5],n[6]]}}),this.styleAttributeService.registerStyleAttribute({name:"instance64Low",type:Ot.jQ.Attribute,descriptor:{name:"a_Instance64Low",shaderLocation:this.attributeLocation.INSTANCE_64LOW,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:4,update:(e,t,n)=>[(0,y.qk)(n[3]),(0,y.qk)(n[4]),(0,y.qk)(n[5]),(0,y.qk)(n[6])]}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Ot.jQ.Attribute,descriptor:{name:"a_Normal",shaderLocation:this.attributeLocation.NORMAL,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:(e,t,n,r,i)=>i}})}},earthArc3d:Mc};class jc extends Ml{constructor(...e){super(...e),(0,kr.A)(this,"type","LineLayer"),(0,kr.A)(this,"enableShaderEncodeStyles",["stroke","offsets","opacity","thetaOffset"]),(0,kr.A)(this,"arrowInsertCount",0),(0,kr.A)(this,"defaultSourceConfig",{data:[{lng1:100,lat1:30,lng2:130,lat2:30}],options:{parser:{type:"json",x:"lng1",y:"lat1",x1:"lng2",y1:"lat2"}}})}buildModels(){var e=this;return(0,Hr.A)((function*(){const t=e.getModelType();e.layerModel=new zc[t](e),yield e.initLayerModels()}))()}getDefaultConfig(){return{line:{},linearline:{},simple:{},wall:{},arc3d:{blend:"additive"},arc:{blend:"additive"},greatcircle:{blend:"additive"},tileLine:{},earthArc3d:{},flowline:{},arrow:{}}[this.getModelType()]}getModelType(){var e;if(this.layerType)return this.layerType;const t=this.styleAttributeService.getLayerStyleAttribute("shape");return(null==t||null===(e=t.scale)||void 0===e?void 0:e.field)||"line"}processData(e){if("simple"!==this.getModelType())return e;const t=[];return e.map((e=>{if(Array.isArray(e.coordinates)&&Array.isArray(e.coordinates[0])&&Array.isArray(e.coordinates[0][0])){const n=(0,Ur.A)({},e);e.coordinates.map((e=>{t.push((0,Ur.A)((0,Ur.A)({},n),{},{coordinates:e}))}))}else t.push(e)})),t}}class Vc extends kl{constructor(...e){super(...e),(0,kr.A)(this,"raiseCount",0),(0,kr.A)(this,"raiseRepeat",0)}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,EXTRUDE:10,NORMAL:11})}getCommonUniformsInfo(){const{animateOption:e={enable:!1,speed:.01,repeat:!1},sourceColor:t,targetColor:n,pickLight:r=!1,heightfixed:i=!1,opacityLinear:o={enable:!1,dir:"up"},lightEnable:a=!0}=this.layer.getLayerConfig();let s=0,l=[0,0,0,0],c=[0,0,0,0];if(t&&n&&(l=(0,y.HR)(t),c=(0,y.HR)(n),s=1),this.raiseCount<1&&this.raiseRepeat>0&&e.enable){const{speed:t=.01}=e;this.raiseCount+=t,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}const u={u_pickLight:Number(r),u_heightfixed:Number(i),u_r:e.enable&&this.raiseRepeat>0?this.raiseCount:1,u_linearColor:s,u_sourceColor:l,u_targetColor:c,u_opacitylinear:Number(o.enable),u_opacitylinear_dir:"up"===o.dir?1:0,u_lightEnable:Number(a)};return this.getUniformsBufferInfo(u)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){const{depth:t=!0,animateOption:{repeat:n=1}}=e.layer.getLayerConfig();return e.raiseRepeat=n,e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointExtrude",vertexShader:'#define pi (3.1415926535)\n\nlayout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in vec3 a_Size;\nlayout(location = ATTRIBUTE_LOCATION_EXTRUDE) in vec4 a_Extrude;\nlayout(location = ATTRIBUTE_LOCATION_NORMAL) in vec3 a_Normal;\n\nlayout(std140) uniform commonUniforms {\n float u_pickLight;\n float u_heightfixed;\n float u_r;\n float u_linearColor;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_opacitylinear;\n float u_opacitylinear_dir;\n float u_lightEnable;\n};\nout vec4 v_color;\nout float v_lightWeight;\n\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\n\nfloat getYRadian(float x, float z) {\n if (x > 0.0 && z > 0.0) {\n return atan(x / z);\n } else if (x > 0.0 && z <= 0.0) {\n return atan(-z / x) + pi / 2.0;\n } else if (x <= 0.0 && z <= 0.0) {\n return pi + atan(x / z); //atan(x/z) +\n } else {\n return atan(z / -x) + pi * 3.0 / 2.0;\n }\n}\n\nfloat getXRadian(float y, float r) {\n return atan(y / r);\n}\n\nvoid main() {\n vec3 size = a_Size * a_Position;\n\n vec3 offset = size; // 控制圆柱体的大小 - 从标准单位圆柱体进行偏移\n\n if (u_heightfixed < 1.0) {\n // 圆柱体不固定高度\n } else {\n // 圆柱体固定高度 ( 处理 mapbox )\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n offset *= 4.0 / pow(2.0, 21.0 - u_Zoom);\n }\n }\n\n vec2 positions = a_Extrude.xy;\n vec2 positions64Low = a_Extrude.zw;\n vec4 project_pos = project_position(vec4(positions, 0.0, 1.0), positions64Low);\n\n // u_r 控制圆柱的生长\n vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);\n\n // // 圆柱光照效果\n float lightWeight = 1.0;\n\n if (u_lightEnable > 0.0) {\n // 取消三元表达式,增强健壮性\n lightWeight = calc_lighting(pos);\n }\n\n v_lightWeight = lightWeight;\n\n v_color = a_Color;\n\n // 设置圆柱的底色\n if (u_linearColor == 1.0) {\n // 使用渐变颜色\n v_color = mix(u_sourceColor, u_targetColor, a_Position.z);\n v_color.a = v_color.a * opacity;\n } else {\n v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);\n }\n\n if (u_opacitylinear > 0.0) {\n v_color.a *= u_opacitylinear_dir > 0.0 ? 1.0 - a_Position.z : a_Position.z;\n }\n\n gl_Position = project_common_position_to_clipspace(pos);\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'\nin vec4 v_color;\nin float v_lightWeight;\nout vec4 outputColor;\n\nlayout(std140) uniform commonUniforms {\n float u_pickLight;\n float u_heightfixed;\n float u_r;\n float u_linearColor;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_opacitylinear;\n float u_opacitylinear_dir;\n float u_lightEnable;\n};\n\n#pragma include "scene_uniforms"\n#pragma include "picking"\n\nvoid main() {\n\n outputColor = v_color;\n // 开启透明度渐变\n // picking\n if(u_pickLight > 0.0) {\n outputColor = filterColorAlpha(outputColor, v_lightWeight);\n } else {\n outputColor = filterColor(outputColor);\n }\n}\n',triangulation:fc,defines:e.getDefines(),inject:e.getInject(),cull:{enable:!0,face:Ot.gl.FRONT},depth:{enable:t}})]}))()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:e=>{const{size:t}=e;if(t){let e=[];return Array.isArray(t)&&(e=2===t.length?[t[0],t[0],t[1]]:t),Array.isArray(t)||(e=[t,t,t]),e}return[2,2,2]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Ot.jQ.Attribute,descriptor:{name:"a_Normal",shaderLocation:this.attributeLocation.NORMAL,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:(e,t,n,r,i)=>i}}),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Ot.jQ.Attribute,descriptor:{name:"a_Extrude",shaderLocation:this.attributeLocation.EXTRUDE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:4,update:e=>{const t=(0,y.fi)(e.coordinates);return[t[0],t[1],(0,y.qk)(t[0]),(0,y.qk)(t[1])]}}})}}class Hc extends kl{get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,SHAPE:10,EXTRUDE:11})}getCommonUniformsInfo(){const{strokeOpacity:e=1,strokeWidth:t=0,blend:n,blur:r=0,raisingHeight:i=0,heightfixed:o=!1,unit:a="pixel"}=this.layer.getLayerConfig();let s=this.getAnimateUniforms().u_time;isNaN(s)&&(s=-1);const l={u_blur_height_fixed:[r,Number(i),Number(o)],u_stroke_width:t,u_additive:"additive"===n?1:0,u_stroke_opacity:e,u_size_unit:kc[a],u_time:s,u_animate:this.getAnimateUniforms().u_animate};return this.getUniformsBufferInfo(l)}getAnimateUniforms(){const{animateOption:e={enable:!1}}=this.layer.getLayerConfig();return{u_animate:this.animateOption2Array(e),u_time:this.layer.getLayerAnimateTime()}}getAttribute(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),hc)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){const{frag:t,vert:n,type:r}=e.getShaders();return e.layer.triangulation=hc,e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:r,vertexShader:n,fragmentShader:t,defines:e.getDefines(),inject:e.getInject(),triangulation:hc,depth:{enable:!1}})]}))()}getShaders(){return{frag:"\nlayout(std140) uniform commonUniforms {\n vec3 u_blur_height_fixed;\n float u_stroke_width;\n float u_additive;\n float u_stroke_opacity;\n float u_size_unit;\n float u_time;\n vec4 u_animate;\n};\n\nin vec4 v_color;\nin vec4 v_stroke;\nin vec4 v_data;\nin float v_radius;\n\n#pragma include \"scene_uniforms\"\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nout vec4 outputColor;\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius + u_stroke_width);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n } else if (shape == 1) {\n outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n } else if (shape == 2) {\n outer_df = sdBox(v_data.xy, vec2(1.));\n inner_df = sdBox(v_data.xy, vec2(r));\n } else if (shape == 3) {\n outer_df = sdPentagon(v_data.xy, 0.8);\n inner_df = sdPentagon(v_data.xy, r * 0.8);\n } else if (shape == 4) {\n outer_df = sdHexagon(v_data.xy, 0.8);\n inner_df = sdHexagon(v_data.xy, r * 0.8);\n } else if (shape == 5) {\n outer_df = sdOctogon(v_data.xy, 1.0);\n inner_df = sdOctogon(v_data.xy, r);\n } else if (shape == 6) {\n outer_df = sdHexagram(v_data.xy, 0.52);\n inner_df = sdHexagram(v_data.xy, r * 0.52);\n } else if (shape == 7) {\n outer_df = sdRhombus(v_data.xy, vec2(1.0));\n inner_df = sdRhombus(v_data.xy, vec2(r));\n } else if (shape == 8) {\n outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n }\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n\n float PI = 3.14159;\n float N_RINGS = 3.0;\n float FREQ = 1.0;\n\n if(u_stroke_width < 0.01) {\n outputColor = v_color;\n } else {\n outputColor = mix(v_color, v_stroke * u_stroke_opacity, color_t);\n }\n float intensity = 1.0;\n if(u_time!=-1.0){\n //wave相关逻辑\n float d = length(v_data.xy);\n if(d > 0.5) {\n discard;\n }\n 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);\n }\n\n if(u_additive > 0.0) {\n outputColor *= opacity_t;\n outputColor *= intensity;//wave\n outputColor = filterColorAlpha(outputColor, outputColor.a);\n } else {\n outputColor.a *= opacity_t;\n outputColor.a *= intensity;//wave \n outputColor = filterColor(outputColor);\n }\n // 作为 mask 模板时需要丢弃透明的像素\n if(outputColor.a < 0.01) {\n discard;\n } \n}\n",vert:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_SHAPE) in float a_Shape;\nlayout(location = ATTRIBUTE_LOCATION_EXTRUDE) in vec3 a_Extrude;\n\nlayout(std140) uniform commonUniforms {\n vec3 u_blur_height_fixed;\n float u_stroke_width;\n float u_additive;\n float u_stroke_opacity;\n float u_size_unit;\n float u_time;\n vec4 u_animate;\n};\n\nout vec4 v_color;\nout vec4 v_stroke;\nout vec4 v_data;\nout float v_radius;\n\n#pragma include "projection"\n#pragma include "picking"\n#pragma include "rotation_2d"\n\nvoid main() {\n // 透明度计算\n v_stroke = stroke;\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n /*\n * setPickingSize 设置拾取大小\n * u_meter2coord 在等面积大小的时候设置单位\n */\n float newSize = setPickingSize(a_Size);\n // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;\n\n\n\n // unpack color(vec2)\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n\n if(u_size_unit == 1.0) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n\n v_radius = newSize;\n\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur_height_fixed.x);\n\n vec2 offset = (extrude.xy * (newSize + u_stroke_width) + u_offsets);\n\n offset = project_pixel(offset);\n offset = rotate_matrix(offset,rotation);\n\n // TODP: /abs(extrude.x) 是为了兼容地球模式\n v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0), a_Position64Low);\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n\n float raisingHeight = u_blur_height_fixed.y;\n\n if(u_blur_height_fixed.z < 1.0) { // false\n raisingHeight = project_pixel(u_blur_height_fixed.y);\n } else {\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raisingHeight = u_blur_height_fixed.y * mapboxZoomScale;\n }\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n',type:"pointFill"}}animateOption2Array(e){return[e.enable?0:1,e.speed||1,e.rings||3,0]}registerBuiltinAttributes(){const e=this.layer.getLayerConfig().shape2d;this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Ot.jQ.Attribute,descriptor:{name:"a_Extrude",shaderLocation:this.attributeLocation.EXTRUDE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:(e,t,n,r)=>{const i=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],o=r%4*3;return[i[o],i[o+1],i[o+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{size:t=5}=e;return Array.isArray(t)?[t[0]]:[t]}}}),this.styleAttributeService.registerStyleAttribute({name:"shape",type:Ot.jQ.Attribute,descriptor:{name:"a_Shape",shaderLocation:this.attributeLocation.SHAPE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:t=>{const{shape:n=2}=t;return[e.indexOf(n)]}}})}}class Wc extends kl{constructor(...e){super(...e),(0,kr.A)(this,"texture",void 0),(0,kr.A)(this,"updateTexture",(()=>{const{createTexture2D:e}=this.rendererService;if(this.texture)return this.texture.update({data:this.iconService.getCanvas(),mag:"linear",min:"linear mipmap nearest",mipmap:!0}),void setTimeout((()=>{this.layerService.throttleRenderLayers()}));this.texture=e({data:this.iconService.getCanvas(),mag:Ot.gl.LINEAR,min:Ot.gl.LINEAR_MIPMAP_LINEAR,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128,mipmap:!0})}))}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,UV:10})}getUninforms(){var e;this.rendererService.getDirty()&&(null===(e=this.texture)||void 0===e||e.bind());const t=this.getCommonUniformsInfo(),n=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Ur.A)((0,Ur.A)({},t.uniformsOption),n.uniformsOption)}getCommonUniformsInfo(){const{raisingHeight:e=0,heightfixed:t=!1}=this.layer.getLayerConfig(),n={u_textSize:[1024,this.iconService.canvasHeight||128],u_raisingHeight:Number(e),u_heightfixed:Number(t),u_texture:this.texture};return this.textures=[this.texture],this.getUniformsBufferInfo(n)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.iconService.on("imageUpdate",e.updateTexture),e.updateTexture(),e.buildModels()}))()}clearModels(){var e;null===(e=this.texture)||void 0===e||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}buildModels(){var e=this;return(0,Hr.A)((function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointImage",vertexShader:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_Uv;\n\nlayout(std140) uniform commonUniforms {\n vec2 u_textSize;\n float u_raisingHeight;\n float u_heightfixed;\n};\n\nout vec4 v_color;\nout vec2 v_uv;\nout float v_opacity;\n\n#pragma include "projection"\n#pragma include "picking"\n\nvoid main() {\n // cal style mapping - 数据纹理映射部分的计算\n v_color = a_Color;\n v_opacity = opacity;\n v_uv = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);\n\n vec2 offset = project_pixel(offsets);\n\n float raisingHeight = u_raisingHeight;\n if (u_heightfixed < 1.0) {\n // false\n raisingHeight = project_pixel(u_raisingHeight);\n } else {\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom);\n raisingHeight = u_raisingHeight * mapboxZoomScale;\n }\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));\n\n gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'layout(std140) uniform commonUniforms {\n vec2 u_textSize;\n float u_raisingHeight;\n float u_heightfixed;\n};\n\nuniform sampler2D u_texture;\n\nin vec4 v_color;\nin vec2 v_uv;\nin float v_opacity;\n\n#pragma include "picking"\n\nout vec4 outputColor;\n\nvoid main(){\n vec2 pos = v_uv / u_textSize + gl_PointCoord / u_textSize * 64.;\n vec4 textureColor;\n\n // Y = 0.299R + 0.587G + 0.114B // 亮度提取\n \n textureColor = texture(SAMPLER_2D(u_texture), pos);\n\n // Tip: 去除边缘部分 mipmap 导致的混合变暗\n float fragmengTocenter = distance(vec2(0.5), gl_PointCoord);\n if(fragmengTocenter >= 0.5) {\n float luma = 0.299 * textureColor.r + 0.587 * textureColor.g + 0.114 * textureColor.b;\n textureColor.a *= luma;\n }\n \n if(all(lessThan(v_color, vec4(1.0+0.00001))) && all(greaterThan(v_color, vec4(1.0-0.00001))) || v_color==vec4(1.0)){\n outputColor= textureColor;\n }else {\n outputColor= step(0.01, textureColor.z) * v_color;\n }\n outputColor.a *= v_opacity;\n if (outputColor.a < 0.01) {\n discard;\n }\n outputColor = filterColor(outputColor);\n}\n',triangulation:pc,defines:e.getDefines(),inject:e.getInject(),depth:{enable:!1},primitive:Ot.gl.POINTS})]}))()}registerBuiltinAttributes(){this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{size:t=5}=e;return Array.isArray(t)?[t[0]]:[t]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Ot.jQ.Attribute,descriptor:{name:"a_Uv",shaderLocation:this.attributeLocation.UV,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:e=>{const t=this.iconService.getIconMap(),{shape:n}=e,{x:r,y:i}=t[n]||{x:-64,y:-64};return[r,i]}}})}}function Xc(e){const t=e.coordinates;return{vertices:[...t],indices:[0],size:t.length}}class Zc extends kl{get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9})}getDefaultStyle(){return{blend:"additive"}}getCommonUniformsInfo(){return this.getUniformsBufferInfo({u_size_scale:.5})}initModels(){var e=this;return(0,Hr.A)((function*(){return e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){return e.layer.triangulation=Xc,e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointNormal",vertexShader:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\n\nlayout(std140) uniform u_Common {\n float u_size_scale;\n};\n\nout vec4 v_color;\n\n#pragma include "projection"\n#pragma include "project"\n\nvoid main() {\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n\n vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);\n gl_Position = project_common_position_to_clipspace(project_pos);\n\n gl_PointSize = a_Size * u_size_scale * 2.0 * u_DevicePixelRatio;\n}\n',fragmentShader:"in vec4 v_color;\nout vec4 outputColor;\nvoid main() {\n outputColor = v_color;\n}",triangulation:Xc,defines:e.getDefines(),inject:e.getInject(),depth:{enable:!1},primitive:Ot.gl.POINTS,pick:!1})]}))()}clearModels(){}registerBuiltinAttributes(){this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{size:t=1}=e;return Array.isArray(t)?[t[0]]:[t]}}})}}var Yc=n(70911),qc=n(39095);const Kc=class{constructor(e,t,n){(0,kr.A)(this,"boxCells",[]),(0,kr.A)(this,"xCellCount",void 0),(0,kr.A)(this,"yCellCount",void 0),(0,kr.A)(this,"boxKeys",void 0),(0,kr.A)(this,"bboxes",void 0),(0,kr.A)(this,"width",void 0),(0,kr.A)(this,"height",void 0),(0,kr.A)(this,"xScale",void 0),(0,kr.A)(this,"yScale",void 0),(0,kr.A)(this,"boxUid",void 0);const r=this.boxCells;this.xCellCount=Math.ceil(e/n),this.yCellCount=Math.ceil(t/n);for(let e=0;e<this.xCellCount*this.yCellCount;e++)r.push([]);this.boxKeys=[],this.bboxes=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0}insert(e,t,n,r,i){this.forEachCell(t,n,r,i,this.insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)}query(e,t,n,r,i){return this.queryHitTest(e,t,n,r,!1,i)}hitTest(e,t,n,r,i){return this.queryHitTest(e,t,n,r,!0,i)}insertBoxCell(e,t,n,r,i,o){this.boxCells[i].push(o)}queryHitTest(e,t,n,r,i,o){if(n<0||e>this.width||r<0||t>this.height)return!i&&[];const a=[];if(e<=0&&t<=0&&this.width<=n&&this.height<=r){if(i)return!0;for(let e=0;e<this.boxKeys.length;e++)a.push({key:this.boxKeys[e],x1:this.bboxes[4*e],y1:this.bboxes[4*e+1],x2:this.bboxes[4*e+2],y2:this.bboxes[4*e+3]});return o?a.filter(o):a}const s={hitTest:i,seenUids:{box:{},circle:{}}};return this.forEachCell(e,t,n,r,this.queryCell,a,s,o),i?a.length>0:a}queryCell(e,t,n,r,i,o,a,s){const l=a.seenUids,c=this.boxCells[i];if(null!==c){const i=this.bboxes;for(const u of c)if(!l.box[u]){l.box[u]=!0;const c=4*u;if(e<=i[c+2]&&t<=i[c+3]&&n>=i[c+0]&&r>=i[c+1]&&(!s||s(this.boxKeys[u]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[u],x1:i[c],y1:i[c+1],x2:i[c+2],y2:i[c+3]})}}}return!1}forEachCell(e,t,n,r,i,o,a,s){const l=this.convertToXCellCoord(e),c=this.convertToYCellCoord(t),u=this.convertToXCellCoord(n),h=this.convertToYCellCoord(r);for(let d=l;d<=u;d++)for(let l=c;l<=h;l++){const c=this.xCellCount*l+d;if(i.call(this,e,t,n,r,c,o,a,s))return}}convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}};class Qc{constructor(e,t){(0,kr.A)(this,"width",void 0),(0,kr.A)(this,"height",void 0),(0,kr.A)(this,"grid",void 0),(0,kr.A)(this,"viewportPadding",100),(0,kr.A)(this,"screenRightBoundary",void 0),(0,kr.A)(this,"screenBottomBoundary",void 0),(0,kr.A)(this,"gridRightBoundary",void 0),(0,kr.A)(this,"gridBottomBoundary",void 0),this.width=e,this.height=t,this.viewportPadding=Math.max(e,t),this.grid=new Kc(e+this.viewportPadding,t+this.viewportPadding,25),this.screenRightBoundary=e+this.viewportPadding,this.screenBottomBoundary=t+this.viewportPadding,this.gridRightBoundary=e+2*this.viewportPadding,this.gridBottomBoundary=t+2*this.viewportPadding}placeCollisionBox(e){const t=e.x1+e.anchorPointX+this.viewportPadding,n=e.y1+e.anchorPointY+this.viewportPadding,r=e.x2+e.anchorPointX+this.viewportPadding,i=e.y2+e.anchorPointY+this.viewportPadding;return!this.isInsideGrid(t,n,r,i)||this.grid.hitTest(t,n,r,i)?{box:[]}:{box:[t,n,r,i]}}insertCollisionBox(e,t){const n={featureIndex:t};this.grid.insert(n,e[0],e[1],e[2],e[3])}project(e,t,n){const r=Yc.fA(t,n,0,1),i=Yc.vt(),o=qc.fA(...e);return Yc.Z0(i,r,o),{x:(i[0]/i[3]+1)/2*this.width+this.viewportPadding,y:(-i[1]/i[3]+1)/2*this.height+this.viewportPadding}}isInsideGrid(e,t,n,r){return n>=0&&e<this.gridRightBoundary&&r>=0&&t<this.gridBottomBoundary}}function $c(e){let t=.5,n=.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":n=1;break;case"top":case"top-right":case"top-left":n=0;break;default:n=.5}return{horizontalAlign:t,verticalAlign:n}}function Jc(e,t,n,r,i){if(!i)return;const o=e[r],a=o.glyph;if(a){const s=t[a].advance*o.scale,l=(e[r].x+s)*i;for(let t=n;t<=r;t++)e[t].x-=l}}function eu(e,t,n,r,i,o,a){const s=(t-n)*i,l=(-r*a+.5)*o;for(const t of e)t.x+=s,t.y+=l}const tu='#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 48.0\n\nuniform sampler2D u_sdf_map;\nlayout(std140) uniform commonUniforms {\n vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n vec2 u_sdf_map_size;\n float u_raisingHeight: 0.0;\n float u_stroke_width : 2;\n float u_gamma_scale : 0.5;\n float u_halo_blur : 0.5;\n};\n\nin vec2 v_uv;\nin float v_gamma_scale;\nin vec4 v_color;\nin vec4 v_stroke_color;\nin float v_fontScale;\n\nout vec4 outputColor;\n\n#pragma include "picking"\nvoid main() {\n // get style data mapping\n\n // get sdf from atlas\n float dist = texture(SAMPLER_2D(u_sdf_map), v_uv).a;\n\n lowp float buff = (6.0 - u_stroke_width / v_fontScale) / SDF_PX;\n highp float gamma = (u_halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (v_fontScale * u_gamma_scale) / 1.0;\n\n highp float gamma_scaled = gamma * v_gamma_scale;\n\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n outputColor = mix(v_color, v_stroke_color, smoothstep(0., 0.5, 1.- dist));\n\n outputColor.a *= alpha;\n // 作为 mask 模板时需要丢弃透明的像素\n if (outputColor.a < 0.01) {\n discard;\n }\n outputColor = filterColor(outputColor);\n}\n',nu='#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 24.0\n\nlayout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_TEXT_OFFSETS) in vec2 a_textOffsets;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_tex;\n\nlayout(std140) uniform commonUniforms {\n vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n vec2 u_sdf_map_size;\n float u_raisingHeight: 0.0;\n float u_stroke_width : 2;\n float u_gamma_scale : 0.5;\n float u_halo_blur : 0.5;\n};\n\nout vec2 v_uv;\nout float v_gamma_scale;\nout vec4 v_color;\nout vec4 v_stroke_color;\nout float v_fontScale;\n\n#pragma include "projection"\n#pragma include "picking"\n#pragma include "rotation_2d"\n\nvoid main() {\n // cal style mapping - 数据纹理映射部分的计算\n\n v_uv = a_tex / u_sdf_map_size;\n\n\n\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n v_stroke_color = vec4(u_stroke_color.xyz, u_stroke_color.w * opacity);\n\n // 文本缩放比例\n float fontScale = a_Size / FONT_SIZE;\n v_fontScale = fontScale;\n\n vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);\n // vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n vec2 offset = rotate_matrix(a_textOffsets,rotation);\n\n // gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n\n float raiseHeight = u_raisingHeight;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raiseHeight = u_raisingHeight * mapboxZoomScale;\n }\n\n vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));\n\n gl_Position = vec4(\n projected_position.xy / projected_position.w + offset * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n v_gamma_scale = gl_Position.w;\n setPickingColor(a_PickingColor);\n\n}\n',{isEqual:ru}=y.uG;function iu(e){const t=this,n=e.id,r=[],i=[];if(!t.glyphInfoMap||!t.glyphInfoMap[n])return{vertices:[],indices:[],size:7};const o=t.glyphInfoMap[n].centroid,a=2===o.length?[o[0],o[1],0]:o;return t.glyphInfoMap[n].glyphQuads.forEach(((e,t)=>{r.push(...a,e.tex.x,e.tex.y+e.tex.height,e.tl.x,e.tl.y,...a,e.tex.x+e.tex.width,e.tex.y+e.tex.height,e.tr.x,e.tr.y,...a,e.tex.x+e.tex.width,e.tex.y,e.br.x,e.br.y,...a,e.tex.x,e.tex.y,e.bl.x,e.bl.y),i.push(0+4*t,1+4*t,2+4*t,2+4*t,3+4*t,0+4*t)})),{vertices:r,indices:i,size:7}}class ou extends kl{constructor(...e){var t;super(...e),t=this,(0,kr.A)(this,"glyphInfo",void 0),(0,kr.A)(this,"glyphInfoMap",{}),(0,kr.A)(this,"rawEncodeData",void 0),(0,kr.A)(this,"texture",void 0),(0,kr.A)(this,"currentZoom",-1),(0,kr.A)(this,"extent",void 0),(0,kr.A)(this,"textureHeight",0),(0,kr.A)(this,"textCount",0),(0,kr.A)(this,"preTextStyle",{}),(0,kr.A)(this,"mapping",(0,Hr.A)((function*(){t.initGlyph(),t.updateTexture(),yield t.reBuildModel()})))}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,TEXT_OFFSETS:10,UV:11})}getUninforms(){const e=this.getCommonUniformsInfo(),t=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Ur.A)((0,Ur.A)((0,Ur.A)({},e.uniformsOption),t.uniformsOption),{u_sdf_map:this.textures[0]})}getCommonUniformsInfo(){const{stroke:e="#fff",strokeWidth:t=0,halo:n=.5,gamma:r=2,raisingHeight:i=0}=this.layer.getLayerConfig(),o=this.getFontServiceMapping(),a=this.getFontServiceCanvas();o&&Object.keys(o).length!==this.textCount&&a&&(this.updateTexture(),this.textCount=Object.keys(o).length),this.preTextStyle=this.getTextStyle();const s={u_stroke_color:(0,y.HR)(e),u_sdf_map_size:[(null==a?void 0:a.width)||1,(null==a?void 0:a.height)||1],u_raisingHeight:Number(i),u_stroke_width:t,u_gamma_scale:r,u_halo_blur:n};return this.getUniformsBufferInfo(s)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.bindEvent(),e.extent=e.textExtent(),e.rawEncodeData=e.layer.getEncodedData(),e.preTextStyle=e.getTextStyle(),e.initUniformsBuffer(),e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){const{textAllowOverlap:t=!1}=e.layer.getLayerConfig();return e.initGlyph(),e.updateTexture(),t||e.filterGlyphs(),[yield e.layer.buildLayerModel({moduleName:"pointText",vertexShader:nu,fragmentShader:tu,defines:e.getDefines(),inject:e.getInject(),triangulation:iu.bind(e),depth:{enable:!1}})]}))()}needUpdate(){var e=this;return(0,Hr.A)((function*(){const{textAllowOverlap:t=!1,textAnchor:n="center",textOffset:r,padding:i,fontFamily:o,fontWeight:a}=e.getTextStyle();if(!(ru(i,e.preTextStyle.padding)&&ru(r,e.preTextStyle.textOffset)&&ru(n,e.preTextStyle.textAnchor)&&ru(o,e.preTextStyle.fontFamily)&&ru(a,e.preTextStyle.fontWeight)))return yield e.mapping(),!0;if(t)return!1;const s=e.mapService.getZoom(),l=e.mapService.getBounds(),c=(0,y.rB)(e.extent,l);return(Math.abs(e.currentZoom-s)>.5||!c||t!==e.preTextStyle.textAllowOverlap)&&(yield e.reBuildModel(),!0)}))()}clearModels(){var e;null===(e=this.texture)||void 0===e||e.destroy(),this.layer.off("remapping",this.mapping)}registerBuiltinAttributes(){this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"textOffsets",type:Ot.jQ.Attribute,descriptor:{shaderLocation:this.attributeLocation.TEXT_OFFSETS,name:"a_textOffsets",buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:(e,t,n)=>[n[5],n[6]]}}),this.styleAttributeService.registerStyleAttribute({name:"textUv",type:Ot.jQ.Attribute,descriptor:{name:"a_tex",shaderLocation:this.attributeLocation.UV,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:(e,t,n)=>[n[3],n[4]]}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{size:t=12}=e;return Array.isArray(t)?[t[0]]:[t]}}})}bindEvent(){this.layer.isTileLayer||this.layer.on("remapping",this.mapping)}textExtent(){const e=this.mapService.getBounds();return(0,y.ng)(e,.5)}initTextFont(){const{fontWeight:e,fontFamily:t}=this.getTextStyle(),n=this.rawEncodeData,r=[];n.forEach((e=>{let{shape:t=""}=e;t=t.toString();for(const e of t)-1===r.indexOf(e)&&r.push(e)})),this.fontService.setFontOptions({characterSet:r,fontWeight:e,fontFamily:t,iconfont:!1})}initIconFontTex(){const{fontWeight:e,fontFamily:t}=this.getTextStyle(),n=this.rawEncodeData,r=[];n.forEach((e=>{let{shape:t=""}=e;t=`${t}`,-1===r.indexOf(t)&&r.push(t)})),this.fontService.setFontOptions({characterSet:r,fontWeight:e,fontFamily:t,iconfont:!0})}getTextStyle(){const{fontWeight:e="400",fontFamily:t="sans-serif",textAllowOverlap:n=!1,padding:r=[0,0],textAnchor:i="center",textOffset:o=[0,0],opacity:a=1,strokeOpacity:s=1,strokeWidth:l=0,stroke:c="#000"}=this.layer.getLayerConfig();return{fontWeight:e,fontFamily:t,textAllowOverlap:n,padding:r,textAnchor:i,textOffset:o,opacity:a,strokeOpacity:s,strokeWidth:l,stroke:c}}generateGlyphLayout(e){const t=this.getFontServiceMapping(),{spacing:n=2,textAnchor:r="center",textOffset:i}=this.layer.getLayerConfig(),o=this.rawEncodeData;this.glyphInfo=o.map((o=>{const{shape:a="",id:s,size:l=1}=o,c=o.textOffset?o.textOffset:i||[0,0],u=o.textAnchor?o.textAnchor:r||"center",h=function(e,t,n,r,i,o,a=[0,0],s){const l=e.split("\n"),c=[],u={positionedGlyphs:c,top:a[1],bottom:a[1],left:a[0],right:a[0],lineCount:l.length,text:e};return s?function(e,t,n,r,i,o,a){let s=0,l=-8,c=0;const u=e.positionedGlyphs,h="right"===o?1:"left"===o?0:.5,d=u.length;n.forEach((e=>{const n=t[e];if(n&&(u.push({glyph:e,x:n.advance/2,y:l+0,vertical:!1,scale:1,metrics:n}),s+=n.advance+a),u.length!==d){const e=s-a;c=Math.max(e,c),Jc(u,t,d,u.length-1,h)}s=0,l-=r+5}));const{horizontalAlign:f,verticalAlign:p}=$c(i);eu(u,h,f,p,c,r,n.length);const g=l- -8;e.top+=-p*g,e.bottom=e.top-g,e.left+=-f*c,e.right=e.left+c}(u,t,l,n,r,i,o):function(e,t,n,r,i,o,a){let s=0,l=-8,c=0;const u=e.positionedGlyphs,h="right"===o?1:"left"===o?0:.5,d=u.length;n.forEach((e=>{if(e.split("").forEach((e=>{const n=t[e];n&&(u.push({glyph:e,x:s,y:l+0,vertical:!1,scale:1,metrics:n}),s+=n.advance+a)})),u.length!==d){const e=s-a;c=Math.max(e,c),Jc(u,t,d,u.length-1,h)}s=0,l-=r+5}));const{horizontalAlign:f,verticalAlign:p}=$c(i);eu(u,h,f,p,c,r,n.length);const g=l- -8;e.top+=-p*g,e.bottom=e.top-g,e.left+=-f*c,e.right=e.left+c}(u,t,l,n,r,i,o),!!c.length&&u}(a.toString(),t,l,u,"left",n,c,e),d=function(e,t=[0,0],n){const{positionedGlyphs:r=[]}=e,i=[];for(const e of r){const r=e.metrics,o=4,a=r.advance*e.scale/2,s=n?[e.x+a,e.y]:[0,0],l=n?[0,0]:[e.x+a+t[0],e.y+t[1]],c=(0-o)*e.scale-a+l[0],u=(0-o)*e.scale+l[1],h=c+r.width*e.scale,d=u+r.height*e.scale,f={x:c,y:u},p={x:h,y:u},g={x:c,y:d},m={x:h,y:d};i.push({tl:f,tr:p,bl:g,br:m,tex:r,glyphOffset:s})}return i}(h,c,!1);return o.shaping=h,o.glyphQuads=d,o.centroid=(0,y.fi)(o.coordinates),this.glyphInfoMap[s]={shaping:h,glyphQuads:d,centroid:(0,y.fi)(o.coordinates)},o}))}getFontServiceMapping(){const{fontWeight:e="400",fontFamily:t="sans-serif"}=this.layer.getLayerConfig();return this.fontService.getMappingByKey(`${t}_${e}`)}getFontServiceCanvas(){const{fontWeight:e="400",fontFamily:t="sans-serif"}=this.layer.getLayerConfig();return this.fontService.getCanvasByKey(`${t}_${e}`)}filterGlyphs(){const{padding:e=[0,0],textAllowOverlap:t=!1}=this.layer.getLayerConfig();if(t)return;this.glyphInfoMap={},this.currentZoom=this.mapService.getZoom(),this.extent=this.textExtent();const{width:n,height:r}=this.rendererService.getViewportSize(),i=new Qc(n,r);this.glyphInfo.filter((t=>{const{shaping:n,id:r=0}=t,o=t.centroid,a=t.size/16,s=this.mapService.lngLatToContainer(o),{box:l}=i.placeCollisionBox({x1:n.left*a-e[0],x2:n.right*a+e[0],y1:n.top*a-e[1],y2:n.bottom*a+e[1],anchorPointX:s.x,anchorPointY:s.y});return!(!l||!l.length||(i.insertCollisionBox(l,r),0))})).forEach((e=>{this.glyphInfoMap[e.id]=e}))}initGlyph(){const{iconfont:e=!1}=this.layer.getLayerConfig();e?this.initIconFontTex():this.initTextFont(),this.generateGlyphLayout(e)}updateTexture(){const{createTexture2D:e}=this.rendererService,t=this.getFontServiceCanvas();this.textureHeight=t.height,this.texture&&this.texture.destroy(),this.texture=e({data:t,mag:Ot.gl.LINEAR,min:Ot.gl.LINEAR,width:t.width,height:t.height}),this.textures=[this.texture]}reBuildModel(){var e=this;return(0,Hr.A)((function*(){e.filterGlyphs();const t=yield e.layer.buildLayerModel({moduleName:"pointText",vertexShader:nu,fragmentShader:tu,triangulation:iu.bind(e),defines:e.getDefines(),inject:e.getInject(),depth:{enable:!1}});e.layer.models=[t]}))()}}function au(){return(au=(0,Hr.A)((function*(e){if(window.createImageBitmap){const t=yield fetch(e);return yield createImageBitmap(yield t.blob())}{const t=new window.Image;return new Promise((n=>{t.onload=()=>n(t),t.src=e,t.crossOrigin="Anonymous"}))}}))).apply(this,arguments)}const su={fill:class extends kl{get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,LINEAR:9})}getUninforms(){const e=this.getCommonUniformsInfo(),t=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Ur.A)((0,Ur.A)({},e.uniformsOption),t.uniformsOption)}getCommonUniformsInfo(){const{raisingHeight:e=0,opacityLinear:t={enable:!1,dir:"in"}}=this.layer.getLayerConfig(),n={u_raisingHeight:Number(e),u_opacitylinear:Number(t.enable),u_dir:"in"===t.dir?1:0};return this.getUniformsBufferInfo(n)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){const{frag:t,vert:n,triangulation:r,type:i}=e.getModelParams();return e.initUniformsBuffer(),e.layer.triangulation=r,[yield e.layer.buildLayerModel({moduleName:i,vertexShader:n,fragmentShader:t,defines:e.getDefines(),inject:e.getInject(),triangulation:r,primitive:Ot.gl.TRIANGLES,depth:{enable:!1}})]}))()}registerBuiltinAttributes(){this.registerPosition64LowAttribute();const{opacityLinear:e={enable:!1,dir:"in"}}=this.layer.getLayerConfig();e.enable&&this.styleAttributeService.registerStyleAttribute({name:"linear",type:Ot.jQ.Attribute,descriptor:{name:"a_linear",shaderLocation:this.attributeLocation.LINEAR,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:(e,t,n)=>[n[3],n[4],n[5]]}})}getModelParams(){const{opacityLinear:e={enable:!1}}=this.layer.getLayerConfig();return e.enable?{frag:'\nlayout(std140) uniform commonUniforms {\n float u_raisingHeight;\n float u_opacitylinear;\n float u_dir;\n};\n\nin vec4 v_color;\nin vec3 v_linear;\nin vec2 v_pos;\nout vec4 outputColor;\n#pragma include "scene_uniforms"\n#pragma include "picking"\n\nvoid main() {\n outputColor = v_color;\n if (u_opacitylinear > 0.0) {\n 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;\n }\n outputColor = filterColor(outputColor);\n}\n',vert:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_LINEAR) in vec3 a_linear;\n\nlayout(std140) uniform commonUniforms {\n float u_raisingHeight;\n float u_opacitylinear;\n float u_dir;\n};\n\nout vec4 v_color;\nout vec3 v_linear;\nout vec2 v_pos;\n\n#pragma include "projection"\n#pragma include "picking"\n\nvoid main() {\n if (u_opacitylinear > 0.0) {\n v_linear = a_linear;\n v_pos = a_Position.xy;\n }\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);\n project_pos.z += u_raisingHeight;\n\n if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n setPickingColor(a_PickingColor);\n}\n',type:"polygonLinear",triangulation:Ec}:{frag:'in vec4 v_color;\n#pragma include "scene_uniforms"\n#pragma include "picking"\nout vec4 outputColor;\nvoid main() {\n outputColor = v_color;\n outputColor = filterColor(outputColor);\n}\n',vert:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\n\nlayout(std140) uniform commonUniforms {\n float u_raisingHeight;\n};\n\nout vec4 v_color;\n\n#pragma include "projection"\n#pragma include "picking"\n\nvoid main() {\n // cal style mapping - 数据纹理映射部分的计算\n\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);\n\n project_pos.z += u_raisingHeight;\n\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom);\n project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n\n',type:"polygonFill",triangulation:yc}}},line:Gc,extrude:class extends kl{constructor(...e){super(...e),(0,kr.A)(this,"texture",void 0)}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,NORMAL:10,UV:11})}getUninforms(){const e=this.getCommonUniformsInfo(),t=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Ur.A)((0,Ur.A)({},e.uniformsOption),t.uniformsOption)}getCommonUniformsInfo(){const{mapTexture:e,heightfixed:t=!1,raisingHeight:n=0,topsurface:r=!0,sidesurface:i=!0,sourceColor:o,targetColor:a}=this.layer.getLayerConfig();let s=0,l=[1,1,1,1],c=[1,1,1,1];o&&a&&(l=(0,y.HR)(o),c=(0,y.HR)(a),s=1);const u={u_sourceColor:l,u_targetColor:c,u_linearColor:s,u_topsurface:Number(r),u_sidesurface:Number(i),u_heightfixed:Number(t),u_raisingHeight:Number(n)};return e&&this.texture&&(u.u_texture=this.texture,this.textures=[this.texture]),this.getUniformsBufferInfo(u)}initModels(){var e=this;return(0,Hr.A)((function*(){return yield e.loadTexture(),e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){const{frag:t,vert:n,type:r}=e.getShaders();return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:r,vertexShader:n,fragmentShader:t,depth:{enable:!0},defines:e.getDefines(),inject:e.getInject(),triangulation:bc})]}))()}getShaders(){const{pickLight:e,mapTexture:t}=this.layer.getLayerConfig();return t?{frag:'uniform sampler2D u_texture;\n\nlayout(std140) uniform commonUniforms {\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_linearColor;\n float u_topsurface;\n float u_sidesurface;\n float u_heightfixed; // 默认不固定\n float u_raisingHeight;\n};\n\nin vec4 v_Color;\nin vec3 v_uvs;\nin vec2 v_texture_data;\n\n#pragma include "scene_uniforms"\n#pragma include "picking"\n\nout vec4 outputColor;\n\nvoid main() {\n float opacity = u_opacity;\n float isSide = v_texture_data.x;\n float lightWeight = v_texture_data.y;\n float topU = v_uvs[0];\n float topV = 1.0 - v_uvs[1];\n float sidey = v_uvs[2];\n\n outputColor = texture(SAMPLER_2D(u_texture), vec2(topU, topV));\n // Tip: 部分机型 GPU 计算精度兼容\n if (isSide < 0.999) {// 是否是边缘\n // side face\n if (u_sidesurface < 1.0) {\n discard;\n }\n\n if (u_linearColor == 1.0) {\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n outputColor = linearColor;\n } else {\n outputColor = v_Color;\n }\n } else {\n // top face\n if (u_topsurface < 1.0) {\n discard;\n }\n }\n \n outputColor.a *= opacity;\n outputColor = filterColor(outputColor);\n}\n',vert:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_NORMAL) in vec3 a_Normal;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec3 a_uvs;\n\nlayout(std140) uniform commonUniforms {\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_linearColor;\n float u_topsurface;\n float u_sidesurface;\n float u_heightfixed; // 默认不固定\n float u_raisingHeight;\n};\n\nout vec4 v_Color;\nout vec3 v_uvs;\nout vec2 v_texture_data;\n\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\n\nvoid main() {\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos, a_Position64Low);\n float lightWeight = calc_lighting(project_pos);\n v_uvs = a_uvs;\n v_Color = a_Color;\n v_Color.a *= opacity;\n\n v_texture_data = vec2(a_Position.z, lightWeight);\n\n if (u_heightfixed > 0.0) {\n // 判断几何体是否固定高度\n project_pos.z = a_Position.z * a_Size;\n project_pos.z += u_raisingHeight;\n\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom);\n project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n',type:"polygonExtrudeTexture"}:e?{frag:'\nlayout(std140) uniform commonUniforms {\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_linearColor;\n float u_topsurface;\n float u_sidesurface;\n float u_heightfixed; // 默认不固定\n float u_raisingHeight;\n};\n\nin vec4 v_Color;\nin vec3 v_uvs;\nin vec2 v_texture_data;\nout vec4 outputColor;\n\n#pragma include "scene_uniforms"\n#pragma include "picking"\n\nvoid main() {\n float isSide = v_texture_data.x;\n float sidey = v_uvs[2];\n float lightWeight = v_texture_data.y;\n\n // Tip: 部分机型 GPU 计算精度兼容\n if(isSide < 0.999) {\n // side face\n if(u_sidesurface < 1.0) {\n discard;\n }\n \n if( u_linearColor == 1.0) {\n // side use linear\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n outputColor = linearColor;\n } else {\n // side notuse linear\n outputColor = v_Color;\n }\n } else {\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n outputColor = v_Color;\n }\n\n outputColor = filterColorAlpha(outputColor, lightWeight);\n}\n',vert:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_NORMAL) in vec3 a_Normal;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec3 a_uvs;\n\nlayout(std140) uniform commonUniforms {\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_linearColor;\n float u_topsurface;\n float u_sidesurface;\n float u_heightfixed; // 默认不固定\n float u_raisingHeight;\n};\n\nout vec4 v_Color;\nout vec3 v_uvs;\nout vec2 v_texture_data;\n\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\n\nvoid main() {\n v_uvs = a_uvs;\n // cal style mapping - 数据纹理映射部分的计算\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos, a_Position64Low);\n\n if (u_heightfixed > 0.0) {\n // 判断几何体是否固定高度\n project_pos.z = a_Position.z * a_Size;\n project_pos.z += u_raisingHeight;\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom);\n project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n float lightWeight = calc_lighting(project_pos);\n v_texture_data = vec2(a_Position.z, lightWeight);\n\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);\n\n setPickingColor(a_PickingColor);\n}\n',type:"polygonExtrudePickLight"}:{frag:'layout(std140) uniform commonUniforms {\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_linearColor;\n float u_topsurface;\n float u_sidesurface;\n float u_heightfixed; // 默认不固定\n float u_raisingHeight;\n};\n\nin vec4 v_Color;\n#pragma include "scene_uniforms"\n#pragma include "picking"\nout vec4 outputColor;\nvoid main() {\n\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n\n outputColor = v_Color;\n \n outputColor = filterColor(outputColor);\n}\n',vert:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_NORMAL) in vec3 a_Normal;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec3 a_uvs;\n\nlayout(std140) uniform commonUniforms {\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_linearColor;\n float u_topsurface;\n float u_sidesurface;\n float u_heightfixed; // 默认不固定\n float u_raisingHeight;\n};\n\nout vec4 v_Color;\n\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\n\nvoid main() {\n float isSide = a_Position.z;\n float topU = a_uvs[0];\n float topV = 1.0 - a_uvs[1];\n float sidey = a_uvs[2];\n\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n\n vec4 project_pos = project_position(pos, a_Position64Low);\n float lightWeight = calc_lighting(project_pos);\n\n if (u_heightfixed > 0.0) {\n // 判断几何体是否固定高度\n project_pos.z = a_Position.z * a_Size;\n project_pos.z += u_raisingHeight;\n\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom);\n project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n // Tip: 部分机型 GPU 计算精度兼容\n if (isSide < 0.999) {\n // side face\n // if(u_sidesurface < 1.0) {\n // discard;\n // }\n\n if (u_linearColor == 1.0) {\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n v_Color = linearColor;\n } else {\n v_Color = a_Color;\n }\n\n } else {\n v_Color = a_Color;\n }\n\n v_Color = vec4(v_Color.rgb * lightWeight, v_Color.w * opacity);\n\n setPickingColor(a_PickingColor);\n}\n',type:"polygonExtrude"}}clearModels(){var e;null===(e=this.texture)||void 0===e||e.destroy(),this.textures=[]}registerBuiltinAttributes(){const e=this.layer.getSource().extent,t=e[2]-e[0],n=e[3]-e[1];this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"uvs",type:Ot.jQ.Attribute,descriptor:{name:"a_uvs",shaderLocation:this.attributeLocation.UV,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:(r,i,o)=>{const a=o[0],s=o[1];return[(a-e[0])/t,(s-e[1])/n,o[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Ot.jQ.Attribute,descriptor:{name:"a_Normal",shaderLocation:this.attributeLocation.NORMAL,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:(e,t,n,r,i)=>i}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{size:t=10}=e;return Array.isArray(t)?[t[0]]:[t]}}})}loadTexture(){var e=this;return(0,Hr.A)((function*(){const{mapTexture:t}=e.layer.getLayerConfig(),{createTexture2D:n}=e.rendererService;if(e.texture=n({height:1,width:1}),t){const r=yield function(e){return au.apply(this,arguments)}(t);e.texture=n({data:r,width:r.width,height:r.height,wrapS:Ot.gl.CLAMP_TO_EDGE,wrapT:Ot.gl.CLAMP_TO_EDGE,min:Ot.gl.LINEAR,mag:Ot.gl.LINEAR})}}))()}},text:ou,point_fill:Hc,point_image:Wc,point_normal:Zc,point_extrude:Vc,water:class extends kl{constructor(...e){super(...e),(0,kr.A)(this,"texture",void 0)}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,UV:9})}getUninforms(){const e=this.getCommonUniformsInfo(),t=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Ur.A)((0,Ur.A)({},e.uniformsOption),t.uniformsOption)}getCommonUniformsInfo(){const{speed:e=.5}=this.layer.getLayerConfig(),t={u_speed:e,u_time:this.layer.getLayerAnimateTime(),u_texture:this.texture};return this.textures=[this.texture],this.getUniformsBufferInfo(t)}getAnimateUniforms(){return{u_time:this.layer.getLayerAnimateTime()}}initModels(){var e=this;return(0,Hr.A)((function*(){return e.loadTexture(),e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"polygonWater",vertexShader:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_uv;\n\nlayout(std140) uniform commonUniforms {\n float u_speed;\n float u_time;\n};\nout vec4 v_Color;\nout vec2 v_uv;\n\n#pragma include "projection"\n\nvoid main() {\n v_uv = a_uv;\n v_Color = a_Color;\n v_Color.a *= opacity;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n}\n\n',fragmentShader:"uniform sampler2D u_texture;\nlayout(std140) uniform commonUniforms {\n float u_speed;\n float u_time;\n};\n\nout vec4 outputColor;\n\n\nin vec4 v_Color;\nin vec2 v_uv;\n\nfloat rand(vec2 n) { return 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453); }\n\nfloat water(vec3 p) {\n float t = u_time * u_speed;\n p.z += t * 2.; p.x += t * 2.;\n vec3 c1 = texture(SAMPLER_2D(u_texture), p.xz / 30.).xyz;\n p.z += t * 3.; p.x += t * 0.52;\n vec3 c2 = texture(SAMPLER_2D(u_texture), p.xz / 30.).xyz;\n p.z += t * 4.; p.x += t * 0.8;\n vec3 c3 = texture(SAMPLER_2D(u_texture), p.xz / 30.).xyz;\n c1 += c2 - c3;\n float z = (c1.x + c1.y + c1.z) / 3.;\n return p.y + z / 4.;\n}\n\nfloat map(vec3 p) {\n float d = 100.0;\n d = water(p);\n return d;\n}\n\nfloat intersect(vec3 ro, vec3 rd) {\n float d = 0.0;\n for (int i = 0; i <= 100; i++) {\n float h = map(ro + rd * d);\n if (h < 0.1) return d;\n d += h;\n }\n return 0.0;\n}\n\nvec3 norm(vec3 p) {\n float eps = .1;\n return normalize(vec3(\n map(p + vec3(eps, 0, 0)) - map(p + vec3(-eps, 0, 0)),\n map(p + vec3(0, eps, 0)) - map(p + vec3(0, -eps, 0)),\n map(p + vec3(0, 0, eps)) - map(p + vec3(0, 0, -eps))\n ));\n} \n\nfloat calSpc() {\n vec3 l1 = normalize(vec3(1, 1, 1));\n vec3 ro = vec3(-3, 20, -8);\n vec3 rc = vec3(0, 0, 0);\n vec3 ww = normalize(rc - ro);\n vec3 uu = normalize(cross(vec3(0,1,0), ww));\n vec3 vv = normalize(cross(rc - ro, uu));\n vec3 rd = normalize(uu * v_uv.x + vv * v_uv.y + ww);\n float d = intersect(ro, rd);\n vec3 p = ro + rd * d;\n vec3 n = norm(p);\n float spc = pow(max(0.0, dot(reflect(l1, n), rd)), 30.0);\n return spc;\n}\n\nvoid main() {\n\n outputColor = v_Color;\n float spc = calSpc();\n outputColor += spc * 0.4;\n}\n",triangulation:yc,defines:e.getDefines(),inject:e.getInject(),primitive:Ot.gl.TRIANGLES,depth:{enable:!1},pickingEnabled:!1,diagnosticDerivativeUniformityEnabled:!1})]}))()}clearModels(){var e;null===(e=this.texture)||void 0===e||e.destroy()}registerBuiltinAttributes(){const e=this.layer.getSource().extent,[t,n,r,i]=e,o=r-t,a=i-n;this.styleAttributeService.registerStyleAttribute({name:"waterUv",type:Ot.jQ.Attribute,descriptor:{name:"a_uv",shaderLocation:this.attributeLocation.UV,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:(e,r,i)=>{const[s,l]=i;return[(s-t)/o,(l-n)/a]}}})}loadTexture(){const{waterTexture:e}=this.layer.getLayerConfig(),{createTexture2D:t}=this.rendererService;this.texture=t({height:1,width:1});const n=new Image;n.crossOrigin="",e?(console.warn("L7 recommend:https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ"),n.src=e):n.src="https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ",n.onload=()=>{this.texture=t({data:n,width:n.width,height:n.height,wrapS:Ot.gl.MIRRORED_REPEAT,wrapT:Ot.gl.MIRRORED_REPEAT,min:Ot.gl.LINEAR,mag:Ot.gl.LINEAR}),this.layerService.reRender()}}},ocean:class extends kl{constructor(...e){super(...e),(0,kr.A)(this,"texture1",void 0),(0,kr.A)(this,"texture2",void 0),(0,kr.A)(this,"texture3",void 0)}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,UV:9})}getUninforms(){const e=this.getCommonUniformsInfo(),t=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Ur.A)((0,Ur.A)({},e.uniformsOption),t.uniformsOption)}getCommonUniformsInfo(){const{watercolor:e="#6D99A8",watercolor2:t="#0F121C"}=this.layer.getLayerConfig(),n={u_watercolor:(0,y.HR)(e),u_watercolor2:(0,y.HR)(t),u_time:this.layer.getLayerAnimateTime(),u_texture1:this.texture1,u_texture2:this.texture2,u_texture3:this.texture3};return this.textures=[this.texture1,this.texture2,this.texture3],this.getUniformsBufferInfo(n)}getAnimateUniforms(){return{u_time:this.layer.getLayerAnimateTime()}}initModels(){var e=this;return(0,Hr.A)((function*(){return e.loadTexture(),e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"polygonOcean",vertexShader:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_uv;\n\nlayout(std140) uniform commonUniforms {\n vec4 u_watercolor;\n vec4 u_watercolor2;\n float u_time;\n};\n\nout vec2 v_uv;\nout float v_opacity;\n\n#pragma include "projection"\n\nvoid main() {\n v_uv = a_uv;\n v_opacity = opacity;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n}\n\n',fragmentShader:"\nlayout(std140) uniform commonUniforms {\n vec4 u_watercolor;\n vec4 u_watercolor2;\n float u_time;\n};\n\nin vec2 v_uv;\nin float v_opacity;\nout vec4 outputColor;\n\nfloat coast2water_fadedepth = 0.10;\nfloat large_waveheight = .750; // change to adjust the \"heavy\" waves\nfloat large_wavesize = 3.4; // factor to adjust the large wave size\nfloat small_waveheight = 0.6; // change to adjust the small random waves\nfloat small_wavesize = 0.5; // factor to ajust the small wave size\nfloat water_softlight_fact = 15.; // range [1..200] (should be << smaller than glossy-fact)\nfloat water_glossylight_fact= 120.; // range [1..200]\nfloat particle_amount = 70.;\n\nvec3 water_specularcolor = vec3(1.3, 1.3, 0.9); // specular Color (RGB) of the water-highlights\n#define light vec3(-0., sin(u_time*0.5)*.5 + .35, 2.8) // position of the sun\n\nuniform sampler2D u_texture1;\nuniform sampler2D u_texture2;\nuniform sampler2D u_texture3;\n\n \n\nfloat hash( float n ) {\n return fract(sin(n)*43758.5453123);\n}\n\n// 2d noise function\nfloat noise1( in vec2 x ) {\n vec2 p = floor(x);\n vec2 f = smoothstep(0.0, 1.0, fract(x));\n float n = p.x + p.y*57.0;\n return mix(mix( hash(n+ 0.0), hash(n+ 1.0),f.x),\n mix( hash(n+ 57.0), hash(n+ 58.0),f.x),f.y);\n}\n\nfloat noise(vec2 p) {\n return texture(SAMPLER_2D(u_texture2),p*vec2(1./256.)).x;\n}\n\nvec4 highness(vec2 p) {\n vec4 t = texture(SAMPLER_2D(u_texture1),fract(p));\n 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;\n 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);\n}\n\nfloat height_map( vec2 p ) {\n vec4 height=highness(p);\n /*\n height = -0.5+\n 0.5*smoothstep(-100.,0.,-height)+\n 2.75*smoothstep(0.,2.,height)+\n 1.75*smoothstep(2.,4.,height)+\n 2.75*smoothstep(4.,16.,height)+\n 1.5*smoothstep(16.,1000.,height);\n */\n\n mat2 m = mat2( 0.9563*1.4, -0.2924*1.4, 0.2924*1.4, 0.9563*1.4 );\n //p = p*6.;\n float f = 0.6000*noise1( p ); p = m*p*1.1*6.;\n f += 0.2500*noise( p ); p = m*p*1.32;\n f += 0.1666*noise( p ); p = m*p*1.11;\n f += 0.0834*noise( p ); p = m*p*1.12;\n f += 0.0634*noise( p ); p = m*p*1.13;\n f += 0.0444*noise( p ); p = m*p*1.14;\n f += 0.0274*noise( p ); p = m*p*1.15;\n f += 0.0134*noise( p ); p = m*p*1.16;\n f += 0.0104*noise( p ); p = m*p*1.17;\n f += 0.0084*noise( p );\n f = .25*f+dot(height,vec4(-.03125,-.125,.25,.25))*.5;\n const float FLAT_LEVEL = 0.92525;\n //f = f*0.25+height*0.75;\n if (f<FLAT_LEVEL)\n f = f;\n else\n f = pow((f-FLAT_LEVEL)/(1.-FLAT_LEVEL), 2.)*(1.-FLAT_LEVEL)*2.0+FLAT_LEVEL; // makes a smooth coast-increase\n return clamp(f, 0., 10.);\n}\n\nvec3 plasma_quintic( float x ) {\n x = clamp( x, 0.0, 1.0);\n vec4 x1 = vec4( 1.0, x, x * x, x * x * x ); // 1 x x2 x3\n vec4 x2 = x1 * x1.w * x; // x4 x5 x6 x7\n return vec3(\n dot( x1.xyzw, vec4( +0.063861086, +1.992659096, -1.023901152, -0.490832805 ) ) + dot( x2.xy, vec2( +1.308442123, -0.914547012 ) ),\n dot( x1.xyzw, vec4( +0.049718590, -0.791144343, +2.892305078, +0.811726816 ) ) + dot( x2.xy, vec2( -4.686502417, +2.717794514 ) ),\n dot( x1.xyzw, vec4( +0.513275779, +1.580255060, -5.164414457, +4.559573646 ) ) + dot( x2.xy, vec2( -1.916810682, +0.570638854 ) ) );\n}\n\nvec4 color(vec2 p){\n vec4 c1 = vec4(1.7,1.6,.9,1);\n vec4 c2 = vec4(.2,.94,.1,1);\n vec4 c3 = vec4(.3,.2,.0,1);\n vec4 c4 = vec4(.99,.99,1.6,1);\n vec4 v = highness(p);\n float los = smoothstep(0.1,1.1,v.b);\n float his = smoothstep(3.5,6.5,v.b);\n float ces = smoothstep(1.,5.,v.a);\n vec4 lo = mix(c1,c2,los);\n vec4 hi = mix(c3,c4,his);\n vec4 ce = mix(lo,hi,ces);\n\n return vec4(plasma_quintic(ces),1).ragb;\n}\n\nvec3 terrain_map( vec2 p )\n{\n 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'\n}\n\nconst mat2 m = mat2( 0.72, -1.60, 1.60, 0.72 );\n\nfloat water_map( vec2 p, float height ) {\n vec2 p2 = p*large_wavesize;\n vec2 shift1 = 0.001*vec2( u_time*160.0*2.0, u_time*120.0*2.0 );\n vec2 shift2 = 0.001*vec2( u_time*190.0*2.0, -u_time*130.0*2.0 );\n\n // coarse crossing 'ocean' waves...\n float f = 0.6000*noise( p );\n f += 0.2500*noise( p*m );\n f += 0.1666*noise( p*m*m );\n float wave = sin(p2.x*0.622+p2.y*0.622+shift2.x*4.269)*large_waveheight*f*height*height ;\n\n p *= small_wavesize;\n f = 0.;\n float amp = 1.0, s = .5;\n for (int i=0; i<9; i++)\n { p = m*p*.947; f -= amp*abs(sin((noise( p+shift1*s )-.5)*2.)); amp = amp*.59; s*=-1.329; }\n \n return wave+f*small_waveheight;\n}\n\nfloat nautic(vec2 p) {\n p *= 18.;\n float f = 0.;\n float amp = 1.0, s = .5;\n for (int i=0; i<3; i++)\n { p = m*p*1.2; f += amp*abs(smoothstep(0., 1., noise( p+u_time*s ))-.5); amp = amp*.5; s*=-1.227; }\n return pow(1.-f, 5.);\n}\n\nfloat particles(vec2 p) {\n p *= 200.;\n float f = 0.;\n float amp = 1.0, s = 1.5;\n for (int i=0; i<3; i++)\n { p = m*p*1.2; f += amp*noise( p+u_time*s ); amp = amp*.5; s*=-1.227; }\n return pow(f*.35, 7.)*particle_amount;\n}\n\nfloat test_shadow( vec2 xy, float height) {\n vec3 r0 = vec3(xy, height);\n vec3 rd = normalize( light - r0 );\n \n float hit = 1.0;\n float t = 0.001;\n for (int j=1; j<25; j++)\n {\n vec3 p = r0 + t*rd;\n float h = height_map( p.xy );\n float height_diff = p.z - h;\n if (height_diff<0.0)\n {\n return 0.0;\n }\n t += 0.01+height_diff*.02;\n hit = min(hit, 2.*height_diff/t); // soft shaddow \n }\n return hit;\n}\n\nvec3 CalcTerrain(vec2 uv, float height) {\n vec3 col = terrain_map( uv );\n vec2 iResolution = vec2(512.);\n float h1 = height_map(uv-vec2(0., 0.5)/ iResolution.xy);\n float h2 = height_map(uv+vec2(0., 0.5)/ iResolution.xy);\n float h3 = height_map(uv-vec2(0.5, 0.)/ iResolution.xy);\n float h4 = height_map(uv+vec2(0.5, 0.)/ iResolution.xy);\n vec3 norm = normalize(vec3(h3-h4, h1-h2, 1.));\n vec3 r0 = vec3(uv, height);\n vec3 rd = normalize( light - r0 );\n float grad = dot(norm, rd);\n col *= grad+pow(grad, 8.);\n float terrainshade = test_shadow( uv, height );\n col = mix(col*.25, col, terrainshade);\n return col;\n}\n\n\nvoid main() {\n vec3 watercolor = u_watercolor.rgb;\n vec3 watercolor2 = u_watercolor2.rgb;\n vec2 uv = v_uv;\n float WATER_LEVEL = 0.84; // Water level (range: 0.0 - 2.0)\n float deepwater_fadedepth = 0.4 + coast2water_fadedepth;\n float height = height_map( uv );\n vec3 col;\n\n float waveheight = clamp(WATER_LEVEL*3.-1.5, 0., 1.);\n float level = WATER_LEVEL + .2*water_map(uv*15. + vec2(u_time*.1), waveheight);\n if (height > level)\n {\n col = CalcTerrain(uv, height);\n }\n if (height <= level)\n {\n vec2 dif = vec2(.0, .01);\n vec2 pos = uv*15. + vec2(u_time*.01);\n float h1 = water_map(pos-dif,waveheight);\n float h2 = water_map(pos+dif,waveheight);\n float h3 = water_map(pos-dif.yx,waveheight);\n float h4 = water_map(pos+dif.yx,waveheight);\n vec3 normwater = normalize(vec3(h3-h4, h1-h2, .125)); // norm-vector of the 'bumpy' water-plane\n uv += normwater.xy*.002*(level-height);\n \n col = CalcTerrain(uv, height);\n\n float coastfade = clamp((level-height)/coast2water_fadedepth, 0., 1.);\n float coastfade2= clamp((level-height)/deepwater_fadedepth, 0., 1.);\n float intensity = col.r*.2126+col.g*.7152+col.b*.0722;\n watercolor = mix(watercolor*intensity, watercolor2, smoothstep(0., 1., coastfade2));\n\n vec3 r0 = vec3(uv, WATER_LEVEL);\n vec3 rd = normalize( light - r0 ); // ray-direction to the light from water-position\n float grad = dot(normwater, rd); // dot-product of norm-vector and light-direction\n float specular = pow(grad, water_softlight_fact); // used for soft highlights \n float specular2= pow(grad, water_glossylight_fact); // used for glossy highlights\n float gradpos = dot(vec3(0., 0., 1.), rd);\n float specular1= smoothstep(0., 1., pow(gradpos, 5.)); // used for diffusity (some darker corona around light's specular reflections...) \n float watershade = test_shadow( uv, level );\n watercolor *= 2.2+watershade;\n watercolor += (.2+.8*watershade) * ((grad-1.0)*.5+specular) * .25;\n watercolor /= (1.+specular1*1.25);\n watercolor += watershade*specular2*water_specularcolor;\n watercolor += watershade*coastfade*(1.-coastfade2)*(vec3(.5, .6, .7)*nautic(uv)+vec3(1., 1., 1.)*particles(uv));\n \n col = mix(col, watercolor, coastfade);\n }\n \n outputColor = vec4(col, v_opacity); \n}\n",defines:e.getDefines(),inject:e.getInject(),triangulation:yc,primitive:Ot.gl.TRIANGLES,depth:{enable:!1}})]}))()}clearModels(){var e,t,n;null===(e=this.texture1)||void 0===e||e.destroy(),null===(t=this.texture2)||void 0===t||t.destroy(),null===(n=this.texture3)||void 0===n||n.destroy()}registerBuiltinAttributes(){const e=this.layer.getSource().extent,[t,n,r,i]=e,o=r-t,a=i-n;this.styleAttributeService.registerStyleAttribute({name:"oceanUv",type:Ot.jQ.Attribute,descriptor:{name:"a_uv",shaderLocation:this.attributeLocation.UV,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:(e,r,i)=>{const[s,l]=i;return[(s-t)/o,(l-n)/a]}}})}loadTexture(){const{createTexture2D:e}=this.rendererService,t={height:0,width:0};function n(t){return e({data:t,width:t.width,height:t.height,wrapS:Ot.gl.MIRRORED_REPEAT,wrapT:Ot.gl.MIRRORED_REPEAT,min:Ot.gl.LINEAR,mag:Ot.gl.LINEAR})}this.texture1=e(t),this.texture2=e(t),this.texture3=e(t),function(e){let t=0;const n=[];["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"].map((r=>{const i=new Image;i.crossOrigin="",i.src=r,n.push(i),i.onload=()=>{t++,3===t&&e(n)}}))}((e=>{this.texture1=n(e[0]),this.texture2=n(e[1]),this.texture3=n(e[2]),this.layerService.reRender()}))}},extrusion:class extends kl{constructor(...e){super(...e),(0,kr.A)(this,"texture",void 0)}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,NORMAL:10,EXTRUSION_BASE:11})}getUninforms(){const e=this.getCommonUniformsInfo(),t=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Ur.A)((0,Ur.A)({},e.uniformsOption),t.uniformsOption)}getCommonUniformsInfo(){return this.getUniformsBufferInfo({})}initModels(){var e=this;return(0,Hr.A)((function*(){return e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){const{frag:t,vert:n,type:r}=e.getShaders();return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:r,vertexShader:n,fragmentShader:t,defines:e.getDefines(),inject:e.getInject(),triangulation:bc,depth:{enable:!0}})]}))()}getShaders(){return{frag:'\nin vec4 v_Color;\n#pragma include "scene_uniforms"\n#pragma include "picking"\nout vec4 outputColor;\nvoid main() {\n\n outputColor = v_Color;\n outputColor = filterColor(outputColor);\n}\n',vert:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_NORMAL) in vec3 a_Normal;\n\nout vec4 v_Color;\n\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\n\nvoid main() {\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size + (1.0 - a_Position.z) * extrusionBase, 1.0);\n\n vec4 project_pos = project_position(pos, a_Position64Low);\n float lightWeight = calc_lighting(project_pos);\n v_Color = a_Color;\n v_Color = vec4(v_Color.rgb * lightWeight, v_Color.w * opacity);\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n',type:"polygonExtrude"}}clearModels(){var e;null===(e=this.texture)||void 0===e||e.destroy()}registerBuiltinAttributes(){this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Ot.jQ.Attribute,descriptor:{name:"a_Normal",shaderLocation:this.attributeLocation.NORMAL,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:(e,t,n,r,i)=>i}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{size:t=10}=e;return Array.isArray(t)?[t[0]]:[t]}}}),this.styleAttributeService.registerStyleAttribute({name:"extrusionBase",type:Ot.jQ.Attribute,descriptor:{name:"a_ExtrusionBase",shaderLocation:this.attributeLocation.EXTRUSION_BASE,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{extrusionBase:t=0}=e;return[t]}}})}}};class lu extends Ml{constructor(...e){super(...e),(0,kr.A)(this,"type","PolygonLayer"),(0,kr.A)(this,"enableShaderEncodeStyles",["opacity","extrusionBase","rotation","offsets","stroke"])}buildModels(){var e=this;return(0,Hr.A)((function*(){const t=e.getModelType();e.layerModel=new su[t](e),yield e.initLayerModels()}))()}getModelType(){var e;const t=this.styleAttributeService.getLayerStyleAttribute("shape"),n=null==t||null===(e=t.scale)||void 0===e?void 0:e.field;return"fill"!==n&&n?"extrude"===n?"extrude":"extrusion"===n?"extrusion":"water"===n?"water":"ocean"===n?"ocean":"line"===n?"line":this.getPointModelType():"fill"}getPointModelType(){const e=this.getEncodedData(),{shape2d:t,shape3d:n}=this.getLayerConfig(),r=this.iconService.getIconMap(),i=e.find((e=>e.hasOwnProperty("shape")));if(i){const e=i.shape;return"dot"===e?"point_normal":-1!==(null==t?void 0:t.indexOf(e))?"point_fill":-1!==(null==n?void 0:n.indexOf(e))?"point_extrude":r.hasOwnProperty(e)?"point_image":"text"}return"fill"}}class cu{constructor({rendererService:e,layerService:t,parent:n}){(0,kr.A)(this,"tileResource",new Map),(0,kr.A)(this,"rendererService",void 0),(0,kr.A)(this,"layerService",void 0),(0,kr.A)(this,"parent",void 0),(0,kr.A)(this,"layerTiles",[]),this.rendererService=e,this.layerService=t,this.parent=n}get tiles(){return this.layerTiles}hasTile(e){return this.layerTiles.some((t=>t.key===e))}addTile(e){this.layerTiles.push(e)}getTile(e){return this.layerTiles.find((t=>t.key===e))}getVisibleTileBylngLat(e){return this.layerTiles.find((t=>t.isLoaded&&t.visible&&t.lnglatInBounds(e)))}removeTile(e){const t=this.layerTiles.findIndex((t=>t.key===e)),n=this.layerTiles.splice(t,1);n[0]&&n[0].destroy()}updateTileVisible(e){const t=this.getTile(e.key);if(e.isVisible)if(e.parent){const n=this.isChildrenLoaded(e.parent);null==t||t.updateVisible(n)}else null==t||t.updateVisible(!0);else if(e.parent){const n=this.isChildrenLoaded(e.parent);null==t||t.updateVisible(!n)}else null==t||t.updateVisible(!1)}isParentLoaded(e){const t=e.parent;if(!t)return!0;const n=this.getTile(null==t?void 0:t.key);return!(null==n||!n.isLoaded)}isChildrenLoaded(e){const t=null==e?void 0:e.children;return 0===t.length||t.every((e=>{const t=this.getTile(null==e?void 0:e.key);return!t||!0===(null==t?void 0:t.isLoaded)}))}render(){var e=this;return(0,Hr.A)((function*(){const t=e.getRenderLayers().map(function(){var t=(0,Hr.A)((function*(t){yield e.layerService.renderTileLayer(t)}));return function(e){return t.apply(this,arguments)}}());yield Promise.all(t)}))()}getRenderLayers(){const e=this.layerTiles.filter((e=>e.visible&&e.isLoaded)),t=[];return e.map((e=>t.push(...e.getLayers()))),t}getLayers(){const e=this.layerTiles.filter((e=>e.isLoaded)),t=[];return e.map((e=>t.push(...e.getLayers()))),t}getTiles(){return this.layerTiles}destroy(){this.layerTiles.forEach((e=>e.destroy())),this.tileResource.clear()}}var uu=n(2235);class hu{getCombineFeature(e){let t=null;const n=e[0];return e.map((e=>{const n=g.n1(e.coordinates);t=null===t?n:function(e,t,n){void 0===n&&(n={});var r=_(e),i=_(t),o=uu.union(r.coordinates,i.coordinates);return 0===o.length?null:1===o.length?(0,g.n1)(o[0],n.properties):(0,g.g5)(o,n.properties)}(t,n)})),n&&(t.properties=(0,Ur.A)({},n)),t}}const du="select",fu="active";class pu{constructor({layerService:e,tileLayerService:t,parent:n}){(0,kr.A)(this,"layerService",void 0),(0,kr.A)(this,"tileLayerService",void 0),(0,kr.A)(this,"tileSourceService",void 0),(0,kr.A)(this,"parent",void 0),(0,kr.A)(this,"tilePickID",new Map),this.layerService=e,this.tileLayerService=t,this.parent=n,this.tileSourceService=new hu}pickRender(e){const t=this.tileLayerService.getVisibleTileBylngLat(e.lngLat);if(t){const n=t.getMainLayer();null==n||n.layerPickService.pickRender(e)}}pick(e,t){var n=this;return(0,Hr.A)((function*(){const r=n.parent.getContainer().pickingService;if("RasterLayer"===e.type){const e=n.tileLayerService.getVisibleTileBylngLat(t.lngLat);if(e&&void 0!==e.getMainLayer()){const r=e.getMainLayer();return r.layerPickService.pickRasterLayer(r,t,n.parent)}return!1}return n.pickRender(t),r.pickFromPickingFBO(e,t)}))()}selectFeature(e){const[t,n,r]=e,i=this.color2PickId(t,n,r);this.tilePickID.set(du,i),this.updateHighLight(t,n,r,du)}highlightPickedFeature(e){const[t,n,r]=e,i=this.color2PickId(t,n,r);this.tilePickID.set(fu,i),this.updateHighLight(t,n,r,fu)}updateHighLight(e,t,n,r){this.tileLayerService.tiles.map((i=>{const o=i.getMainLayer();switch(r){case du:null==o||o.hooks.beforeSelect.call([e,t,n]);break;case fu:null==o||o.hooks.beforeHighlight.call([e,t,n])}}))}setPickState(){const e=this.tilePickID.get(du),t=this.tilePickID.get(fu);if(e){const[t,n,r]=this.pickId2Color(e);this.updateHighLight(t,n,r,du)}else if(t){const[e,n,r]=this.pickId2Color(t);this.updateHighLight(e,n,r,fu)}}color2PickId(e,t,n){return(0,y.dG)(new Uint8Array([e,t,n]))}pickId2Color(e){return(0,y.Z8)(e)}getFeatureById(e){const t=this.tileLayerService.getTiles().filter((e=>e.visible)),n=[];return t.forEach((t=>{n.push(...t.getFeatureById(e))})),n}pickRasterLayer(){return!1}}function gu(e){const t=e.coordinates;return{vertices:[...t],indices:[0],size:t.length}}const{isNumber:mu}=y.uG,_u={fillImage:class extends kl{constructor(...e){super(...e),(0,kr.A)(this,"meter2coord",1),(0,kr.A)(this,"texture",void 0),(0,kr.A)(this,"isMeter",!1),(0,kr.A)(this,"radian",0),(0,kr.A)(this,"updateTexture",(()=>{const{createTexture2D:e}=this.rendererService;if(this.texture)return this.texture.update({data:this.iconService.getCanvas(),mag:"linear",min:"linear mipmap nearest",mipmap:!0}),void this.layerService.throttleRenderLayers();this.texture=e({data:this.iconService.getCanvas(),mag:Ot.gl.LINEAR,min:Ot.gl.LINEAR_MIPMAP_LINEAR,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128,mipmap:!0}),this.textures=[this.texture]}))}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,EXTRUDE:10,UV:11})}getCommonUniformsInfo(){const{raisingHeight:e=0,heightfixed:t=!1,unit:n="pixel"}=this.layer.getLayerConfig();var r;this.rendererService.getDirty()&&(null===(r=this.texture)||void 0===r||r.bind());const i={u_textSize:[1024,this.iconService.canvasHeight||128],u_heightfixed:Number(t),u_raisingHeight:Number(e),u_size_unit:kc[n]};return this.getUniformsBufferInfo(i)}getAttribute(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),hc)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.iconService.on("imageUpdate",e.updateTexture),e.updateTexture(),e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointFillImage",vertexShader:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_EXTRUDE) in vec3 a_Extrude;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_Uv;\n\nlayout(std140) uniform commonUniform {\n vec2 u_textSize;\n float u_heightfixed;\n float u_raisingHeight;\n float u_size_unit;\n};\n\nout vec2 v_uv;\nout vec2 v_Iconuv;\nout float v_opacity;\n\n#pragma include "projection"\n#pragma include "picking"\n#pragma include "rotation_2d"\n\nvoid main() {\n vec3 extrude = a_Extrude;\n v_uv = (a_Extrude.xy + 1.0) / 2.0;\n v_uv.y = 1.0 - v_uv.y;\n v_Iconuv = a_Uv;\n v_opacity = opacity;\n float newSize = a_Size;\n if (u_size_unit == 1.0) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n\n // vec2 offset = (u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);\n vec2 offset = extrude.xy * newSize + offsets;\n\n offset = rotate_matrix(offset, rotation);\n\n offset = project_pixel(offset);\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0), a_Position64Low);\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'in vec2 v_uv;// 本身的 uv 坐标\nin vec2 v_Iconuv;\nin float v_opacity;\nout vec4 outputColor;\n\nuniform sampler2D u_texture;\nlayout(std140) uniform commonUniform {\n vec2 u_textSize;\n float u_heightfixed: 0.0;\n float u_raisingHeight: 0.0;\n float u_size_unit;\n};\n\n#pragma include "scene_uniforms"\n#pragma include "sdf_2d"\n#pragma include "picking"\n\nvoid main() {\n vec2 pos = v_Iconuv / u_textSize + v_uv / u_textSize * 64.;\n outputColor = texture(SAMPLER_2D(u_texture), pos);\n outputColor.a *= v_opacity;\n outputColor = filterColor(outputColor);\n}\n',triangulation:hc,depth:{enable:!1},defines:e.getDefines(),inject:e.getInject(),cull:{enable:!0,face:Ot.gl.FRONT}})]}))()}clearModels(){var e;this.iconService.off("imageUpdate",this.updateTexture),null===(e=this.texture)||void 0===e||e.destroy()}registerBuiltinAttributes(){this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Ot.jQ.Attribute,descriptor:{name:"a_Uv",shaderLocation:this.attributeLocation.UV,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:e=>{const t=this.iconService.getIconMap(),{shape:n}=e,{x:r,y:i}=t[n]||{x:-64,y:-64};return[r,i]}}}),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Ot.jQ.Attribute,descriptor:{name:"a_Extrude",shaderLocation:this.attributeLocation.EXTRUDE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:(e,t,n,r)=>{const i=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],o=r%4*3;return[i[o],i[o+1],i[o+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{size:t=5}=e;return Array.isArray(t)?[t[0]]:[t]}}})}},fill:Hc,radar:class extends kl{get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,EXTRUDE:10})}getCommonUniformsInfo(){const{blend:e,speed:t=1,unit:n="pixel"}=this.layer.getLayerConfig(),r={u_additive:"additive"===e?1:0,u_size_unit:kc[n],u_speed:t,u_time:this.layer.getLayerAnimateTime()};return this.getUniformsBufferInfo(r)}getAnimateUniforms(){return{}}getAttribute(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),hc)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointRadar",vertexShader:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_EXTRUDE) in vec3 a_Extrude;\n\nlayout(std140) uniform commonUniorm {\n float u_additive;\n float u_size_unit;\n float u_speed: 1.0;\n float u_time;\n};\n\nout vec4 v_data;\nout vec4 v_color;\nout float v_radius;\nout vec2 v_extrude;\n\n#pragma include "projection"\n#pragma include "picking"\n\nvoid main() {\n float newSize = setPickingSize(a_Size);\n\n float time = u_time * u_speed;\n mat2 rotateMatrix = mat2(\n cos(time), sin(time),\n -sin(time), cos(time)\n );\n v_extrude = rotateMatrix * a_Extrude.xy;\n\n v_color = a_Color;\n v_color.a *= opacity;\n\n float blur = 0.0;\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);\n\n if(u_size_unit == 1.) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n v_radius = newSize;\n\n vec2 offset = (a_Extrude.xy * (newSize));\n\n offset = project_pixel(offset);\n\n v_data = vec4(a_Extrude.x, a_Extrude.y, antialiasblur, -1.0);\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0), a_Position64Low);\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'\nlayout(std140) uniform commonUniorm{\n float u_additive;\n float u_size_unit;\n float u_speed: 1.0;\n float u_time;\n};\nin vec4 v_data;\nin vec4 v_color;\nin float v_radius;\nin vec2 v_extrude;\n#pragma include "sdf_2d"\n#pragma include "picking"\n\nout vec4 outputColor;\n\nvoid main() {\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df = sdCircle(v_data.xy, 1.0);\n float inner_df = sdCircle(v_data.xy, r);\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n outputColor = vec4(v_color.rgb, v_color.a);\n\n if(u_additive > 0.0) {\n outputColor *= opacity_t;\n } else {\n outputColor.a *= opacity_t;\n }\n\n if(outputColor.a > 0.0) {\n outputColor = filterColor(outputColor);\n }\n\n vec2 extrude = v_extrude;\n vec2 dir = normalize(extrude);\n vec2 baseDir = vec2(1.0, 0.0);\n float pi = 3.14159265359;\n float flag = sign(dir.y);\n float rades = dot(dir, baseDir);\n float radar_v = (flag - 1.0) * -0.5 * acos(rades)/pi;\n // simple AA\n if(radar_v > 0.99) {\n radar_v = 1.0 - (radar_v - 0.99)/0.01;\n }\n\n outputColor.a *= radar_v;\n}\n',triangulation:hc,defines:e.getDefines(),inject:e.getInject(),depth:{enable:!1}})]}))()}animateOption2Array(e){return[e.enable?0:1,e.speed||1,e.rings||3,0]}registerBuiltinAttributes(){this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Ot.jQ.Attribute,descriptor:{name:"a_Extrude",shaderLocation:this.attributeLocation.EXTRUDE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:(e,t,n,r)=>{const i=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],o=r%4*3;return[i[o],i[o+1],i[o+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{shaderLocation:this.attributeLocation.SIZE,name:"a_Size",buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{size:t=5}=e;return Array.isArray(t)?[t[0]]:[t]}}})}},image:Wc,normal:Zc,simplePoint:class extends kl{get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9})}getDefaultStyle(){return{blend:"additive"}}getCommonUniformsInfo(){const{blend:e,strokeOpacity:t=1,strokeWidth:n=0,stroke:r="#fff"}=this.layer.getLayerConfig(),i={u_stroke_color:(0,y.HR)(r),u_additive:"additive"===e?1:0,u_stroke_opacity:t,u_stroke_width:n};return this.getUniformsBufferInfo(i)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){return e.layer.triangulation=gu,e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointSimple",vertexShader:'\nlayout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\n\nlayout(std140) uniform commonUniorm {\n vec4 u_stroke_color;\n float u_additive;\n float u_stroke_opacity;\n float u_stroke_width;\n};\n\nout vec4 v_color;\nout float v_blur;\nout float v_innerRadius;\n\n#pragma include "projection"\n#pragma include "picking"\n#pragma include "project"\nvoid main() {\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n v_blur = 1.0 - max(2.0 / a_Size, 0.05);\n v_innerRadius = max((a_Size - u_stroke_width) / a_Size, 0.0);\n\n vec2 offset = project_pixel(u_offsets);\n\n vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);\n gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));\n\n gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'\nlayout(std140) uniform commonUniorm {\n vec4 u_stroke_color;\n float u_additive;\n float u_stroke_opacity;\n float u_stroke_width;\n};\n\nin vec4 v_color;\nin float v_blur;\nin float v_innerRadius;\n\nout vec4 outputColor;\n\n#pragma include "picking"\nvoid main() {\n vec2 center = vec2(0.5);\n\n // Tip: 片元到中心点的距离 0 - 1\n float fragmengTocenter = distance(center, gl_PointCoord) * 2.0;\n // Tip: 片元的剪切成圆形\n float circleClipOpacity = 1.0 - smoothstep(v_blur, 1.0, fragmengTocenter);\n\n\n if(v_innerRadius < 0.99) {\n // 当存在 stroke 且 stroke > 0.01\n float blurWidth = (1.0 - v_blur)/2.0;\n vec4 stroke = vec4(u_stroke_color.rgb, u_stroke_opacity);\n if(fragmengTocenter > v_innerRadius + blurWidth) {\n outputColor = stroke;\n } else if(fragmengTocenter > v_innerRadius - blurWidth){\n float mixR = (fragmengTocenter - (v_innerRadius - blurWidth)) / (blurWidth * 2.0);\n outputColor = mix(v_color, stroke, mixR);\n } else {\n outputColor = v_color;\n }\n } else {\n // 当不存在 stroke 或 stroke <= 0.01\n outputColor = v_color;\n }\n\n outputColor = filterColor(outputColor);\n \n if(u_additive > 0.0) {\n outputColor *= circleClipOpacity;\n } else {\n outputColor.a *= circleClipOpacity;\n }\n\n}\n',defines:e.getDefines(),inject:e.getInject(),triangulation:gu,depth:{enable:!1},primitive:Ot.gl.POINTS})]}))()}registerBuiltinAttributes(){this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{size:t=1}=e;return Array.isArray(t)?[t[0]]:[t]}}})}},extrude:Vc,text:ou,earthFill:class extends kl{get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,SHAPE:10,EXTRUDE:11})}getCommonUniformsInfo(){const{strokeOpacity:e=1,strokeWidth:t=0,blend:n,blur:r=0}=this.layer.getLayerConfig();this.layer.getLayerConfig();const i={u_additive:"additive"===n?1:0,u_stroke_opacity:e,u_stroke_width:t,u_blur:r};return this.getUniformsBufferInfo(i)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.initUniformsBuffer(),e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){return e.layer.triangulation=dc,[yield e.layer.buildLayerModel({moduleName:"pointEarthFill",vertexShader:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_SHAPE) in float a_Shape;\nlayout(location = ATTRIBUTE_LOCATION_EXTRUDE) in vec3 a_Extrude;\n\nlayout(std140) uniform commonUniform {\n float u_additive;\n float u_stroke_opacity : 1;\n float u_stroke_width : 2;\n float u_blur : 0.0;\n};\nout vec4 v_data;\nout vec4 v_color;\nout float v_radius;\n\n#pragma include "projection"\n#pragma include "picking"\n\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n /*\n * setPickingSize 设置拾取大小\n */\n float newSize = setPickingSize(a_Size);\n // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;\n\n // unpack color(vec2)\n v_color = a_Color;\n\n // radius(16-bit)\n v_radius = newSize;\n\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur);\n\n // TODP: /abs(extrude.x) 是为了兼容地球模式\n v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);\n\n gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1 + vec3(u_offsets,0.0), 1.0);\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:"in vec4 v_data;\nin vec4 v_color;\nin float v_radius;\n\nlayout(std140) uniform commonUniform {\n float u_additive;\n float u_stroke_opacity : 1;\n float u_stroke_width : 2;\n float u_blur : 0.0;\n};\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nout vec4 outputColor;\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n\n vec4 strokeColor = u_stroke == vec4(0.0) ? v_color : u_stroke;\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius + u_stroke_width);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n } else if (shape == 1) {\n outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n } else if (shape == 2) {\n outer_df = sdBox(v_data.xy, vec2(1.));\n inner_df = sdBox(v_data.xy, vec2(r));\n } else if (shape == 3) {\n outer_df = sdPentagon(v_data.xy, 0.8);\n inner_df = sdPentagon(v_data.xy, r * 0.8);\n } else if (shape == 4) {\n outer_df = sdHexagon(v_data.xy, 0.8);\n inner_df = sdHexagon(v_data.xy, r * 0.8);\n } else if (shape == 5) {\n outer_df = sdOctogon(v_data.xy, 1.0);\n inner_df = sdOctogon(v_data.xy, r);\n } else if (shape == 6) {\n outer_df = sdHexagram(v_data.xy, 0.52);\n inner_df = sdHexagram(v_data.xy, r * 0.52);\n } else if (shape == 7) {\n outer_df = sdRhombus(v_data.xy, vec2(1.0));\n inner_df = sdRhombus(v_data.xy, vec2(r));\n } else if (shape == 8) {\n outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n }\n\n if(outer_df > antialiasblur + 0.018) discard;\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n\n if(u_stroke_width < 0.01) {\n outputColor = vec4(v_color.rgb, v_color.a * u_opacity);\n } else {\n outputColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);\n }\n\n if(u_additive > 0.0) {\n outputColor *= opacity_t;\n outputColor = filterColorAlpha(outputColor, outputColor.a);\n } else {\n outputColor.a *= opacity_t;\n outputColor = filterColor(outputColor);\n }\n}\n",triangulation:dc,defines:e.getDefines(),inject:e.getInject(),depth:{enable:!0},blend:e.getBlend()})]}))()}animateOption2Array(e){return[e.enable?0:1,e.speed||1,e.rings||3,0]}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Ot.jQ.Attribute,descriptor:{name:"a_Extrude",shaderLocation:this.attributeLocation.EXTRUDE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:(e,t,n,r)=>{const[i,o,a]=n,s=sc.fA(0,0,1),l=sc.fA(i,0,a),c=i>=0?sc.g7(s,l):2*Math.PI-sc.g7(s,l),u=2*Math.PI-Math.asin(o/100),h=qc.vt();qc.Z8(h,h,c),qc.eL(h,h,u);const d=sc.fA(1,1,0);sc.Z0(d,d,h),sc.S8(d,d);const f=sc.fA(-1,1,0);sc.Z0(f,f,h),sc.S8(f,f);const p=sc.fA(-1,-1,0);sc.Z0(p,p,h),sc.S8(p,p);const g=sc.fA(1,-1,0);sc.Z0(g,g,h),sc.S8(g,g);const m=[...d,...f,...p,...g],_=r%4*3;return[m[_],m[_+1],m[_+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{size:t=5}=e;return Array.isArray(t)?[t[0]]:[t]}}}),this.styleAttributeService.registerStyleAttribute({name:"shape",type:Ot.jQ.Attribute,descriptor:{name:"a_Shape",shaderLocation:this.attributeLocation.SHAPE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:1,update:e=>{const{shape:t=2}=e;return[this.layer.getLayerConfig().shape2d.indexOf(t)]}}})}},earthExtrude:class extends kl{constructor(...e){super(...e),(0,kr.A)(this,"raiseCount",0),(0,kr.A)(this,"raiseRepeat",0)}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,SIZE:9,POS:10,NORMAL:11})}getCommonUniformsInfo(){const{animateOption:e={enable:!1,speed:.01,repeat:!1},opacity:t=1,sourceColor:n,targetColor:r,pickLight:i=!1,heightfixed:o=!0,opacityLinear:a={enable:!1,dir:"up"},lightEnable:s=!0}=this.layer.getLayerConfig();let l=0,c=[0,0,0,0],u=[0,0,0,0];if(n&&r&&(c=(0,y.HR)(n),u=(0,y.HR)(r),l=1),this.raiseCount<1&&this.raiseRepeat>0&&e.enable){const{speed:t=.01}=e;this.raiseCount+=t,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}const h={u_sourceColor:c,u_targetColor:u,u_linearColor:l,u_pickLight:Number(i),u_heightfixed:Number(o),u_r:e.enable&&this.raiseRepeat>0?this.raiseCount:1,u_opacity:mu(t)?t:1,u_opacitylinear:Number(a.enable),u_opacitylinear_dir:"up"===a.dir?1:0,u_lightEnable:Number(s)};return this.getUniformsBufferInfo(h)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.initUniformsBuffer(),e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){const{animateOption:{repeat:t=1}}=e.layer.getLayerConfig();return e.raiseRepeat=t,[yield e.layer.buildLayerModel({moduleName:"pointEarthExtrude",vertexShader:'precision highp float;\n\n#define pi 3.1415926535\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nlayout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in vec3 a_Size;\nlayout(location = ATTRIBUTE_LOCATION_POS) in vec3 a_Pos;\nlayout(location = ATTRIBUTE_LOCATION_NORMAL) in vec3 a_Normal;\n\nlayout(std140) uniform commonUniform {\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_linearColor: 0;\n float u_heightfixed: 0.0; // 默认不固定\n float u_globel;\n float u_r;\n float u_pickLight: 0.0;\n float u_opacitylinear: 0.0;\n float u_opacitylinear_dir: 1.0;\n float u_lightEnable: 1.0;\n};\n\nout vec4 v_color;\nout float v_lightWeight;\nout float v_barLinearZ;\n// 用于将在顶点着色器中计算好的样式值传递给片元\n\n\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\n\nfloat getYRadian(float x, float z) {\n if(x > 0.0 && z > 0.0) {\n return atan(x/z);\n } else if(x > 0.0 && z <= 0.0){\n return atan(-z/x) + pi/2.0;\n } else if(x <= 0.0 && z <= 0.0) {\n return pi + atan(x/z); //atan(x/z) +\n } else {\n return atan(z/-x) + pi*3.0/2.0;\n }\n}\n\nfloat getXRadian(float y, float r) {\n return atan(y/r);\n}\n\nvoid main() {\n\n // cal style mapping - 数据纹理映射部分的计算\n vec3 size = a_Size * a_Position;\n\n // a_Position.z 是在构建网格的时候传入的标准值 0 - 1,在插值器插值可以获取 0~1 线性渐变的值\n v_barLinearZ = a_Position.z;\n\n vec3 offset = size; // 控制圆柱体的大小 - 从标准单位圆柱体进行偏移\n if(u_heightfixed < 1.0) { // 圆柱体不固定高度\n //\n } else {// 圆柱体固定高度 ( 处理 mapbox )\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n offset *= 4.0/pow(2.0, 21.0 - u_Zoom);\n }\n }\n\n\n vec4 project_pos = project_position(vec4(a_Pos.xy, 0., 1.0));\n\n // u_r 控制圆柱的生长\n vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);\n\n // 圆柱光照效果\n float lightWeight = 1.0;\n if(u_lightEnable > 0.0) { // 取消三元表达式,增强健壮性\n lightWeight = calc_lighting(pos);\n }\n v_lightWeight = lightWeight;\n // 设置圆柱的底色\n if(u_linearColor == 1.0) { // 使用渐变颜色\n v_color = mix(u_sourceColor, u_targetColor, v_barLinearZ);\n v_color.rgb *= lightWeight;\n } else { // 使用 color 方法传入的颜色\n v_color = a_Color;\n }\n v_color.a *= u_opacity;\n\n\n // 在地球模式下,将原本垂直于 xy 平面的圆柱调整姿态到适应圆的角度\n //旋转矩阵mx,创建绕x轴旋转矩阵\n float r = sqrt(a_Pos.z*a_Pos.z + a_Pos.x*a_Pos.x);\n float xRadian = getXRadian(a_Pos.y, r);\n float xcos = cos(xRadian);//求解旋转角度余弦值\n float xsin = sin(xRadian);//求解旋转角度正弦值\n mat4 mx = mat4(\n 1,0,0,0,\n 0,xcos,-xsin,0,\n 0,xsin,xcos,0,\n 0,0,0,1);\n\n //旋转矩阵my,创建绕y轴旋转矩阵\n float yRadian = getYRadian(a_Pos.x, a_Pos.z);\n float ycos = cos(yRadian);//求解旋转角度余弦值\n float ysin = sin(yRadian);//求解旋转角度正弦值\n mat4 my = mat4(\n ycos,0,-ysin,0,\n 0,1,0,0,\n ysin,0,ycos,0,\n 0,0,0,1);\n\n gl_Position = u_ViewProjectionMatrix * vec4(( my * mx * vec4(a_Position * a_Size, 1.0)).xyz + a_Pos, 1.0);\n\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'precision highp float;\nin vec4 v_color;\n\n#pragma include "picking"\n\nlayout(std140) uniform commonUniform {\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_linearColor: 0;\n float u_heightfixed: 0.0; // 默认不固定\n float u_globel;\n float u_r;\n float u_pickLight: 0.0;\n float u_opacitylinear: 0.0;\n float u_opacitylinear_dir: 1.0;\n float u_lightEnable: 1.0;\n};\nin float v_lightWeight;\nin float v_barLinearZ;\nout vec4 outputColor;\nvoid main() {\n\n outputColor = v_color;\n\n // 开启透明度渐变\n if(u_opacitylinear > 0.0) {\n outputColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - v_barLinearZ): v_barLinearZ;\n }\n\n // picking\n if(u_pickLight > 0.0) {\n outputColor = filterColorAlpha(outputColor, v_lightWeight);\n } else {\n outputColor = filterColor(outputColor);\n }\n}\n',triangulation:fc,depth:{enable:!0},defines:e.getDefines(),inject:e.getInject(),cull:{enable:!0,face:Ot.gl.FRONT},blend:e.getBlend()})]}))()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Ot.jQ.Attribute,descriptor:{name:"a_Size",shaderLocation:this.attributeLocation.SIZE,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:e=>{const{size:t}=e;if(t){let e=[];return Array.isArray(t)&&(e=2===t.length?[t[0],t[0],t[1]]:t),Array.isArray(t)||(e=[t,t,t]),e}return[2,2,2]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Ot.jQ.Attribute,descriptor:{name:"a_Normal",shaderLocation:this.attributeLocation.NORMAL,buffer:{usage:Ot.gl.STATIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:(e,t,n,r,i)=>i}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:Ot.jQ.Attribute,descriptor:{name:"a_Pos",shaderLocation:this.attributeLocation.POS,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:3,update:e=>{const t=(0,y.fi)(e.coordinates);return zl([t[0],t[1]])}}})}}},vu=_u;class yu extends Ml{constructor(...e){super(...e),(0,kr.A)(this,"type","PointLayer"),(0,kr.A)(this,"enableShaderEncodeStyles",["stroke","offsets","opacity","rotation"]),(0,kr.A)(this,"enableDataEncodeStyles",["textOffset","textAnchor"]),(0,kr.A)(this,"defaultSourceConfig",{data:[],options:{parser:{type:"json",x:"lng",y:"lat"}}})}buildModels(){var e=this;return(0,Hr.A)((function*(){const t=e.getModelType();e.layerModel&&e.layerModel.clearModels(),e.layerModel=new vu[t](e),yield e.initLayerModels()}))()}rebuildModels(){var e=this;return(0,Hr.A)((function*(){yield e.buildModels()}))()}getModelTypeWillEmptyData(){if(this.shapeOption){const{field:e,values:t}=this.shapeOption,{shape2d:n}=this.getLayerConfig(),r=this.iconService.getIconMap();if(e&&-1!==(null==n?void 0:n.indexOf(e)))return"fill";if("text"===t)return"text";if(t&&t instanceof Array)for(const e of t)if("string"==typeof e&&r.hasOwnProperty(e))return"image"}return"normal"}getDefaultConfig(){return{fillImage:{},normal:{blend:"additive"},radar:{},simplePoint:{},fill:{blend:"normal"},extrude:{},image:{},text:{blend:"normal"},tile:{},tileText:{},earthFill:{},earthExtrude:{}}[this.getModelType()]}getModelType(){const e=this.getEncodedData(),{shape2d:t,shape3d:n,billboard:r=!0}=this.getLayerConfig(),i=this.iconService.getIconMap(),o=e.find((e=>e.hasOwnProperty("shape")));if(o){const e=o.shape;return"dot"===e?"normal":"simple"===e?"simplePoint":"radar"===e?"radar":"fillImage"===this.layerType||!1===r?"fillImage":-1!==(null==t?void 0:t.indexOf(e))?"GLOBEL"===this.mapService.version?"earthFill":"fill":-1!==(null==n?void 0:n.indexOf(e))?"GLOBEL"===this.mapService.version?"earthExtrude":"extrude":i.hasOwnProperty(e)?"image":"text"}return this.getModelTypeWillEmptyData()}}class Eu extends Zn.EventEmitter{constructor(e,t){super(),(0,kr.A)(this,"x",void 0),(0,kr.A)(this,"y",void 0),(0,kr.A)(this,"z",void 0),(0,kr.A)(this,"key",void 0),(0,kr.A)(this,"parent",void 0),(0,kr.A)(this,"sourceTile",void 0),(0,kr.A)(this,"visible",!0),(0,kr.A)(this,"layers",[]),(0,kr.A)(this,"isLoaded",!1),(0,kr.A)(this,"tileMaskLayers",[]),(0,kr.A)(this,"tileMask",void 0),this.parent=t,this.sourceTile=e,this.x=e.x,this.y=e.y,this.z=e.z,this.key=`${this.x}_${this.y}_${this.z}`}getLayers(){return this.layers}styleUpdate(...e){}lnglatInBounds(e){const[t,n,r,i]=this.sourceTile.bounds,{lng:o,lat:a}=e;return o>=t&&o<=r&&a>=n&&a<=i}getLayerOptions(){var e;const t=this.parent.getLayerConfig();return(0,Ur.A)((0,Ur.A)({},t),{},{textAllowOverlap:!0,autoFit:!1,maskLayers:this.getMaskLayer(),tileMask:(n=this.parent.type,-1!==["PolygonLayer","LineLayer"].indexOf(n)),mask:t.mask||0!==(null===(e=t.maskLayers)||void 0===e?void 0:e.length)&&t.enableMask});var n}getMaskLayer(){const{maskLayers:e}=this.parent.getLayerConfig(),t=[];return null==e||e.forEach((e=>{if(!e.tileLayer)return t.push(e),e;const n=e.tileLayer.getTile(this.sourceTile.key),r=null==n?void 0:n.getLayers()[0];r&&t.push(r)})),t}addTileMask(){var e=this;return(0,Hr.A)((function*(){const t=new lu({name:"mask",visible:!0,enablePicking:!1}).source({type:"FeatureCollection",features:[e.sourceTile.bboxPolygon]},{parser:{type:"geojson",featureId:"id"}}).shape("fill").color("#0f0").style({opacity:.5}),n=(0,Ot.T3)(e.parent.container);t.setContainer(n),yield t.init(),e.tileMask=t;const r=e.getMainLayer();return void 0!==r&&(r.tileMask=t),t}))()}addMask(e,t){var n=this;return(0,Hr.A)((function*(){const r=(0,Ot.T3)(n.parent.container);t.setContainer(r),yield t.init(),e.addMask(t),n.tileMaskLayers.push(t)}))()}addLayer(e){var t=this;return(0,Hr.A)((function*(){e.isTileLayer=!0;const n=(0,Ot.T3)(t.parent.container);e.setContainer(n),t.layers.push(e),yield e.init()}))()}updateVisible(e){this.visible=e,this.updateOptions("visible",e)}updateOptions(e,t){this.layers.forEach((n=>{n.updateLayerConfig({[e]:t})}))}getMainLayer(){return this.layers[0]}getFeatures(e){return[]}getFeatureById(e){return[]}destroy(){var e;null===(e=this.tileMask)||void 0===e||e.destroy(),this.layers.forEach((e=>e.destroy()))}}class Au extends Eu{initTileLayer(){var e=this;return(0,Hr.A)((function*(){const t=e.getSourceOption(),n=t.data.features[0].properties,r=(new jc).source(t.data,t.options).size(1).shape("line").color("red"),i=new yu({minZoom:e.z-1,maxZoom:e.z+1,textAllowOverlap:!0}).source([n],{parser:{type:"json",x:"x",y:"y"}}).size(20).color("red").shape(e.key).style({stroke:"#fff",strokeWidth:2});yield e.addLayer(r),yield e.addLayer(i),e.isLoaded=!0}))()}getSourceOption(){const e=this.parent.getSource();return{data:{type:"FeatureCollection",features:this.sourceTile.data.layers.testTile.features},options:{parser:{type:"geojson"},transforms:e.transforms}}}}class bu extends Eu{initTileLayer(){var e=this;return(0,Hr.A)((function*(){const t=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),r=e.getSourceOption(),i=new Cc((0,Ur.A)({},n)).source(r.data,r.options);t&&Object.keys(t).forEach((e=>{var n,r;const o=e;i[o](null===(n=t[o])||void 0===n?void 0:n.field,null===(r=t[o])||void 0===r?void 0:r.values)})),yield e.addLayer(i),e.isLoaded=!0}))()}getSourceOption(){const e=this.parent.getSource();return{data:this.sourceTile.data,options:{parser:{type:"image",extent:this.sourceTile.bounds},transforms:e.transforms}}}}const Tu={fill:class extends kl{getUninforms(){const e=this.getCommonUniformsInfo(),t=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Ur.A)((0,Ur.A)({},e.uniformsOption),t.uniformsOption)}getCommonUniformsInfo(){const{opacity:e=1,color:t="#000"}=this.layer.getLayerConfig(),n={u_color:(0,y.HR)(t),u_opacity:e||1};return this.getUniformsBufferInfo(n)}initModels(){var e=this;return(0,Hr.A)((function*(){return e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"mask",vertexShader:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\n\nlayout(std140) uniform commonUniorm {\n vec4 u_color;\n float u_opacity;\n};\n\n#pragma include "projection"\n\nvoid main() {\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n}\n\n',fragmentShader:"layout(std140) uniform commonUniorm {\n vec4 u_color;\n float u_opacity;\n};\n\nout vec4 outputColor;\n\nvoid main() {\n outputColor = u_color;\n outputColor.a *= u_opacity;\n}\n",defines:e.getDefines(),triangulation:yc,depth:{enable:!1},pick:!1})]}))()}clearModels(e=!0){e&&this.layerService.clear()}registerBuiltinAttributes(){return""}}};class xu extends Ml{constructor(...e){super(...e),(0,kr.A)(this,"type","MaskLayer")}buildModels(){var e=this;return(0,Hr.A)((function*(){const t=e.getModelType();e.layerModel=new Tu[t](e),yield e.initLayerModels()}))()}getModelType(){return"fill"}}class Su extends Eu{initTileLayer(){var e=this;return(0,Hr.A)((function*(){const t=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),r=e.getSourceOption(),i=new xu((0,Ur.A)({},n)).source(r.data,r.options);t&&Object.keys(t).forEach((e=>{var n,r;const o=e;i[o](null===(n=t[o])||void 0===n?void 0:n.field,null===(r=t[o])||void 0===r?void 0:r.values)})),yield e.addLayer(i),e.isLoaded=!0}))()}getFeatures(e){return e?this.sourceTile.data.getTileData(e):[]}getSourceOption(){const e=this.parent.getSource(),{sourceLayer:t,featureId:n}=this.parent.getLayerConfig();return{data:{type:"FeatureCollection",features:this.getFeatures(t)},options:{parser:{type:"geojson",featureId:n},transforms:e.transforms}}}}class Ru extends kl{constructor(...e){super(...e),(0,kr.A)(this,"texture",void 0),(0,kr.A)(this,"colorTexture",void 0)}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,UV:9})}getUninforms(){const e=this.getCommonUniformsInfo(),t=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Ur.A)((0,Ur.A)({},e.uniformsOption),t.uniformsOption)}getCommonUniformsInfo(){const{opacity:e=1,clampLow:t=!0,clampHigh:n=!0,noDataValue:r=-9999999,domain:i,rampColors:o}=this.layer.getLayerConfig(),a=i||(0,y.Er)(o);this.colorTexture=this.layer.textureService.getColorTexture(o,a);const s={u_domain:a,u_opacity:e||1,u_noDataValue:r,u_clampLow:t?1:0,u_clampHigh:(void 0!==n?n:t)?1:0,u_rasterTexture:this.texture,u_colorTexture:this.colorTexture};return this.textures=[this.texture,this.colorTexture],this.getUniformsBufferInfo(s)}getRasterData(e){return(0,Hr.A)((function*(){if(Array.isArray(e.data))return{data:e.data,width:e.width,height:e.height};{const{rasterData:t,width:n,height:r}=yield e.data;return{data:Array.from(t),width:n,height:r}}}))()}initModels(){var e=this;return(0,Hr.A)((function*(){return e.buildModels()}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){e.initUniformsBuffer();const t=e.layer.getSource(),{createTexture2D:n,queryVerdorInfo:r}=e.rendererService,i=t.data.dataArray[0],{data:o,width:a,height:s}=yield e.getRasterData(i);return e.texture=n({data:new Float32Array(o),width:a,height:s,format:"WebGL1"===r()?Ot.gl.LUMINANCE:Ot.gl.RED,type:Ot.gl.FLOAT,alignment:1}),[yield e.layer.buildLayerModel({moduleName:"rasterImageData",vertexShader:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_Uv;\n\nlayout(std140) uniform commonUniforms {\n vec2 u_domain;\n float u_opacity;\n float u_noDataValue;\n float u_clampLow;\n float u_clampHigh;\n};\n\nout vec2 v_texCoord;\n\n#pragma include "projection"\n\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0.0, 1.0));\n}\n',fragmentShader:"layout(std140) uniform commonUniforms {\n vec2 u_domain;\n float u_opacity;\n float u_noDataValue;\n float u_clampLow;\n float u_clampHigh;\n};\n\nuniform sampler2D u_rasterTexture;\nuniform sampler2D u_colorTexture;\n\nin vec2 v_texCoord;\n\nbool isnan_emu(float x) { return (x > 0.0 || x < 0.0) ? x != x : x != 0.0; }\n\nout vec4 outputColor;\n\nvoid main() {\n // Can use any component here since u_rasterTexture is under luminance format.\n float value = texture(SAMPLER_2D(u_rasterTexture), vec2(v_texCoord.x, v_texCoord.y)).r;\n if (value == u_noDataValue || isnan_emu(value)) {\n discard;\n } else if ((u_clampLow < 0.5 && value < u_domain[0]) || (u_clampHigh < 0.5 && value > u_domain[1])) {\n discard;\n } else {\n float normalisedValue =(value - u_domain[0]) / (u_domain[1] - u_domain[0]);\n vec4 color = texture(SAMPLER_2D(u_colorTexture), vec2(normalisedValue, 0));\n \n outputColor = color;\n outputColor.a = outputColor.a * u_opacity ;\n if (outputColor.a < 0.01)\n discard;\n }\n}\n",defines:e.getDefines(),triangulation:Tc,primitive:Ot.gl.TRIANGLES,depth:{enable:!1},pickingEnabled:!1})]}))()}clearModels(){var e,t;null===(e=this.texture)||void 0===e||e.destroy(),null===(t=this.colorTexture)||void 0===t||t.destroy()}registerBuiltinAttributes(){this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Ot.jQ.Attribute,descriptor:{shaderLocation:this.attributeLocation.UV,name:"a_Uv",buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:(e,t,n)=>[n[3],n[4]]}})}}const Cu=["data"],Lu=["rasterData"],Ou={raster:Ru,rasterRgb:class extends kl{constructor(...e){super(...e),(0,kr.A)(this,"texture",void 0),(0,kr.A)(this,"dataOption",{})}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,UV:9})}getUninforms(){const e=this.getCommonUniformsInfo(),t=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Ur.A)((0,Ur.A)({},e.uniformsOption),t.uniformsOption)}getCommonUniformsInfo(){const{opacity:e=1,noDataValue:t=0}=this.layer.getLayerConfig(),{rMinMax:n=[0,255],gMinMax:r=[0,255],bMinMax:i=[0,255]}=this.dataOption,o={u_rminmax:n,u_gminmax:r,u_bminmax:i,u_opacity:e||1,u_noDataValue:t,u_texture:this.texture};return this.textures=[this.texture],this.getUniformsBufferInfo(o)}getRasterData(e){var t=this;return(0,Hr.A)((function*(){if(Array.isArray(e.data)){const{data:n}=e,r=(0,Kr.A)(e,Cu);return t.dataOption=r,(0,Ur.A)({data:n},r)}const n=yield e.data,{rasterData:r}=n,i=(0,Kr.A)(n,Lu);return t.dataOption=i,Array.isArray(r)?(0,Ur.A)({data:r},i):(0,Ur.A)({data:Array.from(r)},i)}))()}initModels(){var e=this;return(0,Hr.A)((function*(){e.initUniformsBuffer();const t=e.layer.getSource(),{createTexture2D:n}=e.rendererService,r=t.data.dataArray[0],{data:i,width:o,height:a}=yield e.getRasterData(r);return e.texture=n({data:new Float32Array(i),width:o,height:a,format:Ot.gl.RGB,type:Ot.gl.FLOAT}),[yield e.layer.buildLayerModel({moduleName:"rasterImageDataRGBA",vertexShader:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_Uv;\n\nlayout(std140) uniform commonUniforms {\n vec2 u_rminmax;\n vec2 u_gminmax;\n vec2 u_bminmax;\n float u_opacity;\n float u_noDataValue;\n};\n\nout vec2 v_texCoord;\n\n#pragma include "projection"\n\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0.0, 1.0));\n}\n',fragmentShader:"uniform sampler2D u_texture;\nlayout(std140) uniform commonUniforms {\n vec2 u_rminmax;\n vec2 u_gminmax;\n vec2 u_bminmax;\n float u_opacity;\n float u_noDataValue;\n};\n\nin vec2 v_texCoord;\n\nout vec4 outputColor;\n\nvoid main() {\n\n vec3 rgb = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y)).rgb;\n\n if(rgb == vec3(u_noDataValue)) {\n outputColor = vec4(0.0, 0, 0, 0.0);\n } else {\n 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);\n }\n\n if(outputColor.a < 0.01)\n discard;\n \n}",defines:e.getDefines(),triangulation:Tc,primitive:Ot.gl.TRIANGLES,depth:{enable:!1},pickingEnabled:!1})]}))()}buildModels(){var e=this;return(0,Hr.A)((function*(){return e.initModels()}))()}clearModels(){var e;null===(e=this.texture)||void 0===e||e.destroy()}registerBuiltinAttributes(){this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Ot.jQ.Attribute,descriptor:{name:"a_Uv",shaderLocation:this.attributeLocation.UV,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:(e,t,n)=>[n[3],n[4]]}})}},raster3d:Ru,rasterTerrainRgb:class extends kl{constructor(...e){super(...e),(0,kr.A)(this,"texture",void 0)}get attributeLocation(){return Object.assign(super.attributeLocation,{MAX:super.attributeLocation.MAX,UV:9})}getCommonUniformsInfo(){const{opacity:e,clampLow:t=!0,clampHigh:n=!0,noDataValue:r=-9999999,domain:i,rampColors:o,colorTexture:a,rScaler:s=6553.6,gScaler:l=25.6,bScaler:c=.1,offset:u=1e4}=this.layer.getLayerConfig(),h=i||(0,y.Er)(o);let d=a;a?this.layer.textureService.setColorTexture(a,o,h):d=this.layer.textureService.getColorTexture(o,h);const f={u_unpack:[s,l,c,u],u_domain:h,u_opacity:e||1,u_noDataValue:r,u_clampLow:t,u_clampHigh:void 0!==n?n:t,u_texture:this.texture,u_colorTexture:d};return this.textures=[this.texture,d],this.getUniformsBufferInfo(f)}initModels(){var e=this;return(0,Hr.A)((function*(){e.initUniformsBuffer();const t=e.layer.getSource(),{createTexture2D:n}=e.rendererService,r=yield t.data.images;return e.texture=n({data:r[0],width:r[0].width,height:r[0].height,min:Ot.gl.LINEAR,mag:Ot.gl.LINEAR}),[yield e.layer.buildLayerModel({moduleName:"RasterTileDataImage",vertexShader:'layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_Uv;\n\nlayout(std140) uniform commonUniforms {\n vec4 u_unpack;\n vec2 u_domain;\n float u_opacity;\n float u_noDataValue;\n float u_clampLow;\n float u_clampHigh;\n};\nout vec2 v_texCoord;\n#pragma include "projection"\n\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0.0, 1.0));\n}\n',fragmentShader:"uniform sampler2D u_texture;\nuniform sampler2D u_colorTexture;\n\nlayout(std140) uniform commonUniforms {\n vec4 u_unpack;\n vec2 u_domain;\n float u_opacity;\n float u_noDataValue;\n float u_clampLow;\n float u_clampHigh;\n};\n\nin vec2 v_texCoord;\nout vec4 outputColor;\n\n\nfloat getElevation(vec2 coord, float bias) {\n // Convert encoded elevation value to meters\n vec4 data = texture(SAMPLER_2D(u_texture), coord,bias) * 255.0;\n data.a = -1.0;\n return dot(data, u_unpack);\n}\n\nvec4 getColor(float value) {\n float normalisedValue =(value- u_domain[0]) / (u_domain[1] - u_domain[0]);\n vec2 coord = vec2(normalisedValue, 0);\n return texture(SAMPLER_2D(u_colorTexture), coord);\n}\n\nvoid main() {\n float value = getElevation(v_texCoord,0.0);\n if (value == u_noDataValue) {\n outputColor = vec4(0.0, 0, 0, 0.0);\n } else if ((u_clampLow < 0.5 && value < u_domain[0]) || (u_clampHigh < 0.5 && value > u_domain[1])) {\n outputColor = vec4(0.0, 0, 0, 0.0);\n } else {\n \n outputColor = getColor(value);\n outputColor.a = outputColor.a * u_opacity ;\n if(outputColor.a < 0.01)\n discard;\n }\n}\n",defines:e.getDefines(),triangulation:Tc,primitive:Ot.gl.TRIANGLES,depth:{enable:!1}})]}))()}clearModels(){var e;null===(e=this.texture)||void 0===e||e.destroy()}buildModels(){var e=this;return(0,Hr.A)((function*(){return e.initModels()}))()}registerBuiltinAttributes(){this.registerPosition64LowAttribute(),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Ot.jQ.Attribute,descriptor:{name:"a_Uv",shaderLocation:this.attributeLocation.UV,buffer:{usage:Ot.gl.DYNAMIC_DRAW,data:[],type:Ot.gl.FLOAT},size:2,update:(e,t,n)=>[n[3],n[4]]}})}}};class Mu extends Ml{constructor(...e){super(...e),(0,kr.A)(this,"type","RasterLayer")}buildModels(){var e=this;return(0,Hr.A)((function*(){const t=e.getModelType();e.layerModel=new Ou[t](e),yield e.initLayerModels()}))()}getDefaultConfig(){return{raster:{},rasterRgb:{},raster3d:{},rasterTerrainRgb:{}}[this.getModelType()]}getModelType(){switch(this.layerSource.getParserType()){case"raster":default:return"raster";case"rasterRgb":case"rgb":return"rasterRgb";case"image":return"rasterTerrainRgb"}}getLegend(e){return"color"!==e?{type:void 0,field:void 0,items:[]}:function(e,t){return{type:e.type,field:"value",items:e.positions.map(((n,r)=>({[t]:r>=e.colors.length?null:e.colors[r],value:n})))}}(this.getLayerConfig().rampColors,e)}}const Iu=["rasterData"];class wu extends Eu{initTileLayer(){var e=this;return(0,Hr.A)((function*(){const t=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),r=e.getSourceOption(),i=new Mu((0,Ur.A)({},n)).source(r.data,r.options);t&&Object.keys(t).forEach((e=>{var n,r;const o=e;i[o](null===(n=t[o])||void 0===n?void 0:n.field,null===(r=t[o])||void 0===r?void 0:r.values)})),yield e.addLayer(i),e.isLoaded=!0}))()}getSourceOption(){const e=this.parent.getSource(),t=this.sourceTile.data.data,{rasterData:n}=t,r=(0,Kr.A)(t,Iu);return{data:n,options:{parser:(0,Ur.A)({type:"rasterRgb",extent:this.sourceTile.bounds},r),transforms:e.transforms}}}}class Pu extends Eu{initTileLayer(){var e=this;return(0,Hr.A)((function*(){const t=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),r=e.getSourceOption(),i=new Mu((0,Ur.A)({},n)).source(r.data,r.options);t&&Object.keys(t).forEach((e=>{var n,r;const o=e;i[o](null===(n=t[o])||void 0===n?void 0:n.field,null===(r=t[o])||void 0===r?void 0:r.values)})),yield e.addLayer(i),e.isLoaded=!0}))()}getSourceOption(){const e=this.parent.getSource();return{data:this.sourceTile.data,options:{parser:{type:"image",extent:this.sourceTile.bounds},transforms:e.transforms}}}}const Nu=["rasterData"],Du={positions:[0,1],colors:["#000","#fff"]};class Bu extends Eu{constructor(...e){super(...e),(0,kr.A)(this,"colorTexture",void 0)}initTileLayer(){var e=this;return(0,Hr.A)((function*(){const t=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),r=e.getSourceOption(),{rampColors:i,domain:o}=e.getLayerOptions();e.colorTexture=e.parent.textureService.getColorTexture(i,o);const a=new Mu((0,Ur.A)((0,Ur.A)({},n),{},{colorTexture:e.colorTexture})).source(r.data,r.options);t&&Object.keys(t).forEach((e=>{var n,r;const i=e;a[i](null===(n=t[i])||void 0===n?void 0:n.field,null===(r=t[i])||void 0===r?void 0:r.values)})),yield e.addLayer(a),e.isLoaded=!0}))()}getSourceOption(){const e=this.parent.getSource(),t=this.sourceTile.data.data,{rasterData:n}=t,r=(0,Kr.A)(t,Nu);return{data:n,options:{parser:(0,Ur.A)({type:"raster",extent:this.sourceTile.bounds},r),transforms:e.transforms}}}styleUpdate(...e){const{rampColors:t=Du,domain:n}=e;this.colorTexture=this.parent.textureService.getColorTexture(t,n||(0,y.Er)(t)),this.layers.forEach((e=>e.style({colorTexture:this.colorTexture})))}destroy(){this.layers.forEach((e=>e.destroy()))}}class Fu extends Eu{initTileLayer(){var e=this;return(0,Hr.A)((function*(){const t=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),r="PolygonLayer"===(i=e.parent.type)?lu:"LineLayer"===i?jc:yu;var i;const o=e.getSourceOption();if(!o)return e.isLoaded=!0,void e.emit("loaded");const a=new r((0,Ur.A)({},n)).source(o.data,o.options);Object.keys(t).forEach((e=>{var n,r;const i=e;a[i](null===(n=t[i])||void 0===n?void 0:n.field,null===(r=t[i])||void 0===r?void 0:r.values)})),yield e.addLayer(a),n.tileMask&&(yield e.addTileMask()),e.setLayerMinMaxZoom(a),e.isLoaded=!0,e.emit("loaded")}))()}getSourceOption(){const e=this.parent.getSource(),{sourceLayer:t="defaultLayer",featureId:n="id"}=this.parent.getLayerConfig();return{data:{type:"FeatureCollection",features:this.getFeatures(t)},options:{parser:{type:"geojson",featureId:n},transforms:e.transforms}}}setLayerMinMaxZoom(e){"text"===e.getModelType()&&e.updateLayerConfig({maxZoom:this.z+1,minZoom:this.z-1})}getFeatures(e){return this.sourceTile.data.getTileData(e)}getFeatureById(e){const t=this.getMainLayer();return t?t.getSource().data.dataArray.filter((t=>t._id===e)):[]}}const Uu=["shape","color","size","style","animate","filter","rotate","scale","setBlend","setSelect","setActive","disableMask","enableMask","addMask","removeMask"],{debounce:ku}=y.uG;class Gu{constructor(e){(0,kr.A)(this,"parent",void 0),(0,kr.A)(this,"tileLayerService",void 0),(0,kr.A)(this,"mapService",void 0),(0,kr.A)(this,"layerService",void 0),(0,kr.A)(this,"rendererService",void 0),(0,kr.A)(this,"pickingService",void 0),(0,kr.A)(this,"tilePickService",void 0),(0,kr.A)(this,"tilesetManager",void 0),(0,kr.A)(this,"initedTileset",!1),(0,kr.A)(this,"lastViewStates",void 0),(0,kr.A)(this,"mapchange",(()=>{var e;if(!1===this.parent.isVisible())return;const{latLonBounds:t,zoom:n}=this.getCurrentView();this.lastViewStates&&this.lastViewStates.zoom===n&&this.lastViewStates.latLonBounds.toString()===t.toString()||(this.lastViewStates={zoom:n,latLonBounds:t},null===(e=this.tilesetManager)||void 0===e||e.throttleUpdate(n,t))})),(0,kr.A)(this,"viewchange",ku(this.mapchange,24)),this.parent=e;const t=this.parent.getContainer();this.rendererService=t.rendererService,this.layerService=t.layerService,this.mapService=t.mapService,this.pickingService=t.pickingService,this.tileLayerService=new cu({rendererService:this.rendererService,layerService:this.layerService,parent:e}),this.tilePickService=new pu({tileLayerService:this.tileLayerService,layerService:this.layerService,parent:e}),this.parent.setLayerPickService(this.tilePickService),this.proxy(e),this.initTileSetManager()}initTileSetManager(){var e;const t=this.parent.getSource();if(this.tilesetManager=t.tileset,this.initedTileset||(this.bindTilesetEvent(),this.initedTileset=!0),!1===this.parent.isVisible())return;const{latLonBounds:n,zoom:r}=this.getCurrentView();null===(e=this.tilesetManager)||void 0===e||e.update(r,n)}getCurrentView(){const e=this.mapService.getBounds();return{latLonBounds:[e[0][0],e[0][1],e[1][0],e[1][1]],zoom:this.mapService.getZoom()}}bindTilesetEvent(){this.tilesetManager.on("tile-loaded",(e=>{})),this.tilesetManager.on("tile-unload",(e=>{this.tileUnLoad(e)})),this.tilesetManager.on("tile-error",((e,t)=>{this.tileError(e)})),this.tilesetManager.on("tile-update",(()=>{this.tileUpdate()})),this.mapService.on("zoomend",this.mapchange),this.mapService.on("moveend",this.viewchange)}render(){this.tileLayerService.render()}getLayers(){return this.tileLayerService.getLayers()}getTiles(){return this.tileLayerService.getTiles()}getTile(e){return this.tileLayerService.getTile(e)}tileLoaded(e){}tileError(e){console.warn("error:",e)}destroy(){var e;this.mapService.off("zoomend",this.mapchange),this.mapService.off("moveend",this.viewchange),null===(e=this.tilesetManager)||void 0===e||e.destroy(),this.tileLayerService.destroy()}reload(){var e;this.tilesetManager.clear();const{latLonBounds:t,zoom:n}=this.getCurrentView();null===(e=this.tilesetManager)||void 0===e||e.update(n,t)}tileUnLoad(e){this.tileLayerService.removeTile(e.key)}tileUpdate(){var e=this;return(0,Hr.A)((function*(){if(!e.tilesetManager)return;const t=e.parent.getMinZoom(),n=e.parent.getMaxZoom(),r=e.tilesetManager.tiles.filter((e=>e.isLoaded)).filter((e=>e.isVisibleChange)).filter((e=>e.data)).filter((e=>e.z>=t&&e.z<n));yield Promise.all(r.map(function(){var t=(0,Hr.A)((function*(t){if(e.tileLayerService.hasTile(t.key))e.tileLayerService.updateTileVisible(t),e.tilePickService.setPickState(),e.layerService.reRender();else{const n=new(function(e){switch(e.type){case"PolygonLayer":case"LineLayer":case"PointLayer":return Fu;case"TileDebugLayer":return Au;case"MaskLayer":return Su;case"RasterLayer":const{dataType:t}=e.getSource().parser;switch(t){case Ot.Gc.RGB:case Ot.Gc.CUSTOMRGB:return wu;case Ot.Gc.ARRAYBUFFER:case Ot.Gc.CUSTOMARRAYBUFFER:return Bu;case Ot.Gc.TERRAINRGB:case Ot.Gc.CUSTOMTERRAINRGB:return Pu;default:return bu}default:return Fu}}(e.parent))(t,e.parent);yield n.initTileLayer(),e.tilePickService.setPickState(),0!==n.getLayers().length&&(e.tileLayerService.addTile(n),e.tileLayerService.updateTileVisible(t),e.layerService.reRender())}}));return function(e){return t.apply(this,arguments)}}())),e.tilesetManager.isLoaded&&e.parent.emit("tiles-loaded",e.tilesetManager.currentTiles)}))()}setPickState(e){}pickRender(e){this.tilePickService.pickRender(e)}selectFeature(e){this.tilePickService.selectFeature(e)}highlightPickedFeature(e){this.tilePickService.highlightPickedFeature(e)}proxy(e){Uu.forEach((t=>{const n=e[t].bind(e);e[t]=(...r)=>(n(...r),this.getLayers().map((e=>{e[t](...r)})),"style"===t&&this.getTiles().forEach((e=>e.styleUpdate(...r))),e)}))}}Zn.EventEmitter;const{get:zu}=y.uG;!function(e,t){var n="undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM,r="undefined"!=typeof wx&&null!==wx&&(void 0!==wx.request||void 0!==wx.miniProgram);if(!n&&!r&&(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");a.type="text/css",a.styleSheet?a.styleSheet.cssText=e:a.appendChild(t.createTextNode(e)),i.appendChild(a)}}(".l7-marker-container {\n position: absolute;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n.l7-marker {\n position: absolute !important;\n top: 0;\n left: 0;\n z-index: 5;\n cursor: pointer;\n}\n.l7-marker-cluster {\n width: 40px;\n height: 40px;\n background-color: rgba(181, 226, 140, 0.6);\n background-clip: padding-box;\n border-radius: 20px;\n}\n.l7-marker-cluster div {\n width: 30px;\n height: 30px;\n margin-top: 5px;\n margin-left: 5px;\n font:\n 12px 'Helvetica Neue',\n Arial,\n Helvetica,\n sans-serif;\n text-align: center;\n background-color: rgba(110, 204, 57, 0.6);\n border-radius: 15px;\n}\n.l7-marker-cluster span {\n line-height: 30px;\n}\n.l7-touch .l7-control-attribution,\n.l7-touch .l7-control-layers,\n.l7-touch .l7-bar {\n box-shadow: none;\n}\n.l7-touch .l7-control-layers,\n.l7-touch .l7-bar {\n background-clip: padding-box;\n border: 2px solid rgba(0, 0, 0, 0.2);\n}\n.mapboxgl-ctrl-logo,\n.amap-logo {\n display: none !important;\n}\n.l7-select-box {\n border: 3px dashed gray;\n border-radius: 2px;\n position: absolute;\n z-index: 999;\n box-sizing: border-box;\n}\n.l7-control-container {\n font:\n 12px/1.5 'Helvetica Neue',\n Arial,\n Helvetica,\n sans-serif;\n}\n.l7-control-container .l7-control {\n position: relative;\n z-index: 999;\n float: left;\n clear: both;\n color: #595959;\n font-size: 12px;\n pointer-events: visiblePainted;\n /* IE 9-10 doesn't have auto */\n pointer-events: auto;\n}\n.l7-control-container .l7-control.l7-control--hide {\n display: none;\n}\n.l7-control-container .l7-top {\n top: 0;\n display: flex;\n position: absolute;\n z-index: 999;\n pointer-events: none;\n}\n.l7-control-container .l7-top .l7-control:not(.l7-control--hide) {\n margin-top: 8px;\n}\n.l7-control-container .l7-right {\n right: 0;\n display: flex;\n position: absolute;\n z-index: 999;\n pointer-events: none;\n}\n.l7-control-container .l7-right .l7-control:not(.l7-control--hide) {\n margin-right: 8px;\n}\n.l7-control-container .l7-bottom {\n bottom: 0;\n display: flex;\n position: absolute;\n z-index: 999;\n pointer-events: none;\n}\n.l7-control-container .l7-bottom .l7-control:not(.l7-control--hide) {\n margin-bottom: 8px;\n}\n.l7-control-container .l7-left {\n left: 0;\n display: flex;\n position: absolute;\n z-index: 999;\n pointer-events: none;\n}\n.l7-control-container .l7-left .l7-control:not(.l7-control--hide) {\n margin-left: 8px;\n}\n.l7-control-container .l7-center {\n position: absolute;\n display: flex;\n justify-content: center;\n}\n.l7-control-container .l7-center.l7-top,\n.l7-control-container .l7-center.l7-bottom {\n width: 100%;\n}\n.l7-control-container .l7-center.l7-left,\n.l7-control-container .l7-center.l7-right {\n height: 100%;\n}\n.l7-control-container .l7-center .l7-control {\n margin-right: 8px;\n margin-bottom: 8px;\n}\n.l7-control-container .l7-row {\n flex-direction: row;\n}\n.l7-control-container .l7-row.l7-top {\n align-items: flex-start;\n}\n.l7-control-container .l7-row.l7-bottom {\n align-items: flex-end;\n}\n.l7-control-container .l7-column {\n flex-direction: column;\n}\n.l7-control-container .l7-column.l7-left {\n align-items: flex-start;\n}\n.l7-control-container .l7-column.l7-right {\n align-items: flex-end;\n}\n.l7-button-control {\n min-width: 28px;\n height: 28px;\n background-color: #fff;\n border-width: 0;\n border-radius: 2px;\n outline: 0;\n cursor: pointer;\n transition: all 0.2s;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 0 6px;\n box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);\n line-height: 16px;\n}\n.l7-button-control .l7-iconfont {\n fill: #595959;\n color: #595959;\n width: 16px;\n height: 16px;\n}\n.l7-button-control.l7-button-control--row {\n padding: 0 16px 0 13px;\n}\n.l7-button-control.l7-button-control--row * + .l7-button-control__text {\n margin-left: 8px;\n}\n.l7-button-control.l7-button-control--column {\n height: 44px;\n flex-direction: column;\n}\n.l7-button-control.l7-button-control--column .l7-iconfont {\n margin-top: 3px;\n}\n.l7-button-control.l7-button-control--column .l7-button-control__text {\n margin-top: 3px;\n font-size: 10px;\n -webkit-transform: scale(0.83333);\n transform: scale(0.83333);\n}\n.l7-button-control:not(:disabled):hover {\n background-color: #f3f3f3;\n}\n.l7-button-control:not(:disabled):active {\n background-color: #f3f3f3;\n}\n.l7-button-control:disabled {\n background-color: #fafafa;\n color: #bdbdbd;\n cursor: not-allowed;\n}\n.l7-button-control:disabled .l7-iconfont {\n fill: #bdbdbd;\n color: #bdbdbd;\n}\n.l7-button-control:disabled:hover {\n background-color: #fafafa;\n}\n.l7-button-control:disabled:active {\n background-color: #fafafa;\n}\n.l7-popper {\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 5;\n color: #595959;\n}\n.l7-popper.l7-popper-hide {\n display: none;\n}\n.l7-popper .l7-popper-content {\n min-height: 28px;\n background: #fff;\n border-radius: 2px;\n box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);\n}\n.l7-popper .l7-popper-arrow {\n width: 0;\n height: 0;\n border-width: 4px;\n border-style: solid;\n border-top-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n border-right-color: transparent;\n box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);\n}\n.l7-popper.l7-popper-left {\n flex-direction: row;\n}\n.l7-popper.l7-popper-left .l7-popper-arrow {\n border-left-color: #fff;\n margin: 10px 0;\n}\n.l7-popper.l7-popper-right {\n flex-direction: row-reverse;\n}\n.l7-popper.l7-popper-right .l7-popper-arrow {\n border-right-color: #fff;\n margin: 10px 0;\n}\n.l7-popper.l7-popper-top {\n flex-direction: column;\n}\n.l7-popper.l7-popper-top .l7-popper-arrow {\n border-top-color: #fff;\n margin: 0 10px;\n}\n.l7-popper.l7-popper-bottom {\n flex-direction: column-reverse;\n}\n.l7-popper.l7-popper-bottom .l7-popper-arrow {\n border-bottom-color: #fff;\n margin: 0 10px;\n}\n.l7-popper.l7-popper-start {\n align-items: flex-start;\n}\n.l7-popper.l7-popper-end {\n align-items: flex-end;\n}\n.l7-select-control--normal {\n padding: 4px 0;\n}\n.l7-select-control--normal .l7-select-control-item {\n display: flex;\n align-items: center;\n height: 24px;\n padding: 0 16px;\n font-size: 12px;\n line-height: 24px;\n}\n.l7-select-control--normal .l7-select-control-item > * + * {\n margin-left: 6px;\n}\n.l7-select-control--normal .l7-select-control-item input[type='checkbox'] {\n width: 14px;\n height: 14px;\n}\n.l7-select-control--normal .l7-select-control-item:hover {\n background-color: #f3f3f3;\n}\n.l7-select-control--image {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n box-sizing: content-box;\n max-width: 460px;\n max-height: 400px;\n margin: 12px 0 0 12px;\n overflow-x: hidden;\n overflow-y: auto;\n}\n.l7-select-control--image .l7-select-control-item {\n position: relative;\n display: flex;\n flex: 0 0 calc((100% - (12px + 9px) * 2) / 3);\n flex-direction: column;\n justify-content: center;\n box-sizing: content-box;\n margin-right: 12px;\n margin-bottom: 12px;\n overflow: hidden;\n font-size: 12px;\n border: 1px solid #fff;\n border-radius: 2px;\n}\n.l7-select-control--image .l7-select-control-item img {\n width: 100%;\n height: 80px;\n}\n.l7-select-control--image .l7-select-control-item input[type='checkbox'] {\n position: absolute;\n top: 0;\n right: 0;\n}\n.l7-select-control--image .l7-select-control-item .l7-select-control-item-row {\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 26px;\n}\n.l7-select-control--image .l7-select-control-item .l7-select-control-item-row > * + * {\n margin-left: 8px;\n}\n.l7-select-control--image .l7-select-control-item.l7-select-control-item-active {\n border-color: #0370fe;\n}\n.l7-select-control-item {\n cursor: pointer;\n}\n.l7-select-control-item input[type='checkbox'] {\n margin: 0;\n cursor: pointer;\n}\n.l7-select-control--multiple .l7-select-control-item:hover {\n background-color: transparent;\n}\n.l7-control-logo {\n width: 89px;\n height: 16px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.l7-control-logo img {\n height: 100%;\n width: 100%;\n}\n.l7-control-logo .l7-control-logo-link {\n display: block;\n cursor: pointer;\n}\n.l7-control-logo .l7-control-logo-link img {\n cursor: pointer;\n}\n.l7-control-mouse-location {\n background-color: #fff;\n border-radius: 2px;\n box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);\n padding: 2px 4px;\n min-width: 130px;\n}\n.l7-control-zoom {\n overflow: hidden;\n border-radius: 2px;\n box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);\n}\n.l7-control-zoom .l7-button-control {\n font-size: 16px;\n border-bottom: 1px solid #f0f0f0;\n border-radius: 0;\n box-shadow: 0 0 0;\n}\n.l7-control-zoom .l7-button-control .l7-iconfont {\n width: 14px;\n height: 14px;\n}\n.l7-control-zoom .l7-button-control:last-child {\n border-bottom: 0;\n}\n.l7-control-zoom .l7-control-zoom__number {\n color: #595959;\n padding: 0;\n}\n.l7-control-zoom .l7-control-zoom__number:hover {\n background-color: #fff;\n}\n.l7-control-scale {\n display: flex;\n flex-direction: column;\n}\n.l7-control-scale .l7-control-scale-line {\n box-sizing: border-box;\n padding: 2px 5px 1px;\n overflow: hidden;\n color: #595959;\n font-size: 10px;\n line-height: 1.1;\n white-space: nowrap;\n background: #fff;\n border: 2px solid #000;\n border-top: 0;\n transition: width 0.1s;\n}\n.l7-control-scale .l7-control-scale-line + .l7-control-scale .l7-control-scale-line {\n margin-top: -2px;\n border-top: 2px solid #777;\n border-bottom: none;\n}\n.l7-right .l7-control-scale {\n display: flex;\n align-items: flex-end;\n}\n.l7-right .l7-control-scale .l7-control-scale-line {\n text-align: right;\n}\n.l7-popup {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n display: flex;\n will-change: transform;\n pointer-events: none;\n}\n.l7-popup.l7-popup-hide {\n display: none;\n}\n.l7-popup .l7-popup-content {\n position: relative;\n padding: 16px;\n font-size: 14px;\n background: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n.l7-popup .l7-popup-content .l7-popup-content__title {\n margin-bottom: 8px;\n font-weight: bold;\n}\n.l7-popup .l7-popup-content .l7-popup-close-button,\n.l7-popup .l7-popup-content .l7-popup-content__title,\n.l7-popup .l7-popup-content .l7-popup-content__panel {\n white-space: normal;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n pointer-events: initial;\n}\n.l7-popup .l7-popup-content .l7-popup-close-button {\n position: absolute;\n top: 0;\n right: 0;\n width: 18px;\n height: 18px;\n padding: 0;\n font-size: 14px;\n line-height: 18px;\n text-align: center;\n background-color: transparent;\n border: 0;\n border-radius: 0 3px 0 0;\n cursor: pointer;\n}\n.l7-popup .l7-popup-tip {\n position: relative;\n z-index: 1;\n width: 0;\n height: 0;\n border: 10px solid transparent;\n}\n.l7-popup.l7-popup-anchor-bottom,\n.l7-popup.l7-popup-anchor-bottom-left,\n.l7-popup.l7-popup-anchor-bottom-right {\n flex-direction: column-reverse;\n}\n.l7-popup.l7-popup-anchor-bottom .l7-popup-tip,\n.l7-popup.l7-popup-anchor-bottom-left .l7-popup-tip,\n.l7-popup.l7-popup-anchor-bottom-right .l7-popup-tip {\n bottom: 1px;\n}\n.l7-popup.l7-popup-anchor-top,\n.l7-popup.l7-popup-anchor-top-left,\n.l7-popup.l7-popup-anchor-top-right {\n flex-direction: column;\n}\n.l7-popup.l7-popup-anchor-top .l7-popup-tip,\n.l7-popup.l7-popup-anchor-top-left .l7-popup-tip,\n.l7-popup.l7-popup-anchor-top-right .l7-popup-tip {\n top: 1px;\n}\n.l7-popup.l7-popup-anchor-left {\n flex-direction: row;\n}\n.l7-popup.l7-popup-anchor-right {\n flex-direction: row-reverse;\n}\n.l7-popup-anchor-top .l7-popup-tip {\n position: relative;\n align-self: center;\n border-top: none;\n border-bottom-color: #fff;\n}\n.l7-popup-anchor-top-left .l7-popup-tip {\n align-self: flex-start;\n border-top: none;\n border-bottom-color: #fff;\n border-left: none;\n}\n.l7-popup-anchor-top-right .l7-popup-tip {\n align-self: flex-end;\n border-top: none;\n border-right: none;\n border-bottom-color: #fff;\n}\n.l7-popup-anchor-bottom .l7-popup-tip {\n align-self: center;\n border-top-color: #fff;\n border-bottom: none;\n}\n.l7-popup-anchor-bottom-left .l7-popup-tip {\n align-self: flex-start;\n border-top-color: #fff;\n border-bottom: none;\n border-left: none;\n}\n.l7-popup-anchor-bottom-right .l7-popup-tip {\n align-self: flex-end;\n border-top-color: #fff;\n border-right: none;\n border-bottom: none;\n}\n.l7-popup-anchor-left .l7-popup-tip {\n align-self: center;\n border-right-color: #fff;\n border-left: none;\n}\n.l7-popup-anchor-right .l7-popup-tip {\n right: 1px;\n align-self: center;\n border-right: none;\n border-left-color: #fff;\n}\n.l7-popup-anchor-top-left .l7-popup-content {\n border-top-left-radius: 0;\n}\n.l7-popup-anchor-top-right .l7-popup-content {\n border-top-right-radius: 0;\n}\n.l7-popup-anchor-bottom-left .l7-popup-content {\n border-bottom-left-radius: 0;\n}\n.l7-popup-anchor-bottom-right .l7-popup-content {\n border-bottom-right-radius: 0;\n}\n.l7-popup-track-pointer {\n display: none;\n}\n.l7-popup-track-pointer * {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n pointer-events: none;\n}\n.l7-map:hover .l7-popup-track-pointer {\n display: flex;\n}\n.l7-map:active .l7-popup-track-pointer {\n display: none;\n}\n.l7-layer-popup__row {\n font-size: 12px;\n}\n.l7-layer-popup__row + .l7-layer-popup__row {\n margin-top: 4px;\n}\n.l7-control-swipe {\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: 6;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n touch-action: none;\n}\n.l7-control-swipe_hide {\n display: none;\n}\n.l7-control-swipe:before {\n position: absolute;\n top: -5000px;\n bottom: -5000px;\n left: 50%;\n z-index: -1;\n width: 4px;\n background: #fff;\n -webkit-transform: translate(-2px, 0);\n transform: translate(-2px, 0);\n content: '';\n}\n.l7-control-swipe.horizontal:before {\n top: 50%;\n right: -5000px;\n bottom: auto;\n left: -5000px;\n width: auto;\n height: 4px;\n}\n.l7-control-swipe__button {\n display: block;\n width: 28px;\n height: 28px;\n margin: 0;\n padding: 0;\n color: #595959;\n font-weight: bold;\n font-size: inherit;\n text-align: center;\n text-decoration: none;\n background-color: #fff;\n border: none;\n border-radius: 2px;\n outline: none;\n}\n.l7-control-swipe,\n.l7-control-swipe__button {\n cursor: ew-resize;\n}\n.l7-control-swipe.horizontal,\n.l7-control-swipe.horizontal button {\n cursor: ns-resize;\n}\n.l7-control-swipe:after,\n.l7-control-swipe__button:before,\n.l7-control-swipe__button:after {\n position: absolute;\n top: 25%;\n bottom: 25%;\n left: 50%;\n width: 2px;\n background: currentColor;\n -webkit-transform: translate(-1px, 0);\n transform: translate(-1px, 0);\n content: '';\n}\n.l7-control-swipe__button:after {\n -webkit-transform: translateX(4px);\n transform: translateX(4px);\n}\n.l7-control-swipe__button:before {\n -webkit-transform: translateX(-6px);\n transform: translateX(-6px);\n}\n");var ju=n(48643),Vu=n.n(ju),Hu=class{constructor(e,t){const{buffer:n,offset:r,stride:i,normalized:o,size:a,divisor:s}=t;this.buffer=n,this.attribute={buffer:n.get(),offset:r||0,stride:i||0,normalized:o||!1,divisor:s||0},a&&(this.attribute.size=a)}get(){return this.attribute}updateBuffer(e){this.buffer.subData(e)}destroy(){this.buffer.destroy()}},Wu={[Ot.gl.POINTS]:"points",[Ot.gl.LINES]:"lines",[Ot.gl.LINE_LOOP]:"line loop",[Ot.gl.LINE_STRIP]:"line strip",[Ot.gl.TRIANGLES]:"triangles",[Ot.gl.TRIANGLE_FAN]:"triangle fan",[Ot.gl.TRIANGLE_STRIP]:"triangle strip"},Xu={[Ot.gl.STATIC_DRAW]:"static",[Ot.gl.DYNAMIC_DRAW]:"dynamic",[Ot.gl.STREAM_DRAW]:"stream"},Zu={[Ot.gl.BYTE]:"int8",[Ot.gl.INT]:"int32",[Ot.gl.UNSIGNED_BYTE]:"uint8",[Ot.gl.UNSIGNED_SHORT]:"uint16",[Ot.gl.UNSIGNED_INT]:"uint32",[Ot.gl.FLOAT]:"float"},Yu={[Ot.gl.ALPHA]:"alpha",[Ot.gl.LUMINANCE]:"luminance",[Ot.gl.LUMINANCE_ALPHA]:"luminance alpha",[Ot.gl.RGB]:"rgb",[Ot.gl.RGBA]:"rgba",[Ot.gl.RGBA4]:"rgba4",[Ot.gl.RGB5_A1]:"rgb5 a1",[Ot.gl.RGB565]:"rgb565",[Ot.gl.DEPTH_COMPONENT]:"depth",[Ot.gl.DEPTH_STENCIL]:"depth stencil"},qu={[Ot.gl.DONT_CARE]:"dont care",[Ot.gl.NICEST]:"nice",[Ot.gl.FASTEST]:"fast"},Ku={[Ot.gl.NEAREST]:"nearest",[Ot.gl.LINEAR]:"linear",[Ot.gl.LINEAR_MIPMAP_LINEAR]:"mipmap",[Ot.gl.NEAREST_MIPMAP_LINEAR]:"nearest mipmap linear",[Ot.gl.LINEAR_MIPMAP_NEAREST]:"linear mipmap nearest",[Ot.gl.NEAREST_MIPMAP_NEAREST]:"nearest mipmap nearest"},Qu={[Ot.gl.REPEAT]:"repeat",[Ot.gl.CLAMP_TO_EDGE]:"clamp",[Ot.gl.MIRRORED_REPEAT]:"mirror"},$u={[Ot.gl.NONE]:"none",[Ot.gl.BROWSER_DEFAULT_WEBGL]:"browser"},Ju={[Ot.gl.NEVER]:"never",[Ot.gl.ALWAYS]:"always",[Ot.gl.LESS]:"less",[Ot.gl.LEQUAL]:"lequal",[Ot.gl.GREATER]:"greater",[Ot.gl.GEQUAL]:"gequal",[Ot.gl.EQUAL]:"equal",[Ot.gl.NOTEQUAL]:"notequal"},eh={[Ot.gl.FUNC_ADD]:"add",[Ot.gl.MIN_EXT]:"min",[Ot.gl.MAX_EXT]:"max",[Ot.gl.FUNC_SUBTRACT]:"subtract",[Ot.gl.FUNC_REVERSE_SUBTRACT]:"reverse subtract"},th={[Ot.gl.ZERO]:"zero",[Ot.gl.ONE]:"one",[Ot.gl.SRC_COLOR]:"src color",[Ot.gl.ONE_MINUS_SRC_COLOR]:"one minus src color",[Ot.gl.SRC_ALPHA]:"src alpha",[Ot.gl.ONE_MINUS_SRC_ALPHA]:"one minus src alpha",[Ot.gl.DST_COLOR]:"dst color",[Ot.gl.ONE_MINUS_DST_COLOR]:"one minus dst color",[Ot.gl.DST_ALPHA]:"dst alpha",[Ot.gl.ONE_MINUS_DST_ALPHA]:"one minus dst alpha",[Ot.gl.CONSTANT_COLOR]:"constant color",[Ot.gl.ONE_MINUS_CONSTANT_COLOR]:"one minus constant color",[Ot.gl.CONSTANT_ALPHA]:"constant alpha",[Ot.gl.ONE_MINUS_CONSTANT_ALPHA]:"one minus constant alpha",[Ot.gl.SRC_ALPHA_SATURATE]:"src alpha saturate"},nh={[Ot.gl.NEVER]:"never",[Ot.gl.ALWAYS]:"always",[Ot.gl.LESS]:"less",[Ot.gl.LEQUAL]:"lequal",[Ot.gl.GREATER]:"greater",[Ot.gl.GEQUAL]:"gequal",[Ot.gl.EQUAL]:"equal",[Ot.gl.NOTEQUAL]:"notequal"},rh={[Ot.gl.ZERO]:"zero",[Ot.gl.KEEP]:"keep",[Ot.gl.REPLACE]:"replace",[Ot.gl.INVERT]:"invert",[Ot.gl.INCR]:"increment",[Ot.gl.DECR]:"decrement",[Ot.gl.INCR_WRAP]:"increment wrap",[Ot.gl.DECR_WRAP]:"decrement wrap"},ih={[Ot.gl.FRONT]:"front",[Ot.gl.BACK]:"back"},oh=class{constructor(e,t){this.isDestroyed=!1;const{data:n,usage:r,type:i}=t;this.buffer=e.buffer({data:n,usage:Xu[r||Ot.gl.STATIC_DRAW],type:Zu[i||Ot.gl.UNSIGNED_BYTE]})}get(){return this.buffer}destroy(){this.isDestroyed||this.buffer.destroy(),this.isDestroyed=!0}subData({data:e,offset:t}){this.buffer.subdata(e,t)}},ah=class{constructor(e,t){const{data:n,usage:r,type:i,count:o}=t;this.elements=e.elements({data:n,usage:Xu[r||Ot.gl.STATIC_DRAW],type:Zu[i||Ot.gl.UNSIGNED_BYTE],count:o})}get(){return this.elements}subData({data:e}){this.elements.subdata(e)}destroy(){}},sh=class{constructor(e,t){const{width:n,height:r,color:i,colors:o}=t,a={width:n,height:r};Array.isArray(o)&&(a.colors=o.map((e=>e.get()))),i&&"boolean"!=typeof i&&(a.color=i.get()),this.framebuffer=e.framebuffer(a)}get(){return this.framebuffer}destroy(){this.framebuffer.destroy()}resize({width:e,height:t}){this.framebuffer.resize(e,t)}};const lh=function(e){return null==e};var ch={}.toString;const uh=function(e){return function(e,t){return ch.call(e)==="[object "+t+"]"}(e,"Number")};var hh=n(85608);const dh=n(49666);var fh,ph,gh,mh,_h,vh,yh,Eh,Ah,bh,Th,xh,Sh,Rh,Ch,Lh,Oh,Mh,Ih,wh,Ph,Nh,Dh,Bh,Fh,Uh,kh;function Gh(e,t,n){return e<<16|t<<8|n}function zh(e){return e>>>8&255}function jh(e){return e>>>16&255}function Vh(e){return 255&e}function Hh(e){switch(e){case Bh.F32:case Bh.U32:case Bh.S32:return 4;case Bh.U16:case Bh.S16:case Bh.F16:return 2;case Bh.U8:case Bh.S8:return 1;default:throw new Error("whoops")}}function Wh(e){return Hh(jh(e))}function Xh(e){var t=Vh(e);if(t&Uh.Depth)return wh.Depth;if(t&Uh.Normalized)return wh.Float;var n=jh(e);if(n===Bh.F16||n===Bh.F32)return wh.Float;if(n===Bh.U8||n===Bh.U16||n===Bh.U32)return wh.Uint;if(n===Bh.S8||n===Bh.S16||n===Bh.S32)return wh.Sint;throw new Error("whoops")}function Zh(e,t){if(void 0===t&&(t=""),!e)throw new Error("Assert fail: ".concat(t))}function Yh(e){if(null!=e)return e;throw new Error("Missing object")}function qh(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}function Kh(e,t){e.r=t.r,e.g=t.g,e.b=t.b,e.a=t.a}function Qh(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}function $h(e,t,n,r){return void 0===r&&(r=1),{r:e,g:t,b:n,a:r}}!function(e){e[e.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",e[e.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",e[e.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN",e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",e[e.FUNC_ADD=32774]="FUNC_ADD",e[e.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",e[e.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",e[e.BLEND_EQUATION=32777]="BLEND_EQUATION",e[e.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",e[e.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",e[e.BLEND_DST_RGB=32968]="BLEND_DST_RGB",e[e.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",e[e.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",e[e.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",e[e.BLEND_COLOR=32773]="BLEND_COLOR",e[e.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",e[e.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",e[e.LINE_WIDTH=2849]="LINE_WIDTH",e[e.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",e[e.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",e[e.CULL_FACE_MODE=2885]="CULL_FACE_MODE",e[e.FRONT_FACE=2886]="FRONT_FACE",e[e.DEPTH_RANGE=2928]="DEPTH_RANGE",e[e.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",e[e.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",e[e.DEPTH_FUNC=2932]="DEPTH_FUNC",e[e.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",e[e.STENCIL_FUNC=2962]="STENCIL_FUNC",e[e.STENCIL_FAIL=2964]="STENCIL_FAIL",e[e.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",e[e.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",e[e.STENCIL_REF=2967]="STENCIL_REF",e[e.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",e[e.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",e[e.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",e[e.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",e[e.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",e[e.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",e[e.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",e[e.VIEWPORT=2978]="VIEWPORT",e[e.SCISSOR_BOX=3088]="SCISSOR_BOX",e[e.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",e[e.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",e[e.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",e[e.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",e[e.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",e[e.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",e[e.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",e[e.RED_BITS=3410]="RED_BITS",e[e.GREEN_BITS=3411]="GREEN_BITS",e[e.BLUE_BITS=3412]="BLUE_BITS",e[e.ALPHA_BITS=3413]="ALPHA_BITS",e[e.DEPTH_BITS=3414]="DEPTH_BITS",e[e.STENCIL_BITS=3415]="STENCIL_BITS",e[e.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",e[e.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",e[e.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",e[e.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",e[e.SAMPLES=32937]="SAMPLES",e[e.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",e[e.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",e[e.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",e[e.VENDOR=7936]="VENDOR",e[e.RENDERER=7937]="RENDERER",e[e.VERSION=7938]="VERSION",e[e.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",e[e.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",e[e.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",e[e.STATIC_DRAW=35044]="STATIC_DRAW",e[e.STREAM_DRAW=35040]="STREAM_DRAW",e[e.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.BUFFER_SIZE=34660]="BUFFER_SIZE",e[e.BUFFER_USAGE=34661]="BUFFER_USAGE",e[e.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",e[e.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",e[e.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",e[e.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",e[e.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",e[e.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",e[e.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",e[e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",e[e.CULL_FACE=2884]="CULL_FACE",e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK",e[e.BLEND=3042]="BLEND",e[e.DEPTH_TEST=2929]="DEPTH_TEST",e[e.DITHER=3024]="DITHER",e[e.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",e[e.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",e[e.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",e[e.SCISSOR_TEST=3089]="SCISSOR_TEST",e[e.STENCIL_TEST=2960]="STENCIL_TEST",e[e.NO_ERROR=0]="NO_ERROR",e[e.INVALID_ENUM=1280]="INVALID_ENUM",e[e.INVALID_VALUE=1281]="INVALID_VALUE",e[e.INVALID_OPERATION=1282]="INVALID_OPERATION",e[e.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",e[e.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",e[e.CW=2304]="CW",e[e.CCW=2305]="CCW",e[e.DONT_CARE=4352]="DONT_CARE",e[e.FASTEST=4353]="FASTEST",e[e.NICEST=4354]="NICEST",e[e.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.DOUBLE=5130]="DOUBLE",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",e[e.VERTEX_SHADER=35633]="VERTEX_SHADER",e[e.COMPILE_STATUS=35713]="COMPILE_STATUS",e[e.DELETE_STATUS=35712]="DELETE_STATUS",e[e.LINK_STATUS=35714]="LINK_STATUS",e[e.VALIDATE_STATUS=35715]="VALIDATE_STATUS",e[e.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",e[e.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",e[e.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",e[e.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",e[e.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",e[e.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",e[e.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",e[e.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",e[e.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",e[e.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",e[e.SHADER_TYPE=35663]="SHADER_TYPE",e[e.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",e[e.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",e[e.NEVER=512]="NEVER",e[e.ALWAYS=519]="ALWAYS",e[e.LESS=513]="LESS",e[e.EQUAL=514]="EQUAL",e[e.LEQUAL=515]="LEQUAL",e[e.GREATER=516]="GREATER",e[e.GEQUAL=518]="GEQUAL",e[e.NOTEQUAL=517]="NOTEQUAL",e[e.KEEP=7680]="KEEP",e[e.REPLACE=7681]="REPLACE",e[e.INCR=7682]="INCR",e[e.DECR=7683]="DECR",e[e.INVERT=5386]="INVERT",e[e.INCR_WRAP=34055]="INCR_WRAP",e[e.DECR_WRAP=34056]="DECR_WRAP",e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9729]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",e[e.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",e[e.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",e[e.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",e[e.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE=5890]="TEXTURE",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e[e.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",e[e.TEXTURE0=33984]="TEXTURE0",e[e.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",e[e.REPEAT=10497]="REPEAT",e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",e[e.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D",e[e.SAMPLER_CUBE=35680]="SAMPLER_CUBE",e[e.LOW_FLOAT=36336]="LOW_FLOAT",e[e.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",e[e.HIGH_FLOAT=36338]="HIGH_FLOAT",e[e.LOW_INT=36339]="LOW_INT",e[e.MEDIUM_INT=36340]="MEDIUM_INT",e[e.HIGH_INT=36341]="HIGH_INT",e[e.FRAMEBUFFER=36160]="FRAMEBUFFER",e[e.RENDERBUFFER=36161]="RENDERBUFFER",e[e.RGBA4=32854]="RGBA4",e[e.RGB5_A1=32855]="RGB5_A1",e[e.RGB565=36194]="RGB565",e[e.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",e[e.STENCIL_INDEX=6401]="STENCIL_INDEX",e[e.STENCIL_INDEX8=36168]="STENCIL_INDEX8",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e[e.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",e[e.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",e[e.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",e[e.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",e[e.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",e[e.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",e[e.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",e[e.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",e[e.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",e[e.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",e[e.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",e[e.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",e[e.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",e[e.NONE=0]="NONE",e[e.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",e[e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",e[e.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",e[e.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",e[e.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",e[e.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",e[e.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",e[e.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",e[e.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",e[e.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",e[e.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",e[e.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",e[e.READ_BUFFER=3074]="READ_BUFFER",e[e.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",e[e.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",e[e.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",e[e.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",e[e.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",e[e.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",e[e.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",e[e.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",e[e.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",e[e.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",e[e.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",e[e.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",e[e.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",e[e.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",e[e.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",e[e.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",e[e.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",e[e.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",e[e.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",e[e.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",e[e.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",e[e.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",e[e.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",e[e.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",e[e.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",e[e.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",e[e.RED=6403]="RED",e[e.RGB8=32849]="RGB8",e[e.RGBA8=32856]="RGBA8",e[e.RGB10_A2=32857]="RGB10_A2",e[e.TEXTURE_3D=32879]="TEXTURE_3D",e[e.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",e[e.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",e[e.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",e[e.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",e[e.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",e[e.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",e[e.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",e[e.SRGB=35904]="SRGB",e[e.SRGB8=35905]="SRGB8",e[e.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",e[e.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",e[e.RGBA32F=34836]="RGBA32F",e[e.RGB32F=34837]="RGB32F",e[e.RGBA16F=34842]="RGBA16F",e[e.RGB16F=34843]="RGB16F",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",e[e.R11F_G11F_B10F=35898]="R11F_G11F_B10F",e[e.RGB9_E5=35901]="RGB9_E5",e[e.RGBA32UI=36208]="RGBA32UI",e[e.RGB32UI=36209]="RGB32UI",e[e.RGBA16UI=36214]="RGBA16UI",e[e.RGB16UI=36215]="RGB16UI",e[e.RGBA8UI=36220]="RGBA8UI",e[e.RGB8UI=36221]="RGB8UI",e[e.RGBA32I=36226]="RGBA32I",e[e.RGB32I=36227]="RGB32I",e[e.RGBA16I=36232]="RGBA16I",e[e.RGB16I=36233]="RGB16I",e[e.RGBA8I=36238]="RGBA8I",e[e.RGB8I=36239]="RGB8I",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.R8=33321]="R8",e[e.RG8=33323]="RG8",e[e.R16F=33325]="R16F",e[e.R32F=33326]="R32F",e[e.RG16F=33327]="RG16F",e[e.RG32F=33328]="RG32F",e[e.R8I=33329]="R8I",e[e.R8UI=33330]="R8UI",e[e.R16I=33331]="R16I",e[e.R16UI=33332]="R16UI",e[e.R32I=33333]="R32I",e[e.R32UI=33334]="R32UI",e[e.RG8I=33335]="RG8I",e[e.RG8UI=33336]="RG8UI",e[e.RG16I=33337]="RG16I",e[e.RG16UI=33338]="RG16UI",e[e.RG32I=33339]="RG32I",e[e.RG32UI=33340]="RG32UI",e[e.R8_SNORM=36756]="R8_SNORM",e[e.RG8_SNORM=36757]="RG8_SNORM",e[e.RGB8_SNORM=36758]="RGB8_SNORM",e[e.RGBA8_SNORM=36759]="RGBA8_SNORM",e[e.RGB10_A2UI=36975]="RGB10_A2UI",e[e.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",e[e.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.HALF_FLOAT=5131]="HALF_FLOAT",e[e.RG=33319]="RG",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",e[e.CURRENT_QUERY=34917]="CURRENT_QUERY",e[e.QUERY_RESULT=34918]="QUERY_RESULT",e[e.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",e[e.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",e[e.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",e[e.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",e[e.DRAW_BUFFER0=34853]="DRAW_BUFFER0",e[e.DRAW_BUFFER1=34854]="DRAW_BUFFER1",e[e.DRAW_BUFFER2=34855]="DRAW_BUFFER2",e[e.DRAW_BUFFER3=34856]="DRAW_BUFFER3",e[e.DRAW_BUFFER4=34857]="DRAW_BUFFER4",e[e.DRAW_BUFFER5=34858]="DRAW_BUFFER5",e[e.DRAW_BUFFER6=34859]="DRAW_BUFFER6",e[e.DRAW_BUFFER7=34860]="DRAW_BUFFER7",e[e.DRAW_BUFFER8=34861]="DRAW_BUFFER8",e[e.DRAW_BUFFER9=34862]="DRAW_BUFFER9",e[e.DRAW_BUFFER10=34863]="DRAW_BUFFER10",e[e.DRAW_BUFFER11=34864]="DRAW_BUFFER11",e[e.DRAW_BUFFER12=34865]="DRAW_BUFFER12",e[e.DRAW_BUFFER13=34866]="DRAW_BUFFER13",e[e.DRAW_BUFFER14=34867]="DRAW_BUFFER14",e[e.DRAW_BUFFER15=34868]="DRAW_BUFFER15",e[e.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",e[e.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",e[e.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",e[e.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",e[e.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",e[e.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",e[e.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",e[e.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",e[e.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",e[e.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",e[e.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",e[e.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",e[e.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",e[e.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",e[e.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",e[e.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",e[e.SAMPLER_3D=35679]="SAMPLER_3D",e[e.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",e[e.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",e[e.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",e[e.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",e[e.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",e[e.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",e[e.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",e[e.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",e[e.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",e[e.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",e[e.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",e[e.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",e[e.MAX_SAMPLES=36183]="MAX_SAMPLES",e[e.SAMPLER_BINDING=35097]="SAMPLER_BINDING",e[e.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",e[e.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",e[e.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",e[e.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",e[e.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",e[e.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",e[e.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",e[e.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",e[e.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",e[e.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",e[e.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",e[e.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",e[e.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",e[e.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",e[e.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",e[e.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",e[e.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",e[e.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",e[e.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",e[e.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",e[e.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",e[e.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",e[e.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",e[e.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",e[e.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",e[e.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",e[e.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",e[e.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",e[e.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",e[e.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",e[e.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",e[e.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",e[e.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",e[e.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",e[e.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",e[e.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",e[e.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",e[e.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",e[e.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",e[e.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",e[e.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",e[e.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",e[e.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",e[e.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",e[e.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",e[e.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",e[e.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",e[e.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",e[e.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",e[e.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",e[e.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",e[e.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",e[e.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",e[e.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",e[e.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",e[e.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",e[e.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",e[e.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",e[e.UNIFORM_TYPE=35383]="UNIFORM_TYPE",e[e.UNIFORM_SIZE=35384]="UNIFORM_SIZE",e[e.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",e[e.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",e[e.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",e[e.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",e[e.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",e[e.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",e[e.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",e[e.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",e[e.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",e[e.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",e[e.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",e[e.OBJECT_TYPE=37138]="OBJECT_TYPE",e[e.SYNC_CONDITION=37139]="SYNC_CONDITION",e[e.SYNC_STATUS=37140]="SYNC_STATUS",e[e.SYNC_FLAGS=37141]="SYNC_FLAGS",e[e.SYNC_FENCE=37142]="SYNC_FENCE",e[e.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",e[e.UNSIGNALED=37144]="UNSIGNALED",e[e.SIGNALED=37145]="SIGNALED",e[e.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",e[e.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",e[e.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",e[e.WAIT_FAILED=37149]="WAIT_FAILED",e[e.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",e[e.COLOR=6144]="COLOR",e[e.DEPTH=6145]="DEPTH",e[e.STENCIL=6146]="STENCIL",e[e.MIN=32775]="MIN",e[e.MAX=32776]="MAX",e[e.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",e[e.STREAM_READ=35041]="STREAM_READ",e[e.STREAM_COPY=35042]="STREAM_COPY",e[e.STATIC_READ=35045]="STATIC_READ",e[e.STATIC_COPY=35046]="STATIC_COPY",e[e.DYNAMIC_READ=35049]="DYNAMIC_READ",e[e.DYNAMIC_COPY=35050]="DYNAMIC_COPY",e[e.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",e[e.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",e[e.INVALID_INDEX=4294967295]="INVALID_INDEX",e[e.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",e[e.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",e[e.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",e[e.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",e[e.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",e[e.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",e[e.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",e[e.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",e[e.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",e[e.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",e[e.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",e[e.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",e[e.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",e[e.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",e[e.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",e[e.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",e[e.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",e[e.UNSIGNED_INT_24_8_WEBGL=34042]="UNSIGNED_INT_24_8_WEBGL",e[e.HALF_FLOAT_OES=36193]="HALF_FLOAT_OES",e[e.RGBA32F_EXT=34836]="RGBA32F_EXT",e[e.RGB32F_EXT=34837]="RGB32F_EXT",e[e.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",e[e.UNSIGNED_NORMALIZED_EXT=35863]="UNSIGNED_NORMALIZED_EXT",e[e.MIN_EXT=32775]="MIN_EXT",e[e.MAX_EXT=32776]="MAX_EXT",e[e.SRGB_EXT=35904]="SRGB_EXT",e[e.SRGB_ALPHA_EXT=35906]="SRGB_ALPHA_EXT",e[e.SRGB8_ALPHA8_EXT=35907]="SRGB8_ALPHA8_EXT",e[e.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",e[e.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT_OES",e[e.COLOR_ATTACHMENT0_WEBGL=36064]="COLOR_ATTACHMENT0_WEBGL",e[e.COLOR_ATTACHMENT1_WEBGL=36065]="COLOR_ATTACHMENT1_WEBGL",e[e.COLOR_ATTACHMENT2_WEBGL=36066]="COLOR_ATTACHMENT2_WEBGL",e[e.COLOR_ATTACHMENT3_WEBGL=36067]="COLOR_ATTACHMENT3_WEBGL",e[e.COLOR_ATTACHMENT4_WEBGL=36068]="COLOR_ATTACHMENT4_WEBGL",e[e.COLOR_ATTACHMENT5_WEBGL=36069]="COLOR_ATTACHMENT5_WEBGL",e[e.COLOR_ATTACHMENT6_WEBGL=36070]="COLOR_ATTACHMENT6_WEBGL",e[e.COLOR_ATTACHMENT7_WEBGL=36071]="COLOR_ATTACHMENT7_WEBGL",e[e.COLOR_ATTACHMENT8_WEBGL=36072]="COLOR_ATTACHMENT8_WEBGL",e[e.COLOR_ATTACHMENT9_WEBGL=36073]="COLOR_ATTACHMENT9_WEBGL",e[e.COLOR_ATTACHMENT10_WEBGL=36074]="COLOR_ATTACHMENT10_WEBGL",e[e.COLOR_ATTACHMENT11_WEBGL=36075]="COLOR_ATTACHMENT11_WEBGL",e[e.COLOR_ATTACHMENT12_WEBGL=36076]="COLOR_ATTACHMENT12_WEBGL",e[e.COLOR_ATTACHMENT13_WEBGL=36077]="COLOR_ATTACHMENT13_WEBGL",e[e.COLOR_ATTACHMENT14_WEBGL=36078]="COLOR_ATTACHMENT14_WEBGL",e[e.COLOR_ATTACHMENT15_WEBGL=36079]="COLOR_ATTACHMENT15_WEBGL",e[e.DRAW_BUFFER0_WEBGL=34853]="DRAW_BUFFER0_WEBGL",e[e.DRAW_BUFFER1_WEBGL=34854]="DRAW_BUFFER1_WEBGL",e[e.DRAW_BUFFER2_WEBGL=34855]="DRAW_BUFFER2_WEBGL",e[e.DRAW_BUFFER3_WEBGL=34856]="DRAW_BUFFER3_WEBGL",e[e.DRAW_BUFFER4_WEBGL=34857]="DRAW_BUFFER4_WEBGL",e[e.DRAW_BUFFER5_WEBGL=34858]="DRAW_BUFFER5_WEBGL",e[e.DRAW_BUFFER6_WEBGL=34859]="DRAW_BUFFER6_WEBGL",e[e.DRAW_BUFFER7_WEBGL=34860]="DRAW_BUFFER7_WEBGL",e[e.DRAW_BUFFER8_WEBGL=34861]="DRAW_BUFFER8_WEBGL",e[e.DRAW_BUFFER9_WEBGL=34862]="DRAW_BUFFER9_WEBGL",e[e.DRAW_BUFFER10_WEBGL=34863]="DRAW_BUFFER10_WEBGL",e[e.DRAW_BUFFER11_WEBGL=34864]="DRAW_BUFFER11_WEBGL",e[e.DRAW_BUFFER12_WEBGL=34865]="DRAW_BUFFER12_WEBGL",e[e.DRAW_BUFFER13_WEBGL=34866]="DRAW_BUFFER13_WEBGL",e[e.DRAW_BUFFER14_WEBGL=34867]="DRAW_BUFFER14_WEBGL",e[e.DRAW_BUFFER15_WEBGL=34868]="DRAW_BUFFER15_WEBGL",e[e.MAX_COLOR_ATTACHMENTS_WEBGL=36063]="MAX_COLOR_ATTACHMENTS_WEBGL",e[e.MAX_DRAW_BUFFERS_WEBGL=34852]="MAX_DRAW_BUFFERS_WEBGL",e[e.VERTEX_ARRAY_BINDING_OES=34229]="VERTEX_ARRAY_BINDING_OES",e[e.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",e[e.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",e[e.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",e[e.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",e[e.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",e[e.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",e[e.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT"}(fh||(fh={})),function(e){e[e.Buffer=0]="Buffer",e[e.Texture=1]="Texture",e[e.RenderTarget=2]="RenderTarget",e[e.Sampler=3]="Sampler",e[e.Program=4]="Program",e[e.Bindings=5]="Bindings",e[e.InputLayout=6]="InputLayout",e[e.RenderPipeline=7]="RenderPipeline",e[e.ComputePipeline=8]="ComputePipeline",e[e.Readback=9]="Readback",e[e.QueryPool=10]="QueryPool",e[e.RenderBundle=11]="RenderBundle"}(ph||(ph={})),function(e){e[e.NEVER=512]="NEVER",e[e.LESS=513]="LESS",e[e.EQUAL=514]="EQUAL",e[e.LEQUAL=515]="LEQUAL",e[e.GREATER=516]="GREATER",e[e.NOTEQUAL=517]="NOTEQUAL",e[e.GEQUAL=518]="GEQUAL",e[e.ALWAYS=519]="ALWAYS"}(gh||(gh={})),function(e){e[e.CCW=2305]="CCW",e[e.CW=2304]="CW"}(mh||(mh={})),function(e){e[e.NONE=0]="NONE",e[e.FRONT=1]="FRONT",e[e.BACK=2]="BACK",e[e.FRONT_AND_BACK=3]="FRONT_AND_BACK"}(_h||(_h={})),function(e){e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC=768]="SRC",e[e.ONE_MINUS_SRC=769]="ONE_MINUS_SRC",e[e.DST=774]="DST",e[e.ONE_MINUS_DST=775]="ONE_MINUS_DST",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.CONST=32769]="CONST",e[e.ONE_MINUS_CONSTANT=32770]="ONE_MINUS_CONSTANT",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE"}(vh||(vh={})),function(e){e[e.ADD=32774]="ADD",e[e.SUBSTRACT=32778]="SUBSTRACT",e[e.REVERSE_SUBSTRACT=32779]="REVERSE_SUBSTRACT",e[e.MIN=32775]="MIN",e[e.MAX=32776]="MAX"}(yh||(yh={})),function(e){e[e.CLAMP_TO_EDGE=0]="CLAMP_TO_EDGE",e[e.REPEAT=1]="REPEAT",e[e.MIRRORED_REPEAT=2]="MIRRORED_REPEAT"}(Eh||(Eh={})),function(e){e[e.POINT=0]="POINT",e[e.BILINEAR=1]="BILINEAR"}(Ah||(Ah={})),function(e){e[e.NO_MIP=0]="NO_MIP",e[e.NEAREST=1]="NEAREST",e[e.LINEAR=2]="LINEAR"}(bh||(bh={})),function(e){e[e.POINTS=0]="POINTS",e[e.TRIANGLES=1]="TRIANGLES",e[e.TRIANGLE_STRIP=2]="TRIANGLE_STRIP",e[e.LINES=3]="LINES",e[e.LINE_STRIP=4]="LINE_STRIP"}(Th||(Th={})),function(e){e[e.MAP_READ=1]="MAP_READ",e[e.MAP_WRITE=2]="MAP_WRITE",e[e.COPY_SRC=4]="COPY_SRC",e[e.COPY_DST=8]="COPY_DST",e[e.INDEX=16]="INDEX",e[e.VERTEX=32]="VERTEX",e[e.UNIFORM=64]="UNIFORM",e[e.STORAGE=128]="STORAGE",e[e.INDIRECT=256]="INDIRECT",e[e.QUERY_RESOLVE=512]="QUERY_RESOLVE"}(xh||(xh={})),function(e){e[e.STATIC=1]="STATIC",e[e.DYNAMIC=2]="DYNAMIC"}(Sh||(Sh={})),function(e){e[e.VERTEX=1]="VERTEX",e[e.INSTANCE=2]="INSTANCE"}(Rh||(Rh={})),function(e){e.LOADED="loaded"}(Ch||(Ch={})),function(e){e[e.TEXTURE_2D=0]="TEXTURE_2D",e[e.TEXTURE_2D_ARRAY=1]="TEXTURE_2D_ARRAY",e[e.TEXTURE_3D=2]="TEXTURE_3D",e[e.TEXTURE_CUBE_MAP=3]="TEXTURE_CUBE_MAP"}(Lh||(Lh={})),function(e){e[e.SAMPLED=1]="SAMPLED",e[e.RENDER_TARGET=2]="RENDER_TARGET",e[e.STORAGE=4]="STORAGE"}(Oh||(Oh={})),function(e){e[e.NONE=0]="NONE",e[e.RED=1]="RED",e[e.GREEN=2]="GREEN",e[e.BLUE=4]="BLUE",e[e.ALPHA=8]="ALPHA",e[e.RGB=7]="RGB",e[e.ALL=15]="ALL"}(Mh||(Mh={})),function(e){e[e.KEEP=7680]="KEEP",e[e.ZERO=0]="ZERO",e[e.REPLACE=7681]="REPLACE",e[e.INVERT=5386]="INVERT",e[e.INCREMENT_CLAMP=7682]="INCREMENT_CLAMP",e[e.DECREMENT_CLAMP=7683]="DECREMENT_CLAMP",e[e.INCREMENT_WRAP=34055]="INCREMENT_WRAP",e[e.DECREMENT_WRAP=34056]="DECREMENT_WRAP"}(Ih||(Ih={})),function(e){e[e.Float=0]="Float",e[e.UnfilterableFloat=1]="UnfilterableFloat",e[e.Uint=2]="Uint",e[e.Sint=3]="Sint",e[e.Depth=4]="Depth"}(wh||(wh={})),function(e){e[e.LOWER_LEFT=0]="LOWER_LEFT",e[e.UPPER_LEFT=1]="UPPER_LEFT"}(Ph||(Ph={})),function(e){e[e.NEGATIVE_ONE=0]="NEGATIVE_ONE",e[e.ZERO=1]="ZERO"}(Nh||(Nh={})),function(e){e[e.OcclusionConservative=0]="OcclusionConservative"}(Dh||(Dh={})),function(e){e[e.U8=1]="U8",e[e.U16=2]="U16",e[e.U32=3]="U32",e[e.S8=4]="S8",e[e.S16=5]="S16",e[e.S32=6]="S32",e[e.F16=7]="F16",e[e.F32=8]="F32",e[e.BC1=65]="BC1",e[e.BC2=66]="BC2",e[e.BC3=67]="BC3",e[e.BC4_UNORM=68]="BC4_UNORM",e[e.BC4_SNORM=69]="BC4_SNORM",e[e.BC5_UNORM=70]="BC5_UNORM",e[e.BC5_SNORM=71]="BC5_SNORM",e[e.U16_PACKED_5551=97]="U16_PACKED_5551",e[e.U16_PACKED_565=98]="U16_PACKED_565",e[e.D24=129]="D24",e[e.D32F=130]="D32F",e[e.D24S8=131]="D24S8",e[e.D32FS8=132]="D32FS8"}(Bh||(Bh={})),function(e){e[e.R=1]="R",e[e.RG=2]="RG",e[e.RGB=3]="RGB",e[e.RGBA=4]="RGBA",e[e.A=5]="A"}(Fh||(Fh={})),function(e){e[e.None=0]="None",e[e.Normalized=1]="Normalized",e[e.sRGB=2]="sRGB",e[e.Depth=4]="Depth",e[e.Stencil=8]="Stencil",e[e.RenderTarget=16]="RenderTarget",e[e.Luminance=32]="Luminance"}(Uh||(Uh={})),function(e){e[e.ALPHA=Gh(Bh.U8,Fh.A,Uh.None)]="ALPHA",e[e.U8_LUMINANCE=Gh(Bh.U8,Fh.A,Uh.Luminance)]="U8_LUMINANCE",e[e.F16_LUMINANCE=Gh(Bh.F16,Fh.A,Uh.Luminance)]="F16_LUMINANCE",e[e.F32_LUMINANCE=Gh(Bh.F32,Fh.A,Uh.Luminance)]="F32_LUMINANCE",e[e.F16_R=Gh(Bh.F16,Fh.R,Uh.None)]="F16_R",e[e.F16_RG=Gh(Bh.F16,Fh.RG,Uh.None)]="F16_RG",e[e.F16_RGB=Gh(Bh.F16,Fh.RGB,Uh.None)]="F16_RGB",e[e.F16_RGBA=Gh(Bh.F16,Fh.RGBA,Uh.None)]="F16_RGBA",e[e.F32_R=Gh(Bh.F32,Fh.R,Uh.None)]="F32_R",e[e.F32_RG=Gh(Bh.F32,Fh.RG,Uh.None)]="F32_RG",e[e.F32_RGB=Gh(Bh.F32,Fh.RGB,Uh.None)]="F32_RGB",e[e.F32_RGBA=Gh(Bh.F32,Fh.RGBA,Uh.None)]="F32_RGBA",e[e.U8_R=Gh(Bh.U8,Fh.R,Uh.None)]="U8_R",e[e.U8_R_NORM=Gh(Bh.U8,Fh.R,Uh.Normalized)]="U8_R_NORM",e[e.U8_RG=Gh(Bh.U8,Fh.RG,Uh.None)]="U8_RG",e[e.U8_RG_NORM=Gh(Bh.U8,Fh.RG,Uh.Normalized)]="U8_RG_NORM",e[e.U8_RGB=Gh(Bh.U8,Fh.RGB,Uh.None)]="U8_RGB",e[e.U8_RGB_NORM=Gh(Bh.U8,Fh.RGB,Uh.Normalized)]="U8_RGB_NORM",e[e.U8_RGB_SRGB=Gh(Bh.U8,Fh.RGB,Uh.sRGB|Uh.Normalized)]="U8_RGB_SRGB",e[e.U8_RGBA=Gh(Bh.U8,Fh.RGBA,Uh.None)]="U8_RGBA",e[e.U8_RGBA_NORM=Gh(Bh.U8,Fh.RGBA,Uh.Normalized)]="U8_RGBA_NORM",e[e.U8_RGBA_SRGB=Gh(Bh.U8,Fh.RGBA,Uh.sRGB|Uh.Normalized)]="U8_RGBA_SRGB",e[e.U16_R=Gh(Bh.U16,Fh.R,Uh.None)]="U16_R",e[e.U16_R_NORM=Gh(Bh.U16,Fh.R,Uh.Normalized)]="U16_R_NORM",e[e.U16_RG_NORM=Gh(Bh.U16,Fh.RG,Uh.Normalized)]="U16_RG_NORM",e[e.U16_RGBA_NORM=Gh(Bh.U16,Fh.RGBA,Uh.Normalized)]="U16_RGBA_NORM",e[e.U16_RGBA=Gh(Bh.U16,Fh.RGBA,Uh.None)]="U16_RGBA",e[e.U16_RGB=Gh(Bh.U16,Fh.RGB,Uh.None)]="U16_RGB",e[e.U16_RG=Gh(Bh.U16,Fh.RG,Uh.None)]="U16_RG",e[e.U32_R=Gh(Bh.U32,Fh.R,Uh.None)]="U32_R",e[e.U32_RG=Gh(Bh.U32,Fh.RG,Uh.None)]="U32_RG",e[e.U32_RGB=Gh(Bh.U32,Fh.RGB,Uh.None)]="U32_RGB",e[e.U32_RGBA=Gh(Bh.U32,Fh.RGBA,Uh.None)]="U32_RGBA",e[e.S8_R=Gh(Bh.S8,Fh.R,Uh.None)]="S8_R",e[e.S8_R_NORM=Gh(Bh.S8,Fh.R,Uh.Normalized)]="S8_R_NORM",e[e.S8_RG_NORM=Gh(Bh.S8,Fh.RG,Uh.Normalized)]="S8_RG_NORM",e[e.S8_RGB_NORM=Gh(Bh.S8,Fh.RGB,Uh.Normalized)]="S8_RGB_NORM",e[e.S8_RGBA_NORM=Gh(Bh.S8,Fh.RGBA,Uh.Normalized)]="S8_RGBA_NORM",e[e.S16_R=Gh(Bh.S16,Fh.R,Uh.None)]="S16_R",e[e.S16_RG=Gh(Bh.S16,Fh.RG,Uh.None)]="S16_RG",e[e.S16_RG_NORM=Gh(Bh.S16,Fh.RG,Uh.Normalized)]="S16_RG_NORM",e[e.S16_RGB_NORM=Gh(Bh.S16,Fh.RGB,Uh.Normalized)]="S16_RGB_NORM",e[e.S16_RGBA=Gh(Bh.S16,Fh.RGBA,Uh.None)]="S16_RGBA",e[e.S16_RGBA_NORM=Gh(Bh.S16,Fh.RGBA,Uh.Normalized)]="S16_RGBA_NORM",e[e.S32_R=Gh(Bh.S32,Fh.R,Uh.None)]="S32_R",e[e.S32_RG=Gh(Bh.S32,Fh.RG,Uh.None)]="S32_RG",e[e.S32_RGB=Gh(Bh.S32,Fh.RGB,Uh.None)]="S32_RGB",e[e.S32_RGBA=Gh(Bh.S32,Fh.RGBA,Uh.None)]="S32_RGBA",e[e.U16_RGBA_5551=Gh(Bh.U16_PACKED_5551,Fh.RGBA,Uh.Normalized)]="U16_RGBA_5551",e[e.U16_RGB_565=Gh(Bh.U16_PACKED_565,Fh.RGB,Uh.Normalized)]="U16_RGB_565",e[e.BC1=Gh(Bh.BC1,Fh.RGBA,Uh.Normalized)]="BC1",e[e.BC1_SRGB=Gh(Bh.BC1,Fh.RGBA,Uh.Normalized|Uh.sRGB)]="BC1_SRGB",e[e.BC2=Gh(Bh.BC2,Fh.RGBA,Uh.Normalized)]="BC2",e[e.BC2_SRGB=Gh(Bh.BC2,Fh.RGBA,Uh.Normalized|Uh.sRGB)]="BC2_SRGB",e[e.BC3=Gh(Bh.BC3,Fh.RGBA,Uh.Normalized)]="BC3",e[e.BC3_SRGB=Gh(Bh.BC3,Fh.RGBA,Uh.Normalized|Uh.sRGB)]="BC3_SRGB",e[e.BC4_UNORM=Gh(Bh.BC4_UNORM,Fh.R,Uh.Normalized)]="BC4_UNORM",e[e.BC4_SNORM=Gh(Bh.BC4_SNORM,Fh.R,Uh.Normalized)]="BC4_SNORM",e[e.BC5_UNORM=Gh(Bh.BC5_UNORM,Fh.RG,Uh.Normalized)]="BC5_UNORM",e[e.BC5_SNORM=Gh(Bh.BC5_SNORM,Fh.RG,Uh.Normalized)]="BC5_SNORM",e[e.D24=Gh(Bh.D24,Fh.R,Uh.Depth)]="D24",e[e.D24_S8=Gh(Bh.D24S8,Fh.RG,Uh.Depth|Uh.Stencil)]="D24_S8",e[e.D32F=Gh(Bh.D32F,Fh.R,Uh.Depth)]="D32F",e[e.D32F_S8=Gh(Bh.D32FS8,Fh.RG,Uh.Depth|Uh.Stencil)]="D32F_S8",e[e.U8_RGB_RT=Gh(Bh.U8,Fh.RGB,Uh.RenderTarget|Uh.Normalized)]="U8_RGB_RT",e[e.U8_RGBA_RT=Gh(Bh.U8,Fh.RGBA,Uh.RenderTarget|Uh.Normalized)]="U8_RGBA_RT",e[e.U8_RGBA_RT_SRGB=Gh(Bh.U8,Fh.RGBA,Uh.RenderTarget|Uh.Normalized|Uh.sRGB)]="U8_RGBA_RT_SRGB"}(kh||(kh={}));var Jh=$h(0,0,0,0),ed=($h(0,0,0,1),$h(1,1,1,0));function td(e){return!(!e||e&e-1)}function nd(e,t){return null!=e?e:t}function rd(e,t){var n=t-1;return e+n&~n}function id(e,t){e.blendDstFactor=t.blendDstFactor,e.blendSrcFactor=t.blendSrcFactor,e.blendMode=t.blendMode}function od(e,t){return void 0===e&&(e={}),e.compare=t.compare,e.depthFailOp=t.depthFailOp,e.passOp=t.passOp,e.failOp=t.failOp,e.mask=t.mask,e}function ad(e,t){return void 0===e&&(e={rgbBlendState:{},alphaBlendState:{},channelWriteMask:0}),id(e.rgbBlendState,t.rgbBlendState),id(e.alphaBlendState,t.alphaBlendState),e.channelWriteMask=t.channelWriteMask,e}function sd(e,t){e.length!==t.length&&(e.length=t.length);for(var n=0;n<t.length;n++)e[n]=ad(e[n],t[n])}function ld(e){var t=Object.assign({},e);return t.attachmentsState=[],sd(t.attachmentsState,e.attachmentsState),t.blendConstant=t.blendConstant&&Qh(t.blendConstant),t.stencilFront=od(void 0,e.stencilFront),t.stencilBack=od(void 0,e.stencilBack),t}$h(1,1,1,1);var cd={blendMode:yh.ADD,blendSrcFactor:vh.ONE,blendDstFactor:vh.ZERO},ud={attachmentsState:[{channelWriteMask:Mh.ALL,rgbBlendState:cd,alphaBlendState:cd}],blendConstant:Qh(Jh),depthWrite:!0,depthCompare:gh.LEQUAL,stencilWrite:!1,stencilFront:{compare:gh.ALWAYS,passOp:Ih.KEEP,depthFailOp:Ih.KEEP,failOp:Ih.KEEP},stencilBack:{compare:gh.ALWAYS,passOp:Ih.KEEP,depthFailOp:Ih.KEEP,failOp:Ih.KEEP},cullMode:_h.NONE,frontFace:mh.CCW,polygonOffset:!1,polygonOffsetFactor:0,polygonOffsetUnits:0};!function(e,t){void 0===e&&(e=null),void 0===t&&(t=ud);var n=ld(t);null!==e&&function(e,t){void 0!==t.attachmentsState&&sd(e.attachmentsState,t.attachmentsState),e.blendConstant&&t.blendConstant&&Kh(e.blendConstant,t.blendConstant),e.depthCompare=nd(t.depthCompare,e.depthCompare),e.depthWrite=nd(t.depthWrite,e.depthWrite),e.stencilWrite=nd(t.stencilWrite,e.stencilWrite),e.stencilFront&&t.stencilFront&&od(e.stencilFront,t.stencilFront),e.stencilBack&&t.stencilBack&&od(e.stencilBack,t.stencilBack),e.cullMode=nd(t.cullMode,e.cullMode),e.frontFace=nd(t.frontFace,e.frontFace),e.polygonOffset=nd(t.polygonOffset,e.polygonOffset),e.polygonOffsetFactor=nd(t.polygonOffsetFactor,e.polygonOffsetFactor),e.polygonOffsetUnits=nd(t.polygonOffsetUnits,e.polygonOffsetUnits)}(n,e)}({depthCompare:gh.ALWAYS,depthWrite:!1},ud);var hd,dd={texture:null,sampler:null,formatKind:wh.Float,dimension:Lh.TEXTURE_2D};function fd(e,t,n){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function pd(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=t(e[r]);return n}function gd(e,t){return e.texture===t.texture&&e.binding===t.binding}function md(e,t){return e.buffer===t.buffer&&e.size===t.size&&e.binding===t.binding&&e.offset===t.offset}function _d(e,t){return null===e?null===t:null!==t&&e.sampler===t.sampler&&e.texture===t.texture&&e.dimension===t.dimension&&e.formatKind===t.formatKind&&e.comparison===t.comparison}function vd(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&&fd(e.samplerBindings,t.samplerBindings,_d)&&fd(e.uniformBufferBindings,t.uniformBufferBindings,md)&&fd(e.storageBufferBindings,t.storageBufferBindings,md)&&fd(e.storageTextureBindings,t.storageTextureBindings,gd))}function yd(e,t){return e.blendMode==t.blendMode&&e.blendSrcFactor===t.blendSrcFactor&&e.blendDstFactor===t.blendDstFactor}function Ed(e,t){return!!yd(e.rgbBlendState,t.rgbBlendState)&&!!yd(e.alphaBlendState,t.alphaBlendState)&&e.channelWriteMask===t.channelWriteMask}function Ad(e,t){return e.compare==t.compare&&e.depthFailOp===t.depthFailOp&&e.failOp===t.failOp&&e.passOp===t.passOp&&e.mask===t.mask}function bd(e,t){return e.id===t.id}function Td(e,t){return e===t}function xd(e,t){return!(e.topology!==t.topology||e.inputLayout!==t.inputLayout||e.sampleCount!==t.sampleCount||e.megaStateDescriptor&&t.megaStateDescriptor&&!function(e,t){return!(!fd(e.attachmentsState,t.attachmentsState,Ed)||e.blendConstant&&t.blendConstant&&!qh(e.blendConstant,t.blendConstant)||e.stencilFront&&t.stencilFront&&!Ad(e.stencilFront,t.stencilFront)||e.stencilBack&&t.stencilBack&&!Ad(e.stencilBack,t.stencilBack)||e.depthCompare!==t.depthCompare||e.depthWrite!==t.depthWrite||e.stencilWrite!==t.stencilWrite||e.cullMode!==t.cullMode||e.frontFace!==t.frontFace||e.polygonOffset!==t.polygonOffset||e.polygonOffsetFactor!==t.polygonOffsetFactor||e.polygonOffsetUnits!==t.polygonOffsetUnits)}(e.megaStateDescriptor,t.megaStateDescriptor)||!bd(e.program,t.program)||!fd(e.colorAttachmentFormats,t.colorAttachmentFormats,Td)||e.depthStencilAttachmentFormat!==t.depthStencilAttachmentFormat)}function Sd(e,t){return e.offset===t.offset&&e.shaderLocation===t.shaderLocation&&e.format===t.format&&e.divisor===t.divisor}function Rd(e,t){return lh(e)?lh(t):!lh(t)&&e.arrayStride===t.arrayStride&&e.stepMode===t.stepMode&&fd(e.attributes,t.attributes,Sd)}function Cd(e,t){return e.indexBufferFormat===t.indexBufferFormat&&!!fd(e.vertexBufferDescriptors,t.vertexBufferDescriptors,Rd)&&!!bd(e.program,t.program)}function Ld(e){return{sampler:e.sampler,texture:e.texture,dimension:e.dimension,formatKind:e.formatKind,comparison:e.comparison}}function Od(e){var t=e.buffer,n=e.size;return{binding:e.binding,buffer:t,offset:e.offset,size:n}}function Md(e){return{binding:e.binding,texture:e.texture}}function Id(e){return{shaderLocation:e.shaderLocation,format:e.format,offset:e.offset,divisor:e.divisor}}function wd(e){return lh(e)?e:{arrayStride:e.arrayStride,stepMode:e.stepMode,attributes:pd(e.attributes,Id)}}var Pd=/([^[]*)(\[[0-9]+\])?/;function Nd(e){if("]"!==e[e.length-1])return{name:e,length:1,isArray:!1};var t=e.match(Pd);if(!t||t.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(e));return{name:t[1],length:Number(t[2])||1,isArray:Boolean(t[2])}}function Dd(){var e=null;return function(t,n,r){var i=e!==r;return i&&(t.uniform1i(n,r),e=r),i}}function Bd(e,t,n,r){var i=null,o=null;return function(a,s,l){var c=t(l,n),u=c.length,h=!1;if(null===i)i=new Float32Array(u),o=u,h=!0;else{Zh(o===u,"Uniform length cannot change.");for(var d=0;d<u;++d)if(c[d]!==i[d]){h=!0;break}}return h&&(r(a,e,s,c),i.set(c)),h}}function Fd(e,t,n,r){e[t](n,r)}function Ud(e,t,n,r){e[t](n,!1,r)}var kd={},Gd={},zd={},jd=[0];function Vd(e,t,n,r){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(jd[0]=e,e=jd);var i=e.length;if(e instanceof n)return e;var o=r[i];o||(o=new n(i),r[i]=o);for(var a=0;a<i;a++)o[a]=e[a];return o}function Hd(e,t){return Vd(e,t,Float32Array,kd)}function Wd(e,t){return Vd(e,t,Int32Array,Gd)}function Xd(e,t){return Vd(e,t,Uint32Array,zd)}var Zd=((hd={})[fh.FLOAT]=Bd.bind(null,"uniform1fv",Hd,1,Fd),hd[fh.FLOAT_VEC2]=Bd.bind(null,"uniform2fv",Hd,2,Fd),hd[fh.FLOAT_VEC3]=Bd.bind(null,"uniform3fv",Hd,3,Fd),hd[fh.FLOAT_VEC4]=Bd.bind(null,"uniform4fv",Hd,4,Fd),hd[fh.INT]=Bd.bind(null,"uniform1iv",Wd,1,Fd),hd[fh.INT_VEC2]=Bd.bind(null,"uniform2iv",Wd,2,Fd),hd[fh.INT_VEC3]=Bd.bind(null,"uniform3iv",Wd,3,Fd),hd[fh.INT_VEC4]=Bd.bind(null,"uniform4iv",Wd,4,Fd),hd[fh.BOOL]=Bd.bind(null,"uniform1iv",Wd,1,Fd),hd[fh.BOOL_VEC2]=Bd.bind(null,"uniform2iv",Wd,2,Fd),hd[fh.BOOL_VEC3]=Bd.bind(null,"uniform3iv",Wd,3,Fd),hd[fh.BOOL_VEC4]=Bd.bind(null,"uniform4iv",Wd,4,Fd),hd[fh.FLOAT_MAT2]=Bd.bind(null,"uniformMatrix2fv",Hd,4,Ud),hd[fh.FLOAT_MAT3]=Bd.bind(null,"uniformMatrix3fv",Hd,9,Ud),hd[fh.FLOAT_MAT4]=Bd.bind(null,"uniformMatrix4fv",Hd,16,Ud),hd[fh.UNSIGNED_INT]=Bd.bind(null,"uniform1uiv",Xd,1,Fd),hd[fh.UNSIGNED_INT_VEC2]=Bd.bind(null,"uniform2uiv",Xd,2,Fd),hd[fh.UNSIGNED_INT_VEC3]=Bd.bind(null,"uniform3uiv",Xd,3,Fd),hd[fh.UNSIGNED_INT_VEC4]=Bd.bind(null,"uniform4uiv",Xd,4,Fd),hd[fh.FLOAT_MAT2x3]=Bd.bind(null,"uniformMatrix2x3fv",Hd,6,Ud),hd[fh.FLOAT_MAT2x4]=Bd.bind(null,"uniformMatrix2x4fv",Hd,8,Ud),hd[fh.FLOAT_MAT3x2]=Bd.bind(null,"uniformMatrix3x2fv",Hd,6,Ud),hd[fh.FLOAT_MAT3x4]=Bd.bind(null,"uniformMatrix3x4fv",Hd,12,Ud),hd[fh.FLOAT_MAT4x2]=Bd.bind(null,"uniformMatrix4x2fv",Hd,8,Ud),hd[fh.FLOAT_MAT4x3]=Bd.bind(null,"uniformMatrix4x3fv",Hd,12,Ud),hd[fh.SAMPLER_2D]=Dd,hd[fh.SAMPLER_CUBE]=Dd,hd[fh.SAMPLER_3D]=Dd,hd[fh.SAMPLER_2D_SHADOW]=Dd,hd[fh.SAMPLER_2D_ARRAY]=Dd,hd[fh.SAMPLER_2D_ARRAY_SHADOW]=Dd,hd[fh.SAMPLER_CUBE_SHADOW]=Dd,hd[fh.INT_SAMPLER_2D]=Dd,hd[fh.INT_SAMPLER_3D]=Dd,hd[fh.INT_SAMPLER_CUBE]=Dd,hd[fh.INT_SAMPLER_2D_ARRAY]=Dd,hd[fh.UNSIGNED_INT_SAMPLER_2D]=Dd,hd[fh.UNSIGNED_INT_SAMPLER_3D]=Dd,hd[fh.UNSIGNED_INT_SAMPLER_CUBE]=Dd,hd[fh.UNSIGNED_INT_SAMPLER_2D_ARRAY]=Dd,hd);function Yd(e,t,n){var r=Zd[n.type];if(!r)throw new Error("Unknown GLSL uniform type ".concat(n.type));return r().bind(null,e,t)}var qd={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121};function Kd(e,t){return"#define ".concat(e," ").concat(t)}function Qd(e){if(void 0===e)return null;var t=/binding\s*=\s*(\d+)/.exec(e);if(null!==t){var n=parseInt(t[1],10);if(!Number.isNaN(n))return n}return null}function $d(e){return[e,""]}function Jd(e,t,n,r,i){var o;void 0===r&&(r=null),void 0===i&&(i=!0);var a="#version 100"===e.glslVersion,s="frag"===t&&(null===(o=n.match(/^\s*layout\(location\s*=\s*\d*\)\s*out\s+vec4\s*(.*);$/gm))||void 0===o?void 0:o.length)>1,l=n.replace("\r\n","\n").split("\n").map((function(e){return e.replace(/[/][/].*$/,"")})).filter((function(e){return!(!e||/^\s+$/.test(e))})),c="";null!==r&&(c=Object.keys(r).map((function(e){return Kd(e,r[e])})).join("\n"));var u=l.find((function(e){return e.startsWith("precision")}))||"precision mediump float;",h=i?l.filter((function(e){return!e.startsWith("precision")})).join("\n"):l.join("\n"),d="";if(e.viewportOrigin===Ph.UPPER_LEFT&&(d+="".concat(Kd("VIEWPORT_ORIGIN_TL","1"),"\n")),e.clipSpaceNearZ===Nh.ZERO&&(d+="".concat(Kd("CLIPSPACE_NEAR_ZERO","1"),"\n")),e.explicitBindingLocations){var f=0,p=0,g=0;h=h.replace(/^\s*(layout\((.*)\))?\s*uniform(.+{)$/gm,(function(e,t,n,r){var i=n?"".concat(n,", "):"";return"layout(".concat(i,"set = ").concat(f,", binding = ").concat(p++,") uniform ").concat(r)})),f++,p=0,Zh(e.separateSamplerTextures),h=h.replace(/^\s*(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm,(function(e,n,r,i,o){var a=Qd(r);null===a&&(a=p++);var s=(0,hh.zs)($d(i),2),l=s[0],c=s[1];return"frag"===t?"\nlayout(set = ".concat(f,", binding = ").concat(2*a+0,") uniform texture").concat(l," T_").concat(o,";\nlayout(set = ").concat(f,", binding = ").concat(2*a+1,") uniform sampler").concat(c," S_").concat(o,";").trim():""})),h=h.replace("frag"===t?/^\s*\b(varying|in)\b/gm:/^\s*\b(varying|out)\b/gm,(function(e,t){return"layout(location = ".concat(g++,") ").concat(t)})),d+="".concat(Kd("gl_VertexID","gl_VertexIndex"),"\n"),d+="".concat(Kd("gl_InstanceID","gl_InstanceIndex"),"\n"),u=u.replace(/^precision (.*) sampler(.*);$/gm,"")}else{var m=0;h=h.replace(/^\s*(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm,(function(e,t,n,r,i){var o=Qd(n);return null===o&&(o=m++),"uniform sampler".concat(r," ").concat(i,"; // BINDING=").concat(o)}))}if(h=(h=(h=h.replace(/\bPU_SAMPLER_(\w+)\((.*?)\)/g,(function(e,t,n){return"SAMPLER_".concat(t,"(P_").concat(n,")")}))).replace(/\bPF_SAMPLER_(\w+)\((.*?)\)/g,(function(e,t,n){return"PP_SAMPLER_".concat(t,"(P_").concat(n,")")}))).replace(/\bPU_TEXTURE\((.*?)\)/g,(function(e,t){return"TEXTURE(P_".concat(t,")")})),e.separateSamplerTextures)h=h.replace(/\bPD_SAMPLER_(\w+)\((.*?)\)/g,(function(e,t,n){var r=(0,hh.zs)($d(t),2),i=r[0],o=r[1];return"texture".concat(i," T_P_").concat(n,", sampler").concat(o," S_P_").concat(n)})),h=(h=(h=h.replace(/\bPP_SAMPLER_(\w+)\((.*?)\)/g,(function(e,t,n){return"T_".concat(n,", S_").concat(n)}))).replace(/\bSAMPLER_(\w+)\((.*?)\)/g,(function(e,t,n){return"sampler".concat(t,"(T_").concat(n,", S_").concat(n,")")}))).replace(/\bTEXTURE\((.*?)\)/g,(function(e,t){return"T_".concat(t)}));else{var _=[];h=(h=(h=h.replace(/\bPD_SAMPLER_(\w+)\((.*?)\)/g,(function(e,t,n){return"sampler".concat(t," P_").concat(n)}))).replace(/\bPP_SAMPLER_(\w+)\((.*?)\)/g,(function(e,t,n){return n}))).replace(/\bSAMPLER_(\w+)\((.*?)\)/g,(function(e,t,n){return _.push([n,t]),n})),a&&_.forEach((function(e){var t=(0,hh.zs)(e,2),n=t[0],r=t[1];h=h.replace(new RegExp("texture\\(".concat(n),"g"),(function(){return"texture".concat(r,"(").concat(n)}))})),h=h.replace(/\bTEXTURE\((.*?)\)/g,(function(e,t){return t}))}var v="".concat(a?"":e.glslVersion,"\n").concat(a&&s?"#extension GL_EXT_draw_buffers : require\n":"","\n").concat(a&&"frag"===t?"#extension GL_OES_standard_derivatives : enable\n":"").concat(i?u:"","\n").concat(d||"").concat(c?c+"\n":"","\n").concat(h,"\n").trim();if(e.explicitBindingLocations&&"frag"===t&&(v=v.replace(/^\b(out)\b/g,(function(e,t){return"layout(location = 0) ".concat(t)}))),a){if("frag"===t&&(v=v.replace(/^\s*in\s+(\S+)\s*(.*);$/gm,(function(e,t,n){return"varying ".concat(t," ").concat(n,";\n")}))),"vert"===t&&(v=(v=v.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,(function(e,t,n){return"varying ".concat(t," ").concat(n,";\n")}))).replace(/^\s*layout\(location\s*=\s*\S*\)\s*in\s+(\S+)\s*(.*);$/gm,(function(e,t,n){return"attribute ".concat(t," ").concat(n,";\n")}))),v=v.replace(/\s*uniform\s*.*\s*{((?:\s*.*\s*)*?)};/g,(function(e,t){return t.trim().replace(/^.*$/gm,(function(e){var t=e.trim();return t.startsWith("#")?t:e?"uniform ".concat(t):""}))})),"frag"===t)if(s){var y=[],E=(v=v.replace(/^\s*layout\(location\s*=\s*\d*\)\s*out\s+vec4\s*(.*);$/gm,(function(e,t){return y.push(t),"vec4 ".concat(t,";\n")}))).lastIndexOf("}");v=v.substring(0,E)+"\n ".concat(y.map((function(e,t){return"gl_FragData[".concat(t,"] = ").concat(e,";\n ")})).join("\n"))+v.substring(E)}else{var A;v=v.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,(function(e,t,n){return A=n,"".concat(t," ").concat(n,";\n")})),A&&(E=v.lastIndexOf("}"),v=v.substring(0,E)+"\n gl_FragColor = vec4(".concat(A,");\n")+v.substring(E))}v=v.replace(/^\s*layout\((.*)\)/gm,"")}return v}var ef=function(e){function t(t){var n=t.id,r=t.device,i=e.call(this)||this;return i.id=n,i.device=r,null!==i.device.resourceCreationTracker&&i.device.resourceCreationTracker.trackResourceCreated(i),i}return(0,hh.C6)(t,e),t.prototype.destroy=function(){null!==this.device.resourceCreationTracker&&this.device.resourceCreationTracker.trackResourceDestroyed(this)},t}(dh),tf=function(e){function t(t){var n=t.id,r=t.device,i=t.descriptor,o=e.call(this,{id:n,device:r})||this;o.type=ph.Bindings;var a=i.uniformBufferBindings,s=i.samplerBindings;return o.uniformBufferBindings=a||[],o.samplerBindings=s||[],o.bindingLayouts=o.createBindingLayouts(),o}return(0,hh.C6)(t,e),t.prototype.createBindingLayouts=function(){var e=0,t=0,n=[],r=this.uniformBufferBindings.length,i=this.samplerBindings.length;return n.push({firstUniformBuffer:e,numUniformBuffers:r,firstSampler:t,numSamplers:i}),{numUniformBuffers:e+=r,numSamplers:t+=i,bindingLayoutTables:n}},t}(ef);function nf(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}function rf(e){switch(jh(e)){case Bh.BC1:case Bh.BC2:case Bh.BC3:case Bh.BC4_UNORM:case Bh.BC4_SNORM:case Bh.BC5_UNORM:case Bh.BC5_SNORM:return!0;default:return!1}}function of(e){if(Vh(e)&Uh.Normalized)return!1;var t=jh(e);return t===Bh.S8||t===Bh.S16||t===Bh.S32||t===Bh.U8||t===Bh.U16||t===Bh.U32}function af(e){return e&xh.INDEX?fh.ELEMENT_ARRAY_BUFFER:e&xh.VERTEX?fh.ARRAY_BUFFER:e&xh.UNIFORM?fh.UNIFORM_BUFFER:void 0}function sf(e){var t=jh(e),n=zh(e),r=Vh(e),i=function(e){switch(e){case Bh.U8:return fh.UNSIGNED_BYTE;case Bh.U16:return fh.UNSIGNED_SHORT;case Bh.U32:return fh.UNSIGNED_INT;case Bh.S8:return fh.BYTE;case Bh.S16:return fh.SHORT;case Bh.S32:return fh.INT;case Bh.F16:return fh.HALF_FLOAT;case Bh.F32:return fh.FLOAT;default:throw new Error("whoops")}}(t),o=function(e){switch(e){case Fh.R:return 1;case Fh.RG:return 2;case Fh.RGB:return 3;case Fh.RGBA:return 4;default:return 1}}(n);return{size:o,type:i,normalized:!!(r&Uh.Normalized)}}function lf(e){switch(e){case Eh.CLAMP_TO_EDGE:return fh.CLAMP_TO_EDGE;case Eh.REPEAT:return fh.REPEAT;case Eh.MIRRORED_REPEAT:return fh.MIRRORED_REPEAT;default:throw new Error("whoops")}}function cf(e,t){if(t===bh.LINEAR&&e===Ah.BILINEAR)return fh.LINEAR_MIPMAP_LINEAR;if(t===bh.LINEAR&&e===Ah.POINT)return fh.NEAREST_MIPMAP_LINEAR;if(t===bh.NEAREST&&e===Ah.BILINEAR)return fh.LINEAR_MIPMAP_NEAREST;if(t===bh.NEAREST&&e===Ah.POINT)return fh.NEAREST_MIPMAP_NEAREST;if(t===bh.NO_MIP&&e===Ah.BILINEAR)return fh.LINEAR;if(t===bh.NO_MIP&&e===Ah.POINT)return fh.NEAREST;throw new Error("Unknown texture filter mode")}function uf(e,t){void 0===t&&(t=0);var n=e;return n.gl_buffer_pages[t/n.pageByteSize|0]}function hf(e){return e.gl_texture}function df(e){return e.gl_sampler}function ff(e,t){e.name=t,e.__SPECTOR_Metadata={name:t}}function pf(e,t){for(var n=[];;){var r=t.exec(e);if(!r)break;n.push(r)}return n}function gf(e){return e.blendMode==yh.ADD&&e.blendSrcFactor==vh.ONE&&e.blendDstFactor===vh.ZERO}function mf(e){if(e===Lh.TEXTURE_2D)return fh.TEXTURE_2D;if(e===Lh.TEXTURE_2D_ARRAY)return fh.TEXTURE_2D_ARRAY;if(e===Lh.TEXTURE_CUBE_MAP)return fh.TEXTURE_CUBE_MAP;if(e===Lh.TEXTURE_3D)return fh.TEXTURE_3D;throw new Error("whoops")}function _f(e,t,n,r){return e%n==0&&t%r==0}var vf,yf=function(e){function t(t){var n=t.id,r=t.device,i=t.descriptor,o=e.call(this,{id:n,device:r})||this;o.type=ph.Buffer;var a=i.viewOrSize,s=i.usage,l=i.hint,c=void 0===l?Sh.STATIC:l,u=r.uniformBufferMaxPageByteSize,h=r.gl,d=s&xh.UNIFORM;d||(nf(h)?h.bindVertexArray(null):r.OES_vertex_array_object.bindVertexArrayOES(null));var f,p=uh(a)?rd(a,4):rd(a.byteLength,4);if(o.gl_buffer_pages=[],d){for(var g=p;g>0;)o.gl_buffer_pages.push(o.createBufferPage(Math.min(g,u),s,c)),g-=u;f=u}else o.gl_buffer_pages.push(o.createBufferPage(p,s,c)),f=p;return o.pageByteSize=f,o.byteSize=p,o.usage=s,o.gl_target=af(s),uh(a)||o.setSubData(0,new Uint8Array(a.buffer)),d||(nf(h)?h.bindVertexArray(o.device.currentBoundVAO):r.OES_vertex_array_object.bindVertexArrayOES(o.device.currentBoundVAO)),o}return(0,hh.C6)(t,e),t.prototype.setSubData=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=t.byteLength-n);for(var i=this.device.gl,o=this.pageByteSize,a=e+r,s=e,l=e%o;s<a;){var c=nf(i)?i.COPY_WRITE_BUFFER:this.gl_target,u=uf(this,s);if(u.ubo)return;i.bindBuffer(c,u),nf(i)?i.bufferSubData(c,l,t,n,Math.min(a-s,o)):i.bufferSubData(c,l,t),s+=o,l=0,n+=o,this.device.debugGroupStatisticsBufferUpload()}},t.prototype.destroy=function(){e.prototype.destroy.call(this);for(var t=0;t<this.gl_buffer_pages.length;t++)this.gl_buffer_pages[t].ubo||this.device.gl.deleteBuffer(this.gl_buffer_pages[t]);this.gl_buffer_pages=[]},t.prototype.createBufferPage=function(e,t,n){var r=this.device.gl,i=t&xh.UNIFORM;if(!nf(r)&&i)return{ubo:!0};var o=this.device.ensureResourceExists(r.createBuffer()),a=af(t),s=function(e){switch(e){case Sh.STATIC:return fh.STATIC_DRAW;case Sh.DYNAMIC:return fh.DYNAMIC_DRAW}}(n);return r.bindBuffer(a,o),r.bufferData(a,e,s),o},t}(ef),Ef=function(e){function t(t){var n,r,i,o,a,s=t.id,l=t.device,c=t.descriptor,u=e.call(this,{id:s,device:l})||this;u.type=ph.InputLayout;var h=c.vertexBufferDescriptors,d=c.indexBufferFormat,f=c.program;Zh(d===kh.U16_R||d===kh.U32_R||null===d);var p=null!==d?function(e){switch(e){case kh.U8_R:return fh.UNSIGNED_BYTE;case kh.U16_R:return fh.UNSIGNED_SHORT;case kh.U32_R:return fh.UNSIGNED_INT;default:throw new Error("whoops")}}(d):null,g=null!==d?Wh(d):null,m=u.device.gl,_=u.device.ensureResourceExists(nf(m)?m.createVertexArray():l.OES_vertex_array_object.createVertexArrayOES());nf(m)?m.bindVertexArray(_):l.OES_vertex_array_object.bindVertexArrayOES(_),m.bindBuffer(m.ARRAY_BUFFER,uf(u.device.fallbackVertexBuffer));try{for(var v=(0,hh.Ju)(c.vertexBufferDescriptors),y=v.next();!y.done;y=v.next()){var E=y.value,A=E.stepMode,b=E.attributes;try{for(var T=(i=void 0,(0,hh.Ju)(b)),x=T.next();!x.done;x=T.next()){var S=x.value,R=S.shaderLocation,C=S.format,L=S.divisor,O=void 0===L?1:L,M=nf(m)?R:null===(a=f.attributes[R])||void 0===a?void 0:a.location,I=sf(C);if(S.vertexFormat=I,!lh(M)){of(C);var w=I.size,P=I.type,N=I.normalized;m.vertexAttribPointer(M,w,P,N,0,0),A===Rh.INSTANCE&&(nf(m)?m.vertexAttribDivisor(M,O):l.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(M,O)),m.enableVertexAttribArray(M)}}}catch(e){i={error:e}}finally{try{x&&!x.done&&(o=T.return)&&o.call(T)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}return nf(m)?m.bindVertexArray(null):l.OES_vertex_array_object.bindVertexArrayOES(null),u.vertexBufferDescriptors=h,u.vao=_,u.indexBufferFormat=d,u.indexBufferType=p,u.indexBufferCompByteSize=g,u.program=f,u}return(0,hh.C6)(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this),this.device.currentBoundVAO===this.vao&&(nf(this.device.gl)?(this.device.gl.bindVertexArray(null),this.device.gl.deleteVertexArray(this.vao)):(this.device.OES_vertex_array_object.bindVertexArrayOES(null),this.device.OES_vertex_array_object.deleteVertexArrayOES(this.vao)),this.device.currentBoundVAO=null)},t}(ef),Af=function(e){function t(t){var n=t.id,r=t.device,i=t.descriptor,o=t.fake,a=e.call(this,{id:n,device:r})||this;a.type=ph.Texture,i=(0,hh.Cl)({dimension:Lh.TEXTURE_2D,depthOrArrayLayers:1,mipLevelCount:1},i);var s,l,c=a.device.gl,u=a.clampmipLevelCount(i);if(a.immutable=i.usage===Oh.RENDER_TARGET,a.pixelStore=i.pixelStore,a.format=i.format,a.dimension=i.dimension,a.formatKind=Xh(i.format),a.width=i.width,a.height=i.height,a.depthOrArrayLayers=i.depthOrArrayLayers,a.mipmaps=u>=1,!o){l=a.device.ensureResourceExists(c.createTexture());var h=a.device.translateTextureType(i.format),d=a.device.translateTextureInternalFormat(i.format);if(a.device.setActiveTexture(c.TEXTURE0),a.device.currentTextures[0]=null,a.preprocessImage(),i.dimension===Lh.TEXTURE_2D){if(s=fh.TEXTURE_2D,c.bindTexture(s,l),a.immutable)if(nf(c))c.texStorage2D(s,u,d,i.width,i.height);else{var f=(d===fh.DEPTH_COMPONENT||a.isNPOT(),0);(a.format!==kh.D32F&&a.format!==kh.D24_S8||nf(c)||r.WEBGL_depth_texture)&&(c.texImage2D(s,f,d,i.width,i.height,0,d,h,null),a.mipmaps&&(a.mipmaps=!1,c.texParameteri(fh.TEXTURE_2D,fh.TEXTURE_MIN_FILTER,fh.LINEAR),c.texParameteri(fh.TEXTURE_2D,fh.TEXTURE_WRAP_S,fh.CLAMP_TO_EDGE),c.texParameteri(fh.TEXTURE_2D,fh.TEXTURE_WRAP_T,fh.CLAMP_TO_EDGE)))}Zh(1===i.depthOrArrayLayers)}else if(i.dimension===Lh.TEXTURE_2D_ARRAY)s=fh.TEXTURE_2D_ARRAY,c.bindTexture(s,l),a.immutable&&nf(c)&&c.texStorage3D(s,u,d,i.width,i.height,i.depthOrArrayLayers);else if(i.dimension===Lh.TEXTURE_3D)s=fh.TEXTURE_3D,c.bindTexture(s,l),a.immutable&&nf(c)&&c.texStorage3D(s,u,d,i.width,i.height,i.depthOrArrayLayers);else{if(i.dimension!==Lh.TEXTURE_CUBE_MAP)throw new Error("whoops");s=fh.TEXTURE_CUBE_MAP,c.bindTexture(s,l),a.immutable&&nf(c)&&c.texStorage2D(s,u,d,i.width,i.height),Zh(6===i.depthOrArrayLayers)}}return a.gl_texture=l,a.gl_target=s,a.mipLevelCount=u,a}return(0,hh.C6)(t,e),t.prototype.setImageData=function(e,t){void 0===t&&(t=0);var n=this.device.gl;rf(this.format);var r,i=this.gl_target===fh.TEXTURE_3D||this.gl_target===fh.TEXTURE_2D_ARRAY,o=this.gl_target===fh.TEXTURE_CUBE_MAP,a=(r=e[0],Object.prototype.toString.call(r)in qd);this.device.setActiveTexture(n.TEXTURE0),this.device.currentTextures[0]=null;var s,l,c=e[0];a?(s=this.width,l=this.height):(s=c.width,l=c.height,this.width=s,this.height=l),n.bindTexture(this.gl_target,this.gl_texture);var u=this.device.translateTextureFormat(this.format),h=nf(n)?this.device.translateInternalTextureFormat(this.format):u,d=this.device.translateTextureType(this.format);this.preprocessImage();for(var f=0;f<this.depthOrArrayLayers;f++){var p=e[f],g=this.gl_target;o&&(g=fh.TEXTURE_CUBE_MAP_POSITIVE_X+f%6),this.immutable?n.texSubImage2D(g,t,0,0,s,l,u,d,p):nf(n)?i?n.texImage3D(g,t,h,s,l,this.depthOrArrayLayers,0,u,d,p):n.texImage2D(g,t,h,s,l,0,u,d,p):a?n.texImage2D(g,t,u,s,l,0,u,d,p):n.texImage2D(g,t,u,u,d,p)}this.mipmaps&&this.generateMipmap(i)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.device.gl.deleteTexture(hf(this))},t.prototype.clampmipLevelCount=function(e){if(e.dimension===Lh.TEXTURE_2D_ARRAY&&e.depthOrArrayLayers>1&&jh(e.format)===Bh.BC1)for(var t=e.width,n=e.height,r=0;r<e.mipLevelCount;r++){if(t<=2||n<=2)return r-1;t=Math.max(t/2|0,1),n=Math.max(n/2|0,1)}return e.mipLevelCount},t.prototype.preprocessImage=function(){var e=this.device.gl;this.pixelStore&&(this.pixelStore.unpackFlipY&&e.pixelStorei(fh.UNPACK_FLIP_Y_WEBGL,!0),this.pixelStore.packAlignment&&e.pixelStorei(fh.PACK_ALIGNMENT,this.pixelStore.packAlignment),this.pixelStore.unpackAlignment&&e.pixelStorei(fh.UNPACK_ALIGNMENT,this.pixelStore.unpackAlignment))},t.prototype.generateMipmap=function(e){void 0===e&&(e=!1);var t=this.device.gl;return!nf(t)&&this.isNPOT()||this.gl_texture&&this.gl_target&&(t.bindTexture(this.gl_target,this.gl_texture),e?(t.texParameteri(this.gl_target,fh.TEXTURE_BASE_LEVEL,0),t.texParameteri(this.gl_target,fh.TEXTURE_MAX_LEVEL,Math.log2(this.width)),t.texParameteri(this.gl_target,fh.TEXTURE_MIN_FILTER,fh.LINEAR_MIPMAP_LINEAR),t.texParameteri(this.gl_target,fh.TEXTURE_MAG_FILTER,fh.LINEAR)):t.texParameteri(fh.TEXTURE_2D,fh.TEXTURE_MIN_FILTER,fh.NEAREST_MIPMAP_LINEAR),t.generateMipmap(this.gl_target),t.bindTexture(this.gl_target,null)),this},t.prototype.isNPOT=function(){return!(nf(this.device.gl)||td(this.width)&&td(this.height))},t}(ef),bf=function(e){function t(t){var n=t.id,r=t.device,i=t.descriptor,o=e.call(this,{id:n,device:r})||this;o.type=ph.RenderTarget,o.gl_renderbuffer=null,o.texture=null;var a=o.device.gl,s=i.format,l=i.width,c=i.height,u=i.sampleCount,h=void 0===u?1:u,d=i.texture,f=!1;if(s!==kh.D32F&&s!==kh.D24_S8||!d||nf(a)||r.WEBGL_depth_texture||(d.destroy(),o.texture=null,f=!0),!f&&d)o.texture=d;else{o.gl_renderbuffer=o.device.ensureResourceExists(a.createRenderbuffer()),a.bindRenderbuffer(a.RENDERBUFFER,o.gl_renderbuffer);var p=o.device.translateTextureInternalFormat(s,!0);nf(a)&&h>1?a.renderbufferStorageMultisample(fh.RENDERBUFFER,h,p,l,c):a.renderbufferStorage(fh.RENDERBUFFER,p,l,c)}return o.format=s,o.width=l,o.height=c,o.sampleCount=h,o}return(0,hh.C6)(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this),null!==this.gl_renderbuffer&&this.device.gl.deleteRenderbuffer(this.gl_renderbuffer),this.texture&&this.texture.destroy()},t}(ef);!function(e){e[e.NeedsCompile=0]="NeedsCompile",e[e.Compiling=1]="Compiling",e[e.NeedsBind=2]="NeedsBind",e[e.ReadyToUse=3]="ReadyToUse"}(vf||(vf={}));var Tf=function(e){function t(t,n){var r=t.id,i=t.device,o=t.descriptor,a=e.call(this,{id:r,device:i})||this;a.rawVertexGLSL=n,a.type=ph.Program,a.uniformSetters={},a.attributes=[];var s=a.device.gl;return a.descriptor=o,a.gl_program=a.device.ensureResourceExists(s.createProgram()),a.gl_shader_vert=null,a.gl_shader_frag=null,a.compileState=vf.NeedsCompile,a.tryCompileProgram(),a}return(0,hh.C6)(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this),this.device.gl.deleteProgram(this.gl_program),this.device.gl.deleteShader(this.gl_shader_vert),this.device.gl.deleteShader(this.gl_shader_frag)},t.prototype.tryCompileProgram=function(){Zh(this.compileState===vf.NeedsCompile);var e=this.descriptor,t=e.vertex,n=e.fragment,r=this.device.gl;(null==t?void 0:t.glsl)&&(null==n?void 0:n.glsl)&&(this.gl_shader_vert=this.compileShader(t.postprocess?t.postprocess(t.glsl):t.glsl,r.VERTEX_SHADER),this.gl_shader_frag=this.compileShader(n.postprocess?n.postprocess(n.glsl):n.glsl,r.FRAGMENT_SHADER),r.attachShader(this.gl_program,this.gl_shader_vert),r.attachShader(this.gl_program,this.gl_shader_frag),r.linkProgram(this.gl_program),this.compileState=vf.Compiling,nf(r)||(this.readUniformLocationsFromLinkedProgram(),this.readAttributesFromLinkedProgram()))},t.prototype.readAttributesFromLinkedProgram=function(){for(var e,t=this.device.gl,n=t.getProgramParameter(this.gl_program,t.ACTIVE_ATTRIBUTES),r=function(e){var t={};return e.replace(/^\s*#define\s*(\S*)\s*(\S*)\s*$/gm,(function(e,n,r){var i=Number(r);return t[n]=isNaN(i)?r:i,""})),t}(this.descriptor.vertex.glsl),i=function(e,t){var n=[];return e.replace(/^\s*layout\(location\s*=\s*(\S*)\)\s*in\s+\S+\s*(.*);$/gm,(function(e,r,i){var o=Number(r);return n.push({location:isNaN(o)?t[r]:o,name:i}),""})),n}(this.rawVertexGLSL,r),o=function(n){var r=t.getActiveAttrib(a.gl_program,n),o=r.name,s=r.type,l=r.size,c=t.getAttribLocation(a.gl_program,o),u=null===(e=i.find((function(e){return e.name===o})))||void 0===e?void 0:e.location;c>=0&&!lh(u)&&(a.attributes[u]={name:o,location:c,type:s,size:l})},a=this,s=0;s<n;s++)o(s)},t.prototype.readUniformLocationsFromLinkedProgram=function(){for(var e=this.device.gl,t=e.getProgramParameter(this.gl_program,e.ACTIVE_UNIFORMS),n=0;n<t;n++){var r=e.getActiveUniform(this.gl_program,n),i=Nd(r.name).name,o=e.getUniformLocation(this.gl_program,i);if(this.uniformSetters[i]=Yd(e,o,r),r&&r.size>1)for(var a=0;a<r.size;a++)o=e.getUniformLocation(this.gl_program,"".concat(i,"[").concat(a,"]")),this.uniformSetters["".concat(i,"[").concat(a,"]")]=Yd(e,o,r)}},t.prototype.compileShader=function(e,t){var n=this.device.gl,r=this.device.ensureResourceExists(n.createShader(t));return n.shaderSource(r,e),n.compileShader(r),r},t.prototype.setUniformsLegacy=function(e){void 0===e&&(e={});var t=this.device.gl;if(!nf(t)){var n=!1;for(var r in e){n||(t.useProgram(this.gl_program),n=!0);var i=e[r],o=this.uniformSetters[r];if(o){var a=i;a instanceof Af&&(a=a.textureIndex),o(a)}}}return this},t}(ef),xf=function(e){function t(t){var n=t.id,r=t.device,i=t.descriptor,o=e.call(this,{id:n,device:r})||this;o.type=ph.QueryPool;var a=o.device.gl;if(nf(a)){var s=i.elemCount,l=i.type;o.gl_query=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=o.device.ensureResourceExists(a.createQuery());return t}(s),o.gl_query_type=function(e){if(e===Dh.OcclusionConservative)return fh.ANY_SAMPLES_PASSED_CONSERVATIVE;throw new Error("whoops")}(l)}return o}return(0,hh.C6)(t,e),t.prototype.queryResultOcclusion=function(e){var t=this.device.gl;if(nf(t)){var n=this.gl_query[e];return t.getQueryParameter(n,t.QUERY_RESULT_AVAILABLE)?!!t.getQueryParameter(n,t.QUERY_RESULT):null}return null},t.prototype.destroy=function(){e.prototype.destroy.call(this);var t=this.device.gl;if(nf(t))for(var n=0;n<this.gl_query.length;n++)t.deleteQuery(this.gl_query[n])},t}(ef),Sf=function(e){function t(t){var n=t.id,r=t.device,i=e.call(this,{id:n,device:r})||this;return i.type=ph.Readback,i.gl_pbo=null,i.gl_sync=null,i}return(0,hh.C6)(t,e),t.prototype.clientWaitAsync=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=10);var r=this.device.gl;return new Promise((function(i,o){!function a(){var s,l,c,u=r.clientWaitSync(e,t,0);u!=r.WAIT_FAILED?u!=r.TIMEOUT_EXPIRED?i():setTimeout(a,(s=n,l=0,c=r.MAX_CLIENT_WAIT_TIMEOUT_WEBGL,s<l?l:s>c?c:s)):o()}()}))},t.prototype.getBufferSubDataAsync=function(e,t,n,r,i,o){return(0,hh.sH)(this,void 0,void 0,(function(){var a;return(0,hh.YH)(this,(function(s){switch(s.label){case 0:return nf(a=this.device.gl)?(this.gl_sync=a.fenceSync(a.SYNC_GPU_COMMANDS_COMPLETE,0),a.flush(),[4,this.clientWaitAsync(this.gl_sync,0,10)]):[3,2];case 1:return s.sent(),a.bindBuffer(e,t),a.getBufferSubData(e,n,r,i,o),a.bindBuffer(e,null),[2,r];case 2:return[2]}}))}))},t.prototype.readTexture=function(e,t,n,r,i,o,a,s){return void 0===a&&(a=0),void 0===s&&(s=o.byteLength||0),(0,hh.sH)(this,void 0,void 0,(function(){var l,c,u,h,d;return(0,hh.YH)(this,(function(f){var p;return l=this.device.gl,c=e,u=this.device.translateTextureFormat(c.format),h=this.device.translateTextureType(c.format),p=c.format,d=Hh(jh(p))*zh(p),nf(l)?(this.gl_pbo=this.device.ensureResourceExists(l.createBuffer()),l.bindBuffer(l.PIXEL_PACK_BUFFER,this.gl_pbo),l.bufferData(l.PIXEL_PACK_BUFFER,s,l.STREAM_READ),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),l.bindFramebuffer(fh.READ_FRAMEBUFFER,this.device.readbackFramebuffer),l.framebufferTexture2D(fh.READ_FRAMEBUFFER,fh.COLOR_ATTACHMENT0,fh.TEXTURE_2D,c.gl_texture,0),l.bindBuffer(l.PIXEL_PACK_BUFFER,this.gl_pbo),l.readPixels(t,n,r,i,u,h,a*d),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),[2,this.getBufferSubDataAsync(l.PIXEL_PACK_BUFFER,this.gl_pbo,0,o,a,0)]):[2,this.readTextureSync(e,t,n,r,i,o,a,s)]}))}))},t.prototype.readTextureSync=function(e,t,n,r,i,o,a,s){void 0===s&&(s=o.byteLength||0);var l=this.device.gl,c=e,u=this.device.translateTextureType(c.format);return l.bindFramebuffer(fh.FRAMEBUFFER,this.device.readbackFramebuffer),l.framebufferTexture2D(fh.FRAMEBUFFER,fh.COLOR_ATTACHMENT0,fh.TEXTURE_2D,c.gl_texture,0),l.pixelStorei(l.PACK_ALIGNMENT,4),l.readPixels(t,n,r,i,l.RGBA,u,o),o},t.prototype.readBuffer=function(e,t,n,r,i){return(0,hh.sH)(this,void 0,void 0,(function(){var o;return(0,hh.YH)(this,(function(a){return nf(o=this.device.gl)?[2,this.getBufferSubDataAsync(o.ARRAY_BUFFER,uf(e,t),t,n,r,i)]:[2,Promise.reject()]}))}))},t.prototype.destroy=function(){e.prototype.destroy.call(this),nf(this.device.gl)&&(null!==this.gl_sync&&this.device.gl.deleteSync(this.gl_sync),null!==this.gl_pbo&&this.device.gl.deleteBuffer(this.gl_pbo))},t}(ef),Rf=function(e){function t(t){var n,r,i=t.id,o=t.device,a=t.descriptor,s=e.call(this,{id:i,device:o})||this;return s.type=ph.RenderPipeline,s.drawMode=function(e){switch(e){case Th.TRIANGLES:return fh.TRIANGLES;case Th.POINTS:return fh.POINTS;case Th.TRIANGLE_STRIP:return fh.TRIANGLE_STRIP;case Th.LINES:return fh.LINES;case Th.LINE_STRIP:return fh.LINE_STRIP;default:throw new Error("Unknown primitive topology mode")}}(null!==(n=a.topology)&&void 0!==n?n:Th.TRIANGLES),s.program=a.program,s.inputLayout=a.inputLayout,s.megaState=(0,hh.Cl)((0,hh.Cl)({},ld(ud)),a.megaStateDescriptor),s.colorAttachmentFormats=a.colorAttachmentFormats.slice(),s.depthStencilAttachmentFormat=a.depthStencilAttachmentFormat,s.sampleCount=null!==(r=a.sampleCount)&&void 0!==r?r:1,s}return(0,hh.C6)(t,e),t}(ef),Cf=function(e){function t(t){var n=t.id,r=t.device,i=t.descriptor,o=e.call(this,{id:n,device:r})||this;return o.type=ph.ComputePipeline,o.descriptor=i,o}return(0,hh.C6)(t,e),t}(ef),Lf=function(){function e(){this.liveObjects=new Set,this.creationStacks=new Map,this.deletionStacks=new Map}return e.prototype.trackResourceCreated=function(e){this.creationStacks.set(e,(new Error).stack),this.liveObjects.add(e)},e.prototype.trackResourceDestroyed=function(e){this.deletionStacks.has(e)&&console.warn("Object double freed:",e,"\n\nCreation stack: ",this.creationStacks.get(e),"\n\nDeletion stack: ",this.deletionStacks.get(e),"\n\nThis stack: ",(new Error).stack),this.deletionStacks.set(e,(new Error).stack),this.liveObjects.delete(e)},e.prototype.checkForLeaks=function(){var e,t;try{for(var n=(0,hh.Ju)(this.liveObjects.values()),r=n.next();!r.done;r=n.next()){var i=r.value;console.warn("Object leaked:",i,"Creation stack:",this.creationStacks.get(i))}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},e.prototype.setResourceLeakCheck=function(e,t){t?this.liveObjects.add(e):this.liveObjects.delete(e)},e}(),Of=function(e){function t(t){var n,r,i=t.id,o=t.device,a=t.descriptor,s=e.call(this,{id:i,device:o})||this;s.type=ph.Sampler;var l=s.device.gl;if(nf(l)){var c=s.device.ensureResourceExists(l.createSampler());l.samplerParameteri(c,fh.TEXTURE_WRAP_S,lf(a.addressModeU)),l.samplerParameteri(c,fh.TEXTURE_WRAP_T,lf(a.addressModeV)),l.samplerParameteri(c,fh.TEXTURE_WRAP_R,lf(null!==(n=a.addressModeW)&&void 0!==n?n:a.addressModeU)),l.samplerParameteri(c,fh.TEXTURE_MIN_FILTER,cf(a.minFilter,a.mipmapFilter)),l.samplerParameteri(c,fh.TEXTURE_MAG_FILTER,cf(a.magFilter,bh.NO_MIP)),void 0!==a.lodMinClamp&&l.samplerParameterf(c,fh.TEXTURE_MIN_LOD,a.lodMinClamp),void 0!==a.lodMaxClamp&&l.samplerParameterf(c,fh.TEXTURE_MAX_LOD,a.lodMaxClamp),void 0!==a.compareFunction&&(l.samplerParameteri(c,l.TEXTURE_COMPARE_MODE,l.COMPARE_REF_TO_TEXTURE),l.samplerParameteri(c,l.TEXTURE_COMPARE_FUNC,a.compareFunction));var u=null!==(r=a.maxAnisotropy)&&void 0!==r?r:1;u>1&&null!==s.device.EXT_texture_filter_anisotropic&&(Zh(a.minFilter===Ah.BILINEAR&&a.magFilter===Ah.BILINEAR&&a.mipmapFilter===bh.LINEAR),l.samplerParameterf(c,s.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT,u)),s.gl_sampler=c}else s.descriptor=a;return s}return(0,hh.C6)(t,e),t.prototype.setTextureParameters=function(e,t,n){var r,i=this.device.gl,o=this.descriptor;this.isNPOT(t,n)?i.texParameteri(fh.TEXTURE_2D,fh.TEXTURE_MIN_FILTER,fh.LINEAR):i.texParameteri(e,fh.TEXTURE_MIN_FILTER,cf(o.minFilter,o.mipmapFilter)),i.texParameteri(fh.TEXTURE_2D,fh.TEXTURE_WRAP_S,lf(o.addressModeU)),i.texParameteri(fh.TEXTURE_2D,fh.TEXTURE_WRAP_T,lf(o.addressModeV)),i.texParameteri(e,fh.TEXTURE_MAG_FILTER,cf(o.magFilter,bh.NO_MIP));var a=null!==(r=o.maxAnisotropy)&&void 0!==r?r:1;a>1&&null!==this.device.EXT_texture_filter_anisotropic&&(Zh(o.minFilter===Ah.BILINEAR&&o.magFilter===Ah.BILINEAR&&o.mipmapFilter===bh.LINEAR),i.texParameteri(e,this.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a))},t.prototype.destroy=function(){e.prototype.destroy.call(this),nf(this.device.gl)&&this.device.gl.deleteSampler(df(this))},t.prototype.isNPOT=function(e,t){return!td(e)||!td(t)},t}(ef),Mf=function(){function e(){}return e.prototype.dispatchWorkgroups=function(e,t,n){},e.prototype.dispatchWorkgroupsIndirect=function(e,t){},e.prototype.setPipeline=function(e){},e.prototype.setBindings=function(e){},e.prototype.pushDebugGroup=function(e){},e.prototype.popDebugGroup=function(){},e.prototype.insertDebugMarker=function(e){},e}(),If=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=ph.RenderBundle,t.commands=[],t}return(0,hh.C6)(t,e),t.prototype.push=function(e){this.commands.push(e)},t.prototype.replay=function(){this.commands.forEach((function(e){return e()}))},t}(ef),wf=/uniform(?:\s+)(\w+)(?:\s?){([^]*?)}/g,Pf=function(){function e(e,t){void 0===t&&(t={}),this.shaderDebug=!1,this.OES_vertex_array_object=null,this.ANGLE_instanced_arrays=null,this.OES_texture_float=null,this.OES_draw_buffers_indexed=null,this.WEBGL_draw_buffers=null,this.WEBGL_depth_texture=null,this.WEBGL_color_buffer_float=null,this.EXT_color_buffer_half_float=null,this.WEBGL_compressed_texture_s3tc=null,this.WEBGL_compressed_texture_s3tc_srgb=null,this.EXT_texture_compression_rgtc=null,this.EXT_texture_filter_anisotropic=null,this.KHR_parallel_shader_compile=null,this.EXT_texture_norm16=null,this.EXT_color_buffer_float=null,this.OES_texture_float_linear=null,this.OES_texture_half_float_linear=null,this.scTexture=null,this.scPlatformFramebuffer=null,this.currentActiveTexture=null,this.currentBoundVAO=null,this.currentProgram=null,this.resourceCreationTracker=null,this.resourceUniqueId=0,this.currentColorAttachments=[],this.currentColorAttachmentLevels=[],this.currentColorResolveTos=[],this.currentColorResolveToLevels=[],this.currentSampleCount=-1,this.currentIndexBufferByteOffset=null,this.currentMegaState=ld(ud),this.currentSamplers=[],this.currentTextures=[],this.currentUniformBuffers=[],this.currentUniformBufferByteOffsets=[],this.currentUniformBufferByteSizes=[],this.currentScissorEnabled=!1,this.currentStencilRef=null,this.currentRenderPassDescriptor=null,this.currentRenderPassDescriptorStack=[],this.debugGroupStack=[],this.resolveColorAttachmentsChanged=!1,this.resolveDepthStencilAttachmentsChanged=!1,this.explicitBindingLocations=!1,this.separateSamplerTextures=!1,this.viewportOrigin=Ph.LOWER_LEFT,this.clipSpaceNearZ=Nh.NEGATIVE_ONE,this.supportMRT=!1,this.inBlitRenderPass=!1,this.supportedSampleCounts=[],this.occlusionQueriesRecommended=!1,this.computeShadersSupported=!1,this.gl=e,this.contextAttributes=Yh(e.getContextAttributes()),nf(e)?(this.EXT_texture_norm16=e.getExtension("EXT_texture_norm16"),this.EXT_color_buffer_float=e.getExtension("EXT_color_buffer_float")):(this.OES_vertex_array_object=e.getExtension("OES_vertex_array_object"),this.ANGLE_instanced_arrays=e.getExtension("ANGLE_instanced_arrays"),this.OES_texture_float=e.getExtension("OES_texture_float"),this.WEBGL_draw_buffers=e.getExtension("WEBGL_draw_buffers"),this.WEBGL_depth_texture=e.getExtension("WEBGL_depth_texture"),this.WEBGL_color_buffer_float=e.getExtension("WEBGL_color_buffer_float"),this.EXT_color_buffer_half_float=e.getExtension("EXT_color_buffer_half_float"),e.getExtension("EXT_frag_depth"),e.getExtension("OES_element_index_uint"),e.getExtension("OES_standard_derivatives")),this.WEBGL_compressed_texture_s3tc=e.getExtension("WEBGL_compressed_texture_s3tc"),this.WEBGL_compressed_texture_s3tc_srgb=e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),this.EXT_texture_compression_rgtc=e.getExtension("EXT_texture_compression_rgtc"),this.EXT_texture_filter_anisotropic=e.getExtension("EXT_texture_filter_anisotropic"),this.EXT_texture_norm16=e.getExtension("EXT_texture_norm16"),this.OES_texture_float_linear=e.getExtension("OES_texture_float_linear"),this.OES_texture_half_float_linear=e.getExtension("OES_texture_half_float_linear"),this.KHR_parallel_shader_compile=e.getExtension("KHR_parallel_shader_compile"),nf(e)?(this.platformString="WebGL2",this.glslVersion="#version 300 es"):(this.platformString="WebGL1",this.glslVersion="#version 100"),this.scTexture=new Af({id:this.getNextUniqueId(),device:this,descriptor:{width:0,height:0,depthOrArrayLayers:1,dimension:Lh.TEXTURE_2D,mipLevelCount:1,usage:Oh.RENDER_TARGET,format:!1===this.contextAttributes.alpha?kh.U8_RGB_RT:kh.U8_RGBA_RT},fake:!0}),this.scTexture.formatKind=wh.Float,this.scTexture.gl_target=null,this.scTexture.gl_texture=null,this.resolveColorReadFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.resolveColorDrawFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.resolveDepthStencilReadFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.resolveDepthStencilDrawFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.renderPassDrawFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.readbackFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.fallbackTexture2D=this.createFallbackTexture(Lh.TEXTURE_2D,wh.Float),this.fallbackTexture2DDepth=this.createFallbackTexture(Lh.TEXTURE_2D,wh.Depth),this.fallbackVertexBuffer=this.createBuffer({viewOrSize:1,usage:xh.VERTEX,hint:Sh.STATIC}),nf(e)&&(this.fallbackTexture2DArray=this.createFallbackTexture(Lh.TEXTURE_2D_ARRAY,wh.Float),this.fallbackTexture3D=this.createFallbackTexture(Lh.TEXTURE_3D,wh.Float),this.fallbackTextureCube=this.createFallbackTexture(Lh.TEXTURE_CUBE_MAP,wh.Float)),this.currentMegaState.depthCompare=gh.LESS,this.currentMegaState.depthWrite=!1,this.currentMegaState.attachmentsState[0].channelWriteMask=Mh.ALL,e.enable(e.DEPTH_TEST),e.enable(e.STENCIL_TEST),this.checkLimits(),t.shaderDebug&&(this.shaderDebug=!0),t.trackResources&&(this.resourceCreationTracker=new Lf)}return e.prototype.destroy=function(){this.blitBindings&&this.blitBindings.destroy(),this.blitInputLayout&&this.blitInputLayout.destroy(),this.blitRenderPipeline&&this.blitRenderPipeline.destroy(),this.blitVertexBuffer&&this.blitVertexBuffer.destroy(),this.blitProgram&&this.blitProgram.destroy()},e.prototype.createFallbackTexture=function(e,t){var n=e===Lh.TEXTURE_CUBE_MAP?6:1,r=t===wh.Depth?kh.D32F:kh.U8_RGBA_NORM,i=this.createTexture({dimension:e,format:r,usage:Oh.SAMPLED,width:1,height:1,depthOrArrayLayers:n,mipLevelCount:1});return t===wh.Float&&i.setImageData([new Uint8Array(4*n)]),hf(i)},e.prototype.getNextUniqueId=function(){return++this.resourceUniqueId},e.prototype.checkLimits=function(){var e=this.gl;if(this.maxVertexAttribs=e.getParameter(fh.MAX_VERTEX_ATTRIBS),nf(e)){this.uniformBufferMaxPageByteSize=Math.min(e.getParameter(fh.MAX_UNIFORM_BLOCK_SIZE),65536),this.uniformBufferWordAlignment=e.getParameter(e.UNIFORM_BUFFER_OFFSET_ALIGNMENT)/4;var t=e.getInternalformatParameter(e.RENDERBUFFER,e.DEPTH32F_STENCIL8,e.SAMPLES);this.supportedSampleCounts=t?(0,hh.fX)([],(0,hh.zs)(t),!1):[],this.occlusionQueriesRecommended=!0}else this.uniformBufferWordAlignment=64,this.uniformBufferMaxPageByteSize=65536;this.uniformBufferMaxPageWordSize=this.uniformBufferMaxPageByteSize/4,this.supportedSampleCounts.includes(1)||this.supportedSampleCounts.push(1),this.supportedSampleCounts.sort((function(e,t){return e-t}))},e.prototype.configureSwapChain=function(e,t,n){var r,i=this.scTexture;i.width=e,i.height=t,this.scPlatformFramebuffer=void 0===(r=n)?null:r},e.prototype.getDevice=function(){return this},e.prototype.getCanvas=function(){return this.gl.canvas},e.prototype.getOnscreenTexture=function(){return this.scTexture},e.prototype.beginFrame=function(){},e.prototype.endFrame=function(){},e.prototype.translateTextureInternalFormat=function(e,t){switch(void 0===t&&(t=!1),e){case kh.ALPHA:return fh.ALPHA;case kh.U8_LUMINANCE:case kh.F16_LUMINANCE:case kh.F32_LUMINANCE:return fh.LUMINANCE;case kh.F16_R:return fh.R16F;case kh.F16_RG:return fh.RG16F;case kh.F16_RGB:return fh.RGB16F;case kh.F16_RGBA:return fh.RGBA16F;case kh.F32_R:return fh.R32F;case kh.F32_RG:return fh.RG32F;case kh.F32_RGB:return fh.RGB32F;case kh.F32_RGBA:return nf(this.gl)?fh.RGBA32F:t?this.WEBGL_color_buffer_float.RGBA32F_EXT:fh.RGBA;case kh.U8_R_NORM:return fh.R8;case kh.U8_RG_NORM:return fh.RG8;case kh.U8_RGB_NORM:case kh.U8_RGB_RT:return fh.RGB8;case kh.U8_RGB_SRGB:return fh.SRGB8;case kh.U8_RGBA_NORM:case kh.U8_RGBA_RT:return nf(this.gl)?fh.RGBA8:t?fh.RGBA4:fh.RGBA;case kh.U8_RGBA:return fh.RGBA;case kh.U8_RGBA_SRGB:case kh.U8_RGBA_RT_SRGB:return fh.SRGB8_ALPHA8;case kh.U16_R:return fh.R16UI;case kh.U16_R_NORM:return this.EXT_texture_norm16.R16_EXT;case kh.U16_RG_NORM:return this.EXT_texture_norm16.RG16_EXT;case kh.U16_RGBA_NORM:return this.EXT_texture_norm16.RGBA16_EXT;case kh.U16_RGBA_5551:return fh.RGB5_A1;case kh.U16_RGB_565:return fh.RGB565;case kh.U32_R:return fh.R32UI;case kh.S8_RGBA_NORM:return fh.RGBA8_SNORM;case kh.S8_RG_NORM:return fh.RG8_SNORM;case kh.BC1:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT;case kh.BC1_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;case kh.BC2:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT;case kh.BC2_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;case kh.BC3:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT;case kh.BC3_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;case kh.BC4_UNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_RED_RGTC1_EXT;case kh.BC4_SNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT;case kh.BC5_UNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT;case kh.BC5_SNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;case kh.D32F_S8:return nf(this.gl)?fh.DEPTH32F_STENCIL8:this.WEBGL_depth_texture?fh.DEPTH_STENCIL:fh.DEPTH_COMPONENT16;case kh.D24_S8:return nf(this.gl)?fh.DEPTH24_STENCIL8:this.WEBGL_depth_texture?fh.DEPTH_STENCIL:fh.DEPTH_COMPONENT16;case kh.D32F:return nf(this.gl)?fh.DEPTH_COMPONENT32F:this.WEBGL_depth_texture?fh.DEPTH_COMPONENT:fh.DEPTH_COMPONENT16;case kh.D24:return nf(this.gl)?fh.DEPTH_COMPONENT24:this.WEBGL_depth_texture?fh.DEPTH_COMPONENT:fh.DEPTH_COMPONENT16;default:throw new Error("whoops")}},e.prototype.translateTextureType=function(e){switch(jh(e)){case Bh.U8:return fh.UNSIGNED_BYTE;case Bh.U16:return fh.UNSIGNED_SHORT;case Bh.U32:return fh.UNSIGNED_INT;case Bh.S8:return fh.BYTE;case Bh.F16:return fh.HALF_FLOAT;case Bh.F32:return fh.FLOAT;case Bh.U16_PACKED_5551:return fh.UNSIGNED_SHORT_5_5_5_1;case Bh.D32F:return nf(this.gl)?fh.FLOAT:this.WEBGL_depth_texture?fh.UNSIGNED_INT:fh.UNSIGNED_BYTE;case Bh.D24:return nf(this.gl)?fh.UNSIGNED_INT_24_8:this.WEBGL_depth_texture?fh.UNSIGNED_SHORT:fh.UNSIGNED_BYTE;case Bh.D24S8:return nf(this.gl)?fh.UNSIGNED_INT_24_8:this.WEBGL_depth_texture?fh.UNSIGNED_INT_24_8_WEBGL:fh.UNSIGNED_BYTE;case Bh.D32FS8:return fh.FLOAT_32_UNSIGNED_INT_24_8_REV;default:throw new Error("whoops")}},e.prototype.translateInternalTextureFormat=function(e){switch(e){case kh.F32_R:return fh.R32F;case kh.F32_RG:return fh.RG32F;case kh.F32_RGB:return fh.RGB32F;case kh.F32_RGBA:return fh.RGBA32F;case kh.F16_R:return fh.R16F;case kh.F16_RG:return fh.RG16F;case kh.F16_RGB:return fh.RGB16F;case kh.F16_RGBA:return fh.RGBA16F}return this.translateTextureFormat(e)},e.prototype.translateTextureFormat=function(e){if(rf(e)||e===kh.F32_LUMINANCE||e===kh.U8_LUMINANCE)return this.translateTextureInternalFormat(e);var t=nf(this.gl)||!nf(this.gl)&&!!this.WEBGL_depth_texture;switch(e){case kh.D24_S8:case kh.D32F_S8:return t?fh.DEPTH_STENCIL:fh.RGBA;case kh.D24:case kh.D32F:return t?fh.DEPTH_COMPONENT:fh.RGBA}var n=of(e);switch(zh(e)){case Fh.A:return fh.ALPHA;case Fh.R:return n?fh.RED_INTEGER:fh.RED;case Fh.RG:return n?fh.RG_INTEGER:fh.RG;case Fh.RGB:return n?fh.RGB_INTEGER:fh.RGB;case Fh.RGBA:return fh.RGBA}},e.prototype.setActiveTexture=function(e){this.currentActiveTexture!==e&&(this.gl.activeTexture(e),this.currentActiveTexture=e)},e.prototype.bindVAO=function(e){this.currentBoundVAO!==e&&(nf(this.gl)?this.gl.bindVertexArray(e):this.OES_vertex_array_object.bindVertexArrayOES(e),this.currentBoundVAO=e)},e.prototype.programCompiled=function(e){Zh(e.compileState!==vf.NeedsCompile),e.compileState===vf.Compiling&&(e.compileState=vf.NeedsBind,this.shaderDebug&&this.checkProgramCompilationForErrors(e))},e.prototype.useProgram=function(e){this.currentProgram!==e&&(this.programCompiled(e),this.gl.useProgram(e.gl_program),this.currentProgram=e)},e.prototype.ensureResourceExists=function(e){if(null===e){var t=this.gl.getError();throw new Error("Created resource is null; GL error encountered: ".concat(t))}return e},e.prototype.createBuffer=function(e){return new yf({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createTexture=function(e){return new Af({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createSampler=function(e){return new Of({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createRenderTarget=function(e){return new bf({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createRenderTargetFromTexture=function(e){var t=e,n=t.format,r=t.width,i=t.height;return Zh(1===t.mipLevelCount),this.createRenderTarget({format:n,width:r,height:i,sampleCount:1,texture:e})},e.prototype.createProgram=function(e){var t,n,r,i=null===(t=e.vertex)||void 0===t?void 0:t.glsl;return(null===(n=e.vertex)||void 0===n?void 0:n.glsl)&&(e.vertex.glsl=Jd(this.queryVendorInfo(),"vert",e.vertex.glsl)),(null===(r=e.fragment)||void 0===r?void 0:r.glsl)&&(e.fragment.glsl=Jd(this.queryVendorInfo(),"frag",e.fragment.glsl)),this.createProgramSimple(e,i)},e.prototype.createProgramSimple=function(e,t){return new Tf({id:this.getNextUniqueId(),device:this,descriptor:e},t)},e.prototype.createBindings=function(e){return new tf({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createInputLayout=function(e){return new Ef({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createRenderPipeline=function(e){return new Rf({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createComputePass=function(){return new Mf},e.prototype.createComputePipeline=function(e){return new Cf({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createReadback=function(){return new Sf({id:this.getNextUniqueId(),device:this})},e.prototype.createQueryPool=function(e,t){return new xf({id:this.getNextUniqueId(),device:this,descriptor:{type:e,elemCount:t}})},e.prototype.formatRenderPassDescriptor=function(e){var t,n,r,i,o,a,s=e.colorAttachment;e.depthClearValue=null!==(t=e.depthClearValue)&&void 0!==t?t:"load",e.stencilClearValue=null!==(n=e.stencilClearValue)&&void 0!==n?n:"load";for(var l=0;l<s.length;l++)e.colorAttachmentLevel||(e.colorAttachmentLevel=[]),e.colorAttachmentLevel[l]=null!==(r=e.colorAttachmentLevel[l])&&void 0!==r?r:0,e.colorResolveToLevel||(e.colorResolveToLevel=[]),e.colorResolveToLevel[l]=null!==(i=e.colorResolveToLevel[l])&&void 0!==i?i:0,e.colorClearColor||(e.colorClearColor=[]),e.colorClearColor[l]=null!==(o=e.colorClearColor[l])&&void 0!==o?o:"load",e.colorStore||(e.colorStore=[]),e.colorStore[l]=null!==(a=e.colorStore[l])&&void 0!==a&&a},e.prototype.createRenderBundle=function(){return new If({id:this.getNextUniqueId(),device:this})},e.prototype.beginBundle=function(e){this.renderBundle=e},e.prototype.endBundle=function(){this.renderBundle=void 0},e.prototype.executeBundles=function(e){e.forEach((function(e){e.replay()}))},e.prototype.createRenderPass=function(e){null!==this.currentRenderPassDescriptor&&this.currentRenderPassDescriptorStack.push(this.currentRenderPassDescriptor),this.currentRenderPassDescriptor=e,this.formatRenderPassDescriptor(e);var t=e.colorAttachment,n=e.colorAttachmentLevel,r=e.colorClearColor,i=e.colorResolveTo,o=e.colorResolveToLevel,a=e.depthStencilAttachment,s=e.depthClearValue,l=e.stencilClearValue,c=e.depthStencilResolveTo,u=i&&1===i.length&&i[0]===this.scTexture;this.setRenderPassParametersBegin(t.length,u);for(var h=0;h<t.length;h++)this.setRenderPassParametersColor(h,t[h],n[h],i[h],o[h],u);for(this.setRenderPassParametersDepthStencil(a,c,u),this.validateCurrentAttachments(),h=0;h<t.length;h++){var d=r[h];"load"!==d&&this.setRenderPassParametersClearColor(h,d.r,d.g,d.b,d.a)}return this.setRenderPassParametersClearDepthStencil(s,l),this},e.prototype.submitPass=function(e){Zh(null!==this.currentRenderPassDescriptor),this.endPass(),this.currentRenderPassDescriptorStack.length?this.currentRenderPassDescriptor=this.currentRenderPassDescriptorStack.pop():this.currentRenderPassDescriptor=null},e.prototype.copySubTexture2D=function(e,t,n,r,i,o){var a=this.gl,s=e,l=r;if(Zh(1===l.mipLevelCount),Zh(1===s.mipLevelCount),nf(a))s===this.scTexture?a.bindFramebuffer(a.DRAW_FRAMEBUFFER,this.scPlatformFramebuffer):(a.bindFramebuffer(a.DRAW_FRAMEBUFFER,this.resolveColorDrawFramebuffer),this.bindFramebufferAttachment(a.DRAW_FRAMEBUFFER,a.COLOR_ATTACHMENT0,s,0)),a.bindFramebuffer(a.READ_FRAMEBUFFER,this.resolveColorReadFramebuffer),this.bindFramebufferAttachment(a.READ_FRAMEBUFFER,a.COLOR_ATTACHMENT0,l,0),a.blitFramebuffer(i,o,i+l.width,o+l.height,t,n,t+l.width,n+l.height,a.COLOR_BUFFER_BIT,a.LINEAR),a.bindFramebuffer(a.READ_FRAMEBUFFER,null),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,null);else if(s===this.scTexture){var c=this.createRenderTargetFromTexture(r);this.submitBlitRenderPass(c,s)}},e.prototype.queryLimits=function(){return this},e.prototype.queryTextureFormatSupported=function(e,t,n){switch(e){case kh.BC1_SRGB:case kh.BC2_SRGB:case kh.BC3_SRGB:return null!==this.WEBGL_compressed_texture_s3tc_srgb&&_f(t,n,4,4);case kh.BC1:case kh.BC2:case kh.BC3:return null!==this.WEBGL_compressed_texture_s3tc&&_f(t,n,4,4);case kh.BC4_UNORM:case kh.BC4_SNORM:case kh.BC5_UNORM:case kh.BC5_SNORM:return null!==this.EXT_texture_compression_rgtc&&_f(t,n,4,4);case kh.U16_R_NORM:case kh.U16_RG_NORM:case kh.U16_RGBA_NORM:return null!==this.EXT_texture_norm16;case kh.F32_R:case kh.F32_RG:case kh.F32_RGB:case kh.F32_RGBA:return null!==this.OES_texture_float_linear;case kh.F16_R:case kh.F16_RG:case kh.F16_RGB:case kh.F16_RGBA:return null!==this.OES_texture_half_float_linear;default:return!0}},e.prototype.queryProgramReady=function(e){var t=this.gl;if(e.compileState===vf.NeedsCompile)throw new Error("whoops");if(e.compileState===vf.Compiling){var n;return(n=null===this.KHR_parallel_shader_compile||t.getProgramParameter(e.gl_program,this.KHR_parallel_shader_compile.COMPLETION_STATUS_KHR))&&this.programCompiled(e),n}return e.compileState===vf.NeedsBind||e.compileState===vf.ReadyToUse},e.prototype.queryPlatformAvailable=function(){return this.gl.isContextLost()},e.prototype.queryVendorInfo=function(){return this},e.prototype.queryRenderPass=function(e){return this.currentRenderPassDescriptor},e.prototype.queryRenderTarget=function(e){return e},e.prototype.setResourceName=function(e,t){if(e.name=t,e.type===ph.Buffer)for(var n=e.gl_buffer_pages,r=0;r<n.length;r++)ff(n[r],"".concat(t," Page ").concat(r));else if(e.type===ph.Texture)ff(hf(e),t);else if(e.type===ph.Sampler)ff(df(e),t);else if(e.type===ph.RenderTarget){var i=e.gl_renderbuffer;null!==i&&ff(i,t)}else e.type===ph.InputLayout&&ff(e.vao,t)},e.prototype.setResourceLeakCheck=function(e,t){null!==this.resourceCreationTracker&&this.resourceCreationTracker.setResourceLeakCheck(e,t)},e.prototype.checkForLeaks=function(){null!==this.resourceCreationTracker&&this.resourceCreationTracker.checkForLeaks()},e.prototype.pushDebugGroup=function(e){},e.prototype.popDebugGroup=function(){},e.prototype.insertDebugMarker=function(e){},e.prototype.programPatched=function(e,t){Zh(this.shaderDebug)},e.prototype.getBufferData=function(e,t,n){void 0===n&&(n=0);var r=this.gl;nf(r)&&(r.bindBuffer(r.COPY_READ_BUFFER,uf(e,4*n)),r.getBufferSubData(r.COPY_READ_BUFFER,4*n,t))},e.prototype.debugGroupStatisticsDrawCall=function(e){void 0===e&&(e=1);for(var t=this.debugGroupStack.length-1;t>=0;t--)this.debugGroupStack[t].drawCallCount+=e},e.prototype.debugGroupStatisticsBufferUpload=function(e){void 0===e&&(e=1);for(var t=this.debugGroupStack.length-1;t>=0;t--)this.debugGroupStack[t].bufferUploadCount+=e},e.prototype.debugGroupStatisticsTextureBind=function(e){void 0===e&&(e=1);for(var t=this.debugGroupStack.length-1;t>=0;t--)this.debugGroupStack[t].textureBindCount+=e},e.prototype.debugGroupStatisticsTriangles=function(e){for(var t=this.debugGroupStack.length-1;t>=0;t--)this.debugGroupStack[t].triangleCount+=e},e.prototype.reportShaderError=function(e,t){var n=this.gl,r=n.getShaderParameter(e,n.COMPILE_STATUS);if(!r){console.error(function(e,t){return void 0===t&&(t=1),e.split("\n").map((function(e,n){return"".concat(function(e,t,n){for(void 0===n&&(n="0");e.length<4;)e="".concat(n).concat(e);return e}(""+(t+n),0," ")," ").concat(e)})).join("\n")}(t));var i=n.getExtension("WEBGL_debug_shaders");i&&console.error(i.getTranslatedShaderSource(e)),console.error(n.getShaderInfoLog(e))}return r},e.prototype.checkProgramCompilationForErrors=function(e){var t=this.gl,n=e.gl_program;if(!t.getProgramParameter(n,t.LINK_STATUS)){var r=e.descriptor;if(!this.reportShaderError(e.gl_shader_vert,r.vertex.glsl))return;if(!this.reportShaderError(e.gl_shader_frag,r.fragment.glsl))return;console.error(t.getProgramInfoLog(e.gl_program))}},e.prototype.bindFramebufferAttachment=function(e,t,n,r){var i=this.gl;if(lh(n))i.framebufferRenderbuffer(e,t,i.RENDERBUFFER,null);else if(n.type===ph.RenderTarget)null!==n.gl_renderbuffer?i.framebufferRenderbuffer(e,t,i.RENDERBUFFER,n.gl_renderbuffer):null!==n.texture&&i.framebufferTexture2D(e,t,fh.TEXTURE_2D,hf(n.texture),r);else if(n.type===ph.Texture){var o=hf(n);n.dimension===Lh.TEXTURE_2D?i.framebufferTexture2D(e,t,fh.TEXTURE_2D,o,r):nf(i)&&(n.dimension,Lh.TEXTURE_2D_ARRAY)}},e.prototype.bindFramebufferDepthStencilAttachment=function(e,t){var n=this.gl,r=lh(t)?Uh.Depth|Uh.Stencil:Vh(t.format),i=!!(r&Uh.Depth),o=!!(r&Uh.Stencil);i&&o?nf(this.gl)||!nf(this.gl)&&this.WEBGL_depth_texture?this.bindFramebufferAttachment(e,n.DEPTH_STENCIL_ATTACHMENT,t,0):this.bindFramebufferAttachment(e,n.DEPTH_ATTACHMENT,t,0):i?(this.bindFramebufferAttachment(e,n.DEPTH_ATTACHMENT,t,0),this.bindFramebufferAttachment(e,n.STENCIL_ATTACHMENT,null,0)):o&&(this.bindFramebufferAttachment(e,n.STENCIL_ATTACHMENT,t,0),this.bindFramebufferAttachment(e,n.DEPTH_ATTACHMENT,null,0))},e.prototype.validateCurrentAttachments=function(){for(var e=-1,t=-1,n=-1,r=0;r<this.currentColorAttachments.length;r++){var i=this.currentColorAttachments[r];null!==i&&(-1===e?(e=i.sampleCount,t=i.width,n=i.height):(Zh(e===i.sampleCount),Zh(t===i.width),Zh(n===i.height)))}this.currentDepthStencilAttachment&&(-1===e?e=this.currentDepthStencilAttachment.sampleCount:(Zh(e===this.currentDepthStencilAttachment.sampleCount),Zh(t===this.currentDepthStencilAttachment.width),Zh(n===this.currentDepthStencilAttachment.height))),this.currentSampleCount=e},e.prototype.setRenderPassParametersBegin=function(e,t){void 0===t&&(t=!1);var n=this.gl;if(t)n.bindFramebuffer(fh.FRAMEBUFFER,null);else if(nf(n)?n.bindFramebuffer(fh.DRAW_FRAMEBUFFER,this.renderPassDrawFramebuffer):this.inBlitRenderPass||n.bindFramebuffer(fh.FRAMEBUFFER,this.renderPassDrawFramebuffer),nf(n)?n.drawBuffers([fh.COLOR_ATTACHMENT0,fh.COLOR_ATTACHMENT1,fh.COLOR_ATTACHMENT2,fh.COLOR_ATTACHMENT3]):!this.inBlitRenderPass&&this.WEBGL_draw_buffers&&this.WEBGL_draw_buffers.drawBuffersWEBGL([fh.COLOR_ATTACHMENT0_WEBGL,fh.COLOR_ATTACHMENT1_WEBGL,fh.COLOR_ATTACHMENT2_WEBGL,fh.COLOR_ATTACHMENT3_WEBGL]),!this.inBlitRenderPass)for(var r=e;r<this.currentColorAttachments.length;r++){var i=nf(n)?fh.DRAW_FRAMEBUFFER:fh.FRAMEBUFFER,o=nf(n)?fh.COLOR_ATTACHMENT0:fh.COLOR_ATTACHMENT0_WEBGL;n.framebufferRenderbuffer(i,o+r,fh.RENDERBUFFER,null),n.framebufferTexture2D(i,o+r,fh.TEXTURE_2D,null,0)}this.currentColorAttachments.length=e},e.prototype.setRenderPassParametersColor=function(e,t,n,r,i,o){void 0===o&&(o=!1);var a=nf(this.gl);this.currentColorAttachments[e]===t&&this.currentColorAttachmentLevels[e]===n||(this.currentColorAttachments[e]=t,this.currentColorAttachmentLevels[e]=n,!o&&(a||!a&&this.WEBGL_draw_buffers)&&this.bindFramebufferAttachment(a?fh.DRAW_FRAMEBUFFER:fh.FRAMEBUFFER,(a?fh.COLOR_ATTACHMENT0:fh.COLOR_ATTACHMENT0_WEBGL)+e,t,n),this.resolveColorAttachmentsChanged=!0),this.currentColorResolveTos[e]===r&&this.currentColorResolveToLevels[e]===i||(this.currentColorResolveTos[e]=r,this.currentColorResolveToLevels[e]=i,null!==r&&(this.resolveColorAttachmentsChanged=!0))},e.prototype.setRenderPassParametersDepthStencil=function(e,t,n){void 0===n&&(n=!1);var r=this.gl;this.currentDepthStencilAttachment!==e&&(this.currentDepthStencilAttachment=e,n||this.inBlitRenderPass||this.bindFramebufferDepthStencilAttachment(nf(r)?fh.DRAW_FRAMEBUFFER:fh.FRAMEBUFFER,this.currentDepthStencilAttachment),this.resolveDepthStencilAttachmentsChanged=!0),this.currentDepthStencilResolveTo!==t&&(this.currentDepthStencilResolveTo=t,t&&(this.resolveDepthStencilAttachmentsChanged=!0))},e.prototype.setRenderPassParametersClearColor=function(e,t,n,r,i){var o,a=this.gl;null!==this.OES_draw_buffers_indexed?(o=this.currentMegaState.attachmentsState[e])&&o.channelWriteMask!==Mh.ALL&&(this.OES_draw_buffers_indexed.colorMaskiOES(e,!0,!0,!0,!0),o.channelWriteMask=Mh.ALL):(o=this.currentMegaState.attachmentsState[0])&&o.channelWriteMask!==Mh.ALL&&(a.colorMask(!0,!0,!0,!0),o.channelWriteMask=Mh.ALL),this.setScissorRectEnabled(!1),nf(a)?a.clearBufferfv(a.COLOR,e,[t,n,r,i]):(a.clearColor(t,n,r,i),a.clear(a.COLOR_BUFFER_BIT))},e.prototype.setRenderPassParametersClearDepthStencil=function(e,t){void 0===e&&(e="load"),void 0===t&&(t="load");var n=this.gl;"load"!==e&&(Zh(!!this.currentDepthStencilAttachment),this.currentMegaState.depthWrite||(n.depthMask(!0),this.currentMegaState.depthWrite=!0),nf(n)?n.clearBufferfv(n.DEPTH,0,[e]):(n.clearDepth(e),n.clear(n.DEPTH_BUFFER_BIT))),"load"!==t&&(Zh(!!this.currentDepthStencilAttachment),this.currentMegaState.stencilWrite||(n.enable(n.STENCIL_TEST),n.stencilMask(255),this.currentMegaState.stencilWrite=!0),nf(n)?n.clearBufferiv(n.STENCIL,0,[t]):(n.clearStencil(t),n.clear(n.STENCIL_BUFFER_BIT)))},e.prototype.setBindings=function(e){var t,n=this;if(this.renderBundle)this.renderBundle.push((function(){return n.setBindings(e)}));else{var r=this.gl,i=e,o=i.uniformBufferBindings,a=i.samplerBindings,s=i.bindingLayouts;Zh(0<s.bindingLayoutTables.length);var l=s.bindingLayoutTables[0];Zh(o.length>=l.numUniformBuffers),Zh(a.length>=l.numSamplers);for(var c=0;c<o.length;c++)if(0!==(m=o[c]).size){var u=l.firstUniformBuffer+c,h=m.buffer,d=m.offset||0,f=m.size||h.byteSize;if(h!==this.currentUniformBuffers[u]||d!==this.currentUniformBufferByteOffsets[u]||f!==this.currentUniformBufferByteSizes[u]){var p=d%h.pageByteSize,g=h.gl_buffer_pages[d/h.pageByteSize|0];Zh(p+f<=h.pageByteSize),nf(r)&&r.bindBufferRange(r.UNIFORM_BUFFER,u,g,p,f),this.currentUniformBuffers[u]=h,this.currentUniformBufferByteOffsets[u]=d,this.currentUniformBufferByteSizes[u]=f}}for(c=0;c<l.numSamplers;c++){var m=a[c],_=l.firstSampler+c,v=null!==m&&null!==m.sampler?df(m.sampler):null,y=null!==m&&null!==m.texture?hf(m.texture):null;if(this.currentSamplers[_]!==v&&(nf(r)&&r.bindSampler(_,v),this.currentSamplers[_]=v),this.currentTextures[_]!==y){if(this.setActiveTexture(r.TEXTURE0+_),null!==y){var E=Yh(m).texture,A=E.gl_target,b=E.width,T=E.height;m.texture.textureIndex=_,r.bindTexture(A,y),nf(r)||null===(t=m.sampler)||void 0===t||t.setTextureParameters(A,b,T),this.debugGroupStatisticsTextureBind()}else{var x=(0,hh.Cl)((0,hh.Cl)({},m),dd),S=x.dimension,R=x.formatKind;A=mf(S),r.bindTexture(A,this.getFallbackTexture((0,hh.Cl)({gl_target:A,formatKind:R},x)))}this.currentTextures[_]=y}}}},e.prototype.setViewport=function(e,t,n,r){this.gl.viewport(e,t,n,r)},e.prototype.setScissorRect=function(e,t,n,r){var i=this.gl;this.setScissorRectEnabled(!0),i.scissor(e,t,n,r)},e.prototype.applyAttachmentStateIndexed=function(e,t,n){var r=this.gl,i=this.OES_draw_buffers_indexed;t.channelWriteMask!==n.channelWriteMask&&(i.colorMaskiOES(e,!!(n.channelWriteMask&Mh.RED),!!(n.channelWriteMask&Mh.GREEN),!!(n.channelWriteMask&Mh.BLUE),!!(n.channelWriteMask&Mh.ALPHA)),t.channelWriteMask=n.channelWriteMask);var o=t.rgbBlendState.blendMode!==n.rgbBlendState.blendMode||t.alphaBlendState.blendMode!==n.alphaBlendState.blendMode,a=t.rgbBlendState.blendSrcFactor!==n.rgbBlendState.blendSrcFactor||t.alphaBlendState.blendSrcFactor!==n.alphaBlendState.blendSrcFactor||t.rgbBlendState.blendDstFactor!==n.rgbBlendState.blendDstFactor||t.alphaBlendState.blendDstFactor!==n.alphaBlendState.blendDstFactor;(a||o)&&(gf(t.rgbBlendState)&&gf(t.alphaBlendState)?i.enableiOES(e,r.BLEND):gf(n.rgbBlendState)&&gf(n.alphaBlendState)&&i.disableiOES(e,r.BLEND)),o&&(i.blendEquationSeparateiOES(e,n.rgbBlendState.blendMode,n.alphaBlendState.blendMode),t.rgbBlendState.blendMode=n.rgbBlendState.blendMode,t.alphaBlendState.blendMode=n.alphaBlendState.blendMode),a&&(i.blendFuncSeparateiOES(e,n.rgbBlendState.blendSrcFactor,n.rgbBlendState.blendDstFactor,n.alphaBlendState.blendSrcFactor,n.alphaBlendState.blendDstFactor),t.rgbBlendState.blendSrcFactor=n.rgbBlendState.blendSrcFactor,t.alphaBlendState.blendSrcFactor=n.alphaBlendState.blendSrcFactor,t.rgbBlendState.blendDstFactor=n.rgbBlendState.blendDstFactor,t.alphaBlendState.blendDstFactor=n.alphaBlendState.blendDstFactor)},e.prototype.applyAttachmentState=function(e,t){var n=this.gl;e.channelWriteMask!==t.channelWriteMask&&(n.colorMask(!!(t.channelWriteMask&Mh.RED),!!(t.channelWriteMask&Mh.GREEN),!!(t.channelWriteMask&Mh.BLUE),!!(t.channelWriteMask&Mh.ALPHA)),e.channelWriteMask=t.channelWriteMask);var r=e.rgbBlendState.blendMode!==t.rgbBlendState.blendMode||e.alphaBlendState.blendMode!==t.alphaBlendState.blendMode,i=e.rgbBlendState.blendSrcFactor!==t.rgbBlendState.blendSrcFactor||e.alphaBlendState.blendSrcFactor!==t.alphaBlendState.blendSrcFactor||e.rgbBlendState.blendDstFactor!==t.rgbBlendState.blendDstFactor||e.alphaBlendState.blendDstFactor!==t.alphaBlendState.blendDstFactor;(i||r)&&(gf(e.rgbBlendState)&&gf(e.alphaBlendState)?n.enable(n.BLEND):gf(t.rgbBlendState)&&gf(t.alphaBlendState)&&n.disable(n.BLEND)),r&&(n.blendEquationSeparate(t.rgbBlendState.blendMode,t.alphaBlendState.blendMode),e.rgbBlendState.blendMode=t.rgbBlendState.blendMode,e.alphaBlendState.blendMode=t.alphaBlendState.blendMode),i&&(n.blendFuncSeparate(t.rgbBlendState.blendSrcFactor,t.rgbBlendState.blendDstFactor,t.alphaBlendState.blendSrcFactor,t.alphaBlendState.blendDstFactor),e.rgbBlendState.blendSrcFactor=t.rgbBlendState.blendSrcFactor,e.alphaBlendState.blendSrcFactor=t.alphaBlendState.blendSrcFactor,e.rgbBlendState.blendDstFactor=t.rgbBlendState.blendDstFactor,e.alphaBlendState.blendDstFactor=t.alphaBlendState.blendDstFactor)},e.prototype.setMegaState=function(e){var t=this.gl,n=this.currentMegaState;if(null!==this.OES_draw_buffers_indexed)for(var r=0;r<e.attachmentsState.length;r++)this.applyAttachmentStateIndexed(r,n.attachmentsState[0],e.attachmentsState[0]);else Zh(1===e.attachmentsState.length),this.applyAttachmentState(n.attachmentsState[0],e.attachmentsState[0]);qh(n.blendConstant,e.blendConstant)||(t.blendColor(e.blendConstant.r,e.blendConstant.g,e.blendConstant.b,e.blendConstant.a),Kh(n.blendConstant,e.blendConstant)),n.depthCompare!==e.depthCompare&&(t.depthFunc(e.depthCompare),n.depthCompare=e.depthCompare),!!n.depthWrite!=!!e.depthWrite&&(t.depthMask(e.depthWrite),n.depthWrite=e.depthWrite),!!n.stencilWrite!=!!e.stencilWrite&&(t.stencilMask(e.stencilWrite?255:0),n.stencilWrite=e.stencilWrite);var i=!1;if(!Ad(n.stencilFront,e.stencilFront)){i=!0;var o=e.stencilFront,a=o.passOp,s=o.failOp,l=o.depthFailOp,c=o.compare;n.stencilFront.passOp===a&&n.stencilFront.failOp===s&&n.stencilFront.depthFailOp===l||(t.stencilOpSeparate(t.FRONT,s,l,a),n.stencilFront.passOp=a,n.stencilFront.failOp=s,n.stencilFront.depthFailOp=l),n.stencilFront.compare!==c&&(this.setStencilReference(0),n.stencilFront.compare=c)}if(!Ad(n.stencilBack,e.stencilBack)){i=!0;var u=e.stencilBack;a=u.passOp,s=u.failOp,l=u.depthFailOp,c=u.compare,n.stencilBack.passOp===a&&n.stencilBack.failOp===s&&n.stencilBack.depthFailOp===l||(t.stencilOpSeparate(t.BACK,s,l,a),n.stencilBack.passOp=a,n.stencilBack.failOp=s,n.stencilBack.depthFailOp=l),n.stencilBack.compare!==c&&(this.setStencilReference(0),n.stencilBack.compare=c)}n.stencilFront.mask===e.stencilFront.mask&&n.stencilBack.mask===e.stencilBack.mask||(i=!0,n.stencilFront.mask=e.stencilFront.mask,n.stencilBack.mask=e.stencilBack.mask),i&&this.applyStencil(),n.cullMode!==e.cullMode&&(n.cullMode===_h.NONE?t.enable(t.CULL_FACE):e.cullMode===_h.NONE&&t.disable(t.CULL_FACE),e.cullMode===_h.BACK?t.cullFace(t.BACK):e.cullMode===_h.FRONT?t.cullFace(t.FRONT):e.cullMode===_h.FRONT_AND_BACK&&t.cullFace(t.FRONT_AND_BACK),n.cullMode=e.cullMode),n.frontFace!==e.frontFace&&(t.frontFace(e.frontFace),n.frontFace=e.frontFace),n.polygonOffset!==e.polygonOffset&&(e.polygonOffset?t.enable(t.POLYGON_OFFSET_FILL):t.disable(t.POLYGON_OFFSET_FILL),n.polygonOffset=e.polygonOffset),n.polygonOffsetFactor===e.polygonOffsetFactor&&n.polygonOffsetUnits===e.polygonOffsetUnits||(t.polygonOffset(e.polygonOffsetFactor,e.polygonOffsetUnits),n.polygonOffsetFactor=e.polygonOffsetFactor,n.polygonOffsetUnits=e.polygonOffsetUnits)},e.prototype.validatePipelineFormats=function(e){for(var t=0;t<this.currentColorAttachments.length;t++)this.currentColorAttachments[t];this.currentDepthStencilAttachment&&Zh(this.currentDepthStencilAttachment.format===e.depthStencilAttachmentFormat),-1!==this.currentSampleCount&&Zh(this.currentSampleCount===e.sampleCount)},e.prototype.setPipeline=function(e){var t=this;if(this.renderBundle)this.renderBundle.push((function(){return t.setPipeline(e)}));else{this.currentPipeline=e,this.validatePipelineFormats(this.currentPipeline),this.setMegaState(this.currentPipeline.megaState);var n=this.currentPipeline.program;if(this.useProgram(n),n.compileState===vf.NeedsBind){var r=this.gl,i=n.gl_program,o=n.descriptor,a=pf(o.vertex.glsl,wf);if(nf(r))for(var s=0;s<a.length;s++){var l=(0,hh.zs)(a[s],2)[1],c=r.getUniformBlockIndex(i,l);-1!==c&&4294967295!==c&&r.uniformBlockBinding(i,c,s)}var u=pf(o.fragment.glsl,/^uniform .*sampler\S+ (\w+);\s* \/\/ BINDING=(\d+)$/gm);for(s=0;s<u.length;s++){var h=(0,hh.zs)(u[s],3),d=h[1],f=h[2],p=r.getUniformLocation(i,d);r.uniform1i(p,parseInt(f))}n.compileState=vf.ReadyToUse}}},e.prototype.setVertexInput=function(e,t,n){var r,i,o,a=this;if(this.renderBundle)this.renderBundle.push((function(){return a.setVertexInput(e,t,n)}));else if(null!==e){Zh(this.currentPipeline.inputLayout===e);var s=e;this.bindVAO(s.vao);for(var l=this.gl,c=0;c<s.vertexBufferDescriptors.length;c++){var u=s.vertexBufferDescriptors[c],h=u.arrayStride,d=u.attributes;try{for(var f=(r=void 0,(0,hh.Ju)(d)),p=f.next();!p.done;p=f.next()){var g=p.value,m=g.shaderLocation,_=g.offset,v=nf(l)?m:null===(o=s.program.attributes[m])||void 0===o?void 0:o.location;if(!lh(v)){var y=t[c];if(null===y)continue;var E=g.vertexFormat;l.bindBuffer(l.ARRAY_BUFFER,uf(y.buffer));var A=(y.offset||0)+_;l.vertexAttribPointer(v,E.size,E.type,E.normalized,h,A)}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}if(Zh(null!==n==(null!==s.indexBufferFormat)),null!==n){var b=n.buffer;Zh(b.usage===xh.INDEX),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,uf(b)),this.currentIndexBufferByteOffset=n.offset||0}else this.currentIndexBufferByteOffset=null}else Zh(null===this.currentPipeline.inputLayout),Zh(null===n),this.bindVAO(null),this.currentIndexBufferByteOffset=0},e.prototype.setStencilReference=function(e){this.currentStencilRef!==e&&(this.currentStencilRef=e,this.applyStencil())},e.prototype.draw=function(e,t,n,r){var i,o=this;if(this.renderBundle)this.renderBundle.push((function(){return o.draw(e,t,n,r)}));else{var a=this.gl,s=this.currentPipeline;if(t){var l=[s.drawMode,n||0,e,t];nf(a)?a.drawArraysInstanced.apply(a,(0,hh.fX)([],(0,hh.zs)(l),!1)):(i=this.ANGLE_instanced_arrays).drawArraysInstancedANGLE.apply(i,(0,hh.fX)([],(0,hh.zs)(l),!1))}else a.drawArrays(s.drawMode,n,e);this.debugGroupStatisticsDrawCall(),this.debugGroupStatisticsTriangles(e/3*Math.max(t,1))}},e.prototype.drawIndexed=function(e,t,n,r,i){var o,a=this;if(this.renderBundle)this.renderBundle.push((function(){return a.drawIndexed(e,t,n,r,i)}));else{var s=this.gl,l=this.currentPipeline,c=Yh(l.inputLayout),u=Yh(this.currentIndexBufferByteOffset)+n*c.indexBufferCompByteSize;if(t){var h=[l.drawMode,e,c.indexBufferType,u,t];nf(s)?s.drawElementsInstanced.apply(s,(0,hh.fX)([],(0,hh.zs)(h),!1)):(o=this.ANGLE_instanced_arrays).drawElementsInstancedANGLE.apply(o,(0,hh.fX)([],(0,hh.zs)(h),!1))}else s.drawElements(l.drawMode,e,c.indexBufferType,u);this.debugGroupStatisticsDrawCall(),this.debugGroupStatisticsTriangles(e/3*Math.max(t,1))}},e.prototype.drawIndirect=function(e,t){},e.prototype.drawIndexedIndirect=function(e,t){},e.prototype.beginOcclusionQuery=function(e){var t=this.gl;if(nf(t)){var n=this.currentRenderPassDescriptor.occlusionQueryPool;t.beginQuery(n.gl_query_type,n.gl_query[e])}},e.prototype.endOcclusionQuery=function(){var e=this.gl;if(nf(e)){var t=this.currentRenderPassDescriptor.occlusionQueryPool;e.endQuery(t.gl_query_type)}},e.prototype.pipelineQueryReady=function(e){var t=e;return this.queryProgramReady(t.program)},e.prototype.pipelineForceReady=function(e){},e.prototype.endPass=function(){for(var e=this.gl,t=nf(e),n=1===this.currentColorResolveTos.length&&this.currentColorResolveTos[0]===this.scTexture,r=!1,i=0;i<this.currentColorAttachments.length;i++){var o=this.currentColorAttachments[i];if(null!==o){var a=this.currentColorResolveTos[i],s=!1;null!==a&&(Zh(o.width===a.width&&o.height===a.height),this.setScissorRectEnabled(!1),n||(t&&e.bindFramebuffer(e.READ_FRAMEBUFFER,this.resolveColorReadFramebuffer),this.resolveColorAttachmentsChanged&&t&&this.bindFramebufferAttachment(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,o,this.currentColorAttachmentLevels[i])),s=!0,n||(a===this.scTexture?e.bindFramebuffer(t?fh.DRAW_FRAMEBUFFER:fh.FRAMEBUFFER,this.scPlatformFramebuffer):(e.bindFramebuffer(t?fh.DRAW_FRAMEBUFFER:fh.FRAMEBUFFER,this.resolveColorDrawFramebuffer),this.resolveColorAttachmentsChanged&&e.framebufferTexture2D(t?fh.DRAW_FRAMEBUFFER:fh.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a.gl_texture,this.currentColorResolveToLevels[i]))),n||(t?(e.blitFramebuffer(0,0,o.width,o.height,0,0,a.width,a.height,e.COLOR_BUFFER_BIT,e.LINEAR),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null)):this.submitBlitRenderPass(o,a)),r=!0),this.currentRenderPassDescriptor.colorStore[i]||n||s||(e.bindFramebuffer(t?fh.READ_FRAMEBUFFER:fh.FRAMEBUFFER,this.resolveColorReadFramebuffer),this.resolveColorAttachmentsChanged&&this.bindFramebufferAttachment(t?fh.READ_FRAMEBUFFER:fh.FRAMEBUFFER,e.COLOR_ATTACHMENT0,o,this.currentColorAttachmentLevels[i])),n||e.bindFramebuffer(t?fh.READ_FRAMEBUFFER:fh.FRAMEBUFFER,null)}}this.resolveColorAttachmentsChanged=!1;var l=this.currentDepthStencilAttachment;if(l){var c=this.currentDepthStencilResolveTo;s=!1,c&&(Zh(l.width===c.width&&l.height===c.height),this.setScissorRectEnabled(!1),n||(e.bindFramebuffer(t?fh.READ_FRAMEBUFFER:fh.FRAMEBUFFER,this.resolveDepthStencilReadFramebuffer),e.bindFramebuffer(t?fh.DRAW_FRAMEBUFFER:fh.FRAMEBUFFER,this.resolveDepthStencilDrawFramebuffer),this.resolveDepthStencilAttachmentsChanged&&(this.bindFramebufferDepthStencilAttachment(t?fh.READ_FRAMEBUFFER:fh.FRAMEBUFFER,l),this.bindFramebufferDepthStencilAttachment(t?fh.DRAW_FRAMEBUFFER:fh.FRAMEBUFFER,c))),s=!0,n||(t&&e.blitFramebuffer(0,0,l.width,l.height,0,0,c.width,c.height,e.DEPTH_BUFFER_BIT,e.NEAREST),e.bindFramebuffer(t?fh.DRAW_FRAMEBUFFER:fh.FRAMEBUFFER,null)),r=!0),n||this.currentRenderPassDescriptor.depthStencilStore||(s||(e.bindFramebuffer(t?fh.READ_FRAMEBUFFER:fh.FRAMEBUFFER,this.resolveDepthStencilReadFramebuffer),this.resolveDepthStencilAttachmentsChanged&&this.bindFramebufferDepthStencilAttachment(t?fh.READ_FRAMEBUFFER:fh.FRAMEBUFFER,l),s=!0),t&&e.invalidateFramebuffer(e.READ_FRAMEBUFFER,[e.DEPTH_STENCIL_ATTACHMENT])),!n&&s&&e.bindFramebuffer(t?fh.READ_FRAMEBUFFER:fh.FRAMEBUFFER,null),this.resolveDepthStencilAttachmentsChanged=!1}n||r||e.bindFramebuffer(t?fh.DRAW_FRAMEBUFFER:fh.FRAMEBUFFER,null)},e.prototype.setScissorRectEnabled=function(e){if(this.currentScissorEnabled!==e){var t=this.gl;e?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST),this.currentScissorEnabled=e}},e.prototype.applyStencil=function(){lh(this.currentStencilRef)||(this.gl.stencilFuncSeparate(fh.FRONT,this.currentMegaState.stencilFront.compare,this.currentStencilRef,this.currentMegaState.stencilFront.mask||255),this.gl.stencilFuncSeparate(fh.BACK,this.currentMegaState.stencilBack.compare,this.currentStencilRef,this.currentMegaState.stencilBack.mask||255))},e.prototype.getFallbackTexture=function(e){var t=e.gl_target,n=e.formatKind;if(t===fh.TEXTURE_2D)return n===wh.Depth?this.fallbackTexture2DDepth:this.fallbackTexture2D;if(t===fh.TEXTURE_2D_ARRAY)return this.fallbackTexture2DArray;if(t===fh.TEXTURE_3D)return this.fallbackTexture3D;if(t===fh.TEXTURE_CUBE_MAP)return this.fallbackTextureCube;throw new Error("whoops")},e.prototype.submitBlitRenderPass=function(e,t){this.blitRenderPipeline||(this.blitProgram=this.createProgram({vertex:{glsl:"layout(location = 0) in vec2 a_Position;\nout vec2 v_TexCoord;\nvoid main() {\n v_TexCoord = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n\n #ifdef VIEWPORT_ORIGIN_TL\n v_TexCoord.y = 1.0 - v_TexCoord.y;\n #endif\n}"},fragment:{glsl:"uniform sampler2D u_Texture;\nin vec2 v_TexCoord;\nout vec4 outputColor;\nvoid main() {\n outputColor = texture(SAMPLER_2D(u_Texture), v_TexCoord);\n}"}}),this.blitVertexBuffer=this.createBuffer({usage:xh.VERTEX|xh.COPY_DST,viewOrSize:new Float32Array([-4,-4,4,-4,0,4])}),this.blitInputLayout=this.createInputLayout({vertexBufferDescriptors:[{arrayStride:8,stepMode:Rh.VERTEX,attributes:[{format:kh.F32_RG,offset:0,shaderLocation:0}]}],indexBufferFormat:null,program:this.blitProgram}),this.blitRenderPipeline=this.createRenderPipeline({topology:Th.TRIANGLES,sampleCount:1,program:this.blitProgram,colorAttachmentFormats:[kh.U8_RGBA_RT],depthStencilAttachmentFormat:null,inputLayout:this.blitInputLayout,megaStateDescriptor:ld(ud)}),this.blitBindings=this.createBindings({samplerBindings:[{sampler:null,texture:e.texture}],uniformBufferBindings:[]}),this.blitProgram.setUniformsLegacy({u_Texture:e}));var n=this.currentRenderPassDescriptor;this.currentRenderPassDescriptor=null,this.inBlitRenderPass=!0;var r=this.createRenderPass({colorAttachment:[e],colorResolveTo:[t],colorClearColor:[ed]}),i=this.getCanvas(),o=i.width,a=i.height;r.setPipeline(this.blitRenderPipeline),r.setBindings(this.blitBindings),r.setVertexInput(this.blitInputLayout,[{buffer:this.blitVertexBuffer}],null),r.setViewport(0,0,o,a),this.gl.disable(this.gl.BLEND),r.draw(3,0),this.gl.enable(this.gl.BLEND),this.currentRenderPassDescriptor=n,this.inBlitRenderPass=!1},e}(),Nf=function(){function e(e){this.pluginOptions=e}return e.prototype.createSwapChain=function(e){return(0,hh.sH)(this,void 0,void 0,(function(){var t,n,r,i,o,a,s,l,c,u,h,d,f;return(0,hh.YH)(this,(function(p){return t=this.pluginOptions,n=t.targets,r=t.xrCompatible,i=t.antialias,o=void 0!==i&&i,a=t.preserveDrawingBuffer,s=void 0!==a&&a,l=t.premultipliedAlpha,c=void 0===l||l,u=t.shaderDebug,h=t.trackResources,d={antialias:o,preserveDrawingBuffer:s,stencil:!0,premultipliedAlpha:c,xrCompatible:r},this.handleContextEvents(e),n.includes("webgl2")&&(f=e.getContext("webgl2",d)||e.getContext("experimental-webgl2",d)),!f&&n.includes("webgl1")&&(f=e.getContext("webgl",d)||e.getContext("experimental-webgl",d)),[2,new Pf(f,{shaderDebug:u,trackResources:h})]}))}))},e.prototype.handleContextEvents=function(e){var t=this.pluginOptions,n=t.onContextLost,r=t.onContextRestored,i=t.onContextCreationError;i&&e.addEventListener("webglcontextcreationerror",i,!1),n&&e.addEventListener("webglcontextlost",n,!1),r&&e.addEventListener("webglcontextrestored",r,!1)},e}();let Df;const Bf="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&Bf.decode();let Ff=null;function Uf(){return null!==Ff&&0!==Ff.byteLength||(Ff=new Uint8Array(Df.memory.buffer)),Ff}function kf(e,t){return e>>>=0,Bf.decode(Uf().subarray(e,e+t))}const Gf=new Array(128).fill(void 0);Gf.push(void 0,null,!0,!1);let zf=Gf.length;function jf(e){return Gf[e]}let Vf=0;const Hf="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Wf="function"==typeof Hf.encodeInto?function(e,t){return Hf.encodeInto(e,t)}:function(e,t){const n=Hf.encode(e);return t.set(n),{read:e.length,written:n.length}};function Xf(e,t,n){if(void 0===n){const n=Hf.encode(e),r=t(n.length,1)>>>0;return Uf().subarray(r,r+n.length).set(n),Vf=n.length,r}let r=e.length,i=t(r,1)>>>0;const o=Uf();let a=0;for(;a<r;a++){const t=e.charCodeAt(a);if(t>127)break;o[i+a]=t}if(a!==r){0!==a&&(e=e.slice(a)),i=n(i,r,r=a+3*e.length,1)>>>0;const t=Uf().subarray(i+a,i+r);a+=Wf(e,t).written}return Vf=a,i}let Zf=null;function Yf(){return null!==Zf&&0!==Zf.byteLength||(Zf=new Int32Array(Df.memory.buffer)),Zf}function qf(e,t,n){let r,i;try{const s=Df.__wbindgen_add_to_stack_pointer(-16),l=Xf(e,Df.__wbindgen_malloc,Df.__wbindgen_realloc),c=Vf,u=Xf(t,Df.__wbindgen_malloc,Df.__wbindgen_realloc),h=Vf;Df.glsl_compile(s,l,c,u,h,n);var o=Yf()[s/4+0],a=Yf()[s/4+1];return r=o,i=a,kf(o,a)}finally{Df.__wbindgen_add_to_stack_pointer(16),Df.__wbindgen_free(r,i,1)}}class Kf{static __wrap(e){e>>>=0;const t=Object.create(Kf.prototype);return t.__wbg_ptr=e,t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,e}free(){const e=this.__destroy_into_raw();Df.__wbg_wgslcomposer_free(e)}constructor(){const e=Df.wgslcomposer_new();return Kf.__wrap(e)}load_composable(e){const t=Xf(e,Df.__wbindgen_malloc,Df.__wbindgen_realloc),n=Vf;Df.wgslcomposer_load_composable(this.__wbg_ptr,t,n)}wgsl_compile(e){let t,n;try{const o=Df.__wbindgen_add_to_stack_pointer(-16),a=Xf(e,Df.__wbindgen_malloc,Df.__wbindgen_realloc),s=Vf;Df.wgslcomposer_wgsl_compile(o,this.__wbg_ptr,a,s);var r=Yf()[o/4+0],i=Yf()[o/4+1];return t=r,n=i,kf(r,i)}finally{Df.__wbindgen_add_to_stack_pointer(16),Df.__wbindgen_free(t,n,1)}}}function Qf(){const e={wbg:{}};return e.wbg.__wbindgen_string_new=function(e,t){return function(e){zf===Gf.length&&Gf.push(Gf.length+1);const t=zf;return zf=Gf[t],Gf[t]=e,t}(kf(e,t))},e.wbg.__wbindgen_object_drop_ref=function(e){!function(e){const t=jf(e);(function(e){e<132||(Gf[e]=zf,zf=e)})(e)}(e)},e.wbg.__wbg_log_1d3ae0273d8f4f8a=function(e){console.log(jf(e))},e.wbg.__wbg_log_576ca876af0d4a77=function(e,t){console.log(jf(e),jf(t))},e.wbg.__wbindgen_throw=function(e,t){throw new Error(kf(e,t))},e}async function $f(e){if(void 0!==Df)return Df;const t=Qf();("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e));const{instance:n,module:r}=await async function(e,t){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if("application/wasm"==e.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t)}const n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}{const n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}(await e,t);return function(e,t){return Df=e.exports,$f.__wbindgen_wasm_module=t,Zf=null,Ff=null,Df}(n,r)}var Jf,ep;function tp(e){if(e===kh.U8_R_NORM)return"r8unorm";if(e===kh.S8_R_NORM)return"r8snorm";if(e===kh.U8_RG_NORM)return"rg8unorm";if(e===kh.S8_RG_NORM)return"rg8snorm";if(e===kh.U32_R)return"r32uint";if(e===kh.S32_R)return"r32sint";if(e===kh.F32_R)return"r32float";if(e===kh.U16_RG)return"rg16uint";if(e===kh.S16_RG)return"rg16sint";if(e===kh.F16_RG)return"rg16float";if(e===kh.U8_RGBA_RT)return"bgra8unorm";if(e===kh.U8_RGBA_RT_SRGB)return"bgra8unorm-srgb";if(e===kh.U8_RGBA_NORM)return"rgba8unorm";if(e===kh.U8_RGBA_SRGB)return"rgba8unorm-srgb";if(e===kh.S8_RGBA_NORM)return"rgba8snorm";if(e===kh.U32_RG)return"rg32uint";if(e===kh.S32_RG)return"rg32sint";if(e===kh.F32_RG)return"rg32float";if(e===kh.U16_RGBA)return"rgba16uint";if(e===kh.S16_RGBA)return"rgba16sint";if(e===kh.F16_RGBA)return"rgba16float";if(e===kh.F32_RGBA)return"rgba32float";if(e===kh.U32_RGBA)return"rgba32uint";if(e===kh.S32_RGBA)return"rgba32sint";if(e===kh.D24)return"depth24plus";if(e===kh.D24_S8)return"depth24plus-stencil8";if(e===kh.D32F)return"depth32float";if(e===kh.D32F_S8)return"depth32float-stencil8";if(e===kh.BC1)return"bc1-rgba-unorm";if(e===kh.BC1_SRGB)return"bc1-rgba-unorm-srgb";if(e===kh.BC2)return"bc2-rgba-unorm";if(e===kh.BC2_SRGB)return"bc2-rgba-unorm-srgb";if(e===kh.BC3)return"bc3-rgba-unorm";if(e===kh.BC3_SRGB)return"bc3-rgba-unorm-srgb";if(e===kh.BC4_SNORM)return"bc4-r-snorm";if(e===kh.BC4_UNORM)return"bc4-r-unorm";if(e===kh.BC5_SNORM)return"bc5-rg-snorm";if(e===kh.BC5_UNORM)return"bc5-rg-unorm";throw"whoops"}function np(e){if(e===Lh.TEXTURE_2D)return"2d";if(e===Lh.TEXTURE_CUBE_MAP)return"cube";if(e===Lh.TEXTURE_2D_ARRAY)return"2d-array";if(e===Lh.TEXTURE_3D)return"3d";throw new Error("whoops")}function rp(e){if(e===Eh.CLAMP_TO_EDGE)return"clamp-to-edge";if(e===Eh.REPEAT)return"repeat";if(e===Eh.MIRRORED_REPEAT)return"mirror-repeat";throw new Error("whoops")}function ip(e){if(e===Ah.BILINEAR)return"linear";if(e===Ah.POINT)return"nearest";throw new Error("whoops")}function op(e){if(e===bh.LINEAR)return"linear";if(e===bh.NEAREST)return"nearest";if(e===bh.NO_MIP)return"nearest";throw new Error("whoops")}function ap(e){return e.gpuBuffer}function sp(e){if(e===Dh.OcclusionConservative)return"occlusion";throw new Error("whoops")}function lp(e){switch(e){case Th.TRIANGLES:return"triangle-list";case Th.POINTS:return"point-list";case Th.TRIANGLE_STRIP:return"triangle-strip";case Th.LINES:return"line-list";case Th.LINE_STRIP:return"line-strip";default:throw new Error("Unknown primitive topology mode")}}function cp(e){if(e===_h.NONE)return"none";if(e===_h.FRONT)return"front";if(e===_h.BACK)return"back";throw new Error("whoops")}function up(e){if(e===mh.CCW)return"ccw";if(e===mh.CW)return"cw";throw new Error("whoops")}function hp(e){if(e===vh.ZERO)return"zero";if(e===vh.ONE)return"one";if(e===vh.SRC)return"src";if(e===vh.ONE_MINUS_SRC)return"one-minus-src";if(e===vh.DST)return"dst";if(e===vh.ONE_MINUS_DST)return"one-minus-dst";if(e===vh.SRC_ALPHA)return"src-alpha";if(e===vh.ONE_MINUS_SRC_ALPHA)return"one-minus-src-alpha";if(e===vh.DST_ALPHA)return"dst-alpha";if(e===vh.ONE_MINUS_DST_ALPHA)return"one-minus-dst-alpha";if(e===vh.CONST)return"constant";if(e===vh.ONE_MINUS_CONSTANT)return"one-minus-constant";if(e===vh.SRC_ALPHA_SATURATE)return"src-alpha-saturated";throw new Error("whoops")}function dp(e){if(e===yh.ADD)return"add";if(e===yh.SUBSTRACT)return"subtract";if(e===yh.REVERSE_SUBSTRACT)return"reverse-subtract";if(e===yh.MIN)return"min";if(e===yh.MAX)return"max";throw new Error("whoops")}function fp(e){return{operation:dp(e.blendMode),srcFactor:hp(e.blendSrcFactor),dstFactor:hp(e.blendDstFactor)}}function pp(e){return e.blendMode===yh.ADD&&e.blendSrcFactor===vh.ONE&&e.blendDstFactor===vh.ZERO}function gp(e){return pp(e.rgbBlendState)&&pp(e.alphaBlendState)?void 0:{color:fp(e.rgbBlendState),alpha:fp(e.alphaBlendState)}}function mp(e){if(e===gh.NEVER)return"never";if(e===gh.LESS)return"less";if(e===gh.EQUAL)return"equal";if(e===gh.LEQUAL)return"less-equal";if(e===gh.GREATER)return"greater";if(e===gh.NOTEQUAL)return"not-equal";if(e===gh.GEQUAL)return"greater-equal";if(e===gh.ALWAYS)return"always";throw new Error("whoops")}function _p(e){if(e===Ih.KEEP)return"keep";if(e===Ih.REPLACE)return"replace";if(e===Ih.ZERO)return"zero";if(e===Ih.DECREMENT_CLAMP)return"decrement-clamp";if(e===Ih.DECREMENT_WRAP)return"decrement-wrap";if(e===Ih.INCREMENT_CLAMP)return"increment-clamp";if(e===Ih.INCREMENT_WRAP)return"increment-wrap";if(e===Ih.INVERT)return"invert";throw new Error("whoops")}function vp(e){if(e===Rh.VERTEX)return"vertex";if(e===Rh.INSTANCE)return"instance";throw new Error("whoops")}function yp(e){if(e===kh.U8_R)return"uint8x2";if(e===kh.U8_RG)return"uint8x2";if(e===kh.U8_RGB)return"uint8x4";if(e===kh.U8_RGBA)return"uint8x4";if(e===kh.U8_RG_NORM)return"unorm8x2";if(e===kh.U8_RGBA_NORM)return"unorm8x4";if(e===kh.S8_RGB_NORM)return"snorm8x4";if(e===kh.S8_RGBA_NORM)return"snorm8x4";if(e===kh.U16_RG_NORM)return"unorm16x2";if(e===kh.U16_RGBA_NORM)return"unorm16x4";if(e===kh.S16_RG_NORM)return"snorm16x2";if(e===kh.S16_RGBA_NORM)return"snorm16x4";if(e===kh.S16_RG)return"uint16x2";if(e===kh.F16_RG)return"float16x2";if(e===kh.F16_RGBA)return"float16x4";if(e===kh.F32_R)return"float32";if(e===kh.F32_RG)return"float32x2";if(e===kh.F32_RGB)return"float32x3";if(e===kh.F32_RGBA)return"float32x4";throw"whoops"}function Ep(e,t,n,r){switch(void 0===n&&(n=!1),e){case kh.S8_R:case kh.S8_R_NORM:case kh.S8_RG_NORM:case kh.S8_RGB_NORM:case kh.S8_RGBA_NORM:var i=(ArrayBuffer,new Int8Array(t));return r&&i.set(new Int8Array(r)),i;case kh.U8_R:case kh.U8_R_NORM:case kh.U8_RG:case kh.U8_RG_NORM:case kh.U8_RGB:case kh.U8_RGB_NORM:case kh.U8_RGB_SRGB:case kh.U8_RGBA:case kh.U8_RGBA_NORM:case kh.U8_RGBA_SRGB:var o=(ArrayBuffer,new Uint8Array(t));return r&&o.set(new Uint8Array(r)),o;case kh.S16_R:case kh.S16_RG:case kh.S16_RG_NORM:case kh.S16_RGB_NORM:case kh.S16_RGBA:case kh.S16_RGBA_NORM:var a=t instanceof ArrayBuffer?new Int16Array(t):new Int16Array(n?t/2:t);return r&&a.set(new Int16Array(r)),a;case kh.U16_R:case kh.U16_RGB:case kh.U16_RGBA_5551:case kh.U16_RGBA_NORM:case kh.U16_RG_NORM:case kh.U16_R_NORM:var s=t instanceof ArrayBuffer?new Uint16Array(t):new Uint16Array(n?t/2:t);return r&&s.set(new Uint16Array(r)),s;case kh.S32_R:var l=t instanceof ArrayBuffer?new Int32Array(t):new Int32Array(n?t/4:t);return r&&l.set(new Int32Array(r)),l;case kh.U32_R:case kh.U32_RG:var c=t instanceof ArrayBuffer?new Uint32Array(t):new Uint32Array(n?t/4:t);return r&&c.set(new Uint32Array(r)),c;case kh.F32_R:case kh.F32_RG:case kh.F32_RGB:case kh.F32_RGBA:var u=t instanceof ArrayBuffer?new Float32Array(t):new Float32Array(n?t/4:t);return r&&u.set(new Float32Array(r)),u}var h=(ArrayBuffer,new Uint8Array(t));return r&&h.set(new Uint8Array(r)),h}function Ap(e){var t=(32768&e)>>15,n=(31744&e)>>10,r=1023&e;return 0===n?(t?-1:1)*Math.pow(2,-14)*(r/Math.pow(2,10)):31==n?r?NaN:1/0*(t?-1:1):(t?-1:1)*Math.pow(2,n-15)*(1+r/Math.pow(2,10))}function bp(e){switch(e){case"r8unorm":case"r8snorm":case"r8uint":case"r8sint":return{width:1,height:1,length:1};case"r16uint":case"r16sint":case"r16float":case"rg8unorm":case"rg8snorm":case"rg8uint":case"rg8sint":case"depth16unorm":return{width:1,height:1,length:2};case"r32uint":case"r32sint":case"r32float":case"rg16uint":case"rg16sint":case"rg16float":case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8snorm":case"rgba8uint":case"rgba8sint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgb9e5ufloat":case"rgb10a2unorm":case"rg11b10ufloat":case"depth32float":default:return{width:1,height:1,length:4};case"rg32uint":case"rg32sint":case"rg32float":case"rgba16uint":case"rgba16sint":case"rgba16float":return{width:1,height:1,length:8};case"rgba32uint":case"rgba32sint":case"rgba32float":return{width:1,height:1,length:16};case"stencil8":throw new Error("No fixed size for Stencil8 format!");case"depth24plus":throw new Error("No fixed size for Depth24Plus format!");case"depth24plus-stencil8":throw new Error("No fixed size for Depth24PlusStencil8 format!");case"depth32float-stencil8":return{width:1,height:1,length:5};case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc6h-rgb-ufloat":case"bc6h-rgb-float":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc5-rg-unorm":case"bc5-rg-snorm":return{width:4,height:4,length:16};case"bc4-r-unorm":case"bc4-r-snorm":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":return{width:4,height:4,length:8}}}!function(e){e[e.COPY_SRC=1]="COPY_SRC",e[e.COPY_DST=2]="COPY_DST",e[e.TEXTURE_BINDING=4]="TEXTURE_BINDING",e[e.STORAGE_BINDING=8]="STORAGE_BINDING",e[e.STORAGE=8]="STORAGE",e[e.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"}(Jf||(Jf={})),function(e){e[e.READ=1]="READ",e[e.WRITE=2]="WRITE"}(ep||(ep={}));var Tp=function(e){function t(t){var n=t.id,r=t.device,i=e.call(this)||this;return i.id=n,i.device=r,i}return(0,hh.C6)(t,e),t.prototype.destroy=function(){},t}(dh),xp=function(e){function t(t){var n,r,i=t.id,o=t.device,a=t.descriptor,s=e.call(this,{id:i,device:o})||this;s.type=ph.Bindings;var l=a.pipeline;Zh(!!l);var c=a.uniformBufferBindings,u=a.storageBufferBindings,h=a.samplerBindings,d=a.storageTextureBindings;s.numUniformBuffers=(null==c?void 0:c.length)||0;var f=[[],[],[],[]],p=0;if(c&&c.length)for(var g=0;g<c.length;g++){var m=a.uniformBufferBindings[g],_=m.binding,v=m.size,y=m.offset,E={buffer:ap(m.buffer),offset:null!=y?y:0,size:v};f[0].push({binding:null!=_?_:p++,resource:E})}if(h&&h.length)for(p=0,g=0;g<h.length;g++){var A=(0,hh.Cl)((0,hh.Cl)({},h[g]),dd),b=null!==(_=a.samplerBindings[g]).texture?_.texture:s.device.getFallbackTexture(A);A.dimension=b.dimension,A.formatKind=Xh(b.format);var T=b.gpuTextureView;if(f[1].push({binding:null!==(n=_.textureBinding)&&void 0!==n?n:p++,resource:T}),-1!==_.samplerBinding){var x=(null!==_.sampler?_.sampler:s.device.getFallbackSampler(A)).gpuSampler;f[1].push({binding:null!==(r=_.samplerBinding)&&void 0!==r?r:p++,resource:x})}}if(u&&u.length)for(p=0,g=0;g<u.length;g++){var S=a.storageBufferBindings[g];_=S.binding,v=S.size,y=S.offset,E={buffer:ap(S.buffer),offset:null!=y?y:0,size:v},f[2].push({binding:null!=_?_:p++,resource:E})}if(d&&d.length)for(p=0,g=0;g<d.length;g++){var R=a.storageTextureBindings[g];_=R.binding,T=(b=R.texture).gpuTextureView,f[3].push({binding:null!=_?_:p++,resource:T})}var C=f.findLastIndex((function(e){return!!e.length}));return s.gpuBindGroup=f.map((function(e,t){return t<=C&&s.device.device.createBindGroup({layout:l.getBindGroupLayout(t),entries:e})})),s}return(0,hh.C6)(t,e),t}(Tp),Sp=function(e){function t(t){var n=t.id,r=t.device,i=t.descriptor,o=e.call(this,{id:n,device:r})||this;o.type=ph.Buffer;var a=i.usage,s=i.viewOrSize,l=!!(a&xh.MAP_READ);o.usage=function(e){var t=0;return e&xh.INDEX&&(t|=GPUBufferUsage.INDEX),e&xh.VERTEX&&(t|=GPUBufferUsage.VERTEX),e&xh.UNIFORM&&(t|=GPUBufferUsage.UNIFORM),e&xh.STORAGE&&(t|=GPUBufferUsage.STORAGE),e&xh.COPY_SRC&&(t|=GPUBufferUsage.COPY_SRC),e&xh.INDIRECT&&(t|=GPUBufferUsage.INDIRECT),t|GPUBufferUsage.COPY_DST}(a),l&&(o.usage=xh.MAP_READ|xh.COPY_DST);var c=!uh(s);return o.view=uh(s)?null:s,o.size=uh(s)?rd(s,4):rd(s.byteLength,4),uh(s)?o.gpuBuffer=o.device.device.createBuffer({usage:o.usage,size:o.size,mappedAtCreation:!!l&&c}):(o.gpuBuffer=o.device.device.createBuffer({usage:o.usage,size:o.size,mappedAtCreation:!0}),new(s&&s.constructor||Float32Array)(o.gpuBuffer.getMappedRange()).set(s),o.gpuBuffer.unmap()),o}return(0,hh.C6)(t,e),t.prototype.setSubData=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i=this.gpuBuffer;r=r||t.byteLength,r=Math.min(r,this.size-e);var o=t.byteOffset+n,a=o+r,s=r+3&-4;if(s!==r){var l=new Uint8Array(t.buffer.slice(o,a));(t=new Uint8Array(s)).set(l),n=0,o=0,a=s,r=s}for(var c=15728640,u=0;a-(o+u)>c;)this.device.device.queue.writeBuffer(i,e+u,t.buffer,o+u,c),u+=c;this.device.device.queue.writeBuffer(i,e+u,t.buffer,o+u,r-u)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.gpuBuffer.destroy()},t}(Tp),Rp=function(){function e(){this.gpuComputePassEncoder=null}return e.prototype.dispatchWorkgroups=function(e,t,n){this.gpuComputePassEncoder.dispatchWorkgroups(e,t,n)},e.prototype.dispatchWorkgroupsIndirect=function(e,t){this.gpuComputePassEncoder.dispatchWorkgroupsIndirect(e.gpuBuffer,t)},e.prototype.finish=function(){this.gpuComputePassEncoder.end(),this.gpuComputePassEncoder=null,this.frameCommandEncoder=null},e.prototype.beginComputePass=function(e){Zh(null===this.gpuComputePassEncoder),this.frameCommandEncoder=e,this.gpuComputePassEncoder=this.frameCommandEncoder.beginComputePass(this.gpuComputePassDescriptor)},e.prototype.setPipeline=function(e){var t=Yh(e.gpuComputePipeline);this.gpuComputePassEncoder.setPipeline(t)},e.prototype.setBindings=function(e){var t=this,n=e;n.gpuBindGroup.forEach((function(e,r){e&&t.gpuComputePassEncoder.setBindGroup(r,n.gpuBindGroup[r])}))},e.prototype.pushDebugGroup=function(e){this.gpuComputePassEncoder.pushDebugGroup(e)},e.prototype.popDebugGroup=function(){this.gpuComputePassEncoder.popDebugGroup()},e.prototype.insertDebugMarker=function(e){this.gpuComputePassEncoder.insertDebugMarker(e)},e}(),Cp=function(e){function t(t){var n=t.id,r=t.device,i=t.descriptor,o=e.call(this,{id:n,device:r})||this;o.type=ph.ComputePipeline,o.gpuComputePipeline=null,o.descriptor=i;var a=i.program.computeStage;if(null===a)return o;var s={layout:"auto",compute:(0,hh.Cl)({},a)};return o.gpuComputePipeline=o.device.device.createComputePipeline(s),void 0!==o.name&&(o.gpuComputePipeline.label=o.name),o}return(0,hh.C6)(t,e),t.prototype.getBindGroupLayout=function(e){return this.gpuComputePipeline.getBindGroupLayout(e)},t}(Tp),Lp=function(e){function t(t){var n,r,i,o,a=t.id,s=t.device,l=t.descriptor,c=e.call(this,{id:a,device:s})||this;c.type=ph.InputLayout;var u=[];try{for(var h=(0,hh.Ju)(l.vertexBufferDescriptors),d=h.next();!d.done;d=h.next()){var f=d.value,p=f.arrayStride,g=f.stepMode,m=f.attributes;u.push({arrayStride:p,stepMode:vp(g),attributes:[]});try{for(var _=(i=void 0,(0,hh.Ju)(m)),v=_.next();!v.done;v=_.next()){var y=v.value,E=y.shaderLocation,A=y.format,b=y.offset;u[u.length-1].attributes.push({shaderLocation:E,format:yp(A),offset:b})}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=_.return)&&o.call(_)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}return c.indexFormat=function(e){if(null!==e){if(e===kh.U16_R)return"uint16";if(e===kh.U32_R)return"uint32";throw new Error("whoops")}}(l.indexBufferFormat),c.buffers=u,c}return(0,hh.C6)(t,e),t}(Tp),Op=function(e){function t(t){var n=t.id,r=t.device,i=t.descriptor,o=e.call(this,{id:n,device:r})||this;return o.type=ph.Program,o.vertexStage=null,o.fragmentStage=null,o.computeStage=null,o.descriptor=i,i.vertex&&(o.vertexStage=o.createShaderStage(i.vertex,"vertex")),i.fragment&&(o.fragmentStage=o.createShaderStage(i.fragment,"fragment")),i.compute&&(o.computeStage=o.createShaderStage(i.compute,"compute")),o}return(0,hh.C6)(t,e),t.prototype.setUniformsLegacy=function(e){},t.prototype.createShaderStage=function(e,t){var n,r,i=e.glsl,o=e.wgsl,a=e.entryPoint,s=e.postprocess,l=o;if(!l)try{l=this.device.glsl_compile(i,t,!1)}catch(e){throw console.error(e,i),new Error("whoops")}var c=function(e){if(!l.includes(e))return"continue";l=(l=l.replace("var T_".concat(e,": texture_2d<f32>;"),"var T_".concat(e,": texture_depth_2d;"))).replace(new RegExp("textureSample\\(T_".concat(e,"(.*)\\);$"),"gm"),(function(t,n){return"vec4<f32>(textureSample(T_".concat(e).concat(n,"), 0.0, 0.0, 0.0);")}))};try{for(var u=(0,hh.Ju)(["u_TextureFramebufferDepth"]),h=u.next();!h.done;h=u.next())c(h.value)}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return s&&(l=s(l)),{module:this.device.device.createShaderModule({code:l}),entryPoint:a||"main"}},t}(Tp),Mp=function(e){function t(t){var n=t.id,r=t.device,i=t.descriptor,o=e.call(this,{id:n,device:r})||this;o.type=ph.QueryPool;var a=i.elemCount,s=i.type;return o.querySet=o.device.device.createQuerySet({type:sp(s),count:a}),o.resolveBuffer=o.device.device.createBuffer({size:8*a,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),o.cpuBuffer=o.device.device.createBuffer({size:8*a,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),o.results=null,o}return(0,hh.C6)(t,e),t.prototype.queryResultOcclusion=function(e){return null===this.results?null:this.results[e]!==BigInt(0)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.querySet.destroy(),this.resolveBuffer.destroy(),this.cpuBuffer.destroy()},t}(Tp),Ip=function(e){function t(t){var n=t.id,r=t.device,i=e.call(this,{id:n,device:r})||this;return i.type=ph.Readback,i}return(0,hh.C6)(t,e),t.prototype.readTexture=function(e,t,n,r,i,o,a,s){return void 0===a&&(a=0),(0,hh.sH)(this,void 0,void 0,(function(){var s,l,c,u,h,d,f;return(0,hh.YH)(this,(function(p){return l=bp((s=e).gpuTextureformat),c=Math.ceil(r/l.width)*l.length,u=256*Math.ceil(c/256),h=u*i,d=this.device.createBuffer({usage:xh.STORAGE|xh.MAP_READ|xh.COPY_DST,hint:Sh.STATIC,viewOrSize:h}),(f=this.device.device.createCommandEncoder()).copyTextureToBuffer({texture:s.gpuTexture,mipLevel:0,origin:{x:t,y:n,z:Math.max(0,0)}},{buffer:d.gpuBuffer,offset:0,bytesPerRow:u},{width:r,height:i,depthOrArrayLayers:1}),this.device.device.queue.submit([f.finish()]),[2,this.readBuffer(d,0,o.byteLength===h?o:null,a,h,s.format,!0,!1,c,u,i)]}))}))},t.prototype.readTextureSync=function(e,t,n,r,i,o,a,s){throw new Error("ERROR_MSG_METHOD_NOT_IMPLEMENTED")},t.prototype.readBuffer=function(e,t,n,r,i,o,a,s,l,c,u){var h=this;void 0===t&&(t=0),void 0===n&&(n=null),void 0===i&&(i=0),void 0===o&&(o=kh.U8_RGB),void 0===a&&(a=!1),void 0===l&&(l=0),void 0===c&&(c=0),void 0===u&&(u=0);var d=e,f=i||d.size,p=n||d.view,g=p&&p.constructor&&p.constructor.BYTES_PER_ELEMENT||Wh(o),m=d;if(!(d.usage&xh.MAP_READ&&d.usage&xh.COPY_DST)){var _=this.device.device.createCommandEncoder();m=this.device.createBuffer({usage:xh.STORAGE|xh.MAP_READ|xh.COPY_DST,hint:Sh.STATIC,viewOrSize:f}),_.copyBufferToBuffer(d.gpuBuffer,t,m.gpuBuffer,0,f),this.device.device.queue.submit([_.finish()])}return new Promise((function(e,n){m.gpuBuffer.mapAsync(ep.READ,t,f).then((function(){var n=m.gpuBuffer.getMappedRange(t,f),r=p;if(a)r=null===r?Ep(o,f,!0,n):Ep(o,r.buffer,void 0,n);else if(null===r)switch(g){case 1:(r=new Uint8Array(f)).set(new Uint8Array(n));break;case 2:r=h.getHalfFloatAsFloatRGBAArrayBuffer(f/2,n);break;case 4:(r=new Float32Array(f/4)).set(new Float32Array(n))}else switch(g){case 1:(r=new Uint8Array(r.buffer)).set(new Uint8Array(n));break;case 2:r=h.getHalfFloatAsFloatRGBAArrayBuffer(f/2,n,p);break;case 4:var i=p&&p.constructor||Float32Array;(r=new i(r.buffer)).set(new i(n))}if(l!==c){1!==g||a||(l*=2,c*=2);for(var s=new Uint8Array(r.buffer),d=l,_=0,v=1;v<u;++v){_=v*c;for(var y=0;y<l;++y)s[d++]=s[_++]}r=0===g||a?new Uint8Array(s.buffer,0,d):new Float32Array(s.buffer,0,d/4)}m.gpuBuffer.unmap(),e(r)}),(function(e){return n(e)}))}))},t.prototype.getHalfFloatAsFloatRGBAArrayBuffer=function(e,t,n){n||(n=new Float32Array(e));for(var r=new Uint16Array(t);e--;)n[e]=Ap(r[e]);return n},t}(Tp),wp=function(){function e(e){this.device=e,this.gpuRenderPassEncoder=null,this.gfxColorAttachment=[],this.gfxColorAttachmentLevel=[],this.gfxColorResolveTo=[],this.gfxColorResolveToLevel=[],this.gfxDepthStencilAttachment=null,this.gfxDepthStencilResolveTo=null,this.gpuColorAttachments=[],this.gpuDepthStencilAttachment={view:null,depthLoadOp:"load",depthStoreOp:"store",stencilLoadOp:"load",stencilStoreOp:"store"},this.gpuRenderPassDescriptor={colorAttachments:this.gpuColorAttachments,depthStencilAttachment:this.gpuDepthStencilAttachment}}return e.prototype.getEncoder=function(){var e;return(null===(e=this.renderBundle)||void 0===e?void 0:e.renderBundleEncoder)||this.gpuRenderPassEncoder},e.prototype.getTextureView=function(e,t){return Zh(t<e.mipLevelCount),1===e.mipLevelCount?e.gpuTextureView:e.gpuTexture.createView({baseMipLevel:t,mipLevelCount:1})},e.prototype.setRenderPassDescriptor=function(e){var t,n,r,i,o,a;this.descriptor=e,this.gpuRenderPassDescriptor.colorAttachments=this.gpuColorAttachments;var s=e.colorAttachment.length;this.gfxColorAttachment.length=s,this.gfxColorResolveTo.length=s;for(var l=0;l<e.colorAttachment.length;l++){var c=e.colorAttachment[l],u=e.colorResolveTo[l];if(null===c&&null!==u&&(c=u,u=null),this.gfxColorAttachment[l]=c,this.gfxColorResolveTo[l]=u,this.gfxColorAttachmentLevel[l]=(null===(t=e.colorAttachmentLevel)||void 0===t?void 0:t[l])||0,this.gfxColorResolveToLevel[l]=(null===(n=e.colorResolveToLevel)||void 0===n?void 0:n[l])||0,null===c){this.gpuColorAttachments.length=l,this.gfxColorAttachment.length=l,this.gfxColorResolveTo.length=l;break}void 0===this.gpuColorAttachments[l]&&(this.gpuColorAttachments[l]={}),(d=this.gpuColorAttachments[l]).view=this.getTextureView(c,(null===(r=this.gfxColorAttachmentLevel)||void 0===r?void 0:r[l])||0);var h=null!==(o=null===(i=e.colorClearColor)||void 0===i?void 0:i[l])&&void 0!==o?o:"load";"load"===h?d.loadOp="load":(d.loadOp="clear",d.clearValue=h),d.storeOp=(null===(a=e.colorStore)||void 0===a?void 0:a[l])?"store":"discard",d.resolveTarget=void 0,null!==u&&(c.sampleCount>1?d.resolveTarget=this.getTextureView(u,this.gfxColorResolveToLevel[l]):d.storeOp="store")}if(this.gfxDepthStencilAttachment=e.depthStencilAttachment,this.gfxDepthStencilResolveTo=e.depthStencilResolveTo,e.depthStencilAttachment){var d,f=e.depthStencilAttachment;(d=this.gpuDepthStencilAttachment).view=f.gpuTextureView,Vh(f.format)&Uh.Depth?("load"===e.depthClearValue?d.depthLoadOp="load":(d.depthLoadOp="clear",d.depthClearValue=e.depthClearValue),e.depthStencilStore||null!==this.gfxDepthStencilResolveTo?d.depthStoreOp="store":d.depthStoreOp="discard"):(d.depthLoadOp=void 0,d.depthStoreOp=void 0),Vh(f.format)&Uh.Stencil?("load"===e.stencilClearValue?d.stencilLoadOp="load":(d.stencilLoadOp="clear",d.stencilClearValue=e.stencilClearValue),e.depthStencilStore||null!==this.gfxDepthStencilResolveTo?d.stencilStoreOp="store":d.stencilStoreOp="discard"):(d.stencilLoadOp=void 0,d.stencilStoreOp=void 0),this.gpuRenderPassDescriptor.depthStencilAttachment=this.gpuDepthStencilAttachment}else this.gpuRenderPassDescriptor.depthStencilAttachment=void 0;this.gpuRenderPassDescriptor.occlusionQuerySet=lh(e.occlusionQueryPool)?void 0:e.occlusionQueryPool.querySet},e.prototype.beginRenderPass=function(e,t){Zh(null===this.gpuRenderPassEncoder),this.setRenderPassDescriptor(t),this.frameCommandEncoder=e,this.gpuRenderPassEncoder=this.frameCommandEncoder.beginRenderPass(this.gpuRenderPassDescriptor)},e.prototype.flipY=function(e,t){return this.device.swapChainHeight-e-t},e.prototype.setViewport=function(e,t,n,r,i,o){void 0===i&&(i=0),void 0===o&&(o=1),this.gpuRenderPassEncoder.setViewport(e,this.flipY(t,r),n,r,i,o)},e.prototype.setScissorRect=function(e,t,n,r){this.gpuRenderPassEncoder.setScissorRect(e,this.flipY(t,r),n,r)},e.prototype.setPipeline=function(e){var t=Yh(e.gpuRenderPipeline);this.getEncoder().setPipeline(t)},e.prototype.setVertexInput=function(e,t,n){if(null!==e){var r=this.getEncoder(),i=e;null!==n&&r.setIndexBuffer(ap(n.buffer),Yh(i.indexFormat),n.offset);for(var o=0;o<t.length;o++){var a=t[o];null!==a&&r.setVertexBuffer(o,ap(a.buffer),a.offset)}}},e.prototype.setBindings=function(e){var t=e,n=this.getEncoder();t.gpuBindGroup.forEach((function(e,r){e&&n.setBindGroup(r,t.gpuBindGroup[r])}))},e.prototype.setStencilReference=function(e){this.gpuRenderPassEncoder.setStencilReference(e)},e.prototype.draw=function(e,t,n,r){this.getEncoder().draw(e,t,n,r)},e.prototype.drawIndexed=function(e,t,n,r,i){this.getEncoder().drawIndexed(e,t,n,r,i)},e.prototype.drawIndirect=function(e,t){this.getEncoder().drawIndirect(ap(e),t)},e.prototype.drawIndexedIndirect=function(e,t){this.getEncoder().drawIndexedIndirect(ap(e),t)},e.prototype.beginOcclusionQuery=function(e){this.gpuRenderPassEncoder.beginOcclusionQuery(e)},e.prototype.endOcclusionQuery=function(){this.gpuRenderPassEncoder.endOcclusionQuery()},e.prototype.pushDebugGroup=function(e){this.gpuRenderPassEncoder.pushDebugGroup(e)},e.prototype.popDebugGroup=function(){this.gpuRenderPassEncoder.popDebugGroup()},e.prototype.insertDebugMarker=function(e){this.gpuRenderPassEncoder.insertDebugMarker(e)},e.prototype.beginBundle=function(e){this.renderBundle=e},e.prototype.endBundle=function(){this.renderBundle.finish()},e.prototype.executeBundles=function(e){this.gpuRenderPassEncoder.executeBundles(e.map((function(e){return e.renderBundle})))},e.prototype.finish=function(){var e;null===(e=this.gpuRenderPassEncoder)||void 0===e||e.end(),this.gpuRenderPassEncoder=null;for(var t=0;t<this.gfxColorAttachment.length;t++){var n=this.gfxColorAttachment[t],r=this.gfxColorResolveTo[t];null!==n&&null!==r&&1===n.sampleCount&&this.copyAttachment(r,this.gfxColorAttachmentLevel[t],n,this.gfxColorResolveToLevel[t])}this.gfxDepthStencilAttachment&&this.gfxDepthStencilResolveTo&&(this.gfxDepthStencilAttachment.sampleCount>1||this.copyAttachment(this.gfxDepthStencilResolveTo,0,this.gfxDepthStencilAttachment,0)),this.frameCommandEncoder=null},e.prototype.copyAttachment=function(e,t,n,r){Zh(1===n.sampleCount);var i={texture:n.gpuTexture,mipLevel:r},o={texture:e.gpuTexture,mipLevel:t};Zh(n.width>>>r==e.width>>>t),Zh(n.height>>>r==e.height>>>t),Zh(!!(n.usage&Jf.COPY_SRC)),Zh(!!(e.usage&Jf.COPY_DST)),this.frameCommandEncoder.copyTextureToTexture(i,o,[e.width,e.height,1])},e}(),Pp=function(e){function t(t){var n=t.id,r=t.device,i=t.descriptor,o=e.call(this,{id:n,device:r})||this;return o.type=ph.RenderPipeline,o.isCreatingAsync=!1,o.gpuRenderPipeline=null,o.descriptor=i,o.device.createRenderPipelineInternal(o,!1),o}return(0,hh.C6)(t,e),t.prototype.getBindGroupLayout=function(e){return this.gpuRenderPipeline.getBindGroupLayout(e)},t}(Tp),Np=function(e){function t(t){var n,r,i=t.id,o=t.device,a=t.descriptor,s=e.call(this,{id:i,device:o})||this;s.type=ph.Sampler;var l=a.lodMinClamp,c=a.mipmapFilter===bh.NO_MIP?a.lodMinClamp:a.lodMaxClamp,u=null!==(n=a.maxAnisotropy)&&void 0!==n?n:1;return u>1&&Zh(a.minFilter===Ah.BILINEAR&&a.magFilter===Ah.BILINEAR&&a.mipmapFilter===bh.LINEAR),s.gpuSampler=s.device.device.createSampler({addressModeU:rp(a.addressModeU),addressModeV:rp(a.addressModeV),addressModeW:rp(null!==(r=a.addressModeW)&&void 0!==r?r:a.addressModeU),lodMinClamp:l,lodMaxClamp:c,minFilter:ip(a.minFilter),magFilter:ip(a.magFilter),mipmapFilter:op(a.mipmapFilter),compare:void 0!==a.compareFunction?mp(a.compareFunction):void 0,maxAnisotropy:u}),s}return(0,hh.C6)(t,e),t}(Tp),Dp=function(e){function t(t){var n=t.id,r=t.device,i=t.descriptor,o=t.skipCreate,a=t.sampleCount,s=e.call(this,{id:n,device:r})||this;s.type=ph.Texture,s.flipY=!1;var l=i.format,c=i.dimension,u=i.width,h=i.height,d=i.depthOrArrayLayers,f=i.mipLevelCount,p=i.usage,g=i.pixelStore;return s.flipY=!!(null==g?void 0:g.unpackFlipY),s.device.createTextureShared({format:l,dimension:null!=c?c:Lh.TEXTURE_2D,width:u,height:h,depthOrArrayLayers:null!=d?d:1,mipLevelCount:null!=f?f:1,usage:p,sampleCount:null!=a?a:1},s,o),s}return(0,hh.C6)(t,e),t.prototype.textureFromImageBitmapOrCanvas=function(e,t,n){for(var r=t[0].width,i=t[0].height,o={size:{width:r,height:i,depthOrArrayLayers:n},format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT},a=e.createTexture(o),s=0;s<t.length;s++)e.queue.copyExternalImageToTexture({source:t[s],flipY:this.flipY},{texture:a,origin:[0,0,s]},[r,i]);return[a,r,i]},t.prototype.isImageBitmapOrCanvases=function(e){var t=e[0];return t instanceof ImageBitmap||t instanceof HTMLCanvasElement||t instanceof OffscreenCanvas},t.prototype.isVideo=function(e){return e[0]instanceof HTMLVideoElement},t.prototype.setImageData=function(e,t){var n,r,i,o,a=this,s=this.device.device;if(this.isImageBitmapOrCanvases(e))r=(n=(0,hh.zs)(this.textureFromImageBitmapOrCanvas(s,e,this.depthOrArrayLayers),3))[0],i=n[1],o=n[2];else if(this.isVideo(e))r=s.importExternalTexture({source:e[0]});else{var l=bp(this.gpuTextureformat),c=Math.ceil(this.width/l.width)*l.length;e.forEach((function(e){s.queue.writeTexture({texture:a.gpuTexture},e,{bytesPerRow:c},{width:a.width,height:a.height})}))}this.width=i,this.height=o,r&&(this.gpuTexture=r),this.gpuTextureView=this.gpuTexture.createView({dimension:np(this.dimension)})},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.gpuTexture.destroy()},t}(Tp),Bp=function(e){function t(t){var n=t.id,r=t.device,i=e.call(this,{id:n,device:r})||this;return i.type=ph.RenderBundle,i.renderBundleEncoder=i.device.device.createRenderBundleEncoder({colorFormats:[i.device.swapChainFormat]}),i}return(0,hh.C6)(t,e),t.prototype.finish=function(){this.renderBundle=this.renderBundleEncoder.finish()},t}(Tp),Fp=function(){function e(e,t,n,r,i,o){this.swapChainWidth=0,this.swapChainHeight=0,this.swapChainTextureUsage=Jf.RENDER_ATTACHMENT|Jf.COPY_DST,this._resourceUniqueId=0,this.renderPassPool=[],this.computePassPool=[],this.frameCommandEncoderPool=[],this.featureTextureCompressionBC=!1,this.platformString="WebGPU",this.glslVersion="#version 440",this.explicitBindingLocations=!0,this.separateSamplerTextures=!0,this.viewportOrigin=Ph.UPPER_LEFT,this.clipSpaceNearZ=Nh.ZERO,this.supportsSyncPipelineCompilation=!1,this.supportMRT=!0,this.device=t,this.canvas=n,this.canvasContext=r,this.glsl_compile=i,this.WGSLComposer=o,this.fallbackTexture2D=this.createFallbackTexture(Lh.TEXTURE_2D,wh.Float),this.setResourceName(this.fallbackTexture2D,"Fallback Texture2D"),this.fallbackTexture2DDepth=this.createFallbackTexture(Lh.TEXTURE_2D,wh.Depth),this.setResourceName(this.fallbackTexture2DDepth,"Fallback Depth Texture2D"),this.fallbackTexture2DArray=this.createFallbackTexture(Lh.TEXTURE_2D_ARRAY,wh.Float),this.setResourceName(this.fallbackTexture2DArray,"Fallback Texture2DArray"),this.fallbackTexture3D=this.createFallbackTexture(Lh.TEXTURE_3D,wh.Float),this.setResourceName(this.fallbackTexture3D,"Fallback Texture3D"),this.fallbackTextureCube=this.createFallbackTexture(Lh.TEXTURE_CUBE_MAP,wh.Float),this.setResourceName(this.fallbackTextureCube,"Fallback TextureCube"),this.fallbackSamplerFiltering=this.createSampler({addressModeU:Eh.REPEAT,addressModeV:Eh.REPEAT,minFilter:Ah.POINT,magFilter:Ah.POINT,mipmapFilter:bh.NEAREST}),this.setResourceName(this.fallbackSamplerFiltering,"Fallback Sampler Filtering"),this.fallbackSamplerComparison=this.createSampler({addressModeU:Eh.REPEAT,addressModeV:Eh.REPEAT,minFilter:Ah.POINT,magFilter:Ah.POINT,mipmapFilter:bh.NEAREST,compareFunction:gh.ALWAYS}),this.setResourceName(this.fallbackSamplerComparison,"Fallback Sampler Comparison Filtering"),this.device.features&&(this.featureTextureCompressionBC=this.device.features.has("texture-compression-bc")),this.device.onuncapturederror=function(e){console.error(e.error)},this.swapChainFormat=navigator.gpu.getPreferredCanvasFormat(),this.canvasContext.configure({device:this.device,format:this.swapChainFormat,usage:this.swapChainTextureUsage,alphaMode:"premultiplied"})}return e.prototype.destroy=function(){},e.prototype.configureSwapChain=function(e,t){this.swapChainWidth===e&&this.swapChainHeight===t||(this.swapChainWidth=e,this.swapChainHeight=t)},e.prototype.getOnscreenTexture=function(){var e=this.canvasContext.getCurrentTexture(),t=e.createView(),n=new Dp({id:0,device:this,descriptor:{format:kh.U8_RGBA_RT,width:this.swapChainWidth,height:this.swapChainHeight,depthOrArrayLayers:0,dimension:Lh.TEXTURE_2D,mipLevelCount:1,usage:this.swapChainTextureUsage},skipCreate:!0});return n.depthOrArrayLayers=1,n.sampleCount=1,n.gpuTexture=e,n.gpuTextureView=t,n.name="Onscreen",this.setResourceName(n,"Onscreen Texture"),n},e.prototype.getDevice=function(){return this},e.prototype.getCanvas=function(){return this.canvas},e.prototype.beginFrame=function(){Zh(0===this.frameCommandEncoderPool.length)},e.prototype.endFrame=function(){Zh(this.frameCommandEncoderPool.every((function(e){return null!==e}))),this.device.queue.submit(this.frameCommandEncoderPool.map((function(e){return e.finish()}))),this.frameCommandEncoderPool=[]},e.prototype.getNextUniqueId=function(){return++this._resourceUniqueId},e.prototype.createBuffer=function(e){return new Sp({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createTexture=function(e){return new Dp({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createSampler=function(e){return new Np({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createRenderTarget=function(e){var t=new Dp({id:this.getNextUniqueId(),device:this,descriptor:(0,hh.Cl)((0,hh.Cl)({},e),{dimension:Lh.TEXTURE_2D,mipLevelCount:1,depthOrArrayLayers:1,usage:Oh.RENDER_TARGET}),sampleCount:e.sampleCount});return t.depthOrArrayLayers=1,t.type=ph.RenderTarget,t},e.prototype.createRenderTargetFromTexture=function(e){var t=e,n=t.format,r=t.width,i=t.height,o=t.depthOrArrayLayers,a=t.sampleCount,s=t.mipLevelCount,l=t.gpuTexture,c=t.gpuTextureView,u=t.usage;Zh(!!(u&Jf.RENDER_ATTACHMENT));var h=new Dp({id:this.getNextUniqueId(),device:this,descriptor:{format:n,width:r,height:i,depthOrArrayLayers:o,dimension:Lh.TEXTURE_2D,mipLevelCount:s,usage:u},skipCreate:!0});return h.depthOrArrayLayers=o,h.sampleCount=a,h.gpuTexture=l,h.gpuTextureView=c,h},e.prototype.createProgram=function(e){var t,n;return(null===(t=e.vertex)||void 0===t?void 0:t.glsl)&&(e.vertex.glsl=Jd(this.queryVendorInfo(),"vert",e.vertex.glsl)),(null===(n=e.fragment)||void 0===n?void 0:n.glsl)&&(e.fragment.glsl=Jd(this.queryVendorInfo(),"frag",e.fragment.glsl)),new Op({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createProgramSimple=function(e){return new Op({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createTextureShared=function(e,t,n){var r={width:e.width,height:e.height,depthOrArrayLayers:e.depthOrArrayLayers},i=e.mipLevelCount,o=tp(e.format),a=function(e){if(e===Lh.TEXTURE_2D)return"2d";if(e===Lh.TEXTURE_CUBE_MAP)return"2d";if(e===Lh.TEXTURE_2D_ARRAY)return"2d";if(e===Lh.TEXTURE_3D)return"3d";throw new Error("whoops")}(e.dimension),s=function(e){var t=0;return e&Oh.SAMPLED&&(t|=Jf.TEXTURE_BINDING|Jf.COPY_DST|Jf.COPY_SRC),e&Oh.STORAGE&&(t|=Jf.TEXTURE_BINDING|Jf.STORAGE_BINDING|Jf.COPY_SRC|Jf.COPY_DST),e&Oh.RENDER_TARGET&&(t|=Jf.RENDER_ATTACHMENT|Jf.TEXTURE_BINDING|Jf.COPY_SRC|Jf.COPY_DST),t}(e.usage);if(t.gpuTextureformat=o,t.dimension=e.dimension,t.format=e.format,t.width=e.width,t.height=e.height,t.depthOrArrayLayers=e.depthOrArrayLayers,t.mipLevelCount=i,t.usage=s,t.sampleCount=e.sampleCount,!n){var l=this.device.createTexture({size:r,mipLevelCount:i,format:o,dimension:a,sampleCount:e.sampleCount,usage:s}),c=l.createView();t.gpuTexture=l,t.gpuTextureView=c}},e.prototype.getFallbackSampler=function(e){return e.formatKind===wh.Depth&&e.comparison?this.fallbackSamplerComparison:this.fallbackSamplerFiltering},e.prototype.getFallbackTexture=function(e){var t=e.dimension,n=e.formatKind;if(t===Lh.TEXTURE_2D)return n===wh.Depth?this.fallbackTexture2DDepth:this.fallbackTexture2D;if(t===Lh.TEXTURE_2D_ARRAY)return this.fallbackTexture2DArray;if(t===Lh.TEXTURE_3D)return this.fallbackTexture3D;if(t===Lh.TEXTURE_CUBE_MAP)return this.fallbackTextureCube;throw new Error("whoops")},e.prototype.createFallbackTexture=function(e,t){var n=e===Lh.TEXTURE_CUBE_MAP?6:1,r=t===wh.Float?kh.U8_RGBA_NORM:kh.D24;return this.createTexture({dimension:e,format:r,usage:Oh.SAMPLED,width:1,height:1,depthOrArrayLayers:n,mipLevelCount:1})},e.prototype.createBindings=function(e){return new xp({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createInputLayout=function(e){return new Lp({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createComputePipeline=function(e){return new Cp({id:this.getNextUniqueId(),device:this,descriptor:e})},e.prototype.createRenderPipeline=function(e){return new Pp({id:this.getNextUniqueId(),device:this,descriptor:(0,hh.Cl)({},e)})},e.prototype.createQueryPool=function(e,t){return new Mp({id:this.getNextUniqueId(),device:this,descriptor:{type:e,elemCount:t}})},e.prototype.createRenderPipelineInternal=function(e,t){var n;if(null===e.gpuRenderPipeline){var r=e.descriptor,i=r.program,o=i.vertexStage,a=i.fragmentStage;if(null!==o&&null!==a){var s=r.megaStateDescriptor||{},l=s.stencilBack,c=s.stencilFront,u=(0,hh.Tt)(s,["stencilBack","stencilFront"]),h=ld(ud);r.megaStateDescriptor=(0,hh.Cl)((0,hh.Cl)((0,hh.Cl)({},h),{stencilBack:(0,hh.Cl)((0,hh.Cl)({},h.stencilBack),l),stencilFront:(0,hh.Cl)((0,hh.Cl)({},h.stencilFront),c)}),u);var d=r.megaStateDescriptor.attachmentsState[0];r.colorAttachmentFormats.forEach((function(e,t){r.megaStateDescriptor.attachmentsState[t]||(r.megaStateDescriptor.attachmentsState[t]=ad(void 0,d))}));var f,p,g=(f=null!==(n=r.topology)&&void 0!==n?n:Th.TRIANGLES,p=r.megaStateDescriptor,{topology:lp(f),cullMode:cp(p.cullMode),frontFace:up(p.frontFace)}),m=function(e,t){return t.attachmentsState.map((function(t,n){return function(e,t){return{format:tp(t),blend:gp(e),writeMask:e.channelWriteMask}}(t,e[n])}))}(r.colorAttachmentFormats,r.megaStateDescriptor),_=function(e,t){if(!lh(e))return{format:tp(e),depthWriteEnabled:!!t.depthWrite,depthCompare:mp(t.depthCompare),depthBias:t.polygonOffset?t.polygonOffsetUnits:0,depthBiasSlopeScale:t.polygonOffset?t.polygonOffsetFactor:0,stencilFront:{compare:mp(t.stencilFront.compare),passOp:_p(t.stencilFront.passOp),failOp:_p(t.stencilFront.failOp),depthFailOp:_p(t.stencilFront.depthFailOp)},stencilBack:{compare:mp(t.stencilBack.compare),passOp:_p(t.stencilBack.passOp),failOp:_p(t.stencilBack.failOp),depthFailOp:_p(t.stencilBack.depthFailOp)},stencilReadMask:4294967295,stencilWriteMask:4294967295}}(r.depthStencilAttachmentFormat,r.megaStateDescriptor),v=void 0;null!==r.inputLayout&&(v=r.inputLayout.buffers);var y=r.sampleCount,E={layout:"auto",vertex:(0,hh.Cl)((0,hh.Cl)({},o),{buffers:v}),primitive:g,depthStencil:_,multisample:{count:y},fragment:(0,hh.Cl)((0,hh.Cl)({},a),{targets:m})};e.gpuRenderPipeline=this.device.createRenderPipeline(E)}}},e.prototype.createReadback=function(){return new Ip({id:this.getNextUniqueId(),device:this})},e.prototype.createRenderBundle=function(){return new Bp({id:this.getNextUniqueId(),device:this})},e.prototype.createRenderPass=function(e){var t=this.renderPassPool.pop();void 0===t&&(t=new wp(this));var n=this.frameCommandEncoderPool.pop();return void 0===n&&(n=this.device.createCommandEncoder()),t.beginRenderPass(n,e),t},e.prototype.createComputePass=function(){var e=this.computePassPool.pop();void 0===e&&(e=new Rp);var t=this.frameCommandEncoderPool.pop();return void 0===t&&(t=this.device.createCommandEncoder()),e.beginComputePass(t),e},e.prototype.submitPass=function(e){var t=e;t instanceof wp?(this.frameCommandEncoderPool.push(t.frameCommandEncoder),t.finish(),this.renderPassPool.push(t)):t instanceof Rp&&(this.frameCommandEncoderPool.push(t.frameCommandEncoder),t.finish(),this.computePassPool.push(t))},e.prototype.copySubTexture2D=function(e,t,n,r,i,o,a){var s=this.device.createCommandEncoder(),l=e,c=r,u={texture:c.gpuTexture,origin:[i,o,0],mipLevel:0,aspect:"all"},h={texture:l.gpuTexture,origin:[t,n,0],mipLevel:0,aspect:"all"};Zh(!!(c.usage&Jf.COPY_SRC)),Zh(!!(l.usage&Jf.COPY_DST)),s.copyTextureToTexture(u,h,[c.width,c.height,a||1]),this.device.queue.submit([s.finish()])},e.prototype.queryLimits=function(){return{uniformBufferMaxPageWordSize:this.device.limits.maxUniformBufferBindingSize>>>2,uniformBufferWordAlignment:this.device.limits.minUniformBufferOffsetAlignment>>>2,supportedSampleCounts:[1],occlusionQueriesRecommended:!0,computeShadersSupported:!0}},e.prototype.queryTextureFormatSupported=function(e,t,n){if(function(e){switch(jh(e)){case Bh.BC1:case Bh.BC2:case Bh.BC3:case Bh.BC4_SNORM:case Bh.BC4_UNORM:case Bh.BC5_SNORM:case Bh.BC5_UNORM:return!0;default:return!1}}(e)){if(!this.featureTextureCompressionBC)return!1;var r=function(e){switch(jh(e)){case Bh.BC1:case Bh.BC2:case Bh.BC3:case Bh.BC4_SNORM:case Bh.BC4_UNORM:case Bh.BC5_SNORM:case Bh.BC5_UNORM:return 4;default:return 1}}(e);return t%r==0&&n%r==0&&this.featureTextureCompressionBC}switch(e){case kh.U16_RGBA_NORM:case kh.F32_RGBA:return!1}return!0},e.prototype.queryPlatformAvailable=function(){return!0},e.prototype.queryVendorInfo=function(){return this},e.prototype.queryRenderPass=function(e){return e.descriptor},e.prototype.queryRenderTarget=function(e){return e},e.prototype.setResourceName=function(e,t){if(e.name=t,e.type===ph.Buffer)(n=e).gpuBuffer.label=t;else if(e.type===ph.Texture)(n=e).gpuTexture.label=t,n.gpuTextureView.label=t;else if(e.type===ph.RenderTarget)(n=e).gpuTexture.label=t,n.gpuTextureView.label=t;else if(e.type===ph.Sampler)(n=e).gpuSampler.label=t;else if(e.type===ph.RenderPipeline){var n;null!==(n=e).gpuRenderPipeline&&(n.gpuRenderPipeline.label=t)}},e.prototype.setResourceLeakCheck=function(e,t){},e.prototype.checkForLeaks=function(){},e.prototype.programPatched=function(e){},e.prototype.pipelineQueryReady=function(e){return null!==e.gpuRenderPipeline},e.prototype.pipelineForceReady=function(e){var t=e;this.createRenderPipelineInternal(t,!1)},e}(),Up=function(){function e(e){this.pluginOptions=e}return e.prototype.createSwapChain=function(e){return(0,hh.sH)(this,void 0,void 0,(function(){var t,n,r,i,o,a,s;return(0,hh.YH)(this,(function(l){switch(l.label){case 0:if(void 0===globalThis.navigator.gpu)return[2,null];t=null,l.label=1;case 1:return l.trys.push([1,3,,4]),n=this.pluginOptions.xrCompatible,[4,globalThis.navigator.gpu.requestAdapter({xrCompatible:n})];case 2:return t=l.sent(),[3,4];case 3:return r=l.sent(),console.log(r),[3,4];case 4:return null===t?[2,null]:(i=["depth32float-stencil8","texture-compression-bc","float32-filterable"].filter((function(e){return t.features.has(e)})),[4,t.requestDevice({requiredFeatures:i})]);case 5:if((o=l.sent())&&(a=this.pluginOptions.onContextLost,o.lost.then((function(){a&&a()}))),null===o)return[2,null];if(!(s=e.getContext("webgpu")))return[2,null];l.label=6;case 6:return l.trys.push([6,8,,9]),[4,$f(this.pluginOptions.shaderCompilerPath)];case 7:case 8:return l.sent(),[3,9];case 9:return[2,new Fp(t,o,e,s,qf,Kf&&new Kf)]}}))}))},e}(),kp=Object.defineProperty,Gp=Object.defineProperties,zp=Object.getOwnPropertyDescriptors,jp=Object.getOwnPropertySymbols,Vp=Object.prototype.hasOwnProperty,Hp=Object.prototype.propertyIsEnumerable,Wp=(e,t,n)=>t in e?kp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xp=(e,t)=>{for(var n in t||(t={}))Vp.call(t,n)&&Wp(e,n,t[n]);if(jp)for(var n of jp(t))Hp.call(t,n)&&Wp(e,n,t[n]);return e},{isPlainObject:Zp,isTypedArray:Yp}=y.uG,qp=class{constructor(e,t){this.destroyed=!1,this.uniforms={},this.reGl=e;const{vs:n,fs:r,attributes:i,uniforms:o,primitive:a,count:s,elements:l,depth:c,cull:u,instances:h}=t,d={platformString:"WebGL1",glslVersion:"#version 100",explicitBindingLocations:!1,separateSamplerTextures:!1,viewportOrigin:Ph.LOWER_LEFT,clipSpaceNearZ:Nh.NEGATIVE_ONE,supportMRT:!1},f={};this.options=t,o&&(this.uniforms=this.extractUniforms(o),Object.keys(o).forEach((t=>{f[t]=e.prop(t)})));const p={};Object.keys(i).forEach((e=>{p[e]=i[e].get()}));const g=(0,Ot.vA)(Jd(d,"frag",r,null,!1)),m=(0,Ot.vA)(Jd(d,"vert",n,null,!1)),_={attributes:p,frag:g,uniforms:f,vert:m,colorMask:e.prop("colorMask"),lineWidth:1,blend:{enable:e.prop("blend.enable"),func:e.prop("blend.func"),equation:e.prop("blend.equation"),color:e.prop("blend.color")},stencil:{enable:e.prop("stencil.enable"),mask:e.prop("stencil.mask"),func:e.prop("stencil.func"),opFront:e.prop("stencil.opFront"),opBack:e.prop("stencil.opBack")},primitive:Wu[void 0===a?Ot.gl.TRIANGLES:a]};h&&(_.instances=h),s?_.count=s:l&&(_.elements=l.get()),this.initDepthDrawParams({depth:c},_),this.initCullDrawParams({cull:u},_),this.drawCommand=e(_),this.drawParams=_}updateAttributesAndElements(e,t){const n={};Object.keys(e).forEach((t=>{n[t]=e[t].get()})),this.drawParams.attributes=n,this.drawParams.elements=t.get(),this.drawCommand=this.reGl(this.drawParams)}updateAttributes(e){const t={};Object.keys(e).forEach((n=>{t[n]=e[n].get()})),this.drawParams.attributes=t,this.drawCommand=this.reGl(this.drawParams)}addUniforms(e){this.uniforms=Xp(Xp({},this.uniforms),this.extractUniforms(e))}draw(e,t){if(this.drawParams.attributes&&0===Object.keys(this.drawParams.attributes).length)return;const n=Xp(Xp({},this.uniforms),this.extractUniforms(e.uniforms||{})),r={};Object.keys(n).forEach((e=>{const t=typeof n[e];"boolean"===t||"number"===t||Array.isArray(n[e])||n[e].BYTES_PER_ELEMENT?r[e]=n[e]:r[e]=n[e].get()})),r.blend=t?this.getBlendDrawParams({blend:{enable:!1}}):this.getBlendDrawParams(e),r.stencil=this.getStencilDrawParams(e),r.colorMask=this.getColorMaskDrawParams(e,t),this.drawCommand(r)}destroy(){var e,t;null==(t=null==(e=this.drawParams)?void 0:e.elements)||t.destroy(),this.options.attributes&&Object.values(this.options.attributes).forEach((e=>{null==e||e.destroy()})),this.destroyed=!0}initDepthDrawParams({depth:e},t){e&&(t.depth={enable:void 0===e.enable||!!e.enable,mask:void 0===e.mask||!!e.mask,func:Ju[e.func||Ot.gl.LESS],range:e.range||[0,1]})}getBlendDrawParams({blend:e}){const{enable:t,func:n,equation:r,color:i=[0,0,0,0]}=e||{};return{enable:!!t,func:{srcRGB:th[n&&n.srcRGB||Ot.gl.SRC_ALPHA],srcAlpha:th[n&&n.srcAlpha||Ot.gl.SRC_ALPHA],dstRGB:th[n&&n.dstRGB||Ot.gl.ONE_MINUS_SRC_ALPHA],dstAlpha:th[n&&n.dstAlpha||Ot.gl.ONE_MINUS_SRC_ALPHA]},equation:{rgb:eh[r&&r.rgb||Ot.gl.FUNC_ADD],alpha:eh[r&&r.alpha||Ot.gl.FUNC_ADD]},color:i}}getStencilDrawParams({stencil:e}){const{enable:t,mask:n=-1,func:r={cmp:Ot.gl.ALWAYS,ref:0,mask:-1},opFront:i={fail:Ot.gl.KEEP,zfail:Ot.gl.KEEP,zpass:Ot.gl.KEEP},opBack:o={fail:Ot.gl.KEEP,zfail:Ot.gl.KEEP,zpass:Ot.gl.KEEP}}=e||{};return{enable:!!t,mask:n,func:(a=Xp({},r),s={cmp:nh[r.cmp]},Gp(a,zp(s))),opFront:{fail:rh[i.fail],zfail:rh[i.zfail],zpass:rh[i.zpass]},opBack:{fail:rh[o.fail],zfail:rh[o.zfail],zpass:rh[o.zpass]}};var a,s}getColorMaskDrawParams({stencil:e},t){return(null==e?void 0:e.enable)&&e.opFront&&!t?[!1,!1,!1,!1]:[!0,!0,!0,!0]}initCullDrawParams({cull:e},t){if(e){const{enable:n,face:r=Ot.gl.BACK}=e;t.cull={enable:!!n,face:ih[r]}}}extractUniforms(e){const t={};return Object.keys(e).forEach((n=>{this.extractUniformsRecursively(n,e[n],t,"")})),t}extractUniformsRecursively(e,t,n,r){null===t||"number"==typeof t||"boolean"==typeof t||Array.isArray(t)&&"number"==typeof t[0]||Yp(t)||""===t||"resize"in t?n[`${r&&r+"."}${e}`]=t:(Zp(t)&&Object.keys(t).forEach((i=>{this.extractUniformsRecursively(i,t[i],n,`${r&&r+"."}${e}`)})),Array.isArray(t)&&t.forEach(((t,i)=>{Object.keys(t).forEach((o=>{this.extractUniformsRecursively(o,t[o],n,`${r&&r+"."}${e}[${i}]`)}))})))}},Kp=class{constructor(e,t){this.isDestroy=!1;const{data:n,type:r=Ot.gl.UNSIGNED_BYTE,width:i,height:o,flipY:a=!1,format:s=Ot.gl.RGBA,mipmap:l=!1,wrapS:c=Ot.gl.CLAMP_TO_EDGE,wrapT:u=Ot.gl.CLAMP_TO_EDGE,aniso:h=0,alignment:d=1,premultiplyAlpha:f=!1,mag:p=Ot.gl.NEAREST,min:g=Ot.gl.NEAREST,colorSpace:m=Ot.gl.BROWSER_DEFAULT_WEBGL,x:_=0,y:v=0,copy:y=!1}=t;this.width=i,this.height=o;const E={width:i,height:o,type:Zu[r],format:Yu[s],wrapS:Qu[c],wrapT:Qu[u],mag:Ku[p],min:Ku[g],alignment:d,flipY:a,colorSpace:$u[m],premultiplyAlpha:f,aniso:h,x:_,y:v,copy:y};n&&(E.data=n),"number"==typeof l?E.mipmap=qu[l]:"boolean"==typeof l&&(E.mipmap=l),this.texture=e.texture(E)}get(){return this.texture}update(e={}){this.texture(e)}bind(){this.texture._texture.bind()}resize({width:e,height:t}){this.texture.resize(e,t),this.width=e,this.height=t}getSize(){return[this.width,this.height]}destroy(){var e;this.isDestroy||null==(e=this.texture)||e.destroy(),this.isDestroy=!0}},Qp=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{s(n.next(e))}catch(e){i(e)}},a=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,a);s((n=n.apply(e,t)).next())})),$p=class{constructor(){this.uniformBuffers=[],this.queryVerdorInfo=()=>"WebGL1",this.createModel=e=>new qp(this.gl,e),this.createAttribute=e=>new Hu(this.gl,e),this.createBuffer=e=>new oh(this.gl,e),this.createElements=e=>new ah(this.gl,e),this.createTexture2D=e=>new Kp(this.gl,e),this.createFramebuffer=e=>new sh(this.gl,e),this.useFramebuffer=(e,t)=>{this.gl({framebuffer:e?e.get():null})(t)},this.useFramebufferAsync=(e,t)=>Qp(this,null,(function*(){this.gl({framebuffer:e?e.get():null})(t)})),this.clear=e=>{var t;const{color:n,depth:r,stencil:i,framebuffer:o=null}=e,a={color:n,depth:r,stencil:i};a.framebuffer=null===o?o:o.get(),null==(t=this.gl)||t.clear(a)},this.viewport=({x:e,y:t,width:n,height:r})=>{this.gl._gl.viewport(e,t,n,r),this.width=n,this.height=r,this.gl._refresh()},this.readPixels=e=>{const{framebuffer:t,x:n,y:r,width:i,height:o}=e,a={x:n,y:r,width:i,height:o};return t&&(a.framebuffer=t.get()),this.gl.read(a)},this.readPixelsAsync=e=>Qp(this,null,(function*(){return this.readPixels(e)})),this.getViewportSize=()=>({width:this.gl._gl.drawingBufferWidth,height:this.gl._gl.drawingBufferHeight}),this.getContainer=()=>{var e;return null==(e=this.canvas)?void 0:e.parentElement},this.getCanvas=()=>this.canvas,this.getGLContext=()=>this.gl._gl,this.destroy=()=>{var e,t,n;this.canvas=null,null==(n=null==(t=null==(e=this.gl)?void 0:e._gl)?void 0:t.getExtension("WEBGL_lose_context"))||n.loseContext(),this.gl.destroy(),this.gl=null}}init(e,t,n){return Qp(this,null,(function*(){this.canvas=e,this.gl=n||(yield new Promise(((e,n)=>{Vu()({canvas:this.canvas,attributes:{alpha:!0,antialias:t.antialias,premultipliedAlpha:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,stencil:t.stencil},extensions:["OES_element_index_uint","OES_standard_derivatives","ANGLE_instanced_arrays"],optionalExtensions:["oes_texture_float_linear","OES_texture_float","EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture","WEBGL_lose_context"],profile:!0,onDone:(t,r)=>{!t&&r||n(t),e(r)}})}))),this.extensionObject={OES_texture_float:this.testExtension("OES_texture_float")}}))}getPointSizeRange(){return this.gl._gl.getParameter(this.gl._gl.ALIASED_POINT_SIZE_RANGE)}testExtension(e){return!!this.getGLContext().getExtension(e)}setState(){this.gl({cull:{enable:!1,face:"back"},viewport:{x:0,y:0,height:this.width,width:this.height},blend:{enable:!0,equation:"add"},framebuffer:null}),this.gl._refresh()}setBaseState(){this.gl({cull:{enable:!1,face:"back"},viewport:{x:0,y:0,height:this.width,width:this.height},blend:{enable:!1,equation:"add"},framebuffer:null}),this.gl._refresh()}setCustomLayerDefaults(){const e=this.getGLContext();e.disable(e.CULL_FACE)}setDirty(e){this.isDirty=e}getDirty(){return this.isDirty}beginFrame(){}endFrame(){}},Jp=class{constructor(e,t){const{buffer:n,offset:r,stride:i,normalized:o,size:a,divisor:s,shaderLocation:l}=t;this.buffer=n,this.attribute={shaderLocation:l,buffer:n.get(),offset:r||0,stride:i||0,normalized:o||!1,divisor:s||0},a&&(this.attribute.size=a)}get(){return this.buffer}updateBuffer(e){this.buffer.subData(e)}destroy(){this.buffer.destroy()}},eg={[Ot.gl.FLOAT]:Float32Array,[Ot.gl.UNSIGNED_BYTE]:Uint8Array,[Ot.gl.SHORT]:Int16Array,[Ot.gl.UNSIGNED_SHORT]:Uint16Array,[Ot.gl.INT]:Int32Array,[Ot.gl.UNSIGNED_INT]:Uint32Array},tg={[Ot.gl.POINTS]:Th.POINTS,[Ot.gl.LINES]:Th.LINES,[Ot.gl.LINE_LOOP]:Th.LINES,[Ot.gl.LINE_STRIP]:Th.LINE_STRIP,[Ot.gl.TRIANGLES]:Th.TRIANGLES,[Ot.gl.TRIANGLE_FAN]:Th.TRIANGLES,[Ot.gl.TRIANGLE_STRIP]:Th.TRIANGLE_STRIP},ng={1:kh.F32_R,2:kh.F32_RG,3:kh.F32_RGB,4:kh.F32_RGBA},rg={[Ot.gl.STATIC_DRAW]:Sh.STATIC,[Ot.gl.DYNAMIC_DRAW]:Sh.DYNAMIC,[Ot.gl.STREAM_DRAW]:Sh.DYNAMIC},ig={[Ot.gl.REPEAT]:Eh.REPEAT,[Ot.gl.CLAMP_TO_EDGE]:Eh.CLAMP_TO_EDGE,[Ot.gl.MIRRORED_REPEAT]:Eh.MIRRORED_REPEAT},og={[Ot.gl.NEVER]:gh.NEVER,[Ot.gl.ALWAYS]:gh.ALWAYS,[Ot.gl.LESS]:gh.LESS,[Ot.gl.LEQUAL]:gh.LEQUAL,[Ot.gl.GREATER]:gh.GREATER,[Ot.gl.GEQUAL]:gh.GEQUAL,[Ot.gl.EQUAL]:gh.EQUAL,[Ot.gl.NOTEQUAL]:gh.NOTEQUAL},ag={[Ot.gl.FRONT]:_h.FRONT,[Ot.gl.BACK]:_h.BACK},sg={[Ot.gl.FUNC_ADD]:yh.ADD,[Ot.gl.MIN_EXT]:yh.MIN,[Ot.gl.MAX_EXT]:yh.MAX,[Ot.gl.FUNC_SUBTRACT]:yh.SUBSTRACT,[Ot.gl.FUNC_REVERSE_SUBTRACT]:yh.REVERSE_SUBSTRACT},lg={[Ot.gl.ZERO]:vh.ZERO,[Ot.gl.ONE]:vh.ONE,[Ot.gl.SRC_COLOR]:vh.SRC,[Ot.gl.ONE_MINUS_SRC_COLOR]:vh.ONE_MINUS_SRC,[Ot.gl.SRC_ALPHA]:vh.SRC_ALPHA,[Ot.gl.ONE_MINUS_SRC_ALPHA]:vh.ONE_MINUS_SRC_ALPHA,[Ot.gl.DST_COLOR]:vh.DST,[Ot.gl.ONE_MINUS_DST_COLOR]:vh.ONE_MINUS_DST,[Ot.gl.DST_ALPHA]:vh.DST_ALPHA,[Ot.gl.ONE_MINUS_DST_ALPHA]:vh.ONE_MINUS_DST_ALPHA,[Ot.gl.CONSTANT_COLOR]:vh.CONST,[Ot.gl.ONE_MINUS_CONSTANT_COLOR]:vh.ONE_MINUS_CONSTANT,[Ot.gl.CONSTANT_ALPHA]:vh.CONST,[Ot.gl.ONE_MINUS_CONSTANT_ALPHA]:vh.ONE_MINUS_CONSTANT,[Ot.gl.SRC_ALPHA_SATURATE]:vh.SRC_ALPHA_SATURATE},cg={[Ot.gl.REPLACE]:Ih.REPLACE,[Ot.gl.KEEP]:Ih.KEEP,[Ot.gl.ZERO]:Ih.ZERO,[Ot.gl.INVERT]:Ih.INVERT,[Ot.gl.INCR]:Ih.INCREMENT_CLAMP,[Ot.gl.DECR]:Ih.DECREMENT_CLAMP,[Ot.gl.INCR_WRAP]:Ih.INCREMENT_WRAP,[Ot.gl.DECR_WRAP]:Ih.DECREMENT_WRAP},ug={[Ot.gl.ALWAYS]:gh.ALWAYS,[Ot.gl.EQUAL]:gh.EQUAL,[Ot.gl.GEQUAL]:gh.GEQUAL,[Ot.gl.GREATER]:gh.GREATER,[Ot.gl.LEQUAL]:gh.LEQUAL,[Ot.gl.LESS]:gh.LESS,[Ot.gl.NEVER]:gh.NEVER,[Ot.gl.NOTEQUAL]:gh.NOTEQUAL},hg={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121};function dg(e){return Object.prototype.toString.call(e)in hg}var fg=class{constructor(e,t){this.isDestroyed=!1;const{data:n,usage:r,type:i,isUBO:o,label:a}=t;let s;s=dg(n)?n:new eg[this.type||Ot.gl.FLOAT](n),this.type=i,this.size=s.byteLength,this.buffer=e.createBuffer({viewOrSize:s,usage:o?xh.UNIFORM:xh.VERTEX,hint:rg[r||Ot.gl.STATIC_DRAW]}),a&&e.setResourceName(this.buffer,a)}get(){return this.buffer}destroy(){this.isDestroyed||this.buffer.destroy(),this.isDestroyed=!0}subData({data:e,offset:t}){let n;n=dg(e)?e:new eg[this.type||Ot.gl.FLOAT](e),this.buffer.setSubData(t,new Uint8Array(n.buffer))}};function pg(e,t=0){return e+=t,e+=e<<10,(e+=e>>>6)>>>0}function gg(e){return e+=e<<3,e^=e>>>11,(e+=e<<15)>>>0}function mg(){return 0}var _g=class{constructor(){this.keys=[],this.values=[]}},vg=class{constructor(e,t){this.keyEqualFunc=e,this.keyHashFunc=t,this.buckets=new Map}findBucketIndex(e,t){for(let n=0;n<e.keys.length;n++)if(this.keyEqualFunc(t,e.keys[n]))return n;return-1}findBucket(e){const t=this.keyHashFunc(e);return this.buckets.get(t)}get(e){const t=this.findBucket(e);if(void 0===t)return null;const n=this.findBucketIndex(t,e);return n<0?null:t.values[n]}add(e,t){const n=this.keyHashFunc(e);void 0===this.buckets.get(n)&&this.buckets.set(n,new _g);const r=this.buckets.get(n);r.keys.push(e),r.values.push(t)}delete(e){const t=this.findBucket(e);if(void 0===t)return;const n=this.findBucketIndex(t,e);-1!==n&&(t.keys.splice(n,1),t.values.splice(n,1))}clear(){this.buckets.clear()}size(){let e=0;for(const t of this.buckets.values())e+=t.values.length;return e}*values(){for(const e of this.buckets.values())for(let t=e.values.length-1;t>=0;t--)yield e.values[t]}};function yg(e,t){return e=pg(e,t.blendMode),e=pg(e,t.blendSrcFactor),pg(e,t.blendDstFactor)}function Eg(e,t){return e=yg(e,t.rgbBlendState),pg(e=yg(e,t.alphaBlendState),t.channelWriteMask)}function Ag(e){let t=0;t=pg(t,e.program.id),null!==e.inputLayout&&(t=pg(t,e.inputLayout.id)),t=function(e,t){var n,r,i,o,a,s,l,c;for(let n=0;n<t.attachmentsState.length;n++)e=Eg(e,t.attachmentsState[n]);return e=function(e,t){return pg(e,t.r<<24|t.g<<16|t.b<<8|t.a)}(e,t.blendConstant||Jh),e=pg(e,t.depthCompare),e=pg(e,t.depthWrite?1:0),e=pg(e,null==(n=t.stencilFront)?void 0:n.compare),e=pg(e,null==(r=t.stencilFront)?void 0:r.passOp),e=pg(e,null==(i=t.stencilFront)?void 0:i.failOp),e=pg(e,null==(o=t.stencilFront)?void 0:o.depthFailOp),e=pg(e,null==(a=t.stencilBack)?void 0:a.compare),e=pg(e,null==(s=t.stencilBack)?void 0:s.passOp),e=pg(e,null==(l=t.stencilBack)?void 0:l.failOp),e=pg(e,null==(c=t.stencilBack)?void 0:c.depthFailOp),e=pg(e,t.stencilWrite?1:0),e=pg(e,t.cullMode),e=pg(e,t.frontFace?1:0),pg(e,t.polygonOffset?1:0)}(t,e.megaStateDescriptor);for(let n=0;n<e.colorAttachmentFormats.length;n++)t=pg(t,e.colorAttachmentFormats[n]||0);return t=pg(t,e.depthStencilAttachmentFormat||0),gg(t)}function bg(e){let t=0;if(e.samplerBindings)for(let n=0;n<e.samplerBindings.length;n++){const r=e.samplerBindings[n];null!==r&&null!==r.texture&&(t=pg(t,r.texture.id))}if(e.uniformBufferBindings)for(let n=0;n<e.uniformBufferBindings.length;n++){const r=e.uniformBufferBindings[n];null!==r&&null!==r.buffer&&(t=pg(t,r.buffer.id),t=pg(t,r.binding),t=pg(t,r.offset),t=pg(t,r.size))}if(e.storageBufferBindings)for(let n=0;n<e.storageBufferBindings.length;n++){const r=e.storageBufferBindings[n];null!==r&&null!==r.buffer&&(t=pg(t,r.buffer.id),t=pg(t,r.binding),t=pg(t,r.offset),t=pg(t,r.size))}if(e.storageTextureBindings)for(let n=0;n<e.storageTextureBindings.length;n++){const r=e.storageTextureBindings[n];null!==r&&null!==r.texture&&(t=pg(t,r.texture.id),t=pg(t,r.binding))}return gg(t)}function Tg(e,t){var n,r,i,o;return(null==(n=e.vertex)?void 0:n.glsl)===(null==(r=t.vertex)?void 0:r.glsl)&&(null==(i=e.fragment)?void 0:i.glsl)===(null==(o=t.fragment)?void 0:o.glsl)}var xg=class{constructor(e){this.device=e,this.bindingsCache=new vg(vd,bg),this.renderPipelinesCache=new vg(xd,Ag),this.inputLayoutsCache=new vg(Cd,mg),this.programCache=new vg(Tg,mg)}createBindings(e){var t;let n=this.bindingsCache.get(e);if(null===n){const i={samplerBindings:(r=e).samplerBindings&&pd(r.samplerBindings,Ld),uniformBufferBindings:r.uniformBufferBindings&&pd(r.uniformBufferBindings,Od),storageBufferBindings:r.storageBufferBindings&&pd(r.storageBufferBindings,Od),storageTextureBindings:r.storageTextureBindings&&pd(r.storageTextureBindings,Md),pipeline:r.pipeline};i.uniformBufferBindings=null==(t=i.uniformBufferBindings)?void 0:t.filter((({size:e})=>e&&e>0)),n=this.device.createBindings(i),this.bindingsCache.add(i,n)}var r;return n}createRenderPipeline(e){let t=this.renderPipelinesCache.get(e);if(null===t){const a=(r=(n=e).inputLayout,i=n.program,o=n.topology,{inputLayout:r,megaStateDescriptor:n.megaStateDescriptor&&ld(n.megaStateDescriptor),program:i,topology:o,colorAttachmentFormats:n.colorAttachmentFormats.slice(),depthStencilAttachmentFormat:n.depthStencilAttachmentFormat,sampleCount:n.sampleCount});a.colorAttachmentFormats=a.colorAttachmentFormats.filter((e=>e)),t=this.device.createRenderPipeline(a),this.renderPipelinesCache.add(a,t)}var n,r,i,o;return t}createInputLayout(e){e.vertexBufferDescriptors=e.vertexBufferDescriptors.filter((e=>!!e));let t=this.inputLayoutsCache.get(e);if(null===t){const r={vertexBufferDescriptors:pd((n=e).vertexBufferDescriptors,wd),indexBufferFormat:n.indexBufferFormat,program:n.program};t=this.device.createInputLayout(r),this.inputLayoutsCache.add(r,t)}var n;return t}createProgram(e){let t=this.programCache.get(e);if(null===t){const n=function(e){var t,n;return{vertex:{glsl:null==(t=e.vertex)?void 0:t.glsl},fragment:{glsl:null==(n=e.fragment)?void 0:n.glsl}}}(e);t=this.device.createProgram(e),this.programCache.add(n,t)}return t}destroy(){for(const e of this.bindingsCache.values())e.destroy();for(const e of this.renderPipelinesCache.values())e.destroy();for(const e of this.inputLayoutsCache.values())e.destroy();for(const e of this.programCache.values())e.destroy();this.bindingsCache.clear(),this.renderPipelinesCache.clear(),this.inputLayoutsCache.clear(),this.programCache.clear()}},Sg=class{constructor(e,t){const{data:n,type:r,count:i=0}=t;let o;o=dg(n)?n:new eg[this.type||Ot.gl.UNSIGNED_INT](n),this.type=r,this.count=i,this.indexBuffer=e.createBuffer({viewOrSize:o,usage:xh.INDEX})}get(){return this.indexBuffer}subData({data:e}){let t;t=dg(e)?e:new eg[this.type||Ot.gl.UNSIGNED_INT](e),this.indexBuffer.setSubData(0,new Uint8Array(t.buffer))}destroy(){this.indexBuffer.destroy()}};function Rg(e){return!(!e||!e.texture)}var Cg=class{constructor(e,t){this.device=e,this.options=t,this.isDestroy=!1;const{wrapS:n=Ot.gl.CLAMP_TO_EDGE,wrapT:r=Ot.gl.CLAMP_TO_EDGE,aniso:i,mag:o=Ot.gl.NEAREST,min:a=Ot.gl.NEAREST}=t;this.createTexture(t),this.sampler=e.createSampler({addressModeU:ig[n],addressModeV:ig[r],minFilter:a===Ot.gl.NEAREST?Ah.POINT:Ah.BILINEAR,magFilter:o===Ot.gl.NEAREST?Ah.POINT:Ah.BILINEAR,mipmapFilter:bh.NO_MIP,maxAnisotropy:i})}createTexture(e){const{type:t=Ot.gl.UNSIGNED_BYTE,width:n,height:r,flipY:i=!1,format:o=Ot.gl.RGBA,alignment:a=1,usage:s=Ot.tT.SAMPLED,unorm:l=!1,label:c}=e;let{data:u}=e;this.width=n,this.height=r;let h=kh.U8_RGBA_RT;if(t===Ot.gl.UNSIGNED_BYTE&&o===Ot.gl.RGBA)h=l?kh.U8_RGBA_NORM:kh.U8_RGBA_RT;else if(t===Ot.gl.UNSIGNED_BYTE&&o===Ot.gl.LUMINANCE)h=kh.U8_LUMINANCE;else if(t===Ot.gl.FLOAT&&o===Ot.gl.LUMINANCE)h=kh.F32_LUMINANCE;else if(t===Ot.gl.FLOAT&&o===Ot.gl.RGB)"WebGPU"===this.device.queryVendorInfo().platformString?(u&&(u=function(e){const t=e.length,n=t+Math.ceil(t/3),r=new Float32Array(n);for(let t=0;t<n;t+=4)r[t]=e[t/4*3],r[t+1]=e[t/4*3+1],r[t+2]=e[t/4*3+2],r[t+3]=0;return r}(u)),h=kh.F32_RGBA):h=kh.F32_RGB;else if(t===Ot.gl.FLOAT&&o===Ot.gl.RGBA)h=kh.F32_RGBA;else{if(t!==Ot.gl.FLOAT||o!==Ot.gl.RED)throw new Error(`create texture error, type: ${t}, format: ${o}`);h=kh.F32_R}this.texture=this.device.createTexture({format:h,width:n,height:r,usage:s===Ot.tT.SAMPLED?Oh.SAMPLED:Oh.RENDER_TARGET,pixelStore:{unpackFlipY:i,packAlignment:a},mipLevelCount:1}),c&&this.device.setResourceName(this.texture,c),u&&this.texture.setImageData([u])}get(){return this.texture}update(e){const{data:t}=e;this.texture.setImageData([t])}bind(){}resize({width:e,height:t}){this.width===e&&this.height===t||this.destroy(),this.options.width=e,this.options.height=t,this.createTexture(this.options),this.isDestroy=!1}getSize(){return[this.width,this.height]}destroy(){var e;this.isDestroy||this.texture.destroyed||null==(e=this.texture)||e.destroy(),this.isDestroy=!0}},Lg=class{constructor(e,t){this.device=e,this.options=t,this.createColorRenderTarget(),this.createDepthRenderTarget()}createColorRenderTarget(e=!1){const{width:t,height:n,color:r}=this.options;r&&(Rg(r)?(e&&r.resize({width:t,height:n}),this.colorTexture=r.get(),this.colorRenderTarget=this.device.createRenderTargetFromTexture(this.colorTexture),this.width=r.width,this.height=r.height):t&&n&&(this.colorTexture=this.device.createTexture({format:kh.U8_RGBA_RT,usage:Oh.RENDER_TARGET,width:t,height:n}),this.colorRenderTarget=this.device.createRenderTargetFromTexture(this.colorTexture),this.width=t,this.height=n))}createDepthRenderTarget(e=!1){const{width:t,height:n,depth:r}=this.options;r&&(Rg(r)?(e&&r.resize({width:t,height:n}),this.depthTexture=r.get(),this.depthRenderTarget=this.device.createRenderTargetFromTexture(this.depthTexture),this.width=r.width,this.height=r.height):t&&n&&(this.depthTexture=this.device.createTexture({format:kh.D24_S8,usage:Oh.RENDER_TARGET,width:t,height:n}),this.depthRenderTarget=this.device.createRenderTargetFromTexture(this.depthTexture),this.width=t,this.height=n))}get(){return this.colorRenderTarget}destroy(){var e,t;null==(e=this.colorRenderTarget)||e.destroy(),null==(t=this.depthRenderTarget)||t.destroy()}resize({width:e,height:t}){this.width===e&&this.height===t||(this.destroy(),this.colorTexture.destroyed=!0,this.depthTexture.destroyed=!0,this.options.width=e,this.options.height=t,this.createColorRenderTarget(!0),this.createDepthRenderTarget(!0))}},Og=Object.defineProperty,Mg=Object.defineProperties,Ig=Object.getOwnPropertyDescriptors,wg=Object.getOwnPropertySymbols,Pg=Object.prototype.hasOwnProperty,Ng=Object.prototype.propertyIsEnumerable,Dg=(e,t,n)=>t in e?Og(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bg=(e,t)=>{for(var n in t||(t={}))Pg.call(t,n)&&Dg(e,n,t[n]);if(wg)for(var n of wg(t))Ng.call(t,n)&&Dg(e,n,t[n]);return e},{isPlainObject:Fg,isTypedArray:Ug,isNil:kg}=y.uG,Gg=class{constructor(e,t,n){this.device=e,this.options=t,this.service=n,this.destroyed=!1,this.uniforms={},this.vertexBuffers=[];const{vs:r,fs:i,attributes:o,uniforms:a,count:s,elements:l,diagnosticDerivativeUniformityEnabled:c}=t;this.options=t;const u=c?"":this.service.viewportOrigin===Ph.UPPER_LEFT?"diagnostic(off,derivative_uniformity);":"";this.program=n.renderCache.createProgram({vertex:{glsl:r},fragment:{glsl:i,postprocess:e=>u+e}}),a&&(this.uniforms=this.extractUniforms(a));const h=[];let d=0;Object.keys(o).forEach((e=>{const t=o[e],n=t.get();this.vertexBuffers.push(n.get());const{offset:r=0,stride:i=0,size:a=1,divisor:s=0,shaderLocation:l=0}=t.attribute;h.push({arrayStride:i||4*a,stepMode:Rh.VERTEX,attributes:[{format:ng[a],shaderLocation:l,offset:r,divisor:s}]}),d=n.size/a})),s||(this.options.count=d),l&&(this.indexBuffer=l.get());const f=n.renderCache.createInputLayout({vertexBufferDescriptors:h,indexBufferFormat:l?kh.U32_R:null,program:this.program});this.inputLayout=f,this.pipeline=this.createPipeline(t)}createPipeline(e,t){var n;const{primitive:r=Ot.gl.TRIANGLES,depth:i,cull:o,blend:a,stencil:s}=e,l=this.initDepthDrawParams({depth:i}),c=!(!l||!l.enable),u=this.initCullDrawParams({cull:o}),h=!(!u||!u.enable),d=this.getBlendDrawParams({blend:a}),f=!(!d||!d.enable),p=this.getStencilDrawParams({stencil:s}),g=!(!p||!p.enable),m=this.device.createRenderPipeline({inputLayout:this.inputLayout,program:this.program,topology:tg[r],colorAttachmentFormats:[kh.U8_RGBA_RT],depthStencilAttachmentFormat:kh.D24_S8,megaStateDescriptor:{attachmentsState:[t?{channelWriteMask:Mh.ALL,rgbBlendState:{blendMode:yh.ADD,blendSrcFactor:vh.ONE,blendDstFactor:vh.ZERO},alphaBlendState:{blendMode:yh.ADD,blendSrcFactor:vh.ONE,blendDstFactor:vh.ZERO}}:{channelWriteMask:g&&p.opFront.zpass===Ih.REPLACE?Mh.NONE:Mh.ALL,rgbBlendState:{blendMode:f&&d.equation.rgb||yh.ADD,blendSrcFactor:f&&d.func.srcRGB||vh.SRC_ALPHA,blendDstFactor:f&&d.func.dstRGB||vh.ONE_MINUS_SRC_ALPHA},alphaBlendState:{blendMode:f&&d.equation.alpha||yh.ADD,blendSrcFactor:f&&d.func.srcAlpha||vh.ONE,blendDstFactor:f&&d.func.dstAlpha||vh.ONE}}],blendConstant:f?Jh:void 0,depthWrite:c,depthCompare:c&&l.func||gh.LESS,cullMode:h&&u.face||_h.NONE,stencilWrite:g,stencilFront:{compare:g?p.func.cmp:gh.ALWAYS,passOp:p.opFront.zpass,failOp:p.opFront.fail,depthFailOp:p.opFront.zfail,mask:p.opFront.mask},stencilBack:{compare:g?p.func.cmp:gh.ALWAYS,passOp:p.opBack.zpass,failOp:p.opBack.fail,depthFailOp:p.opBack.zfail,mask:p.opBack.mask}}});return g&&!kg(null==(n=null==s?void 0:s.func)?void 0:n.ref)&&(m.stencilFuncReference=s.func.ref),m}updateAttributesAndElements(){}updateAttributes(){}addUniforms(e){this.uniforms=Bg(Bg({},this.uniforms),this.extractUniforms(e))}draw(e,t){const n=Bg(Bg({},this.options),e),{count:r=0,instances:i,elements:o,uniforms:a={},uniformBuffers:s,textures:l}=n;this.uniforms=Bg(Bg({},this.uniforms),this.extractUniforms(a));const{renderPass:c,currentFramebuffer:u,width:h,height:d}=this.service;this.pipeline=this.createPipeline(n,t);const f=this.service.device,p=f.swapChainHeight;if(f.swapChainHeight=(null==u?void 0:u.height)||d,c.setViewport(0,0,(null==u?void 0:u.width)||h,(null==u?void 0:u.height)||d),f.swapChainHeight=p,c.setPipeline(this.pipeline),kg(this.pipeline.stencilFuncReference)||c.setStencilReference(this.pipeline.stencilFuncReference),c.setVertexInput(this.inputLayout,this.vertexBuffers.map((e=>({buffer:e}))),o?{buffer:this.indexBuffer,offset:0}:null),s&&(this.bindings=f.createBindings({pipeline:this.pipeline,uniformBufferBindings:s.map(((e,t)=>{const n=e;return{binding:t,buffer:n.get(),size:n.size}})),samplerBindings:null==l?void 0:l.map((e=>({texture:e.texture,sampler:e.sampler})))})),this.bindings&&(c.setBindings(this.bindings),Object.keys(this.uniforms).forEach((e=>{const t=this.uniforms[e];t instanceof Cg?this.uniforms[e]=t.get():t instanceof Lg&&(this.uniforms[e]=t.get().texture)})),this.program.setUniformsLegacy(this.uniforms)),o){const e=o.count;0===e?c.draw(r,i):c.drawIndexed(e,i)}else c.draw(r,i)}destroy(){var e,t,n;null==(e=this.vertexBuffers)||e.forEach((e=>e.destroy())),null==(t=this.indexBuffer)||t.destroy(),null==(n=this.bindings)||n.destroy(),this.pipeline.destroy(),this.destroyed=!0}initDepthDrawParams({depth:e}){if(e)return{enable:void 0===e.enable||!!e.enable,mask:void 0===e.mask||!!e.mask,func:og[e.func||Ot.gl.LESS],range:e.range||[0,1]}}getBlendDrawParams({blend:e}){const{enable:t,func:n,equation:r,color:i=[0,0,0,0]}=e||{};return{enable:!!t,func:{srcRGB:lg[n&&n.srcRGB||Ot.gl.SRC_ALPHA],srcAlpha:lg[n&&n.srcAlpha||Ot.gl.SRC_ALPHA],dstRGB:lg[n&&n.dstRGB||Ot.gl.ONE_MINUS_SRC_ALPHA],dstAlpha:lg[n&&n.dstAlpha||Ot.gl.ONE_MINUS_SRC_ALPHA]},equation:{rgb:sg[r&&r.rgb||Ot.gl.FUNC_ADD],alpha:sg[r&&r.alpha||Ot.gl.FUNC_ADD]},color:i}}getStencilDrawParams({stencil:e}){const{enable:t,mask:n=4294967295,func:r={cmp:Ot.gl.ALWAYS,ref:0,mask:4294967295},opFront:i={fail:Ot.gl.KEEP,zfail:Ot.gl.KEEP,zpass:Ot.gl.KEEP},opBack:o={fail:Ot.gl.KEEP,zfail:Ot.gl.KEEP,zpass:Ot.gl.KEEP}}=e||{};return{enable:!!t,mask:n,func:(a=Bg({},r),s={cmp:ug[r.cmp]},Mg(a,Ig(s))),opFront:{fail:cg[i.fail],zfail:cg[i.zfail],zpass:cg[i.zpass],mask:r.mask},opBack:{fail:cg[o.fail],zfail:cg[o.zfail],zpass:cg[o.zpass],mask:r.mask}};var a,s}initCullDrawParams({cull:e}){if(e){const{enable:t,face:n=Ot.gl.BACK}=e;return{enable:!!t,face:ag[n]}}}extractUniforms(e){const t={};return Object.keys(e).forEach((n=>{this.extractUniformsRecursively(n,e[n],t,"")})),t}extractUniformsRecursively(e,t,n,r){null===t||"number"==typeof t||"boolean"==typeof t||Array.isArray(t)&&"number"==typeof t[0]||Ug(t)||""===t||"resize"in t?n[`${r&&r+"."}${e}`]=t:(Fg(t)&&Object.keys(t).forEach((i=>{this.extractUniformsRecursively(i,t[i],n,`${r&&r+"."}${e}`)})),Array.isArray(t)&&t.forEach(((t,i)=>{Object.keys(t).forEach((o=>{this.extractUniformsRecursively(o,t[o],n,`${r&&r+"."}${e}[${i}]`)}))})))}};function zg(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}var jg=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{s(n.next(e))}catch(e){i(e)}},a=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,a);s((n=n.apply(e,t)).next())})),{isUndefined:Vg}=y.uG,Hg=class{constructor(){this.uniformBuffers=[],this.queryVerdorInfo=()=>this.device.queryVendorInfo().platformString,this.createModel=e=>new Gg(this.device,e,this),this.createAttribute=e=>new Jp(this.device,e),this.createBuffer=e=>new fg(this.device,e),this.createElements=e=>new Sg(this.device,e),this.createTexture2D=e=>new Cg(this.device,e),this.createFramebuffer=e=>new Lg(this.device,e),this.useFramebuffer=(e,t)=>{this.currentFramebuffer=e,this.beginFrame(),t(),this.endFrame(),this.currentFramebuffer=null},this.useFramebufferAsync=(e,t)=>jg(this,null,(function*(){this.currentFramebuffer=e,this.preRenderPass=this.renderPass,this.beginFrame(),yield t(),this.endFrame(),this.currentFramebuffer=null,this.renderPass=this.preRenderPass})),this.clear=e=>{const{color:t,depth:n,stencil:r,framebuffer:i=null}=e;if(i)i.clearOptions={color:t,depth:n,stencil:r};else{const e=this.queryVerdorInfo();if("WebGL1"===e){const e=this.getGLContext();Vg(r)?Vg(n)||(e.clearDepth(n),e.clear(e.DEPTH_BUFFER_BIT)):(e.clearStencil(r),e.clear(e.STENCIL_BUFFER_BIT))}else if("WebGL2"===e){const e=this.getGLContext();Vg(r)?Vg(n)||e.clearBufferfv(e.DEPTH,0,[n]):e.clearBufferiv(e.STENCIL,0,[r])}}},this.viewport=({width:e,height:t})=>{this.swapChain.configureSwapChain(e,t),this.createMainColorDepthRT(e,t),this.width=e,this.height=t},this.readPixels=e=>{const{framebuffer:t,x:n,y:r,width:i,height:o}=e,a=this.device.createReadback(),s=t.colorTexture,l=a.readTextureSync(s,n,this.viewportOrigin===Ph.LOWER_LEFT?r:this.height-r,i,o,new Uint8Array(i*o*4));if(this.viewportOrigin!==Ph.LOWER_LEFT)for(let e=0;e<l.length;e+=4){const t=l[e];l[e]=l[e+2],l[e+2]=t}return a.destroy(),l},this.readPixelsAsync=e=>jg(this,null,(function*(){const{framebuffer:t,x:n,y:r,width:i,height:o}=e,a=this.device.createReadback(),s=t.colorTexture,l=yield a.readTexture(s,n,this.viewportOrigin===Ph.LOWER_LEFT?r:this.height-r,i,o,new Uint8Array(i*o*4));if(this.viewportOrigin!==Ph.LOWER_LEFT)for(let e=0;e<l.length;e+=4){const t=l[e];l[e]=l[e+2],l[e+2]=t}return a.destroy(),l})),this.getViewportSize=()=>({width:this.width,height:this.height}),this.getContainer=()=>{var e;return null==(e=this.canvas)?void 0:e.parentElement},this.getCanvas=()=>this.canvas,this.getGLContext=()=>this.device.gl,this.destroy=()=>{var e;this.canvas=null,null==(e=this.uniformBuffers)||e.forEach((e=>{e.destroy()})),this.device.destroy(),this.renderCache.destroy()}}init(e,t){return jg(this,null,(function*(){const{enableWebGPU:n,shaderCompilerPath:r,antialias:i}=t;this.canvas=e;const o=n?new Up({shaderCompilerPath:r}):new Nf({targets:["webgl2","webgl1"],antialias:i,onContextLost(e){console.warn("context lost",e)},onContextCreationError(e){console.warn("context creation error",e)},onContextRestored(e){console.warn("context restored",e)}}),a=yield o.createSwapChain(e);a.configureSwapChain(e.width,e.height),this.device=a.getDevice(),this.swapChain=a,this.renderCache=new xg(this.device),this.currentFramebuffer=null,this.viewportOrigin=this.device.queryVendorInfo().viewportOrigin;const s=this.device.gl;this.extensionObject={OES_texture_float:!zg(s)&&this.device.OES_texture_float},this.createMainColorDepthRT(e.width,e.height)}))}createMainColorDepthRT(e,t){this.mainColorRT&&this.mainColorRT.destroy(),this.mainDepthRT&&this.mainDepthRT.destroy(),this.mainColorRT=this.device.createRenderTargetFromTexture(this.device.createTexture({format:kh.U8_RGBA_RT,width:e,height:t,usage:Oh.RENDER_TARGET})),this.mainDepthRT=this.device.createRenderTargetFromTexture(this.device.createTexture({format:kh.D24_S8,width:e,height:t,usage:Oh.RENDER_TARGET}))}beginFrame(){this.device.beginFrame();const{currentFramebuffer:e,swapChain:t,mainColorRT:n,mainDepthRT:r}=this,i=e?e.colorRenderTarget:n,o=e?null:t.getOnscreenTexture(),a=e?e.depthRenderTarget:r,{color:s=[0,0,0,0],depth:l=1,stencil:c=0}=(null==e?void 0:e.clearOptions)||{},u=i?$h(255*s[0],255*s[1],255*s[2],s[3]):Jh,h=a?l:void 0,d=a?c:void 0,f=this.device.createRenderPass({colorAttachment:[i],colorResolveTo:[o],colorClearColor:[u],colorStore:[!0],depthStencilAttachment:a,depthClearValue:h,stencilClearValue:d});this.renderPass=f}endFrame(){this.device.submitPass(this.renderPass),this.device.endFrame()}getPointSizeRange(){const e=this.device.gl;return e.getParameter(e.ALIASED_POINT_SIZE_RANGE)}testExtension(e){return!!this.getGLContext().getExtension(e)}setState(){}setBaseState(){}setCustomLayerDefaults(){}setDirty(e){this.isDirty=e}getDirty(){return this.isDirty}},Wg=["selectstart","selecting","selectend"],Xg=class extends Zn.EventEmitter{constructor(e,t={}){super(),this.isEnable=!1,this.onDragStart=e=>{this.box.style.display="block",this.startEvent=this.endEvent=e,this.syncBoxBound(),this.emit("selectstart",this.getLngLatBox(),this.startEvent,this.endEvent)},this.onDragging=e=>{this.endEvent=e,this.syncBoxBound(),this.emit("selecting",this.getLngLatBox(),this.startEvent,this.endEvent)},this.onDragEnd=e=>{this.endEvent=e,this.box.style.display="none",this.emit("selectend",this.getLngLatBox(),this.startEvent,this.endEvent)},this.scene=e,this.options=t}get container(){return this.scene.getMapService().getMarkerContainer()}enable(){if(this.isEnable)return;const{className:e}=this.options;if(this.scene.setMapStatus({dragEnable:!1}),this.container.style.cursor="crosshair",!this.box){const t=y.dv.create("div",void 0,this.container);t.classList.add("l7-select-box"),e&&t.classList.add(e),t.style.display="none",this.box=t}this.scene.on("dragstart",this.onDragStart),this.scene.on("dragging",this.onDragging),this.scene.on("dragend",this.onDragEnd),this.isEnable=!0}disable(){this.isEnable&&(this.scene.setMapStatus({dragEnable:!0}),this.container.style.cursor="auto",this.scene.off("dragstart",this.onDragStart),this.scene.off("dragging",this.onDragging),this.scene.off("dragend",this.onDragEnd),this.isEnable=!1)}syncBoxBound(){const{x:e,y:t}=this.startEvent,{x:n,y:r}=this.endEvent,i=Math.min(e,n),o=Math.min(t,r),a=Math.abs(e-n),s=Math.abs(t-r);this.box.style.top=`${o}px`,this.box.style.left=`${i}px`,this.box.style.width=`${a}px`,this.box.style.height=`${s}px`}getLngLatBox(){const{lngLat:{lng:e,lat:t}}=this.startEvent,{lngLat:{lng:n,lat:r}}=this.endEvent;return(0,y.tp)([[e,t],[n,r]])}},Zg=Object.defineProperty,Yg=Object.defineProperties,qg=Object.getOwnPropertyDescriptors,Kg=Object.getOwnPropertySymbols,Qg=Object.prototype.hasOwnProperty,$g=Object.prototype.propertyIsEnumerable,Jg=(e,t,n)=>t in e?Zg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,em=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{s(n.next(e))}catch(e){i(e)}},a=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,a);s((n=n.apply(e,t)).next())})),tm=class{constructor(e){const{id:t,map:n,renderer:r="device"}=e,i=(0,Ot.Cz)();this.container=i,n.setContainer(i,t),i.rendererService="regl"===r?new $p:new Hg,this.sceneService=i.sceneService,this.mapService=i.mapService,this.iconService=i.iconService,this.fontService=i.fontService,this.controlService=i.controlService,this.layerService=i.layerService,this.debugService=i.debugService,this.debugService.setEnable(e.debug),this.markerService=i.markerService,this.interactionService=i.interactionService,this.popupService=i.popupService,this.boxSelect=new Xg(this,{}),this.initComponent(t),this.sceneService.init(e),this.initControl()}get map(){return this.mapService.map}get loaded(){return this.sceneService.loaded}getServiceContainer(){return this.container}getSize(){return this.mapService.getSize()}getMinZoom(){return this.mapService.getMinZoom()}getMaxZoom(){return this.mapService.getMaxZoom()}getType(){return this.mapService.getType()}getMapContainer(){return this.mapService.getMapContainer()}getMapCanvasContainer(){return this.mapService.getMapCanvasContainer()}getMapService(){return this.mapService}getDebugService(){return this.debugService}exportPng(e){return em(this,null,(function*(){return this.sceneService.exportPng(e)}))}exportMap(e){return em(this,null,(function*(){return this.sceneService.exportPng(e)}))}registerRenderService(e){this.sceneService.loaded?new e(this).init():this.on("loaded",(()=>{new e(this).init()}))}setBgColor(e){this.mapService.setBgColor(e)}addLayer(e){this.loaded?this.preAddLayer(e):this.once("loaded",(()=>{this.preAddLayer(e)}))}preAddLayer(e){const t=(0,Ot.T3)(this.container);if(e.setContainer(t),this.sceneService.addLayer(e),e.inited){this.initTileLayer(e);const t=this.initMask(e);this.addMask(t,e.id)}else e.on("inited",(()=>{this.initTileLayer(e);const t=this.initMask(e);this.addMask(t,e.id)}))}initMask(e){const{mask:t,maskfence:n,maskColor:r="#000",maskOpacity:i=0}=e.getLayerConfig();if(t&&n)return(new xu).source(n).shape("fill").style({color:r,opacity:i})}addMask(e,t){if(!e)return;const n=this.getLayer(t);if(n){const t=(0,Ot.T3)(this.container);e.setContainer(t),n.addMaskLayer(e),this.sceneService.addMask(e)}else console.warn("parent layer not find!")}getPickedLayer(){return this.layerService.pickedLayerId}getLayers(){return this.layerService.getLayers()}getLayer(e){return this.layerService.getLayer(e)}getLayerByName(e){return this.layerService.getLayerByName(e)}removeLayer(e,t){return em(this,null,(function*(){yield this.layerService.remove(e,t)}))}removeAllLayer(){return em(this,null,(function*(){yield this.layerService.removeAllLayers()}))}render(){this.sceneService.render()}setEnableRender(e){this.layerService.setEnableRender(e)}addIconFont(e,t){this.fontService.addIconFont(e,t)}addIconFonts(e){e.forEach((([e,t])=>{this.fontService.addIconFont(e,t)}))}addFontFace(e,t){this.fontService.once("fontloaded",(e=>{this.emit("fontloaded",e)})),this.fontService.addFontFace(e,t)}addImage(e,t){return em(this,null,(function*(){yield this.iconService.addImage(e,t)}))}hasImage(e){return this.iconService.hasImage(e)}removeImage(e){this.iconService.removeImage(e)}addIconFontGlyphs(e,t){this.fontService.addIconGlyphs(t)}addControl(e){this.controlService.addControl(e,this.container)}removeControl(e){this.controlService.removeControl(e)}getControlByName(e){return this.controlService.getControlByName(e)}addMarker(e){this.markerService.addMarker(e)}addMarkerLayer(e){this.markerService.addMarkerLayer(e)}removeMarkerLayer(e){this.markerService.removeMarkerLayer(e)}removeAllMarkers(){this.markerService.removeAllMarkers()}removeAllMakers(){console.warn("removeAllMakers 已废弃,请使用 removeAllMarkers"),this.markerService.removeAllMarkers()}addPopup(e){this.popupService.addPopup(e)}removePopup(e){this.popupService.removePopup(e)}on(e,t){var n;Wg.includes(e)?null==(n=this.boxSelect)||n.on(e,t):Ot.Zo.includes(e)?this.sceneService.on(e,t):this.mapService.on(e,t)}once(e,t){var n;Wg.includes(e)?null==(n=this.boxSelect)||n.once(e,t):Ot.Zo.includes(e)?this.sceneService.once(e,t):this.mapService.once(e,t)}emit(e,t){-1===Ot.Zo.indexOf(e)?this.mapService.on(e,t):this.sceneService.emit(e,t)}off(e,t){var n;Wg.includes(e)?null==(n=this.boxSelect)||n.off(e,t):Ot.Zo.includes(e)?this.sceneService.off(e,t):this.mapService.off(e,t)}getZoom(){return this.mapService.getZoom()}getCenter(e){return this.mapService.getCenter(e)}setCenter(e,t){return this.mapService.setCenter(e,t)}getPitch(){return this.mapService.getPitch()}setPitch(e){return this.mapService.setPitch(e)}getRotation(){return this.mapService.getRotation()}getBounds(){return this.mapService.getBounds()}setRotation(e){this.mapService.setRotation(e)}zoomIn(){this.mapService.zoomIn()}zoomOut(){this.mapService.zoomOut()}panTo(e){this.mapService.panTo(e)}panBy(e,t){this.mapService.panBy(e,t)}getContainer(){return this.mapService.getContainer()}setZoom(e){this.mapService.setZoom(e)}fitBounds(e,t){const{fitBoundsOptions:n,animate:r}=this.sceneService.getSceneConfig();var i;this.mapService.fitBounds(e,t||(i=((e,t)=>{for(var n in t||(t={}))Qg.call(t,n)&&Jg(e,n,t[n]);if(Kg)for(var n of Kg(t))$g.call(t,n)&&Jg(e,n,t[n]);return e})({},n),Yg(i,qg({animate:r}))))}setZoomAndCenter(e,t){this.mapService.setZoomAndCenter(e,t)}setMapStyle(e){this.mapService.setMapStyle(e)}setMapStatus(e){this.mapService.setMapStatus(e)}pixelToLngLat(e){return this.mapService.pixelToLngLat(e)}lngLatToPixel(e){return this.mapService.lngLatToPixel(e)}containerToLngLat(e){return this.mapService.containerToLngLat(e)}lngLatToContainer(e){return this.mapService.lngLatToContainer(e)}destroy(){this.sceneService.destroy()}registerPostProcessingPass(e){this.container.postProcessingPass.name=new e}enableShaderPick(){this.layerService.enableShaderPick()}diasbleShaderPick(){this.layerService.disableShaderPick()}enableBoxSelect(e=!0){this.boxSelect.enable(),e&&this.boxSelect.once("selectend",(()=>{this.disableBoxSelect()}))}disableBoxSelect(){this.boxSelect.disable()}static addProtocol(e,t){y.xP.REGISTERED_PROTOCOLS[e]=t}static removeProtocol(e){delete y.xP.REGISTERED_PROTOCOLS[e]}getProtocol(e){return y.xP.REGISTERED_PROTOCOLS[e]}startAnimate(){this.layerService.startAnimate()}stopAnimate(){this.layerService.stopAnimate()}getPointSizeRange(){return this.sceneService.getPointSizeRange()}initComponent(e){this.controlService.init({container:y.dv.getContainer(e)},this.container),this.markerService.init(this.container),this.popupService.init(this.container)}initControl(){const{logoVisible:e,logoPosition:t}=this.sceneService.getSceneConfig();e&&this.addControl(new qr({position:t}))}initTileLayer(e){e.getSource().isTile&&(e.tileLayer=new Gu(e))}}},48643:function(e){e.exports=function(){"use strict";var e=function(e){return e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array||e instanceof Uint8ClampedArray},t=function(e,t){for(var n=Object.keys(t),r=0;r<n.length;++r)e[n[r]]=t[n[r]];return e},n="\n";function r(e){var t=new Error("(regl) "+e);throw console.error(t),t}function i(e,t){e||r(t)}function o(e){return e?": "+e:""}function a(e,t){switch(t){case"number":return"number"==typeof e;case"object":return"object"==typeof e;case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"function":return"function"==typeof e;case"undefined":return void 0===e;case"symbol":return"symbol"==typeof e}}function s(e,t,n){t.indexOf(e)<0&&r("invalid value"+o(n)+". must be one of: "+t)}var l=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function c(e,t){for(e+="";e.length<t;)e=" "+e;return e}function u(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function h(e,t){this.number=e,this.line=t,this.errors=[]}function d(e,t,n){this.file=e,this.line=t,this.message=n}function f(){var e=new Error,t=(e.stack||e).toString(),n=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(t);if(n)return n[1];var r=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(t);return r?r[1]:"unknown"}function p(){var e=new Error,t=(e.stack||e).toString(),n=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(t);if(n)return n[1];var r=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(t);return r?r[1]:"unknown"}function g(e,t){var n,r=e.split("\n"),i=1,o=0,a={unknown:new u,0:new u};a.unknown.name=a[0].name=t||f(),a.unknown.lines.push(new h(0,""));for(var s=0;s<r.length;++s){var l=r[s],c=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(l);if(c)switch(c[1]){case"line":var d=/(\d+)(\s+\d+)?/.exec(c[2]);d&&(i=0|d[1],d[2]&&((o=0|d[2])in a||(a[o]=new u)));break;case"define":var p=/SHADER_NAME(_B64)?\s+(.*)$/.exec(c[2]);p&&(a[o].name=p[1]?(n=p[2],"undefined"!=typeof atob?atob(n):"base64:"+n):p[2])}a[o].lines.push(new h(i++,l))}return Object.keys(a).forEach((function(e){var t=a[e];t.lines.forEach((function(e){t.index[e.number]=e}))})),a}function m(e){e._commandRef=f()}function _(e,t){var n=p();r(e+" in command "+(t||f())+("unknown"===n?"":" called from "+n))}function v(e,t,n,r){a(e,t)||_("invalid parameter type"+o(n)+". expected "+t+", got "+typeof e,r||f())}var y=33071,E={};function A(e,t){return 32820===e||32819===e||33635===e?2:34042===e?4:E[e]*t}function b(e){return!(e&e-1||!e)}E[5120]=E[5121]=1,E[5122]=E[5123]=E[36193]=E[33635]=E[32819]=E[32820]=2,E[5124]=E[5125]=E[5126]=E[34042]=4;var T=t(i,{optional:function(e){e()},raise:r,commandRaise:_,command:function(e,t,n){e||_(t,n||f())},parameter:function(e,t,n){e in t||r("unknown parameter ("+e+")"+o(n)+". possible values: "+Object.keys(t).join())},commandParameter:function(e,t,n,r){e in t||_("unknown parameter ("+e+")"+o(n)+". possible values: "+Object.keys(t).join(),r||f())},constructor:function(e){Object.keys(e).forEach((function(e){l.indexOf(e)<0&&r('invalid regl constructor argument "'+e+'". must be one of '+l)}))},type:function(e,t,n){a(e,t)||r("invalid parameter type"+o(n)+". expected "+t+", got "+typeof e)},commandType:v,isTypedArray:function(t,n){e(t)||r("invalid parameter type"+o(n)+". must be a typed array")},nni:function(e,t){e>=0&&(0|e)===e||r("invalid parameter type, ("+e+")"+o(t)+". must be a nonnegative integer")},oneOf:s,shaderError:function(e,t,r,o,a){if(!e.getShaderParameter(t,e.COMPILE_STATUS)){var s=e.getShaderInfoLog(t),l=o===e.FRAGMENT_SHADER?"fragment":"vertex";v(r,"string",l+" shader source must be a string",a);var u=g(r,a),h=function(e){var t=[];return e.split("\n").forEach((function(e){if(!(e.length<5)){var n=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(e);n?t.push(new d(0|n[1],0|n[2],n[3].trim())):e.length>0&&t.push(new d("unknown",0,e))}})),t}(s);(function(e,t){t.forEach((function(t){var n=e[t.file];if(n){var r=n.index[t.line];if(r)return r.errors.push(t),void(n.hasErrors=!0)}e.unknown.hasErrors=!0,e.unknown.lines[0].errors.push(t)}))})(u,h),Object.keys(u).forEach((function(e){var t=u[e];if(t.hasErrors){var r=[""],i=[""];o("file number "+e+": "+t.name+"\n","color:red;text-decoration:underline;font-weight:bold"),t.lines.forEach((function(e){if(e.errors.length>0){o(c(e.number,4)+"| ","background-color:yellow; font-weight:bold"),o(e.line+n,"color:red; background-color:yellow; font-weight:bold");var t=0;e.errors.forEach((function(r){var i=r.message,a=/^\s*'(.*)'\s*:\s*(.*)$/.exec(i);if(a){var s=a[1];i=a[2],"assign"===s&&(s="="),t=Math.max(e.line.indexOf(s,t),0)}else t=0;o(c("| ",6)),o(c("^^^",t+3)+n,"font-weight:bold"),o(c("| ",6)),o(i+n,"font-weight:bold")})),o(c("| ",6)+n)}else o(c(e.number,4)+"| "),o(e.line+n,"color:red")})),"undefined"==typeof document||window.chrome?console.log(r.join("")):(i[0]=r.join("%c"),console.log.apply(console,i))}function o(e,t){r.push(e),i.push(t||"")}})),i.raise("Error compiling "+l+" shader, "+u[0].name)}},linkError:function(e,t,r,o,a){if(!e.getProgramParameter(t,e.LINK_STATUS)){var s=e.getProgramInfoLog(t),l=g(r,a),c='Error linking program with vertex shader, "'+g(o,a)[0].name+'", and fragment shader "'+l[0].name+'"';"undefined"!=typeof document?console.log("%c"+c+"\n%c"+s,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(c+n+s),i.raise(c)}},callSite:p,saveCommandRef:m,saveDrawInfo:function(e,t,n,r){function i(e){return e?r.id(e):0}function o(e,t){Object.keys(t).forEach((function(t){e[r.id(t)]=!0}))}m(e),e._fragId=i(e.static.frag),e._vertId=i(e.static.vert);var a=e._uniformSet={};o(a,t.static),o(a,t.dynamic);var s=e._attributeSet={};o(s,n.static),o(s,n.dynamic),e._hasCount="count"in e.static||"count"in e.dynamic||"elements"in e.static||"elements"in e.dynamic},framebufferFormat:function(e,t,n){e.texture?s(e.texture._texture.internalformat,t,"unsupported texture format for attachment"):s(e.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:f,texture2D:function(e,t,n){var r,o=t.width,a=t.height,s=t.channels;i(o>0&&o<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),e.wrapS===y&&e.wrapT===y||i(b(o)&&b(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===t.mipmask?1!==o&&1!==a&&i(9984!==e.minFilter&&9986!==e.minFilter&&9985!==e.minFilter&&9987!==e.minFilter,"min filter requires mipmap"):(i(b(o)&&b(a),"texture must be a square power of 2 to support mipmapping"),i(t.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),5126===t.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&i(9728===e.minFilter&&9728===e.magFilter,"filter not supported, must enable oes_texture_float_linear"),i(!e.genMipmaps,"mipmap generation not supported with float textures"));var l=t.images;for(r=0;r<16;++r)if(l[r]){var c=o>>r,u=a>>r;i(t.mipmask&1<<r,"missing mipmap data");var h=l[r];if(i(h.width===c&&h.height===u,"invalid shape for mip images"),i(h.format===t.format&&h.internalformat===t.internalformat&&h.type===t.type,"incompatible type for mip image"),h.compressed);else if(h.data){var d=Math.ceil(A(h.type,s)*c/h.unpackAlignment)*h.unpackAlignment;i(h.data.byteLength===d*u,"invalid data for image, buffer size is inconsistent with image format")}else h.element||h.copy}else e.genMipmaps||i(!(t.mipmask&1<<r),"extra mipmap data");t.compressed&&i(!e.genMipmaps,"mipmap generation for compressed images not supported")},textureCube:function(e,t,n,r){var o=e.width,a=e.height,s=e.channels;i(o>0&&o<=r.maxTextureSize&&a>0&&a<=r.maxTextureSize,"invalid texture shape"),i(o===a,"cube map must be square"),i(t.wrapS===y&&t.wrapT===y,"wrap mode not supported by cube map");for(var l=0;l<n.length;++l){var c=n[l];i(c.width===o&&c.height===a,"inconsistent cube map face shape"),t.genMipmaps&&(i(!c.compressed,"can not generate mipmap for compressed textures"),i(1===c.mipmask,"can not specify mipmaps and generate mipmaps"));for(var u=c.images,h=0;h<16;++h){var d=u[h];if(d){var f=o>>h,p=a>>h;i(c.mipmask&1<<h,"missing mipmap data"),i(d.width===f&&d.height===p,"invalid shape for mip images"),i(d.format===e.format&&d.internalformat===e.internalformat&&d.type===e.type,"incompatible type for mip image"),d.compressed||(d.data?i(d.data.byteLength===f*p*Math.max(A(d.type,s),d.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):d.element||d.copy)}}}}}),x=0;function S(e,t){this.id=x++,this.type=e,this.data=t}function R(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function C(e){if(0===e.length)return[];var t=e.charAt(0),n=e.charAt(e.length-1);if(e.length>1&&t===n&&('"'===t||"'"===t))return['"'+R(e.substr(1,e.length-2))+'"'];var r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e);if(r)return C(e.substr(0,r.index)).concat(C(r[1])).concat(C(e.substr(r.index+r[0].length)));var i=e.split(".");if(1===i.length)return['"'+R(e)+'"'];for(var o=[],a=0;a<i.length;++a)o=o.concat(C(i[a]));return o}function L(e){return"["+C(e).join("][")+"]"}var O={DynamicVariable:S,define:function(e,t){return new S(e,L(t+""))},isDynamic:function(e){return"function"==typeof e&&!e._reglType||e instanceof S},unbox:function(e,t){return"function"==typeof e?new S(0,e):e},accessor:L},M={next:"function"==typeof requestAnimationFrame?function(e){return requestAnimationFrame(e)}:function(e){return setTimeout(e,16)},cancel:"function"==typeof cancelAnimationFrame?function(e){return cancelAnimationFrame(e)}:clearTimeout},I="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function w(e){return"string"==typeof e?e.split():(T(Array.isArray(e),"invalid extension array"),e)}function P(e){return"string"==typeof e?(T("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(e)):e}function N(e){var n,r,i,o,a,s=e||{},l={},c=[],u=[],h="undefined"==typeof window?1:window.devicePixelRatio,d=!1,f=function(e){e&&T.raise(e)},p=function(){};if("string"==typeof s?(T("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(s),T(n,"invalid query string for element")):"object"==typeof s?"string"==typeof(a=s).nodeName&&"function"==typeof a.appendChild&&"function"==typeof a.getBoundingClientRect?n=s:function(e){return"function"==typeof e.drawArrays||"function"==typeof e.drawElements}(s)?i=(o=s).canvas:(T.constructor(s),"gl"in s?o=s.gl:"canvas"in s?i=P(s.canvas):"container"in s&&(r=P(s.container)),"attributes"in s&&(l=s.attributes,T.type(l,"object","invalid context attributes")),"extensions"in s&&(c=w(s.extensions)),"optionalExtensions"in s&&(u=w(s.optionalExtensions)),"onDone"in s&&(T.type(s.onDone,"function","invalid or missing onDone callback"),f=s.onDone),"profile"in s&&(d=!!s.profile),"pixelRatio"in s&&(h=+s.pixelRatio,T(h>0,"invalid pixel ratio"))):T.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?i=n:r=n),!o){if(!i){T("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var g=function(e,n,r){var i,o=document.createElement("canvas");function a(){var n=window.innerWidth,i=window.innerHeight;if(e!==document.body){var a=e.getBoundingClientRect();n=a.right-a.left,i=a.bottom-a.top}o.width=r*n,o.height=r*i,t(o.style,{width:n+"px",height:i+"px"})}return t(o.style,{border:0,margin:0,padding:0,top:0,left:0}),e.appendChild(o),e===document.body&&(o.style.position="absolute",t(e.style,{margin:0,padding:0})),e!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(a)}))).observe(e):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),e.removeChild(o)}}}(r||document.body,0,h);if(!g)return null;i=g.canvas,p=g.onDestroy}void 0===l.premultipliedAlpha&&(l.premultipliedAlpha=!0),o=function(e,t){function n(n){try{return e.getContext(n,t)}catch(e){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(i,l)}return o?{gl:o,canvas:i,container:r,extensions:c,optionalExtensions:u,pixelRatio:h,profile:d,onDone:f,onDestroy:p}:(p(),f("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function D(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=t(r);return n}function B(e){var t,n;return t=(e>65535)<<4,t|=n=((e>>>=t)>255)<<3,t|=n=((e>>>=n)>15)<<2,(t|=n=((e>>>=n)>3)<<1)|(e>>>=n)>>1}function F(){var e=D(8,(function(){return[]}));function t(t){var n=function(e){for(var t=16;t<=1<<28;t*=16)if(e<=t)return t;return 0}(t),r=e[B(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(t){e[B(t.byteLength)>>2].push(t)}return{alloc:t,free:n,allocType:function(e,n){var r=null;switch(e){case 5120:r=new Int8Array(t(n),0,n);break;case 5121:r=new Uint8Array(t(n),0,n);break;case 5122:r=new Int16Array(t(2*n),0,n);break;case 5123:r=new Uint16Array(t(2*n),0,n);break;case 5124:r=new Int32Array(t(4*n),0,n);break;case 5125:r=new Uint32Array(t(4*n),0,n);break;case 5126:r=new Float32Array(t(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(e){n(e.buffer)}}}var U=F();U.zero=F();var k=3553,G=6408,z=5126,j=36160;function V(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||e(t.data))}var H=function(e){return Object.keys(e).map((function(t){return e[t]}))},W={shape:function(e){for(var t=[],n=e;n.length;n=n[0])t.push(n.length);return t},flatten:function(e,t,n,r){var i=1;if(t.length)for(var o=0;o<t.length;++o)i*=t[o];else i=0;var a=r||U.allocType(n,i);switch(t.length){case 0:break;case 1:!function(e,t,n){for(var r=0;r<t;++r)n[r]=e[r]}(e,t[0],a);break;case 2:!function(e,t,n,r){for(var i=0,o=0;o<t;++o)for(var a=e[o],s=0;s<n;++s)r[i++]=a[s]}(e,t[0],t[1],a);break;case 3:X(e,t[0],t[1],t[2],a,0);break;default:Z(e,t,0,a,0)}return a}};function X(e,t,n,r,i,o){for(var a=o,s=0;s<t;++s)for(var l=e[s],c=0;c<n;++c)for(var u=l[c],h=0;h<r;++h)i[a++]=u[h]}function Z(e,t,n,r,i){for(var o=1,a=n+1;a<t.length;++a)o*=t[a];var s=t[n];if(t.length-n==4){var l=t[n+1],c=t[n+2],u=t[n+3];for(a=0;a<s;++a)X(e[a],l,c,u,r,i),i+=o}else for(a=0;a<s;++a)Z(e[a],t,n+1,r,i),i+=o}var Y={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},q={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},K={dynamic:35048,stream:35040,static:35044},Q=W.flatten,$=W.shape,J=5121,ee=5126,te=[];function ne(e){return 0|Y[Object.prototype.toString.call(e)]}function re(e,t){for(var n=0;n<t.length;++n)e[n]=t[n]}function ie(e,t,n,r,i,o,a){for(var s=0,l=0;l<n;++l)for(var c=0;c<r;++c)e[s++]=t[i*l+o*c+a]}te[5120]=1,te[5122]=2,te[5124]=4,te[5121]=1,te[5123]=2,te[5125]=4,te[5126]=4;var oe={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},ae=5121,se=5123,le=5125,ce=34963;var ue=new Float32Array(1),he=new Uint32Array(ue.buffer);function de(e){for(var t=U.allocType(5123,e.length),n=0;n<e.length;++n)if(isNaN(e[n]))t[n]=65535;else if(e[n]===1/0)t[n]=31744;else if(e[n]===-1/0)t[n]=64512;else{ue[0]=e[n];var r=he[0],i=r>>>31<<15,o=(r<<1>>>24)-127,a=r>>13&1023;if(o<-24)t[n]=i;else if(o<-14){var s=-14-o;t[n]=i+(a+1024>>s)}else t[n]=o>15?i+31744:i+(o+15<<10)+a}return t}function fe(t){return Array.isArray(t)||e(t)}var pe=function(e){return!(e&e-1||!e)},ge=3553,me=34069,_e=6408,ve=6406,ye=6407,Ee=6409,Ae=6410,be=32855,Te=6402,xe=34041,Se=35904,Re=35906,Ce=36193,Le=33776,Oe=33777,Me=33778,Ie=33779,we=5121,Pe=5123,Ne=5125,De=5126,Be=33071,Fe=9728,Ue=9984,ke=9987,Ge=4352,ze=33984,je=[Ue,9986,9985,ke],Ve=[0,Ee,Ae,ye,_e],He={};function We(e){return"[object "+e+"]"}He[6409]=He[6406]=He[6402]=1,He[34041]=He[6410]=2,He[6407]=He[35904]=3,He[6408]=He[35906]=4;var Xe=We("HTMLCanvasElement"),Ze=We("OffscreenCanvas"),Ye=We("CanvasRenderingContext2D"),qe=We("ImageBitmap"),Ke=We("HTMLImageElement"),Qe=We("HTMLVideoElement"),$e=Object.keys(Y).concat([Xe,Ze,Ye,qe,Ke,Qe]),Je=[];Je[5121]=1,Je[5126]=4,Je[36193]=2,Je[5123]=2,Je[5125]=4;var et=[];function tt(e){return Array.isArray(e)&&(0===e.length||"number"==typeof e[0])}function nt(e){return!!Array.isArray(e)&&!(0===e.length||!fe(e[0]))}function rt(e){return Object.prototype.toString.call(e)}function it(e){return rt(e)===Xe}function ot(e){return rt(e)===Ze}function at(e){if(!e)return!1;var t=rt(e);return $e.indexOf(t)>=0||tt(e)||nt(e)||V(e)}function st(e){return 0|Y[Object.prototype.toString.call(e)]}function lt(e,t){return U.allocType(e.type===Ce?De:e.type,t)}function ct(e,t){e.type===Ce?(e.data=de(t),U.freeType(t)):e.data=t}function ut(e,t,n,r,i,o){var a;if(a=void 0!==et[e]?et[e]:He[e]*Je[t],o&&(a*=6),i){for(var s=0,l=n;l>=1;)s+=a*l*l,l/=2;return s}return a*n*r}function ht(n,r,i,o,a,s,l){var c={"don't care":Ge,"dont care":Ge,nice:4354,fast:4353},u={repeat:10497,clamp:Be,mirror:33648},h={nearest:Fe,linear:9729},d=t({mipmap:ke,"nearest mipmap nearest":Ue,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":ke},h),f={none:0,browser:37444},p={uint8:we,rgba4:32819,rgb565:33635,"rgb5 a1":32820},g={alpha:ve,luminance:Ee,"luminance alpha":Ae,rgb:ye,rgba:_e,rgba4:32854,"rgb5 a1":be,rgb565:36194},m={};r.ext_srgb&&(g.srgb=Se,g.srgba=Re),r.oes_texture_float&&(p.float32=p.float=De),r.oes_texture_half_float&&(p.float16=p["half float"]=Ce),r.webgl_depth_texture&&(t(g,{depth:Te,"depth stencil":xe}),t(p,{uint16:Pe,uint32:Ne,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&t(m,{"rgb s3tc dxt1":Le,"rgba s3tc dxt1":Oe,"rgba s3tc dxt3":Me,"rgba s3tc dxt5":Ie}),r.webgl_compressed_texture_atc&&t(m,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&t(m,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(m["rgb etc1"]=36196);var _=Array.prototype.slice.call(n.getParameter(34467));Object.keys(m).forEach((function(e){var t=m[e];_.indexOf(t)>=0&&(g[e]=t)}));var v=Object.keys(g);i.textureFormats=v;var y=[];Object.keys(g).forEach((function(e){var t=g[e];y[t]=e}));var E=[];Object.keys(p).forEach((function(e){var t=p[e];E[t]=e}));var A=[];Object.keys(h).forEach((function(e){A[h[e]]=e}));var b=[];Object.keys(d).forEach((function(e){var t=d[e];b[t]=e}));var x=[];Object.keys(u).forEach((function(e){x[u[e]]=e}));var S=v.reduce((function(e,t){var n=g[t];return n===Ee||n===ve||n===Ee||n===Ae||n===Te||n===xe||r.ext_srgb&&(n===Se||n===Re)?e[n]=n:n===be||t.indexOf("rgba")>=0?e[n]=_e:e[n]=ye,e}),{});function R(){this.internalformat=_e,this.format=_e,this.type=we,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function C(e,t){e.internalformat=t.internalformat,e.format=t.format,e.type=t.type,e.compressed=t.compressed,e.premultiplyAlpha=t.premultiplyAlpha,e.flipY=t.flipY,e.unpackAlignment=t.unpackAlignment,e.colorSpace=t.colorSpace,e.width=t.width,e.height=t.height,e.channels=t.channels}function L(e,t){if("object"==typeof t&&t){if("premultiplyAlpha"in t&&(T.type(t.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),e.premultiplyAlpha=t.premultiplyAlpha),"flipY"in t&&(T.type(t.flipY,"boolean","invalid texture flip"),e.flipY=t.flipY),"alignment"in t&&(T.oneOf(t.alignment,[1,2,4,8],"invalid texture unpack alignment"),e.unpackAlignment=t.alignment),"colorSpace"in t&&(T.parameter(t.colorSpace,f,"invalid colorSpace"),e.colorSpace=f[t.colorSpace]),"type"in t){var n=t.type;T(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),T(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),T(r.webgl_depth_texture||!("uint16"===n||"uint32"===n||"depth stencil"===n),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),T.parameter(n,p,"invalid texture type"),e.type=p[n]}var o=e.width,a=e.height,s=e.channels,l=!1;"shape"in t?(T(Array.isArray(t.shape)&&t.shape.length>=2,"shape must be an array"),o=t.shape[0],a=t.shape[1],3===t.shape.length&&(s=t.shape[2],T(s>0&&s<=4,"invalid number of channels"),l=!0),T(o>=0&&o<=i.maxTextureSize,"invalid width"),T(a>=0&&a<=i.maxTextureSize,"invalid height")):("radius"in t&&(o=a=t.radius,T(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in t&&(o=t.width,T(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in t&&(a=t.height,T(a>=0&&a<=i.maxTextureSize,"invalid height")),"channels"in t&&(s=t.channels,T(s>0&&s<=4,"invalid number of channels"),l=!0)),e.width=0|o,e.height=0|a,e.channels=0|s;var c=!1;if("format"in t){var u=t.format;T(r.webgl_depth_texture||!("depth"===u||"depth stencil"===u),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),T.parameter(u,g,"invalid texture format");var h=e.internalformat=g[u];e.format=S[h],u in p&&("type"in t||(e.type=p[u])),u in m&&(e.compressed=!0),c=!0}!l&&c?e.channels=He[e.format]:l&&!c?e.channels!==Ve[e.format]&&(e.format=e.internalformat=Ve[e.channels]):c&&l&&T(e.channels===He[e.format],"number of channels inconsistent with specified format")}}function O(e){n.pixelStorei(37440,e.flipY),n.pixelStorei(37441,e.premultiplyAlpha),n.pixelStorei(37443,e.colorSpace),n.pixelStorei(3317,e.unpackAlignment)}function M(){R.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function I(t,n){var r=null;if(at(n)?r=n:n&&(T.type(n,"object","invalid pixel data type"),L(t,n),"x"in n&&(t.xOffset=0|n.x),"y"in n&&(t.yOffset=0|n.y),at(n.data)&&(r=n.data)),T(!t.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){T(!r,"can not specify copy and data field for the same texture");var o=a.viewportWidth,s=a.viewportHeight;t.width=t.width||o-t.xOffset,t.height=t.height||s-t.yOffset,t.needsCopy=!0,T(t.xOffset>=0&&t.xOffset<o&&t.yOffset>=0&&t.yOffset<s&&t.width>0&&t.width<=o&&t.height>0&&t.height<=s,"copy texture read out of bounds")}else if(r){if(e(r))t.channels=t.channels||4,t.data=r,"type"in n||t.type!==we||(t.type=st(r));else if(tt(r))t.channels=t.channels||4,function(e,t){var n=t.length;switch(e.type){case we:case Pe:case Ne:case De:var r=U.allocType(e.type,n);r.set(t),e.data=r;break;case Ce:e.data=de(t);break;default:T.raise("unsupported texture type, must specify a typed array")}}(t,r),t.alignment=1,t.needsFree=!0;else if(V(r)){var l=r.data;Array.isArray(l)||t.type!==we||(t.type=st(l));var c,u,h,d,f,p,g=r.shape,m=r.stride;3===g.length?(h=g[2],p=m[2]):(T(2===g.length,"invalid ndarray pixel data, must be 2 or 3D"),h=1,p=1),c=g[0],u=g[1],d=m[0],f=m[1],t.alignment=1,t.width=c,t.height=u,t.channels=h,t.format=t.internalformat=Ve[h],t.needsFree=!0,function(e,t,n,r,i,o){for(var a=e.width,s=e.height,l=e.channels,c=lt(e,a*s*l),u=0,h=0;h<s;++h)for(var d=0;d<a;++d)for(var f=0;f<l;++f)c[u++]=t[n*d+r*h+i*f+o];ct(e,c)}(t,l,d,f,p,r.offset)}else if(it(r)||ot(r)||rt(r)===Ye)it(r)||ot(r)?t.element=r:t.element=r.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(function(e){return rt(e)===qe}(r))t.element=r,t.width=r.width,t.height=r.height,t.channels=4;else if(function(e){return rt(e)===Ke}(r))t.element=r,t.width=r.naturalWidth,t.height=r.naturalHeight,t.channels=4;else if(function(e){return rt(e)===Qe}(r))t.element=r,t.width=r.videoWidth,t.height=r.videoHeight,t.channels=4;else if(nt(r)){var _=t.width||r[0].length,v=t.height||r.length,y=t.channels;y=fe(r[0][0])?y||r[0][0].length:y||1;for(var E=W.shape(r),A=1,b=0;b<E.length;++b)A*=E[b];var x=lt(t,A);W.flatten(r,E,"",x),ct(t,x),t.alignment=1,t.width=_,t.height=v,t.channels=y,t.format=t.internalformat=Ve[y],t.needsFree=!0}}else t.width=t.width||1,t.height=t.height||1,t.channels=t.channels||4;t.type===De?T(i.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):t.type===Ce&&T(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function w(e,t,r){var i=e.element,a=e.data,s=e.internalformat,l=e.format,c=e.type,u=e.width,h=e.height;O(e),i?n.texImage2D(t,r,l,l,c,i):e.compressed?n.compressedTexImage2D(t,r,s,u,h,0,a):e.needsCopy?(o(),n.copyTexImage2D(t,r,l,e.xOffset,e.yOffset,u,h,0)):n.texImage2D(t,r,l,u,h,0,l,c,a||null)}function P(e,t,r,i,a){var s=e.element,l=e.data,c=e.internalformat,u=e.format,h=e.type,d=e.width,f=e.height;O(e),s?n.texSubImage2D(t,a,r,i,u,h,s):e.compressed?n.compressedTexSubImage2D(t,a,r,i,c,d,f,l):e.needsCopy?(o(),n.copyTexSubImage2D(t,a,r,i,e.xOffset,e.yOffset,d,f)):n.texSubImage2D(t,a,r,i,d,f,u,h,l)}var N=[];function D(){return N.pop()||new M}function B(e){e.needsFree&&U.freeType(e.data),M.call(e),N.push(e)}function F(){R.call(this),this.genMipmaps=!1,this.mipmapHint=Ge,this.mipmask=0,this.images=Array(16)}function k(e,t,n){var r=e.images[0]=D();e.mipmask=1,r.width=e.width=t,r.height=e.height=n,r.channels=e.channels=4}function G(e,t){var n=null;if(at(t))C(n=e.images[0]=D(),e),I(n,t),e.mipmask=1;else if(L(e,t),Array.isArray(t.mipmap))for(var r=t.mipmap,i=0;i<r.length;++i)C(n=e.images[i]=D(),e),n.width>>=i,n.height>>=i,I(n,r[i]),e.mipmask|=1<<i;else C(n=e.images[0]=D(),e),I(n,t),e.mipmask=1;C(e,e.images[0]),!e.compressed||e.internalformat!==Le&&e.internalformat!==Oe&&e.internalformat!==Me&&e.internalformat!==Ie||T(e.width%4==0&&e.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function z(e,t){for(var n=e.images,r=0;r<n.length;++r){if(!n[r])return;w(n[r],t,r)}}var j=[];function X(){var e=j.pop()||new F;R.call(e),e.mipmask=0;for(var t=0;t<16;++t)e.images[t]=null;return e}function Z(e){for(var t=e.images,n=0;n<t.length;++n)t[n]&&B(t[n]),t[n]=null;j.push(e)}function Y(){this.minFilter=Fe,this.magFilter=Fe,this.wrapS=Be,this.wrapT=Be,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Ge}function q(e,t){if("min"in t){var n=t.min;T.parameter(n,d),e.minFilter=d[n],je.indexOf(e.minFilter)>=0&&!("faces"in t)&&(e.genMipmaps=!0)}if("mag"in t){var r=t.mag;T.parameter(r,h),e.magFilter=h[r]}var o=e.wrapS,a=e.wrapT;if("wrap"in t){var s=t.wrap;"string"==typeof s?(T.parameter(s,u),o=a=u[s]):Array.isArray(s)&&(T.parameter(s[0],u),T.parameter(s[1],u),o=u[s[0]],a=u[s[1]])}else{if("wrapS"in t){var l=t.wrapS;T.parameter(l,u),o=u[l]}if("wrapT"in t){var f=t.wrapT;T.parameter(f,u),a=u[f]}}if(e.wrapS=o,e.wrapT=a,"anisotropic"in t){var p=t.anisotropic;T("number"==typeof p&&p>=1&&p<=i.maxAnisotropic,"aniso samples must be between 1 and "),e.anisotropic=t.anisotropic}if("mipmap"in t){var g=!1;switch(typeof t.mipmap){case"string":T.parameter(t.mipmap,c,"invalid mipmap hint"),e.mipmapHint=c[t.mipmap],e.genMipmaps=!0,g=!0;break;case"boolean":g=e.genMipmaps=t.mipmap;break;case"object":T(Array.isArray(t.mipmap),"invalid mipmap type"),e.genMipmaps=!1,g=!0;break;default:T.raise("invalid mipmap type")}g&&!("min"in t)&&(e.minFilter=Ue)}}function K(e,t){n.texParameteri(t,10241,e.minFilter),n.texParameteri(t,10240,e.magFilter),n.texParameteri(t,10242,e.wrapS),n.texParameteri(t,10243,e.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(t,34046,e.anisotropic),e.genMipmaps&&(n.hint(33170,e.mipmapHint),n.generateMipmap(t))}var Q=0,$={},J=i.maxTextureUnits,ee=Array(J).map((function(){return null}));function te(e){R.call(this),this.mipmask=0,this.internalformat=_e,this.id=Q++,this.refCount=1,this.target=e,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Y,l.profile&&(this.stats={size:0})}function ne(e){n.activeTexture(ze),n.bindTexture(e.target,e.texture)}function re(){var e=ee[0];e?n.bindTexture(e.target,e.texture):n.bindTexture(ge,null)}function ie(e){var t=e.texture;T(t,"must not double destroy texture");var r=e.unit,i=e.target;r>=0&&(n.activeTexture(ze+r),n.bindTexture(i,null),ee[r]=null),n.deleteTexture(t),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete $[e.id],s.textureCount--}return t(te.prototype,{bind:function(){var e=this;e.bindCount+=1;var t=e.unit;if(t<0){for(var r=0;r<J;++r){var i=ee[r];if(i){if(i.bindCount>0)continue;i.unit=-1}ee[r]=e,t=r;break}t>=J&&T.raise("insufficient number of texture units"),l.profile&&s.maxTextureUnits<t+1&&(s.maxTextureUnits=t+1),e.unit=t,n.activeTexture(ze+t),n.bindTexture(e.target,e.texture)}return t},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&ie(this)}}),l.profile&&(s.getTotalTextureSize=function(){var e=0;return Object.keys($).forEach((function(t){e+=$[t].stats.size})),e}),{create2D:function(e,t){var r=new te(ge);function o(e,t){var n=r.texInfo;Y.call(n);var a=X();return"number"==typeof e?k(a,0|e,"number"==typeof t?0|t:0|e):e?(T.type(e,"object","invalid arguments to regl.texture"),q(n,e),G(a,e)):k(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,C(r,a),T.texture2D(n,a,i),r.internalformat=a.internalformat,o.width=a.width,o.height=a.height,ne(r),z(a,ge),K(n,ge),re(),Z(a),l.profile&&(r.stats.size=ut(r.internalformat,r.type,a.width,a.height,n.genMipmaps,!1)),o.format=y[r.internalformat],o.type=E[r.type],o.mag=A[n.magFilter],o.min=b[n.minFilter],o.wrapS=x[n.wrapS],o.wrapT=x[n.wrapT],o}return $[r.id]=r,s.textureCount++,o(e,t),o.subimage=function(e,t,n,i){T(!!e,"must specify image data");var a=0|t,s=0|n,l=0|i,c=D();return C(c,r),c.width=0,c.height=0,I(c,e),c.width=c.width||(r.width>>l)-a,c.height=c.height||(r.height>>l)-s,T(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),T(a>=0&&s>=0&&a+c.width<=r.width&&s+c.height<=r.height,"texture.subimage write out of bounds"),T(r.mipmask&1<<l,"missing mipmap data"),T(c.data||c.element||c.needsCopy,"missing image data"),ne(r),P(c,ge,a,s,l),re(),B(c),o},o.resize=function(e,t){var i=0|e,a=0|t||i;if(i===r.width&&a===r.height)return o;o.width=r.width=i,o.height=r.height=a,ne(r);for(var s=0;r.mipmask>>s;++s){var c=i>>s,u=a>>s;if(!c||!u)break;n.texImage2D(ge,s,r.format,c,u,0,r.format,r.type,null)}return re(),l.profile&&(r.stats.size=ut(r.internalformat,r.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=r,l.profile&&(o.stats=r.stats),o.destroy=function(){r.decRef()},o},createCube:function(e,t,r,o,a,c){var u=new te(34067);$[u.id]=u,s.cubeCount++;var h=new Array(6);function d(e,t,n,r,o,a){var s,c=u.texInfo;for(Y.call(c),s=0;s<6;++s)h[s]=X();if("number"!=typeof e&&e)if("object"==typeof e)if(t)G(h[0],e),G(h[1],t),G(h[2],n),G(h[3],r),G(h[4],o),G(h[5],a);else if(q(c,e),L(u,e),"faces"in e){var f=e.faces;for(T(Array.isArray(f)&&6===f.length,"cube faces must be a length 6 array"),s=0;s<6;++s)T("object"==typeof f[s]&&!!f[s],"invalid input for cube map face"),C(h[s],u),G(h[s],f[s])}else for(s=0;s<6;++s)G(h[s],e);else T.raise("invalid arguments to cube map");else{var p=0|e||1;for(s=0;s<6;++s)k(h[s],p,p)}for(C(u,h[0]),i.npotTextureCube||T(pe(u.width)&&pe(u.height),"your browser does not support non power or two texture dimensions"),c.genMipmaps?u.mipmask=(h[0].width<<1)-1:u.mipmask=h[0].mipmask,T.textureCube(u,c,h,i),u.internalformat=h[0].internalformat,d.width=h[0].width,d.height=h[0].height,ne(u),s=0;s<6;++s)z(h[s],me+s);for(K(c,34067),re(),l.profile&&(u.stats.size=ut(u.internalformat,u.type,d.width,d.height,c.genMipmaps,!0)),d.format=y[u.internalformat],d.type=E[u.type],d.mag=A[c.magFilter],d.min=b[c.minFilter],d.wrapS=x[c.wrapS],d.wrapT=x[c.wrapT],s=0;s<6;++s)Z(h[s]);return d}return d(e,t,r,o,a,c),d.subimage=function(e,t,n,r,i){T(!!t,"must specify image data"),T("number"==typeof e&&e===(0|e)&&e>=0&&e<6,"invalid face");var o=0|n,a=0|r,s=0|i,l=D();return C(l,u),l.width=0,l.height=0,I(l,t),l.width=l.width||(u.width>>s)-o,l.height=l.height||(u.height>>s)-a,T(u.type===l.type&&u.format===l.format&&u.internalformat===l.internalformat,"incompatible format for texture.subimage"),T(o>=0&&a>=0&&o+l.width<=u.width&&a+l.height<=u.height,"texture.subimage write out of bounds"),T(u.mipmask&1<<s,"missing mipmap data"),T(l.data||l.element||l.needsCopy,"missing image data"),ne(u),P(l,me+e,o,a,s),re(),B(l),d},d.resize=function(e){var t=0|e;if(t!==u.width){d.width=u.width=t,d.height=u.height=t,ne(u);for(var r=0;r<6;++r)for(var i=0;u.mipmask>>i;++i)n.texImage2D(me+r,i,u.format,t>>i,t>>i,0,u.format,u.type,null);return re(),l.profile&&(u.stats.size=ut(u.internalformat,u.type,d.width,d.height,!1,!0)),d}},d._reglType="textureCube",d._texture=u,l.profile&&(d.stats=u.stats),d.destroy=function(){u.decRef()},d},clear:function(){for(var e=0;e<J;++e)n.activeTexture(ze+e),n.bindTexture(ge,null),ee[e]=null;H($).forEach(ie),s.cubeCount=0,s.textureCount=0},getTexture:function(e){return null},restore:function(){for(var e=0;e<J;++e){var t=ee[e];t&&(t.bindCount=0,t.unit=-1,ee[e]=null)}H($).forEach((function(e){e.texture=n.createTexture(),n.bindTexture(e.target,e.texture);for(var t=0;t<32;++t)if(e.mipmask&1<<t)if(e.target===ge)n.texImage2D(ge,t,e.internalformat,e.width>>t,e.height>>t,0,e.internalformat,e.type,null);else for(var r=0;r<6;++r)n.texImage2D(me+r,t,e.internalformat,e.width>>t,e.height>>t,0,e.internalformat,e.type,null);K(e.texInfo,e.target)}))}}}et[32854]=2,et[32855]=2,et[36194]=2,et[34041]=4,et[33776]=.5,et[33777]=.5,et[33778]=1,et[33779]=1,et[35986]=.5,et[35987]=1,et[34798]=1,et[35840]=.5,et[35841]=.25,et[35842]=.5,et[35843]=.25,et[36196]=.5;var dt=36161,ft=32854,pt=[];function gt(e,t,n){return pt[e]*t*n}pt[32854]=2,pt[32855]=2,pt[36194]=2,pt[33189]=2,pt[36168]=1,pt[34041]=4,pt[35907]=4,pt[34836]=16,pt[34842]=8,pt[34843]=6;var mt=36160,_t=36161,vt=3553,yt=34069,Et=[6407,6408],At=[];At[6408]=4,At[6407]=3;var bt=[];bt[5121]=1,bt[5126]=4,bt[36193]=2;var Tt=[32854,32855,36194,35907,34842,34843,34836],xt={};xt[36053]="complete",xt[36054]="incomplete attachment",xt[36057]="incomplete dimensions",xt[36055]="incomplete, missing attachment",xt[36061]="unsupported";function St(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}var Rt=5121,Ct=5126;function Lt(t,n,r,i,o,a,s){function l(l){var c;null===n.next?(T(o.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),c=Rt):(T(null!==n.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),c=n.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?(T(c===Rt||c===Ct,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),c===Ct&&T(s.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):T(c===Rt,"Reading from a framebuffer is only allowed for the type 'uint8'"));var u=0,h=0,d=i.framebufferWidth,f=i.framebufferHeight,p=null;e(l)?p=l:l&&(T.type(l,"object","invalid arguments to regl.read()"),u=0|l.x,h=0|l.y,T(u>=0&&u<i.framebufferWidth,"invalid x offset for regl.read"),T(h>=0&&h<i.framebufferHeight,"invalid y offset for regl.read"),d=0|(l.width||i.framebufferWidth-u),f=0|(l.height||i.framebufferHeight-h),p=l.data||null),p&&(c===Rt?T(p instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):c===Ct&&T(p instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),T(d>0&&d+u<=i.framebufferWidth,"invalid width for read pixels"),T(f>0&&f+h<=i.framebufferHeight,"invalid height for read pixels"),r();var g=d*f*4;return p||(c===Rt?p=new Uint8Array(g):c===Ct&&(p=p||new Float32Array(g))),T.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),T(p.byteLength>=g,"data buffer for regl.read() too small"),t.pixelStorei(3333,4),t.readPixels(u,h,d,f,6408,c,p),p}return function(e){return e&&"framebuffer"in e?function(e){var t;return n.setFBO({framebuffer:e.framebuffer},(function(){t=l(e)})),t}(e):l(e)}}function Ot(e){return Array.prototype.slice.call(e)}function Mt(e){return Ot(e).join("")}var It="xyzw".split(""),wt="dither",Pt="blend.enable",Nt="blend.color",Dt="blend.equation",Bt="blend.func",Ft="depth.enable",Ut="depth.func",kt="depth.range",Gt="depth.mask",zt="colorMask",jt="cull.enable",Vt="cull.face",Ht="frontFace",Wt="lineWidth",Xt="polygonOffset.enable",Zt="polygonOffset.offset",Yt="sample.alpha",qt="sample.enable",Kt="sample.coverage",Qt="stencil.enable",$t="stencil.mask",Jt="stencil.func",en="stencil.opFront",tn="stencil.opBack",nn="scissor.enable",rn="scissor.box",on="viewport",an="profile",sn="framebuffer",ln="vert",cn="frag",un="elements",hn="primitive",dn="count",fn="offset",pn="instances",gn="vao",mn="Width",_n="Height",vn=sn+mn,yn=sn+_n,En=on+mn,An=on+_n,bn="drawingBuffer",Tn=bn+mn,xn=bn+_n,Sn=[Bt,Dt,Jt,en,tn,Kt,on,rn,Zt],Rn=34962,Cn=5126,Ln=35664,On=35665,Mn=35666,In=5124,wn=35667,Pn=35668,Nn=35669,Dn=35670,Bn=35671,Fn=35672,Un=35673,kn=35674,Gn=35675,zn=35676,jn=35678,Vn=35680,Hn=1028,Wn=1029,Xn=2305,Zn=7680,Yn={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},qn=["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"],Kn={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},Qn={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},$n={frag:35632,vert:35633},Jn={cw:2304,ccw:Xn};function er(t){return Array.isArray(t)||e(t)||V(t)}function tr(e){return e.sort((function(e,t){return e===on?-1:t===on?1:e<t?-1:1}))}function nr(e,t,n,r){this.thisDep=e,this.contextDep=t,this.propDep=n,this.append=r}function rr(e){return e&&!(e.thisDep||e.contextDep||e.propDep)}function ir(e){return new nr(!1,!1,!1,e)}function or(e,t){var n=e.type;if(0===n){var r=e.data.length;return new nr(!0,r>=1,r>=2,t)}if(4===n){var i=e.data;return new nr(i.thisDep,i.contextDep,i.propDep,t)}return new nr(3===n,2===n,1===n,t)}var ar=new nr(!1,!1,!1,(function(){}));function sr(e,n,r,i,o,a,s,l,c,u,h,d,f,p,g){var m=u.Record,_={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(_.min=32775,_.max=32776);var v=r.angle_instanced_arrays,y=r.webgl_draw_buffers,E={dirty:!0,profile:g.profile},A={},b=[],x={},S={};function R(e){return e.replace(".","_")}function C(e,t,n){var r=R(e);b.push(e),A[r]=E[r]=!!n,x[r]=t}function L(e,t,n){var r=R(e);b.push(e),Array.isArray(n)?(E[r]=n.slice(),A[r]=n.slice()):E[r]=A[r]=n,S[r]=t}C(wt,3024),C(Pt,3042),L(Nt,"blendColor",[0,0,0,0]),L(Dt,"blendEquationSeparate",[32774,32774]),L(Bt,"blendFuncSeparate",[1,0,1,0]),C(Ft,2929,!0),L(Ut,"depthFunc",513),L(kt,"depthRange",[0,1]),L(Gt,"depthMask",!0),L(zt,zt,[!0,!0,!0,!0]),C(jt,2884),L(Vt,"cullFace",Wn),L(Ht,Ht,Xn),L(Wt,Wt,1),C(Xt,32823),L(Zt,"polygonOffset",[0,0]),C(Yt,32926),C(qt,32928),L(Kt,"sampleCoverage",[1,!1]),C(Qt,2960),L($t,"stencilMask",-1),L(Jt,"stencilFunc",[519,0,-1]),L(en,"stencilOpSeparate",[Hn,Zn,Zn,Zn]),L(tn,"stencilOpSeparate",[Wn,Zn,Zn,Zn]),C(nn,3089),L(rn,"scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),L(on,on,[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var M={gl:e,context:f,strings:n,next:A,current:E,draw:d,elements:a,buffer:o,shader:h,attributes:u.state,vao:u,uniforms:c,framebuffer:l,extensions:r,timer:p,isBufferArgs:er},I={primTypes:oe,compareFuncs:Kn,blendFuncs:Yn,blendEquations:_,stencilOps:Qn,glTypes:q,orientationType:Jn};T.optional((function(){M.isArrayLike=fe})),y&&(I.backBuffer=[Wn],I.drawBuffer=D(i.maxDrawbuffers,(function(e){return 0===e?[0]:D(e,(function(e){return 36064+e}))})));var w=0;function P(){var e=function(){var e=0,n=[],r=[];function i(){var n=[],r=[];return t((function(){n.push.apply(n,Ot(arguments))}),{def:function(){var t="v"+e++;return r.push(t),arguments.length>0&&(n.push(t,"="),n.push.apply(n,Ot(arguments)),n.push(";")),t},toString:function(){return Mt([r.length>0?"var "+r.join(",")+";":"",Mt(n)])}})}function o(){var e=i(),n=i(),r=e.toString,o=n.toString;function a(t,r){n(t,r,"=",e.def(t,r),";")}return t((function(){e.apply(e,Ot(arguments))}),{def:e.def,entry:e,exit:n,save:a,set:function(t,n,r){a(t,n),e(t,n,"=",r,";")},toString:function(){return r()+o()}})}var a=i(),s={};return{global:a,link:function(t){for(var i=0;i<r.length;++i)if(r[i]===t)return n[i];var o="g"+e++;return n.push(o),r.push(t),o},block:i,proc:function(e,n){var r=[];function i(){var e="a"+r.length;return r.push(e),e}n=n||0;for(var a=0;a<n;++a)i();var l=o(),c=l.toString;return s[e]=t(l,{arg:i,toString:function(){return Mt(["function(",r.join(),"){",c(),"}"])}})},scope:o,cond:function(){var e=Mt(arguments),n=o(),r=o(),i=n.toString,a=r.toString;return t(n,{then:function(){return n.apply(n,Ot(arguments)),this},else:function(){return r.apply(r,Ot(arguments)),this},toString:function(){var t=a();return t&&(t="else{"+t+"}"),Mt(["if(",e,"){",i(),"}",t])}})},compile:function(){var e=['"use strict";',a,"return {"];Object.keys(s).forEach((function(t){e.push('"',t,'":',s[t].toString(),",")})),e.push("}");var t=Mt(e).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(t)).apply(null,r)}}}(),r=e.link,i=e.global;e.id=w++,e.batchId="0";var o=r(M),a=e.shared={props:"a0"};Object.keys(M).forEach((function(e){a[e]=i.def(o,".",e)})),T.optional((function(){e.CHECK=r(T),e.commandStr=T.guessCommand(),e.command=r(e.commandStr),e.assert=function(e,t,n){e("if(!(",t,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},I.invalidBlendCombinations=qn}));var s=e.next={},l=e.current={};Object.keys(S).forEach((function(e){Array.isArray(E[e])&&(s[e]=i.def(a.next,".",e),l[e]=i.def(a.current,".",e))}));var c=e.constants={};Object.keys(I).forEach((function(e){c[e]=i.def(JSON.stringify(I[e]))})),e.invoke=function(t,n){switch(n.type){case 0:var i=["this",a.context,a.props,e.batchId];return t.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case 1:return t.def(a.props,n.data);case 2:return t.def(a.context,n.data);case 3:return t.def("this",n.data);case 4:return n.data.append(e,t),n.data.ref}},e.attribCache={};var h={};return e.scopeAttrib=function(e){var t=n.id(e);if(t in h)return h[t];var i=u.scope[t];return i||(i=u.scope[t]=new m),h[t]=r(i)},e}function N(e,t,s,c,d){var f=e.static,p=e.dynamic;T.optional((function(){var e=[sn,ln,cn,un,hn,fn,dn,pn,an,gn].concat(b);function t(t){Object.keys(t).forEach((function(t){T.command(e.indexOf(t)>=0,'unknown parameter "'+t+'"',d.commandStr)}))}t(f),t(p)}));var g=function(e,t){var n=e.static;if("string"==typeof n[cn]&&"string"==typeof n[ln]){if(Object.keys(t.dynamic).length>0)return null;var r=t.static,i=Object.keys(r);if(i.length>0&&"number"==typeof r[i[0]]){for(var o=[],a=0;a<i.length;++a)T("number"==typeof r[i[a]],"must specify all vertex attribute locations when using vaos"),o.push([0|r[i[a]],i[a]]);return o}}return null}(e,t),y=function(e){var t=e.static,n=e.dynamic;if(sn in t){var r=t[sn];return r?(r=l.getFramebuffer(r),T.command(r,"invalid framebuffer object"),ir((function(e,t){var n=e.link(r),i=e.shared;t.set(i.framebuffer,".next",n);var o=i.context;return t.set(o,"."+vn,n+".width"),t.set(o,"."+yn,n+".height"),n}))):ir((function(e,t){var n=e.shared;t.set(n.framebuffer,".next","null");var r=n.context;return t.set(r,"."+vn,r+"."+Tn),t.set(r,"."+yn,r+"."+xn),"null"}))}if(sn in n){var i=n[sn];return or(i,(function(e,t){var n=e.invoke(t,i),r=e.shared,o=r.framebuffer,a=t.def(o,".getFramebuffer(",n,")");T.optional((function(){e.assert(t,"!"+n+"||"+a,"invalid framebuffer object")})),t.set(o,".next",a);var s=r.context;return t.set(s,"."+vn,a+"?"+a+".width:"+s+"."+Tn),t.set(s,"."+yn,a+"?"+a+".height:"+s+"."+xn),a}))}return null}(e),E=function(e,t,n){var r=e.static,i=e.dynamic;function o(e){if(e in r){var o=r[e];T.commandType(o,"object","invalid "+e,n.commandStr);var a,s,l=!0,c=0|o.x,u=0|o.y;return"width"in o?(a=0|o.width,T.command(a>=0,"invalid "+e,n.commandStr)):l=!1,"height"in o?(s=0|o.height,T.command(s>=0,"invalid "+e,n.commandStr)):l=!1,new nr(!l&&t&&t.thisDep,!l&&t&&t.contextDep,!l&&t&&t.propDep,(function(e,t){var n=e.shared.context,r=a;"width"in o||(r=t.def(n,".",vn,"-",c));var i=s;return"height"in o||(i=t.def(n,".",yn,"-",u)),[c,u,r,i]}))}if(e in i){var h=i[e],d=or(h,(function(t,n){var r=t.invoke(n,h);T.optional((function(){t.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+e)}));var i=t.shared.context,o=n.def(r,".x|0"),a=n.def(r,".y|0"),s=n.def('"width" in ',r,"?",r,".width|0:","(",i,".",vn,"-",o,")"),l=n.def('"height" in ',r,"?",r,".height|0:","(",i,".",yn,"-",a,")");return T.optional((function(){t.assert(n,s+">=0&&"+l+">=0","invalid "+e)})),[o,a,s,l]}));return t&&(d.thisDep=d.thisDep||t.thisDep,d.contextDep=d.contextDep||t.contextDep,d.propDep=d.propDep||t.propDep),d}return t?new nr(t.thisDep,t.contextDep,t.propDep,(function(e,t){var n=e.shared.context;return[0,0,t.def(n,".",vn),t.def(n,".",yn)]})):null}var a=o(on);if(a){var s=a;a=new nr(a.thisDep,a.contextDep,a.propDep,(function(e,t){var n=s.append(e,t),r=e.shared.context;return t.set(r,"."+En,n[2]),t.set(r,"."+An,n[3]),n}))}return{viewport:a,scissor_box:o(rn)}}(e,y,d),A=function(e,t){var n=e.static,r=e.dynamic,i=function(){if(un in n){var e=n[un];er(e)?e=a.getElements(a.create(e,!0)):e&&(e=a.getElements(e),T.command(e,"invalid elements",t.commandStr));var i=ir((function(t,n){if(e){var r=t.link(e);return t.ELEMENTS=r,r}return t.ELEMENTS=null,null}));return i.value=e,i}if(un in r){var o=r[un];return or(o,(function(e,t){var n=e.shared,r=n.isBufferArgs,i=n.elements,a=e.invoke(t,o),s=t.def("null"),l=t.def(r,"(",a,")"),c=e.cond(l).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return T.optional((function(){e.assert(c.else,"!"+a+"||"+s,"invalid elements")})),t.entry(c),t.exit(e.cond(l).then(i,".destroyStream(",s,");")),e.ELEMENTS=s,s}))}return null}();function o(e,o){if(e in n){var a=0|n[e];return T.command(!o||a>=0,"invalid "+e,t.commandStr),ir((function(e,t){return o&&(e.OFFSET=a),a}))}if(e in r){var s=r[e];return or(s,(function(t,n){var r=t.invoke(n,s);return o&&(t.OFFSET=r,T.optional((function(){t.assert(n,r+">=0","invalid "+e)}))),r}))}return o&&i?ir((function(e,t){return e.OFFSET="0",0})):null}var s=o(fn,!0);return{elements:i,primitive:function(){if(hn in n){var e=n[hn];return T.commandParameter(e,oe,"invalid primitve",t.commandStr),ir((function(t,n){return oe[e]}))}if(hn in r){var o=r[hn];return or(o,(function(e,t){var n=e.constants.primTypes,r=e.invoke(t,o);return T.optional((function(){e.assert(t,r+" in "+n,"invalid primitive, must be one of "+Object.keys(oe))})),t.def(n,"[",r,"]")}))}return i?rr(i)?i.value?ir((function(e,t){return t.def(e.ELEMENTS,".primType")})):ir((function(){return 4})):new nr(i.thisDep,i.contextDep,i.propDep,(function(e,t){var n=e.ELEMENTS;return t.def(n,"?",n,".primType:",4)})):null}(),count:function(){if(dn in n){var e=0|n[dn];return T.command("number"==typeof e&&e>=0,"invalid vertex count",t.commandStr),ir((function(){return e}))}if(dn in r){var o=r[dn];return or(o,(function(e,t){var n=e.invoke(t,o);return T.optional((function(){e.assert(t,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(i){if(rr(i)){if(i)return s?new nr(s.thisDep,s.contextDep,s.propDep,(function(e,t){var n=t.def(e.ELEMENTS,".vertCount-",e.OFFSET);return T.optional((function(){e.assert(t,n+">=0","invalid vertex offset/element buffer too small")})),n})):ir((function(e,t){return t.def(e.ELEMENTS,".vertCount")}));var a=ir((function(){return-1}));return T.optional((function(){a.MISSING=!0})),a}var l=new nr(i.thisDep||s.thisDep,i.contextDep||s.contextDep,i.propDep||s.propDep,(function(e,t){var n=e.ELEMENTS;return e.OFFSET?t.def(n,"?",n,".vertCount-",e.OFFSET,":-1"):t.def(n,"?",n,".vertCount:-1")}));return T.optional((function(){l.DYNAMIC=!0})),l}return null}(),instances:o(pn,!1),offset:s}}(e,d),x=function(e,t){var n=e.static,r=e.dynamic,o={};return b.forEach((function(e){var a=R(e);function s(t,i){if(e in n){var s=t(n[e]);o[a]=ir((function(){return s}))}else if(e in r){var l=r[e];o[a]=or(l,(function(e,t){return i(e,t,e.invoke(t,l))}))}}switch(e){case jt:case Pt:case wt:case Qt:case Ft:case nn:case Xt:case Yt:case qt:case Gt:return s((function(n){return T.commandType(n,"boolean",e,t.commandStr),n}),(function(t,n,r){return T.optional((function(){t.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+e,t.commandStr)})),r}));case Ut:return s((function(n){return T.commandParameter(n,Kn,"invalid "+e,t.commandStr),Kn[n]}),(function(t,n,r){var i=t.constants.compareFuncs;return T.optional((function(){t.assert(n,r+" in "+i,"invalid "+e+", must be one of "+Object.keys(Kn))})),n.def(i,"[",r,"]")}));case kt:return s((function(e){return T.command(fe(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]&&e[0]<=e[1],"depth range is 2d array",t.commandStr),e}),(function(e,t,n){return T.optional((function(){e.assert(t,e.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+'[0]==="number"&&typeof '+n+'[1]==="number"&&'+n+"[0]<="+n+"[1]","depth range must be a 2d array")})),[t.def("+",n,"[0]"),t.def("+",n,"[1]")]}));case Bt:return s((function(e){T.commandType(e,"object","blend.func",t.commandStr);var n="srcRGB"in e?e.srcRGB:e.src,r="srcAlpha"in e?e.srcAlpha:e.src,i="dstRGB"in e?e.dstRGB:e.dst,o="dstAlpha"in e?e.dstAlpha:e.dst;return T.commandParameter(n,Yn,a+".srcRGB",t.commandStr),T.commandParameter(r,Yn,a+".srcAlpha",t.commandStr),T.commandParameter(i,Yn,a+".dstRGB",t.commandStr),T.commandParameter(o,Yn,a+".dstAlpha",t.commandStr),T.command(-1===qn.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",t.commandStr),[Yn[n],Yn[i],Yn[r],Yn[o]]}),(function(t,n,r){var i=t.constants.blendFuncs;function o(o,a){var s=n.def('"',o,a,'" in ',r,"?",r,".",o,a,":",r,".",o);return T.optional((function(){t.assert(n,s+" in "+i,"invalid "+e+"."+o+a+", must be one of "+Object.keys(Yn))})),s}T.optional((function(){t.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")}));var a=o("src","RGB"),s=o("dst","RGB");T.optional((function(){var e=t.constants.invalidBlendCombinations;t.assert(n,e+".indexOf("+a+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var l=n.def(i,"[",a,"]"),c=n.def(i,"[",o("src","Alpha"),"]");return[l,n.def(i,"[",s,"]"),c,n.def(i,"[",o("dst","Alpha"),"]")]}));case Dt:return s((function(n){return"string"==typeof n?(T.commandParameter(n,_,"invalid "+e,t.commandStr),[_[n],_[n]]):"object"==typeof n?(T.commandParameter(n.rgb,_,e+".rgb",t.commandStr),T.commandParameter(n.alpha,_,e+".alpha",t.commandStr),[_[n.rgb],_[n.alpha]]):void T.commandRaise("invalid blend.equation",t.commandStr)}),(function(t,n,r){var i=t.constants.blendEquations,o=n.def(),a=n.def(),s=t.cond("typeof ",r,'==="string"');return T.optional((function(){function n(e,n,r){t.assert(e,r+" in "+i,"invalid "+n+", must be one of "+Object.keys(_))}n(s.then,e,r),t.assert(s.else,r+"&&typeof "+r+'==="object"',"invalid "+e),n(s.else,e+".rgb",r+".rgb"),n(s.else,e+".alpha",r+".alpha")})),s.then(o,"=",a,"=",i,"[",r,"];"),s.else(o,"=",i,"[",r,".rgb];",a,"=",i,"[",r,".alpha];"),n(s),[o,a]}));case Nt:return s((function(e){return T.command(fe(e)&&4===e.length,"blend.color must be a 4d array",t.commandStr),D(4,(function(t){return+e[t]}))}),(function(e,t,n){return T.optional((function(){e.assert(t,e.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),D(4,(function(e){return t.def("+",n,"[",e,"]")}))}));case $t:return s((function(e){return T.commandType(e,"number",a,t.commandStr),0|e}),(function(e,t,n){return T.optional((function(){e.assert(t,"typeof "+n+'==="number"',"invalid stencil.mask")})),t.def(n,"|0")}));case Jt:return s((function(n){T.commandType(n,"object",a,t.commandStr);var r=n.cmp||"keep",i=n.ref||0,o="mask"in n?n.mask:-1;return T.commandParameter(r,Kn,e+".cmp",t.commandStr),T.commandType(i,"number",e+".ref",t.commandStr),T.commandType(o,"number",e+".mask",t.commandStr),[Kn[r],i,o]}),(function(e,t,n){var r=e.constants.compareFuncs;return T.optional((function(){function i(){e.assert(t,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(n+"&&typeof ",n,'==="object"'),i('!("cmp" in ',n,")||(",n,".cmp in ",r,")")})),[t.def('"cmp" in ',n,"?",r,"[",n,".cmp]",":",Zn),t.def(n,".ref|0"),t.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case en:case tn:return s((function(n){T.commandType(n,"object",a,t.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",o=n.zpass||"keep";return T.commandParameter(r,Qn,e+".fail",t.commandStr),T.commandParameter(i,Qn,e+".zfail",t.commandStr),T.commandParameter(o,Qn,e+".zpass",t.commandStr),[e===tn?Wn:Hn,Qn[r],Qn[i],Qn[o]]}),(function(t,n,r){var i=t.constants.stencilOps;function o(o){return T.optional((function(){t.assert(n,'!("'+o+'" in '+r+")||("+r+"."+o+" in "+i+")","invalid "+e+"."+o+", must be one of "+Object.keys(Qn))})),n.def('"',o,'" in ',r,"?",i,"[",r,".",o,"]:",Zn)}return T.optional((function(){t.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+e)})),[e===tn?Wn:Hn,o("fail"),o("zfail"),o("zpass")]}));case Zt:return s((function(e){T.commandType(e,"object",a,t.commandStr);var n=0|e.factor,r=0|e.units;return T.commandType(n,"number",a+".factor",t.commandStr),T.commandType(r,"number",a+".units",t.commandStr),[n,r]}),(function(t,n,r){return T.optional((function(){t.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+e)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case Vt:return s((function(e){var n=0;return"front"===e?n=Hn:"back"===e&&(n=Wn),T.command(!!n,a,t.commandStr),n}),(function(e,t,n){return T.optional((function(){e.assert(t,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),t.def(n,'==="front"?',Hn,":",Wn)}));case Wt:return s((function(e){return T.command("number"==typeof e&&e>=i.lineWidthDims[0]&&e<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],t.commandStr),e}),(function(e,t,n){return T.optional((function(){e.assert(t,"typeof "+n+'==="number"&&'+n+">="+i.lineWidthDims[0]+"&&"+n+"<="+i.lineWidthDims[1],"invalid line width")})),n}));case Ht:return s((function(e){return T.commandParameter(e,Jn,a,t.commandStr),Jn[e]}),(function(e,t,n){return T.optional((function(){e.assert(t,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),t.def(n+'==="cw"?2304:'+Xn)}));case zt:return s((function(e){return T.command(fe(e)&&4===e.length,"color.mask must be length 4 array",t.commandStr),e.map((function(e){return!!e}))}),(function(e,t,n){return T.optional((function(){e.assert(t,e.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),D(4,(function(e){return"!!"+n+"["+e+"]"}))}));case Kt:return s((function(e){T.command("object"==typeof e&&e,a,t.commandStr);var n="value"in e?e.value:1,r=!!e.invert;return T.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",t.commandStr),[n,r]}),(function(e,t,n){return T.optional((function(){e.assert(t,n+"&&typeof "+n+'==="object"',"invalid sample.coverage")})),[t.def('"value" in ',n,"?+",n,".value:1"),t.def("!!",n,".invert")]}))}})),o}(e,d),S=function(e,t,r){var i=e.static,o=e.dynamic;function a(e){if(e in i){var t=n.id(i[e]);T.optional((function(){h.shader($n[e],t,T.guessCommand())}));var r=ir((function(){return t}));return r.id=t,r}if(e in o){var a=o[e];return or(a,(function(t,n){var r=t.invoke(n,a),i=n.def(t.shared.strings,".id(",r,")");return T.optional((function(){n(t.shared.shader,".shader(",$n[e],",",i,",",t.command,");")})),i}))}return null}var s,l=a(cn),c=a(ln),u=null;return rr(l)&&rr(c)?(u=h.program(c.id,l.id,null,r),s=ir((function(e,t){return e.link(u)}))):s=new nr(l&&l.thisDep||c&&c.thisDep,l&&l.contextDep||c&&c.contextDep,l&&l.propDep||c&&c.propDep,(function(e,t){var n,r=e.shared.shader;n=l?l.append(e,t):t.def(r,".",cn);var i=r+".program("+(c?c.append(e,t):t.def(r,".",ln))+","+n;return T.optional((function(){i+=","+e.command})),t.def(i+")")})),{frag:l,vert:c,progVar:s,program:u}}(e,0,g);function C(e){var t=E[e];t&&(x[e]=t)}C(on),C(R(rn));var L=Object.keys(x).length>0,O={framebuffer:y,draw:A,shader:S,state:x,dirty:L,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(O.profile=function(e){var t,n=e.static,r=e.dynamic;if(an in n){var i=!!n[an];(t=ir((function(e,t){return i}))).enable=i}else if(an in r){var o=r[an];t=or(o,(function(e,t){return e.invoke(t,o)}))}return t}(e),O.uniforms=function(e,t){var n=e.static,r=e.dynamic,i={};return Object.keys(n).forEach((function(e){var r,o=n[e];if("number"==typeof o||"boolean"==typeof o)r=ir((function(){return o}));else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?r=ir((function(e){return e.link(o)})):"framebuffer"===a||"framebufferCube"===a?(T.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+e+'"',t.commandStr),r=ir((function(e){return e.link(o.color[0])}))):T.commandRaise('invalid data for uniform "'+e+'"',t.commandStr)}else fe(o)?r=ir((function(t){return t.global.def("[",D(o.length,(function(n){return T.command("number"==typeof o[n]||"boolean"==typeof o[n],"invalid uniform "+e,t.commandStr),o[n]})),"]")})):T.commandRaise('invalid or missing data for uniform "'+e+'"',t.commandStr);r.value=o,i[e]=r})),Object.keys(r).forEach((function(e){var t=r[e];i[e]=or(t,(function(e,n){return e.invoke(n,t)}))})),i}(s,d),O.drawVAO=O.scopeVAO=function(e){var t=e.static,n=e.dynamic;if(gn in t){var r=t[gn];return null!==r&&null===u.getVAO(r)&&(r=u.createVAO(r)),ir((function(e){return e.link(u.getVAO(r))}))}if(gn in n){var i=n[gn];return or(i,(function(e,t){var n=e.invoke(t,i);return t.def(e.shared.vao+".getVAO("+n+")")}))}return null}(e),!O.drawVAO&&S.program&&!g&&r.angle_instanced_arrays){var M=!0,I=S.program.attributes.map((function(e){var n=t.static[e];return M=M&&!!n,n}));if(M&&I.length>0){var w=u.getVAO(u.createVAO(I));O.drawVAO=new nr(null,null,null,(function(e,t){return e.link(w)})),O.useVAO=!0}}return g?O.useVAO=!0:O.attributes=function(e,t){var r=e.static,i=e.dynamic,a={};return Object.keys(r).forEach((function(e){var i=r[e],s=n.id(e),l=new m;if(er(i))l.state=1,l.buffer=o.getBuffer(o.create(i,Rn,!1,!0)),l.type=0;else{var c=o.getBuffer(i);if(c)l.state=1,l.buffer=c,l.type=0;else if(T.command("object"==typeof i&&i,"invalid data for attribute "+e,t.commandStr),"constant"in i){var u=i.constant;l.buffer="null",l.state=2,"number"==typeof u?l.x=u:(T.command(fe(u)&&u.length>0&&u.length<=4,"invalid constant for attribute "+e,t.commandStr),It.forEach((function(e,t){t<u.length&&(l[e]=u[t])})))}else{c=er(i.buffer)?o.getBuffer(o.create(i.buffer,Rn,!1,!0)):o.getBuffer(i.buffer),T.command(!!c,'missing buffer for attribute "'+e+'"',t.commandStr);var h=0|i.offset;T.command(h>=0,'invalid offset for attribute "'+e+'"',t.commandStr);var d=0|i.stride;T.command(d>=0&&d<256,'invalid stride for attribute "'+e+'", must be integer betweeen [0, 255]',t.commandStr);var f=0|i.size;T.command(!("size"in i)||f>0&&f<=4,'invalid size for attribute "'+e+'", must be 1,2,3,4',t.commandStr);var p=!!i.normalized,g=0;"type"in i&&(T.commandParameter(i.type,q,"invalid type for attribute "+e,t.commandStr),g=q[i.type]);var _=0|i.divisor;"divisor"in i&&(T.command(0===_||v,'cannot specify divisor for attribute "'+e+'", instancing not supported',t.commandStr),T.command(_>=0,'invalid divisor for attribute "'+e+'"',t.commandStr)),T.optional((function(){var n=t.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach((function(t){T.command(r.indexOf(t)>=0,'unknown parameter "'+t+'" for attribute pointer "'+e+'" (valid parameters are '+r+")",n)}))})),l.buffer=c,l.state=1,l.size=f,l.normalized=p,l.type=g||c.dtype,l.offset=h,l.stride=d,l.divisor=_}}a[e]=ir((function(e,t){var n=e.attribCache;if(s in n)return n[s];var r={isStream:!1};return Object.keys(l).forEach((function(e){r[e]=l[e]})),l.buffer&&(r.buffer=e.link(l.buffer),r.type=r.type||r.buffer+".dtype"),n[s]=r,r}))})),Object.keys(i).forEach((function(e){var t=i[e];a[e]=or(t,(function(n,r){var i=n.invoke(r,t),o=n.shared,a=n.constants,s=o.isBufferArgs,l=o.buffer;T.optional((function(){n.assert(r,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+s+"("+i+")||"+l+".getBuffer("+i+")||"+l+".getBuffer("+i+".buffer)||"+s+"("+i+'.buffer)||("constant" in '+i+"&&(typeof "+i+'.constant==="number"||'+o.isArrayLike+"("+i+".constant))))",'invalid dynamic attribute "'+e+'"')}));var c={isStream:r.def(!1)},u=new m;u.state=1,Object.keys(u).forEach((function(e){c[e]=r.def(""+u[e])}));var h=c.buffer,d=c.type;function f(e){r(c[e],"=",i,".",e,"|0;")}return r("if(",s,"(",i,")){",c.isStream,"=true;",h,"=",l,".createStream(",Rn,",",i,");",d,"=",h,".dtype;","}else{",h,"=",l,".getBuffer(",i,");","if(",h,"){",d,"=",h,".dtype;",'}else if("constant" in ',i,"){",c.state,"=",2,";","if(typeof "+i+'.constant === "number"){',c[It[0]],"=",i,".constant;",It.slice(1).map((function(e){return c[e]})).join("="),"=0;","}else{",It.map((function(e,t){return c[e]+"="+i+".constant.length>"+t+"?"+i+".constant["+t+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",h,"=",l,".createStream(",Rn,",",i,".buffer);","}else{",h,"=",l,".getBuffer(",i,".buffer);","}",d,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",h,".dtype;",c.normalized,"=!!",i,".normalized;"),f("size"),f("offset"),f("stride"),f("divisor"),r("}}"),r.exit("if(",c.isStream,"){",l,".destroyStream(",h,");","}"),c}))})),a}(t,d),O.context=function(e){var t=e.static,n=e.dynamic,r={};return Object.keys(t).forEach((function(e){var n=t[e];r[e]=ir((function(e,t){return"number"==typeof n||"boolean"==typeof n?""+n:e.link(n)}))})),Object.keys(n).forEach((function(e){var t=n[e];r[e]=or(t,(function(e,n){return e.invoke(n,t)}))})),r}(c),O}function B(e,t,n){var r=e.shared.context,i=e.scope();Object.keys(n).forEach((function(o){t.save(r,"."+o);var a=n[o];i(r,".",o,"=",a.append(e,t),";")})),t(i)}function F(e,t,n,r){var i,o=e.shared,a=o.gl,s=o.framebuffer;y&&(i=t.def(o.extensions,".webgl_draw_buffers"));var l,c=e.constants,u=c.drawBuffer,h=c.backBuffer;l=n?n.append(e,t):t.def(s,".next"),r||t("if(",l,"!==",s,".cur){"),t("if(",l,"){",a,".bindFramebuffer(",36160,",",l,".framebuffer);"),y&&t(i,".drawBuffersWEBGL(",u,"[",l,".colorAttachments.length]);"),t("}else{",a,".bindFramebuffer(",36160,",null);"),y&&t(i,".drawBuffersWEBGL(",h,");"),t("}",s,".cur=",l,";"),r||t("}")}function U(e,t,n){var r=e.shared,i=r.gl,o=e.current,a=e.next,s=r.current,l=r.next,c=e.cond(s,".dirty");b.forEach((function(t){var r,u,h=R(t);if(!(h in n.state))if(h in a){r=a[h],u=o[h];var d=D(E[h].length,(function(e){return c.def(r,"[",e,"]")}));c(e.cond(d.map((function(e,t){return e+"!=="+u+"["+t+"]"})).join("||")).then(i,".",S[h],"(",d,");",d.map((function(e,t){return u+"["+t+"]="+e})).join(";"),";"))}else{r=c.def(l,".",h);var f=e.cond(r,"!==",s,".",h);c(f),h in x?f(e.cond(r).then(i,".enable(",x[h],");").else(i,".disable(",x[h],");"),s,".",h,"=",r,";"):f(i,".",S[h],"(",r,");",s,".",h,"=",r,";")}})),0===Object.keys(n.state).length&&c(s,".dirty=false;"),t(c)}function k(e,t,n,r){var i=e.shared,o=e.current,a=i.current,s=i.gl;tr(Object.keys(n)).forEach((function(i){var l=n[i];if(!r||r(l)){var c=l.append(e,t);if(x[i]){var u=x[i];rr(l)?t(s,c?".enable(":".disable(",u,");"):t(e.cond(c).then(s,".enable(",u,");").else(s,".disable(",u,");")),t(a,".",i,"=",c,";")}else if(fe(c)){var h=o[i];t(s,".",S[i],"(",c,");",c.map((function(e,t){return h+"["+t+"]="+e})).join(";"),";")}else t(s,".",S[i],"(",c,");",a,".",i,"=",c,";")}}))}function G(e,t){v&&(e.instancing=t.def(e.shared.extensions,".angle_instanced_arrays"))}function z(e,t,n,r,i){var o,a,s,l=e.shared,c=e.stats,u=l.current,h=l.timer,d=n.profile;function f(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function g(e){e(o=t.def(),"=",f(),";"),"string"==typeof i?e(c,".count+=",i,";"):e(c,".count++;"),p&&(r?e(a=t.def(),"=",h,".getNumPendingQueries();"):e(h,".beginQuery(",c,");"))}function m(e){e(c,".cpuTime+=",f(),"-",o,";"),p&&(r?e(h,".pushScopeStats(",a,",",h,".getNumPendingQueries(),",c,");"):e(h,".endQuery();"))}function _(e){var n=t.def(u,".profile");t(u,".profile=",e,";"),t.exit(u,".profile=",n,";")}if(d){if(rr(d))return void(d.enable?(g(t),m(t.exit),_("true")):_("false"));_(s=d.append(e,t))}else s=t.def(u,".profile");var v=e.block();g(v),t("if(",s,"){",v,"}");var y=e.block();m(y),t.exit("if(",s,"){",y,"}")}function j(e,t,n,r,i){var o=e.shared;r.forEach((function(r){var a,s=r.name,l=n.attributes[s];if(l){if(!i(l))return;a=l.append(e,t)}else{if(!i(ar))return;var c=e.scopeAttrib(s);T.optional((function(){e.assert(t,c+".state","missing attribute "+s)})),a={},Object.keys(new m).forEach((function(e){a[e]=t.def(c,".",e)}))}!function(n,r,i){var a=o.gl,s=t.def(n,".location"),l=t.def(o.attributes,"[",s,"]"),c=i.state,u=i.buffer,h=[i.x,i.y,i.z,i.w],d=["buffer","normalized","offset","stride"];function f(){t("if(!",l,".buffer){",a,".enableVertexAttribArray(",s,");}");var n,o=i.type;if(n=i.size?t.def(i.size,"||",r):r,t("if(",l,".type!==",o,"||",l,".size!==",n,"||",d.map((function(e){return l+"."+e+"!=="+i[e]})).join("||"),"){",a,".bindBuffer(",Rn,",",u,".buffer);",a,".vertexAttribPointer(",[s,n,o,i.normalized,i.stride,i.offset],");",l,".type=",o,";",l,".size=",n,";",d.map((function(e){return l+"."+e+"="+i[e]+";"})).join(""),"}"),v){var c=i.divisor;t("if(",l,".divisor!==",c,"){",e.instancing,".vertexAttribDivisorANGLE(",[s,c],");",l,".divisor=",c,";}")}}function p(){t("if(",l,".buffer){",a,".disableVertexAttribArray(",s,");",l,".buffer=null;","}if(",It.map((function(e,t){return l+"."+e+"!=="+h[t]})).join("||"),"){",a,".vertexAttrib4f(",s,",",h,");",It.map((function(e,t){return l+"."+e+"="+h[t]+";"})).join(""),"}")}1===c?f():2===c?p():(t("if(",c,"===",1,"){"),f(),t("}else{"),p(),t("}"))}(e.link(r),function(e){switch(e){case Ln:case wn:case Bn:return 2;case On:case Pn:case Fn:return 3;case Mn:case Nn:case Un:return 4;default:return 1}}(r.info.type),a)}))}function V(e,t,r,i,o){for(var a,s=e.shared,l=s.gl,c=0;c<i.length;++c){var u,h=i[c],d=h.name,f=h.info.type,p=r.uniforms[d],g=e.link(h)+".location";if(p){if(!o(p))continue;if(rr(p)){var m=p.value;if(T.command(null!=m,'missing uniform "'+d+'"',e.commandStr),f===jn||f===Vn){T.command("function"==typeof m&&(f===jn&&("texture2d"===m._reglType||"framebuffer"===m._reglType)||f===Vn&&("textureCube"===m._reglType||"framebufferCube"===m._reglType)),"invalid texture for uniform "+d,e.commandStr);var _=e.link(m._texture||m.color[0]._texture);t(l,".uniform1i(",g,",",_+".bind());"),t.exit(_,".unbind();")}else if(f===kn||f===Gn||f===zn){T.optional((function(){T.command(fe(m),"invalid matrix for uniform "+d,e.commandStr),T.command(f===kn&&4===m.length||f===Gn&&9===m.length||f===zn&&16===m.length,"invalid length for matrix uniform "+d,e.commandStr)}));var v=e.global.def("new Float32Array(["+Array.prototype.slice.call(m)+"])"),y=2;f===Gn?y=3:f===zn&&(y=4),t(l,".uniformMatrix",y,"fv(",g,",false,",v,");")}else{switch(f){case Cn:T.commandType(m,"number","uniform "+d,e.commandStr),a="1f";break;case Ln:T.command(fe(m)&&2===m.length,"uniform "+d,e.commandStr),a="2f";break;case On:T.command(fe(m)&&3===m.length,"uniform "+d,e.commandStr),a="3f";break;case Mn:T.command(fe(m)&&4===m.length,"uniform "+d,e.commandStr),a="4f";break;case Dn:T.commandType(m,"boolean","uniform "+d,e.commandStr),a="1i";break;case In:T.commandType(m,"number","uniform "+d,e.commandStr),a="1i";break;case Bn:case wn:T.command(fe(m)&&2===m.length,"uniform "+d,e.commandStr),a="2i";break;case Fn:case Pn:T.command(fe(m)&&3===m.length,"uniform "+d,e.commandStr),a="3i";break;case Un:case Nn:T.command(fe(m)&&4===m.length,"uniform "+d,e.commandStr),a="4i"}t(l,".uniform",a,"(",g,",",fe(m)?Array.prototype.slice.call(m):m,");")}continue}u=p.append(e,t)}else{if(!o(ar))continue;u=t.def(s.uniforms,"[",n.id(d),"]")}f===jn?t("if(",u,"&&",u,'._reglType==="framebuffer"){',u,"=",u,".color[0];","}"):f===Vn&&t("if(",u,"&&",u,'._reglType==="framebufferCube"){',u,"=",u,".color[0];","}"),T.optional((function(){function n(n,r){e.assert(t,n,'bad data or missing for uniform "'+d+'". '+r)}function r(e){n("typeof "+u+'==="'+e+'"',"invalid type, expected "+e)}function i(t,r){n(s.isArrayLike+"("+u+")&&"+u+".length==="+t,"invalid vector, should have length "+t,e.commandStr)}function o(t){n("typeof "+u+'==="function"&&'+u+'._reglType==="texture'+(3553===t?"2d":"Cube")+'"',"invalid texture type",e.commandStr)}switch(f){case In:r("number");break;case wn:i(2);break;case Pn:i(3);break;case Nn:i(4);break;case Cn:r("number");break;case Ln:i(2);break;case On:i(3);break;case Mn:i(4);break;case Dn:r("boolean");break;case Bn:i(2);break;case Fn:i(3);break;case Un:case kn:i(4);break;case Gn:i(9);break;case zn:i(16);break;case jn:o(3553);break;case Vn:o(34067)}}));var E=1;switch(f){case jn:case Vn:var A=t.def(u,"._texture");t(l,".uniform1i(",g,",",A,".bind());"),t.exit(A,".unbind();");continue;case In:case Dn:a="1i";break;case wn:case Bn:a="2i",E=2;break;case Pn:case Fn:a="3i",E=3;break;case Nn:case Un:a="4i",E=4;break;case Cn:a="1f";break;case Ln:a="2f",E=2;break;case On:a="3f",E=3;break;case Mn:a="4f",E=4;break;case kn:a="Matrix2fv";break;case Gn:a="Matrix3fv";break;case zn:a="Matrix4fv"}if(t(l,".uniform",a,"(",g,","),"M"===a.charAt(0)){var b=Math.pow(f-kn+2,2),x=e.global.def("new Float32Array(",b,")");t("false,(Array.isArray(",u,")||",u," instanceof Float32Array)?",u,":(",D(b,(function(e){return x+"["+e+"]="+u+"["+e+"]"})),",",x,")")}else t(E>1?D(E,(function(e){return u+"["+e+"]"})):u);t(");")}}function H(e,t,n,r){var i=e.shared,o=i.gl,a=i.draw,s=r.draw;var l=function(){var i,l=s.elements,c=t;return l?((l.contextDep&&r.contextDynamic||l.propDep)&&(c=n),i=l.append(e,c)):i=c.def(a,".",un),i&&c("if("+i+")"+o+".bindBuffer(34963,"+i+".buffer.buffer);"),i}();function c(i){var o=s[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(e,n):o.append(e,t):t.def(a,".",i)}var u,h,d=c(hn),f=c(fn),p=function(){var i,o=s.count,l=t;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(l=n),i=o.append(e,l),T.optional((function(){o.MISSING&&e.assert(t,"false","missing vertex count"),o.DYNAMIC&&e.assert(l,i+">=0","missing vertex count")}))):(i=l.def(a,".",dn),T.optional((function(){e.assert(l,i+">=0","missing vertex count")}))),i}();if("number"==typeof p){if(0===p)return}else n("if(",p,"){"),n.exit("}");v&&(u=c(pn),h=e.instancing);var g=l+".type",m=s.elements&&rr(s.elements);function _(){function e(){n(h,".drawElementsInstancedANGLE(",[d,p,g,f+"<<(("+g+"-5121)>>1)",u],");")}function t(){n(h,".drawArraysInstancedANGLE(",[d,f,p,u],");")}l?m?e():(n("if(",l,"){"),e(),n("}else{"),t(),n("}")):t()}function y(){function e(){n(o+".drawElements("+[d,p,g,f+"<<(("+g+"-5121)>>1)"]+");")}function t(){n(o+".drawArrays("+[d,f,p]+");")}l?m?e():(n("if(",l,"){"),e(),n("}else{"),t(),n("}")):t()}v&&("number"!=typeof u||u>=0)?"string"==typeof u?(n("if(",u,">0){"),_(),n("}else if(",u,"<0){"),y(),n("}")):_():y()}function W(e,t,n,r,i){var o=P(),a=o.proc("body",i);return T.optional((function(){o.commandStr=t.commandStr,o.command=o.link(t.commandStr)})),v&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),e(o,a,n,r),o.compile().body}function X(e,t,n,r){G(e,t),n.useVAO?n.drawVAO?t(e.shared.vao,".setVAO(",n.drawVAO.append(e,t),");"):t(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(t(e.shared.vao,".setVAO(null);"),j(e,t,n,r.attributes,(function(){return!0}))),V(e,t,n,r.uniforms,(function(){return!0})),H(e,t,t,n)}function Z(e,t,n,r){function i(){return!0}e.batchId="a1",G(e,t),j(e,t,n,r.attributes,i),V(e,t,n,r.uniforms,i),H(e,t,t,n)}function Y(e,t,n,r){G(e,t);var i=n.contextDep,o=t.def(),a=t.def();e.shared.props=a,e.batchId=o;var s=e.scope(),l=e.scope();function c(e){return e.contextDep&&i||e.propDep}function u(e){return!c(e)}if(t(s.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",l,"}",s.exit),n.needsContext&&B(e,l,n.context),n.needsFramebuffer&&F(e,l,n.framebuffer),k(e,l,n.state,c),n.profile&&c(n.profile)&&z(e,l,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?l(e.shared.vao,".setVAO(",n.drawVAO.append(e,l),");"):s(e.shared.vao,".setVAO(",n.drawVAO.append(e,s),");"):s(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(s(e.shared.vao,".setVAO(null);"),j(e,s,n,r.attributes,u),j(e,l,n,r.attributes,c)),V(e,s,n,r.uniforms,u),V(e,l,n,r.uniforms,c),H(e,s,l,n);else{var h=e.global.def("{}"),d=n.shader.progVar.append(e,l),f=l.def(d,".id"),p=l.def(h,"[",f,"]");l(e.shared.gl,".useProgram(",d,".program);","if(!",p,"){",p,"=",h,"[",f,"]=",e.link((function(t){return W(Z,e,n,t,2)})),"(",d,");}",p,".call(this,a0[",o,"],",o,");")}}function K(e,t,n){var r=t.static[n];if(r&&function(e){if("object"==typeof e&&!fe(e)){for(var t=Object.keys(e),n=0;n<t.length;++n)if(O.isDynamic(e[t[n]]))return!0;return!1}}(r)){var i=e.global,o=Object.keys(r),a=!1,s=!1,l=!1,c=e.global.def("{}");o.forEach((function(t){var n=r[t];if(O.isDynamic(n)){"function"==typeof n&&(n=r[t]=O.unbox(n));var o=or(n,null);a=a||o.thisDep,l=l||o.propDep,s=s||o.contextDep}else{switch(i(c,".",t,"="),typeof n){case"number":i(n);break;case"string":i('"',n,'"');break;case"object":Array.isArray(n)&&i("[",n.join(),"]");break;default:i(e.link(n))}i(";")}})),t.dynamic[n]=new O.DynamicVariable(4,{thisDep:a,contextDep:s,propDep:l,ref:c,append:function(e,t){o.forEach((function(n){var i=r[n];if(O.isDynamic(i)){var o=e.invoke(t,i);t(c,".",n,"=",o,";")}}))}}),delete t.static[n]}}return{next:A,current:E,procs:function(){var e=P(),t=e.proc("poll"),n=e.proc("refresh"),o=e.block();t(o),n(o);var a,s=e.shared,l=s.gl,c=s.next,u=s.current;o(u,".dirty=false;"),F(e,t),F(e,n,null,!0),v&&(a=e.link(v)),r.oes_vertex_array_object&&n(e.link(r.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var h=0;h<i.maxAttributes;++h){var d=n.def(s.attributes,"[",h,"]"),f=e.cond(d,".buffer");f.then(l,".enableVertexAttribArray(",h,");",l,".bindBuffer(",Rn,",",d,".buffer.buffer);",l,".vertexAttribPointer(",h,",",d,".size,",d,".type,",d,".normalized,",d,".stride,",d,".offset);").else(l,".disableVertexAttribArray(",h,");",l,".vertexAttrib4f(",h,",",d,".x,",d,".y,",d,".z,",d,".w);",d,".buffer=null;"),n(f),v&&n(a,".vertexAttribDivisorANGLE(",h,",",d,".divisor);")}return n(e.shared.vao,".currentVAO=null;",e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"),Object.keys(x).forEach((function(r){var i=x[r],a=o.def(c,".",r),s=e.block();s("if(",a,"){",l,".enable(",i,")}else{",l,".disable(",i,")}",u,".",r,"=",a,";"),n(s),t("if(",a,"!==",u,".",r,"){",s,"}")})),Object.keys(S).forEach((function(r){var i,a,s=S[r],h=E[r],d=e.block();if(d(l,".",s,"("),fe(h)){var f=h.length;i=e.global.def(c,".",r),a=e.global.def(u,".",r),d(D(f,(function(e){return i+"["+e+"]"})),");",D(f,(function(e){return a+"["+e+"]="+i+"["+e+"];"})).join("")),t("if(",D(f,(function(e){return i+"["+e+"]!=="+a+"["+e+"]"})).join("||"),"){",d,"}")}else i=o.def(c,".",r),a=o.def(u,".",r),d(i,");",u,".",r,"=",i,";"),t("if(",i,"!==",a,"){",d,"}");n(d)})),e.compile()}(),compile:function(e,t,r,i,o){var a=P();a.stats=a.link(o),Object.keys(t.static).forEach((function(e){K(a,t,e)})),Sn.forEach((function(t){K(a,e,t)}));var s=N(e,t,r,i,a);return function(e,t){var n=e.proc("draw",1);G(e,n),B(e,n,t.context),F(e,n,t.framebuffer),U(e,n,t),k(e,n,t.state),z(e,n,t,!1,!0);var r=t.shader.progVar.append(e,n);if(n(e.shared.gl,".useProgram(",r,".program);"),t.shader.program)X(e,n,t,t.shader.program);else{n(e.shared.vao,".setVAO(null);");var i=e.global.def("{}"),o=n.def(r,".id"),a=n.def(i,"[",o,"]");n(e.cond(a).then(a,".call(this,a0);").else(a,"=",i,"[",o,"]=",e.link((function(n){return W(X,e,t,n,1)})),"(",r,");",a,".call(this,a0);"))}Object.keys(t.state).length>0&&n(e.shared.current,".dirty=true;")}(a,s),function(e,t){var r=e.proc("scope",3);e.batchId="a2";var i=e.shared,o=i.current;function a(n){var o=t.shader[n];o&&r.set(i.shader,"."+n,o.append(e,r))}B(e,r,t.context),t.framebuffer&&t.framebuffer.append(e,r),tr(Object.keys(t.state)).forEach((function(n){var o=t.state[n].append(e,r);fe(o)?o.forEach((function(t,i){r.set(e.next[n],"["+i+"]",t)})):r.set(i.next,"."+n,o)})),z(e,r,t,!0,!0),[un,fn,dn,pn,hn].forEach((function(n){var o=t.draw[n];o&&r.set(i.draw,"."+n,""+o.append(e,r))})),Object.keys(t.uniforms).forEach((function(o){r.set(i.uniforms,"["+n.id(o)+"]",t.uniforms[o].append(e,r))})),Object.keys(t.attributes).forEach((function(n){var i=t.attributes[n].append(e,r),o=e.scopeAttrib(n);Object.keys(new m).forEach((function(e){r.set(o,"."+e,i[e])}))})),t.scopeVAO&&r.set(i.vao,".targetVAO",t.scopeVAO.append(e,r)),a(ln),a(cn),Object.keys(t.state).length>0&&(r(o,".dirty=true;"),r.exit(o,".dirty=true;")),r("a1(",e.shared.context,",a0,",e.batchId,");")}(a,s),function(e,t){var n=e.proc("batch",2);e.batchId="0",G(e,n);var r=!1,i=!0;Object.keys(t.context).forEach((function(e){r=r||t.context[e].propDep})),r||(B(e,n,t.context),i=!1);var o=t.framebuffer,a=!1;function s(e){return e.contextDep&&r||e.propDep}o?(o.propDep?r=a=!0:o.contextDep&&r&&(a=!0),a||F(e,n,o)):F(e,n,null),t.state.viewport&&t.state.viewport.propDep&&(r=!0),U(e,n,t),k(e,n,t.state,(function(e){return!s(e)})),t.profile&&s(t.profile)||z(e,n,t,!1,"a1"),t.contextDep=r,t.needsContext=i,t.needsFramebuffer=a;var l=t.shader.progVar;if(l.contextDep&&r||l.propDep)Y(e,n,t,null);else{var c=l.append(e,n);if(n(e.shared.gl,".useProgram(",c,".program);"),t.shader.program)Y(e,n,t,t.shader.program);else{n(e.shared.vao,".setVAO(null);");var u=e.global.def("{}"),h=n.def(c,".id"),d=n.def(u,"[",h,"]");n(e.cond(d).then(d,".call(this,a0,a1);").else(d,"=",u,"[",h,"]=",e.link((function(n){return W(Y,e,t,n,2)})),"(",c,");",d,".call(this,a0,a1);"))}}Object.keys(t.state).length>0&&n(e.shared.current,".dirty=true;")}(a,s),a.compile()}}}var lr=function(e,t){if(!t.ext_disjoint_timer_query)return null;var n=[];function r(e){n.push(e)}var i=[];function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[];function s(e){a.push(e)}var l=[];function c(e,t,n){var r=a.pop()||new o;r.startQueryIndex=e,r.endQueryIndex=t,r.sum=0,r.stats=n,l.push(r)}var u=[],h=[];return{beginQuery:function(e){var r=n.pop()||t.ext_disjoint_timer_query.createQueryEXT();t.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),c(i.length-1,i.length,e)},endQuery:function(){t.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var e,n,o=i.length;if(0!==o){h.length=Math.max(h.length,o+1),u.length=Math.max(u.length,o+1),u[0]=0,h[0]=0;var a=0;for(e=0,n=0;n<i.length;++n){var c=i[n];t.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(a+=t.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),r(c)):i[e++]=c,u[n+1]=a,h[n+1]=e}for(i.length=e,e=0,n=0;n<l.length;++n){var d=l[n],f=d.startQueryIndex,p=d.endQueryIndex;d.sum+=u[p]-u[f];var g=h[f],m=h[p];m===g?(d.stats.gpuTime+=d.sum/1e6,s(d)):(d.startQueryIndex=g,d.endQueryIndex=m,l[e++]=d)}l.length=e}},getNumPendingQueries:function(){return i.length},clear:function(){n.push.apply(n,i);for(var e=0;e<n.length;e++)t.ext_disjoint_timer_query.deleteQueryEXT(n[e]);i.length=0,n.length=0},restore:function(){i.length=0,n.length=0}}},cr="webglcontextlost",ur="webglcontextrestored";function hr(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}return function(n){var r=N(n);if(!r)return null;var i=r.gl,o=i.getContextAttributes(),a=i.isContextLost(),s=function(e,t){var n={};function r(t){T.type(t,"string","extension name must be string");var r,i=t.toLowerCase();try{r=n[i]=e.getExtension(i)}catch(e){}return!!r}for(var i=0;i<t.extensions.length;++i){var o=t.extensions[i];if(!r(o))return t.onDestroy(),t.onDone('"'+o+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return t.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach((function(e){if(n[e]&&!r(e))throw new Error("(regl): error restoring extension "+e)}))}}}(i,r);if(!s)return null;var l,c,u=(l={"":0},c=[""],{id:function(e){var t=l[e];return t||(t=l[e]=c.length,c.push(e),t)},str:function(e){return c[e]}}),h={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},d=s.extensions,f=lr(0,d),p=I(),g=i.drawingBufferWidth,m=i.drawingBufferHeight,_={tick:0,time:0,viewportWidth:g,viewportHeight:m,framebufferWidth:g,framebufferHeight:m,drawingBufferWidth:g,drawingBufferHeight:m,pixelRatio:r.pixelRatio},v=function(e,t){var n=1;t.ext_texture_filter_anisotropic&&(n=e.getParameter(34047));var r=1,i=1;t.webgl_draw_buffers&&(r=e.getParameter(34852),i=e.getParameter(36063));var o=!!t.oes_texture_float;if(o){var a=e.createTexture();e.bindTexture(k,a),e.texImage2D(k,0,G,1,1,0,G,z,null);var s=e.createFramebuffer();if(e.bindFramebuffer(j,s),e.framebufferTexture2D(j,36064,k,a,0),e.bindTexture(k,null),36053!==e.checkFramebufferStatus(j))o=!1;else{e.viewport(0,0,1,1),e.clearColor(1,0,0,1),e.clear(16384);var l=U.allocType(z,4);e.readPixels(0,0,1,1,G,z,l),e.getError()?o=!1:(e.deleteFramebuffer(s),e.deleteTexture(a),o=1===l[0]),U.freeType(l)}}var c=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var u=e.createTexture(),h=U.allocType(5121,36);e.activeTexture(33984),e.bindTexture(34067,u),e.texImage2D(34069,0,G,3,3,0,G,5121,h),U.freeType(h),e.bindTexture(34067,null),e.deleteTexture(u),c=!e.getError()}return{colorBits:[e.getParameter(3410),e.getParameter(3411),e.getParameter(3412),e.getParameter(3413)],depthBits:e.getParameter(3414),stencilBits:e.getParameter(3415),subpixelBits:e.getParameter(3408),extensions:Object.keys(t).filter((function(e){return!!t[e]})),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:i,pointSizeDims:e.getParameter(33901),lineWidthDims:e.getParameter(33902),maxViewportDims:e.getParameter(3386),maxCombinedTextureUnits:e.getParameter(35661),maxCubeMapSize:e.getParameter(34076),maxRenderbufferSize:e.getParameter(34024),maxTextureUnits:e.getParameter(34930),maxTextureSize:e.getParameter(3379),maxAttributes:e.getParameter(34921),maxVertexUniforms:e.getParameter(36347),maxVertexTextureUnits:e.getParameter(35660),maxVaryingVectors:e.getParameter(36348),maxFragmentUniforms:e.getParameter(36349),glsl:e.getParameter(35724),renderer:e.getParameter(7937),vendor:e.getParameter(7936),version:e.getParameter(7938),readFloat:o,npotTextureCube:c}}(i,d),y=function(t,n,r,i){var o=0,a={};function s(e){this.id=o++,this.buffer=t.createBuffer(),this.type=e,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=J,this.persistentData=null,r.profile&&(this.stats={size:0})}s.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},s.prototype.destroy=function(){h(this)};var l=[];function c(e,n,r){e.byteLength=n.byteLength,t.bufferData(e.type,n,r)}function u(t,n,r,i,o,a){var s,l;if(t.usage=r,Array.isArray(n)){if(t.dtype=i||ee,n.length>0)if(Array.isArray(n[0])){s=$(n);for(var u=1,h=1;h<s.length;++h)u*=s[h];t.dimension=u,c(t,l=Q(n,s,t.dtype),r),a?t.persistentData=l:U.freeType(l)}else if("number"==typeof n[0]){t.dimension=o;var d=U.allocType(t.dtype,n.length);re(d,n),c(t,d,r),a?t.persistentData=d:U.freeType(d)}else e(n[0])?(t.dimension=n[0].length,t.dtype=i||ne(n[0])||ee,c(t,l=Q(n,[n.length,n[0].length],t.dtype),r),a?t.persistentData=l:U.freeType(l)):T.raise("invalid buffer data")}else if(e(n))t.dtype=i||ne(n),t.dimension=o,c(t,n,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(n.buffer)));else if(V(n)){s=n.shape;var f=n.stride,p=n.offset,g=0,m=0,_=0,v=0;1===s.length?(g=s[0],m=1,_=f[0],v=0):2===s.length?(g=s[0],m=s[1],_=f[0],v=f[1]):T.raise("invalid shape"),t.dtype=i||ne(n.data)||ee,t.dimension=m;var y=U.allocType(t.dtype,g*m);ie(y,n.data,g,m,_,v,p),c(t,y,r),a?t.persistentData=y:U.freeType(y)}else n instanceof ArrayBuffer?(t.dtype=J,t.dimension=o,c(t,n,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(n)))):T.raise("invalid buffer data")}function h(e){n.bufferCount--,i(e);var r=e.buffer;T(r,"buffer must not be deleted already"),t.deleteBuffer(r),e.buffer=null,delete a[e.id]}return r.profile&&(n.getTotalBufferSize=function(){var e=0;return Object.keys(a).forEach((function(t){e+=a[t].stats.size})),e}),{create:function(i,o,l,c){n.bufferCount++;var d=new s(o);function f(n){var i=35044,o=null,a=0,s=0,l=1;return Array.isArray(n)||e(n)||V(n)||n instanceof ArrayBuffer?o=n:"number"==typeof n?a=0|n:n&&(T.type(n,"object","buffer arguments must be an object, a number or an array"),"data"in n&&(T(null===o||Array.isArray(o)||e(o)||V(o),"invalid data for buffer"),o=n.data),"usage"in n&&(T.parameter(n.usage,K,"invalid buffer usage"),i=K[n.usage]),"type"in n&&(T.parameter(n.type,q,"invalid buffer type"),s=q[n.type]),"dimension"in n&&(T.type(n.dimension,"number","invalid dimension"),l=0|n.dimension),"length"in n&&(T.nni(a,"buffer length must be a nonnegative integer"),a=0|n.length)),d.bind(),o?u(d,o,i,s,l,c):(a&&t.bufferData(d.type,a,i),d.dtype=s||J,d.usage=i,d.dimension=l,d.byteLength=a),r.profile&&(d.stats.size=d.byteLength*te[d.dtype]),f}function p(e,n){T(n+e.byteLength<=d.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+e.byteLength+" starting from offset "+n+" to a buffer of size "+d.byteLength),t.bufferSubData(d.type,n,e)}return a[d.id]=d,l||f(i),f._reglType="buffer",f._buffer=d,f.subdata=function(t,n){var r,i=0|(n||0);if(d.bind(),e(t)||t instanceof ArrayBuffer)p(t,i);else if(Array.isArray(t)){if(t.length>0)if("number"==typeof t[0]){var o=U.allocType(d.dtype,t.length);re(o,t),p(o,i),U.freeType(o)}else if(Array.isArray(t[0])||e(t[0])){r=$(t);var a=Q(t,r,d.dtype);p(a,i),U.freeType(a)}else T.raise("invalid buffer data")}else if(V(t)){r=t.shape;var s=t.stride,l=0,c=0,u=0,h=0;1===r.length?(l=r[0],c=1,u=s[0],h=0):2===r.length?(l=r[0],c=r[1],u=s[0],h=s[1]):T.raise("invalid shape");var g=Array.isArray(t.data)?d.dtype:ne(t.data),m=U.allocType(g,l*c);ie(m,t.data,l,c,u,h,t.offset),p(m,i),U.freeType(m)}else T.raise("invalid data for buffer subdata");return f},r.profile&&(f.stats=d.stats),f.destroy=function(){h(d)},f},createStream:function(e,t){var n=l.pop();return n||(n=new s(e)),n.bind(),u(n,t,35040,0,1,!1),n},destroyStream:function(e){l.push(e)},clear:function(){H(a).forEach(h),l.forEach(h)},getBuffer:function(e){return e&&e._buffer instanceof s?e._buffer:null},restore:function(){H(a).forEach((function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)}))},_initBuffer:u}}(i,h,r,(function(e){return E.destroyBuffer(e)})),E=function(t,n,r,i,o){for(var a=r.maxAttributes,s=new Array(a),l=0;l<a;++l)s[l]=new St;var c=0,u={},h={Record:St,scope:{},state:s,currentVAO:null,targetVAO:null,restore:d()?function(){d()&&H(u).forEach((function(e){e.refresh()}))}:function(){},createVAO:function(t){var r=new p;function s(t){T(Array.isArray(t),"arguments to vertex array constructor must be an array"),T(t.length<a,"too many attributes"),T(t.length>0,"must specify at least one attribute");for(var i=0;i<r.buffers.length;++i)r.buffers[i].destroy();r.buffers.length=0;var l=r.attributes;l.length=t.length;for(var c=0;c<t.length;++c){var u=t[c],h=l[c]=new St;if(Array.isArray(u)||e(u)||V(u)){var d=o.create(u,34962,!1,!0);h.buffer=o.getBuffer(d),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1,r.buffers.push(d)}else o.getBuffer(u)?(h.buffer=o.getBuffer(u),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1):o.getBuffer(u.buffer)?(h.buffer=o.getBuffer(u.buffer),h.size=0|(+u.size||h.buffer.dimension),h.normalized=!!u.normalized||!1,"type"in u?(T.parameter(u.type,q,"invalid buffer type"),h.type=q[u.type]):h.type=h.buffer.dtype,h.offset=0|(u.offset||0),h.stride=0|(u.stride||0),h.divisor=0|(u.divisor||0),h.state=1,T(h.size>=1&&h.size<=4,"size must be between 1 and 4"),T(h.offset>=0,"invalid offset"),T(h.stride>=0&&h.stride<=255,"stride must be between 0 and 255"),T(h.divisor>=0,"divisor must be positive"),T(!h.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in u?(T(c>0,"first attribute must not be a constant"),h.x=+u.x||0,h.y=+u.y||0,h.z=+u.z||0,h.w=+u.w||0,h.state=2):T(!1,"invalid attribute spec for location "+c)}return r.refresh(),s}return i.vaoCount+=1,s.destroy=function(){r.destroy()},s._vao=r,s._reglType="vao",s(t)},getVAO:function(e){return"function"==typeof e&&e._vao?e._vao:null},destroyBuffer:function(e){for(var n=0;n<s.length;++n){var r=s[n];r.buffer===e&&(t.disableVertexAttribArray(n),r.buffer=null)}},setVAO:d()?function(e){if(e!==h.currentVAO){var t=d();e?t.bindVertexArrayOES(e.vao):t.bindVertexArrayOES(null),h.currentVAO=e}}:function(e){if(e!==h.currentVAO){if(e)e.bindAttrs();else for(var n=f(),r=0;r<s.length;++r){var i=s[r];i.buffer?(t.enableVertexAttribArray(r),t.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offfset),n&&n.vertexAttribDivisorANGLE(r,i.divisor)):(t.disableVertexAttribArray(r),t.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}h.currentVAO=e}},clear:d()?function(){H(u).forEach((function(e){e.destroy()}))}:function(){}};function d(){return n.oes_vertex_array_object}function f(){return n.angle_instanced_arrays}function p(){this.id=++c,this.attributes=[];var e=d();this.vao=e?e.createVertexArrayOES():null,u[this.id]=this,this.buffers=[]}return p.prototype.bindAttrs=function(){for(var e=f(),n=this.attributes,r=0;r<n.length;++r){var i=n[r];i.buffer?(t.enableVertexAttribArray(r),t.bindBuffer(34962,i.buffer.buffer),t.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offset),e&&e.vertexAttribDivisorANGLE(r,i.divisor)):(t.disableVertexAttribArray(r),t.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}for(var o=n.length;o<a;++o)t.disableVertexAttribArray(o)},p.prototype.refresh=function(){var e=d();e&&(e.bindVertexArrayOES(this.vao),this.bindAttrs(),h.currentVAO=this)},p.prototype.destroy=function(){if(this.vao){var e=d();this===h.currentVAO&&(h.currentVAO=null,e.bindVertexArrayOES(null)),e.deleteVertexArrayOES(this.vao),this.vao=null}u[this.id]&&(delete u[this.id],i.vaoCount-=1)},h}(i,d,v,h,y),A=function(t,n,r,i){var o={},a=0,s={uint8:ae,uint16:se};function l(e){this.id=a++,o[this.id]=this,this.buffer=e,this.primType=4,this.vertCount=0,this.type=0}n.oes_element_index_uint&&(s.uint32=le),l.prototype.bind=function(){this.buffer.bind()};var c=[];function u(i,o,a,s,l,c,u){var h;if(i.buffer.bind(),o){var d=u;u||e(o)&&(!V(o)||e(o.data))||(d=n.oes_element_index_uint?le:se),r._initBuffer(i.buffer,o,a,d,3)}else t.bufferData(ce,c,a),i.buffer.dtype=h||ae,i.buffer.usage=a,i.buffer.dimension=3,i.buffer.byteLength=c;if(h=u,!u){switch(i.buffer.dtype){case ae:case 5120:h=ae;break;case se:case 5122:h=se;break;case le:case 5124:h=le;break;default:T.raise("unsupported type for element array")}i.buffer.dtype=h}i.type=h,T(h!==le||!!n.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var f=l;f<0&&(f=i.buffer.byteLength,h===se?f>>=1:h===le&&(f>>=2)),i.vertCount=f;var p=s;if(s<0){p=4;var g=i.buffer.dimension;1===g&&(p=0),2===g&&(p=1),3===g&&(p=4)}i.primType=p}function h(e){i.elementsCount--,T(null!==e.buffer,"must not double destroy elements"),delete o[e.id],e.buffer.destroy(),e.buffer=null}return{create:function(t,n){var o=r.create(null,ce,!0),a=new l(o._buffer);function c(t){if(t)if("number"==typeof t)o(t),a.primType=4,a.vertCount=0|t,a.type=ae;else{var n=null,r=35044,i=-1,l=-1,h=0,d=0;Array.isArray(t)||e(t)||V(t)?n=t:(T.type(t,"object","invalid arguments for elements"),"data"in t&&(n=t.data,T(Array.isArray(n)||e(n)||V(n),"invalid data for element buffer")),"usage"in t&&(T.parameter(t.usage,K,"invalid element buffer usage"),r=K[t.usage]),"primitive"in t&&(T.parameter(t.primitive,oe,"invalid element buffer primitive"),i=oe[t.primitive]),"count"in t&&(T("number"==typeof t.count&&t.count>=0,"invalid vertex count for elements"),l=0|t.count),"type"in t&&(T.parameter(t.type,s,"invalid buffer type"),d=s[t.type]),"length"in t?h=0|t.length:(h=l,d===se||5122===d?h*=2:d!==le&&5124!==d||(h*=4))),u(a,n,r,i,l,h,d)}else o(),a.primType=4,a.vertCount=0,a.type=ae;return c}return i.elementsCount++,c(t),c._reglType="elements",c._elements=a,c.subdata=function(e,t){return o.subdata(e,t),c},c.destroy=function(){h(a)},c},createStream:function(e){var t=c.pop();return t||(t=new l(r.create(null,ce,!0,!1)._buffer)),u(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){c.push(e)},getElements:function(e){return"function"==typeof e&&e._elements instanceof l?e._elements:null},clear:function(){H(o).forEach(h)}}}(i,d,y,h),b=function(e,t,n,r){var i={},o={};function a(e,t,n,r){this.name=e,this.id=t,this.location=n,this.info=r}function s(e,t){for(var n=0;n<e.length;++n)if(e[n].id===t.id)return void(e[n].location=t.location);e.push(t)}function l(n,r,a){var s=35632===n?i:o,l=s[r];if(!l){var c=t.str(r);l=e.createShader(n),e.shaderSource(l,c),e.compileShader(l),T.shaderError(e,l,c,n,a),s[r]=l}return l}var c={},u=[],h=0;function d(e,t){this.id=h++,this.fragId=e,this.vertId=t,this.program=null,this.uniforms=[],this.attributes=[],r.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function f(n,i,o){var c,u,h=l(35632,n.fragId),d=l(35633,n.vertId),f=n.program=e.createProgram();if(e.attachShader(f,h),e.attachShader(f,d),o)for(c=0;c<o.length;++c){var p=o[c];e.bindAttribLocation(f,p[0],p[1])}e.linkProgram(f),T.linkError(e,f,t.str(n.fragId),t.str(n.vertId),i);var g=e.getProgramParameter(f,35718);r.profile&&(n.stats.uniformsCount=g);var m=n.uniforms;for(c=0;c<g;++c)if(u=e.getActiveUniform(f,c))if(u.size>1)for(var _=0;_<u.size;++_){var v=u.name.replace("[0]","["+_+"]");s(m,new a(v,t.id(v),e.getUniformLocation(f,v),u))}else s(m,new a(u.name,t.id(u.name),e.getUniformLocation(f,u.name),u));var y=e.getProgramParameter(f,35721);r.profile&&(n.stats.attributesCount=y);var E=n.attributes;for(c=0;c<y;++c)(u=e.getActiveAttrib(f,c))&&s(E,new a(u.name,t.id(u.name),e.getAttribLocation(f,u.name),u))}return r.profile&&(n.getMaxUniformsCount=function(){var e=0;return u.forEach((function(t){t.stats.uniformsCount>e&&(e=t.stats.uniformsCount)})),e},n.getMaxAttributesCount=function(){var e=0;return u.forEach((function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)})),e}),{clear:function(){var t=e.deleteShader.bind(e);H(i).forEach(t),i={},H(o).forEach(t),o={},u.forEach((function(t){e.deleteProgram(t.program)})),u.length=0,c={},n.shaderCount=0},program:function(e,t,r,i){T.command(e>=0,"missing vertex shader",r),T.command(t>=0,"missing fragment shader",r);var o=c[t];o||(o=c[t]={});var a=o[e];if(a&&!i)return a;var s=new d(t,e);return n.shaderCount++,f(s,r,i),a||(o[e]=s),u.push(s),s},restore:function(){i={},o={};for(var e=0;e<u.length;++e)f(u[e],null,u[e].attributes.map((function(e){return[e.location,e.name]})))},shader:l,frag:-1,vert:-1}}(i,u,h,r),x=ht(i,d,v,(function(){C.procs.poll()}),_,h,r),S=function(e,t,n,r,i){var o={rgba4:ft,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};t.ext_srgb&&(o.srgba=35907),t.ext_color_buffer_half_float&&(o.rgba16f=34842,o.rgb16f=34843),t.webgl_color_buffer_float&&(o.rgba32f=34836);var a=[];Object.keys(o).forEach((function(e){var t=o[e];a[t]=e}));var s=0,l={};function c(e){this.id=s++,this.refCount=1,this.renderbuffer=e,this.format=ft,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function u(t){var n=t.renderbuffer;T(n,"must not double destroy renderbuffer"),e.bindRenderbuffer(dt,null),e.deleteRenderbuffer(n),t.renderbuffer=null,t.refCount=0,delete l[t.id],r.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&u(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var e=0;return Object.keys(l).forEach((function(t){e+=l[t].stats.size})),e}),{create:function(t,s){var u=new c(e.createRenderbuffer());function h(t,r){var s=0,l=0,c=ft;if("object"==typeof t&&t){var d=t;if("shape"in d){var f=d.shape;T(Array.isArray(f)&&f.length>=2,"invalid renderbuffer shape"),s=0|f[0],l=0|f[1]}else"radius"in d&&(s=l=0|d.radius),"width"in d&&(s=0|d.width),"height"in d&&(l=0|d.height);"format"in d&&(T.parameter(d.format,o,"invalid renderbuffer format"),c=o[d.format])}else"number"==typeof t?(s=0|t,l="number"==typeof r?0|r:s):t?T.raise("invalid arguments to renderbuffer constructor"):s=l=1;if(T(s>0&&l>0&&s<=n.maxRenderbufferSize&&l<=n.maxRenderbufferSize,"invalid renderbuffer size"),s!==u.width||l!==u.height||c!==u.format)return h.width=u.width=s,h.height=u.height=l,u.format=c,e.bindRenderbuffer(dt,u.renderbuffer),e.renderbufferStorage(dt,c,s,l),T(0===e.getError(),"invalid render buffer format"),i.profile&&(u.stats.size=gt(u.format,u.width,u.height)),h.format=a[u.format],h}return l[u.id]=u,r.renderbufferCount++,h(t,s),h.resize=function(t,r){var o=0|t,a=0|r||o;return o===u.width&&a===u.height||(T(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),h.width=u.width=o,h.height=u.height=a,e.bindRenderbuffer(dt,u.renderbuffer),e.renderbufferStorage(dt,u.format,o,a),T(0===e.getError(),"invalid render buffer format"),i.profile&&(u.stats.size=gt(u.format,u.width,u.height))),h},h._reglType="renderbuffer",h._renderbuffer=u,i.profile&&(h.stats=u.stats),h.destroy=function(){u.decRef()},h},clear:function(){H(l).forEach(u)},restore:function(){H(l).forEach((function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(dt,t.renderbuffer),e.renderbufferStorage(dt,t.format,t.width,t.height)})),e.bindRenderbuffer(dt,null)}}}(i,d,v,h,r),R=function(e,n,r,i,o,a){var s={cur:null,next:null,dirty:!1,setFBO:null},l=["rgba"],c=["rgba4","rgb565","rgb5 a1"];n.ext_srgb&&c.push("srgba"),n.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),n.webgl_color_buffer_float&&c.push("rgba32f");var u=["uint8"];function h(e,t,n){this.target=e,this.texture=t,this.renderbuffer=n;var r=0,i=0;t?(r=t.width,i=t.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function d(e){e&&(e.texture&&e.texture._texture.decRef(),e.renderbuffer&&e.renderbuffer._renderbuffer.decRef())}function f(e,t,n){if(e)if(e.texture){var r=e.texture._texture,i=Math.max(1,r.width),o=Math.max(1,r.height);T(i===t&&o===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=e.renderbuffer._renderbuffer;T(a.width===t&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function p(t,n){n&&(n.texture?e.framebufferTexture2D(mt,t,n.target,n.texture._texture.texture,0):e.framebufferRenderbuffer(mt,t,_t,n.renderbuffer._renderbuffer.renderbuffer))}function g(e){var t=vt,n=null,r=null,i=e;"object"==typeof e&&(i=e.data,"target"in e&&(t=0|e.target)),T.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(n=i,T(t===vt)):"textureCube"===o?(n=i,T(t>=yt&&t<34075,"invalid cube map target")):"renderbuffer"===o?(r=i,t=_t):T.raise("invalid regl object for attachment"),new h(t,n,r)}function m(e,t,n,r,a){if(n){var s=i.create2D({width:e,height:t,format:r,type:a});return s._texture.refCount=0,new h(vt,s,null)}var l=o.create({width:e,height:t,format:r});return l._renderbuffer.refCount=0,new h(_t,null,l)}function _(e){return e&&(e.texture||e.renderbuffer)}function v(e,t,n){e&&(e.texture?e.texture.resize(t,n):e.renderbuffer&&e.renderbuffer.resize(t,n),e.width=t,e.height=n)}n.oes_texture_half_float&&u.push("half float","float16"),n.oes_texture_float&&u.push("float","float32");var y=0,E={};function A(){this.id=y++,E[this.id]=this,this.framebuffer=e.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function b(e){e.colorAttachments.forEach(d),d(e.depthAttachment),d(e.stencilAttachment),d(e.depthStencilAttachment)}function x(t){var n=t.framebuffer;T(n,"must not double destroy framebuffer"),e.deleteFramebuffer(n),t.framebuffer=null,a.framebufferCount--,delete E[t.id]}function S(t){var n;e.bindFramebuffer(mt,t.framebuffer);var i=t.colorAttachments;for(n=0;n<i.length;++n)p(36064+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)e.framebufferTexture2D(mt,36064+n,vt,null,0);e.framebufferTexture2D(mt,33306,vt,null,0),e.framebufferTexture2D(mt,36096,vt,null,0),e.framebufferTexture2D(mt,36128,vt,null,0),p(36096,t.depthAttachment),p(36128,t.stencilAttachment),p(33306,t.depthStencilAttachment);var o=e.checkFramebufferStatus(mt);e.isContextLost()||36053===o||T.raise("framebuffer configuration not supported, status = "+xt[o]),e.bindFramebuffer(mt,s.next?s.next.framebuffer:null),s.cur=s.next,e.getError()}function R(e,i){var o=new A;function h(e,t){var i;T(s.next!==o,"can not update framebuffer which is currently in use");var a=0,d=0,p=!0,v=!0,y=null,E=!0,A="rgba",x="uint8",R=1,C=null,L=null,O=null,M=!1;if("number"==typeof e)a=0|e,d=0|t||a;else if(e){T.type(e,"object","invalid arguments for framebuffer");var I=e;if("shape"in I){var w=I.shape;T(Array.isArray(w)&&w.length>=2,"invalid shape for framebuffer"),a=w[0],d=w[1]}else"radius"in I&&(a=d=I.radius),"width"in I&&(a=I.width),"height"in I&&(d=I.height);("color"in I||"colors"in I)&&(y=I.color||I.colors,Array.isArray(y)&&T(1===y.length||n.webgl_draw_buffers,"multiple render targets not supported")),y||("colorCount"in I&&(R=0|I.colorCount,T(R>0,"invalid color buffer count")),"colorTexture"in I&&(E=!!I.colorTexture,A="rgba4"),"colorType"in I&&(x=I.colorType,E?(T(n.oes_texture_float||!("float"===x||"float32"===x),"you must enable OES_texture_float in order to use floating point framebuffer objects"),T(n.oes_texture_half_float||!("half float"===x||"float16"===x),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===x||"float16"===x?(T(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),A="rgba16f"):"float"!==x&&"float32"!==x||(T(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),A="rgba32f"),T.oneOf(x,u,"invalid color type")),"colorFormat"in I&&(A=I.colorFormat,l.indexOf(A)>=0?E=!0:c.indexOf(A)>=0?E=!1:E?T.oneOf(I.colorFormat,l,"invalid color format for texture"):T.oneOf(I.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in I||"depthStencilTexture"in I)&&(M=!(!I.depthTexture&&!I.depthStencilTexture),T(!M||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in I&&("boolean"==typeof I.depth?p=I.depth:(C=I.depth,v=!1)),"stencil"in I&&("boolean"==typeof I.stencil?v=I.stencil:(L=I.stencil,p=!1)),"depthStencil"in I&&("boolean"==typeof I.depthStencil?p=v=I.depthStencil:(O=I.depthStencil,p=!1,v=!1))}else a=d=1;var P=null,N=null,D=null,B=null;if(Array.isArray(y))P=y.map(g);else if(y)P=[g(y)];else for(P=new Array(R),i=0;i<R;++i)P[i]=m(a,d,E,A,x);T(n.webgl_draw_buffers||P.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),T(P.length<=r.maxColorAttachments,"too many color attachments, not supported"),a=a||P[0].width,d=d||P[0].height,C?N=g(C):p&&!v&&(N=m(a,d,M,"depth","uint32")),L?D=g(L):v&&!p&&(D=m(a,d,!1,"stencil","uint8")),O?B=g(O):!C&&!L&&v&&p&&(B=m(a,d,M,"depth stencil","depth stencil")),T(!!C+!!L+!!O<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var F=null;for(i=0;i<P.length;++i)if(f(P[i],a,d),T(!P[i]||P[i].texture&&Et.indexOf(P[i].texture._texture.format)>=0||P[i].renderbuffer&&Tt.indexOf(P[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),P[i]&&P[i].texture){var U=At[P[i].texture._texture.format]*bt[P[i].texture._texture.type];null===F?F=U:T(F===U,"all color attachments much have the same number of bits per pixel.")}return f(N,a,d),T(!N||N.texture&&6402===N.texture._texture.format||N.renderbuffer&&33189===N.renderbuffer._renderbuffer.format,"invalid depth attachment for framebuffer object"),f(D,a,d),T(!D||D.renderbuffer&&36168===D.renderbuffer._renderbuffer.format,"invalid stencil attachment for framebuffer object"),f(B,a,d),T(!B||B.texture&&34041===B.texture._texture.format||B.renderbuffer&&34041===B.renderbuffer._renderbuffer.format,"invalid depth-stencil attachment for framebuffer object"),b(o),o.width=a,o.height=d,o.colorAttachments=P,o.depthAttachment=N,o.stencilAttachment=D,o.depthStencilAttachment=B,h.color=P.map(_),h.depth=_(N),h.stencil=_(D),h.depthStencil=_(B),h.width=o.width,h.height=o.height,S(o),h}return a.framebufferCount++,h(e,i),t(h,{resize:function(e,t){T(s.next!==o,"can not resize a framebuffer which is currently in use");var n=Math.max(0|e,1),r=Math.max(0|t||n,1);if(n===o.width&&r===o.height)return h;for(var i=o.colorAttachments,a=0;a<i.length;++a)v(i[a],n,r);return v(o.depthAttachment,n,r),v(o.stencilAttachment,n,r),v(o.depthStencilAttachment,n,r),o.width=h.width=n,o.height=h.height=r,S(o),h},_reglType:"framebuffer",_framebuffer:o,destroy:function(){x(o),b(o)},use:function(e){s.setFBO({framebuffer:h},e)}})}return t(s,{getFramebuffer:function(e){if("function"==typeof e&&"framebuffer"===e._reglType){var t=e._framebuffer;if(t instanceof A)return t}return null},create:R,createCube:function(e){var o=Array(6);function a(e){var r;T(o.indexOf(s.next)<0,"can not update framebuffer which is currently in use");var c,h={color:null},d=0,f=null,p="rgba",g="uint8",m=1;if("number"==typeof e)d=0|e;else if(e){T.type(e,"object","invalid arguments for framebuffer");var _=e;if("shape"in _){var v=_.shape;T(Array.isArray(v)&&v.length>=2,"invalid shape for framebuffer"),T(v[0]===v[1],"cube framebuffer must be square"),d=v[0]}else"radius"in _&&(d=0|_.radius),"width"in _?(d=0|_.width,"height"in _&&T(_.height===d,"must be square")):"height"in _&&(d=0|_.height);("color"in _||"colors"in _)&&(f=_.color||_.colors,Array.isArray(f)&&T(1===f.length||n.webgl_draw_buffers,"multiple render targets not supported")),f||("colorCount"in _&&(m=0|_.colorCount,T(m>0,"invalid color buffer count")),"colorType"in _&&(T.oneOf(_.colorType,u,"invalid color type"),g=_.colorType),"colorFormat"in _&&(p=_.colorFormat,T.oneOf(_.colorFormat,l,"invalid color format for texture"))),"depth"in _&&(h.depth=_.depth),"stencil"in _&&(h.stencil=_.stencil),"depthStencil"in _&&(h.depthStencil=_.depthStencil)}else d=1;if(f)if(Array.isArray(f))for(c=[],r=0;r<f.length;++r)c[r]=f[r];else c=[f];else{c=Array(m);var y={radius:d,format:p,type:g};for(r=0;r<m;++r)c[r]=i.createCube(y)}for(h.color=Array(c.length),r=0;r<c.length;++r){var E=c[r];T("function"==typeof E&&"textureCube"===E._reglType,"invalid cube map"),d=d||E.width,T(E.width===d&&E.height===d,"invalid cube map shape"),h.color[r]={target:yt,data:c[r]}}for(r=0;r<6;++r){for(var A=0;A<c.length;++A)h.color[A].target=yt+r;r>0&&(h.depth=o[0].depth,h.stencil=o[0].stencil,h.depthStencil=o[0].depthStencil),o[r]?o[r](h):o[r]=R(h)}return t(a,{width:d,height:d,color:c})}return a(e),t(a,{faces:o,resize:function(e){var t,n=0|e;if(T(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var i=a.color;for(t=0;t<i.length;++t)i[t].resize(n);for(t=0;t<6;++t)o[t].resize(n);return a.width=a.height=n,a},_reglType:"framebufferCube",destroy:function(){o.forEach((function(e){e.destroy()}))}})},clear:function(){H(E).forEach(x)},restore:function(){s.cur=null,s.next=null,s.dirty=!0,H(E).forEach((function(t){t.framebuffer=e.createFramebuffer(),S(t)}))}})}(i,d,v,x,S,h),C=sr(i,u,d,v,y,A,0,R,{},E,b,{elements:null,primitive:4,count:-1,offset:0,instances:-1},_,f,r),L=Lt(i,R,C.procs.poll,_,o,d,v),w=C.next,P=i.canvas,D=[],B=[],F=[],W=[r.onDestroy],X=null;function Z(){if(0===D.length)return f&&f.update(),void(X=null);X=M.next(Z),ve();for(var e=D.length-1;e>=0;--e){var t=D[e];t&&t(_,null,0)}i.flush(),f&&f.update()}function Y(){!X&&D.length>0&&(X=M.next(Z))}function ue(){X&&(M.cancel(Z),X=null)}function he(e){e.preventDefault(),a=!0,ue(),B.forEach((function(e){e()}))}function de(e){i.getError(),a=!1,s.restore(),b.restore(),y.restore(),x.restore(),S.restore(),R.restore(),E.restore(),f&&f.restore(),C.procs.refresh(),Y(),F.forEach((function(e){e()}))}function fe(e){function n(e){var t={},n={};return Object.keys(e).forEach((function(r){var i=e[r];O.isDynamic(i)?n[r]=O.unbox(i,r):t[r]=i})),{dynamic:n,static:t}}T(!!e,"invalid args to regl({...})"),T.type(e,"object","invalid args to regl({...})");var r=n(e.context||{}),i=n(e.uniforms||{}),o=n(e.attributes||{}),s=n(function(e){var n=t({},e);function r(e){if(e in n){var t=n[e];delete n[e],Object.keys(t).forEach((function(r){n[e+"."+r]=t[r]}))}}return delete n.uniforms,delete n.attributes,delete n.context,delete n.vao,"stencil"in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op),r("blend"),r("depth"),r("cull"),r("stencil"),r("polygonOffset"),r("scissor"),r("sample"),"vao"in e&&(n.vao=e.vao),n}(e)),l={gpuTime:0,cpuTime:0,count:0},c=C.compile(s,o,i,r,l),u=c.draw,h=c.batch,d=c.scope,f=[];return t((function(e,t){var n;if(a&&T.raise("context lost"),"function"==typeof e)return d.call(this,null,e,0);if("function"==typeof t)if("number"==typeof e)for(n=0;n<e;++n)d.call(this,null,t,n);else{if(!Array.isArray(e))return d.call(this,e,t,0);for(n=0;n<e.length;++n)d.call(this,e[n],t,n)}else if("number"==typeof e){if(e>0)return h.call(this,function(e){for(;f.length<e;)f.push(null);return f}(0|e),0|e)}else{if(!Array.isArray(e))return u.call(this,e);if(e.length)return h.call(this,e,e.length)}}),{stats:l})}P&&(P.addEventListener(cr,he,!1),P.addEventListener(ur,de,!1));var pe=R.setFBO=fe({framebuffer:O.define.call(null,1,"framebuffer")});function ge(e,t){var n=0;C.procs.poll();var r=t.color;r&&(i.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in t&&(i.clearDepth(+t.depth),n|=256),"stencil"in t&&(i.clearStencil(0|t.stencil),n|=1024),T(!!n,"called regl.clear with no buffer specified"),i.clear(n)}function me(e){return T.type(e,"function","regl.frame() callback must be a function"),D.push(e),Y(),{cancel:function(){var t=hr(D,e);T(t>=0,"cannot cancel a frame twice"),D[t]=function e(){var t=hr(D,e);D[t]=D[D.length-1],D.length-=1,D.length<=0&&ue()}}}}function _e(){var e=w.viewport,t=w.scissor_box;e[0]=e[1]=t[0]=t[1]=0,_.viewportWidth=_.framebufferWidth=_.drawingBufferWidth=e[2]=t[2]=i.drawingBufferWidth,_.viewportHeight=_.framebufferHeight=_.drawingBufferHeight=e[3]=t[3]=i.drawingBufferHeight}function ve(){_.tick+=1,_.time=Ee(),_e(),C.procs.poll()}function ye(){_e(),C.procs.refresh(),f&&f.update()}function Ee(){return(I()-p)/1e3}ye();var Ae=t(fe,{clear:function(e){if(T("object"==typeof e&&e,"regl.clear() takes an object as input"),"framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var n=0;n<6;++n)pe(t({framebuffer:e.framebuffer.faces[n]},e),ge);else pe(e,ge);else ge(0,e)},prop:O.define.bind(null,1),context:O.define.bind(null,2),this:O.define.bind(null,3),draw:fe({}),buffer:function(e){return y.create(e,34962,!1,!1)},elements:function(e){return A.create(e,!1)},texture:x.create2D,cube:x.createCube,renderbuffer:S.create,framebuffer:R.create,framebufferCube:R.createCube,vao:E.createVAO,attributes:o,frame:me,on:function(e,t){var n;switch(T.type(t,"function","listener callback must be a function"),e){case"frame":return me(t);case"lost":n=B;break;case"restore":n=F;break;case"destroy":n=W;break;default:T.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(t),{cancel:function(){for(var e=0;e<n.length;++e)if(n[e]===t)return n[e]=n[n.length-1],void n.pop()}}},limits:v,hasExtension:function(e){return v.extensions.indexOf(e.toLowerCase())>=0},read:L,destroy:function(){D.length=0,ue(),P&&(P.removeEventListener(cr,he),P.removeEventListener(ur,de)),b.clear(),R.clear(),S.clear(),x.clear(),A.clear(),y.clear(),E.clear(),f&&f.clear(),W.forEach((function(e){e()}))},_gl:i,_refresh:ye,poll:function(){ve(),f&&f.update()},now:Ee,stats:h});return r.onDone(null,Ae),Ae}}()},48875:(e,t,n)=>{var r=n(40091),i=n(77848)((function(e,t,n,i){r(e,t,n,i)}));e.exports=i},48926:(e,t,n)=>{"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)}n.d(t,{A:()=>i})},49261:(e,t,n)=>{var r=n(65111),i=n(2478),o=n(38250),a=n(49460),s=n(84354),l=Array.prototype.splice;e.exports=function(e,t,n,c){var u=c?o:i,h=-1,d=t.length,f=e;for(e===t&&(t=s(t)),n&&(f=r(e,a(n)));++h<d;)for(var p=0,g=t[h],m=n?n(g):g;(p=u(f,m,p,c))>-1;)f!==e&&l.call(f,p,1),l.call(e,p,1);return e}},49266:(e,t,n)=>{var r=n(24810),i=n(17099),o=n(92264),a=n(84354),s=n(75964),l=n(3283),c=n(53142),u=n(65406),h=n(75853),d=n(93655),f=n(41580),p=n(48360),g=n(8666),m=n(78763),_=n(64207);e.exports=function(e,t,n,v,y,E,A){var b=m(e,n),T=m(t,n),x=A.get(T);if(x)r(e,n,x);else{var S=E?E(b,T,n+"",e,t,A):void 0,R=void 0===S;if(R){var C=c(T),L=!C&&h(T),O=!C&&!L&&g(T);S=T,C||L||O?c(b)?S=b:u(b)?S=a(b):L?(R=!1,S=i(T,!0)):O?(R=!1,S=o(T,!0)):S=[]:p(T)||l(T)?(S=b,l(b)?S=_(b):f(b)&&!d(b)||(S=s(T))):R=!1}R&&(A.set(T,S),y(S,T,v,E,A),A.delete(T)),r(e,n,S)}}},49460:e=>{e.exports=function(e){return function(t){return e(t)}}},49666:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,i),!0;case 5:return u.fn.call(u.context,t,r,i,o),!0;case 6:return u.fn.call(u.context,t,r,i,o,a),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,i);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||i&&!s[l].once||r&&s[l].context!==r)&&c.push(s[l]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s},49753:(e,t,n)=>{var r=n(25098),i=n(1386),o=n(19770);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},49828:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},50424:(e,t,n)=>{var r=n(58898),i=n(92480),o=n(78340),a=n(18069),s=n(92264);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return o(e);case"[object Symbol]":return a(e)}}},51035:e=>{e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},51187:(e,t,n)=>{var r=n(87379),i=n(80547);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},51340:(e,t,n)=>{var r=n(1386),i=n(64103),o=n(21779),a=n(34162),s=n(7462),l=n(96638);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=l,e.exports=c},52291:(e,t,n)=>{var r=n(65650),i=n(65111),o=n(53142),a=n(51187),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},52837:e=>{e.exports=function(e){return e.split("")}},53142:e=>{var t=Array.isArray;e.exports=t},53260:(e,t,n)=>{e.exports.VectorTile=n(23057),n(26919),n(38008)},54732:(e,t,n)=>{var r=n(44700);e.exports=function(e){return r(this,e).has(e)}},54750:e=>{"use strict";var t=e.exports={};t.isIE=function(e){return!(-1===(t=navigator.userAgent.toLowerCase()).indexOf("msie")&&-1===t.indexOf("trident")&&-1===t.indexOf(" edge/")||e&&e!==function(){var e=3,t=document.createElement("div"),n=t.getElementsByTagName("i");do{t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e"}while(n[0]);return e>4?e:void 0}());var t},t.isLegacyOpera=function(){return!!window.opera}},55152:(e,t,n)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{A:()=>r})},56005:(e,t,n)=>{var r=n(95243),i=n(5485);e.exports=function(e){return i(r(e).toLowerCase())}},56027:(e,t,n)=>{var r=n(87379),i=n(80547);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},56561:e=>{"use strict";e.exports=n,e.exports.default=n;var t=1e20;function n(e,t,n,r,i,o){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=r||.25,this.fontFamily=i||"sans-serif",this.fontWeight=o||"normal",this.radius=n||8;var a=this.size=this.fontSize+2*this.buffer,s=a+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function r(e,t,n,r,o,a){for(var s=0;s<t;s++)i(e,s,t,n,r,o,a);for(var l=0;l<n;l++)i(e,l*t,1,t,r,o,a)}function i(e,n,r,i,o,a,s){var l,c,u,h;for(a[0]=0,s[0]=-t,s[1]=t,l=0;l<i;l++)o[l]=e[n+l*r];for(l=1,c=0,u=0;l<i;l++){do{h=a[c],u=(o[l]-o[h]+l*l-h*h)/(l-h)/2}while(u<=s[c]&&--c>-1);a[++c]=l,s[c]=u,s[c+1]=t}for(l=0,c=0;l<i;l++){for(;s[c+1]<l;)c++;h=a[c],e[n+l*r]=o[h]+(l-h)*(l-h)}}n.prototype._draw=function(e,n){var i,o,a,s,l,c,u,h,d,f=this.ctx.measureText(e),p=f.width,g=2*this.buffer;n&&this.useMetrics?(l=Math.floor(f.actualBoundingBoxAscent),h=this.buffer+Math.ceil(f.actualBoundingBoxAscent),c=this.buffer,u=this.buffer,i=(o=Math.min(this.size,Math.ceil(f.actualBoundingBoxRight-f.actualBoundingBoxLeft)))+g,a=(s=Math.min(this.size-c,Math.ceil(f.actualBoundingBoxAscent+f.actualBoundingBoxDescent)))+g,this.ctx.textBaseline="alphabetic"):(i=o=this.size,a=s=this.size,l=19*this.fontSize/24,c=u=0,h=this.middle,this.ctx.textBaseline="middle"),o&&s&&(this.ctx.clearRect(u,c,o,s),this.ctx.fillText(e,this.buffer,h),d=this.ctx.getImageData(u,c,o,s));var m=new Uint8ClampedArray(i*a);return function(e,n,r,i,o,a,s){a.fill(t,0,n*r),s.fill(0,0,n*r);for(var l=(n-i)/2,c=0;c<o;c++)for(var u=0;u<i;u++){var h=(c+l)*n+u+l,d=e.data[4*(c*i+u)+3]/255;if(1===d)a[h]=0,s[h]=t;else if(0===d)a[h]=t,s[h]=0;else{var f=Math.max(0,.5-d),p=Math.max(0,d-.5);a[h]=f*f,s[h]=p*p}}}(d,i,a,o,s,this.gridOuter,this.gridInner),r(this.gridOuter,i,a,this.f,this.v,this.z),r(this.gridInner,i,a,this.f,this.v,this.z),function(e,t,n,r,i,o,a){for(var s=0;s<t*n;s++){var l=Math.sqrt(r[s])-Math.sqrt(i[s]);e[s]=Math.round(255-255*(l/o+a))}}(m,i,a,this.gridOuter,this.gridInner,this.radius,this.cutoff),{data:m,metrics:{width:o,height:s,sdfWidth:i,sdfHeight:a,top:l,left:0,advance:p}}},n.prototype.draw=function(e){return this._draw(e,!1).data},n.prototype.drawWithMetrics=function(e){return this._draw(e,!0)}},57073:(e,t,n)=>{var r=n(72532);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},57200:(e,t,n)=>{var r=n(41580),i=n(84882),o=n(38546),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},57452:(e,t,n)=>{var r=n(94497);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},57923:(e,t,n)=>{var r=n(93526),i=n(66040);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},58571:(e,t,n)=>{"use strict";var r=n(99619);function i(){var e={},t=0,n=0,r=0;return{add:function(i,o){o||(o=i,i=0),i>n?n=i:i<r&&(r=i),e[i]||(e[i]=[]),e[i].push(o),t++},process:function(){for(var t=r;t<=n;t++)for(var i=e[t],o=0;o<i.length;o++)(0,i[o])()},size:function(){return t}}}e.exports=function(e){var t=(e=e||{}).reporter,n=r.getOption(e,"async",!0),o=r.getOption(e,"auto",!0);o&&!n&&(t&&t.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var a,s=i(),l=!1;function c(){for(l=!0;s.size();){var e=s;s=i(),e.process()}l=!1}function u(){a=setTimeout(c,0)}return{add:function(e,t){!l&&o&&n&&0===s.size()&&u(),s.add(e,t)},force:function(e){l||(void 0===e&&(e=n),a&&(clearTimeout(a),a=null),e?u():c())}}}},58771:e=>{e.exports=function(e){return void 0===e}},58898:(e,t,n)=>{var r=n(31623);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},59068:(e,t,n)=>{var r=n(44700);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},59756:(e,t,n)=>{var r=n(2478);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},60986:(e,t,n)=>{var r=n(87379),i=n(80547);e.exports=function(e){return"number"==typeof e||i(e)&&"[object Number]"==r(e)}},62049:(e,t,n)=>{var r=n(97034),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},62945:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},64062:(e,t,n)=>{"use strict";n.d(t,{$A:()=>l,S8:()=>s,Z0:()=>c,fA:()=>o,g7:()=>u,jb:()=>h,vt:()=>i,ze:()=>a});var r=n(23172);function i(){var e=new r.tb(3);return r.tb!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function o(e,t,n){var i=new r.tb(3);return i[0]=e,i[1]=t,i[2]=n,i}function a(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function s(e,t){var n=t[0],r=t[1],i=t[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function l(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2];return e[0]=i*l-o*s,e[1]=o*a-r*l,e[2]=r*s-i*a,e}function c(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,e[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,e[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,e[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,e}function u(e,t){var n=e[0],r=e[1],i=e[2],o=t[0],a=t[1],s=t[2],l=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+s*s),c=l&&function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}(e,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))}var h=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e};i()},64066:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},64103:(e,t,n)=>{var r=n(1386);e.exports=function(){this.__data__=new r,this.size=0}},64207:(e,t,n)=>{var r=n(39032),i=n(25288);e.exports=function(e){return r(e,i(e))}},64512:(e,t,n)=>{var r=n(94715)(n(78942),"Set");e.exports=r},64651:e=>{"use strict";e.exports=function(e){var t=e.idGenerator,n=e.stateHandler.getState;return{get:function(e){var t=n(e);return t&&void 0!==t.id?t.id:null},set:function(e){var r=n(e);if(!r)throw new Error("setId required the element to have a resize detection state.");var i=t.generate();return r.id=i,i}}}},64759:(e,t,n)=>{var r,i=n(41950),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},65111:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},65187:(e,t,n)=>{var r=n(53142),i=n(51187),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},65387:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},65406:(e,t,n)=>{var r=n(36529),i=n(80547);e.exports=function(e){return i(e)&&r(e)}},65568:e=>{e.exports=function(e,t){return e.has(t)}},65650:(e,t,n)=>{var r=n(78942).Symbol;e.exports=r},66040:(e,t,n)=>{var r=n(51187);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},66424:(e,t,n)=>{"use strict";function r(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function i(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function o(){}n.d(t,{Ay:()=>A,Qh:()=>x});var a=.7,s=1/a,l="\\s*([+-]?\\d+)\\s*",c="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",u="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",h=/^#([0-9a-f]{3,8})$/,d=new RegExp("^rgb\\("+[l,l,l]+"\\)$"),f=new RegExp("^rgb\\("+[u,u,u]+"\\)$"),p=new RegExp("^rgba\\("+[l,l,l,c]+"\\)$"),g=new RegExp("^rgba\\("+[u,u,u,c]+"\\)$"),m=new RegExp("^hsl\\("+[c,u,u]+"\\)$"),_=new RegExp("^hsla\\("+[c,u,u,c]+"\\)$"),v={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function y(){return this.rgb().formatHex()}function E(){return this.rgb().formatRgb()}function A(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=h.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?b(t):3===n?new S(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?T(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?T(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=d.exec(e))?new S(t[1],t[2],t[3],1):(t=f.exec(e))?new S(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=p.exec(e))?T(t[1],t[2],t[3],t[4]):(t=g.exec(e))?T(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=m.exec(e))?O(t[1],t[2]/100,t[3]/100,1):(t=_.exec(e))?O(t[1],t[2]/100,t[3]/100,t[4]):v.hasOwnProperty(e)?b(v[e]):"transparent"===e?new S(NaN,NaN,NaN,0):null}function b(e){return new S(e>>16&255,e>>8&255,255&e,1)}function T(e,t,n,r){return r<=0&&(e=t=n=NaN),new S(e,t,n,r)}function x(e,t,n,r){return 1===arguments.length?((i=e)instanceof o||(i=A(i)),i?new S((i=i.rgb()).r,i.g,i.b,i.opacity):new S):new S(e,t,n,null==r?1:r);var i}function S(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function R(){return"#"+L(this.r)+L(this.g)+L(this.b)}function C(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function L(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function O(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new I(e,t,n,r)}function M(e){if(e instanceof I)return new I(e.h,e.s,e.l,e.opacity);if(e instanceof o||(e=A(e)),!e)return new I;if(e instanceof I)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),s=NaN,l=a-i,c=(a+i)/2;return l?(s=t===a?(n-r)/l+6*(n<r):n===a?(r-t)/l+2:(t-n)/l+4,l/=c<.5?a+i:2-a-i,s*=60):l=c>0&&c<1?0:s,new I(s,l,c,e.opacity)}function I(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function w(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}r(o,A,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:y,formatHex:y,formatHsl:function(){return M(this).formatHsl()},formatRgb:E,toString:E}),r(S,x,i(o,{brighter:function(e){return e=null==e?s:Math.pow(s,e),new S(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?a:Math.pow(a,e),new S(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:R,formatHex:R,formatRgb:C,toString:C})),r(I,(function(e,t,n,r){return 1===arguments.length?M(e):new I(e,t,n,null==r?1:r)}),i(o,{brighter:function(e){return e=null==e?s:Math.pow(s,e),new I(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?a:Math.pow(a,e),new I(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new S(w(e>=240?e-240:e+120,i,r),w(e,i,r),w(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}))},68250:(e,t,n)=>{var r=n(49753),i=n(5681),o=n(80088),a=n(54732),s=n(59068);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},69011:(e,t,n)=>{var r=n(68250);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},69334:(e,t,n)=>{var r=n(51340),i=n(79968),o=n(3422),a=n(37930),s=n(30125),l=n(17099),c=n(84354),u=n(83546),h=n(24733),d=n(80393),f=n(93650),p=n(28486),g=n(97350),m=n(50424),_=n(75964),v=n(53142),y=n(75853),E=n(37681),A=n(41580),b=n(83943),T=n(81211),x=n(25288),S="[object Arguments]",R="[object Function]",C="[object Object]",L={};L[S]=L["[object Array]"]=L["[object ArrayBuffer]"]=L["[object DataView]"]=L["[object Boolean]"]=L["[object Date]"]=L["[object Float32Array]"]=L["[object Float64Array]"]=L["[object Int8Array]"]=L["[object Int16Array]"]=L["[object Int32Array]"]=L["[object Map]"]=L["[object Number]"]=L[C]=L["[object RegExp]"]=L["[object Set]"]=L["[object String]"]=L["[object Symbol]"]=L["[object Uint8Array]"]=L["[object Uint8ClampedArray]"]=L["[object Uint16Array]"]=L["[object Uint32Array]"]=!0,L["[object Error]"]=L[R]=L["[object WeakMap]"]=!1,e.exports=function e(t,n,O,M,I,w){var P,N=1&n,D=2&n,B=4&n;if(O&&(P=I?O(t,M,I,w):O(t)),void 0!==P)return P;if(!A(t))return t;var F=v(t);if(F){if(P=g(t),!N)return c(t,P)}else{var U=p(t),k=U==R||"[object GeneratorFunction]"==U;if(y(t))return l(t,N);if(U==C||U==S||k&&!I){if(P=D||k?{}:_(t),!N)return D?h(t,s(P,t)):u(t,a(P,t))}else{if(!L[U])return I?t:{};P=m(t,U,N)}}w||(w=new r);var G=w.get(t);if(G)return G;w.set(t,P),b(t)?t.forEach((function(r){P.add(e(r,n,O,r,t,w))})):E(t)&&t.forEach((function(r,i){P.set(i,e(r,n,O,i,t,w))}));var z=F?void 0:(B?D?f:d:D?x:T)(t);return i(z||t,(function(r,i){z&&(r=t[i=r]),o(P,i,e(r,n,O,i,t,w))})),P}},69454:e=>{e.exports=function(e){return e!=e}},69632:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},69740:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(24586);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},69968:(e,t,n)=>{var r=n(51035)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"});e.exports=r},70581:(e,t,n)=>{var r=n(49261);e.exports=function(e,t){return e&&e.length&&t&&t.length?r(e,t):e}},70674:(e,t,n)=>{var r=n(87379),i=n(65387),o=n(80547),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},70911:(e,t,n)=>{"use strict";n.d(t,{Z0:()=>s,fA:()=>o,hs:()=>a,vt:()=>i});var r=n(23172);function i(){var e=new r.tb(4);return r.tb!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function o(e,t,n,i){var o=new r.tb(4);return o[0]=e,o[1]=t,o[2]=n,o[3]=i,o}function a(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function s(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,e[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,e[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,e[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,e}i()},72532:(e,t,n)=>{var r=n(94715),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},72715:(e,t,n)=>{"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{A:()=>r})},73501:e=>{e.exports=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}},73712:(e,t,n)=>{"use strict";var r=n(54750);e.exports=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,i=e.stateHandler.getState;if(!t)throw new Error("Missing required dependency: reporter.");function o(t){var n=e.important?" !important; ":"; ";return(t.join(n)+n).trim()}function a(e){return i(e).object}return{makeDetectable:function(e,a,s){s||(s=a,a=e,e=null),(e=e||{}).debug,r.isIE(8)?s(a):function(a,s){var l=o(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),c=!1,u=window.getComputedStyle(a),h=a.offsetWidth,d=a.offsetHeight;function f(){function n(){if("static"===u.position){a.style.setProperty("position","relative",e.important?"important":"");var n=function(t,n,r,i){var o=r[i];"auto"!==o&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(o)&&(t.warn("An element that is positioned static has style."+i+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",n),n.style.setProperty(i,"0",e.important?"important":""))};n(t,a,u,"top"),n(t,a,u,"right"),n(t,a,u,"bottom"),n(t,a,u,"left")}}""!==u.position&&(n(),c=!0);var o=document.createElement("object");o.style.cssText=l,o.tabIndex=-1,o.type="text/html",o.setAttribute("aria-hidden","true"),o.onload=function(){c||n(),function e(t,n){if(!t.contentDocument){var r=i(t);return r.checkForObjectDocumentTimeoutId&&window.clearTimeout(r.checkForObjectDocumentTimeoutId),void(r.checkForObjectDocumentTimeoutId=setTimeout((function(){r.checkForObjectDocumentTimeoutId=0,e(t,n)}),100))}n(t.contentDocument)}(this,(function(e){s(a)}))},r.isIE()||(o.data="about:blank"),i(a)&&(a.appendChild(o),i(a).object=o,r.isIE()&&(o.data="about:blank"))}i(a).startSize={width:h,height:d},n?n.add(f):f()}(a,s)},addListener:function(e,t){function n(){t(e)}if(r.isIE(8))i(e).object={proxy:n},e.attachEvent("onresize",n);else{var o=a(e);if(!o)throw new Error("Element is not detectable by this strategy.");o.contentDocument.defaultView.addEventListener("resize",n)}},uninstall:function(e){if(i(e)){var t=a(e);t&&(r.isIE(8)?e.detachEvent("onresize",t.proxy):e.removeChild(t),i(e).checkForObjectDocumentTimeoutId&&window.clearTimeout(i(e).checkForObjectDocumentTimeoutId),delete i(e).object)}}}}},74535:(e,t,n)=>{var r=n(46285),i=n(36529),o=n(69632),a=n(41580);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},74630:(e,t,n)=>{"use strict";n.d(t,{jQ:()=>O,c9:()=>T,sY:()=>_,gq:()=>y,bT:()=>E,L2:()=>A,X$:()=>R,SA:()=>M,S7:()=>S,CR:()=>v,Gc:()=>at,Wh:()=>C,Zo:()=>ot,RH:()=>x,gT:()=>L,tT:()=>he,T3:()=>it,Cz:()=>rt,gl:()=>s,FZ:()=>tt,vA:()=>g});var r=n(69740),i=n(24586),o=n(1976);let a=function(e){return e.Normal="normal",e.PostProcessing="post-processing",e}({}),s=function(e){return e[e.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",e[e.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",e[e.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN",e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",e[e.FUNC_ADD=32774]="FUNC_ADD",e[e.BLEND_EQUATION=32777]="BLEND_EQUATION",e[e.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",e[e.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",e[e.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",e[e.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",e[e.MAX_EXT=32776]="MAX_EXT",e[e.MIN_EXT=32775]="MIN_EXT",e[e.BLEND_DST_RGB=32968]="BLEND_DST_RGB",e[e.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",e[e.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",e[e.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",e[e.BLEND_COLOR=32773]="BLEND_COLOR",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",e[e.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",e[e.STREAM_DRAW=35040]="STREAM_DRAW",e[e.STATIC_DRAW=35044]="STATIC_DRAW",e[e.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",e[e.BUFFER_SIZE=34660]="BUFFER_SIZE",e[e.BUFFER_USAGE=34661]="BUFFER_USAGE",e[e.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK",e[e.CULL_FACE=2884]="CULL_FACE",e[e.BLEND=3042]="BLEND",e[e.DITHER=3024]="DITHER",e[e.STENCIL_TEST=2960]="STENCIL_TEST",e[e.DEPTH_TEST=2929]="DEPTH_TEST",e[e.SCISSOR_TEST=3089]="SCISSOR_TEST",e[e.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",e[e.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",e[e.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",e[e.NO_ERROR=0]="NO_ERROR",e[e.INVALID_ENUM=1280]="INVALID_ENUM",e[e.INVALID_VALUE=1281]="INVALID_VALUE",e[e.INVALID_OPERATION=1282]="INVALID_OPERATION",e[e.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",e[e.CW=2304]="CW",e[e.CCW=2305]="CCW",e[e.LINE_WIDTH=2849]="LINE_WIDTH",e[e.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",e[e.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",e[e.CULL_FACE_MODE=2885]="CULL_FACE_MODE",e[e.FRONT_FACE=2886]="FRONT_FACE",e[e.DEPTH_RANGE=2928]="DEPTH_RANGE",e[e.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",e[e.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",e[e.DEPTH_FUNC=2932]="DEPTH_FUNC",e[e.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",e[e.STENCIL_FUNC=2962]="STENCIL_FUNC",e[e.STENCIL_FAIL=2964]="STENCIL_FAIL",e[e.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",e[e.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",e[e.STENCIL_REF=2967]="STENCIL_REF",e[e.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",e[e.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",e[e.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",e[e.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",e[e.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",e[e.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",e[e.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",e[e.VIEWPORT=2978]="VIEWPORT",e[e.SCISSOR_BOX=3088]="SCISSOR_BOX",e[e.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",e[e.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",e[e.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",e[e.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",e[e.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",e[e.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",e[e.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",e[e.RED_BITS=3410]="RED_BITS",e[e.GREEN_BITS=3411]="GREEN_BITS",e[e.BLUE_BITS=3412]="BLUE_BITS",e[e.ALPHA_BITS=3413]="ALPHA_BITS",e[e.DEPTH_BITS=3414]="DEPTH_BITS",e[e.STENCIL_BITS=3415]="STENCIL_BITS",e[e.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",e[e.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",e[e.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",e[e.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",e[e.SAMPLES=32937]="SAMPLES",e[e.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",e[e.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",e[e.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",e[e.DONT_CARE=4352]="DONT_CARE",e[e.FASTEST=4353]="FASTEST",e[e.NICEST=4354]="NICEST",e[e.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.RED=6403]="RED",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",e[e.VERTEX_SHADER=35633]="VERTEX_SHADER",e[e.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",e[e.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",e[e.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",e[e.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",e[e.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",e[e.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",e[e.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",e[e.SHADER_TYPE=35663]="SHADER_TYPE",e[e.DELETE_STATUS=35712]="DELETE_STATUS",e[e.LINK_STATUS=35714]="LINK_STATUS",e[e.VALIDATE_STATUS=35715]="VALIDATE_STATUS",e[e.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",e[e.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",e[e.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",e[e.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",e[e.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",e[e.NEVER=512]="NEVER",e[e.LESS=513]="LESS",e[e.EQUAL=514]="EQUAL",e[e.LEQUAL=515]="LEQUAL",e[e.GREATER=516]="GREATER",e[e.NOTEQUAL=517]="NOTEQUAL",e[e.GEQUAL=518]="GEQUAL",e[e.ALWAYS=519]="ALWAYS",e[e.KEEP=7680]="KEEP",e[e.REPLACE=7681]="REPLACE",e[e.INCR=7682]="INCR",e[e.DECR=7683]="DECR",e[e.INVERT=5386]="INVERT",e[e.INCR_WRAP=34055]="INCR_WRAP",e[e.DECR_WRAP=34056]="DECR_WRAP",e[e.VENDOR=7936]="VENDOR",e[e.RENDERER=7937]="RENDERER",e[e.VERSION=7938]="VERSION",e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9729]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",e[e.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",e[e.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",e[e.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",e[e.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE=5890]="TEXTURE",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e[e.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",e[e.TEXTURE0=33984]="TEXTURE0",e[e.TEXTURE1=33985]="TEXTURE1",e[e.TEXTURE2=33986]="TEXTURE2",e[e.TEXTURE3=33987]="TEXTURE3",e[e.TEXTURE4=33988]="TEXTURE4",e[e.TEXTURE5=33989]="TEXTURE5",e[e.TEXTURE6=33990]="TEXTURE6",e[e.TEXTURE7=33991]="TEXTURE7",e[e.TEXTURE8=33992]="TEXTURE8",e[e.TEXTURE9=33993]="TEXTURE9",e[e.TEXTURE10=33994]="TEXTURE10",e[e.TEXTURE11=33995]="TEXTURE11",e[e.TEXTURE12=33996]="TEXTURE12",e[e.TEXTURE13=33997]="TEXTURE13",e[e.TEXTURE14=33998]="TEXTURE14",e[e.TEXTURE15=33999]="TEXTURE15",e[e.TEXTURE16=34e3]="TEXTURE16",e[e.TEXTURE17=34001]="TEXTURE17",e[e.TEXTURE18=34002]="TEXTURE18",e[e.TEXTURE19=34003]="TEXTURE19",e[e.TEXTURE20=34004]="TEXTURE20",e[e.TEXTURE21=34005]="TEXTURE21",e[e.TEXTURE22=34006]="TEXTURE22",e[e.TEXTURE23=34007]="TEXTURE23",e[e.TEXTURE24=34008]="TEXTURE24",e[e.TEXTURE25=34009]="TEXTURE25",e[e.TEXTURE26=34010]="TEXTURE26",e[e.TEXTURE27=34011]="TEXTURE27",e[e.TEXTURE28=34012]="TEXTURE28",e[e.TEXTURE29=34013]="TEXTURE29",e[e.TEXTURE30=34014]="TEXTURE30",e[e.TEXTURE31=34015]="TEXTURE31",e[e.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",e[e.REPEAT=10497]="REPEAT",e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D",e[e.SAMPLER_CUBE=35680]="SAMPLER_CUBE",e[e.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",e[e.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",e[e.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",e[e.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",e[e.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",e[e.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",e[e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",e[e.COMPILE_STATUS=35713]="COMPILE_STATUS",e[e.LOW_FLOAT=36336]="LOW_FLOAT",e[e.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",e[e.HIGH_FLOAT=36338]="HIGH_FLOAT",e[e.LOW_INT=36339]="LOW_INT",e[e.MEDIUM_INT=36340]="MEDIUM_INT",e[e.HIGH_INT=36341]="HIGH_INT",e[e.FRAMEBUFFER=36160]="FRAMEBUFFER",e[e.RENDERBUFFER=36161]="RENDERBUFFER",e[e.RGBA4=32854]="RGBA4",e[e.RGB5_A1=32855]="RGB5_A1",e[e.RGB565=36194]="RGB565",e[e.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",e[e.STENCIL_INDEX=6401]="STENCIL_INDEX",e[e.STENCIL_INDEX8=36168]="STENCIL_INDEX8",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e[e.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",e[e.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",e[e.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",e[e.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",e[e.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",e[e.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",e[e.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",e[e.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",e[e.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",e[e.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",e[e.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",e[e.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",e[e.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",e[e.NONE=0]="NONE",e[e.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",e[e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",e[e.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",e[e.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",e[e.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",e[e.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",e[e.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",e[e.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",e[e.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",e[e.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",e[e.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",e[e.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",e}({});const{camelCase:l,isNil:c,upperFirst:u}=o.uG;class h{constructor(){(0,i.A)(this,"shaderModuleService",void 0),(0,i.A)(this,"rendererService",void 0),(0,i.A)(this,"config",void 0),(0,i.A)(this,"quad","attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}"),(0,i.A)(this,"enabled",!0),(0,i.A)(this,"renderToScreen",!1),(0,i.A)(this,"model",void 0),(0,i.A)(this,"name",void 0),(0,i.A)(this,"optionsToUpdate",{})}getName(){return this.name}setName(e){this.name=e}getType(){return a.PostProcessing}init(e,t){this.config=t,this.rendererService=e.getContainer().rendererService,this.shaderModuleService=e.getContainer().shaderModuleService;const{createAttribute:n,createBuffer:i,createModel:o}=this.rendererService,{vs:a,fs:l,uniforms:c}=this.setupShaders();this.model=o({vs:a,fs:l,attributes:{a_Position:n({buffer:i({data:[-4,-4,4,-4,0,4],type:s.FLOAT}),size:2})},uniforms:(0,r.A)((0,r.A)({u_Texture:null},c),this.config&&this.convertOptionsToUniforms(this.config)),depth:{enable:!1},count:3,blend:{enable:"copy"===this.getName()}})}render(e,t){const n=e.multiPassRenderer.getPostProcessor(),{useFramebuffer:i,getViewportSize:o,clear:a}=this.rendererService,{width:s,height:l}=o();i(this.renderToScreen?null:n.getWriteFBO(),(()=>{a({framebuffer:n.getWriteFBO(),color:[0,0,0,0],depth:1,stencil:0});const e=(0,r.A)({u_BloomFinal:0,u_Texture:n.getReadFBO(),u_ViewportSize:[s,l]},this.convertOptionsToUniforms(this.optionsToUpdate));t&&(e.u_BloomFinal=1,e.u_Texture2=t),this.model.draw({uniforms:e})}))}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}setRenderToScreen(e){this.renderToScreen=e}updateOptions(e){this.optionsToUpdate=(0,r.A)((0,r.A)({},this.optionsToUpdate),e)}setupShaders(){throw new Error("Method not implemented.")}convertOptionsToUniforms(e){const t={};return Object.keys(e).forEach((n=>{c(e[n])||(t[`u_${u(l(n))}`]=e[n])})),t}}const d=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function f(e,t=!1){const n={};return{content:e=e.replace(d,((e,r,i)=>{const o=i.split(":"),a=o[0].trim();let s="";switch(o.length>1&&(s=o[1].trim()),r){case"bool":s="true"===s;break;case"float":case"int":s=Number(s);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":s=s?s.replace("[","").replace("]","").split(",").reduce(((e,t)=>(e.push(Number(t.trim())),e)),[]):new Array(function(e){let t=0;switch(e){case"vec2":case"ivec2":t=2;break;case"vec3":case"ivec3":t=3;break;case"vec4":case"ivec4":case"mat2":t=4;break;case"mat3":t=9;break;case"mat4":t=16}return t}(r)).fill(0)}return n[a]=s,`${t?"uniform ":""}${r} ${a};\n`})),uniforms:n}}function p(e){let{content:t,uniforms:n}=f(e,!0);return t=t.replace(/(\s*uniform\s*.*\s*){((?:\s*.*\s*)*?)};/g,((e,t,r)=>{r=r.trim().replace(/^.*$/gm,(e=>`uniform ${e}`));const{content:i,uniforms:o}=f(r);return Object.assign(n,o),`${t}{\n${i}\n};`})),{content:t,uniforms:n}}function g(e){const t={};return e.replace(d,((e,n,r)=>{const i=r.trim();return t[i]?"":(t[i]=!0,`uniform ${n} ${i};\n`)}))}const{clamp:m}=o.uG,_={ProjectionMatrix:"u_ProjectionMatrix",ViewMatrix:"u_ViewMatrix",ViewProjectionMatrix:"u_ViewProjectionMatrix",Zoom:"u_Zoom",ZoomScale:"u_ZoomScale",FocalDistance:"u_FocalDistance",CameraPosition:"u_CameraPosition"};let v=function(e){return e.TOPRIGHT="topright",e.TOPLEFT="topleft",e.BOTTOMRIGHT="bottomright",e.BOTTOMLEFT="bottomleft",e.TOPCENTER="topcenter",e.BOTTOMCENTER="bottomcenter",e.LEFTCENTER="leftcenter",e.RIGHTCENTER="rightcenter",e.LEFTTOP="lefttop",e.RIGHTTOP="righttop",e.LEFTBOTTOM="leftbottom",e.RIGHTBOTTOM="rightbottom",e}({}),y=function(e){return e[e.LNGLAT=1]="LNGLAT",e[e.LNGLAT_OFFSET=2]="LNGLAT_OFFSET",e[e.VECTOR_TILE=3]="VECTOR_TILE",e[e.IDENTITY=4]="IDENTITY",e[e.METER_OFFSET=5]="METER_OFFSET",e}({});const E={CoordinateSystem:"u_CoordinateSystem",ViewportCenter:"u_ViewportCenter",ViewportCenterProjection:"u_ViewportCenterProjection",PixelsPerDegree:"u_PixelsPerDegree",PixelsPerDegree2:"u_PixelsPerDegree2",PixelsPerMeter:"u_PixelsPerMeter"};var A={MapInitStart:"mapInitStart",LayerInitStart:"layerInitStart",LayerInitEnd:"layerInitEnd",SourceInitStart:"sourceInitStart",SourceInitEnd:"sourceInitEnd",ScaleInitStart:"scaleInitStart",ScaleInitEnd:"scaleInitEnd",MappingStart:"mappingStart",MappingEnd:"mappingEnd",BuildModelStart:"buildModelStart",BuildModelEnd:"buildModelEnd"};let b=function(e){return e.Hover="hover",e.Click="click",e.Select="select",e.Active="active",e.Drag="drag",e}({}),T=function(e){return e.normal="normal",e.additive="additive",e.subtractive="subtractive",e.min="min",e.max="max",e.none="none",e}({}),x=function(e){return e.MULTIPLE="MULTIPLE",e.SINGLE="SINGLE",e}({}),S=function(e){return e.AND="and",e.OR="or",e}({}),R=function(e){return e.INIT="init",e.UPDATE="update",e}({}),C=function(e){return e.LINEAR="linear",e.SEQUENTIAL="sequential",e.POWER="power",e.LOG="log",e.IDENTITY="identity",e.TIME="time",e.QUANTILE="quantile",e.QUANTIZE="quantize",e.THRESHOLD="threshold",e.CAT="cat",e.DIVERGING="diverging",e.CUSTOM="threshold",e}({}),L=function(e){return e.CONSTANT="constant",e.VARIABLE="variable",e}({}),O=function(e){return e[e.Attribute=0]="Attribute",e[e.InstancedAttribute=1]="InstancedAttribute",e[e.Uniform=2]="Uniform",e}({});const M=["mapload","mapchange","mapAfterFrameChange"];var I=n(56561),w=n.n(I),P=n(28985),N=n.n(P);function D(e,t,n){for(const i of t){const{icon:t,xOffset:o}=i;e[t.id]=(0,r.A)((0,r.A)({},t),{},{x:o,y:n,image:t.image,width:t.width,height:t.height})}}function B(e){return Math.pow(2,Math.ceil(Math.log2(e)))}const F=function(){const e=[];for(let t=32;t<128;t++)e.push(String.fromCharCode(t));return e}();function U(e,t,n,r){e.font=`${r} ${n}px ${t}`,e.fillStyle="black",e.textBaseline="middle"}function k(e,t){for(let n=0;n<e.length;n++)t.data[4*n+3]=e[n]}class G extends P.EventEmitter{constructor(...e){super(...e),(0,i.A)(this,"fontAtlas",void 0),(0,i.A)(this,"iconFontMap",void 0),(0,i.A)(this,"iconFontGlyphs",{}),(0,i.A)(this,"fontOptions",void 0),(0,i.A)(this,"key",void 0),(0,i.A)(this,"cache",new o.qK(3))}get scale(){return 1}get canvas(){const e=this.cache.get(this.key);return e&&e.data}get mapping(){const e=this.cache.get(this.key);return e&&e.mapping||{}}getCanvasByKey(e){const t=this.cache.get(e);return t&&t.data}getMappingByKey(e){const t=this.cache.get(e);return t&&t.mapping||{}}init(){this.cache.clear(),this.fontOptions={fontFamily:"sans-serif",fontWeight:"normal",characterSet:F,fontSize:24,buffer:3,sdf:!0,cutoff:.25,radius:8,iconfont:!1},this.key="",this.iconFontMap=new Map}addIconGlyphs(e){e.forEach((e=>{this.iconFontGlyphs[e.name]=e.unicode}))}addIconFont(e,t){this.iconFontMap.set(e,t)}getIconFontKey(e){return this.iconFontMap.get(e)||e}getGlyph(e){return this.iconFontGlyphs[e]?String.fromCharCode(parseInt(this.iconFontGlyphs[e],16)):""}setFontOptions(e){this.fontOptions=(0,r.A)((0,r.A)({},this.fontOptions),e),this.key=this.getKey();const t=this.getNewChars(this.key,this.fontOptions.characterSet),n=this.cache.get(this.key);if(n&&0===t.length)return;const i=this.generateFontAtlas(this.key,t,n);this.fontAtlas=i,this.cache.set(this.key,i)}addFontFace(e,t){const n=document.createElement("style");n.type="text/css",n.innerText=`\n @font-face{\n font-family: '${e}';\n src: url('${t}') format('woff2'),\n url('${t}') format('woff'),\n url('${t}') format('truetype');\n }`,n.onload=()=>{if(document.fonts)try{document.fonts.load(`24px ${e}`,"L7text"),document.fonts.ready.then((()=>{this.emit("fontloaded",{fontFamily:e})}))}catch(e){console.warn("当前环境不支持 document.fonts !"),console.warn("当前环境不支持 iconfont !"),console.warn(e)}},document.getElementsByTagName("head")[0].appendChild(n)}destroy(){this.cache.clear(),this.iconFontMap.clear()}generateFontAtlas(e,t,n){const{fontFamily:i,fontWeight:o,fontSize:a,buffer:s,sdf:l,radius:c,cutoff:u,iconfont:h}=this.fontOptions;let d=n&&n.data;d||(d=window.document.createElement("canvas"),d.width=1024);const f=d.getContext("2d",{willReadFrequently:!0});U(f,i,a,o);const{mapping:p,canvasHeight:g,xOffset:m,yOffset:_}=function({characterSet:e,getFontWidth:t,fontHeight:n,buffer:r,maxCanvasWidth:i,mapping:o={},xOffset:a=0,yOffset:s=0}){let l=0,c=a;Array.from(e).forEach(((e,n)=>{if(!o[e]){const r=t(e,n);c+30>i&&(c=0,l++),o[e]={x:c,y:s+30*l,width:30,height:30,advance:r},c+=30}}));const u=n+2*r;return{mapping:o,xOffset:c,yOffset:s+l*u,canvasHeight:B(s+(l+1)*u)}}((0,r.A)({getFontWidth:e=>f.measureText(e).width,fontHeight:1*a,buffer:s,characterSet:t,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),v=f.getImageData(0,0,d.width,d.height);if(d.height=g,f.putImageData(v,0,0),U(f,i,a,o),l){const e=new(w())(a,s,c,u,i,o),n=f.getImageData(0,0,e.size,e.size);for(const r of t){if(h){const t=String.fromCharCode(parseInt(r.replace("&#x","").replace(";",""),16));k(e.draw(t),n)}else k(e.draw(r),n);f.putImageData(n,p[r].x,p[r].y)}}else for(const e of t)f.fillText(e,p[e].x,p[e].y+1*a);return{xOffset:m,yOffset:_,mapping:p,data:d,width:d.width,height:d.height}}getKey(){const{fontFamily:e,fontWeight:t}=this.fontOptions;return`${e}_${t}`}getNewChars(e,t){const n=this.cache.get(e);if(!n)return t;const r=[],i=n.mapping,o=new Set(Object.keys(i));return new Set(t).forEach((e=>{o.has(e)||r.push(e)})),r}}var z=n(86330);class j extends P.EventEmitter{constructor(...e){super(...e),(0,i.A)(this,"canvasHeight",128),(0,i.A)(this,"texture",void 0),(0,i.A)(this,"canvas",void 0),(0,i.A)(this,"iconData",void 0),(0,i.A)(this,"iconMap",void 0),(0,i.A)(this,"ctx",void 0),(0,i.A)(this,"loadingImageCount",0)}isLoading(){return 0===this.loadingImageCount}init(){this.iconData=[],this.iconMap={},this.canvas=window.document.createElement("canvas"),this.canvas.width=128,this.canvas.height=128,this.ctx=this.canvas.getContext("2d")}addImage(e,t){var n=this;return(0,z.A)((function*(){let r=new Image;n.loadingImageCount++,n.hasImage(e)?console.warn("Image Id already exists"):n.iconData.push({id:e,size:64}),n.updateIconMap(),r=yield n.loadImage(t);const i=n.iconData.find((t=>t.id===e));i&&(i.image=r,i.width=r.width,i.height=r.height),n.update()}))()}addImageMini(e,t,n){const r=n.getSceneConfig().canvas;let i=r.createImage();if(this.loadingImageCount++,this.hasImage(e))throw new Error("Image Id already exists");this.iconData.push({id:e,size:64}),this.updateIconMap(),this.loadImageMini(t,r).then((t=>{i=t;const n=this.iconData.find((t=>t.id===e));n&&(n.image=i,n.width=i.width,n.height=i.height),this.update()}))}getTexture(){return this.texture}getIconMap(){return this.iconMap}getCanvas(){return this.canvas}hasImage(e){return this.iconMap.hasOwnProperty(e)}removeImage(e){this.hasImage(e)&&(this.iconData=this.iconData.filter((t=>t.id!==e)),delete this.iconMap[e],this.update())}destroy(){this.removeAllListeners("imageUpdate"),this.iconData=[],this.iconMap={}}loadImage(e){return new Promise(((t,n)=>{if(e instanceof HTMLImageElement)return void t(e);const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{t(r)},r.onerror=()=>{n(new Error("Could not load image at "+e))},r.src=e instanceof File?URL.createObjectURL(e):e}))}update(){this.updateIconMap(),this.updateIconAtlas(),this.loadingImageCount--,0===this.loadingImageCount&&this.emit("imageUpdate")}updateIconAtlas(){this.canvas.width=1024,this.canvas.height=this.canvasHeight,Object.keys(this.iconMap).forEach((e=>{const{x:t,y:n,image:r,width:i=64,height:o=64}=this.iconMap[e],a=Math.max(i,o)/64,s=o/a,l=i/a;r&&this.ctx.drawImage(r,t+(64-l)/2,n+(64-s)/2,l,s)}))}updateIconMap(){const{mapping:e,canvasHeight:t}=function(e){let t=0,n=0,r=0,i=[];const o={};for(const a of e)if(!o[a.id]){const{size:e}=a;t+e+3>1024&&(D(o,i,n),t=0,n=r+n+3,r=0,i=[]),i.push({icon:a,xOffset:t}),t=t+e+3,r=Math.max(r,e)}return i.length>0&&D(o,i,n),{mapping:o,canvasHeight:B(r+n+3)}}(this.iconData);this.iconMap=e,this.canvasHeight=t}loadImageMini(e,t){return new Promise(((n,r)=>{const i=t.createImage();i.crossOrigin="anonymous",i.onload=()=>{n(i)},i.onerror=()=>{r(new Error("Could not load image at "+e))},i.src=e}))}}var V=n(39095);class H{constructor(){(0,i.A)(this,"viewport",void 0),(0,i.A)(this,"overridedViewProjectionMatrix",void 0),(0,i.A)(this,"viewMatrixInverse",void 0),(0,i.A)(this,"cameraPosition",void 0)}init(){}update(e){this.viewport=e,this.viewMatrixInverse=V.vt(),V.B8(this.viewMatrixInverse,e.getViewMatrix()),this.cameraPosition=[this.viewMatrixInverse[12],this.viewMatrixInverse[13],this.viewMatrixInverse[14]]}getProjectionMatrix(){return this.viewport.getProjectionMatrix()}getModelMatrix(){return this.viewport.getModelMatrix()}getViewMatrix(){return this.viewport.getViewMatrix()}getViewMatrixUncentered(){return this.viewport.getViewMatrixUncentered()}getViewProjectionMatrixUncentered(){return this.viewport.getViewProjectionMatrixUncentered()}getViewProjectionMatrix(){return this.overridedViewProjectionMatrix||this.viewport.getViewProjectionMatrix()}getZoom(){return this.viewport.getZoom()}getZoomScale(){return this.viewport.getZoomScale()}getCenter(){const[e,t]=this.viewport.getCenter();return[e,t]}getFocalDistance(){return this.viewport.getFocalDistance()}getCameraPosition(){return this.cameraPosition}projectFlat(e,t){return this.viewport.projectFlat(e,t)}setViewProjectionMatrix(e){this.overridedViewProjectionMatrix=e}}const W={topleft:"column",topright:"column",bottomright:"column",bottomleft:"column",leftcenter:"column",rightcenter:"column",topcenter:"row",bottomcenter:"row",lefttop:"row",righttop:"row",leftbottom:"row",rightbottom:"row"};class X{constructor(){(0,i.A)(this,"container",void 0),(0,i.A)(this,"controlCorners",void 0),(0,i.A)(this,"controlContainer",void 0),(0,i.A)(this,"scene",void 0),(0,i.A)(this,"mapsService",void 0),(0,i.A)(this,"controls",[]),(0,i.A)(this,"unAddControls",[])}init(e,t){this.container=e.container,this.scene=t,this.mapsService=t.mapService,this.initControlPos()}addControl(e,t){t.mapService.map?(e.addTo(this.scene),this.controls.push(e)):this.unAddControls.push(e)}getControlByName(e){return this.controls.find((t=>t.controlOption.name===e))}removeControl(e){const t=this.controls.indexOf(e);return t>-1&&this.controls.splice(t,1),e.remove(),this}addControls(){this.unAddControls.forEach((e=>{e.addTo(this.scene),this.controls.push(e)})),this.unAddControls=[]}destroy(){for(const e of this.controls)e.remove();this.controls=[],this.clearControlPos()}initControlPos(){const e=this.controlCorners={},t=this.controlContainer=o.dv.create("div","l7-control-container",this.container);Object.values(v).forEach((n=>{var r;!function(n=[]){const r=n.map((e=>"l7-"+e)).join(" ");e[n.filter((e=>!["row","column"].includes(e))).join("")]=o.dv.create("div",r,t)}((r=n,[...r.replace(/^(top|bottom|left|right|center)/,"$1-").split("-"),W[r]]))})),this.checkCornerOverlap()}clearControlPos(){for(const e in this.controlCorners)this.controlCorners[e]&&o.dv.remove(this.controlCorners[e]);this.controlContainer&&o.dv.remove(this.controlContainer)}checkCornerOverlap(){const e=window.MutationObserver;if(e)for(const t of Object.keys(this.controlCorners)){const n=t.match(/^(top|bottom)(left|right)$/);if(n){const[,t,r]=n,i=this.controlCorners[`${t}${r}`];new e((([{target:e}])=>{i&&(i.style[t]=e.clientHeight+"px")})).observe(this.controlCorners[`${r}${t}`],{childList:!0,attributes:!0})}}}}class Z{constructor(){(0,i.A)(this,"container",void 0),(0,i.A)(this,"scene",void 0),(0,i.A)(this,"mapsService",void 0),(0,i.A)(this,"markers",[]),(0,i.A)(this,"markerLayers",[]),(0,i.A)(this,"unAddMarkers",[]),(0,i.A)(this,"unAddMarkerLayers",[])}addMarkerLayer(e){this.mapsService.map&&this.mapsService.getMarkerContainer()?(this.markerLayers.push(e),e.addTo(this.scene)):this.unAddMarkerLayers.push(e)}removeMarkerLayer(e){e.destroy(),this.markerLayers.indexOf(e);const t=this.markerLayers.indexOf(e);t>-1&&this.markerLayers.splice(t,1)}addMarker(e){this.mapsService.map&&this.mapsService.getMarkerContainer()?(this.markers.push(e),e.addTo(this.scene)):this.unAddMarkers.push(e)}addMarkers(){this.unAddMarkers.forEach((e=>{e.addTo(this.scene),this.markers.push(e)})),this.unAddMarkers=[]}addMarkerLayers(){this.unAddMarkerLayers.forEach((e=>{this.markerLayers.push(e),e.addTo(this.scene)})),this.unAddMarkers=[]}removeMarker(e){e.remove(),this.markers.indexOf(e);const t=this.markers.indexOf(e);t>-1&&this.markers.splice(t,1)}removeAllMarkers(){this.destroy()}init(e){this.scene=e,this.mapsService=e.mapService}destroy(){this.markers.forEach((e=>{e.remove()})),this.markers=[],this.markerLayers.forEach((e=>{e.destroy()})),this.markerLayers=[]}removeMakerLayerMarker(e){e.destroy()}}class Y{constructor(){(0,i.A)(this,"scene",void 0),(0,i.A)(this,"mapsService",void 0),(0,i.A)(this,"popups",[]),(0,i.A)(this,"unAddPopups",[])}get isMarkerReady(){return this.mapsService.map&&this.mapsService.getMarkerContainer()}removePopup(e){null!=e&&e.isOpen()&&e.remove();const t=this.popups.indexOf(e);t>-1&&this.popups.splice(t,1);const n=this.unAddPopups.indexOf(e);n>-1&&this.unAddPopups.splice(n,1)}destroy(){this.popups.forEach((e=>e.remove()))}addPopup(e){e&&e.getOptions().autoClose&&[...this.popups,...this.unAddPopups].forEach((e=>{e.getOptions().autoClose&&this.removePopup(e)})),this.isMarkerReady?(e.addTo(this.scene),this.popups.push(e)):this.unAddPopups.push(e),e.on("close",(()=>{this.removePopup(e)}))}initPopup(){this.unAddPopups.length&&this.unAddPopups.forEach((e=>{this.addPopup(e),this.unAddPopups=[]}))}init(e){this.scene=e,this.mapsService=e.mapService}}const q={MapToken:"您正在使用 Demo 测试 Token, 生产环境务必自行注册 Token 确保服务稳定 高德地图申请地址 https://lbs.amap.com/api/javascript-api/guide/abc/prepare Mapbox地图申请地址 https://docs.mapbox.com/help/glossary/access-token/",SDK:"请确认引入了mapbox-gl api且在L7之前引入"},{merge:K}=o.uG,Q={id:"map",logoPosition:"bottomleft",logoVisible:!0,antialias:!0,stencil:!0,preserveDrawingBuffer:!1,pickBufferScale:1,fitBoundsOptions:{animate:!1}},$={colors:["rgb(103,0,31)","rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(247,247,247)","rgb(209,229,240)","rgb(146,197,222)","rgb(67,147,195)","rgb(33,102,172)","rgb(5,48,97)"],size:10,shape:"circle",scales:{},shape2d:["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],shape3d:["cylinder","triangleColumn","hexagonColumn","squareColumn"],minZoom:-1,maxZoom:24,visible:!0,autoFit:!1,pickingBuffer:0,enablePropagation:!1,zIndex:0,blend:"normal",maskLayers:[],enableMask:!0,maskOperation:S.AND,pickedFeatureID:-1,enableMultiPassRenderer:!1,enablePicking:!0,active:!1,activeColor:"#2f54eb",enableHighlight:!1,enableSelect:!1,highlightColor:"#2f54eb",activeMix:0,selectColor:"blue",selectMix:0,enableLighting:!1,animateOption:{enable:!1,interval:.2,duration:4,trailLength:.15},forward:!0};var J=n(70911);const ee=Math.PI/180,te=4003e4;function ne({latitude:e=0,zoom:t=0,scale:n,highPrecision:r=!1,flipY:i=!1}){const o={},a=512*(n=void 0!==n?n:Math.pow(2,t)),s=Math.cos(e*ee),l=a/360,c=l/s,u=a/te/s;if(o.pixelsPerMeter=[u,-u,u],o.metersPerPixel=[1/u,-1/u,1/u],o.pixelsPerDegree=[l,-c,u],o.degreesPerPixel=[1/l,-1/c,1/u],r){const t=ee*Math.tan(e*ee)/s,n=l*t/2,r=a/te*t,h=r/c*u;o.pixelsPerDegree2=[0,-n,r],o.pixelsPerMeter2=[h,0,h],i&&(o.pixelsPerDegree2[1]=-o.pixelsPerDegree2[1],o.pixelsPerMeter2[1]=-o.pixelsPerMeter2[1])}return i&&(o.pixelsPerMeter[1]=-o.pixelsPerMeter[1],o.metersPerPixel[1]=-o.metersPerPixel[1],o.pixelsPerDegree[1]=-o.pixelsPerDegree[1],o.degreesPerPixel[1]=-o.degreesPerPixel[1]),o}const re=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];class ie{constructor(e){(0,i.A)(this,"needRefresh",!0),(0,i.A)(this,"coordinateSystem",void 0),(0,i.A)(this,"viewportCenter",void 0),(0,i.A)(this,"viewportCenterProjection",void 0),(0,i.A)(this,"pixelsPerDegree",void 0),(0,i.A)(this,"pixelsPerDegree2",void 0),(0,i.A)(this,"pixelsPerMeter",void 0),this.cameraService=e}refresh(e){const t=this.cameraService.getZoom(),n=e||this.cameraService.getCenter(),{pixelsPerMeter:r,pixelsPerDegree:i}=ne({latitude:n[1],zoom:t});this.viewportCenter=n,this.viewportCenterProjection=[0,0,0,0],this.pixelsPerMeter=r,this.pixelsPerDegree=i,this.pixelsPerDegree2=[0,0,0],this.coordinateSystem===y.LNGLAT?this.cameraService.setViewProjectionMatrix(void 0):this.coordinateSystem===y.LNGLAT_OFFSET&&this.calculateLnglatOffset(n,t),this.needRefresh=!1}getCoordinateSystem(){return this.coordinateSystem}setCoordinateSystem(e){this.coordinateSystem=e}getViewportCenter(){return this.viewportCenter}getViewportCenterProjection(){return this.viewportCenterProjection}getPixelsPerDegree(){return this.pixelsPerDegree}getPixelsPerDegree2(){return this.pixelsPerDegree2}getPixelsPerMeter(){return this.pixelsPerMeter}calculateLnglatOffset(e,t,n,r){const{pixelsPerMeter:i,pixelsPerDegree:o,pixelsPerDegree2:a}=ne({latitude:e[1],zoom:t,scale:n,flipY:r,highPrecision:!0});let s=this.cameraService.getViewMatrix();const l=this.cameraService.getProjectionMatrix();let c=V.lw([],l,s);const u=this.cameraService.projectFlat([Math.fround(e[0]),Math.fround(e[1])],Math.pow(2,t));this.viewportCenterProjection=J.Z0([],[u[0],u[1],0,1],c),s=this.cameraService.getViewMatrixUncentered()||s,c=V.lw([],l,s),c=V.lw([],c,re),this.cameraService.setViewProjectionMatrix(c),this.pixelsPerMeter=i,this.pixelsPerDegree=o,this.pixelsPerDegree2=a}}class oe extends P.EventEmitter{constructor(...e){super(...e),(0,i.A)(this,"renderMap",new Map),(0,i.A)(this,"enable",!1),(0,i.A)(this,"renderEnable",!1),(0,i.A)(this,"cacheLogs",{})}setEnable(e){this.enable=!!e}log(e,t){if(!this.enable)return;const n=e.split(".");let i=null;n.forEach(((e,o)=>{null!==i?(i[e]||(i[e]={}),o!==n.length-1&&(i=i[e])):(this.cacheLogs[e]||(this.cacheLogs[e]={}),o!==n.length-1&&(i=this.cacheLogs[e])),o===n.length-1&&(i[e]=(0,r.A)((0,r.A)({time:Date.now()},i[e]),t))}))}getLog(e){switch(typeof e){case"string":return this.cacheLogs[e];case"object":return e.map((e=>this.cacheLogs[e])).filter((e=>void 0!==e));case"undefined":return this.cacheLogs}}removeLog(e){delete this.cacheLogs[e]}generateRenderUid(){return this.renderEnable?(0,o.Os)():""}renderDebug(e){this.renderEnable=e}renderStart(e){if(!this.renderEnable||!this.enable)return;const t=this.renderMap.get(e)||{};this.renderMap.set(e,(0,r.A)((0,r.A)({},t),{},{renderUid:e,renderStart:Date.now()}))}renderEnd(e){if(!this.renderEnable||!this.enable)return;const t=this.renderMap.get(e);if(t){const n=t.renderStart,i=Date.now();this.emit("renderEnd",(0,r.A)((0,r.A)({},t),{},{renderEnd:i,renderDuration:i-n})),this.renderMap.delete(e)}}destroy(){this.cacheLogs=null,this.renderMap.clear()}}var ae=n(99545),se=n.n(ae);const le={panstart:"dragstart",panmove:"dragging",panend:"dragend",pancancel:"dragcancel"};class ce extends(N()){get mapService(){return this.container.mapService}constructor(e){super(),(0,i.A)(this,"indragging",!1),(0,i.A)(this,"hammertime",void 0),(0,i.A)(this,"lastClickTime",0),(0,i.A)(this,"lastClickXY",[-1,-1]),(0,i.A)(this,"clickTimer",void 0),(0,i.A)(this,"$containter",void 0),(0,i.A)(this,"onDrag",(e=>{const t=this.interactionEvent(e);t.type=le[t.type],"dragging"===t.type?this.indragging=!0:this.indragging=!1,this.emit(b.Drag,t)})),(0,i.A)(this,"onHammer",(e=>{e.srcEvent.stopPropagation();const t=this.interactionEvent(e);this.emit(b.Hover,t)})),(0,i.A)(this,"onTouch",(e=>{const t=e.touches[0];this.onHover({clientX:t.clientX,clientY:t.clientY,type:"touchstart"})})),(0,i.A)(this,"onTouchEnd",(e=>{if(e.changedTouches.length>0){const t=e.changedTouches[0];this.onHover({clientX:t.clientX,clientY:t.clientY,type:"touchend"})}})),(0,i.A)(this,"onTouchMove",(e=>{const t=e.changedTouches[0];this.onHover({clientX:t.clientX,clientY:t.clientY,type:"touchmove"})})),(0,i.A)(this,"onHover",(e=>{const{clientX:t,clientY:n}=e;let r=t,i=n;const o=e.type,a=this.mapService.getMapContainer();if(a){const{top:e,left:t}=a.getBoundingClientRect();r=r-t-a.clientLeft,i=i-e-a.clientTop}const s=this.mapService.containerToLngLat([r,i]);"click"!==o&&"touch"!==o?"click"!==o&&"dblclick"!==o&&this.emit(b.Hover,{x:r,y:i,lngLat:s,type:o,target:e}):this.isDoubleTap(r,i,s)})),this.container=e}init(){this.addEventListenerOnMap(),this.$containter=this.mapService.getMapContainer()}destroy(){this.hammertime&&this.hammertime.destroy(),this.removeEventListenerOnMap(),this.off(b.Hover)}triggerHover({x:e,y:t}){this.emit(b.Hover,{x:e,y:t})}triggerSelect(e){this.emit(b.Select,{featureId:e})}triggerActive(e){this.emit(b.Active,{featureId:e})}addEventListenerOnMap(){const e=this.mapService.getMapContainer();if(e){const t=new(se().Manager)(e);t.add(new(se().Tap)({event:"dblclick",taps:2})),t.add(new(se().Tap)({event:"click"})),t.add(new(se().Pan)({threshold:0,pointers:0})),t.add(new(se().Press)({})),t.on("dblclick click",this.onHammer),t.on("panstart panmove panend pancancel",this.onDrag),e.addEventListener("touchstart",this.onTouch),e.addEventListener("touchend",this.onTouchEnd),e.addEventListener("mousemove",this.onHover),e.addEventListener("touchmove",this.onTouchMove),e.addEventListener("mousedown",this.onHover,!0),e.addEventListener("mouseup",this.onHover),e.addEventListener("contextmenu",this.onHover),this.hammertime=t}}removeEventListenerOnMap(){const e=this.mapService.getMapContainer();e&&(e.removeEventListener("mousemove",this.onHover),this.hammertime.off("dblclick click",this.onHammer),this.hammertime.off("panstart panmove panend pancancel",this.onDrag),e.removeEventListener("touchstart",this.onTouch),e.removeEventListener("touchend",this.onTouchEnd),e.removeEventListener("mousedown",this.onHover),e.removeEventListener("mouseup",this.onHover),e.removeEventListener("contextmenu",this.onHover))}interactionEvent(e){const{type:t,pointerType:n}=e;let r,i;"touch"===n?(i=Math.floor(e.pointers[0].clientY),r=Math.floor(e.pointers[0].clientX)):(i=Math.floor(e.srcEvent.y),r=Math.floor(e.srcEvent.x));const o=this.mapService.getMapContainer();if(o){const{top:e,left:t}=o.getBoundingClientRect();r-=t,i-=e}return{x:r,y:i,lngLat:this.mapService.containerToLngLat([r,i]),type:t,target:e.srcEvent}}isDoubleTap(e,t,n){const r=(new Date).getTime();let i="click";r-this.lastClickTime<400&&Math.abs(this.lastClickXY[0]-e)<10&&Math.abs(this.lastClickXY[1]-t)<10?(this.lastClickTime=0,this.lastClickXY=[-1,-1],this.clickTimer&&clearTimeout(this.clickTimer),i="dblclick",this.emit(b.Hover,{x:e,y:t,lngLat:n,type:i})):(this.lastClickTime=r,this.lastClickXY=[e,t],this.clickTimer=setTimeout((()=>{i="click",this.emit(b.Hover,{x:e,y:t,lngLat:n,type:i})}),400))}}let ue=0,he=function(e){return e[e.SAMPLED=0]="SAMPLED",e[e.RENDER_TARGET=1]="RENDER_TARGET",e}({});class de{constructor(e){var t=this;(0,i.A)(this,"pickedColors",void 0),(0,i.A)(this,"pickedTileLayers",[]),(0,i.A)(this,"pickingFBO",void 0),(0,i.A)(this,"width",0),(0,i.A)(this,"height",0),(0,i.A)(this,"alreadyInPicking",!1),(0,i.A)(this,"pickBufferScale",1),(0,i.A)(this,"pickFromPickingFBO",function(){var e=(0,z.A)((function*(e,{x:n,y:i,lngLat:a,type:s,target:l}){var c;let u=!1;const{readPixels:h,readPixelsAsync:d,getViewportSize:f,queryVerdorInfo:p}=t.rendererService,{width:g,height:m}=f(),{enableHighlight:_,enableSelect:v}=e.getLayerConfig(),y=n*o.dv.DPR,E=i*o.dv.DPR;if(y>g-1*o.dv.DPR||y<0||E>m-1*o.dv.DPR||E<0)return!1;let A;if(A="WebGPU"===p()?yield d({x:Math.floor(y/t.pickBufferScale),y:Math.floor((m-(i+1)*o.dv.DPR)/t.pickBufferScale),width:1,height:1,data:new Uint8Array(4),framebuffer:t.pickingFBO}):h({x:Math.floor(y/t.pickBufferScale),y:Math.floor((m-(i+1)*o.dv.DPR)/t.pickBufferScale),width:1,height:1,data:new Uint8Array(4),framebuffer:t.pickingFBO}),t.pickedColors=A,0!==A[0]||0!==A[1]||0!==A[2]){const r=(0,o.dG)(A),c=e.layerPickService.getFeatureById(r);r!==e.getCurrentPickId()&&"mousemove"===s&&(s="mouseenter");const h={x:n,y:i,type:s,lngLat:a,featureId:r,feature:c,target:l};c&&(u=!0,e.setCurrentPickId(r),t.triggerHoverOnLayer(e,h))}else{const o={x:n,y:i,lngLat:a,type:null!==e.getCurrentPickId()&&"mousemove"===s?"mouseout":"un"+s,featureId:null,target:l,feature:null};t.triggerHoverOnLayer(e,(0,r.A)((0,r.A)({},o),{},{type:"unpick"})),t.triggerHoverOnLayer(e,o),e.setCurrentPickId(null)}if(_&&e.layerPickService.highlightPickedFeature(A),v&&"click"===s&&(null===(c=A)||void 0===c?void 0:c.toString())!==[0,0,0,0].toString()){const t=(0,o.dG)(A);null===e.getCurrentSelectedId()||t!==e.getCurrentSelectedId()?(e.layerPickService.selectFeature(A),e.setCurrentSelectedId(t)):(e.layerPickService.selectFeature(new Uint8Array([0,0,0,0])),e.setCurrentSelectedId(null))}return u}));return function(t,n){return e.apply(this,arguments)}}()),this.container=e}get mapService(){return this.container.mapService}get rendererService(){return this.container.rendererService}get configService(){return this.container.globalConfigService}get interactionService(){return this.container.interactionService}get layerService(){return this.container.layerService}init(e){const{createTexture2D:t,createFramebuffer:n,getViewportSize:r}=this.rendererService;let{width:i,height:o}=r();this.pickBufferScale=this.configService.getSceneConfig(e).pickBufferScale||1,i=Math.round(i/this.pickBufferScale),o=Math.round(o/this.pickBufferScale);const a=t({width:i,height:o,usage:he.RENDER_TARGET,label:"Picking Texture"});this.pickingFBO=n({color:a,depth:!0,width:i,height:o}),this.interactionService.on(b.Hover,this.pickingAllLayer.bind(this))}boxPickLayer(e,t,n){var r=this;return(0,z.A)((function*(){const{useFramebufferAsync:i,clear:o}=r.rendererService;r.resizePickingFBO(),e.hooks.beforePickingEncode.call(),yield i(r.pickingFBO,(0,z.A)((function*(){o({framebuffer:r.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),e.renderModels({ispick:!0})}))),e.hooks.afterPickingEncode.call();const a=yield r.pickBox(e,t);n(a)}))()}pickBox(e,t){var n=this;return(0,z.A)((function*(){const[i,a,s,l]=t.map((e=>{const t=e<0?0:e;return Math.floor(t*o.dv.DPR/n.pickBufferScale)})),{readPixelsAsync:c,getViewportSize:u}=n.rendererService,{width:h,height:d}=u();if(i>(h-1)*o.dv.DPR/n.pickBufferScale||s<0||a>(d-1)*o.dv.DPR/n.pickBufferScale||l<0)return[];const f=Math.min(h/n.pickBufferScale,s)-i,p=Math.min(d/n.pickBufferScale,l)-a,g=yield c({x:i,y:Math.floor(d/n.pickBufferScale-(l+1)),width:f,height:p,data:new Uint8Array(f*p*4),framebuffer:n.pickingFBO}),m=[],_={};for(let t=0;t<g.length/4;t+=1){const n=g.slice(4*t,4*t+4),i=(0,o.dG)(n);if(-1!==i&&!_[i]){const t=e.layerPickService.getFeatureById(i);m.push((0,r.A)((0,r.A)({},t),{},{pickedFeatureIdx:i})),_[i]=!0}}return m}))()}handleCursor(e,t){const{cursor:n="",cursorEnabled:r}=e.getLayerConfig();if(r){const e="amap"===this.mapService.getType()?this.mapService.getMapContainer():this.mapService.getMarkerContainer(),r=null==e?void 0:e.style.getPropertyValue("cursor");"unmousemove"===t&&""!==r?null==e||e.style.setProperty("cursor",""):"mousemove"===t&&(null==e||e.style.setProperty("cursor",n))}}destroy(){this.pickingFBO.destroy(),this.pickingFBO=null}pickingAllLayer(e){var t=this;return(0,z.A)((function*(){t.layerService.needPick(e.type)&&t.isPickingAllLayer()&&(t.alreadyInPicking=!0,yield t.pickingLayers(e),t.layerService.renderLayers(),t.alreadyInPicking=!1)}))()}isPickingAllLayer(){return!(this.alreadyInPicking||this.layerService.alreadyInRendering||this.interactionService.indragging||!this.layerService.getShaderPickStat())}resizePickingFBO(){const{getViewportSize:e}=this.rendererService,{width:t,height:n}=e();this.width===t&&this.height===n||(this.pickingFBO.resize({width:Math.round(t/this.pickBufferScale),height:Math.round(n/this.pickBufferScale)}),this.width=t,this.height=n)}pickingLayers(e){var t=this;return(0,z.A)((function*(){const{clear:n,useFramebufferAsync:r}=t.rendererService;t.resizePickingFBO();const i=t.layerService.getRenderList();for(const o of i.filter((t=>t.needPick(e.type))).reverse()){yield r(t.pickingFBO,(0,z.A)((function*(){n({framebuffer:t.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),o.layerPickService.pickRender(e)})));const i=yield t.pickFromPickingFBO(o,e);if(t.layerService.pickedLayerId=i?+o.id:-1,i&&!o.getLayerConfig().enablePropagation)break}}))()}triggerHoverOnLayer(e,t){(function(e){var t;let n=!0;if((null==e||null===(t=e.target)||void 0===t?void 0:t.target)instanceof HTMLElement){var r;let t=null==e||null===(r=e.target)||void 0===r?void 0:r.target;for(;t;){var i;const e=Array.from(t.classList);if(e.includes("l7-marker")||e.includes("l7-popup")){n=!1;break}t=null===(i=t)||void 0===i?void 0:i.parentElement}}return n})(t)&&(this.handleCursor(e,t.type),e.emit(t.type,t))}}class fe{constructor(e=!0){(0,i.A)(this,"autoStart",void 0),(0,i.A)(this,"startTime",0),(0,i.A)(this,"oldTime",0),(0,i.A)(this,"running",!1),(0,i.A)(this,"elapsedTime",0),this.autoStart=e}start(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}const{throttle:pe}=o.uG;class ge extends P.EventEmitter{get renderService(){return this.container.rendererService}get mapService(){return this.container.mapService}get debugService(){return this.container.debugService}constructor(e){super(),(0,i.A)(this,"pickedLayerId",-1),(0,i.A)(this,"clock",new fe),(0,i.A)(this,"alreadyInRendering",!1),(0,i.A)(this,"layers",[]),(0,i.A)(this,"layerList",[]),(0,i.A)(this,"layerRenderID",void 0),(0,i.A)(this,"sceneInited",!1),(0,i.A)(this,"animateInstanceCount",0),(0,i.A)(this,"shaderPicking",!0),(0,i.A)(this,"enableRender",!0),(0,i.A)(this,"reRender",pe((()=>{this.renderLayers()}),32)),(0,i.A)(this,"throttleRenderLayers",pe((()=>{this.renderLayers()}),16)),this.container=e}needPick(e){return this.updateLayerRenderList(),this.layerList.some((t=>t.needPick(e)))}add(e){this.layers.push(e),this.sceneInited&&e.init().then((()=>{this.renderLayers()}))}addMask(e){this.sceneInited&&e.init().then((()=>{this.renderLayers()}))}initLayers(){var e=this;return(0,z.A)((function*(){e.sceneInited=!0,e.layers.forEach(function(){var t=(0,z.A)((function*(t){t.startInit||(yield t.init(),e.updateLayerRenderList())}));return function(e){return t.apply(this,arguments)}}())}))()}getSceneInited(){return this.sceneInited}getRenderList(){return this.layerList}getLayers(){return this.layers}getLayer(e){return this.layers.find((t=>t.id===e))}getLayerByName(e){return this.layers.find((t=>t.name===e))}remove(e,t){var n=this;return(0,z.A)((function*(){t?t.layerChildren=t.layerChildren.filter((t=>t!==e)):n.layers=n.layers.filter((t=>t!==e)),e.destroy(),n.reRender(),n.emit("layerChange",n.layers)}))()}removeAllLayers(){var e=this;return(0,z.A)((function*(){e.destroy(),e.reRender()}))()}setEnableRender(e){this.enableRender=e}renderLayers(){var e=this;return(0,z.A)((function*(){if(e.alreadyInRendering||!e.enableRender)return;e.updateLayerRenderList();const t=e.debugService.generateRenderUid();e.debugService.renderStart(t),e.alreadyInRendering=!0,e.clear();for(const t of e.layerList)t.prerender();e.renderService.beginFrame();for(const t of e.layerList){const{enableMask:n}=t.getLayerConfig();t.masks.filter((e=>e.inited)).length>0&&n&&e.renderMask(t.masks),t.getLayerConfig().enableMultiPassRenderer?yield t.renderMultiPass():t.render()}e.renderService.endFrame(),e.debugService.renderEnd(t),e.alreadyInRendering=!1}))()}renderMask(e){let t=0;this.renderService.clear({stencil:0,depth:1,framebuffer:null});const n=e.length>1?x.MULTIPLE:x.SINGLE;for(const r of e)r.render({isStencil:!0,stencilType:n,stencilIndex:t++})}beforeRenderData(e){var t=this;return(0,z.A)((function*(){(yield e.hooks.beforeRenderData.promise())&&t.renderLayers()}))()}renderTileLayerMask(e){let t=0;const{enableMask:n=!0}=e.getLayerConfig();let r=e.tileMask?1:0;const i=e.masks.filter((e=>e.inited));r+=n?i.length:1;const o=r>1?x.MULTIPLE:x.SINGLE;if((e.tileMask||i.length&&n)&&this.renderService.clear({stencil:0,depth:1,framebuffer:null}),i.length&&n)for(const e of i)e.render({isStencil:!0,stencilType:o,stencilIndex:t++});e.tileMask&&e.tileMask.render({isStencil:!0,stencilType:o,stencilIndex:t++,stencilOperation:S.OR})}renderTileLayer(e){var t=this;return(0,z.A)((function*(){t.renderTileLayerMask(e),e.getLayerConfig().enableMultiPassRenderer?yield e.renderMultiPass():yield e.render()}))()}updateLayerRenderList(){this.layerList=[],this.layers.filter((e=>e.inited)).filter((e=>e.isVisible())).sort(((e,t)=>e.zIndex-t.zIndex)).forEach((e=>{this.layerList.push(e)}))}destroy(){this.layers.forEach((e=>{e.destroy()})),this.layers=[],this.layerList=[],this.emit("layerChange",this.layers)}startAnimate(){0==this.animateInstanceCount++&&(this.clock.start(),this.runRender())}stopAnimate(){0==--this.animateInstanceCount&&(this.stopRender(),this.clock.stop())}getOESTextureFloat(){return this.renderService.extensionObject.OES_texture_float}enableShaderPick(){this.shaderPicking=!0}disableShaderPick(){this.shaderPicking=!1}getShaderPickStat(){return this.shaderPicking}clear(){const e=(0,o.HR)(this.mapService.bgColor);this.renderService.clear({color:e,depth:1,stencil:0,framebuffer:null})}runRender(){this.renderLayers(),this.layerRenderID=window.requestAnimationFrame(this.runRender.bind(this))}stopRender(){window.cancelAnimationFrame(this.layerRenderID)}}var me=n(14223);const{isNil:_e}=o.uG;class ve{constructor(e){(0,i.A)(this,"name",void 0),(0,i.A)(this,"type",void 0),(0,i.A)(this,"scale",void 0),(0,i.A)(this,"descriptor",void 0),(0,i.A)(this,"featureBufferLayout",[]),(0,i.A)(this,"needRescale",!1),(0,i.A)(this,"needRemapping",!1),(0,i.A)(this,"needRegenerateVertices",!1),(0,i.A)(this,"featureRange",{startIndex:0,endIndex:1/0}),(0,i.A)(this,"vertexAttribute",void 0),(0,i.A)(this,"defaultCallback",(e=>{var t;return 0===e.length?(null===(t=this.scale)||void 0===t?void 0:t.defaultValues)||[]:e.map(((e,t)=>{var n;return(null===(n=this.scale)||void 0===n?void 0:n.scalers[t].func)(e)}))})),this.setProps(e)}setProps(e){Object.assign(this,e)}mapping(e){var t;if(null!==(t=this.scale)&&void 0!==t&&t.callback){var n;const t=null===(n=this.scale)||void 0===n?void 0:n.callback(...e);if(!_e(t))return[t]}return this.defaultCallback(e)}resetDescriptor(){this.descriptor&&(this.descriptor.buffer.data=[])}}const ye=["buffer","update","name"],Ee=["buffer","update","name"],Ae={[s.FLOAT]:4,[s.UNSIGNED_BYTE]:1,[s.UNSIGNED_SHORT]:2};class be{constructor(e){(0,i.A)(this,"attributesAndIndices",void 0),(0,i.A)(this,"attributes",[]),(0,i.A)(this,"triangulation",void 0),(0,i.A)(this,"featureLayout",{sizePerElement:0,elements:[]}),this.rendererService=e}registerStyleAttribute(e){let t=this.getLayerStyleAttribute(e.name||"");return t?t.setProps(e):(t=new ve(e),this.attributes.push(t)),t}unRegisterStyleAttribute(e){const t=this.attributes.findIndex((t=>t.name===e));t>-1&&this.attributes.splice(t,1)}updateScaleAttribute(e){this.attributes.forEach((t=>{var n;const r=t.name,i=null===(n=t.scale)||void 0===n?void 0:n.field;(e[r]||i&&e[i])&&(t.needRescale=!0,t.needRemapping=!0,t.needRegenerateVertices=!0)}))}updateStyleAttribute(e,t,n){let i=this.getLayerStyleAttribute(e);i||(i=this.registerStyleAttribute((0,r.A)((0,r.A)({},t),{},{name:e})));const{scale:o}=t;o&&i&&(i.scale=o,i.needRescale=!0,i.needRemapping=!0,i.needRegenerateVertices=!0,n&&n.featureRange&&(i.featureRange=n.featureRange))}getLayerStyleAttributes(){return this.attributes}getLayerStyleAttribute(e){return this.attributes.find((t=>t.name===e))}getLayerAttributeScale(e){var t;const n=this.getLayerStyleAttribute(e),r=null==n||null===(t=n.scale)||void 0===t?void 0:t.scalers;return r&&r[0]?r[0].func:null}updateAttributeByFeatureRange(e,t,n=0,r,i){const o=this.attributes.find((t=>t.name===e));if(o&&o.descriptor){const{descriptor:a}=o,{update:l,buffer:c,size:u=0}=a,h=Ae[c.type||s.FLOAT];if(l){const{elements:a,sizePerElement:s}=this.featureLayout,c=a.slice(n,r);if(!c.length)return;const{offset:d}=c[0],f=d*u*h,p=c.map((({featureIdx:e,vertices:n,normals:r},i)=>{const o=n.length/s,a=[];for(let c=0;c<o;c++){const o=r?r.slice(3*c,3*c+3):[];a.push(...l(t[e],e,n.slice(c*s,c*s+s),i,o))}return a})).flat();o.vertexAttribute.updateBuffer({data:p,offset:f}),null==i||i.emit(`legend:${e}`,i.getLegend(e))}}}createAttributesAndIndices(e,t,n,i){this.featureLayout={sizePerElement:0,elements:[]},t&&(this.triangulation=t);const o=this.attributes.map((e=>(e.resetDescriptor(),e.descriptor)));let a=0,l=0;const c=[];let u=3;e.forEach(((e,t)=>{const{indices:r,vertices:i,normals:s,size:h,indexes:d,count:f}=this.triangulation(e,n);"number"==typeof f&&(l+=f),r.forEach((e=>{c.push(e+a)})),u=h;const p=i.length/h;this.featureLayout.sizePerElement=u,this.featureLayout.elements.push({featureIdx:t,vertices:i,normals:s,offset:a}),a+=p;for(let n=0;n<p;n++){const r=(null==s?void 0:s.slice(3*n,3*n+3))||[],a=i.slice(n*h,n*h+h);let l=0;d&&void 0!==d[n]&&(l=d[n]),o.forEach(((i,o)=>{i&&i.update&&i.buffer.data.push(...i.update(e,t,a,n,r,l))}))}}));const{createAttribute:h,createBuffer:d,createElements:f}=this.rendererService,p={};o.forEach(((e,t)=>{if(e){const{buffer:n,update:i,name:o}=e,a=(0,me.A)(e,ye),s=h((0,r.A)({buffer:d(n)},a));p[e.name||""]=s,this.attributes[t].vertexAttribute=s}}));const g=f({data:c,type:s.UNSIGNED_INT,count:c.length});return this.attributesAndIndices={attributes:p,elements:g,count:l},Object.values(this.attributes).filter((e=>e.scale)).forEach((e=>{const t=e.name;null==i||i.emit(`legend:${t}`,i.getLegend(t))})),this.attributesAndIndices}createAttributes(e,t){this.featureLayout={sizePerElement:0,elements:[]},t&&(this.triangulation=t);const n=this.attributes.map((e=>(e.resetDescriptor(),e.descriptor)));let i=0;const o=[];let a=3;e.forEach(((e,t)=>{const{indices:r,vertices:s,normals:l,size:c,indexes:u}=this.triangulation(e);r.forEach((e=>{o.push(e+i)})),a=c;const h=s.length/c;this.featureLayout.sizePerElement=a,this.featureLayout.elements.push({featureIdx:t,vertices:s,normals:l,offset:i}),i+=h;for(let r=0;r<h;r++){const i=(null==l?void 0:l.slice(3*r,3*r+3))||[],o=s.slice(r*c,r*c+c);let a=0;u&&void 0!==u[r]&&(a=u[r]),n.forEach(((n,s)=>{n&&n.update&&n.buffer.data.push(...n.update(e,t,o,r,i,a))}))}}));const{createAttribute:s,createBuffer:l}=this.rendererService,c={};return n.forEach(((e,t)=>{if(e){const{buffer:n,update:i,name:o}=e,a=(0,me.A)(e,Ee),u=s((0,r.A)({buffer:l(n)},a));c[e.name||""]=u,this.attributes[t].vertexAttribute=u}})),{attributes:c}}clearAllAttributes(){var e;this.attributes.forEach((e=>{e.vertexAttribute&&e.vertexAttribute.destroy()})),null===(e=this.attributesAndIndices)||void 0===e||e.elements.destroy(),this.attributes=[]}}var Te=n(35461),xe=n(82087),Se=n.n(xe);class Re extends P.EventEmitter{get iconService(){return this.container.iconService}get fontService(){return this.container.fontService}get controlService(){return this.container.controlService}get configService(){return this.container.globalConfigService}get map(){return this.container.mapService}get coordinateSystemService(){return this.container.coordinateSystemService}get rendererService(){return this.container.rendererService}get layerService(){return this.container.layerService}get debugService(){return this.container.debugService}get cameraService(){return this.container.cameraService}get interactionService(){return this.container.interactionService}get pickingService(){return this.container.pickingService}get shaderModuleService(){return this.container.shaderModuleService}get markerService(){return this.container.markerService}get popupService(){return this.container.popupService}constructor(e){super(),(0,i.A)(this,"destroyed",!1),(0,i.A)(this,"loaded",!1),(0,i.A)(this,"id",void 0),(0,i.A)(this,"inited",!1),(0,i.A)(this,"rendering",!1),(0,i.A)(this,"$container",void 0),(0,i.A)(this,"canvas",void 0),(0,i.A)(this,"markerContainer",void 0),(0,i.A)(this,"resizeDetector",void 0),(0,i.A)(this,"hooks",void 0),(0,i.A)(this,"handleWindowResized",(()=>{this.emit("resize"),this.$container&&(this.initContainer(),this.coordinateSystemService.needRefresh=!0,this.render())})),(0,i.A)(this,"handleMapCameraChanged",(e=>{this.cameraService.update(e),this.render()})),this.container=e,this.hooks={init:new Te.FU},this.id=e.id}init(e){var t=this;this.configService.setSceneConfig(this.id,e),this.shaderModuleService.registerBuiltinModules(),this.iconService.init(),this.iconService.on("imageUpdate",(()=>this.render())),this.fontService.init(),this.hooks.init.tapPromise("initMap",(0,z.A)((function*(){t.debugService.log("map.mapInitStart",{type:t.map.version}),yield new Promise((e=>{t.map.onCameraChanged((n=>{t.cameraService.init(),t.cameraService.update(n),e()})),t.map.init()})),t.map.onCameraChanged(t.handleMapCameraChanged),t.map.addMarkerContainer(),t.markerService.addMarkers(),t.markerService.addMarkerLayers(),t.popupService.initPopup(),t.interactionService.init(),t.interactionService.on(b.Drag,t.addSceneEvent.bind(t))}))),this.hooks.init.tapPromise("initRenderer",(0,z.A)((function*(){var n;const r=(null===(n=t.map)||void 0===n?void 0:n.getOverlayContainer())||void 0;if(t.$container=r||function(e){let t=e;if("string"==typeof e&&(t=document.getElementById(e)),t){const e=document.createElement("div");return e.style.cssText+="\n position: absolute;\n z-index:2;\n height: 100%;\n width: 100%;\n pointer-events: none;\n ",e.id="l7-scene-"+ue++,e.classList.add("l7-scene"),t.appendChild(e),e}return null}(t.configService.getSceneConfig(t.id).id||""),t.$container){const{canvas:n}=e;var i;t.canvas=n||o.dv.create("canvas","",t.$container),t.setCanvas(),yield t.rendererService.init(t.canvas,t.configService.getSceneConfig(t.id),e.gl),t.registerContextLost(),t.initContainer(),t.resizeDetector=Se()({strategy:"scroll"}),t.resizeDetector.listenTo(t.$container,t.handleWindowResized),window.matchMedia&&(null===(i=window.matchMedia("screen and (-webkit-min-device-pixel-ratio: 1.5)"))||void 0===i||i.addListener(t.handleWindowResized.bind("screen")))}else console.error("容器 id 不存在");t.pickingService.init(t.id)}))),this.render()}registerContextLost(){const e=this.rendererService.getCanvas();e&&e.addEventListener("webglcontextlost",(()=>this.emit("webglcontextlost")))}addLayer(e){this.layerService.sceneService=this,this.layerService.add(e)}addMask(e){this.layerService.sceneService=this,this.layerService.addMask(e)}render(){var e=this;return(0,z.A)((function*(){e.rendering||e.destroyed||(e.rendering=!0,e.inited?(yield e.layerService.initLayers(),yield e.layerService.renderLayers()):(yield e.hooks.init.promise(),e.destroyed&&e.destroy(),yield e.layerService.initLayers(),e.layerService.renderLayers(),e.controlService.addControls(),e.loaded=!0,e.emit("loaded"),e.inited=!0),e.rendering=!1)}))()}addFontFace(e,t){this.fontService.addFontFace(e,t)}getSceneContainer(){return this.$container}exportPng(e){var t=this;return(0,z.A)((function*(){var n;const r=null===(n=t.$container)||void 0===n?void 0:n.getElementsByTagName("canvas")[0];return yield t.render(),"jpg"===e?null==r?void 0:r.toDataURL("image/jpeg"):null==r?void 0:r.toDataURL("image/png")}))()}getSceneConfig(){return this.configService.getSceneConfig(this.id)}getPointSizeRange(){return this.rendererService.getPointSizeRange()}addMarkerContainer(){const e=this.$container.parentElement;null!==e&&(this.markerContainer=o.dv.create("div","l7-marker-container",e))}getMarkerContainer(){return this.markerContainer}destroy(){var e;this.inited?(this.resizeDetector.removeListener(this.$container,this.handleWindowResized),this.pickingService.destroy(),this.layerService.destroy(),this.interactionService.destroy(),this.controlService.destroy(),this.markerService.destroy(),this.fontService.destroy(),this.iconService.destroy(),this.removeAllListeners(),this.inited=!1,this.map.destroy(),setTimeout((()=>{var e;null===(e=this.$container)||void 0===e||e.removeChild(this.canvas),this.canvas=null,this.rendererService.destroy()})),null===(e=this.$container)||void 0===e||null===(e=e.parentNode)||void 0===e||e.removeChild(this.$container),this.emit("destroy")):this.destroyed=!0}initContainer(){var e,t;const n=o.dv.DPR,r=(null===(e=this.$container)||void 0===e?void 0:e.clientWidth)||400,i=(null===(t=this.$container)||void 0===t?void 0:t.clientHeight)||300,a=this.canvas;a&&(a.width=r*n,a.height=i*n),this.rendererService.viewport({x:0,y:0,width:n*r,height:n*i})}setCanvas(){var e,t;const n=o.dv.DPR,r=(null===(e=this.$container)||void 0===e?void 0:e.clientWidth)||400,i=(null===(t=this.$container)||void 0===t?void 0:t.clientHeight)||300,a=this.canvas;a.width=r*n,a.height=i*n,a.style.width="100%",a.style.height="100%"}addSceneEvent(e){this.emit(e.type,e)}}const{uniq:Ce}=o.uG,Le="#define PI 3.14159265359",Oe="layout(std140) uniform PickingUniforms {\n vec4 u_HighlightColor;\n vec4 u_SelectColor;\n vec3 u_PickingColor;\n float u_PickingStage;\n vec3 u_CurrentSelectedId;\n float u_PickingThreshold;\n float u_PickingBuffer;\n float u_shaderPick;\n float u_activeMix;\n};",Me='#define TILE_SIZE (512.0)\n#define PI (3.1415926536)\n#define WORLD_SCALE (TILE_SIZE / (PI * 2.0))\n#define EARTH_CIRCUMFERENCE (40.03e6)\n\n#define COORDINATE_SYSTEM_LNGLAT (1.0) // mapbox\n#define COORDINATE_SYSTEM_LNGLAT_OFFSET (2.0) // mapbox offset\n#define COORDINATE_SYSTEM_VECTOR_TILE (3.0)\n#define COORDINATE_SYSTEM_IDENTITY (4.0)\n#define COORDINATE_SYSTEM_METER_OFFSET (5.0)\n\n#pragma include "scene_uniforms"\n\nconst vec2 ZERO_64_XY_LOW = vec2(0.0, 0.0);\n\n// web mercator coords -> world coords\nvec2 project_mercator(vec2 lnglat) {\n float x = lnglat.x;\n return vec2(radians(x) + PI, PI - log(tan(PI * 0.25 + radians(lnglat.y) * 0.5)));\n}\n\nfloat project_scale(float meters) {\n return meters * u_PixelsPerMeter.z;\n}\n\n// offset coords -> world coords\nvec4 project_offset(vec4 offset) {\n float dy = offset.y;\n dy = clamp(dy, -1.0, 1.0);\n vec3 pixels_per_unit = u_PixelsPerDegree + u_PixelsPerDegree2 * dy;\n return vec4(offset.xyz * pixels_per_unit, offset.w);\n}\n\nvec3 project_normal(vec3 normal) {\n vec4 normal_modelspace = u_ModelMatrix * vec4(normal, 0.0);\n return normalize(normal_modelspace.xyz * u_PixelsPerMeter);\n}\n\nvec3 project_offset_normal(vec3 vector) {\n if (\n u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 &&\n u_CoordinateSystem > COORDINATE_SYSTEM_LNGLAT - 0.01 ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n // normals generated by the polygon tesselator are in lnglat offsets instead of meters\n return normalize(vector * u_PixelsPerDegree);\n }\n return project_normal(vector);\n}\n\nvec4 project_position(vec4 position, vec2 position64xyLow) {\n if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float X = position.x - u_ViewportCenter.x;\n float Y = position.y - u_ViewportCenter.y;\n return project_offset(\n vec4(X + position64xyLow.x, Y + position64xyLow.y, position.z, position.w)\n );\n }\n if (\n u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 &&\n u_CoordinateSystem > COORDINATE_SYSTEM_LNGLAT - 0.01\n ) {\n return vec4(\n project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale,\n project_scale(position.z),\n position.w\n );\n }\n\n return position;\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_XY_LOW);\n}\n\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / u_ViewportSize * u_DevicePixelRatio * 2.0;\n return offset * u_FocalDistance;\n}\n\n// 适配纹理贴图的等像素大小\nfloat project_pixel_texture(float pixel) {\n // mapbox zoom > 12\n if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n return pixel * pow(0.5, u_Zoom) * u_FocalDistance;\n }\n\n return pixel * 2.0 * u_FocalDistance;\n}\n\n// 在不论什么底图下需要统一处理的时候使用\nfloat project_float_pixel(float pixel) {\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n // mapbox 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1\n return pixel * pow(2.0, 19.0 - u_Zoom) * u_FocalDistance;\n }\n\n return pixel * u_FocalDistance;\n}\n\n// Project meter into the unit of pixel which used in the camera world space\nfloat project_float_meter(float meter) {\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n // Since the zoom level uniform is updated by mapservice and it\'s alread been subtracted by 1\n // Not sure if we are supposed to do that again\n return meter;\n } else {\n return project_float_pixel(meter);\n }\n\n // TODO: change the following code to make adaptations for amap\n // return u_FocalDistance * TILE_SIZE * pow(2.0, u_Zoom) * meter / EARTH_CIRCUMFERENCE;\n\n}\n\nfloat project_pixel(float pixel) {\n return pixel * u_FocalDistance;\n}\n\nvec2 project_pixel(vec2 pixel) {\n return pixel * -1.0 * u_FocalDistance;\n}\n\nvec3 project_pixel(vec3 pixel) {\n return pixel * -1.0 * u_FocalDistance;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n // Needs to be divided with project_uCommonUnitsPerMeter\n position.w *= u_PixelsPerMeter.z;\n }\n\n return viewProjectionMatrix * position + center;\n}\n\n// Projects from common space coordinates to clip space\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(\n position,\n u_ViewProjectionMatrix,\n u_ViewportCenterProjection\n );\n}\n\nvec4 unproject_clipspace_to_position(vec4 clipspacePos, mat4 u_InverseViewProjectionMatrix) {\n vec4 pos = u_InverseViewProjectionMatrix * (clipspacePos - u_ViewportCenterProjection);\n\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n // Needs to be divided with project_uCommonUnitsPerMeter\n pos.w = pos.w / u_PixelsPerMeter.z;\n }\n return pos;\n}\n\nbool isEqual(float a, float b) {\n return a < b + 0.001 && a > b - 0.001;\n}\n\n',Ie="layout(std140) uniform SceneUniforms {\n mat4 u_ViewMatrix;\n mat4 u_ProjectionMatrix;\n mat4 u_ViewProjectionMatrix;\n mat4 u_ModelMatrix;\n vec4 u_ViewportCenterProjection;\n vec3 u_PixelsPerDegree;\n float u_Zoom;\n vec3 u_PixelsPerDegree2;\n float u_ZoomScale;\n vec3 u_PixelsPerMeter;\n float u_CoordinateSystem;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_ViewportCenter;\n vec2 u_ViewportSize;\n float u_FocalDistance;\n};\n",we=/precision\s+(high|low|medium)p\s+float/,Pe="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n#endif\n",Ne=/#pragma include (["^+"]?["[a-zA-Z_0-9](.*)"]*?)/g,De=/void\s+main\s*\([^)]*\)\s*\{\n?/;class Be{constructor(){(0,i.A)(this,"moduleCache",{}),(0,i.A)(this,"rawContentCache",{})}registerBuiltinModules(){this.destroy(),this.registerModule("common",{vs:Le,fs:Le}),this.registerModule("decode",{vs:"#define SHIFT_RIGHT17 1.0 / 131072.0\n#define SHIFT_RIGHT18 1.0 / 262144.0\n#define SHIFT_RIGHT19 1.0 / 524288.0\n#define SHIFT_RIGHT20 1.0 / 1048576.0\n#define SHIFT_RIGHT21 1.0 / 2097152.0\n#define SHIFT_RIGHT22 1.0 / 4194304.0\n#define SHIFT_RIGHT23 1.0 / 8388608.0\n#define SHIFT_RIGHT24 1.0 / 16777216.0\n\n#define SHIFT_LEFT17 131072.0\n#define SHIFT_LEFT18 262144.0\n#define SHIFT_LEFT19 524288.0\n#define SHIFT_LEFT20 1048576.0\n#define SHIFT_LEFT21 2097152.0\n#define SHIFT_LEFT22 4194304.0\n#define SHIFT_LEFT23 8388608.0\n#define SHIFT_LEFT24 16777216.0\n\nvec2 unpack_float(float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\n\nvec4 decode_color(vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\n",fs:""}),this.registerModule("scene_uniforms",{vs:Ie,fs:Ie}),this.registerModule("picking_uniforms",{vs:Oe,fs:Oe}),this.registerModule("projection",{vs:Me,fs:Me}),this.registerModule("project",{vs:"\n#define E 2.718281828459045\nvec2 ProjectFlat(vec2 lnglat){\n float maxs=85.0511287798;\n float lat=max(min(maxs,lnglat.y),-maxs);\n float scale= 268435456.;\n float d=PI/180.;\n float x=lnglat.x*d;\n float y=lat*d;\n y=log(tan((PI/4.)+(y/2.)));\n\n float a=.5/PI,\n b=.5,\n c=-.5/PI;\n d=.5;\n x=scale*(a*x+b);\n y=scale*(c*y+d);\n return vec2(x,y);\n}\n\nvec2 unProjectFlat(vec2 px){\n float a=.5/PI;\n float b=.5;\n float c=-.5/PI;\n float d=.5;\n float scale = 268435456.;\n float x=(px.x/scale-b)/a;\n float y=(px.y/scale-d)/c;\n y=(atan(pow(E,y))-(PI/4.))*2.;\n d=PI/180.;\n float lat=y/d;\n float lng=x/d;\n return vec2(lng,lat);\n}\n\nfloat pixelDistance(vec2 from, vec2 to) {\n vec2 a1 = ProjectFlat(from);\n vec2 b1 = ProjectFlat(to);\n return distance(a1, b1);\n}\n\n// gaode2.0\nvec2 customProject(vec2 lnglat) { // 经纬度 => 平面坐标\n float t = lnglat.x;\n float e = lnglat.y;\n float Sm = 180.0 / PI;\n float Tm = 6378137.0;\n float Rm = PI / 180.0;\n float r = 85.0511287798;\n e = max(min(r, e), -r);\n t *= Rm;\n e *= Rm;\n e = log(tan(PI / 4.0 + e / 2.0));\n return vec2(t * Tm, e * Tm);\n}\n\nvec2 unProjCustomCoord(vec2 point) { // 平面坐标 => 经纬度\n float Sm = 57.29577951308232; //180 / Math.PI\n float Tm = 6378137.0;\n float t = point.x;\n float e = point.y;\n return vec2(t / Tm * Sm, (2.0 * atan(exp(e / Tm)) - PI / 2.0) * Sm);\n}\n\n\nfloat customPixelDistance(vec2 from, vec2 to) {\n vec2 a1 = ProjectFlat(from);\n vec2 b1 = ProjectFlat(to);\n return distance(a1, b1);\n}",fs:""}),this.registerModule("sdf_2d",{vs:"",fs:"/**\n * 2D signed distance field functions\n * @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm\n */\n\nfloat ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }\n\nfloat sdCircle(vec2 p, float r) {\n return length(p) - r;\n}\n\nfloat sdEquilateralTriangle(vec2 p) {\n float k = sqrt(3.0);\n p.x = abs(p.x) - 1.0;\n p.y = p.y + 1.0/k;\n if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;\n p.x -= clamp( p.x, -2.0, 0.0 );\n return -length(p)*sign(p.y);\n}\n\nfloat sdBox(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);\n}\n\nfloat sdPentagon(vec2 p, float r) {\n vec3 k = vec3(0.809016994,0.587785252,0.726542528);\n p.x = abs(p.x);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagon(vec2 p, float r) {\n vec3 k = vec3(-0.866025404,0.5,0.577350269);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdOctogon(vec2 p, float r) {\n vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );\n p = abs(p);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagram(vec2 p, float r) {\n vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;\n p -= vec2(clamp(p.x,r*k.z,r*k.w),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdRhombus(vec2 p, vec2 b) {\n vec2 q = abs(p);\n float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);\n float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );\n return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );\n}\n\nfloat sdVesica(vec2 p, float r, float d) {\n p = abs(p);\n float b = sqrt(r*r-d*d); // can delay this sqrt\n return ((p.y-b)*d>p.x*b)\n ? length(p-vec2(0.0,b))\n : length(p-vec2(-d,0.0))-r;\n}\n"}),this.registerModule("lighting",{vs:"// Blinn-Phong model\n// apply lighting in vertex shader instead of fragment shader\n// @see https://learnopengl.com/Advanced-Lighting/Advanced-Lighting\nuniform float u_Ambient : 1.0;\nuniform float u_Diffuse : 1.0;\nuniform float u_Specular : 1.0;\nuniform int u_NumOfDirectionalLights : 1;\nuniform int u_NumOfSpotLights : 0;\n\n#define SHININESS 32.0\n#define MAX_NUM_OF_DIRECTIONAL_LIGHTS 3\n#define MAX_NUM_OF_SPOT_LIGHTS 3\n\nstruct DirectionalLight {\n vec3 direction;\n vec3 ambient;\n vec3 diffuse;\n vec3 specular;\n};\n\nstruct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 ambient;\n vec3 diffuse;\n vec3 specular;\n float constant;\n float linear;\n float quadratic;\n float angle;\n float blur;\n float exponent;\n};\n\nuniform DirectionalLight u_DirectionalLights[MAX_NUM_OF_DIRECTIONAL_LIGHTS];\nuniform SpotLight u_SpotLights[MAX_NUM_OF_SPOT_LIGHTS];\n\nvec3 calc_directional_light(DirectionalLight light, vec3 normal, vec3 viewDir) {\n vec3 lightDir = normalize(light.direction);\n // diffuse shading\n float diff = max(dot(normal, lightDir), 0.0);\n // Blinn-Phong specular shading\n vec3 halfwayDir = normalize(lightDir + viewDir);\n float spec = pow(max(dot(normal, halfwayDir), 0.0), SHININESS);\n\n vec3 ambient = light.ambient * u_Ambient;\n vec3 diffuse = light.diffuse * diff * u_Diffuse;\n vec3 specular = light.specular * spec * u_Specular;\n\n return ambient + diffuse + specular;\n}\n\n\nvec3 calc_lighting(vec3 position, vec3 normal, vec3 viewDir) {\n vec3 weight = vec3(0.0);\n for (int i = 0; i < MAX_NUM_OF_DIRECTIONAL_LIGHTS; i++) {\n if (i >= u_NumOfDirectionalLights) {\n break;\n }\n weight += calc_directional_light(u_DirectionalLights[i], normal, viewDir);\n }\n return weight;\n}\n",fs:""}),this.registerModule("light",{vs:"#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\n\nfloat calc_lighting(vec4 pos) {\n\n vec3 worldPos = vec3(pos * u_ModelMatrix);\n\n vec3 worldNormal = a_Normal;\n // //cal light weight\n vec3 viewDir = normalize(u_CameraPosition - worldPos);\n\n vec3 lightDir = normalize(vec3(1, -10.5, 12));\n\n vec3 halfDir = normalize(viewDir+lightDir);\n // //lambert\n float lambert = dot(worldNormal, lightDir);\n //specular\n float specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0);\n //sum to light weight\n float lightWeight = ambientRatio + diffuseRatio * lambert + specularRatio * specular;\n\n return lightWeight;\n}\n",fs:""}),this.registerModule("picking",{vs:'layout(location = ATTRIBUTE_LOCATION_PICKING_COLOR) in vec3 a_PickingColor;\nout vec4 v_PickingResult;\n\n#pragma include "picking_uniforms"\n\n#define PICKING_NONE 0.0\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\n#define NORMAL 0.0\n#define HIGHLIGHT 1.0\n#define SELECT 2.0\n\nbool isVertexPicked(vec3 vertexColor) {\n return distance(vertexColor,u_PickingColor.rgb) < 0.01;\n}\n\n// 判断当前点是否已经被 select 选中\nbool isVertexSelected(vec3 vertexColor) {\n return distance(vertexColor,u_CurrentSelectedId.rgb) < 0.01;\n}\n\nvoid setPickingColor(vec3 pickingColor) {\n if(u_shaderPick < 0.5) {\n return;\n }\n // compares only in highlight stage\n\n if(u_PickingStage == PICKING_HIGHLIGHT) {\n if(isVertexPicked(pickingColor)) {\n v_PickingResult = vec4(pickingColor.rgb * COLOR_SCALE,HIGHLIGHT);\n return;\n }\n if(isVertexSelected(pickingColor)) {\n v_PickingResult = vec4(u_CurrentSelectedId.rgb * COLOR_SCALE,SELECT);\n return;\n }\n\n } else {\n v_PickingResult= vec4(pickingColor.rgb * COLOR_SCALE,NORMAL);\n return;\n }\n\n // // v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && (isVertexPicked(pickingColor) || isVertexPicked(u_CurrentSelectedId)));\n\n // // Stores the picking color so that the fragment shader can render it during picking\n // v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nfloat setPickingSize(float x) {\n return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;\n}\n\nfloat setPickingOrder(float z) {\n bool selected = bool(v_PickingResult.a);\n return selected ? z + 1. : 0.;\n}\n',fs:'\nin vec4 v_PickingResult;\n\n#pragma include "picking_uniforms"\n\n#define PICKING_NONE 0.0\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\n#define HIGHLIGHT 1.0\n#define SELECT 2.0\n\n/*\n * Returns highlight color if this item is selected.\n */\nvec4 filterHighlightColor(vec4 color, float weight) {\n float activeType = v_PickingResult.a;\n if(activeType > 0.0) {\n vec4 highLightColor = activeType > 1.5 ? u_SelectColor : u_HighlightColor;\n highLightColor = highLightColor * COLOR_SCALE;\n float highLightAlpha = highLightColor.a;\n float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));\n vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(mix(resultRGB * weight, color.rgb, u_activeMix), color.a);\n }\n else {\n return color;\n }\n\n \n}\n\n/*\n * Returns picking color if picking enabled else unmodified argument.\n */\nvec4 filterPickingColor(vec4 color) {\n vec3 pickingColor = v_PickingResult.rgb;\n if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {\n discard;\n }\n return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;\n}\n\n/*\n * Returns picking color if picking is enabled if not\n * highlight color if this item is selected, otherwise unmodified argument.\n */\nvec4 filterColor(vec4 color) {\n // 过滤多余的 shader 计算\n // return color;\n if(u_shaderPick < 0.5) {\n return color; // 暂时去除 直接取消计算在选中时拖拽地图会有问题\n } else {\n return filterPickingColor(filterHighlightColor(color, 1.0));\n }\n \n}\n\nvec4 filterColorAlpha(vec4 color, float alpha) {\n // 过滤多余的 shader 计算\n // return color;\n if(u_shaderPick < 0.5) {\n return color; // 暂时去除 直接取消计算在选中时拖拽地图会有问题\n } else {\n return filterPickingColor(filterHighlightColor(color, alpha));\n }\n}\n\n'}),this.registerModule("rotation_2d",{vs:"vec2 rotate_matrix(vec2 v, float a) {\n float b = a / 180.0 * 3.1415926535897932384626433832795;\n float s = sin(b);\n float c = cos(b);\n mat2 m = mat2(c, s, -s, c);\n return m * v;\n}",fs:""})}registerModule(e,t){t.vs=t.vs.replace(/\r\n/g,"\n"),t.fs=t.fs.replace(/\r\n/g,"\n");const{vs:n,fs:i,uniforms:o,defines:a,inject:s}=t,{content:l,uniforms:c}=p(n),{content:u,uniforms:h}=p(i);this.rawContentCache[e]={fs:u,defines:a,inject:s,uniforms:(0,r.A)((0,r.A)((0,r.A)({},c),h),o),vs:l}}getModule(e){let t=this.rawContentCache[e].vs,n=this.rawContentCache[e].fs;const{defines:i={},inject:o={}}=this.rawContentCache[e];let a={};o["vs:#decl"]&&(t=o["vs:#decl"]+t,a=p(o["vs:#decl"]).uniforms),o["vs:#main-start"]&&(t=t.replace(De,(e=>e+o["vs:#main-start"]))),o["fs:#decl"]&&(n=o["fs:#decl"]+n);const s=function(e){return Object.keys(e).reduce(((t,n)=>t+`#define ${n.toUpperCase()} ${e[n]}\n`),"\n")}(i);t=s+t;const{content:l,includeList:c}=this.processModule(t,[],"vs"),{content:u,includeList:h}=this.processModule(n,[],"fs"),d=Ce(c.concat(h).concat(e)).reduce(((e,t)=>(0,r.A)((0,r.A)({},e),this.rawContentCache[t].uniforms)),(0,r.A)({},a)),f=(we.test(u)?"":Pe)+l,g=(we.test(u)?"":Pe)+u;return this.moduleCache[e]={vs:f.trim(),fs:g.trim(),uniforms:d},this.moduleCache[e]}destroy(){this.moduleCache={},this.rawContentCache={}}processModule(e,t,n){return{content:e.replace(Ne,((e,r)=>{const i=r.split(" ")[0].replace(/"/g,"");if(t.indexOf(i)>-1)return"";const o=this.rawContentCache[i][n];t.push(i);const{content:a}=this.processModule(o,t,n);return a})),includeList:t}}}class Fe{constructor(){(0,i.A)(this,"shaderModuleService",void 0),(0,i.A)(this,"rendererService",void 0),(0,i.A)(this,"cameraService",void 0),(0,i.A)(this,"mapService",void 0),(0,i.A)(this,"interactionService",void 0),(0,i.A)(this,"layerService",void 0),(0,i.A)(this,"config",void 0)}getName(){return""}getType(){return a.Normal}init(e,t){this.config=t,this.rendererService=e.getContainer().rendererService,this.cameraService=e.getContainer().cameraService,this.mapService=e.getContainer().mapService,this.interactionService=e.getContainer().interactionService,this.layerService=e.getContainer().layerService,this.shaderModuleService=e.getContainer().shaderModuleService}render(e){}}class Ue extends Fe{getName(){return"clear"}init(e,t){super.init(e,t)}render(){this.rendererService.clear({color:[0,0,0,0],depth:1,framebuffer:null})}}class ke{constructor(e){(0,i.A)(this,"passes",[]),(0,i.A)(this,"layer",void 0),(0,i.A)(this,"renderFlag",void 0),(0,i.A)(this,"width",0),(0,i.A)(this,"height",0),this.postProcessor=e}setLayer(e){this.layer=e}setRenderFlag(e){this.renderFlag=e}getRenderFlag(){return this.renderFlag}getPostProcessor(){return this.postProcessor}render(){var e=this;return(0,z.A)((function*(){for(const t of e.passes)yield t.render(e.layer);yield e.postProcessor.render(e.layer)}))()}resize(e,t){this.width===e&&this.height===t||(this.postProcessor.resize(e,t),this.width=e,this.height=t)}add(e,t){e.getType()===a.PostProcessing?this.postProcessor.add(e,this.layer,t):(e.init(this.layer,t),this.passes.push(e))}insert(e,t,n){e.init(this.layer,t),this.passes.splice(n,0,e)}destroy(){this.passes.length=0}}class Ge extends Fe{constructor(...e){var t;super(...e),t=this,(0,i.A)(this,"pickingFBO",void 0),(0,i.A)(this,"layer",void 0),(0,i.A)(this,"width",0),(0,i.A)(this,"height",0),(0,i.A)(this,"alreadyInRendering",!1),(0,i.A)(this,"pickFromPickingFBO",(({x:e,y:n,lngLat:i,type:a})=>{if(!this.layer.isVisible()||!this.layer.needPick(a))return;const{getViewportSize:s,readPixelsAsync:l,useFramebuffer:c}=this.rendererService,{width:u,height:h}=s(),{enableHighlight:d,enableSelect:f}=this.layer.getLayerConfig(),p=e*o.dv.DPR,g=n*o.dv.DPR;if(p>u||p<0||g>h||g<0)return;let m;c(this.pickingFBO,(0,z.A)((function*(){var s;if(m=yield l({x:Math.round(p),y:Math.round(h-(n+1)*o.dv.DPR),width:1,height:1,data:new Uint8Array(4),framebuffer:t.pickingFBO}),0!==m[0]||0!==m[1]||0!==m[2]){const r=(0,o.dG)(m),s=t.layer.getSource().getFeatureById(r),l={x:e,y:n,type:a,lngLat:i,featureId:r,feature:s};s&&(t.layer.setCurrentPickId(r),t.triggerHoverOnLayer(l))}else{const o={x:e,y:n,lngLat:i,type:null===t.layer.getCurrentPickId()?"un"+a:"mouseout",featureId:null,feature:null};t.triggerHoverOnLayer((0,r.A)((0,r.A)({},o),{},{type:"unpick"})),t.triggerHoverOnLayer(o),t.layer.setCurrentPickId(null)}d&&t.highlightPickedFeature(m),f&&"click"===a&&(null===(s=m)||void 0===s?void 0:s.toString())!==[0,0,0,0].toString()&&t.selectFeature(m)})))}))}getType(){return a.Normal}getName(){return"pixelPicking"}init(e,t){super.init(e,t),this.layer=e;const{createTexture2D:n,createFramebuffer:r,getViewportSize:i}=this.rendererService,{width:o,height:a}=i(),l=n({width:o,height:a,wrapS:s.CLAMP_TO_EDGE,wrapT:s.CLAMP_TO_EDGE,label:"Picking Texture"});this.pickingFBO=r({color:l}),this.interactionService.on(b.Hover,this.pickFromPickingFBO),this.interactionService.on(b.Select,this.selectFeatureHandle.bind(this)),this.interactionService.on(b.Active,this.highlightFeatureHandle.bind(this))}render(e){if(this.alreadyInRendering)return;const{getViewportSize:t,useFramebuffer:n,clear:r}=this.rendererService,{width:i,height:o}=t();this.alreadyInRendering=!0,this.width===i&&this.height===o||(this.pickingFBO.resize({width:i,height:o}),this.width=i,this.height=o),n(this.pickingFBO,(()=>{r({framebuffer:this.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});const t=this.layer.multiPassRenderer.getRenderFlag();this.layer.multiPassRenderer.setRenderFlag(!1),e.hooks.beforePickingEncode.call(),e.render(),e.hooks.afterPickingEncode.call(),this.layer.multiPassRenderer.setRenderFlag(t),this.alreadyInRendering=!1}))}triggerHoverOnLayer(e){this.layer.emit(e.type,e)}highlightPickedFeature(e){const[t,n,r]=e;this.layer.hooks.beforeHighlight.call([t,n,r]),this.layerService.renderLayers()}selectFeature(e){const[t,n,r]=e;this.layer.hooks.beforeSelect.call([t,n,r]),this.layerService.renderLayers()}selectFeatureHandle({featureId:e}){const t=(0,o.Z8)(e);this.selectFeature(new Uint8Array(t))}highlightFeatureHandle({featureId:e}){const t=(0,o.Z8)(e);this.highlightPickedFeature(new Uint8Array(t))}}class ze{constructor(e){(0,i.A)(this,"passes",[]),(0,i.A)(this,"readFBO",void 0),(0,i.A)(this,"writeFBO",void 0),this.rendererService=e,this.init()}getReadFBO(){return this.readFBO}getWriteFBO(){return this.writeFBO}getCurrentFBOTex(){const{getViewportSize:e,createTexture2D:t}=this.rendererService,{width:n,height:r}=e();return t({x:0,y:0,width:n,height:r,copy:!0})}getReadFBOTex(){var e=this;const{useFramebuffer:t}=this.rendererService;return new Promise((n=>{t(this.readFBO,(0,z.A)((function*(){n(e.getCurrentFBOTex())})))}))}renderBloomPass(e,t){var n=this;return(0,z.A)((function*(){const r=yield n.getReadFBOTex();let i=0;for(;i<4;)yield t.render(e,r),n.swap(),i++}))()}render(e){var t=this;return(0,z.A)((function*(){for(let n=0;n<t.passes.length;n++){const r=t.passes[n];r.setRenderToScreen(t.isLastEnabledPass(n)),"bloom"===r.getName()?yield t.renderBloomPass(e,r):(yield r.render(e),n!==t.passes.length-1&&t.swap())}}))()}resize(e,t){this.readFBO.resize({width:e,height:t}),this.writeFBO.resize({width:e,height:t})}add(e,t,n){e.init(t,n),this.passes.push(e)}insert(e,t,n,r){e.init(n,r),this.passes.splice(t,0,e)}getPostProcessingPassByName(e){return this.passes.find((t=>t.getName()===e))}init(){const{createFramebuffer:e,createTexture2D:t}=this.rendererService;this.readFBO=e({color:t({width:1,height:1,wrapS:s.CLAMP_TO_EDGE,wrapT:s.CLAMP_TO_EDGE,usage:he.RENDER_TARGET})}),this.writeFBO=e({color:t({width:1,height:1,wrapS:s.CLAMP_TO_EDGE,wrapT:s.CLAMP_TO_EDGE,usage:he.RENDER_TARGET})})}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].isEnabled())return!1;return!0}swap(){const e=this.readFBO;this.readFBO=this.writeFBO,this.writeFBO=e}}class je extends Fe{getType(){return a.Normal}getName(){return"render"}init(e,t){super.init(e,t)}render(e){const{useFramebuffer:t,clear:n}=this.rendererService,r=e.multiPassRenderer.getPostProcessor().getReadFBO();t(r,(()=>{n({color:[0,0,0,0],depth:1,stencil:0,framebuffer:r}),e.multiPassRenderer.setRenderFlag(!1),e.models.forEach((t=>{t.draw({uniforms:e.layerModel.getUninforms()})})),e.multiPassRenderer.setRenderFlag(!0)}))}}const{isNil:Ve}=o.uG;class He extends h{setupShaders(){this.shaderModuleService.registerModule("blur-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform float u_BloomFinal: 0.0;\nuniform sampler2D u_Texture;\nuniform sampler2D u_Texture2;\n\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform float u_radius: 5.0;\nuniform float u_intensity: 0.3;\nuniform float u_baseRadio: 0.5;\n\n// https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl\nvec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {\n vec4 color = vec4(0.0);\n vec2 off1 = vec2(1.3846153846) * direction;\n vec2 off2 = vec2(3.2307692308) * direction;\n color += texture2D(image, uv) * 0.2270270270;\n color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;\n color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;\n color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;\n color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;\n return color;\n}\n\nfloat luminance(vec4 color) {\n return 0.2125 * color.r + 0.7154 * color.g + 0.0721 * color.b;\n}\n\nvoid main() {\n // vec4 baseColor = texture2D(u_Texture, v_UV);\n\n float r = sqrt(u_radius);\n\n vec4 c1 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(u_radius, 0.0));\n // c1 *= luminance(c1);\n vec4 c2 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(0.0, u_radius));\n // c2 *= luminance(c2);\n vec4 c3 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(r, r));\n // c3 *= luminance(c3);\n vec4 c4 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(r, -r));\n // c4 *= luminance(c4);\n vec4 inbloomColor = (c1 + c2 + c3 + c4) * 0.25;\n\n // float lum = luminance(inbloomColor);\n // inbloomColor.rgb *= lum;\n\n if(u_BloomFinal > 0.0) {\n vec4 baseColor = texture2D(u_Texture2, v_UV);\n float baselum = luminance(baseColor);\n gl_FragColor = mix(inbloomColor, baseColor, u_baseRadio);\n if(baselum <= 0.2) {\n gl_FragColor = inbloomColor * u_intensity;\n }\n } else {\n gl_FragColor = inbloomColor;\n }\n}"});const{vs:e,fs:t,uniforms:n}=this.shaderModuleService.getModule("blur-pass"),{width:i,height:o}=this.rendererService.getViewportSize();return{vs:e,fs:t,uniforms:(0,r.A)((0,r.A)({},n),{},{u_ViewportSize:[i,o]})}}convertOptionsToUniforms(e){const t={};return Ve(e.bloomRadius)||(t.u_radius=e.bloomRadius),Ve(e.bloomIntensity)||(t.u_intensity=e.bloomIntensity),Ve(e.bloomBaseRadio)||(t.u_baseRadio=e.bloomBaseRadio),t}}const{isNil:We}=o.uG;class Xe extends h{setupShaders(){this.shaderModuleService.registerModule("blur-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\n\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform vec2 u_BlurDir: [1.0, 0.0];\n\n// https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl\nvec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {\n vec4 color = vec4(0.0);\n vec2 off1 = vec2(1.3846153846) * direction;\n vec2 off2 = vec2(3.2307692308) * direction;\n color += texture2D(image, uv) * 0.2270270270;\n color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;\n color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;\n color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;\n color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;\n return color;\n}\n\nvoid main() {\n gl_FragColor = blur9(u_Texture, v_UV, u_ViewportSize, u_BlurDir);\n}"});const{vs:e,fs:t,uniforms:n}=this.shaderModuleService.getModule("blur-pass"),{width:i,height:o}=this.rendererService.getViewportSize();return{vs:e,fs:t,uniforms:(0,r.A)((0,r.A)({},n),{},{u_ViewportSize:[i,o]})}}convertOptionsToUniforms(e){const t={};return We(e.blurRadius)||(t.u_BlurDir=[e.blurRadius,0]),t}}const{isNil:Ze}=o.uG;class Ye extends h{setupShaders(){this.shaderModuleService.registerModule("blur-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\n\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform vec2 u_BlurDir: [1.0, 0.0];\n\n// https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl\nvec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {\n vec4 color = vec4(0.0);\n vec2 off1 = vec2(1.3846153846) * direction;\n vec2 off2 = vec2(3.2307692308) * direction;\n color += texture2D(image, uv) * 0.2270270270;\n color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;\n color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;\n color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;\n color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;\n return color;\n}\n\nvoid main() {\n gl_FragColor = blur9(u_Texture, v_UV, u_ViewportSize, u_BlurDir);\n}"});const{vs:e,fs:t,uniforms:n}=this.shaderModuleService.getModule("blur-pass"),{width:i,height:o}=this.rendererService.getViewportSize();return{vs:e,fs:t,uniforms:(0,r.A)((0,r.A)({},n),{},{u_ViewportSize:[i,o]})}}convertOptionsToUniforms(e){const t={};return Ze(e.blurRadius)||(t.u_BlurDir=[0,e.blurRadius]),t}}class qe extends h{setupShaders(){this.shaderModuleService.registerModule("colorhalftone-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:'varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform vec2 u_Center : [0.5, 0.5];\nuniform float u_Angle : 0;\nuniform float u_Size : 8;\n\n#pragma include "common"\n\nfloat scale = PI / u_Size;\n\nfloat pattern(float u_Angle, vec2 texSize, vec2 texCoord) {\n float s = sin(u_Angle), c = cos(u_Angle);\n vec2 tex = texCoord * texSize - u_Center * texSize;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\n// https://github.com/evanw/glfx.js/blob/master/src/filters/fun/colorhalftone.js\nvec4 colorHalftone_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n vec3 cmy = 1.0 - color.rgb;\n float k = min(cmy.x, min(cmy.y, cmy.z));\n cmy = (cmy - k) / (1.0 - k);\n cmy = clamp(\n cmy * 10.0 - 3.0 + vec3(\n pattern(u_Angle + 0.26179, texSize, texCoord),\n pattern(u_Angle + 1.30899, texSize, texCoord),\n pattern(u_Angle, texSize, texCoord)\n ),\n 0.0,\n 1.0\n );\n k = clamp(k * 10.0 - 5.0 + pattern(u_Angle + 0.78539, texSize, texCoord), 0.0, 1.0);\n return vec4(1.0 - cmy - k, color.a);\n}\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n gl_FragColor = colorHalftone_filterColor(gl_FragColor, u_ViewportSize, v_UV);\n}'});const{vs:e,fs:t,uniforms:n}=this.shaderModuleService.getModule("colorhalftone-pass"),{width:i,height:o}=this.rendererService.getViewportSize();return{vs:e,fs:t,uniforms:(0,r.A)((0,r.A)({},n),{},{u_ViewportSize:[i,o]})}}}class Ke extends h{setupShaders(){return this.shaderModuleService.registerModule("copy-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n}"}),this.shaderModuleService.getModule("copy-pass")}}class Qe extends h{setupShaders(){this.shaderModuleService.registerModule("hexagonalpixelate-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform vec2 u_Center : [0.5, 0.5];\nuniform float u_Scale : 10;\n\n// https://github.com/evanw/glfx.js/blob/master/src/filters/fun/hexagonalpixelate.js\nvec4 hexagonalPixelate_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n vec2 tex = (texCoord * texSize - u_Center * texSize) / u_Scale;\n tex.y /= 0.866025404;\n tex.x -= tex.y * 0.5;\n vec2 a;\n if (tex.x + tex.y - floor(tex.x) - floor(tex.y) < 1.0) {\n a = vec2(floor(tex.x), floor(tex.y));\n }\n else a = vec2(ceil(tex.x), ceil(tex.y));\n vec2 b = vec2(ceil(tex.x), floor(tex.y));\n vec2 c = vec2(floor(tex.x), ceil(tex.y));\n vec3 TEX = vec3(tex.x, tex.y, 1.0 - tex.x - tex.y);\n vec3 A = vec3(a.x, a.y, 1.0 - a.x - a.y);\n vec3 B = vec3(b.x, b.y, 1.0 - b.x - b.y);\n vec3 C = vec3(c.x, c.y, 1.0 - c.x - c.y);\n float alen = length(TEX - A);\n float blen = length(TEX - B);\n float clen = length(TEX - C);\n vec2 choice;\n if (alen < blen) {\n if (alen < clen) choice = a;\n else choice = c;\n } else {\n if (blen < clen) choice = b;\n else choice = c;\n }\n choice.x += choice.y * 0.5;\n choice.y *= 0.866025404;\n choice *= u_Scale / texSize;\n return texture2D(texture, choice + u_Center);\n}\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n gl_FragColor = hexagonalPixelate_sampleColor(u_Texture, u_ViewportSize, v_UV);\n}"});const{vs:e,fs:t,uniforms:n}=this.shaderModuleService.getModule("hexagonalpixelate-pass"),{width:i,height:o}=this.rendererService.getViewportSize();return{vs:e,fs:t,uniforms:(0,r.A)((0,r.A)({},n),{},{u_ViewportSize:[i,o]})}}}class $e extends h{setupShaders(){this.shaderModuleService.registerModule("ink-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform float u_Strength : 0.6;\n\nvec4 ink_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n vec2 dx = vec2(1.0 / texSize.x, 0.0);\n vec2 dy = vec2(0.0, 1.0 / texSize.y);\n vec4 color = texture2D(texture, texCoord);\n float bigTotal = 0.0;\n float smallTotal = 0.0;\n vec3 bigAverage = vec3(0.0);\n vec3 smallAverage = vec3(0.0);\n for (float x = -2.0; x <= 2.0; x += 1.0) {\n for (float y = -2.0; y <= 2.0; y += 1.0) {\n vec3 sample = texture2D(texture, texCoord + dx * x + dy * y).rgb;\n bigAverage += sample;\n bigTotal += 1.0;\n if (abs(x) + abs(y) < 2.0) {\n smallAverage += sample;\n smallTotal += 1.0;\n }\n }\n }\n vec3 edge = max(vec3(0.0), bigAverage / bigTotal - smallAverage / smallTotal);\n float power = u_Strength * u_Strength * u_Strength * u_Strength * u_Strength;\n return vec4(color.rgb - dot(edge, edge) * power * 100000.0, color.a);\n}\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n gl_FragColor = ink_sampleColor(u_Texture, u_ViewportSize, v_UV);\n}"});const{vs:e,fs:t,uniforms:n}=this.shaderModuleService.getModule("ink-pass"),{width:i,height:o}=this.rendererService.getViewportSize();return{vs:e,fs:t,uniforms:(0,r.A)((0,r.A)({},n),{},{u_ViewportSize:[i,o]})}}}class Je extends h{setupShaders(){return this.shaderModuleService.registerModule("noise-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\nuniform float u_Amount : 0.5;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n// https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js\nvec4 noise_filterColor(vec4 color, vec2 texCoord) {\n float diff = (rand(texCoord) - 0.5) * u_Amount;\n color.r += diff;\n color.g += diff;\n color.b += diff;\n return color;\n}\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n gl_FragColor = noise_filterColor(gl_FragColor, v_UV);\n}"}),this.shaderModuleService.getModule("noise-pass")}}class et extends h{setupShaders(){return this.shaderModuleService.registerModule("sepia-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\n\nuniform float u_Amount : 0.5;\n\n// https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/sepia.js\nvec4 sepia_filterColor(vec4 color) {\n float r = color.r;\n float g = color.g;\n float b = color.b;\n color.r =\n min(1.0, (r * (1.0 - (0.607 * u_Amount))) + (g * (0.769 * u_Amount)) + (b * (0.189 * u_Amount)));\n color.g = min(1.0, (r * 0.349 * u_Amount) + (g * (1.0 - (0.314 * u_Amount))) + (b * 0.168 * u_Amount));\n color.b = min(1.0, (r * 0.272 * u_Amount) + (g * 0.534 * u_Amount) + (b * (1.0 - (0.869 * u_Amount))));\n return color;\n}\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n gl_FragColor = sepia_filterColor(gl_FragColor);\n}"}),this.shaderModuleService.getModule("sepia-pass")}}const tt=new class{constructor(){(0,i.A)(this,"sceneConfigCache",{}),(0,i.A)(this,"layerConfigCache",{}),(0,i.A)(this,"layerAttributeConfigCache",{})}getSceneConfig(e){return this.sceneConfigCache[e]}getSceneWarninfo(e){return q[e]}setSceneConfig(e,t){this.sceneConfigCache[e]=(0,r.A)((0,r.A)({},Q),t)}getLayerConfig(e){return this.layerConfigCache[e]}setLayerConfig(e,t,n){this.layerConfigCache[t]=(0,r.A)({},K({},this.sceneConfigCache[e],$,n))}getAttributeConfig(e){return this.layerAttributeConfigCache[e]}setAttributeConfig(e,t){this.layerAttributeConfigCache[e]=(0,r.A)((0,r.A)({},this.layerAttributeConfigCache[e]),t)}clean(){this.sceneConfigCache={},this.layerConfigCache={}}};let nt=0;function rt(){const e=new Be,t=new oe,n=new H,r=new ie(n),i=new G,o=new j,a=new Z,s=new Y,l=new X,c={id:""+nt++,globalConfigService:tt,shaderModuleService:e,debugService:t,cameraService:n,coordinateSystemService:r,fontService:i,iconService:o,markerService:a,popupService:s,controlService:l,customRenderService:{}},u=new ge(c);c.layerService=u;const h=new Re(c);c.sceneService=h;const d=new ce(c);c.interactionService=d;const f=new de(c);c.pickingService=f;const p={clear:new Ue,pixelPicking:new Ge,render:new je};c.normalPassFactory=e=>p[e];const g={copy:new Ke,bloom:new He,blurH:new Xe,blurV:new Ye,noise:new Je,sepia:new et,colorHalftone:new qe,hexagonalPixelate:new Qe,ink:new $e};return c.postProcessingPass=g,c.postProcessingPassFactory=e=>g[e],c}function it(e){const t=(0,r.A)({},e);return t.postProcessor=new ze(t.rendererService),t.multiPassRenderer=new ke(t.postProcessor),t.styleAttributeService=new be(t.rendererService),t}const ot=["loaded","fontloaded","maploaded","resize","destroy","dragstart","dragging","dragend","dragcancel"];let at=function(e){return e.IMAGE="image",e.CUSTOMIMAGE="customImage",e.ARRAYBUFFER="arraybuffer",e.RGB="rgb",e.TERRAINRGB="terrainRGB",e.CUSTOMRGB="customRGB",e.CUSTOMARRAYBUFFER="customArrayBuffer",e.CUSTOMTERRAINRGB="customTerrainRGB",e}({})},74635:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(72016);function i(e,t){(0,r.A)(e,t),t.add(e)}},74784:(e,t,n)=>{var r=n(3766)(Object.getPrototypeOf,Object);e.exports=r},74967:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},75234:(e,t,n)=>{var r=n(86912),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),l=Array(s);++a<s;)l[a]=o[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=o[a];return c[t]=n(l),r(e,this,c)}}},75853:(e,t,n)=>{e=n.nmd(e);var r=n(78942),i=n(34772),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;e.exports=l},75964:(e,t,n)=>{var r=n(39747),i=n(74784),o=n(84882);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},76853:(e,t,n)=>{var r=n(69011);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},77848:(e,t,n)=>{var r=n(23945),i=n(74535);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r<o;){var l=n[r];l&&e(t,l,r,a)}return t}))}},77979:(e,t,n)=>{var r=n(79847),i=n(99306),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},78340:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},78763:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},78942:(e,t,n)=>{var r=n(74967),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},79067:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},79071:e=>{e.exports=function(){}},79847:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},79968:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},80088:(e,t,n)=>{var r=n(44700);e.exports=function(e){return r(this,e).get(e)}},80393:(e,t,n)=>{var r=n(48244),i=n(77979),o=n(81211);e.exports=function(e){return r(e,o,i)}},80547:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},80777:(e,t,n)=>{var r=n(28486),i=n(80547);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},80796:(e,t,n)=>{var r=n(47403),i=n(3316)(r);e.exports=i},81211:(e,t,n)=>{var r=n(10358),i=n(195),o=n(36529);e.exports=function(e){return o(e)?r(e):i(e)}},81935:(e,t,n)=>{var r=n(28486),i=n(80547);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},82087:(e,t,n)=>{"use strict";var r=n(35379).forEach,i=n(95839),o=n(41850),a=n(9158),s=n(64651),l=n(23766),c=n(54750),u=n(58571),h=n(33787),d=n(73712),f=n(99814);function p(e){return Array.isArray(e)||void 0!==e.length}function g(e){if(Array.isArray(e))return e;var t=[];return r(e,(function(e){t.push(e)})),t}function m(e){return e&&1===e.nodeType}function _(e,t,n){var r=e[t];return null==r&&void 0!==n?n:r}e.exports=function(e){var t;if((e=e||{}).idHandler)t={get:function(t){return e.idHandler.get(t,!0)},set:e.idHandler.set};else{var n=a(),v=s({idGenerator:n,stateHandler:h});t=v}var y=e.reporter;y||(y=l(!1===y));var E=_(e,"batchProcessor",u({reporter:y})),A={};A.callOnAdd=!!_(e,"callOnAdd",!0),A.debug=!!_(e,"debug",!1);var b,T=o(t),x=i({stateHandler:h}),S=_(e,"strategy","object"),R=_(e,"important",!1),C={reporter:y,batchProcessor:E,stateHandler:h,idHandler:t,important:R};if("scroll"===S&&(c.isLegacyOpera()?(y.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),S="object"):c.isIE(9)&&(y.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),S="object")),"scroll"===S)b=f(C);else{if("object"!==S)throw new Error("Invalid strategy name: "+S);b=d(C)}var L={};return{listenTo:function(e,n,i){function o(e){var t=T.get(e);r(t,(function(t){t(e)}))}function a(e,t,n){T.add(t,n),e&&n(t)}if(i||(i=n,n=e,e={}),!n)throw new Error("At least one element required.");if(!i)throw new Error("Listener required.");if(m(n))n=[n];else{if(!p(n))return y.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");n=g(n)}var s=0,l=_(e,"callOnAdd",A.callOnAdd),c=_(e,"onReady",(function(){})),u=_(e,"debug",A.debug);r(n,(function(e){h.getState(e)||(h.initState(e),t.set(e));var d=t.get(e);if(u&&y.log("Attaching listener to element",d,e),!x.isDetectable(e))return u&&y.log(d,"Not detectable."),x.isBusy(e)?(u&&y.log(d,"System busy making it detectable"),a(l,e,i),L[d]=L[d]||[],void L[d].push((function(){++s===n.length&&c()}))):(u&&y.log(d,"Making detectable..."),x.markBusy(e,!0),b.makeDetectable({debug:u,important:R},e,(function(e){if(u&&y.log(d,"onElementDetectable"),h.getState(e)){x.markAsDetectable(e),x.markBusy(e,!1),b.addListener(e,o),a(l,e,i);var t=h.getState(e);if(t&&t.startSize){var f=e.offsetWidth,p=e.offsetHeight;t.startSize.width===f&&t.startSize.height===p||o(e)}L[d]&&r(L[d],(function(e){e()}))}else u&&y.log(d,"Element uninstalled before being detectable.");delete L[d],++s===n.length&&c()})));u&&y.log(d,"Already detecable, adding listener."),a(l,e,i),s++})),s===n.length&&c()},removeListener:T.removeListener,removeAllListeners:T.removeAllListeners,uninstall:function(e){if(!e)return y.error("At least one element is required.");if(m(e))e=[e];else{if(!p(e))return y.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=g(e)}r(e,(function(e){T.removeAllListeners(e),b.uninstall(e),h.cleanState(e)}))},initDocument:function(e){b.initDocument&&b.initDocument(e)}}}},82237:(e,t,n)=>{var r=n(52837),i=n(83417),o=n(92013);e.exports=function(e){return i(e)?o(e):r(e)}},82438:(e,t,n)=>{var r=n(15630);e.exports=function(e){return e&&e.length?r(e):[]}},82451:(e,t,n)=>{var r=n(40091),i=n(77848)((function(e,t,n){r(e,t,n)}));e.exports=i},82619:e=>{e.exports=function(e){return function(){return e}}},83061:()=>{window._iconfont_svg_string_3580659='<svg><symbol id="l7-icon-area1" viewBox="0 0 1024 1024"><path d="M796.444444 56.888889a113.777778 113.777778 0 0 1 43.064889 219.136l38.798223 466.261333a113.777778 113.777778 0 1 1-133.518223 145.237334H279.210667a113.777778 113.777778 0 1 1-60.302223-137.272889L697.856 227.555556A113.777778 113.777778 0 0 1 796.444444 56.888889z m56.888889 750.933333a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m-682.666666 0a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m577.592889-534.072889L269.198222 796.444444c4.152889 7.168 7.509333 14.791111 10.012445 22.812445h465.578666a114.119111 114.119111 0 0 1 65.479111-71.224889l-38.798222-466.261333a112.924444 112.924444 0 0 1-23.210666-7.964445zM796.444444 125.155556a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-area" viewBox="0 0 1024 1024"><path d="M796.444444 56.888889a113.777778 113.777778 0 0 1 43.008 219.136l38.855112 466.261333a113.777778 113.777778 0 0 1-16.497778 224.540445L853.333333 967.111111a113.777778 113.777778 0 0 1-108.544-79.644444H279.210667a113.834667 113.834667 0 0 1-100.067556 79.36L170.666667 967.111111a113.777778 113.777778 0 0 1-17.066667-226.304l30.492444-351.175111a113.777778 113.777778 0 0 1 34.986667-218.680889L227.555556 170.666667a113.777778 113.777778 0 0 1 99.896888 59.221333l355.84-71.395556a113.777778 113.777778 0 0 1 104.675556-101.262222L796.444444 56.888889z m56.888889 750.933333a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m-682.666666 0a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m526.051555-582.314666L340.650667 296.903111a113.891556 113.891556 0 0 1-88.462223 98.645333l-30.947555 355.84c27.477333 13.653333 48.64 38.115556 58.026667 67.754667h465.521777a114.119111 114.119111 0 0 1 65.536-71.168l-38.855111-466.261333a113.948444 113.948444 0 0 1-74.752-56.206222zM227.555556 238.933333a45.511111 45.511111 0 1 0 0 91.022223 45.511111 45.511111 0 0 0 0-91.022223z m568.888888-113.777777a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-delete" viewBox="0 0 1024 1024"><path d="M705.422222 85.333333a34.133333 34.133333 0 0 1 34.133334 34.133334V227.555556h136.533333a34.133333 34.133333 0 0 1 0 68.266666h-25.543111l-24.348445 610.076445a34.133333 34.133333 0 0 1-34.133333 32.768H231.936a34.133333 34.133333 0 0 1-34.076444-32.768L173.340444 295.822222H147.911111a34.133333 34.133333 0 1 1 0-68.266666H284.444444V119.466667a34.133333 34.133333 0 0 1 34.133334-34.133334h386.844444zM241.720889 295.822222l22.983111 574.577778h494.535111l23.04-574.577778H241.720889zM671.288889 153.6H352.711111V227.555556h318.577778V153.6z" ></path></symbol><symbol id="l7-icon-color" viewBox="0 0 1024 1024"><path d="M512 56.888889c9.841778 0 19.626667 0.341333 29.354667 0.910222 69.176889 4.437333 119.068444 62.577778 124.302222 131.072l0.455111 9.386667c0.739556 44.600889 15.303111 84.935111 44.999111 114.631111 27.022222 27.022222 62.805333 41.528889 102.570667 44.430222l12.060444 0.568889c72.476444 1.194667 135.793778 52.451556 140.458667 124.757333 1.137778 18.261333 1.251556 36.807111 0.170667 55.637334-13.198222 233.585778-211.399111 424.220444-445.326223 428.714666L512 967.111111a455.111111 455.111111 0 0 1-455.054222-464.156444c4.551111-233.927111 195.185778-432.128 428.771555-445.326223C494.535111 57.116444 503.296 56.888889 512 56.888889z m0 68.266667a385.706667 385.706667 0 0 0-22.414222 0.625777C291.726222 136.988444 129.080889 305.948444 125.155556 504.263111c-4.152889 212.366222 163.100444 387.185778 372.508444 394.353778l13.425778 0.227555 8.533333-0.113777c198.371556-3.811556 367.331556-166.456889 378.538667-364.373334a396.174222 396.174222 0 0 0-0.170667-47.331555c-1.991111-31.232-29.127111-56.604444-67.128889-60.472889l-8.248889-0.455111-14.051555-0.682667c-56.547556-4.209778-107.406222-25.884444-145.806222-64.284444-38.855111-38.798222-60.416-90.225778-64.284445-145.749334l-0.910222-21.333333c-2.901333-38.001778-28.785778-66.048-60.302222-68.096A433.891556 433.891556 0 0 0 512 125.155556zM438.044444 682.666667a68.266667 68.266667 0 1 1 0 136.533333 68.266667 68.266667 0 0 1 0-136.533333z m-170.666666-227.555556a68.266667 68.266667 0 1 1 0 136.533333 68.266667 68.266667 0 0 1 0-136.533333z m142.222222-227.555555a68.266667 68.266667 0 1 1 0 136.533333 68.266667 68.266667 0 0 1 0-136.533333z" ></path></symbol><symbol id="l7-icon-base-map" viewBox="0 0 1024 1024"><path d="M923.761778 115.029333A34.133333 34.133333 0 0 1 967.111111 147.911111v624.128a34.133333 34.133333 0 0 1-22.186667 32.028445l-278.755555 103.992888a34.133333 34.133333 0 0 1-23.665778 0.056889L381.724444 812.714667a34.133333 34.133333 0 0 0-23.665777 0.113777L102.968889 908.060444a34.133333 34.133333 0 0 1-45.738667-26.965333L56.888889 876.088889V251.960889a34.133333 34.133333 0 0 1 22.186667-32.028445l278.755555-103.992888a34.133333 34.133333 0 0 1 20.992-0.967112l266.183111 72.988445a34.133333 34.133333 0 0 0 18.204445 0zM403.911111 192.625778v555.576889l216.177778 79.075555V251.960889l-216.177778-59.335111z m-68.266667 4.380444L125.155556 275.569778v551.310222l210.432-78.506667V197.006222zM898.844444 192.853333l-210.545777 58.936889v575.089778l210.545777-78.563556V192.853333z" ></path></symbol><symbol id="l7-icon-dot" viewBox="0 0 1024 1024"><path d="M341.333333 739.555556a113.777778 113.777778 0 0 1 8.533334 227.271111L341.333333 967.111111a113.777778 113.777778 0 0 1-8.533333-227.271111L341.333333 739.555556z m0 68.266666a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222zM910.222222 341.333333a113.777778 113.777778 0 0 1 8.533334 227.271111L910.222222 568.888889a113.777778 113.777778 0 0 1-8.533333-227.271111L910.222222 341.333333z m0 68.266667a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222zM227.555556 56.888889a113.777778 113.777778 0 0 1 8.533333 227.271111L227.555556 284.444444a113.777778 113.777778 0 0 1-8.533334-227.271111L227.555556 56.888889z m0 68.266667a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-display" viewBox="0 0 1024 1024"><path d="M512 170.666667c284.444444 0 455.111111 227.555556 455.111111 341.333333s-170.666667 341.333333-455.111111 341.333333-455.111111-227.555556-455.111111-341.333333 170.666667-341.333333 455.111111-341.333333z m0 68.266666C303.729778 238.933333 125.155556 401.237333 125.155556 512c0 110.762667 178.574222 273.066667 386.844444 273.066667s386.844444-162.304 386.844444-273.066667c0-110.762667-178.574222-273.066667-386.844444-273.066667zM512 341.333333a170.666667 170.666667 0 1 1 0 341.333334 170.666667 170.666667 0 0 1 0-341.333334z m0 68.266667a102.4 102.4 0 1 0 0 204.8 102.4 102.4 0 0 0 0-204.8z" ></path></symbol><symbol id="l7-icon-enlarge" viewBox="0 0 1024 1024"><path d="M546.133333 147.911111l-0.056889 329.955556H876.088889a34.133333 34.133333 0 0 1 0 68.266666H546.076444v329.955556a34.133333 34.133333 0 0 1-68.266666 0V546.133333H147.911111a34.133333 34.133333 0 1 1 0-68.266666h329.898667V147.911111a34.133333 34.133333 0 0 1 68.266666 0z" ></path></symbol><symbol id="l7-icon-export-picture" viewBox="0 0 1024 1024"><path d="M883.873684 161.684211a32.336842 32.336842 0 0 1 32.336842 32.336842v582.063158a32.336842 32.336842 0 0 1-32.336842 32.336842H86.231579a32.336842 32.336842 0 0 1-32.336842-32.336842V194.021053a32.336842 32.336842 0 0 1 32.336842-32.336842h797.642105z m-32.336842 64.673684H118.568421v517.389473h170.792421a32.175158 32.175158 0 0 1 0.431158-0.646736l3.772632-4.473264 330.320842-330.374736a32.336842 32.336842 0 0 1 38.588631-5.389474l4.473263 3.018105 184.589474 147.725474V226.357895z m-202.428631 248.131368L379.850105 743.747368H851.536842v-107.304421l-202.428631-161.953684zM323.368421 323.368421a107.789474 107.789474 0 1 1 0 215.578947 107.789474 107.789474 0 0 1 0-215.578947z m0 64.673684a43.115789 43.115789 0 1 0 0 86.231579 43.115789 43.115789 0 0 0 0-86.231579z" ></path></symbol><symbol id="l7-icon-exit-fullscreen" viewBox="0 0 1024 1024"><path d="M841.955556 591.644444a34.133333 34.133333 0 0 1 5.518222 67.811556l-5.518222 0.455111h-133.745778l192 192.056889a34.133333 34.133333 0 0 1-38.343111 55.182222l-5.176889-2.958222-4.721778-3.982222L659.911111 708.266667V841.955556a34.133333 34.133333 0 0 1-28.615111 33.678222L625.777778 876.088889a34.133333 34.133333 0 0 1-33.678222-28.615111L591.644444 841.955556V625.777778a34.133333 34.133333 0 0 1 28.615112-33.678222L625.777778 591.644444h216.177778z m-443.733334 0a34.133333 34.133333 0 0 1 33.678222 28.615112L432.355556 625.777778v216.177778a34.133333 34.133333 0 0 1-67.811556 5.518222L364.088889 841.955556v-133.745778l-192.056889 192a34.133333 34.133333 0 0 1-52.224-43.52l3.982222-4.721778L315.847111 659.911111H182.044444a34.133333 34.133333 0 0 1-33.678222-28.615111L147.911111 625.777778a34.133333 34.133333 0 0 1 28.615111-33.678222L182.044444 591.644444H398.222222zM167.310222 119.808l4.721778 3.982222L364.088889 315.847111V182.044444a34.133333 34.133333 0 0 1 28.615111-33.678222L398.222222 147.911111a34.133333 34.133333 0 0 1 33.678222 28.615111L432.355556 182.044444V398.222222a34.133333 34.133333 0 0 1-28.615112 33.678222L398.222222 432.355556H182.044444a34.133333 34.133333 0 0 1-5.518222-67.811556L182.044444 364.088889h133.802667L123.790222 172.032a34.133333 34.133333 0 0 1 43.52-52.224z m732.899556 3.982222a34.133333 34.133333 0 0 1 3.982222 43.52l-3.982222 4.721778L708.266667 364.088889H841.955556a34.133333 34.133333 0 0 1 33.678222 28.615111L876.088889 398.222222a34.133333 34.133333 0 0 1-28.615111 33.678222L841.955556 432.355556H625.777778a34.133333 34.133333 0 0 1-33.678222-28.615112L591.644444 398.222222V182.044444a34.133333 34.133333 0 0 1 67.811556-5.518222l0.455111 5.518222v133.802667l192.056889-192.056889a34.133333 34.133333 0 0 1 48.241778 0z" ></path></symbol><symbol id="l7-icon-line" viewBox="0 0 1024 1024"><path d="M853.333333 56.888889a113.777778 113.777778 0 0 1 8.533334 227.271111L853.333333 284.444444c-19.000889 0-36.864-4.664889-52.622222-12.856888l-529.123555 529.066666a113.777778 113.777778 0 0 1-92.387556 166.115556L170.666667 967.111111a113.777778 113.777778 0 0 1-8.533334-227.271111L170.666667 739.555556c19.000889 0 36.864 4.664889 52.622222 12.856888l529.123555-529.066666a113.777778 113.777778 0 0 1 92.387556-166.115556L853.333333 56.888889zM170.666667 807.822222a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m682.666666-682.666666a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-layer" viewBox="0 0 1024 1024"><path d="M767.089778 625.777778l180.167111 82.773333a34.133333 34.133333 0 0 1 4.892444 59.278222l-4.892444 2.730667-420.977778 193.422222a34.133333 34.133333 0 0 1-22.983111 1.991111l-5.575111-1.991111-420.977778-193.422222a34.133333 34.133333 0 0 1-4.892444-59.278222l4.892444-2.730667L256.853333 625.777778l81.749334 37.546666L172.771556 739.555556 512 895.374222 851.171556 739.555556l-165.831112-76.231112 81.749334-37.546666z m0-227.555556l180.167111 82.773334a34.133333 34.133333 0 0 1 4.892444 59.278222l-4.892444 2.730666-420.977778 193.422223a34.133333 34.133333 0 0 1-22.983111 1.991111l-5.575111-1.991111-420.977778-193.422223a34.133333 34.133333 0 0 1-4.892444-59.278222l4.892444-2.730666L256.853333 398.222222l81.749334 37.546667-165.831111 76.174222L512 667.818667l339.171556-155.875556-165.831112-76.174222L767.089778 398.222222zM497.720889 60.017778a34.133333 34.133333 0 0 1 28.558222 0l420.977778 193.422222a34.133333 34.133333 0 0 1 0 62.008889l-420.977778 193.422222a34.133333 34.133333 0 0 1-28.558222 0l-420.977778-193.422222a34.133333 34.133333 0 0 1 0-62.008889zM512 128.568889L172.771556 284.387556 512 440.263111l339.171556-155.875555L512 128.568889z" ></path></symbol><symbol id="l7-icon-narrow" viewBox="0 0 1024 1024"><path d="M910.222222 512a34.133333 34.133333 0 0 1-34.133333 34.133333H147.911111a34.133333 34.133333 0 1 1 0-68.266666h728.177778a34.133333 34.133333 0 0 1 34.133333 34.133333z" ></path></symbol><symbol id="l7-icon-fullscreen" viewBox="0 0 1024 1024"><path d="M645.176889 597.674667l4.721778 3.982222L841.955556 793.6l0.056888-133.688889a34.133333 34.133333 0 0 1 28.615112-33.678222L876.088889 625.777778a34.133333 34.133333 0 0 1 33.678222 28.615111L910.222222 659.911111v216.177778a34.133333 34.133333 0 0 1-28.615111 33.678222L876.088889 910.222222h-216.177778a34.133333 34.133333 0 0 1-5.518222-67.811555l5.518222-0.455111h133.745778l-192-192.056889a34.133333 34.133333 0 0 1 43.52-52.224z m-222.833778 3.982222a34.133333 34.133333 0 0 1 3.982222 43.52l-3.982222 4.721778L230.286222 841.955556H364.088889a34.133333 34.133333 0 0 1 33.678222 28.615111L398.222222 876.088889a34.133333 34.133333 0 0 1-28.615111 33.678222L364.088889 910.222222H147.911111a34.133333 34.133333 0 0 1-33.678222-28.615111L113.777778 876.088889v-216.177778a34.133333 34.133333 0 0 1 67.811555-5.518222l0.455111 5.518222-0.056888 133.745778 192.113777-192a34.133333 34.133333 0 0 1 48.241778 0zM364.088889 113.777778a34.133333 34.133333 0 0 1 5.518222 67.811555L364.088889 182.044444H230.343111l192 192.056889a34.133333 34.133333 0 0 1-43.52 52.224l-4.721778-3.982222-192.113777-192.056889L182.044444 364.088889a34.133333 34.133333 0 0 1-28.615111 33.678222L147.911111 398.222222a34.133333 34.133333 0 0 1-33.678222-28.615111L113.777778 364.088889V147.911111a34.133333 34.133333 0 0 1 28.615111-33.678222L147.911111 113.777778h216.177778z m512 0a34.133333 34.133333 0 0 1 33.678222 28.615111L910.222222 147.911111v216.177778a34.133333 34.133333 0 0 1-67.811555 5.518222L841.955556 364.088889l-0.056889-133.745778-192 192a34.133333 34.133333 0 0 1-52.224-43.52l3.982222-4.721778L793.6 182.044444H659.911111a34.133333 34.133333 0 0 1-33.678222-28.615111L625.777778 147.911111a34.133333 34.133333 0 0 1 28.615111-33.678222L659.911111 113.777778h216.177778z" ></path></symbol><symbol id="l7-icon-hide" viewBox="0 0 1024 1024"><path d="M875.52 87.836444a34.133333 34.133333 0 0 1 7.281778 43.121778l-3.527111 5.006222-682.666667 796.444445a34.133333 34.133333 0 0 1-55.409778-39.367111l3.527111-5.006222 97.166223-113.379556C123.164444 697.969778 56.888889 582.940444 56.888889 512c0-113.777778 170.666667-341.333333 455.111111-341.333333a496.64 496.64 0 0 1 208.952889 45.112889l106.439111-124.188445a34.133333 34.133333 0 0 1 48.128-3.754667z m-38.684444 202.524445C921.031111 362.951111 967.111111 452.835556 967.111111 512c0 113.777778-170.666667 341.333333-455.111111 341.333333-50.631111 0-97.678222-7.224889-140.8-19.740444l50.232889-58.595556A417.393778 417.393778 0 0 0 512 785.066667c208.270222 0 386.844444-162.304 386.844444-273.066667 0-52.849778-40.675556-117.418667-105.813333-170.496l43.804445-51.2zM512 238.933333C303.729778 238.933333 125.155556 401.237333 125.155556 512c0 66.787556 64.853333 152.291556 162.133333 209.692444L377.173333 616.675556a170.666667 170.666667 0 0 1 217.713778-253.895112l78.620445-91.704888A432.924444 432.924444 0 0 0 512 238.933333z m166.684444 236.088889a170.666667 170.666667 0 0 1-177.664 207.303111l177.607112-207.303111zM512 409.6a102.4 102.4 0 0 0-88.746667 153.486222L548.864 416.426667A102.172444 102.172444 0 0 0 512 409.6z" ></path></symbol><symbol id="l7-icon-rectangle" viewBox="0 0 1024 1024"><path d="M170.666667 56.888889a113.777778 113.777778 0 0 1 108.544 79.644444H853.333333a34.133333 34.133333 0 0 1 33.678223 28.615111L887.466667 170.666667v574.122666a113.777778 113.777778 0 1 1-142.677334 142.734223L170.666667 887.466667a34.133333 34.133333 0 0 1-33.678223-28.615111L136.533333 853.333333V279.210667A113.777778 113.777778 0 0 1 170.666667 56.888889z m682.666666 750.933333a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m-34.133333-603.022222H279.210667a114.062222 114.062222 0 0 1-74.353778 74.410667L204.8 819.2h539.989333a114.062222 114.062222 0 0 1 74.410667-74.410667V204.8zM170.666667 125.155556a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-ranging" viewBox="0 0 1024 1024"><path d="M723.171556 50.403556l250.424888 250.424888a31.061333 31.061333 0 0 1 0 43.918223L344.746667 973.596444a31.061333 31.061333 0 0 1-43.918223 0L50.403556 723.171556a31.061333 31.061333 0 0 1 0-43.918223L679.253333 50.403556a31.061333 31.061333 0 0 1 43.918223 0z m-21.959112 74.524444l-39.765333 39.822222 98.986667 98.872889a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.640889-98.929778-98.929778-63.886222 63.886222 62.179556 62.122667a34.133333 34.133333 0 0 1-44.088889 51.882667L563.2 387.242667 501.077333 325.063111 437.191111 388.949333l98.986667 98.929778a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.640889-98.929778-98.929778-63.886222 63.886222L387.242667 563.2a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.584-62.122667-62.179556-63.886222 63.886222 98.986667 98.929778a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.640889-98.929778-98.929778-39.765333 39.822222 197.802667 197.745778 576.284444-576.284444-197.802667-197.745778z" ></path></symbol><symbol id="l7-icon-reposition" viewBox="0 0 1024 1024"><path d="M512 56.888889a34.133333 34.133333 0 0 1 34.133333 34.133333v24.177778A398.336 398.336 0 0 1 908.856889 477.866667h24.177778a34.133333 34.133333 0 0 1 0 68.266666h-24.177778A398.336 398.336 0 0 1 546.133333 908.856889L546.133333 932.977778a34.133333 34.133333 0 0 1-68.266666 0v-24.177778A398.336 398.336 0 0 1 115.2 546.133333L91.022222 546.133333a34.133333 34.133333 0 1 1 0-68.266666h24.177778A398.336 398.336 0 0 1 477.866667 115.2V91.022222A34.133333 34.133333 0 0 1 512 56.888889z m34.190222 126.862222L546.133333 193.422222a34.133333 34.133333 0 1 1-68.266666 0v-9.671111A330.069333 330.069333 0 0 0 183.751111 477.866667h9.671111a34.133333 34.133333 0 1 1 0 68.266666l-9.671111 0.056889A330.069333 330.069333 0 0 0 477.866667 840.248889V830.577778a34.133333 34.133333 0 0 1 68.266666 0l0.056889 9.671111A330.069333 330.069333 0 0 0 840.248889 546.133333L830.577778 546.133333a34.133333 34.133333 0 0 1 0-68.266666h9.671111A330.069333 330.069333 0 0 0 546.133333 183.751111zM512 341.333333a170.666667 170.666667 0 1 1 0 341.333334 170.666667 170.666667 0 0 1 0-341.333334z m0 68.266667a102.4 102.4 0 1 0 0 204.8 102.4 102.4 0 0 0 0-204.8z" ></path></symbol><symbol id="l7-icon-round" viewBox="0 0 1024 1024"><path d="M512 56.888889a455.111111 455.111111 0 0 1 391.395556 687.502222 113.777778 113.777778 0 0 1-159.061334 158.890667A455.111111 455.111111 0 0 1 120.604444 279.608889 113.777778 113.777778 0 0 1 279.608889 120.604444 452.835556 452.835556 0 0 1 512 56.888889z m0 68.266667a384.910222 384.910222 0 0 0-191.715556 50.744888A113.777778 113.777778 0 0 1 175.957333 320.284444a386.844444 386.844444 0 0 0 527.815111 527.758223 113.777778 113.777778 0 0 1 144.270223-144.440889A386.844444 386.844444 0 0 0 512 125.155556z m299.406222 640.739555a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222zM212.593778 167.082667a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-guanbi" viewBox="0 0 1024 1024"><path d="M576 512l277.333333 277.333333-64 64-277.333333-277.333333L234.666667 853.333333 170.666667 789.333333l277.333333-277.333333L170.666667 234.666667 234.666667 170.666667l277.333333 277.333333L789.333333 170.666667 853.333333 234.666667 576 512z" ></path></symbol></svg>',function(e){try{var t,n=(t=(t=document.getElementsByTagName("script"))[t.length-1]).getAttribute("data-injectcss");if(!(t=t.getAttribute("data-disable-injectsvg"))){var r,i,o,a,s;if(n&&!e.__iconfont__svg__cssinject__){e.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(t){console&&console.log(t)}}r=function(){var t,n=document.createElement("div");n.innerHTML=e._iconfont_svg_string_3580659,(n=n.getElementsByTagName("svg")[0])&&(n.setAttribute("aria-hidden","true"),n.style.position="absolute",n.style.width=0,n.style.height=0,n.style.overflow="hidden",(t=document.body).firstChild?function(e,t){t.parentNode.insertBefore(e,t)}(n,t.firstChild):t.appendChild(n))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(r,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),r()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=r,a=e.document,s=!1,function e(){try{a.documentElement.doScroll("left")}catch(t){return void setTimeout(e,50)}l()}(),a.onreadystatechange=function(){"complete"==a.readyState&&(a.onreadystatechange=null,l())})}function l(){s||(s=!0,o())}}catch(i){}}(window)},83417:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},83546:(e,t,n)=>{var r=n(39032),i=n(77979);e.exports=function(e,t){return r(e,i(e),t)}},83943:(e,t,n)=>{var r=n(81935),i=n(49460),o=n(2306),a=o&&o.isSet,s=a?i(a):r;e.exports=s},84354:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},84882:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},85608:(e,t,n)=>{"use strict";n.d(t,{C6:()=>i,Cl:()=>o,Ju:()=>c,Tt:()=>a,YH:()=>l,aN:()=>h,fX:()=>d,sH:()=>s,zs:()=>u});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function s(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function l(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function c(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function h(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function d(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError},85832:(e,t,n)=>{var r=n(11129),i=n(74784),o=n(77979),a=n(99306),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},86330:(e,t,n)=>{"use strict";function r(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,l,"next",e)}function l(e){r(a,i,o,s,l,"throw",e)}s(void 0)}))}}n.d(t,{A:()=>i})},86403:(e,t,n)=>{var r=n(62945),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},86596:e=>{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}},86912:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},87379:(e,t,n)=>{var r=n(65650),i=n(8870),o=n(29005),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},88435:e=>{"use strict";function t(e,t,n,r){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=n,this.p2y=r}e.exports=t,t.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,r=0;r<8;r++){var i=this.sampleCurveX(n)-e;if(Math.abs(i)<t)return n;var o=this.sampleCurveDerivativeX(n);if(Math.abs(o)<1e-6)break;n-=i/o}var a=0,s=1;for(n=e,r=0;r<20&&(i=this.sampleCurveX(n),!(Math.abs(i-e)<t));r++)e>i?a=n:s=n,n=.5*(s-a)+a;return n},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}}},88861:(e,t,n)=>{var r=n(65650),i=n(31623),o=n(46285),a=n(33934),s=n(95894),l=n(49828),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,h,d){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!h(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=s;case"[object Set]":var p=1&r;if(f||(f=l),e.size!=t.size&&!p)return!1;var g=d.get(e);if(g)return g==t;r|=2,d.set(e,t);var m=a(f(e),f(t),r,c,h,d);return d.delete(e),m;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},89413:(e,t,n)=>{var r=n(94715)(n(78942),"Promise");e.exports=r},89624:(e,t,n)=>{var r=n(93655),i=n(64759),o=n(41580),a=n(64066),s=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,h=c.hasOwnProperty,d=RegExp("^"+u.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?d:s).test(a(e))}},90333:(e,t,n)=>{"use strict";n.d(t,{C:()=>a,Cc:()=>f,Om:()=>d,Re:()=>c,S8:()=>h,WQ:()=>l,fA:()=>o,hZ:()=>s,jb:()=>p,vt:()=>i,ze:()=>u});var r=n(23172);function i(){var e=new r.tb(2);return r.tb!=Float32Array&&(e[0]=0,e[1]=0),e}function o(e,t){var n=new r.tb(2);return n[0]=e,n[1]=t,n}function a(e,t){return e[0]=t[0],e[1]=t[1],e}function s(e,t,n){return e[0]=t,e[1]=n,e}function l(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function c(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function u(e,t){return e[0]=-t[0],e[1]=-t[1],e}function h(e,t){var n=t[0],r=t[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e}function d(e,t){return e[0]*t[0]+e[1]*t[1]}function f(e,t,n,r){var i=t[0],o=t[1];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e}var p=c;i()},90353:(e,t,n)=>{var r=n(51340),i=n(33934),o=n(88861),a=n(31182),s=n(28486),l=n(53142),c=n(75853),u=n(8666),h="[object Arguments]",d="[object Array]",f="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,m,_){var v=l(e),y=l(t),E=v?d:s(e),A=y?d:s(t),b=(E=E==h?f:E)==f,T=(A=A==h?f:A)==f,x=E==A;if(x&&c(e)){if(!c(t))return!1;v=!0,b=!1}if(x&&!b)return _||(_=new r),v||u(e)?i(e,t,n,g,m,_):o(e,t,E,n,g,m,_);if(!(1&n)){var S=b&&p.call(e,"__wrapped__"),R=T&&p.call(t,"__wrapped__");if(S||R){var C=S?e.value():e,L=R?t.value():t;return _||(_=new r),m(C,L,n,g,_)}}return!!x&&(_||(_=new r),a(e,t,n,g,m,_))}},90689:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(96488),i=n(93417),o=n(5405);function a(e,t){return(0,r.A)(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||(0,i.A)(e,t)||(0,o.A)()}},91767:e=>{"use strict";function t(e,t,r){r=r||2;var o,a,s,l,h,d,p,g=t&&t.length,m=g?t[0]*r:e.length,_=n(e,0,m,r,!0),v=[];if(!_||_.next===_.prev)return v;if(g&&(_=function(e,t,r,i){var o,a,s,l=[];for(o=0,a=t.length;o<a;o++)(s=n(e,t[o]*i,o<a-1?t[o+1]*i:e.length,i,!1))===s.next&&(s.steiner=!0),l.push(f(s));for(l.sort(c),o=0;o<l.length;o++)r=u(l[o],r);return r}(e,t,_,r)),e.length>80*r){o=s=e[0],a=l=e[1];for(var y=r;y<m;y+=r)(h=e[y])<o&&(o=h),(d=e[y+1])<a&&(a=d),h>s&&(s=h),d>l&&(l=d);p=0!==(p=Math.max(s-o,l-a))?32767/p:0}return i(_,v,r,o,a,p,0),v}function n(e,t,n,r,i){var o,a;if(i===R(e,t,n,r)>0)for(o=t;o<n;o+=r)a=T(o,e[o],e[o+1],a);else for(o=n-r;o>=t;o-=r)a=T(o,e[o],e[o+1],a);return a&&_(a,a.next)&&(x(a),a=a.next),a}function r(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!_(r,r.next)&&0!==m(r.prev,r,r.next))r=r.next;else{if(x(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function i(e,t,n,c,u,h,f){if(e){!f&&h&&function(e,t,n,r){var i=e;do{0===i.z&&(i.z=d(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,l,c=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t<c&&(s++,r=r.nextZ);t++);for(l=c;s>0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(a>1)}(i)}(e,c,u,h);for(var p,g,m=e;e.prev!==e.next;)if(p=e.prev,g=e.next,h?a(e,c,u,h):o(e))t.push(p.i/n|0),t.push(e.i/n|0),t.push(g.i/n|0),x(e),e=g.next,m=g.next;else if((e=g)===m){f?1===f?i(e=s(r(e),t,n),t,n,c,u,h,2):2===f&&l(e,t,n,c,u,h):i(r(e),t,n,c,u,h,1);break}}}function o(e){var t=e.prev,n=e,r=e.next;if(m(t,n,r)>=0)return!1;for(var i=t.x,o=n.x,a=r.x,s=t.y,l=n.y,c=r.y,u=i<o?i<a?i:a:o<a?o:a,h=s<l?s<c?s:c:l<c?l:c,d=i>o?i>a?i:a:o>a?o:a,f=s>l?s>c?s:c:l>c?l:c,g=r.next;g!==t;){if(g.x>=u&&g.x<=d&&g.y>=h&&g.y<=f&&p(i,s,o,l,a,c,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function a(e,t,n,r){var i=e.prev,o=e,a=e.next;if(m(i,o,a)>=0)return!1;for(var s=i.x,l=o.x,c=a.x,u=i.y,h=o.y,f=a.y,g=s<l?s<c?s:c:l<c?l:c,_=u<h?u<f?u:f:h<f?h:f,v=s>l?s>c?s:c:l>c?l:c,y=u>h?u>f?u:f:h>f?h:f,E=d(g,_,t,n,r),A=d(v,y,t,n,r),b=e.prevZ,T=e.nextZ;b&&b.z>=E&&T&&T.z<=A;){if(b.x>=g&&b.x<=v&&b.y>=_&&b.y<=y&&b!==i&&b!==a&&p(s,u,l,h,c,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,T.x>=g&&T.x<=v&&T.y>=_&&T.y<=y&&T!==i&&T!==a&&p(s,u,l,h,c,f,T.x,T.y)&&m(T.prev,T,T.next)>=0)return!1;T=T.nextZ}for(;b&&b.z>=E;){if(b.x>=g&&b.x<=v&&b.y>=_&&b.y<=y&&b!==i&&b!==a&&p(s,u,l,h,c,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;T&&T.z<=A;){if(T.x>=g&&T.x<=v&&T.y>=_&&T.y<=y&&T!==i&&T!==a&&p(s,u,l,h,c,f,T.x,T.y)&&m(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function s(e,t,n){var i=e;do{var o=i.prev,a=i.next.next;!_(o,a)&&v(o,i,i.next,a)&&A(o,a)&&A(a,o)&&(t.push(o.i/n|0),t.push(i.i/n|0),t.push(a.i/n|0),x(i),x(i.next),i=e=a),i=i.next}while(i!==e);return r(i)}function l(e,t,n,o,a,s){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&g(l,c)){var u=b(l,c);return l=r(l,l.next),u=r(u,u.next),i(l,t,n,o,a,s,0),void i(u,t,n,o,a,s,0)}c=c.next}l=l.next}while(l!==e)}function c(e,t){return e.x-t.x}function u(e,t){var n=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a&&(a=s,n=r.x<r.next.x?r:r.next,s===i))return n}r=r.next}while(r!==t);if(!n)return null;var l,c=n,u=n.x,d=n.y,f=1/0;r=n;do{i>=r.x&&r.x>=u&&i!==r.x&&p(o<d?i:a,o,u,d,o<d?a:i,o,r.x,r.y)&&(l=Math.abs(o-r.y)/(i-r.x),A(r,e)&&(l<f||l===f&&(r.x>n.x||r.x===n.x&&h(n,r)))&&(n=r,f=l)),r=r.next}while(r!==c);return n}(e,t);if(!n)return t;var i=b(n,e);return r(i,i.next),r(n,n.next)}function h(e,t){return m(e.prev,e,t.prev)<0&&m(t.next,e,e.next)<0}function d(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function f(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function p(e,t,n,r,i,o,a,s){return(i-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(r-s)>=(n-a)*(t-s)&&(n-a)*(o-s)>=(i-a)*(r-s)}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&v(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(A(e,t)&&A(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(m(e.prev,e,t.prev)||m(e,t.prev,t))||_(e,t)&&m(e.prev,e,e.next)>0&&m(t.prev,t,t.next)>0)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function _(e,t){return e.x===t.x&&e.y===t.y}function v(e,t,n,r){var i=E(m(e,t,n)),o=E(m(e,t,r)),a=E(m(n,r,e)),s=E(m(n,r,t));return i!==o&&a!==s||!(0!==i||!y(e,n,t))||!(0!==o||!y(e,r,t))||!(0!==a||!y(n,e,r))||!(0!==s||!y(n,t,r))}function y(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function E(e){return e>0?1:e<0?-1:0}function A(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function b(e,t){var n=new S(e.i,e.x,e.y),r=new S(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function T(e,t,n,r){var i=new S(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function x(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function S(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function R(e,t,n,r){for(var i=0,o=t,a=n-r;o<n;o+=r)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}e.exports=t,e.exports.default=t,t.deviation=function(e,t,n,r){var i=t&&t.length,o=i?t[0]*n:e.length,a=Math.abs(R(e,0,o,n));if(i)for(var s=0,l=t.length;s<l;s++){var c=t[s]*n,u=s<l-1?t[s+1]*n:e.length;a-=Math.abs(R(e,c,u,n))}var h=0;for(s=0;s<r.length;s+=3){var d=r[s]*n,f=r[s+1]*n,p=r[s+2]*n;h+=Math.abs((e[d]-e[p])*(e[f+1]-e[d+1])-(e[d]-e[f])*(e[p+1]-e[d+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},t.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)n.vertices.push(e[i][o][a]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n}},92013:e=>{var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")?",c="[\\ufe0e\\ufe0f]?",u=c+l+"(?:\\u200d(?:"+[o,a,s].join("|")+")"+c+l+")*",h="(?:"+[o+r+"?",r,a,s,n].join("|")+")",d=RegExp(i+"(?="+i+")|"+h+u,"g");e.exports=function(e){return e.match(d)||[]}},92264:(e,t,n)=>{var r=n(58898);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},92480:(e,t,n)=>{var r=n(58898);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},93417:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}n.d(t,{A:()=>i})},93526:(e,t,n)=>{var r=n(53142),i=n(65187),o=n(96493),a=n(95243);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},93640:(e,t,n)=>{var r=n(44187),i=n(45881),o=n(39850),a=RegExp("['’]","g");e.exports=function(e){return function(t){return r(o(i(t).replace(a,"")),e,"")}}},93650:(e,t,n)=>{var r=n(48244),i=n(85832),o=n(25288);e.exports=function(e){return r(e,o,i)}},93655:(e,t,n)=>{var r=n(87379),i=n(41580);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},94436:e=>{e.exports=function(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}},94495:(e,t,n)=>{var r=n(78942);e.exports=function(){return r.Date.now()}},94497:(e,t,n)=>{var r=n(94715)(Object,"create");e.exports=r},94687:(e,t,n)=>{var r=n(90353),i=n(80547);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},94715:(e,t,n)=>{var r=n(89624),i=n(20155);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},95243:(e,t,n)=>{var r=n(52291);e.exports=function(e){return null==e?"":r(e)}},95309:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(17545),i=n(2474);function o(e,t){if(t&&("object"===(0,r.A)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,i.A)(e)}},95839:e=>{"use strict";e.exports=function(e){var t=e.stateHandler.getState;return{isDetectable:function(e){var n=t(e);return n&&!!n.isDetectable},markAsDetectable:function(e){t(e).isDetectable=!0},isBusy:function(e){return!!t(e).busy},markBusy:function(e,n){t(e).busy=!!n}}}},95894:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},96323:function(e){e.exports=function(){"use strict";function e(n,r,i,o,a,s){if(!(a-o<=i)){var l=o+a>>1;t(n,r,l,o,a,s%2),e(n,r,i,o,l-1,s+1),e(n,r,i,l+1,a,s+1)}}function t(e,r,i,o,a,s){for(;a>o;){if(a-o>600){var l=a-o+1,c=i-o+1,u=Math.log(l),h=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1);t(e,r,i,Math.max(o,Math.floor(i-c*h/l+d)),Math.min(a,Math.floor(i+(l-c)*h/l+d)),s)}var f=r[2*i+s],p=o,g=a;for(n(e,r,o,i),r[2*a+s]>f&&n(e,r,o,a);p<g;){for(n(e,r,p,g),p++,g--;r[2*p+s]<f;)p++;for(;r[2*g+s]>f;)g--}r[2*o+s]===f?n(e,r,o,g):n(e,r,++g,a),g<=i&&(o=g+1),i<=g&&(a=g-1)}}function n(e,t,n,i){r(e,n,i),r(t,2*n,2*i),r(t,2*n+1,2*i+1)}function r(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function i(e,t,n,r){var i=e-n,o=t-r;return i*i+o*o}var o=function(e){return e[0]},a=function(e){return e[1]},s=function(t,n,r,i,s){void 0===n&&(n=o),void 0===r&&(r=a),void 0===i&&(i=64),void 0===s&&(s=Float64Array),this.nodeSize=i,this.points=t;for(var l=t.length<65536?Uint16Array:Uint32Array,c=this.ids=new l(t.length),u=this.coords=new s(2*t.length),h=0;h<t.length;h++)c[h]=h,u[2*h]=n(t[h]),u[2*h+1]=r(t[h]);e(c,u,i,0,c.length-1,0)};s.prototype.range=function(e,t,n,r){return function(e,t,n,r,i,o,a){for(var s,l,c=[0,e.length-1,0],u=[];c.length;){var h=c.pop(),d=c.pop(),f=c.pop();if(d-f<=a)for(var p=f;p<=d;p++)s=t[2*p],l=t[2*p+1],s>=n&&s<=i&&l>=r&&l<=o&&u.push(e[p]);else{var g=Math.floor((f+d)/2);s=t[2*g],l=t[2*g+1],s>=n&&s<=i&&l>=r&&l<=o&&u.push(e[g]);var m=(h+1)%2;(0===h?n<=s:r<=l)&&(c.push(f),c.push(g-1),c.push(m)),(0===h?i>=s:o>=l)&&(c.push(g+1),c.push(d),c.push(m))}}return u}(this.ids,this.coords,e,t,n,r,this.nodeSize)},s.prototype.within=function(e,t,n){return function(e,t,n,r,o,a){for(var s=[0,e.length-1,0],l=[],c=o*o;s.length;){var u=s.pop(),h=s.pop(),d=s.pop();if(h-d<=a)for(var f=d;f<=h;f++)i(t[2*f],t[2*f+1],n,r)<=c&&l.push(e[f]);else{var p=Math.floor((d+h)/2),g=t[2*p],m=t[2*p+1];i(g,m,n,r)<=c&&l.push(e[p]);var _=(u+1)%2;(0===u?n-o<=g:r-o<=m)&&(s.push(d),s.push(p-1),s.push(_)),(0===u?n+o>=g:r+o>=m)&&(s.push(p+1),s.push(h),s.push(_))}}return l}(this.ids,this.coords,e,t,n,this.nodeSize)};var l,c={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(e){return e}},u=Math.fround||(l=new Float32Array(1),function(e){return l[0]=+e,l[0]}),h=function(e){this.options=v(Object.create(c),e),this.trees=new Array(this.options.maxZoom+1)};function d(e,t,n,r,i){return{x:u(e),y:u(t),zoom:1/0,id:n,parentId:-1,numPoints:r,properties:i}}function f(e,t){var n=e.geometry.coordinates,r=n[0],i=n[1];return{x:u(m(r)),y:u(_(i)),zoom:1/0,index:t,parentId:-1}}function p(e){return{type:"Feature",id:e.id,properties:g(e),geometry:{type:"Point",coordinates:[(r=e.x,360*(r-.5)),(t=e.y,n=(180-360*t)*Math.PI/180,360*Math.atan(Math.exp(n))/Math.PI-90)]}};var t,n,r}function g(e){var t=e.numPoints,n=t>=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return v(v({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:n})}function m(e){return e/360+.5}function _(e){var t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function v(e,t){for(var n in t)e[n]=t[n];return e}function y(e){return e.x}function E(e){return e.y}return h.prototype.load=function(e){var t=this.options,n=t.log,r=t.minZoom,i=t.maxZoom,o=t.nodeSize;n&&console.time("total time");var a="prepare "+e.length+" points";n&&console.time(a),this.points=e;for(var l=[],c=0;c<e.length;c++)e[c].geometry&&l.push(f(e[c],c));this.trees[i+1]=new s(l,y,E,o,Float32Array),n&&console.timeEnd(a);for(var u=i;u>=r;u--){var h=+Date.now();l=this._cluster(l,u),this.trees[u]=new s(l,y,E,o,Float32Array),n&&console.log("z%d: %d clusters in %dms",u,l.length,+Date.now()-h)}return n&&console.timeEnd("total time"),this},h.prototype.getClusters=function(e,t){var n=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),i=180===e[2]?180:((e[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,i=180;else if(n>i){var a=this.getClusters([n,r,180,o],t),s=this.getClusters([-180,r,i,o],t);return a.concat(s)}for(var l=this.trees[this._limitZoom(t)],c=[],u=0,h=l.range(m(n),_(o),m(i),_(r));u<h.length;u+=1){var d=h[u],f=l.points[d];c.push(f.numPoints?p(f):this.points[f.index])}return c},h.prototype.getChildren=function(e){var t=this._getOriginId(e),n=this._getOriginZoom(e),r="No cluster with the specified id.",i=this.trees[n];if(!i)throw new Error(r);var o=i.points[t];if(!o)throw new Error(r);for(var a=this.options.radius/(this.options.extent*Math.pow(2,n-1)),s=[],l=0,c=i.within(o.x,o.y,a);l<c.length;l+=1){var u=c[l],h=i.points[u];h.parentId===e&&s.push(h.numPoints?p(h):this.points[h.index])}if(0===s.length)throw new Error(r);return s},h.prototype.getLeaves=function(e,t,n){t=t||10,n=n||0;var r=[];return this._appendLeaves(r,e,t,n,0),r},h.prototype.getTile=function(e,t,n){var r=this.trees[this._limitZoom(e)],i=Math.pow(2,e),o=this.options,a=o.extent,s=o.radius/a,l=(n-s)/i,c=(n+1+s)/i,u={features:[]};return this._addTileFeatures(r.range((t-s)/i,l,(t+1+s)/i,c),r.points,t,n,i,u),0===t&&this._addTileFeatures(r.range(1-s/i,l,1,c),r.points,i,n,i,u),t===i-1&&this._addTileFeatures(r.range(0,l,s/i,c),r.points,-1,n,i,u),u.features.length?u:null},h.prototype.getClusterExpansionZoom=function(e){for(var t=this._getOriginZoom(e)-1;t<=this.options.maxZoom;){var n=this.getChildren(e);if(t++,1!==n.length)break;e=n[0].properties.cluster_id}return t},h.prototype._appendLeaves=function(e,t,n,r,i){for(var o=0,a=this.getChildren(t);o<a.length;o+=1){var s=a[o],l=s.properties;if(l&&l.cluster?i+l.point_count<=r?i+=l.point_count:i=this._appendLeaves(e,l.cluster_id,n,r,i):i<r?i++:e.push(s),e.length===n)break}return i},h.prototype._addTileFeatures=function(e,t,n,r,i,o){for(var a=0,s=e;a<s.length;a+=1){var l=t[s[a]],c=l.numPoints,u=void 0,h=void 0,d=void 0;if(c)u=g(l),h=l.x,d=l.y;else{var f=this.points[l.index];u=f.properties,h=m(f.geometry.coordinates[0]),d=_(f.geometry.coordinates[1])}var p={type:1,geometry:[[Math.round(this.options.extent*(h*i-n)),Math.round(this.options.extent*(d*i-r))]],tags:u},v=void 0;c?v=l.id:this.options.generateId?v=l.index:this.points[l.index].id&&(v=this.points[l.index].id),void 0!==v&&(p.id=v),o.features.push(p)}},h.prototype._limitZoom=function(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))},h.prototype._cluster=function(e,t){for(var n=[],r=this.options,i=r.radius,o=r.extent,a=r.reduce,s=r.minPoints,l=i/(o*Math.pow(2,t)),c=0;c<e.length;c++){var u=e[c];if(!(u.zoom<=t)){u.zoom=t;for(var h=this.trees[t+1],f=h.within(u.x,u.y,l),p=u.numPoints||1,g=p,m=0,_=f;m<_.length;m+=1){var v=_[m],y=h.points[v];y.zoom>t&&(g+=y.numPoints||1)}if(g>p&&g>=s){for(var E=u.x*p,A=u.y*p,b=a&&p>1?this._map(u,!0):null,T=(c<<5)+(t+1)+this.points.length,x=0,S=f;x<S.length;x+=1){var R=S[x],C=h.points[R];if(!(C.zoom<=t)){C.zoom=t;var L=C.numPoints||1;E+=C.x*L,A+=C.y*L,C.parentId=T,a&&(b||(b=this._map(u,!0)),a(b,this._map(C)))}}u.parentId=T,n.push(d(E/g,A/g,T,g,b))}else if(n.push(u),g>1)for(var O=0,M=f;O<M.length;O+=1){var I=M[O],w=h.points[I];w.zoom<=t||(w.zoom=t,n.push(w))}}}return n},h.prototype._getOriginId=function(e){return e-this.points.length>>5},h.prototype._getOriginZoom=function(e){return(e-this.points.length)%32},h.prototype._map=function(e,t){if(e.numPoints)return t?v({},e.properties):e.properties;var n=this.points[e.index].properties,r=this.options.map(n);return t&&r===n?v({},r):r},h}()},96488:(e,t,n)=>{"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,{A:()=>r})},96493:(e,t,n)=>{var r=n(76853),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},96638:(e,t,n)=>{var r=n(1386),i=n(19770),o=n(68250);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},97034:(e,t,n)=>{var r=n(46285);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},97331:(e,t,n)=>{var r=n(12784),i=n(41580);e.exports=function(e,t,n){var o=!0,a=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return i(n)&&(o="leading"in n?!!n.leading:o,a="trailing"in n?!!n.trailing:a),r(e,t,{leading:o,maxWait:t,trailing:a})}},97350:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},97706:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},98121:(e,t,n)=>{var r=n(3766)(Object.keys,Object);e.exports=r},98167:e=>{function t(e,t){if(0!==e.length){n(e[0],t);for(var r=1;r<e.length;r++)n(e[r],!t)}}function n(e,t){for(var n=0,r=0,i=0,o=e.length,a=o-1;i<o;a=i++){var s=(e[i][0]-e[a][0])*(e[a][1]+e[i][1]),l=n+s;r+=Math.abs(n)>=Math.abs(s)?n-l+s:s-l+n,n=l}n+r>=0!=!!t&&e.reverse()}e.exports=function e(n,r){var i,o=n&&n.type;if("FeatureCollection"===o)for(i=0;i<n.features.length;i++)e(n.features[i],r);else if("GeometryCollection"===o)for(i=0;i<n.geometries.length;i++)e(n.geometries[i],r);else if("Feature"===o)e(n.geometry,r);else if("Polygon"===o)t(n.coordinates,r);else if("MultiPolygon"===o)for(i=0;i<n.coordinates.length;i++)t(n.coordinates[i],r);return n}},99306:e=>{e.exports=function(){return[]}},99545:(e,t,n)=>{var r;!function(i,o,a,s){"use strict";var l,c=["","webkit","Moz","MS","ms","o"],u=o.createElement("div"),h=Math.round,d=Math.abs,f=Date.now;function p(e,t,n){return setTimeout(A(e,n),t)}function g(e,t,n){return!!Array.isArray(e)&&(m(e,n[t],n),!0)}function m(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function _(e,t,n){var r="DEPRECATED METHOD: "+t+"\n"+n+" AT \n";return function(){var t=new Error("get-stack-trace"),n=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),e.apply(this,arguments)}}l="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==s&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t}:Object.assign;var v=_((function(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;)(!n||n&&e[r[i]]===s)&&(e[r[i]]=t[r[i]]),i++;return e}),"extend","Use `assign`."),y=_((function(e,t){return v(e,t,!0)}),"merge","Use `assign`.");function E(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&l(r,n)}function A(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||s,t):e}function T(e,t){return e===s?t:e}function x(e,t,n){m(L(t),(function(t){e.addEventListener(t,n,!1)}))}function S(e,t,n){m(L(t),(function(t){e.removeEventListener(t,n,!1)}))}function R(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function C(e,t){return e.indexOf(t)>-1}function L(e){return e.trim().split(/\s+/g)}function O(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function M(e){return Array.prototype.slice.call(e,0)}function I(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];O(i,a)<0&&r.push(e[o]),i[o]=a,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function w(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),o=0;o<c.length;){if((r=(n=c[o])?n+i:t)in e)return r;o++}return s}var P=1;function N(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||i}var D="ontouchstart"in i,B=w(i,"PointerEvent")!==s,F=D&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),U="touch",k="mouse",G=["x","y"],z=["clientX","clientY"];function j(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&n.handler(t)},this.init()}function V(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,o=1&t&&r-i==0,a=12&t&&r-i==0;n.isFirst=!!o,n.isFinal=!!a,o&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||(n.firstInput=H(t)),i>1&&!n.firstMultiple?n.firstMultiple=H(t):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,l=a?a.center:o.center,c=t.center=W(r);t.timeStamp=f(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=q(l,c),t.distance=Y(l,c),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=Z(t.deltaX,t.deltaY);var u,h,p=X(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=p.x,t.overallVelocityY=p.y,t.overallVelocity=d(p.x)>d(p.y)?p.x:p.y,t.scale=a?(u=a.pointers,Y((h=r)[0],h[1],z)/Y(u[0],u[1],z)):1,t.rotation=a?function(e,t){return q(t[1],t[0],z)+q(e[1],e[0],z)}(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,i,o,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(l>25||a.velocity===s)){var c=t.deltaX-a.deltaX,u=t.deltaY-a.deltaY,h=X(l,c,u);r=h.x,i=h.y,n=d(h.x)>d(h.y)?h.x:h.y,o=Z(c,u),e.lastInterval=t}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=o}(n,t);var g=e.element;R(t.srcEvent.target,g)&&(g=t.srcEvent.target),t.target=g}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function H(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:h(e.pointers[n].clientX),clientY:h(e.pointers[n].clientY)},n++;return{timeStamp:f(),pointers:t,center:W(t),deltaX:e.deltaX,deltaY:e.deltaY}}function W(e){var t=e.length;if(1===t)return{x:h(e[0].clientX),y:h(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:h(n/t),y:h(r/t)}}function X(e,t,n){return{x:t/e||0,y:n/e||0}}function Z(e,t){return e===t?1:d(e)>=d(t)?e<0?2:4:t<0?8:16}function Y(e,t,n){n||(n=G);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function q(e,t,n){n||(n=G);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}j.prototype={handler:function(){},init:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(N(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4};function Q(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,j.apply(this,arguments)}E(Q,j,{handler:function(e){var t=K[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:k,srcEvent:e}))}});var $={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},J={2:U,3:"pen",4:k,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,j.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),E(ne,j,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=$[r],o=J[e.pointerType]||e.pointerType,a=o==U,s=O(t,e.pointerId,"pointerId");1&i&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&i&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ie(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,j.apply(this,arguments)}function oe(e,t){var n=M(e.touches),r=M(e.changedTouches);return 12&t&&(n=I(n.concat(r),"identifier",!0)),[n,r]}E(ie,j,{handler:function(e){var t=re[e.type];if(1===t&&(this.started=!0),this.started){var n=oe.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:U,srcEvent:e})}}});var ae={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function se(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},j.apply(this,arguments)}function le(e,t){var n=M(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=M(e.changedTouches),s=[],l=this.target;if(o=n.filter((function(e){return R(e.target,l)})),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),12&t&&delete r[a[i].identifier],i++;return s.length?[I(o.concat(s),"identifier",!0),s]:void 0}function ce(){j.apply(this,arguments);var e=A(this.handler,this);this.touch=new se(this.manager,e),this.mouse=new Q(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function ue(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,he.call(this,t)):12&e&&he.call(this,t)}function he(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),2500)}}function de(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}E(se,j,{handler:function(e){var t=ae[e.type],n=le.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:U,srcEvent:e})}}),E(ce,j,{handler:function(e,t,n){var r=n.pointerType==U,i=n.pointerType==k;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)ue.call(this,t,n);else if(i&&de.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var fe=w(u.style,"touchAction"),pe=fe!==s,ge="compute",me="auto",_e="manipulation",ve="none",ye="pan-x",Ee="pan-y",Ae=function(){if(!pe)return!1;var e={},t=i.CSS&&i.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){e[n]=!t||i.CSS.supports("touch-action",n)})),e}();function be(e,t){this.manager=e,this.set(t)}be.prototype={set:function(e){e==ge&&(e=this.compute()),pe&&this.manager.element.style&&Ae[e]&&(this.manager.element.style[fe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return m(this.manager.recognizers,(function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(C(e,ve))return ve;var t=C(e,ye),n=C(e,Ee);return t&&n?ve:t||n?t?ye:Ee:C(e,_e)?_e:me}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=C(r,ve)&&!Ae[ve],o=C(r,Ee)&&!Ae[Ee],a=C(r,ye)&&!Ae[ye];if(i){var s=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(s&&l&&c)return}if(!a||!o)return i||o&&6&n||a&&24&n?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Te=32;function xe(e){this.options=l({},this.defaults,e||{}),this.id=P++,this.manager=null,this.options.enable=T(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Se(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Re(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Ce(e,t){var n=t.manager;return n?n.get(e):e}function Le(){xe.apply(this,arguments)}function Oe(){Le.apply(this,arguments),this.pX=null,this.pY=null}function Me(){Le.apply(this,arguments)}function Ie(){xe.apply(this,arguments),this._timer=null,this._input=null}function we(){Le.apply(this,arguments)}function Pe(){Le.apply(this,arguments)}function Ne(){xe.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function De(e,t){return(t=t||{}).recognizers=T(t.recognizers,De.defaults.preset),new Be(e,t)}function Be(e,t){this.options=l({},De.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new(this.options.inputClass||(B?ne:F?se:D?ce:Q))(this,V),this.touchAction=new be(this,this.options.touchAction),Fe(this,!0),m(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Fe(e,t){var n,r=e.element;r.style&&(m(e.options.cssProps,(function(i,o){n=w(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}xe.prototype={defaults:{},set:function(e){return l(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(g(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ce(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return g(e,"dropRecognizeWith",this)||(e=Ce(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(g(e,"requireFailure",this))return this;var t=this.requireFail;return-1===O(t,e=Ce(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(g(e,"dropRequireFailure",this))return this;e=Ce(e,this);var t=O(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+Se(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+Se(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Te},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=l({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=Te);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},E(Le,xe,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:Te}}),E(Oe,Le,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Ee),24&e&&t.push(ye),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,a=e.deltaY;return i&t.direction||(6&t.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===a?1:a<0?8:16,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Le.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Re(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),E(Me,Le,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ve]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),E(Ie,xe,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[me]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=p((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Te},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}}),E(we,Le,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ve]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),E(Pe,Le,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Oe.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:24&n&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Re(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),E(Ne,xe,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[_e]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||Y(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0==this.count%t.taps)return this.hasRequireFailures()?(this._timer=p((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Te},failTimeout:function(){return this._timer=p((function(){this.state=Te}),this.options.interval,this),Te},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),De.VERSION="2.0.7",De.defaults={domEvents:!1,touchAction:ge,enable:!0,inputTarget:null,inputClass:null,preset:[[we,{enable:!1}],[Me,{enable:!1},["rotate"]],[Pe,{direction:6}],[Oe,{direction:6},["swipe"]],[Ne],[Ne,{event:"doubletap",taps:2},["tap"]],[Ie]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Be.prototype={set:function(e){return l(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof xe)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(g(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(g(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=O(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==s&&t!==s){var n=this.handlers;return m(L(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==s){var n=this.handlers;return m(L(e),(function(e){t?n[e]&&n[e].splice(O(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var n=o.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},destroy:function(){this.element&&Fe(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},l(De,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Te,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Be,Input:j,TouchAction:be,TouchInput:se,MouseInput:Q,PointerEventInput:ne,TouchMouseInput:ce,SingleTouchInput:ie,Recognizer:xe,AttrRecognizer:Le,Tap:Ne,Pan:Oe,Swipe:Pe,Pinch:Me,Rotate:we,Press:Ie,on:x,off:S,each:m,merge:y,extend:v,assign:l,inherit:E,bindFn:A,prefixed:w}),(void 0!==i?i:"undefined"!=typeof self?self:{}).Hammer=De,(r=function(){return De}.call(t,n,t,e))===s||(e.exports=r)}(window,document)},99619:e=>{"use strict";(e.exports={}).getOption=function(e,t,n){var r=e[t];return null==r&&void 0!==n?n:r}},99677:(e,t,n)=>{var r=n(56005),i=n(93640)((function(e,t,n){return t=t.toLowerCase(),e+(n?r(t):t)}));e.exports=i},99814:(e,t,n)=>{"use strict";var r=n(35379).forEach;e.exports=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,i=e.stateHandler.getState,o=(e.stateHandler.hasState,e.idHandler);if(!n)throw new Error("Missing required dependency: batchProcessor");if(!t)throw new Error("Missing required dependency: reporter.");var a=function(){var e=document.createElement("div");e.style.cssText=c(["position: absolute","width: 1000px","height: 1000px","visibility: hidden","margin: 0","padding: 0"]);var t=document.createElement("div");t.style.cssText=c(["position: absolute","width: 500px","height: 500px","overflow: scroll","visibility: none","top: -1500px","left: -1500px","visibility: hidden","margin: 0","padding: 0"]),t.appendChild(e),document.body.insertBefore(t,document.body.firstChild);var n=500-t.clientWidth,r=500-t.clientHeight;return document.body.removeChild(t),{width:n,height:r}}(),s="erd_scroll_detection_container";function l(e){!function(e,t,n){if(!e.getElementById(t)){var r=n+"_animation",i=n+"_animation_active",o="/* Created by the element-resize-detector library. */\n";o+="."+n+" > div::-webkit-scrollbar { "+c(["display: none"])+" }\n\n",o+="."+i+" { "+c(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+r,"animation-name: "+r])+" }\n",o+="@-webkit-keyframes "+r+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",function(n,r){r=r||function(t){e.head.appendChild(t)};var i=e.createElement("style");i.innerHTML=n,i.id=t,r(i)}(o+="@keyframes "+r+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}(e,"erd_scroll_detection_scrollbar_style",s)}function c(t){var n=e.important?" !important; ":"; ";return(t.join(n)+n).trim()}function u(e,n,r){if(e.addEventListener)e.addEventListener(n,r);else{if(!e.attachEvent)return t.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+n,r)}}function h(e,n,r){if(e.removeEventListener)e.removeEventListener(n,r);else{if(!e.detachEvent)return t.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+n,r)}}function d(e){return i(e).container.childNodes[0].childNodes[0].childNodes[0]}function f(e){return i(e).container.childNodes[0].childNodes[0].childNodes[1]}return l(window.document),{makeDetectable:function(e,l,h){function p(){if(e.debug){var n=Array.prototype.slice.call(arguments);if(n.unshift(o.get(l),"Scroll: "),t.log.apply)t.log.apply(null,n);else for(var r=0;r<n.length;r++)t.log(n[r])}}function g(e){var t=i(e).container.childNodes[0],n=window.getComputedStyle(t);return!n.width||-1===n.width.indexOf("px")}function m(){var e=window.getComputedStyle(l),t={};return t.position=e.position,t.width=l.offsetWidth,t.height=l.offsetHeight,t.top=e.top,t.right=e.right,t.bottom=e.bottom,t.left=e.left,t.widthCSS=e.width,t.heightCSS=e.height,t}function _(){if(p("storeStyle invoked."),i(l)){var e=m();i(l).style=e}else p("Aborting because element has been uninstalled")}function v(e,t,n){i(e).lastWidth=t,i(e).lastHeight=n}function y(){return 2*a.width+1}function E(){return 2*a.height+1}function A(e){return e+10+y()}function b(e){return e+10+E()}function T(e,t,n){var r=d(e),i=f(e),o=A(t),a=b(n),s=function(e){return 2*e+y()}(t),l=function(e){return 2*e+E()}(n);r.scrollLeft=o,r.scrollTop=a,i.scrollLeft=s,i.scrollTop=l}function x(){var e=i(l).container;if(!e){(e=document.createElement("div")).className=s,e.style.cssText=c(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),i(l).container=e,function(e){e.className+=" "+s+"_animation_active"}(e),l.appendChild(e);var t=function(){i(l).onRendered&&i(l).onRendered()};u(e,"animationstart",t),i(l).onAnimationStart=t}return e}function S(){if(p("Injecting elements"),i(l)){!function(){var n=i(l).style;if("static"===n.position){l.style.setProperty("position","relative",e.important?"important":"");var r=function(e,t,n,r){var i=n[r];"auto"!==i&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(i)&&(e.warn("An element that is positioned static has style."+r+"="+i+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+r+" will be set to 0. Element: ",t),t.style[r]=0)};r(t,l,n,"top"),r(t,l,n,"right"),r(t,l,n,"bottom"),r(t,l,n,"left")}}();var n=i(l).container;n||(n=x());var r,o,h,d,f=a.width,g=a.height,m=c(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),_=c(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(["left: "+(r=(r=-(1+f))?r+"px":"0"),"top: "+(o=(o=-(1+g))?o+"px":"0"),"right: "+(d=(d=-f)?d+"px":"0"),"bottom: "+(h=(h=-g)?h+"px":"0")])),v=c(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),y=c(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),E=c(["position: absolute","left: 0","top: 0"]),A=c(["position: absolute","width: 200%","height: 200%"]),b=document.createElement("div"),T=document.createElement("div"),S=document.createElement("div"),R=document.createElement("div"),C=document.createElement("div"),L=document.createElement("div");b.dir="ltr",b.style.cssText=m,b.className=s,T.className=s,T.style.cssText=_,S.style.cssText=v,R.style.cssText=E,C.style.cssText=y,L.style.cssText=A,S.appendChild(R),C.appendChild(L),T.appendChild(S),T.appendChild(C),b.appendChild(T),n.appendChild(b),u(S,"scroll",O),u(C,"scroll",M),i(l).onExpandScroll=O,i(l).onShrinkScroll=M}else p("Aborting because element has been uninstalled");function O(){var e=i(l);e&&e.onExpand?e.onExpand():p("Aborting expand scroll handler: element has been uninstalled")}function M(){var e=i(l);e&&e.onShrink?e.onShrink():p("Aborting shrink scroll handler: element has been uninstalled")}}function R(){function a(t,n,r){var i=function(e){return d(e).childNodes[0]}(t),o=A(n),a=b(r);i.style.setProperty("width",o+"px",e.important?"important":""),i.style.setProperty("height",a+"px",e.important?"important":"")}function s(r){var s=l.offsetWidth,u=l.offsetHeight,h=s!==i(l).lastWidth||u!==i(l).lastHeight;p("Storing current size",s,u),v(l,s,u),n.add(0,(function(){if(h)if(i(l))if(c()){if(e.debug){var n=l.offsetWidth,r=l.offsetHeight;n===s&&r===u||t.warn(o.get(l),"Scroll: Size changed before updating detector elements.")}a(l,s,u)}else p("Aborting because element container has not been initialized");else p("Aborting because element has been uninstalled")})),n.add(1,(function(){i(l)?c()?T(l,s,u):p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled")})),h&&r&&n.add(2,(function(){i(l)?c()?r():p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled")}))}function c(){return!!i(l).container}function u(){p("notifyListenersIfNeeded invoked");var e=i(l);return void 0===i(l).lastNotifiedWidth&&e.lastWidth===e.startSize.width&&e.lastHeight===e.startSize.height?p("Not notifying: Size is the same as the start size, and there has been no notification yet."):e.lastWidth===e.lastNotifiedWidth&&e.lastHeight===e.lastNotifiedHeight?p("Not notifying: Size already notified"):(p("Current size not notified, notifying..."),e.lastNotifiedWidth=e.lastWidth,e.lastNotifiedHeight=e.lastHeight,void r(i(l).listeners,(function(e){e(l)})))}function h(){p("Scroll detected."),g(l)?p("Scroll event fired while unrendered. Ignoring..."):s(u)}if(p("registerListenersAndPositionElements invoked."),i(l)){i(l).onRendered=function(){if(p("startanimation triggered."),g(l))p("Ignoring since element is still unrendered...");else{p("Element rendered.");var e=d(l),t=f(l);0!==e.scrollLeft&&0!==e.scrollTop&&0!==t.scrollLeft&&0!==t.scrollTop||(p("Scrollbars out of sync. Updating detector elements..."),s(u))}},i(l).onExpand=h,i(l).onShrink=h;var m=i(l).style;a(l,m.width,m.height)}else p("Aborting because element has been uninstalled")}function C(){if(p("finalizeDomMutation invoked."),i(l)){var e=i(l).style;v(l,e.width,e.height),T(l,e.width,e.height)}else p("Aborting because element has been uninstalled")}function L(){h(l)}function O(){var e;p("Installing..."),i(l).listeners=[],e=m(),i(l).startSize={width:e.width,height:e.height},p("Element start size",i(l).startSize),n.add(0,_),n.add(1,S),n.add(2,R),n.add(3,C),n.add(4,L)}h||(h=l,l=e,e=null),e=e||{},p("Making detectable..."),function(e){return!function(e){var t=e.getRootNode&&e.getRootNode().contains(e);return e===e.ownerDocument.body||e.ownerDocument.body.contains(e)||t}(e)||null===window.getComputedStyle(e)}(l)?(p("Element is detached"),x(),p("Waiting until element is attached..."),i(l).onRendered=function(){p("Element is now attached"),O()}):O()},addListener:function(e,t){if(!i(e).listeners.push)throw new Error("Cannot add listener to an element that is not detectable.");i(e).listeners.push(t)},uninstall:function(e){var t=i(e);t&&(t.onExpandScroll&&h(d(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&h(f(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&h(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))},initDocument:l}}}}]);
3
- //# sourceMappingURL=5902.8d260dd5.js.map