@terra.gl/core 0.0.1-alpha.64 → 0.0.1-alpha.65

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.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as gt from "three";
2
2
  import { REVISION as uf, TrianglesDrawMode as $w, TriangleFanDrawMode as $l, TriangleStripDrawMode as df, Mesh as Ge, Vector3 as z, Color as he, FrontSide as sa, Plane as ff, Matrix4 as Le, Vector4 as Sn, PerspectiveCamera as rr, WebGLRenderTarget as Ir, UniformsUtils as ar, UniformsLib as ta, ShaderMaterial as Et, MOUSE as yi, TOUCH as vi, Spherical as sd, Quaternion as _n, OrthographicCamera as sr, Vector2 as ce, Ray as qw, PlaneGeometry as bn, HalfFloatType as qi, AdditiveBlending as mc, MeshBasicMaterial as wn, RGBAFormat as pf, LinearFilter as Li, NoBlending as eb, Clock as oa, Loader as gc, LoaderUtils as Er, FileLoader as Pi, MeshPhysicalMaterial as Fn, SpotLight as mf, PointLight as ql, DirectionalLight as na, InstancedMesh as yc, InstancedBufferAttribute as ec, Object3D as xn, TextureLoader as aa, ImageBitmapLoader as tb, BufferAttribute as St, InterleavedBuffer as nb, InterleavedBufferAttribute as er, LinearMipmapLinearFilter as Is, NearestMipmapLinearFilter as ib, LinearMipmapNearestFilter as rb, NearestMipmapNearestFilter as sb, NearestFilter as gf, RepeatWrapping as Mn, MirroredRepeatWrapping as ob, ClampToEdgeWrapping as tc, PointsMaterial as la, Material as Pl, LineBasicMaterial as vc, MeshStandardMaterial as Es, DoubleSide as zr, PropertyBinding as Zs, BufferGeometry as Nt, SkinnedMesh as yf, LineSegments as ab, Line as _c, LineLoop as lb, Points as Dr, Group as Tn, MathUtils as _t, Skeleton as vf, AnimationClip as _f, Bone as nc, InterpolateDiscrete as cb, InterpolateLinear as wf, Texture as Fr, VectorKeyframeTrack as ic, NumberKeyframeTrack as rc, QuaternionKeyframeTrack as sc, Interpolant as hb, Box3 as lr, Sphere as wc, Curve as ub, MeshPhongMaterial as Ls, MeshLambertMaterial as bf, EquirectangularReflectionMapping as db, AmbientLight as xf, Float32BufferAttribute as _i, Uint16BufferAttribute as fb, Matrix3 as pb, Euler as ws, DataTextureLoader as mb, FloatType as $o, DataUtils as Zo, InstancedBufferGeometry as Tf, InstancedInterleavedBuffer as oc, WireframeGeometry as gb, Line3 as yb, EventDispatcher as Sf, Scene as Mf, FogExp2 as od, CubeTextureLoader as vb, WebGLRenderer as _b, PCFSoftShadowMap as wb, ACESFilmicToneMapping as bb, SRGBColorSpace as ca, CameraHelper as xb, CubicBezierCurve3 as Tb, Frustum as Sb, Raycaster as Ws, CanvasTexture as Xr, SpriteMaterial as kr, Sprite as Wi, DynamicDrawUsage as ad, NormalBlending as Lf, CurvePath as Pf, LineCurve3 as Ar, QuadraticBezierCurve3 as Cf, TubeGeometry as Mb, BackSide as Lb, Shape as Pb, ShapeGeometry as Cb, CylinderGeometry as Zb, AnimationMixer as Wb, LoopRepeat as Gb, LoopOnce as Rb, LoadingManager as Ib, Box2 as Eb, ImageLoader as Zf } from "three";
3
- const Ab = "0.0.1-alpha.64", Cl = {
3
+ const Ab = "0.0.1-alpha.65", Cl = {
4
4
  name: "Criska"
5
5
  };
6
6
  var Ps = function() {
@@ -19721,7 +19721,7 @@ function R2(r, e) {
19721
19721
  }
19722
19722
  const I2 = `{
19723
19723
  "name": "@terra.gl/core",
19724
- "version": "0.0.1-alpha.64",
19724
+ "version": "0.0.1-alpha.65",
19725
19725
  "type": "module",
19726
19726
  "files": [
19727
19727
  "dist"
@@ -1,4 +1,4 @@
1
- (function(q,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("three")):typeof define=="function"&&define.amd?define(["exports","three"],p):(q=typeof globalThis<"u"?globalThis:q||self,p(q["terra-gl"]={},q.THREE))})(this,function(q,p){"use strict";function uf(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const ht=uf(p),df="0.0.1-alpha.64",wo={name:"Criska"};var ur=function(){var r=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(m){m.preventDefault(),i(++r%e.children.length)},!1);function t(m){return e.appendChild(m.dom),m}function i(m){for(var f=0;f<e.children.length;f++)e.children[f].style.display=f===m?"block":"none";r=m}var n=(performance||Date).now(),o=n,a=0,c=t(new ur.Panel("FPS","#0ff","#002")),h=t(new ur.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var d=t(new ur.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:e,addPanel:t,showPanel:i,begin:function(){n=(performance||Date).now()},end:function(){a++;var m=(performance||Date).now();if(h.update(m-n,200),m>=o+1e3&&(c.update(a*1e3/(m-o),100),o=m,a=0,d)){var f=performance.memory;d.update(f.usedJSHeapSize/1048576,f.jsHeapSizeLimit/1048576)}return m},update:function(){n=this.end()},domElement:e,setMode:i}};ur.Panel=function(r,e,t){var i=1/0,n=0,o=Math.round,a=o(window.devicePixelRatio||1),c=80*a,h=48*a,d=3*a,m=2*a,f=3*a,g=15*a,v=74*a,w=30*a,b=document.createElement("canvas");b.width=c,b.height=h,b.style.cssText="width:80px;height:48px";var x=b.getContext("2d");return x.font="bold "+9*a+"px Helvetica,Arial,sans-serif",x.textBaseline="top",x.fillStyle=t,x.fillRect(0,0,c,h),x.fillStyle=e,x.fillText(r,d,m),x.fillRect(f,g,v,w),x.fillStyle=t,x.globalAlpha=.9,x.fillRect(f,g,v,w),{dom:b,update:function(L,M){i=Math.min(i,L),n=Math.max(n,L),x.fillStyle=t,x.globalAlpha=1,x.fillRect(0,0,c,g),x.fillStyle=e,x.fillText(o(L)+" "+r+" ("+o(i)+"-"+o(n)+")",d,m),x.drawImage(b,f+a,g,v-a,w,f,g,v-a,w),x.fillRect(f+v-a,g,a,w),x.fillStyle=t,x.globalAlpha=.9,x.fillRect(f+v-a,g,a,o((1-L/M)*w))}}};const qr=parseInt(p.REVISION.replace(/\D+/g,"")),bo=qr>=125?"uv1":"uv2";function Fl(r,e){if(e===p.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(e===p.TriangleFanDrawMode||e===p.TriangleStripDrawMode){let t=r.getIndex();if(t===null){const a=[],c=r.getAttribute("position");if(c!==void 0){for(let h=0;h<c.count;h++)a.push(h);r.setIndex(a),t=r.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),r}const i=t.count-2,n=[];if(t)if(e===p.TriangleFanDrawMode)for(let a=1;a<=i;a++)n.push(t.getX(0)),n.push(t.getX(a)),n.push(t.getX(a+1));else for(let a=0;a<i;a++)a%2===0?(n.push(t.getX(a)),n.push(t.getX(a+1)),n.push(t.getX(a+2))):(n.push(t.getX(a+2)),n.push(t.getX(a+1)),n.push(t.getX(a)));n.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=r.clone();return o.setIndex(n),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),r}var kt=Uint8Array,Di=Uint16Array,xo=Uint32Array,Ol=new kt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Dl=new kt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ff=new kt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zl=function(r,e){for(var t=new Di(31),i=0;i<31;++i)t[i]=e+=1<<r[i-1];for(var n=new xo(t[30]),i=1;i<30;++i)for(var o=t[i];o<t[i+1];++o)n[o]=o-t[i]<<5|i;return[t,n]},Xl=zl(Ol,2),Ul=Xl[0],pf=Xl[1];Ul[28]=258,pf[258]=28;for(var mf=zl(Dl,0),gf=mf[0],Mo=new Di(32768),Ze=0;Ze<32768;++Ze){var zi=(Ze&43690)>>>1|(Ze&21845)<<1;zi=(zi&52428)>>>2|(zi&13107)<<2,zi=(zi&61680)>>>4|(zi&3855)<<4,Mo[Ze]=((zi&65280)>>>8|(zi&255)<<8)>>>1}for(var dr=function(r,e,t){for(var i=r.length,n=0,o=new Di(e);n<i;++n)++o[r[n]-1];var a=new Di(e);for(n=0;n<e;++n)a[n]=a[n-1]+o[n-1]<<1;var c;if(t){c=new Di(1<<e);var h=15-e;for(n=0;n<i;++n)if(r[n])for(var d=n<<4|r[n],m=e-r[n],f=a[r[n]-1]++<<m,g=f|(1<<m)-1;f<=g;++f)c[Mo[f]>>>h]=d}else for(c=new Di(i),n=0;n<i;++n)r[n]&&(c[n]=Mo[a[r[n]-1]++]>>>15-r[n]);return c},fr=new kt(288),Ze=0;Ze<144;++Ze)fr[Ze]=8;for(var Ze=144;Ze<256;++Ze)fr[Ze]=9;for(var Ze=256;Ze<280;++Ze)fr[Ze]=7;for(var Ze=280;Ze<288;++Ze)fr[Ze]=8;for(var kl=new kt(32),Ze=0;Ze<32;++Ze)kl[Ze]=5;var yf=dr(fr,9,1),vf=dr(kl,5,1),So=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},ei=function(r,e,t){var i=e/8|0;return(r[i]|r[i+1]<<8)>>(e&7)&t},Lo=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(e&7)},_f=function(r){return(r/8|0)+(r&7&&1)},wf=function(r,e,t){(t==null||t>r.length)&&(t=r.length);var i=new(r instanceof Di?Di:r instanceof xo?xo:kt)(t-e);return i.set(r.subarray(e,t)),i},bf=function(r,e,t){var i=r.length;if(!i||t&&!t.l&&i<5)return e||new kt(0);var n=!e||t,o=!t||t.i;t||(t={}),e||(e=new kt(i*3));var a=function(ft){var He=e.length;if(ft>He){var Re=new kt(Math.max(He*2,ft));Re.set(e),e=Re}},c=t.f||0,h=t.p||0,d=t.b||0,m=t.l,f=t.d,g=t.m,v=t.n,w=i*8;do{if(!m){t.f=c=ei(r,h,1);var b=ei(r,h+1,3);if(h+=3,b)if(b==1)m=yf,f=vf,g=9,v=5;else if(b==2){var C=ei(r,h,31)+257,W=ei(r,h+10,15)+4,z=C+ei(r,h+5,31)+1;h+=14;for(var D=new kt(z),X=new kt(19),I=0;I<W;++I)X[ff[I]]=ei(r,h+I*3,7);h+=W*3;for(var K=So(X),V=(1<<K)-1,G=dr(X,K,1),I=0;I<z;){var k=G[ei(r,h,V)];h+=k&15;var x=k>>>4;if(x<16)D[I++]=x;else{var j=0,Y=0;for(x==16?(Y=3+ei(r,h,3),h+=2,j=D[I-1]):x==17?(Y=3+ei(r,h,7),h+=3):x==18&&(Y=11+ei(r,h,127),h+=7);Y--;)D[I++]=j}}var H=D.subarray(0,C),Q=D.subarray(C);g=So(H),v=So(Q),m=dr(H,g,1),f=dr(Q,v,1)}else throw"invalid block type";else{var x=_f(h)+4,L=r[x-4]|r[x-3]<<8,M=x+L;if(M>i){if(o)throw"unexpected EOF";break}n&&a(d+L),e.set(r.subarray(x,M),d),t.b=d+=L,t.p=h=M*8;continue}if(h>w){if(o)throw"unexpected EOF";break}}n&&a(d+131072);for(var re=(1<<g)-1,ne=(1<<v)-1,le=h;;le=h){var j=m[Lo(r,h)&re],de=j>>>4;if(h+=j&15,h>w){if(o)throw"unexpected EOF";break}if(!j)throw"invalid length/literal";if(de<256)e[d++]=de;else if(de==256){le=h,m=null;break}else{var ge=de-254;if(de>264){var I=de-257,fe=Ol[I];ge=ei(r,h,(1<<fe)-1)+Ul[I],h+=fe}var Se=f[Lo(r,h)&ne],rt=Se>>>4;if(!Se)throw"invalid distance";h+=Se&15;var Q=gf[rt];if(rt>3){var fe=Dl[rt];Q+=Lo(r,h)&(1<<fe)-1,h+=fe}if(h>w){if(o)throw"unexpected EOF";break}n&&a(d+131072);for(var st=d+ge;d<st;d+=4)e[d]=e[d-Q],e[d+1]=e[d+1-Q],e[d+2]=e[d+2-Q],e[d+3]=e[d+3-Q];d=st}}t.l=m,t.p=le,t.b=d,m&&(c=1,t.m=g,t.d=f,t.n=v)}while(!c);return d==e.length?e:wf(e,0,d)},xf=new kt(0),Mf=function(r){if((r[0]&15)!=8||r[0]>>>4>7||(r[0]<<8|r[1])%31)throw"invalid zlib data";if(r[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Sf(r,e){return bf((Mf(r),r.subarray(2,-4)),e)}var Lf=typeof TextDecoder<"u"&&new TextDecoder,Pf=0;try{Lf.decode(xf,{stream:!0}),Pf=1}catch{}class Cf extends p.Mesh{constructor(e,t={}){super(e),this.isWater=!0;const i=this,n=t.textureWidth!==void 0?t.textureWidth:512,o=t.textureHeight!==void 0?t.textureHeight:512,a=t.clipBias!==void 0?t.clipBias:0,c=t.alpha!==void 0?t.alpha:1,h=t.time!==void 0?t.time:0,d=t.waterNormals!==void 0?t.waterNormals:null,m=t.sunDirection!==void 0?t.sunDirection:new p.Vector3(.70707,.70707,0),f=new p.Color(t.sunColor!==void 0?t.sunColor:16777215),g=new p.Color(t.waterColor!==void 0?t.waterColor:8355711),v=t.eye!==void 0?t.eye:new p.Vector3(0,0,0),w=t.distortionScale!==void 0?t.distortionScale:20,b=t.side!==void 0?t.side:p.FrontSide,x=t.fog!==void 0?t.fog:!1,L=new p.Plane,M=new p.Vector3,C=new p.Vector3,W=new p.Vector3,z=new p.Matrix4,D=new p.Vector3(0,0,-1),X=new p.Vector4,I=new p.Vector3,K=new p.Vector3,V=new p.Vector4,G=new p.Matrix4,k=new p.PerspectiveCamera,j=new p.WebGLRenderTarget(n,o),Y={uniforms:p.UniformsUtils.merge([p.UniformsLib.fog,p.UniformsLib.lights,{normalSampler:{value:null},mirrorSampler:{value:null},alpha:{value:1},time:{value:0},size:{value:1},distortionScale:{value:20},textureMatrix:{value:new p.Matrix4},sunColor:{value:new p.Color(8355711)},sunDirection:{value:new p.Vector3(.70707,.70707,0)},eye:{value:new p.Vector3},waterColor:{value:new p.Color(5592405)}}]),vertexShader:`
1
+ (function(q,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("three")):typeof define=="function"&&define.amd?define(["exports","three"],p):(q=typeof globalThis<"u"?globalThis:q||self,p(q["terra-gl"]={},q.THREE))})(this,function(q,p){"use strict";function uf(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const ht=uf(p),df="0.0.1-alpha.65",wo={name:"Criska"};var ur=function(){var r=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(m){m.preventDefault(),i(++r%e.children.length)},!1);function t(m){return e.appendChild(m.dom),m}function i(m){for(var f=0;f<e.children.length;f++)e.children[f].style.display=f===m?"block":"none";r=m}var n=(performance||Date).now(),o=n,a=0,c=t(new ur.Panel("FPS","#0ff","#002")),h=t(new ur.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var d=t(new ur.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:e,addPanel:t,showPanel:i,begin:function(){n=(performance||Date).now()},end:function(){a++;var m=(performance||Date).now();if(h.update(m-n,200),m>=o+1e3&&(c.update(a*1e3/(m-o),100),o=m,a=0,d)){var f=performance.memory;d.update(f.usedJSHeapSize/1048576,f.jsHeapSizeLimit/1048576)}return m},update:function(){n=this.end()},domElement:e,setMode:i}};ur.Panel=function(r,e,t){var i=1/0,n=0,o=Math.round,a=o(window.devicePixelRatio||1),c=80*a,h=48*a,d=3*a,m=2*a,f=3*a,g=15*a,v=74*a,w=30*a,b=document.createElement("canvas");b.width=c,b.height=h,b.style.cssText="width:80px;height:48px";var x=b.getContext("2d");return x.font="bold "+9*a+"px Helvetica,Arial,sans-serif",x.textBaseline="top",x.fillStyle=t,x.fillRect(0,0,c,h),x.fillStyle=e,x.fillText(r,d,m),x.fillRect(f,g,v,w),x.fillStyle=t,x.globalAlpha=.9,x.fillRect(f,g,v,w),{dom:b,update:function(L,M){i=Math.min(i,L),n=Math.max(n,L),x.fillStyle=t,x.globalAlpha=1,x.fillRect(0,0,c,g),x.fillStyle=e,x.fillText(o(L)+" "+r+" ("+o(i)+"-"+o(n)+")",d,m),x.drawImage(b,f+a,g,v-a,w,f,g,v-a,w),x.fillRect(f+v-a,g,a,w),x.fillStyle=t,x.globalAlpha=.9,x.fillRect(f+v-a,g,a,o((1-L/M)*w))}}};const qr=parseInt(p.REVISION.replace(/\D+/g,"")),bo=qr>=125?"uv1":"uv2";function Fl(r,e){if(e===p.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(e===p.TriangleFanDrawMode||e===p.TriangleStripDrawMode){let t=r.getIndex();if(t===null){const a=[],c=r.getAttribute("position");if(c!==void 0){for(let h=0;h<c.count;h++)a.push(h);r.setIndex(a),t=r.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),r}const i=t.count-2,n=[];if(t)if(e===p.TriangleFanDrawMode)for(let a=1;a<=i;a++)n.push(t.getX(0)),n.push(t.getX(a)),n.push(t.getX(a+1));else for(let a=0;a<i;a++)a%2===0?(n.push(t.getX(a)),n.push(t.getX(a+1)),n.push(t.getX(a+2))):(n.push(t.getX(a+2)),n.push(t.getX(a+1)),n.push(t.getX(a)));n.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=r.clone();return o.setIndex(n),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),r}var kt=Uint8Array,Di=Uint16Array,xo=Uint32Array,Ol=new kt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Dl=new kt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ff=new kt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zl=function(r,e){for(var t=new Di(31),i=0;i<31;++i)t[i]=e+=1<<r[i-1];for(var n=new xo(t[30]),i=1;i<30;++i)for(var o=t[i];o<t[i+1];++o)n[o]=o-t[i]<<5|i;return[t,n]},Xl=zl(Ol,2),Ul=Xl[0],pf=Xl[1];Ul[28]=258,pf[258]=28;for(var mf=zl(Dl,0),gf=mf[0],Mo=new Di(32768),Ze=0;Ze<32768;++Ze){var zi=(Ze&43690)>>>1|(Ze&21845)<<1;zi=(zi&52428)>>>2|(zi&13107)<<2,zi=(zi&61680)>>>4|(zi&3855)<<4,Mo[Ze]=((zi&65280)>>>8|(zi&255)<<8)>>>1}for(var dr=function(r,e,t){for(var i=r.length,n=0,o=new Di(e);n<i;++n)++o[r[n]-1];var a=new Di(e);for(n=0;n<e;++n)a[n]=a[n-1]+o[n-1]<<1;var c;if(t){c=new Di(1<<e);var h=15-e;for(n=0;n<i;++n)if(r[n])for(var d=n<<4|r[n],m=e-r[n],f=a[r[n]-1]++<<m,g=f|(1<<m)-1;f<=g;++f)c[Mo[f]>>>h]=d}else for(c=new Di(i),n=0;n<i;++n)r[n]&&(c[n]=Mo[a[r[n]-1]++]>>>15-r[n]);return c},fr=new kt(288),Ze=0;Ze<144;++Ze)fr[Ze]=8;for(var Ze=144;Ze<256;++Ze)fr[Ze]=9;for(var Ze=256;Ze<280;++Ze)fr[Ze]=7;for(var Ze=280;Ze<288;++Ze)fr[Ze]=8;for(var kl=new kt(32),Ze=0;Ze<32;++Ze)kl[Ze]=5;var yf=dr(fr,9,1),vf=dr(kl,5,1),So=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},ei=function(r,e,t){var i=e/8|0;return(r[i]|r[i+1]<<8)>>(e&7)&t},Lo=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(e&7)},_f=function(r){return(r/8|0)+(r&7&&1)},wf=function(r,e,t){(t==null||t>r.length)&&(t=r.length);var i=new(r instanceof Di?Di:r instanceof xo?xo:kt)(t-e);return i.set(r.subarray(e,t)),i},bf=function(r,e,t){var i=r.length;if(!i||t&&!t.l&&i<5)return e||new kt(0);var n=!e||t,o=!t||t.i;t||(t={}),e||(e=new kt(i*3));var a=function(ft){var He=e.length;if(ft>He){var Re=new kt(Math.max(He*2,ft));Re.set(e),e=Re}},c=t.f||0,h=t.p||0,d=t.b||0,m=t.l,f=t.d,g=t.m,v=t.n,w=i*8;do{if(!m){t.f=c=ei(r,h,1);var b=ei(r,h+1,3);if(h+=3,b)if(b==1)m=yf,f=vf,g=9,v=5;else if(b==2){var C=ei(r,h,31)+257,W=ei(r,h+10,15)+4,z=C+ei(r,h+5,31)+1;h+=14;for(var D=new kt(z),X=new kt(19),I=0;I<W;++I)X[ff[I]]=ei(r,h+I*3,7);h+=W*3;for(var K=So(X),V=(1<<K)-1,G=dr(X,K,1),I=0;I<z;){var k=G[ei(r,h,V)];h+=k&15;var x=k>>>4;if(x<16)D[I++]=x;else{var j=0,Y=0;for(x==16?(Y=3+ei(r,h,3),h+=2,j=D[I-1]):x==17?(Y=3+ei(r,h,7),h+=3):x==18&&(Y=11+ei(r,h,127),h+=7);Y--;)D[I++]=j}}var H=D.subarray(0,C),Q=D.subarray(C);g=So(H),v=So(Q),m=dr(H,g,1),f=dr(Q,v,1)}else throw"invalid block type";else{var x=_f(h)+4,L=r[x-4]|r[x-3]<<8,M=x+L;if(M>i){if(o)throw"unexpected EOF";break}n&&a(d+L),e.set(r.subarray(x,M),d),t.b=d+=L,t.p=h=M*8;continue}if(h>w){if(o)throw"unexpected EOF";break}}n&&a(d+131072);for(var re=(1<<g)-1,ne=(1<<v)-1,le=h;;le=h){var j=m[Lo(r,h)&re],de=j>>>4;if(h+=j&15,h>w){if(o)throw"unexpected EOF";break}if(!j)throw"invalid length/literal";if(de<256)e[d++]=de;else if(de==256){le=h,m=null;break}else{var ge=de-254;if(de>264){var I=de-257,fe=Ol[I];ge=ei(r,h,(1<<fe)-1)+Ul[I],h+=fe}var Se=f[Lo(r,h)&ne],rt=Se>>>4;if(!Se)throw"invalid distance";h+=Se&15;var Q=gf[rt];if(rt>3){var fe=Dl[rt];Q+=Lo(r,h)&(1<<fe)-1,h+=fe}if(h>w){if(o)throw"unexpected EOF";break}n&&a(d+131072);for(var st=d+ge;d<st;d+=4)e[d]=e[d-Q],e[d+1]=e[d+1-Q],e[d+2]=e[d+2-Q],e[d+3]=e[d+3-Q];d=st}}t.l=m,t.p=le,t.b=d,m&&(c=1,t.m=g,t.d=f,t.n=v)}while(!c);return d==e.length?e:wf(e,0,d)},xf=new kt(0),Mf=function(r){if((r[0]&15)!=8||r[0]>>>4>7||(r[0]<<8|r[1])%31)throw"invalid zlib data";if(r[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Sf(r,e){return bf((Mf(r),r.subarray(2,-4)),e)}var Lf=typeof TextDecoder<"u"&&new TextDecoder,Pf=0;try{Lf.decode(xf,{stream:!0}),Pf=1}catch{}class Cf extends p.Mesh{constructor(e,t={}){super(e),this.isWater=!0;const i=this,n=t.textureWidth!==void 0?t.textureWidth:512,o=t.textureHeight!==void 0?t.textureHeight:512,a=t.clipBias!==void 0?t.clipBias:0,c=t.alpha!==void 0?t.alpha:1,h=t.time!==void 0?t.time:0,d=t.waterNormals!==void 0?t.waterNormals:null,m=t.sunDirection!==void 0?t.sunDirection:new p.Vector3(.70707,.70707,0),f=new p.Color(t.sunColor!==void 0?t.sunColor:16777215),g=new p.Color(t.waterColor!==void 0?t.waterColor:8355711),v=t.eye!==void 0?t.eye:new p.Vector3(0,0,0),w=t.distortionScale!==void 0?t.distortionScale:20,b=t.side!==void 0?t.side:p.FrontSide,x=t.fog!==void 0?t.fog:!1,L=new p.Plane,M=new p.Vector3,C=new p.Vector3,W=new p.Vector3,z=new p.Matrix4,D=new p.Vector3(0,0,-1),X=new p.Vector4,I=new p.Vector3,K=new p.Vector3,V=new p.Vector4,G=new p.Matrix4,k=new p.PerspectiveCamera,j=new p.WebGLRenderTarget(n,o),Y={uniforms:p.UniformsUtils.merge([p.UniformsLib.fog,p.UniformsLib.lights,{normalSampler:{value:null},mirrorSampler:{value:null},alpha:{value:1},time:{value:0},size:{value:1},distortionScale:{value:20},textureMatrix:{value:new p.Matrix4},sunColor:{value:new p.Color(8355711)},sunDirection:{value:new p.Vector3(.70707,.70707,0)},eye:{value:new p.Vector3},waterColor:{value:new p.Color(5592405)}}]),vertexShader:`
2
2
  uniform mat4 textureMatrix;
3
3
  uniform float time;
4
4
 
@@ -1121,7 +1121,7 @@ function print() { __p += __j.call(arguments, '') }
1121
1121
  }
1122
1122
  `)}setDiffusionFromObject(e){if(!this.shaderOption.effects?.diffusion)return;const t=new ht.Box3().setFromObject(e);if(t.isEmpty())return;const i=new ht.Vector3;t.getCenter(i);const n=[new ht.Vector3(t.min.x,t.min.y,t.min.z),new ht.Vector3(t.max.x,t.max.y,t.max.z)];let o=0;n.forEach(a=>{const c=i.distanceTo(a);c>o&&(o=c)}),this.shaderOption.effects.diffusion={...this.shaderOption.effects.diffusion,center:i,maxDistance:o},this.needsUpdate=!0}updateBoundingBox(e,t){this.shaderOption.minY=e,this.shaderOption.maxY=t,this.needsUpdate=!0}updateEffects(e){this.shaderOption.effects={...this.shaderOption.effects,...e},this.needsUpdate=!0}animate(){requestAnimationFrame(()=>this.animate()),this.time.value=this.clock.getElapsedTime(),this.startTime.value<1&&(this.startTime.value+=.01)}}var q0=Object.defineProperty,ey=(r,e,t)=>e in r?q0(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ii=(r,e,t)=>ey(r,typeof e!="symbol"?e+"":e,t);const ty={emissive:!1,emissiveIntensity:1,emissiveColor:"#ffffff"};class ih extends ti{constructor(e){super(e),ii(this,"_type","Model"),ii(this,"_emissive",!1),ii(this,"_emissiveIntensity",1),ii(this,"_emissiveColor","#ffffff"),ii(this,"_mixer",null),ii(this,"_currentAction",null),ii(this,"_animations",[]),ii(this,"_clock",new p.Clock),ii(this,"_autoUpdate",!0),ii(this,"_animationRequestId",null),ii(this,"_iscity",!1),this._emissive=e.emissive||!1,this._emissiveIntensity=e.emissiveIntensity||1,this._emissiveColor=e.emissiveColor||"#ffffff",this.castShadow=e.castShadow||!1,this.receiveShadow=e.receiveShadow||!1,this._iscity=e.iscity||!1}async _toThreeJSGeometry(){if(this._position=this._coordsTransform(),this._style){if(this._threeGeometry&&this._disposeGeometry(),this.modelunino=await this._createObject(this._style),this._threeGeometry=this.modelunino.model,!this._threeGeometry){console.error("Model load failed: model returned by _createObject is undefined"),console.error("模型加载失败:_createObject返回的model为undefined");return}this._threeGeometry.userData._type="Model",this.modelunino.animations&&this.modelunino.animations.length>0&&(this._animations=this.modelunino.animations,this._mixer=new p.AnimationMixer(this._threeGeometry),this._startAnimationLoop(),this.playAnimation({name:this._animations[0].name,loop:!0,speed:1.5,fadeInDuration:.5,fadeOutDuration:.3})),this._updateGeometry(),this.setShadows({cast:this.castShadow,receive:this.receiveShadow}),this._applyEmissionProperties(),this._iscity&&this._rendercity(),this.trigger("loaded",{timestamp:_c(),targrt:this})}}async _createObject(e){switch(e.config.type){case"fbx":case"gltf":return fg(e.config,this._position);default:throw new Error(`Unsupported style type: ${e.config.type}`)}}_applyEmissionProperties(){this._threeGeometry&&this._threeGeometry.traverse(e=>{if("material"in e){const t=e.material;t&&(t.emissiveIntensity=this._emissive?this._emissiveIntensity:0,t.emissive&&t.emissive.setStyle(this._emissiveColor))}})}get emissive(){return this._emissive}set emissive(e){this._emissive=e,this._applyEmissionProperties()}get emissiveIntensity(){return this._emissiveIntensity}set emissiveIntensity(e){this._emissiveIntensity=e,this._applyEmissionProperties()}get emissiveColor(){return this._emissiveColor}set emissiveColor(e){this._emissiveColor=e,this._applyEmissionProperties()}setEmission(e,t,i){this._emissive=e,t!==void 0&&(this._emissiveIntensity=t),i!==void 0&&(this._emissiveColor=i),this._applyEmissionProperties()}async setShadows(e){this.castShadow=e.cast,this.receiveShadow=e.receive,this._threeGeometry&&this._threeGeometry.traverse(t=>{t.isMesh&&t.material&&(t.castShadow=e.cast,t.receiveShadow=e.receive)})}playAnimation(e){if(!this._mixer||this._animations.length===0){console.warn("No available animations for model"),console.warn("模型没有可用的动画");return}this._currentAction&&(e.fadeOutDuration&&e.fadeOutDuration>0?this._currentAction.fadeOut(e.fadeOutDuration):this._currentAction.stop());const t=typeof e.name=="number"?this._animations[e.name]:this._animations.find(i=>i.name===e.name);if(!t){console.warn(`Animation not found: ${e.name}`),console.warn(`找不到动画: ${e.name}`);return}this._currentAction=this._mixer.clipAction(t),this._currentAction.setLoop(e.loop?p.LoopRepeat:p.LoopOnce,e.loop?1/0:1),this._currentAction.timeScale=e.speed||1,this._currentAction.time=e.startAt||0,this._currentAction.setEffectiveWeight(e.weight||1),e.fadeInDuration&&e.fadeInDuration>0&&this._currentAction.fadeIn(e.fadeInDuration),this._currentAction.play(),this._autoUpdate&&this._animationRequestId===null&&this._startAnimationLoop()}stopAnimation(e={}){this._currentAction&&(e.fadeDuration&&e.fadeDuration>0?(this._currentAction.fadeOut(e.fadeDuration),setTimeout(()=>{this._currentAction&&(this._currentAction.stop(),this._currentAction=null)},e.fadeDuration*1e3)):(this._currentAction.stop(),this._currentAction=null))}setAnimationPaused(e){this._currentAction&&(this._currentAction.paused=e.paused)}setAnimationSpeed(e){this._currentAction&&(this._currentAction.timeScale=e.speed)}updateAnimation(e){this._mixer&&this._mixer.update(e.deltaTime)}getAnimationNames(){return this._animations.map(e=>e.name)}getCurrentAnimationName(){return this._currentAction?this._currentAction.getClip().name:null}getAnimationDuration(e){let t;return typeof e.name=="number"?t=this._animations[e.name]:t=this._animations.find(i=>i.name===e.name),t?t.duration:null}dispose(){this._stopAnimationLoop(),this._mixer&&(this._mixer.stopAllAction(),this._mixer.uncacheRoot(this._threeGeometry)),super.dispose()}_startAnimationLoop(){if(!this._autoUpdate||this._animationRequestId!==null)return;const e=()=>{if(this._mixer){const t=this._clock.getDelta();this._mixer.update(t)}this._animationRequestId=requestAnimationFrame(e)};this._clock.start(),this._animationRequestId=requestAnimationFrame(e)}_stopAnimationLoop(){this._animationRequestId!==null&&(cancelAnimationFrame(this._animationRequestId),this._animationRequestId=null),this._clock.stop()}setAutoUpdate(e){this._autoUpdate=e,e?this._startAnimationLoop():this._stopAnimationLoop()}_computeOverlayVertices(e){const t=e.feature;if(t&&Array.isArray(t._vertexPoints)&&t._vertexPoints.length>=6){const h=t.getMap?.()||this.getMap();if(h&&h.prjcenter){const d=h.prjcenter,m=t._vertexPoints,f=[];for(let g=0;g+2<m.length;g+=3){const v=m[g],w=m[g+2],b=d.x+v,x=d.z+w;f.push(new p.Vector2(b,x))}if(f.length>=3)return f}}const i=this.getMap();if(!i||!e.geometry)return null;const n=e.geometry;let o;if(n.type==="Polygon")o=n.coordinates;else if(n.type==="MultiPolygon"){if(!n.coordinates.length)return null;o=n.coordinates[0]}else return null;if(!o.length||!o[0].length)return null;const a=o[0],c=[];for(const h of a){const d=h[0],m=h[1],f=i.geo2world(new p.Vector3(d,m,0));c.push(new p.Vector2(f.x,f.z))}return c.length<3?null:c}_rendercity(){const e=this.getLayer();let t=null;if(e&&e.getRegionOverlays){const i=e.getRegionOverlays()||[];if(i.length){const n=i.filter(a=>(a.mode??"overlay")==="overlay").sort((a,c)=>(a.zIndex??0)-(c.zIndex??0)),o=n[n.length-1];if(o&&(o.geometry||o.feature)){const a=this._computeOverlayVertices(o);a&&a.length>=3&&(t={color:new p.Color(o.color??"#00FF88"),opacity:o.opacity??.3,vertices:a})}}}this.traverse(async i=>{if(i instanceof p.Mesh&&i.material){if(i.castShadow=!0,i.name==="building"){const n=new $0({color:new p.Color("#6BA7EC").multiplyScalar(1.8),opacity:.9,shaderOption:{minY:0,maxY:50,minRate:.3,maxRate:1.5,effects:{diffusion:{enabled:!0,color:new p.Color("#FFFFF"),width:300,speed:.05},flow:{enabled:!1,color:new p.Color("#FFFFF"),range:1e3,speed:3e3},sweep:{enabled:!0,color:new p.Color("#ffffff"),width:3,speed:5}}},regionOverlay:t||void 0}),o=new p.Box3().setFromObject(i);n.updateBoundingBox(o.min.y,o.max.y),n.setDiffusionFromObject(i),i.receiveShadow=!1,i.material=n,i.material.needsUpdate=!0}i.name==="grass"&&(i.castShadow=!1,i.receiveShadow=!0,i.material.color=new p.Color("#81e4d8ff)").multiplyScalar(.7),i.material.metalness=.2,i.material.roughness=.8,["metalnessMap","normalMap","roughnessMap","specularColorMap"].forEach(n=>{const o=i.material[n];o&&(o.wrapS=o.wrapT=p.RepeatWrapping,o.repeat.set(.3,.3),o.needsUpdate=!0)}),i.material.normalScale=new p.Vector2(3,3))}})}}ih.mergeOptions(ty);var iy=Object.defineProperty,ny=(r,e,t)=>e in r?iy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ry=(r,e,t)=>ny(r,e+"",t);const sy={};class nh extends ti{constructor(e){super(e),ry(this,"_type","Cloud")}async _toThreeJSGeometry(){this._position=this._coordsTransform(),this._style&&(this._threeGeometry&&this._disposeGeometry(),this._threeGeometry=await this._createObject(this._style),this._updateGeometry())}_updateGeometry(){this._disposeGeometry();const e=this.getLayer();this._threeGeometry&&(this._threeGeometry.position.copy(this._position),this._threeGeometry.renderOrder=99,e&&(e._clouds.add(this._threeGeometry),e._clouds.updateMatrixWorld()))}async _createObject(e){switch(e.config.type){case"cloud":return vg(e.config,this._position);default:throw new Error(`Unsupported style type: ${e.config.type}`)}}}nh.mergeOptions(sy);var oy=Object.defineProperty,ay=(r,e,t)=>e in r?oy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ly=(r,e,t)=>ay(r,e+"",t);const cy={};class rh extends ti{constructor(e){super(e),ly(this,"_type","Label")}async _toThreeJSGeometry(){this._position=this._coordsTransform(),this._style&&(this._threeGeometry&&this._disposeGeometry(),this._threeGeometry=await this._createObject(this._style),this._updateGeometry())}_updateGeometryPositions(){this._position=this._coordsTransform(),this._threeGeometry?(this._threeGeometry.position.copy(this._position),this.children.includes(this._threeGeometry)||this.add(this._threeGeometry),this.updateMatrixWorld(!0),this._threeGeometry.updateMatrixWorld(!0)):this._toThreeJSGeometry()}async _createObject(e){switch(e.config.type){case"canvas-label-fixed":return wg(e.config,new p.Vector3(0,0,0),this.getMap());case"canvas-label":return _g(e.config,new p.Vector3(0,0,0));default:throw new Error(`Unsupported style type: ${e.config.type}`)}}}rh.mergeOptions(cy);var hy=Object.defineProperty,uy=(r,e,t)=>e in r?hy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,sh=(r,e,t)=>uy(r,typeof e!="symbol"?e+"":e,t);const dy={};class oh extends ti{constructor(e){super(e),sh(this,"_type","TPoints"),sh(this,"_geometries"),this._geometries=e.geometries}async _toThreeJSGeometry(){this._position=this._coordsTransform(),this._style&&(this._threeGeometry&&this._disposeGeometry(),this._threeGeometry=await this._createObject(this._style),this._updateGeometry())}_updateGeometry(){this._threeGeometry&&(this._threeGeometry.points&&this.add(this._threeGeometry.points),this._threeGeometry.InstancedCol&&this.add(this._threeGeometry.InstancedCol),this.updateMatrixWorld(!0))}async _createObject(e){switch(e.config.type){case"light":return Gg(e.config,this._geometries,this.getMap());default:throw new Error(`Unsupported style type: ${e.config.type}`)}}}oh.mergeOptions(dy);var fy=Object.defineProperty,py=(r,e,t)=>e in r?fy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ri=(r,e,t)=>py(r,typeof e!="symbol"?e+"":e,t);class Tr extends Ki(Object){constructor(e,t){super(),Ri(this,"options"),Ri(this,"map"),Ri(this,"_sprite",null),Ri(this,"_isDragging",!1),Ri(this,"_dragStartPosition",null),Ri(this,"_lastCoordinate",null),Ri(this,"_boundOnMouseMove",null),Ri(this,"_boundOnMouseUp",null),this.map=t,this.options={position:e.position,index:e.index,symbol:e.symbol??0,size:e.size??8,color:e.color??"#ffffff",opacity:e.opacity??.9,draggable:e.draggable??!0},this._createSprite(),this._boundOnMouseMove=this._onMouseMove.bind(this),this._boundOnMouseUp=this._onMouseUp.bind(this)}_createSprite(){const t=document.createElement("canvas"),i=t.getContext("2d");t.width=64,t.height=64;const n=64/2,o=64/2-2;i.clearRect(0,0,t.width,t.height),i.beginPath(),i.arc(n,n,o,0,2*Math.PI),i.fillStyle="#000000",i.fill(),i.beginPath(),i.arc(n,n,o-2,0,2*Math.PI),i.fillStyle=this.options.color,i.fill();const a=new p.CanvasTexture(t);a.needsUpdate=!0;const c=new p.SpriteMaterial({map:a,opacity:this.options.opacity,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!0});this._sprite=new p.Sprite(c),this._sprite.position.copy(this.options.position),this._sprite.renderOrder=999999;const h=new p.Vector2;this._sprite.onBeforeRender=(d,m,f)=>{if(!this._sprite||!f)return;const g=f.position.distanceTo(this._sprite.position);d.getSize(h);const v=d.getPixelRatio(),w=this.options.size*v;let b=1;if(f.isPerspectiveCamera){const x=f.fov*Math.PI/180,L=2*Math.tan(x/2)*g;b=w/h.y*L}else if(f.isOrthographicCamera){const x=f.top,L=f.bottom,M=Math.abs(x-L)/f.zoom;b=w/h.y*M}this._sprite.scale.set(b,b,1)},this._sprite._editHandle=this,this.map.viewer.scene.add(this._sprite)}updatePosition(e){this.options.position=e,this._sprite&&this._sprite.position.copy(e)}getPosition(){return this.options.position.clone()}getIndex(){return this.options.index}getSymbol(){return this.options.symbol}getSprite(){return this._sprite}intersect(e){return!this._sprite||!this.options.draggable?!1:e.intersectObject(this._sprite).length>0}startDrag(e){this.options.draggable&&(this._isDragging=!0,this._dragStartPosition=this.options.position.clone(),this._lastCoordinate=e,this.map.viewer.config("draggable",!1),this.map.on("mousemove",this._boundOnMouseMove),this.map.on("mouseup",this._boundOnMouseUp),this.trigger("dragstart",{target:this,coordinate:e,position:this.options.position.clone()}))}_onMouseMove(e){if(!this._isDragging||!this._lastCoordinate)return;const t=e.coordinate,i=t[0]-this._lastCoordinate[0],n=t[1]-this._lastCoordinate[1],o=this.map.world2geo(this.options.position),a=this.map.geo2world(new p.Vector3(t[0],t[1],o.z));this.updatePosition(a),this._lastCoordinate=t,this.trigger("dragging",{target:this,coordinate:t,position:this.options.position.clone(),offset:{dx:i,dy:n}})}_onMouseUp(e){this._isDragging&&(this._isDragging=!1,this.map.viewer.config("draggable",!0),this.map.off("mousemove",this._boundOnMouseMove),this.map.off("mouseup",this._boundOnMouseUp),this.trigger("dragend",{target:this,coordinate:e.coordinate,position:this.options.position.clone(),startPosition:this._dragStartPosition}),this._dragStartPosition=null,this._lastCoordinate=null)}show(){this._sprite&&(this._sprite.visible=!0)}hide(){this._sprite&&(this._sprite.visible=!1)}remove(){if(this._isDragging&&(this._isDragging=!1,this.map.viewer.config("draggable",!0),this.map.off("mousemove",this._boundOnMouseMove),this.map.off("mouseup",this._boundOnMouseUp)),this._sprite){this.map.viewer.scene.remove(this._sprite);const e=this._sprite.material;e.map&&e.map.dispose(),e.dispose(),this._sprite=null}this._dragStartPosition=null,this._lastCoordinate=null,this._boundOnMouseMove=null,this._boundOnMouseUp=null}}function na(r,e,t){const{currentTarget:i,clientX:n,clientY:o}=r;if(i instanceof HTMLElement){const a=i.clientWidth,c=i.clientHeight,h=new p.Vector2(n/a*2-1,-(o/c)*2+1);return e.getLocalInfoFromScreen(t,h)?.location}else return}var my=Object.defineProperty,gy=(r,e,t)=>e in r?my(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,dt=(r,e,t)=>gy(r,typeof e!="symbol"?e+"":e,t);class yy extends cs{constructor(e,t){super(e),dt(this,"options"),dt(this,"_handles",[]),dt(this,"_middleHandles",[]),dt(this,"_middleHandleColor","rgba(255, 255, 255, 0.6)"),dt(this,"_editing",!1),dt(this,"_shadow",null),dt(this,"_shadowSnapshot",null),dt(this,"_updating",!1),dt(this,"_history",[]),dt(this,"_historyIndex",-1),dt(this,"_draggableOriginalState",!1),dt(this,"_boundOnMapMouseMove",null),dt(this,"_boundOnMapClick",null),dt(this,"_boundOnMapMouseDown",null),dt(this,"_boundOnFeatureDragging",null),dt(this,"_boundOnFeatureDragEnd",null),this.options={handleSize:t?.handleSize??8,handleColor:t?.handleColor??"#ffffff",showMiddleHandles:t?.showMiddleHandles??!1,maxHistorySize:t?.maxHistorySize??20,removeVertexOn:t?.removeVertexOn??"contextmenu"},this._boundOnMapMouseMove=this._onMapMouseMove.bind(this),this._boundOnMapClick=this._onMapClick.bind(this),this._boundOnMapMouseDown=this._onMapMouseDown.bind(this),this._boundOnFeatureDragging=this._onFeatureDragging.bind(this),this._boundOnFeatureDragEnd=this._onFeatureDragEnd.bind(this)}enable(){return this._editing?this:(super.enable(),this._editing=!0,this._createShadow(),this._saveSnapshot(),this._setFeatureEditingStyle(!0),this._createHandles(),this.target.trigger("editstart"),this._draggableOriginalState=this.target.options.draggable||!1,this._draggableOriginalState||(this.target.options.draggable=!0,this.target.draggable&&this.target.draggable.enable()),this)}disable(){return this._editing?(super.disable(),this._editing=!1,this._clearHandles(),this._setFeatureEditingStyle(!1),this._draggableOriginalState||(this.target.options.draggable=!1,this.target.draggable&&this.target.draggable.disable()),this._draggableOriginalState=!1,this._updateCoordFromShadow(),this._removeShadow(),this.target.trigger("editend"),this):this}addHooks(){const e=this._getMap();e&&(e.on("mousemove",this._boundOnMapMouseMove),e.on("click",this._boundOnMapClick),e.viewer.container&&e.viewer.container.addEventListener("mousedown",this._boundOnMapMouseDown,!0),this.options.removeVertexOn==="contextmenu"&&e.on("contextmenu",this._boundOnMapClick)),this.target.on("dragging",this._boundOnFeatureDragging),this.target.on("dragend",this._boundOnFeatureDragEnd)}removeHooks(){const e=this._getMap();e&&(e.off("mousemove",this._boundOnMapMouseMove),e.off("click",this._boundOnMapClick),e.viewer.container&&e.viewer.container.removeEventListener("mousedown",this._boundOnMapMouseDown,!0),this.options.removeVertexOn==="contextmenu"&&e.off("contextmenu",this._boundOnMapClick)),this.target.off("dragging",this._boundOnFeatureDragging),this.target.off("dragend",this._boundOnFeatureDragEnd)}isEditing(){return this._editing}_createShadow(){this._shadow=null}_removeShadow(){this._shadow&&(this._shadow=null),this._shadowSnapshot=null}_updateCoordFromShadow(e=!1){e&&!this._updating&&this.target._onPositionChanged(!0)}_saveSnapshot(){const e=this.target._geometry;this._shadowSnapshot={type:e.type,coordinates:JSON.parse(JSON.stringify(e.coordinates))},this._addHistory(e.coordinates)}_addHistory(e){this._historyIndex<this._history.length-1&&(this._history=this._history.slice(0,this._historyIndex+1)),this._history.push({coordinates:JSON.parse(JSON.stringify(e)),timestamp:Date.now()}),this._history.length>this.options.maxHistorySize?this._history.shift():this._historyIndex++}undo(){if(this._historyIndex>0){this._historyIndex--;const e=this._history[this._historyIndex];this._restoreCoordinates(e.coordinates),this.target.trigger("editundo")}return this}redo(){if(this._historyIndex<this._history.length-1){this._historyIndex++;const e=this._history[this._historyIndex];this._restoreCoordinates(e.coordinates),this.target.trigger("editredo")}return this}_restoreCoordinates(e){const t=this.target._geometry;t.coordinates=JSON.parse(JSON.stringify(e)),this.target._onPositionChanged(!0),this._updateHandlePositions()}cancel(){return this._shadowSnapshot&&this._restoreCoordinates(this._shadowSnapshot.coordinates),this.disable(),this}_createHandles(){const e=this.target._geometry,t=this._getMap();if(!t){console.warn("[FeatureEditHandler] No map found, cannot create handles");return}this.target instanceof ti?this._createPointHandles(e,t):this.target instanceof St?this._createLineStringHandles(e,t):this.target instanceof vi&&this._createPolygonHandles(e,t)}_createPointHandles(e,t){const i=e.coordinates,n=t.geo2world(new p.Vector3(i[0],i[1],i[2]||0)),o=new Tr({position:n,index:0,symbol:0,size:this.options.handleSize,color:this.options.handleColor},t);o.on("dragstart",a=>{this._onHandleDragStart(a,0)}),o.on("dragging",a=>{this._onHandleDragging(a,0)}),o.on("dragend",a=>{this._onHandleDragEnd(a,0)}),this._handles.push(o)}_createLineStringHandles(e,t){const i=e.coordinates;i.forEach((n,o)=>{const a=t.geo2world(new p.Vector3(n[0],n[1],n[2]||0)),c=new Tr({position:a,index:o,symbol:0,size:this.options.handleSize,color:this.options.handleColor},t);c.on("dragstart",h=>{this._onHandleDragStart(h,o)}),c.on("dragging",h=>{this._onHandleDragging(h,o)}),c.on("dragend",h=>{this._onHandleDragEnd(h,o)}),this._handles.push(c)}),this.options.showMiddleHandles&&this._createLineStringMiddleHandles(i,t)}_onHandleDragging(e,t){this._updating=!0;const n=e.target.getPosition();if(!this._getMap())return;const a=this._fixHandlePointCoordinates(n,t),c=this.target._geometry;this.target instanceof ti?c.coordinates=[a.x,a.y,a.z]:this.target instanceof St&&(c.coordinates[t]=[a.x,a.y,a.z]),this.target._onPositionChanged(!0),this.target.trigger("handledragging",{index:t,coordinate:[a.x,a.y,a.z]}),this.target.trigger("editing",{index:t,coordinate:[a.x,a.y,a.z]}),this._updating=!1}_onHandleDragStart(e,t){this._updating=!0,this.target.trigger("handledragstart",{index:t,coordinate:e.coordinate})}_onHandleDragEnd(e,t){this._updating=!1;const i=this.target._geometry;this._addHistory(i.coordinates),this.target.trigger("handledragend",{index:t,coordinate:this.target instanceof ti?i.coordinates:i.coordinates[t]}),this.target.trigger("editvertex",{index:t,coordinate:this.target instanceof ti?i.coordinates:i.coordinates[t]})}_createPolygonHandles(e,t){const i=e.coordinates;if(!i||!Array.isArray(i)||i.length===0){console.warn("[FeatureEditHandler] Invalid polygon coordinates");return}i.forEach((o,a)=>{if(!o||o.length<3)return;const c=o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1]?o.length-1:o.length;for(let h=0;h<c;h++){const d=o[h],m=t.geo2world(new p.Vector3(d[0],d[1],d[2]||0)),f=new Tr({position:m,index:h,symbol:0,size:this.options.handleSize,color:this.options.handleColor},t);f._ringIndex=a,f.on("dragstart",g=>{this._onPolygonHandleDragStart(g,h,a)}),f.on("dragging",g=>{this._onPolygonHandleDragging(g,h,a)}),f.on("dragend",g=>{this._onPolygonHandleDragEnd(g,h,a)}),this._handles.push(f)}this.options.showMiddleHandles&&this._createPolygonMiddleHandles(o,a,t)})}_onPolygonHandleDragStart(e,t,i){this._updating=!0,this.target.trigger("handledragstart",{index:t,ringIndex:i,coordinate:e.coordinate})}_onPolygonHandleDragging(e,t,i){const o=e.target.getPosition();if(!this._getMap())return;const c=this._fixHandlePointCoordinates(o,t,i),d=this.target._geometry.coordinates;if(d[i]&&d[i][t]&&(d[i][t]=[c.x,c.y,c.z],t===0&&d[i].length>1)){const m=d[i].length-1;d[i][m]=[c.x,c.y,c.z]}this.target._onPositionChanged(!0),this.target.trigger("handledragging",{index:t,ringIndex:i,coordinate:[c.x,c.y,c.z]}),this.target.trigger("editing",{index:t,ringIndex:i,coordinate:[c.x,c.y,c.z]})}_onPolygonHandleDragEnd(e,t,i){this._updating=!1;const n=this.target._geometry,o=n.coordinates;this._addHistory(n.coordinates),this.target.trigger("handledragend",{index:t,ringIndex:i,coordinate:o[i]?.[t]||null}),this.target.trigger("editvertex",{index:t,ringIndex:i,coordinate:o[i]?.[t]||null})}_updateHandlePositions(){const e=this.target._geometry,t=this._getMap();if(t){if(this.target instanceof ti){const i=e.coordinates,n=t.geo2world(new p.Vector3(i[0],i[1],i[2]||0));this._handles[0]&&this._handles[0].updatePosition(n)}else if(this.target instanceof St)e.coordinates.forEach((n,o)=>{const a=t.geo2world(new p.Vector3(n[0],n[1],n[2]||0));this._handles[o]&&this._handles[o].updatePosition(a)});else if(this.target instanceof vi){const i=e.coordinates;let n=0;i.forEach(o=>{const a=o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1]?o.length-1:o.length;for(let c=0;c<a;c++){const h=o[c],d=t.geo2world(new p.Vector3(h[0],h[1],h[2]||0));this._handles[n]&&this._handles[n].updatePosition(d),n++}})}}}_clearHandles(){this._handles.forEach(e=>e.remove()),this._handles=[],this._middleHandles.forEach(e=>e.remove()),this._middleHandles=[]}_onFeatureDragging(e){this._updateHandlePositions(),this.options.showMiddleHandles&&this._updateMiddleHandlePositions()}_onFeatureDragEnd(e){const t=this.target._geometry;this._addHistory(t.coordinates),this._updateHandlePositions(),this.options.showMiddleHandles&&this._updateMiddleHandlePositions()}_updateMiddleHandlePositions(){const e=this.target._geometry,t=this._getMap();if(!t)return;let i=0;if(this.target instanceof St){const n=e.coordinates;for(let o=0;o<n.length-1&&!(i>=this._middleHandles.length);o++){const a=n[o],c=n[o+1],h=[(a[0]+c[0])/2,(a[1]+c[1])/2,((a[2]||0)+(c[2]||0))/2],d=t.geo2world(new p.Vector3(h[0],h[1],h[2]));this._middleHandles[i].updatePosition(d),i++}}else this.target instanceof vi&&e.coordinates.forEach(o=>{const a=o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1]?o.length-1:o.length;for(let c=0;c<a&&!(i>=this._middleHandles.length);c++){const h=(c+1)%a,d=o[c],m=o[h],f=[(d[0]+m[0])/2,(d[1]+m[1])/2,((d[2]||0)+(m[2]||0))/2],g=t.geo2world(new p.Vector3(f[0],f[1],f[2]));this._middleHandles[i].updatePosition(g),i++}})}_onMapMouseDown(e){const t=this._getMap();if(!t)return;const i=new p.Raycaster;i.params.Points={threshold:.5};const n=e,o=t.viewer.renderer.domElement,a=o.getBoundingClientRect(),c=new p.Vector2((n.clientX-a.left)/a.width*2-1,-((n.clientY-a.top)/a.height)*2+1);i.setFromCamera(c,t.viewer.camera);const h=[...this._handles,...this._middleHandles];for(const d of h)if(d.intersect(i)){const m=na({currentTarget:o,clientX:n.clientX,clientY:n.clientY},t.tilemap,t.viewer.camera);m&&(d.startDrag([m.x,m.y]),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),n.preventDefault&&n.preventDefault());return}}_onMapMouseMove(e){}_onMapClick(e){if(!(e.type===this.options.removeVertexOn))return;const i=this._getMap();if(!i)return;const n=new p.Raycaster;n.params.Points={threshold:.5};const o=e.originEvent;if(!o)return;const a=new p.Vector2(o.offsetX/i.viewer.renderer.domElement.clientWidth*2-1,-(o.offsetY/i.viewer.renderer.domElement.clientHeight)*2+1);n.setFromCamera(a,i.viewer.camera);for(let c=0;c<this._handles.length;c++)if(this._handles[c].intersect(n)){this._removeVertex(c),o.stopPropagation&&o.stopPropagation(),o.preventDefault&&o.preventDefault();return}}_setFeatureEditingStyle(e){const t=this.target._threeGeometry;t&&t.traverse(i=>{i.material&&(e?Array.isArray(i.material)?i.material.forEach(n=>{n.userData._originalOpacity||(n.userData._originalOpacity=n.opacity),n.opacity=Math.min(n.opacity*.6,.6),n.transparent=!0}):(i.material.userData._originalOpacity||(i.material.userData._originalOpacity=i.material.opacity),i.material.opacity=Math.min(i.material.opacity*.6,.6),i.material.transparent=!0):Array.isArray(i.material)?i.material.forEach(n=>{n.userData._originalOpacity!==void 0&&(n.opacity=n.userData._originalOpacity,delete n.userData._originalOpacity)}):i.material.userData._originalOpacity!==void 0&&(i.material.opacity=i.material.userData._originalOpacity,delete i.material.userData._originalOpacity))})}_removeVertex(e){const t=this.target._geometry,i=this._handles[e],n=i.getIndex(),o=i._ringIndex||0;let a=null;if(this.target instanceof St){const c=t.coordinates;if(c.length<=2){console.warn("[FeatureEditHandler] LineString requires at least 2 vertices");return}a=c[n],c.splice(n,1)}else if(this.target instanceof vi){const h=t.coordinates[o];if(!h)return;const d=h.length>1&&h[0][0]===h[h.length-1][0]&&h[0][1]===h[h.length-1][1],m=d?4:3;if(h.length<=m){console.warn("[FeatureEditHandler] Polygon ring requires at least 3 vertices");return}a=h[n],h.splice(n,1),d&&n===0&&h.length>0&&(h[h.length-1]=[...h[0]])}else return;this.target._onPositionChanged(!0),i.remove(),this._handles.splice(e,1),this._updateHandleIndices(),this._addHistory(t.coordinates),this.target.trigger("handleremove",{index:n,ringIndex:o,coordinate:a})}_createLineStringMiddleHandles(e,t){for(let i=0;i<e.length-1;i++){const n=e[i],o=e[i+1],a=[(n[0]+o[0])/2,(n[1]+o[1])/2,((n[2]||0)+(o[2]||0))/2],c=t.geo2world(new p.Vector3(a[0],a[1],a[2])),h=new Tr({position:c,index:i,symbol:1,size:this.options.handleSize,color:this._middleHandleColor,opacity:.6},t);h.on("dragstart",d=>{this._onMiddleHandleClick(i,"LineString",0)}),this._middleHandles.push(h)}}_createPolygonMiddleHandles(e,t,i){const n=e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]?e.length-1:e.length;for(let o=0;o<n;o++){const a=(o+1)%n,c=e[o],h=e[a],d=[(c[0]+h[0])/2,(c[1]+h[1])/2,((c[2]||0)+(h[2]||0))/2],m=i.geo2world(new p.Vector3(d[0],d[1],d[2])),f=new Tr({position:m,index:o,symbol:1,size:this.options.handleSize,color:this._middleHandleColor,opacity:.6},i);f._ringIndex=t,f.on("dragstart",g=>{this._onMiddleHandleClick(o,"Polygon",t)}),this._middleHandles.push(f)}}_onMiddleHandleClick(e,t,i){const n=this.target._geometry;if(this._getMap()){if(t==="LineString"){const a=n.coordinates,c=a[e],h=a[e+1],d=[(c[0]+h[0])/2,(c[1]+h[1])/2,((c[2]||0)+(h[2]||0))/2];a.splice(e+1,0,d)}else if(t==="Polygon"){const c=n.coordinates[i];if(!c)return;const h=c[0][0]===c[c.length-1][0]&&c[0][1]===c[c.length-1][1]?c.length-1:c.length,d=(e+1)%h,m=c[e],f=c[d],g=[(m[0]+f[0])/2,(m[1]+f[1])/2,((m[2]||0)+(f[2]||0))/2];c.splice(e+1,0,g),c.length>1&&c[0][0]===c[c.length-1][0]&&c[0][1]===c[c.length-1][1]&&e===h-1&&(c[c.length-1]=[...c[0]])}this.target._onPositionChanged(!0),this._clearHandles(),this._createHandles(),this._addHistory(n.coordinates),this.target.trigger("vertexinsert",{index:e+1,ringIndex:i})}}_updateHandleIndices(){if(this.target instanceof St)this._handles.forEach((e,t)=>{e._index=t});else if(this.target instanceof vi){let e=0;this.target._geometry.coordinates.forEach((n,o)=>{const a=n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]?n.length-1:n.length;for(let c=0;c<a;c++)this._handles[e]&&(this._handles[e]._index=c,this._handles[e]._ringIndex=o),e++})}}_fixHandlePointCoordinates(e,t,i=0){const n=this._getMap();if(!n)return e;const o=this.target._geometry;let a=null;if(this.target instanceof ti)a=o.coordinates;else if(this.target instanceof St)a=o.coordinates[t];else if(this.target instanceof vi){const h=o.coordinates;h[i]&&h[i][t]&&(a=h[i][t])}if(!a||!a[2]||a[2]===0)return n.world2geo(e);const c=n.world2geo(e);return c.z=a[2],c}_getMap(){return this.target.getMap()}remove(){this.disable(),this._history=[],this._historyIndex=-1,this._shadow=null,this._shadowSnapshot=null,this._boundOnMapMouseMove=null,this._boundOnMapClick=null,this._boundOnMapMouseDown=null}}ut.prototype.startEdit=function(r){return this.options?.editable?(this._editor&&this.endEdit(),this._editor=new yy(this,r),this._editor.enable(),this):(console.warn("Feature is not editable. Set editable option to true."),this)},ut.prototype.endEdit=function(){return this._editor&&(this._editor.disable(),this._editor.remove(),delete this._editor),this},ut.prototype.isEditing=function(){return this._editor?this._editor.isEditing():!1},ut.prototype.cancelEdit=function(){return this._editor&&this._editor.cancel(),this},ut.prototype.undoEdit=function(){return this._editor&&this._editor.undo(),this},ut.prototype.redoEdit=function(){return this._editor&&this._editor.redo(),this};function _s(r,e){if(!r||r===!0)return!0;if(!Array.isArray(r))return!!r;switch(r[0]){case"all":return r.slice(1).every(i=>_s(i,e));case"any":return r.slice(1).some(i=>_s(i,e));case"!":return!_s(r[1],e);case"==":{const i=De(r[1],e),n=De(r[2],e);return ws(i)==ws(n)}case"!=":{const i=De(r[1],e),n=De(r[2],e);return ws(i)!=ws(n)}case">":{const i=De(r[1],e),n=De(r[2],e);return ji(i)>ji(n)}case"<":{const i=De(r[1],e),n=De(r[2],e);return ji(i)<ji(n)}case">=":{const i=De(r[1],e),n=De(r[2],e);return ji(i)>=ji(n)}case"<=":{const i=De(r[1],e),n=De(r[2],e);return ji(i)<=ji(n)}case"in":{const i=De(r[1],e);return r.slice(2).map(o=>De(o,e)).includes(i)}case"!in":{const i=De(r[1],e);return!r.slice(2).map(o=>De(o,e)).includes(i)}case"has":{const i=r[1];return e!=null&&Object.prototype.hasOwnProperty.call(e,i)}case"!has":{const i=r[1];return!(e!=null&&Object.prototype.hasOwnProperty.call(e,i))}case"like":case"contains":{const i=De(r[1],e),n=De(r[2],e);return String(i).toLowerCase().includes(String(n).toLowerCase())}case"starts-with":{const i=De(r[1],e),n=De(r[2],e);return String(i).toLowerCase().startsWith(String(n).toLowerCase())}case"ends-with":{const i=De(r[1],e),n=De(r[2],e);return String(i).toLowerCase().endsWith(String(n).toLowerCase())}default:return!0}}function De(r,e){if(Array.isArray(r))switch(r[0]){case"get":return e?e[r[1]]:void 0;default:return r}return r}function ws(r){if(r==null)return null;if(typeof r=="string"){const e=Number(r);if(!isNaN(e)&&r.trim()!=="")return e}return typeof r=="boolean"?r?1:0:r}function ji(r){if(r==null)return 0;if(typeof r=="number")return r;if(typeof r=="boolean")return r?1:0;if(typeof r=="string"){const e=Number(r);return isNaN(e)?0:e}return Number(r)}var vy=Object.defineProperty,_y=(r,e,t)=>e in r?vy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,kn=(r,e,t)=>_y(r,typeof e!="symbol"?e+"":e,t);class bs extends Bi{constructor(e,t){super(e,t),kn(this,"TILE_SIZE"),kn(this,"EXTENT"),kn(this,"style"),kn(this,"interactive",!1),kn(this,"_tileFeatureMap",new Map),kn(this,"_activeFeatureFilter"),this.TILE_SIZE=t.tileSize??256,this.EXTENT=t.extent??4096,this.style=t.style||[],this._onMapUpdate=this._onMapUpdate.bind(this)}processTileData(e,t){const i=this.getMap(),n=`${e.z}-${e.x}-${e.y}`,o=this._tileFeatureMap.get(n);if(o&&o.length>0){o.forEach(d=>{d.visible=!0,this.children.some(m=>m&&d&&m.uuid===d.uuid)||d.addTo(this)});return}const a=t.vectorData;if(!a||!a.layers||!i||this.style.length===0)return;const c=[],h=this.style;Object.keys(a.layers).forEach(d=>{const m=a.layers[d];for(let f=0;f<m.length;f++){const g=m[f],v=g.geometry;if(this._activeFeatureFilter&&!this._activeFeatureFilter(g.properties))continue;let w=null;for(const b of h)if(this._evaluateFilter(b.filter,g.properties,d,g.geometry.type)){w=b.style;break}if(w){const b={isVectorTile:!0,tileZ:e.z,tileX:e.x,tileY:e.y,rawCoordinates:v,extent:this.EXTENT,tileSize:this.TILE_SIZE},x=this._createFeatureInstance(g.geometry,g.geometry.type,w,{layerName:d,...g.properties});x&&(x.userData.tileData=b,x.style=Mt.create(w),x.addTo(this),x.initializeGeometry(),c.push(x))}}}),this._tileFeatureMap.set(n,c)}_evaluateFilter(e,t,i,n){if(!e||e===!0)return!0;const o={...t,$layer:i,$type:n};return _s(e,o)}hideFeaturesByTileKey(e){const t=this._tileFeatureMap.get(e);t&&t.forEach(i=>{i.visible=!1})}removeFeaturesByTileKey(e){this._removeFeaturesByTileKey(e)}_removeFeaturesByTileKey(e){const t=this._tileFeatureMap.get(e);t&&(t.forEach(i=>{i._remove()}),this._tileFeatureMap.delete(e))}_createFeatureInstance(e,t,i,n){const a={geometry:{ismvt:!0,...e},style:i,userData:n};switch(t){case"Point":return new Pi(a);case"LineString":return new St(a);default:return null}}setFeatureFilter(e){this._activeFeatureFilter=e}clearFeatureFilter(){this._activeFeatureFilter=void 0}setOpacity(e){this.opacity=e,this._tileFeatureMap.forEach(t=>{t.forEach(i=>{i.material&&(i.material.opacity=e,i.material.transparent=e<1)})})}_onMapUpdate(){}updateStyle(e,t){if(!e||!Array.isArray(e)){console.warn("[VectorTileRenderLayer] updateStyle called with invalid style rules.");return}this.style=e,this._tileFeatureMap.forEach((i,n)=>{const o=t.get(n);if(!o||!o.data||!o.data.vectorData)return;const a=o.data.vectorData;i.forEach(c=>{const h=c.userData,d=c.userData.tileData?.rawCoordinates?.type;let m="";if(a&&a.layers){for(const[g,v]of Object.entries(a.layers))if(v.some(b=>b.properties===h||JSON.stringify(b.properties)===JSON.stringify(h))){m=g;break}}if(this._activeFeatureFilter&&!this._activeFeatureFilter(h)){c.visible=!1;return}let f=null;for(const g of e)if(this._evaluateFilter(g.filter,h,m,d)){f=g.style;break}f?(this._applyStyleToFeature(c,f),c.visible=!0):c.visible=!1})})}_applyStyleToFeature(e,t){e.style=Mt.create(t),e.initializeGeometry()}validateFeature(e){return e instanceof ut}dispose(){this._tileFeatureMap.forEach((e,t)=>{this._removeFeaturesByTileKey(t)})}}var wy=Object.defineProperty,by=(r,e,t)=>e in r?wy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Lt=(r,e,t)=>by(r,typeof e!="symbol"?e+"":e,t);class ah extends ps{constructor(e,t){super(e,t),this.layerId=e,Lt(this,"isTileLayer",!0),Lt(this,"layerType","base"),Lt(this,"isBaseLayer",!1),Lt(this,"_enabled",!0),Lt(this,"_visible",!0),Lt(this,"_rootTile"),Lt(this,"_loader"),Lt(this,"_LODThreshold",1),Lt(this,"isSceneLayer",!1),Lt(this,"opacity",1),Lt(this,"source"),Lt(this,"projection"),Lt(this,"minLevel",2),Lt(this,"maxLevel",19),this.source=t.source,this.projection=t.projection,this.minLevel=t.minLevel??2,this.maxLevel=t.maxLevel??19,this._LODThreshold=t.LODThreshold??1,this.opacity=t.opacity??1,this.name=`Layer-${e}`,this._loader=this.createLoader(),this._rootTile=new Ni,this._rootTile.matrixAutoUpdate=!0,this._rootTile.scale.set(this.projection.mapWidth,this.projection.mapHeight,1),this.add(this._rootTile),this._rootTile.updateMatrix(),this.layerId=e,this.name==="Layer-label-layer"&&this.position.set(0,0,1)}get LODThreshold(){return this._LODThreshold}set LODThreshold(e){this._LODThreshold=e}get loader(){return this._loader}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._rootTile&&(this._rootTile.visible=e&&this._visible)}get ivisible(){return this._visible&&super._visible}set ivisible(e){this._visible=e,this._rootTile&&(this._rootTile.visible=e&&this._enabled)}update(e){if(!(!this._enabled||!this._visible)){try{this._rootTile.update({camera:e,loader:this._loader,minLevel:this.minLevel,maxLevel:this.maxLevel,LODThreshold:this.LODThreshold})}catch{}console.groupEnd()}}_debugTileTree(){this._rootTile.traverse(e=>{e.isTile&&(e.loaded,e.visible,e.inFrustum,e.loaded)})}_getLODThreshold(){return 1}_getCurrentTileLevel(){let e=0;return this._rootTile.traverse(t=>{t.isTile&&t.loaded&&(e=Math.max(e,t.z))}),`最大层级: ${e}`}dispose(){this.remove(this._rootTile),this._rootTile.reload(this._loader)}reload(){this._rootTile.reload(this._loader)}setElevation(e){this.position.y=e,this.updateMatrix(),this.updateMatrixWorld(!0)}raiseElevation(e){this.position.z+=e,this.updateMatrix(),this.updateMatrixWorld(!0)}getElevation(){return this.position.y}}var xy=Object.defineProperty,My=(r,e,t)=>e in r?xy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Sy=(r,e,t)=>My(r,e+"",t);class lh extends p.LoadingManager{constructor(){super(...arguments),Sy(this,"onParseEnd")}parseEnd(e){this.onParseEnd&&this.onParseEnd(e)}}const ze={manager:new lh,demLoaderMap:new Map,meshLoaderMap:new Map,imgLoaderMap:new Map,registerMaterialLoader(r){ze.imgLoaderMap.set(r.dataType,r),r.info.author=r.info.author??wo.name},registerGeometryLoader(r){ze.demLoaderMap.set(r.dataType,r),r.info.author=r.info.author??wo.name},registerMeshLoader(r){ze.meshLoaderMap.set(r.dataType,r),r.info.author=r.info.author??wo.name},getMaterialLoader(r){const e=ze.imgLoaderMap.get(r.dataType);if(e)return e;throw`Source dataType "${r.dataType}" is not support!`},getGeometryLoader(r){const e=ze.demLoaderMap.get(r.dataType);if(e)return e;throw`Source dataType "${r.dataType}" is not support!`},getMeshLoader(r){const e=ze.meshLoaderMap.get(r.dataType);if(e)return e;throw`Source dataType "${r.dataType}" is not support!`}};var Ly=Object.defineProperty,Py=(r,e,t)=>e in r?Ly(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Cy=(r,e,t)=>Py(r,e+"",t);class Ty{constructor(e){Cy(this,"worker"),this.worker=e()}async run(e,t){return new Promise(i=>{this.worker.onmessage=n=>{i(n.data)},this.worker.postMessage(e,t)})}terminate(){this.worker.terminate()}}const Gy=4096,ch=Math.PI;function ra(r,e){const t=Math.floor(r[0]*e),i=Math.floor(r[1]*e),n=Math.floor((r[2]-r[0])*e),o=Math.floor((r[3]-r[1])*e);return{sx:t,sy:i,sw:n,sh:o}}function sa(r,e,t,i){if(i<r.minLevel)return{url:void 0,clipBounds:[0,0,1,1]};if(i<=r.maxLevel)return{url:r._getUrl(e,t,i),clipBounds:[0,0,1,1]};const n=Wy(e,t,i,r.maxLevel),o=n.parentNO;return{url:r._getUrl(o.x,o.y,o.z),clipBounds:n.bounds}}function Wy(r,e,t,i){const n=t-i,o={x:r>>n,y:e>>n,z:t-n},a=Math.pow(2,n),c=Math.pow(.5,n),h=r%a/a-.5+c/2,d=e%a/a-.5+c/2,m=new p.Vector2(h,d),f=new p.Box2().setFromCenterAndSize(m,new p.Vector2(c,c)),g=[f.min.x+.5,f.min.y+.5,f.max.x+.5,f.max.y+.5];return{parentNO:o,bounds:g}}function oa(r,e,t,i,n=Gy){const{x:o,y:a}=r,c=(e+o/n)/Math.pow(2,i),h=(t+a/n)/Math.pow(2,i),d=c*360-180,f=Math.atan(Math.sinh(ch*(1-2*h)))*180/ch;return[parseFloat(d.toFixed(8)),parseFloat(f.toFixed(8))]}function Zy(r,e,t,i){if(!r||!r.coordinates)throw new Error("无效的geometry数据格式");const n={type:r.type,coordinates:null};function o(a){if(typeof a=="object"&&a.x!==void 0&&a.y!==void 0)return oa(a,e,t,i);if(Array.isArray(a)&&a.length>0){const c=a[0];return typeof c=="object"&&c.x!==void 0&&c.y!==void 0?a.map(h=>oa(h,e,t,i)):a.map(h=>o(h))}return a}return n.coordinates=o(r.coordinates),n}var Vy=Object.defineProperty,Iy=(r,e,t)=>e in r?Vy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,xs=(r,e,t)=>Iy(r,typeof e!="symbol"?e+"":e,t);class Ms{constructor(){xs(this,"_imgSource",[]),xs(this,"_demSource"),xs(this,"_vtSource"),xs(this,"manager",ze.manager)}get imgSource(){return this._imgSource}set imgSource(e){this._imgSource=e}get demSource(){return this._demSource}set demSource(e){this._demSource=e}get vtSource(){return this._vtSource}set vtSource(e){this._vtSource=e}async load(e){const t=await this.loadGeometry(e),i=await this.loadMaterial(e);console.assert(!!i&&!!t);for(let n=0;n<i.length;n++)t.addGroup(0,1/0,n);return{materials:i,geometry:t}}unload(e){const t=e.material,i=e.geometry;for(let n=0;n<t.length;n++)t[n].dispose();i.dispose()}async loadGeometry(e){let t;if(this.demSource&&e.z>=this.demSource.minLevel&&this._isBoundsInSourceBounds(this.demSource,e.bounds)){const i=ze.getGeometryLoader(this.demSource),n=this.demSource;t=await i.load({source:n,...e}).catch(o=>(console.error("Load material error",n.dataType,e.x,e.y,e.z),new p.PlaneGeometry)),t.addEventListener("dispose",()=>{i.unload&&i.unload(t)})}else if(this.vtSource&&e.z>=this.vtSource.minLevel&&this._isBoundsInSourceBounds(this.vtSource,e.bounds)){const i=ze.getMeshLoader(this.vtSource),n=this.vtSource;t=await i.load({source:n,...e}).catch(o=>(console.error("Load geometry error",n.dataType,e.x,e.y,e.z),new p.PlaneGeometry)),t.addEventListener("dispose",()=>{i.unload&&i.unload(t)})}else t=new p.PlaneGeometry;return t}async loadMaterial(e){const i=this.imgSource.filter(n=>e.z>=n.minLevel&&this._isBoundsInSourceBounds(n,e.bounds)).map(async n=>{const o=ze.getMaterialLoader(n),a=await o.load({source:n,...e}).catch(h=>(console.error("Load material error",n.dataType,e.x,e.y,e.z),new p.MeshBasicMaterial)),c=h=>{o.unload&&o.unload(h.target),h.target.removeEventListener("dispose",c)};return a instanceof p.MeshBasicMaterial||a.addEventListener("dispose",c),a});return Promise.all(i)}_isBoundsInSourceBounds(e,t){const i=e._projectionBounds;return!(t[2]<i[0]||t[3]<i[1]||t[0]>i[2]||t[1]>i[3])}}function Gr(...r){const e=r,t=e&&e.length>1&&e[0].constructor||null;if(!t)throw new Error("concatenateTypedArrays - incorrect quantity of arguments or arguments have incompatible data types");const i=e.reduce((a,c)=>a+c.length,0),n=new t(i);let o=0;for(const a of e)n.set(a,o),o+=a.length;return n}function hh(r,e,t,i){const n=i?Fy(i,r.position.value):Ay(e),o=n.length,a=new Float32Array(o*6),c=new Float32Array(o*4),h=new e.constructor(o*6),d=new Float32Array(o*6);for(let f=0;f<o;f++)Oy({edge:n[f],edgeIndex:f,attributes:r,skirtHeight:t,newPosition:a,newTexcoord0:c,newTriangles:h,newNormals:d});r.position.value=Gr(r.position.value,a),r.texcoord.value=Gr(r.texcoord.value,c),r.normal.value=Gr(r.normal.value,d);const m=Gr(e,h);return{attributes:r,indices:m}}function Ay(r){const e=[],t=Array.isArray(r)?r:Array.from(r);for(let n=0;n<t.length;n+=3){const o=t[n],a=t[n+1],c=t[n+2];e.push([o,a],[a,c],[c,o])}e.sort(([n,o],[a,c])=>{const h=Math.min(n,o),d=Math.min(a,c);return h!==d?h-d:Math.max(n,o)-Math.max(a,c)});const i=[];for(let n=0;n<e.length;n++)n+1<e.length&&e[n][0]===e[n+1][1]&&e[n][1]===e[n+1][0]?n++:i.push(e[n]);return i}function Fy(r,e){const t=(n,o)=>{n.sort(o)};t(r.westIndices,(n,o)=>e[3*n+1]-e[3*o+1]),t(r.eastIndices,(n,o)=>e[3*o+1]-e[3*n+1]),t(r.southIndices,(n,o)=>e[3*o]-e[3*n]),t(r.northIndices,(n,o)=>e[3*n]-e[3*o]);const i=[];return Object.values(r).forEach(n=>{if(n.length>1)for(let o=0;o<n.length-1;o++)i.push([n[o],n[o+1]])}),i}function Oy({edge:r,edgeIndex:e,attributes:t,skirtHeight:i,newPosition:n,newTexcoord0:o,newTriangles:a,newNormals:c}){const h=t.position.value.length,d=e*2,m=d+1;n.set(t.position.value.subarray(r[0]*3,r[0]*3+3),d*3),n[d*3+2]=n[d*3+2]-i,n.set(t.position.value.subarray(r[1]*3,r[1]*3+3),m*3),n[m*3+2]=n[m*3+2]-i,o.set(t.texcoord.value.subarray(r[0]*2,r[0]*2+2),d*2),o.set(t.texcoord.value.subarray(r[1]*2,r[1]*2+2),m*2);const f=e*2*3;a[f]=r[0],a[f+1]=h/3+m,a[f+2]=r[1],a[f+3]=h/3+m,a[f+4]=r[0],a[f+5]=h/3+d,c[f]=0,c[f+1]=0,c[f+2]=1,c[f+3]=0,c[f+4]=0,c[f+5]=1}function uh(r){if(r.length<4)throw new Error(`DEM数组长度必须大于4,当前长度: ${r.length}!`);const e=Math.floor(Math.sqrt(r.length)),t=e,i=e,n=aa(i,t);return{attributes:Dy(r,i,t),indices:n}}function Dy(r,e,t){const i=t*e,n=new Float32Array(i*3),o=new Float32Array(i*2);let a=0;for(let c=0;c<e;c++)for(let h=0;h<t;h++){const d=h/(t-1),m=c/(e-1);o[a*2]=d,o[a*2+1]=m,n[a*3]=d-.5,n[a*3+1]=m-.5,n[a*3+2]=r[(e-c-1)*t+h],a++}return{position:{value:n,size:3},texcoord:{value:o,size:2},normal:{value:la(n,aa(e,t)),size:3}}}function aa(r,e){const t=6*(e-1)*(r-1),i=new Uint16Array(t);let n=0;for(let o=0;o<r-1;o++)for(let a=0;a<e-1;a++){const c=o*e+a,h=c+1,d=c+e,m=d+1,f=n*6;i[f]=c,i[f+1]=h,i[f+2]=d,i[f+3]=d,i[f+4]=h,i[f+5]=m,n++}return i}function la(r,e){const t=new Float32Array(r.length);for(let i=0;i<e.length;i+=3){const n=e[i]*3,o=e[i+1]*3,a=e[i+2]*3,c=r[n],h=r[n+1],d=r[n+2],m=r[o],f=r[o+1],g=r[o+2],v=r[a],w=r[a+1],b=r[a+2],x=m-c,L=f-h,M=g-d,C=v-c,W=w-h,z=b-d,D=L*z-M*W,X=M*C-x*z,I=x*W-L*C,K=Math.sqrt(D*D+X*X+I*I),V=[0,0,1];if(K>0){const G=1/K;V[0]=D*G,V[1]=X*G,V[2]=I*G}for(let G=0;G<3;G++)t[n+G]=t[o+G]=t[a+G]=V[G]}return t}var zy=Object.defineProperty,Xy=(r,e,t)=>e in r?zy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Uy=(r,e,t)=>Xy(r,e+"",t);class Kn extends p.PlaneGeometry{constructor(){super(...arguments),Uy(this,"type","TileGeometry")}setData(e,t=1e3){let i=e instanceof Float32Array?uh(e):e;i=hh(i.attributes,i.indices,t);const{attributes:n,indices:o}=i;return this.setIndex(new p.BufferAttribute(o,1)),this.setAttribute("position",new p.BufferAttribute(n.position.value,n.position.size)),this.setAttribute("uv",new p.BufferAttribute(n.texcoord.value,n.texcoord.size)),this.setAttribute("normal",new p.BufferAttribute(n.normal.value,n.normal.size)),this.computeBoundingBox(),this.computeBoundingSphere(),this}}var ky=Object.defineProperty,Ky=(r,e,t)=>e in r?ky(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ji=(r,e,t)=>Ky(r,typeof e!="symbol"?e+"":e,t);class dh{constructor(e=257){Ji(this,"gridSize"),Ji(this,"numTriangles"),Ji(this,"numParentTriangles"),Ji(this,"indices"),Ji(this,"coords"),this.gridSize=e;const t=e-1;if(t&t-1)throw new Error(`Expected grid size to be 2^n+1, got ${e}.`);this.numTriangles=t*t*2-2,this.numParentTriangles=this.numTriangles-t*t,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(this.numTriangles*4);for(let i=0;i<this.numTriangles;i++){let n=i+2,o=0,a=0,c=0,h=0,d=0,m=0;for(n&1?c=h=d=t:o=a=m=t;(n>>=1)>1;){const g=o+c>>1,v=a+h>>1;n&1?(c=o,h=a,o=d,a=m):(o=c,a=h,c=d,h=m),d=g,m=v}const f=i*4;this.coords[f+0]=o,this.coords[f+1]=a,this.coords[f+2]=c,this.coords[f+3]=h}}createTile(e){return new Ny(e,this)}}class Ny{constructor(e,t){Ji(this,"martini"),Ji(this,"terrain"),Ji(this,"errors");const i=t.gridSize;if(e.length!==i*i)throw new Error(`Expected terrain data of length ${i*i} (${i} x ${i}), got ${e.length}.`);this.terrain=e,this.martini=t,this.errors=new Float32Array(e.length),this.update()}update(){const{numTriangles:e,numParentTriangles:t,coords:i,gridSize:n}=this.martini,{terrain:o,errors:a}=this;for(let c=e-1;c>=0;c--){const h=c*4,d=i[h+0],m=i[h+1],f=i[h+2],g=i[h+3],v=d+f>>1,w=m+g>>1,b=v+w-m,x=w+d-v,L=(o[m*n+d]+o[g*n+f])/2,M=w*n+v,C=Math.abs(L-o[M]);if(a[M]=Math.max(a[M],C),c<t){const W=(m+x>>1)*n+(d+b>>1),z=(g+x>>1)*n+(f+b>>1);a[M]=Math.max(a[M],a[W],a[z])}}}getGeometryData(e=0){const{gridSize:t,indices:i}=this.martini,{errors:n}=this;let o=0,a=0;const c=t-1;let h,d,m=0;i.fill(0);function f(M,C,W,z,D,X){const I=M+W>>1,K=C+z>>1;Math.abs(M-D)+Math.abs(C-X)>1&&n[K*t+I]>e?(f(D,X,M,C,I,K),f(W,z,D,X,I,K)):(h=C*t+M,d=z*t+W,m=X*t+D,i[h]===0&&(i[h]=++o),i[d]===0&&(i[d]=++o),i[m]===0&&(i[m]=++o),a++)}f(0,0,c,c,c,0),f(c,c,0,0,0,c);const g=o*2,v=a*3,w=new Uint16Array(g),b=new Uint32Array(v);let x=0;function L(M,C,W,z,D,X){const I=M+W>>1,K=C+z>>1;if(Math.abs(M-D)+Math.abs(C-X)>1&&n[K*t+I]>e)L(D,X,M,C,I,K),L(W,z,D,X,I,K);else{const V=i[C*t+M]-1,G=i[z*t+W]-1,k=i[X*t+D]-1;w[2*V]=M,w[2*V+1]=C,w[2*G]=W,w[2*G+1]=z,w[2*k]=D,w[2*k+1]=X,b[x++]=V,b[x++]=G,b[x++]=k}}return L(0,0,c,c,c,0),L(c,c,0,0,0,c),{attributes:this._getMeshAttributes(this.terrain,w,b),indices:b}}_getMeshAttributes(e,t,i){const n=Math.floor(Math.sqrt(e.length)),o=n-1,a=t.length/2,c=new Float32Array(a*3),h=new Float32Array(a*2);for(let m=0;m<a;m++){const f=t[m*2],g=t[m*2+1],v=g*n+f;c[3*m+0]=f/o-.5,c[3*m+1]=.5-g/o,c[3*m+2]=e[v],h[2*m+0]=f/o,h[2*m+1]=1-g/o}const d=la(c,i);return{position:{value:c,size:3},texcoord:{value:h,size:2},normal:{value:d,size:3}}}}var By=Object.defineProperty,Yy=(r,e,t)=>e in r?By(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,fh=(r,e,t)=>Yy(r,typeof e!="symbol"?e+"":e,t);class ca{constructor(){fh(this,"info",{version:"0.10.0",description:"Terrain loader base class"}),fh(this,"dataType","")}async load(e){const{source:t,x:i,y:n,z:o}=e,{url:a,clipBounds:c}=sa(t,i,n,o);if(!a)return new Kn;const h=await this.doLoad(a,{source:t,x:i,y:n,z:o,bounds:c});return ze.manager.parseEnd(a),h}}class ha extends p.MeshStandardMaterial{constructor(e={}){super({transparent:!0,side:p.FrontSide,...e})}setTexture(e){this.map=e,this.needsUpdate=!0}dispose(){const e=this.map;e&&(e.image instanceof ImageBitmap&&e.image.close(),e.dispose())}}var nt=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.Linestring=2]="Linestring",r[r.Polygon=3]="Polygon",r))(nt||{});class ph{render(e,t,i,n,o=1){switch(e.lineCap="round",e.lineJoin="round",(n.shadowBlur??0)>0&&(e.shadowBlur=n.shadowBlur??2,e.shadowColor=n.shadowColor??"black",e.shadowOffsetX=n.shadowOffset?n.shadowOffset[0]:0,e.shadowOffsetY=n.shadowOffset?n.shadowOffset[1]:0),t){case nt.Point:e.textAlign="center",e.textBaseline="middle",e.font=n.font??"14px Arial",e.fillStyle=n.fontColor??"white",this._renderPointText(e,i,o,n.textField??"name",n.fontOffset??[0,-8]);break;case nt.Linestring:this._renderLineString(e,i,o);break;case nt.Polygon:this._renderPolygon(e,i,o);break;default:console.warn(`Unknown feature type: ${t}`)}(n.fill||t===nt.Point)&&(e.globalAlpha=n.fillOpacity||.5,e.fillStyle=n.fillColor||n.color||"#3388ff",e.fill(n.fillRule||"evenodd")),(n.stroke??!0)&&(n.weight??1)>0&&(e.globalAlpha=n.opacity||1,e.lineWidth=n.weight||1,e.strokeStyle=n.color||"#3388ff",e.setLineDash(n.dashArray||[]),e.stroke())}_renderPointText(e,t,i=1,n="name",o=[0,0]){const a=t.geometry;e.beginPath();for(const h of a)for(let d=0;d<h.length;d++){const m=h[d];e.arc(m.x*i,m.y*i,2,0,2*Math.PI)}const c=t.properties;c&&c[n]&&e.fillText(c[n],a[0][0].x*i+o[0],a[0][0].y*i+o[1])}_renderLineString(e,t,i){const n=t.geometry;e.beginPath();for(const o of n)for(let a=0;a<o.length;a++){const{x:c,y:h}=o[a];a===0?e.moveTo(c*i,h*i):e.lineTo(c*i,h*i)}}_renderPolygon(e,t,i){const n=t.geometry;e.beginPath();for(let o=0;o<n.length;o++){const a=n[o];for(let c=0;c<a.length;c++){const{x:h,y:d}=a[c];c===0?e.moveTo(h*i,d*i):e.lineTo(h*i,d*i)}e.closePath()}}}var Ry=Object.defineProperty,jy=(r,e,t)=>e in r?Ry(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,mh=(r,e,t)=>jy(r,typeof e!="symbol"?e+"":e,t);class ua{constructor(){mh(this,"info",{version:"0.10.0",description:"Image loader base class"}),mh(this,"dataType","")}async load(e){const{source:t,x:i,y:n,z:o}=e,a=new ha({}),{url:c,clipBounds:h}=sa(t,i,n,o);if(c){const d=await this.doLoad(c,{source:t,x:i,y:n,z:o,bounds:h});a.map=d,ze.manager.parseEnd(c)}return a}}var Jy=Object.defineProperty,Qy=(r,e,t)=>e in r?Jy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,gh=(r,e,t)=>Qy(r,typeof e!="symbol"?e+"":e,t);class Hy{constructor(){gh(this,"info",{version:"0.10.0",description:"Canvas tile abstract loader"}),gh(this,"dataType","")}async load(e){const t=this._creatCanvasContext(256,256);this.drawTile(t,e);const i=new p.CanvasTexture(t.canvas.transferToImageBitmap());return new ha({transparent:!0,map:i,opacity:e.source.opacity})}_creatCanvasContext(e,t){const n=new OffscreenCanvas(e,t).getContext("2d");if(!n)throw new Error("create canvas context failed");return n.scale(1,-1),n.translate(0,-t),n}}var Ey=Object.defineProperty,$y=(r,e,t)=>e in r?Ey(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,da=(r,e,t)=>$y(r,typeof e!="symbol"?e+"":e,t);class qy extends ua{constructor(){super(...arguments),da(this,"info",{version:"0.10.0",description:"Tile image loader. It can load xyz tile image."}),da(this,"dataType","image"),da(this,"loader",new p.ImageLoader(ze.manager))}async doLoad(e,t){const i=await this.loader.loadAsync(e).catch(a=>new Image(1,1)),n=new p.Texture;n.colorSpace=p.SRGBColorSpace;const{bounds:o}=t;return o[2]-o[0]<1?n.image=ev(i,o):n.image=i,n.needsUpdate=!0,n}}function ev(r,e){const t=r.width,i=new OffscreenCanvas(t,t),n=i.getContext("2d"),{sx:o,sy:a,sw:c,sh:h}=ra(e,r.width);return n.drawImage(r,o,a,c,h,0,0,t,t),i}const tv=`{
1123
1123
  "name": "@terra.gl/core",
1124
- "version": "0.0.1-alpha.64",
1124
+ "version": "0.0.1-alpha.65",
1125
1125
  "type": "module",
1126
1126
  "files": [
1127
1127
  "dist"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terra.gl/core",
3
- "version": "0.0.1-alpha.64",
3
+ "version": "0.0.1-alpha.65",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"