@gmgis/gm-sdk 2.0.2 → 2.0.3

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 (116) hide show
  1. package/README.md +15 -0
  2. package/dist/dist/index.js +1045 -105
  3. package/dist/gm.min.css +403 -1
  4. package/dist/gm.min.js +42327 -8214
  5. package/dist/index.js +1048 -108
  6. package/dist/resources/ThirdParty/Workers/zip-web-worker.js +1 -0
  7. package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +1 -1
  8. package/dist/resources/ThirdParty/zip-module.wasm +0 -0
  9. package/dist/resources/Workers/{chunk-GILIDQNQ.js → chunk-25COWEQA.js} +2 -2
  10. package/dist/resources/Workers/{chunk-CYCB63OH.js → chunk-26456K5W.js} +2 -2
  11. package/dist/resources/Workers/{chunk-QOUAJ6TL.js → chunk-26UHRUB3.js} +2 -2
  12. package/dist/resources/Workers/{chunk-ARG42DC4.js → chunk-2SWT6U6X.js} +2 -2
  13. package/dist/resources/Workers/{chunk-FEVXJ54I.js → chunk-36M4VMOA.js} +2 -2
  14. package/dist/resources/Workers/{chunk-B4AA3ARO.js → chunk-5YOHHDAP.js} +2 -2
  15. package/dist/resources/Workers/{chunk-3W4GT7KQ.js → chunk-6B3DM6A5.js} +2 -2
  16. package/dist/resources/Workers/{chunk-VW6VD53G.js → chunk-6VRQKJFS.js} +2 -2
  17. package/dist/resources/Workers/{chunk-G5AGHVVC.js → chunk-7ZWGKBJM.js} +2 -2
  18. package/dist/resources/Workers/{chunk-5YEWO3HT.js → chunk-BJLHCYRK.js} +2 -2
  19. package/dist/resources/Workers/{chunk-EZUYS2JF.js → chunk-CAW5BE2L.js} +2 -2
  20. package/dist/resources/Workers/{chunk-HTFSEEMT.js → chunk-CKDBE4RR.js} +2 -2
  21. package/dist/resources/Workers/{chunk-OSW76XDF.js → chunk-DGHOUIXA.js} +1 -1
  22. package/dist/resources/Workers/{chunk-U4IEOH5K.js → chunk-DYQOAIKX.js} +2 -2
  23. package/dist/resources/Workers/{chunk-WGGIH7QW.js → chunk-ELLIJ4U5.js} +2 -2
  24. package/dist/resources/Workers/{chunk-N4VJKXZS.js → chunk-EOYPFHZC.js} +2 -2
  25. package/dist/resources/Workers/{chunk-D6AA5QVT.js → chunk-FCCJEZP2.js} +2 -2
  26. package/dist/resources/Workers/{chunk-7HTKERZY.js → chunk-FMVDP5JE.js} +2 -2
  27. package/dist/resources/Workers/{chunk-HWXX4CWK.js → chunk-FV4VKA33.js} +2 -2
  28. package/dist/resources/Workers/{chunk-OFUUQVMR.js → chunk-GCWYQAXJ.js} +2 -2
  29. package/dist/resources/Workers/{chunk-NB3ML6JO.js → chunk-GXNQF252.js} +2 -2
  30. package/dist/resources/Workers/{chunk-77IHZJJ3.js → chunk-HER2H3SF.js} +2 -2
  31. package/dist/resources/Workers/{chunk-DEPHB2WM.js → chunk-HICISBVP.js} +2 -2
  32. package/dist/resources/Workers/{chunk-AJYK4IVJ.js → chunk-HJOLI3MG.js} +2 -2
  33. package/dist/resources/Workers/{chunk-64RSHJUE.js → chunk-HMXGNDLA.js} +2 -2
  34. package/dist/resources/Workers/{chunk-M3MGYQSL.js → chunk-IH2J72GH.js} +1 -1
  35. package/dist/resources/Workers/{chunk-WWA5PL4H.js → chunk-ITVLZS5V.js} +2 -2
  36. package/dist/resources/Workers/{chunk-GBYLG25F.js → chunk-IXYLEDPQ.js} +1 -1
  37. package/dist/resources/Workers/{chunk-4IW2T6GF.js → chunk-KWW52NRT.js} +2 -2
  38. package/dist/resources/Workers/{chunk-D6C66QON.js → chunk-L2JANGOZ.js} +2 -2
  39. package/dist/resources/Workers/{chunk-QN3VOORQ.js → chunk-L6XQ7EEU.js} +2 -2
  40. package/dist/resources/Workers/chunk-MLHVWID2.js +26 -0
  41. package/dist/resources/Workers/{chunk-VTAIKJXX.js → chunk-NVZ5L4JK.js} +1 -1
  42. package/dist/resources/Workers/{chunk-UP6I5URU.js → chunk-PABIYHEA.js} +2 -2
  43. package/dist/resources/Workers/{chunk-XRL4AVS5.js → chunk-PKPGT5QI.js} +2 -2
  44. package/dist/resources/Workers/{chunk-ED5JPB3S.js → chunk-Q2UJZ7OW.js} +2 -2
  45. package/dist/resources/Workers/{chunk-A56XVLQR.js → chunk-QND5YPLT.js} +2 -2
  46. package/dist/resources/Workers/{chunk-J6UP6FLE.js → chunk-QXY3EU54.js} +1 -1
  47. package/dist/resources/Workers/{chunk-DQQ63PYM.js → chunk-RZMWEK2K.js} +2 -2
  48. package/dist/resources/Workers/chunk-S2E5UWT4.js +66 -0
  49. package/dist/resources/Workers/{chunk-LEYMRMBK.js → chunk-U7V5VQ2T.js} +2 -2
  50. package/dist/resources/Workers/{chunk-RCV6KWXS.js → chunk-UHBRQJNJ.js} +2 -2
  51. package/dist/resources/Workers/{chunk-HMIYSTF6.js → chunk-USMMQPEU.js} +2 -2
  52. package/dist/resources/Workers/{chunk-3SSKC3VN.js → chunk-V7XA5C77.js} +2 -2
  53. package/dist/resources/Workers/{chunk-DMEY62ID.js → chunk-VPIAW7TM.js} +2 -2
  54. package/dist/resources/Workers/{chunk-TCGIRNHN.js → chunk-VSL3QDZM.js} +2 -2
  55. package/dist/resources/Workers/{chunk-IYTZ52EY.js → chunk-W6PQQSH7.js} +2 -2
  56. package/dist/resources/Workers/{chunk-AU7IKHOH.js → chunk-XNSUDY5I.js} +2 -2
  57. package/dist/resources/Workers/{chunk-37F5JSTI.js → chunk-YALWINTL.js} +2 -2
  58. package/dist/resources/Workers/{chunk-VTBDSFTG.js → chunk-YES4UTDW.js} +2 -2
  59. package/dist/resources/Workers/{chunk-WZDE3RYP.js → chunk-ZR45J7LY.js} +2 -2
  60. package/dist/resources/Workers/{chunk-CNCV5UL7.js → chunk-ZYCILUCF.js} +2 -2
  61. package/dist/resources/Workers/combineGeometry.js +2 -2
  62. package/dist/resources/Workers/createBoxGeometry.js +2 -2
  63. package/dist/resources/Workers/createBoxOutlineGeometry.js +2 -2
  64. package/dist/resources/Workers/createCircleGeometry.js +2 -2
  65. package/dist/resources/Workers/createCircleOutlineGeometry.js +2 -2
  66. package/dist/resources/Workers/createCoplanarPolygonGeometry.js +2 -2
  67. package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +2 -2
  68. package/dist/resources/Workers/createCorridorGeometry.js +2 -2
  69. package/dist/resources/Workers/createCorridorOutlineGeometry.js +2 -2
  70. package/dist/resources/Workers/createCylinderGeometry.js +2 -2
  71. package/dist/resources/Workers/createCylinderOutlineGeometry.js +2 -2
  72. package/dist/resources/Workers/createEllipseGeometry.js +2 -2
  73. package/dist/resources/Workers/createEllipseOutlineGeometry.js +2 -2
  74. package/dist/resources/Workers/createEllipsoidGeometry.js +2 -2
  75. package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +2 -2
  76. package/dist/resources/Workers/createFrustumGeometry.js +2 -2
  77. package/dist/resources/Workers/createFrustumOutlineGeometry.js +2 -2
  78. package/dist/resources/Workers/createGeometry.js +2 -2
  79. package/dist/resources/Workers/createGroundPolylineGeometry.js +2 -2
  80. package/dist/resources/Workers/createPlaneGeometry.js +2 -2
  81. package/dist/resources/Workers/createPlaneOutlineGeometry.js +2 -2
  82. package/dist/resources/Workers/createPolygonGeometry.js +2 -2
  83. package/dist/resources/Workers/createPolygonOutlineGeometry.js +2 -2
  84. package/dist/resources/Workers/createPolylineGeometry.js +2 -2
  85. package/dist/resources/Workers/createPolylineVolumeGeometry.js +2 -2
  86. package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +2 -2
  87. package/dist/resources/Workers/createRectangleGeometry.js +2 -2
  88. package/dist/resources/Workers/createRectangleOutlineGeometry.js +2 -2
  89. package/dist/resources/Workers/createSimplePolylineGeometry.js +2 -2
  90. package/dist/resources/Workers/createSphereGeometry.js +2 -2
  91. package/dist/resources/Workers/createSphereOutlineGeometry.js +2 -2
  92. package/dist/resources/Workers/createTaskProcessorWorker.js +2 -2
  93. package/dist/resources/Workers/createVectorTileClampedPolylines.js +2 -2
  94. package/dist/resources/Workers/createVectorTileGeometries.js +2 -2
  95. package/dist/resources/Workers/createVectorTilePoints.js +2 -2
  96. package/dist/resources/Workers/createVectorTilePolygons.js +2 -2
  97. package/dist/resources/Workers/createVectorTilePolylines.js +2 -2
  98. package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -2
  99. package/dist/resources/Workers/createVerticesFromHeightmap.js +2 -2
  100. package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -2
  101. package/dist/resources/Workers/createWallGeometry.js +2 -2
  102. package/dist/resources/Workers/createWallOutlineGeometry.js +2 -2
  103. package/dist/resources/Workers/decodeDraco.js +2 -2
  104. package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2
  105. package/dist/resources/Workers/decodeI3S.js +2 -2
  106. package/dist/resources/Workers/gaussianSplatSorter.js +2 -2
  107. package/dist/resources/Workers/gaussianSplatTextureGenerator.js +2 -2
  108. package/dist/resources/Workers/transcodeKTX2.js +19 -19
  109. package/dist/resources/Workers/transferTypedArrayTest.js +1 -1
  110. package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +2 -2
  111. package/package.json +10 -4
  112. package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +0 -1
  113. package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +0 -1
  114. package/dist/resources/ThirdParty/Workers/z-worker-pako.js +0 -1
  115. package/dist/resources/Workers/chunk-35SHYARM.js +0 -26
  116. package/dist/resources/Workers/chunk-PSPPBZWI.js +0 -66
@@ -1,18 +1,18 @@
1
- var ig=Object.create;var ji=Object.defineProperty;var rg=Object.getOwnPropertyDescriptor;var sg=Object.getOwnPropertyNames;var og=Object.getPrototypeOf,ag=Object.prototype.hasOwnProperty;var ng=(a,e,t)=>e in a?ji(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var b=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports);var lg=(a,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of sg(e))!ag.call(a,s)&&s!==t&&ji(a,s,{get:()=>e[s],enumerable:!(r=rg(e,s))||r.enumerable});return a};var hg=(a,e,t)=>(t=a!=null?ig(og(a)):{},lg(e||!a||!a.__esModule?ji(t,"default",{value:a,enumerable:!0}):t,a));var qi=(a,e,t)=>(ng(a,typeof e!="symbol"?e+"":e,t),t);var Hh=b((q4,Nh)=>{function py(){this.__data__=[],this.size=0}Nh.exports=py});var so=b((Z4,Wh)=>{function dy(a,e){return a===e||a!==a&&e!==e}Wh.exports=dy});var ct=b((Y4,Gh)=>{var my=so();function uy(a,e){for(var t=a.length;t--;)if(my(a[t][0],e))return t;return-1}Gh.exports=uy});var Bh=b((X4,Uh)=>{var _y=ct(),fy=Array.prototype,gy=fy.splice;function yy(a){var e=this.__data__,t=_y(e,a);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():gy.call(e,t,1),--this.size,!0}Uh.exports=yy});var jh=b((J4,Vh)=>{var vy=ct();function wy(a){var e=this.__data__,t=vy(e,a);return t<0?void 0:e[t][1]}Vh.exports=wy});var Zh=b((K4,qh)=>{var Cy=ct();function xy(a){return Cy(this.__data__,a)>-1}qh.exports=xy});var Xh=b((Q4,Yh)=>{var Ty=ct();function Ey(a,e){var t=this.__data__,r=Ty(t,a);return r<0?(++this.size,t.push([a,e])):t[r][1]=e,this}Yh.exports=Ey});var pt=b(($4,Jh)=>{var Py=Hh(),by=Bh(),Ay=jh(),My=Zh(),Iy=Xh();function Be(a){var e=-1,t=a==null?0:a.length;for(this.clear();++e<t;){var r=a[e];this.set(r[0],r[1])}}Be.prototype.clear=Py;Be.prototype.delete=by;Be.prototype.get=Ay;Be.prototype.has=My;Be.prototype.set=Iy;Jh.exports=Be});var Qh=b((eR,Kh)=>{var Sy=pt();function Dy(){this.__data__=new Sy,this.size=0}Kh.exports=Dy});var ec=b((tR,$h)=>{function Ly(a){var e=this.__data__,t=e.delete(a);return this.size=e.size,t}$h.exports=Ly});var ic=b((iR,tc)=>{function Ry(a){return this.__data__.get(a)}tc.exports=Ry});var sc=b((rR,rc)=>{function Oy(a){return this.__data__.has(a)}rc.exports=Oy});var oo=b((sR,oc)=>{var ky=typeof global=="object"&&global&&global.Object===Object&&global;oc.exports=ky});var pe=b((oR,ac)=>{var Fy=oo(),zy=typeof self=="object"&&self&&self.Object===Object&&self,Ny=Fy||zy||Function("return this")();ac.exports=Ny});var Ut=b((aR,nc)=>{var Hy=pe(),Wy=Hy.Symbol;nc.exports=Wy});var pc=b((nR,cc)=>{var lc=Ut(),hc=Object.prototype,Gy=hc.hasOwnProperty,Uy=hc.toString,dt=lc?lc.toStringTag:void 0;function By(a){var e=Gy.call(a,dt),t=a[dt];try{a[dt]=void 0;var r=!0}catch{}var s=Uy.call(a);return r&&(e?a[dt]=t:delete a[dt]),s}cc.exports=By});var mc=b((lR,dc)=>{var Vy=Object.prototype,jy=Vy.toString;function qy(a){return jy.call(a)}dc.exports=qy});var mt=b((hR,fc)=>{var uc=Ut(),Zy=pc(),Yy=mc(),Xy="[object Null]",Jy="[object Undefined]",_c=uc?uc.toStringTag:void 0;function Ky(a){return a==null?a===void 0?Jy:Xy:_c&&_c in Object(a)?Zy(a):Yy(a)}fc.exports=Ky});var Ve=b((cR,gc)=>{function Qy(a){var e=typeof a;return a!=null&&(e=="object"||e=="function")}gc.exports=Qy});var ao=b((pR,yc)=>{var $y=mt(),e0=Ve(),t0="[object AsyncFunction]",i0="[object Function]",r0="[object GeneratorFunction]",s0="[object Proxy]";function o0(a){if(!e0(a))return!1;var e=$y(a);return e==i0||e==r0||e==t0||e==s0}yc.exports=o0});var wc=b((dR,vc)=>{var a0=pe(),n0=a0["__core-js_shared__"];vc.exports=n0});var Tc=b((mR,xc)=>{var no=wc(),Cc=function(){var a=/[^.]+$/.exec(no&&no.keys&&no.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}();function l0(a){return!!Cc&&Cc in a}xc.exports=l0});var lo=b((uR,Ec)=>{var h0=Function.prototype,c0=h0.toString;function p0(a){if(a!=null){try{return c0.call(a)}catch{}try{return a+""}catch{}}return""}Ec.exports=p0});var bc=b((_R,Pc)=>{var d0=ao(),m0=Tc(),u0=Ve(),_0=lo(),f0=/[\\^$.*+?()[\]{}|]/g,g0=/^\[object .+?Constructor\]$/,y0=Function.prototype,v0=Object.prototype,w0=y0.toString,C0=v0.hasOwnProperty,x0=RegExp("^"+w0.call(C0).replace(f0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function T0(a){if(!u0(a)||m0(a))return!1;var e=d0(a)?x0:g0;return e.test(_0(a))}Pc.exports=T0});var Mc=b((fR,Ac)=>{function E0(a,e){return a==null?void 0:a[e]}Ac.exports=E0});var Ae=b((gR,Ic)=>{var P0=bc(),b0=Mc();function A0(a,e){var t=b0(a,e);return P0(t)?t:void 0}Ic.exports=A0});var Bt=b((yR,Sc)=>{var M0=Ae(),I0=pe(),S0=M0(I0,"Map");Sc.exports=S0});var ut=b((vR,Dc)=>{var D0=Ae(),L0=D0(Object,"create");Dc.exports=L0});var Oc=b((wR,Rc)=>{var Lc=ut();function R0(){this.__data__=Lc?Lc(null):{},this.size=0}Rc.exports=R0});var Fc=b((CR,kc)=>{function O0(a){var e=this.has(a)&&delete this.__data__[a];return this.size-=e?1:0,e}kc.exports=O0});var Nc=b((xR,zc)=>{var k0=ut(),F0="__lodash_hash_undefined__",z0=Object.prototype,N0=z0.hasOwnProperty;function H0(a){var e=this.__data__;if(k0){var t=e[a];return t===F0?void 0:t}return N0.call(e,a)?e[a]:void 0}zc.exports=H0});var Wc=b((TR,Hc)=>{var W0=ut(),G0=Object.prototype,U0=G0.hasOwnProperty;function B0(a){var e=this.__data__;return W0?e[a]!==void 0:U0.call(e,a)}Hc.exports=B0});var Uc=b((ER,Gc)=>{var V0=ut(),j0="__lodash_hash_undefined__";function q0(a,e){var t=this.__data__;return this.size+=this.has(a)?0:1,t[a]=V0&&e===void 0?j0:e,this}Gc.exports=q0});var Vc=b((PR,Bc)=>{var Z0=Oc(),Y0=Fc(),X0=Nc(),J0=Wc(),K0=Uc();function je(a){var e=-1,t=a==null?0:a.length;for(this.clear();++e<t;){var r=a[e];this.set(r[0],r[1])}}je.prototype.clear=Z0;je.prototype.delete=Y0;je.prototype.get=X0;je.prototype.has=J0;je.prototype.set=K0;Bc.exports=je});var Zc=b((bR,qc)=>{var jc=Vc(),Q0=pt(),$0=Bt();function ev(){this.size=0,this.__data__={hash:new jc,map:new($0||Q0),string:new jc}}qc.exports=ev});var Xc=b((AR,Yc)=>{function tv(a){var e=typeof a;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?a!=="__proto__":a===null}Yc.exports=tv});var _t=b((MR,Jc)=>{var iv=Xc();function rv(a,e){var t=a.__data__;return iv(e)?t[typeof e=="string"?"string":"hash"]:t.map}Jc.exports=rv});var Qc=b((IR,Kc)=>{var sv=_t();function ov(a){var e=sv(this,a).delete(a);return this.size-=e?1:0,e}Kc.exports=ov});var ep=b((SR,$c)=>{var av=_t();function nv(a){return av(this,a).get(a)}$c.exports=nv});var ip=b((DR,tp)=>{var lv=_t();function hv(a){return lv(this,a).has(a)}tp.exports=hv});var sp=b((LR,rp)=>{var cv=_t();function pv(a,e){var t=cv(this,a),r=t.size;return t.set(a,e),this.size+=t.size==r?0:1,this}rp.exports=pv});var ap=b((RR,op)=>{var dv=Zc(),mv=Qc(),uv=ep(),_v=ip(),fv=sp();function qe(a){var e=-1,t=a==null?0:a.length;for(this.clear();++e<t;){var r=a[e];this.set(r[0],r[1])}}qe.prototype.clear=dv;qe.prototype.delete=mv;qe.prototype.get=uv;qe.prototype.has=_v;qe.prototype.set=fv;op.exports=qe});var lp=b((OR,np)=>{var gv=pt(),yv=Bt(),vv=ap(),wv=200;function Cv(a,e){var t=this.__data__;if(t instanceof gv){var r=t.__data__;if(!yv||r.length<wv-1)return r.push([a,e]),this.size=++t.size,this;t=this.__data__=new vv(r)}return t.set(a,e),this.size=t.size,this}np.exports=Cv});var cp=b((kR,hp)=>{var xv=pt(),Tv=Qh(),Ev=ec(),Pv=ic(),bv=sc(),Av=lp();function Ze(a){var e=this.__data__=new xv(a);this.size=e.size}Ze.prototype.clear=Tv;Ze.prototype.delete=Ev;Ze.prototype.get=Pv;Ze.prototype.has=bv;Ze.prototype.set=Av;hp.exports=Ze});var dp=b((FR,pp)=>{function Mv(a,e){for(var t=-1,r=a==null?0:a.length;++t<r&&e(a[t],t,a)!==!1;);return a}pp.exports=Mv});var up=b((zR,mp)=>{var Iv=Ae(),Sv=function(){try{var a=Iv(Object,"defineProperty");return a({},"",{}),a}catch{}}();mp.exports=Sv});var ho=b((NR,fp)=>{var _p=up();function Dv(a,e,t){e=="__proto__"&&_p?_p(a,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):a[e]=t}fp.exports=Dv});var co=b((HR,gp)=>{var Lv=ho(),Rv=so(),Ov=Object.prototype,kv=Ov.hasOwnProperty;function Fv(a,e,t){var r=a[e];(!(kv.call(a,e)&&Rv(r,t))||t===void 0&&!(e in a))&&Lv(a,e,t)}gp.exports=Fv});var ft=b((WR,yp)=>{var zv=co(),Nv=ho();function Hv(a,e,t,r){var s=!t;t||(t={});for(var o=-1,n=e.length;++o<n;){var l=e[o],h=r?r(t[l],a[l],l,t,a):void 0;h===void 0&&(h=a[l]),s?Nv(t,l,h):zv(t,l,h)}return t}yp.exports=Hv});var wp=b((GR,vp)=>{function Wv(a,e){for(var t=-1,r=Array(a);++t<a;)r[t]=e(t);return r}vp.exports=Wv});var Ye=b((UR,Cp)=>{function Gv(a){return a!=null&&typeof a=="object"}Cp.exports=Gv});var Tp=b((BR,xp)=>{var Uv=mt(),Bv=Ye(),Vv="[object Arguments]";function jv(a){return Bv(a)&&Uv(a)==Vv}xp.exports=jv});var Ap=b((VR,bp)=>{var Ep=Tp(),qv=Ye(),Pp=Object.prototype,Zv=Pp.hasOwnProperty,Yv=Pp.propertyIsEnumerable,Xv=Ep(function(){return arguments}())?Ep:function(a){return qv(a)&&Zv.call(a,"callee")&&!Yv.call(a,"callee")};bp.exports=Xv});var Vt=b((jR,Mp)=>{var Jv=Array.isArray;Mp.exports=Jv});var Sp=b((qR,Ip)=>{function Kv(){return!1}Ip.exports=Kv});var po=b((gt,Xe)=>{var Qv=pe(),$v=Sp(),Rp=typeof gt=="object"&&gt&&!gt.nodeType&&gt,Dp=Rp&&typeof Xe=="object"&&Xe&&!Xe.nodeType&&Xe,ew=Dp&&Dp.exports===Rp,Lp=ew?Qv.Buffer:void 0,tw=Lp?Lp.isBuffer:void 0,iw=tw||$v;Xe.exports=iw});var kp=b((ZR,Op)=>{var rw=9007199254740991,sw=/^(?:0|[1-9]\d*)$/;function ow(a,e){var t=typeof a;return e=e==null?rw:e,!!e&&(t=="number"||t!="symbol"&&sw.test(a))&&a>-1&&a%1==0&&a<e}Op.exports=ow});var mo=b((YR,Fp)=>{var aw=9007199254740991;function nw(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=aw}Fp.exports=nw});var Np=b((XR,zp)=>{var lw=mt(),hw=mo(),cw=Ye(),pw="[object Arguments]",dw="[object Array]",mw="[object Boolean]",uw="[object Date]",_w="[object Error]",fw="[object Function]",gw="[object Map]",yw="[object Number]",vw="[object Object]",ww="[object RegExp]",Cw="[object Set]",xw="[object String]",Tw="[object WeakMap]",Ew="[object ArrayBuffer]",Pw="[object DataView]",bw="[object Float32Array]",Aw="[object Float64Array]",Mw="[object Int8Array]",Iw="[object Int16Array]",Sw="[object Int32Array]",Dw="[object Uint8Array]",Lw="[object Uint8ClampedArray]",Rw="[object Uint16Array]",Ow="[object Uint32Array]",G={};G[bw]=G[Aw]=G[Mw]=G[Iw]=G[Sw]=G[Dw]=G[Lw]=G[Rw]=G[Ow]=!0;G[pw]=G[dw]=G[Ew]=G[mw]=G[Pw]=G[uw]=G[_w]=G[fw]=G[gw]=G[yw]=G[vw]=G[ww]=G[Cw]=G[xw]=G[Tw]=!1;function kw(a){return cw(a)&&hw(a.length)&&!!G[lw(a)]}zp.exports=kw});var jt=b((JR,Hp)=>{function Fw(a){return function(e){return a(e)}}Hp.exports=Fw});var qt=b((yt,Je)=>{var zw=oo(),Wp=typeof yt=="object"&&yt&&!yt.nodeType&&yt,vt=Wp&&typeof Je=="object"&&Je&&!Je.nodeType&&Je,Nw=vt&&vt.exports===Wp,uo=Nw&&zw.process,Hw=function(){try{var a=vt&&vt.require&&vt.require("util").types;return a||uo&&uo.binding&&uo.binding("util")}catch{}}();Je.exports=Hw});var Vp=b((KR,Bp)=>{var Ww=Np(),Gw=jt(),Gp=qt(),Up=Gp&&Gp.isTypedArray,Uw=Up?Gw(Up):Ww;Bp.exports=Uw});var _o=b((QR,jp)=>{var Bw=wp(),Vw=Ap(),jw=Vt(),qw=po(),Zw=kp(),Yw=Vp(),Xw=Object.prototype,Jw=Xw.hasOwnProperty;function Kw(a,e){var t=jw(a),r=!t&&Vw(a),s=!t&&!r&&qw(a),o=!t&&!r&&!s&&Yw(a),n=t||r||s||o,l=n?Bw(a.length,String):[],h=l.length;for(var c in a)(e||Jw.call(a,c))&&!(n&&(c=="length"||s&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Zw(c,h)))&&l.push(c);return l}jp.exports=Kw});var Zt=b(($R,qp)=>{var Qw=Object.prototype;function $w(a){var e=a&&a.constructor,t=typeof e=="function"&&e.prototype||Qw;return a===t}qp.exports=$w});var fo=b((eO,Zp)=>{function e1(a,e){return function(t){return a(e(t))}}Zp.exports=e1});var Xp=b((tO,Yp)=>{var t1=fo(),i1=t1(Object.keys,Object);Yp.exports=i1});var Kp=b((iO,Jp)=>{var r1=Zt(),s1=Xp(),o1=Object.prototype,a1=o1.hasOwnProperty;function n1(a){if(!r1(a))return s1(a);var e=[];for(var t in Object(a))a1.call(a,t)&&t!="constructor"&&e.push(t);return e}Jp.exports=n1});var go=b((rO,Qp)=>{var l1=ao(),h1=mo();function c1(a){return a!=null&&h1(a.length)&&!l1(a)}Qp.exports=c1});var Yt=b((sO,$p)=>{var p1=_o(),d1=Kp(),m1=go();function u1(a){return m1(a)?p1(a):d1(a)}$p.exports=u1});var td=b((oO,ed)=>{var _1=ft(),f1=Yt();function g1(a,e){return a&&_1(e,f1(e),a)}ed.exports=g1});var rd=b((aO,id)=>{function y1(a){var e=[];if(a!=null)for(var t in Object(a))e.push(t);return e}id.exports=y1});var od=b((nO,sd)=>{var v1=Ve(),w1=Zt(),C1=rd(),x1=Object.prototype,T1=x1.hasOwnProperty;function E1(a){if(!v1(a))return C1(a);var e=w1(a),t=[];for(var r in a)r=="constructor"&&(e||!T1.call(a,r))||t.push(r);return t}sd.exports=E1});var Xt=b((lO,ad)=>{var P1=_o(),b1=od(),A1=go();function M1(a){return A1(a)?P1(a,!0):b1(a)}ad.exports=M1});var ld=b((hO,nd)=>{var I1=ft(),S1=Xt();function D1(a,e){return a&&I1(e,S1(e),a)}nd.exports=D1});var md=b((wt,Ke)=>{var L1=pe(),dd=typeof wt=="object"&&wt&&!wt.nodeType&&wt,hd=dd&&typeof Ke=="object"&&Ke&&!Ke.nodeType&&Ke,R1=hd&&hd.exports===dd,cd=R1?L1.Buffer:void 0,pd=cd?cd.allocUnsafe:void 0;function O1(a,e){if(e)return a.slice();var t=a.length,r=pd?pd(t):new a.constructor(t);return a.copy(r),r}Ke.exports=O1});var _d=b((cO,ud)=>{function k1(a,e){var t=-1,r=a.length;for(e||(e=Array(r));++t<r;)e[t]=a[t];return e}ud.exports=k1});var gd=b((pO,fd)=>{function F1(a,e){for(var t=-1,r=a==null?0:a.length,s=0,o=[];++t<r;){var n=a[t];e(n,t,a)&&(o[s++]=n)}return o}fd.exports=F1});var yo=b((dO,yd)=>{function z1(){return[]}yd.exports=z1});var Jt=b((mO,wd)=>{var N1=gd(),H1=yo(),W1=Object.prototype,G1=W1.propertyIsEnumerable,vd=Object.getOwnPropertySymbols,U1=vd?function(a){return a==null?[]:(a=Object(a),N1(vd(a),function(e){return G1.call(a,e)}))}:H1;wd.exports=U1});var xd=b((uO,Cd)=>{var B1=ft(),V1=Jt();function j1(a,e){return B1(a,V1(a),e)}Cd.exports=j1});var vo=b((_O,Td)=>{function q1(a,e){for(var t=-1,r=e.length,s=a.length;++t<r;)a[s+t]=e[t];return a}Td.exports=q1});var wo=b((fO,Ed)=>{var Z1=fo(),Y1=Z1(Object.getPrototypeOf,Object);Ed.exports=Y1});var Co=b((gO,Pd)=>{var X1=vo(),J1=wo(),K1=Jt(),Q1=yo(),$1=Object.getOwnPropertySymbols,eC=$1?function(a){for(var e=[];a;)X1(e,K1(a)),a=J1(a);return e}:Q1;Pd.exports=eC});var Ad=b((yO,bd)=>{var tC=ft(),iC=Co();function rC(a,e){return tC(a,iC(a),e)}bd.exports=rC});var xo=b((vO,Md)=>{var sC=vo(),oC=Vt();function aC(a,e,t){var r=e(a);return oC(a)?r:sC(r,t(a))}Md.exports=aC});var Sd=b((wO,Id)=>{var nC=xo(),lC=Jt(),hC=Yt();function cC(a){return nC(a,hC,lC)}Id.exports=cC});var Ld=b((CO,Dd)=>{var pC=xo(),dC=Co(),mC=Xt();function uC(a){return pC(a,mC,dC)}Dd.exports=uC});var Od=b((xO,Rd)=>{var _C=Ae(),fC=pe(),gC=_C(fC,"DataView");Rd.exports=gC});var Fd=b((TO,kd)=>{var yC=Ae(),vC=pe(),wC=yC(vC,"Promise");kd.exports=wC});var Nd=b((EO,zd)=>{var CC=Ae(),xC=pe(),TC=CC(xC,"Set");zd.exports=TC});var Wd=b((PO,Hd)=>{var EC=Ae(),PC=pe(),bC=EC(PC,"WeakMap");Hd.exports=bC});var Kt=b((bO,Zd)=>{var To=Od(),Eo=Bt(),Po=Fd(),bo=Nd(),Ao=Wd(),qd=mt(),Qe=lo(),Gd="[object Map]",AC="[object Object]",Ud="[object Promise]",Bd="[object Set]",Vd="[object WeakMap]",jd="[object DataView]",MC=Qe(To),IC=Qe(Eo),SC=Qe(Po),DC=Qe(bo),LC=Qe(Ao),Fe=qd;(To&&Fe(new To(new ArrayBuffer(1)))!=jd||Eo&&Fe(new Eo)!=Gd||Po&&Fe(Po.resolve())!=Ud||bo&&Fe(new bo)!=Bd||Ao&&Fe(new Ao)!=Vd)&&(Fe=function(a){var e=qd(a),t=e==AC?a.constructor:void 0,r=t?Qe(t):"";if(r)switch(r){case MC:return jd;case IC:return Gd;case SC:return Ud;case DC:return Bd;case LC:return Vd}return e});Zd.exports=Fe});var Xd=b((AO,Yd)=>{var RC=Object.prototype,OC=RC.hasOwnProperty;function kC(a){var e=a.length,t=new a.constructor(e);return e&&typeof a[0]=="string"&&OC.call(a,"index")&&(t.index=a.index,t.input=a.input),t}Yd.exports=kC});var Kd=b((MO,Jd)=>{var FC=pe(),zC=FC.Uint8Array;Jd.exports=zC});var Qt=b((IO,$d)=>{var Qd=Kd();function NC(a){var e=new a.constructor(a.byteLength);return new Qd(e).set(new Qd(a)),e}$d.exports=NC});var tm=b((SO,em)=>{var HC=Qt();function WC(a,e){var t=e?HC(a.buffer):a.buffer;return new a.constructor(t,a.byteOffset,a.byteLength)}em.exports=WC});var rm=b((DO,im)=>{var GC=/\w*$/;function UC(a){var e=new a.constructor(a.source,GC.exec(a));return e.lastIndex=a.lastIndex,e}im.exports=UC});var lm=b((LO,nm)=>{var sm=Ut(),om=sm?sm.prototype:void 0,am=om?om.valueOf:void 0;function BC(a){return am?Object(am.call(a)):{}}nm.exports=BC});var cm=b((RO,hm)=>{var VC=Qt();function jC(a,e){var t=e?VC(a.buffer):a.buffer;return new a.constructor(t,a.byteOffset,a.length)}hm.exports=jC});var dm=b((OO,pm)=>{var qC=Qt(),ZC=tm(),YC=rm(),XC=lm(),JC=cm(),KC="[object Boolean]",QC="[object Date]",$C="[object Map]",ex="[object Number]",tx="[object RegExp]",ix="[object Set]",rx="[object String]",sx="[object Symbol]",ox="[object ArrayBuffer]",ax="[object DataView]",nx="[object Float32Array]",lx="[object Float64Array]",hx="[object Int8Array]",cx="[object Int16Array]",px="[object Int32Array]",dx="[object Uint8Array]",mx="[object Uint8ClampedArray]",ux="[object Uint16Array]",_x="[object Uint32Array]";function fx(a,e,t){var r=a.constructor;switch(e){case ox:return qC(a);case KC:case QC:return new r(+a);case ax:return ZC(a,t);case nx:case lx:case hx:case cx:case px:case dx:case mx:case ux:case _x:return JC(a,t);case $C:return new r;case ex:case rx:return new r(a);case tx:return YC(a);case ix:return new r;case sx:return XC(a)}}pm.exports=fx});var _m=b((kO,um)=>{var gx=Ve(),mm=Object.create,yx=function(){function a(){}return function(e){if(!gx(e))return{};if(mm)return mm(e);a.prototype=e;var t=new a;return a.prototype=void 0,t}}();um.exports=yx});var gm=b((FO,fm)=>{var vx=_m(),wx=wo(),Cx=Zt();function xx(a){return typeof a.constructor=="function"&&!Cx(a)?vx(wx(a)):{}}fm.exports=xx});var vm=b((zO,ym)=>{var Tx=Kt(),Ex=Ye(),Px="[object Map]";function bx(a){return Ex(a)&&Tx(a)==Px}ym.exports=bx});var Tm=b((NO,xm)=>{var Ax=vm(),Mx=jt(),wm=qt(),Cm=wm&&wm.isMap,Ix=Cm?Mx(Cm):Ax;xm.exports=Ix});var Pm=b((HO,Em)=>{var Sx=Kt(),Dx=Ye(),Lx="[object Set]";function Rx(a){return Dx(a)&&Sx(a)==Lx}Em.exports=Rx});var Im=b((WO,Mm)=>{var Ox=Pm(),kx=jt(),bm=qt(),Am=bm&&bm.isSet,Fx=Am?kx(Am):Ox;Mm.exports=Fx});var Om=b((GO,Rm)=>{var zx=cp(),Nx=dp(),Hx=co(),Wx=td(),Gx=ld(),Ux=md(),Bx=_d(),Vx=xd(),jx=Ad(),qx=Sd(),Zx=Ld(),Yx=Kt(),Xx=Xd(),Jx=dm(),Kx=gm(),Qx=Vt(),$x=po(),eT=Tm(),tT=Ve(),iT=Im(),rT=Yt(),sT=Xt(),oT=1,aT=2,nT=4,Sm="[object Arguments]",lT="[object Array]",hT="[object Boolean]",cT="[object Date]",pT="[object Error]",Dm="[object Function]",dT="[object GeneratorFunction]",mT="[object Map]",uT="[object Number]",Lm="[object Object]",_T="[object RegExp]",fT="[object Set]",gT="[object String]",yT="[object Symbol]",vT="[object WeakMap]",wT="[object ArrayBuffer]",CT="[object DataView]",xT="[object Float32Array]",TT="[object Float64Array]",ET="[object Int8Array]",PT="[object Int16Array]",bT="[object Int32Array]",AT="[object Uint8Array]",MT="[object Uint8ClampedArray]",IT="[object Uint16Array]",ST="[object Uint32Array]",W={};W[Sm]=W[lT]=W[wT]=W[CT]=W[hT]=W[cT]=W[xT]=W[TT]=W[ET]=W[PT]=W[bT]=W[mT]=W[uT]=W[Lm]=W[_T]=W[fT]=W[gT]=W[yT]=W[AT]=W[MT]=W[IT]=W[ST]=!0;W[pT]=W[Dm]=W[vT]=!1;function $t(a,e,t,r,s,o){var n,l=e&oT,h=e&aT,c=e&nT;if(t&&(n=s?t(a,r,s,o):t(a)),n!==void 0)return n;if(!tT(a))return a;var p=Qx(a);if(p){if(n=Xx(a),!l)return Bx(a,n)}else{var u=Yx(a),g=u==Dm||u==dT;if($x(a))return Ux(a,l);if(u==Lm||u==Sm||g&&!s){if(n=h||g?{}:Kx(a),!l)return h?jx(a,Gx(n,a)):Vx(a,Wx(n,a))}else{if(!W[u])return s?a:{};n=Jx(a,u,l)}}o||(o=new zx);var _=o.get(a);if(_)return _;o.set(a,n),iT(a)?a.forEach(function(w){n.add($t(w,e,t,w,a,o))}):eT(a)&&a.forEach(function(w,P){n.set(P,$t(w,e,t,P,a,o))});var d=c?h?Zx:qx:h?sT:rT,T=p?void 0:d(a);return Nx(T||a,function(w,P){T&&(P=w,w=a[P]),Hx(n,P,$t(w,e,t,P,a,o))}),n}Rm.exports=$t});var Fm=b((UO,km)=>{var DT=Om(),LT=1,RT=4;function OT(a){return DT(a,LT|RT)}km.exports=OT});var Qn={};function $n(a,e){Qn[a]=e}function q(a){return Qn[a]}var el={};function bt(a,e){el[a]=e}function Zi(a){return el[a]}import*as i from"cesium";var tl=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Yi=1,rt=8,ot=class a{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[t,r]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");let s=r>>4;if(s!==Yi)throw new Error(`Got v${s} data when expected v${Yi}.`);let o=tl[r&15];if(!o)throw new Error("Unrecognized array type.");let[n]=new Uint16Array(e,2,1),[l]=new Uint32Array(e,4,1);return new a(l,n,o,e)}constructor(e,t=64,r=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let o=tl.indexOf(this.ArrayType),n=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,h=(8-l%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,rt,e),this.coords=new this.ArrayType(this.data,rt+l+h,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(rt+n+l+h),this.ids=new this.IndexArrayType(this.data,rt,e),this.coords=new this.ArrayType(this.data,rt+l+h,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Yi<<4)+o]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){let r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Ji(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:n,nodeSize:l}=this,h=[0,o.length-1,0],c=[];for(;h.length;){let p=h.pop()||0,u=h.pop()||0,g=h.pop()||0;if(u-g<=l){for(let w=g;w<=u;w++){let P=n[2*w],M=n[2*w+1];P>=e&&P<=r&&M>=t&&M<=s&&c.push(o[w])}continue}let _=g+u>>1,d=n[2*_],T=n[2*_+1];d>=e&&d<=r&&T>=t&&T<=s&&c.push(o[_]),(p===0?e<=d:t<=T)&&(h.push(g),h.push(_-1),h.push(1-p)),(p===0?r>=d:s>=T)&&(h.push(_+1),h.push(u),h.push(1-p))}return c}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:s,coords:o,nodeSize:n}=this,l=[0,s.length-1,0],h=[],c=r*r;for(;l.length;){let p=l.pop()||0,u=l.pop()||0,g=l.pop()||0;if(u-g<=n){for(let w=g;w<=u;w++)il(o[2*w],o[2*w+1],e,t)<=c&&h.push(s[w]);continue}let _=g+u>>1,d=o[2*_],T=o[2*_+1];il(d,T,e,t)<=c&&h.push(s[_]),(p===0?e-r<=d:t-r<=T)&&(l.push(g),l.push(_-1),l.push(1-p)),(p===0?e+r>=d:t+r>=T)&&(l.push(_+1),l.push(u),l.push(1-p))}return h}};function Ji(a,e,t,r,s,o){if(s-r<=t)return;let n=r+s>>1;rl(a,e,n,r,s,o),Ji(a,e,t,r,n-1,1-o),Ji(a,e,t,n+1,s,1-o)}function rl(a,e,t,r,s,o){for(;s>r;){if(s-r>600){let c=s-r+1,p=t-r+1,u=Math.log(c),g=.5*Math.exp(2*u/3),_=.5*Math.sqrt(u*g*(c-g)/c)*(p-c/2<0?-1:1),d=Math.max(r,Math.floor(t-p*g/c+_)),T=Math.min(s,Math.floor(t+(c-p)*g/c+_));rl(a,e,t,d,T,o)}let n=e[2*t+o],l=r,h=s;for(st(a,e,r,t),e[2*s+o]>n&&st(a,e,r,s);l<h;){for(st(a,e,l,h),l++,h--;e[2*l+o]<n;)l++;for(;e[2*h+o]>n;)h--}e[2*r+o]===n?st(a,e,r,h):(h++,st(a,e,h,s)),h<=t&&(r=h+1),t<=h&&(s=h-1)}}function st(a,e,t,r){Xi(a,t,r),Xi(e,2*t,2*r),Xi(e,2*t+1,2*r+1)}function Xi(a,e,t){let r=a[e];a[e]=a[t],a[t]=r}function il(a,e,t,r){let s=a-t,o=e-r;return s*s+o*o}var cg={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:a=>a},sl=Math.fround||(a=>e=>(a[0]=+e,a[0]))(new Float32Array(1)),Re=2,Ce=3,Ki=4,we=5,al=6,He=class{constructor(e){this.options=Object.assign(Object.create(cg),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:t,minZoom:r,maxZoom:s}=this.options;t&&console.time("total time");let o=`prepare ${e.length} points`;t&&console.time(o),this.points=e;let n=[];for(let h=0;h<e.length;h++){let c=e[h];if(!c.geometry)continue;let[p,u]=c.geometry.coordinates,g=sl(At(p)),_=sl(Mt(u));n.push(g,_,1/0,h,-1,1),this.options.reduce&&n.push(0)}let l=this.trees[s+1]=this._createTree(n);t&&console.timeEnd(o);for(let h=s;h>=r;h--){let c=+Date.now();l=this.trees[h]=this._createTree(this._cluster(l,h)),t&&console.log("z%d: %d clusters in %dms",h,l.numItems,+Date.now()-c)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180,s=Math.max(-90,Math.min(90,e[1])),o=e[2]===180?180:((e[2]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){let u=this.getClusters([r,s,180,n],t),g=this.getClusters([-180,s,o,n],t);return u.concat(g)}let l=this.trees[this._limitZoom(t)],h=l.range(At(r),Mt(n),At(o),Mt(s)),c=l.data,p=[];for(let u of h){let g=this.stride*u;p.push(c[g+we]>1?ol(c,g,this.clusterProps):this.points[c[g+Ce]])}return p}getChildren(e){let t=this._getOriginId(e),r=this._getOriginZoom(e),s="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(s);let n=o.data;if(t*this.stride>=n.length)throw new Error(s);let l=this.options.radius/(this.options.extent*Math.pow(2,r-1)),h=n[t*this.stride],c=n[t*this.stride+1],p=o.within(h,c,l),u=[];for(let g of p){let _=g*this.stride;n[_+Ki]===e&&u.push(n[_+we]>1?ol(n,_,this.clusterProps):this.points[n[_+Ce]])}if(u.length===0)throw new Error(s);return u}getLeaves(e,t,r){t=t||10,r=r||0;let s=[];return this._appendLeaves(s,e,t,r,0),s}getTile(e,t,r){let s=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:n,radius:l}=this.options,h=l/n,c=(r-h)/o,p=(r+1+h)/o,u={features:[]};return this._addTileFeatures(s.range((t-h)/o,c,(t+1+h)/o,p),s.data,t,r,o,u),t===0&&this._addTileFeatures(s.range(1-h/o,c,1,p),s.data,o,r,o,u),t===o-1&&this._addTileFeatures(s.range(0,c,h/o,p),s.data,-1,r,o,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){let r=this.getChildren(e);if(t++,r.length!==1)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,s,o){let n=this.getChildren(t);for(let l of n){let h=l.properties;if(h&&h.cluster?o+h.point_count<=s?o+=h.point_count:o=this._appendLeaves(e,h.cluster_id,r,s,o):o<s?o++:e.push(l),e.length===r)break}return o}_createTree(e){let t=new ot(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)t.add(e[r],e[r+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,r,s,o,n){for(let l of e){let h=l*this.stride,c=t[h+we]>1,p,u,g;if(c)p=nl(t,h,this.clusterProps),u=t[h],g=t[h+1];else{let T=this.points[t[h+Ce]];p=T.properties;let[w,P]=T.geometry.coordinates;u=At(w),g=Mt(P)}let _={type:1,geometry:[[Math.round(this.options.extent*(u*o-r)),Math.round(this.options.extent*(g*o-s))]],tags:p},d;c||this.options.generateId?d=t[h+Ce]:d=this.points[t[h+Ce]].id,d!==void 0&&(_.id=d),n.features.push(_)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){let{radius:r,extent:s,reduce:o,minPoints:n}=this.options,l=r/(s*Math.pow(2,t)),h=e.data,c=[],p=this.stride;for(let u=0;u<h.length;u+=p){if(h[u+Re]<=t)continue;h[u+Re]=t;let g=h[u],_=h[u+1],d=e.within(h[u],h[u+1],l),T=h[u+we],w=T;for(let P of d){let M=P*p;h[M+Re]>t&&(w+=h[M+we])}if(w>T&&w>=n){let P=g*T,M=_*T,R,F=-1,H=((u/p|0)<<5)+(t+1)+this.points.length;for(let ee of d){let Y=ee*p;if(h[Y+Re]<=t)continue;h[Y+Re]=t;let B=h[Y+we];P+=h[Y]*B,M+=h[Y+1]*B,h[Y+Ki]=H,o&&(R||(R=this._map(h,u,!0),F=this.clusterProps.length,this.clusterProps.push(R)),o(R,this._map(h,Y)))}h[u+Ki]=H,c.push(P/w,M/w,1/0,H,-1,w),o&&c.push(F)}else{for(let P=0;P<p;P++)c.push(h[u+P]);if(w>1)for(let P of d){let M=P*p;if(!(h[M+Re]<=t)){h[M+Re]=t;for(let R=0;R<p;R++)c.push(h[M+R])}}}}return c}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+we]>1){let n=this.clusterProps[e[t+al]];return r?Object.assign({},n):n}let s=this.points[e[t+Ce]].properties,o=this.options.map(s);return r&&o===s?Object.assign({},o):o}};function ol(a,e,t){return{type:"Feature",id:a[e+Ce],properties:nl(a,e,t),geometry:{type:"Point",coordinates:[pg(a[e]),dg(a[e+1])]}}}function nl(a,e,t){let r=a[e+we],s=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=a[e+al],n=o===-1?{}:Object.assign({},t[o]);return Object.assign(n,{cluster:!0,cluster_id:a[e+Ce],point_count:r,point_count_abbreviated:s})}function At(a){return a/360+.5}function Mt(a){let e=Math.sin(a*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function pg(a){return(a-.5)*360}function dg(a){let e=(180-a*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var ll=new i.WebMercatorProjection,Qi=class{static transformCartesianToWGS84(e){if(e){let t=i.Ellipsoid.WGS84.cartesianToCartographic(e);return new X(i.Math.toDegrees((t==null?void 0:t.longitude)||0),i.Math.toDegrees((t==null?void 0:t.latitude)||0),t.height||0)}return new X(0,0)}static transformCartographicToWGS84(e){return e?new X(i.Math.toDegrees((e==null?void 0:e.longitude)||0),i.Math.toDegrees((e==null?void 0:e.latitude)||0),e.height||0):new X(0,0)}static transformWGS84ToCartesian(e){return e?i.Cartesian3.fromDegrees(e.lng,e.lat,e.alt,i.Ellipsoid.WGS84):i.Cartesian3.ZERO}static transformWGS84ToCartographic(e){return e?i.Cartographic.fromDegrees(e.lng,e.lat,e.alt):i.Cartographic.ZERO}static transformCartesianArrayToWGS84Array(e){return e?e.map(t=>this.transformCartesianToWGS84(t)):[]}static transformWGS84ArrayToCartesianArray(e){return e?e.map(t=>this.transformWGS84ToCartesian(t)):[]}static transformWGS84ToMercator(e){let t=ll.project(i.Cartographic.fromDegrees(e.lng,e.lat,e.alt));return new X(t.x,t.y,t.z)}static transformMercatorToWGS84(e){let t=ll.unproject(new i.Cartesian3(e.lng,e.lat,e.alt));return new X(i.Math.toDegrees(t.longitude),i.Math.toDegrees(t.latitude),t.height)}static transformWindowToWGS84(e,t){let r=t.scene,s;if(r.mode===i.SceneMode.SCENE3D){let o=r.camera.getPickRay(e);s=r.globe.pick(o,r)}else s=r.camera.pickEllipsoid(e,i.Ellipsoid.WGS84);return this.transformCartesianToWGS84(s)}static transformWGS84ToWindow(e,t){let r=t.scene;return i.SceneTransforms.worldToWindowCoordinates(r,this.transformWGS84ToCartesian(e))}},f=Qi;var It=52.35987755982988,te=3.141592653589793,hl=6378245,cl=.006693421622965943,$i=class{static BD09ToGCJ02(e,t){let r=+e-.0065,s=+t-.006,o=Math.sqrt(r*r+s*s)-2e-5*Math.sin(s*It),n=Math.atan2(s,r)-3e-6*Math.cos(r*It),l=o*Math.cos(n),h=o*Math.sin(n);return[l,h]}static GCJ02ToBD09(e,t){t=+t,e=+e;let r=Math.sqrt(e*e+t*t)+2e-5*Math.sin(t*It),s=Math.atan2(t,e)+3e-6*Math.cos(e*It),o=r*Math.cos(s)+.0065,n=r*Math.sin(s)+.006;return[o,n]}static WGS84ToGCJ02(e,t){if(t=+t,e=+e,this.out_of_china(e,t))return[e,t];{let r=this.delta(e,t);return[e+r[0],t+r[1]]}}static GCJ02ToWGS84(e,t){if(t=+t,e=+e,this.out_of_china(e,t))return[e,t];{let r=[e,t],s=this.WGS84ToGCJ02(e,t),o=s[0]-e,n=s[1]-t;do s=this.WGS84ToGCJ02(r[0]-=o,r[1]-=n),o=s[0]-e,n=s[1]-t;while(Math.abs(o)>1e-7||Math.abs(n)>1e-7);return r}}static delta(e,t){let r=this.transformLng(e-105,t-35),s=this.transformLat(e-105,t-35),o=t/180*te,n=Math.sin(o);n=1-cl*n*n;let l=Math.sqrt(n);return r=r*180/(hl/l*Math.cos(o)*te),s=s*180/(hl*(1-cl)/(n*l)*te),[r,s]}static transformLng(e,t){t=+t,e=+e;let r=300+e+2*t+.1*e*e+.1*e*t+.1*Math.sqrt(Math.abs(e));return r+=(20*Math.sin(6*e*te)+20*Math.sin(2*e*te))*2/3,r+=(20*Math.sin(e*te)+40*Math.sin(e/3*te))*2/3,r+=(150*Math.sin(e/12*te)+300*Math.sin(e/30*te))*2/3,r}static transformLat(e,t){t=+t,e=+e;let r=-100+2*e+3*t+.2*t*t+.1*e*t+.2*Math.sqrt(Math.abs(e));return r+=(20*Math.sin(6*e*te)+20*Math.sin(2*e*te))*2/3,r+=(20*Math.sin(t*te)+40*Math.sin(t/3*te))*2/3,r+=(160*Math.sin(t/12*te)+320*Math.sin(t*te/30))*2/3,r}static out_of_china(e,t){return t=+t,e=+e,!(e>73.66&&e<135.05&&t>3.86&&t<53.55)}},me=$i;var er=class a{constructor(e,t,r,s,o,n){this._lng=+e||0,this._lat=+t||0,this._alt=+r||0,this._heading=+s||0,this._pitch=+o||0,this._roll=+n||0}set lng(e){this._lng=+e}get lng(){return this._lng}set lat(e){this._lat=+e}get lat(){return this._lat}set alt(e){this._alt=+e}get alt(){return this._alt}set heading(e){this._heading=+e}get heading(){return this._heading}set pitch(e){this._pitch=+e}get pitch(){return this._pitch}set roll(e){this._roll=+e}get roll(){return this._roll}serialize(){let e=new a(this._lng,this._lat,this._alt,this._heading,this._pitch,this._roll);return JSON.stringify(e)}distance(e){return!e||!(e instanceof a)?0:i.Cartesian3.distance(f.transformWGS84ToCartesian(this),f.transformWGS84ToCartesian(e))}clone(){let e=new a;return e.lng=this.lng||0,e.lat=this.lat||0,e.alt=this.alt||0,e.heading=this.heading||0,e.pitch=this.pitch||0,e.roll=this.roll||0,e}copy(){return this.clone()}toArray(){return[this.lng,this.lat,this.alt,this.heading,this.pitch,this.roll]}toString(){return`${this.lng},${this.lat},${this.alt},${this.heading},${this.pitch},${this.roll}`}toObject(){return{lng:this.lng,lat:this.lat,alt:this.alt,heading:this.heading,pitch:this.pitch,roll:this.roll}}static fromArray(e){let t=new a;return Array.isArray(e)&&(t.lng=e[0]||0,t.lat=e[1]||0,t.alt=e[2]||0,t.heading=e[3]||0,t.pitch=e[4]||0,t.roll=e[5]||0),t}static fromString(e){let t=new a;if(e&&typeof e=="string"){let r=e.split(",");t=this.fromArray(r)}return t}static fromObject(e){return new a(e.lng,e.lat,e.alt,e.heading,e.pitch,e.roll)}static deserialize(e){let t=new a,r=JSON.parse(e);return r&&(t.lng=r.lng||0,t.lat=r.lat||0,t.alt=r.alt||0,t.heading=r.heading||0,t.pitch=r.pitch||0,t.roll=r.roll||0),t}},X=er;var tr=class{static parsePosition(e){let t=new X;return e&&(typeof e=="string"?t=X.fromString(e):Array.isArray(e)?t=X.fromArray(e):!(Object(e)instanceof X)&&Object(e).hasOwnProperty("lng")&&Object(e).hasOwnProperty("lat")?t=X.fromObject(e):Object(e)instanceof X?t=e:Object(e)instanceof i.Cartesian3?t=f.transformCartesianToWGS84(e):Object(e)instanceof i.Cartographic&&(t=f.transformCartographicToWGS84(e))),t}static parsePositions(e){if(typeof e=="string"){if(e.indexOf("#")>=0)throw new Error("the positions invalid");e=e.split(";").filter(t=>!!t)}return e.map(t=>this.parsePosition(t))}static parsePointCoordToArray(e){return e=this.parsePosition(e),[e.lng,e.lat]}static parsePolylineCoordToArray(e){let t=[];return e=this.parsePositions(e),e.forEach(r=>{t.push([r.lng,r.lat])}),t}static parsePolygonCoordToArray(e,t=!1){let r=[];return e=this.parsePositions(e),e.forEach(s=>{r.push([s.lng,s.lat])}),t&&r.length>0&&r.push(r[0]),[r]}},y=tr;var at={ADD:"add",REMOVE:"remove"},O={LEFT_DOWN:i.ScreenSpaceEventType.LEFT_DOWN,LEFT_UP:i.ScreenSpaceEventType.LEFT_UP,CLICK:i.ScreenSpaceEventType.LEFT_CLICK,RIGHT_DOWN:i.ScreenSpaceEventType.RIGHT_DOWN,RIGHT_UP:i.ScreenSpaceEventType.RIGHT_UP,RIGHT_CLICK:i.ScreenSpaceEventType.RIGHT_CLICK,DB_CLICK:i.ScreenSpaceEventType.LEFT_DOUBLE_CLICK,MOUSE_MOVE:i.ScreenSpaceEventType.MOUSE_MOVE,WHEEL:i.ScreenSpaceEventType.WHEEL,MOUSE_OVER:"mouseover",MOUSE_OUT:"mouseout"},pl={ADD_LAYER:"addLayer",REMOVE_LAYER:"removeLayer",ADD_EFFECT:"addEffect",REMOVE_EFFECT:"removeEffect",LEFT_DOWN:i.ScreenSpaceEventType.LEFT_DOWN,LEFT_UP:i.ScreenSpaceEventType.LEFT_UP,CLICK:i.ScreenSpaceEventType.LEFT_CLICK,RIGHT_DOWN:i.ScreenSpaceEventType.RIGHT_DOWN,RIGHT_UP:i.ScreenSpaceEventType.RIGHT_UP,RIGHT_CLICK:i.ScreenSpaceEventType.RIGHT_CLICK,DB_CLICK:i.ScreenSpaceEventType.LEFT_DOUBLE_CLICK,MOUSE_MOVE:i.ScreenSpaceEventType.MOUSE_MOVE,WHEEL:i.ScreenSpaceEventType.WHEEL},D={CAMERA_MOVE_END:"cameraMoveEnd",CAMERA_CHANGED:"cameraChanged",PRE_UPDATE:"preUpdate",POST_UPDATE:"postUpdate",PRE_RENDER:"preRender",POST_RENDER:"postRender",MORPH_COMPLETE:"morphComplete",CLOCK_TICK:"clockTick",RENDER_ERROR:"renderError"},xe={...at,LEFT_DOWN:i.ScreenSpaceEventType.LEFT_DOWN,LEFT_UP:i.ScreenSpaceEventType.LEFT_UP,CLICK:i.ScreenSpaceEventType.LEFT_CLICK,RIGHT_DOWN:i.ScreenSpaceEventType.RIGHT_DOWN,RIGHT_UP:i.ScreenSpaceEventType.RIGHT_UP,RIGHT_CLICK:i.ScreenSpaceEventType.RIGHT_CLICK,DB_CLICK:i.ScreenSpaceEventType.LEFT_DOUBLE_CLICK,MOUSE_MOVE:i.ScreenSpaceEventType.MOUSE_MOVE,MOUSE_OVER:"mouseover",MOUSE_OUT:"mouseout",POSITION_UPDATE:"positionUpdate"},Oe={READY:"ready",TEX_READY:"texturesReady"},K={INITIAL_TILES_LOADED:"initialTilesLoaded",ALL_TILES_LOADED:"allTilesLoaded ",LOAD_PROGRESS:"loadProgress ",TILE_FAILED:"tileFailed ",TILE_LOAD:"tileLoad",TILE_UNLOAD:"tileUnload",TILE_VISIBLE:"tileVisible"},Te=at,Ee={...at,LEFT_DOWN:i.ScreenSpaceEventType.LEFT_DOWN,LEFT_UP:i.ScreenSpaceEventType.LEFT_UP,CLICK:i.ScreenSpaceEventType.LEFT_CLICK,RIGHT_DOWN:i.ScreenSpaceEventType.RIGHT_DOWN,RIGHT_UP:i.ScreenSpaceEventType.RIGHT_UP,RIGHT_CLICK:i.ScreenSpaceEventType.RIGHT_CLICK,DB_CLICK:i.ScreenSpaceEventType.LEFT_DOUBLE_CLICK},oe={...at,POST_RENDER:"postRender",ACTIVATE:"activate",DEACTIVATE:"deactivate",RESET_TIME_LINE:"restTimeLine"},ae={...at,POST_RENDER:"postRender",RESET_TIME_LINE:"restTimeLine"},E={DRAW_START:"drawStart",DRAW_STOP:"drawStop",EDIT_START:"editStart",EDIT_STOP:"editEnd",DRAW_ANCHOR:"drawAnchor",CREATE_ANCHOR:"createAnchor",UPDATE_ANCHOR:"updateAnchor",ANCHOR_MOVING:"anchorMoving",EDIT_ANCHOR_STOP:"editAnchorStop",CLEAR_ANCHOR:"clearAnchor"};var ir=class{constructor(e){this._types=e,this._cache={}}_on(e,t,r){let s=this.getEvent(e),o;return s&&t&&(o=s.addEventListener(t,r||this)),o}_off(e,t,r){let s=this.getEvent(e),o=!1;return s&&t&&(o=s.removeEventListener(t,r||this)),o}_fire(e,t){let r=this.getEvent(e);r&&r.raiseEvent(t)}_registerEvent(){Object.keys(this._types).forEach(e=>{let t=this._types[e];this._cache[t]=new i.Event})}on(e,t,r){return this._on(e,t,r)}once(e,t,r){let s=this._on(e,o=>{t(o),s&&s()},r)}off(e,t,r){return this._off(e,t,r)}fire(e,t){this._fire(e,t)}getEvent(e){return this._cache[e]||void 0}},U=ir;var rr=class extends U{constructor(e,t={}){super(O),this._viewer=e,this._selected=void 0,this._enableEventPropagation=t.enableEventPropagation,this._enableMouseOver=t.enableMouseOver,this._enableMouseMovePick=t.enableMouseMovePick,this._registerEvent(),this._addDefaultEvent()}_registerEvent(){let e=new i.ScreenSpaceEventHandler(this._viewer.canvas);Object.keys(i.ScreenSpaceEventType).forEach(t=>{let r=i.ScreenSpaceEventType[t];this._cache[r]=new i.Event,e.setInputAction(s=>{this._cache[r].raiseEvent(s)},r)})}_addDefaultEvent(){this.on(this._types.LEFT_DOWN,this._leftDownHandler,this),this.on(this._types.LEFT_UP,this._leftUpHandler,this),this.on(this._types.CLICK,this._clickHandler,this),this.on(this._types.DB_CLICK,this._dbClickHandler,this),this.on(this._types.RIGHT_DOWN,this._rightDownHandler,this),this.on(this._types.RIGHT_UP,this._rightUpHandler,this),this.on(this._types.RIGHT_CLICK,this._rightClickHandler,this),this.on(this._types.MOUSE_MOVE,this._mouseMoveHandler,this),this.on(this._types.WHEEL,this._mouseWheelHandler,this)}_adjustPosition(e){let t=this._viewer.canvas.getBoundingClientRect(),r=this._viewer.canvas.offsetWidth/t.width,s=this._viewer.canvas.offsetHeight/t.height;return new i.Cartesian2(e.x*r,e.y*s)}_getMousePosition(e){let t=this._viewer.scene,r,s,o,n;if(t.pickPositionSupported&&(r=t.pickPosition(e)),r){let l=i.Ellipsoid.WGS84.cartesianToCartographic(r);l&&(o={lng:i.Math.toDegrees(l.longitude),lat:i.Math.toDegrees(l.latitude),alt:l.height})}if(t.mode===i.SceneMode.SCENE3D&&!(this._viewer.terrainProvider instanceof i.EllipsoidTerrainProvider)){let l=t.camera.getPickRay(e);s=t.globe.pick(l,t)}else s=t.camera.pickEllipsoid(e,i.Ellipsoid.WGS84);if(s){let l=i.Ellipsoid.WGS84.cartesianToCartographic(s);l&&(n={lng:i.Math.toDegrees(l.longitude),lat:i.Math.toDegrees(l.latitude),alt:l.height})}return{windowPosition:e,position:r,wgs84Position:o,surfacePosition:s,wgs84SurfacePosition:n}}_getMouseInfo(e){return{...this._getMousePosition(this._adjustPosition(e)),target:this._viewer.scene.pick(this._adjustPosition(e))}}_getDrillInfos(e){let t=[],s=this._viewer.scene.drillPick(e);return s&&s.length&&s.forEach(o=>{t.push(this._getTargetInfo(o))}),t}_getOverlayId(e){let t;return(e==null?void 0:e.id)instanceof i.Entity?t=e.id.overlayId:e instanceof i.Cesium3DTileFeature?t=e.tileset.overlayId:((e==null?void 0:e.primitive)instanceof i.Cesium3DTileset||e!=null&&e.primitive)&&(t=e.primitive.overlayId),t}_getTargetInfo(e){let t,r,s;return(e==null?void 0:e.id)instanceof i.Entity?(r=this._viewer.getLayers().filter(o=>o.layerId===e.id.layerId)[0],r!=null&&r.getOverlay&&(t=r.getOverlay(e.id.overlayId))):e instanceof i.Cesium3DTileFeature?(r=this._viewer.getLayers().filter(o=>o.layerId===e.tileset.layerId)[0],s=e,r!=null&&r.getOverlay&&(t=r.getOverlay(e.tileset.overlayId),s&&s.getPropertyNames&&s.getPropertyNames().forEach(n=>{t.attr[n]=s.getProperty(n)}))):(e==null?void 0:e.primitive)instanceof i.Cesium3DTileset?(r=this._viewer.getLayers().filter(o=>o.layerId===e.primitive.layerId)[0],r!=null&&r.getOverlay&&(t=r.getOverlay(e.primitive.overlayId))):e!=null&&e.primitive&&(r=this._viewer.getLayers().filter(o=>o.layerId===e.primitive.layerId)[0],r!=null&&r.getOverlay&&(t=r.getOverlay(e.primitive.overlayId))),{layer:r,overlay:t,feature:s,instanceId:e==null?void 0:e.instanceId}}_raiseEvent(e,t={}){var l;let r,s=this._getTargetInfo(t.target),o=s==null?void 0:s.overlay,n=s==null?void 0:s.layer;o!=null&&o.overlayEvent&&(r=o.overlayEvent.getEvent(e),r&&r.numberOfListeners>0&&r.raiseEvent({...s,...t})),(!r||r.numberOfListeners===0||this._eventPropagation)&&(n!=null&&n.layerEvent)&&(r=n.layerEvent.getEvent(e),r&&r.numberOfListeners>0&&r.raiseEvent({...s,...t})),(!r||r.numberOfListeners===0||this._enableEventPropagation)&&((l=this._viewer)!=null&&l.viewerEvent)&&(r=this._viewer.viewerEvent.getEvent(e),r&&r.numberOfListeners>0&&r.raiseEvent({...s,...t})),o!=null&&o.allowDrillPicking&&this._getDrillInfos(t.windowPosition).forEach(c=>{let p=c==null?void 0:c.overlay,u=c==null?void 0:c.layer;(p==null?void 0:p.overlayId)!==o.overlayId&&(p!=null&&p.overlayEvent)&&(r=p.overlayEvent.getEvent(e),(!r||r.numberOfListeners===0)&&(u!=null&&u.layerEvent)&&(r=u.layerEvent.getEvent(e)),r&&r.numberOfListeners>0&&r.raiseEvent({...c,...t}))})}_clickHandler(e){if(!(e!=null&&e.position))return!1;this._raiseEvent(O.CLICK,this._getMouseInfo(e.position))}_dbClickHandler(e){if(!(e!=null&&e.position))return!1;this._raiseEvent(O.DB_CLICK,this._getMouseInfo(e.position))}_rightClickHandler(e){if(!(e!=null&&e.position))return!1;this._raiseEvent(O.RIGHT_CLICK,this._getMouseInfo(e.position))}_mouseMoveHandler(e){if(!(e!=null&&e.endPosition))return!1;if(this._enableMouseMovePick){let t=this._getMouseInfo(e.endPosition);this._viewer.canvas.style.cursor=t.target?"pointer":"default",this._raiseEvent(O.MOUSE_MOVE,t),this._enableMouseOver&&(!this._selected||this._getOverlayId(this._selected.target)!==this._getOverlayId(t.target))&&(this._raiseEvent(O.MOUSE_OUT,this._selected),this._raiseEvent(O.MOUSE_OVER,t),this._selected=t)}else this._raiseEvent(O.MOUSE_MOVE,this._getMousePosition(this._adjustPosition(e.endPosition)))}_leftDownHandler(e){if(!(e!=null&&e.position))return!1;this._raiseEvent(O.LEFT_DOWN,this._getMouseInfo(e.position))}_leftUpHandler(e){this._raiseEvent(O.LEFT_UP,this._getMouseInfo(e.position))}_rightDownHandler(e){if(!(e!=null&&e.position))return!1;this._raiseEvent(O.RIGHT_DOWN,this._getMouseInfo(e.position))}_rightUpHandler(e){this._raiseEvent(O.RIGHT_UP,this._getMouseInfo(e.position))}_mouseWheelHandler(e){this._raiseEvent(O.WHEEL,{movement:e})}},sr=rr;var or=class extends U{constructor(){super(pl),this._registerEvent()}},ar=or;var nr=class extends U{constructor(e){super(D),this._camera=e.camera,this._scene=e.scene,this._clock=e.clock}on(e,t,r){let s;switch(e){case D.CAMERA_MOVE_END:s=this._camera.moveEnd.addEventListener(t,r||this);break;case D.CAMERA_CHANGED:s=this._camera.changed.addEventListener(t,r||this);break;case D.PRE_UPDATE:s=this._scene.preUpdate.addEventListener(t,r||this);break;case D.POST_UPDATE:s=this._scene.postUpdate.addEventListener(t,r||this);break;case D.PRE_RENDER:s=this._scene.preRender.addEventListener(t,r||this);break;case D.POST_RENDER:s=this._scene.postRender.addEventListener(t,r||this);break;case D.MORPH_COMPLETE:s=this._scene.morphComplete.addEventListener(t,r||this);break;case D.CLOCK_TICK:s=this._clock.onTick.addEventListener(t,r||this);break;case D.RENDER_ERROR:s=this._scene.renderError.addEventListener(t,r||this);break;default:break}return s}off(e,t,r){let s=!1;switch(e){case D.CAMERA_MOVE_END:s=this._camera.moveEnd.removeEventListener(t,r||this);break;case D.CAMERA_CHANGED:s=this._camera.changed.removeEventListener(t,r||this);break;case D.PRE_UPDATE:s=this._scene.preUpdate.removeEventListener(t,r||this);break;case D.POST_UPDATE:s=this._scene.postUpdate.removeEventListener(t,r||this);break;case D.PRE_RENDER:s=this._scene.preRender.removeEventListener(t,r||this);break;case D.POST_RENDER:s=this._scene.postRender.removeEventListener(t,r||this);break;case D.MORPH_COMPLETE:s=this._scene.morphComplete.removeEventListener(t,r||this);break;case D.CLOCK_TICK:s=this._clock.onTick.removeEventListener(t,r||this);break;case D.RENDER_ERROR:s=this._scene.renderError.removeEventListener(t,r||this);break;default:break}return s}},lr=nr;var hr=class extends U{constructor(){super(Te),this._registerEvent()}},cr=hr;var pr=class extends U{constructor(){super(Ee),this._registerEvent()}},dr=pr;var mr=class extends U{constructor(){super(xe),this._registerEvent()}},ur=mr;var _r=class extends U{constructor(e){super(K),this._tileset=e}on(e,t,r){return this._tileset.then(s=>{switch(e){case K.INITIAL_TILES_LOADED:s.initialTilesLoaded.addEventListener(t,r||this);break;case K.ALL_TILES_LOADED:s.allTilesLoaded.addEventListener(t,r||this);break;case K.LOAD_PROGRESS:s.loadProgress.addEventListener(t,r||this);break;case K.TILE_FAILED:s.tileFailed.addEventListener(t,r||this);break;case K.TILE_LOAD:s.tileLoad.addEventListener(t,r||this);break;case K.TILE_UNLOAD:s.tileUnload.addEventListener(t,r||this);break;case K.TILE_VISIBLE:s.tileVisible.addEventListener(t,r||this);break;default:break}}),null}off(e,t,r){return this._tileset.then(s=>{switch(e){case K.INITIAL_TILES_LOADED:s.initialTilesLoaded.removeEventListener(t,r||this);break;case K.ALL_TILES_LOADED:s.allTilesLoaded.removeEventListener(t,r||this);break;case K.LOAD_PROGRESS:s.loadProgress.removeEventListener(t,r||this);break;case K.TILE_FAILED:s.tileFailed.removeEventListener(t,r||this);break;case K.TILE_LOAD:s.tileLoad.removeEventListener(t,r||this);break;case K.TILE_UNLOAD:s.tileUnload.removeEventListener(t,r||this);break;case K.TILE_VISIBLE:s.tileVisible.removeEventListener(t,r||this);break;default:break}}),!0}},fr=_r;var gr=class extends U{constructor(e){super(Oe),this._model=e}on(e,t,r){return this._model.then(s=>{switch(e){case Oe.READY:s.readyEvent.addEventListener(t,r||this);break;case Oe.TEX_READY:s.texturesReadyEvent.addEventListener(t,r||this);break;default:break}}),null}off(e,t,r){return this._model.then(s=>{switch(e){case Oe.READY:s.readyEvent.removeEventListener(t,r||this);break;case Oe.TEX_READY:s.texturesReadyEvent.removeEventListener(t,r||this);break;default:break}}),!0}},yr=gr;var vr=class extends U{constructor(){super(oe),this._registerEvent()}},wr=vr;var Cr=class extends U{constructor(){super(ae),this._registerEvent()}},xr=Cr;var Tr=class extends U{constructor(){super(E),this._registerEvent()}},nt=Tr;var mg={LEFT_MIDDLE:0,LEFT_RIGHT:1},Pe=mg;var ug="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),Er=class{static uuid(e="D"){let t=[];t[8]=t[13]=t[18]=t[23]="-",t[14]="4";let r;for(let s=0;s<36;s++)t[s]||(r=0|Math.random()*16,t[s]=ug[s===19?r&3|8:r]);return e+"-"+t.join("")}static merge(e,...t){let r,s,o,n;for(s=0,o=t.length;s<o;s++){n=t[s];for(r in n)e[r]=n[r]}return e}static splitWords(e){return this.trim(e).split(/\s+/)}static setOptions(e,t){e.hasOwnProperty("options")||(e.options=e.options?Object.create(e.options):{});for(let r in t)e.options[r]=t[r];return e.options}static formatNum(e,t){let r=Math.pow(10,t===void 0?6:t);return Math.round(e*r)/r}static trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}static emptyImageUrl(){return function(){return"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}()}static checkPosition(e){return e&&e.hasOwnProperty("_lng")&&e.hasOwnProperty("_lat")&&e.hasOwnProperty("_alt")}static debounce(e,t){let r=null;return function(){r&&clearTimeout(r),r=setTimeout(e,t)}}static throttle(e,t){let r=!0;return function(){if(!r)return!1;r=!1,setTimeout(()=>{e(),r=!0},t)}}static dataURLtoBlob(e){let t=e.split(","),r=t[0].match(/:(.*?);/)[1],s=atob(t[1]),o=s.length,n=new Uint8Array(o);for(;o--;)n[o]=s.charCodeAt(o);return new Blob([n],{type:r})}static isPromise(e){return Promise.resolve(e)==e}},C=Er;var Pr=class{static get(e){return typeof e=="string"?document.getElementById(e):e}static getStyle(e,t){let r=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!r||r==="auto")&&document.defaultView){let s=document.defaultView.getComputedStyle(e,null);r=s?s[t]:null}return r==="auto"?null:r}static create(e,t,r=null){let s=document.createElement(e);return s.className=t||"",r&&r.appendChild(s),s}static remove(e){let t=e.parentNode;t&&t.removeChild(e)}static empty(e){for(;e.firstChild;)e.removeChild(e.firstChild)}static hasClass(e,t){if(e.classList!==void 0)return e.classList.contains(t);let r=this.getClass(e);return r.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(r)}static addClass(e,t){if(e.classList!==void 0){let r=C.splitWords(t);for(let s=0,o=r.length;s<o;s++)e.classList.add(r[s])}else if(!this.hasClass(e,t)){let r=this.getClass(e);this.setClass(e,(r?r+" ":"")+t)}}static removeClass(e,t){e.classList!==void 0?e.classList.remove(t):this.setClass(e,C.trim((" "+this.getClass(e)+" ").replace(" "+t+" "," ")))}static setClass(e,t){e.className.baseVal===void 0?e.className=t:e.className.baseVal=t}static getClass(e){return e.correspondingElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}static createSvg(e,t,r,s){let o=document.createElementNS("http://www.w3.org/2000/svg","svg:svg");o.setAttribute("class","svg-path"),o.setAttribute("width",e),o.setAttribute("height",t),o.setAttribute("viewBox",`0 0 ${e} ${t}`);let n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",r),o.appendChild(n),s&&s.appendChild(o),o}static parseDom(e,t,r){t=t!=null?t:!1;let s=document.createElement("div");return s.className=r||"",s.innerHTML=e,t?s:s.childNodes}static enterFullscreen(e){e&&(e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen())}static exitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}static createVideo(e,t,r=null){let s=this.create("video",t,r),o=this.create("source","",s);o.setAttribute("src",e),o.setAttribute("type","video/map4");let n=this.create("source","",s);return n.setAttribute("src",e),n.setAttribute("type","video/quicktime"),s}},I=Pr;var br=Math.PI*2,St=100,Ar=1e-4,Mr=class{static distance(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))}static wholeDistance(e){let t=0;for(let r=0;r<e.length-1;r++)t+=this.distance(e[r],e[r+1]);return t}static getBaseLength(e){return Math.pow(this.wholeDistance(e),.99)}static mid(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}static getCircleCenterOfThreePoints(e,t,r){let s=[(e[0]+t[0])/2,(e[1]+t[1])/2],o=[s[0]-e[1]+t[1],s[1]+e[0]-t[0]],n=[(e[0]+r[0])/2,(e[1]+r[1])/2],l=[n[0]-e[1]+r[1],n[1]+e[0]-r[0]];return this.getIntersectPoint(s,o,n,l)}static getIntersectPoint(e,t,r,s){let o,n,l,h;return e[1]===t[1]?(l=(s[0]-r[0])/(s[1]-r[1]),o=l*(e[1]-r[1])+r[0],n=e[1],[o,n]):r[1]===s[1]?(h=(t[0]-e[0])/(t[1]-e[1]),o=h*(r[1]-e[1])+e[0],n=r[1],[o,n]):(h=(t[0]-e[0])/(t[1]-e[1]),l=(s[0]-r[0])/(s[1]-r[1]),n=(h*e[1]-e[0]-l*r[1]+r[0])/(h-l),o=h*n-h*e[1]+e[0],[o,n])}static getAzimuth(e,t){let r,s=Math.asin(Math.abs(t[1]-e[1])/this.distance(e,t));return t[1]>=e[1]&&t[0]>=e[0]?r=s+Math.PI:t[1]>=e[1]&&t[0]<e[0]?r=br-s:t[1]<e[1]&&t[0]<e[0]?r=s:t[1]<e[1]&&t[0]>=e[0]&&(r=Math.PI-s),r}static getAngleOfThreePoints(e,t,r){let s=this.getAzimuth(t,e)-this.getAzimuth(t,r);return s<0?s+br:s}static isClockWise(e,t,r){return(r[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(r[0]-e[0])}static getPointOnLine(e,t,r){let s=t[0]+e*(r[0]-t[0]),o=t[1]+e*(r[1]-t[1]);return[s,o]}static getCubicValue(e,t,r,s,o){e=Math.max(Math.min(e,1),0);let n=1-e,l=e*e,h=l*e,c=n*n,p=c*n,u=p*t[0]+3*c*e*r[0]+3*n*l*s[0]+h*o[0],g=p*t[1]+3*c*e*r[1]+3*n*l*s[1]+h*o[1];return[u,g]}static getThirdPoint(e,t,r,s,o){let n=this.getAzimuth(e,t),l=o?n+r:n-r,h=s*Math.cos(l),c=s*Math.sin(l);return[t[0]+h,t[1]+c]}static getArcPoints(e,t,r,s){let o,n,l=[],h=s-r;h=h<0?h+br:h;for(let c=0;c<=St;c++){let p=r+h*c/St;o=e[0]+t*Math.cos(p),n=e[1]+t*Math.sin(p),l.push([o,n])}return l}static getBisectorNormals(e,t,r,s){let o=this.getNormal(t,r,s),n=Math.sqrt(o[0]*o[0]+o[1]*o[1]),l=o[0]/n,h=o[1]/n,c=this.distance(t,r),p=this.distance(r,s),u,g,_,d,T;return n>Ar?this.isClockWise(t,r,s)?(u=e*c,g=r[0]-u*h,_=r[1]+u*l,T=[g,_],u=e*p,g=r[0]+u*h,_=r[1]-u*l,d=[g,_]):(u=e*c,g=r[0]+u*h,_=r[1]-u*l,T=[g,_],u=e*p,g=r[0]-u*h,_=r[1]+u*l,d=[g,_]):(g=r[0]+e*(t[0]-r[0]),_=r[1]+e*(t[1]-r[1]),T=[g,_],g=r[0]+e*(s[0]-r[0]),_=r[1]+e*(s[1]-r[1]),d=[g,_]),[T,d]}static getNormal(e,t,r){let s=e[0]-t[0],o=e[1]-t[1],n=Math.sqrt(s*s+o*o);s/=n,o/=n;let l=r[0]-t[0],h=r[1]-t[1],c=Math.sqrt(l*l+h*h);l/=c,h/=c;let p=s+l,u=o+h;return[p,u]}static getCurvePoints(e,t){let s=[this.getLeftMostControlPoint(e,t)],o,n,l,h;for(let u=0;u<t.length-2;u++)o=t[u],n=t[u+1],l=t[u+2],h=this.getBisectorNormals(e,o,n,l),s=s.concat(h);let c=this.getRightMostControlPoint(e,t);s.push(c);let p=[];for(let u=0;u<t.length-1;u++){o=t[u],n=t[u+1],p.push(o);for(let g=0;g<St;g++){let _=this.getCubicValue(g/St,o,s[u*2],s[u*2+1],n);p.push(_)}p.push(n)}return p}static getLeftMostControlPoint(e,t){let r=t[0],s=t[1],o=t[2],l=this.getBisectorNormals(0,r,s,o)[0],h=this.getNormal(r,s,o),c=Math.sqrt(h[0]*h[0]+h[1]*h[1]),p,u;if(c>Ar){let g=this.mid(r,s),_=r[0]-g[0],d=r[1]-g[1],w=2/this.distance(r,s),P=-w*d,M=w*_,R=P*P-M*M,F=2*P*M,H=M*M-P*P,ee=l[0]-g[0],Y=l[1]-g[1];p=g[0]+R*ee+F*Y,u=g[1]+F*ee+H*Y}else p=r[0]+e*(s[0]-r[0]),u=r[1]+e*(s[1]-r[1]);return[p,u]}static getRightMostControlPoint(e,t){let r=t.length,s=t[r-3],o=t[r-2],n=t[r-1],h=this.getBisectorNormals(0,s,o,n)[1],c=this.getNormal(s,o,n),p=Math.sqrt(c[0]*c[0]+c[1]*c[1]),u,g;if(p>Ar){let _=this.mid(o,n),d=n[0]-_[0],T=n[1]-_[1],P=2/this.distance(o,n),M=-P*T,R=P*d,F=M*M-R*R,H=2*M*R,ee=R*R-M*M,Y=h[0]-_[0],B=h[1]-_[1];u=_[0]+F*Y+H*B,g=_[1]+H*Y+ee*B}else u=n[0]+e*(o[0]-n[0]),g=n[1]+e*(o[1]-n[1]);return[u,g]}static getBezierPoints(e){if(e.length<=2)return e;let t=[],r=e.length-1;for(let s=0;s<=1;s+=.01){let o=0,n=0;for(let l=0;l<=r;l++){let h=this.getBinomialFactor(r,l),c=Math.pow(s,l),p=Math.pow(1-s,r-l);o+=h*c*p*e[l][0],n+=h*c*p*e[l][1]}t.push([o,n])}return t.push(e[r]),t}static getBinomialFactor(e,t){return this.getFactorial(e)/(this.getFactorial(t)*this.getFactorial(e-t))}static getFactorial(e){if(e<=1)return 1;if(e===2)return 2;if(e===3)return 6;if(e===4)return 24;if(e===5)return 120;let t=1;for(let r=1;r<=e;r++)t*=r;return t}static getQBSplinePoints(e){if(e.length<=2)return e;let t=2,r=[],s=e.length-t-1;r.push(e[0]);for(let o=0;o<=s;o++)for(let n=0;n<=1;n+=.05){let l=0,h=0;for(let c=0;c<=t;c++){let p=this.getQuadricBSplineFactor(c,n);l+=p*e[o+c][0],h+=p*e[o+c][1]}r.push([l,h])}return r.push(e[e.length-1]),r}static getQuadricBSplineFactor(e,t){return e===0?Math.pow(t-1,2)/2:e===1?(-2*Math.pow(t,2)+2*t+1)/2:e===2?Math.pow(t,2)/2:0}},x=Mr;var Ir=class{constructor(e){this._viewer=e,this._options={}}_setViewerOption(){var e,t,r;return this._viewer.delegate.shadows=(t=(e=this._options)==null?void 0:e.shadows)!=null?t:!1,this._viewer.delegate.resolutionScale=((r=this._options)==null?void 0:r.resolutionScale)||1,this}_setCanvasOption(){return this._options.tabIndex&&this._viewer.scene.canvas.setAttribute("tabIndex",this._options.tabIndex),this}_setSceneOption(){var t,r,s,o,n;let e=this._viewer.scene;return e.skyAtmosphere.show=(t=this._options.showAtmosphere)!=null?t:!0,e.sun.show=(r=this._options.showSun)!=null?r:!0,e.moon.show=(s=this._options.showMoon)!=null?s:!0,e.postProcessStages.fxaa.enabled=(o=this._options.enableFxaa)!=null?o:!1,e.msaaSupported&&(e.msaaSamples=+this._options.msaaSamples||1),e.verticalExaggeration=this._options.verticalExaggeration||1,e.verticalExaggerationRelativeHeight=(n=this._options.verticalExaggerationRelativeHeight)!=null?n:0,this}_setSkyBoxOption(){var t;if(!this._options.skyBox)return this;let e=this._options.skyBox;if(e instanceof i.SkyBox)this._viewer.scene.skyBox=e;else{let r=this._viewer.scene.skyBox;r.show=(t=e.show)!=null?t:!0,e.offsetAngle&&(r.offsetAngle=e.offsetAngle),e!=null&&e.sources&&(r.sources=e.sources)}return this}_setGlobeOption(){var r,s,o,n,l,h,c,p,u,g,_,d;if(!this._options.globe)return this;let e=this._viewer.scene.globe,t=this._options.globe;if(C.merge(e,{show:(r=t==null?void 0:t.show)!=null?r:!0,showGroundAtmosphere:(s=t==null?void 0:t.showGroundAtmosphere)!=null?s:!0,enableLighting:(o=t==null?void 0:t.enableLighting)!=null?o:!1,depthTestAgainstTerrain:(n=t==null?void 0:t.depthTestAgainstTerrain)!=null?n:!1,tileCacheSize:+(t==null?void 0:t.tileCacheSize)||100,preloadSiblings:(l=t==null?void 0:t.preloadSiblings)!=null?l:!1,showSkirts:(h=t==null?void 0:t.showSkirts)!=null?h:!0,baseColor:(t==null?void 0:t.baseColor)||new i.Color(0,0,.5,1)}),C.merge(e.translucency,{enabled:(p=(c=t==null?void 0:t.translucency)==null?void 0:c.enabled)!=null?p:!1,backFaceAlpha:+((u=t==null?void 0:t.translucency)==null?void 0:u.backFaceAlpha)||1,backFaceAlphaByDistance:(g=t==null?void 0:t.translucency)==null?void 0:g.backFaceAlphaByDistance,frontFaceAlpha:+((_=t==null?void 0:t.translucency)==null?void 0:_.frontFaceAlpha)||1,frontFaceAlphaByDistance:(d=t==null?void 0:t.translucency)==null?void 0:d.frontFaceAlphaByDistance}),t!=null&&t.filterColor){let T=this._viewer.scene.globe._surfaceShaderSet.baseFragmentShaderSource,w=T.sources.pop();T.sources.push(w.replace("out_FragColor = finalColor;",`out_FragColor = finalColor * vec4${t.filterColor.toString()};`))}return this}_setCameraController(){var r,s,o,n,l,h,c;if(!((r=this._options)!=null&&r.cameraController))return this;let e=this._viewer.scene.screenSpaceCameraController,t=this._options.cameraController;return C.merge(e,{enableInputs:(s=t==null?void 0:t.enableInputs)!=null?s:!0,enableRotate:(o=t==null?void 0:t.enableRotate)!=null?o:!0,enableTilt:(n=t==null?void 0:t.enableTilt)!=null?n:!0,enableTranslate:(l=t==null?void 0:t.enableTranslate)!=null?l:!0,enableZoom:(h=t==null?void 0:t.enableZoom)!=null?h:!0,enableCollisionDetection:(c=t==null?void 0:t.enableCollisionDetection)!=null?c:!0,minimumZoomDistance:+(t==null?void 0:t.minimumZoomDistance)||1,maximumZoomDistance:+(t==null?void 0:t.maximumZoomDistance)||40489014}),this}setOptions(e){return Object.keys(e).length===0?this:(this._options={...this._options,...e},this._setViewerOption()._setCanvasOption()._setSceneOption()._setSkyBoxOption()._setGlobeOption()._setCameraController(),this)}},Sr=Ir;var Dr=class{constructor(e){this._viewer=e,this._mouseMode=0}setPitchRange(e,t){let r=new i.ScreenSpaceEventHandler(this._viewer.scene.canvas);this._viewer.scene.mode===i.SceneMode.SCENE3D&&(r.setInputAction(s=>{r.setInputAction(o=>{let n=!0,l=o.endPosition.y<o.startPosition.y;l&&this._viewer.camera.pitch>i.Math.toRadians(t)||!l&&this._viewer.camera.pitch<i.Math.toRadians(e)?n=!1:n=!0,this._viewer.scene.screenSpaceCameraController.enableTilt=n},i.ScreenSpaceEventType.MOUSE_MOVE)},this._mouseMode===Pe.LEFT_MIDDLE?i.ScreenSpaceEventType.MIDDLE_DOWN:i.ScreenSpaceEventType.RIGHT_DOWN),r.setInputAction(s=>{this._viewer.scene.screenSpaceCameraController.enableTilt=!0,r.removeInputAction(i.ScreenSpaceEventType.MOUSE_MOVE)},this._mouseMode===Pe.LEFT_MIDDLE?i.ScreenSpaceEventType.MIDDLE_UP:i.ScreenSpaceEventType.RIGHT_UP))}changeMouseMode(e){this._mouseMode=e||Pe.LEFT_MIDDLE,e===Pe.LEFT_MIDDLE?(this._viewer.scene.screenSpaceCameraController.tiltEventTypes=[i.CameraEventType.MIDDLE_DRAG,i.CameraEventType.PINCH,{eventType:i.CameraEventType.LEFT_DRAG,modifier:i.KeyboardEventModifier.CTRL},{eventType:i.CameraEventType.RIGHT_DRAG,modifier:i.KeyboardEventModifier.CTRL}],this._viewer.scene.screenSpaceCameraController.zoomEventTypes=[i.CameraEventType.RIGHT_DRAG,i.CameraEventType.WHEEL,i.CameraEventType.PINCH]):e===Pe.LEFT_RIGHT&&(this._viewer.scene.screenSpaceCameraController.tiltEventTypes=[i.CameraEventType.RIGHT_DRAG,i.CameraEventType.PINCH,{eventType:i.CameraEventType.LEFT_DRAG,modifier:i.KeyboardEventModifier.CTRL},{eventType:i.CameraEventType.RIGHT_DRAG,modifier:i.KeyboardEventModifier.CTRL}],this._viewer.scene.screenSpaceCameraController.zoomEventTypes=[i.CameraEventType.WHEEL,i.CameraEventType.PINCH])}},Lr=Dr;var _g={INITIALIZED:"initialized",ADDED:"added",REMOVED:"removed",CLEARED:"cleared",INSTALLED:"installed",ENABLED:"enabled",DISABLED:"disabled",PLAY:"play",PAUSE:"pause",RESTORE:"restore"},m=_g;var fg={},Rr=fg;var Or=class{constructor(){this._viewer=void 0,this._enable=!1,this._wrapper=void 0,this._ready=!1}set enable(e){this._enable!==e&&(this._enable=e,this._state=this._enable?m.ENABLED:m.DISABLED,this._enableHook&&this._enableHook())}get enable(){return this._enable}get state(){return this._state}_mountContent(){}_bindEvent(){}_unbindEvent(){}_enableHook(){!this._ready&&this._mountContent(),this._enable?(!this._wrapper.parentNode&&this._viewer.widgetContainer.appendChild(this._wrapper),this._bindEvent()):(this._unbindEvent(),this._wrapper.parentNode&&this._viewer.widgetContainer.removeChild(this._wrapper))}_updateWindowCoord(e){}_installHook(){}_getViewerOffset(){return this._viewer?this._viewer.getOffset():{x:0,y:0}}install(e){this._viewer=e,this._installHook&&this._installHook(),this._state=m.INSTALLED}setWrapper(e){return this}setContent(e){if(e&&typeof e=="string")this._wrapper.innerHTML=e;else if(e&&e instanceof Element){for(;this._wrapper.hasChildNodes();)this._wrapper.removeChild(this._wrapper.firstChild);this._wrapper.appendChild(e)}return this}hide(){this._wrapper&&(this._wrapper.style.cssText=`
1
+ var Dm=Object.defineProperty;var Rm=(a,e,t)=>e in a?Dm(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var Pi=(a,e,t)=>(Rm(a,typeof e!="symbol"?e+"":e,t),t);var zn={};function Wn(a,e){zn[a]=e}function Y(a){return zn[a]}var Gn={};function dt(a,e){Gn[a]=e}function bi(a){return Gn[a]}import*as i from"cesium";var Un=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Si=1,et=8,it=class a{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[t,r]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");let s=r>>4;if(s!==Si)throw new Error(`Got v${s} data when expected v${Si}.`);let o=Un[r&15];if(!o)throw new Error("Unrecognized array type.");let[n]=new Uint16Array(e,2,1),[l]=new Uint32Array(e,4,1);return new a(l,n,o,e)}constructor(e,t=64,r=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let o=Un.indexOf(this.ArrayType),n=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,h=(8-l%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,et,e),this.coords=new this.ArrayType(this.data,et+l+h,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(et+n+l+h),this.ids=new this.IndexArrayType(this.data,et,e),this.coords=new this.ArrayType(this.data,et+l+h,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Si<<4)+o]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){let r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Mi(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:n,nodeSize:l}=this,h=[0,o.length-1,0],c=[];for(;h.length;){let d=h.pop()||0,m=h.pop()||0,f=h.pop()||0;if(m-f<=l){for(let C=f;C<=m;C++){let E=n[2*C],b=n[2*C+1];E>=e&&E<=r&&b>=t&&b<=s&&c.push(o[C])}continue}let u=f+m>>1,p=n[2*u],x=n[2*u+1];p>=e&&p<=r&&x>=t&&x<=s&&c.push(o[u]),(d===0?e<=p:t<=x)&&(h.push(f),h.push(u-1),h.push(1-d)),(d===0?r>=p:s>=x)&&(h.push(u+1),h.push(m),h.push(1-d))}return c}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:s,coords:o,nodeSize:n}=this,l=[0,s.length-1,0],h=[],c=r*r;for(;l.length;){let d=l.pop()||0,m=l.pop()||0,f=l.pop()||0;if(m-f<=n){for(let C=f;C<=m;C++)Bn(o[2*C],o[2*C+1],e,t)<=c&&h.push(s[C]);continue}let u=f+m>>1,p=o[2*u],x=o[2*u+1];Bn(p,x,e,t)<=c&&h.push(s[u]),(d===0?e-r<=p:t-r<=x)&&(l.push(f),l.push(u-1),l.push(1-d)),(d===0?e+r>=p:t+r>=x)&&(l.push(u+1),l.push(m),l.push(1-d))}return h}};function Mi(a,e,t,r,s,o){if(s-r<=t)return;let n=r+s>>1;Vn(a,e,n,r,s,o),Mi(a,e,t,r,n-1,1-o),Mi(a,e,t,n+1,s,1-o)}function Vn(a,e,t,r,s,o){for(;s>r;){if(s-r>600){let c=s-r+1,d=t-r+1,m=Math.log(c),f=.5*Math.exp(2*m/3),u=.5*Math.sqrt(m*f*(c-f)/c)*(d-c/2<0?-1:1),p=Math.max(r,Math.floor(t-d*f/c+u)),x=Math.min(s,Math.floor(t+(c-d)*f/c+u));Vn(a,e,t,p,x,o)}let n=e[2*t+o],l=r,h=s;for(tt(a,e,r,t),e[2*s+o]>n&&tt(a,e,r,s);l<h;){for(tt(a,e,l,h),l++,h--;e[2*l+o]<n;)l++;for(;e[2*h+o]>n;)h--}e[2*r+o]===n?tt(a,e,r,h):(h++,tt(a,e,h,s)),h<=t&&(r=h+1),t<=h&&(s=h-1)}}function tt(a,e,t,r){Ai(a,t,r),Ai(e,2*t,2*r),Ai(e,2*t+1,2*r+1)}function Ai(a,e,t){let r=a[e];a[e]=a[t],a[t]=r}function Bn(a,e,t,r){let s=a-t,o=e-r;return s*s+o*o}var Om={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:a=>a},jn=Math.fround||(a=>e=>(a[0]=+e,a[0]))(new Float32Array(1)),ke=2,Te=3,Ii=4,xe=5,qn=6,Ue=class{constructor(e){this.options=Object.assign(Object.create(Om),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:t,minZoom:r,maxZoom:s}=this.options;t&&console.time("total time");let o=`prepare ${e.length} points`;t&&console.time(o),this.points=e;let n=[];for(let h=0;h<e.length;h++){let c=e[h];if(!c.geometry)continue;let[d,m]=c.geometry.coordinates,f=jn(pt(d)),u=jn(mt(m));n.push(f,u,1/0,h,-1,1),this.options.reduce&&n.push(0)}let l=this.trees[s+1]=this._createTree(n);t&&console.timeEnd(o);for(let h=s;h>=r;h--){let c=+Date.now();l=this.trees[h]=this._createTree(this._cluster(l,h)),t&&console.log("z%d: %d clusters in %dms",h,l.numItems,+Date.now()-c)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180,s=Math.max(-90,Math.min(90,e[1])),o=e[2]===180?180:((e[2]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){let m=this.getClusters([r,s,180,n],t),f=this.getClusters([-180,s,o,n],t);return m.concat(f)}let l=this.trees[this._limitZoom(t)],h=l.range(pt(r),mt(n),pt(o),mt(s)),c=l.data,d=[];for(let m of h){let f=this.stride*m;d.push(c[f+xe]>1?Yn(c,f,this.clusterProps):this.points[c[f+Te]])}return d}getChildren(e){let t=this._getOriginId(e),r=this._getOriginZoom(e),s="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(s);let n=o.data;if(t*this.stride>=n.length)throw new Error(s);let l=this.options.radius/(this.options.extent*Math.pow(2,r-1)),h=n[t*this.stride],c=n[t*this.stride+1],d=o.within(h,c,l),m=[];for(let f of d){let u=f*this.stride;n[u+Ii]===e&&m.push(n[u+xe]>1?Yn(n,u,this.clusterProps):this.points[n[u+Te]])}if(m.length===0)throw new Error(s);return m}getLeaves(e,t,r){t=t||10,r=r||0;let s=[];return this._appendLeaves(s,e,t,r,0),s}getTile(e,t,r){let s=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:n,radius:l}=this.options,h=l/n,c=(r-h)/o,d=(r+1+h)/o,m={features:[]};return this._addTileFeatures(s.range((t-h)/o,c,(t+1+h)/o,d),s.data,t,r,o,m),t===0&&this._addTileFeatures(s.range(1-h/o,c,1,d),s.data,o,r,o,m),t===o-1&&this._addTileFeatures(s.range(0,c,h/o,d),s.data,-1,r,o,m),m.features.length?m:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){let r=this.getChildren(e);if(t++,r.length!==1)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,s,o){let n=this.getChildren(t);for(let l of n){let h=l.properties;if(h&&h.cluster?o+h.point_count<=s?o+=h.point_count:o=this._appendLeaves(e,h.cluster_id,r,s,o):o<s?o++:e.push(l),e.length===r)break}return o}_createTree(e){let t=new it(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)t.add(e[r],e[r+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,r,s,o,n){for(let l of e){let h=l*this.stride,c=t[h+xe]>1,d,m,f;if(c)d=Zn(t,h,this.clusterProps),m=t[h],f=t[h+1];else{let x=this.points[t[h+Te]];d=x.properties;let[C,E]=x.geometry.coordinates;m=pt(C),f=mt(E)}let u={type:1,geometry:[[Math.round(this.options.extent*(m*o-r)),Math.round(this.options.extent*(f*o-s))]],tags:d},p;c||this.options.generateId?p=t[h+Te]:p=this.points[t[h+Te]].id,p!==void 0&&(u.id=p),n.features.push(u)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){let{radius:r,extent:s,reduce:o,minPoints:n}=this.options,l=r/(s*Math.pow(2,t)),h=e.data,c=[],d=this.stride;for(let m=0;m<h.length;m+=d){if(h[m+ke]<=t)continue;h[m+ke]=t;let f=h[m],u=h[m+1],p=e.within(h[m],h[m+1],l),x=h[m+xe],C=x;for(let E of p){let b=E*d;h[b+ke]>t&&(C+=h[b+xe])}if(C>x&&C>=n){let E=f*x,b=u*x,R,S=-1,I=((m/d|0)<<5)+(t+1)+this.points.length;for(let L of p){let k=L*d;if(h[k+ke]<=t)continue;h[k+ke]=t;let F=h[k+xe];E+=h[k]*F,b+=h[k+1]*F,h[k+Ii]=I,o&&(R||(R=this._map(h,m,!0),S=this.clusterProps.length,this.clusterProps.push(R)),o(R,this._map(h,k)))}h[m+Ii]=I,c.push(E/C,b/C,1/0,I,-1,C),o&&c.push(S)}else{for(let E=0;E<d;E++)c.push(h[m+E]);if(C>1)for(let E of p){let b=E*d;if(!(h[b+ke]<=t)){h[b+ke]=t;for(let R=0;R<d;R++)c.push(h[b+R])}}}}return c}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+xe]>1){let n=this.clusterProps[e[t+qn]];return r?Object.assign({},n):n}let s=this.points[e[t+Te]].properties,o=this.options.map(s);return r&&o===s?Object.assign({},o):o}};function Yn(a,e,t){return{type:"Feature",id:a[e+Te],properties:Zn(a,e,t),geometry:{type:"Point",coordinates:[km(a[e]),Nm(a[e+1])]}}}function Zn(a,e,t){let r=a[e+xe],s=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=a[e+qn],n=o===-1?{}:Object.assign({},t[o]);return Object.assign(n,{cluster:!0,cluster_id:a[e+Te],point_count:r,point_count_abbreviated:s})}function pt(a){return a/360+.5}function mt(a){let e=Math.sin(a*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function km(a){return(a-.5)*360}function Nm(a){let e=(180-a*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var Xn=new i.WebMercatorProjection,Li=class{static transformCartesianToWGS84(e){if(e){let t=i.Ellipsoid.WGS84.cartesianToCartographic(e);return new Z(i.Math.toDegrees((t==null?void 0:t.longitude)||0),i.Math.toDegrees((t==null?void 0:t.latitude)||0),t.height||0)}return new Z(0,0)}static transformCartographicToWGS84(e){return e?new Z(i.Math.toDegrees((e==null?void 0:e.longitude)||0),i.Math.toDegrees((e==null?void 0:e.latitude)||0),e.height||0):new Z(0,0)}static transformWGS84ToCartesian(e){return e?i.Cartesian3.fromDegrees(e.lng,e.lat,e.alt,i.Ellipsoid.WGS84):i.Cartesian3.ZERO}static transformWGS84ToCartographic(e){return e?i.Cartographic.fromDegrees(e.lng,e.lat,e.alt):i.Cartographic.ZERO}static transformCartesianArrayToWGS84Array(e){return e?e.map(t=>this.transformCartesianToWGS84(t)):[]}static transformWGS84ArrayToCartesianArray(e){return e?e.map(t=>this.transformWGS84ToCartesian(t)):[]}static transformWGS84ToMercator(e){let t=Xn.project(i.Cartographic.fromDegrees(e.lng,e.lat,e.alt));return new Z(t.x,t.y,t.z)}static transformMercatorToWGS84(e){let t=Xn.unproject(new i.Cartesian3(e.lng,e.lat,e.alt));return new Z(i.Math.toDegrees(t.longitude),i.Math.toDegrees(t.latitude),t.height)}static transformWindowToWGS84(e,t){let r=t.scene,s;if(r.mode===i.SceneMode.SCENE3D){let o=r.camera.getPickRay(e);s=r.globe.pick(o,r)}else s=r.camera.pickEllipsoid(e,i.Ellipsoid.WGS84);return this.transformCartesianToWGS84(s)}static transformWGS84ToWindow(e,t){let r=t.scene;return i.SceneTransforms.worldToWindowCoordinates(r,this.transformWGS84ToCartesian(e))}},g=Li;var ut=52.35987755982988,ee=3.141592653589793,Jn=6378245,$n=.006693421622965943,Di=class{static BD09ToGCJ02(e,t){let r=+e-.0065,s=+t-.006,o=Math.sqrt(r*r+s*s)-2e-5*Math.sin(s*ut),n=Math.atan2(s,r)-3e-6*Math.cos(r*ut),l=o*Math.cos(n),h=o*Math.sin(n);return[l,h]}static GCJ02ToBD09(e,t){t=+t,e=+e;let r=Math.sqrt(e*e+t*t)+2e-5*Math.sin(t*ut),s=Math.atan2(t,e)+3e-6*Math.cos(e*ut),o=r*Math.cos(s)+.0065,n=r*Math.sin(s)+.006;return[o,n]}static WGS84ToGCJ02(e,t){if(t=+t,e=+e,this.out_of_china(e,t))return[e,t];{let r=this.delta(e,t);return[e+r[0],t+r[1]]}}static GCJ02ToWGS84(e,t){if(t=+t,e=+e,this.out_of_china(e,t))return[e,t];{let r=[e,t],s=this.WGS84ToGCJ02(e,t),o=s[0]-e,n=s[1]-t;do s=this.WGS84ToGCJ02(r[0]-=o,r[1]-=n),o=s[0]-e,n=s[1]-t;while(Math.abs(o)>1e-7||Math.abs(n)>1e-7);return r}}static delta(e,t){let r=this.transformLng(e-105,t-35),s=this.transformLat(e-105,t-35),o=t/180*ee,n=Math.sin(o);n=1-$n*n*n;let l=Math.sqrt(n);return r=r*180/(Jn/l*Math.cos(o)*ee),s=s*180/(Jn*(1-$n)/(n*l)*ee),[r,s]}static transformLng(e,t){t=+t,e=+e;let r=300+e+2*t+.1*e*e+.1*e*t+.1*Math.sqrt(Math.abs(e));return r+=(20*Math.sin(6*e*ee)+20*Math.sin(2*e*ee))*2/3,r+=(20*Math.sin(e*ee)+40*Math.sin(e/3*ee))*2/3,r+=(150*Math.sin(e/12*ee)+300*Math.sin(e/30*ee))*2/3,r}static transformLat(e,t){t=+t,e=+e;let r=-100+2*e+3*t+.2*t*t+.1*e*t+.2*Math.sqrt(Math.abs(e));return r+=(20*Math.sin(6*e*ee)+20*Math.sin(2*e*ee))*2/3,r+=(20*Math.sin(t*ee)+40*Math.sin(t/3*ee))*2/3,r+=(160*Math.sin(t/12*ee)+320*Math.sin(t*ee/30))*2/3,r}static out_of_china(e,t){return t=+t,e=+e,!(e>73.66&&e<135.05&&t>3.86&&t<53.55)}},ue=Di;var Ri=class a{constructor(e,t,r,s,o,n){this._lng=+e||0,this._lat=+t||0,this._alt=+r||0,this._heading=+s||0,this._pitch=+o||0,this._roll=+n||0}set lng(e){this._lng=+e}get lng(){return this._lng}set lat(e){this._lat=+e}get lat(){return this._lat}set alt(e){this._alt=+e}get alt(){return this._alt}set heading(e){this._heading=+e}get heading(){return this._heading}set pitch(e){this._pitch=+e}get pitch(){return this._pitch}set roll(e){this._roll=+e}get roll(){return this._roll}serialize(){let e=new a(this._lng,this._lat,this._alt,this._heading,this._pitch,this._roll);return JSON.stringify(e)}distance(e){return!e||!(e instanceof a)?0:i.Cartesian3.distance(g.transformWGS84ToCartesian(this),g.transformWGS84ToCartesian(e))}clone(){let e=new a;return e.lng=this.lng||0,e.lat=this.lat||0,e.alt=this.alt||0,e.heading=this.heading||0,e.pitch=this.pitch||0,e.roll=this.roll||0,e}copy(){return this.clone()}toArray(){return[this.lng,this.lat,this.alt,this.heading,this.pitch,this.roll]}toString(){return`${this.lng},${this.lat},${this.alt},${this.heading},${this.pitch},${this.roll}`}toObject(){return{lng:this.lng,lat:this.lat,alt:this.alt,heading:this.heading,pitch:this.pitch,roll:this.roll}}static fromArray(e){let t=new a;return Array.isArray(e)&&(t.lng=e[0]||0,t.lat=e[1]||0,t.alt=e[2]||0,t.heading=e[3]||0,t.pitch=e[4]||0,t.roll=e[5]||0),t}static fromString(e){let t=new a;if(e&&typeof e=="string"){let r=e.split(",");t=this.fromArray(r)}return t}static fromObject(e){return new a(e.lng,e.lat,e.alt,e.heading,e.pitch,e.roll)}static deserialize(e){let t=new a,r=JSON.parse(e);return r&&(t.lng=r.lng||0,t.lat=r.lat||0,t.alt=r.alt||0,t.heading=r.heading||0,t.pitch=r.pitch||0,t.roll=r.roll||0),t}},Z=Ri;var Oi=class{static parsePosition(e){let t=new Z;return e&&(typeof e=="string"?t=Z.fromString(e):Array.isArray(e)?t=Z.fromArray(e):!(Object(e)instanceof Z)&&Object(e).hasOwnProperty("lng")&&Object(e).hasOwnProperty("lat")?t=Z.fromObject(e):Object(e)instanceof Z?t=e:Object(e)instanceof i.Cartesian3?t=g.transformCartesianToWGS84(e):Object(e)instanceof i.Cartographic&&(t=g.transformCartographicToWGS84(e))),t}static parsePositions(e){if(typeof e=="string"){if(e.indexOf("#")>=0)throw new Error("the positions invalid");e=e.split(";").filter(t=>!!t)}return e.map(t=>this.parsePosition(t))}static parsePointCoordToArray(e){return e=this.parsePosition(e),[e.lng,e.lat]}static parsePolylineCoordToArray(e){let t=[];return e=this.parsePositions(e),e.forEach(r=>{t.push([r.lng,r.lat])}),t}static parsePolygonCoordToArray(e,t=!1){let r=[];return e=this.parsePositions(e),e.forEach(s=>{r.push([s.lng,s.lat])}),t&&r.length>0&&r.push(r[0]),[r]}},y=Oi;var rt={ADD:"add",REMOVE:"remove"},H={LEFT_DOWN:i.ScreenSpaceEventType.LEFT_DOWN,LEFT_UP:i.ScreenSpaceEventType.LEFT_UP,CLICK:i.ScreenSpaceEventType.LEFT_CLICK,RIGHT_DOWN:i.ScreenSpaceEventType.RIGHT_DOWN,RIGHT_UP:i.ScreenSpaceEventType.RIGHT_UP,RIGHT_CLICK:i.ScreenSpaceEventType.RIGHT_CLICK,DB_CLICK:i.ScreenSpaceEventType.LEFT_DOUBLE_CLICK,MOUSE_MOVE:i.ScreenSpaceEventType.MOUSE_MOVE,WHEEL:i.ScreenSpaceEventType.WHEEL,MOUSE_OVER:"mouseover",MOUSE_OUT:"mouseout"},Kn={ADD_LAYER:"addLayer",REMOVE_LAYER:"removeLayer",ADD_EFFECT:"addEffect",REMOVE_EFFECT:"removeEffect",LEFT_DOWN:i.ScreenSpaceEventType.LEFT_DOWN,LEFT_UP:i.ScreenSpaceEventType.LEFT_UP,CLICK:i.ScreenSpaceEventType.LEFT_CLICK,RIGHT_DOWN:i.ScreenSpaceEventType.RIGHT_DOWN,RIGHT_UP:i.ScreenSpaceEventType.RIGHT_UP,RIGHT_CLICK:i.ScreenSpaceEventType.RIGHT_CLICK,DB_CLICK:i.ScreenSpaceEventType.LEFT_DOUBLE_CLICK,MOUSE_MOVE:i.ScreenSpaceEventType.MOUSE_MOVE,WHEEL:i.ScreenSpaceEventType.WHEEL},D={CAMERA_MOVE_END:"cameraMoveEnd",CAMERA_CHANGED:"cameraChanged",PRE_UPDATE:"preUpdate",POST_UPDATE:"postUpdate",PRE_RENDER:"preRender",POST_RENDER:"postRender",MORPH_COMPLETE:"morphComplete",CLOCK_TICK:"clockTick",RENDER_ERROR:"renderError"},Ee={...rt,LEFT_DOWN:i.ScreenSpaceEventType.LEFT_DOWN,LEFT_UP:i.ScreenSpaceEventType.LEFT_UP,CLICK:i.ScreenSpaceEventType.LEFT_CLICK,RIGHT_DOWN:i.ScreenSpaceEventType.RIGHT_DOWN,RIGHT_UP:i.ScreenSpaceEventType.RIGHT_UP,RIGHT_CLICK:i.ScreenSpaceEventType.RIGHT_CLICK,DB_CLICK:i.ScreenSpaceEventType.LEFT_DOUBLE_CLICK,MOUSE_MOVE:i.ScreenSpaceEventType.MOUSE_MOVE,MOUSE_OVER:"mouseover",MOUSE_OUT:"mouseout",POSITION_UPDATE:"positionUpdate"},Ne={READY:"ready",TEX_READY:"texturesReady"},J={INITIAL_TILES_LOADED:"initialTilesLoaded",ALL_TILES_LOADED:"allTilesLoaded ",LOAD_PROGRESS:"loadProgress ",TILE_FAILED:"tileFailed ",TILE_LOAD:"tileLoad",TILE_UNLOAD:"tileUnload",TILE_VISIBLE:"tileVisible"},Pe=rt,be={...rt,LEFT_DOWN:i.ScreenSpaceEventType.LEFT_DOWN,LEFT_UP:i.ScreenSpaceEventType.LEFT_UP,CLICK:i.ScreenSpaceEventType.LEFT_CLICK,RIGHT_DOWN:i.ScreenSpaceEventType.RIGHT_DOWN,RIGHT_UP:i.ScreenSpaceEventType.RIGHT_UP,RIGHT_CLICK:i.ScreenSpaceEventType.RIGHT_CLICK,DB_CLICK:i.ScreenSpaceEventType.LEFT_DOUBLE_CLICK},le={...rt,POST_RENDER:"postRender",ACTIVATE:"activate",DEACTIVATE:"deactivate",RESET_TIME_LINE:"restTimeLine"},he={...rt,POST_RENDER:"postRender",RESET_TIME_LINE:"restTimeLine"},P={DRAW_START:"drawStart",DRAW_STOP:"drawStop",EDIT_START:"editStart",EDIT_STOP:"editEnd",DRAW_ANCHOR:"drawAnchor",CREATE_ANCHOR:"createAnchor",UPDATE_ANCHOR:"updateAnchor",ANCHOR_MOVING:"anchorMoving",EDIT_ANCHOR_STOP:"editAnchorStop",CLEAR_ANCHOR:"clearAnchor"};var ki=class{constructor(e){this._types=e,this._cache={}}_on(e,t,r){let s=this.getEvent(e),o;return s&&t&&(o=s.addEventListener(t,r||this)),o}_off(e,t,r){let s=this.getEvent(e),o=!1;return s&&t&&(o=s.removeEventListener(t,r||this)),o}_fire(e,t){let r=this.getEvent(e);r&&r.raiseEvent(t)}_registerEvent(){Object.keys(this._types).forEach(e=>{let t=this._types[e];this._cache[t]=new i.Event})}on(e,t,r){return this._on(e,t,r)}once(e,t,r){let s=this._on(e,o=>{t(o),s&&s()},r)}off(e,t,r){return this._off(e,t,r)}fire(e,t){this._fire(e,t)}getEvent(e){return this._cache[e]||void 0}},B=ki;var Ni=class extends B{constructor(e,t={}){super(H),this._viewer=e,this._selected=void 0,this._enableEventPropagation=t.enableEventPropagation,this._enableMouseOver=t.enableMouseOver,this._enableMouseMovePick=t.enableMouseMovePick,this._registerEvent(),this._addDefaultEvent()}_registerEvent(){let e=new i.ScreenSpaceEventHandler(this._viewer.canvas);Object.keys(i.ScreenSpaceEventType).forEach(t=>{let r=i.ScreenSpaceEventType[t];this._cache[r]=new i.Event,e.setInputAction(s=>{this._cache[r].raiseEvent(s)},r)})}_addDefaultEvent(){this.on(this._types.LEFT_DOWN,this._leftDownHandler,this),this.on(this._types.LEFT_UP,this._leftUpHandler,this),this.on(this._types.CLICK,this._clickHandler,this),this.on(this._types.DB_CLICK,this._dbClickHandler,this),this.on(this._types.RIGHT_DOWN,this._rightDownHandler,this),this.on(this._types.RIGHT_UP,this._rightUpHandler,this),this.on(this._types.RIGHT_CLICK,this._rightClickHandler,this),this.on(this._types.MOUSE_MOVE,this._mouseMoveHandler,this),this.on(this._types.WHEEL,this._mouseWheelHandler,this)}_adjustPosition(e){let t=this._viewer.canvas.getBoundingClientRect(),r=this._viewer.canvas.offsetWidth/t.width,s=this._viewer.canvas.offsetHeight/t.height;return new i.Cartesian2(e.x*r,e.y*s)}_getMousePosition(e){let t=this._viewer.scene,r,s,o,n;if(t.pickPositionSupported&&(r=t.pickPosition(e)),r){let l=i.Ellipsoid.WGS84.cartesianToCartographic(r);l&&(o={lng:i.Math.toDegrees(l.longitude),lat:i.Math.toDegrees(l.latitude),alt:l.height})}if(t.mode===i.SceneMode.SCENE3D&&!(this._viewer.terrainProvider instanceof i.EllipsoidTerrainProvider)){let l=t.camera.getPickRay(e);s=t.globe.pick(l,t)}else s=t.camera.pickEllipsoid(e,i.Ellipsoid.WGS84);if(s){let l=i.Ellipsoid.WGS84.cartesianToCartographic(s);l&&(n={lng:i.Math.toDegrees(l.longitude),lat:i.Math.toDegrees(l.latitude),alt:l.height})}return{windowPosition:e,position:r,wgs84Position:o,surfacePosition:s,wgs84SurfacePosition:n}}_getMouseInfo(e){return{...this._getMousePosition(this._adjustPosition(e)),target:this._viewer.scene.pick(this._adjustPosition(e))}}_getDrillInfos(e){let t=[],s=this._viewer.scene.drillPick(e);return s&&s.length&&s.forEach(o=>{t.push(this._getTargetInfo(o))}),t}_getOverlayId(e){let t;return(e==null?void 0:e.id)instanceof i.Entity?t=e.id.overlayId:e instanceof i.Cesium3DTileFeature?t=e.tileset.overlayId:((e==null?void 0:e.primitive)instanceof i.Cesium3DTileset||e!=null&&e.primitive)&&(t=e.primitive.overlayId),t}_getTargetInfo(e){let t,r,s;return(e==null?void 0:e.id)instanceof i.Entity?(r=this._viewer.getLayers().filter(o=>o.layerId===e.id.layerId)[0],r!=null&&r.getOverlay&&(t=r.getOverlay(e.id.overlayId))):e instanceof i.Cesium3DTileFeature?(r=this._viewer.getLayers().filter(o=>o.layerId===e.tileset.layerId)[0],s=e,r!=null&&r.getOverlay&&(t=r.getOverlay(e.tileset.overlayId),s&&s.getPropertyNames&&s.getPropertyNames().forEach(n=>{t.attr[n]=s.getProperty(n)}))):(e==null?void 0:e.primitive)instanceof i.Cesium3DTileset?(r=this._viewer.getLayers().filter(o=>o.layerId===e.primitive.layerId)[0],r!=null&&r.getOverlay&&(t=r.getOverlay(e.primitive.overlayId))):e!=null&&e.primitive&&(r=this._viewer.getLayers().filter(o=>o.layerId===e.primitive.layerId)[0],r!=null&&r.getOverlay&&(t=r.getOverlay(e.primitive.overlayId))),{layer:r,overlay:t,feature:s,instanceId:e==null?void 0:e.instanceId}}_raiseEvent(e,t={}){var l;let r,s=this._getTargetInfo(t.target),o=s==null?void 0:s.overlay,n=s==null?void 0:s.layer;o!=null&&o.overlayEvent&&(r=o.overlayEvent.getEvent(e),r&&r.numberOfListeners>0&&r.raiseEvent({...s,...t})),(!r||r.numberOfListeners===0||this._eventPropagation)&&(n!=null&&n.layerEvent)&&(r=n.layerEvent.getEvent(e),r&&r.numberOfListeners>0&&r.raiseEvent({...s,...t})),(!r||r.numberOfListeners===0||this._enableEventPropagation)&&((l=this._viewer)!=null&&l.viewerEvent)&&(r=this._viewer.viewerEvent.getEvent(e),r&&r.numberOfListeners>0&&r.raiseEvent({...s,...t})),o!=null&&o.allowDrillPicking&&this._getDrillInfos(t.windowPosition).forEach(c=>{let d=c==null?void 0:c.overlay,m=c==null?void 0:c.layer;(d==null?void 0:d.overlayId)!==o.overlayId&&(d!=null&&d.overlayEvent)&&(r=d.overlayEvent.getEvent(e),(!r||r.numberOfListeners===0)&&(m!=null&&m.layerEvent)&&(r=m.layerEvent.getEvent(e)),r&&r.numberOfListeners>0&&r.raiseEvent({...c,...t}))})}_clickHandler(e){if(!(e!=null&&e.position))return!1;this._raiseEvent(H.CLICK,this._getMouseInfo(e.position))}_dbClickHandler(e){if(!(e!=null&&e.position))return!1;this._raiseEvent(H.DB_CLICK,this._getMouseInfo(e.position))}_rightClickHandler(e){if(!(e!=null&&e.position))return!1;this._raiseEvent(H.RIGHT_CLICK,this._getMouseInfo(e.position))}_mouseMoveHandler(e){if(!(e!=null&&e.endPosition))return!1;if(this._enableMouseMovePick){let t=this._getMouseInfo(e.endPosition);this._viewer.canvas.style.cursor=t.target?"pointer":"default",this._raiseEvent(H.MOUSE_MOVE,t),this._enableMouseOver&&(!this._selected||this._getOverlayId(this._selected.target)!==this._getOverlayId(t.target))&&(this._raiseEvent(H.MOUSE_OUT,this._selected),this._raiseEvent(H.MOUSE_OVER,t),this._selected=t)}else this._raiseEvent(H.MOUSE_MOVE,this._getMousePosition(this._adjustPosition(e.endPosition)))}_leftDownHandler(e){if(!(e!=null&&e.position))return!1;this._raiseEvent(H.LEFT_DOWN,this._getMouseInfo(e.position))}_leftUpHandler(e){this._raiseEvent(H.LEFT_UP,this._getMouseInfo(e.position))}_rightDownHandler(e){if(!(e!=null&&e.position))return!1;this._raiseEvent(H.RIGHT_DOWN,this._getMouseInfo(e.position))}_rightUpHandler(e){this._raiseEvent(H.RIGHT_UP,this._getMouseInfo(e.position))}_mouseWheelHandler(e){this._raiseEvent(H.WHEEL,{movement:e})}},Fi=Ni;var Hi=class extends B{constructor(){super(Kn),this._registerEvent()}},zi=Hi;var Wi=class extends B{constructor(e){super(D),this._camera=e.camera,this._scene=e.scene,this._clock=e.clock}on(e,t,r){let s;switch(e){case D.CAMERA_MOVE_END:s=this._camera.moveEnd.addEventListener(t,r||this);break;case D.CAMERA_CHANGED:s=this._camera.changed.addEventListener(t,r||this);break;case D.PRE_UPDATE:s=this._scene.preUpdate.addEventListener(t,r||this);break;case D.POST_UPDATE:s=this._scene.postUpdate.addEventListener(t,r||this);break;case D.PRE_RENDER:s=this._scene.preRender.addEventListener(t,r||this);break;case D.POST_RENDER:s=this._scene.postRender.addEventListener(t,r||this);break;case D.MORPH_COMPLETE:s=this._scene.morphComplete.addEventListener(t,r||this);break;case D.CLOCK_TICK:s=this._clock.onTick.addEventListener(t,r||this);break;case D.RENDER_ERROR:s=this._scene.renderError.addEventListener(t,r||this);break;default:break}return s}off(e,t,r){let s=!1;switch(e){case D.CAMERA_MOVE_END:s=this._camera.moveEnd.removeEventListener(t,r||this);break;case D.CAMERA_CHANGED:s=this._camera.changed.removeEventListener(t,r||this);break;case D.PRE_UPDATE:s=this._scene.preUpdate.removeEventListener(t,r||this);break;case D.POST_UPDATE:s=this._scene.postUpdate.removeEventListener(t,r||this);break;case D.PRE_RENDER:s=this._scene.preRender.removeEventListener(t,r||this);break;case D.POST_RENDER:s=this._scene.postRender.removeEventListener(t,r||this);break;case D.MORPH_COMPLETE:s=this._scene.morphComplete.removeEventListener(t,r||this);break;case D.CLOCK_TICK:s=this._clock.onTick.removeEventListener(t,r||this);break;case D.RENDER_ERROR:s=this._scene.renderError.removeEventListener(t,r||this);break;default:break}return s}},Gi=Wi;var Ui=class extends B{constructor(){super(Pe),this._registerEvent()}},Bi=Ui;var Vi=class extends B{constructor(){super(be),this._registerEvent()}},ji=Vi;var Yi=class extends B{constructor(){super(Ee),this._registerEvent()}},qi=Yi;var Zi=class extends B{constructor(e){super(J),this._tileset=e}on(e,t,r){return this._tileset.then(s=>{switch(e){case J.INITIAL_TILES_LOADED:s.initialTilesLoaded.addEventListener(t,r||this);break;case J.ALL_TILES_LOADED:s.allTilesLoaded.addEventListener(t,r||this);break;case J.LOAD_PROGRESS:s.loadProgress.addEventListener(t,r||this);break;case J.TILE_FAILED:s.tileFailed.addEventListener(t,r||this);break;case J.TILE_LOAD:s.tileLoad.addEventListener(t,r||this);break;case J.TILE_UNLOAD:s.tileUnload.addEventListener(t,r||this);break;case J.TILE_VISIBLE:s.tileVisible.addEventListener(t,r||this);break;default:break}}),null}off(e,t,r){return this._tileset.then(s=>{switch(e){case J.INITIAL_TILES_LOADED:s.initialTilesLoaded.removeEventListener(t,r||this);break;case J.ALL_TILES_LOADED:s.allTilesLoaded.removeEventListener(t,r||this);break;case J.LOAD_PROGRESS:s.loadProgress.removeEventListener(t,r||this);break;case J.TILE_FAILED:s.tileFailed.removeEventListener(t,r||this);break;case J.TILE_LOAD:s.tileLoad.removeEventListener(t,r||this);break;case J.TILE_UNLOAD:s.tileUnload.removeEventListener(t,r||this);break;case J.TILE_VISIBLE:s.tileVisible.removeEventListener(t,r||this);break;default:break}}),!0}},Xi=Zi;var Ji=class extends B{constructor(e){super(Ne),this._model=e}on(e,t,r){return this._model.then(s=>{switch(e){case Ne.READY:s.readyEvent.addEventListener(t,r||this);break;case Ne.TEX_READY:s.texturesReadyEvent.addEventListener(t,r||this);break;default:break}}),null}off(e,t,r){return this._model.then(s=>{switch(e){case Ne.READY:s.readyEvent.removeEventListener(t,r||this);break;case Ne.TEX_READY:s.texturesReadyEvent.removeEventListener(t,r||this);break;default:break}}),!0}},$i=Ji;var Ki=class extends B{constructor(){super(le),this._registerEvent()}},Qi=Ki;var er=class extends B{constructor(){super(he),this._registerEvent()}},tr=er;var ir=class extends B{constructor(){super(P),this._registerEvent()}},st=ir;var Fm={LEFT_MIDDLE:0,LEFT_RIGHT:1},Se=Fm;var Hm="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),rr=class{static uuid(e="D"){let t=[];t[8]=t[13]=t[18]=t[23]="-",t[14]="4";let r;for(let s=0;s<36;s++)t[s]||(r=0|Math.random()*16,t[s]=Hm[s===19?r&3|8:r]);return e+"-"+t.join("")}static merge(e,...t){let r,s,o,n;for(s=0,o=t.length;s<o;s++){n=t[s];for(r in n)e[r]=n[r]}return e}static splitWords(e){return this.trim(e).split(/\s+/)}static setOptions(e,t){e.hasOwnProperty("options")||(e.options=e.options?Object.create(e.options):{});for(let r in t)e.options[r]=t[r];return e.options}static formatNum(e,t){let r=Math.pow(10,t===void 0?6:t);return Math.round(e*r)/r}static trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}static emptyImageUrl(){return function(){return"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}()}static checkPosition(e){return e&&e.hasOwnProperty("_lng")&&e.hasOwnProperty("_lat")&&e.hasOwnProperty("_alt")}static debounce(e,t){let r=null;return function(){r&&clearTimeout(r),r=setTimeout(e,t)}}static throttle(e,t){let r=!0;return function(){if(!r)return!1;r=!1,setTimeout(()=>{e(),r=!0},t)}}static dataURLtoBlob(e){let t=e.split(","),r=t[0].match(/:(.*?);/)[1],s=atob(t[1]),o=s.length,n=new Uint8Array(o);for(;o--;)n[o]=s.charCodeAt(o);return new Blob([n],{type:r})}static isPromise(e){return Promise.resolve(e)==e}},v=rr;var sr=class{static get(e){return typeof e=="string"?document.getElementById(e):e}static getStyle(e,t){let r=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!r||r==="auto")&&document.defaultView){let s=document.defaultView.getComputedStyle(e,null);r=s?s[t]:null}return r==="auto"?null:r}static create(e,t,r=null){let s=document.createElement(e);return s.className=t||"",r&&r.appendChild(s),s}static remove(e){let t=e.parentNode;t&&t.removeChild(e)}static empty(e){for(;e.firstChild;)e.removeChild(e.firstChild)}static hasClass(e,t){if(e.classList!==void 0)return e.classList.contains(t);let r=this.getClass(e);return r.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(r)}static addClass(e,t){if(e.classList!==void 0){let r=v.splitWords(t);for(let s=0,o=r.length;s<o;s++)e.classList.add(r[s])}else if(!this.hasClass(e,t)){let r=this.getClass(e);this.setClass(e,(r?r+" ":"")+t)}}static removeClass(e,t){e.classList!==void 0?e.classList.remove(t):this.setClass(e,v.trim((" "+this.getClass(e)+" ").replace(" "+t+" "," ")))}static setClass(e,t){e.className.baseVal===void 0?e.className=t:e.className.baseVal=t}static getClass(e){return e.correspondingElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}static createSvg(e,t,r,s){let o=document.createElementNS("http://www.w3.org/2000/svg","svg:svg");o.setAttribute("class","svg-path"),o.setAttribute("width",e),o.setAttribute("height",t),o.setAttribute("viewBox",`0 0 ${e} ${t}`);let n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",r),o.appendChild(n),s&&s.appendChild(o),o}static parseDom(e,t,r){t=t!=null?t:!1;let s=document.createElement("div");return s.className=r||"",s.innerHTML=e,t?s:s.childNodes}static enterFullscreen(e){e&&(e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen())}static exitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}static createVideo(e,t,r=null){let s=this.create("video",t,r),o=this.create("source","",s);o.setAttribute("src",e),o.setAttribute("type","video/map4");let n=this.create("source","",s);return n.setAttribute("src",e),n.setAttribute("type","video/quicktime"),s}},M=sr;var or=Math.PI*2,_t=100,ar=1e-4,nr=class{static distance(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))}static wholeDistance(e){let t=0;for(let r=0;r<e.length-1;r++)t+=this.distance(e[r],e[r+1]);return t}static getBaseLength(e){return Math.pow(this.wholeDistance(e),.99)}static mid(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}static getCircleCenterOfThreePoints(e,t,r){let s=[(e[0]+t[0])/2,(e[1]+t[1])/2],o=[s[0]-e[1]+t[1],s[1]+e[0]-t[0]],n=[(e[0]+r[0])/2,(e[1]+r[1])/2],l=[n[0]-e[1]+r[1],n[1]+e[0]-r[0]];return this.getIntersectPoint(s,o,n,l)}static getIntersectPoint(e,t,r,s){let o,n,l,h;return e[1]===t[1]?(l=(s[0]-r[0])/(s[1]-r[1]),o=l*(e[1]-r[1])+r[0],n=e[1],[o,n]):r[1]===s[1]?(h=(t[0]-e[0])/(t[1]-e[1]),o=h*(r[1]-e[1])+e[0],n=r[1],[o,n]):(h=(t[0]-e[0])/(t[1]-e[1]),l=(s[0]-r[0])/(s[1]-r[1]),n=(h*e[1]-e[0]-l*r[1]+r[0])/(h-l),o=h*n-h*e[1]+e[0],[o,n])}static getAzimuth(e,t){let r,s=Math.asin(Math.abs(t[1]-e[1])/this.distance(e,t));return t[1]>=e[1]&&t[0]>=e[0]?r=s+Math.PI:t[1]>=e[1]&&t[0]<e[0]?r=or-s:t[1]<e[1]&&t[0]<e[0]?r=s:t[1]<e[1]&&t[0]>=e[0]&&(r=Math.PI-s),r}static getAngleOfThreePoints(e,t,r){let s=this.getAzimuth(t,e)-this.getAzimuth(t,r);return s<0?s+or:s}static isClockWise(e,t,r){return(r[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(r[0]-e[0])}static getPointOnLine(e,t,r){let s=t[0]+e*(r[0]-t[0]),o=t[1]+e*(r[1]-t[1]);return[s,o]}static getCubicValue(e,t,r,s,o){e=Math.max(Math.min(e,1),0);let n=1-e,l=e*e,h=l*e,c=n*n,d=c*n,m=d*t[0]+3*c*e*r[0]+3*n*l*s[0]+h*o[0],f=d*t[1]+3*c*e*r[1]+3*n*l*s[1]+h*o[1];return[m,f]}static getThirdPoint(e,t,r,s,o){let n=this.getAzimuth(e,t),l=o?n+r:n-r,h=s*Math.cos(l),c=s*Math.sin(l);return[t[0]+h,t[1]+c]}static getArcPoints(e,t,r,s){let o,n,l=[],h=s-r;h=h<0?h+or:h;for(let c=0;c<=_t;c++){let d=r+h*c/_t;o=e[0]+t*Math.cos(d),n=e[1]+t*Math.sin(d),l.push([o,n])}return l}static getBisectorNormals(e,t,r,s){let o=this.getNormal(t,r,s),n=Math.sqrt(o[0]*o[0]+o[1]*o[1]),l=o[0]/n,h=o[1]/n,c=this.distance(t,r),d=this.distance(r,s),m,f,u,p,x;return n>ar?this.isClockWise(t,r,s)?(m=e*c,f=r[0]-m*h,u=r[1]+m*l,x=[f,u],m=e*d,f=r[0]+m*h,u=r[1]-m*l,p=[f,u]):(m=e*c,f=r[0]+m*h,u=r[1]-m*l,x=[f,u],m=e*d,f=r[0]-m*h,u=r[1]+m*l,p=[f,u]):(f=r[0]+e*(t[0]-r[0]),u=r[1]+e*(t[1]-r[1]),x=[f,u],f=r[0]+e*(s[0]-r[0]),u=r[1]+e*(s[1]-r[1]),p=[f,u]),[x,p]}static getNormal(e,t,r){let s=e[0]-t[0],o=e[1]-t[1],n=Math.sqrt(s*s+o*o);s/=n,o/=n;let l=r[0]-t[0],h=r[1]-t[1],c=Math.sqrt(l*l+h*h);l/=c,h/=c;let d=s+l,m=o+h;return[d,m]}static getCurvePoints(e,t){let s=[this.getLeftMostControlPoint(e,t)],o,n,l,h;for(let m=0;m<t.length-2;m++)o=t[m],n=t[m+1],l=t[m+2],h=this.getBisectorNormals(e,o,n,l),s=s.concat(h);let c=this.getRightMostControlPoint(e,t);s.push(c);let d=[];for(let m=0;m<t.length-1;m++){o=t[m],n=t[m+1],d.push(o);for(let f=0;f<_t;f++){let u=this.getCubicValue(f/_t,o,s[m*2],s[m*2+1],n);d.push(u)}d.push(n)}return d}static getLeftMostControlPoint(e,t){let r=t[0],s=t[1],o=t[2],l=this.getBisectorNormals(0,r,s,o)[0],h=this.getNormal(r,s,o),c=Math.sqrt(h[0]*h[0]+h[1]*h[1]),d,m;if(c>ar){let f=this.mid(r,s),u=r[0]-f[0],p=r[1]-f[1],C=2/this.distance(r,s),E=-C*p,b=C*u,R=E*E-b*b,S=2*E*b,I=b*b-E*E,L=l[0]-f[0],k=l[1]-f[1];d=f[0]+R*L+S*k,m=f[1]+S*L+I*k}else d=r[0]+e*(s[0]-r[0]),m=r[1]+e*(s[1]-r[1]);return[d,m]}static getRightMostControlPoint(e,t){let r=t.length,s=t[r-3],o=t[r-2],n=t[r-1],h=this.getBisectorNormals(0,s,o,n)[1],c=this.getNormal(s,o,n),d=Math.sqrt(c[0]*c[0]+c[1]*c[1]),m,f;if(d>ar){let u=this.mid(o,n),p=n[0]-u[0],x=n[1]-u[1],E=2/this.distance(o,n),b=-E*x,R=E*p,S=b*b-R*R,I=2*b*R,L=R*R-b*b,k=h[0]-u[0],F=h[1]-u[1];m=u[0]+S*k+I*F,f=u[1]+I*k+L*F}else m=n[0]+e*(o[0]-n[0]),f=n[1]+e*(o[1]-n[1]);return[m,f]}static getBezierPoints(e){if(e.length<=2)return e;let t=[],r=e.length-1;for(let s=0;s<=1;s+=.01){let o=0,n=0;for(let l=0;l<=r;l++){let h=this.getBinomialFactor(r,l),c=Math.pow(s,l),d=Math.pow(1-s,r-l);o+=h*c*d*e[l][0],n+=h*c*d*e[l][1]}t.push([o,n])}return t.push(e[r]),t}static getBinomialFactor(e,t){return this.getFactorial(e)/(this.getFactorial(t)*this.getFactorial(e-t))}static getFactorial(e){if(e<=1)return 1;if(e===2)return 2;if(e===3)return 6;if(e===4)return 24;if(e===5)return 120;let t=1;for(let r=1;r<=e;r++)t*=r;return t}static getQBSplinePoints(e){if(e.length<=2)return e;let t=2,r=[],s=e.length-t-1;r.push(e[0]);for(let o=0;o<=s;o++)for(let n=0;n<=1;n+=.05){let l=0,h=0;for(let c=0;c<=t;c++){let d=this.getQuadricBSplineFactor(c,n);l+=d*e[o+c][0],h+=d*e[o+c][1]}r.push([l,h])}return r.push(e[e.length-1]),r}static getQuadricBSplineFactor(e,t){return e===0?Math.pow(t-1,2)/2:e===1?(-2*Math.pow(t,2)+2*t+1)/2:e===2?Math.pow(t,2)/2:0}},T=nr;var lr=class{constructor(e){this._viewer=e,this._options={}}_setViewerOption(){var e,t,r;return this._viewer.delegate.shadows=(t=(e=this._options)==null?void 0:e.shadows)!=null?t:!1,this._viewer.delegate.resolutionScale=((r=this._options)==null?void 0:r.resolutionScale)||1,this}_setCanvasOption(){return this._options.tabIndex&&this._viewer.scene.canvas.setAttribute("tabIndex",this._options.tabIndex),this}_setSceneOption(){var t,r,s,o,n;let e=this._viewer.scene;return e.skyAtmosphere.show=(t=this._options.showAtmosphere)!=null?t:!0,e.sun.show=(r=this._options.showSun)!=null?r:!0,e.moon.show=(s=this._options.showMoon)!=null?s:!0,e.postProcessStages.fxaa.enabled=(o=this._options.enableFxaa)!=null?o:!1,e.msaaSupported&&(e.msaaSamples=+this._options.msaaSamples||1),e.verticalExaggeration=this._options.verticalExaggeration||1,e.verticalExaggerationRelativeHeight=(n=this._options.verticalExaggerationRelativeHeight)!=null?n:0,this}_setSkyBoxOption(){var t;if(!this._options.skyBox)return this;let e=this._options.skyBox;if(e instanceof i.SkyBox)this._viewer.scene.skyBox=e;else{let r=this._viewer.scene.skyBox;r.show=(t=e.show)!=null?t:!0,e.offsetAngle&&(r.offsetAngle=e.offsetAngle),e!=null&&e.sources&&(r.sources=e.sources)}return this}_setGlobeOption(){var r,s,o,n,l,h,c,d,m,f,u,p;if(!this._options.globe)return this;let e=this._viewer.scene.globe,t=this._options.globe;if(v.merge(e,{show:(r=t==null?void 0:t.show)!=null?r:!0,showGroundAtmosphere:(s=t==null?void 0:t.showGroundAtmosphere)!=null?s:!0,enableLighting:(o=t==null?void 0:t.enableLighting)!=null?o:!1,depthTestAgainstTerrain:(n=t==null?void 0:t.depthTestAgainstTerrain)!=null?n:!1,tileCacheSize:+(t==null?void 0:t.tileCacheSize)||100,preloadSiblings:(l=t==null?void 0:t.preloadSiblings)!=null?l:!1,showSkirts:(h=t==null?void 0:t.showSkirts)!=null?h:!0,baseColor:(t==null?void 0:t.baseColor)||new i.Color(0,0,.5,1)}),v.merge(e.translucency,{enabled:(d=(c=t==null?void 0:t.translucency)==null?void 0:c.enabled)!=null?d:!1,backFaceAlpha:+((m=t==null?void 0:t.translucency)==null?void 0:m.backFaceAlpha)||1,backFaceAlphaByDistance:(f=t==null?void 0:t.translucency)==null?void 0:f.backFaceAlphaByDistance,frontFaceAlpha:+((u=t==null?void 0:t.translucency)==null?void 0:u.frontFaceAlpha)||1,frontFaceAlphaByDistance:(p=t==null?void 0:t.translucency)==null?void 0:p.frontFaceAlphaByDistance}),t!=null&&t.filterColor){let x=this._viewer.scene.globe._surfaceShaderSet.baseFragmentShaderSource,C=x.sources.pop();x.sources.push(C.replace("out_FragColor = finalColor;",`out_FragColor = finalColor * vec4${t.filterColor.toString()};`))}return this}_setCameraController(){var r,s,o,n,l,h,c;if(!((r=this._options)!=null&&r.cameraController))return this;let e=this._viewer.scene.screenSpaceCameraController,t=this._options.cameraController;return v.merge(e,{enableInputs:(s=t==null?void 0:t.enableInputs)!=null?s:!0,enableRotate:(o=t==null?void 0:t.enableRotate)!=null?o:!0,enableTilt:(n=t==null?void 0:t.enableTilt)!=null?n:!0,enableTranslate:(l=t==null?void 0:t.enableTranslate)!=null?l:!0,enableZoom:(h=t==null?void 0:t.enableZoom)!=null?h:!0,enableCollisionDetection:(c=t==null?void 0:t.enableCollisionDetection)!=null?c:!0,minimumZoomDistance:+(t==null?void 0:t.minimumZoomDistance)||1,maximumZoomDistance:+(t==null?void 0:t.maximumZoomDistance)||40489014}),this}setOptions(e){return Object.keys(e).length===0?this:(this._options={...this._options,...e},this._setViewerOption()._setCanvasOption()._setSceneOption()._setSkyBoxOption()._setGlobeOption()._setCameraController(),this)}},hr=lr;var cr=class{constructor(e){this._viewer=e,this._mouseMode=0}setPitchRange(e,t){let r=new i.ScreenSpaceEventHandler(this._viewer.scene.canvas);this._viewer.scene.mode===i.SceneMode.SCENE3D&&(r.setInputAction(s=>{r.setInputAction(o=>{let n=!0,l=o.endPosition.y<o.startPosition.y;l&&this._viewer.camera.pitch>i.Math.toRadians(t)||!l&&this._viewer.camera.pitch<i.Math.toRadians(e)?n=!1:n=!0,this._viewer.scene.screenSpaceCameraController.enableTilt=n},i.ScreenSpaceEventType.MOUSE_MOVE)},this._mouseMode===Se.LEFT_MIDDLE?i.ScreenSpaceEventType.MIDDLE_DOWN:i.ScreenSpaceEventType.RIGHT_DOWN),r.setInputAction(s=>{this._viewer.scene.screenSpaceCameraController.enableTilt=!0,r.removeInputAction(i.ScreenSpaceEventType.MOUSE_MOVE)},this._mouseMode===Se.LEFT_MIDDLE?i.ScreenSpaceEventType.MIDDLE_UP:i.ScreenSpaceEventType.RIGHT_UP))}changeMouseMode(e){this._mouseMode=e||Se.LEFT_MIDDLE,e===Se.LEFT_MIDDLE?(this._viewer.scene.screenSpaceCameraController.tiltEventTypes=[i.CameraEventType.MIDDLE_DRAG,i.CameraEventType.PINCH,{eventType:i.CameraEventType.LEFT_DRAG,modifier:i.KeyboardEventModifier.CTRL},{eventType:i.CameraEventType.RIGHT_DRAG,modifier:i.KeyboardEventModifier.CTRL}],this._viewer.scene.screenSpaceCameraController.zoomEventTypes=[i.CameraEventType.RIGHT_DRAG,i.CameraEventType.WHEEL,i.CameraEventType.PINCH]):e===Se.LEFT_RIGHT&&(this._viewer.scene.screenSpaceCameraController.tiltEventTypes=[i.CameraEventType.RIGHT_DRAG,i.CameraEventType.PINCH,{eventType:i.CameraEventType.LEFT_DRAG,modifier:i.KeyboardEventModifier.CTRL},{eventType:i.CameraEventType.RIGHT_DRAG,modifier:i.KeyboardEventModifier.CTRL}],this._viewer.scene.screenSpaceCameraController.zoomEventTypes=[i.CameraEventType.WHEEL,i.CameraEventType.PINCH])}},dr=cr;var zm={INITIALIZED:"initialized",ADDED:"added",REMOVED:"removed",CLEARED:"cleared",INSTALLED:"installed",ENABLED:"enabled",DISABLED:"disabled",PLAY:"play",PAUSE:"pause",RESTORE:"restore"},_=zm;var Wm={},pr=Wm;var mr=class{constructor(){this._viewer=void 0,this._enable=!1,this._wrapper=void 0,this._ready=!1}set enable(e){this._enable!==e&&(this._enable=e,this._state=this._enable?_.ENABLED:_.DISABLED,this._enableHook&&this._enableHook())}get enable(){return this._enable}get state(){return this._state}_mountContent(){}_bindEvent(){}_unbindEvent(){}_enableHook(){!this._ready&&this._mountContent(),this._enable?(!this._wrapper.parentNode&&this._viewer.widgetContainer.appendChild(this._wrapper),this._bindEvent()):(this._unbindEvent(),this._wrapper.parentNode&&this._viewer.widgetContainer.removeChild(this._wrapper))}_updateWindowCoord(e){}_installHook(){}_getViewerOffset(){return this._viewer?this._viewer.getOffset():{x:0,y:0}}install(e){this._viewer=e,this._installHook&&this._installHook(),this._state=_.INSTALLED}setWrapper(e){return this}setContent(e){if(e&&typeof e=="string")this._wrapper.innerHTML=e;else if(e&&e instanceof Element){for(;this._wrapper.hasChildNodes();)this._wrapper.removeChild(this._wrapper.firstChild);this._wrapper.appendChild(e)}return this}hide(){this._wrapper&&(this._wrapper.style.cssText=`
2
2
  visibility:hidden;
3
- `)}static registerType(e){e&&(Rr[e.toLocaleUpperCase()]=e.toLocaleLowerCase())}static getWidgetType(e){return Rr[e.toLocaleUpperCase()]||void 0}},S=Or;var kr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget context-menu"),this._ulEl=void 0,this._handler=void 0,this._overlay=void 0,this._position=void 0,this._wgs84Position=void 0,this._surfacePosition=void 0,this._wgs84SurfacePosition=void 0,this._windowPosition=void 0,this._instanceId=void 0,this._config={},this._defaultMenu=[{label:"\u98DE\u5230\u9ED8\u8BA4\u4F4D\u7F6E",callback:()=>{this._viewer.camera.flyHome(1.5)},context:this},{label:"\u53D6\u6D88\u98DE\u884C",callback:()=>{this._viewer.camera.cancelFlight()},context:this}],this._overlayMenu=[],this._state=m.INITIALIZED}get type(){return S.getWidgetType("contextmenu")}set DEFAULT_MENU(e){this._defaultMenu=e}set config(e){this._config=e,e.customClass&&this._setCustomClass()}_installHook(){let e=this;Object.defineProperty(this._viewer,"contextMenu",{get(){return e}}),this._handler=new i.ScreenSpaceEventHandler(this._viewer.canvas)}_bindEvent(){this._handler.setInputAction(e=>{this._onRightClick(e)},i.ScreenSpaceEventType.RIGHT_CLICK),this._handler.setInputAction(e=>{this._onClick(e)},i.ScreenSpaceEventType.LEFT_CLICK)}_unbindEvent(){this._handler.removeInputAction(i.ScreenSpaceEventType.RIGHT_CLICK),this._handler.removeInputAction(i.ScreenSpaceEventType.LEFT_CLICK)}_mountContent(){this._ulEl=I.create("ul","menu-list",this._wrapper),this._ready=!0}_mountMenu(){for(;this._ulEl.hasChildNodes();)this._ulEl.removeChild(this._ulEl.firstChild);this._overlayMenu&&this._overlayMenu.length&&this._overlayMenu.forEach(e=>{this._addMenuItem(e.label,e.callback,e.context||this)}),this._defaultMenu&&this._defaultMenu.length&&this._defaultMenu.forEach(e=>{this._addMenuItem(e.label,e.callback,e.context||this)})}_onRightClick(e){var s;if(!this._enable)return;this._overlay=void 0;let t=this._viewer.scene;this._windowPosition=e.position;let r=t.pick(e.position);if(t.pickPositionSupported&&(this._position=t.pickPosition(e.position)),this._position){let o=i.Ellipsoid.WGS84.cartesianToCartographic(this._position);o&&(this._wgs84Position={lng:i.Math.toDegrees(o.longitude),lat:i.Math.toDegrees(o.latitude),alt:o.height})}if(t.mode===i.SceneMode.SCENE3D){let o=t.camera.getPickRay(e.position);this._surfacePosition=t.globe.pick(o,t)}else this._surfacePosition=t.camera.pickEllipsoid(e.position,i.Ellipsoid.WGS84);if(this._surfacePosition){let o=i.Ellipsoid.WGS84.cartesianToCartographic(this._surfacePosition);o&&(this._wgs84SurfacePosition={lng:i.Math.toDegrees(o.longitude),lat:i.Math.toDegrees(o.latitude),alt:o.height})}if(this._instanceId=r==null?void 0:r.instanceId,(r==null?void 0:r.id)instanceof i.Entity){let o=this._viewer.getLayers().filter(n=>n.layerId===r.id.layerId)[0];o&&o.getOverlay&&(this._overlay=o.getOverlay(r.id.overlayId))}else if(r instanceof i.Cesium3DTileFeature){let o=this._viewer.getLayers().filter(n=>n.layerId===r.tileset.layerId)[0];o&&o.getOverlay&&(this._overlay=o.getOverlay(r.tileset.overlayId))}else if((r==null?void 0:r.primitive)instanceof i.Cesium3DTileset){let o=this._viewer.getLayers().filter(n=>n.layerId===r.primitive.layerId)[0];o&&o.getOverlay&&(this._overlay=o.getOverlay(r.primitive.overlayId))}else if(r!=null&&r.primitive){let o=this._viewer.getLayers().filter(n=>n.layerId===r.primitive.layerId)[0];o&&o.getOverlay&&(this._overlay=o.getOverlay(r.primitive.overlayId))}this._overlayMenu=((s=this._overlay)==null?void 0:s.contextMenu)||[],this._mountMenu(),this._updateWindowCoord(e.position)}_onClick(e){this.hide()}_updateWindowCoord(e){let t=this._ulEl.hasChildNodes()?"visible":"hidden",{x:r,y:s}=e,o=this._getViewerOffset();r+=o.x,s+=o.y,this._wrapper.style.cssText=`
3
+ `)}static registerType(e){e&&(pr[e.toLocaleUpperCase()]=e.toLocaleLowerCase())}static getWidgetType(e){return pr[e.toLocaleUpperCase()]||void 0}},O=mr;var ur=class extends O{constructor(){super(),this._wrapper=M.create("div","widget context-menu"),this._ulEl=void 0,this._handler=void 0,this._overlay=void 0,this._position=void 0,this._wgs84Position=void 0,this._surfacePosition=void 0,this._wgs84SurfacePosition=void 0,this._windowPosition=void 0,this._instanceId=void 0,this._config={},this._defaultMenu=[{label:"\u98DE\u5230\u9ED8\u8BA4\u4F4D\u7F6E",callback:()=>{this._viewer.camera.flyHome(1.5)},context:this},{label:"\u53D6\u6D88\u98DE\u884C",callback:()=>{this._viewer.camera.cancelFlight()},context:this}],this._overlayMenu=[],this._state=_.INITIALIZED}get type(){return O.getWidgetType("contextmenu")}set DEFAULT_MENU(e){this._defaultMenu=e}set config(e){this._config=e,e.customClass&&this._setCustomClass()}_installHook(){let e=this;Object.defineProperty(this._viewer,"contextMenu",{get(){return e}}),this._handler=new i.ScreenSpaceEventHandler(this._viewer.canvas)}_bindEvent(){this._handler.setInputAction(e=>{this._onRightClick(e)},i.ScreenSpaceEventType.RIGHT_CLICK),this._handler.setInputAction(e=>{this._onClick(e)},i.ScreenSpaceEventType.LEFT_CLICK)}_unbindEvent(){this._handler.removeInputAction(i.ScreenSpaceEventType.RIGHT_CLICK),this._handler.removeInputAction(i.ScreenSpaceEventType.LEFT_CLICK)}_mountContent(){this._ulEl=M.create("ul","menu-list",this._wrapper),this._ready=!0}_mountMenu(){for(;this._ulEl.hasChildNodes();)this._ulEl.removeChild(this._ulEl.firstChild);this._overlayMenu&&this._overlayMenu.length&&this._overlayMenu.forEach(e=>{this._addMenuItem(e.label,e.callback,e.context||this)}),this._defaultMenu&&this._defaultMenu.length&&this._defaultMenu.forEach(e=>{this._addMenuItem(e.label,e.callback,e.context||this)})}_onRightClick(e){var s;if(!this._enable)return;this._overlay=void 0;let t=this._viewer.scene;this._windowPosition=e.position;let r=t.pick(e.position);if(t.pickPositionSupported&&(this._position=t.pickPosition(e.position)),this._position){let o=i.Ellipsoid.WGS84.cartesianToCartographic(this._position);o&&(this._wgs84Position={lng:i.Math.toDegrees(o.longitude),lat:i.Math.toDegrees(o.latitude),alt:o.height})}if(t.mode===i.SceneMode.SCENE3D){let o=t.camera.getPickRay(e.position);this._surfacePosition=t.globe.pick(o,t)}else this._surfacePosition=t.camera.pickEllipsoid(e.position,i.Ellipsoid.WGS84);if(this._surfacePosition){let o=i.Ellipsoid.WGS84.cartesianToCartographic(this._surfacePosition);o&&(this._wgs84SurfacePosition={lng:i.Math.toDegrees(o.longitude),lat:i.Math.toDegrees(o.latitude),alt:o.height})}if(this._instanceId=r==null?void 0:r.instanceId,(r==null?void 0:r.id)instanceof i.Entity){let o=this._viewer.getLayers().filter(n=>n.layerId===r.id.layerId)[0];o&&o.getOverlay&&(this._overlay=o.getOverlay(r.id.overlayId))}else if(r instanceof i.Cesium3DTileFeature){let o=this._viewer.getLayers().filter(n=>n.layerId===r.tileset.layerId)[0];o&&o.getOverlay&&(this._overlay=o.getOverlay(r.tileset.overlayId))}else if((r==null?void 0:r.primitive)instanceof i.Cesium3DTileset){let o=this._viewer.getLayers().filter(n=>n.layerId===r.primitive.layerId)[0];o&&o.getOverlay&&(this._overlay=o.getOverlay(r.primitive.overlayId))}else if(r!=null&&r.primitive){let o=this._viewer.getLayers().filter(n=>n.layerId===r.primitive.layerId)[0];o&&o.getOverlay&&(this._overlay=o.getOverlay(r.primitive.overlayId))}this._overlayMenu=((s=this._overlay)==null?void 0:s.contextMenu)||[],this._mountMenu(),this._updateWindowCoord(e.position)}_onClick(e){this.hide()}_updateWindowCoord(e){let t=this._ulEl.hasChildNodes()?"visible":"hidden",{x:r,y:s}=e,o=this._getViewerOffset();r+=o.x,s+=o.y,this._wrapper.style.cssText=`
4
4
  visibility:${t};
5
5
  z-index:1;
6
6
  transform:translate3d(${Math.round(r)}px,${Math.round(s)}px, 0);
7
- `}_setCustomClass(){I.setClass(this._wrapper,`dc-context-menu ${this._config.customClass}`)}_addMenuItem(e,t,r){if(!e||!t)return this;let s=I.create("li","menu-item",null),o=I.create("a","",s);o.innerHTML=e,o.href="javascript:void(0)";let n=this;return t&&(o.onclick=()=>{t.call(r,{windowPosition:n._windowPosition,position:n._position,wgs84Position:n._wgs84Position,surfacePosition:n._surfacePosition,wgs84SurfacePosition:n._wgs84SurfacePosition,overlay:n._overlay,instanceId:n._instanceId}),n.hide()}),this._ulEl.appendChild(s),this}};S.registerType("contextmenu");var dl=kr;var Fr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget location-bar"),this._mouseEl=void 0,this._cameraEl=void 0,this._fpsEl=void 0,this._msEl=void 0,this._lastMouseSampleTime=i.getTimestamp(),this._lastCameraSampleTime=i.getTimestamp(),this._lastFpsSampleTime=i.getTimestamp(),this._lastMsSampleTime=i.getTimestamp(),this._fpsFrameCount=0,this._msFrameCount=0,this._state=m.INITIALIZED}get type(){return S.getWidgetType("location_bar")}_installHook(){let e=this;Object.defineProperty(this._viewer,"locationBar",{get(){return e}})}_bindEvent(){this._viewer.on(O.MOUSE_MOVE,this._onMove,this),this._viewer.on(D.CAMERA_CHANGED,this._onCameraChanged,this),this._viewer.on(D.POST_UPDATE,this._onPostUpdate,this)}_unbindEvent(){this._viewer.off(O.MOUSE_MOVE,this._onMove,this),this._viewer.off(D.CAMERA_CHANGED,this._onCameraChanged,this),this._viewer.off(D.POST_UPDATE,this._onPostUpdate,this)}_mountContent(){this._mouseEl=I.create("div","mouse-bar",this._wrapper),this._cameraEl=I.create("div","camera-bar",this._wrapper),this._msEl=I.create("div","ms-bar",this._wrapper),this._fpsEl=I.create("div","fps-bar",this._wrapper),this._ready=!0}_onMove(e){let t=i.getTimestamp();if(t<this._lastMouseSampleTime+300)return;let r=e.wgs84SurfacePosition;this._mouseEl.innerHTML=`
7
+ `}_setCustomClass(){M.setClass(this._wrapper,`dc-context-menu ${this._config.customClass}`)}_addMenuItem(e,t,r){if(!e||!t)return this;let s=M.create("li","menu-item",null),o=M.create("a","",s);o.innerHTML=e,o.href="javascript:void(0)";let n=this;return t&&(o.onclick=()=>{t.call(r,{windowPosition:n._windowPosition,position:n._position,wgs84Position:n._wgs84Position,surfacePosition:n._surfacePosition,wgs84SurfacePosition:n._wgs84SurfacePosition,overlay:n._overlay,instanceId:n._instanceId}),n.hide()}),this._ulEl.appendChild(s),this}};O.registerType("contextmenu");var Qn=ur;var _r=class extends O{constructor(){super(),this._wrapper=M.create("div","widget location-bar"),this._mouseEl=void 0,this._cameraEl=void 0,this._fpsEl=void 0,this._msEl=void 0,this._lastMouseSampleTime=i.getTimestamp(),this._lastCameraSampleTime=i.getTimestamp(),this._lastFpsSampleTime=i.getTimestamp(),this._lastMsSampleTime=i.getTimestamp(),this._fpsFrameCount=0,this._msFrameCount=0,this._state=_.INITIALIZED}get type(){return O.getWidgetType("location_bar")}_installHook(){let e=this;Object.defineProperty(this._viewer,"locationBar",{get(){return e}})}_bindEvent(){this._viewer.on(H.MOUSE_MOVE,this._onMove,this),this._viewer.on(D.CAMERA_CHANGED,this._onCameraChanged,this),this._viewer.on(D.POST_UPDATE,this._onPostUpdate,this)}_unbindEvent(){this._viewer.off(H.MOUSE_MOVE,this._onMove,this),this._viewer.off(D.CAMERA_CHANGED,this._onCameraChanged,this),this._viewer.off(D.POST_UPDATE,this._onPostUpdate,this)}_mountContent(){this._mouseEl=M.create("div","mouse-bar",this._wrapper),this._cameraEl=M.create("div","camera-bar",this._wrapper),this._msEl=M.create("div","ms-bar",this._wrapper),this._fpsEl=M.create("div","fps-bar",this._wrapper),this._ready=!0}_onMove(e){let t=i.getTimestamp();if(t<this._lastMouseSampleTime+300)return;let r=e.wgs84SurfacePosition;this._mouseEl.innerHTML=`
8
8
  <span>\u7ECF\u5EA6\uFF1A${(r==null?void 0:r.lng.toFixed(8))||Number.NaN}</span>
9
9
  <span>\u7EAC\u5EA6\uFF1A${(r==null?void 0:r.lat.toFixed(8))||Number.NaN}</span>
10
10
  <span>\u6D77\u62D4\uFF1A${(r==null?void 0:r.alt.toFixed(2))||Number.NaN} \u7C73</span>`,this._lastMouseSampleTime=t}_onCameraChanged(){let e=i.getTimestamp();if(e<this._lastCameraSampleTime+300)return;let t=this._viewer.cameraPosition;this._cameraEl.innerHTML=`
11
11
  <span>\u89C6\u89D2\uFF1A${(+t.pitch).toFixed(2)}</span>
12
12
  <span>\u89C6\u9AD8\uFF1A${(+t.alt).toFixed(2)} \u7C73</span>
13
- `,this._lastCameraSampleTime=e}_onPostUpdate(){let e=i.getTimestamp();this._msFrameCount++;let t=e-this._lastMsSampleTime;if(t>200){let s=(t/this._msFrameCount).toFixed(2);this._msEl.innerHTML=`<span>${s} MS</span>`,this._lastMsSampleTime=e,this._msFrameCount=0}this._fpsFrameCount++;let r=e-this._lastFpsSampleTime;if(r>1e3){let s=this._fpsFrameCount*1e3/r|0;this._fpsEl.innerHTML=`<span>${s} FPS</span>`,this._lastFpsSampleTime=e,this._fpsFrameCount=0}}};S.registerType("location_bar");var ml=Fr;var gg=`
13
+ `,this._lastCameraSampleTime=e}_onPostUpdate(){let e=i.getTimestamp();this._msFrameCount++;let t=e-this._lastMsSampleTime;if(t>200){let s=(t/this._msFrameCount).toFixed(2);this._msEl.innerHTML=`<span>${s} MS</span>`,this._lastMsSampleTime=e,this._msFrameCount=0}this._fpsFrameCount++;let r=e-this._lastFpsSampleTime;if(r>1e3){let s=this._fpsFrameCount*1e3/r|0;this._fpsEl.innerHTML=`<span>${s} FPS</span>`,this._lastFpsSampleTime=e,this._fpsFrameCount=0}}};O.registerType("location_bar");var el=_r;var Gm=`
14
14
  data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAG5ElEQVRoQ+2Yf2xVZxnHP89py9qliPe0BUTqBrunuDEBx8QfcxuwRYcxM3HO7Y8JZUNKTweKmWyaGDBZYtwSMmnvuXRKcEMzt0WmwdllE1nclkgsyUaIUM4ZNmKihfbcDjbCpPc85rT3QG1677ltb5UlPf+e932e7/f5vu/zPO8jfMA/+YDjZ4rA/1vBKQWmFBgWAXOnex0Bu4FPAf8Evu3b1vOFgnTZHKHa1LEVgZTtEoLv9NkLfpMjs03hfMa2VucjcdkQSKTdVkGq/ebk2ghswjmxSMh2+Lb10cufgOO9AHRk7OSTw8Gajqu+beUN9GWjgJnq2qZi3JqxrRURATPtbka5w7etL066AjXprmUaGDdhyCI0WAhyHeAjHFPoMgI9lDWyr/Y3X9udD4yZc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9mIRaz36CcrKHxLITSB0t283XGxbxqdAmJfLeQfY5dvWuslQYO72k1Xnqt5/CA2+CzId9ALIId+2wvwf+8W3Eo7bA1T4tmXGWhvDgrrUkeqAikbEuF/hk8CbKnJQVJtGa9fHp4Dj/gMYnMmI6tp879gx4A6r7Vwp18YAWTPYjsBJgXTV+dNPnKus2wuyZGDaFQvjeqDIZ14FEk7YWLFUIWwX7hKkPJALKwpNFQoRCXsoUdaANjLUInSKIXsGtGLPO/ZVmZqUt1pFnxKRx/qakw8XG5RRCSRS7mABi/Jv7sGyY+R7IM5JTXvXx4MBY6UIYdtxF1AO+iJq7PFbks9G+4e9B67FYEncK26433wETolQN7wfMR33JSAcMBV8hNc4b9+uol9G9VZgSc7ZKcIBQJZfhK+1kcSjFxno477dEE46iv5GJWA67pHQgoGs6bWThyJrpuN1g14VXbLa9u6PZIPsUgkGbhQxblDkNtArh9ZLN8JvA9U/XlE9fX/P6tnvjYYqehOHE44+27qzaOS5hXkUOL5FRIZaZeUVhDOonkWkH9gAVAJngekjHB5V0b2GUbGvr2newUJgctPnaCrxkm9bq8YKfjBM+TaZjnu3CMtVWQwsC1PppbVyLhfpEwodUPbsQFnl0bNNc+J7pJFzoZjxTByp2DowaGDrgfLaurmLVINz06undXevnXf+Yms95GEckzn+hgZPFzM+LESiOAJ5LAw9cIL1IPcAM3JHrgfhLdDDiswSdDHIoksm9C8Ce3RAnvI3WWfiIhz3f0IEIuOJ9rdnGEFwp6p+BeQaoA50JoRHjT6gV5VODXh+tCwUB3LSFJiI41LtLYkCpQIzHjtTBMYTtVLumVKglNEcj63/AIrz7E/FBbRAAAAAAElFTkSuQmCC
15
- `,ul=gg;var yg=`
15
+ `,tl=Gm;var Um=`
16
16
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
17
17
  <svg width="162px" height="162px" viewBox="0 0 162 162" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
18
18
  <!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
@@ -33,7 +33,7 @@ data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAG5ElEQVRoQ+
33
33
  </g>
34
34
  </g>
35
35
  </svg>
36
- `,_l=yg;var vg=`
36
+ `,il=Um;var Bm=`
37
37
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
38
38
  <svg width="17px" height="17px" viewBox="0 0 17 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
39
39
  <!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
@@ -51,7 +51,7 @@ data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAG5ElEQVRoQ+
51
51
  </g>
52
52
  </g>
53
53
  </svg>
54
- `,fl=vg;var wg=`
54
+ `,rl=Bm;var Vm=`
55
55
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
56
56
  <svg width="53px" height="53px" viewBox="0 0 53 53" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
57
57
  <!-- Generator: Sketch 3.4.3 (16044) - http://www.bohemiancoding.com/sketch -->
@@ -65,79 +65,61 @@ data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAG5ElEQVRoQ+
65
65
  </g>
66
66
  </g>
67
67
  </svg>
68
- `,gl=wg;var Cg=`
68
+ `,sl=Vm;var jm=`
69
69
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
70
70
  <svg width="50px" height="6px" viewBox="0 0 50 6" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
71
71
  <!-- Generator: Sketch 3.4.3 (16044) - http://www.bohemiancoding.com/sketch -->
72
72
  <title>decrease</title>
73
73
  <path d="M46.6183575,0.657894737 L3.30112724,0.657894737 C1.44927539,0.657894737 0,1.66880618 0,2.96052632 C0,4.25224645 1.44927539,5.26315789 3.30112724,5.26315789 L46.6988728,5.26315789 C48.5507246,5.26315789 50,4.25224645 50,2.96052632 C49.9194847,1.66880618 48.4702093,0.657894737 46.6183575,0.657894737 L46.6183575,0.657894737 L46.6183575,0.657894737 Z" id="Shape"></path>
74
74
  </svg>
75
- `,yl=Cg;var xg=`
75
+ `,ol=jm;var Ym=`
76
76
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
77
77
  <svg width="50px" height="50px" viewBox="0 0 50 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
78
78
  <!-- Generator: Sketch 3.4.3 (16044) - http://www.bohemiancoding.com/sketch -->
79
79
  <title>increase</title>
80
80
  <path d="M0,25 C0,25.3514939 0.131810207,25.659051 0.373462207,25.900703 C0.615114207,26.142355 0.922671379,26.2741652 1.27416517,26.2741652 L23.7258348,26.2741652 L23.7258348,48.7258348 C23.7258348,49.0773286 23.857645,49.3848858 24.099297,49.6265378 C24.3189807,49.8462214 24.6485061,50 25,50 C25.7029877,50 26.2741652,49.4288225 26.2741652,48.7258348 L26.2741652,26.2741652 L48.7258348,26.2741652 C49.4288225,26.2741652 50,25.7029877 50,25 C50,24.2970123 49.4288225,23.7258348 48.7258348,23.7258348 L26.2741652,23.7258348 L26.2741652,1.27416517 C26.2741652,0.571177517 25.7029877,0 25,0 C24.2970123,0 23.7258348,0.571177517 23.7258348,1.27416517 L23.7258348,23.7258348 L1.27416517,23.7258348 C0.571177517,23.7258348 0,24.2970123 0,25 L0,25 L0,25 L0,25 Z" id="Shape"></path>
81
81
  </svg>
82
- `,vl=xg;var Tg=`
82
+ `,al=Ym;var qm=`
83
83
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
84
84
  <svg width="50px" height="50px" viewBox="0 0 50 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
85
85
  <!-- Generator: Sketch 3.4.3 (16044) - http://www.bohemiancoding.com/sketch -->
86
86
  <title>refresh</title>
87
87
  <path d="M48.2758621,0 C47.2844828,0 46.5086207,0.775193846 46.5086207,1.76571923 L46.5086207,12.2308355 C42.0689655,4.78036173 34.0086207,0 25,0 C11.2068965,0 0,11.1972438 0,25.0215332 C0,38.8458226 11.2068965,50 25,50 C38.7931035,50 50,38.8027562 50,25.0215332 C50,24.0310078 49.2241379,23.2558139 48.2327587,23.2558139 C47.2413793,23.2558139 46.4655172,24.0310078 46.4655172,25.0215332 C46.4655172,36.8647717 36.8103448,46.5116279 24.9568965,46.5116279 C13.1034483,46.5116279 3.49137933,36.8217054 3.49137933,24.9784668 C3.49137933,13.1352283 13.1465517,3.48837212 25,3.48837212 C33.4913793,3.48837212 41.0775862,8.44099913 44.5258621,16.0206718 L32.1551724,16.0206718 C31.1637931,16.0206718 30.3879311,16.7958657 30.3879311,17.7863911 C30.3879311,18.7769164 31.1637931,19.5521103 32.1551724,19.5521103 L48.2327587,19.5521103 C49.2241379,19.5521103 50,18.7769164 50,17.7863911 L50,1.72265288 C50,0.775193846 49.2241379,0 48.2758621,0 L48.2758621,0 L48.2758621,0 Z" id="Shape"></path>
88
88
  </svg>
89
- `,wl=Tg;var Eg=`
89
+ `,nl=qm;var Zm=`
90
90
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
91
91
  <svg width="19px" height="28px" viewBox="0 0 19 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
92
92
  <path d="M0.6551724,2.3448276 L0.6551724,25.6551724 C0.6551724,26.6454761 1.4579722,27.4482759 2.4482759,27.4482759 C3.4385796,27.4482759 4.2413793,26.6454761 4.2413793,25.6551724 L4.2413793,2.3448276 C4.2413793,1.3545239 3.4385796,0.5517241 2.4482759,0.5517241 C1.4579722,0.5517241 0.6551724,1.3545239 0.6551724,2.3448276 L0.6551724,2.3448276 Z M7.6551724,2.3448276 L7.6551724,25.6551724 C7.6551724,26.6454761 8.4579722,27.4482759 9.4482759,27.4482759 C10.4385796,27.4482759 11.2413793,26.6454761 11.2413793,25.6551724 L11.2413793,2.3448276 C11.2413793,1.3545239 10.4385796,0.5517241 9.4482759,0.5517241 C8.4579722,0.5517241 7.6551724,1.3545239 7.6551724,2.3448276 L7.6551724,2.3448276 Z M14.6551724,2.3448276 L14.6551724,25.6551724 C14.6551724,26.6454761 15.4579722,27.4482759 16.4482759,27.4482759 C17.4385796,27.4482759 18.2413793,26.6454761 18.2413793,25.6551724 L18.2413793,2.3448276 C18.2413793,1.3545239 17.4385796,0.5517241 16.4482759,0.5517241 C15.4579722,0.5517241 14.6551724,1.3545239 14.6551724,2.3448276 L14.6551724,2.3448276 Z" id="splitter"></path>
93
93
  </svg>
94
- `,Cl=Eg;var Pg={logo:ul,compass_outer:_l,compass_inner:fl,compass_rotation_marker:gl,decrease:yl,increase:vl,refresh:wl,splitter:Cl},re=Pg;var zr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget slider"),this._baseLayer=void 0,this._moveActive=!1,this._state=m.INITIALIZED}get type(){return S.getWidgetType("map_split")}_installHook(){let e=this;Object.defineProperty(this._viewer,"mapSplit",{get(){return e}})}_bindEvent(){this._viewer.scene.splitPosition=.5,this._wrapper.style.left="50%"}_unbindEvent(){this._baseLayer?this._viewer.scene.splitPosition=this._baseLayer.splitDirection>0?1:0:this._viewer.scene.splitPosition=0}_mountContent(){let e=I.parseDom(re.splitter,!0,"splitter");this._wrapper.appendChild(e);let t=new i.ScreenSpaceEventHandler(e),r=this;t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.PINCH_START),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.MOUSE_MOVE),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.PINCH_MOVE),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.LEFT_UP),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.PINCH_END),this._ready=!0}_moveHandler(e){if(!this._moveActive||!this._enable)return;let t=e.endPosition.x,r=(this._wrapper.offsetLeft+t)/this._wrapper.parentElement.offsetWidth;this._wrapper.style.left=100*r+"%",this._viewer.scene.splitPosition=r}addBaseLayer(e,t=1){return!this._viewer||!this._enable?this:(e&&(this._baseLayer&&this._viewer.imageryLayers.remove(this._baseLayer),this._baseLayer=this._viewer.imageryLayers.addImageryProvider(e),this._baseLayer.splitDirection=t||0,this._viewer.scene.splitPosition=this._wrapper.offsetLeft/this._wrapper.parentElement.offsetWidth),this)}};S.registerType("map_split");var xl=zr;var Nr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget map-switch"),this._config=void 0,this._cache=[],this._state=m.INITIALIZED}get type(){return S.getWidgetType("map_switch")}_enableHook(){!this._wrapper.parentNode&&this._viewer&&this._viewer.widgetContainer.appendChild(this._wrapper)}_installHook(){let e=this;Object.defineProperty(this._viewer,"mapSwitch",{get(){return e}}),this.enable=!0,this._wrapper.onmouseover=()=>{let t=80,r=5;e._cache.length>0&&(t=e._cache.length*(t+r)-r),this._wrapper.style.width=`${t}px`},this._wrapper.onmouseout=()=>{e._wrapper.style.width="80px"}}_addItem(e){let t=I.create("div","map-item",this._wrapper),r=this._cache.length?this._cache.length-1:0;r===0&&I.addClass(t,"active"),t.setAttribute("data-index",String(r)),t.onclick=o=>{let n=document.getElementsByClassName("map-item active");n&&n.length&&(n[0].className="map-item"),this._viewer&&(o.target.className="map-item active",this._viewer.changeBaseLayer(+o.target.getAttribute("data-index")||0))},e.iconUrl&&(t.style.cssText=`
94
+ `,ll=Zm;var Xm={logo:tl,compass_outer:il,compass_inner:rl,compass_rotation_marker:sl,decrease:ol,increase:al,refresh:nl,splitter:ll},ie=Xm;var fr=class extends O{constructor(){super(),this._wrapper=M.create("div","widget slider"),this._baseLayer=void 0,this._moveActive=!1,this._state=_.INITIALIZED}get type(){return O.getWidgetType("map_split")}_installHook(){let e=this;Object.defineProperty(this._viewer,"mapSplit",{get(){return e}})}_bindEvent(){this._viewer.scene.splitPosition=.5,this._wrapper.style.left="50%"}_unbindEvent(){this._baseLayer?this._viewer.scene.splitPosition=this._baseLayer.splitDirection>0?1:0:this._viewer.scene.splitPosition=0}_mountContent(){let e=M.parseDom(ie.splitter,!0,"splitter");this._wrapper.appendChild(e);let t=new i.ScreenSpaceEventHandler(e),r=this;t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.PINCH_START),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.MOUSE_MOVE),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.PINCH_MOVE),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.LEFT_UP),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.PINCH_END),this._ready=!0}_moveHandler(e){if(!this._moveActive||!this._enable)return;let t=e.endPosition.x,r=(this._wrapper.offsetLeft+t)/this._wrapper.parentElement.offsetWidth;this._wrapper.style.left=100*r+"%",this._viewer.scene.splitPosition=r}addBaseLayer(e,t=1){return!this._viewer||!this._enable?this:(e&&(this._baseLayer&&this._viewer.imageryLayers.remove(this._baseLayer),this._baseLayer=this._viewer.imageryLayers.addImageryProvider(e),this._baseLayer.splitDirection=t||0,this._viewer.scene.splitPosition=this._wrapper.offsetLeft/this._wrapper.parentElement.offsetWidth),this)}};O.registerType("map_split");var hl=fr;var gr=class extends O{constructor(){super(),this._wrapper=M.create("div","widget map-switch"),this._config=void 0,this._cache=[],this._state=_.INITIALIZED}get type(){return O.getWidgetType("map_switch")}_enableHook(){!this._wrapper.parentNode&&this._viewer&&this._viewer.widgetContainer.appendChild(this._wrapper)}_installHook(){let e=this;Object.defineProperty(this._viewer,"mapSwitch",{get(){return e}}),this.enable=!0,this._wrapper.onmouseover=()=>{let t=80,r=5;e._cache.length>0&&(t=e._cache.length*(t+r)-r),this._wrapper.style.width=`${t}px`},this._wrapper.onmouseout=()=>{e._wrapper.style.width="80px"}}_addItem(e){let t=M.create("div","map-item",this._wrapper),r=this._cache.length?this._cache.length-1:0;r===0&&M.addClass(t,"active"),t.setAttribute("data-index",String(r)),t.onclick=o=>{let n=document.getElementsByClassName("map-item active");n&&n.length&&(n[0].className="map-item"),this._viewer&&(o.target.className="map-item active",this._viewer.changeBaseLayer(+o.target.getAttribute("data-index")||0))},e.iconUrl&&(t.style.cssText=`
95
95
  background:url(${e.iconUrl});
96
- `);let s=I.create("span","",t);s.innerHTML=e.name||"\u5730\u56FE"}addMap(e={}){this._enable&&(this._cache.push(e),this._addItem(e),this._cache.length>1&&(this._wrapper.style.visibility="visible"))}};S.registerType("map_switch");var Tl=Nr;var Hr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget popup"),this._config={customClass:""},this._position=void 0,this._offsetX=0,this._offsetY=0,this._state=m.INITIALIZED}get type(){return S.getWidgetType("popup")}set config(e){this._config=e,e.customClass&&this._setCustomClass()}_bindEvent(){if(this._viewer&&this._wrapper){let e=this,t=this._viewer.scene;t.postRender.addEventListener(()=>{if(e._position&&e._enable&&e._updateWindowCoord&&e._wrapper.style.visibility==="visible"){let r=i.SceneTransforms.worldToWindowCoordinates(t,e._position);r&&e._updateWindowCoord(r)}})}}_mountContent(){this._wrapper.style.visibility="hidden"}_installHook(){this.enable=!0,this._bindEvent();let e=this;Object.defineProperty(this._viewer,"popup",{get(){return e}})}_updateWindowCoord(e){let t=e.x-this._wrapper.offsetWidth/2,r=e.y-this._wrapper.offsetHeight;this._config.position==="topleft"?(t=e.x-this._wrapper.offsetWidth,r=e.y-this._wrapper.offsetHeight):this._config.position==="topright"?(t=e.x,r=e.y-this._wrapper.offsetHeight):this._config.position==="bottomleft"?(t=e.x-this._wrapper.offsetWidth,r=e.y):this._config.position==="bottomright"&&(t=e.x,r=e.y),t=t+this._offsetX,r=r+this._offsetY,this._wrapper.style.cssText=`
96
+ `);let s=M.create("span","",t);s.innerHTML=e.name||"\u5730\u56FE"}addMap(e={}){this._enable&&(this._cache.push(e),this._addItem(e),this._cache.length>1&&(this._wrapper.style.visibility="visible"))}};O.registerType("map_switch");var cl=gr;var yr=class extends O{constructor(){super(),this._wrapper=M.create("div","widget popup"),this._config={customClass:""},this._position=void 0,this._offsetX=0,this._offsetY=0,this._state=_.INITIALIZED}get type(){return O.getWidgetType("popup")}set config(e){this._config=e,e.customClass&&this._setCustomClass()}_bindEvent(){if(this._viewer&&this._wrapper){let e=this,t=this._viewer.scene;t.postRender.addEventListener(()=>{if(e._position&&e._enable&&e._updateWindowCoord&&e._wrapper.style.visibility==="visible"){let r=i.SceneTransforms.worldToWindowCoordinates(t,e._position);r&&e._updateWindowCoord(r)}})}}_mountContent(){this._wrapper.style.visibility="hidden"}_installHook(){this.enable=!0,this._bindEvent();let e=this;Object.defineProperty(this._viewer,"popup",{get(){return e}})}_updateWindowCoord(e){let t=e.x-this._wrapper.offsetWidth/2,r=e.y-this._wrapper.offsetHeight;this._config.position==="topleft"?(t=e.x-this._wrapper.offsetWidth,r=e.y-this._wrapper.offsetHeight):this._config.position==="topright"?(t=e.x,r=e.y-this._wrapper.offsetHeight):this._config.position==="bottomleft"?(t=e.x-this._wrapper.offsetWidth,r=e.y):this._config.position==="bottomright"&&(t=e.x,r=e.y),t=t+this._offsetX,r=r+this._offsetY,this._wrapper.style.cssText=`
97
97
  visibility:visible;
98
98
  z-index:1;
99
99
  transform:translate3d(${Math.round(t)}px,${Math.round(r)}px, 0);
100
- `}_setCustomClass(){I.setClass(this._wrapper,`widget popup ${this._config.customClass}`)}setWrapper(e){return e&&e instanceof Element&&(this._wrapper=e,I.addClass(this._wrapper,"widget popup")),this}setPosition(e,t={x:0,y:0}){return this._position=e,this._offsetX=t.x||0,this._offsetY=t.y||0,this._wrapper&&(this._wrapper.style.cssText=`
100
+ `}_setCustomClass(){M.setClass(this._wrapper,`widget popup ${this._config.customClass}`)}setWrapper(e){return e&&e instanceof Element&&(this._wrapper=e,M.addClass(this._wrapper,"widget popup")),this}setPosition(e,t={x:0,y:0}){return this._position=e,this._offsetX=t.x||0,this._offsetY=t.y||0,this._wrapper&&(this._wrapper.style.cssText=`
101
101
  visibility:visible;
102
- `),this}showAt(e,t,r={x:0,y:0}){return this.setPosition(e,r).setContent(t),this}};S.registerType("popup");var El=Hr;var Wr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget tool-tip"),this._ready=!0,this._state=m.INITIALIZED}get type(){return S.getWidgetType("tooltip")}_installHook(){let e=this;Object.defineProperty(this._viewer,"tooltip",{get(){return e}})}_updateWindowCoord(e){let t=e.x+10,r=e.y-this._wrapper.offsetHeight/2;this._wrapper.style.cssText=`
102
+ `),this}showAt(e,t,r={x:0,y:0}){return this.setPosition(e,r).setContent(t),this}};O.registerType("popup");var dl=yr;var vr=class extends O{constructor(){super(),this._wrapper=M.create("div","widget tool-tip"),this._ready=!0,this._state=_.INITIALIZED}get type(){return O.getWidgetType("tooltip")}_installHook(){let e=this;Object.defineProperty(this._viewer,"tooltip",{get(){return e}})}_updateWindowCoord(e){let t=e.x+10,r=e.y-this._wrapper.offsetHeight/2;this._wrapper.style.cssText=`
103
103
  visibility:visible;
104
104
  z-index:1;
105
105
  transform:translate3d(${Math.round(t)}px,${Math.round(r)}px, 0);
106
- `}showAt(e,t){return this._enable?(e&&this._updateWindowCoord(e),this.setContent(t),this):this}};S.registerType("tooltip");var Pl=Wr;var Gr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget hawkeye-map",null),this._wrapper.setAttribute("id",C.uuid()),this._map=void 0,this._state=m.INITIALIZED}get type(){return S.getWidgetType("hawkeye_map")}_mountContent(){let e=new i.CesiumWidget(this._wrapper,{sceneMode:i.SceneMode.SCENE2D,creditContainer:document.createElement("div"),creditViewport:document.createElement("div"),baseLayer:!1});e.imageryLayers.removeAll(),e.canvas.parentNode.className="viewer-canvas",C.merge(e.scene.screenSpaceCameraController,{enableRotate:!1,enableTranslate:!1,enableZoom:!1,enableTilt:!1,enableLook:!1,maximumZoomDistance:40489014}),this._map=e,this._ready=!0}_bindEvent(){this._viewer.on(D.CAMERA_CHANGED,this._syncMap,this)}_unbindEvent(){this._viewer.off(D.CAMERA_CHANGED,this._syncMap,this)}_installHook(){let e=this;Object.defineProperty(this._viewer,"hawkeyeMap",{get(){return e}}),this._viewer.camera.percentageChanged=.01}_syncMap(){let e=new i.Cartesian2(Math.floor(this._viewer.canvas.clientWidth/2),Math.floor(this._viewer.canvas.clientHeight/2)),t=this._viewer.scene.camera.pickEllipsoid(e);if(!t)return!1;let r=i.Cartesian3.distance(t,this._viewer.scene.camera.positionWC);this._map.scene.camera.lookAt(t,new i.Cartesian3(0,0,r))}addBaseLayer(e){return!this._map||!this._enable?this:(e&&(this._map.imageryLayers.removeAll(),Array.isArray(e)||(e=[e]),e.forEach(t=>{this._map.imageryLayers.add(i.ImageryLayer.fromProviderAsync(t,{}))})),this)}};S.registerType("hawkeye_map");var bl=Gr;var Ur=class extends S{constructor(){super(),this._wrapper=I.create("div","widget compass"),this._compassRectangle=void 0,this._outRing=void 0,this._gyro=void 0,this._rotation_marker=void 0,this._orbitCursorAngle=0,this._orbitCursorOpacity=0,this._orbitLastTimestamp=0,this._orbitFrame=void 0,this._orbitIsLook=!1,this._rotateInitialCursorAngle=void 0,this._rotateFrame=void 0,this._mouseMoveHandle=void 0,this._mouseUpHandle=void 0,this._state=m.INITIALIZED}get type(){return S.getWidgetType("compass")}_installHook(){let e=this;Object.defineProperty(this._viewer,"compass",{get(){return e}}),this._wrapper.onmousedown=t=>{this._handleMouseDown(t)},this._wrapper.ondblclick=t=>{this._handleDoubleClick(t)}}_bindEvent(){this._viewer.on(D.POST_RENDER,this._postRenderHandler,this)}_unbindEvent(){this._viewer.off(D.POST_RENDER,this._postRenderHandler,this)}_postRenderHandler(){let e=this._viewer.camera.heading;this._outRing&&(this._outRing.style.cssText=`
106
+ `}showAt(e,t){return this._enable?(e&&this._updateWindowCoord(e),this.setContent(t),this):this}};O.registerType("tooltip");var pl=vr;var wr=class extends O{constructor(){super(),this._wrapper=M.create("div","widget hawkeye-map",null),this._wrapper.setAttribute("id",v.uuid()),this._map=void 0,this._state=_.INITIALIZED}get type(){return O.getWidgetType("hawkeye_map")}_mountContent(){let e=new i.CesiumWidget(this._wrapper,{sceneMode:i.SceneMode.SCENE2D,creditContainer:document.createElement("div"),creditViewport:document.createElement("div"),baseLayer:!1});e.imageryLayers.removeAll(),e.canvas.parentNode.className="viewer-canvas",v.merge(e.scene.screenSpaceCameraController,{enableRotate:!1,enableTranslate:!1,enableZoom:!1,enableTilt:!1,enableLook:!1,maximumZoomDistance:40489014}),this._map=e,this._ready=!0}_bindEvent(){this._viewer.on(D.CAMERA_CHANGED,this._syncMap,this)}_unbindEvent(){this._viewer.off(D.CAMERA_CHANGED,this._syncMap,this)}_installHook(){let e=this;Object.defineProperty(this._viewer,"hawkeyeMap",{get(){return e}}),this._viewer.camera.percentageChanged=.01}_syncMap(){let e=new i.Cartesian2(Math.floor(this._viewer.canvas.clientWidth/2),Math.floor(this._viewer.canvas.clientHeight/2)),t=this._viewer.scene.camera.pickEllipsoid(e);if(!t)return!1;let r=i.Cartesian3.distance(t,this._viewer.scene.camera.positionWC);this._map.scene.camera.lookAt(t,new i.Cartesian3(0,0,r))}addBaseLayer(e){return!this._map||!this._enable?this:(e&&(this._map.imageryLayers.removeAll(),Array.isArray(e)||(e=[e]),e.forEach(t=>{this._map.imageryLayers.add(i.ImageryLayer.fromProviderAsync(t,{}))})),this)}};O.registerType("hawkeye_map");var ml=wr;var Cr=class extends O{constructor(){super(),this._wrapper=M.create("div","widget compass"),this._compassRectangle=void 0,this._outRing=void 0,this._gyro=void 0,this._rotation_marker=void 0,this._orbitCursorAngle=0,this._orbitCursorOpacity=0,this._orbitLastTimestamp=0,this._orbitFrame=void 0,this._orbitIsLook=!1,this._rotateInitialCursorAngle=void 0,this._rotateFrame=void 0,this._mouseMoveHandle=void 0,this._mouseUpHandle=void 0,this._state=_.INITIALIZED}get type(){return O.getWidgetType("compass")}_installHook(){let e=this;Object.defineProperty(this._viewer,"compass",{get(){return e}}),this._wrapper.onmousedown=t=>{this._handleMouseDown(t)},this._wrapper.ondblclick=t=>{this._handleDoubleClick(t)}}_bindEvent(){this._viewer.on(D.POST_RENDER,this._postRenderHandler,this)}_unbindEvent(){this._viewer.off(D.POST_RENDER,this._postRenderHandler,this)}_postRenderHandler(){let e=this._viewer.camera.heading;this._outRing&&(this._outRing.style.cssText=`
107
107
  transform : rotate(-${e}rad);
108
108
  -webkit-transform : rotate(-${e}rad);
109
- `)}_mountContent(){I.create("div","out-ring-bg",this._wrapper),this._outRing=I.parseDom(re.compass_outer,!0,"out-ring"),this._wrapper.appendChild(this._outRing),this._gyro=I.parseDom(re.compass_inner,!0,"gyro"),this._wrapper.appendChild(this._gyro),this._rotation_marker=I.parseDom(re.compass_rotation_marker,!0,"rotation_marker"),this._wrapper.appendChild(this._rotation_marker),this._rotation_marker.style.visibility="hidden",this._ready=!0}_handleMouseDown(e){if(this._viewer.scene.mode===i.SceneMode.MORPHING)return!0;this._compassRectangle=e.currentTarget.getBoundingClientRect();let r=this._compassRectangle.width/2,s=this._getVector(e),o=i.Cartesian2.magnitude(s)/r;if(o<50/145)this._orbit(s);else if(o<1)this._rotate(s);else return!0}_handleDoubleClick(){let e=this._viewer.scene,t=e.camera,r=e.screenSpaceCameraController;if(e.mode===i.SceneMode.MORPHING||!r.enableInputs)return!0;if(e.mode===i.SceneMode.COLUMBUS_VIEW&&!r.enableTranslate||(e.mode===i.SceneMode.SCENE3D||e.mode===i.SceneMode.COLUMBUS_VIEW)&&(!r.enableLook||e.mode===i.SceneMode.SCENE3D&&!r.enableRotate))return;let s=this._getCameraFocus(!0);if(!s)return;let o=e.globe.ellipsoid.cartographicToCartesian(t.positionCartographic),n=e.globe.ellipsoid.geodeticSurfaceNormal(s),l=new i.BoundingSphere(s,0);t.flyToBoundingSphere(l,{offset:new i.HeadingPitchRange(0,i.Math.PI_OVER_TWO-i.Cartesian3.angleBetween(n,t.directionWC),i.Cartesian3.distance(o,s)),duration:1.5})}_getCameraFocus(e){let t=new i.Cartesian3,r=this._viewer.scene,s=r.camera;if(r.mode!==i.SceneMode.MORPHING){if(this._viewer.delegate.trackedEntity)t=this._viewer.delegate.trackedEntity.position.getValue(this._viewer.clock.currentTime);else{let o=new i.Ray;o.origin=s.positionWC,o.direction=s.directionWC,t=r.globe.pick(o,r)}if(t){if(r.mode===i.SceneMode.SCENE2D||r.mode===i.SceneMode.COLUMBUS_VIEW){t=s.worldToCameraCoordinatesPoint(t);let o=new i.Cartographic;e&&(t=r.globe.ellipsoid.cartographicToCartesian(r.mapProjection.unproject(t,o)))}else e||(t=s.worldToCameraCoordinatesPoint(t));return t}}}_orbit(e){let t=this._viewer.scene,r=t.screenSpaceCameraController,s=t.camera;if(!(t.mode===i.SceneMode.MORPHING||!r.enableInputs)){switch(t.mode){case i.SceneMode.COLUMBUS_VIEW:if(r.enableLook)break;if(!r.enableTranslate||!r.enableTilt)return;break;case i.SceneMode.SCENE3D:if(r.enableLook)break;if(!r.enableTilt||!r.enableRotate)return;break;case i.SceneMode.SCENE2D:if(!r.enableTranslate)return;break}if(this._mouseMoveHandle=o=>{this._orbitMouseMoveFunction(o)},this._mouseUpHandle=()=>{this._orbitMouseUpFunction()},document.removeEventListener("mousemove",this._mouseMoveHandle,!1),document.removeEventListener("mouseup",this._mouseUpHandle,!1),this._orbitLastTimestamp=i.getTimestamp(),this._viewer.delegate.trackedEntity)this._orbitFrame=void 0,this._orbitIsLook=!1;else{let o=this._getCameraFocus(!0);o?(this._orbitFrame=i.Transforms.eastNorthUpToFixedFrame(o,t.globe.ellipsoid),this._orbitIsLook=!1):(this._orbitFrame=i.Transforms.eastNorthUpToFixedFrame(s.positionWC,t.globe.ellipsoid),this._orbitIsLook=!0)}this._rotation_marker.style.visibility="visible",this._gyro.className+=" gyro-active",document.addEventListener("mousemove",this._mouseMoveHandle,!1),document.addEventListener("mouseup",this._mouseUpHandle,!1),this._viewer.clock.onTick.addEventListener(this._orbitTickFunction,this),this._updateAngleAndOpacity(e,this._compassRectangle.width)}}_orbitTickFunction(){let e=this._viewer.scene,t=this._viewer.camera,r=i.getTimestamp(),s=r-this._orbitLastTimestamp,o=(this._orbitCursorOpacity-.5)*2.5/1e3,n=s*o,l=this._orbitCursorAngle+i.Math.PI_OVER_TWO,h=Math.cos(l)*n,c=Math.sin(l)*n,p;this._orbitFrame&&(p=i.Matrix4.clone(t.transform),t.lookAtTransform(this._orbitFrame)),e.mode===i.SceneMode.SCENE2D?t.move(new i.Cartesian3(h,c,0),Math.max(e.canvas.clientWidth,e.canvas.clientHeight)/100*t.positionCartographic.height*n):this._orbitIsLook?(t.look(i.Cartesian3.UNIT_Z,-h),t.look(t.right,-c)):(t.rotateLeft(h),t.rotateUp(c)),this._orbitFrame&&p&&t.lookAtTransform(p),this._orbitLastTimestamp=r}_updateAngleAndOpacity(e,t){let r=Math.atan2(-e.y,e.x);this._orbitCursorAngle=i.Math.zeroToTwoPi(r-i.Math.PI_OVER_TWO);let s=i.Cartesian2.magnitude(e),o=t/2,n=Math.min(s/o,1);this._orbitCursorOpacity=.5*n*n+.5,this._rotation_marker.style.cssText=`
109
+ `)}_mountContent(){M.create("div","out-ring-bg",this._wrapper),this._outRing=M.parseDom(ie.compass_outer,!0,"out-ring"),this._wrapper.appendChild(this._outRing),this._gyro=M.parseDom(ie.compass_inner,!0,"gyro"),this._wrapper.appendChild(this._gyro),this._rotation_marker=M.parseDom(ie.compass_rotation_marker,!0,"rotation_marker"),this._wrapper.appendChild(this._rotation_marker),this._rotation_marker.style.visibility="hidden",this._ready=!0}_handleMouseDown(e){if(this._viewer.scene.mode===i.SceneMode.MORPHING)return!0;this._compassRectangle=e.currentTarget.getBoundingClientRect();let r=this._compassRectangle.width/2,s=this._getVector(e),o=i.Cartesian2.magnitude(s)/r;if(o<50/145)this._orbit(s);else if(o<1)this._rotate(s);else return!0}_handleDoubleClick(){let e=this._viewer.scene,t=e.camera,r=e.screenSpaceCameraController;if(e.mode===i.SceneMode.MORPHING||!r.enableInputs)return!0;if(e.mode===i.SceneMode.COLUMBUS_VIEW&&!r.enableTranslate||(e.mode===i.SceneMode.SCENE3D||e.mode===i.SceneMode.COLUMBUS_VIEW)&&(!r.enableLook||e.mode===i.SceneMode.SCENE3D&&!r.enableRotate))return;let s=this._getCameraFocus(!0);if(!s)return;let o=e.globe.ellipsoid.cartographicToCartesian(t.positionCartographic),n=e.globe.ellipsoid.geodeticSurfaceNormal(s),l=new i.BoundingSphere(s,0);t.flyToBoundingSphere(l,{offset:new i.HeadingPitchRange(0,i.Math.PI_OVER_TWO-i.Cartesian3.angleBetween(n,t.directionWC),i.Cartesian3.distance(o,s)),duration:1.5})}_getCameraFocus(e){let t=new i.Cartesian3,r=this._viewer.scene,s=r.camera;if(r.mode!==i.SceneMode.MORPHING){if(this._viewer.delegate.trackedEntity)t=this._viewer.delegate.trackedEntity.position.getValue(this._viewer.clock.currentTime);else{let o=new i.Ray;o.origin=s.positionWC,o.direction=s.directionWC,t=r.globe.pick(o,r)}if(t){if(r.mode===i.SceneMode.SCENE2D||r.mode===i.SceneMode.COLUMBUS_VIEW){t=s.worldToCameraCoordinatesPoint(t);let o=new i.Cartographic;e&&(t=r.globe.ellipsoid.cartographicToCartesian(r.mapProjection.unproject(t,o)))}else e||(t=s.worldToCameraCoordinatesPoint(t));return t}}}_orbit(e){let t=this._viewer.scene,r=t.screenSpaceCameraController,s=t.camera;if(!(t.mode===i.SceneMode.MORPHING||!r.enableInputs)){switch(t.mode){case i.SceneMode.COLUMBUS_VIEW:if(r.enableLook)break;if(!r.enableTranslate||!r.enableTilt)return;break;case i.SceneMode.SCENE3D:if(r.enableLook)break;if(!r.enableTilt||!r.enableRotate)return;break;case i.SceneMode.SCENE2D:if(!r.enableTranslate)return;break}if(this._mouseMoveHandle=o=>{this._orbitMouseMoveFunction(o)},this._mouseUpHandle=()=>{this._orbitMouseUpFunction()},document.removeEventListener("mousemove",this._mouseMoveHandle,!1),document.removeEventListener("mouseup",this._mouseUpHandle,!1),this._orbitLastTimestamp=i.getTimestamp(),this._viewer.delegate.trackedEntity)this._orbitFrame=void 0,this._orbitIsLook=!1;else{let o=this._getCameraFocus(!0);o?(this._orbitFrame=i.Transforms.eastNorthUpToFixedFrame(o,t.globe.ellipsoid),this._orbitIsLook=!1):(this._orbitFrame=i.Transforms.eastNorthUpToFixedFrame(s.positionWC,t.globe.ellipsoid),this._orbitIsLook=!0)}this._rotation_marker.style.visibility="visible",this._gyro.className+=" gyro-active",document.addEventListener("mousemove",this._mouseMoveHandle,!1),document.addEventListener("mouseup",this._mouseUpHandle,!1),this._viewer.clock.onTick.addEventListener(this._orbitTickFunction,this),this._updateAngleAndOpacity(e,this._compassRectangle.width)}}_orbitTickFunction(){let e=this._viewer.scene,t=this._viewer.camera,r=i.getTimestamp(),s=r-this._orbitLastTimestamp,o=(this._orbitCursorOpacity-.5)*2.5/1e3,n=s*o,l=this._orbitCursorAngle+i.Math.PI_OVER_TWO,h=Math.cos(l)*n,c=Math.sin(l)*n,d;this._orbitFrame&&(d=i.Matrix4.clone(t.transform),t.lookAtTransform(this._orbitFrame)),e.mode===i.SceneMode.SCENE2D?t.move(new i.Cartesian3(h,c,0),Math.max(e.canvas.clientWidth,e.canvas.clientHeight)/100*t.positionCartographic.height*n):this._orbitIsLook?(t.look(i.Cartesian3.UNIT_Z,-h),t.look(t.right,-c)):(t.rotateLeft(h),t.rotateUp(c)),this._orbitFrame&&d&&t.lookAtTransform(d),this._orbitLastTimestamp=r}_updateAngleAndOpacity(e,t){let r=Math.atan2(-e.y,e.x);this._orbitCursorAngle=i.Math.zeroToTwoPi(r-i.Math.PI_OVER_TWO);let s=i.Cartesian2.magnitude(e),o=t/2,n=Math.min(s/o,1);this._orbitCursorOpacity=.5*n*n+.5,this._rotation_marker.style.cssText=`
110
110
  transform: rotate(-${this._orbitCursorAngle}rad);
111
- opacity: ${this._orbitCursorOpacity}`}_orbitMouseMoveFunction(e){this._updateAngleAndOpacity(this._getVector(e),this._compassRectangle.width)}_orbitMouseUpFunction(){document.removeEventListener("mousemove",this._mouseMoveHandle,!1),document.removeEventListener("mouseup",this._mouseUpHandle,!1),this._viewer.clock.onTick.removeEventListener(this._orbitTickFunction,this),this._mouseMoveHandle=void 0,this._mouseUpHandle=void 0,this._rotation_marker.style.visibility="hidden",this._gyro.className=this._gyro.className.replace(" gyro-active","")}_rotate(e){let t=this._viewer.scene,r=t.camera,s=t.screenSpaceCameraController;if(t.mode===i.SceneMode.MORPHING||t.mode===i.SceneMode.SCENE2D||!s.enableInputs||!s.enableLook&&(t.mode===i.SceneMode.COLUMBUS_VIEW||t.mode===i.SceneMode.SCENE3D&&!s.enableRotate))return;if(this._mouseMoveHandle=n=>{this._rotateMouseMoveFunction(n)},this._mouseUpHandle=()=>{this._rotateMouseUpFunction()},document.removeEventListener("mousemove",this._mouseMoveHandle,!1),document.removeEventListener("mouseup",this._mouseUpHandle,!1),this._rotateInitialCursorAngle=Math.atan2(-e.y,e.x),this._viewer.delegate.trackedEntity)this._rotateFrame=void 0;else{let n=this._getCameraFocus(!0);!n||t.mode===i.SceneMode.COLUMBUS_VIEW&&!s.enableLook&&!s.enableTranslate?this._rotateFrame=i.Transforms.eastNorthUpToFixedFrame(r.positionWC,t.globe.ellipsoid):this._rotateFrame=i.Transforms.eastNorthUpToFixedFrame(n,t.globe.ellipsoid)}let o;this._rotateFrame&&(o=i.Matrix4.clone(r.transform),r.lookAtTransform(this._rotateFrame)),this._rotateInitialCameraAngle=-r.heading,this._rotateFrame&&o&&r.lookAtTransform(o),document.addEventListener("mousemove",this._mouseMoveHandle,!1),document.addEventListener("mouseup",this._mouseUpHandle,!1)}_rotateMouseMoveFunction(e){let t=this._viewer.camera,r=this._getVector(e),o=Math.atan2(-r.y,r.x)-this._rotateInitialCursorAngle,n=i.Math.zeroToTwoPi(this._rotateInitialCameraAngle-o),l;this._rotateFrame&&(l=i.Matrix4.clone(t.transform),t.lookAtTransform(this._rotateFrame));let h=-t.heading;t.rotateRight(n-h),this._rotateFrame&&l&&t.lookAtTransform(l)}_rotateMouseUpFunction(){document.removeEventListener("mousemove",this._mouseMoveHandle,!1),document.removeEventListener("mouseup",this._mouseUpHandle,!1),this._mouseMoveHandle=void 0,this._mouseUpHandle=void 0}_getVector(e){let t=this._compassRectangle,r=new i.Cartesian2((t.right-t.left)/2,(t.bottom-t.top)/2),s=new i.Cartesian2(e.clientX-t.left,e.clientY-t.top),o=new i.Cartesian2;return i.Cartesian2.subtract(s,r,o),o}};S.registerType("compass");var Al=Ur;var Ml=new i.EllipsoidGeodesic,ke=[1,2,3,5],Br=[...ke,...ke.map(a=>a*10),...ke.map(a=>a*100),...ke.map(a=>a*1e3),...ke.map(a=>a*1e4),...ke.map(a=>a*1e5),...ke.map(a=>a*1e6)],Vr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget distance-legend"),this._labelEl=void 0,this._scaleBarEl=void 0,this._lastUpdate=i.getTimestamp(),this._state=m.INITIALIZED}get type(){return S.getWidgetType("distance_legend")}_installHook(){let e=this;Object.defineProperty(this._viewer,"distanceLegend",{get(){return e}})}_bindEvent(){this._viewer.on(D.POST_RENDER,this._updateContent,this)}_unbindEvent(){this._viewer.off(D.POST_RENDER,this._updateContent,this)}_updateContent(e,t){let r=i.getTimestamp();if(r<this._lastUpdate+250||!this._labelEl||!this._scaleBarEl)return;this._lastUpdate=r;let s=e.canvas.width,o=e.canvas.height,n=e.camera.getPickRay(new i.Cartesian2(s/2|0,o-1)),l=e.camera.getPickRay(new i.Cartesian2(1+s/2|0,o-1)),h=e.globe.pick(n,e),c=e.globe.pick(l,e);if(!h||!c)return;Ml.setEndPoints(e.globe.ellipsoid.cartesianToCartographic(h),e.globe.ellipsoid.cartesianToCartographic(c));let p=Ml.surfaceDistance,u=100,g=0;for(let _=Br.length-1;_>=0;--_)if(Br[_]/p<u){g=Br[_];break}if(g){this._wrapper.style.visibility="visible",this._labelEl.innerHTML=g>=1e3?`${g/1e3} km`:`${g} m`;let _=g/p|0;this._scaleBarEl.style.cssText=`width: ${_}px; left: ${(125-_)/2}px;`}}_mountContent(){this._labelEl=I.create("div","label",this._wrapper),this._scaleBarEl=I.create("div","scale-bar",this._wrapper),this._wrapper.style.visibility="hidden",this._ready=!0}};S.registerType("distance_legend");var Il=Vr;var jr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget zoom-controller"),this._zoomInEl=void 0,this._zoomOutEl=void 0,this._refreshEl=void 0,this._state=m.INITIALIZED}get type(){return S.getWidgetType("zoom_controller")}_getCameraFocus(e){let t=new i.Ray(e.camera.positionWC,e.camera.directionWC),r=i.IntersectionTests.rayEllipsoid(t,i.Ellipsoid.WGS84);return r?i.Ray.getPoint(t,r.start):i.IntersectionTests.grazingAltitudeLocation(t,i.Ellipsoid.WGS84)}_getCameraPosition(e,t,r){let s=new i.Cartesian3,o=i.Cartesian3.subtract(t,e.position,s),n=i.Cartesian3.multiplyByScalar(o,r,s);return i.Cartesian3.add(e.position,n,s)}_zoomIn(){let e=this._viewer.scene,t=e.camera,r=e.screenSpaceCameraController;if(e.mode===i.SceneMode.MORPHING||!r.enableInputs||e.mode===i.SceneMode.COLUMBUS_VIEW)return!0;if(e.mode===i.SceneMode.SCENE2D)t.zoomIn(t.positionCartographic.height*.5);else if(e.mode===i.SceneMode.SCENE3D){let s=this._getCameraFocus(e),o=this._getCameraPosition(t,s,1/2);t.flyTo({destination:o,orientation:{heading:t.heading,pitch:t.pitch,roll:t.roll},duration:.5,convert:!1})}}_refresh(){this._viewer.camera.flyHome(1.5)}_zoomOut(){let e=this._viewer.scene,t=e.camera,r=e.screenSpaceCameraController;if(e.mode===i.SceneMode.MORPHING||!r.enableInputs||e.mode===i.SceneMode.COLUMBUS_VIEW)return!0;if(e.mode===i.SceneMode.SCENE2D)t.zoomOut(t.positionCartographic.height);else if(e.mode===i.SceneMode.SCENE3D){let s=this._getCameraFocus(e),o=this._getCameraPosition(t,s,-1);t.flyTo({destination:o,orientation:{heading:t.heading,pitch:t.pitch,roll:t.roll},duration:.5,convert:!1})}}_installHook(){let e=this;Object.defineProperty(this._viewer,"zoomController",{get(){return e}})}_mountContent(){this._zoomInEl=I.parseDom(re.increase,!0,"zoom-in"),this._refreshEl=I.parseDom(re.refresh,!0,"refresh"),this._zoomOutEl=I.parseDom(re.decrease,!0,"zoom-out"),this._wrapper.appendChild(this._zoomInEl),this._wrapper.appendChild(this._refreshEl),this._wrapper.appendChild(this._zoomOutEl);let e=this;this._zoomInEl.onclick=()=>{e._zoomIn()},this._refreshEl.onclick=()=>{e._refresh()},this._zoomOutEl.onclick=()=>{e._zoomOut()},this._ready=!0}};S.registerType("zoom_controller");var Sl=jr;var qr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget loading-mask"),this._state=m.INITIALIZED}get type(){return S.getWidgetType("loading_mask")}_installHook(){let e=this;Object.defineProperty(this._viewer,"loadingMask",{get(){return e}})}_mountContent(){let e=I.parseDom(`
111
+ opacity: ${this._orbitCursorOpacity}`}_orbitMouseMoveFunction(e){this._updateAngleAndOpacity(this._getVector(e),this._compassRectangle.width)}_orbitMouseUpFunction(){document.removeEventListener("mousemove",this._mouseMoveHandle,!1),document.removeEventListener("mouseup",this._mouseUpHandle,!1),this._viewer.clock.onTick.removeEventListener(this._orbitTickFunction,this),this._mouseMoveHandle=void 0,this._mouseUpHandle=void 0,this._rotation_marker.style.visibility="hidden",this._gyro.className=this._gyro.className.replace(" gyro-active","")}_rotate(e){let t=this._viewer.scene,r=t.camera,s=t.screenSpaceCameraController;if(t.mode===i.SceneMode.MORPHING||t.mode===i.SceneMode.SCENE2D||!s.enableInputs||!s.enableLook&&(t.mode===i.SceneMode.COLUMBUS_VIEW||t.mode===i.SceneMode.SCENE3D&&!s.enableRotate))return;if(this._mouseMoveHandle=n=>{this._rotateMouseMoveFunction(n)},this._mouseUpHandle=()=>{this._rotateMouseUpFunction()},document.removeEventListener("mousemove",this._mouseMoveHandle,!1),document.removeEventListener("mouseup",this._mouseUpHandle,!1),this._rotateInitialCursorAngle=Math.atan2(-e.y,e.x),this._viewer.delegate.trackedEntity)this._rotateFrame=void 0;else{let n=this._getCameraFocus(!0);!n||t.mode===i.SceneMode.COLUMBUS_VIEW&&!s.enableLook&&!s.enableTranslate?this._rotateFrame=i.Transforms.eastNorthUpToFixedFrame(r.positionWC,t.globe.ellipsoid):this._rotateFrame=i.Transforms.eastNorthUpToFixedFrame(n,t.globe.ellipsoid)}let o;this._rotateFrame&&(o=i.Matrix4.clone(r.transform),r.lookAtTransform(this._rotateFrame)),this._rotateInitialCameraAngle=-r.heading,this._rotateFrame&&o&&r.lookAtTransform(o),document.addEventListener("mousemove",this._mouseMoveHandle,!1),document.addEventListener("mouseup",this._mouseUpHandle,!1)}_rotateMouseMoveFunction(e){let t=this._viewer.camera,r=this._getVector(e),o=Math.atan2(-r.y,r.x)-this._rotateInitialCursorAngle,n=i.Math.zeroToTwoPi(this._rotateInitialCameraAngle-o),l;this._rotateFrame&&(l=i.Matrix4.clone(t.transform),t.lookAtTransform(this._rotateFrame));let h=-t.heading;t.rotateRight(n-h),this._rotateFrame&&l&&t.lookAtTransform(l)}_rotateMouseUpFunction(){document.removeEventListener("mousemove",this._mouseMoveHandle,!1),document.removeEventListener("mouseup",this._mouseUpHandle,!1),this._mouseMoveHandle=void 0,this._mouseUpHandle=void 0}_getVector(e){let t=this._compassRectangle,r=new i.Cartesian2((t.right-t.left)/2,(t.bottom-t.top)/2),s=new i.Cartesian2(e.clientX-t.left,e.clientY-t.top),o=new i.Cartesian2;return i.Cartesian2.subtract(s,r,o),o}};O.registerType("compass");var ul=Cr;var _l=new i.EllipsoidGeodesic,Fe=[1,2,3,5],xr=[...Fe,...Fe.map(a=>a*10),...Fe.map(a=>a*100),...Fe.map(a=>a*1e3),...Fe.map(a=>a*1e4),...Fe.map(a=>a*1e5),...Fe.map(a=>a*1e6)],Tr=class extends O{constructor(){super(),this._wrapper=M.create("div","widget distance-legend"),this._labelEl=void 0,this._scaleBarEl=void 0,this._lastUpdate=i.getTimestamp(),this._state=_.INITIALIZED}get type(){return O.getWidgetType("distance_legend")}_installHook(){let e=this;Object.defineProperty(this._viewer,"distanceLegend",{get(){return e}})}_bindEvent(){this._viewer.on(D.POST_RENDER,this._updateContent,this)}_unbindEvent(){this._viewer.off(D.POST_RENDER,this._updateContent,this)}_updateContent(e,t){let r=i.getTimestamp();if(r<this._lastUpdate+250||!this._labelEl||!this._scaleBarEl)return;this._lastUpdate=r;let s=e.canvas.width,o=e.canvas.height,n=e.camera.getPickRay(new i.Cartesian2(s/2|0,o-1)),l=e.camera.getPickRay(new i.Cartesian2(1+s/2|0,o-1)),h=e.globe.pick(n,e),c=e.globe.pick(l,e);if(!h||!c)return;_l.setEndPoints(e.globe.ellipsoid.cartesianToCartographic(h),e.globe.ellipsoid.cartesianToCartographic(c));let d=_l.surfaceDistance,m=100,f=0;for(let u=xr.length-1;u>=0;--u)if(xr[u]/d<m){f=xr[u];break}if(f){this._wrapper.style.visibility="visible",this._labelEl.innerHTML=f>=1e3?`${f/1e3} km`:`${f} m`;let u=f/d|0;this._scaleBarEl.style.cssText=`width: ${u}px; left: ${(125-u)/2}px;`}}_mountContent(){this._labelEl=M.create("div","label",this._wrapper),this._scaleBarEl=M.create("div","scale-bar",this._wrapper),this._wrapper.style.visibility="hidden",this._ready=!0}};O.registerType("distance_legend");var fl=Tr;var Er=class extends O{constructor(){super(),this._wrapper=M.create("div","widget zoom-controller"),this._zoomInEl=void 0,this._zoomOutEl=void 0,this._refreshEl=void 0,this._state=_.INITIALIZED}get type(){return O.getWidgetType("zoom_controller")}_getCameraFocus(e){let t=new i.Ray(e.camera.positionWC,e.camera.directionWC),r=i.IntersectionTests.rayEllipsoid(t,i.Ellipsoid.WGS84);return r?i.Ray.getPoint(t,r.start):i.IntersectionTests.grazingAltitudeLocation(t,i.Ellipsoid.WGS84)}_getCameraPosition(e,t,r){let s=new i.Cartesian3,o=i.Cartesian3.subtract(t,e.position,s),n=i.Cartesian3.multiplyByScalar(o,r,s);return i.Cartesian3.add(e.position,n,s)}_zoomIn(){let e=this._viewer.scene,t=e.camera,r=e.screenSpaceCameraController;if(e.mode===i.SceneMode.MORPHING||!r.enableInputs||e.mode===i.SceneMode.COLUMBUS_VIEW)return!0;if(e.mode===i.SceneMode.SCENE2D)t.zoomIn(t.positionCartographic.height*.5);else if(e.mode===i.SceneMode.SCENE3D){let s=this._getCameraFocus(e),o=this._getCameraPosition(t,s,1/2);t.flyTo({destination:o,orientation:{heading:t.heading,pitch:t.pitch,roll:t.roll},duration:.5,convert:!1})}}_refresh(){this._viewer.camera.flyHome(1.5)}_zoomOut(){let e=this._viewer.scene,t=e.camera,r=e.screenSpaceCameraController;if(e.mode===i.SceneMode.MORPHING||!r.enableInputs||e.mode===i.SceneMode.COLUMBUS_VIEW)return!0;if(e.mode===i.SceneMode.SCENE2D)t.zoomOut(t.positionCartographic.height);else if(e.mode===i.SceneMode.SCENE3D){let s=this._getCameraFocus(e),o=this._getCameraPosition(t,s,-1);t.flyTo({destination:o,orientation:{heading:t.heading,pitch:t.pitch,roll:t.roll},duration:.5,convert:!1})}}_installHook(){let e=this;Object.defineProperty(this._viewer,"zoomController",{get(){return e}})}_mountContent(){this._zoomInEl=M.parseDom(ie.increase,!0,"zoom-in"),this._refreshEl=M.parseDom(ie.refresh,!0,"refresh"),this._zoomOutEl=M.parseDom(ie.decrease,!0,"zoom-out"),this._wrapper.appendChild(this._zoomInEl),this._wrapper.appendChild(this._refreshEl),this._wrapper.appendChild(this._zoomOutEl);let e=this;this._zoomInEl.onclick=()=>{e._zoomIn()},this._refreshEl.onclick=()=>{e._refresh()},this._zoomOutEl.onclick=()=>{e._zoomOut()},this._ready=!0}};O.registerType("zoom_controller");var gl=Er;var Pr=class extends O{constructor(){super(),this._wrapper=M.create("div","widget loading-mask"),this._state=_.INITIALIZED}get type(){return O.getWidgetType("loading_mask")}_installHook(){let e=this;Object.defineProperty(this._viewer,"loadingMask",{get(){return e}})}_mountContent(){let e=M.parseDom(`
112
112
  <span></span>
113
113
  <span></span>
114
114
  <span></span>
115
115
  <span></span>
116
116
  <span></span>
117
- `,!0,"loading");this._wrapper.appendChild(e),this._ready=!0}};S.registerType("loading_mask");var Dl=qr;var Zr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget slider"),this._tileset=void 0,this._moveActive=!1,this._state=m.INITIALIZED}get type(){return S.getWidgetType("tileset_split")}_installHook(){let e=this;Object.defineProperty(this._viewer,"tilesetSplit",{get(){return e}})}_bindEvent(){this._viewer.scene.splitPosition=.5,this._wrapper.style.left="50%"}_unbindEvent(){this._tileset?this._viewer.scene.splitPosition=this._tileset.splitDirection>0?1:0:this._viewer.scene.splitPosition=0}_mountContent(){let e=I.parseDom(re.splitter,!0,"splitter");this._wrapper.appendChild(e);let t=new i.ScreenSpaceEventHandler(e),r=this;t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.PINCH_START),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.MOUSE_MOVE),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.PINCH_MOVE),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.LEFT_UP),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.PINCH_END),this._ready=!0}_moveHandler(e){if(!this._moveActive||!this._enable)return;let t=e.endPosition.x,r=(this._wrapper.offsetLeft+t)/this._wrapper.parentElement.offsetWidth;this._wrapper.style.left=100*r+"%",this._viewer.scene.splitPosition=r}addTileset(e){return!this._viewer||!this._enable?this:(e&&(this._tileset&&this._viewer.scene.primitives.remove(this._tileset),this._tileset=this._viewer.scene.primitives.add(e.delegate||e),this._viewer.scene.splitPosition=this._wrapper.offsetLeft/this._wrapper.parentElement.offsetWidth),this)}};S.registerType("tileset_split");var Ll=Zr;var Yr=class extends S{constructor(){super(),this._wrapper=I.create("div","widget slider"),this._tileset=void 0,this._baseLayer=void 0,this._moveActive=!1,this._state=m.INITIALIZED}get type(){return S.getWidgetType("scene_split")}_installHook(){let e=this;Object.defineProperty(this._viewer,"sceneSplit",{get(){return e}})}_bindEvent(){this._viewer.scene.splitPosition=.5,this._wrapper.style.left="50%"}_unbindEvent(){this._viewer.scene.splitPosition=1}_mountContent(){let e=I.parseDom(re.splitter,!0,"splitter");this._wrapper.appendChild(e);let t=new i.ScreenSpaceEventHandler(e),r=this;t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.PINCH_START),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.MOUSE_MOVE),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.PINCH_MOVE),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.LEFT_UP),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.PINCH_END),this._ready=!0}_moveHandler(e){if(!this._moveActive||!this._enable)return;let t=e.endPosition.x,r=(this._wrapper.offsetLeft+t)/this._wrapper.parentElement.offsetWidth;this._wrapper.style.left=100*r+"%",this._viewer.scene.splitPosition=r}addTileset(e){return!this._viewer||!this._enable?this:(e&&(this._tileset&&this._viewer.scene.primitives.remove(this._tileset),Promise.resolve(e.delegate||e).then(t=>{this._tileset=this._viewer.scene.primitives.add(t)})),this)}addBaseLayer(e){return!this._viewer||!this._enable?this:(e&&(this._baseLayer&&this._viewer.imageryLayers.remove(this._baseLayer),Promise.resolve(e).then(t=>{this._baseLayer=this._viewer.imageryLayers.addImageryProvider(t),this._baseLayer.splitDirection=1})),this)}};S.registerType("scene_split");var Rl=Yr;function Xr(){return{popup:new El,contextMenu:new dl,tooltip:new Pl,mapSwitch:new Tl,mapSplit:new xl,locationBar:new ml,hawkeyeMap:new bl,compass:new Al,distanceLegend:new Il,zoomController:new Sl,loadingMask:new Dl,tilesetSplit:new Ll,sceneSplit:new Rl}}var We="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsSAAALEgHS3X78AAACCklEQVQ4jWP8//8/Ax5gwMDAIACVfgDF2AHIIDSs8Of+8x3/vv/88ffFu++/jl75/evEte//vnz//e/Dl3d/nrye8P//fwF0fSicv28/Vv7/////t8W7/79Wi///gt0DBb9zLfv/89Cl/3/fff7w//9/A2S9cK/9//i1g4GZqeSdcwnzn4v38HmXgSs3gIGnKfEXIyebOQMDwwWQGMwgh/9fvu8hxhAY4Ix1ZeCdnPOTkYNNgoGB4QMT2DWfv6/50riIaENA4Pvi3Qy/T99k//v0TQOIDzLI4P/nb/zfJm8g2hAY+Nq8hIFJmC8DbNDfp28Sfqw7zEKyKQwMDL8OXQKFLShsDJgYmRhN/j58SY45YPDn1hMOUFpjYmBj5aHEIBhg+vvw5QVWPWWyDWBkY/kBoplYjVQPsOgrkWeIADcDq7kmyGsXQLG2gd3XkoFZXpxkg7hzAhn+3nl6HpaOPvx79X4+35xikgwBWcxVEPSXWUW6iAGajhiYxASLWLTkHxNrGMhLAmsb/v57+2klAwPDAbAYUjEi8O/tp0t/rj2U/ZTSy4ArJtns9Bj4F5T9YWBk2M4kKewHNxytPBL49+p9H5OYYOLPzcfBCQ6WbUAGsAdY/2VWkfrz/+PXIiZxwWkorsRRsCn8e/cp8v+nb/aMvFygTMnw/8v3q8zy4rsZGBgWYKhmYGAAAN6EGE9igaT+AAAAAElFTkSuQmCC";var Dt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsSAAALEgHS3X78AAAB+klEQVQ4jZ2UT2gTQRTGv5nd7G7TsNnW1QimWC+CghBEqJ7sSTx50oM3iwhejSJ486J4qdWLt6JXsQdPVdRDj0WQBqEehKJotLbEbrLNJvtnZlYmZEub1rLJB8Mw8+b9Zt7Me0PiOMY+KgGwuubv3ba3JKinjUfBj7dC+D6L1tt+82Pke5/agnsRZ+4GC38/iePY6vXbcSLBnXtUGXnYdObQWJ8BC6s7NjeGzyJfuAXNONGgSn4SQCWxbYEE33xECL3zZ+WyEvpf9gsXpn0dVuFuSKgxkcAS0GQsvA9pIIlyI1cweuRBQIh+GECddk4jvLn62nRqiFTTeYWgtaTzaPW+HEtQKeabebc2mxqSqLE2A6qO3uyAeLR6rdWYV/umAPC9RQjuyrspUYCeYVE1hdveioIVQ+YaJSST633mQURZ9KuiDZ0cGECI5sueakOnFjLGYCCqmNCzp2VoFflqr7PmBahasW+QTEwWfFtK8qjOWe35geJ0XxC5sWnf4Kp+rIxuHkFR7bKmH/+ZFiZDOnR0lnPmvASwIOe2F60l2MbnMPg69rd6e1fBJpKFa489ZQB5o2QKl5L53v/I4qz2WFHtqZb7DoG3iLC93DEYuXPImhdlKExwt6yoB59td/zfxzYuuHNV8OZ5SodlUUKI1rKqFd8DeLFrNYB/A6b1Qz9EzRMAAAAASUVORK5CYII=";var Mg={icon_center:Dt,icon_anchor:We,icon_size:[12,12],clampToModel:!1,maxAnchorSize:999},Jr=class{constructor(){this._viewer=void 0,this._anchorLayer=new i.CustomDataSource("draw-anchor-layer"),this._floatingAnchor=void 0,this._options={},this._plotEvent=new nt,this._tooltipMess=void 0}set tooltipMess(e){this._tooltipMess=e}_getEventPosition(e){return this._options.clampToModel&&e.position?e.position:e.surfacePosition}_onClick(e){let t=this._getEventPosition(e);if(!t)return!1;this._floatingAnchor||(this._floatingAnchor=this._onCreateAnchor({position:t})),this._plotEvent.fire(E.DRAW_ANCHOR,t)}_onMouseMove(e){this._viewer.tooltip.showAt(e.windowPosition,this._tooltipMess);let t=this._getEventPosition(e);if(!t)return!1;this._floatingAnchor&&this._floatingAnchor.position.setValue(t),this._plotEvent.fire(E.ANCHOR_MOVING,t)}_onRightClick(e){this._plotEvent.fire(E.DRAW_STOP,this._getEventPosition(e))}_onCreateAnchor({position:e,isCenter:t=!1}){var r;return this._anchorLayer.entities.add({position:e,billboard:{image:t?this._options.icon_center:this._options.icon_anchor,width:this._options.icon_size[0],height:this._options.icon_size[1],pixelOffset:this._options.pixelOffset||new i.Cartesian2(0,0),eyeOffset:this._options.eyeOffset||new i.Cartesian3(0,0,-100),disableDepthTestDistance:(r=this._options.disableDepthTestDistance)!=null?r:0,heightReference:this._viewer.scene.mode===i.SceneMode.SCENE3D&&!this._options.clampToModel?i.HeightReference.CLAMP_TO_GROUND:i.HeightReference.NONE}})}_onClearAnchor(){this._anchorLayer.entities.removeAll()}_bindEvent(){this._viewer.on(O.CLICK,this._onClick,this),this._viewer.on(O.MOUSE_MOVE,this._onMouseMove,this),this._viewer.on(O.RIGHT_CLICK,this._onRightClick,this),this._plotEvent.on(E.CREATE_ANCHOR,this._onCreateAnchor,this),this._plotEvent.on(E.CLEAR_ANCHOR,this._onClearAnchor,this)}_unbindEvent(){this._viewer.off(O.CLICK,this._onClick,this),this._viewer.off(O.MOUSE_MOVE,this._onMouseMove,this),this._viewer.off(O.RIGHT_CLICK,this._onRightClick,this),this._plotEvent.off(E.CREATE_ANCHOR,this._onCreateAnchor,this),this._plotEvent.off(E.CLEAR_ANCHOR,this._onClearAnchor,this)}on(e,t,r){return this._plotEvent.on(e,t,r||this),this}off(e,t,r){return this._plotEvent.off(e,t,r||this),this}fire(e,t={}){return this._plotEvent.fire(e,t),this}activate(e={}){return this._viewer.tooltip.enable=!0,this._options={...Mg,...e},this._unbindEvent(),this._bindEvent(),this.fire(E.DRAW_START,this._options),this}deactivate(){return this._unbindEvent(),this._viewer.tooltip.enable=!1,this._anchorLayer.entities.removeAll(),this._floatingAnchor=void 0,this}install(e){this._viewer=e,this._viewer.dataSources.add(this._anchorLayer),Object.defineProperty(this._viewer,"drawTool",{value:this,writable:!1})}},Ol=Jr;var kl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsSAAALEgHS3X78AAACDElEQVQ4jWP8//8/Ax5gwMDAIACVfgDF2AHIIDSscO/l7x3ff/378fz9n++Hr//4fezmz+9ffvz7/eHr33eP3/6Z8P//fwF0fSguevv5X6UwL1PbwoNfGRrWfGJ48PoPiuUOWuwMDSH8DHryrB8FuZkcGBgYLsDk4AZ9/Pavg5mJscS24SXzhQe/8XmXocCLl6Etgv8XJxujOcwwmEEOX37830OMITCQYM/NMD1F8CcHK6MEAwPDByaQ+Ofv/9fUrvpItCEgsODgV4aTt3+xP3n3twHEBxlk8On7P/4J2z4TbQgMNKz5yCDCy5QBNujJu78Ja05+YyHZFAYGhgPXfjJ8+PoPFDYGTEyMDCYPXv8lxxwwuPnsDwcorTGxsTDyoEczOYDp4es/Fwzk2cg2gI2F8QeIZjJWYjtgoMBKliEC3EwMlmpsIK9dAMXaBn8TTgYFUdLDu8CTl+H2iz/nYenow8uPf+cvyBQiyRCQxcU+vH9VJViKGKDpiEGcn7lIW5b1MbGGgby0qVTk75vPf1eCUgFIDDnTCrz5/O/S1ce/ZROmv8PIsDAAyrhLcoT/MDIybJcSZPaDiaOXRwIvP/7tE+dnTtx45js4wV148Ass4aDFwRBkxvlXVZLlz4ev/4okBJinIWvEVbApvP38L/LT93/2vJxMoEzJ8OXHv6sKoiy7QdkMQzUDAwMAuq71NKWtMMgAAAAASUVORK5CYII=";var Sg={icon_center:Dt,icon_anchor:We,icon_midAnchor:kl,icon_size:[12,12],clampToModel:!0},Kr=class{constructor(){this._viewer=void 0,this._anchorLayer=new i.CustomDataSource("edit-anchor-layer"),this._options={},this._plotEvent=new nt,this._tooltipMess=void 0,this._pickedAnchor=void 0,this._isMoving=!1,this._anchors=[]}set tooltipMess(e){this._tooltipMess=e}_onClick(e){if(this._isMoving){let t=this._options.clampToModel&&e.position?e.position:e.surfacePosition;if(!t)return!1;this._pickedAnchor&&this._pickedAnchor.position&&this._pickedAnchor.properties&&(this._pickedAnchor.position.setValue(t),this._plotEvent.fire(E.EDIT_ANCHOR_STOP,{pickedAnchor:this._pickedAnchor,position:t})),this._isMoving=!1}else{if(!e.target||!e.target.id)return!1;this._pickedAnchor=e.target.id,this._isMoving=!0}}_onMouseMove(e){if(this._viewer.tooltip.showAt(e.windowPosition,this._tooltipMess),!this._isMoving&&this._anchors.length!==0)return!1;let t=this._options.clampToModel&&e.position?e.position:e.surfacePosition;if(!t)return!1;this._pickedAnchor&&this._pickedAnchor.position&&this._pickedAnchor.properties?(this._pickedAnchor.position.setValue(t),this._plotEvent.fire(E.ANCHOR_MOVING,{pickedAnchor:this._pickedAnchor,position:t})):this._anchors.length===0&&this._plotEvent.fire(E.ANCHOR_MOVING,{position:t})}_onRightClick(e){let t=this._options.clampToModel&&e.position?e.position:e.surfacePosition;this._plotEvent.fire(E.EDIT_STOP,{pickedAnchor:this._pickedAnchor,position:t})}_onCreateAnchor({position:e,index:t,isCenter:r=!1,isMid:s=!1}){var l;let o=s?this._options.icon_midAnchor:r?this._options.icon_center:this._options.icon_anchor,n=this._anchorLayer.entities.add({position:e,billboard:{image:o,width:this._options.icon_size[0],height:this._options.icon_size[1],pixelOffset:this._options.pixelOffset||new i.Cartesian2(0,0),eyeOffset:this._options.eyeOffset||new i.Cartesian3(0,0,-100),disableDepthTestDistance:(l=this._options.disableDepthTestDistance)!=null?l:0,heightReference:this._viewer.scene.mode===i.SceneMode.SCENE3D&&!this._options.clampToModel?i.HeightReference.CLAMP_TO_GROUND:i.HeightReference.NONE},properties:{isMid:s,index:t}});this._anchors.push(n)}_onUpdateAnchor({index:e,position:t}){this._anchors[e]&&this._anchors[e].position.setValue(t)}_onClearAnchor(){this._anchorLayer.entities.removeAll(),this._anchors=[]}_bindEvent(){this._viewer.on(O.CLICK,this._onClick,this),this._viewer.on(O.MOUSE_MOVE,this._onMouseMove,this),this._viewer.on(O.RIGHT_CLICK,this._onRightClick,this),this._plotEvent.on(E.CREATE_ANCHOR,this._onCreateAnchor,this),this._plotEvent.on(E.UPDATE_ANCHOR,this._onUpdateAnchor,this),this._plotEvent.on(E.CLEAR_ANCHOR,this._onClearAnchor,this)}_unbindEvent(){this._viewer.off(O.CLICK,this._onClick,this),this._viewer.off(O.MOUSE_MOVE,this._onMouseMove,this),this._viewer.off(O.RIGHT_CLICK,this._onRightClick,this),this._plotEvent.off(E.CREATE_ANCHOR,this._onCreateAnchor,this),this._plotEvent.off(E.UPDATE_ANCHOR,this._onUpdateAnchor,this),this._plotEvent.off(E.CLEAR_ANCHOR,this._onClearAnchor,this)}on(e,t,r){return this._plotEvent.on(e,t,r||this),this}off(e,t,r){return this._plotEvent.off(e,t,r||this),this}fire(e,t){return this._plotEvent.fire(e,t),this}activate(e={}){return this._anchorLayer.entities.removeAll(),this._anchors=[],this._viewer.tooltip.enable=!0,this._options={...Sg,...e},this._unbindEvent(),this._bindEvent(),this.fire(E.EDIT_START,this._options),this}deactivate(){return this._unbindEvent(),this._viewer.tooltip.enable=!1,this._anchorLayer.entities.removeAll(),this._anchors=[],this}install(e){this._viewer=e,this._viewer.dataSources.add(this._anchorLayer),Object.defineProperty(this._viewer,"editTool",{value:this,writable:!1})}},Fl=Kr;function Qr(){return{drawTool:new Ol,editTool:new Fl}}var{ImageryLayer:Dg}=i,$r=class{constructor(e){if(!e.globe)throw new Error("globe is required");this._globe=e.globe,this._imageryLayers=[],this._selectedImageryLayer=void 0,this._count=0}set selectedImageryLayer(e){if((!e||!e.layers)&&new Error("imagery format error"),!(this._selectedImageryLayer&&e.id===this._selectedImageryLayer.id)){if(this._selectedImageryLayer&&e.id!==this._selectedImageryLayer.id){for(let t=0;t<this._selectedImageryLayer.cache.length;t++)this._globe.imageryLayers.remove(this._selectedImageryLayer.cache[t]);e.cache=[]}for(let t=e.layers.length-1;t>=0;t--){let r=e.layers[t],s=Dg.fromProviderAsync(r,e.options);r&&this._globe.imageryLayers.add(s,0),e.cache.push(s)}this._selectedImageryLayer=e}}get selectedImageryLayer(){return this._selectedImageryLayer}addImageryLayer(e,t={}){let r=[];return Array.isArray(e)?r=e.slice(0):r=[e],this._count++,this._imageryLayers.push({id:`imagery-no-${this._count}`,layers:r,cache:[],options:t}),this}changeImageryLayer(e){if(e>this._imageryLayers.length-1)throw new Error("index error");return this.selectedImageryLayer=this._imageryLayers[e],this}},es=$r;var{BoxGeometry:zl,Cartesian3:Lg,defined:fe,DeveloperError:Nl,GeometryPipeline:Rg,Matrix3:Hl,Matrix4:ts,Transforms:Og,VertexFormat:kg,BufferUsage:Fg,CubeMap:zg,loadCubeMap:Ng,RenderState:Hg,VertexArray:Wg,BlendingState:Gg,SceneMode:Wl,ShaderProgram:Ug,ShaderSource:Bg,SkyBox:Vg}=i,jg=`
118
- uniform samplerCube u_cubeMap;
119
- in vec3 v_texCoord;
120
- void main()
121
- {
122
- vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord));
123
- out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);
124
- }
125
- `,qg=`
126
- in vec3 position;
127
- out vec3 v_texCoord;
128
- uniform mat3 u_rotateMatrix;
129
- void main()
130
- {
131
- vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));
132
- gl_Position = czm_projection * vec4(p, 1.0);
133
- v_texCoord = position.xyz;
134
- }
135
- `,is=class extends Vg{constructor(e={}){super(e),this.offsetAngle=(e==null?void 0:e.offsetAngle)||0}update(e,t){let r=this;if(!this.show||e.mode!==Wl.SCENE3D&&e.mode!==Wl.MORPHING||!e.passes.render)return;let s=e.context;if(this._sources!==this.sources){this._sources=this.sources;let n=this.sources;if(!fe(n.positiveX)||!fe(n.negativeX)||!fe(n.positiveY)||!fe(n.negativeY)||!fe(n.positiveZ)||!fe(n.negativeZ))throw new Nl("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof n.positiveX!=typeof n.negativeX||typeof n.positiveX!=typeof n.positiveY||typeof n.positiveX!=typeof n.negativeY||typeof n.positiveX!=typeof n.positiveZ||typeof n.positiveX!=typeof n.negativeZ)throw new Nl("this.sources properties must all be the same type.");typeof n.positiveX=="string"?Ng(s,this._sources).then(function(l){r._cubeMap=r._cubeMap&&r._cubeMap.destroy(),r._cubeMap=l}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new zg({context:s,source:n}))}let o=this._command;if(o.modelMatrix=Og.eastNorthUpToFixedFrame(e.camera.positionWC),this.offsetAngle!==0&&ts.multiply(o.modelMatrix,ts.fromRotationTranslation(Hl.fromRotationZ(this.offsetAngle/180*Math.PI)),o.modelMatrix),!fe(o.vertexArray)){o.uniformMap={u_cubeMap:function(){return r._cubeMap},u_rotateMatrix:function(){return ts.getMatrix3(o.modelMatrix,new Hl)}};let n=zl.createGeometry(zl.fromDimensions({dimensions:new Lg(2,2,2),vertexFormat:kg.POSITION_ONLY})),l=this._attributeLocations=Rg.createAttributeLocations(n);o.vertexArray=Wg.fromGeometry({context:s,geometry:n,attributeLocations:l,bufferUsage:Fg._DRAW}),o.renderState=Hg.fromCache({blending:Gg.ALPHA_BLEND})}if(!fe(o.shaderProgram)||this._useHdr!==t){let n=new Bg({defines:[t?"HDR":""],sources:[jg]});o.shaderProgram=Ug.fromCache({context:s,vertexShaderSource:qg,fragmentShaderSource:n,attributeLocations:this._attributeLocations}),this._useHdr=t}if(fe(this._cubeMap))return o}},Gl=is;var Zg={creditContainer:document.createElement("div"),creditViewport:document.createElement("div"),baseLayer:!1,shouldAnimate:!0},rs=class{constructor(e,t={}){if(__cmdOut&&__cmdOut(),!e||typeof e=="string"&&!document.getElementById(e))throw new Error("Viewer: the container is empty");if(e instanceof HTMLElement)throw new Error("Viewer: not support the type container");if(typeof e=="string"){let o=Zi("baseUrl");o&&i.buildModuleUrl.setBaseUrl(o)}this._delegate=typeof e!="string"?e:new i.CesiumWidget(e,{...Zg,...t}),this._delegate.canvas.parentNode.className="viewer-canvas",new sr(this,t),this._viewerEvent=new ar,this._sceneEvent=new lr(this),this._viewerOption=new Sr(this),this._cameraOption=new Lr(this),this._widgetContainer=I.create("div","viewer-widgets",typeof e=="string"?document.getElementById(e):this._delegate.container),this._layerContainer=I.create("div","viewer-layers",typeof e=="string"?document.getElementById(e):this._delegate.container),this._baseLayerPicker=new es({globe:this._delegate.scene.globe}),this._layerGroupCache={},this._layerCache={};let r=Xr();Object.keys(r).forEach(o=>{this._use(r[o])});let s=Qr();Object.keys(s).forEach(o=>{this._use(s[o])})}get delegate(){return this._delegate}get container(){return this._delegate.container}get widgetContainer(){return this._widgetContainer}get layerContainer(){return this._layerContainer}get scene(){return this._delegate.scene}get camera(){return this._delegate.camera}get canvas(){return this._delegate.scene.canvas}get dataSources(){return this._delegate.dataSources}get imageryLayers(){return this._delegate.imageryLayers}get terrainProvider(){return this._delegate.terrainProvider}get entities(){return this._delegate.entities}get postProcessStages(){return this._delegate.scene.postProcessStages}get clock(){return this._delegate.clock}get viewerEvent(){return this._viewerEvent}get cameraPosition(){var t,r,s,o,n,l,h;let e=f.transformCartographicToWGS84((t=this.camera)==null?void 0:t.positionCartographic);return e&&(e.heading=i.Math.toDegrees((s=(r=this.camera)==null?void 0:r.heading)!=null?s:0),e.pitch=i.Math.toDegrees((n=(o=this.camera)==null?void 0:o.pitch)!=null?n:0),e.roll=i.Math.toDegrees((h=(l=this.camera)==null?void 0:l.roll)!=null?h:0)),e}get resolution(){let e=this.scene.canvas.width,t=this.scene.canvas.height,r=f.transformWindowToWGS84(new i.Cartesian2(e/2|0,t-1),this),s=f.transformWindowToWGS84(new i.Cartesian2(1+e/2|0,t-1),this);return!r||!s?1:Math.abs(r.lng-s.lng)}get viewBounds(){let e=this.scene.canvas.width,t=this.scene.canvas.height,r=f.transformWindowToWGS84(new i.Cartesian2(0,t),this),s=f.transformWindowToWGS84(new i.Cartesian2(e,0),this);return!r||!s?i.Rectangle.MAX_VALUE:i.Rectangle.fromDegrees(r.lng,r.lat,s.lng,s.lat)}get zoom(){let e=this.camera.positionCartographic.height,t=40487.57,r=7096758e-11,s=91610.74,o=-40467.74;return Math.round(o+(t-o)/(1+Math.pow(e/s,r)))}_use(e){return e&&e.install&&e.install(this),this}_addLayerGroup(e){e!=null&&e.layerGroupEvent&&!Object(this._layerGroupCache).hasOwnProperty(e.id)&&(e.layerGroupEvent.fire(Te.ADD,this),this._layerGroupCache[e.id]=e)}_removeLayerGroup(e){e!=null&&e.layerGroupEvent&&Object(this._layerGroupCache).hasOwnProperty(e.id)&&(e.layerGroupEvent.fire(Te.REMOVE,this),delete this._layerGroupCache[e.id])}_addLayer(e){!this._layerCache[e.type]&&(this._layerCache[e.type]={}),Object(this._layerCache[e.type]).hasOwnProperty(e.id)||(e.fire(Ee.ADD,this),this._layerCache[e.type][e.id]=e)}_removeLayer(e){Object(this._layerCache[e.type]).hasOwnProperty(e.id)&&(e.fire(Ee.REMOVE,this),delete this._layerCache[e.type][e.id])}setOptions(e){return this._viewerOption.setOptions(e),this}setPitchRange(e=-90,t=-20){return this._cameraOption.setPitchRange(e,t),this}changeSceneMode(e,t=0){return e===2?this._delegate.scene.morphTo2D(t):e===3?this._delegate.scene.morphTo3D(t):e===2.5&&this._delegate.scene.morphToColumbusView(t),this}changeMouseMode(e){return this._cameraOption.changeMouseMode(e),this}setTerrain(e){return this._delegate.scene.setTerrain(new i.Terrain(e||Promise.resolve(new i.EllipsoidTerrainProvider))),this}addBaseLayer(e,t={}){return e?(this._baseLayerPicker.addImageryLayer(e,t),this._baseLayerPicker.selectedImageryLayer||this._baseLayerPicker.changeImageryLayer(0),this.mapSwitch&&this.mapSwitch.addMap(t),this):this}changeBaseLayer(e){return this._baseLayerPicker.changeImageryLayer(e),this}getImageryLayerInfo(e){let t=this._delegate.camera.getPickRay(e);return this._delegate.imageryLayers.pickImageryLayerFeatures(t,this._delegate.scene)}addLayerGroup(e){return this._addLayerGroup(e),this}removeLayerGroup(e){return this._removeLayerGroup(e),this}getLayerGroup(e){return this._layerGroupCache[e]||void 0}addLayer(e){return this._addLayer(e),this}removeLayer(e){return this._removeLayer(e),this}hasLayer(e){return Object(this._layerCache[e.type]).hasOwnProperty(e.id)}getLayer(e){let t=this.getLayers().filter(r=>r.id===e);return t&&t.length?t[0]:void 0}getLayers(){let e=[];return Object.keys(this._layerCache).forEach(t=>{let r=this._layerCache[t];Object.keys(r).forEach(s=>{e.push(r[s])})}),e}eachLayer(e,t){return Object.keys(this._layerCache).forEach(r=>{let s=this._layerCache[r];Object.keys(s).forEach(o=>{e.call(t,s[o])})}),this}flyTo(e,t){return this._delegate.flyTo((e==null?void 0:e.delegate)||e,{duration:t}),this}zoomTo(e){return this._delegate.zoomTo((e==null?void 0:e.delegate)||e),this}flyToPosition(e,t,r){return e=y.parsePosition(e),this.camera.flyTo({destination:f.transformWGS84ToCartesian(e),orientation:{heading:i.Math.toRadians(e.heading),pitch:i.Math.toRadians(e.pitch),roll:i.Math.toRadians(e.roll)},complete:t,duration:r}),this}zoomToPosition(e,t){return this.flyToPosition(e,t,0),this}flyToBounds(e,{heading:t=0,pitch:r=0,roll:s=0},o,n){return e?(Array.isArray(e)||(e=e.split(",")),this.camera.flyTo({destination:i.Rectangle.fromDegrees(e[0],e[1],e[2],e[3]),orientation:{heading:i.Math.toRadians(t),pitch:i.Math.toRadians(r),roll:i.Math.toRadians(s)},complete:o,duration:n}),this):this}zoomToBounds(e,{heading:t=0,pitch:r=0,roll:s=0},o){return this.flyToBounds(e,{heading:t,pitch:r,roll:s},o),this}on(e,t,r){return this._viewerEvent.on(e,t,r||this),this._sceneEvent.on(e,t,r||this),this}once(e,t,r){return this._viewerEvent.once(e,t,r||this),this}off(e,t,r){return this._viewerEvent.off(e,t,r||this),this._sceneEvent.off(e,t,r||this),this}destroy(){return Object.keys(this._layerCache).forEach(e=>{let t=this._layerCache[e];Object.keys(t).forEach(r=>{this._removeLayer(t[r])})}),this._delegate.destroy(),this._delegate=void 0,this._baseLayerPicker=void 0,this._layerCache={},this._widgetContainer.parentNode.removeChild(this._widgetContainer),this._widgetContainer=void 0,this._layerContainer.parentNode.removeChild(this._layerContainer),this._layerContainer=void 0,this}exportScene(e){this.scene.render();let r=this.canvas.toDataURL("image/png").replace("image/png","image/octet-stream"),s=document.createElement("a"),o=C.dataURLtoBlob(r),n=URL.createObjectURL(o);return s.download=`${e||"scene"}.png`,s.href=n,s.click(),this}getOffset(){var r;let e={x:0,y:0},t=(r=this._delegate)==null?void 0:r.container;if(t)if(t.getBoundingClientRect){let s=t.getBoundingClientRect();e.x=s.left,e.y=s.top}else e.x=t.offsetLeft,e.y=t.offsetTop;return e}resize(){return this._delegate.resize(),this}},Yg=rs;var Xg={ARCGIS:"arcgis",BING:"bing",OSM:"osm",SINGLE_TILE:"single_tile",WMS:"wms",WMTS:"wmts",XYZ:"xyz",COORD:"coord",GRID:"grid",MAPBOX:"mapbox",MAPBOX_STYLE:"mapbox_style",TMS:"tms"},k=Xg;var ss=class extends i.WebMercatorTilingScheme{constructor(e){super(e);let t=new i.WebMercatorProjection;this._projection.project=function(r,s){return s=me.WGS84ToGCJ02(i.Math.toDegrees(r.longitude),i.Math.toDegrees(r.latitude)),s=t.project(new i.Cartographic(i.Math.toRadians(s[0]),i.Math.toRadians(s[1]))),new i.Cartesian2(s.x,s.y)},this._projection.unproject=function(r,s){let o=t.unproject(r);return s=me.GCJ02ToWGS84(i.Math.toDegrees(o.longitude),i.Math.toDegrees(o.latitude)),new i.Cartographic(i.Math.toRadians(s[0]),i.Math.toRadians(s[1]))}}},Lt=ss;var Ul={img:"//webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",elec:"//webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",cva:"//webst{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}"},os=class extends i.UrlTemplateImageryProvider{constructor(e={}){e.url=e.url||[e.protocol||"",Ul[e.style]||Ul.elec].join(""),e.subdomains=e.subdomains||["01","02","03","04"],e.crs==="WGS84"&&(e.tilingScheme=new Lt),super(e)}};k.AMAP="amap";var Bl=os;var Jg=637099681e-2,Vl=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],Rt=[75,60,45,30,15,0],Kg=[[1410526172116255e-23,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,173379812e-1],[-7435856389565537e-24,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1026014486e-2],[-3030883460898826e-23,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,685681737e-2],[-1981981304930552e-23,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,448277706e-2],[309191371068437e-23,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,25551644e-1],[2890871144776878e-24,8983055095805407e-21,-3068298e-14,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],jl=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,6477955746671607e-7,-4082003173641316e-6,1077490566351142e-5,-1517187553151559e-5,1205306533862167e-5,-5124939663577472e-6,9133119359512032e-7,67.5],[.00337398766765,111320.7020202162,4481351045890365e-9,-2339375119931662e-8,7968221547186455e-8,-1159649932797253e-7,9723671115602145e-8,-4366194633752821e-8,8477230501135234e-9,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837749470245e-9,992013.7397791013,-122195221711287e-8,1340652697009075e-9,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758690035394e-9,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],as=class{constructor(){this.isWgs84=!1}getDistanceByMC(e,t){if(!e||!t||(e=this.convertMC2LL(e),!e))return 0;let r=this.toRadians(e.lng),s=this.toRadians(e.lat);if(t=this.convertMC2LL(t),!t)return 0;let o=this.toRadians(t.lng),n=this.toRadians(t.lat);return this.getDistance(r,o,s,n)}getDistanceByLL(e,t){if(!e||!t)return 0;e.lng=this.getLoop(e.lng,-180,180),e.lat=this.getRange(e.lat,-74,74),t.lng=this.getLoop(t.lng,-180,180),t.lat=this.getRange(t.lat,-74,74);let r=this.toRadians(e.lng),s=this.toRadians(e.lat),o=this.toRadians(t.lng),n=this.toRadians(t.lat);return this.getDistance(r,o,s,n)}convertMC2LL(e){if(!e)return{lng:0,lat:0};let t={};if(this.isWgs84){t.lng=e.lng/2003750834e-2*180;let o=e.lat/2003750834e-2*180;return t.lat=180/Math.PI*(2*Math.atan(Math.exp(o*Math.PI/180))-Math.PI/2),{lng:t.lng.toFixed(6),lat:t.lat.toFixed(6)}}let r={lng:Math.abs(e.lng),lat:Math.abs(e.lat)},s;for(let o=0;o<Vl.length;o++)if(r.lat>=Vl[o]){s=Kg[o];break}return t=this.convertor(e,s),{lng:t.lng.toFixed(6),lat:t.lat.toFixed(6)}}convertLL2MC(e){if(!e)return{lng:0,lat:0};if(e.lng>180||e.lng<-180||e.lat>90||e.lat<-90)return e;if(this.isWgs84){let o={},n=6378137;o.lng=e.lng*Math.PI/180*n;let l=e.lat*Math.PI/180;return o.lat=n/2*Math.log((1+Math.sin(l))/(1-Math.sin(l))),{lng:parseFloat(o.lng.toFixed(2)),lat:parseFloat(o.lat.toFixed(2))}}e.lng=this.getLoop(e.lng,-180,180),e.lat=this.getRange(e.lat,-74,74);let t={lng:e.lng,lat:e.lat},r;for(let o=0;o<Rt.length;o++)if(t.lat>=Rt[o]){r=jl[o];break}if(!r){for(let o=0;o<Rt.length;o++)if(t.lat<=-Rt[o]){r=jl[o];break}}let s=this.convertor(e,r);return{lng:parseFloat(s.lng.toFixed(2)),lat:parseFloat(s.lat.toFixed(2))}}convertor(e,t){if(!e||!t)return{lng:0,lat:0};let r=t[0]+t[1]*Math.abs(e.lng),s=Math.abs(e.lat)/t[9],o=t[2]+t[3]*s+t[4]*s*s+t[5]*s*s*s+t[6]*s*s*s*s+t[7]*s*s*s*s*s+t[8]*s*s*s*s*s*s;return r*=e.lng<0?-1:1,o*=e.lat<0?-1:1,{lng:r,lat:o}}getDistance(e,t,r,s){return Jg*Math.acos(Math.sin(r)*Math.sin(s)+Math.cos(r)*Math.cos(s)*Math.cos(t-e))}toRadians(e){return Math.PI*e/180}toDegrees(e){return 180*e/Math.PI}getRange(e,t,r){return t!=null&&(e=Math.max(e,t)),r!=null&&(e=Math.min(e,r)),e}getLoop(e,t,r){for(;e>r;)e-=r-t;for(;e<t;)e+=r-t;return e}lngLatToMercator(e){return this.convertLL2MC(e)}lngLatToPoint(e){let t=this.convertLL2MC(e);return{x:t.lng,y:t.lat}}mercatorToLngLat(e){return this.convertMC2LL(e)}pointToLngLat(e){let t={lng:e.x,lat:e.y};return this.convertMC2LL(t)}pointToPixel(e,t,r,s){if(!e)return{x:0,y:0};e=this.lngLatToMercator(e);let o=this.getZoomUnits(t),n=Math.round((e.lng-r.lng)/o+s.width/2),l=Math.round((r.lat-e.lat)/o+s.height/2);return{x:n,y:l}}pixelToPoint(e,t,r,s){if(!e)return{lng:0,lat:0};let o=this.getZoomUnits(t),n=r.lng+o*(e.x-s.width/2),l=r.lat-o*(e.y-s.height/2),h={lng:n,lat:l};return this.mercatorToLngLat(h)}getZoomUnits(e){return Math.pow(2,18-e)}},ql=as;var ns=class extends i.WebMercatorTilingScheme{constructor(e){super(e);let t=new ql;this._projection.project=function(r,s){return s=s||{},s=me.WGS84ToGCJ02(i.Math.toDegrees(r.longitude),i.Math.toDegrees(r.latitude)),s=me.GCJ02ToBD09(s[0],s[1]),s[0]=Math.min(s[0],180),s[0]=Math.max(s[0],-180),s[1]=Math.min(s[1],74.000022),s[1]=Math.max(s[1],-71.988531),s=t.lngLatToPoint({lng:s[0],lat:s[1]}),new i.Cartesian2(s.x,s.y)},this._projection.unproject=function(r,s){return s=s||{},s=t.mercatorToLngLat({lng:r.x,lat:r.y}),s=me.BD09ToGCJ02(s.lng,s.lat),s=me.GCJ02ToWGS84(s[0],s[1]),new i.Cartographic(i.Math.toRadians(s[0]),i.Math.toRadians(s[1]))},this.resolutions=e.resolutions||[]}tileXYToNativeRectangle(e,t,r,s){let o=this.resolutions[r],n=e*o,l=(e+1)*o,h=((t=-t)+1)*o,c=t*o;return i.defined(s)?(s.west=n,s.south=c,s.east=l,s.north=h,s):new i.Rectangle(n,c,l,h)}positionToTileXY(e,t,r){let s=this._rectangle;if(!i.Rectangle.contains(s,e))return;let n=this._projection.project(e);if(!i.defined(n))return;let l=this.resolutions[t],h=Math.floor(n.x/l),c=-Math.floor(n.y/l);return i.defined(r)?(r.x=h,r.y=c,r):new i.Cartesian2(h,c)}},Zl=ns;var Yl={img:"//shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46",vec:"//online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl&v=020",custom:"//api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}",traffic:"//its.map.baidu.com:8002/traffic/TrafficTileService?time={time}&label={labelStyle}&v=016&level={z}&x={x}&y={y}&scaler=2"},ls=class extends i.UrlTemplateImageryProvider{constructor(e={}){if(e.url=e.url||[e.protocol||"",Yl[e.style]||Yl.custom].join(""),e.crs==="WGS84"){let t=[];for(let r=0;r<19;r++)t[r]=256*Math.pow(2,18-r);e.tilingScheme=new Zl({resolutions:t,rectangleSouthwestInMeters:new i.Cartesian2(-2003772637e-2,-1247410417e-2),rectangleNortheastInMeters:new i.Cartesian2(2003772637e-2,1247410417e-2)})}else e.tilingScheme=new i.WebMercatorTilingScheme({rectangleSouthwestInMeters:new i.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new i.Cartesian2(33554054,33746824)});e.maximumLevel=18,super(e),this._rectangle=this._tilingScheme.rectangle,this._url=e.url,this._crs=e.crs||"BD09",this._style=e.style||"normal"}requestImage(e,t,r){let s=this._tilingScheme.getNumberOfXTilesAtLevel(r),o=this._tilingScheme.getNumberOfYTilesAtLevel(r),n=this._url.replace("{z}",r).replace("{s}",String(1)).replace("{style}",this._style);return this._crs==="WGS84"?n=n.replace("{x}",String(e)).replace("{y}",String(-t)):n=n.replace("{x}",String(e-s/2)).replace("{y}",String(o/2-t-1)),i.ImageryProvider.loadImage(this,n)}};k.BAIDU="baidu";var Xl=ls;var Qg="//tiles{s}.geovisearth.com/base/v1/{style}/{z}/{x}/{y}?format={format}&tmsIds=w&token={key}",hs=class extends i.UrlTemplateImageryProvider{constructor(e={}){e.url=e.url||[e.protocol||"",Qg.replace(/\{style\}/g,e.style||"vec").replace(/\{format\}/g,e.format||"png").replace(/\{key\}/g,e.key||"")].join(""),e.subdomains=e.subdomains||["1","2","3"],super(e)}};k.GEO_VIS="geoVis";var Jl=hs;var Kl={img:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=s&x={x}&y={y}&z={z}",elec:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=m&x={x}&y={y}&z={z}",cva:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=h&x={x}&y={y}&z={z}",ter:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=t@131,r&x={x}&y={y}&z={z}",img_cva:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=y&x={x}&y={y}&z={z}"},cs=class extends i.UrlTemplateImageryProvider{constructor(e={}){e.url=e.url||[e.protocol||"",Kl[e.style]||Kl.elec].join(""),e.crs==="WGS84"&&(e.tilingScheme=new Lt),super(e)}};k.GOOGLE="google";var Ql=cs;var $g="//t{s}.tianditu.gov.cn/DataServer?T={style}_w&x={x}&y={y}&l={z}&tk={key}",ps=class extends i.UrlTemplateImageryProvider{constructor(e={}){super({url:[e.protocol||"",$g.replace(/\{style\}/g,e.style||"vec").replace(/\{key\}/g,e.key||"")].join(""),subdomains:["0","1","2","3","4","5","6","7"],maximumLevel:18})}};k.TDT="tdt";var $l=ps;var eh={img:"//p{s}.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=400",elec:"//rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid={style}&scene=0&version=347"},ds=class extends i.UrlTemplateImageryProvider{constructor(e={}){let t=e.url||[e.protocol||"",eh[e.style]||eh.elec].join("");e.url=t.replace("{style}",e.style||1),e.subdomains=e.subdomains||["1","2","3"],e.style==="img"&&(e.customTags={sx:(r,s,o,n)=>s>>4,sy:(r,s,o,n)=>(1<<n)-o>>4}),super(e)}};k.TENCENT="tencent";var th=ds;var ms=class{static createAMapImageryLayer(e){return Promise.resolve(new Bl(e))}static createBaiduImageryLayer(e){return Promise.resolve(new Xl(e))}static createGeoVisImageryLayer(e){return Promise.resolve(new Jl(e))}static createGoogleImageryLayer(e){return Promise.resolve(new Ql(e))}static createTdtImageryLayer(e){return Promise.resolve(new $l(e))}static createTencentImageryLayer(e){return Promise.resolve(new th(e))}static createArcGisImageryLayer(e){return i.ArcGisMapServerImageryProvider.fromUrl(e.url,e)}static createBingImageryLayer(e){return i.BingMapsImageryProvider.fromUrl(e.url,e)}static createOSMImageryLayer(e){return Promise.resolve(new i.OpenStreetMapImageryProvider(e))}static createSingleTileImageryLayer(e){return i.SingleTileImageryProvider.fromUrl(e.url,e)}static createWMSImageryLayer(e){return Promise.resolve(new i.WebMapServiceImageryProvider(e))}static createWMTSImageryLayer(e){return Promise.resolve(new i.WebMapTileServiceImageryProvider(e))}static createXYZImageryLayer(e){return Promise.resolve(new i.UrlTemplateImageryProvider(e))}static createCoordImageryLayer(e){return Promise.resolve(new i.TileCoordinatesImageryProvider(e))}static createGridImageryLayer(e){return Promise.resolve(new i.GridImageryProvider(e))}static createMapboxImageryLayer(e){return Promise.resolve(new i.MapboxImageryProvider(e))}static createMapboxStyleImageryLayer(e){return Promise.resolve(new i.MapboxStyleImageryProvider(e))}static createTMSImageryLayer(e){return i.TileMapServiceImageryProvider.fromUrl(e.url,e)}static createImageryLayer(e,t){let r;switch(e){case k.AMAP:r=this.createAMapImageryLayer(t);break;case k.BAIDU:r=this.createBaiduImageryLayer(t);break;case k.GEO_VIS:r=this.createGeoVisImageryLayer(t);break;case k.GOOGLE:r=this.createGoogleImageryLayer(t);break;case k.TDT:r=this.createTdtImageryLayer(t);break;case k.TENCENT:r=this.createTencentImageryLayer(t);break;case k.ARCGIS:r=this.createArcGisImageryLayer(t);break;case k.BING:r=this.createBingImageryLayer(t);break;case k.OSM:r=this.createOSMImageryLayer(t);break;case k.SINGLE_TILE:r=this.createSingleTileImageryLayer(t);break;case k.WMS:r=this.createWMSImageryLayer(t);break;case k.WMTS:r=this.createWMTSImageryLayer(t);break;case k.XYZ:r=this.createXYZImageryLayer(t);break;case k.COORD:r=this.createCoordImageryLayer(t);break;case k.GRID:r=this.createGridImageryLayer(t);break;case k.MAPBOX:r=this.createMapboxImageryLayer(t);break;case k.MAPBOX_STYLE:r=this.createMapboxStyleImageryLayer(t);break;case k.TMS:r=this.createTMSImageryLayer(t);break;default:break}return r}},ih=ms;var us=class extends i.GeographicTilingScheme{constructor(e={}){super(e),this._origin=e.origin||[-180,90],this._zoomOffset=e.zoomOffset||0,this._tileSize=e.tileSize||256,this._resolutions=e.resolutions||[]}get zoomOffset(){return this._zoomOffset}tileXYToRectangle(e,t,r,s){if(!this._resolutions||!this._resolutions[r+this._zoomOffset])return i.Rectangle.MAX_VALUE;let o=this._resolutions[r+this._zoomOffset]*this._tileSize,n=i.Math.toRadians(this._origin[0]+e*o),l=i.Math.toRadians(this._origin[1]-(t+1)*o),h=i.Math.toRadians(this._origin[0]+(e+1)*o),c=i.Math.toRadians(this._origin[1]-t*o);return s?(s.west=n,s.south=l,s.east=h,s.north=c,s):new i.Rectangle(n,l,h,c)}positionToTileXY(e,t,r){if(!this._resolutions||!this._resolutions[t+this._zoomOffset])return new i.Cartesian2;let s=this._resolutions[t+this._zoomOffset]*this._tileSize,o=i.Math.toDegrees(e.longitude),n=i.Math.toDegrees(e.latitude),l=Math.floor((o-this._origin[0])/s),h=Math.floor((this._origin[1]-n)/s);return r?(r.x=l,r.y=h,r):new i.Cartesian2(Math.max(0,l),Math.max(0,h))}},rh=us;var _s=class extends i.WebMercatorTilingScheme{constructor(e={}){super(e),this._origin=e.origin||[-200375083427892e-7,200375083427892e-7],this._zoomOffset=e.zoomOffset||0,this._tileSize=e.tileSize||256,this._resolutions=e.resolutions||[]}get zoomOffset(){return this._zoomOffset}tileXYToNativeRectangle(e,t,r,s){if(!this._resolutions||!this._resolutions[r+this._zoomOffset])return i.Rectangle.MAX_VALUE;if(e<0||t<0)return i.Rectangle.MAX_VALUE;let o=this._resolutions[r+this._zoomOffset]*this._tileSize,n=this._origin[0]+e*o,l=this._origin[1]-(t+1)*o,h=this._origin[0]+(e+1)*o,c=this._origin[1]-t*o;return s?(s.west=n,s.south=l,s.east=h,s.north=c,s):new i.Rectangle(n,l,h,c)}positionToTileXY(e,t,r){let s=this._rectangle;if(!i.Rectangle.contains(s,e))return;if(!this._resolutions||!this._resolutions[t+this._zoomOffset])return new i.Cartesian2;let o=this._resolutions[t+this._zoomOffset]*this._tileSize,l=this._projection.project(e),h=Math.floor((l.x-this._origin[0])/o),c=Math.floor((this._origin[1]-l.y)/o);return r?(r.x=h,r.y=c,r):new i.Cartesian2(Math.max(0,h),Math.max(0,c))}},sh=_s;var ey={NONE:"none",XYZ:"xyz",ARCGIS:"arcgis",GOOGLE:"google",VR:"vr"},be=ey;var fs=class{static createEllipsoidTerrain(e){return Promise.resolve(new i.EllipsoidTerrainProvider(e))}static createUrlTerrain(e){return i.CesiumTerrainProvider.fromUrl(e.url,e)}static createGoogleTerrain(e){return i.GoogleEarthEnterpriseTerrainProvider.fromUrl(e.url,e)}static createArcgisTerrain(e){return i.ArcGISTiledElevationTerrainProvider.fromUrl(e.url,e)}static createVRTerrain(e){return i.VRTheWorldTerrainProvider.fromUrl(e.url,e)}static createTerrain(e,t){let r;switch(e){case be.NONE:r=this.createEllipsoidTerrain(t);break;case be.XYZ:r=this.createUrlTerrain(t);break;case be.GOOGLE:r=this.createGoogleTerrain(t);break;case be.ARCGIS:r=this.createArcgisTerrain(t);break;case be.VR:r=this.createVRTerrain(t);break;default:break}return r}},oh=fs;var ty={},lt=ty;var gs=class{constructor(e){this._id=C.uuid(),this._bid=e||C.uuid(),this._delegate=void 0,this._viewer=void 0,this._state=void 0,this._show=!0,this._isGround=!1,this._cache={},this._attr={},this._layerEvent=new dr,this._layerEvent.on(Ee.ADD,this._onAdd,this),this._layerEvent.on(Ee.REMOVE,this._onRemove,this)}get layerId(){return this._id}get id(){return this._bid}get delegate(){return this._delegate}set show(e){this._show=e,this._delegate&&(this._delegate.show=this._show)}get show(){return this._show}get layerEvent(){return this._layerEvent}set attr(e){this._attr=e}get attr(){return this._attr}get state(){return this._state}_addedHook(){}_removedHook(){}_onAdd(e){this._viewer=e,this._delegate&&(this._delegate instanceof i.PrimitiveCollection?this._isGround?this._viewer.scene.groundPrimitives.add(this._delegate):this._viewer.scene.primitives.add(this._delegate):this._delegate instanceof i.ImageryLayer?this._viewer.imageryLayers.add(this._delegate):this._viewer.dataSources.add(this._delegate),this._addedHook&&this._addedHook(),this._state=m.ADDED)}_onRemove(){this._delegate&&this._viewer&&(this._cache={},this._delegate instanceof i.PrimitiveCollection?(this._delegate.removeAll(),this._isGround?this._viewer.scene.groundPrimitives.remove(this._delegate):this._viewer.scene.primitives.remove(this._delegate)):this._delegate instanceof i.ImageryLayer?this._viewer.imageryLayers.remove(this._delegate,!1):this._delegate instanceof Promise?(this._delegate.then(e=>{e.entities.removeAll()}),this._viewer.dataSources.remove(this._delegate)):(this._delegate.entities&&this._delegate.entities.removeAll(),this._viewer.dataSources.remove(this._delegate)),this._removedHook&&this._removedHook(),this._state=m.REMOVED)}_addOverlay(e){this._cache.hasOwnProperty(e.overlayId)||(this._cache[e.overlayId]=e,this._delegate&&e.fire(xe.ADD,this),this._state===m.CLEARED&&(this._state=m.ADDED))}_removeOverlay(e){this._cache.hasOwnProperty(e.overlayId)&&(this._delegate&&e.fire(xe.REMOVE,this),delete this._cache[e.overlayId])}addOverlay(e){return this._addOverlay(e),this}addOverlays(e){return Array.isArray(e)&&e.forEach(t=>{this._addOverlay(t)}),this}removeOverlay(e){return this._removeOverlay(e),this}getOverlay(e){return this._cache[e]||void 0}getOverlayById(e){let t;return Object.keys(this._cache).forEach(r=>{this._cache[r].id===e&&(t=this._cache[r])}),t}getOverlaysByAttr(e,t){let r=[];return this.eachOverlay(s=>{s.attr[e]===t&&r.push(s)},this),r}eachOverlay(e,t){return Object.keys(this._cache).forEach(r=>{e&&e.call(t||this,this._cache[r])}),this}getOverlays(){let e=[];return Object.keys(this._cache).forEach(t=>{e.push(this._cache[t])}),e}clear(){}remove(){this._viewer&&this._viewer.removeLayer(this)}addTo(e){return e!=null&&e.addLayer&&e.addLayer(this),this}setStyle(e){}on(e,t,r){return this._layerEvent.on(e,t,r||this),this}off(e,t,r){return this._layerEvent.off(e,t,r||this),this}fire(e,t){return this._layerEvent.fire(e,t),this}static registerType(e){e&&(lt[e.toLocaleUpperCase()]=e.toLocaleLowerCase())}static getLayerType(e){return lt[e.toLocaleUpperCase()]||void 0}},A=gs;var ys=class{constructor(e){this._id=e||C.uuid(),this._cache={},this._show=!0,this._viewer=void 0,this._layerGroupEvent=new cr,this._layerGroupEvent.on(Te.ADD,this._onAdd,this),this._layerGroupEvent.on(Te.REMOVE,this._onRemove,this),this._state=m.INITIALIZED}get id(){return this._id}get type(){return A.getLayerType("layer_group")}set show(e){this._show=e,Object.keys(this._cache).forEach(t=>{this._cache[t].show=this._show})}get show(){return this._show}get layerGroupEvent(){return this._layerGroupEvent}get state(){return this._state}_onAdd(e){this._viewer=e,Object.keys(this._cache).forEach(t=>{this._viewer.addLayer(this._cache[t])}),this._state=m.ADDED}_onRemove(){Object.keys(this._cache).forEach(e=>{this._viewer&&this._viewer.removeLayer(this._cache[e])}),this._cache={},this._state=m.REMOVED}addLayer(e){return Object(this._cache).hasOwnProperty(e.id)||(this._cache[e.id]=e,this._viewer&&this._viewer.addLayer(e)),this}removeLayer(e){return Object(this._cache).hasOwnProperty(e.id)&&(this._viewer&&this._viewer.removeLayer(e),delete this._cache[e.id]),this}getLayer(e){return this._cache[e]||void 0}getLayers(){let e=[];return Object.keys(this._cache).forEach(t=>{e.push(this._cache[t])}),e}addTo(e){return e&&e.addLayerGroup&&e.addLayerGroup(this),this}remove(){return this._viewer&&this._viewer.removeLayerGroup(this),this}};A.registerType("layer_group");var ah=ys;var iy={radius:60,maxZoom:25,style:"circle",image:"",gradientColors:{1e-4:i.Color.DEEPSKYBLUE,.001:i.Color.GREEN,.01:i.Color.ORANGE,.1:i.Color.RED},gradientImages:{},showCount:!0,fontSize:12,clusterSize:16,fontColor:i.Color.BLACK,getCountOffset:a=>({x:-3.542857*String(a).length+1.066667,y:String(a).length>3?5:4})},vs=class extends A{constructor(e,t={}){super(e),this._delegate=new i.PrimitiveCollection,this._options={...iy,...t},this._billboards=this._delegate.add(new i.BillboardCollection),this._labels=this._delegate.add(new i.LabelCollection),this._cluster=new He({radius:this._options.radius,maxZoom:this._options.maxZoom}),this._allCount=0,this._changedRemoveCallback=void 0,this._lastChangedTime=null,this._state=m.INITIALIZED}get type(){return A.getLayerType("cluster")}_addOverlay(e){}_removeOverlay(e){}_getCircleImage(e,t){let r=this._options.clusterSize*(String(t).length+1),s=e.toCssColorString()+"-"+t;if(!this._cache[s]){let o=document.createElement("canvas");o.width=r,o.height=r;let n=o.getContext("2d");n.save(),n.scale(r/24,r/24),n.fillStyle=e.withAlpha(.2).toCssColorString(),n.beginPath(),n.arc(12,12,9,0,2*Math.PI),n.closePath(),n.fill(),n.beginPath(),n.arc(12,12,6,0,2*Math.PI),n.fillStyle=e.toCssColorString(),n.closePath(),n.fill(),n.restore(),this._cache[s]=o.toDataURL()}return this._cache[s]}_getClusteringImage(e,t){let r=this._options.clusterSize*(String(t).length+1),s=e.toCssColorString()+"-"+t,o=-Math.PI/12,n=Math.PI/2,l=Math.PI/6;if(!this._cache[s]){let h=document.createElement("canvas");h.width=r,h.height=r;let c=h.getContext("2d");c.save(),c.scale(r/24,r/24),c.beginPath(),c.arc(12,12,6,0,2*Math.PI),c.fillStyle=e.toCssColorString(),c.fill(),c.closePath(),c.lineWidth=2;for(let p=0;p<3;p++)c.beginPath(),c.arc(12,12,8,o,o+n,!1),c.strokeStyle=e.withAlpha(.4).toCssColorString(),c.stroke(),c.arc(12,12,11,o,o+n,!1),c.strokeStyle=e.withAlpha(.2).toCssColorString(),c.stroke(),c.closePath(),o=o+n+l;c.restore(),this._cache[s]=h.toDataURL()}return this._cache[s]}_getClusterImage(e){let t=e/this._allCount,r;if(this._options.style==="custom"){let s=Object.keys(this._options.gradientImages).sort((o,n)=>Number(o)-Number(n));for(let o=s.length-1;o>=0;o--)if(t>=Number(s[o])){r=this._options.gradientImages[s[o]];break}r||(r=this._options.gradientImages[s[0]])}else{let s=Object.keys(this._options.gradientColors).sort((n,l)=>Number(n)-Number(l)),o;for(let n=s.length-1;n>=0;n--)if(t>=Number(s[n])){o=this._options.gradientColors[s[n]];break}o||(o=this._options.gradientColors[s[0]]),r=this._options.style==="circle"?this._getCircleImage(o,e):this._getClusteringImage(o,e)}return r}_changeCluster(e){let t=i.getTimestamp();if(this._lastChangedTime&&t-this._lastChangedTime<=1e3)return;this._lastChangedTime=t,this._cache={},this._billboards.removeAll(),this._labels.removeAll();let r=this._viewer.camera.computeViewRectangle();r||(r=this._viewer.viewBounds),this._allCount&&this._cluster.getClusters([i.Math.toDegrees(r.west),i.Math.toDegrees(r.south),i.Math.toDegrees(r.east),i.Math.toDegrees(r.north)],this._viewer.zoom).forEach(o=>{let n=C.uuid();if(o.properties.cluster){let l=o.properties.point_count,h=this._billboards.add({position:i.Cartesian3.fromDegrees(+o.geometry.coordinates[0],+o.geometry.coordinates[1]),image:this._getClusterImage(l)});if(h.layerId=this.layerId,h.overlayId=n,h.attr={count:l},this._cache[n]=h,this._options.showCount){let c=this._labels.add({position:i.Cartesian3.fromDegrees(+o.geometry.coordinates[0],+o.geometry.coordinates[1]),text:String(l),font:`${this._options.fontSize} px sans-serif`,disableDepthTestDistance:Number.POSITIVE_INFINITY,fillColor:this._options.fontColor,scale:.8,pixelOffset:this._options.getCountOffset(l)});c.layerId=this.layerId,c.overlayId=n,c.attr={count:l},this._cache[n]=c}}else{let l=this._billboards.add({position:i.Cartesian3.fromDegrees(+o.geometry.coordinates[0],+o.geometry.coordinates[1]),image:this._options.image,...o.properties.style});l.layerId=this.layerId,l.overlayId=n,l.attr=o.properties,this._cache[n]=l}})}_addedHook(){this._changedRemoveCallback=this._viewer.camera.changed.addEventListener(this._changeCluster,this)}_removedHook(){this._changedRemoveCallback&&this._changedRemoveCallback()}setPoints(e=[]){return e.length&&(this._allCount=e.length,this._cluster.load(e.map(t=>{let r=y.parsePosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[r.lng,r.lat]},properties:t.attr||{}}}))),this}clear(){return this._cache={},this._allCount=0,this._state=m.CLEARED,this}};A.registerType("cluster");var nh=vs;var ws=class extends A{constructor(e,t="",r={}){super(e),this._delegate=i.CzmlDataSource.load(t,r),this._state=m.INITIALIZED}get type(){return A.getLayerType("czml")}set show(e){this._show=e,this._delegate&&this._delegate.then(t=>{t.show=this._show})}get show(){return this._show}eachOverlay(e,t){if(this._delegate)return this._delegate.then(r=>{r.entities.values.forEach(o=>{e.call(t,o)})}),this}};A.registerType("czml");var lh=ws;var Cs=class extends A{constructor(e){super(e),this._delegate=new i.CustomDataSource(e),this._state=m.INITIALIZED}get type(){return A.getLayerType("dynamic")}clear(){return this._delegate.entities&&this._delegate.entities.removeAll(),this._cache={},this._state=m.CLEARED,this}};A.registerType("dynamic");var hh=Cs;var xs=class extends A{constructor(e){super(e),this._delegate=new i.CustomDataSource(e),this._state=m.INITIALIZED}get type(){return A.getLayerType("vector")}clear(){return this._delegate.entities&&this._delegate.entities.removeAll(),this._cache={},this._state=m.CLEARED,this}};A.registerType("vector");var ue=xs;var ry={name:"",count:10,maximumLevel:21,dataProperty:"",callback:()=>null},Ts=class extends A{constructor(e,t,r={}){super(e),this._url=t,this._options={...ry,...r},this._levelLayers={},this._tileWidth=256,this._tileHeight=256,this._maximumLevel=this._options.maximumLevel,this._tilingScheme=this._options.tilingScheme||new i.GeographicTilingScheme,this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._token=void 0;for(let s=0;s<this.maximumLevel;s++)this._levelLayers[String(s)]=new ue(e+"-grid-"+s);this._viewer=void 0,this._imageryLayer=void 0,this._imagery=document.createElement("canvas"),this._imagery.width=this._tileWidth,this._imagery.height=this._tileHeight,this._state=m.INITIALIZED}get type(){return A.getLayerType("feature_grid")}get url(){return this._url}set show(e){this._show=e,Object.keys(this._levelLayers).forEach(t=>{this._levelLayers[t].show=e})}get show(){return this._show}get token(){return this._token}get tileWidth(){if(!this.ready)throw new i.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}get tileHeight(){if(!this.ready)throw new i.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}get maximumLevel(){if(!this.ready)throw new i.DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}get minimumLevel(){if(!this.ready)throw new i.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}get tilingScheme(){if(!this.ready)throw new i.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}get rectangle(){if(!this.ready)throw new i.DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}get ready(){return!!this._url}get credit(){return this._credit}get hasAlphaChannel(){return!0}_onAdd(e){this._viewer=e,this._imageryLayer=this._viewer.imageryLayers.addImageryProvider(this),Object.keys(this._levelLayers).forEach(t=>{this._viewer.addLayer(this._levelLayers[t])}),this._state=m.ADDED}_onRemove(){this._imageryLayer&&this._viewer.imageryLayers.remove(this._imageryLayer),Object.keys(this._levelLayers).forEach(e=>{this._viewer.removeLayer(this._levelLayers[e])}),this._state=m.REMOVED}getTileCredits(e,t,r){}requestImage(e,t,r,s){let o=this._levelLayers[String(r)],n=this._tilingScheme.tileXYToRectangle(e,t,r);return this._viewer&&n&&o&&i.Rectangle.intersection(n,this._viewer.viewBounds)&&i.Resource.fetchJson({url:this._url,queryParameters:{minX:i.Math.toDegrees(n.west),minY:i.Math.toDegrees(n.south),maxX:i.Math.toDegrees(n.east),maxY:i.Math.toDegrees(n.north),count:this._options.count}}).then(l=>{let h=l;if(this._options.dataProperty&&(h=l[this._options.dataProperty]),h&&h.length){for(let c=r+3;c<this._maximumLevel;c++)this._levelLayers[String(c)]&&this._levelLayers[String(c)].clear();h.forEach(c=>{let p=this._options.callback(c);p&&o.addOverlay(p)})}}),this._imagery}clear(){Object.keys(this._levelLayers).forEach(e=>{this._levelLayers[e].clear()}),this._state=m.CLEARED}};A.registerType("feature_grid");var ch=Ts;var sy={},N=sy;var Es=class{constructor(){this._id=C.uuid(),this._bid=C.uuid(),this._delegate=void 0,this._layer=void 0,this._state=void 0,this._show=!0,this._style={},this._attr={},this._allowDrillPicking=!1,this._contextMenu=[],this._overlayEvent=new ur,this._overlayEvent.on(xe.ADD,this._onAdd,this),this._overlayEvent.on(xe.REMOVE,this._onRemove,this)}get overlayId(){return this._id}get type(){return""}set id(e){this._bid=e}get id(){return this._bid}set show(e){this._show=e,C.isPromise(this._delegate)?this._delegate.then(t=>{t.show=this._show}):this._delegate&&(this._delegate.show=this._show)}get show(){return this._show}set attr(e){this._attr=e}get attr(){return this._attr}set allowDrillPicking(e){this._allowDrillPicking=e}get allowDrillPicking(){return this._allowDrillPicking}get overlayEvent(){return this._overlayEvent}get delegate(){return this._delegate}get state(){return this._state}set contextMenu(e){this._contextMenu=e}get contextMenu(){return this._contextMenu}_getLayerCollection(e){let t;switch(e){case"point_primitive":t=this._layer.points;break;case"billboard_primitive":case"bounce_billboard_primitive":t=this._layer.billboards;break;case"label_primitive":case"bounce_label_primitive":t=this._layer.labels;break;case"polyline_primitive":t=this._layer.polylines;break;case"cloud_primitive":t=this._layer.clouds;break;default:break}return t}_mountedHook(){}_addedHook(){var e;if(!this._delegate)return!1;this._delegate instanceof Promise?this._delegate.then(t=>{var r;t.layerId=(r=this._layer)==null?void 0:r.layerId,t.overlayId=this._id}):(this._delegate.layerId=(e=this._layer)==null?void 0:e.layerId,this._delegate.overlayId=this._id)}_removedHook(){}_onAdd(e){var t,r,s,o;if(e){if(this._layer=e,this._mountedHook&&this._mountedHook(),(r=(t=this._layer)==null?void 0:t.delegate)!=null&&r.entities&&this._delegate)this._layer.delegate.entities.add(this._delegate);else if((o=(s=this._layer)==null?void 0:s.delegate)!=null&&o.add){let n=this._getLayerCollection(this.type);n?(this._delegate&&(this._delegate=n.add(this._delegate)),C.merge(this._delegate,this._style),this.update&&this.destroy&&this._layer.delegate.add(this)):C.isPromise(this._delegate)?this._delegate.then(l=>{this._layer.delegate.add(l)}):this.update&&this.destroy?this._layer.delegate.add(this):this._delegate&&this._layer.delegate.add(this._delegate)}this._addedHook&&this._addedHook(),this._state=m.ADDED}}_onRemove(){var e,t,r,s;if(this._layer){if((t=(e=this._layer)==null?void 0:e.delegate)!=null&&t.entities)this._layer.delegate.entities.remove(this._delegate);else if((s=(r=this._layer)==null?void 0:r.delegate)!=null&&s.remove){let o=this._getLayerCollection(this.type);o?(this._delegate&&o.remove(this._delegate),this.update&&this.destroy&&this._layer.delegate.remove(this)):C.isPromise(this._delegate)?this._delegate.then(n=>{this._layer.delegate.remove(n)}):this.update&&this.destroy?this._layer.delegate.remove(this):this._delegate&&this._layer.delegate.remove(this._delegate)}this._removedHook&&this._removedHook(),this._state=m.REMOVED}}setLabel(e,t){return this._delegate?(this._delegate instanceof i.Entity&&(this._delegate.label={...t,text:e}),this):this}setStyle(e){return this}remove(){return this._layer&&this._layer.removeOverlay(this),this}addTo(e){return e&&e.addOverlay&&e.addOverlay(this),this}on(e,t,r){return this._overlayEvent.on(e,t,r||this),this}off(e,t,r){return this._overlayEvent.off(e,t,r||this),this}fire(e,t){return this._overlayEvent.fire(e,t),this}static registerType(e){e&&(N[e.toLocaleUpperCase()]=e.toLocaleLowerCase())}static getOverlayType(e){return N[e.toLocaleUpperCase()]||void 0}},v=Es;var Ps=class extends v{constructor(e,t){super(),this._delegate=new i.Entity({billboard:{}}),this._position=y.parsePosition(e),this._icon=t,this._size=[32,32],this._state=m.INITIALIZED}get type(){return v.getOverlayType("custom_billboard")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}set icon(e){this._icon=e,this._delegate.billboard.image=this._icon}get icon(){return this._icon}set size(e){if(!Array.isArray(e))throw new Error("CustomBillboard: the size invalid");this._size=e,this._delegate.billboard.width=this._size[0]||32,this._delegate.billboard.height=this._size[1]||32}get size(){return this._size}_mountedHook(){this.position=this._position,this.icon=this._icon,this.size=this._size}setLabel(e,t){return this._delegate.label={...t,text:e},this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.image&&delete e.width&&delete e.height,C.merge(this._style,e),C.merge(this._delegate.billboard,e),this)}setVLine(e={}){if(this._position.alt>0&&!this._delegate.polyline){let t=this._position.copy();t.alt=e.height||0,this._delegate.polyline={...e,positions:f.transformWGS84ArrayToCartesianArray([t,this._position])}}return this}setBottomCircle(e,t={},r=0){let s=0,o=r;return this._delegate.ellipse={...t,semiMajorAxis:e,semiMinorAxis:e,stRotation:new i.CallbackProperty(()=>(s+=o,(s>=360||s<=-360)&&(s=0),s),!1)},this}};v.registerType("custom_billboard");var ph=Ps;var bs=class extends v{constructor(e,t){super(),this._delegate=new i.Entity({label:{}}),this._position=y.parsePosition(e),this._text=t,this._state=m.INITIALIZED}get type(){return v.getOverlayType("custom_label")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}set text(e){this._text=e,this._delegate.label.text=this._text}get text(){return this._text}_mountedHook(){this.position=this._position,this.text=this._text}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.text,C.merge(this._style,e),C.merge(this._delegate.label,e),this)}setVLine(e={}){if(this._position.alt>0&&!this._delegate.polyline){let t=this._position.copy();t.alt=e.height||0,this._delegate.polyline={...e,positions:f.transformWGS84ArrayToCartesianArray([t,this._position])}}return this}setBottomCircle(e,t={},r=0){let s=0,o=r;return this._delegate.ellipse={...t,semiMajorAxis:e,semiMinorAxis:e,stRotation:new i.CallbackProperty(()=>(s+=o,(s>=360||s<=-360)&&(s=0),s),!1)},this}};v.registerType("custom_label");var dh=bs;var As=class extends v{constructor(){super(),this._startTime=void 0,this._lastTime=void 0,this._sampledPosition=new i.SampledPositionProperty,this._cache=[],this._maxCacheSize=10,this._state=m.INITIALIZED}set maxCacheSize(e){this._maxCacheSize=e}get maxCacheSize(){return this._maxCacheSize}get position(){return f.transformCartesianToWGS84(this._sampledPosition.getValue(i.JulianDate.now()))}_removePosition(){if(this._cache.length>this._maxCacheSize){let e=i.JulianDate.addSeconds(this._cache[0],-.2,new i.JulianDate),t=i.JulianDate.addSeconds(this._cache[this._cache.length-this._maxCacheSize],-.2,new i.JulianDate);this._sampledPosition.removeSamples(new i.TimeInterval({start:e,stop:t})),this._cache.splice(0,this._cache.length-this._maxCacheSize)}}addPosition(e,t){this._removePosition();let r=i.JulianDate.now(),s=i.JulianDate.addSeconds(r,t,new i.JulianDate);return this._sampledPosition.addSample(s,f.transformWGS84ToCartesian(y.parsePosition(e))),this._lastTime=s,this._cache.push(this._lastTime),this}bindDom(e){return this}},Ot=As;var Ms=class extends Ot{constructor(e,t){super(),this._position=y.parsePosition(e),this._icon=t,this._delegate=new i.Entity({billboard:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("dynamic_billboard")}set icon(e){this._icon=e,this._delegate.billboard.image=this._icon}get icon(){return this._icon}set size(e){if(!Array.isArray(e))throw new Error("DynamicBillboard: the size invalid");this._size=e,this._delegate.billboard.width=this._size[0]||32,this._delegate.billboard.height=this._size[1]||32}get size(){return this._size}_mountedHook(){this._sampledPosition.forwardExtrapolationType=i.ExtrapolationType.HOLD,this._startTime=i.JulianDate.now(),this._sampledPosition.addSample(this._startTime,f.transformWGS84ToCartesian(this._position)),this._delegate.position=this._sampledPosition,this._cache.push(this._startTime),this.icon=this._icon,this.size=this._size}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.image&&delete e.width&&delete e.height,C.merge(this._style,e),C.merge(this._delegate.billboard,e),this)}};v.registerType("dynamic_billboard");var mh=Ms;var Is=class extends Ot{constructor(e,t){super(),this._position=y.parsePosition(e),this._modelUrl=t,this._delegate=new i.Entity({model:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("dynamic_model")}set modelUrl(e){this._modelUrl=e,this._delegate.model.uri=this._modelUrl}get modelUrl(){return this._modelUrl}_mountedHook(){this._sampledPosition.forwardExtrapolationType=i.ExtrapolationType.HOLD,this._startTime=i.JulianDate.now(),this._sampledPosition.addSample(this._startTime,f.transformWGS84ToCartesian(this._position)),this._delegate.position=this._sampledPosition,this._delegate.orientation=new i.VelocityOrientationProperty(this._sampledPosition),this._cache.push(this._startTime),this.modelUrl=this._modelUrl}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.uri,C.merge(this._style,e),C.merge(this._delegate.model,e),this)}};v.registerType("dynamic_model");var uh=Is;function oy(a,e,t){let r=i.Cartesian3.subtract(a,e,new i.Cartesian3),s=i.Cartesian3.subtract(t,e,new i.Cartesian3),o=i.Cartesian3.cross(r,s,r);return i.Cartesian3.magnitude(o)*.5}function ge(a){let e=0;if(!Array.isArray(a))return e;a[0]instanceof i.Cartesian3||(a=f.transformWGS84ArrayToCartesianArray(a));let t=i.CoplanarPolygonGeometry.createGeometry(i.CoplanarPolygonGeometry.fromPositions({positions:a,vertexFormat:i.VertexFormat.POSITION_ONLY}));if(!t)return e;let r=t.attributes.position.values,s=t.indices;for(let o=0;o<s.length;o+=3){let n=i.Cartesian3.unpack(r,s[o]*3,new i.Cartesian3),l=i.Cartesian3.unpack(r,s[o+1]*3,new i.Cartesian3),h=i.Cartesian3.unpack(r,s[o+2]*3,new i.Cartesian3);e+=oy(n,l,h)}return e}function Ss(a=[],e=0){let t=180,r=90,s=-180,o=-90;if(a.forEach(n=>{t=Math.min(t,n.lng||n.x),r=Math.min(r,n.lat||n.y),s=Math.max(s,n.lng||n.x),o=Math.max(o,n.lat||n.y)}),e>0){let n=Math.abs(s-s),l=Math.abs(o-r);t-=n*e,r-=l*e,s+=n*e,o+=l*e}return{west:t,south:r,east:s,north:o}}function ye(a){if(a&&Array.isArray(a)){let e=0;a.forEach(({alt:s})=>e=Math.max(e,s));let t=i.BoundingSphere.fromPoints(f.transformWGS84ArrayToCartesianArray(a)),r=f.transformCartesianToWGS84(t.center);return r.alt=e,r}return new X}function Ds(a,e){e=e||{};let t=[];for(let r=0;r<a.length-1;r++){let s=ay(a[r],a[r+1],e.count);s&&s.length>0&&(t=t.concat(s))}return t}function ay(a,e,t){if(!a||!e)return null;let r=[];t=t||40;let s=function(M){return 1-2*M+M*M},o=M=>2*M-2*M*M,n=M=>M*M,l,h,c,p,u,g,_=0,d=parseFloat(a.lat),T=parseFloat(e.lat),w=parseFloat(a.lng),P=parseFloat(e.lng);P>w&&P-w>180&&w<0&&(w=360+w,P=360+P),g=0,T===d?(l=0,h=w-P):P===w?(l=Math.PI/2,h=d-T):(l=Math.atan((T-d)/(P-w)),h=(T-d)/Math.sin(l)),g===0&&(g=l+Math.PI/5),c=h/2,u=c*Math.cos(g)+w,p=c*Math.sin(g)+d;for(let M=0;M<t+1;M++){let R=w*s(_)+u*o(_)+P*n(_),F=d*s(_)+p*o(_)+T*n(_),H=a.lng,ee=e.lng;r.push([H<0&&ee>0?R-360:R,F]),_=_+1/t}return r}function ie(a){let e=0;if(a&&Array.isArray(a))for(let t=0;t<a.length-1;t++){let r=f.transformWGS84ToCartographic(a[t]),s=f.transformWGS84ToCartographic(a[t+1]),o=new i.EllipsoidGeodesic;o.setEndPoints(r,s);let n=o.surfaceDistance;n=Math.sqrt(Math.pow(n,2)+Math.pow(s.height-r.height,2)),e+=n}return e.toFixed(3)}function ve(a,e){let t=a,r=e;if(!t||!r)return 0;a instanceof i.Cartesian3||(t=y.parsePosition(a),t=f.transformWGS84ToCartesian(t)),e instanceof i.Cartesian3||(r=y.parsePosition(e),r=f.transformWGS84ToCartesian(r));let s=i.Transforms.eastNorthUpToFixedFrame(t),o=i.Cartesian3.subtract(r,t,new i.Cartesian3),n=i.Matrix4.multiplyByPointAsVector(i.Matrix4.inverse(s,new i.Matrix4),o,new i.Cartesian3),l=Math.atan2(n.y,n.x)-i.Math.PI_OVER_TWO;return l=i.Math.TWO_PI-i.Math.zeroToTwoPi(l),isNaN(l)?0:l}function ht(a,e,t){return a=parseFloat(a)||0,a>=parseFloat(e)&&a<=parseFloat(t)}function z(a,e){return i.Cartesian3.midpoint(a,e,new i.Cartesian3)}function Ls(a,e){let t=y.parsePosition(a),r=y.parsePosition(e);t=f.transformWGS84ToCartographic(t),r=f.transformWGS84ToCartographic(r);let s=new i.EllipsoidGeodesic(t,r).interpolateUsingFraction(.5);return new X(i.Math.toDegrees(s.longitude),i.Math.toDegrees(s.latitude),s.height)}function Rs(a,e,t=0,r=50){let s=[];t=Math.max(+t,100),r=Math.max(+r,50);let o=Math.abs(a.lng-e.lng),n=Math.abs(a.lat-e.lat),l=Math.max(o,n),h=l/r;if(o>n){let c=(e.lat-a.lat)/r;a.lng-e.lng>0&&(h=-h);for(let p=0;p<r;p++){let u=t-Math.pow(-.5*l+Math.abs(h)*p,2)*4*t/Math.pow(l,2),g=a.lng+h*p,_=a.lat+c*p;s.push([g,_,u])}}else{let c=(e.lng-a.lng)/r;a.lat-e.lat>0&&(h=-h);for(let p=0;p<r;p++){let u=t-Math.pow(-.5*l+Math.abs(h)*p,2)*4*t/Math.pow(l,2),g=a.lng+c*p,_=a.lat+h*p;s.push([g,_,u])}}return s.push([e.lng,e.lat,e.alt||0]),s}var{Math:ny}=i,_h={};C.merge(_h,ny,{area:ge,bounds:Ss,center:ye,curve:Ds,distance:ie,heading:ve,isBetween:ht,midCartesian:z,midPosition:Ls,parabola:Rs});var Os=class a extends v{constructor(e,t){super(),this._delegate=I.create("div","div-icon"),this._position=y.parsePosition(e),this._delegate.setAttribute("id",this._id),C.merge(this._delegate.style,{position:"absolute",top:"0",left:"0"}),this.content=t,this._state=m.INITIALIZED}get type(){return v.getOverlayType("div_icon")}set show(e){this._show=e,this._delegate.style.visibility=this._show?"visible":"hidden"}get show(){return this._show}set position(e){this._position=y.parsePosition(e)}get position(){return this._position}set content(e){if(e&&typeof e=="string")this._delegate.innerHTML=e;else if(e&&e instanceof Element){for(;this._delegate.hasChildNodes();)this._delegate.removeChild(this._delegate.firstChild);this._delegate.appendChild(e)}}get content(){return this._delegate.childNodes||[]}_updateStyle(e,t,r){if(!this._show||!e)return;let s=e.x-this._delegate.offsetWidth/2,o=e.y-this._delegate.offsetHeight/2;this._style.position==="topleft"?(s=e.x-this._delegate.offsetWidth,o=e.y-this._delegate.offsetHeight):this._style.position==="topright"?(s=e.x,o=e.y-this._delegate.offsetHeight):this._style.position==="bottomleft"?(s=e.x-this._delegate.offsetWidth,o=e.y):this._style.position==="bottomright"&&(s=e.x,o=e.y);let n=`translate3d(${Math.round(s)}px,${Math.round(o)}px, 0)`,l="scale3d(1,1,1)",h=this._style.scaleByDistance;if(t&&h){let u=h.near||0,g=h.nearValue||1,_=h.far||Number.MAX_VALUE,d=h.farValue||0,T=t/_;if(t<u)l=`scale3d(${g},${g},1)`;else if(t>_)l=`scale3d(${d},${d},1)`;else{let w=d+T*(g-d);l=`scale3d(${w},${w},1)`}}let c=!0,p=this._style.distanceDisplayCondition;t&&p&&(c=ht(t,p.near||0,p.far||Number.MAX_VALUE)),this._delegate.style.transform=`${n} ${l}`,this._delegate.style.visibility=c&&r?"visible":"hidden"}_onAdd(e){this._layer=e,this._layer.delegate.appendChild(this._delegate);let t={layer:e,overlay:this,position:f.transformWGS84ToCartesian(this._position)};this._delegate.addEventListener("click",()=>{this._overlayEvent.fire(O.CLICK,t)}),this._delegate.addEventListener("mouseover",()=>{this._overlayEvent.fire(O.MOUSE_OVER,t)}),this._delegate.addEventListener("mouseout",()=>{this._overlayEvent.fire(O.MOUSE_OUT,t)}),this._state=m.ADDED}_onRemove(){this._layer&&(this._layer.delegate.removeChild(this._delegate),this._state=m.REMOVED)}setLabel(e,t){return this}setStyle(e){return!e||Object.keys(e).length===0?this:(C.merge(this._style,e),this._style.className&&I.addClass(this._delegate,this._style.className),this)}static fromEntity(e,t){var n;let r,s=i.JulianDate.now(),o=f.transformCartesianToWGS84(e.position.getValue(s));return r=new a(o,t),e.billboard&&(r.attr={...(n=e==null?void 0:e.properties)==null?void 0:n.getValue(s)}),r}};v.registerType("div_icon");var fh=Os;var ks=class a extends v{constructor(e,t){super(),this._delegate=new i.Entity({model:{}}),this._position=y.parsePosition(e),this._modelUrl=t,this._rotateAmount=0,this._state=m.INITIALIZED}get type(){return v.getOverlayType("model")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position),this._rotateAmount===0&&(this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll))))}get position(){return this._position}set modelUrl(e){this._modelUrl=e,this._delegate.model.uri=this._modelUrl}get modelUrl(){return this._modelUrl}set rotateAmount(e){this._rotateAmount=+e,this._delegate.orientation=new i.CallbackProperty(()=>(this._position.heading+=this._rotateAmount,(this._position.heading>=360||this._position.heading<=-360)&&(this._position.heading=0),i.Transforms.headingPitchRollQuaternion(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))),!1)}get rotateAmount(){return this._rotateAmount}_mountedHook(){this.position=this._position,this.modelUrl=this._modelUrl}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.uri,C.merge(this._style,e),C.merge(this._delegate.model,e),this)}static fromEntity(e,t){let r=i.JulianDate.now(),s=f.transformCartesianToWGS84(e.position.getValue(r)),o=new a(s,t);return o.attr={...e.properties.getValue(r)},o}};v.registerType("model");var Ge=ks;var Fs=class extends v{constructor(e,t={}){super(),this._delegate=i.I3SDataProvider.fromUrl(e,t),this._state=m.INITIALIZED}get type(){return v.getOverlayType("i3s")}ready(e){return this._delegate.then(e),this}setLabel(e,t){return console.warn("not support this function"),this}};v.registerType("i3s");var gh=Fs;var zs=class extends v{constructor(e,t={}){super(),this._delegate=i.Cesium3DTileset.fromUrl(e,t),this._tilesetEvent=new fr(this._delegate),this._tileVisibleCallback=void 0,this._properties=void 0,this._state=m.INITIALIZED}get type(){return v.getOverlayType("tileset")}set show(e){this._show=e,this._delegate.then(t=>{t.show=e})}_bindVisibleEvent(){this._tileVisibleCallback&&this._tileVisibleCallback(),this._tileVisibleCallback=this._delegate.then(e=>{e.tileVisible.addEventListener(this._updateTile,this)})}_updateTile(e){let t=e.content;for(let r=0;r<t.featuresLength;r++){let s=t.getFeature(r);this._properties&&this._properties.length&&this._properties.forEach(o=>{s.hasProperty(o.key)&&s.getProperty(o.key)===o.keyValue&&s.setProperty(o.propertyName,o.propertyValue)})}}ready(e){return this._delegate.then(e),this}setPosition(e){return e=y.parsePosition(e),this._delegate.then(t=>{let r=i.Transforms.eastNorthUpToFixedFrame(i.Cartesian3.fromDegrees(e.lng,e.lat,e.alt)),s=i.Matrix4.fromRotationTranslation(i.Matrix3.fromHeadingPitchRoll(new i.HeadingPitchRoll(i.Math.toRadians(e.heading),i.Math.toRadians(e.pitch),i.Math.toRadians(e.roll))));i.Matrix4.multiply(r,s,r),t.root.transform=r}),this}setHeadingPitchRoll(e,t,r){return this._delegate.then(s=>{let o=s.root.transform,n=i.Matrix4.fromRotationTranslation(i.Matrix3.fromHeadingPitchRoll(new i.HeadingPitchRoll(i.Math.toRadians(e||0),i.Math.toRadians(t||0),i.Math.toRadians(r||0))));i.Matrix4.multiply(o,n,o),s.root.transform=o}),this}setLabel(e,t){return console.warn("not support this function"),this}clampToGround(){return this._delegate.then(e=>{let t=i.Cartographic.fromCartesian(e.boundingSphere.center),r=i.Cartesian3.fromRadians(t.longitude,t.latitude,t.height),s=i.Cartesian3.fromRadians(t.longitude,t.latitude,0),o=i.Cartesian3.subtract(s,r,new i.Cartesian3);e.modelMatrix=i.Matrix4.fromTranslation(o)}),this}setHeight(e,t=!1){return this._delegate.then(r=>{let s=i.Cartographic.fromCartesian(r.boundingSphere.center),o=i.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),n=i.Cartesian3.fromRadians(s.longitude,s.latitude,t?e:s.height+e),l=i.Cartesian3.subtract(n,o,new i.Cartesian3);r.modelMatrix=i.Matrix4.fromTranslation(l)}),this}setScale(e){return this._delegate.then(t=>{let r=t.root.transform;e>0&&e!==1&&i.Matrix4.multiplyByUniformScale(r,e,r),t.root.transform=r}),this}setProperties(e){return this._properties=e,this._bindVisibleEvent(),this}setSplitDirection(e){return this._delegate.then(t=>{t.splitDirection=e}),this}setCustomShader(e){return this._delegate.then(t=>{t.customShader=e}),this}setClippingPolygons(e=null,t=!1){if(!e||e.length<3)return this._delegate.then(n=>{n.clippingPolygons&&(n.clippingPolygons.enabled=!1)}),this;let r=i.Cartesian3.fromDegreesArray(e),s=new i.ClippingPolygon({positions:r}),o=new i.ClippingPolygonCollection({polygons:[s],inverse:t});return this._delegate.then(n=>{n.clippingPolygons=o}),this}async setClippingPlanes(e=null,t=!1){if(!e||e.length<2)return this._delegate.then(F=>{F.clippingPlanes&&(F.clippingPlanes.enabled=!1)}),this;let r=i.Cartesian3.fromDegrees(e[1].lng,e[1].lat),s=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat),o=new i.Cartesian3((r.x+s.x)/2,(r.y+s.y)/2,(r.z+s.z)/2),n=i.Cartesian3.subtract(s,r,new i.Cartesian3),l=i.Cartesian3.cross(o,n,new i.Cartesian3),h=i.Cartesian3.normalize(l,new i.Cartesian3),c=await Promise.resolve(this._delegate),p=c.boundingSphere.center,u=c.boundingSphere.radius,g=i.Transforms.eastNorthUpToFixedFrame(p),_,d=c.root.transform;d.equals(i.Matrix4.IDENTITY)?(d=g,_=i.Matrix4.inverse(g,new i.Matrix4)):_=i.Matrix4.inverse(d,new i.Matrix4);let T=new i.Cartesian3(p.x-r.x,p.y-r.y,p.z-r.z),w=i.Cartesian3.dot(T,h),P=i.Matrix4.multiplyByPointAsVector(_,h,new i.Cartesian3),M=new i.ClippingPlane(P,w),R=new i.ClippingPlaneCollection({planes:[M],unionClippingRegions:t});return c.clippingPlanes=R,{center:p,size:u,distance:w,clippingPlanes:c.clippingPlanes}}setStyle(e){return e&&e instanceof i.Cesium3DTileStyle&&(this._style=e,this._delegate.then(t=>{t.style=e})),this}on(e,t,r){return this._overlayEvent.on(e,t,r||this),this._tilesetEvent.on(e,t,r||this),this}off(e,t,r){return this._overlayEvent.off(e,t,r||this),this._tilesetEvent.off(e,t,r||this),this}};v.registerType("tileset");var yh=zs;var kt=Math.PI/2,Ns=class extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({polygon:{}}),this.headHeightFactor=.18,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15,this.headTailFactor=.8,this._state=m.INITIALIZED}get type(){return v.getOverlayType("attack_arrow")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._getHierarchy()}get positions(){return this._positions}_getArrowHeadPoints(e,t,r){let s=x.getBaseLength(e),o=s*this.headHeightFactor,n=e[e.length-1];s=x.distance(n,e[e.length-2]);let l=x.distance(t,r);o>l*this.headTailFactor&&(o=l*this.headTailFactor);let h=o*this.headWidthFactor,c=o*this.neckWidthFactor;o=o>s?s:o;let p=o*this.neckHeightFactor,u=x.getThirdPoint(e[e.length-2],n,0,o,!0),g=x.getThirdPoint(e[e.length-2],n,0,p,!0),_=x.getThirdPoint(n,u,kt,h,!1),d=x.getThirdPoint(n,u,kt,h,!0),T=x.getThirdPoint(n,g,kt,c,!1),w=x.getThirdPoint(n,g,kt,c,!0);return[T,_,n,d,w]}_getArrowBodyPoints(e,t,r,s){let o=x.wholeDistance(e),l=x.getBaseLength(e)*s,h=x.distance(t,r),c=(l-h)/2,p=0,u=[],g=[];for(let _=1;_<e.length-1;_++){let d=x.getAngleOfThreePoints(e[_-1],e[_],e[_+1])/2;p+=x.distance(e[_-1],e[_]);let T=(l/2-p/o*c)/Math.sin(d),w=x.getThirdPoint(e[_-1],e[_],Math.PI-d,T,!0),P=x.getThirdPoint(e[_-1],e[_],d,T,!1);u.push(w),g.push(P)}return u.concat(g)}_getHierarchy(){let e=y.parsePolygonCoordToArray(this._positions)[0],t=e[0],r=e[1];x.isClockWise(e[0],e[1],e[2])&&(t=e[1],r=e[0]);let o=[x.mid(t,r)].concat(e.slice(2)),n=this._getArrowHeadPoints(o,t,r),l=n[0],h=n[4],c=x.distance(t,r)/x.getBaseLength(o),p=this._getArrowBodyPoints(o,l,h,c),u=p.length,g=[t].concat(p.slice(0,u/2));g.push(l);let _=[r].concat(p.slice(u/2,u));return _.push(h),g=x.getQBSplinePoints(g),_=x.getQBSplinePoints(_),new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(g.concat(n,_.reverse()))))}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.polygon,e),this)}};v.registerType("attack_arrow");var Ue=Ns;var Q=Math.PI/2,Hs=class extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({polygon:{}}),this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15,this._state=m.INITIALIZED}get type(){return v.getOverlayType("double_arrow")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._getHierarchy()}get positions(){return this._positions}_getArrowPoints(e,t,r,s){let o=x.mid(e,t),n=x.distance(o,r),l=x.getThirdPoint(r,o,0,n*.3,!0),h=x.getThirdPoint(r,o,0,n*.5,!0);l=x.getThirdPoint(o,l,Q,n/5,s),h=x.getThirdPoint(o,h,Q,n/4,s);let c=[o,l,h,r],p=this._getArrowHeadPoints(c),u=p[0],g=p[4],_=x.distance(e,t)/x.getBaseLength(c)/2,d=this._getArrowBodyPoints(c,u,g,_),T=d.length,w=d.slice(0,T/2),P=d.slice(T/2,T);return w.push(u),P.push(g),w=w.reverse(),w.push(t),P=P.reverse(),P.push(e),w.reverse().concat(p,P)}_getArrowHeadPoints(e){let r=x.getBaseLength(e)*this.headHeightFactor,s=e[e.length-1],o=r*this.headWidthFactor,n=r*this.neckWidthFactor,l=r*this.neckHeightFactor,h=x.getThirdPoint(e[e.length-2],s,0,r,!0),c=x.getThirdPoint(e[e.length-2],s,0,l,!0),p=x.getThirdPoint(s,h,Q,o,!1),u=x.getThirdPoint(s,h,Q,o,!0),g=x.getThirdPoint(s,c,Q,n,!1),_=x.getThirdPoint(s,c,Q,n,!0);return[g,p,s,u,_]}_getArrowBodyPoints(e,t,r,s){let o=x.wholeDistance(e),l=x.getBaseLength(e)*s,h=x.distance(t,r),c=(l-h)/2,p=0,u=[],g=[];for(let _=1;_<e.length-1;_++){let d=x.getAngleOfThreePoints(e[_-1],e[_],e[_+1])/2;p+=x.distance(e[_-1],e[_]);let T=(l/2-p/o*c)/Math.sin(d),w=x.getThirdPoint(e[_-1],e[_],Math.PI-d,T,!0),P=x.getThirdPoint(e[_-1],e[_],d,T,!1);u.push(w),g.push(P)}return u.concat(g)}_getTempPoint4(e,t,r){let s=x.mid(e,t),o=x.distance(s,r),n=x.getAngleOfThreePoints(e,s,r),l,h,c,p;return n<Q?(h=o*Math.sin(n),c=o*Math.cos(n),p=x.getThirdPoint(e,s,Q,h,!1),l=x.getThirdPoint(s,p,Q,c,!0)):n>=Q&&n<Math.PI?(h=o*Math.sin(Math.PI-n),c=o*Math.cos(Math.PI-n),p=x.getThirdPoint(e,s,Q,h,!1),l=x.getThirdPoint(s,p,Q,c,!1)):n>=Math.PI&&n<Math.PI*1.5?(h=o*Math.sin(n-Math.PI),c=o*Math.cos(n-Math.PI),p=x.getThirdPoint(e,s,Q,h,!0),l=x.getThirdPoint(s,p,Q,c,!0)):(h=o*Math.sin(Math.PI*2-n),c=o*Math.cos(Math.PI*2-n),p=x.getThirdPoint(e,s,Q,h,!0),l=x.getThirdPoint(s,p,Q,c,!1)),l}_getHierarchy(){let e=this._positions.length,t,r,s=y.parsePolygonCoordToArray(this._positions)[0],o=s[0],n=s[1],l=s[2];e===3?t=this._getTempPoint4(o,n,l):t=s[3],e===3||e===4?r=x.mid(o,n):r=s[4];let h,c;x.isClockWise(o,n,l)?(h=this._getArrowPoints(o,r,t,!1),c=this._getArrowPoints(r,n,l,!0)):(h=this._getArrowPoints(n,r,l,!1),c=this._getArrowPoints(r,o,t,!0));let p=h.length,u=(p-5)/2,g=h.slice(0,u),_=h.slice(u,u+5),d=h.slice(u+5,p),T=c.slice(0,u),w=c.slice(u,u+5),P=c.slice(u+5,p);T=x.getBezierPoints(T);let M=x.getBezierPoints(P.concat(g.slice(1)));return d=x.getBezierPoints(d),new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(T.concat(w,M,_,d))))}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.polygon,e),this)}};v.registerType("double_arrow");var Ft=Hs;var vh=Math.PI/2,Ws=class extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({polygon:{}}),this.tailWidthFactor=.15,this.neckWidthFactor=.2,this.headWidthFactor=.25,this.headAngle=Math.PI/8.5,this.neckAngle=Math.PI/13,this._state=m.INITIALIZED}get type(){return v.getOverlayType("fine_arrow")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._getHierarchy()}get positions(){return this._positions}_getHierarchy(){let e=y.parsePolygonCoordToArray(this._positions)[0],t=e[0],r=e[1],s=x.getBaseLength(e),o=s*this.tailWidthFactor,n=s*this.neckWidthFactor,l=s*this.headWidthFactor,h=x.getThirdPoint(r,t,vh,o,!0),c=x.getThirdPoint(r,t,vh,o,!1),p=x.getThirdPoint(t,r,this.headAngle,l,!1),u=x.getThirdPoint(t,r,this.headAngle,l,!0),g=x.getThirdPoint(t,r,this.neckAngle,n,!1),_=x.getThirdPoint(t,r,this.neckAngle,n,!0);return new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions([h,g,p,r,u,_,c])))}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.polygon,e),this)}};v.registerType("fine_arrow");var zt=Ws;var ly=Math.PI/2,wh=100,Gs=class extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({polygon:{}}),this.t=.4,this._state=m.INITIALIZED}get type(){return v.getOverlayType("gathering_place")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._getHierarchy()}get positions(){return this._positions}_getHierarchy(){let e=y.parsePolygonCoordToArray(this._positions)[0];if(this._positions.length===2){let n=x.mid(e[0],e[1]),l=x.distance(e[0],n)/.9,h=x.getThirdPoint(e[0],n,ly,l,!0);e=[e[0],h,e[1]]}let t=x.mid(e[0],e[2]);e.push(t,e[0],e[1]);let r=[];for(let n=0;n<e.length-2;n++){let l=e[n],h=e[n+1],c=e[n+2],p=x.getBisectorNormals(this.t,l,h,c);r=r.concat(p)}let s=r.length;r=[r[s-1]].concat(r.slice(0,s-1));let o=[];for(let n=0;n<e.length-2;n++){let l=e[n],h=e[n+1];o.push(l);for(let c=0;c<=wh;c++){let p=x.getCubicValue(c/wh,l,r[n*2],r[n*2+1],h);o.push(p)}o.push(h)}return new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(o)))}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.polygon,e),this)}};v.registerType("gathering_place");var Nt=Gs;var Us=class extends Ue{constructor(e){super(e),this._delegate=new i.Entity({polygon:{}}),this.headHeightFactor=.18,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15,this.tailWidthFactor=.1,this.headTailFactor=.8,this.swallowTailFactor=1,this._state=m.INITIALIZED}get type(){return v.getOverlayType("tailed_attack_arrow")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._getHierarchy()}get positions(){return this._positions}_getHierarchy(){let e=y.parsePolygonCoordToArray(this._positions)[0],t=e[0],r=e[1];x.isClockWise(e[0],e[1],e[2])&&(t=e[1],r=e[0]);let o=[x.mid(t,r)].concat(e.slice(2)),n=this._getArrowHeadPoints(o,t,r),l=n[0],h=n[4],c=x.distance(t,r),p=x.getBaseLength(o),u=p*this.tailWidthFactor*this.swallowTailFactor,g=x.getThirdPoint(o[1],o[0],0,u,!0),_=c/p,d=this._getArrowBodyPoints(o,l,h,_),T=d.length,w=[t].concat(d.slice(0,T/2));w.push(l);let P=[r].concat(d.slice(T/2,T));return P.push(h),w=x.getQBSplinePoints(w),P=x.getQBSplinePoints(P),new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(w.concat(n,P.reverse(),[g,w[0]]))))}};v.registerType("tailed_attack_arrow");var Ht=Us;var Bs=class extends v{constructor(e,t){super(),this._position=y.parsePosition(e),this._icon=t,this._size=[32,32],this._delegate={position:void 0,image:void 0,width:0,height:0},this._state=m.INITIALIZED}get type(){return v.getOverlayType("billboard_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}set icon(e){this._icon=e,this._delegate.image=this._icon}get icon(){return this._icon}set size(e){if(!Array.isArray(e))throw new Error("Billboard Primitive: the size invalid");this._size=e,this._delegate.width=this._size[0]||32,this._delegate.height=this._size[1]||32}get size(){return this._size}_mountedHook(){this.position=this._position,this.icon=this._icon,this.size=this._size}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.position&&delete e.image&&delete e.width&&delete e.height,C.merge(this._style,e),C.merge(this._delegate,e),this)}};v.registerType("billboard_primitive");var Wt=Bs;var Ch={maxOffsetY:10,offsetAmount:.1},Vs=class extends Wt{constructor(e,t){super(e,t),this._currentOffset=new i.Cartesian2(0,0),this._isUp=!0,this._state=m.INITIALIZED}get type(){return v.getOverlayType("bounce_billboard_primitive")}update(e){var s,o;if(!this._show)return;let t=((s=this._style)==null?void 0:s.maxOffsetY)||Ch.maxOffsetY,r=((o=this._style)==null?void 0:o.offsetAmount)||Ch.offsetAmount;this._currentOffset.y>=0?this._isUp=!0:this._currentOffset.y<=-t&&(this._isUp=!1),this._currentOffset.y+=r*(this._isUp?-1:1),this._delegate.pixelOffset=this._currentOffset}destroy(){return i.destroyObject(this)}};v.registerType("bounce_billboard_primitive");var xh=Vs;var js=class extends v{constructor(e,t){super(),this._position=y.parsePosition(e),this._text=t,this._delegate={position:void 0,text:void 0},this._state=m.INITIALIZED}get type(){return v.getOverlayType("label_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}set text(e){this._text=e,this._delegate.text=this._text}get text(){return this._text}_mountedHook(){this.position=this._position,this.text=this._text}setLabel(e,t){return this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.position&&delete e.text,C.merge(this._style,e),C.merge(this._delegate,e),this)}};v.registerType("label_primitive");var Gt=js;var Th={maxOffsetY:10,offsetAmount:.1},qs=class extends Gt{constructor(e,t){super(e,t),this._currentOffset=new i.Cartesian2(0,0),this._isUp=!0,this._state=m.INITIALIZED}get type(){return v.getOverlayType("bounce_label_primitive")}update(e){var s,o;if(!this._show)return;let t=((s=this._style)==null?void 0:s.maxOffsetY)||Th.maxOffsetY,r=((o=this._style)==null?void 0:o.offsetAmount)||Th.offsetAmount;this._currentOffset.y>=0?this._isUp=!0:this._currentOffset.y<=-t&&(this._isUp=!1),this._currentOffset.y+=r*(this._isUp?-1:1),this._delegate.pixelOffset=this._currentOffset}destroy(){return i.destroyObject(this)}};v.registerType("bounce_label_primitive");var Eh=qs;var Zs=class extends v{constructor(e){super(),this._position=y.parsePosition(e),this._delegate={position:void 0,scale:{x:12,y:8}},this._state=m.INITIALIZED}get type(){return v.getOverlayType("cloud_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}_mountedHook(){this.position=this._position}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.position,C.merge(this._style,e),C.merge(this._delegate,e),this)}};v.registerType("cloud_primitive");var Ph=Zs;var hy={minRadius:10,minHeight:30,color:i.Color.RED,slices:128,speed:10},Ys=class extends v{constructor(e,t,r){super(),this._center=y.parsePosition(e),this._delegate=void 0,this._height=r,this._radius=t,this._currentHeight=r||0,this._currentRadius=10,this._style={...hy},this._state=m.INITIALIZED}get type(){return v.getOverlayType("diffuse_wall_primitive")}set center(e){this._center=y.parsePosition(e)}get center(){return this._center}set radius(e){this._radius=e}get radius(){return this._radius}set height(e){this._height=e}get height(){return this._height}_getPositions(){let e=[],t=i.Transforms.eastNorthUpToFixedFrame(f.transformWGS84ToCartesian(this._center));for(let r=0;r<this._style.slices;r++){let s=r/this._style.slices*i.Math.TWO_PI,o=Math.cos(s),n=Math.sin(s),l=new i.Cartesian3(o*this._currentRadius,n*this._currentRadius,0);e.push(i.Matrix4.multiplyByPoint(t,l,new i.Cartesian3))}return e.push(e[0]),e}_getHeights(e,t){let r=[];for(let s=0;s<e;s++)r.push(t);return r}update(e){var s;if(this._delegate=this._delegate&&this._delegate.destroy(),this._currentRadius+=this._radius/this._style.speed/20,this._currentHeight-=this._height/this._style.speed/20,(this._currentRadius>this._radius||this._currentHeight<this._style.minHeight)&&(this._currentRadius=this._style.minRadius,this._currentHeight=this._height),!this._style.slices||this._style.slices<3)return!1;let t=this._getPositions();if(!t||!t.length)return!1;let r=new i.WallGeometry({positions:t,minimumHeights:this._getHeights(t.length,0),maximumHeights:this._getHeights(t.length,this._currentHeight)});this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:r}),appearance:new i.MaterialAppearance({material:i.Material.fromType("WallDiffuse",{color:(s=this._style)==null?void 0:s.color}),flat:!0}),asynchronous:!1}),this._delegate.update(e)}setStyle(e){return!e||Object.keys(e).length===0?this:(C.merge(this._style,e),this)}destroy(){return i.destroyObject(this)}};v.registerType("diffuse_wall_primitive");var bh=Ys;var Xs=class extends v{constructor(e,t){super(),this._position=y.parsePosition(e),this._radius=t||{x:10,y:10,z:10},this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("elec_ellipsoid_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.geometryInstances.modelMatrix=i.Transforms.eastNorthUpToFixedFrame(f.transformWGS84ToCartesian(this._position))}get position(){return this._position}set radius(e){this._radius=e,this._delegate.geometryInstances.geometry=new i.EllipsoidGeometry({radii:this._radius,maximumCone:i.Math.PI_OVER_TWO})}get radius(){return this._radius}_setAppearance(){var e,t;this._style&&(this._delegate.appearance=new i.MaterialAppearance({material:i.Material.fromType("EllipsoidElectric",{color:((e=this._style)==null?void 0:e.color)||i.Color.GREEN,speed:((t=this._style)==null?void 0:t.speed)||5})}))}_mountedHook(){this.radius=this._radius,this.position=this._position,!this._delegate.appearance&&this._setAppearance()}setLabel(e,t){return this}setStyle(e={}){return Object.keys(e).length===0?this:(C.merge(this._style,e),this._setAppearance(),this)}};v.registerType("elec_ellipsoid_primitive");var Ah=Xs;var Js=class extends v{constructor(e,t=1){super(),this._positions=y.parsePositions(e),this._width=t,this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("flow_line_primitive")}set positions(e){this._positions=y.parsePositions(e),this._delegate.geometryInstances.geometry=new i.PolylineGeometry({positions:f.transformWGS84ArrayToCartesianArray(this._positions),width:this._width})}get positions(){return this._positions}_setAppearance(){var e,t,r,s;this._delegate.appearance=new i.PolylineMaterialAppearance({material:i.Material.fromType("PolylineFlow",{color:((e=this._style)==null?void 0:e.color)||new i.Color(1,0,0,.7),speed:((t=this._style)==null?void 0:t.speed)||1,percent:((r=this._style)==null?void 0:r.percent)||.03,gradient:((s=this._style)==null?void 0:s.gradient)||.1})})}_mountedHook(){this.positions=this._positions,!this._delegate.appearance&&this._setAppearance()}setLabel(e,t){return this}setStyle(e={}){return Object.keys(e).length===0?this:(C.merge(this._style,e),e.classificationType&&(this._delegate.classificationType=this._style.classificationType),this._setAppearance(),this)}};v.registerType("flow_line_primitive");var Mh=Js;var Ih="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAEACAYAAADSoXR2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2M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a87wwiKQe6eT27AEX6esPVVd8/kOOdAz/oz9FE0p+uGIKUeqE5C8xgSKiICEIAABCAAAQhAAAIQgAAEIAABCECA6AA+sbkREyDUUYlKD6ggZwzRkr8tewBhusisv+0in5qE/hFchoZTE0TL4p8sTbtIpyahQ4Ag5fKpSVBmfdDECvQTZjoM0U9N6KgkwH9xY7PXpPiCmq5yuaLVldHIO7jgNi5XfOEhCqNh9udHV/RnC5YAUDTftdV4/ivvwEoRVS9XXPWa1FIT5ird8jpSB+BDN3rO8AaGMnGy0I0QRYTvdk6NkOsucuhGCMAgI8Q0isaHbmAevNMhiD4P6iZhstANGiQE2PEGCRo2NcgAsQDwKnxWFdlT17/duWU1BJmuHz6A5bwbEsCScgh+qAHit3Jr1oooOPExdRBLbeJjSpuwuy30AAH+CDAAPH5ltESNYl4AAAAASUVORK5CYII=";var cy={color:i.Color.ORANGE},Ks=class extends v{constructor(e,t,r,s){super(),this._center=y.parsePosition(e),this._length=t||100,this._topRadius=r||1,this._bottomRadius=s||50,this._delegate=new i.PrimitiveCollection,this._style={...cy},this._state=m.INITIALIZED}get type(){return v.getOverlayType("light-cylinder-primitive")}set center(e){this._center=y.parsePosition(e),this._updatePrimitives()}get center(){return this._center}set length(e){this._length=e,this._updatePrimitives()}get length(){return this._length}set topRadius(e){this._topRadius=e,this._updatePrimitives()}get topRadius(){return this._topRadius}set bottomRadius(e){this._bottomRadius=e,this._updatePrimitives()}get bottomRadius(){return this._bottomRadius}_computeEllipsePositions(e,t){let r=i.EllipseGeometryLibrary.computeEllipsePositions({center:f.transformWGS84ToCartesian(e),semiMajorAxis:t,semiMinorAxis:t,rotation:0,granularity:.005},!1,!0),s=i.Cartesian3.unpackArray(r.outerPositions);return s.push(s[0]),s}_createCylinderInstance(e,t,r){let s=t.slice(),o=t.length,n=2*o,l=[],h=1/(o-1),c=[],p=[],u=(_,d=0)=>{let T=i.Cartographic.fromCartesian(_);return T.height+=d,i.Cartographic.toCartesian(T)};for(let _=0;_<o;_++){p.push(u(e[_],r)),l.push(_*h,0);let d=_+1,T=(_+1)%o,w=n-d;c.push(w-1,w,_),c.push(_,T,w-1)}for(let _ in p)s.push(p[o-_-1]),l.push(1-_*h,1);let g=i.PolygonGeometry.createGeometry(new i.PolygonGeometry({polygonHierarchy:new i.PolygonHierarchy(s),perPositionHeight:!0}));return g.indices=c,g.attributes.st.values=l,new i.GeometryInstance({geometry:g})}_getCircleImage(){let e=document.createElement("canvas");e.width=512,e.height=512;let t=e.getContext("2d");return t.fillStyle="rgba(255,255,255,0)",t.strokeStyle="rgba(255, 255, 255,255)",t.setLineDash([50,50]),t.lineWidth=30,t.beginPath(),t.arc(256,256,150,0,Math.PI*2,!0),t.stroke(),t.restore(),e}_getParticlesImage(e){let t=document.createElement("canvas");t.width=64,t.height=256;let r=t.getContext("2d");return r.clearRect(0,0,64,256),r.drawImage(e,0,0),r.drawImage(e,33,0),t}_updatePrimitives(){this._delegate.removeAll();let e=this._center.alt===0,t=this._computeEllipsePositions(this._center,this._topRadius),r=this._computeEllipsePositions(this._center,this._bottomRadius*.7),s=this._computeEllipsePositions(this._center,this._bottomRadius),o={geometryInstances:new i.GeometryInstance({geometry:new i.PolygonGeometry({polygonHierarchy:new i.PolygonHierarchy(this._computeEllipsePositions(this._center,this._bottomRadius*2)),perPositionHeight:!e}),asynchronous:!1})},n=e?new i.GroundPrimitive(o):new i.Primitive(o);n.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType(i.Material.CircleRingType,{color:this._style.color})});let l=e?new i.GroundPrimitive(o):new i.Primitive(o);l.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType(i.Material.CircleRotateType,{color:this._style.color,image:this._getCircleImage()})});let h=new i.Primitive({geometryInstances:this._createCylinderInstance(t,r,this._length),appearance:new i.EllipsoidSurfaceAppearance({material:i.Material.fromType(i.Material.CylinderFadeType,{color:this._style.color})}),asynchronous:!1});e?i.GroundPrimitive.initializeTerrainHeights().then(()=>{this._delegate.add(n),this._delegate.add(l),this._delegate.add(h)}):(this._delegate.add(n),this._delegate.add(l),this._delegate.add(h)),i.Resource.fetchImage({url:Ih}).then(c=>{let p=new i.Primitive({geometryInstances:this._createCylinderInstance(t,s,this._length),appearance:new i.EllipsoidSurfaceAppearance({material:i.Material.fromType(i.Material.CylinderParticlesType,{color:this._style.color,image:this._getParticlesImage(c)})}),asynchronous:!1});this._delegate.add(p)})}_mountedHook(){this.center=this._center}update(e){this._delegate.update(e)}setStyle(e){return!e||Object.keys(e).length===0?this:(C.merge(this._style,e),this)}destroy(){return i.destroyObject(this)}};v.registerType("light-cylinder-primitive");var Sh=Ks;var Qs=class extends v{constructor(e,t){super(),this._position=y.parsePosition(e),this._modelUrl=t,this._delegate=i.Model.fromGltfAsync({url:t}),this._modelEvent=new yr(this._delegate),this._state=m.INITIALIZED}get type(){return v.getOverlayType("model_primitive")}set position(e){this._position=y.parsePosition(e);let t=f.transformWGS84ToCartesian(this._position);this._delegate.then(r=>{r.modelMatrix=i.Transforms.headingPitchRollToFixedFrame(t,new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))})}get position(){return this._position}set modelUrl(e){this._modelUrl=e,this._delegate=i.Model.fromGltfAsync({url:e,...this._style}),this.position=this._position}get modelUrl(){return this._modelUrl}_mountedHook(){this.position=this._position}setStyle(e){return!e||Object.keys(e).length===0?this:(C.merge(this._style,e),this._delegate.then(t=>{C.merge(t,e)}),this)}on(e,t,r){return this._overlayEvent.on(e,t,r||this),this._modelEvent.on(e,t,r||this),this}off(e,t,r){return this._overlayEvent.off(e,t,r||this),this._modelEvent.off(e,t,r||this),this}};v.registerType("model_primitive");var Dh=Qs;var Lh={pixelSize:8,outlineColor:i.Color.BLUE,outlineWidth:2},$s=class extends v{constructor(e){super(),this._position=y.parsePosition(e),this._delegate={position:void 0},this._state=m.INITIALIZED}get type(){return v.getOverlayType("point_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}_mountedHook(){this.position=this._position,C.merge(this._delegate,Lh,this._style)}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.position,C.merge(this._style,e),C.merge(this._delegate,Lh,this._style),this)}};v.registerType("point_primitive");var Rh=$s;var eo=class extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate={positions:[]},this._state=m.INITIALIZED}get type(){return v.getOverlayType("polyline_primitive")}set positions(e){this._positions=y.parsePositions(e),this._delegate.positions=f.transformWGS84ArrayToCartesianArray(this._positions)}get positions(){return this._positions}get center(){return ye(this._positions)}get distance(){return ie(this._positions)}_mountedHook(){this.positions=this._positions}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate,e),this)}};v.registerType("polyline_primitive");var Oh=eo;var to=class extends v{constructor(e,t){super(),this._position=y.parsePosition(e),this._radius=t,this._delegate=new i.GroundPrimitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("scan_circle_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.geometryInstances.geometry=new i.EllipseGeometry({center:f.transformWGS84ToCartesian(this._position),semiMajorAxis:this._radius,semiMinorAxis:this._radius})}get position(){return this._position}set radius(e){this._radius=e,this._delegate.geometryInstances.geometry.semiMajorAxis=this._radius,this._delegate.geometryInstances.geometry.semiMinorAxis=this._radius}get radius(){return this._radius}_setAppearance(){var e,t;this._style&&(this._delegate.appearance=new i.MaterialAppearance({material:i.Material.fromType("CircleScan",{color:((e=this._style)==null?void 0:e.color)||i.Color.WHITE,speed:((t=this._style)==null?void 0:t.speed)||10})}))}_mountedHook(){this.position=this._position,!this._delegate.appearance&&this._setAppearance()}setStyle(e={}){return Object.keys(e).length===0?this:(C.merge(this._style,e),e.classificationType&&(this._delegate.classificationType=this._style.classificationType),this._setAppearance(),this)}};v.registerType("scan_circle_primitive");var kh=to;var io=class extends v{constructor(e,t=1){super(),this._positions=y.parsePositions(e),this._width=t,this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("trail_line_primitive")}set positions(e){this._positions=y.parsePositions(e),this._delegate.geometryInstances.geometry=new i.PolylineGeometry({positions:f.transformWGS84ArrayToCartesianArray(this._positions),width:this._width})}get positions(){return this._positions}_setAppearance(){var e,t;this._delegate.appearance=new i.PolylineMaterialAppearance({material:i.Material.fromType("PolylineTrail",{color:((e=this._style)==null?void 0:e.color)||new i.Color(1,0,0,.7),speed:((t=this._style)==null?void 0:t.speed)||5})})}_mountedHook(){this.positions=this._positions,!this._delegate.appearance&&this._setAppearance()}setStyle(e={}){return Object.keys(e).length===0?this:(C.merge(this._style,e),e.classificationType&&(this._delegate.classificationType=this._style.classificationType),this._setAppearance(),this)}};v.registerType("trail_line_primitive");var Fh=io;var ro=class extends v{constructor(e,t){super(),this._positions=y.parsePositions(e),this._delegate=new i.GroundPrimitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._video=t,this._state=m.INITIALIZED}get type(){return v.getOverlayType("video_primitive")}set positions(e){var t,r,s,o;this._positions=y.parsePositions(e),this._delegate.geometryInstances.geometry=i.PolygonGeometry.fromPositions({positions:f.transformWGS84ArrayToCartesianArray(this._positions),height:(t=this._style)==null?void 0:t.height,extrudedHeight:(r=this._style)==null?void 0:r.extrudedHeight,closeTop:(s=this._style)==null?void 0:s.closeTop,closeBottom:(o=this._style)==null?void 0:o.closeBottom,vertexFormat:i.EllipsoidSurfaceAppearance.VERTEX_FORMAT})}get positions(){return this._positions}set video(e){this._video=e,this._setAppearance()}get video(){return this._video}_setAppearance(){this._delegate.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType("Image",{image:this._video})})}_mountedHook(){this.positions=this._positions,this.video=this._video}setStyle(e){var t;return Object.keys(e).length===0?this:(C.merge(this._style,e),(t=this._style)!=null&&t.classificationType&&(this._delegate.classificationType=this._style.classificationType),this)}};v.registerType("video_primitive");var zh=ro;var zm=hg(Fm(),1),Mo=class extends v{constructor(e,t,r){super(),this._viewer=e,this._horizontalViewAngle=t.horizontalViewAngle||60,this._verticalViewAngle=t.verticalViewAngle||40,this._viewPosition=t.viewPosition,this._viewPositionEnd=t.viewPositionEnd,this._viewDistance=null,this._lightCamera=null,this._viewHeading=null,this._viewPitch=null,this._orientation=null,this._outLinePrimitive=null,this._outline=!1,this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._video=r,this._init(),this._state=m.INITIALIZED}get type(){return v.getOverlayType("video_primitive")}set positions(e){this._createGeometry()}get positions(){return this._positions}set video(e){this._video=e,this._setAppearance()}get video(){return this._video}set outline(e){this._outline=e,this._outLinePrimitive.show=e}get outline(){return this._outline}_init(){this._viewDistance=i.Cartesian3.distance(this._viewPosition,this._viewPositionEnd),this._viewHeading=this._getHeading(this._viewPosition,this._viewPositionEnd),this._viewPitch=this._getPitch(this._viewPosition,this._viewPositionEnd),this._createLightCamera()}_createLightCamera(){this._lightCamera=new i.Camera(this._viewer.scene),this._lightCamera.position=this._viewPosition,this._lightCamera.frustum.near=this._viewDistance*1e-4,this._lightCamera.frustum.far=this._viewDistance;let e=i.Math.toRadians(this._horizontalViewAngle),t=i.Math.toRadians(this._verticalViewAngle),r=this._viewDistance*Math.tan(e/2)*2/(this._viewDistance*Math.tan(t/2)*2);this._lightCamera.frustum.aspectRatio=r,e>t?this._lightCamera.frustum.fov=e:this._lightCamera.frustum.fov=t,this._lightCamera.setView({destination:this._viewPosition,orientation:{heading:i.Math.toRadians(this._viewHeading||0),pitch:i.Math.toRadians(this._viewPitch||0),roll:0}})}_createGeometry(){let e=new i.Cartesian3,t=new i.Matrix3,r=new i.Quaternion,s=this._lightCamera.directionWC,o=this._lightCamera.upWC,n=this._lightCamera.rightWC;n=i.Cartesian3.negate(n,e);let l=t;i.Matrix3.setColumn(l,0,n,l),i.Matrix3.setColumn(l,1,o,l),i.Matrix3.setColumn(l,2,s,l),this._orientation=i.Quaternion.fromRotationMatrix(l,r);let h=(0,zm.default)(this._lightCamera.frustum);h.near=h.far-.01,this._delegate.geometryInstances.geometry=new i.FrustumGeometry({frustum:h,origin:this._viewPosition,orientation:this._orientation}),this._setOutlineGeometry()}_setAppearance(){this._delegate.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType("Image",{image:this._video})})}_mountedHook(){this.positions=this._positions,this.video=this._video}setStyle(e){var t;return Object.keys(e).length===0?this:(C.merge(this._style,e),(t=this._style)!=null&&t.classificationType&&(this._delegate.classificationType=this._style.classificationType),this)}_getHeading(e,t){let r=new i.Cartesian3,s=i.Transforms.eastNorthUpToFixedFrame(e);return i.Matrix4.inverse(s,s),i.Matrix4.multiplyByPoint(s,t,r),i.Cartesian3.normalize(r,r),i.Math.toDegrees(Math.atan2(r.x,r.y))}_getPitch(e,t){let r=new i.Cartesian3,s=i.Transforms.eastNorthUpToFixedFrame(e);return i.Matrix4.inverse(s,s),i.Matrix4.multiplyByPoint(s,t,r),i.Cartesian3.normalize(r,r),i.Math.toDegrees(Math.asin(r.z))}_setOutlineGeometry(e=""){let t=new i.GeometryInstance({geometry:new i.FrustumOutlineGeometry({frustum:this._lightCamera.frustum,origin:this._viewPosition,orientation:this._orientation}),attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(e?i.Color.fromCssColorString(e):i.Color.BLUE)}});this._outLinePrimitive=new i.Primitive({geometryInstances:[t],appearance:new i.PerInstanceColorAppearance({flat:!0})}),this._outLinePrimitive.show=this._outline,this._viewer.scene.primitives.add(this._outLinePrimitive)}};v.registerType("video_projection_primitive");var Nm=Mo;var Io=class extends v{constructor(e,t=[]){super(),this._positions=y.parsePositions(e),this._holes=t.map(r=>y.parsePositions(r)),this._delegate=new i.GroundPrimitive({geometryInstances:new i.GeometryInstance({geometry:{}}),asynchronous:!0}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("water_primitive")}set positions(e){var t,r,s,o;this._positions=y.parsePositions(e),this._delegate.geometryInstances.geometry=new i.PolygonGeometry({polygonHierarchy:new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(this._positions),this._holes.map(n=>new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(n)))),height:(t=this._style)==null?void 0:t.height,extrudedHeight:(r=this._style)==null?void 0:r.extrudedHeight,closeTop:(s=this._style)==null?void 0:s.closeTop,closeBottom:(o=this._style)==null?void 0:o.closeBottom,vertexFormat:i.EllipsoidSurfaceAppearance.VERTEX_FORMAT})}get positions(){return this._positions}_setAppearance(){var e,t,r,s,o,n,l,h;this._style&&(this._delegate.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType("Water",{baseWaterColor:((e=this._style)==null?void 0:e.baseWaterColor)||new i.Color(.2,.3,.6,1),blendColor:((t=this._style)==null?void 0:t.blendColor)||new i.Color(0,1,.699,1),specularMap:((r=this._style)==null?void 0:r.specularMap)||i.Material.DefaultImageId,normalMap:((s=this._style)==null?void 0:s.normalMap)||i.Material.DefaultImageId,frequency:((o=this._style)==null?void 0:o.frequency)||1e3,animationSpeed:((n=this._style)==null?void 0:n.animationSpeed)||.01,amplitude:((l=this._style)==null?void 0:l.amplitude)||10,specularIntensity:((h=this._style)==null?void 0:h.specularIntensity)||.5})}))}_mountedHook(){this.positions=this._positions,!this._delegate.appearance&&this._setAppearance()}setStyle(e){var t;return Object.keys(e).length===0?this:(C.merge(this._style,e),(t=this._style)!=null&&t.classificationType&&(this._delegate.classificationType=this._style.classificationType),this._setAppearance(),this)}};v.registerType("water_primitive");var Hm=Io;var So=class a extends v{constructor(e,t){super(),this._delegate=new i.Entity({billboard:{}}),this._position=y.parsePosition(e),this._icon=t,this._size=[32,32],this._state=m.INITIALIZED}get type(){return v.getOverlayType("billboard")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}set icon(e){this._icon=e,this._delegate.billboard.image=this._icon}get icon(){return this._icon}set size(e){if(!Array.isArray(e))throw new Error("Billboard: the size invalid");this._size=e,this._delegate.billboard.width=this._size[0]||32,this._delegate.billboard.height=this._size[1]||32}get size(){return this._size}_mountedHook(){this.position=this._position,this.icon=this._icon,this.size=this._size}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.image&&delete e.width&&delete e.height,C.merge(this._style,e),C.merge(this._delegate.billboard,e),this)}static fromEntity(e){var o;let t,r=i.JulianDate.now(),s=f.transformCartesianToWGS84(e.position.getValue(r));return e.billboard&&(t=new a(s,e.billboard.image.getValue(r)),t.attr={...(o=e==null?void 0:e.properties)==null?void 0:o.getValue(r)}),t}};v.registerType("billboard");var Me=So;var Do=class extends v{constructor(e,t,r,s){super(),this._position=y.parsePosition(e),this._length=t,this._width=r,this._height=s,this._delegate=new i.Entity({box:{dimensions:{x:+this._length,y:+this._width,z:+this._height}}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("box")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position),this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))}get position(){return this._position}set length(e){let t=this._delegate.box.dimensions.getValue();this._length=e||0,t.x=+this._length,this._delegate.box.dimensions.setValue(t)}get length(){return this._length}set width(e){let t=this._delegate.box.dimensions.getValue();this._width=e||0,t.y=+this._width,this._delegate.box.dimensions.setValue(t)}get width(){return this._width}set height(e){let t=this._delegate.box.dimensions.getValue();this._height=e||0,t.z=+this._height,this._delegate.box.dimensions.setValue(t)}get height(){return this._height}_mountedHook(){this.position=this._position}setStyle(e){return Object.keys(e).length===0?this:(delete e.length&&delete e.width&&delete e.height,C.merge(this._style,e),C.merge(this._delegate.box,e),this)}};v.registerType("box");var Wm=Do;var Lo=class extends v{constructor(e,t){super(),this._delegate=new i.Entity({ellipse:{}}),this._center=y.parsePosition(e),this._radius=+t||0,this._rotateAmount=0,this._stRotation=0,this._state=m.INITIALIZED}get type(){return v.getOverlayType("circle")}set center(e){this._center=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._center)}get center(){return this._center}set radius(e){this._radius=+e,this._delegate.ellipse.semiMajorAxis=this._radius,this._delegate.ellipse.semiMinorAxis=this._radius}get radius(){return this._radius}set rotateAmount(e){this._rotateAmount=+e,this._delegate.ellipse.stRotation=new i.CallbackProperty(()=>(this._stRotation+=this._rotateAmount,(this._stRotation>=360||this._stRotation<=-360)&&(this._stRotation=0),i.Math.toRadians(this._stRotation)),!1)}get rotateAmount(){return this._rotateAmount}_mountedHook(){this.center=this._center,this.radius=this._radius}setLabel(e,t){return this._delegate.position=f.transformWGS84ToCartesian(this._center),this._delegate.label={...t,text:e},this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.center,C.merge(this._style,e),C.merge(this._delegate.ellipse,e),this)}};v.registerType("circle");var ei=Lo;var Ro=class a extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({corridor:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("corridor")}set positions(e){this._positions=y.parsePositions(e),this._delegate.corridor.positions=f.transformWGS84ArrayToCartesianArray(this._positions)}get positions(){return this._positions}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.corridor,e),this)}static fromEntity(e){var s;let t,r=i.JulianDate.now();if(e.polyline){let o=f.transformCartesianArrayToWGS84Array(e.polyline.positions.getValue(r));t=new a(o),t.attr={...(s=e==null?void 0:e.properties)==null?void 0:s.getValue(r)}}return t}};v.registerType("corridor");var Gm=Ro;var Oo=class extends v{constructor(e,t,r,s){super(),this._position=y.parsePosition(e),this._length=+t||0,this._topRadius=+r||0,this._bottomRadius=+s||0,this._delegate=new i.Entity({cylinder:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("cylinder")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position),this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))}get position(){return this._position}set length(e){this._length=+e||0,this._delegate.cylinder.length=this._length}get length(){return this._length}set topRadius(e){this._topRadius=+e||0,this._delegate.cylinder.topRadius=this._topRadius}get topRadius(){return this._topRadius}set bottomRadius(e){this._bottomRadius=+e||0,this._delegate.cylinder.bottomRadius=this._bottomRadius}get bottomRadius(){return this._bottomRadius}_mountedHook(){this.position=this._position,this.length=this._length,this.topRadius=this._topRadius,this.bottomRadius=this._bottomRadius}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.length&&delete e.topRadius&&delete e.bottomRadius,C.merge(this._style,e),C.merge(this._delegate.cylinder,e),this)}};v.registerType("cylinder");var Um=Oo;var ko=class extends v{constructor(e,t,r){super(),this._position=y.parsePosition(e),this._semiMajorAxis=+t||0,this._semiMinorAxis=+r||0,this._delegate=new i.Entity({ellipse:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("ellipse")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position),this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))}get position(){return this._position}set semiMajorAxis(e){this._semiMajorAxis=+e||0,this._delegate.ellipse.semiMajorAxis=this._semiMajorAxis}get semiMajorAxis(){return this._semiMajorAxis}set semiMinorAxis(e){this._semiMinorAxis=+e||0,this._delegate.ellipse.semiMinorAxis=this._semiMinorAxis}get semiMinorAxis(){return this._semiMinorAxis}_mountedHook(){this.position=this._position,this.semiMajorAxis=this._semiMajorAxis,this.semiMinorAxis=this._semiMinorAxis}setStyle(e){return Object.keys(e).length===0?this:(delete e.semiMajorAxis&&delete e.semiMinorAxis,C.merge(this._style,e),C.merge(this._delegate.ellipse,e),this)}};v.registerType("ellipse");var Bm=ko;var Fo=class extends v{constructor(e,t){super(),this._position=y.parsePosition(e),this._radius=t||{x:10,y:10,z:10},this._delegate=new i.Entity({ellipsoid:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("sphere")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position),this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))}get position(){return this._position}set radius(e){this._radius=e||{x:10,y:10,z:10},this._delegate.ellipsoid.radii=this._radius}get radius(){return this._radius}_mountedHook(){this.position=this._position,this.radius=this._radius}setStyle(e){return Object.keys(e).length===0?this:(delete e.radius,C.merge(this._style,e),C.merge(this._delegate.ellipsoid,e),this)}};v.registerType("ellipsoid");var Vm=Fo;var zo=class a extends v{constructor(e,t){super(),this._delegate=new i.Entity({label:{}}),this._position=y.parsePosition(e),this._text=t,this._state=m.INITIALIZED}get type(){return v.getOverlayType("label")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}set text(e){this._text=e,this._delegate.label.text=this._text}get text(){return this._text}_mountedHook(){this.position=this._position,this.text=this._text}setLabel(e,t){return this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.text,C.merge(this._style,e),C.merge(this._delegate.label,e),this)}static fromEntity(e){var o;let t=i.JulianDate.now(),r=f.transformCartesianToWGS84(e.position.getValue(t)),s;return e.billboard&&(s=new a(r,e.name),s.attr={...(o=e==null?void 0:e.properties)==null?void 0:o.getValue(t)}),s}};v.registerType("label");var ti=zo;var No=class extends v{constructor(e,t,r,s={}){if(super(),this._position=y.parsePosition(e),this._width=+t||100,this._height=+r||100,s.normal&&typeof s.normal=="string"){let o=String(s.normal).toLocaleUpperCase();s.normal=o==="X"?i.Cartesian3.UNIT_X:o==="Y"?i.Cartesian3.UNIT_Y:i.Cartesian3.UNIT_Z}else s.normal=i.Cartesian3.UNIT_Z;this._normal=s.normal,this._distance=s.distance||0,this._delegate=new i.Entity({plane:{dimensions:{x:this._width,y:this._height},plane:new i.Plane(this._normal,this._distance)}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("plane")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position),this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))}get position(){return this._position}set width(e){let t=this._delegate.plane.dimensions.getValue();this._width=+e||0,t.x=this._width}get width(){return this._width}set height(e){let t=this._delegate.plane.dimensions.getValue();this._height=+e||0,t.y=this._height}get height(){return this._height}set distance(e){let t=this.entityGraphic.plane.getValue();this._distance=e,t.distance=e}get distance(){return this._distance}_mountedHook(){this.position=this._position,this.distance=this._distance}setStyle(e){return Object.keys(e).length===0?this:(delete e.dimensions&&delete["plane"],C.merge(this._style,e),C.merge(this._delegate.plane,e),this)}};v.registerType("plane");var jm=No;var qm={pixelSize:8,outlineColor:i.Color.BLUE,outlineWidth:2},Ho=class a extends v{constructor(e){super(),this._delegate=new i.Entity({point:{}}),this._position=y.parsePosition(e),this._state=m.INITIALIZED}get type(){return v.getOverlayType("point")}set position(e){this._position=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._position)}get position(){return this._position}_mountedHook(){this.position=this._position,C.merge(this._delegate.point,qm,this._style)}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.position,C.merge(this._style,e),C.merge(this._delegate.point,qm,this._style),this)}static fromEntity(e){var o;let t,r=i.JulianDate.now(),s=f.transformCartesianToWGS84(e.position.getValue(r));return t=new a(s),t.attr={...(o=e==null?void 0:e.properties)==null?void 0:o.getValue(r)},t}};v.registerType("point");var ii=Ho;var Wo=class a extends v{constructor(e){super(),this._delegate=new i.Entity({polygon:{}}),this._positions=y.parsePositions(e),this._holes=[],this._state=m.INITIALIZED}get type(){return v.getOverlayType("polygon")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._computeHierarchy()}get positions(){return this._positions}set holes(e){e&&e.length&&(this._holes=e.map(t=>y.parsePositions(t)),this._delegate.polygon.hierarchy=this._computeHierarchy())}get holes(){return this._holes}get center(){return ye([...this._positions,this._positions[0]])}get area(){return ge(this._positions)}_computeHierarchy(){let e=new i.PolygonHierarchy;return e.positions=f.transformWGS84ArrayToCartesianArray(this._positions),e.holes=this._holes.map(t=>new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(t))),e}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this._delegate.position=f.transformWGS84ToCartesian(this.center),this._delegate.label={text:e,...t},this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.polygon,e),this)}static fromEntity(e){var s;let t,r=i.JulianDate.now();if(e.polygon){let o=f.transformCartesianArrayToWGS84Array(e.polygon.hierarchy.getValue(r).positions);t=new a(o),t.attr={...(s=e==null?void 0:e.properties)==null?void 0:s.getValue(r)}}return t}};v.registerType("polygon");var Ie=Wo;var Go=class a extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({polyline:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("polyline")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polyline.positions=f.transformWGS84ArrayToCartesianArray(this._positions)}get positions(){return this._positions}get center(){return ye(this._positions)}get distance(){return ie(this._positions)}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this._delegate.position=f.transformWGS84ToCartesian(this.center),this._delegate.label={text:e,...t},this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.polyline,e),this)}static fromEntity(e){var s;let t,r=i.JulianDate.now();if(e.polyline){let o=f.transformCartesianArrayToWGS84Array(e.polyline.positions.getValue(r));t=new a(o),t.attr={...(s=e==null?void 0:e.properties)==null?void 0:s.getValue(r)}}return t}};v.registerType("polyline");var Se=Go;var Uo=class a extends v{constructor(e,t){super(),this._positions=y.parsePositions(e),this._shape=t||[],this._delegate=new i.Entity({polylineVolume:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("polyline_volume")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polylineVolume.positions=f.transformWGS84ArrayToCartesianArray(this._positions)}get positions(){return this._positions}set shape(e){this._shape=e||[],this._delegate.polylineVolume.shape=this._shape}get shape(){return this._shape}_mountedHook(){this.positions=this._positions,this.shape=this._shape}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions&&delete e.shape,C.merge(this._style,e),C.merge(this._delegate.polylineVolume,e),this)}static fromEntity(e,t){var o;let r,s=i.JulianDate.now();if(e.polyline){let n=f.transformCartesianArrayToWGS84Array(e.polyline.positions.getValue(s));r=new a(n,t),r.attr={...(o=e==null?void 0:e.properties)==null?void 0:o.getValue(s)}}return r}};v.registerType("polyline_volume");var Zm=Uo;var Bo=class extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({rectangle:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("rect")}set positions(e){this._positions=y.parsePositions(e),this._delegate.rectangle.coordinates=i.Rectangle.fromCartesianArray(f.transformWGS84ArrayToCartesianArray(this._positions))}get positions(){return this._positions}_mountedHook(){this.positions=this._positions}setLabel(e,t){let r=this._delegate.rectangle.coordinates.getValue();return this._delegate.position=i.Cartographic.toCartesian(i.Rectangle.center(r,new i.Cartographic)),this._delegate.label={...t,text:e},this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.rectangle,e),this)}};v.registerType("rect");var ri=Bo;var Vo=class a extends v{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({wall:{}}),this._state=m.INITIALIZED}get type(){return v.getOverlayType("wall")}set positions(e){this._positions=y.parsePositions(e),this._delegate.wall.positions=f.transformWGS84ArrayToCartesianArray(this._positions)}get positions(){return this._positions}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.wall,e),this)}static fromEntity(e){var s;let t,r=i.JulianDate.now();if(e.polyline){let o=f.transformCartesianArrayToWGS84Array(e.polyline.positions.getValue(r));t=new a(o),t.attr={...(s=e==null?void 0:e.properties)==null?void 0:s.getValue(r)}}return t}};v.registerType("wall");var Ym=Vo;var jo=class extends v{constructor(e,t,r){super(),this._viewer=e,this._delegate=new i.Entity({wall:{}}),this._center=y.parsePosition(t),this._radius=+r||0,this._heading=0,this._headingSpeed=1,this._rotateAmount=0,this._stRotation=0,this._state=m.INITIALIZED}get type(){return v.getOverlayType("volum_radar")}set center(e){this._center=y.parsePosition(e),this._delegate.position=f.transformWGS84ToCartesian(this._center),this.positionArr=this._calcPoints(this._center._lng,this._center._lat,this._radius,0),this._createWallAndEllipsoid(),this._addPostRender()}get center(){return this._center}set radius(e){this._radius=+e}get radius(){return this._radius}set headingSpeed(e){this._headingSpeed=e}get headingSpeed(){return this._headingSpeed}set rotateAmount(e){}get rotateAmount(){return this._rotateAmount}_createWallAndEllipsoid(){this._delegate.wall={positions:new i.CallbackProperty(()=>i.Cartesian3.fromDegreesArrayHeights(this.positionArr),!1),material:this._style.material||i.Color.fromCssColorString("#00dcff82"),distanceDisplayCondition:this._style.distanceDisplayCondition||new i.DistanceDisplayCondition(0,105e5)},this._delegate.ellipsoid={radii:new i.Cartesian3(this._radius,this._radius,this._radius),maximumCone:i.Math.toRadians(90),material:this._style.material||i.Color.fromCssColorString("#00dcff82"),outline:this._style.outline||!0,outlineColor:this._style.material||i.Color.fromCssColorString("#00dcff82"),outlineWidth:this._style.outlineWidth||1,stackPartitions:this._style.stackPartitions||40,slicePartitions:this._style.slicePartitions||40,distanceDisplayCondition:this._style.distanceDisplayCondition||new i.DistanceDisplayCondition(0,105e5)}}_addPostRender(){this.tickListener=this._viewer.clock.onTick.addEventListener(()=>{this._heading+=this._headingSpeed,this.positionArr=this._calcPoints(this._center._lng,this._center._lat,this._radius,this._heading)})}_calcPoints(e,t,r,s){let o=i.Transforms.eastNorthUpToFixedFrame(i.Cartesian3.fromDegrees(e,t)),n=r*Math.cos(s*Math.PI/180),l=r*Math.sin(s*Math.PI/180),h=i.Cartesian3.fromElements(n,l,0),c=i.Matrix4.multiplyByPoint(o,h,new i.Cartesian3),p=i.Cartographic.fromCartesian(c),u=i.Math.toDegrees(p.longitude),g=i.Math.toDegrees(p.latitude);return this._computeCirclularFlight(e,t,u,g,0,90)}_computeCirclularFlight(e,t,r,s,o,n){let l=[];l.push(e),l.push(t),l.push(0);let h=i.Cartesian3.distance(i.Cartesian3.fromDegrees(e,t),i.Cartesian3.fromDegrees(r,s));for(let c=o;c<=o+n;c++){let p=h*Math.sin(c*Math.PI/180),u=Math.cos(c*Math.PI/180),g=(r-e)*u+e,_=(s-t)*u+t;l.push(g),l.push(_),l.push(p)}return l}_computeHierarchy(){let e=new i.PolygonHierarchy,t=i.EllipseGeometryLibrary.computeEllipsePositions({center:f.transformWGS84ToCartesian(this._center),semiMajorAxis:this._radius,semiMinorAxis:this._radius,rotation:0,granularity:.005},!1,!0),r=i.Cartesian3.unpackArray(t.outerPositions);return r.push(r[0]),e.positions=r,e}_mountedHook(){this.center=this._center}setLabel(e,t){return this._delegate.position=f.transformWGS84ToCartesian(this._center),this._delegate.label={...t,text:e},this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.positions,C.merge(this._style,e),C.merge(this._delegate.wall,e),C.merge(this._delegate.ellipsoid,e),this)}};v.registerType("volum_radar");var Xm=jo;var qo=class extends A{constructor(e,t,r={}){if(!t)throw new Error("GeoJsonLayer\uFF1Athe url invalid");super(e),this._delegate=i.GeoJsonDataSource.load(t,r),this._state=m.INITIALIZED}get type(){return A.getLayerType("geojson")}set show(e){this._show=e,this._delegate&&this._delegate.then(t=>{t.show=this._show})}get show(){return this._show}_createBillboard(e){if(e.position&&e.billboard)return Me.fromEntity(e)}_createPolyline(e){if(e.polyline)return Se.fromEntity(e)}_createPolygon(e){if(e.polygon)return Ie.fromEntity(e)}_createModel(e,t){if(e)return Ge.fromEntity(e,t)}eachOverlay(e,t){if(this._delegate)return this._delegate.then(r=>{r.entities.values.forEach(o=>{e.call(t,o)})}),this}toVectorLayer(){let e=new ue(this.id);return this.eachOverlay(t=>{t.billboard?e.addOverlay(this._createBillboard(t)):t.polyline?e.addOverlay(this._createPolyline(t)):t.polygon&&e.addOverlay(this._createPolygon(t))},this),e}toModelLayer(e){let t=new ue(this.id);return this.eachOverlay(r=>{t.addOverlay(this._createModel(r,e))},this),t}};A.registerType("geojson");var si=qo;var Zo=class extends A{constructor(e,t,r={}){if(!t)throw new Error("GpxLayer: the url is empty");super(e),this._delegate=i.KmlDataSource.load(t,r),this._state=m.INITIALIZED}get type(){return A.getLayerType("gpx")}set show(e){this._show=e,this._delegate&&this._delegate.then(t=>{t.show=this._show})}get show(){return this._show}eachOverlay(e,t){if(this._delegate)return this._delegate.then(r=>{r.entities.values.forEach(o=>{e.call(t,o)})}),this}};A.registerType("gpx");var Jm=Zo;var kT={radialColor:i.Color.WHITE,radialWidth:2,showRadial:!0,LabelColor:i.Color.YELLOW,weftColor:i.Color.WHITE,weftWidth:2},Yo=class extends A{constructor(e,t){super(e),this._options={...kT,...t},this._delegate=new i.CustomDataSource(e),this._state=m.INITIALIZED}get type(){return A.getLayerType("graticule")}_addedHook(){for(let e=0;e<36;e++)this._delegate.entities.add({polyline:{positions:i.Cartesian3.fromDegreesArray([e*10,89.5,e*10,-89.5]),material:this._options.radialColor,width:this._options.radialWidth},show:this._options.showRadial}),this._delegate.entities.add({position:i.Cartesian3.fromDegrees(e*10,0),label:{text:e*10+"\xB0",font:"12px",fillColor:this._options.LabelColor}});for(let e=0;e<18;e++){let t=[];for(let r=0;r<129;r++)t.push(-180+r*(360/128),(e<9?e:-e)*10);this._delegate.entities.add({polyline:{positions:i.Cartesian3.fromDegreesArray(t),material:this._options.weftColor,width:this._options.weftWidth}})}}};A.registerType("graticule");var Km=Yo;var Xo=class extends A{constructor(e){super(e),this._delegate=new i.PrimitiveCollection,this._isGround=!0,this._state=m.INITIALIZED}get type(){return A.getLayerType("ground_primitive")}clear(){return this._delegate&&this._delegate.removeAll(),this._cache={},this._state=m.CLEARED,this}};A.registerType("ground_primitive");var Qm=Xo;var Jo=class extends A{constructor(e){super(e),this._delegate=I.create("div","html-layer",void 0),this._delegate.setAttribute("id",this._id),this._renderRemoveCallback=void 0,this._state=m.INITIALIZED}get type(){return A.getLayerType("html")}set show(e){this._show=e,this._delegate.style.visibility=this._show?"visible":"hidden",Object.keys(this._cache).forEach(t=>{this._cache[t].show=e})}get show(){return this._show}_onAdd(e){this._viewer=e,this._viewer.layerContainer.appendChild(this._delegate);let t=this._viewer.scene;this._renderRemoveCallback=t.postRender.addEventListener(()=>{let r=this._viewer.camera.positionWC,s=this._viewer.camera.direction,o=this._viewer.getOffset();this.eachOverlay(n=>{if(n&&n.position){let l=f.transformWGS84ToCartesian(n.position),h=t.globe.ellipsoid.geodeticSurfaceNormal(l,new i.Cartesian3),c=i.SceneTransforms.worldToWindowCoordinates(t,l);c&&(c.x+=o.x,c.y+=o.y),n._updateStyle(c,i.Cartesian3.distance(l,r),i.Cartesian3.dot(s,h)<=0)}},this)},this),this._state=m.ADDED}_onRemove(){this._renderRemoveCallback&&this._renderRemoveCallback(),this._viewer.layerContainer.removeChild(this._delegate),this._state=m.REMOVED}clear(){for(;this._delegate.hasChildNodes();)this._delegate.removeChild(this._delegate.firstChild);return this._cache={},this._state=m.CLEARED,this}};A.registerType("html");var $m=Jo;var Ko=class extends A{constructor(e){super(e),this._delegate=new i.PrimitiveCollection,this._state=m.INITIALIZED}get type(){return A.getLayerType("i3s")}clear(){return this._delegate.removeAll(),this._cache={},this._state=m.CLEARED,this}};A.registerType("i3s");var eu=Ko;var Qo=class extends A{constructor(e,t,r={}){if(!t)throw new Error("KmlLayer: the url is empty");super(e),this._delegate=i.KmlDataSource.load(t,r),this._state=m.INITIALIZED}get type(){return A.getLayerType("kml")}set show(e){this._show=e,this._delegate&&this._delegate.then(t=>{t.show=this._show})}get show(){return this._show}eachOverlay(e,t){if(this._delegate)return this._delegate.then(r=>{r.entities.values.forEach(o=>{e.call(t,o)})}),this}};A.registerType("kml");var tu=Qo;var $o=class extends A{constructor(e,t=""){super(e),this._dataSource=i.GeoJsonDataSource.load(t),this._delegate=new i.CustomDataSource(e),this._initLabel(),this._state=m.INITIALIZED}get type(){return A.getLayerType("label")}_createLabel(e){if(e.position&&e.name)return ti.fromEntity(e)}_initLabel(){this._dataSource.then(e=>{e.entities.values.forEach(r=>{let s=this._createLabel(r);this.addOverlay(s)})})}};A.registerType("label");var iu=$o;var ea=class extends A{constructor(e){super(e),this._delegate=new i.PrimitiveCollection,this._points=this._delegate.add(new i.PointPrimitiveCollection),this._labels=this._delegate.add(new i.LabelCollection),this._billboards=this._delegate.add(new i.BillboardCollection),this._polylines=this._delegate.add(new i.PolylineCollection),this._clouds=this._delegate.add(new i.CloudCollection),this._state=m.INITIALIZED}get type(){return A.getLayerType("primitive")}get points(){return this._points}get labels(){return this._labels}get billboards(){return this._billboards}get polylines(){return this._polylines}get clouds(){return this._clouds}clear(){return this._delegate&&this._delegate.removeAll(),this._points=this._delegate.add(new i.PointPrimitiveCollection),this._labels=this._delegate.add(new i.LabelCollection),this._billboards=this._delegate.add(new i.BillboardCollection),this._polylines=this._delegate.add(new i.PolylineCollection),this._clouds=this._delegate.add(new i.CloudCollection),this._cache={},this._state=m.CLEARED,this}};A.registerType("primitive");var ru=ea;var ta=class extends A{constructor(e,t,r){super(e),this._delegate=i.ImageryLayer.fromProviderAsync(t,r),this._state=m.INITIALIZED}get type(){return A.getLayerType("raster-tile")}};A.registerType("raster-tile");var su=ta;var ia=class extends A{constructor(e){super(e),this._delegate=new i.PrimitiveCollection,this._state=m.INITIALIZED}get type(){return A.getLayerType("tileset")}clear(){return this._delegate.removeAll(),this._cache={},this._state=m.CLEARED,this}};A.registerType("tileset");var ou=ia;si.registerType("topojson");var ra=class extends A{constructor(e,t,r={}){if(!t)throw"Shp2JsonLayer\uFF1Athe url invalid";if(!q("shpUtil"))throw"missing shpUtil";super(e);let o=this._init(t,r);this._delegate=i.GeoJsonDataSource.load(o,r),this._state=m.INITIALIZED}async _init(e,t){var s;return await shpUtil.toGeoJSON(e,void 0,(s=t.encoding)!=null?s:"gbk",t.crs)}get type(){return A.getLayerType("shp")}set show(e){this._show=e,this._delegate&&this._delegate.then(t=>{t.show=this._show})}get show(){return this._show}_createBillboard(e){if(e.position&&e.billboard)return Me.fromEntity(e)}_createPolyline(e){if(e.polyline)return Se.fromEntity(e)}_createPolygon(e){if(e.polygon)return Ie.fromEntity(e)}_createModel(e,t){if(e)return Ge.fromEntity(e,t)}eachOverlay(e,t){if(this._delegate)return this._delegate.then(r=>{r.entities.values.forEach(o=>{e.call(t,o)})}),this}toVectorLayer(){let e=new ue(this.id);return this.eachOverlay(t=>{t.billboard?e.addOverlay(this._createBillboard(t)):t.polyline?e.addOverlay(this._createPolyline(t)):t.polygon&&e.addOverlay(this._createPolygon(t))},this),e}toModelLayer(e){let t=new ue(this.id);return this.eachOverlay(r=>{t.addOverlay(this._createModel(r,e))},this),t}};A.registerType("shp");var au=ra;var lu=[].indexOf||function(a){for(let e=0,t=this.length;e<t;e++)if(e in this&&this[e]===a)return e;return-1},oi=`attribute vec4 position;
117
+ `,!0,"loading");this._wrapper.appendChild(e),this._ready=!0}};O.registerType("loading_mask");var yl=Pr;var br=class extends O{constructor(){super(),this._wrapper=M.create("div","widget slider"),this._tileset=void 0,this._moveActive=!1,this._state=_.INITIALIZED}get type(){return O.getWidgetType("tileset_split")}_installHook(){let e=this;Object.defineProperty(this._viewer,"tilesetSplit",{get(){return e}})}_bindEvent(){this._viewer.scene.splitPosition=.5,this._wrapper.style.left="50%"}_unbindEvent(){this._tileset?this._viewer.scene.splitPosition=this._tileset.splitDirection>0?1:0:this._viewer.scene.splitPosition=0}_mountContent(){let e=M.parseDom(ie.splitter,!0,"splitter");this._wrapper.appendChild(e);let t=new i.ScreenSpaceEventHandler(e),r=this;t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.PINCH_START),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.MOUSE_MOVE),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.PINCH_MOVE),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.LEFT_UP),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.PINCH_END),this._ready=!0}_moveHandler(e){if(!this._moveActive||!this._enable)return;let t=e.endPosition.x,r=(this._wrapper.offsetLeft+t)/this._wrapper.parentElement.offsetWidth;this._wrapper.style.left=100*r+"%",this._viewer.scene.splitPosition=r}addTileset(e){return!this._viewer||!this._enable?this:(e&&(this._tileset&&this._viewer.scene.primitives.remove(this._tileset),this._tileset=this._viewer.scene.primitives.add(e.delegate||e),this._viewer.scene.splitPosition=this._wrapper.offsetLeft/this._wrapper.parentElement.offsetWidth),this)}};O.registerType("tileset_split");var vl=br;var Sr=class extends O{constructor(){super(),this._wrapper=M.create("div","widget slider"),this._tileset=void 0,this._baseLayer=void 0,this._moveActive=!1,this._state=_.INITIALIZED}get type(){return O.getWidgetType("scene_split")}_installHook(){let e=this;Object.defineProperty(this._viewer,"sceneSplit",{get(){return e}})}_bindEvent(){this._viewer.scene.splitPosition=.5,this._wrapper.style.left="50%"}_unbindEvent(){this._viewer.scene.splitPosition=1}_mountContent(){let e=M.parseDom(ie.splitter,!0,"splitter");this._wrapper.appendChild(e);let t=new i.ScreenSpaceEventHandler(e),r=this;t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(()=>{r._moveActive=!0},i.ScreenSpaceEventType.PINCH_START),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.MOUSE_MOVE),t.setInputAction(s=>{r._moveHandler(s)},i.ScreenSpaceEventType.PINCH_MOVE),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.LEFT_UP),t.setInputAction(()=>{r._moveActive=!1},i.ScreenSpaceEventType.PINCH_END),this._ready=!0}_moveHandler(e){if(!this._moveActive||!this._enable)return;let t=e.endPosition.x,r=(this._wrapper.offsetLeft+t)/this._wrapper.parentElement.offsetWidth;this._wrapper.style.left=100*r+"%",this._viewer.scene.splitPosition=r}addTileset(e){return!this._viewer||!this._enable?this:(e&&(this._tileset&&this._viewer.scene.primitives.remove(this._tileset),Promise.resolve(e.delegate||e).then(t=>{this._tileset=this._viewer.scene.primitives.add(t)})),this)}addBaseLayer(e){return!this._viewer||!this._enable?this:(e&&(this._baseLayer&&this._viewer.imageryLayers.remove(this._baseLayer),Promise.resolve(e).then(t=>{this._baseLayer=this._viewer.imageryLayers.addImageryProvider(t),this._baseLayer.splitDirection=1})),this)}};O.registerType("scene_split");var wl=Sr;function Ar(){return{popup:new dl,contextMenu:new Qn,tooltip:new pl,mapSwitch:new cl,mapSplit:new hl,locationBar:new el,hawkeyeMap:new ml,compass:new ul,distanceLegend:new fl,zoomController:new gl,loadingMask:new yl,tilesetSplit:new vl,sceneSplit:new wl}}var Be="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsSAAALEgHS3X78AAACCklEQVQ4jWP8//8/Ax5gwMDAIACVfgDF2AHIIDSs8Of+8x3/vv/88ffFu++/jl75/evEte//vnz//e/Dl3d/nrye8P//fwF0fSicv28/Vv7/////t8W7/79Wi///gt0DBb9zLfv/89Cl/3/fff7w//9/A2S9cK/9//i1g4GZ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9KuiDZ0cGECI5sueakOnFjLGYCCqmNCzp2VoFflqr7PmBahasW+QTEwWfFtK8qjOWe35geJ0XxC5sWnf4Kp+rIxuHkFR7bKmH/+ZFiZDOnR0lnPmvASwIOe2F60l2MbnMPg69rd6e1fBJpKFa489ZQB5o2QKl5L53v/I4qz2WFHtqZb7DoG3iLC93DEYuXPImhdlKExwt6yoB59td/zfxzYuuHNV8OZ5SodlUUKI1rKqFd8DeLFrNYB/A6b1Qz9EzRMAAAAASUVORK5CYII=";var Km={icon_center:ft,icon_anchor:Be,icon_size:[12,12],clampToModel:!1,maxAnchorSize:999},Mr=class{constructor(){this._viewer=void 0,this._anchorLayer=new i.CustomDataSource("draw-anchor-layer"),this._floatingAnchor=void 0,this._options={},this._plotEvent=new st,this._tooltipMess=void 0}set tooltipMess(e){this._tooltipMess=e}_getEventPosition(e){return this._options.clampToModel&&e.position?e.position:e.surfacePosition}_onClick(e){let t=this._getEventPosition(e);if(!t)return!1;this._floatingAnchor||(this._floatingAnchor=this._onCreateAnchor({position:t})),this._plotEvent.fire(P.DRAW_ANCHOR,t)}_onMouseMove(e){this._viewer.tooltip.showAt(e.windowPosition,this._tooltipMess);let t=this._getEventPosition(e);if(!t)return!1;this._floatingAnchor&&this._floatingAnchor.position.setValue(t),this._plotEvent.fire(P.ANCHOR_MOVING,t)}_onRightClick(e){this._plotEvent.fire(P.DRAW_STOP,this._getEventPosition(e))}_onCreateAnchor({position:e,isCenter:t=!1}){var r;return this._anchorLayer.entities.add({position:e,billboard:{image:t?this._options.icon_center:this._options.icon_anchor,width:this._options.icon_size[0],height:this._options.icon_size[1],pixelOffset:this._options.pixelOffset||new i.Cartesian2(0,0),eyeOffset:this._options.eyeOffset||new i.Cartesian3(0,0,-100),disableDepthTestDistance:(r=this._options.disableDepthTestDistance)!=null?r:0,heightReference:this._viewer.scene.mode===i.SceneMode.SCENE3D&&!this._options.clampToModel?i.HeightReference.CLAMP_TO_GROUND:i.HeightReference.NONE}})}_onClearAnchor(){this._anchorLayer.entities.removeAll()}_bindEvent(){this._viewer.on(H.CLICK,this._onClick,this),this._viewer.on(H.MOUSE_MOVE,this._onMouseMove,this),this._viewer.on(H.RIGHT_CLICK,this._onRightClick,this),this._plotEvent.on(P.CREATE_ANCHOR,this._onCreateAnchor,this),this._plotEvent.on(P.CLEAR_ANCHOR,this._onClearAnchor,this)}_unbindEvent(){this._viewer.off(H.CLICK,this._onClick,this),this._viewer.off(H.MOUSE_MOVE,this._onMouseMove,this),this._viewer.off(H.RIGHT_CLICK,this._onRightClick,this),this._plotEvent.off(P.CREATE_ANCHOR,this._onCreateAnchor,this),this._plotEvent.off(P.CLEAR_ANCHOR,this._onClearAnchor,this)}on(e,t,r){return this._plotEvent.on(e,t,r||this),this}off(e,t,r){return this._plotEvent.off(e,t,r||this),this}fire(e,t={}){return this._plotEvent.fire(e,t),this}activate(e={}){return this._viewer.tooltip.enable=!0,this._options={...Km,...e},this._unbindEvent(),this._bindEvent(),this.fire(P.DRAW_START,this._options),this}deactivate(){return this._unbindEvent(),this._viewer.tooltip.enable=!1,this._anchorLayer.entities.removeAll(),this._floatingAnchor=void 0,this}install(e){this._viewer=e,this._viewer.dataSources.add(this._anchorLayer),Object.defineProperty(this._viewer,"drawTool",{value:this,writable:!1})}},Cl=Mr;var xl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsSAAALEgHS3X78AAACDElEQVQ4jWP8//8/Ax5gwMDAIACVfgDF2AHIIDSscO/l7x3ff/378fz9n++Hr//4fezmz+9ffvz7/eHr33eP3/6Z8P//fwF0fSguevv5X6UwL1PbwoNfGRrWfGJ48PoPiuUOWuwMDSH8DHryrB8FuZkcGBgYLsDk4AZ9/Pavg5mJscS24SXzhQe/8XmXocCLl6Etgv8XJxujOcwwmEEOX37830OMITCQYM/NMD1F8CcHK6MEAwPDByaQ+Ofv/9fUrvpItCEgsODgV4aTt3+xP3n3twHEBxlk8On7P/4J2z4TbQgMNKz5yCDCy5QBNujJu78Ja05+YyHZFAYGhgPXfjJ8+PoPFDYGTEyMDCYPXv8lxxwwuPnsDwcorTGxsTDyoEczOYDp4es/Fwzk2cg2gI2F8QeIZjJWYjtgoMBKliEC3EwMlmpsIK9dAMXaBn8TTgYFUdLDu8CTl+H2iz/nYenow8uPf+cvyBQiyRCQxcU+vH9VJViKGKDpiEGcn7lIW5b1MbGGgby0qVTk75vPf1eCUgFIDDnTCrz5/O/S1ce/ZROmv8PIsDAAyrhLcoT/MDIybJcSZPaDiaOXRwIvP/7tE+dnTtx45js4wV148Ass4aDFwRBkxvlXVZLlz4ev/4okBJinIWvEVbApvP38L/LT93/2vJxMoEzJ8OXHv6sKoiy7QdkMQzUDAwMAuq71NKWtMMgAAAAASUVORK5CYII=";var eu={icon_center:ft,icon_anchor:Be,icon_midAnchor:xl,icon_size:[12,12],clampToModel:!0},Ir=class{constructor(){this._viewer=void 0,this._anchorLayer=new i.CustomDataSource("edit-anchor-layer"),this._options={},this._plotEvent=new st,this._tooltipMess=void 0,this._pickedAnchor=void 0,this._isMoving=!1,this._anchors=[]}set tooltipMess(e){this._tooltipMess=e}_onClick(e){if(this._isMoving){let t=this._options.clampToModel&&e.position?e.position:e.surfacePosition;if(!t)return!1;this._pickedAnchor&&this._pickedAnchor.position&&this._pickedAnchor.properties&&(this._pickedAnchor.position.setValue(t),this._plotEvent.fire(P.EDIT_ANCHOR_STOP,{pickedAnchor:this._pickedAnchor,position:t})),this._isMoving=!1}else{if(!e.target||!e.target.id)return!1;this._pickedAnchor=e.target.id,this._isMoving=!0}}_onMouseMove(e){if(this._viewer.tooltip.showAt(e.windowPosition,this._tooltipMess),!this._isMoving&&this._anchors.length!==0)return!1;let t=this._options.clampToModel&&e.position?e.position:e.surfacePosition;if(!t)return!1;this._pickedAnchor&&this._pickedAnchor.position&&this._pickedAnchor.properties?(this._pickedAnchor.position.setValue(t),this._plotEvent.fire(P.ANCHOR_MOVING,{pickedAnchor:this._pickedAnchor,position:t})):this._anchors.length===0&&this._plotEvent.fire(P.ANCHOR_MOVING,{position:t})}_onRightClick(e){let t=this._options.clampToModel&&e.position?e.position:e.surfacePosition;this._plotEvent.fire(P.EDIT_STOP,{pickedAnchor:this._pickedAnchor,position:t})}_onCreateAnchor({position:e,index:t,isCenter:r=!1,isMid:s=!1}){var l;let o=s?this._options.icon_midAnchor:r?this._options.icon_center:this._options.icon_anchor,n=this._anchorLayer.entities.add({position:e,billboard:{image:o,width:this._options.icon_size[0],height:this._options.icon_size[1],pixelOffset:this._options.pixelOffset||new i.Cartesian2(0,0),eyeOffset:this._options.eyeOffset||new i.Cartesian3(0,0,-100),disableDepthTestDistance:(l=this._options.disableDepthTestDistance)!=null?l:0,heightReference:this._viewer.scene.mode===i.SceneMode.SCENE3D&&!this._options.clampToModel?i.HeightReference.CLAMP_TO_GROUND:i.HeightReference.NONE},properties:{isMid:s,index:t}});this._anchors.push(n)}_onUpdateAnchor({index:e,position:t}){this._anchors[e]&&this._anchors[e].position.setValue(t)}_onClearAnchor(){this._anchorLayer.entities.removeAll(),this._anchors=[]}_bindEvent(){this._viewer.on(H.CLICK,this._onClick,this),this._viewer.on(H.MOUSE_MOVE,this._onMouseMove,this),this._viewer.on(H.RIGHT_CLICK,this._onRightClick,this),this._plotEvent.on(P.CREATE_ANCHOR,this._onCreateAnchor,this),this._plotEvent.on(P.UPDATE_ANCHOR,this._onUpdateAnchor,this),this._plotEvent.on(P.CLEAR_ANCHOR,this._onClearAnchor,this)}_unbindEvent(){this._viewer.off(H.CLICK,this._onClick,this),this._viewer.off(H.MOUSE_MOVE,this._onMouseMove,this),this._viewer.off(H.RIGHT_CLICK,this._onRightClick,this),this._plotEvent.off(P.CREATE_ANCHOR,this._onCreateAnchor,this),this._plotEvent.off(P.UPDATE_ANCHOR,this._onUpdateAnchor,this),this._plotEvent.off(P.CLEAR_ANCHOR,this._onClearAnchor,this)}on(e,t,r){return this._plotEvent.on(e,t,r||this),this}off(e,t,r){return this._plotEvent.off(e,t,r||this),this}fire(e,t){return this._plotEvent.fire(e,t),this}activate(e={}){return this._anchorLayer.entities.removeAll(),this._anchors=[],this._viewer.tooltip.enable=!0,this._options={...eu,...e},this._unbindEvent(),this._bindEvent(),this.fire(P.EDIT_START,this._options),this}deactivate(){return this._unbindEvent(),this._viewer.tooltip.enable=!1,this._anchorLayer.entities.removeAll(),this._anchors=[],this}install(e){this._viewer=e,this._viewer.dataSources.add(this._anchorLayer),Object.defineProperty(this._viewer,"editTool",{value:this,writable:!1})}},Tl=Ir;function Lr(){return{drawTool:new Cl,editTool:new Tl}}var{ImageryLayer:tu}=i,Dr=class{constructor(e){if(!e.globe)throw new Error("globe is required");this._globe=e.globe,this._imageryLayers=[],this._selectedImageryLayer=void 0,this._count=0}set selectedImageryLayer(e){if((!e||!e.layers)&&new Error("imagery format error"),!(this._selectedImageryLayer&&e.id===this._selectedImageryLayer.id)){if(this._selectedImageryLayer&&e.id!==this._selectedImageryLayer.id){for(let t=0;t<this._selectedImageryLayer.cache.length;t++)this._globe.imageryLayers.remove(this._selectedImageryLayer.cache[t]);e.cache=[]}for(let t=e.layers.length-1;t>=0;t--){let r=e.layers[t],s=tu.fromProviderAsync(r,e.options);r&&this._globe.imageryLayers.add(s,0),e.cache.push(s)}this._selectedImageryLayer=e}}get selectedImageryLayer(){return this._selectedImageryLayer}addImageryLayer(e,t={}){let r=[];return Array.isArray(e)?r=e.slice(0):r=[e],this._count++,this._imageryLayers.push({id:`imagery-no-${this._count}`,layers:r,cache:[],options:t}),this}changeImageryLayer(e){if(e>this._imageryLayers.length-1)throw new Error("index error");return this.selectedImageryLayer=this._imageryLayers[e],this}},Rr=Dr;var{Math:iu,Matrix3:El,Matrix4:Or,SceneMode:Pl,SkyBox:ru,Transforms:su}=i,kr=class extends ru{constructor(e={}){super(e),this.offsetAngle=(e==null?void 0:e.offsetAngle)||0}update(e,t){if(!this.show||e.mode!==Pl.SCENE3D&&e.mode!==Pl.MORPHING||!e.passes.render)return;let r=this._panorama,s=su.eastNorthUpToFixedFrame(e.camera.positionWC);return this.offsetAngle!==0&&Or.multiply(s,Or.fromRotationTranslation(El.fromRotationZ(iu.toRadians(this.offsetAngle))),s),r.show=this.show,r._transform=Or.getMatrix3(s,r._transform||new El),r.update(e,t)}},bl=kr;var ou={creditContainer:document.createElement("div"),creditViewport:document.createElement("div"),baseLayer:!1,shouldAnimate:!0},Nr=class{constructor(e,t={}){if(__cmdOut&&__cmdOut(),!e||typeof e=="string"&&!document.getElementById(e))throw new Error("Viewer: the container is empty");if(e instanceof HTMLElement)throw new Error("Viewer: not support the type container");if(typeof e=="string"){let o=bi("baseUrl");o&&i.buildModuleUrl.setBaseUrl(o)}this._delegate=typeof e!="string"?e:new i.CesiumWidget(e,{...ou,...t}),this._delegate.canvas.parentNode.className="viewer-canvas",new Fi(this,t),this._viewerEvent=new zi,this._sceneEvent=new Gi(this),this._viewerOption=new hr(this),this._cameraOption=new dr(this),this._widgetContainer=M.create("div","viewer-widgets",typeof e=="string"?document.getElementById(e):this._delegate.container),this._layerContainer=M.create("div","viewer-layers",typeof e=="string"?document.getElementById(e):this._delegate.container),this._baseLayerPicker=new Rr({globe:this._delegate.scene.globe}),this._layerGroupCache={},this._layerCache={};let r=Ar();Object.keys(r).forEach(o=>{this._use(r[o])});let s=Lr();Object.keys(s).forEach(o=>{this._use(s[o])})}get delegate(){return this._delegate}get container(){return this._delegate.container}get widgetContainer(){return this._widgetContainer}get layerContainer(){return this._layerContainer}get scene(){return this._delegate.scene}get camera(){return this._delegate.camera}get canvas(){return this._delegate.scene.canvas}get dataSources(){return this._delegate.dataSources}get imageryLayers(){return this._delegate.imageryLayers}get terrainProvider(){return this._delegate.terrainProvider}get entities(){return this._delegate.entities}get postProcessStages(){return this._delegate.scene.postProcessStages}get clock(){return this._delegate.clock}get viewerEvent(){return this._viewerEvent}get cameraPosition(){var t,r,s,o,n,l,h;let e=g.transformCartographicToWGS84((t=this.camera)==null?void 0:t.positionCartographic);return e&&(e.heading=i.Math.toDegrees((s=(r=this.camera)==null?void 0:r.heading)!=null?s:0),e.pitch=i.Math.toDegrees((n=(o=this.camera)==null?void 0:o.pitch)!=null?n:0),e.roll=i.Math.toDegrees((h=(l=this.camera)==null?void 0:l.roll)!=null?h:0)),e}get resolution(){let e=this.scene.canvas.width,t=this.scene.canvas.height,r=g.transformWindowToWGS84(new i.Cartesian2(e/2|0,t-1),this),s=g.transformWindowToWGS84(new i.Cartesian2(1+e/2|0,t-1),this);return!r||!s?1:Math.abs(r.lng-s.lng)}get viewBounds(){let e=this.scene.canvas.width,t=this.scene.canvas.height,r=g.transformWindowToWGS84(new i.Cartesian2(0,t),this),s=g.transformWindowToWGS84(new i.Cartesian2(e,0),this);return!r||!s?i.Rectangle.MAX_VALUE:i.Rectangle.fromDegrees(r.lng,r.lat,s.lng,s.lat)}get zoom(){let e=this.camera.positionCartographic.height,t=40487.57,r=7096758e-11,s=91610.74,o=-40467.74;return Math.round(o+(t-o)/(1+Math.pow(e/s,r)))}_use(e){return e&&e.install&&e.install(this),this}_addLayerGroup(e){e!=null&&e.layerGroupEvent&&!Object(this._layerGroupCache).hasOwnProperty(e.id)&&(e.layerGroupEvent.fire(Pe.ADD,this),this._layerGroupCache[e.id]=e)}_removeLayerGroup(e){e!=null&&e.layerGroupEvent&&Object(this._layerGroupCache).hasOwnProperty(e.id)&&(e.layerGroupEvent.fire(Pe.REMOVE,this),delete this._layerGroupCache[e.id])}_addLayer(e){!this._layerCache[e.type]&&(this._layerCache[e.type]={}),Object(this._layerCache[e.type]).hasOwnProperty(e.id)||(e.fire(be.ADD,this),this._layerCache[e.type][e.id]=e)}_removeLayer(e){Object(this._layerCache[e.type]).hasOwnProperty(e.id)&&(e.fire(be.REMOVE,this),delete this._layerCache[e.type][e.id])}setOptions(e){return this._viewerOption.setOptions(e),this}setPitchRange(e=-90,t=-20){return this._cameraOption.setPitchRange(e,t),this}changeSceneMode(e,t=0){return e===2?this._delegate.scene.morphTo2D(t):e===3?this._delegate.scene.morphTo3D(t):e===2.5&&this._delegate.scene.morphToColumbusView(t),this}changeMouseMode(e){return this._cameraOption.changeMouseMode(e),this}setTerrain(e){return this._delegate.scene.setTerrain(new i.Terrain(e||Promise.resolve(new i.EllipsoidTerrainProvider))),this}addBaseLayer(e,t={}){return e?(this._baseLayerPicker.addImageryLayer(e,t),this._baseLayerPicker.selectedImageryLayer||this._baseLayerPicker.changeImageryLayer(0),this.mapSwitch&&this.mapSwitch.addMap(t),this):this}changeBaseLayer(e){return this._baseLayerPicker.changeImageryLayer(e),this}getImageryLayerInfo(e){let t=this._delegate.camera.getPickRay(e);return this._delegate.imageryLayers.pickImageryLayerFeatures(t,this._delegate.scene)}addLayerGroup(e){return this._addLayerGroup(e),this}removeLayerGroup(e){return this._removeLayerGroup(e),this}getLayerGroup(e){return this._layerGroupCache[e]||void 0}addLayer(e){return this._addLayer(e),this}removeLayer(e){return this._removeLayer(e),this}hasLayer(e){return Object(this._layerCache[e.type]).hasOwnProperty(e.id)}getLayer(e){let t=this.getLayers().filter(r=>r.id===e);return t&&t.length?t[0]:void 0}getLayers(){let e=[];return Object.keys(this._layerCache).forEach(t=>{let r=this._layerCache[t];Object.keys(r).forEach(s=>{e.push(r[s])})}),e}eachLayer(e,t){return Object.keys(this._layerCache).forEach(r=>{let s=this._layerCache[r];Object.keys(s).forEach(o=>{e.call(t,s[o])})}),this}flyTo(e,t){return this._delegate.flyTo((e==null?void 0:e.delegate)||e,{duration:t}),this}zoomTo(e){return this._delegate.zoomTo((e==null?void 0:e.delegate)||e),this}flyToPosition(e,t,r){return e=y.parsePosition(e),this.camera.flyTo({destination:g.transformWGS84ToCartesian(e),orientation:{heading:i.Math.toRadians(e.heading),pitch:i.Math.toRadians(e.pitch),roll:i.Math.toRadians(e.roll)},complete:t,duration:r}),this}zoomToPosition(e,t){return this.flyToPosition(e,t,0),this}flyToBounds(e,{heading:t=0,pitch:r=0,roll:s=0},o,n){return e?(Array.isArray(e)||(e=e.split(",")),this.camera.flyTo({destination:i.Rectangle.fromDegrees(e[0],e[1],e[2],e[3]),orientation:{heading:i.Math.toRadians(t),pitch:i.Math.toRadians(r),roll:i.Math.toRadians(s)},complete:o,duration:n}),this):this}zoomToBounds(e,{heading:t=0,pitch:r=0,roll:s=0},o){return this.flyToBounds(e,{heading:t,pitch:r,roll:s},o),this}on(e,t,r){return this._viewerEvent.on(e,t,r||this),this._sceneEvent.on(e,t,r||this),this}once(e,t,r){return this._viewerEvent.once(e,t,r||this),this}off(e,t,r){return this._viewerEvent.off(e,t,r||this),this._sceneEvent.off(e,t,r||this),this}destroy(){return Object.keys(this._layerCache).forEach(e=>{let t=this._layerCache[e];Object.keys(t).forEach(r=>{this._removeLayer(t[r])})}),this._delegate.destroy(),this._delegate=void 0,this._baseLayerPicker=void 0,this._layerCache={},this._widgetContainer.parentNode.removeChild(this._widgetContainer),this._widgetContainer=void 0,this._layerContainer.parentNode.removeChild(this._layerContainer),this._layerContainer=void 0,this}exportScene(e){this.scene.render();let r=this.canvas.toDataURL("image/png").replace("image/png","image/octet-stream"),s=document.createElement("a"),o=v.dataURLtoBlob(r),n=URL.createObjectURL(o);return s.download=`${e||"scene"}.png`,s.href=n,s.click(),this}getOffset(){var r;let e={x:0,y:0},t=(r=this._delegate)==null?void 0:r.container;if(t)if(t.getBoundingClientRect){let s=t.getBoundingClientRect();e.x=s.left,e.y=s.top}else e.x=t.offsetLeft,e.y=t.offsetTop;return e}resize(){return this._delegate.resize(),this}},Fr=Nr;var au={ARCGIS:"arcgis",BING:"bing",OSM:"osm",SINGLE_TILE:"single_tile",WMS:"wms",WMTS:"wmts",XYZ:"xyz",COORD:"coord",GRID:"grid",MAPBOX:"mapbox",MAPBOX_STYLE:"mapbox_style",TMS:"tms"},W=au;var Hr=class extends i.WebMercatorTilingScheme{constructor(e){super(e);let t=new i.WebMercatorProjection;this._projection.project=function(r,s){return s=ue.WGS84ToGCJ02(i.Math.toDegrees(r.longitude),i.Math.toDegrees(r.latitude)),s=t.project(new i.Cartographic(i.Math.toRadians(s[0]),i.Math.toRadians(s[1]))),new i.Cartesian2(s.x,s.y)},this._projection.unproject=function(r,s){let o=t.unproject(r);return s=ue.GCJ02ToWGS84(i.Math.toDegrees(o.longitude),i.Math.toDegrees(o.latitude)),new i.Cartographic(i.Math.toRadians(s[0]),i.Math.toRadians(s[1]))}}},gt=Hr;var Sl={img:"//webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",elec:"//webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",cva:"//webst{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}"},zr=class extends i.UrlTemplateImageryProvider{constructor(e={}){e.url=e.url||[e.protocol||"",Sl[e.style]||Sl.elec].join(""),e.subdomains=e.subdomains||["01","02","03","04"],e.crs==="WGS84"&&(e.tilingScheme=new gt),super(e)}};W.AMAP="amap";var Al=zr;var nu=637099681e-2,Ml=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],yt=[75,60,45,30,15,0],lu=[[1410526172116255e-23,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,173379812e-1],[-7435856389565537e-24,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1026014486e-2],[-3030883460898826e-23,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,685681737e-2],[-1981981304930552e-23,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,448277706e-2],[309191371068437e-23,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,25551644e-1],[2890871144776878e-24,8983055095805407e-21,-3068298e-14,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],Il=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,6477955746671607e-7,-4082003173641316e-6,1077490566351142e-5,-1517187553151559e-5,1205306533862167e-5,-5124939663577472e-6,9133119359512032e-7,67.5],[.00337398766765,111320.7020202162,4481351045890365e-9,-2339375119931662e-8,7968221547186455e-8,-1159649932797253e-7,9723671115602145e-8,-4366194633752821e-8,8477230501135234e-9,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837749470245e-9,992013.7397791013,-122195221711287e-8,1340652697009075e-9,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758690035394e-9,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],Wr=class{constructor(){this.isWgs84=!1}getDistanceByMC(e,t){if(!e||!t||(e=this.convertMC2LL(e),!e))return 0;let r=this.toRadians(e.lng),s=this.toRadians(e.lat);if(t=this.convertMC2LL(t),!t)return 0;let o=this.toRadians(t.lng),n=this.toRadians(t.lat);return this.getDistance(r,o,s,n)}getDistanceByLL(e,t){if(!e||!t)return 0;e.lng=this.getLoop(e.lng,-180,180),e.lat=this.getRange(e.lat,-74,74),t.lng=this.getLoop(t.lng,-180,180),t.lat=this.getRange(t.lat,-74,74);let r=this.toRadians(e.lng),s=this.toRadians(e.lat),o=this.toRadians(t.lng),n=this.toRadians(t.lat);return this.getDistance(r,o,s,n)}convertMC2LL(e){if(!e)return{lng:0,lat:0};let t={};if(this.isWgs84){t.lng=e.lng/2003750834e-2*180;let o=e.lat/2003750834e-2*180;return t.lat=180/Math.PI*(2*Math.atan(Math.exp(o*Math.PI/180))-Math.PI/2),{lng:t.lng.toFixed(6),lat:t.lat.toFixed(6)}}let r={lng:Math.abs(e.lng),lat:Math.abs(e.lat)},s;for(let o=0;o<Ml.length;o++)if(r.lat>=Ml[o]){s=lu[o];break}return t=this.convertor(e,s),{lng:t.lng.toFixed(6),lat:t.lat.toFixed(6)}}convertLL2MC(e){if(!e)return{lng:0,lat:0};if(e.lng>180||e.lng<-180||e.lat>90||e.lat<-90)return e;if(this.isWgs84){let o={},n=6378137;o.lng=e.lng*Math.PI/180*n;let l=e.lat*Math.PI/180;return o.lat=n/2*Math.log((1+Math.sin(l))/(1-Math.sin(l))),{lng:parseFloat(o.lng.toFixed(2)),lat:parseFloat(o.lat.toFixed(2))}}e.lng=this.getLoop(e.lng,-180,180),e.lat=this.getRange(e.lat,-74,74);let t={lng:e.lng,lat:e.lat},r;for(let o=0;o<yt.length;o++)if(t.lat>=yt[o]){r=Il[o];break}if(!r){for(let o=0;o<yt.length;o++)if(t.lat<=-yt[o]){r=Il[o];break}}let s=this.convertor(e,r);return{lng:parseFloat(s.lng.toFixed(2)),lat:parseFloat(s.lat.toFixed(2))}}convertor(e,t){if(!e||!t)return{lng:0,lat:0};let r=t[0]+t[1]*Math.abs(e.lng),s=Math.abs(e.lat)/t[9],o=t[2]+t[3]*s+t[4]*s*s+t[5]*s*s*s+t[6]*s*s*s*s+t[7]*s*s*s*s*s+t[8]*s*s*s*s*s*s;return r*=e.lng<0?-1:1,o*=e.lat<0?-1:1,{lng:r,lat:o}}getDistance(e,t,r,s){return nu*Math.acos(Math.sin(r)*Math.sin(s)+Math.cos(r)*Math.cos(s)*Math.cos(t-e))}toRadians(e){return Math.PI*e/180}toDegrees(e){return 180*e/Math.PI}getRange(e,t,r){return t!=null&&(e=Math.max(e,t)),r!=null&&(e=Math.min(e,r)),e}getLoop(e,t,r){for(;e>r;)e-=r-t;for(;e<t;)e+=r-t;return e}lngLatToMercator(e){return this.convertLL2MC(e)}lngLatToPoint(e){let t=this.convertLL2MC(e);return{x:t.lng,y:t.lat}}mercatorToLngLat(e){return this.convertMC2LL(e)}pointToLngLat(e){let t={lng:e.x,lat:e.y};return this.convertMC2LL(t)}pointToPixel(e,t,r,s){if(!e)return{x:0,y:0};e=this.lngLatToMercator(e);let o=this.getZoomUnits(t),n=Math.round((e.lng-r.lng)/o+s.width/2),l=Math.round((r.lat-e.lat)/o+s.height/2);return{x:n,y:l}}pixelToPoint(e,t,r,s){if(!e)return{lng:0,lat:0};let o=this.getZoomUnits(t),n=r.lng+o*(e.x-s.width/2),l=r.lat-o*(e.y-s.height/2),h={lng:n,lat:l};return this.mercatorToLngLat(h)}getZoomUnits(e){return Math.pow(2,18-e)}},Ll=Wr;var Gr=class extends i.WebMercatorTilingScheme{constructor(e){super(e);let t=new Ll;this._projection.project=function(r,s){return s=s||{},s=ue.WGS84ToGCJ02(i.Math.toDegrees(r.longitude),i.Math.toDegrees(r.latitude)),s=ue.GCJ02ToBD09(s[0],s[1]),s[0]=Math.min(s[0],180),s[0]=Math.max(s[0],-180),s[1]=Math.min(s[1],74.000022),s[1]=Math.max(s[1],-71.988531),s=t.lngLatToPoint({lng:s[0],lat:s[1]}),new i.Cartesian2(s.x,s.y)},this._projection.unproject=function(r,s){return s=s||{},s=t.mercatorToLngLat({lng:r.x,lat:r.y}),s=ue.BD09ToGCJ02(s.lng,s.lat),s=ue.GCJ02ToWGS84(s[0],s[1]),new i.Cartographic(i.Math.toRadians(s[0]),i.Math.toRadians(s[1]))},this.resolutions=e.resolutions||[]}tileXYToNativeRectangle(e,t,r,s){let o=this.resolutions[r],n=e*o,l=(e+1)*o,h=((t=-t)+1)*o,c=t*o;return i.defined(s)?(s.west=n,s.south=c,s.east=l,s.north=h,s):new i.Rectangle(n,c,l,h)}positionToTileXY(e,t,r){let s=this._rectangle;if(!i.Rectangle.contains(s,e))return;let n=this._projection.project(e);if(!i.defined(n))return;let l=this.resolutions[t],h=Math.floor(n.x/l),c=-Math.floor(n.y/l);return i.defined(r)?(r.x=h,r.y=c,r):new i.Cartesian2(h,c)}},Dl=Gr;var Rl={img:"//shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46",vec:"//online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl&v=020",custom:"//api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}",traffic:"//its.map.baidu.com:8002/traffic/TrafficTileService?time={time}&label={labelStyle}&v=016&level={z}&x={x}&y={y}&scaler=2"},Ur=class extends i.UrlTemplateImageryProvider{constructor(e={}){if(e.url=e.url||[e.protocol||"",Rl[e.style]||Rl.custom].join(""),e.crs==="WGS84"){let t=[];for(let r=0;r<19;r++)t[r]=256*Math.pow(2,18-r);e.tilingScheme=new Dl({resolutions:t,rectangleSouthwestInMeters:new i.Cartesian2(-2003772637e-2,-1247410417e-2),rectangleNortheastInMeters:new i.Cartesian2(2003772637e-2,1247410417e-2)})}else e.tilingScheme=new i.WebMercatorTilingScheme({rectangleSouthwestInMeters:new i.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new i.Cartesian2(33554054,33746824)});e.maximumLevel=18,super(e),this._rectangle=this._tilingScheme.rectangle,this._url=e.url,this._crs=e.crs||"BD09",this._style=e.style||"normal"}requestImage(e,t,r){let s=this._tilingScheme.getNumberOfXTilesAtLevel(r),o=this._tilingScheme.getNumberOfYTilesAtLevel(r),n=this._url.replace("{z}",r).replace("{s}",String(1)).replace("{style}",this._style);return this._crs==="WGS84"?n=n.replace("{x}",String(e)).replace("{y}",String(-t)):n=n.replace("{x}",String(e-s/2)).replace("{y}",String(o/2-t-1)),i.ImageryProvider.loadImage(this,n)}};W.BAIDU="baidu";var Ol=Ur;var hu="//tiles{s}.geovisearth.com/base/v1/{style}/{z}/{x}/{y}?format={format}&tmsIds=w&token={key}",Br=class extends i.UrlTemplateImageryProvider{constructor(e={}){e.url=e.url||[e.protocol||"",hu.replace(/\{style\}/g,e.style||"vec").replace(/\{format\}/g,e.format||"png").replace(/\{key\}/g,e.key||"")].join(""),e.subdomains=e.subdomains||["1","2","3"],super(e)}};W.GEO_VIS="geoVis";var kl=Br;var Nl={img:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=s&x={x}&y={y}&z={z}",elec:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=m&x={x}&y={y}&z={z}",cva:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=h&x={x}&y={y}&z={z}",ter:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=t@131,r&x={x}&y={y}&z={z}",img_cva:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=y&x={x}&y={y}&z={z}"},Vr=class extends i.UrlTemplateImageryProvider{constructor(e={}){e.url=e.url||[e.protocol||"",Nl[e.style]||Nl.elec].join(""),e.crs==="WGS84"&&(e.tilingScheme=new gt),super(e)}};W.GOOGLE="google";var Fl=Vr;var cu="//t{s}.tianditu.gov.cn/DataServer?T={style}_w&x={x}&y={y}&l={z}&tk={key}",jr=class extends i.UrlTemplateImageryProvider{constructor(e={}){super({url:[e.protocol||"",cu.replace(/\{style\}/g,e.style||"vec").replace(/\{key\}/g,e.key||"")].join(""),subdomains:["0","1","2","3","4","5","6","7"],maximumLevel:18})}};W.TDT="tdt";var Hl=jr;var zl={img:"//p{s}.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=400",elec:"//rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid={style}&scene=0&version=347"},Yr=class extends i.UrlTemplateImageryProvider{constructor(e={}){let t=e.url||[e.protocol||"",zl[e.style]||zl.elec].join("");e.url=t.replace("{style}",e.style||1),e.subdomains=e.subdomains||["1","2","3"],e.style==="img"&&(e.customTags={sx:(r,s,o,n)=>s>>4,sy:(r,s,o,n)=>(1<<n)-o>>4}),super(e)}};W.TENCENT="tencent";var Wl=Yr;var qr=class{static createAMapImageryLayer(e){return Promise.resolve(new Al(e))}static createBaiduImageryLayer(e){return Promise.resolve(new Ol(e))}static createGeoVisImageryLayer(e){return Promise.resolve(new kl(e))}static createGoogleImageryLayer(e){return Promise.resolve(new Fl(e))}static createTdtImageryLayer(e){return Promise.resolve(new Hl(e))}static createTencentImageryLayer(e){return Promise.resolve(new Wl(e))}static createArcGisImageryLayer(e){return i.ArcGisMapServerImageryProvider.fromUrl(e.url,e)}static createBingImageryLayer(e){return i.BingMapsImageryProvider.fromUrl(e.url,e)}static createOSMImageryLayer(e){return Promise.resolve(new i.OpenStreetMapImageryProvider(e))}static createSingleTileImageryLayer(e){return i.SingleTileImageryProvider.fromUrl(e.url,e)}static createWMSImageryLayer(e){return Promise.resolve(new i.WebMapServiceImageryProvider(e))}static createWMTSImageryLayer(e){return Promise.resolve(new i.WebMapTileServiceImageryProvider(e))}static createXYZImageryLayer(e){return Promise.resolve(new i.UrlTemplateImageryProvider(e))}static createCoordImageryLayer(e){return Promise.resolve(new i.TileCoordinatesImageryProvider(e))}static createGridImageryLayer(e){return Promise.resolve(new i.GridImageryProvider(e))}static createMapboxImageryLayer(e){return Promise.resolve(new i.MapboxImageryProvider(e))}static createMapboxStyleImageryLayer(e){return Promise.resolve(new i.MapboxStyleImageryProvider(e))}static createTMSImageryLayer(e){return i.TileMapServiceImageryProvider.fromUrl(e.url,e)}static createImageryLayer(e,t){let r;switch(e){case W.AMAP:r=this.createAMapImageryLayer(t);break;case W.BAIDU:r=this.createBaiduImageryLayer(t);break;case W.GEO_VIS:r=this.createGeoVisImageryLayer(t);break;case W.GOOGLE:r=this.createGoogleImageryLayer(t);break;case W.TDT:r=this.createTdtImageryLayer(t);break;case W.TENCENT:r=this.createTencentImageryLayer(t);break;case W.ARCGIS:r=this.createArcGisImageryLayer(t);break;case W.BING:r=this.createBingImageryLayer(t);break;case W.OSM:r=this.createOSMImageryLayer(t);break;case W.SINGLE_TILE:r=this.createSingleTileImageryLayer(t);break;case W.WMS:r=this.createWMSImageryLayer(t);break;case W.WMTS:r=this.createWMTSImageryLayer(t);break;case W.XYZ:r=this.createXYZImageryLayer(t);break;case W.COORD:r=this.createCoordImageryLayer(t);break;case W.GRID:r=this.createGridImageryLayer(t);break;case W.MAPBOX:r=this.createMapboxImageryLayer(t);break;case W.MAPBOX_STYLE:r=this.createMapboxStyleImageryLayer(t);break;case W.TMS:r=this.createTMSImageryLayer(t);break;default:break}return r}},Gl=qr;var Zr=class extends i.GeographicTilingScheme{constructor(e={}){super(e),this._origin=e.origin||[-180,90],this._zoomOffset=e.zoomOffset||0,this._tileSize=e.tileSize||256,this._resolutions=e.resolutions||[]}get zoomOffset(){return this._zoomOffset}tileXYToRectangle(e,t,r,s){if(!this._resolutions||!this._resolutions[r+this._zoomOffset])return i.Rectangle.MAX_VALUE;let o=this._resolutions[r+this._zoomOffset]*this._tileSize,n=i.Math.toRadians(this._origin[0]+e*o),l=i.Math.toRadians(this._origin[1]-(t+1)*o),h=i.Math.toRadians(this._origin[0]+(e+1)*o),c=i.Math.toRadians(this._origin[1]-t*o);return s?(s.west=n,s.south=l,s.east=h,s.north=c,s):new i.Rectangle(n,l,h,c)}positionToTileXY(e,t,r){if(!this._resolutions||!this._resolutions[t+this._zoomOffset])return new i.Cartesian2;let s=this._resolutions[t+this._zoomOffset]*this._tileSize,o=i.Math.toDegrees(e.longitude),n=i.Math.toDegrees(e.latitude),l=Math.floor((o-this._origin[0])/s),h=Math.floor((this._origin[1]-n)/s);return r?(r.x=l,r.y=h,r):new i.Cartesian2(Math.max(0,l),Math.max(0,h))}},Ul=Zr;var Xr=class extends i.WebMercatorTilingScheme{constructor(e={}){super(e),this._origin=e.origin||[-200375083427892e-7,200375083427892e-7],this._zoomOffset=e.zoomOffset||0,this._tileSize=e.tileSize||256,this._resolutions=e.resolutions||[]}get zoomOffset(){return this._zoomOffset}tileXYToNativeRectangle(e,t,r,s){if(!this._resolutions||!this._resolutions[r+this._zoomOffset])return i.Rectangle.MAX_VALUE;if(e<0||t<0)return i.Rectangle.MAX_VALUE;let o=this._resolutions[r+this._zoomOffset]*this._tileSize,n=this._origin[0]+e*o,l=this._origin[1]-(t+1)*o,h=this._origin[0]+(e+1)*o,c=this._origin[1]-t*o;return s?(s.west=n,s.south=l,s.east=h,s.north=c,s):new i.Rectangle(n,l,h,c)}positionToTileXY(e,t,r){let s=this._rectangle;if(!i.Rectangle.contains(s,e))return;if(!this._resolutions||!this._resolutions[t+this._zoomOffset])return new i.Cartesian2;let o=this._resolutions[t+this._zoomOffset]*this._tileSize,l=this._projection.project(e),h=Math.floor((l.x-this._origin[0])/o),c=Math.floor((this._origin[1]-l.y)/o);return r?(r.x=h,r.y=c,r):new i.Cartesian2(Math.max(0,h),Math.max(0,c))}},Bl=Xr;var du={NONE:"none",XYZ:"xyz",ARCGIS:"arcgis",GOOGLE:"google",VR:"vr"},Ae=du;var Jr=class{static createEllipsoidTerrain(e){return Promise.resolve(new i.EllipsoidTerrainProvider(e))}static createUrlTerrain(e){return i.CesiumTerrainProvider.fromUrl(e.url,e)}static createGoogleTerrain(e){return i.GoogleEarthEnterpriseTerrainProvider.fromUrl(e.url,e)}static createArcgisTerrain(e){return i.ArcGISTiledElevationTerrainProvider.fromUrl(e.url,e)}static createVRTerrain(e){return i.VRTheWorldTerrainProvider.fromUrl(e.url,e)}static createTerrain(e,t){let r;switch(e){case Ae.NONE:r=this.createEllipsoidTerrain(t);break;case Ae.XYZ:r=this.createUrlTerrain(t);break;case Ae.GOOGLE:r=this.createGoogleTerrain(t);break;case Ae.ARCGIS:r=this.createArcgisTerrain(t);break;case Ae.VR:r=this.createVRTerrain(t);break;default:break}return r}},Vl=Jr;var pu={},ot=pu;var $r=class{constructor(e){this._id=v.uuid(),this._bid=e||v.uuid(),this._delegate=void 0,this._viewer=void 0,this._state=void 0,this._show=!0,this._isGround=!1,this._cache={},this._attr={},this._layerEvent=new ji,this._layerEvent.on(be.ADD,this._onAdd,this),this._layerEvent.on(be.REMOVE,this._onRemove,this)}get layerId(){return this._id}get id(){return this._bid}get delegate(){return this._delegate}set show(e){this._show=e,this._delegate&&(this._delegate.show=this._show)}get show(){return this._show}get layerEvent(){return this._layerEvent}set attr(e){this._attr=e}get attr(){return this._attr}get state(){return this._state}_addedHook(){}_removedHook(){}_onAdd(e){this._viewer=e,this._delegate&&(this._delegate instanceof i.PrimitiveCollection?this._isGround?this._viewer.scene.groundPrimitives.add(this._delegate):this._viewer.scene.primitives.add(this._delegate):this._delegate instanceof i.ImageryLayer?this._viewer.imageryLayers.add(this._delegate):this._viewer.dataSources.add(this._delegate),this._addedHook&&this._addedHook(),this._state=_.ADDED)}_onRemove(){this._delegate&&this._viewer&&(this._cache={},this._delegate instanceof i.PrimitiveCollection?(this._delegate.removeAll(),this._isGround?this._viewer.scene.groundPrimitives.remove(this._delegate):this._viewer.scene.primitives.remove(this._delegate)):this._delegate instanceof i.ImageryLayer?this._viewer.imageryLayers.remove(this._delegate,!1):this._delegate instanceof Promise?(this._delegate.then(e=>{e.entities.removeAll()}),this._viewer.dataSources.remove(this._delegate)):(this._delegate.entities&&this._delegate.entities.removeAll(),this._viewer.dataSources.remove(this._delegate)),this._removedHook&&this._removedHook(),this._state=_.REMOVED)}_addOverlay(e){this._cache.hasOwnProperty(e.overlayId)||(this._cache[e.overlayId]=e,this._delegate&&e.fire(Ee.ADD,this),this._state===_.CLEARED&&(this._state=_.ADDED))}_removeOverlay(e){this._cache.hasOwnProperty(e.overlayId)&&(this._delegate&&e.fire(Ee.REMOVE,this),delete this._cache[e.overlayId])}addOverlay(e){return this._addOverlay(e),this}addOverlays(e){return Array.isArray(e)&&e.forEach(t=>{this._addOverlay(t)}),this}removeOverlay(e){return this._removeOverlay(e),this}getOverlay(e){return this._cache[e]||void 0}getOverlayById(e){let t;return Object.keys(this._cache).forEach(r=>{this._cache[r].id===e&&(t=this._cache[r])}),t}getOverlaysByAttr(e,t){let r=[];return this.eachOverlay(s=>{s.attr[e]===t&&r.push(s)},this),r}eachOverlay(e,t){return Object.keys(this._cache).forEach(r=>{e&&e.call(t||this,this._cache[r])}),this}getOverlays(){let e=[];return Object.keys(this._cache).forEach(t=>{e.push(this._cache[t])}),e}clear(){}remove(){this._viewer&&this._viewer.removeLayer(this)}addTo(e){return e!=null&&e.addLayer&&e.addLayer(this),this}setStyle(e){}on(e,t,r){return this._layerEvent.on(e,t,r||this),this}off(e,t,r){return this._layerEvent.off(e,t,r||this),this}fire(e,t){return this._layerEvent.fire(e,t),this}static registerType(e){e&&(ot[e.toLocaleUpperCase()]=e.toLocaleLowerCase())}static getLayerType(e){return ot[e.toLocaleUpperCase()]||void 0}},A=$r;var Kr=class{constructor(e){this._id=e||v.uuid(),this._cache={},this._show=!0,this._viewer=void 0,this._layerGroupEvent=new Bi,this._layerGroupEvent.on(Pe.ADD,this._onAdd,this),this._layerGroupEvent.on(Pe.REMOVE,this._onRemove,this),this._state=_.INITIALIZED}get id(){return this._id}get type(){return A.getLayerType("layer_group")}set show(e){this._show=e,Object.keys(this._cache).forEach(t=>{this._cache[t].show=this._show})}get show(){return this._show}get layerGroupEvent(){return this._layerGroupEvent}get state(){return this._state}_onAdd(e){this._viewer=e,Object.keys(this._cache).forEach(t=>{this._viewer.addLayer(this._cache[t])}),this._state=_.ADDED}_onRemove(){Object.keys(this._cache).forEach(e=>{this._viewer&&this._viewer.removeLayer(this._cache[e])}),this._cache={},this._state=_.REMOVED}addLayer(e){return Object(this._cache).hasOwnProperty(e.id)||(this._cache[e.id]=e,this._viewer&&this._viewer.addLayer(e)),this}removeLayer(e){return Object(this._cache).hasOwnProperty(e.id)&&(this._viewer&&this._viewer.removeLayer(e),delete this._cache[e.id]),this}getLayer(e){return this._cache[e]||void 0}getLayers(){let e=[];return Object.keys(this._cache).forEach(t=>{e.push(this._cache[t])}),e}addTo(e){return e&&e.addLayerGroup&&e.addLayerGroup(this),this}remove(){return this._viewer&&this._viewer.removeLayerGroup(this),this}};A.registerType("layer_group");var jl=Kr;var mu={radius:60,maxZoom:25,style:"circle",image:"",gradientColors:{1e-4:i.Color.DEEPSKYBLUE,.001:i.Color.GREEN,.01:i.Color.ORANGE,.1:i.Color.RED},gradientImages:{},showCount:!0,fontSize:12,clusterSize:16,fontColor:i.Color.BLACK,getCountOffset:a=>({x:-3.542857*String(a).length+1.066667,y:String(a).length>3?5:4})},Qr=class extends A{constructor(e,t={}){super(e),this._delegate=new i.PrimitiveCollection,this._options={...mu,...t},this._billboards=this._delegate.add(new i.BillboardCollection),this._labels=this._delegate.add(new i.LabelCollection),this._cluster=new Ue({radius:this._options.radius,maxZoom:this._options.maxZoom}),this._allCount=0,this._changedRemoveCallback=void 0,this._lastChangedTime=null,this._state=_.INITIALIZED}get type(){return A.getLayerType("cluster")}_addOverlay(e){}_removeOverlay(e){}_getCircleImage(e,t){let r=this._options.clusterSize*(String(t).length+1),s=e.toCssColorString()+"-"+t;if(!this._cache[s]){let o=document.createElement("canvas");o.width=r,o.height=r;let n=o.getContext("2d");n.save(),n.scale(r/24,r/24),n.fillStyle=e.withAlpha(.2).toCssColorString(),n.beginPath(),n.arc(12,12,9,0,2*Math.PI),n.closePath(),n.fill(),n.beginPath(),n.arc(12,12,6,0,2*Math.PI),n.fillStyle=e.toCssColorString(),n.closePath(),n.fill(),n.restore(),this._cache[s]=o.toDataURL()}return this._cache[s]}_getClusteringImage(e,t){let r=this._options.clusterSize*(String(t).length+1),s=e.toCssColorString()+"-"+t,o=-Math.PI/12,n=Math.PI/2,l=Math.PI/6;if(!this._cache[s]){let h=document.createElement("canvas");h.width=r,h.height=r;let c=h.getContext("2d");c.save(),c.scale(r/24,r/24),c.beginPath(),c.arc(12,12,6,0,2*Math.PI),c.fillStyle=e.toCssColorString(),c.fill(),c.closePath(),c.lineWidth=2;for(let d=0;d<3;d++)c.beginPath(),c.arc(12,12,8,o,o+n,!1),c.strokeStyle=e.withAlpha(.4).toCssColorString(),c.stroke(),c.arc(12,12,11,o,o+n,!1),c.strokeStyle=e.withAlpha(.2).toCssColorString(),c.stroke(),c.closePath(),o=o+n+l;c.restore(),this._cache[s]=h.toDataURL()}return this._cache[s]}_getClusterImage(e){let t=e/this._allCount,r;if(this._options.style==="custom"){let s=Object.keys(this._options.gradientImages).sort((o,n)=>Number(o)-Number(n));for(let o=s.length-1;o>=0;o--)if(t>=Number(s[o])){r=this._options.gradientImages[s[o]];break}r||(r=this._options.gradientImages[s[0]])}else{let s=Object.keys(this._options.gradientColors).sort((n,l)=>Number(n)-Number(l)),o;for(let n=s.length-1;n>=0;n--)if(t>=Number(s[n])){o=this._options.gradientColors[s[n]];break}o||(o=this._options.gradientColors[s[0]]),r=this._options.style==="circle"?this._getCircleImage(o,e):this._getClusteringImage(o,e)}return r}_changeCluster(e){let t=i.getTimestamp();if(this._lastChangedTime&&t-this._lastChangedTime<=1e3)return;this._lastChangedTime=t,this._cache={},this._billboards.removeAll(),this._labels.removeAll();let r=this._viewer.camera.computeViewRectangle();r||(r=this._viewer.viewBounds),this._allCount&&this._cluster.getClusters([i.Math.toDegrees(r.west),i.Math.toDegrees(r.south),i.Math.toDegrees(r.east),i.Math.toDegrees(r.north)],this._viewer.zoom).forEach(o=>{let n=v.uuid();if(o.properties.cluster){let l=o.properties.point_count,h=this._billboards.add({position:i.Cartesian3.fromDegrees(+o.geometry.coordinates[0],+o.geometry.coordinates[1]),image:this._getClusterImage(l)});if(h.layerId=this.layerId,h.overlayId=n,h.attr={count:l},this._cache[n]=h,this._options.showCount){let c=this._labels.add({position:i.Cartesian3.fromDegrees(+o.geometry.coordinates[0],+o.geometry.coordinates[1]),text:String(l),font:`${this._options.fontSize} px sans-serif`,disableDepthTestDistance:Number.POSITIVE_INFINITY,fillColor:this._options.fontColor,scale:.8,pixelOffset:this._options.getCountOffset(l)});c.layerId=this.layerId,c.overlayId=n,c.attr={count:l},this._cache[n]=c}}else{let l=this._billboards.add({position:i.Cartesian3.fromDegrees(+o.geometry.coordinates[0],+o.geometry.coordinates[1]),image:this._options.image,...o.properties.style});l.layerId=this.layerId,l.overlayId=n,l.attr=o.properties,this._cache[n]=l}})}_addedHook(){this._changedRemoveCallback=this._viewer.camera.changed.addEventListener(this._changeCluster,this)}_removedHook(){this._changedRemoveCallback&&this._changedRemoveCallback()}setPoints(e=[]){return e.length&&(this._allCount=e.length,this._cluster.load(e.map(t=>{let r=y.parsePosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[r.lng,r.lat]},properties:t.attr||{}}}))),this}clear(){return this._cache={},this._allCount=0,this._state=_.CLEARED,this}};A.registerType("cluster");var Yl=Qr;var es=class extends A{constructor(e,t="",r={}){super(e),this._delegate=i.CzmlDataSource.load(t,r),this._state=_.INITIALIZED}get type(){return A.getLayerType("czml")}set show(e){this._show=e,this._delegate&&this._delegate.then(t=>{t.show=this._show})}get show(){return this._show}eachOverlay(e,t){if(this._delegate)return this._delegate.then(r=>{r.entities.values.forEach(o=>{e.call(t,o)})}),this}};A.registerType("czml");var ql=es;var ts=class extends A{constructor(e){super(e),this._delegate=new i.CustomDataSource(e),this._state=_.INITIALIZED}get type(){return A.getLayerType("dynamic")}clear(){return this._delegate.entities&&this._delegate.entities.removeAll(),this._cache={},this._state=_.CLEARED,this}};A.registerType("dynamic");var Zl=ts;var is=class extends A{constructor(e){super(e),this._delegate=new i.CustomDataSource(e),this._state=_.INITIALIZED}get type(){return A.getLayerType("vector")}clear(){return this._delegate.entities&&this._delegate.entities.removeAll(),this._cache={},this._state=_.CLEARED,this}};A.registerType("vector");var _e=is;var uu={name:"",count:10,maximumLevel:21,dataProperty:"",callback:()=>null},rs=class extends A{constructor(e,t,r={}){super(e),this._url=t,this._options={...uu,...r},this._levelLayers={},this._tileWidth=256,this._tileHeight=256,this._maximumLevel=this._options.maximumLevel,this._tilingScheme=this._options.tilingScheme||new i.GeographicTilingScheme,this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._token=void 0;for(let s=0;s<this.maximumLevel;s++)this._levelLayers[String(s)]=new _e(e+"-grid-"+s);this._viewer=void 0,this._imageryLayer=void 0,this._imagery=document.createElement("canvas"),this._imagery.width=this._tileWidth,this._imagery.height=this._tileHeight,this._state=_.INITIALIZED}get type(){return A.getLayerType("feature_grid")}get url(){return this._url}set show(e){this._show=e,Object.keys(this._levelLayers).forEach(t=>{this._levelLayers[t].show=e})}get show(){return this._show}get token(){return this._token}get tileWidth(){if(!this.ready)throw new i.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}get tileHeight(){if(!this.ready)throw new i.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}get maximumLevel(){if(!this.ready)throw new i.DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}get minimumLevel(){if(!this.ready)throw new i.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}get tilingScheme(){if(!this.ready)throw new i.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}get rectangle(){if(!this.ready)throw new i.DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}get ready(){return!!this._url}get credit(){return this._credit}get hasAlphaChannel(){return!0}_onAdd(e){this._viewer=e,this._imageryLayer=this._viewer.imageryLayers.addImageryProvider(this),Object.keys(this._levelLayers).forEach(t=>{this._viewer.addLayer(this._levelLayers[t])}),this._state=_.ADDED}_onRemove(){this._imageryLayer&&this._viewer.imageryLayers.remove(this._imageryLayer),Object.keys(this._levelLayers).forEach(e=>{this._viewer.removeLayer(this._levelLayers[e])}),this._state=_.REMOVED}getTileCredits(e,t,r){}requestImage(e,t,r,s){let o=this._levelLayers[String(r)],n=this._tilingScheme.tileXYToRectangle(e,t,r);return this._viewer&&n&&o&&i.Rectangle.intersection(n,this._viewer.viewBounds)&&i.Resource.fetchJson({url:this._url,queryParameters:{minX:i.Math.toDegrees(n.west),minY:i.Math.toDegrees(n.south),maxX:i.Math.toDegrees(n.east),maxY:i.Math.toDegrees(n.north),count:this._options.count}}).then(l=>{let h=l;if(this._options.dataProperty&&(h=l[this._options.dataProperty]),h&&h.length){for(let c=r+3;c<this._maximumLevel;c++)this._levelLayers[String(c)]&&this._levelLayers[String(c)].clear();h.forEach(c=>{let d=this._options.callback(c);d&&o.addOverlay(d)})}}),this._imagery}clear(){Object.keys(this._levelLayers).forEach(e=>{this._levelLayers[e].clear()}),this._state=_.CLEARED}};A.registerType("feature_grid");var Xl=rs;var _u={},U=_u;var ss=class{constructor(){this._id=v.uuid(),this._bid=v.uuid(),this._delegate=void 0,this._layer=void 0,this._state=void 0,this._show=!0,this._style={},this._attr={},this._allowDrillPicking=!1,this._contextMenu=[],this._overlayEvent=new qi,this._overlayEvent.on(Ee.ADD,this._onAdd,this),this._overlayEvent.on(Ee.REMOVE,this._onRemove,this)}get overlayId(){return this._id}get type(){return""}set id(e){this._bid=e}get id(){return this._bid}set show(e){this._show=e,v.isPromise(this._delegate)?this._delegate.then(t=>{t.show=this._show}):this._delegate&&(this._delegate.show=this._show)}get show(){return this._show}set attr(e){this._attr=e}get attr(){return this._attr}set allowDrillPicking(e){this._allowDrillPicking=e}get allowDrillPicking(){return this._allowDrillPicking}get overlayEvent(){return this._overlayEvent}get delegate(){return this._delegate}get state(){return this._state}set contextMenu(e){this._contextMenu=e}get contextMenu(){return this._contextMenu}_getLayerCollection(e){let t;switch(e){case"point_primitive":t=this._layer.points;break;case"billboard_primitive":case"bounce_billboard_primitive":t=this._layer.billboards;break;case"label_primitive":case"bounce_label_primitive":t=this._layer.labels;break;case"polyline_primitive":t=this._layer.polylines;break;case"cloud_primitive":t=this._layer.clouds;break;default:break}return t}_mountedHook(){}_addedHook(){var e;if(!this._delegate)return!1;this._delegate instanceof Promise?this._delegate.then(t=>{var r;t.layerId=(r=this._layer)==null?void 0:r.layerId,t.overlayId=this._id}):(this._delegate.layerId=(e=this._layer)==null?void 0:e.layerId,this._delegate.overlayId=this._id)}_removedHook(){}_onAdd(e){var t,r,s,o;if(e){if(this._layer=e,this._mountedHook&&this._mountedHook(),(r=(t=this._layer)==null?void 0:t.delegate)!=null&&r.entities&&this._delegate)this._layer.delegate.entities.add(this._delegate);else if((o=(s=this._layer)==null?void 0:s.delegate)!=null&&o.add){let n=this._getLayerCollection(this.type);n?(this._delegate&&(this._delegate=n.add(this._delegate)),v.merge(this._delegate,this._style),this.update&&this.destroy&&this._layer.delegate.add(this)):v.isPromise(this._delegate)?this._delegate.then(l=>{this._layer.delegate.add(l)}):this.update&&this.destroy?this._layer.delegate.add(this):this._delegate&&this._layer.delegate.add(this._delegate)}this._addedHook&&this._addedHook(),this._state=_.ADDED}}_onRemove(){var e,t,r,s;if(this._layer){if((t=(e=this._layer)==null?void 0:e.delegate)!=null&&t.entities)this._layer.delegate.entities.remove(this._delegate);else if((s=(r=this._layer)==null?void 0:r.delegate)!=null&&s.remove){let o=this._getLayerCollection(this.type);o?(this._delegate&&o.remove(this._delegate),this.update&&this.destroy&&this._layer.delegate.remove(this)):v.isPromise(this._delegate)?this._delegate.then(n=>{this._layer.delegate.remove(n)}):this.update&&this.destroy?this._layer.delegate.remove(this):this._delegate&&this._layer.delegate.remove(this._delegate)}this._removedHook&&this._removedHook(),this._state=_.REMOVED}}setLabel(e,t){return this._delegate?(this._delegate instanceof i.Entity&&(this._delegate.label={...t,text:e}),this):this}setStyle(e){return this}remove(){return this._layer&&this._layer.removeOverlay(this),this}addTo(e){return e&&e.addOverlay&&e.addOverlay(this),this}on(e,t,r){return this._overlayEvent.on(e,t,r||this),this}off(e,t,r){return this._overlayEvent.off(e,t,r||this),this}fire(e,t){return this._overlayEvent.fire(e,t),this}static registerType(e){e&&(U[e.toLocaleUpperCase()]=e.toLocaleLowerCase())}static getOverlayType(e){return U[e.toLocaleUpperCase()]||void 0}},w=ss;var os=class extends w{constructor(e,t){super(),this._delegate=new i.Entity({billboard:{}}),this._position=y.parsePosition(e),this._icon=t,this._size=[32,32],this._state=_.INITIALIZED}get type(){return w.getOverlayType("custom_billboard")}set position(e){this._position=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._position)}get position(){return this._position}set icon(e){this._icon=e,this._delegate.billboard.image=this._icon}get icon(){return this._icon}set size(e){if(!Array.isArray(e))throw new Error("CustomBillboard: the size invalid");this._size=e,this._delegate.billboard.width=this._size[0]||32,this._delegate.billboard.height=this._size[1]||32}get size(){return this._size}_mountedHook(){this.position=this._position,this.icon=this._icon,this.size=this._size}setLabel(e,t){return this._delegate.label={...t,text:e},this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.image&&delete e.width&&delete e.height,v.merge(this._style,e),v.merge(this._delegate.billboard,e),this)}setVLine(e={}){if(this._position.alt>0&&!this._delegate.polyline){let t=this._position.copy();t.alt=e.height||0,this._delegate.polyline={...e,positions:g.transformWGS84ArrayToCartesianArray([t,this._position])}}return this}setBottomCircle(e,t={},r=0){let s=0,o=r;return this._delegate.ellipse={...t,semiMajorAxis:e,semiMinorAxis:e,stRotation:new i.CallbackProperty(()=>(s+=o,(s>=360||s<=-360)&&(s=0),s),!1)},this}};w.registerType("custom_billboard");var Jl=os;var as=class extends w{constructor(e,t){super(),this._delegate=new i.Entity({label:{}}),this._position=y.parsePosition(e),this._text=t,this._state=_.INITIALIZED}get type(){return w.getOverlayType("custom_label")}set position(e){this._position=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._position)}get position(){return this._position}set text(e){this._text=e,this._delegate.label.text=this._text}get text(){return this._text}_mountedHook(){this.position=this._position,this.text=this._text}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.text,v.merge(this._style,e),v.merge(this._delegate.label,e),this)}setVLine(e={}){if(this._position.alt>0&&!this._delegate.polyline){let t=this._position.copy();t.alt=e.height||0,this._delegate.polyline={...e,positions:g.transformWGS84ArrayToCartesianArray([t,this._position])}}return this}setBottomCircle(e,t={},r=0){let s=0,o=r;return this._delegate.ellipse={...t,semiMajorAxis:e,semiMinorAxis:e,stRotation:new i.CallbackProperty(()=>(s+=o,(s>=360||s<=-360)&&(s=0),s),!1)},this}};w.registerType("custom_label");var $l=as;var ns=class extends w{constructor(){super(),this._startTime=void 0,this._lastTime=void 0,this._sampledPosition=new i.SampledPositionProperty,this._cache=[],this._maxCacheSize=10,this._state=_.INITIALIZED}set maxCacheSize(e){this._maxCacheSize=e}get maxCacheSize(){return this._maxCacheSize}get position(){return g.transformCartesianToWGS84(this._sampledPosition.getValue(i.JulianDate.now()))}_removePosition(){if(this._cache.length>this._maxCacheSize){let e=i.JulianDate.addSeconds(this._cache[0],-.2,new i.JulianDate),t=i.JulianDate.addSeconds(this._cache[this._cache.length-this._maxCacheSize],-.2,new i.JulianDate);this._sampledPosition.removeSamples(new i.TimeInterval({start:e,stop:t})),this._cache.splice(0,this._cache.length-this._maxCacheSize)}}addPosition(e,t){this._removePosition();let r=i.JulianDate.now(),s=i.JulianDate.addSeconds(r,t,new i.JulianDate);return this._sampledPosition.addSample(s,g.transformWGS84ToCartesian(y.parsePosition(e))),this._lastTime=s,this._cache.push(this._lastTime),this}bindDom(e){return this}},vt=ns;var ls=class extends vt{constructor(e,t){super(),this._position=y.parsePosition(e),this._icon=t,this._delegate=new i.Entity({billboard:{}}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("dynamic_billboard")}set icon(e){this._icon=e,this._delegate.billboard.image=this._icon}get icon(){return this._icon}set size(e){if(!Array.isArray(e))throw new Error("DynamicBillboard: the size invalid");this._size=e,this._delegate.billboard.width=this._size[0]||32,this._delegate.billboard.height=this._size[1]||32}get size(){return this._size}_mountedHook(){this._sampledPosition.forwardExtrapolationType=i.ExtrapolationType.HOLD,this._startTime=i.JulianDate.now(),this._sampledPosition.addSample(this._startTime,g.transformWGS84ToCartesian(this._position)),this._delegate.position=this._sampledPosition,this._cache.push(this._startTime),this.icon=this._icon,this.size=this._size}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.image&&delete e.width&&delete e.height,v.merge(this._style,e),v.merge(this._delegate.billboard,e),this)}};w.registerType("dynamic_billboard");var Kl=ls;var hs=class extends vt{constructor(e,t){super(),this._position=y.parsePosition(e),this._modelUrl=t,this._delegate=new i.Entity({model:{}}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("dynamic_model")}set modelUrl(e){this._modelUrl=e,this._delegate.model.uri=this._modelUrl}get modelUrl(){return this._modelUrl}_mountedHook(){this._sampledPosition.forwardExtrapolationType=i.ExtrapolationType.HOLD,this._startTime=i.JulianDate.now(),this._sampledPosition.addSample(this._startTime,g.transformWGS84ToCartesian(this._position)),this._delegate.position=this._sampledPosition,this._delegate.orientation=new i.VelocityOrientationProperty(this._sampledPosition),this._cache.push(this._startTime),this.modelUrl=this._modelUrl}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.uri,v.merge(this._style,e),v.merge(this._delegate.model,e),this)}};w.registerType("dynamic_model");var Ql=hs;function fu(a,e,t){let r=i.Cartesian3.subtract(a,e,new i.Cartesian3),s=i.Cartesian3.subtract(t,e,new i.Cartesian3),o=i.Cartesian3.cross(r,s,r);return i.Cartesian3.magnitude(o)*.5}function ye(a){let e=0;if(!Array.isArray(a))return e;a[0]instanceof i.Cartesian3||(a=g.transformWGS84ArrayToCartesianArray(a));let t=i.CoplanarPolygonGeometry.createGeometry(i.CoplanarPolygonGeometry.fromPositions({positions:a,vertexFormat:i.VertexFormat.POSITION_ONLY}));if(!t)return e;let r=t.attributes.position.values,s=t.indices;for(let o=0;o<s.length;o+=3){let n=i.Cartesian3.unpack(r,s[o]*3,new i.Cartesian3),l=i.Cartesian3.unpack(r,s[o+1]*3,new i.Cartesian3),h=i.Cartesian3.unpack(r,s[o+2]*3,new i.Cartesian3);e+=fu(n,l,h)}return e}function cs(a=[],e=0){let t=180,r=90,s=-180,o=-90;if(a.forEach(n=>{t=Math.min(t,n.lng||n.x),r=Math.min(r,n.lat||n.y),s=Math.max(s,n.lng||n.x),o=Math.max(o,n.lat||n.y)}),e>0){let n=Math.abs(s-s),l=Math.abs(o-r);t-=n*e,r-=l*e,s+=n*e,o+=l*e}return{west:t,south:r,east:s,north:o}}function ve(a){if(a&&Array.isArray(a)){let e=0;a.forEach(({alt:s})=>e=Math.max(e,s));let t=i.BoundingSphere.fromPoints(g.transformWGS84ArrayToCartesianArray(a)),r=g.transformCartesianToWGS84(t.center);return r.alt=e,r}return new Z}function ds(a,e){e=e||{};let t=[];for(let r=0;r<a.length-1;r++){let s=gu(a[r],a[r+1],e.count);s&&s.length>0&&(t=t.concat(s))}return t}function gu(a,e,t){if(!a||!e)return null;let r=[];t=t||40;let s=function(b){return 1-2*b+b*b},o=b=>2*b-2*b*b,n=b=>b*b,l,h,c,d,m,f,u=0,p=parseFloat(a.lat),x=parseFloat(e.lat),C=parseFloat(a.lng),E=parseFloat(e.lng);E>C&&E-C>180&&C<0&&(C=360+C,E=360+E),f=0,x===p?(l=0,h=C-E):E===C?(l=Math.PI/2,h=p-x):(l=Math.atan((x-p)/(E-C)),h=(x-p)/Math.sin(l)),f===0&&(f=l+Math.PI/5),c=h/2,m=c*Math.cos(f)+C,d=c*Math.sin(f)+p;for(let b=0;b<t+1;b++){let R=C*s(u)+m*o(u)+E*n(u),S=p*s(u)+d*o(u)+x*n(u),I=a.lng,L=e.lng;r.push([I<0&&L>0?R-360:R,S]),u=u+1/t}return r}function te(a){let e=0;if(a&&Array.isArray(a))for(let t=0;t<a.length-1;t++){let r=g.transformWGS84ToCartographic(a[t]),s=g.transformWGS84ToCartographic(a[t+1]),o=new i.EllipsoidGeodesic;o.setEndPoints(r,s);let n=o.surfaceDistance;n=Math.sqrt(Math.pow(n,2)+Math.pow(s.height-r.height,2)),e+=n}return e.toFixed(3)}function we(a,e){let t=a,r=e;if(!t||!r)return 0;a instanceof i.Cartesian3||(t=y.parsePosition(a),t=g.transformWGS84ToCartesian(t)),e instanceof i.Cartesian3||(r=y.parsePosition(e),r=g.transformWGS84ToCartesian(r));let s=i.Transforms.eastNorthUpToFixedFrame(t),o=i.Cartesian3.subtract(r,t,new i.Cartesian3),n=i.Matrix4.multiplyByPointAsVector(i.Matrix4.inverse(s,new i.Matrix4),o,new i.Cartesian3),l=Math.atan2(n.y,n.x)-i.Math.PI_OVER_TWO;return l=i.Math.TWO_PI-i.Math.zeroToTwoPi(l),isNaN(l)?0:l}function at(a,e,t){return a=parseFloat(a)||0,a>=parseFloat(e)&&a<=parseFloat(t)}function G(a,e){return i.Cartesian3.midpoint(a,e,new i.Cartesian3)}function ps(a,e){let t=y.parsePosition(a),r=y.parsePosition(e);t=g.transformWGS84ToCartographic(t),r=g.transformWGS84ToCartographic(r);let s=new i.EllipsoidGeodesic(t,r).interpolateUsingFraction(.5);return new Z(i.Math.toDegrees(s.longitude),i.Math.toDegrees(s.latitude),s.height)}function ms(a,e,t=0,r=50){let s=[];t=Math.max(+t,100),r=Math.max(+r,50);let o=Math.abs(a.lng-e.lng),n=Math.abs(a.lat-e.lat),l=Math.max(o,n),h=l/r;if(o>n){let c=(e.lat-a.lat)/r;a.lng-e.lng>0&&(h=-h);for(let d=0;d<r;d++){let m=t-Math.pow(-.5*l+Math.abs(h)*d,2)*4*t/Math.pow(l,2),f=a.lng+h*d,u=a.lat+c*d;s.push([f,u,m])}}else{let c=(e.lng-a.lng)/r;a.lat-e.lat>0&&(h=-h);for(let d=0;d<r;d++){let m=t-Math.pow(-.5*l+Math.abs(h)*d,2)*4*t/Math.pow(l,2),f=a.lng+c*d,u=a.lat+h*d;s.push([f,u,m])}}return s.push([e.lng,e.lat,e.alt||0]),s}var{Math:yu}=i,eh={};v.merge(eh,yu,{area:ye,bounds:cs,center:ve,curve:ds,distance:te,heading:we,isBetween:at,midCartesian:G,midPosition:ps,parabola:ms});var us=class a extends w{constructor(e,t){super(),this._delegate=M.create("div","div-icon"),this._position=y.parsePosition(e),this._delegate.setAttribute("id",this._id),v.merge(this._delegate.style,{position:"absolute",top:"0",left:"0"}),this.content=t,this._state=_.INITIALIZED}get type(){return w.getOverlayType("div_icon")}set show(e){this._show=e,this._delegate.style.visibility=this._show?"visible":"hidden"}get show(){return this._show}set position(e){this._position=y.parsePosition(e)}get position(){return this._position}set content(e){if(e&&typeof e=="string")this._delegate.innerHTML=e;else if(e&&e instanceof Element){for(;this._delegate.hasChildNodes();)this._delegate.removeChild(this._delegate.firstChild);this._delegate.appendChild(e)}}get content(){return this._delegate.childNodes||[]}_updateStyle(e,t,r){if(!this._show||!e)return;let s=e.x-this._delegate.offsetWidth/2,o=e.y-this._delegate.offsetHeight/2;this._style.position==="topleft"?(s=e.x-this._delegate.offsetWidth,o=e.y-this._delegate.offsetHeight):this._style.position==="topright"?(s=e.x,o=e.y-this._delegate.offsetHeight):this._style.position==="bottomleft"?(s=e.x-this._delegate.offsetWidth,o=e.y):this._style.position==="bottomright"&&(s=e.x,o=e.y);let n=`translate3d(${Math.round(s)}px,${Math.round(o)}px, 0)`,l="scale3d(1,1,1)",h=this._style.scaleByDistance;if(t&&h){let m=h.near||0,f=h.nearValue||1,u=h.far||Number.MAX_VALUE,p=h.farValue||0,x=t/u;if(t<m)l=`scale3d(${f},${f},1)`;else if(t>u)l=`scale3d(${p},${p},1)`;else{let C=p+x*(f-p);l=`scale3d(${C},${C},1)`}}let c=!0,d=this._style.distanceDisplayCondition;t&&d&&(c=at(t,d.near||0,d.far||Number.MAX_VALUE)),this._delegate.style.transform=`${n} ${l}`,this._delegate.style.visibility=c&&r?"visible":"hidden"}_onAdd(e){this._layer=e,this._layer.delegate.appendChild(this._delegate);let t={layer:e,overlay:this,position:g.transformWGS84ToCartesian(this._position)};this._delegate.addEventListener("click",()=>{this._overlayEvent.fire(H.CLICK,t)}),this._delegate.addEventListener("mouseover",()=>{this._overlayEvent.fire(H.MOUSE_OVER,t)}),this._delegate.addEventListener("mouseout",()=>{this._overlayEvent.fire(H.MOUSE_OUT,t)}),this._state=_.ADDED}_onRemove(){this._layer&&(this._layer.delegate.removeChild(this._delegate),this._state=_.REMOVED)}setLabel(e,t){return this}setStyle(e){return!e||Object.keys(e).length===0?this:(v.merge(this._style,e),this._style.className&&M.addClass(this._delegate,this._style.className),this)}static fromEntity(e,t){var n;let r,s=i.JulianDate.now(),o=g.transformCartesianToWGS84(e.position.getValue(s));return r=new a(o,t),e.billboard&&(r.attr={...(n=e==null?void 0:e.properties)==null?void 0:n.getValue(s)}),r}};w.registerType("div_icon");var th=us;var _s=class a extends w{constructor(e,t){super(),this._delegate=new i.Entity({model:{}}),this._position=y.parsePosition(e),this._modelUrl=t,this._rotateAmount=0,this._state=_.INITIALIZED}get type(){return w.getOverlayType("model")}set position(e){this._position=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._position),this._rotateAmount===0&&(this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(g.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll))))}get position(){return this._position}set modelUrl(e){this._modelUrl=e,this._delegate.model.uri=this._modelUrl}get modelUrl(){return this._modelUrl}set rotateAmount(e){this._rotateAmount=+e,this._delegate.orientation=new i.CallbackProperty(()=>(this._position.heading+=this._rotateAmount,(this._position.heading>=360||this._position.heading<=-360)&&(this._position.heading=0),i.Transforms.headingPitchRollQuaternion(g.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))),!1)}get rotateAmount(){return this._rotateAmount}_mountedHook(){this.position=this._position,this.modelUrl=this._modelUrl}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.uri,v.merge(this._style,e),v.merge(this._delegate.model,e),this)}static fromEntity(e,t){let r=i.JulianDate.now(),s=g.transformCartesianToWGS84(e.position.getValue(r)),o=new a(s,t);return o.attr={...e.properties.getValue(r)},o}};w.registerType("model");var Ve=_s;var fs=class extends w{constructor(e,t={}){super(),this._delegate=i.I3SDataProvider.fromUrl(e,t),this._state=_.INITIALIZED}get type(){return w.getOverlayType("i3s")}ready(e){return this._delegate.then(e),this}setLabel(e,t){return console.warn("not support this function"),this}};w.registerType("i3s");var ih=fs;var gs=class extends w{constructor(e,t={}){super(),this._delegate=i.Cesium3DTileset.fromUrl(e,t),this._tilesetEvent=new Xi(this._delegate),this._tileVisibleCallback=void 0,this._properties=void 0,this._state=_.INITIALIZED}get type(){return w.getOverlayType("tileset")}set show(e){this._show=e,this._delegate.then(t=>{t.show=e})}_bindVisibleEvent(){this._tileVisibleCallback&&this._tileVisibleCallback(),this._tileVisibleCallback=this._delegate.then(e=>{e.tileVisible.addEventListener(this._updateTile,this)})}_updateTile(e){let t=e.content;for(let r=0;r<t.featuresLength;r++){let s=t.getFeature(r);this._properties&&this._properties.length&&this._properties.forEach(o=>{s.hasProperty(o.key)&&s.getProperty(o.key)===o.keyValue&&s.setProperty(o.propertyName,o.propertyValue)})}}ready(e){return this._delegate.then(e),this}setPosition(e){return e=y.parsePosition(e),this._delegate.then(t=>{let r=i.Transforms.eastNorthUpToFixedFrame(i.Cartesian3.fromDegrees(e.lng,e.lat,e.alt)),s=i.Matrix4.fromRotationTranslation(i.Matrix3.fromHeadingPitchRoll(new i.HeadingPitchRoll(i.Math.toRadians(e.heading),i.Math.toRadians(e.pitch),i.Math.toRadians(e.roll))));i.Matrix4.multiply(r,s,r),t.root.transform=r}),this}setHeadingPitchRoll(e,t,r){return this._delegate.then(s=>{let o=s.root.transform,n=i.Matrix4.fromRotationTranslation(i.Matrix3.fromHeadingPitchRoll(new i.HeadingPitchRoll(i.Math.toRadians(e||0),i.Math.toRadians(t||0),i.Math.toRadians(r||0))));i.Matrix4.multiply(o,n,o),s.root.transform=o}),this}setLabel(e,t){return console.warn("not support this function"),this}clampToGround(){return this._delegate.then(e=>{let t=i.Cartographic.fromCartesian(e.boundingSphere.center),r=i.Cartesian3.fromRadians(t.longitude,t.latitude,t.height),s=i.Cartesian3.fromRadians(t.longitude,t.latitude,0),o=i.Cartesian3.subtract(s,r,new i.Cartesian3);e.modelMatrix=i.Matrix4.fromTranslation(o)}),this}setHeight(e,t=!1){return this._delegate.then(r=>{let s=i.Cartographic.fromCartesian(r.boundingSphere.center),o=i.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),n=i.Cartesian3.fromRadians(s.longitude,s.latitude,t?e:s.height+e),l=i.Cartesian3.subtract(n,o,new i.Cartesian3);r.modelMatrix=i.Matrix4.fromTranslation(l)}),this}setScale(e){return this._delegate.then(t=>{let r=t.root.transform;e>0&&e!==1&&i.Matrix4.multiplyByUniformScale(r,e,r),t.root.transform=r}),this}setProperties(e){return this._properties=e,this._bindVisibleEvent(),this}setSplitDirection(e){return this._delegate.then(t=>{t.splitDirection=e}),this}setCustomShader(e){return this._delegate.then(t=>{t.customShader=e}),this}setClippingPolygons(e=null,t=!1){if(!e||e.length<3)return this._delegate.then(n=>{n.clippingPolygons&&(n.clippingPolygons.enabled=!1)}),this;let r=i.Cartesian3.fromDegreesArray(e),s=new i.ClippingPolygon({positions:r}),o=new i.ClippingPolygonCollection({polygons:[s],inverse:t});return this._delegate.then(n=>{n.clippingPolygons=o}),this}async setClippingPlanes(e=null,t=!1){if(!e||e.length<2)return this._delegate.then(S=>{S.clippingPlanes&&(S.clippingPlanes.enabled=!1)}),this;let r=i.Cartesian3.fromDegrees(e[1].lng,e[1].lat),s=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat),o=new i.Cartesian3((r.x+s.x)/2,(r.y+s.y)/2,(r.z+s.z)/2),n=i.Cartesian3.subtract(s,r,new i.Cartesian3),l=i.Cartesian3.cross(o,n,new i.Cartesian3),h=i.Cartesian3.normalize(l,new i.Cartesian3),c=await Promise.resolve(this._delegate),d=c.boundingSphere.center,m=c.boundingSphere.radius,f=i.Transforms.eastNorthUpToFixedFrame(d),u,p=c.root.transform;p.equals(i.Matrix4.IDENTITY)?(p=f,u=i.Matrix4.inverse(f,new i.Matrix4)):u=i.Matrix4.inverse(p,new i.Matrix4);let x=new i.Cartesian3(d.x-r.x,d.y-r.y,d.z-r.z),C=i.Cartesian3.dot(x,h),E=i.Matrix4.multiplyByPointAsVector(u,h,new i.Cartesian3),b=new i.ClippingPlane(E,C),R=new i.ClippingPlaneCollection({planes:[b],unionClippingRegions:t});return c.clippingPlanes=R,{center:d,size:m,distance:C,clippingPlanes:c.clippingPlanes}}setStyle(e){return e&&e instanceof i.Cesium3DTileStyle&&(this._style=e,this._delegate.then(t=>{t.style=e})),this}on(e,t,r){return this._overlayEvent.on(e,t,r||this),this._tilesetEvent.on(e,t,r||this),this}off(e,t,r){return this._overlayEvent.off(e,t,r||this),this._tilesetEvent.off(e,t,r||this),this}};w.registerType("tileset");var rh=gs;var wt=Math.PI/2,ys=class extends w{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({polygon:{}}),this.headHeightFactor=.18,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15,this.headTailFactor=.8,this._state=_.INITIALIZED}get type(){return w.getOverlayType("attack_arrow")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._getHierarchy()}get positions(){return this._positions}_getArrowHeadPoints(e,t,r){let s=T.getBaseLength(e),o=s*this.headHeightFactor,n=e[e.length-1];s=T.distance(n,e[e.length-2]);let l=T.distance(t,r);o>l*this.headTailFactor&&(o=l*this.headTailFactor);let h=o*this.headWidthFactor,c=o*this.neckWidthFactor;o=o>s?s:o;let d=o*this.neckHeightFactor,m=T.getThirdPoint(e[e.length-2],n,0,o,!0),f=T.getThirdPoint(e[e.length-2],n,0,d,!0),u=T.getThirdPoint(n,m,wt,h,!1),p=T.getThirdPoint(n,m,wt,h,!0),x=T.getThirdPoint(n,f,wt,c,!1),C=T.getThirdPoint(n,f,wt,c,!0);return[x,u,n,p,C]}_getArrowBodyPoints(e,t,r,s){let o=T.wholeDistance(e),l=T.getBaseLength(e)*s,h=T.distance(t,r),c=(l-h)/2,d=0,m=[],f=[];for(let u=1;u<e.length-1;u++){let p=T.getAngleOfThreePoints(e[u-1],e[u],e[u+1])/2;d+=T.distance(e[u-1],e[u]);let x=(l/2-d/o*c)/Math.sin(p),C=T.getThirdPoint(e[u-1],e[u],Math.PI-p,x,!0),E=T.getThirdPoint(e[u-1],e[u],p,x,!1);m.push(C),f.push(E)}return m.concat(f)}_getHierarchy(){let e=y.parsePolygonCoordToArray(this._positions)[0],t=e[0],r=e[1];T.isClockWise(e[0],e[1],e[2])&&(t=e[1],r=e[0]);let o=[T.mid(t,r)].concat(e.slice(2)),n=this._getArrowHeadPoints(o,t,r),l=n[0],h=n[4],c=T.distance(t,r)/T.getBaseLength(o),d=this._getArrowBodyPoints(o,l,h,c),m=d.length,f=[t].concat(d.slice(0,m/2));f.push(l);let u=[r].concat(d.slice(m/2,m));return u.push(h),f=T.getQBSplinePoints(f),u=T.getQBSplinePoints(u),new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(y.parsePositions(f.concat(n,u.reverse()))))}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,v.merge(this._style,e),v.merge(this._delegate.polygon,e),this)}};w.registerType("attack_arrow");var je=ys;var K=Math.PI/2,vs=class extends w{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({polygon:{}}),this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15,this._state=_.INITIALIZED}get type(){return w.getOverlayType("double_arrow")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._getHierarchy()}get positions(){return this._positions}_getArrowPoints(e,t,r,s){let o=T.mid(e,t),n=T.distance(o,r),l=T.getThirdPoint(r,o,0,n*.3,!0),h=T.getThirdPoint(r,o,0,n*.5,!0);l=T.getThirdPoint(o,l,K,n/5,s),h=T.getThirdPoint(o,h,K,n/4,s);let c=[o,l,h,r],d=this._getArrowHeadPoints(c),m=d[0],f=d[4],u=T.distance(e,t)/T.getBaseLength(c)/2,p=this._getArrowBodyPoints(c,m,f,u),x=p.length,C=p.slice(0,x/2),E=p.slice(x/2,x);return C.push(m),E.push(f),C=C.reverse(),C.push(t),E=E.reverse(),E.push(e),C.reverse().concat(d,E)}_getArrowHeadPoints(e){let r=T.getBaseLength(e)*this.headHeightFactor,s=e[e.length-1],o=r*this.headWidthFactor,n=r*this.neckWidthFactor,l=r*this.neckHeightFactor,h=T.getThirdPoint(e[e.length-2],s,0,r,!0),c=T.getThirdPoint(e[e.length-2],s,0,l,!0),d=T.getThirdPoint(s,h,K,o,!1),m=T.getThirdPoint(s,h,K,o,!0),f=T.getThirdPoint(s,c,K,n,!1),u=T.getThirdPoint(s,c,K,n,!0);return[f,d,s,m,u]}_getArrowBodyPoints(e,t,r,s){let o=T.wholeDistance(e),l=T.getBaseLength(e)*s,h=T.distance(t,r),c=(l-h)/2,d=0,m=[],f=[];for(let u=1;u<e.length-1;u++){let p=T.getAngleOfThreePoints(e[u-1],e[u],e[u+1])/2;d+=T.distance(e[u-1],e[u]);let x=(l/2-d/o*c)/Math.sin(p),C=T.getThirdPoint(e[u-1],e[u],Math.PI-p,x,!0),E=T.getThirdPoint(e[u-1],e[u],p,x,!1);m.push(C),f.push(E)}return m.concat(f)}_getTempPoint4(e,t,r){let s=T.mid(e,t),o=T.distance(s,r),n=T.getAngleOfThreePoints(e,s,r),l,h,c,d;return n<K?(h=o*Math.sin(n),c=o*Math.cos(n),d=T.getThirdPoint(e,s,K,h,!1),l=T.getThirdPoint(s,d,K,c,!0)):n>=K&&n<Math.PI?(h=o*Math.sin(Math.PI-n),c=o*Math.cos(Math.PI-n),d=T.getThirdPoint(e,s,K,h,!1),l=T.getThirdPoint(s,d,K,c,!1)):n>=Math.PI&&n<Math.PI*1.5?(h=o*Math.sin(n-Math.PI),c=o*Math.cos(n-Math.PI),d=T.getThirdPoint(e,s,K,h,!0),l=T.getThirdPoint(s,d,K,c,!0)):(h=o*Math.sin(Math.PI*2-n),c=o*Math.cos(Math.PI*2-n),d=T.getThirdPoint(e,s,K,h,!0),l=T.getThirdPoint(s,d,K,c,!1)),l}_getHierarchy(){let e=this._positions.length,t,r,s=y.parsePolygonCoordToArray(this._positions)[0],o=s[0],n=s[1],l=s[2];e===3?t=this._getTempPoint4(o,n,l):t=s[3],e===3||e===4?r=T.mid(o,n):r=s[4];let h,c;T.isClockWise(o,n,l)?(h=this._getArrowPoints(o,r,t,!1),c=this._getArrowPoints(r,n,l,!0)):(h=this._getArrowPoints(n,r,l,!1),c=this._getArrowPoints(r,o,t,!0));let d=h.length,m=(d-5)/2,f=h.slice(0,m),u=h.slice(m,m+5),p=h.slice(m+5,d),x=c.slice(0,m),C=c.slice(m,m+5),E=c.slice(m+5,d);x=T.getBezierPoints(x);let b=T.getBezierPoints(E.concat(f.slice(1)));return p=T.getBezierPoints(p),new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(y.parsePositions(x.concat(C,b,u,p))))}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,v.merge(this._style,e),v.merge(this._delegate.polygon,e),this)}};w.registerType("double_arrow");var Ct=vs;var sh=Math.PI/2,ws=class extends w{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({polygon:{}}),this.tailWidthFactor=.15,this.neckWidthFactor=.2,this.headWidthFactor=.25,this.headAngle=Math.PI/8.5,this.neckAngle=Math.PI/13,this._state=_.INITIALIZED}get type(){return w.getOverlayType("fine_arrow")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._getHierarchy()}get positions(){return this._positions}_getHierarchy(){let e=y.parsePolygonCoordToArray(this._positions)[0],t=e[0],r=e[1],s=T.getBaseLength(e),o=s*this.tailWidthFactor,n=s*this.neckWidthFactor,l=s*this.headWidthFactor,h=T.getThirdPoint(r,t,sh,o,!0),c=T.getThirdPoint(r,t,sh,o,!1),d=T.getThirdPoint(t,r,this.headAngle,l,!1),m=T.getThirdPoint(t,r,this.headAngle,l,!0),f=T.getThirdPoint(t,r,this.neckAngle,n,!1),u=T.getThirdPoint(t,r,this.neckAngle,n,!0);return new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(y.parsePositions([h,f,d,r,m,u,c])))}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,v.merge(this._style,e),v.merge(this._delegate.polygon,e),this)}};w.registerType("fine_arrow");var xt=ws;var vu=Math.PI/2,oh=100,Cs=class extends w{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({polygon:{}}),this.t=.4,this._state=_.INITIALIZED}get type(){return w.getOverlayType("gathering_place")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._getHierarchy()}get positions(){return this._positions}_getHierarchy(){let e=y.parsePolygonCoordToArray(this._positions)[0];if(this._positions.length===2){let n=T.mid(e[0],e[1]),l=T.distance(e[0],n)/.9,h=T.getThirdPoint(e[0],n,vu,l,!0);e=[e[0],h,e[1]]}let t=T.mid(e[0],e[2]);e.push(t,e[0],e[1]);let r=[];for(let n=0;n<e.length-2;n++){let l=e[n],h=e[n+1],c=e[n+2],d=T.getBisectorNormals(this.t,l,h,c);r=r.concat(d)}let s=r.length;r=[r[s-1]].concat(r.slice(0,s-1));let o=[];for(let n=0;n<e.length-2;n++){let l=e[n],h=e[n+1];o.push(l);for(let c=0;c<=oh;c++){let d=T.getCubicValue(c/oh,l,r[n*2],r[n*2+1],h);o.push(d)}o.push(h)}return new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(y.parsePositions(o)))}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,v.merge(this._style,e),v.merge(this._delegate.polygon,e),this)}};w.registerType("gathering_place");var Tt=Cs;var xs=class extends je{constructor(e){super(e),this._delegate=new i.Entity({polygon:{}}),this.headHeightFactor=.18,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15,this.tailWidthFactor=.1,this.headTailFactor=.8,this.swallowTailFactor=1,this._state=_.INITIALIZED}get type(){return w.getOverlayType("tailed_attack_arrow")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._getHierarchy()}get positions(){return this._positions}_getHierarchy(){let e=y.parsePolygonCoordToArray(this._positions)[0],t=e[0],r=e[1];T.isClockWise(e[0],e[1],e[2])&&(t=e[1],r=e[0]);let o=[T.mid(t,r)].concat(e.slice(2)),n=this._getArrowHeadPoints(o,t,r),l=n[0],h=n[4],c=T.distance(t,r),d=T.getBaseLength(o),m=d*this.tailWidthFactor*this.swallowTailFactor,f=T.getThirdPoint(o[1],o[0],0,m,!0),u=c/d,p=this._getArrowBodyPoints(o,l,h,u),x=p.length,C=[t].concat(p.slice(0,x/2));C.push(l);let E=[r].concat(p.slice(x/2,x));return E.push(h),C=T.getQBSplinePoints(C),E=T.getQBSplinePoints(E),new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(y.parsePositions(C.concat(n,E.reverse(),[f,C[0]]))))}};w.registerType("tailed_attack_arrow");var Et=xs;var Ts=class extends w{constructor(e,t){super(),this._position=y.parsePosition(e),this._icon=t,this._size=[32,32],this._delegate={position:void 0,image:void 0,width:0,height:0},this._state=_.INITIALIZED}get type(){return w.getOverlayType("billboard_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._position)}get position(){return this._position}set icon(e){this._icon=e,this._delegate.image=this._icon}get icon(){return this._icon}set size(e){if(!Array.isArray(e))throw new Error("Billboard Primitive: the size invalid");this._size=e,this._delegate.width=this._size[0]||32,this._delegate.height=this._size[1]||32}get size(){return this._size}_mountedHook(){this.position=this._position,this.icon=this._icon,this.size=this._size}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.position&&delete e.image&&delete e.width&&delete e.height,v.merge(this._style,e),v.merge(this._delegate,e),this)}};w.registerType("billboard_primitive");var Pt=Ts;var ah={maxOffsetY:10,offsetAmount:.1},Es=class extends Pt{constructor(e,t){super(e,t),this._currentOffset=new i.Cartesian2(0,0),this._isUp=!0,this._state=_.INITIALIZED}get type(){return w.getOverlayType("bounce_billboard_primitive")}update(e){var s,o;if(!this._show)return;let t=((s=this._style)==null?void 0:s.maxOffsetY)||ah.maxOffsetY,r=((o=this._style)==null?void 0:o.offsetAmount)||ah.offsetAmount;this._currentOffset.y>=0?this._isUp=!0:this._currentOffset.y<=-t&&(this._isUp=!1),this._currentOffset.y+=r*(this._isUp?-1:1),this._delegate.pixelOffset=this._currentOffset}destroy(){return i.destroyObject(this)}};w.registerType("bounce_billboard_primitive");var nh=Es;var Ps=class extends w{constructor(e,t){super(),this._position=y.parsePosition(e),this._text=t,this._delegate={position:void 0,text:void 0},this._state=_.INITIALIZED}get type(){return w.getOverlayType("label_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._position)}get position(){return this._position}set text(e){this._text=e,this._delegate.text=this._text}get text(){return this._text}_mountedHook(){this.position=this._position,this.text=this._text}setLabel(e,t){return this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.position&&delete e.text,v.merge(this._style,e),v.merge(this._delegate,e),this)}};w.registerType("label_primitive");var bt=Ps;var lh={maxOffsetY:10,offsetAmount:.1},bs=class extends bt{constructor(e,t){super(e,t),this._currentOffset=new i.Cartesian2(0,0),this._isUp=!0,this._state=_.INITIALIZED}get type(){return w.getOverlayType("bounce_label_primitive")}update(e){var s,o;if(!this._show)return;let t=((s=this._style)==null?void 0:s.maxOffsetY)||lh.maxOffsetY,r=((o=this._style)==null?void 0:o.offsetAmount)||lh.offsetAmount;this._currentOffset.y>=0?this._isUp=!0:this._currentOffset.y<=-t&&(this._isUp=!1),this._currentOffset.y+=r*(this._isUp?-1:1),this._delegate.pixelOffset=this._currentOffset}destroy(){return i.destroyObject(this)}};w.registerType("bounce_label_primitive");var hh=bs;var Ss=class extends w{constructor(e){super(),this._position=y.parsePosition(e),this._delegate={position:void 0,scale:{x:12,y:8}},this._state=_.INITIALIZED}get type(){return w.getOverlayType("cloud_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._position)}get position(){return this._position}_mountedHook(){this.position=this._position}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.position,v.merge(this._style,e),v.merge(this._delegate,e),this)}};w.registerType("cloud_primitive");var ch=Ss;var wu={minRadius:10,minHeight:30,color:i.Color.RED,slices:128,speed:10},As=class extends w{constructor(e,t,r){super(),this._center=y.parsePosition(e),this._delegate=void 0,this._height=r,this._radius=t,this._currentHeight=r||0,this._currentRadius=10,this._style={...wu},this._state=_.INITIALIZED}get type(){return w.getOverlayType("diffuse_wall_primitive")}set center(e){this._center=y.parsePosition(e)}get center(){return this._center}set radius(e){this._radius=e}get radius(){return this._radius}set height(e){this._height=e}get height(){return this._height}_getPositions(){let e=[],t=i.Transforms.eastNorthUpToFixedFrame(g.transformWGS84ToCartesian(this._center));for(let r=0;r<this._style.slices;r++){let s=r/this._style.slices*i.Math.TWO_PI,o=Math.cos(s),n=Math.sin(s),l=new i.Cartesian3(o*this._currentRadius,n*this._currentRadius,0);e.push(i.Matrix4.multiplyByPoint(t,l,new i.Cartesian3))}return e.push(e[0]),e}_getHeights(e,t){let r=[];for(let s=0;s<e;s++)r.push(t);return r}update(e){var s;if(this._delegate=this._delegate&&this._delegate.destroy(),this._currentRadius+=this._radius/this._style.speed/20,this._currentHeight-=this._height/this._style.speed/20,(this._currentRadius>this._radius||this._currentHeight<this._style.minHeight)&&(this._currentRadius=this._style.minRadius,this._currentHeight=this._height),!this._style.slices||this._style.slices<3)return!1;let t=this._getPositions();if(!t||!t.length)return!1;let r=new i.WallGeometry({positions:t,minimumHeights:this._getHeights(t.length,0),maximumHeights:this._getHeights(t.length,this._currentHeight)});this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:r}),appearance:new i.MaterialAppearance({material:i.Material.fromType("WallDiffuse",{color:(s=this._style)==null?void 0:s.color}),flat:!0}),asynchronous:!1}),this._delegate.update(e)}setStyle(e){return!e||Object.keys(e).length===0?this:(v.merge(this._style,e),this)}destroy(){return i.destroyObject(this)}};w.registerType("diffuse_wall_primitive");var dh=As;var Ms=class extends w{constructor(e,t){super(),this._position=y.parsePosition(e),this._radius=t||{x:10,y:10,z:10},this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("elec_ellipsoid_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.geometryInstances.modelMatrix=i.Transforms.eastNorthUpToFixedFrame(g.transformWGS84ToCartesian(this._position))}get position(){return this._position}set radius(e){this._radius=e,this._delegate.geometryInstances.geometry=new i.EllipsoidGeometry({radii:this._radius,maximumCone:i.Math.PI_OVER_TWO})}get radius(){return this._radius}_setAppearance(){var e,t;this._style&&(this._delegate.appearance=new i.MaterialAppearance({material:i.Material.fromType("EllipsoidElectric",{color:((e=this._style)==null?void 0:e.color)||i.Color.GREEN,speed:((t=this._style)==null?void 0:t.speed)||5})}))}_mountedHook(){this.radius=this._radius,this.position=this._position,!this._delegate.appearance&&this._setAppearance()}setLabel(e,t){return this}setStyle(e={}){return Object.keys(e).length===0?this:(v.merge(this._style,e),this._setAppearance(),this)}};w.registerType("elec_ellipsoid_primitive");var ph=Ms;var Is=class extends w{constructor(e,t=1){super(),this._positions=y.parsePositions(e),this._width=t,this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("flow_line_primitive")}set positions(e){this._positions=y.parsePositions(e),this._delegate.geometryInstances.geometry=new i.PolylineGeometry({positions:g.transformWGS84ArrayToCartesianArray(this._positions),width:this._width})}get positions(){return this._positions}_setAppearance(){var e,t,r,s;this._delegate.appearance=new i.PolylineMaterialAppearance({material:i.Material.fromType("PolylineFlow",{color:((e=this._style)==null?void 0:e.color)||new i.Color(1,0,0,.7),speed:((t=this._style)==null?void 0:t.speed)||1,percent:((r=this._style)==null?void 0:r.percent)||.03,gradient:((s=this._style)==null?void 0:s.gradient)||.1})})}_mountedHook(){this.positions=this._positions,!this._delegate.appearance&&this._setAppearance()}setLabel(e,t){return this}setStyle(e={}){return Object.keys(e).length===0?this:(v.merge(this._style,e),e.classificationType&&(this._delegate.classificationType=this._style.classificationType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fUL/7IFjIzrLGpemBQ0kPbehL6I9vMjUh6oEVEAAIQgAAEIAABdpyj0qcK71YrqGUJANNrv+sHOcAiRpDDM1cTY1BEHk7kqyP/2Ac5vLEEQEG8aDnIoTb5ObZRWg5ywG5o1dX4ClNYxT7IISgJPsXGpLut9MCWU0S5bqkmdAa3LQEwcZDAfkZ3tthQfkwNkVeeD6kiuaUabcp6DpS9YyalrAdQ8bT1EFQVUabarND9fNuyB2gREYAABCAAAQhAAAIQoM770UgBXARCIr/koDogVlzgrWuxemBKd0m4JnBed0+5ZQ9gn3BK5LK+P4y5ewoB8DFiKO91COLFfwVuTCZV1hSoYw1APZCsFIkbN1Haaa87wwiKQe6eT27AEX6esPVVd8/kOOdAz/oz9FE0p+uGIKUeqE5C8xgSKiICEIAABCAAAQhAAAIQgAAEIAABCECA6AA+sbkREyDUUYlKD6ggZwzRkr8tewBhusisv+0in5qE/hFchoZTE0TL4p8sTbtIpyahQ4Ag5fKpSVBmfdDECvQTZjoM0U9N6KgkwH9xY7PXpPiCmq5yuaLVldHIO7jgNi5XfOEhCqNh9udHV/RnC5YAUDTftdV4/ivvwEoRVS9XXPWa1FIT5ird8jpSB+BDN3rO8AaGMnGy0I0QRYTvdk6NkOsucuhGCMAgI8Q0isaHbmAevNMhiD4P6iZhstANGiQE2PEGCRo2NcgAsQDwKnxWFdlT17/duWU1BJmuHz6A5bwbEsCScgh+qAHit3Jr1oooOPExdRBLbeJjSpuwuy30AAH+CDAAPH5ltESNYl4AAAAASUVORK5CYII=";var Cu={color:i.Color.ORANGE},Ls=class extends w{constructor(e,t,r,s){super(),this._center=y.parsePosition(e),this._length=t||100,this._topRadius=r||1,this._bottomRadius=s||50,this._delegate=new i.PrimitiveCollection,this._style={...Cu},this._state=_.INITIALIZED}get type(){return w.getOverlayType("light-cylinder-primitive")}set center(e){this._center=y.parsePosition(e),this._updatePrimitives()}get center(){return this._center}set length(e){this._length=e,this._updatePrimitives()}get length(){return this._length}set topRadius(e){this._topRadius=e,this._updatePrimitives()}get topRadius(){return this._topRadius}set bottomRadius(e){this._bottomRadius=e,this._updatePrimitives()}get bottomRadius(){return this._bottomRadius}_computeEllipsePositions(e,t){let r=i.EllipseGeometryLibrary.computeEllipsePositions({center:g.transformWGS84ToCartesian(e),semiMajorAxis:t,semiMinorAxis:t,rotation:0,granularity:.005},!1,!0),s=i.Cartesian3.unpackArray(r.outerPositions);return s.push(s[0]),s}_createCylinderInstance(e,t,r){let s=t.slice(),o=t.length,n=2*o,l=[],h=1/(o-1),c=[],d=[],m=(u,p=0)=>{let x=i.Cartographic.fromCartesian(u);return x.height+=p,i.Cartographic.toCartesian(x)};for(let u=0;u<o;u++){d.push(m(e[u],r)),l.push(u*h,0);let p=u+1,x=(u+1)%o,C=n-p;c.push(C-1,C,u),c.push(u,x,C-1)}for(let u in d)s.push(d[o-u-1]),l.push(1-u*h,1);let f=i.PolygonGeometry.createGeometry(new i.PolygonGeometry({polygonHierarchy:new i.PolygonHierarchy(s),perPositionHeight:!0}));return f.indices=c,f.attributes.st.values=l,new i.GeometryInstance({geometry:f})}_getCircleImage(){let e=document.createElement("canvas");e.width=512,e.height=512;let t=e.getContext("2d");return t.fillStyle="rgba(255,255,255,0)",t.strokeStyle="rgba(255, 255, 255,255)",t.setLineDash([50,50]),t.lineWidth=30,t.beginPath(),t.arc(256,256,150,0,Math.PI*2,!0),t.stroke(),t.restore(),e}_getParticlesImage(e){let t=document.createElement("canvas");t.width=64,t.height=256;let r=t.getContext("2d");return r.clearRect(0,0,64,256),r.drawImage(e,0,0),r.drawImage(e,33,0),t}_updatePrimitives(){this._delegate.removeAll();let e=this._center.alt===0,t=this._computeEllipsePositions(this._center,this._topRadius),r=this._computeEllipsePositions(this._center,this._bottomRadius*.7),s=this._computeEllipsePositions(this._center,this._bottomRadius),o={geometryInstances:new i.GeometryInstance({geometry:new i.PolygonGeometry({polygonHierarchy:new i.PolygonHierarchy(this._computeEllipsePositions(this._center,this._bottomRadius*2)),perPositionHeight:!e}),asynchronous:!1})},n=e?new i.GroundPrimitive(o):new i.Primitive(o);n.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType(i.Material.CircleRingType,{color:this._style.color})});let l=e?new i.GroundPrimitive(o):new i.Primitive(o);l.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType(i.Material.CircleRotateType,{color:this._style.color,image:this._getCircleImage()})});let h=new i.Primitive({geometryInstances:this._createCylinderInstance(t,r,this._length),appearance:new i.EllipsoidSurfaceAppearance({material:i.Material.fromType(i.Material.CylinderFadeType,{color:this._style.color})}),asynchronous:!1});e?i.GroundPrimitive.initializeTerrainHeights().then(()=>{this._delegate.add(n),this._delegate.add(l),this._delegate.add(h)}):(this._delegate.add(n),this._delegate.add(l),this._delegate.add(h)),i.Resource.fetchImage({url:uh}).then(c=>{let d=new i.Primitive({geometryInstances:this._createCylinderInstance(t,s,this._length),appearance:new i.EllipsoidSurfaceAppearance({material:i.Material.fromType(i.Material.CylinderParticlesType,{color:this._style.color,image:this._getParticlesImage(c)})}),asynchronous:!1});this._delegate.add(d)})}_mountedHook(){this.center=this._center}update(e){this._delegate.update(e)}setStyle(e){return!e||Object.keys(e).length===0?this:(v.merge(this._style,e),this)}destroy(){return i.destroyObject(this)}};w.registerType("light-cylinder-primitive");var _h=Ls;var Ds=class extends w{constructor(e,t){super(),this._position=y.parsePosition(e),this._modelUrl=t,this._delegate=i.Model.fromGltfAsync({url:t}),this._modelEvent=new $i(this._delegate),this._state=_.INITIALIZED}get type(){return w.getOverlayType("model_primitive")}set position(e){this._position=y.parsePosition(e);let t=g.transformWGS84ToCartesian(this._position);this._delegate.then(r=>{r.modelMatrix=i.Transforms.headingPitchRollToFixedFrame(t,new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))})}get position(){return this._position}set modelUrl(e){this._modelUrl=e,this._delegate=i.Model.fromGltfAsync({url:e,...this._style}),this.position=this._position}get modelUrl(){return this._modelUrl}_mountedHook(){this.position=this._position}setStyle(e){return!e||Object.keys(e).length===0?this:(v.merge(this._style,e),this._delegate.then(t=>{v.merge(t,e)}),this)}on(e,t,r){return this._overlayEvent.on(e,t,r||this),this._modelEvent.on(e,t,r||this),this}off(e,t,r){return this._overlayEvent.off(e,t,r||this),this._modelEvent.off(e,t,r||this),this}};w.registerType("model_primitive");var fh=Ds;var gh={pixelSize:8,outlineColor:i.Color.BLUE,outlineWidth:2},Rs=class extends w{constructor(e){super(),this._position=y.parsePosition(e),this._delegate={position:void 0},this._state=_.INITIALIZED}get type(){return w.getOverlayType("point_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._position)}get position(){return this._position}_mountedHook(){this.position=this._position,v.merge(this._delegate,gh,this._style)}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.position,v.merge(this._style,e),v.merge(this._delegate,gh,this._style),this)}};w.registerType("point_primitive");var yh=Rs;var Os=class extends w{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate={positions:[]},this._state=_.INITIALIZED}get type(){return w.getOverlayType("polyline_primitive")}set positions(e){this._positions=y.parsePositions(e),this._delegate.positions=g.transformWGS84ArrayToCartesianArray(this._positions)}get positions(){return this._positions}get center(){return ve(this._positions)}get distance(){return te(this._positions)}_mountedHook(){this.positions=this._positions}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.positions,v.merge(this._style,e),v.merge(this._delegate,e),this)}};w.registerType("polyline_primitive");var vh=Os;var _P={color:i.Color.WHITE},ks=class extends w{constructor(e){super(),this._positions=e,this._geometryInstances=[],this._getGeometryInstances(),this._delegate=new i.Primitive({geometryInstances:this._geometryInstances,shadows:i.ShadowMode.ENABLED}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("polygon_primitive")}set positions(e){this._positions=e}get positions(){return this._positions}get geometryInstances(){return this._geometryInstances}_getGeometryInstances(){var e,t,r,s,o;for(let n=0;n<this._positions.length;n++){let l=this._positions[n].style,h=y.parsePositions(this._positions[n].positions),c=new i.PolygonGeometry({polygonHierarchy:new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(h)),height:(l==null?void 0:l.height)||0,extrudedHeight:(l==null?void 0:l.extrudedHeight)||0,stRotation:(l==null?void 0:l.stRotation)||0,closeTop:(l==null?void 0:l.closeTop)||!0,closeBottom:(l==null?void 0:l.closeBottom)||!0,vertexFormat:i.MaterialAppearance.VERTEX_FORMAT}),d=new i.GeometryInstance({geometry:c,attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(((e=this._style)==null?void 0:e.color)||i.Color.WHITE),distanceDisplayCondition:new i.DistanceDisplayConditionGeometryInstanceAttribute(((r=(t=this._style)==null?void 0:t.distanceDisplayCondition)==null?void 0:r.near)||0,((o=(s=this._style)==null?void 0:s.distanceDisplayCondition)==null?void 0:o.far)||Number.MAX_VALUE)}});this._geometryInstances.push(d)}}_setAppearance(){var e,t,r,s;this._style&&(this._delegate.appearance=new i.MaterialAppearance({material:i.Material.fromType("Color",{color:((e=this._style)==null?void 0:e.color)||i.Color.WHITE}),closed:((t=this._style)==null?void 0:t.closed)||!1,translucent:((r=this._style)==null?void 0:r.translucent)||!1,flat:((s=this._style)==null?void 0:s.flat)||!1}))}_mountedHook(){this.positions=this._positions,!this._delegate.appearance&&this._setAppearance()}setStyle(e={}){return Object.keys(e).length===0?this:(delete e.positionsArr,v.merge(this._style,e),this._setAppearance(),this)}};w.registerType("polygon_primitive");var wh=ks;var TP={color:i.Color.WHITE},Ns=class extends w{constructor(e,t,r,s){super(),this._positions=y.parsePositions(e),this._dimensions=new i.Cartesian3(t/1e3,r/1e3,s/1e3),this._length=t,this._width=r,this._height=s,this._boxGeometry=i.BoxGeometry.fromDimensions({vertexFormat:i.PerInstanceColorAppearance.VERTEX_FORMAT,dimensions:this._dimensions}),this._geometryInstances=[],this._getGeometryInstances(),this._delegate=new i.Primitive({geometryInstances:this._geometryInstances}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("box_primitive")}set positions(e){this._positions=y.parsePositions(e)}get positions(){return this._positions}get geometryInstances(){return this._geometryInstances}_getGeometryInstances(){var e,t,r,s,o;for(let n=0;n<this._positions.length;n++){let l=this._positions[n],h=i.Matrix4.multiplyByUniformScale(i.Transforms.eastNorthUpToFixedFrame(g.transformWGS84ToCartesian(l)),500,new i.Matrix4),c=new i.GeometryInstance({geometry:this._boxGeometry,modelMatrix:h,attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(((e=this._style)==null?void 0:e.color)||i.Color.WHITE),distanceDisplayCondition:new i.DistanceDisplayConditionGeometryInstanceAttribute(((r=(t=this._style)==null?void 0:t.distanceDisplayCondition)==null?void 0:r.near)||0,((o=(s=this._style)==null?void 0:s.distanceDisplayCondition)==null?void 0:o.far)||Number.MAX_VALUE)}});this._geometryInstances.push(c)}}setAddPosition(e){var o,n,l,h;let t=y.parsePosition(e),r=i.Matrix4.multiplyByUniformScale(i.Transforms.eastNorthUpToFixedFrame(g.transformWGS84ToCartesian(t)),500,new i.Matrix4),s=new i.GeometryInstance({geometry:this._boxGeometry,modelMatrix:r,attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(i.Color.RED),distanceDisplayCondition:new i.DistanceDisplayConditionGeometryInstanceAttribute(((n=(o=this._style)==null?void 0:o.distanceDisplayCondition)==null?void 0:n.near)||0,((h=(l=this._style)==null?void 0:l.distanceDisplayCondition)==null?void 0:h.far)||Number.MAX_VALUE)}});this._geometryInstances.push(s)}_setAppearance(){var e,t,r,s,o,n,l,h;if(this._style&&(this._delegate.appearance=new i.PerInstanceColorAppearance({flat:((e=this._style)==null?void 0:e.flat)||!1,translucent:((t=this._style)==null?void 0:t.translucent)||!1,closed:((r=this._style)==null?void 0:r.closed)||!1}),!!this._delegate.geometryInstances))for(let c=0;c<this._delegate.geometryInstances.length;c++)this._delegate.geometryInstances[c].attributes={color:i.ColorGeometryInstanceAttribute.fromColor(((s=this._style)==null?void 0:s.color)||i.Color.WHITE),distanceDisplayCondition:new i.DistanceDisplayConditionGeometryInstanceAttribute(((n=(o=this._style)==null?void 0:o.distanceDisplayCondition)==null?void 0:n.near)||0,((h=(l=this._style)==null?void 0:l.distanceDisplayCondition)==null?void 0:h.far)||Number.MAX_VALUE)}}_mountedHook(){this.positions=this._positions,!this._delegate.appearance&&this._setAppearance()}setStyle(e={}){return Object.keys(e).length===0?this:(delete e.positions,v.merge(this._style,e),this._setAppearance(),this)}};w.registerType("box_primitive");var Ch=Ns;var Fs=class extends w{constructor(e,t,r,s){var h,c,d,m,f;super(),this._positions=y.parsePositions(e),this._length=t,this._width=r,this._height=s;let o=i.BoxOutlineGeometry.fromDimensions({dimensions:new i.Cartesian3(t,r,s)}),n=i.BoxOutlineGeometry.createGeometry(o),l=[];for(let u=0;u<this._positions.length;u++){let p=this._positions[u],x=new i.GeometryInstance({geometry:n,modelMatrix:i.Transforms.eastNorthUpToFixedFrame(g.transformWGS84ToCartesian(p)),attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(((h=this._style)==null?void 0:h.color)||i.Color.WHITE),distanceDisplayCondition:new i.DistanceDisplayConditionGeometryInstanceAttribute(((d=(c=this._style)==null?void 0:c.distanceDisplayCondition)==null?void 0:d.near)||0,((f=(m=this._style)==null?void 0:m.distanceDisplayCondition)==null?void 0:f.far)||Number.MAX_VALUE)}});l.push(x)}this._delegate=new i.Primitive({geometryInstances:l}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("box_outline_primitive")}set positions(e){this._positions=y.parsePositions(e)}get positions(){return this._positions}_setAppearance(){var e,t,r,s,o,n,l,h;if(this._style){this._delegate.appearance=new i.PerInstanceColorAppearance({flat:((e=this._style)==null?void 0:e.flat)||!1,translucent:((t=this._style)==null?void 0:t.translucent)||!1,closed:((r=this._style)==null?void 0:r.closed)||!1});for(let c=0;c<this._delegate.geometryInstances.length;c++)this._delegate.geometryInstances[c].attributes={color:i.ColorGeometryInstanceAttribute.fromColor(((s=this._style)==null?void 0:s.color)||i.Color.WHITE),distanceDisplayCondition:new i.DistanceDisplayConditionGeometryInstanceAttribute(((n=(o=this._style)==null?void 0:o.distanceDisplayCondition)==null?void 0:n.near)||0,((h=(l=this._style)==null?void 0:l.distanceDisplayCondition)==null?void 0:h.far)||Number.MAX_VALUE)}}}_mountedHook(){this.radius=this._radius,this.position=this._position,!this._delegate.appearance&&this._setAppearance()}setStyle(e={}){return!e||Object.keys(e).length===0?this:(v.merge(this._style,e),v.merge(this._delegate,e),this._setAppearance(),this)}};w.registerType("box_outline_primitive");var xh=Fs;var Hs=class extends w{constructor(e,t){super(),this._position=y.parsePosition(e),this._radius=t,this._delegate=new i.GroundPrimitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("scan_circle_primitive")}set position(e){this._position=y.parsePosition(e),this._delegate.geometryInstances.geometry=new i.EllipseGeometry({center:g.transformWGS84ToCartesian(this._position),semiMajorAxis:this._radius,semiMinorAxis:this._radius})}get position(){return this._position}set radius(e){this._radius=e,this._delegate.geometryInstances.geometry.semiMajorAxis=this._radius,this._delegate.geometryInstances.geometry.semiMinorAxis=this._radius}get radius(){return this._radius}_setAppearance(){var e,t;this._style&&(this._delegate.appearance=new i.MaterialAppearance({material:i.Material.fromType("CircleScan",{color:((e=this._style)==null?void 0:e.color)||i.Color.WHITE,speed:((t=this._style)==null?void 0:t.speed)||10})}))}_mountedHook(){this.position=this._position,!this._delegate.appearance&&this._setAppearance()}setStyle(e={}){return Object.keys(e).length===0?this:(v.merge(this._style,e),e.classificationType&&(this._delegate.classificationType=this._style.classificationType),this._setAppearance(),this)}};w.registerType("scan_circle_primitive");var Th=Hs;var zs=class extends w{constructor(e,t=1){super(),this._positions=y.parsePositions(e),this._width=t,this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("trail_line_primitive")}set positions(e){this._positions=y.parsePositions(e),this._delegate.geometryInstances.geometry=new i.PolylineGeometry({positions:g.transformWGS84ArrayToCartesianArray(this._positions),width:this._width})}get positions(){return this._positions}_setAppearance(){var e,t;this._delegate.appearance=new i.PolylineMaterialAppearance({material:i.Material.fromType("PolylineTrail",{color:((e=this._style)==null?void 0:e.color)||new i.Color(1,0,0,.7),speed:((t=this._style)==null?void 0:t.speed)||5})})}_mountedHook(){this.positions=this._positions,!this._delegate.appearance&&this._setAppearance()}setStyle(e={}){return Object.keys(e).length===0?this:(v.merge(this._style,e),e.classificationType&&(this._delegate.classificationType=this._style.classificationType),this._setAppearance(),this)}};w.registerType("trail_line_primitive");var Eh=zs;var Ws=class extends w{constructor(e,t){super(),this._positions=y.parsePositions(e),this._delegate=new i.GroundPrimitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._video=t,this._state=_.INITIALIZED}get type(){return w.getOverlayType("video_primitive")}set positions(e){var t,r,s,o;this._positions=y.parsePositions(e),this._delegate.geometryInstances.geometry=i.PolygonGeometry.fromPositions({positions:g.transformWGS84ArrayToCartesianArray(this._positions),height:(t=this._style)==null?void 0:t.height,extrudedHeight:(r=this._style)==null?void 0:r.extrudedHeight,closeTop:(s=this._style)==null?void 0:s.closeTop,closeBottom:(o=this._style)==null?void 0:o.closeBottom,vertexFormat:i.EllipsoidSurfaceAppearance.VERTEX_FORMAT})}get positions(){return this._positions}set video(e){this._video=e,this._setAppearance()}get video(){return this._video}_setAppearance(){this._delegate.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType("Image",{image:this._video})})}_mountedHook(){this.positions=this._positions,this.video=this._video}setStyle(e){var t;return Object.keys(e).length===0?this:(v.merge(this._style,e),(t=this._style)!=null&&t.classificationType&&(this._delegate.classificationType=this._style.classificationType),this)}};w.registerType("video_primitive");var Ph=Ws;var Gs=class extends w{constructor(e,t,r){super(),this._viewer=e,this._horizontalViewAngle=t.horizontalViewAngle||60,this._verticalViewAngle=t.verticalViewAngle||40,this._viewPosition=t.viewPosition,this._viewPositionEnd=t.viewPositionEnd,this._viewDistance=null,this._lightCamera=null,this._viewHeading=null,this._viewPitch=null,this._orientation=null,this._outLinePrimitive=null,this._outline=!1,this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}})}),this._video=r,this._init(),this._state=_.INITIALIZED}get type(){return w.getOverlayType("video_primitive")}set positions(e){this._createGeometry()}get positions(){return this._positions}set video(e){this._video=e,this._setAppearance()}get video(){return this._video}set outline(e){this._outline=e,this._outLinePrimitive.show=e}get outline(){return this._outline}_init(){this._viewDistance=i.Cartesian3.distance(this._viewPosition,this._viewPositionEnd),this._viewHeading=this._getHeading(this._viewPosition,this._viewPositionEnd),this._viewPitch=this._getPitch(this._viewPosition,this._viewPositionEnd),this._createLightCamera()}_createLightCamera(){this._lightCamera=new i.Camera(this._viewer.scene),this._lightCamera.position=this._viewPosition,this._lightCamera.frustum.near=this._viewDistance*1e-4,this._lightCamera.frustum.far=this._viewDistance;let e=i.Math.toRadians(this._horizontalViewAngle),t=i.Math.toRadians(this._verticalViewAngle),r=this._viewDistance*Math.tan(e/2)*2/(this._viewDistance*Math.tan(t/2)*2);this._lightCamera.frustum.aspectRatio=r,e>t?this._lightCamera.frustum.fov=e:this._lightCamera.frustum.fov=t,this._lightCamera.setView({destination:this._viewPosition,orientation:{heading:i.Math.toRadians(this._viewHeading||0),pitch:i.Math.toRadians(this._viewPitch||0),roll:0}})}_createGeometry(){let e=new i.Cartesian3,t=new i.Matrix3,r=new i.Quaternion,s=this._lightCamera.directionWC,o=this._lightCamera.upWC,n=this._lightCamera.rightWC;n=i.Cartesian3.negate(n,e);let l=t;i.Matrix3.setColumn(l,0,n,l),i.Matrix3.setColumn(l,1,o,l),i.Matrix3.setColumn(l,2,s,l),this._orientation=i.Quaternion.fromRotationMatrix(l,r);let h=this._lightCamera.frustum.clone();h.near=h.far-.01,this._delegate.geometryInstances.geometry=new i.FrustumGeometry({frustum:h,origin:this._viewPosition,orientation:this._orientation}),this._setOutlineGeometry()}_setAppearance(){this._delegate.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType("Image",{image:this._video})})}_mountedHook(){this.positions=this._positions,this.video=this._video}setStyle(e){var t;return Object.keys(e).length===0?this:(v.merge(this._style,e),(t=this._style)!=null&&t.classificationType&&(this._delegate.classificationType=this._style.classificationType),this)}_getHeading(e,t){let r=new i.Cartesian3,s=i.Transforms.eastNorthUpToFixedFrame(e);return i.Matrix4.inverse(s,s),i.Matrix4.multiplyByPoint(s,t,r),i.Cartesian3.normalize(r,r),i.Math.toDegrees(Math.atan2(r.x,r.y))}_getPitch(e,t){let r=new i.Cartesian3,s=i.Transforms.eastNorthUpToFixedFrame(e);return i.Matrix4.inverse(s,s),i.Matrix4.multiplyByPoint(s,t,r),i.Cartesian3.normalize(r,r),i.Math.toDegrees(Math.asin(r.z))}_setOutlineGeometry(e=""){let t=new i.GeometryInstance({geometry:new i.FrustumOutlineGeometry({frustum:this._lightCamera.frustum,origin:this._viewPosition,orientation:this._orientation}),attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(e?i.Color.fromCssColorString(e):i.Color.BLUE)}});this._outLinePrimitive=new i.Primitive({geometryInstances:[t],appearance:new i.PerInstanceColorAppearance({flat:!0})}),this._outLinePrimitive.show=this._outline,this._viewer.scene.primitives.add(this._outLinePrimitive)}};w.registerType("video_projection_primitive");var bh=Gs;function Sh(a,e){if(!a)return e;if(a instanceof i.Color)return a;if(typeof a=="string")try{return i.Color.fromCssColorString(a)}catch{return e}return e}var Us=class extends w{constructor(e,t=[]){super(),this._positions=y.parsePositions(e),this._holes=t.map(r=>y.parsePositions(r)),this._delegate=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}}),asynchronous:!1}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("water_primitive")}set positions(e){var o,n,l,h;this._positions=y.parsePositions(e);let t=this._positions,r=t.some(c=>{var d;return Number.isFinite(Number((d=c==null?void 0:c.alt)!=null?d:c==null?void 0:c.height))}),s=new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(t),this._holes.map(c=>new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(c))));this._delegate.geometryInstances.geometry=new i.PolygonGeometry({polygonHierarchy:s,perPositionHeight:r,height:r||(o=this._style)==null?void 0:o.height,extrudedHeight:r||(n=this._style)==null?void 0:n.extrudedHeight,closeTop:(l=this._style)==null?void 0:l.closeTop,closeBottom:(h=this._style)==null?void 0:h.closeBottom,vertexFormat:i.EllipsoidSurfaceAppearance.VERTEX_FORMAT})}get positions(){return this._positions}_setAppearance(){var o,n,l,h,c,d,m,f;if(!this._style)return;let e=new i.Color(.2,.3,.6,1),t=new i.Color(0,1,.699,1),r=Sh((o=this._style)==null?void 0:o.baseWaterColor,e),s=Sh((n=this._style)==null?void 0:n.blendColor,t);try{this._delegate.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType("Water",{baseWaterColor:r,blendColor:s,specularMap:((l=this._style)==null?void 0:l.specularMap)||i.Material.DefaultImageId,normalMap:((h=this._style)==null?void 0:h.normalMap)||i.Material.DefaultImageId,frequency:((c=this._style)==null?void 0:c.frequency)||1e3,animationSpeed:((d=this._style)==null?void 0:d.animationSpeed)||.01,amplitude:((m=this._style)==null?void 0:m.amplitude)||10,specularIntensity:((f=this._style)==null?void 0:f.specularIntensity)||.5})})}catch{this._delegate.appearance=new i.EllipsoidSurfaceAppearance({material:i.Material.fromType("Water",{baseWaterColor:e,blendColor:t})})}}_mountedHook(){this.positions=this._positions,!this._delegate.appearance&&this._setAppearance()}setStyle(e){var t;return Object.keys(e).length===0?this:(v.merge(this._style,e),(t=this._style)!=null&&t.classificationType&&(this._delegate.classificationType=this._style.classificationType),this._setAppearance(),this)}};w.registerType("water_primitive");var St=Us;var Bs=class a extends w{constructor(e,t){super(),this._delegate=new i.Entity({billboard:{}}),this._position=y.parsePosition(e),this._icon=t,this._size=[32,32],this._state=_.INITIALIZED}get type(){return w.getOverlayType("billboard")}set position(e){this._position=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._position)}get position(){return this._position}set icon(e){this._icon=e,this._delegate.billboard.image=this._icon}get icon(){return this._icon}set size(e){if(!Array.isArray(e))throw new Error("Billboard: the size invalid");this._size=e,this._delegate.billboard.width=this._size[0]||32,this._delegate.billboard.height=this._size[1]||32}get size(){return this._size}_mountedHook(){this.position=this._position,this.icon=this._icon,this.size=this._size}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.image&&delete e.width&&delete e.height,v.merge(this._style,e),v.merge(this._delegate.billboard,e),this)}static fromEntity(e){var o;let t,r=i.JulianDate.now(),s=g.transformCartesianToWGS84(e.position.getValue(r));return e.billboard&&(t=new a(s,e.billboard.image.getValue(r)),t.attr={...(o=e==null?void 0:e.properties)==null?void 0:o.getValue(r)}),t}};w.registerType("billboard");var Me=Bs;var Vs=class extends w{constructor(e,t,r,s){super(),this._position=y.parsePosition(e),this._length=t,this._width=r,this._height=s,this._delegate=new i.Entity({box:{dimensions:{x:+this._length,y:+this._width,z:+this._height}}}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("box")}set position(e){this._position=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._position),this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(g.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))}get position(){return this._position}set length(e){let t=this._delegate.box.dimensions.getValue();this._length=e||0,t.x=+this._length,this._delegate.box.dimensions.setValue(t)}get length(){return this._length}set width(e){let t=this._delegate.box.dimensions.getValue();this._width=e||0,t.y=+this._width,this._delegate.box.dimensions.setValue(t)}get width(){return this._width}set height(e){let t=this._delegate.box.dimensions.getValue();this._height=e||0,t.z=+this._height,this._delegate.box.dimensions.setValue(t)}get height(){return this._height}_mountedHook(){this.position=this._position}setStyle(e){return Object.keys(e).length===0?this:(delete e.length&&delete e.width&&delete e.height,v.merge(this._style,e),v.merge(this._delegate.box,e),this)}};w.registerType("box");var Ah=Vs;var js=class extends w{constructor(e,t){super(),this._delegate=new i.Entity({ellipse:{}}),this._center=y.parsePosition(e),this._radius=+t||0,this._rotateAmount=0,this._stRotation=0,this._state=_.INITIALIZED}get type(){return w.getOverlayType("circle")}set center(e){this._center=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._center)}get center(){return this._center}set radius(e){this._radius=+e,this._delegate.ellipse.semiMajorAxis=this._radius,this._delegate.ellipse.semiMinorAxis=this._radius}get radius(){return this._radius}set rotateAmount(e){this._rotateAmount=+e,this._delegate.ellipse.stRotation=new i.CallbackProperty(()=>(this._stRotation+=this._rotateAmount,(this._stRotation>=360||this._stRotation<=-360)&&(this._stRotation=0),i.Math.toRadians(this._stRotation)),!1)}get rotateAmount(){return this._rotateAmount}_mountedHook(){this.center=this._center,this.radius=this._radius}setLabel(e,t){return this._delegate.position=g.transformWGS84ToCartesian(this._center),this._delegate.label={...t,text:e},this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.center,v.merge(this._style,e),v.merge(this._delegate.ellipse,e),this)}};w.registerType("circle");var At=js;var Ys=class a extends w{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({corridor:{}}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("corridor")}set positions(e){this._positions=y.parsePositions(e),this._delegate.corridor.positions=g.transformWGS84ArrayToCartesianArray(this._positions)}get positions(){return this._positions}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,v.merge(this._style,e),v.merge(this._delegate.corridor,e),this)}static fromEntity(e){var s;let t,r=i.JulianDate.now();if(e.polyline){let o=g.transformCartesianArrayToWGS84Array(e.polyline.positions.getValue(r));t=new a(o),t.attr={...(s=e==null?void 0:e.properties)==null?void 0:s.getValue(r)}}return t}};w.registerType("corridor");var Mh=Ys;var qs=class extends w{constructor(e,t,r,s){super(),this._position=y.parsePosition(e),this._length=+t||0,this._topRadius=+r||0,this._bottomRadius=+s||0,this._delegate=new i.Entity({cylinder:{}}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("cylinder")}set position(e){this._position=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._position),this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(g.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))}get position(){return this._position}set length(e){this._length=+e||0,this._delegate.cylinder.length=this._length}get length(){return this._length}set topRadius(e){this._topRadius=+e||0,this._delegate.cylinder.topRadius=this._topRadius}get topRadius(){return this._topRadius}set bottomRadius(e){this._bottomRadius=+e||0,this._delegate.cylinder.bottomRadius=this._bottomRadius}get bottomRadius(){return this._bottomRadius}_mountedHook(){this.position=this._position,this.length=this._length,this.topRadius=this._topRadius,this.bottomRadius=this._bottomRadius}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.length&&delete e.topRadius&&delete e.bottomRadius,v.merge(this._style,e),v.merge(this._delegate.cylinder,e),this)}};w.registerType("cylinder");var Ih=qs;var Zs=class extends w{constructor(e,t,r){super(),this._position=y.parsePosition(e),this._semiMajorAxis=+t||0,this._semiMinorAxis=+r||0,this._delegate=new i.Entity({ellipse:{}}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("ellipse")}set position(e){this._position=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._position),this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(g.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))}get position(){return this._position}set semiMajorAxis(e){this._semiMajorAxis=+e||0,this._delegate.ellipse.semiMajorAxis=this._semiMajorAxis}get semiMajorAxis(){return this._semiMajorAxis}set semiMinorAxis(e){this._semiMinorAxis=+e||0,this._delegate.ellipse.semiMinorAxis=this._semiMinorAxis}get semiMinorAxis(){return this._semiMinorAxis}_mountedHook(){this.position=this._position,this.semiMajorAxis=this._semiMajorAxis,this.semiMinorAxis=this._semiMinorAxis}setStyle(e){return Object.keys(e).length===0?this:(delete e.semiMajorAxis&&delete e.semiMinorAxis,v.merge(this._style,e),v.merge(this._delegate.ellipse,e),this)}};w.registerType("ellipse");var Lh=Zs;var Xs=class extends w{constructor(e,t){super(),this._position=y.parsePosition(e),this._radius=t||{x:10,y:10,z:10},this._delegate=new i.Entity({ellipsoid:{}}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("sphere")}set position(e){this._position=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._position),this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(g.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))}get position(){return this._position}set radius(e){this._radius=e||{x:10,y:10,z:10},this._delegate.ellipsoid.radii=this._radius}get radius(){return this._radius}_mountedHook(){this.position=this._position,this.radius=this._radius}setStyle(e){return Object.keys(e).length===0?this:(delete e.radius,v.merge(this._style,e),v.merge(this._delegate.ellipsoid,e),this)}};w.registerType("ellipsoid");var Dh=Xs;var Js=class a extends w{constructor(e,t){super(),this._delegate=new i.Entity({label:{}}),this._position=y.parsePosition(e),this._text=t,this._state=_.INITIALIZED}get type(){return w.getOverlayType("label")}set position(e){this._position=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._position)}get position(){return this._position}set text(e){this._text=e,this._delegate.label.text=this._text}get text(){return this._text}_mountedHook(){this.position=this._position,this.text=this._text}setLabel(e,t){return this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.text,v.merge(this._style,e),v.merge(this._delegate.label,e),this)}static fromEntity(e){var o;let t=i.JulianDate.now(),r=g.transformCartesianToWGS84(e.position.getValue(t)),s;return e.billboard&&(s=new a(r,e.name),s.attr={...(o=e==null?void 0:e.properties)==null?void 0:o.getValue(t)}),s}};w.registerType("label");var Mt=Js;var $s=class extends w{constructor(e,t,r,s={}){if(super(),this._position=y.parsePosition(e),this._width=+t||100,this._height=+r||100,s.normal&&typeof s.normal=="string"){let o=String(s.normal).toLocaleUpperCase();s.normal=o==="X"?i.Cartesian3.UNIT_X:o==="Y"?i.Cartesian3.UNIT_Y:i.Cartesian3.UNIT_Z}else s.normal=i.Cartesian3.UNIT_Z;this._normal=s.normal,this._distance=s.distance||0,this._delegate=new i.Entity({plane:{dimensions:{x:this._width,y:this._height},plane:new i.Plane(this._normal,this._distance)}}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("plane")}set position(e){this._position=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._position),this._delegate.orientation=i.Transforms.headingPitchRollQuaternion(g.transformWGS84ToCartesian(this._position),new i.HeadingPitchRoll(i.Math.toRadians(this._position.heading),i.Math.toRadians(this._position.pitch),i.Math.toRadians(this._position.roll)))}get position(){return this._position}set width(e){let t=this._delegate.plane.dimensions.getValue();this._width=+e||0,t.x=this._width}get width(){return this._width}set height(e){let t=this._delegate.plane.dimensions.getValue();this._height=+e||0,t.y=this._height}get height(){return this._height}set distance(e){let t=this._delegate.plane.dimensions.getValue();this._distance=e,t.distance=e}get distance(){return this._distance}_mountedHook(){this.position=this._position,this.distance=this._distance}setStyle(e){return Object.keys(e).length===0?this:(delete e.dimensions&&delete["plane"],v.merge(this._style,e),v.merge(this._delegate.plane,e),this)}};w.registerType("plane");var Rh=$s;var Oh={pixelSize:8,outlineColor:i.Color.BLUE,outlineWidth:2},Ks=class a extends w{constructor(e){super(),this._delegate=new i.Entity({point:{}}),this._position=y.parsePosition(e),this._state=_.INITIALIZED}get type(){return w.getOverlayType("point")}set position(e){this._position=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._position)}get position(){return this._position}_mountedHook(){this.position=this._position,v.merge(this._delegate.point,Oh,this._style)}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.position,v.merge(this._style,e),v.merge(this._delegate.point,Oh,this._style),this)}static fromEntity(e){var o;let t,r=i.JulianDate.now(),s=g.transformCartesianToWGS84(e.position.getValue(r));return t=new a(s),t.attr={...(o=e==null?void 0:e.properties)==null?void 0:o.getValue(r)},t}};w.registerType("point");var It=Ks;var Qs=class a extends w{constructor(e){super(),this._delegate=new i.Entity({polygon:{}}),this._positions=y.parsePositions(e),this._holes=[],this._state=_.INITIALIZED}get type(){return w.getOverlayType("polygon")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polygon.hierarchy=this._computeHierarchy()}get positions(){return this._positions}set holes(e){e&&e.length&&(this._holes=e.map(t=>y.parsePositions(t)),this._delegate.polygon.hierarchy=this._computeHierarchy())}get holes(){return this._holes}get center(){return ve([...this._positions,this._positions[0]])}get area(){return ye(this._positions)}_computeHierarchy(){let e=new i.PolygonHierarchy;return e.positions=g.transformWGS84ArrayToCartesianArray(this._positions),e.holes=this._holes.map(t=>new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(t))),e}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this._delegate.position=g.transformWGS84ToCartesian(this.center),this._delegate.label={text:e,...t},this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.positions,v.merge(this._style,e),v.merge(this._delegate.polygon,e),this)}static fromEntity(e){var s;let t,r=i.JulianDate.now();if(e.polygon){let o=g.transformCartesianArrayToWGS84Array(e.polygon.hierarchy.getValue(r).positions);t=new a(o),t.attr={...(s=e==null?void 0:e.properties)==null?void 0:s.getValue(r)}}return t}};w.registerType("polygon");var Ie=Qs;var eo=class a extends w{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({polyline:{}}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("polyline")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polyline.positions=g.transformWGS84ArrayToCartesianArray(this._positions)}get positions(){return this._positions}get center(){return ve(this._positions)}get distance(){return te(this._positions)}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this._delegate.position=g.transformWGS84ToCartesian(this.center),this._delegate.label={text:e,...t},this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.positions,v.merge(this._style,e),v.merge(this._delegate.polyline,e),this)}static fromEntity(e){var s;let t,r=i.JulianDate.now();if(e.polyline){let o=g.transformCartesianArrayToWGS84Array(e.polyline.positions.getValue(r));t=new a(o),t.attr={...(s=e==null?void 0:e.properties)==null?void 0:s.getValue(r)}}return t}};w.registerType("polyline");var Le=eo;var to=class a extends w{constructor(e,t){super(),this._positions=y.parsePositions(e),this._shape=t||[],this._delegate=new i.Entity({polylineVolume:{}}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("polyline_volume")}set positions(e){this._positions=y.parsePositions(e),this._delegate.polylineVolume.positions=g.transformWGS84ArrayToCartesianArray(this._positions)}get positions(){return this._positions}set shape(e){this._shape=e||[],this._delegate.polylineVolume.shape=this._shape}get shape(){return this._shape}_mountedHook(){this.positions=this._positions,this.shape=this._shape}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions&&delete e.shape,v.merge(this._style,e),v.merge(this._delegate.polylineVolume,e),this)}static fromEntity(e,t){var o;let r,s=i.JulianDate.now();if(e.polyline){let n=g.transformCartesianArrayToWGS84Array(e.polyline.positions.getValue(s));r=new a(n,t),r.attr={...(o=e==null?void 0:e.properties)==null?void 0:o.getValue(s)}}return r}};w.registerType("polyline_volume");var kh=to;var io=class extends w{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({rectangle:{}}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("rect")}set positions(e){this._positions=y.parsePositions(e),this._delegate.rectangle.coordinates=i.Rectangle.fromCartesianArray(g.transformWGS84ArrayToCartesianArray(this._positions))}get positions(){return this._positions}_mountedHook(){this.positions=this._positions}setLabel(e,t){let r=this._delegate.rectangle.coordinates.getValue();return this._delegate.position=i.Cartographic.toCartesian(i.Rectangle.center(r,new i.Cartographic)),this._delegate.label={...t,text:e},this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,v.merge(this._style,e),v.merge(this._delegate.rectangle,e),this)}};w.registerType("rect");var Lt=io;var ro=class a extends w{constructor(e){super(),this._positions=y.parsePositions(e),this._delegate=new i.Entity({wall:{}}),this._state=_.INITIALIZED}get type(){return w.getOverlayType("wall")}set positions(e){this._positions=y.parsePositions(e),this._delegate.wall.positions=g.transformWGS84ArrayToCartesianArray(this._positions)}get positions(){return this._positions}_mountedHook(){this.positions=this._positions}setLabel(e,t){return this}setStyle(e){return Object.keys(e).length===0?this:(delete e.positions,v.merge(this._style,e),v.merge(this._delegate.wall,e),this)}static fromEntity(e){var s;let t,r=i.JulianDate.now();if(e.polyline){let o=g.transformCartesianArrayToWGS84Array(e.polyline.positions.getValue(r));t=new a(o),t.attr={...(s=e==null?void 0:e.properties)==null?void 0:s.getValue(r)}}return t}};w.registerType("wall");var Nh=ro;var so=class extends w{constructor(e,t,r){super(),this._viewer=e,this._delegate=new i.Entity({wall:{}}),this._center=y.parsePosition(t),this._radius=+r||0,this._heading=0,this._headingSpeed=1,this._rotateAmount=0,this._stRotation=0,this._state=_.INITIALIZED}get type(){return w.getOverlayType("volum_radar")}set center(e){this._center=y.parsePosition(e),this._delegate.position=g.transformWGS84ToCartesian(this._center),this.positionArr=this._calcPoints(this._center._lng,this._center._lat,this._radius,0),this._createWallAndEllipsoid(),this._addPostRender()}get center(){return this._center}set radius(e){this._radius=+e}get radius(){return this._radius}set headingSpeed(e){this._headingSpeed=e}get headingSpeed(){return this._headingSpeed}set rotateAmount(e){}get rotateAmount(){return this._rotateAmount}_createWallAndEllipsoid(){this._delegate.wall={positions:new i.CallbackProperty(()=>i.Cartesian3.fromDegreesArrayHeights(this.positionArr),!1),material:this._style.material||i.Color.fromCssColorString("#00dcff82"),distanceDisplayCondition:this._style.distanceDisplayCondition||new i.DistanceDisplayCondition(0,105e5)},this._delegate.ellipsoid={radii:new i.Cartesian3(this._radius,this._radius,this._radius),maximumCone:i.Math.toRadians(90),material:this._style.material||i.Color.fromCssColorString("#00dcff82"),outline:this._style.outline||!0,outlineColor:this._style.material||i.Color.fromCssColorString("#00dcff82"),outlineWidth:this._style.outlineWidth||1,stackPartitions:this._style.stackPartitions||40,slicePartitions:this._style.slicePartitions||40,distanceDisplayCondition:this._style.distanceDisplayCondition||new i.DistanceDisplayCondition(0,105e5)}}_addPostRender(){this.tickListener=this._viewer.clock.onTick.addEventListener(()=>{this._heading+=this._headingSpeed,this.positionArr=this._calcPoints(this._center._lng,this._center._lat,this._radius,this._heading)})}_calcPoints(e,t,r,s){let o=i.Transforms.eastNorthUpToFixedFrame(i.Cartesian3.fromDegrees(e,t)),n=r*Math.cos(s*Math.PI/180),l=r*Math.sin(s*Math.PI/180),h=i.Cartesian3.fromElements(n,l,0),c=i.Matrix4.multiplyByPoint(o,h,new i.Cartesian3),d=i.Cartographic.fromCartesian(c),m=i.Math.toDegrees(d.longitude),f=i.Math.toDegrees(d.latitude);return this._computeCirclularFlight(e,t,m,f,0,90)}_computeCirclularFlight(e,t,r,s,o,n){let l=[];l.push(e),l.push(t),l.push(0);let h=i.Cartesian3.distance(i.Cartesian3.fromDegrees(e,t),i.Cartesian3.fromDegrees(r,s));for(let c=o;c<=o+n;c++){let d=h*Math.sin(c*Math.PI/180),m=Math.cos(c*Math.PI/180),f=(r-e)*m+e,u=(s-t)*m+t;l.push(f),l.push(u),l.push(d)}return l}_computeHierarchy(){let e=new i.PolygonHierarchy,t=i.EllipseGeometryLibrary.computeEllipsePositions({center:g.transformWGS84ToCartesian(this._center),semiMajorAxis:this._radius,semiMinorAxis:this._radius,rotation:0,granularity:.005},!1,!0),r=i.Cartesian3.unpackArray(t.outerPositions);return r.push(r[0]),e.positions=r,e}_mountedHook(){this.center=this._center}setLabel(e,t){return this._delegate.position=g.transformWGS84ToCartesian(this._center),this._delegate.label={...t,text:e},this}setStyle(e){return!e||Object.keys(e).length===0?this:(delete e.positions,v.merge(this._style,e),v.merge(this._delegate.wall,e),v.merge(this._delegate.ellipsoid,e),this)}};w.registerType("volum_radar");var Fh=so;var oo=class extends A{constructor(e,t,r={}){if(!t)throw new Error("GeoJsonLayer\uFF1Athe url invalid");super(e),this._delegate=i.GeoJsonDataSource.load(t,r),this._state=_.INITIALIZED}get type(){return A.getLayerType("geojson")}set show(e){this._show=e,this._delegate&&this._delegate.then(t=>{t.show=this._show})}get show(){return this._show}_createBillboard(e){if(e.position&&e.billboard)return Me.fromEntity(e)}_createPolyline(e){if(e.polyline)return Le.fromEntity(e)}_createPolygon(e){if(e.polygon)return Ie.fromEntity(e)}_createModel(e,t){if(e)return Ve.fromEntity(e,t)}eachOverlay(e,t){if(this._delegate)return this._delegate.then(r=>{r.entities.values.forEach(o=>{e.call(t,o)})}),this}toVectorLayer(){let e=new _e(this.id);return this.eachOverlay(t=>{t.billboard?e.addOverlay(this._createBillboard(t)):t.polyline?e.addOverlay(this._createPolyline(t)):t.polygon&&e.addOverlay(this._createPolygon(t))},this),e}toModelLayer(e){let t=new _e(this.id);return this.eachOverlay(r=>{t.addOverlay(this._createModel(r,e))},this),t}};A.registerType("geojson");var Dt=oo;var ao=class extends A{constructor(e,t,r={}){if(!t)throw new Error("GpxLayer: the url is empty");super(e),this._delegate=i.KmlDataSource.load(t,r),this._state=_.INITIALIZED}get type(){return A.getLayerType("gpx")}set show(e){this._show=e,this._delegate&&this._delegate.then(t=>{t.show=this._show})}get show(){return this._show}eachOverlay(e,t){if(this._delegate)return this._delegate.then(r=>{r.entities.values.forEach(o=>{e.call(t,o)})}),this}};A.registerType("gpx");var Hh=ao;var xu={radialColor:i.Color.WHITE,radialWidth:2,showRadial:!0,LabelColor:i.Color.YELLOW,weftColor:i.Color.WHITE,weftWidth:2},no=class extends A{constructor(e,t){super(e),this._options={...xu,...t},this._delegate=new i.CustomDataSource(e),this._state=_.INITIALIZED}get type(){return A.getLayerType("graticule")}_addedHook(){for(let e=0;e<36;e++)this._delegate.entities.add({polyline:{positions:i.Cartesian3.fromDegreesArray([e*10,89.5,e*10,-89.5]),material:this._options.radialColor,width:this._options.radialWidth},show:this._options.showRadial}),this._delegate.entities.add({position:i.Cartesian3.fromDegrees(e*10,0),label:{text:e*10+"\xB0",font:"12px",fillColor:this._options.LabelColor}});for(let e=0;e<18;e++){let t=[];for(let r=0;r<129;r++)t.push(-180+r*(360/128),(e<9?e:-e)*10);this._delegate.entities.add({polyline:{positions:i.Cartesian3.fromDegreesArray(t),material:this._options.weftColor,width:this._options.weftWidth}})}}};A.registerType("graticule");var zh=no;var lo=class extends A{constructor(e){super(e),this._delegate=new i.PrimitiveCollection,this._isGround=!0,this._state=_.INITIALIZED}get type(){return A.getLayerType("ground_primitive")}clear(){return this._delegate&&this._delegate.removeAll(),this._cache={},this._state=_.CLEARED,this}};A.registerType("ground_primitive");var Wh=lo;var ho=class extends A{constructor(e){super(e),this._delegate=M.create("div","html-layer",void 0),this._delegate.setAttribute("id",this._id),this._renderRemoveCallback=void 0,this._state=_.INITIALIZED}get type(){return A.getLayerType("html")}set show(e){this._show=e,this._delegate.style.visibility=this._show?"visible":"hidden",Object.keys(this._cache).forEach(t=>{this._cache[t].show=e})}get show(){return this._show}_onAdd(e){this._viewer=e,this._viewer.layerContainer.appendChild(this._delegate);let t=this._viewer.scene;this._renderRemoveCallback=t.postRender.addEventListener(()=>{let r=this._viewer.camera.positionWC,s=this._viewer.camera.direction,o=this._viewer.getOffset();this.eachOverlay(n=>{if(n&&n.position){let l=g.transformWGS84ToCartesian(n.position),h=t.globe.ellipsoid.geodeticSurfaceNormal(l,new i.Cartesian3),c=i.SceneTransforms.worldToWindowCoordinates(t,l);c&&(c.x+=o.x,c.y+=o.y),n._updateStyle(c,i.Cartesian3.distance(l,r),i.Cartesian3.dot(s,h)<=0)}},this)},this),this._state=_.ADDED}_onRemove(){this._renderRemoveCallback&&this._renderRemoveCallback(),this._viewer.layerContainer.removeChild(this._delegate),this._state=_.REMOVED}clear(){for(;this._delegate.hasChildNodes();)this._delegate.removeChild(this._delegate.firstChild);return this._cache={},this._state=_.CLEARED,this}};A.registerType("html");var Gh=ho;var co=class extends A{constructor(e){super(e),this._delegate=new i.PrimitiveCollection,this._state=_.INITIALIZED}get type(){return A.getLayerType("i3s")}clear(){return this._delegate.removeAll(),this._cache={},this._state=_.CLEARED,this}};A.registerType("i3s");var Uh=co;var po=class extends A{constructor(e,t,r={}){if(!t)throw new Error("KmlLayer: the url is empty");super(e),this._delegate=i.KmlDataSource.load(t,r),this._state=_.INITIALIZED}get type(){return A.getLayerType("kml")}set show(e){this._show=e,this._delegate&&this._delegate.then(t=>{t.show=this._show})}get show(){return this._show}eachOverlay(e,t){if(this._delegate)return this._delegate.then(r=>{r.entities.values.forEach(o=>{e.call(t,o)})}),this}};A.registerType("kml");var Bh=po;var mo=class extends A{constructor(e,t=""){super(e),this._dataSource=i.GeoJsonDataSource.load(t),this._delegate=new i.CustomDataSource(e),this._initLabel(),this._state=_.INITIALIZED}get type(){return A.getLayerType("label")}_createLabel(e){if(e.position&&e.name)return Mt.fromEntity(e)}_initLabel(){this._dataSource.then(e=>{e.entities.values.forEach(r=>{let s=this._createLabel(r);this.addOverlay(s)})})}};A.registerType("label");var Vh=mo;var uo=class extends A{constructor(e){super(e),this._delegate=new i.PrimitiveCollection,this._points=this._delegate.add(new i.PointPrimitiveCollection),this._labels=this._delegate.add(new i.LabelCollection),this._billboards=this._delegate.add(new i.BillboardCollection),this._polylines=this._delegate.add(new i.PolylineCollection),this._clouds=this._delegate.add(new i.CloudCollection),this._state=_.INITIALIZED}get type(){return A.getLayerType("primitive")}get points(){return this._points}get labels(){return this._labels}get billboards(){return this._billboards}get polylines(){return this._polylines}get clouds(){return this._clouds}clear(){return this._delegate&&this._delegate.removeAll(),this._points=this._delegate.add(new i.PointPrimitiveCollection),this._labels=this._delegate.add(new i.LabelCollection),this._billboards=this._delegate.add(new i.BillboardCollection),this._polylines=this._delegate.add(new i.PolylineCollection),this._clouds=this._delegate.add(new i.CloudCollection),this._cache={},this._state=_.CLEARED,this}};A.registerType("primitive");var jh=uo;var _o=class extends A{constructor(e,t,r){super(e),this._delegate=i.ImageryLayer.fromProviderAsync(t,r),this._state=_.INITIALIZED}get type(){return A.getLayerType("raster-tile")}};A.registerType("raster-tile");var Yh=_o;var fo=class extends A{constructor(e){super(e),this._delegate=new i.PrimitiveCollection,this._state=_.INITIALIZED}get type(){return A.getLayerType("tileset")}clear(){return this._delegate.removeAll(),this._cache={},this._state=_.CLEARED,this}};A.registerType("tileset");var qh=fo;Dt.registerType("topojson");var go=class extends A{constructor(e,t,r={}){if(!t)throw"Shp2JsonLayer\uFF1Athe url invalid";if(!Y("shpUtil"))throw"missing shpUtil";super(e);let o=this._init(t,r);this._delegate=i.GeoJsonDataSource.load(o,r),this._state=_.INITIALIZED}async _init(e,t){var o;return await Y("shpUtil").toGeoJSON(e,void 0,(o=t.encoding)!=null?o:"gbk",t.crs)}get type(){return A.getLayerType("shp")}set show(e){this._show=e,this._delegate&&this._delegate.then(t=>{t.show=this._show})}get show(){return this._show}_createBillboard(e){if(e.position&&e.billboard)return Me.fromEntity(e)}_createPolyline(e){if(e.polyline)return Le.fromEntity(e)}_createPolygon(e){if(e.polygon)return Ie.fromEntity(e)}_createModel(e,t){if(e)return Ve.fromEntity(e,t)}eachOverlay(e,t){if(this._delegate)return this._delegate.then(r=>{r.entities.values.forEach(o=>{e.call(t,o)})}),this}toVectorLayer(){let e=new _e(this.id);return this.eachOverlay(t=>{t.billboard?e.addOverlay(this._createBillboard(t)):t.polyline?e.addOverlay(this._createPolyline(t)):t.polygon&&e.addOverlay(this._createPolygon(t))},this),e}toModelLayer(e){let t=new _e(this.id);return this.eachOverlay(r=>{t.addOverlay(this._createModel(r,e))},this),t}};A.registerType("shp");var Zh=go;var Jh=[].indexOf||function(a){for(let e=0,t=this.length;e<t;e++)if(e in this&&this[e]===a)return e;return-1},Rt=`attribute vec4 position;
136
118
  varying vec2 texcoord;
137
119
  void main(){
138
120
  texcoord = position.xy*0.5+0.5;
139
121
  gl_Position = position;
140
- }`,ai=`#ifdef GL_FRAGMENT_PRECISION_HIGH
122
+ }`,Ot=`#ifdef GL_FRAGMENT_PRECISION_HIGH
141
123
  precision highp int;
142
124
  precision highp float;
143
125
  #else
@@ -145,13 +127,13 @@ void main(){
145
127
  precision mediump float;
146
128
  #endif
147
129
  uniform sampler2D source;
148
- varying vec2 texcoord;`,FT=function(){let a,e,t,r;if(window.WebGLRenderingContext!=null)return r=["WEBKIT","MOZ","MS","O"],t=/^WEBKIT_(.*)|MOZ_(.*)|MS_(.*)|O_(.*)/,a=WebGLRenderingContext.prototype.getExtension,WebGLRenderingContext.prototype.getExtension=function(s){let o,n,l,h,c;if(n=s.match(t),n!==null&&(s=n[1]),o=a.call(this,s),o===null){for(h=0,c=r.length;h<c;h++)if(l=r[h],o=a.call(this,l+"_"+s),o!==null)return o;return null}else return o},e=WebGLRenderingContext.prototype.getSupportedExtensions,WebGLRenderingContext.prototype.getSupportedExtensions=function(){let s,o,n,l,h,c;for(l=e.call(this),n=[],h=0,c=l.length;h<c;h++)s=l[h],o=s.match(t),o!==null&&(s=o[1]),lu.call(n,s)<0&&n.push(s);return n}},zT=function(){let a,e,t,r,s,o,n,l,h,c,p,u,g,_;if(s=function(){let d,T,w;return d=document.createElement("canvas"),d.width=2,d.height=2,T=d.getContext("2d"),w=T.getImageData(0,0,2,2),w.data.set(new Uint8ClampedArray([0,0,0,0,255,255,255,255,0,0,0,0,255,255,255,255])),T.putImageData(w,0,0),d},s(),e=function(d,T){let w,P,M,R,F,H,ee,Y,B,ze,it,Le,de,Ne;if(H=d.createProgram(),de=d.createShader(d.VERTEX_SHADER),d.attachShader(H,de),d.shaderSource(de,`attribute vec2 position;
130
+ varying vec2 texcoord;`,Tu=function(){let a,e,t,r;if(window.WebGLRenderingContext!=null)return r=["WEBKIT","MOZ","MS","O"],t=/^WEBKIT_(.*)|MOZ_(.*)|MS_(.*)|O_(.*)/,a=WebGLRenderingContext.prototype.getExtension,WebGLRenderingContext.prototype.getExtension=function(s){let o,n,l,h,c;if(n=s.match(t),n!==null&&(s=n[1]),o=a.call(this,s),o===null){for(h=0,c=r.length;h<c;h++)if(l=r[h],o=a.call(this,l+"_"+s),o!==null)return o;return null}else return o},e=WebGLRenderingContext.prototype.getSupportedExtensions,WebGLRenderingContext.prototype.getSupportedExtensions=function(){let s,o,n,l,h,c;for(l=e.call(this),n=[],h=0,c=l.length;h<c;h++)s=l[h],o=s.match(t),o!==null&&(s=o[1]),Jh.call(n,s)<0&&n.push(s);return n}},Eu=function(){let a,e,t,r,s,o,n,l,h,c,d,m,f,u;if(s=function(){let p,x,C;return p=document.createElement("canvas"),p.width=2,p.height=2,x=p.getContext("2d"),C=x.getImageData(0,0,2,2),C.data.set(new Uint8ClampedArray([0,0,0,0,255,255,255,255,0,0,0,0,255,255,255,255])),x.putImageData(C,0,0),p},s(),e=function(p,x){let C,E,b,R,S,I,L,k,F,$,ne,re,se,me;if(I=p.createProgram(),se=p.createShader(p.VERTEX_SHADER),p.attachShader(I,se),p.shaderSource(se,`attribute vec2 position;
149
131
  void main(){
150
132
  gl_Position = vec4(position, 0.0, 1.0);
151
- }`),d.compileShader(de),!d.getShaderParameter(de,d.COMPILE_STATUS))throw d.getShaderInfoLog(de);if(M=d.createShader(d.FRAGMENT_SHADER),d.attachShader(H,M),d.shaderSource(M,`uniform sampler2D source;
133
+ }`),p.compileShader(se),!p.getShaderParameter(se,p.COMPILE_STATUS))throw p.getShaderInfoLog(se);if(b=p.createShader(p.FRAGMENT_SHADER),p.attachShader(I,b),p.shaderSource(b,`uniform sampler2D source;
152
134
  void main(){
153
135
  gl_FragColor = texture2D(source, vec2(1.0, 1.0));
154
- }`),d.compileShader(M),!d.getShaderParameter(M,d.COMPILE_STATUS))throw d.getShaderInfoLog(M);if(d.linkProgram(H),!d.getProgramParameter(H,d.LINK_STATUS))throw d.getProgramInfoLog(H);return d.useProgram(H),P=function(){return d.deleteShader(M),d.deleteShader(de),d.deleteProgram(H),d.deleteBuffer(w),d.deleteTexture(B),d.deleteTexture(Le),d.deleteFramebuffer(R),d.bindBuffer(d.ARRAY_BUFFER,null),d.useProgram(null),d.bindTexture(d.TEXTURE_2D,null),d.bindFramebuffer(d.FRAMEBUFFER,null)},Le=d.createTexture(),d.bindTexture(d.TEXTURE_2D,Le),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,2,2,0,d.RGBA,d.UNSIGNED_BYTE,null),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),R=d.createFramebuffer(),d.bindFramebuffer(d.FRAMEBUFFER,R),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,Le,0),ze=s(),B=d.createTexture(),d.bindTexture(d.TEXTURE_2D,B),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,T,ze),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),Ne=new Float32Array([1,1,-1,1,-1,-1,1,1,-1,-1,1,-1]),w=d.createBuffer(),d.bindBuffer(d.ARRAY_BUFFER,w),d.bufferData(d.ARRAY_BUFFER,Ne,d.STATIC_DRAW),F=d.getAttribLocation(H,"position"),it=d.getUniformLocation(H,"source"),d.enableVertexAttribArray(F),d.vertexAttribPointer(F,2,d.FLOAT,!1,0,0),d.uniform1i(it,0),d.drawArrays(d.TRIANGLES,0,6),ee=new Uint8Array(4*4),d.readPixels(0,0,2,2,d.RGBA,d.UNSIGNED_BYTE,ee),Y=Math.abs(ee[0]-127)<10,P(),Y},r=function(d,T){let w;return w=d.createTexture(),d.bindTexture(d.TEXTURE_2D,w),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,2,2,0,d.RGBA,T,null),d.getError()===0?(d.deleteTexture(w),!0):(d.deleteTexture(w),!1)},a=function(d,T){let w,P,M;return M=d.createTexture(),d.bindTexture(d.TEXTURE_2D,M),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,2,2,0,d.RGBA,T,null),P=d.createFramebuffer(),d.bindFramebuffer(d.FRAMEBUFFER,P),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,M,0),w=d.checkFramebufferStatus(d.FRAMEBUFFER),d.deleteTexture(M),d.deleteFramebuffer(P),d.bindTexture(d.TEXTURE_2D,null),d.bindFramebuffer(d.FRAMEBUFFER,null),w===d.FRAMEBUFFER_COMPLETE},h=[],c={},p=[],t=function(){let d,T,w,P,M,R,F;d=document.createElement("canvas"),w=null;try{w=d.getContext("experimental-webgl"),w===null&&(w=d.getContext("webgl"))}catch{}if(w!=null&&(R=w.getExtension("OES_texture_float"),R===null?r(w,w.FLOAT)?(F=!0,h.push("OES_texture_float"),c.OES_texture_float={shim:!0}):(F=!1,p.push("OES_texture_float")):r(w,w.FLOAT)?(F=!0,h.push("OES_texture_float")):(F=!1,p.push("OES_texture_float")),F&&(T=w.getExtension("WEBGL_color_buffer_float"),T===null?a(w,w.FLOAT)?(h.push("WEBGL_color_buffer_float"),c.WEBGL_color_buffer_float={shim:!0,RGBA32F_EXT:34836,RGB32F_EXT:34837,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863}):p.push("WEBGL_color_buffer_float"):a(w,w.FLOAT)?h.push("WEBGL_color_buffer_float"):p.push("WEBGL_color_buffer_float"),T=w.getExtension("OES_texture_float_linear"),T===null?e(w,w.FLOAT)?(h.push("OES_texture_float_linear"),c.OES_texture_float_linear={shim:!0}):p.push("OES_texture_float_linear"):e(w,w.FLOAT)?h.push("OES_texture_float_linear"):p.push("OES_texture_float_linear")),P=w.getExtension("OES_texture_half_float"),P===null?r(w,36193)?(M=!0,h.push("OES_texture_half_float"),P=c.OES_texture_half_float={HALF_FLOAT_OES:36193,shim:!0}):(M=!1,p.push("OES_texture_half_float")):r(w,P.HALF_FLOAT_OES)?(M=!0,h.push("OES_texture_half_float")):(M=!1,p.push("OES_texture_half_float")),M))return T=w.getExtension("EXT_color_buffer_half_float"),T===null?a(w,P.HALF_FLOAT_OES)?(h.push("EXT_color_buffer_half_float"),c.EXT_color_buffer_half_float={shim:!0,RGBA16F_EXT:34842,RGB16F_EXT:34843,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863}):p.push("EXT_color_buffer_half_float"):a(w,P.HALF_FLOAT_OES)?h.push("EXT_color_buffer_half_float"):p.push("EXT_color_buffer_half_float"),T=w.getExtension("OES_texture_half_float_linear"),T===null?e(w,P.HALF_FLOAT_OES)?(h.push("OES_texture_half_float_linear"),c.OES_texture_half_float_linear={shim:!0}):p.push("OES_texture_half_float_linear"):e(w,P.HALF_FLOAT_OES)?h.push("OES_texture_half_float_linear"):p.push("OES_texture_half_float_linear")},window.WebGLRenderingContext!=null){for(t(),u={},g=0,_=p.length;g<_;g++)l=p[g],u[l]=!0;return o=WebGLRenderingContext.prototype.getExtension,WebGLRenderingContext.prototype.getExtension=function(d){let T;return T=c[d],T===void 0?u[d]?null:o.call(this,d):T},n=WebGLRenderingContext.prototype.getSupportedExtensions,WebGLRenderingContext.prototype.getSupportedExtensions=function(){let d,T,w,P,M,R,F;for(w=n.call(this),T=[],P=0,R=w.length;P<R;P++)d=w[P],u[d]===void 0&&T.push(d);for(M=0,F=h.length;M<F;M++)d=h[M],lu.call(T,d)<0&&T.push(d);return T},WebGLRenderingContext.prototype.getFloatExtension=function(d){let T,w,P,M,R,F,H,ee,Y,B,ze,it,Le,de,Ne,Tt,Et,Pt,Zn,Yn,Xn,Jn,Wi,Kn,Gi,Ui;for(d.prefer==null&&(d.prefer=["half"]),d.require==null&&(d.require=[]),d.throws==null&&(d.throws=!0),de=this.getExtension("OES_texture_float"),F=this.getExtension("OES_texture_half_float"),it=this.getExtension("WEBGL_color_buffer_float"),M=this.getExtension("EXT_color_buffer_half_float"),Le=this.getExtension("OES_texture_float_linear"),R=this.getExtension("OES_texture_half_float_linear"),ze={texture:de!==null,filterable:Le!==null,renderable:it!==null,score:0,precision:"single",half:!1,single:!0,type:this.FLOAT},P={texture:F!==null,filterable:R!==null,renderable:M!==null,score:0,precision:"half",half:!0,single:!1,type:(Kn=F!=null?F.HALF_FLOAT_OES:void 0)!=null?Kn:null},w=[],ze.texture&&w.push(ze),P.texture&&w.push(P),B=[],Tt=0,Zn=w.length;Tt<Zn;Tt++){for(T=w[Tt],Ne=!0,Gi=d.require,Et=0,Yn=Gi.length;Et<Yn;Et++)l=Gi[Et],T[l]===!1&&(Ne=!1);Ne&&B.push(T)}for(Pt=0,Xn=B.length;Pt<Xn;Pt++)for(T=B[Pt],Ui=d.prefer,H=Wi=0,Jn=Ui.length;Wi<Jn;H=++Wi)Y=Ui[H],ee=Math.pow(2,d.prefer.length-H-1),T[Y]&&(T.score+=ee);if(B.sort(function(Bi,Vi){if(Bi.score===Vi.score)return 0;if(Bi.score<Vi.score)return 1;if(Bi.score>Vi.score)return-1}),B.length===0){if(d.throws)throw"No floating point texture support that is "+d.require.join(", ");return null}else return B=B[0],{filterable:B.filterable,renderable:B.renderable,type:B.type,precision:B.precision}}}};FT();zT();var Ct=function(){function a(e,t){let r,s;this.gl=e,s=t.vertex,r=t.fragment,this.program=this.gl.createProgram(),this.vs=this.gl.createShader(this.gl.VERTEX_SHADER),this.fs=this.gl.createShader(this.gl.FRAGMENT_SHADER),this.gl.attachShader(this.program,this.vs),this.gl.attachShader(this.program,this.fs),this.compileShader(this.vs,s),this.compileShader(this.fs,r),this.link(),this.value_cache={},this.uniform_cache={},this.attribCache={}}return a.prototype.attribLocation=function(e){let t=this.attribCache[e];return t===void 0&&(t=this.attribCache[e]=this.gl.getAttribLocation(this.program,e)),t},a.prototype.compileShader=function(e,t){if(this.gl.shaderSource(e,t),this.gl.compileShader(e),!this.gl.getShaderParameter(e,this.gl.COMPILE_STATUS))throw"Shader Compile Error: "+this.gl.getShaderInfoLog(e)},a.prototype.link=function(){if(this.gl.linkProgram(this.program),!this.gl.getProgramParameter(this.program,this.gl.LINK_STATUS))throw"Shader Link Error: "+this.gl.getProgramInfoLog(this.program)},a.prototype.use=function(){return this.gl.useProgram(this.program),this},a.prototype.uniformLoc=function(e){let t=this.uniform_cache[e];return t===void 0&&(t=this.uniform_cache[e]=this.gl.getUniformLocation(this.program,e)),t},a.prototype.int=function(e,t){let r,s;return r=this.value_cache[e],r!==t&&(this.value_cache[e]=t,s=this.uniformLoc(e),s&&this.gl.uniform1i(s,t)),this},a.prototype.vec2=function(e,t,r){let s;return s=this.uniformLoc(e),s&&this.gl.uniform2f(s,t,r),this},a.prototype.float=function(e,t){let r,s;return r=this.value_cache[e],r!==t&&(this.value_cache[e]=t,s=this.uniformLoc(e),s&&this.gl.uniform1f(s,t)),this},a}(),NT=function(){function a(e){this.gl=e,this.buffer=this.gl.createFramebuffer()}return a.prototype.destroy=function(){return this.gl.deleteFRamebuffer(this.buffer)},a.prototype.bind=function(){return this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this.buffer),this},a.prototype.unbind=function(){return this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),this},a.prototype.check=function(){let e;switch(e=this.gl.checkFramebufferStatus(this.gl.FRAMEBUFFER),e){case this.gl.FRAMEBUFFER_UNSUPPORTED:throw"Framebuffer is unsupported";case this.gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:throw"Framebuffer incomplete attachment";case this.gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:throw"Framebuffer incomplete dimensions";case this.gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:throw"Framebuffer incomplete missing attachment"}return this},a.prototype.color=function(e){return this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,e.target,e.handle,0),this.check(),this},a.prototype.depth=function(e){return this.gl.framebufferRenderbuffer(this.gl.FRAMEBUFFER,this.gl.DEPTH_ATTACHMENT,this.gl.RENDERBUFFER,e.id),this.check(),this},a.prototype.destroy=function(){return this.gl.deleteFramebuffer(this.buffer)},a}(),hu=function(){function a(e,t){let r,s;switch(this.gl=e,t==null&&(t={}),this.channels=this.gl[((r=t.channels)!=null?r:"rgba").toUpperCase()],typeof t.type=="number"?this.type=t.type:this.type=this.gl[((s=t.type)!=null?s:"unsigned_byte").toUpperCase()],this.channels){case this.gl.RGBA:this.chancount=4;break;case this.gl.RGB:this.chancount=3;break;case this.gl.LUMINANCE_ALPHA:this.chancount=2;break;default:this.chancount=1}this.target=this.gl.TEXTURE_2D,this.handle=this.gl.createTexture()}return a.prototype.destroy=function(){return this.gl.deleteTexture(this.handle)},a.prototype.bind=function(e){if(e==null&&(e=0),e>15)throw"Texture unit too large: "+e;return this.gl.activeTexture(this.gl.TEXTURE0+e),this.gl.bindTexture(this.target,this.handle),this},a.prototype.setSize=function(e,t){return this.width=e,this.height=t,this.gl.texImage2D(this.target,0,this.channels,this.width,this.height,0,this.channels,this.type,null),this},a.prototype.upload=function(e){return this.width=e.width,this.height=e.height,this.gl.texImage2D(this.target,0,this.channels,this.channels,this.type,e),this},a.prototype.linear=function(){return this.gl.texParameteri(this.target,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.target,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this},a.prototype.nearest=function(){return this.gl.texParameteri(this.target,this.gl.TEXTURE_MAG_FILTER,this.gl.NEAREST),this.gl.texParameteri(this.target,this.gl.TEXTURE_MIN_FILTER,this.gl.NEAREST),this},a.prototype.clampToEdge=function(){return this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this},a.prototype.repeat=function(){return this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_S,this.gl.REPEAT),this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_T,this.gl.REPEAT),this},a}(),nu=function(){function a(e,t,r){let s;this.gl=e,this.width=t,this.height=r,s=this.gl.getFloatExtension({require:["renderable"]}),this.texture=new hu(this.gl,{type:s.type}).bind(0).setSize(this.width,this.height).nearest().clampToEdge(),this.fbo=new NT(this.gl).bind().color(this.texture).unbind()}return a.prototype.use=function(){return this.fbo.bind()},a.prototype.bind=function(e){return this.texture.bind(e)},a.prototype.end=function(){return this.fbo.unbind()},a.prototype.resize=function(e,t){return this.width=e,this.height=t,this.texture.bind(0).setSize(this.width,this.height)},a}(),HT=function(){function a(e,t,r,s){let o,n,l;for(this.heatmap=e,this.gl=t,this.width=r,this.height=s,this.shader=new Ct(this.gl,{vertex:`attribute vec4 position, intensity;
136
+ }`),p.compileShader(b),!p.getShaderParameter(b,p.COMPILE_STATUS))throw p.getShaderInfoLog(b);if(p.linkProgram(I),!p.getProgramParameter(I,p.LINK_STATUS))throw p.getProgramInfoLog(I);return p.useProgram(I),E=function(){return p.deleteShader(b),p.deleteShader(se),p.deleteProgram(I),p.deleteBuffer(C),p.deleteTexture(F),p.deleteTexture(re),p.deleteFramebuffer(R),p.bindBuffer(p.ARRAY_BUFFER,null),p.useProgram(null),p.bindTexture(p.TEXTURE_2D,null),p.bindFramebuffer(p.FRAMEBUFFER,null)},re=p.createTexture(),p.bindTexture(p.TEXTURE_2D,re),p.texImage2D(p.TEXTURE_2D,0,p.RGBA,2,2,0,p.RGBA,p.UNSIGNED_BYTE,null),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.LINEAR),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.LINEAR),R=p.createFramebuffer(),p.bindFramebuffer(p.FRAMEBUFFER,R),p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,p.TEXTURE_2D,re,0),$=s(),F=p.createTexture(),p.bindTexture(p.TEXTURE_2D,F),p.texImage2D(p.TEXTURE_2D,0,p.RGBA,p.RGBA,x,$),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.LINEAR),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.LINEAR),me=new Float32Array([1,1,-1,1,-1,-1,1,1,-1,-1,1,-1]),C=p.createBuffer(),p.bindBuffer(p.ARRAY_BUFFER,C),p.bufferData(p.ARRAY_BUFFER,me,p.STATIC_DRAW),S=p.getAttribLocation(I,"position"),ne=p.getUniformLocation(I,"source"),p.enableVertexAttribArray(S),p.vertexAttribPointer(S,2,p.FLOAT,!1,0,0),p.uniform1i(ne,0),p.drawArrays(p.TRIANGLES,0,6),L=new Uint8Array(4*4),p.readPixels(0,0,2,2,p.RGBA,p.UNSIGNED_BYTE,L),k=Math.abs(L[0]-127)<10,E(),k},r=function(p,x){let C;return C=p.createTexture(),p.bindTexture(p.TEXTURE_2D,C),p.texImage2D(p.TEXTURE_2D,0,p.RGBA,2,2,0,p.RGBA,x,null),p.getError()===0?(p.deleteTexture(C),!0):(p.deleteTexture(C),!1)},a=function(p,x){let C,E,b;return b=p.createTexture(),p.bindTexture(p.TEXTURE_2D,b),p.texImage2D(p.TEXTURE_2D,0,p.RGBA,2,2,0,p.RGBA,x,null),E=p.createFramebuffer(),p.bindFramebuffer(p.FRAMEBUFFER,E),p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,p.TEXTURE_2D,b,0),C=p.checkFramebufferStatus(p.FRAMEBUFFER),p.deleteTexture(b),p.deleteFramebuffer(E),p.bindTexture(p.TEXTURE_2D,null),p.bindFramebuffer(p.FRAMEBUFFER,null),C===p.FRAMEBUFFER_COMPLETE},h=[],c={},d=[],t=function(){let p,x,C,E,b,R,S;p=document.createElement("canvas"),C=null;try{C=p.getContext("experimental-webgl"),C===null&&(C=p.getContext("webgl"))}catch{}if(C!=null&&(R=C.getExtension("OES_texture_float"),R===null?r(C,C.FLOAT)?(S=!0,h.push("OES_texture_float"),c.OES_texture_float={shim:!0}):(S=!1,d.push("OES_texture_float")):r(C,C.FLOAT)?(S=!0,h.push("OES_texture_float")):(S=!1,d.push("OES_texture_float")),S&&(x=C.getExtension("WEBGL_color_buffer_float"),x===null?a(C,C.FLOAT)?(h.push("WEBGL_color_buffer_float"),c.WEBGL_color_buffer_float={shim:!0,RGBA32F_EXT:34836,RGB32F_EXT:34837,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863}):d.push("WEBGL_color_buffer_float"):a(C,C.FLOAT)?h.push("WEBGL_color_buffer_float"):d.push("WEBGL_color_buffer_float"),x=C.getExtension("OES_texture_float_linear"),x===null?e(C,C.FLOAT)?(h.push("OES_texture_float_linear"),c.OES_texture_float_linear={shim:!0}):d.push("OES_texture_float_linear"):e(C,C.FLOAT)?h.push("OES_texture_float_linear"):d.push("OES_texture_float_linear")),E=C.getExtension("OES_texture_half_float"),E===null?r(C,36193)?(b=!0,h.push("OES_texture_half_float"),E=c.OES_texture_half_float={HALF_FLOAT_OES:36193,shim:!0}):(b=!1,d.push("OES_texture_half_float")):r(C,E.HALF_FLOAT_OES)?(b=!0,h.push("OES_texture_half_float")):(b=!1,d.push("OES_texture_half_float")),b))return x=C.getExtension("EXT_color_buffer_half_float"),x===null?a(C,E.HALF_FLOAT_OES)?(h.push("EXT_color_buffer_half_float"),c.EXT_color_buffer_half_float={shim:!0,RGBA16F_EXT:34842,RGB16F_EXT:34843,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863}):d.push("EXT_color_buffer_half_float"):a(C,E.HALF_FLOAT_OES)?h.push("EXT_color_buffer_half_float"):d.push("EXT_color_buffer_half_float"),x=C.getExtension("OES_texture_half_float_linear"),x===null?e(C,E.HALF_FLOAT_OES)?(h.push("OES_texture_half_float_linear"),c.OES_texture_half_float_linear={shim:!0}):d.push("OES_texture_half_float_linear"):e(C,E.HALF_FLOAT_OES)?h.push("OES_texture_half_float_linear"):d.push("OES_texture_half_float_linear")},window.WebGLRenderingContext!=null){for(t(),m={},f=0,u=d.length;f<u;f++)l=d[f],m[l]=!0;return o=WebGLRenderingContext.prototype.getExtension,WebGLRenderingContext.prototype.getExtension=function(p){let x;return x=c[p],x===void 0?m[p]?null:o.call(this,p):x},n=WebGLRenderingContext.prototype.getSupportedExtensions,WebGLRenderingContext.prototype.getSupportedExtensions=function(){let p,x,C,E,b,R,S;for(C=n.call(this),x=[],E=0,R=C.length;E<R;E++)p=C[E],m[p]===void 0&&x.push(p);for(b=0,S=h.length;b<S;b++)p=h[b],Jh.call(x,p)<0&&x.push(p);return x},WebGLRenderingContext.prototype.getFloatExtension=function(p){let x,C,E,b,R,S,I,L,k,F,$,ne,re,se,me,ze,We,Ge,ct,kn,Nn,Fn,wi,Hn,Ci,xi;for(p.prefer==null&&(p.prefer=["half"]),p.require==null&&(p.require=[]),p.throws==null&&(p.throws=!0),se=this.getExtension("OES_texture_float"),S=this.getExtension("OES_texture_half_float"),ne=this.getExtension("WEBGL_color_buffer_float"),b=this.getExtension("EXT_color_buffer_half_float"),re=this.getExtension("OES_texture_float_linear"),R=this.getExtension("OES_texture_half_float_linear"),$={texture:se!==null,filterable:re!==null,renderable:ne!==null,score:0,precision:"single",half:!1,single:!0,type:this.FLOAT},E={texture:S!==null,filterable:R!==null,renderable:b!==null,score:0,precision:"half",half:!0,single:!1,type:(Hn=S!=null?S.HALF_FLOAT_OES:void 0)!=null?Hn:null},C=[],$.texture&&C.push($),E.texture&&C.push(E),F=[],ze=0,ct=C.length;ze<ct;ze++){for(x=C[ze],me=!0,Ci=p.require,We=0,kn=Ci.length;We<kn;We++)l=Ci[We],x[l]===!1&&(me=!1);me&&F.push(x)}for(Ge=0,Nn=F.length;Ge<Nn;Ge++)for(x=F[Ge],xi=p.prefer,I=wi=0,Fn=xi.length;wi<Fn;I=++wi)k=xi[I],L=Math.pow(2,p.prefer.length-I-1),x[k]&&(x.score+=L);if(F.sort(function(Ti,Ei){if(Ti.score===Ei.score)return 0;if(Ti.score<Ei.score)return 1;if(Ti.score>Ei.score)return-1}),F.length===0){if(p.throws)throw"No floating point texture support that is "+p.require.join(", ");return null}else return F=F[0],{filterable:F.filterable,renderable:F.renderable,type:F.type,precision:F.precision}}}};Tu();Eu();var nt=function(){function a(e,t){let r,s;this.gl=e,s=t.vertex,r=t.fragment,this.program=this.gl.createProgram(),this.vs=this.gl.createShader(this.gl.VERTEX_SHADER),this.fs=this.gl.createShader(this.gl.FRAGMENT_SHADER),this.gl.attachShader(this.program,this.vs),this.gl.attachShader(this.program,this.fs),this.compileShader(this.vs,s),this.compileShader(this.fs,r),this.link(),this.value_cache={},this.uniform_cache={},this.attribCache={}}return a.prototype.attribLocation=function(e){let t=this.attribCache[e];return t===void 0&&(t=this.attribCache[e]=this.gl.getAttribLocation(this.program,e)),t},a.prototype.compileShader=function(e,t){if(this.gl.shaderSource(e,t),this.gl.compileShader(e),!this.gl.getShaderParameter(e,this.gl.COMPILE_STATUS))throw"Shader Compile Error: "+this.gl.getShaderInfoLog(e)},a.prototype.link=function(){if(this.gl.linkProgram(this.program),!this.gl.getProgramParameter(this.program,this.gl.LINK_STATUS))throw"Shader Link Error: "+this.gl.getProgramInfoLog(this.program)},a.prototype.use=function(){return this.gl.useProgram(this.program),this},a.prototype.uniformLoc=function(e){let t=this.uniform_cache[e];return t===void 0&&(t=this.uniform_cache[e]=this.gl.getUniformLocation(this.program,e)),t},a.prototype.int=function(e,t){let r,s;return r=this.value_cache[e],r!==t&&(this.value_cache[e]=t,s=this.uniformLoc(e),s&&this.gl.uniform1i(s,t)),this},a.prototype.vec2=function(e,t,r){let s;return s=this.uniformLoc(e),s&&this.gl.uniform2f(s,t,r),this},a.prototype.float=function(e,t){let r,s;return r=this.value_cache[e],r!==t&&(this.value_cache[e]=t,s=this.uniformLoc(e),s&&this.gl.uniform1f(s,t)),this},a}(),Pu=function(){function a(e){this.gl=e,this.buffer=this.gl.createFramebuffer()}return a.prototype.destroy=function(){return this.gl.deleteFRamebuffer(this.buffer)},a.prototype.bind=function(){return this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this.buffer),this},a.prototype.unbind=function(){return this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),this},a.prototype.check=function(){let e;switch(e=this.gl.checkFramebufferStatus(this.gl.FRAMEBUFFER),e){case this.gl.FRAMEBUFFER_UNSUPPORTED:throw"Framebuffer is unsupported";case this.gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:throw"Framebuffer incomplete attachment";case this.gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:throw"Framebuffer incomplete dimensions";case this.gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:throw"Framebuffer incomplete missing attachment"}return this},a.prototype.color=function(e){return this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,e.target,e.handle,0),this.check(),this},a.prototype.depth=function(e){return this.gl.framebufferRenderbuffer(this.gl.FRAMEBUFFER,this.gl.DEPTH_ATTACHMENT,this.gl.RENDERBUFFER,e.id),this.check(),this},a.prototype.destroy=function(){return this.gl.deleteFramebuffer(this.buffer)},a}(),$h=function(){function a(e,t){let r,s;switch(this.gl=e,t==null&&(t={}),this.channels=this.gl[((r=t.channels)!=null?r:"rgba").toUpperCase()],typeof t.type=="number"?this.type=t.type:this.type=this.gl[((s=t.type)!=null?s:"unsigned_byte").toUpperCase()],this.channels){case this.gl.RGBA:this.chancount=4;break;case this.gl.RGB:this.chancount=3;break;case this.gl.LUMINANCE_ALPHA:this.chancount=2;break;default:this.chancount=1}this.target=this.gl.TEXTURE_2D,this.handle=this.gl.createTexture()}return a.prototype.destroy=function(){return this.gl.deleteTexture(this.handle)},a.prototype.bind=function(e){if(e==null&&(e=0),e>15)throw"Texture unit too large: "+e;return this.gl.activeTexture(this.gl.TEXTURE0+e),this.gl.bindTexture(this.target,this.handle),this},a.prototype.setSize=function(e,t){return this.width=e,this.height=t,this.gl.texImage2D(this.target,0,this.channels,this.width,this.height,0,this.channels,this.type,null),this},a.prototype.upload=function(e){return this.width=e.width,this.height=e.height,this.gl.texImage2D(this.target,0,this.channels,this.channels,this.type,e),this},a.prototype.linear=function(){return this.gl.texParameteri(this.target,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.target,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this},a.prototype.nearest=function(){return this.gl.texParameteri(this.target,this.gl.TEXTURE_MAG_FILTER,this.gl.NEAREST),this.gl.texParameteri(this.target,this.gl.TEXTURE_MIN_FILTER,this.gl.NEAREST),this},a.prototype.clampToEdge=function(){return this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this},a.prototype.repeat=function(){return this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_S,this.gl.REPEAT),this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_T,this.gl.REPEAT),this},a}(),Xh=function(){function a(e,t,r){let s;this.gl=e,this.width=t,this.height=r,s=this.gl.getFloatExtension({require:["renderable"]}),this.texture=new $h(this.gl,{type:s.type}).bind(0).setSize(this.width,this.height).nearest().clampToEdge(),this.fbo=new Pu(this.gl).bind().color(this.texture).unbind()}return a.prototype.use=function(){return this.fbo.bind()},a.prototype.bind=function(e){return this.texture.bind(e)},a.prototype.end=function(){return this.fbo.unbind()},a.prototype.resize=function(e,t){return this.width=e,this.height=t,this.texture.bind(0).setSize(this.width,this.height)},a}(),bu=function(){function a(e,t,r,s){let o,n,l;for(this.heatmap=e,this.gl=t,this.width=r,this.height=s,this.shader=new nt(this.gl,{vertex:`attribute vec4 position, intensity;
155
137
  varying vec2 off, dim;
156
138
  varying float vIntensity;
157
139
  uniform vec2 viewport;
@@ -175,13 +157,13 @@ void main(){
175
157
  float falloff = (1.0 - smoothstep(0.0, 1.0, length(off/dim)));
176
158
  float intensity = falloff*vIntensity;
177
159
  gl_FragColor = vec4(intensity);
178
- }`}),this.clampShader=new Ct(this.gl,{vertex:oi,fragment:ai+`uniform float low, high;
160
+ }`}),this.clampShader=new nt(this.gl,{vertex:Rt,fragment:Ot+`uniform float low, high;
179
161
  void main(){
180
162
  gl_FragColor = vec4(clamp(texture2D(source, texcoord).rgb, low, high), 1.0);
181
- }`}),this.multiplyShader=new Ct(this.gl,{vertex:oi,fragment:ai+`uniform float value;
163
+ }`}),this.multiplyShader=new nt(this.gl,{vertex:Rt,fragment:Ot+`uniform float value;
182
164
  void main(){
183
165
  gl_FragColor = vec4(texture2D(source, texcoord).rgb*value, 1.0);
184
- }`}),this.blurShader=new Ct(this.gl,{vertex:oi,fragment:ai+`uniform vec2 viewport;
166
+ }`}),this.blurShader=new nt(this.gl,{vertex:Rt,fragment:Ot+`uniform vec2 viewport;
185
167
  void main(){
186
168
  vec4 result = vec4(0.0);
187
169
  for(int x=-1; x<=1; x++){
@@ -193,10 +175,10 @@ void main(){
193
175
  }
194
176
  }
195
177
  gl_FragColor = vec4(result.rgb/result.w, 1.0);
196
- }`}),this.nodeBack=new nu(this.gl,this.width,this.height),this.nodeFront=new nu(this.gl,this.width,this.height),this.vertexBuffer=this.gl.createBuffer(),this.vertexSize=8,this.maxPointCount=1024*10,this.vertexBufferData=new Float32Array(this.maxPointCount*this.vertexSize*6),this.vertexBufferViews=[],o=n=0,l=this.maxPointCount;0<=l?n<l:n>l;o=0<=l?++n:--n)this.vertexBufferViews.push(new Float32Array(this.vertexBufferData.buffer,0,o*this.vertexSize*6));this.bufferIndex=0,this.pointCount=0}return a.prototype.resize=function(e,t){return this.width=e,this.height=t,this.nodeBack.resize(this.width,this.height),this.nodeFront.resize(this.width,this.height)},a.prototype.update=function(){var e,t;if(this.pointCount>0)return this.gl.enable(this.gl.BLEND),this.nodeFront.use(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.vertexBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,this.vertexBufferViews[this.pointCount],this.gl.STREAM_DRAW),t=this.shader.attribLocation("position"),e=this.shader.attribLocation("intensity"),this.gl.enableVertexAttribArray(1),this.gl.vertexAttribPointer(t,4,this.gl.FLOAT,!1,8*4,0),this.gl.vertexAttribPointer(e,4,this.gl.FLOAT,!1,8*4,4*4),this.shader.use().vec2("viewport",this.width,this.height),this.gl.drawArrays(this.gl.TRIANGLES,0,this.pointCount*6),this.gl.disableVertexAttribArray(1),this.pointCount=0,this.bufferIndex=0,this.nodeFront.end(),this.gl.disable(this.gl.BLEND)},a.prototype.clear=function(){return this.nodeFront.use(),this.gl.clearColor(0,0,0,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.nodeFront.end()},a.prototype.clamp=function(e,t){return this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.heatmap.quad),this.gl.vertexAttribPointer(0,4,this.gl.FLOAT,!1,0,0),this.nodeFront.bind(0),this.nodeBack.use(),this.clampShader.use().int("source",0).float("low",e).float("high",t),this.gl.drawArrays(this.gl.TRIANGLES,0,6),this.nodeBack.end(),this.swap()},a.prototype.multiply=function(e){return this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.heatmap.quad),this.gl.vertexAttribPointer(0,4,this.gl.FLOAT,!1,0,0),this.nodeFront.bind(0),this.nodeBack.use(),this.multiplyShader.use().int("source",0).float("value",e),this.gl.drawArrays(this.gl.TRIANGLES,0,6),this.nodeBack.end(),this.swap()},a.prototype.blur=function(){return this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.heatmap.quad),this.gl.vertexAttribPointer(0,4,this.gl.FLOAT,!1,0,0),this.nodeFront.bind(0),this.nodeBack.use(),this.blurShader.use().int("source",0).vec2("viewport",this.width,this.height),this.gl.drawArrays(this.gl.TRIANGLES,0,6),this.nodeBack.end(),this.swap()},a.prototype.swap=function(){let e=this.nodeFront;return this.nodeFront=this.nodeBack,this.nodeBack=e},a.prototype.addVertex=function(e,t,r,s,o){return this.vertexBufferData[this.bufferIndex++]=e,this.vertexBufferData[this.bufferIndex++]=t,this.vertexBufferData[this.bufferIndex++]=r,this.vertexBufferData[this.bufferIndex++]=s,this.vertexBufferData[this.bufferIndex++]=o,this.vertexBufferData[this.bufferIndex++]=o,this.vertexBufferData[this.bufferIndex++]=o,this.vertexBufferData[this.bufferIndex++]=o},a.prototype.addPoint=function(e,t,r,s){let o;return r==null&&(r=50),s==null&&(s=.2),this.pointCount>=this.maxPointCount-1&&this.update(),t=this.height-t,o=r/2,this.addVertex(e,t,-o,-o,s),this.addVertex(e,t,+o,-o,s),this.addVertex(e,t,-o,+o,s),this.addVertex(e,t,-o,+o,s),this.addVertex(e,t,+o,-o,s),this.addVertex(e,t,+o,+o,s),this.pointCount+=1},a}(),WT=function(){function a(e){let t,r,s,o,n,l,h,c,p,u,g,_,d;_=e!=null?e:{},this.canvas=_.canvas,this.width=_.width,this.height=_.height,c=_.intensityToAlpha,l=_.gradientTexture,r=_.alphaRange,this.canvas||(this.canvas=document.createElement("canvas"));try{if(this.gl=this.canvas.getContext("experimental-webgl",{depth:!1,antialias:!1}),this.gl===null&&(this.gl=this.canvas.getContext("webgl",{depth:!1,antialias:!1}),this.gl===null))throw"WebGL not supported"}catch(T){throw o=T,"WebGL not supported"}window.WebGLDebugUtils!=null&&(this.gl=window.WebGLDebugUtils.makeDebugContext(this.gl,function(T,w,P){throw window.WebGLDebugUtils.glEnumToString(T)+" was caused by call to: "+w})),this.gl.enableVertexAttribArray(0),this.gl.blendFunc(this.gl.ONE,this.gl.ONE),l?(g=this.gradientTexture=new hu(this.gl,{channels:"rgba"}).bind(0).setSize(2,2).nearest().clampToEdge(),typeof l=="string"?(h=new Image,h.onload=function(){return g.bind().upload(h)},h.src=l):l.width>0&&l.height>0?g.upload(l):l.onload=function(){return g.upload(l)},n=`uniform sampler2D gradientTexture;
178
+ }`}),this.nodeBack=new Xh(this.gl,this.width,this.height),this.nodeFront=new Xh(this.gl,this.width,this.height),this.vertexBuffer=this.gl.createBuffer(),this.vertexSize=8,this.maxPointCount=1024*10,this.vertexBufferData=new Float32Array(this.maxPointCount*this.vertexSize*6),this.vertexBufferViews=[],o=n=0,l=this.maxPointCount;0<=l?n<l:n>l;o=0<=l?++n:--n)this.vertexBufferViews.push(new Float32Array(this.vertexBufferData.buffer,0,o*this.vertexSize*6));this.bufferIndex=0,this.pointCount=0}return a.prototype.resize=function(e,t){return this.width=e,this.height=t,this.nodeBack.resize(this.width,this.height),this.nodeFront.resize(this.width,this.height)},a.prototype.update=function(){var e,t;if(this.pointCount>0)return this.gl.enable(this.gl.BLEND),this.nodeFront.use(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.vertexBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,this.vertexBufferViews[this.pointCount],this.gl.STREAM_DRAW),t=this.shader.attribLocation("position"),e=this.shader.attribLocation("intensity"),this.gl.enableVertexAttribArray(1),this.gl.vertexAttribPointer(t,4,this.gl.FLOAT,!1,8*4,0),this.gl.vertexAttribPointer(e,4,this.gl.FLOAT,!1,8*4,4*4),this.shader.use().vec2("viewport",this.width,this.height),this.gl.drawArrays(this.gl.TRIANGLES,0,this.pointCount*6),this.gl.disableVertexAttribArray(1),this.pointCount=0,this.bufferIndex=0,this.nodeFront.end(),this.gl.disable(this.gl.BLEND)},a.prototype.clear=function(){return this.nodeFront.use(),this.gl.clearColor(0,0,0,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.nodeFront.end()},a.prototype.clamp=function(e,t){return this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.heatmap.quad),this.gl.vertexAttribPointer(0,4,this.gl.FLOAT,!1,0,0),this.nodeFront.bind(0),this.nodeBack.use(),this.clampShader.use().int("source",0).float("low",e).float("high",t),this.gl.drawArrays(this.gl.TRIANGLES,0,6),this.nodeBack.end(),this.swap()},a.prototype.multiply=function(e){return this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.heatmap.quad),this.gl.vertexAttribPointer(0,4,this.gl.FLOAT,!1,0,0),this.nodeFront.bind(0),this.nodeBack.use(),this.multiplyShader.use().int("source",0).float("value",e),this.gl.drawArrays(this.gl.TRIANGLES,0,6),this.nodeBack.end(),this.swap()},a.prototype.blur=function(){return this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.heatmap.quad),this.gl.vertexAttribPointer(0,4,this.gl.FLOAT,!1,0,0),this.nodeFront.bind(0),this.nodeBack.use(),this.blurShader.use().int("source",0).vec2("viewport",this.width,this.height),this.gl.drawArrays(this.gl.TRIANGLES,0,6),this.nodeBack.end(),this.swap()},a.prototype.swap=function(){let e=this.nodeFront;return this.nodeFront=this.nodeBack,this.nodeBack=e},a.prototype.addVertex=function(e,t,r,s,o){return this.vertexBufferData[this.bufferIndex++]=e,this.vertexBufferData[this.bufferIndex++]=t,this.vertexBufferData[this.bufferIndex++]=r,this.vertexBufferData[this.bufferIndex++]=s,this.vertexBufferData[this.bufferIndex++]=o,this.vertexBufferData[this.bufferIndex++]=o,this.vertexBufferData[this.bufferIndex++]=o,this.vertexBufferData[this.bufferIndex++]=o},a.prototype.addPoint=function(e,t,r,s){let o;return r==null&&(r=50),s==null&&(s=.2),this.pointCount>=this.maxPointCount-1&&this.update(),t=this.height-t,o=r/2,this.addVertex(e,t,-o,-o,s),this.addVertex(e,t,+o,-o,s),this.addVertex(e,t,-o,+o,s),this.addVertex(e,t,-o,+o,s),this.addVertex(e,t,+o,-o,s),this.addVertex(e,t,+o,+o,s),this.pointCount+=1},a}(),Su=function(){function a(e){let t,r,s,o,n,l,h,c,d,m,f,u,p;u=e!=null?e:{},this.canvas=u.canvas,this.width=u.width,this.height=u.height,c=u.intensityToAlpha,l=u.gradientTexture,r=u.alphaRange,this.canvas||(this.canvas=document.createElement("canvas"));try{if(this.gl=this.canvas.getContext("experimental-webgl",{depth:!1,antialias:!1}),this.gl===null&&(this.gl=this.canvas.getContext("webgl",{depth:!1,antialias:!1}),this.gl===null))throw"WebGL not supported"}catch(x){throw o=x,"WebGL not supported"}window.WebGLDebugUtils!=null&&(this.gl=window.WebGLDebugUtils.makeDebugContext(this.gl,function(x,C,E){throw window.WebGLDebugUtils.glEnumToString(x)+" was caused by call to: "+C})),this.gl.enableVertexAttribArray(0),this.gl.blendFunc(this.gl.ONE,this.gl.ONE),l?(f=this.gradientTexture=new $h(this.gl,{channels:"rgba"}).bind(0).setSize(2,2).nearest().clampToEdge(),typeof l=="string"?(h=new Image,h.onload=function(){return f.bind().upload(h)},h.src=l):l.width>0&&l.height>0?f.upload(l):l.onload=function(){return f.upload(l)},n=`uniform sampler2D gradientTexture;
197
179
  vec3 getColor(float intensity){
198
180
  return texture2D(gradientTexture, vec2(intensity, 0.0)).rgb;
199
- }`):(g=null,n=`vec3 getColor(float intensity){
181
+ }`):(f=null,n=`vec3 getColor(float intensity){
200
182
  vec3 blue = vec3(0.0, 0.0, 1.0);
201
183
  vec3 cyan = vec3(0.0, 1.0, 1.0);
202
184
  vec3 green = vec3(0.0, 1.0, 0.0);
@@ -211,12 +193,12 @@ vec3 getColor(float intensity){
211
193
  smoothstep(0.75, 1.0, intensity)*red
212
194
  );
213
195
  return color;
214
- }`),c==null&&(c=!0),c?(d=r!=null?r:[0,1],s=d[0],t=d[1],p=`vec4 alphaFun(vec3 color, float intensity){
196
+ }`),c==null&&(c=!0),c?(p=r!=null?r:[0,1],s=p[0],t=p[1],d=`vec4 alphaFun(vec3 color, float intensity){
215
197
  float alpha = smoothstep(`+s.toFixed(8)+", "+t.toFixed(8)+`, intensity);
216
198
  return vec4(color*alpha, alpha);
217
- }`):p=`vec4 alphaFun(vec3 color, float intensity){
199
+ }`):d=`vec4 alphaFun(vec3 color, float intensity){
218
200
  return vec4(color, 1.0);
219
- }`,this.shader=new Ct(this.gl,{vertex:oi,fragment:ai+(`float linstep(float low, float high, float value){
201
+ }`,this.shader=new nt(this.gl,{vertex:Rt,fragment:Ot+(`float linstep(float low, float high, float value){
220
202
  return clamp((value-low)/(high-low), 0.0, 1.0);
221
203
  }
222
204
 
@@ -228,17 +210,17 @@ float fade(float low, float high, float value){
228
210
  }
229
211
 
230
212
  `+n+`
231
- `+p+`
213
+ `+d+`
232
214
 
233
215
  void main(){
234
216
  float intensity = smoothstep(0.0, 1.0, texture2D(source, texcoord).r);
235
217
  vec3 color = getColor(intensity);
236
218
  gl_FragColor = alphaFun(color, intensity);
237
- }`)}),this.width==null&&(this.width=this.canvas.offsetWidth||2),this.height==null&&(this.height=this.canvas.offsetHeight||2),this.canvas.width=this.width,this.canvas.height=this.height,this.gl.viewport(0,0,this.width,this.height),this.quad=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.quad),u=new Float32Array([-1,-1,0,1,1,-1,0,1,-1,1,0,1,-1,1,0,1,1,-1,0,1,1,1,0,1]),this.gl.bufferData(this.gl.ARRAY_BUFFER,u,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),this.heights=new HT(this,this.gl,this.width,this.height)}return a.prototype.adjustSize=function(){let e,t;if(t=this.canvas.offsetWidth||2,e=this.canvas.offsetHeight||2,this.width!==t||this.height!==e)return this.gl.viewport(0,0,t,e),this.canvas.width=t,this.canvas.height=e,this.width=t,this.height=e,this.heights.resize(this.width,this.height)},a.prototype.display=function(){return this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.quad),this.gl.vertexAttribPointer(0,4,this.gl.FLOAT,!1,0,0),this.heights.nodeFront.bind(0),this.gradientTexture&&this.gradientTexture.bind(1),this.shader.use().int("source",0).int("gradientTexture",1),this.gl.drawArrays(this.gl.TRIANGLES,0,6)},a.prototype.update=function(){return this.heights.update()},a.prototype.clear=function(){return this.heights.clear()},a.prototype.clamp=function(e,t){return e==null&&(e=0),t==null&&(t=1),this.heights.clamp(e,t)},a.prototype.multiply=function(e){return e==null&&(e=.95),this.heights.multiply(e)},a.prototype.blur=function(){return this.heights.blur()},a.prototype.addPoint=function(e,t,r,s){return this.heights.addPoint(e,t,r,s)},a.prototype.addPoints=function(e){let t,r,s,o;for(o=[],r=0,s=e.length;r<s;r++)t=e[r],o.push(this.addPoint(t.x,t.y,t.size,t.intensity));return o},a}();function sa(a){return new WT(a)}var oa=new i.WebMercatorProjection,GT={radius:30,height:0,gradient:void 0,useGround:!1,classificationType:2},aa=class extends A{constructor(e,t={}){super(e),this._options={...GT,...t},this._delegate=new i.PrimitiveCollection,this._isGround=this._options.useGround,this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id",e),this._heat=void 0,this._scale=1,this._points=[],this._bounds=new i.Rectangle,this._boundsInMeter=void 0,this._primitive=this._delegate.add(this._isGround?new i.GroundPrimitive({geometryInstances:new i.GeometryInstance({geometry:{}}),classificationType:this._options.classificationType}):new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}})})),this._state=m.INITIALIZED}get type(){return A.getLayerType("heat-map")}_addedHook(){this._canvas.style.cssText=`
219
+ }`)}),this.width==null&&(this.width=this.canvas.offsetWidth||2),this.height==null&&(this.height=this.canvas.offsetHeight||2),this.canvas.width=this.width,this.canvas.height=this.height,this.gl.viewport(0,0,this.width,this.height),this.quad=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.quad),m=new Float32Array([-1,-1,0,1,1,-1,0,1,-1,1,0,1,-1,1,0,1,1,-1,0,1,1,1,0,1]),this.gl.bufferData(this.gl.ARRAY_BUFFER,m,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),this.heights=new bu(this,this.gl,this.width,this.height)}return a.prototype.adjustSize=function(){let e,t;if(t=this.canvas.offsetWidth||2,e=this.canvas.offsetHeight||2,this.width!==t||this.height!==e)return this.gl.viewport(0,0,t,e),this.canvas.width=t,this.canvas.height=e,this.width=t,this.height=e,this.heights.resize(this.width,this.height)},a.prototype.display=function(){return this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.quad),this.gl.vertexAttribPointer(0,4,this.gl.FLOAT,!1,0,0),this.heights.nodeFront.bind(0),this.gradientTexture&&this.gradientTexture.bind(1),this.shader.use().int("source",0).int("gradientTexture",1),this.gl.drawArrays(this.gl.TRIANGLES,0,6)},a.prototype.update=function(){return this.heights.update()},a.prototype.clear=function(){return this.heights.clear()},a.prototype.clamp=function(e,t){return e==null&&(e=0),t==null&&(t=1),this.heights.clamp(e,t)},a.prototype.multiply=function(e){return e==null&&(e=.95),this.heights.multiply(e)},a.prototype.blur=function(){return this.heights.blur()},a.prototype.addPoint=function(e,t,r,s){return this.heights.addPoint(e,t,r,s)},a.prototype.addPoints=function(e){let t,r,s,o;for(o=[],r=0,s=e.length;r<s;r++)t=e[r],o.push(this.addPoint(t.x,t.y,t.size,t.intensity));return o},a}();function yo(a){return new Su(a)}var vo=new i.WebMercatorProjection,Au={radius:30,height:0,gradient:void 0,useGround:!1,classificationType:2},wo=class extends A{constructor(e,t={}){super(e),this._options={...Au,...t},this._delegate=new i.PrimitiveCollection,this._isGround=this._options.useGround,this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id",e),this._heat=void 0,this._scale=1,this._points=[],this._bounds=new i.Rectangle,this._boundsInMeter=void 0,this._primitive=this._delegate.add(this._isGround?new i.GroundPrimitive({geometryInstances:new i.GeometryInstance({geometry:{}}),classificationType:this._options.classificationType}):new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:{}})})),this._state=_.INITIALIZED}get type(){return A.getLayerType("heat-map")}_addedHook(){this._canvas.style.cssText=`
238
220
  visibility:hidden;
239
221
  width:${this._viewer.canvas.width}px;
240
222
  height:${this._viewer.canvas.height}px;
241
- `,this._viewer.layerContainer.appendChild(this._canvas),this._points&&this._points.length&&(this._heat=sa({canvas:this._canvas,gradientTexture:this._createGradientTexture()}),this._scale=Math.min(Math.abs(this._boundsInMeter.west-this._boundsInMeter.east)/this._viewer.canvas.width,Math.abs(this._boundsInMeter.north-this._boundsInMeter.south)/this._viewer.canvas.height),this._heat.blur(),this._heat.addPoints(this._parsePoints(this._points)),this._update())}_createGradientTexture(){if(!this._options.gradient)return;let e=document.createElement("canvas");e.width=200,e.height=10;let t=e.getContext("2d"),r=t.createLinearGradient(0,0,200,0);for(let s in this._options.gradient)r.addColorStop(+s,this._options.gradient[s]);return t.fillStyle=r,t.fillRect(0,0,200,10),e}_parsePoints(e){return e.map(t=>{let r=oa.project(i.Cartographic.fromDegrees(t.lng,t.lat));return{x:(r.x-this._boundsInMeter.west)/this._scale,y:(r.y-this._boundsInMeter.south)/this._scale,size:this._options.radius,intensity:t.value||Math.random()}})}_computeBounds(){i.Rectangle.fromCartographicArray(this._points.map(e=>i.Cartographic.fromDegrees(e.lng,e.lat)),this._bounds)}_computeBoundsInMeter(){let e=oa.project(i.Rectangle.southwest(this._bounds)),t=oa.project(i.Rectangle.northeast(this._bounds));this._boundsInMeter=new i.Rectangle(e.x,e.y,t.x,t.y)}_update(){if(!this._points||!this._points.length)return!1;this._heat.adjustSize(),this._heat.update(),this._heat.display(),this._primitive&&this._primitive.geometryInstances&&(this._primitive.geometryInstances.geometry=new i.RectangleGeometry({rectangle:this._bounds,height:this._options.height})),this._primitive.appearance=new i.MaterialAppearance({material:new i.Material({fabric:{type:"Heat-Image",uniforms:{image:this._canvas},source:`
223
+ `,this._viewer.layerContainer.appendChild(this._canvas),this._points&&this._points.length&&(this._heat=yo({canvas:this._canvas,gradientTexture:this._createGradientTexture()}),this._scale=Math.min(Math.abs(this._boundsInMeter.west-this._boundsInMeter.east)/this._viewer.canvas.width,Math.abs(this._boundsInMeter.north-this._boundsInMeter.south)/this._viewer.canvas.height),this._heat.blur(),this._heat.addPoints(this._parsePoints(this._points)),this._update())}_createGradientTexture(){if(!this._options.gradient)return;let e=document.createElement("canvas");e.width=200,e.height=10;let t=e.getContext("2d"),r=t.createLinearGradient(0,0,200,0);for(let s in this._options.gradient)r.addColorStop(+s,this._options.gradient[s]);return t.fillStyle=r,t.fillRect(0,0,200,10),e}_parsePoints(e){return e.map(t=>{let r=vo.project(i.Cartographic.fromDegrees(t.lng,t.lat));return{x:(r.x-this._boundsInMeter.west)/this._scale,y:(r.y-this._boundsInMeter.south)/this._scale,size:this._options.radius,intensity:t.value||Math.random()}})}_computeBounds(){i.Rectangle.fromCartographicArray(this._points.map(e=>i.Cartographic.fromDegrees(e.lng,e.lat)),this._bounds)}_computeBoundsInMeter(){let e=vo.project(i.Rectangle.southwest(this._bounds)),t=vo.project(i.Rectangle.northeast(this._bounds));this._boundsInMeter=new i.Rectangle(e.x,e.y,t.x,t.y)}_update(){if(!this._points||!this._points.length)return!1;this._heat.adjustSize(),this._heat.update(),this._heat.display(),this._primitive&&this._primitive.geometryInstances&&(this._primitive.geometryInstances.geometry=new i.RectangleGeometry({rectangle:this._bounds,height:this._options.height})),this._primitive.appearance=new i.MaterialAppearance({material:new i.Material({fabric:{type:"Heat-Image",uniforms:{image:this._canvas},source:`
242
224
  uniform sampler2D image;
243
225
  czm_material czm_getMaterial(czm_materialInput materialInput){
244
226
  czm_material material = czm_getDefaultMaterial(materialInput);
@@ -251,7 +233,7 @@ void main(){
251
233
  material.alpha = colorImage.a;
252
234
  return material;
253
235
  }
254
- `},translucent:function(e){return!0}}),flat:!0})}setPoints(e){return this._points=e,this._computeBounds(),this._computeBoundsInMeter(),this._viewer&&(this._scale=Math.min(Math.abs(this._boundsInMeter.west-this._boundsInMeter.east)/this._viewer.canvas.width,Math.abs(this._boundsInMeter.north-this._boundsInMeter.south)/this._viewer.canvas.height),this._heat=sa({canvas:this._canvas,gradientTexture:this._createGradientTexture()})),this._heat&&(this._heat.blur(),this._heat.addPoints(this._parsePoints(this._points)),this._update()),this}clear(){return this._heat.clear(),this._points=[],this._state=m.CLEARED,this}};A.registerType("heat-map");var UT=aa;var na=class{constructor(e,t){this.u=e,this.v=t,this.m=this.magnitude()}magnitude(){return Math.sqrt(this.u*this.u+this.v*this.v)}directionTo(){let t=Math.atan2(this.u,this.v)*(180/Math.PI);return t<0&&(t+=360),t}directionFrom(){return(this.directionTo()+180)%360}},la=na;var ha=class{constructor(e){this.grid=[],this.xmin=e.xmin,this.xmax=e.xmax,this.ymin=e.ymin,this.ymax=e.ymax,this.cols=e.cols,this.rows=e.rows,this.us=e.us,this.vs=e.vs,this.deltaX=e.deltaX,this.deltaY=e.deltaY,this.deltaY<0&&this.ymin<this.ymax?console.warn("[wind-core]: The data is flipY"):(this.ymin=Math.min(e.ymax,e.ymin),this.ymax=Math.max(e.ymax,e.ymin)),this.isFields=!0;let t=Math.ceil((this.xmax-this.xmin)/e.deltaX),r=Math.ceil((this.ymax-this.ymin)/e.deltaY);(t!==this.cols||r!==this.rows)&&console.warn("[wind-core]: The data grid not equal"),this.isContinuous=Math.floor(this.cols*e.deltaX)>=360,this.wrappedX="wrappedX"in e?e.wrappedX:this.xmax>180,this.grid=this.buildGrid(),this.range=this.calculateRange()}buildGrid(){let e=[],t=0,r=this,s=r.rows,o=r.cols,n=r.us,l=r.vs;for(let h=0;h<s;h++){let c=[];for(let p=0;p<o;p++,t++){let u=n[t],g=l[t],_=this.isValid(u)&&this.isValid(g);c[p]=_?new la(u,g):null}this.isContinuous&&c.push(c[0]),e[h]=c}return e}release(){this.grid=[]}extent(){return[this.xmin,this.ymin,this.xmax,this.ymax]}bilinearInterpolateVector(e,t,r,s,o,n){let l=1-e,h=1-t,c=l*h,p=e*h,u=l*t,g=e*t,_=r.u*c+s.u*p+o.u*u+n.u*g,d=r.v*c+s.v*p+o.v*u+n.v*g;return new la(_,d)}calculateRange(){if(!this.grid||!this.grid[0])return;let e=this.grid.length,t=this.grid[0].length,r,s;for(let o=0;o<e;o++)for(let n=0;n<t;n++){let l=this.grid[o][n];if(l!==null){let h=l.m||l.magnitude();r===void 0?r=h:s===void 0?(s=h,r=Math.min(r,s),s=Math.max(r,s)):(r=Math.min(h,r),s=Math.max(h,s))}}return[r,s]}isValid(e){return e!=null}getWrappedLongitudes(){let e=this.xmin,t=this.xmax;return this.wrappedX&&(this.isContinuous?(e=-180,t=180):(t=this.xmax-360,e=this.xmin-360)),[e,t]}contains(e,t){let r=this.getWrappedLongitudes(),s=r[0],o=r[1],n=e>=s&&e<=o,l;return this.deltaY>=0?l=t>=this.ymin&&t<=this.ymax:l=t>=this.ymax&&t<=this.ymin,n&&l}floorMod(e,t){return e-t*Math.floor(e/t)}getDecimalIndexes(e,t){let r=this.floorMod(e-this.xmin,360)/this.deltaX,s=(this.ymax-t)/this.deltaY;return[r,s]}valueAt(e,t){if(!this.contains(e,t))return null;let r=this.getDecimalIndexes(e,t),s=Math.floor(r[0]),o=Math.floor(r[1]),n=this.clampColumnIndex(s),l=this.clampRowIndex(o);return this.valueAtIndexes(n,l)}interpolatedValueAt(e,t){if(!this.contains(e,t))return null;let r=this.getDecimalIndexes(e,t),s=r[0],o=r[1];return this.interpolatePoint(s,o)}hasValueAt(e,t){return this.valueAt(e,t)!==null}interpolatePoint(e,t){let r=this.getFourSurroundingIndexes(e,t),s=r[0],o=r[1],n=r[2],l=r[3],h=this.getFourSurroundingValues(s,o,n,l);if(h){let c=h[0],p=h[1],u=h[2],g=h[3];return this.bilinearInterpolateVector(e-s,t-n,c,p,u,g)}return null}clampColumnIndex(e){let t=e;e<0&&(t=0);let r=this.cols-1;return e>r&&(t=r),t}clampRowIndex(e){let t=e;e<0&&(t=0);let r=this.rows-1;return e>r&&(t=r),t}getFourSurroundingIndexes(e,t){let r=Math.floor(e),s=r+1;this.isContinuous&&s>=this.cols&&(s=0),s=this.clampColumnIndex(s);let o=this.clampRowIndex(Math.floor(t)),n=this.clampRowIndex(o+1);return[r,s,o,n]}getFourSurroundingValues(e,t,r,s){let o;if(o=this.grid[r]){let n=o[e],l=o[t];if(this.isValid(n)&&this.isValid(l)&&(o=this.grid[s])){let h=o[e],c=o[t];if(this.isValid(h)&&this.isValid(c))return[n,l,h,c]}}return null}valueAtIndexes(e,t){return this.grid[t][e]}lonLatAtIndexes(e,t){let r=this.longitudeAtX(e),s=this.latitudeAtY(t);return[r,s]}longitudeAtX(e){let t=this.deltaX/2,r=this.xmin+t+e*this.deltaX;return this.wrappedX&&(r=r>180?r-360:r),r}latitudeAtY(e){let t=this.deltaY/2;return this.ymax-t-e*this.deltaY}randomize(e,t,r,s){e===void 0&&(e={});let o=Math.random()*(t||this.cols)|0,n=Math.random()*(r||this.rows)|0,l=s([o,n]);return l!==null?(e.x=l[0],e.y=l[1]):(e.x=this.longitudeAtX(o),e.y=this.latitudeAtY(n)),e}checkFields(){return this.isFields}},cu=ha;var ca=class{constructor(e){this.options={},this.particles=[],this.ctx=e,this.animationLoop=void 0,this.animate=this.animate.bind(this)}_indexFor(e,t,r,s){return Math.max(0,Math.min(s.length-1,Math.round((e-t)/(r-t)*(s.length-1))))}_moveParticles(){if(!this.particles||!this.particles.length)return;let e=this.ctx.canvas.width,t=this.ctx.canvas.height,r=this.particles,s=this.options.maxAge,o=typeof this.options.velocityScale=="function"?this.options.velocityScale():this.options.velocityScale;for(let n=0;n<r.length;n++){let l=r[n];l.age>s&&(l.age=0,this.field.randomize(l,e,t,this.unProject));let h=l.x,c=l.y,p=this.field.interpolatedValueAt(h,c);if(p===null)l.age=s;else{let u=h+p.u*o,g=c+p.v*o;this.field.hasValueAt(u,g)?(l.xt=u,l.yt=g,l.m=p.m):(l.x=u,l.y=g,l.age=s)}l.age++}}_drawParticles(){if(!this.particles||!this.particles.length)return;let e=this.particles,t=this.ctx.globalCompositeOperation;this.ctx.globalCompositeOperation="destination-in",this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.globalCompositeOperation=t,this.ctx.globalAlpha=this.options.globalAlpha,this.ctx.fillStyle="rgba(0, 0, 0, "+this.options.globalAlpha+")",this.ctx.lineWidth=this.options.lineWidth?this.options.lineWidth:1,this.ctx.strokeStyle=this.options.colorScale?this.options.colorScale:"#fff";let r=0,s=e.length;if(this.field&&s>0){let o,n;if(this.options.minVelocity&&this.options.maxVelocity)o=this.options.minVelocity,n=this.options.maxVelocity;else{let l=this.field.range;o=l[0],n=l[1]}for(;r<s;r++)this[this.options.useCoordsDraw?"_drawCoordsParticle":"_drawPixelParticle"](e[r],o,n)}}_drawPixelParticle(e,t,r){let s=[e.x,e.y],o=[e.xt,e.yt],n=e.xt-e.x,l=e.yt-e.y;n*n+l*l>20*20||o&&s&&o[0]&&o[1]&&s[0]&&s[1]&&e.age<=this.options.maxAge&&this._drawStroke(s,o,e,t,r)}_drawCoordsParticle(e,t,r){let s=[e.x,e.y],o=[e.xt,e.yt];if(o&&s&&o[0]&&o[1]&&s[0]&&s[1]&&this.intersectsCoordinate(o)&&e.age<=this.options.maxAge){let n=this.project(s),l=this.project(o);this._drawStroke(n,l,e,t,r)}}_drawStroke(e,t,r,s,o){if(e&&t){if(this.ctx.beginPath(),this.ctx.moveTo(e[0],e[1]),this.ctx.lineTo(t[0],t[1]),typeof this.options.colorScale=="function")this.ctx.strokeStyle=this.options.colorScale(r.m);else if(Array.isArray(this.options.colorScale)){let n=this._indexFor(r.m,s,o,this.options.colorScale);this.ctx.strokeStyle=this.options.colorScale[n]}typeof this.options.lineWidth=="function"&&(this.ctx.lineWidth=this.options.lineWidth(r.m)),r.x=r.xt,r.y=r.yt,this.ctx.stroke()}}_prepareParticlePaths(){let e=this.ctx.canvas.width,t=this.ctx.canvas.height,r=typeof this.options.paths=="function"?this.options.paths(this):this.options.paths,s=[];if(!this.field)return[];for(let o=0;o<r;o++)s.push(this.field.randomize({age:Math.floor(Math.random()*this.options.maxAge)},e,t,this.unProject));return s}project(){throw new Error("project must be override")}unProject(){throw new Error("unProject must be override")}intersectsCoordinate(e){throw new Error("must be override")}prerender(){this.field&&(this.particles=this._prepareParticlePaths(),!this.starting&&!this.forceStop&&(this.starting=!0,this._then=Date.now(),this.animate()))}render(){return this._moveParticles(),this._drawParticles(),this}clearCanvas(){this.stop(),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.forceStop=!1}start(){this.starting=!0,this.forceStop=!1,this._then=Date.now(),this.animate()}stop(){cancelAnimationFrame(this.animationLoop),this.starting=!1,this.forceStop=!0}animate(){this.animationLoop&&cancelAnimationFrame(this.animationLoop),this.animationLoop=requestAnimationFrame(this.animate);let e=Date.now(),t=e-this._then;t>this.options.frameRate&&(this._then=e-t%this.options.frameRate,this.render())}setData(e){return this.field=e,this}setOptions(e){var t,r,s,o;return this.options=e,!((t=this.options)!=null&&t.maxAge)&&((r=this.options)!=null&&r.particleAge)&&(this.options.maxAge=Number(this.options.particleAge)),!((s=this.options)!=null&&s.paths)&&((o=this.options)!=null&&o.particleMultiplier)&&(this.options.paths=Math.round(this.options.width*this.options.height*Number(this.options.particleMultiplier))),this}},pu=ca;var BT={globalAlpha:.9,lineWidth:1,colorScale:"#fff",velocityScale:1/25,maxAge:90,paths:800,frameRate:20,useCoordsDraw:!0,gpet:!0},pa=class extends A{constructor(e,t={}){super(e),this._options={...BT,...t},this._data=void 0,this._canvas=document.createElement("canvas"),this._state=m.INITIALIZED}get type(){return A.getLayerType("wind")}set show(e){this._show=e,this._canvas.style.visibility=e?"visible":"hidden"}get show(){return this._show}_formatData(e){let t,r;if(e.forEach(function(o){switch(o.header.parameterCategory+","+o.header.parameterNumber){case"1,2":case"2,2":t=o;break;case"1,3":case"2,3":r=o;break}}),!r||!t)return;let s=t.header;return new cu({xmin:s.lo1,ymin:s.la1,xmax:s.lo2,ymax:s.la2,deltaX:s.dx,deltaY:s.dy,cols:s.nx,rows:s.ny,us:t.data,vs:r.data})}_mountCanvas(){if(!this._viewer||!this._canvas)return;this._canvas.style.cssText="position:absolute; left:0; top:0;user-select:none;pointer-events: none;",this._canvas.className="dc-wind-layer";let{width:e,height:t}=this._viewer.canvas;this._canvas.width=e,this._canvas.height=t,this._canvas.style.width=e+"px",this._canvas.style.height=t+"px",this._viewer.layerContainer.appendChild(this._canvas)}_addedHook(){let e=this._viewer.scene,t=this._viewer.camera,r=i.Ellipsoid.WGS84;this._delegate.intersectsCoordinate=s=>{if(e.mode===i.SceneMode.SCENE3D){let o=new i.EllipsoidalOccluder(r,t.position),n=i.Cartesian3.fromDegrees(s[0],s[1]);return o.isPointVisible(n)}else if(e.mode===i.SceneMode.SCENE2D)return!(s[0]===-180||s[0]===180);return!0},this._delegate.project=s=>{let o=i.Cartesian3.fromDegrees(s[0],s[1]),n=i.SceneTransforms.worldToWindowCoordinates(e,o);return[n.x,n.y]},this._delegate.unProject=s=>{let o=new i.Cartesian2(s[0],s[1]),n;if(e.mode===i.SceneMode.SCENE3D?n=e.globe.pick(t.getPickRay(o),e):n=e.camera.pickEllipsoid(o,r),!n)return null;let l=r.cartesianToCartographic(n),h=i.Math.toDegrees(l.latitude);return[i.Math.toDegrees(l.longitude),h]}}_onAdd(e){this._viewer=e,this._mountCanvas();let t=this._canvas.getContext("2d");this._delegate||(this._delegate=new pu(t),this._delegate.setOptions(this._options),this._addedHook()),this._data&&(this._delegate.setData(this._data),this._delegate.prerender(),this._delegate.render())}_onRemove(){this._delegate&&this._delegate.stop(),this._canvas&&this._viewer.layerContainer.removeChild(this._canvas),delete this._canvas}setData(e,t){return e&&e.checkFields&&e.checkFields()?this._data=e:Array.isArray(e)&&(this._data=this._formatData(e)),this._delegate&&(this._delegate.setData(this._data),t&&(this._options={...this._options,...t},this._delegate.setOptions(this._options)),this._delegate.prerender(),this._delegate.render()),this}setOptions(e){return this._options={...this._options,...e},this._delegate&&(this._delegate.setOptions(this._options),this._delegate.prerender(),this._delegate.render()),this}};A.registerType("wind");var VT=pa;var{Cartesian3:ni,Ellipsoid:jT,Math:du}=i;function _e(a){this._api=a,this._viewer=Object(a.getZr()).viewer,this._mapOffset=[0,0],this.dimensions=["lng","lat"]}_e.prototype.getViewer=function(){return this._viewer};_e.prototype.setMapOffset=function(a){return this._mapOffset=a,this};_e.prototype.dataToPoint=function(a){let e=[],t=ni.fromDegrees(a[0],a[1]);if(!t)return e;let r=jT.WGS84.geodeticSurfaceNormal(t,new ni),s=this._viewer.camera.direction;if(ni.dot(r,s)>=0)return e;let o=this._viewer.scene.cartesianToCanvasCoordinates(t);return o?[o.x-this._mapOffset[0],o.y-this._mapOffset[1]]:e};_e.prototype.pointToData=function(a){let e=this._viewer.scene.globe.ellipsoid,t=new ni(a[0]+this._mapOffset[0],a[1]+this._mapOffset[1],0),r=e.cartesianToCartographic(t);return[du.toDegrees(r.longitude),du.toDegrees(r.latitude)]};_e.create=function(a,e){let t;a.eachComponent("GLMap",function(r){t=new _e(e),t.setMapOffset(r.__mapOffset||[0,0]),r.coordinateSystem=t}),a.eachSeries(function(r){r.get("coordinateSystem")==="GLMap"&&(r.coordinateSystem=t)})};_e.dimensions=["lng","lat"];function qT(a){_e.prototype.getViewRect=function(){let e=this._api;return new a.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},_e.prototype.getRoamTransform=function(){return a.matrix.create()}}var mu=!1;function uu(a){if(mu)return;let{registerAction:e,registerCoordinateSystem:t,extendComponentModel:r,extendComponentView:s}=a;r({type:"GLMap",getViewer(){return Object(this.getZr()).viewer},defaultOption:{roam:!1}}),s({type:"GLMap",init:function(o,n){this.api=n,n.getZr().viewer.clock.onTick.addEventListener(this.moveHandler,this)},moveHandler:function(){this.api.getZr().dom.style.visibility!=="hidden"&&this.api.dispatchAction({type:"GLMapRoam"})},render:function(o,n,l){},dispose:function(){this.api.getZr().viewer.clock.onTick.removeEventListener(this.moveHandler,this)}}),qT(a),t("GLMap",_e),e({type:"GLMapRoam",event:"GLMapRoam",update:"updateLayout"},function(o,n){}),mu=!0}var da=class extends A{constructor(e,t){if(!q("echarts"))throw new Error("miss the echarts lib");super(e),this._option=t,this._delegate=void 0,this._chart=void 0}set show(e){this._show=e,this._delegate.style.visibility=e?"visible":"hidden"}get show(){return this._show}_createChartElement(){let e=this._viewer.scene.canvas,t=document.createElement("div");return t.setAttribute("id",this._id),t.setAttribute("data-layer-type","chart-layer"),t.style.cssText=`position:absolute; top:0; left:0; width: ${e.clientWidth}px; height: ${e.clientHeight}px;pointer-events:none;`,this._viewer.layerContainer.appendChild(t),t}_onAdd(e){let t=q("echarts");uu(t),this._viewer=e,this._viewer.canvas.setAttribute("tabIndex","0"),this._delegate=this._createChartElement(),this._chart=t.init(this._delegate),Object(this._chart.getZr()).viewer=e,this._option&&this._chart.setOption({...this._option,GLMap:{},animation:!1}),this._state=m.ADDED}_onRemove(){this._delegate&&this._viewer&&(this._chart.dispose(),this._viewer.layerContainer.removeChild(this._delegate),this._state=m.REMOVED)}setOption(e={}){return this._option=e,this._chart&&this._chart.setOption({...e,GLMap:{},animation:!1}),this}clear(){return this._chart.clear(),this}resize(){return this._chart.resize(),this}},ZT=da;var _u=`/**\r
236
+ `},translucent:function(e){return!0}}),flat:!0})}setPoints(e){return this._points=e,this._computeBounds(),this._computeBoundsInMeter(),this._viewer&&(this._scale=Math.min(Math.abs(this._boundsInMeter.west-this._boundsInMeter.east)/this._viewer.canvas.width,Math.abs(this._boundsInMeter.north-this._boundsInMeter.south)/this._viewer.canvas.height),this._heat=yo({canvas:this._canvas,gradientTexture:this._createGradientTexture()})),this._heat&&(this._heat.blur(),this._heat.addPoints(this._parsePoints(this._points)),this._update()),this}clear(){return this._heat.clear(),this._points=[],this._state=_.CLEARED,this}};A.registerType("heat-map");var Mu=wo;var Co=class{constructor(e,t){this.u=e,this.v=t,this.m=this.magnitude()}magnitude(){return Math.sqrt(this.u*this.u+this.v*this.v)}directionTo(){let t=Math.atan2(this.u,this.v)*(180/Math.PI);return t<0&&(t+=360),t}directionFrom(){return(this.directionTo()+180)%360}},xo=Co;var To=class{constructor(e){this.grid=[],this.xmin=e.xmin,this.xmax=e.xmax,this.ymin=e.ymin,this.ymax=e.ymax,this.cols=e.cols,this.rows=e.rows,this.us=e.us,this.vs=e.vs,this.deltaX=e.deltaX,this.deltaY=e.deltaY,this.deltaY<0&&this.ymin<this.ymax?console.warn("[wind-core]: The data is flipY"):(this.ymin=Math.min(e.ymax,e.ymin),this.ymax=Math.max(e.ymax,e.ymin)),this.isFields=!0;let t=Math.ceil((this.xmax-this.xmin)/e.deltaX),r=Math.ceil((this.ymax-this.ymin)/e.deltaY);(t!==this.cols||r!==this.rows)&&console.warn("[wind-core]: The data grid not equal"),this.isContinuous=Math.floor(this.cols*e.deltaX)>=360,this.wrappedX="wrappedX"in e?e.wrappedX:this.xmax>180,this.grid=this.buildGrid(),this.range=this.calculateRange()}buildGrid(){let e=[],t=0,r=this,s=r.rows,o=r.cols,n=r.us,l=r.vs;for(let h=0;h<s;h++){let c=[];for(let d=0;d<o;d++,t++){let m=n[t],f=l[t],u=this.isValid(m)&&this.isValid(f);c[d]=u?new xo(m,f):null}this.isContinuous&&c.push(c[0]),e[h]=c}return e}release(){this.grid=[]}extent(){return[this.xmin,this.ymin,this.xmax,this.ymax]}bilinearInterpolateVector(e,t,r,s,o,n){let l=1-e,h=1-t,c=l*h,d=e*h,m=l*t,f=e*t,u=r.u*c+s.u*d+o.u*m+n.u*f,p=r.v*c+s.v*d+o.v*m+n.v*f;return new xo(u,p)}calculateRange(){if(!this.grid||!this.grid[0])return;let e=this.grid.length,t=this.grid[0].length,r,s;for(let o=0;o<e;o++)for(let n=0;n<t;n++){let l=this.grid[o][n];if(l!==null){let h=l.m||l.magnitude();r===void 0?r=h:s===void 0?(s=h,r=Math.min(r,s),s=Math.max(r,s)):(r=Math.min(h,r),s=Math.max(h,s))}}return[r,s]}isValid(e){return e!=null}getWrappedLongitudes(){let e=this.xmin,t=this.xmax;return this.wrappedX&&(this.isContinuous?(e=-180,t=180):(t=this.xmax-360,e=this.xmin-360)),[e,t]}contains(e,t){let r=this.getWrappedLongitudes(),s=r[0],o=r[1],n=e>=s&&e<=o,l;return this.deltaY>=0?l=t>=this.ymin&&t<=this.ymax:l=t>=this.ymax&&t<=this.ymin,n&&l}floorMod(e,t){return e-t*Math.floor(e/t)}getDecimalIndexes(e,t){let r=this.floorMod(e-this.xmin,360)/this.deltaX,s=(this.ymax-t)/this.deltaY;return[r,s]}valueAt(e,t){if(!this.contains(e,t))return null;let r=this.getDecimalIndexes(e,t),s=Math.floor(r[0]),o=Math.floor(r[1]),n=this.clampColumnIndex(s),l=this.clampRowIndex(o);return this.valueAtIndexes(n,l)}interpolatedValueAt(e,t){if(!this.contains(e,t))return null;let r=this.getDecimalIndexes(e,t),s=r[0],o=r[1];return this.interpolatePoint(s,o)}hasValueAt(e,t){return this.valueAt(e,t)!==null}interpolatePoint(e,t){let r=this.getFourSurroundingIndexes(e,t),s=r[0],o=r[1],n=r[2],l=r[3],h=this.getFourSurroundingValues(s,o,n,l);if(h){let c=h[0],d=h[1],m=h[2],f=h[3];return this.bilinearInterpolateVector(e-s,t-n,c,d,m,f)}return null}clampColumnIndex(e){let t=e;e<0&&(t=0);let r=this.cols-1;return e>r&&(t=r),t}clampRowIndex(e){let t=e;e<0&&(t=0);let r=this.rows-1;return e>r&&(t=r),t}getFourSurroundingIndexes(e,t){let r=Math.floor(e),s=r+1;this.isContinuous&&s>=this.cols&&(s=0),s=this.clampColumnIndex(s);let o=this.clampRowIndex(Math.floor(t)),n=this.clampRowIndex(o+1);return[r,s,o,n]}getFourSurroundingValues(e,t,r,s){let o;if(o=this.grid[r]){let n=o[e],l=o[t];if(this.isValid(n)&&this.isValid(l)&&(o=this.grid[s])){let h=o[e],c=o[t];if(this.isValid(h)&&this.isValid(c))return[n,l,h,c]}}return null}valueAtIndexes(e,t){return this.grid[t][e]}lonLatAtIndexes(e,t){let r=this.longitudeAtX(e),s=this.latitudeAtY(t);return[r,s]}longitudeAtX(e){let t=this.deltaX/2,r=this.xmin+t+e*this.deltaX;return this.wrappedX&&(r=r>180?r-360:r),r}latitudeAtY(e){let t=this.deltaY/2;return this.ymax-t-e*this.deltaY}randomize(e,t,r,s){e===void 0&&(e={});let o=Math.random()*(t||this.cols)|0,n=Math.random()*(r||this.rows)|0,l=s([o,n]);return l!==null?(e.x=l[0],e.y=l[1]):(e.x=this.longitudeAtX(o),e.y=this.latitudeAtY(n)),e}checkFields(){return this.isFields}},Kh=To;var Eo=class{constructor(e){this.options={},this.particles=[],this.ctx=e,this.animationLoop=void 0,this.animate=this.animate.bind(this)}_indexFor(e,t,r,s){return Math.max(0,Math.min(s.length-1,Math.round((e-t)/(r-t)*(s.length-1))))}_moveParticles(){if(!this.particles||!this.particles.length)return;let e=this.ctx.canvas.width,t=this.ctx.canvas.height,r=this.particles,s=this.options.maxAge,o=typeof this.options.velocityScale=="function"?this.options.velocityScale():this.options.velocityScale;for(let n=0;n<r.length;n++){let l=r[n];l.age>s&&(l.age=0,this.field.randomize(l,e,t,this.unProject));let h=l.x,c=l.y,d=this.field.interpolatedValueAt(h,c);if(d===null)l.age=s;else{let m=h+d.u*o,f=c+d.v*o;this.field.hasValueAt(m,f)?(l.xt=m,l.yt=f,l.m=d.m):(l.x=m,l.y=f,l.age=s)}l.age++}}_drawParticles(){if(!this.particles||!this.particles.length)return;let e=this.particles,t=this.ctx.globalCompositeOperation;this.ctx.globalCompositeOperation="destination-in",this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.globalCompositeOperation=t,this.ctx.globalAlpha=this.options.globalAlpha,this.ctx.fillStyle="rgba(0, 0, 0, "+this.options.globalAlpha+")",this.ctx.lineWidth=this.options.lineWidth?this.options.lineWidth:1,this.ctx.strokeStyle=this.options.colorScale?this.options.colorScale:"#fff";let r=0,s=e.length;if(this.field&&s>0){let o,n;if(this.options.minVelocity&&this.options.maxVelocity)o=this.options.minVelocity,n=this.options.maxVelocity;else{let l=this.field.range;o=l[0],n=l[1]}for(;r<s;r++)this[this.options.useCoordsDraw?"_drawCoordsParticle":"_drawPixelParticle"](e[r],o,n)}}_drawPixelParticle(e,t,r){let s=[e.x,e.y],o=[e.xt,e.yt],n=e.xt-e.x,l=e.yt-e.y;n*n+l*l>20*20||o&&s&&o[0]&&o[1]&&s[0]&&s[1]&&e.age<=this.options.maxAge&&this._drawStroke(s,o,e,t,r)}_drawCoordsParticle(e,t,r){let s=[e.x,e.y],o=[e.xt,e.yt];if(o&&s&&o[0]&&o[1]&&s[0]&&s[1]&&this.intersectsCoordinate(o)&&e.age<=this.options.maxAge){let n=this.project(s),l=this.project(o);this._drawStroke(n,l,e,t,r)}}_drawStroke(e,t,r,s,o){if(e&&t){if(this.ctx.beginPath(),this.ctx.moveTo(e[0],e[1]),this.ctx.lineTo(t[0],t[1]),typeof this.options.colorScale=="function")this.ctx.strokeStyle=this.options.colorScale(r.m);else if(Array.isArray(this.options.colorScale)){let n=this._indexFor(r.m,s,o,this.options.colorScale);this.ctx.strokeStyle=this.options.colorScale[n]}typeof this.options.lineWidth=="function"&&(this.ctx.lineWidth=this.options.lineWidth(r.m)),r.x=r.xt,r.y=r.yt,this.ctx.stroke()}}_prepareParticlePaths(){let e=this.ctx.canvas.width,t=this.ctx.canvas.height,r=typeof this.options.paths=="function"?this.options.paths(this):this.options.paths,s=[];if(!this.field)return[];for(let o=0;o<r;o++)s.push(this.field.randomize({age:Math.floor(Math.random()*this.options.maxAge)},e,t,this.unProject));return s}project(){throw new Error("project must be override")}unProject(){throw new Error("unProject must be override")}intersectsCoordinate(e){throw new Error("must be override")}prerender(){this.field&&(this.particles=this._prepareParticlePaths(),!this.starting&&!this.forceStop&&(this.starting=!0,this._then=Date.now(),this.animate()))}render(){return this._moveParticles(),this._drawParticles(),this}clearCanvas(){this.stop(),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.forceStop=!1}start(){this.starting=!0,this.forceStop=!1,this._then=Date.now(),this.animate()}stop(){cancelAnimationFrame(this.animationLoop),this.starting=!1,this.forceStop=!0}animate(){this.animationLoop&&cancelAnimationFrame(this.animationLoop),this.animationLoop=requestAnimationFrame(this.animate);let e=Date.now(),t=e-this._then;t>this.options.frameRate&&(this._then=e-t%this.options.frameRate,this.render())}setData(e){return this.field=e,this}setOptions(e){var t,r,s,o;return this.options=e,!((t=this.options)!=null&&t.maxAge)&&((r=this.options)!=null&&r.particleAge)&&(this.options.maxAge=Number(this.options.particleAge)),!((s=this.options)!=null&&s.paths)&&((o=this.options)!=null&&o.particleMultiplier)&&(this.options.paths=Math.round(this.options.width*this.options.height*Number(this.options.particleMultiplier))),this}},Qh=Eo;var Iu={globalAlpha:.9,lineWidth:1,colorScale:"#fff",velocityScale:1/25,maxAge:90,paths:800,frameRate:20,useCoordsDraw:!0,gpet:!0},Po=class extends A{constructor(e,t={}){super(e),this._options={...Iu,...t},this._data=void 0,this._canvas=document.createElement("canvas"),this._state=_.INITIALIZED}get type(){return A.getLayerType("wind")}set show(e){this._show=e,this._canvas.style.visibility=e?"visible":"hidden"}get show(){return this._show}_formatData(e){let t,r;if(e.forEach(function(o){switch(o.header.parameterCategory+","+o.header.parameterNumber){case"1,2":case"2,2":t=o;break;case"1,3":case"2,3":r=o;break}}),!r||!t)return;let s=t.header;return new Kh({xmin:s.lo1,ymin:s.la1,xmax:s.lo2,ymax:s.la2,deltaX:s.dx,deltaY:s.dy,cols:s.nx,rows:s.ny,us:t.data,vs:r.data})}_mountCanvas(){if(!this._viewer||!this._canvas)return;this._canvas.style.cssText="position:absolute; left:0; top:0;user-select:none;pointer-events: none;",this._canvas.className="dc-wind-layer";let{width:e,height:t}=this._viewer.canvas;this._canvas.width=e,this._canvas.height=t,this._canvas.style.width=e+"px",this._canvas.style.height=t+"px",this._viewer.layerContainer.appendChild(this._canvas)}_addedHook(){let e=this._viewer.scene,t=this._viewer.camera,r=i.Ellipsoid.WGS84;this._delegate.intersectsCoordinate=s=>{if(e.mode===i.SceneMode.SCENE3D){let o=new i.EllipsoidalOccluder(r,t.position),n=i.Cartesian3.fromDegrees(s[0],s[1]);return o.isPointVisible(n)}else if(e.mode===i.SceneMode.SCENE2D)return!(s[0]===-180||s[0]===180);return!0},this._delegate.project=s=>{let o=i.Cartesian3.fromDegrees(s[0],s[1]),n=i.SceneTransforms.worldToWindowCoordinates(e,o);return[n.x,n.y]},this._delegate.unProject=s=>{let o=new i.Cartesian2(s[0],s[1]),n;if(e.mode===i.SceneMode.SCENE3D?n=e.globe.pick(t.getPickRay(o),e):n=e.camera.pickEllipsoid(o,r),!n)return null;let l=r.cartesianToCartographic(n),h=i.Math.toDegrees(l.latitude);return[i.Math.toDegrees(l.longitude),h]}}_onAdd(e){this._viewer=e,this._mountCanvas();let t=this._canvas.getContext("2d");this._delegate||(this._delegate=new Qh(t),this._delegate.setOptions(this._options),this._addedHook()),this._data&&(this._delegate.setData(this._data),this._delegate.prerender(),this._delegate.render())}_onRemove(){this._delegate&&this._delegate.stop(),this._canvas&&this._viewer.layerContainer.removeChild(this._canvas),delete this._canvas}setData(e,t){return e&&e.checkFields&&e.checkFields()?this._data=e:Array.isArray(e)&&(this._data=this._formatData(e)),this._delegate&&(this._delegate.setData(this._data),t&&(this._options={...this._options,...t},this._delegate.setOptions(this._options)),this._delegate.prerender(),this._delegate.render()),this}setOptions(e){return this._options={...this._options,...e},this._delegate&&(this._delegate.setOptions(this._options),this._delegate.prerender(),this._delegate.render()),this}};A.registerType("wind");var Lu=Po;var{Cartesian3:kt,Ellipsoid:Du,Math:ec}=i;function fe(a){this._api=a,this._viewer=Object(a.getZr()).viewer,this._mapOffset=[0,0],this.dimensions=["lng","lat"]}fe.prototype.getViewer=function(){return this._viewer};fe.prototype.setMapOffset=function(a){return this._mapOffset=a,this};fe.prototype.dataToPoint=function(a){let e=[],t=kt.fromDegrees(a[0],a[1]);if(!t)return e;let r=Du.WGS84.geodeticSurfaceNormal(t,new kt),s=this._viewer.camera.direction;if(kt.dot(r,s)>=0)return e;let o=this._viewer.scene.cartesianToCanvasCoordinates(t);return o?[o.x-this._mapOffset[0],o.y-this._mapOffset[1]]:e};fe.prototype.pointToData=function(a){let e=this._viewer.scene.globe.ellipsoid,t=new kt(a[0]+this._mapOffset[0],a[1]+this._mapOffset[1],0),r=e.cartesianToCartographic(t);return[ec.toDegrees(r.longitude),ec.toDegrees(r.latitude)]};fe.create=function(a,e){let t;a.eachComponent("GLMap",function(r){t=new fe(e),t.setMapOffset(r.__mapOffset||[0,0]),r.coordinateSystem=t}),a.eachSeries(function(r){r.get("coordinateSystem")==="GLMap"&&(r.coordinateSystem=t)})};fe.dimensions=["lng","lat"];function Ru(a){fe.prototype.getViewRect=function(){let e=this._api;return new a.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},fe.prototype.getRoamTransform=function(){return a.matrix.create()}}var tc=!1;function ic(a){if(tc)return;let{registerAction:e,registerCoordinateSystem:t,extendComponentModel:r,extendComponentView:s}=a;r({type:"GLMap",getViewer(){return Object(this.getZr()).viewer},defaultOption:{roam:!1}}),s({type:"GLMap",init:function(o,n){this.api=n,n.getZr().viewer.clock.onTick.addEventListener(this.moveHandler,this)},moveHandler:function(){this.api.getZr().dom.style.visibility!=="hidden"&&this.api.dispatchAction({type:"GLMapRoam"})},render:function(o,n,l){},dispose:function(){this.api.getZr().viewer.clock.onTick.removeEventListener(this.moveHandler,this)}}),Ru(a),t("GLMap",fe),e({type:"GLMapRoam",event:"GLMapRoam",update:"updateLayout"},function(o,n){}),tc=!0}var bo=class extends A{constructor(e,t){if(!Y("echarts"))throw new Error("miss the echarts lib");super(e),this._option=t,this._delegate=void 0,this._chart=void 0}set show(e){this._show=e,this._delegate.style.visibility=e?"visible":"hidden"}get show(){return this._show}_createChartElement(){let e=this._viewer.scene.canvas,t=document.createElement("div");return t.setAttribute("id",this._id),t.setAttribute("data-layer-type","chart-layer"),t.style.cssText=`position:absolute; top:0; left:0; width: ${e.clientWidth}px; height: ${e.clientHeight}px;pointer-events:none;`,this._viewer.layerContainer.appendChild(t),t}_onAdd(e){let t=Y("echarts");ic(t),this._viewer=e,this._viewer.canvas.setAttribute("tabIndex","0"),this._delegate=this._createChartElement(),this._chart=t.init(this._delegate),Object(this._chart.getZr()).viewer=e,this._option&&this._chart.setOption({...this._option,GLMap:{},animation:!1}),this._state=_.ADDED}_onRemove(){this._delegate&&this._viewer&&(this._chart.dispose(),this._viewer.layerContainer.removeChild(this._delegate),this._state=_.REMOVED)}setOption(e={}){return this._option=e,this._chart&&this._chart.setOption({...e,GLMap:{},animation:!1}),this}clear(){return this._chart.clear(),this}resize(){return this._chart.resize(),this}},Ou=bo;var rc=`/**\r
255
237
  * @license\r
256
238
  * Cellular noise ("Worley noise") in 2D in GLSL.\r
257
239
  * Copyright (c) Stefan Gustavson 2011-04-19. All rights reserved.\r
@@ -328,7 +310,7 @@ vec2 czm_cellular(vec2 P)\r
328
310
  d1.y = min(d1.y, d2.x); // F2 is in d1.y, we're done.\r
329
311
  return sqrt(d1.xy);\r
330
312
  }\r
331
- `;var fu=`/**\r
313
+ `;var sc=`/**\r
332
314
  * @license\r
333
315
  * Description : Array and textureless GLSL 2D/3D/4D simplex\r
334
316
  * noise functions.\r
@@ -610,7 +592,7 @@ float czm_snoise(vec4 v)\r
610
592
  return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\r
611
593
  + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\r
612
594
  }\r
613
- `;var gu=`uniform vec4 asphaltColor;\r
595
+ `;var oc=`uniform vec4 asphaltColor;\r
614
596
  uniform float bumpSize;\r
615
597
  uniform float roughness;\r
616
598
  \r
@@ -634,7 +616,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
634
616
  \r
635
617
  return material;\r
636
618
  }\r
637
- `;var yu=`uniform vec4 lightColor;\r
619
+ `;var ac=`uniform vec4 lightColor;\r
638
620
  uniform vec4 darkColor;\r
639
621
  uniform float frequency;\r
640
622
  \r
@@ -651,7 +633,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
651
633
  \r
652
634
  return material;\r
653
635
  }\r
654
- `;var vu=`uniform vec4 brickColor;\r
636
+ `;var nc=`uniform vec4 brickColor;\r
655
637
  uniform vec4 mortarColor;\r
656
638
  uniform vec2 brickSize;\r
657
639
  uniform vec2 brickPct;\r
@@ -692,7 +674,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
692
674
  \r
693
675
  return material;\r
694
676
  }\r
695
- `;var wu=`uniform vec4 cementColor;\r
677
+ `;var lc=`uniform vec4 cementColor;\r
696
678
  uniform float grainScale;\r
697
679
  uniform float roughness;\r
698
680
  \r
@@ -710,7 +692,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
710
692
  \r
711
693
  return material;\r
712
694
  }\r
713
- `;var Cu=`uniform vec4 color;\r
695
+ `;var hc=`uniform vec4 color;\r
714
696
  uniform float time;\r
715
697
  \r
716
698
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
@@ -731,7 +713,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
731
713
  \r
732
714
  return material;\r
733
715
  }\r
734
- `;var xu=`uniform vec4 lightColor;\r
716
+ `;var cc=`uniform vec4 lightColor;\r
735
717
  uniform vec4 darkColor;\r
736
718
  uniform float frequency;\r
737
719
  \r
@@ -748,7 +730,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
748
730
  \r
749
731
  return material;\r
750
732
  }\r
751
- `;var Tu=`czm_material czm_getMaterial(czm_materialInput materialInput){\r
733
+ `;var dc=`czm_material czm_getMaterial(czm_materialInput materialInput){\r
752
734
  czm_material material = czm_getDefaultMaterial(materialInput);\r
753
735
  \r
754
736
  vec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\r
@@ -759,7 +741,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
759
741
  \r
760
742
  return material;\r
761
743
  }\r
762
- `;var Eu=`uniform vec4 grassColor;\r
744
+ `;var pc=`uniform vec4 grassColor;\r
763
745
  uniform vec4 dirtColor;\r
764
746
  uniform float patchiness;\r
765
747
  \r
@@ -786,7 +768,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
786
768
  \r
787
769
  return material;\r
788
770
  }\r
789
- `;var Pu=`uniform samplerCube cubeMap;\r
771
+ `;var mc=`uniform samplerCube cubeMap;\r
790
772
  \r
791
773
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
792
774
  czm_material material = czm_getDefaultMaterial(materialInput);\r
@@ -798,7 +780,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
798
780
  \r
799
781
  return material;\r
800
782
  }\r
801
- `;var bu=`uniform samplerCube cubeMap;\r
783
+ `;var uc=`uniform samplerCube cubeMap;\r
802
784
  uniform float indexOfRefractionRatio;\r
803
785
  \r
804
786
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
@@ -811,7 +793,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
811
793
  \r
812
794
  return material;\r
813
795
  }\r
814
- `;var Au=`uniform vec4 lightColor;\r
796
+ `;var _c=`uniform vec4 lightColor;\r
815
797
  uniform vec4 darkColor;\r
816
798
  uniform float frequency;\r
817
799
  \r
@@ -827,7 +809,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
827
809
  \r
828
810
  return material;\r
829
811
  }\r
830
- `;var Mu=`uniform vec4 lightWoodColor;\r
812
+ `;var fc=`uniform vec4 lightWoodColor;\r
831
813
  uniform vec4 darkWoodColor;\r
832
814
  uniform float ringFrequency;\r
833
815
  uniform vec2 noiseScale;\r
@@ -862,7 +844,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
862
844
  \r
863
845
  return material;\r
864
846
  }\r
865
- `;i.ShaderSource._czmBuiltinsAndUniforms.czm_cellular=_u;i.ShaderSource._czmBuiltinsAndUniforms.czm_snoise=fu;i.Material.AsphaltType="Asphalt";i.Material._materialCache.addMaterial(i.Material.AsphaltType,{fabric:{type:i.Material.AsphaltType,uniforms:{asphaltColor:new i.Color(.15,.15,.15,1),bumpSize:.02,roughness:.2},source:gu},translucent:function(a){return a.uniforms.asphaltColor.alpha<1}});i.Material.BlobType="Blob";i.Material._materialCache.addMaterial(i.Material.BlobType,{fabric:{type:i.Material.BlobType,uniforms:{lightColor:new i.Color(1,1,1,.5),darkColor:new i.Color(0,0,1,.5),frequency:10},source:yu},translucent:function(a){var e=a.uniforms;return e.lightColor.alpha<1||e.darkColor.alpha<0}});i.Material.BrickType="Brick";i.Material._materialCache.addMaterial(i.Material.BrickType,{fabric:{type:i.Material.BrickType,uniforms:{brickColor:new i.Color(.6,.3,.1,1),mortarColor:new i.Color(.8,.8,.7,1),brickSize:new i.Cartesian2(.3,.15),brickPct:new i.Cartesian2(.9,.85),brickRoughness:.2,mortarRoughness:.1},source:vu},translucent:function(a){var e=a.uniforms;return e.brickColor.alpha<1||e.mortarColor.alpha<1}});i.Material.CementType="Cement";i.Material._materialCache.addMaterial(i.Material.CementType,{fabric:{type:i.Material.CementType,uniforms:{cementColor:new i.Color(.95,.95,.85,1),grainScale:.01,roughness:.3},source:wu},translucent:function(a){return a.uniforms.cementColor.alpha<1}});i.Material.ErosionType="Erosion";i.Material._materialCache.addMaterial(i.Material.ErosionType,{fabric:{type:i.Material.ErosionType,uniforms:{color:new i.Color(1,0,0,.5),time:1},source:Cu},translucent:function(a){return a.uniforms.color.alpha<1}});i.Material.FacetType="Facet";i.Material._materialCache.addMaterial(i.Material.FacetType,{fabric:{type:i.Material.FacetType,uniforms:{lightColor:new i.Color(.25,.25,.25,.75),darkColor:new i.Color(.75,.75,.75,.75),frequency:10},source:xu},translucent:function(a){var e=a.uniforms;return e.lightColor.alpha<1||e.darkColor.alpha<0}});i.Material.FresnelType="Fresnel";i.Material._materialCache.addMaterial(i.Material.FresnelType,{fabric:{type:i.Material.FresnelType,materials:{reflection:{type:i.Material.ReflectionType},refraction:{type:i.Material.RefractionType}},source:Tu},translucent:!1});i.Material.GrassType="Grass";i.Material._materialCache.addMaterial(i.Material.GrassType,{fabric:{type:i.Material.GrassType,uniforms:{grassColor:new i.Color(.25,.4,.1,1),dirtColor:new i.Color(.1,.1,.1,1),patchiness:1.5},source:Eu},translucent:function(a){var e=a.uniforms;return e.grassColor.alpha<1||e.dirtColor.alpha<1}});i.Material.ReflectionType="Reflection";i.Material._materialCache.addMaterial(i.Material.ReflectionType,{fabric:{type:i.Material.ReflectionType,uniforms:{cubeMap:i.Material.DefaultCubeMapId,channels:"rgb"},source:Pu},translucent:!1});i.Material.RefractionType="Refraction";i.Material._materialCache.addMaterial(i.Material.RefractionType,{fabric:{type:i.Material.RefractionType,uniforms:{cubeMap:i.Material.DefaultCubeMapId,channels:"rgb",indexOfRefractionRatio:.9},source:bu},translucent:!1});i.Material.TyeDyeType="TieDye";i.Material._materialCache.addMaterial(i.Material.TyeDyeType,{fabric:{type:i.Material.TyeDyeType,uniforms:{lightColor:new i.Color(1,1,0,.75),darkColor:new i.Color(1,0,0,.75),frequency:5},source:Au},translucent:function(a){var e=a.uniforms;return e.lightColor.alpha<1||e.darkColor.alpha<0}});i.Material.WoodType="Wood";i.Material._materialCache.addMaterial(i.Material.WoodType,{fabric:{type:i.Material.WoodType,uniforms:{lightWoodColor:new i.Color(.6,.3,.1,1),darkWoodColor:new i.Color(.4,.2,.07,1),ringFrequency:3,noiseScale:new i.Cartesian2(.7,.5),grainFrequency:27},source:Mu},translucent:function(a){let e=a.uniforms;return e.lightWoodColor.alpha<1||e.darkWoodColor.alpha<1}});var Iu=`uniform vec4 color;\r
847
+ `;i.ShaderSource._czmBuiltinsAndUniforms.czm_cellular=rc;i.ShaderSource._czmBuiltinsAndUniforms.czm_snoise=sc;i.Material.AsphaltType="Asphalt";i.Material._materialCache.addMaterial(i.Material.AsphaltType,{fabric:{type:i.Material.AsphaltType,uniforms:{asphaltColor:new i.Color(.15,.15,.15,1),bumpSize:.02,roughness:.2},source:oc},translucent:function(a){return a.uniforms.asphaltColor.alpha<1}});i.Material.BlobType="Blob";i.Material._materialCache.addMaterial(i.Material.BlobType,{fabric:{type:i.Material.BlobType,uniforms:{lightColor:new i.Color(1,1,1,.5),darkColor:new i.Color(0,0,1,.5),frequency:10},source:ac},translucent:function(a){var e=a.uniforms;return e.lightColor.alpha<1||e.darkColor.alpha<0}});i.Material.BrickType="Brick";i.Material._materialCache.addMaterial(i.Material.BrickType,{fabric:{type:i.Material.BrickType,uniforms:{brickColor:new i.Color(.6,.3,.1,1),mortarColor:new i.Color(.8,.8,.7,1),brickSize:new i.Cartesian2(.3,.15),brickPct:new i.Cartesian2(.9,.85),brickRoughness:.2,mortarRoughness:.1},source:nc},translucent:function(a){var e=a.uniforms;return e.brickColor.alpha<1||e.mortarColor.alpha<1}});i.Material.CementType="Cement";i.Material._materialCache.addMaterial(i.Material.CementType,{fabric:{type:i.Material.CementType,uniforms:{cementColor:new i.Color(.95,.95,.85,1),grainScale:.01,roughness:.3},source:lc},translucent:function(a){return a.uniforms.cementColor.alpha<1}});i.Material.ErosionType="Erosion";i.Material._materialCache.addMaterial(i.Material.ErosionType,{fabric:{type:i.Material.ErosionType,uniforms:{color:new i.Color(1,0,0,.5),time:1},source:hc},translucent:function(a){return a.uniforms.color.alpha<1}});i.Material.FacetType="Facet";i.Material._materialCache.addMaterial(i.Material.FacetType,{fabric:{type:i.Material.FacetType,uniforms:{lightColor:new i.Color(.25,.25,.25,.75),darkColor:new i.Color(.75,.75,.75,.75),frequency:10},source:cc},translucent:function(a){var e=a.uniforms;return e.lightColor.alpha<1||e.darkColor.alpha<0}});i.Material.FresnelType="Fresnel";i.Material._materialCache.addMaterial(i.Material.FresnelType,{fabric:{type:i.Material.FresnelType,materials:{reflection:{type:i.Material.ReflectionType},refraction:{type:i.Material.RefractionType}},source:dc},translucent:!1});i.Material.GrassType="Grass";i.Material._materialCache.addMaterial(i.Material.GrassType,{fabric:{type:i.Material.GrassType,uniforms:{grassColor:new i.Color(.25,.4,.1,1),dirtColor:new i.Color(.1,.1,.1,1),patchiness:1.5},source:pc},translucent:function(a){var e=a.uniforms;return e.grassColor.alpha<1||e.dirtColor.alpha<1}});i.Material.ReflectionType="Reflection";i.Material._materialCache.addMaterial(i.Material.ReflectionType,{fabric:{type:i.Material.ReflectionType,uniforms:{cubeMap:i.Material.DefaultCubeMapId,channels:"rgb"},source:mc},translucent:!1});i.Material.RefractionType="Refraction";i.Material._materialCache.addMaterial(i.Material.RefractionType,{fabric:{type:i.Material.RefractionType,uniforms:{cubeMap:i.Material.DefaultCubeMapId,channels:"rgb",indexOfRefractionRatio:.9},source:uc},translucent:!1});i.Material.TyeDyeType="TieDye";i.Material._materialCache.addMaterial(i.Material.TyeDyeType,{fabric:{type:i.Material.TyeDyeType,uniforms:{lightColor:new i.Color(1,1,0,.75),darkColor:new i.Color(1,0,0,.75),frequency:5},source:_c},translucent:function(a){var e=a.uniforms;return e.lightColor.alpha<1||e.darkColor.alpha<0}});i.Material.WoodType="Wood";i.Material._materialCache.addMaterial(i.Material.WoodType,{fabric:{type:i.Material.WoodType,uniforms:{lightWoodColor:new i.Color(.6,.3,.1,1),darkWoodColor:new i.Color(.4,.2,.07,1),ringFrequency:3,noiseScale:new i.Cartesian2(.7,.5),grainFrequency:27},source:fc},translucent:function(a){let e=a.uniforms;return e.lightWoodColor.alpha<1||e.darkWoodColor.alpha<1}});var gc=`uniform vec4 color;\r
866
848
  uniform float speed;\r
867
849
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
868
850
  czm_material material = czm_getDefaultMaterial(materialInput);\r
@@ -879,7 +861,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
879
861
  material.diffuse = color.rgb * a * 3.0;\r
880
862
  return material;\r
881
863
  }\r
882
- `;var Su=`uniform vec4 color;\r
864
+ `;var yc=`uniform vec4 color;\r
883
865
  uniform float speed;\r
884
866
  \r
885
867
  vec3 circlePing(float r, float innerTail, float frontierBorder, float timeResetSeconds, float radarPingSpeed, float fadeDistance){\r
@@ -903,7 +885,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
903
885
  material.diffuse = flagColor.rgb;\r
904
886
  return material;\r
905
887
  }\r
906
- `;var Du=`uniform vec4 color;\r
888
+ `;var vc=`uniform vec4 color;\r
907
889
  uniform float speed;\r
908
890
  \r
909
891
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
@@ -919,7 +901,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
919
901
  }\r
920
902
  return material;\r
921
903
  }\r
922
- `;var Lu=`uniform vec4 color;\r
904
+ `;var wc=`uniform vec4 color;\r
923
905
  uniform float speed;\r
924
906
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
925
907
  czm_material material = czm_getDefaultMaterial(materialInput);\r
@@ -935,7 +917,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
935
917
  material.diffuse = color.rgb * d;\r
936
918
  return material;\r
937
919
  }\r
938
- `;var Ru=`uniform vec4 color;\r
920
+ `;var Cc=`uniform vec4 color;\r
939
921
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
940
922
  czm_material material = czm_getDefaultMaterial(materialInput);\r
941
923
  vec2 st = materialInput.st;\r
@@ -952,7 +934,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
952
934
  material.alpha = pow(alpha, 4.0);\r
953
935
  return material;\r
954
936
  }\r
955
- `;var Ou=`uniform vec4 color;\r
937
+ `;var xc=`uniform vec4 color;\r
956
938
  uniform sampler2D image;\r
957
939
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
958
940
  czm_material material = czm_getDefaultMaterial(materialInput);\r
@@ -970,7 +952,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
970
952
  material.alpha = colorImage.a * pow(length, 0.5);\r
971
953
  return material;\r
972
954
  }\r
973
- `;var ku=`uniform vec4 color;\r
955
+ `;var Tc=`uniform vec4 color;\r
974
956
  uniform float speed;\r
975
957
  \r
976
958
  float circle(vec2 uv, float r, float blur) {\r
@@ -996,7 +978,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)\r
996
978
  material.alpha *= color.a;\r
997
979
  return material;\r
998
980
  }\r
999
- `;var Fu=`uniform vec4 color;\r
981
+ `;var Ec=`uniform vec4 color;\r
1000
982
  uniform float speed;\r
1001
983
  \r
1002
984
  #define PI 3.14159265359\r
@@ -1020,7 +1002,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1020
1002
  material.diffuse = color.rgb * a * b * 3.0;\r
1021
1003
  return material;\r
1022
1004
  }\r
1023
- `;var zu=`uniform vec4 color;\r
1005
+ `;var Pc=`uniform vec4 color;\r
1024
1006
  uniform float speed;\r
1025
1007
  \r
1026
1008
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
@@ -1038,7 +1020,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1038
1020
  material.diffuse = fragColor * (inten1 + inten2);\r
1039
1021
  return material;\r
1040
1022
  }\r
1041
- `;var Nu=`uniform vec4 color;
1023
+ `;var bc=`uniform vec4 color;
1042
1024
  uniform float speed;
1043
1025
  uniform float count;
1044
1026
  uniform float gradient;
@@ -1086,7 +1068,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
1086
1068
  return material;
1087
1069
  }
1088
1070
 
1089
- `;i.Material.CircleBlurType="CircleBlur";i.Material._materialCache.addMaterial(i.Material.CircleBlurType,{fabric:{type:i.Material.CircleBlurType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Iu},translucent:function(a){return!0}});i.Material.CircleDiffuseType="CircleDiffuse";i.Material._materialCache.addMaterial(i.Material.CircleDiffuseType,{fabric:{type:i.Material.CircleDiffuseType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Su},translucent:function(a){return!0}});i.Material.CircleFadeType="CircleFade";i.Material._materialCache.addMaterial(i.Material.CircleFadeType,{fabric:{type:i.Material.CircleFadeType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Du},translucent:function(a){return!0}});i.Material.CirclePulseType="CirclePulse";i.Material._materialCache.addMaterial(i.Material.CirclePulseType,{fabric:{type:i.Material.CirclePulseType,uniforms:{color:new i.Color(1,0,0,.7),speed:12},source:Lu},translucent:function(a){return!0}});i.Material.CircleRingType="CircleRing";i.Material._materialCache.addMaterial(i.Material.CircleRingType,{fabric:{type:i.Material.CircleRingType,uniforms:{color:new i.Color(1,0,0,.7)},source:Ru},translucent:function(a){return!0}});i.Material.CircleRotateType="CircleRotate";i.Material._materialCache.addMaterial(i.Material.CircleRotateType,{fabric:{type:i.Material.CircleRotateType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId},source:Ou},translucent:function(a){return!0}});i.Material.CircleScanType="CircleScan";i.Material._materialCache.addMaterial(i.Material.CircleScanType,{fabric:{type:i.Material.CircleScanType,uniforms:{color:new i.Color(1,0,0,.7),speed:1},source:ku},translucent:function(a){return!0}});i.Material.CircleSpiralType="CircleSpiral";i.Material._materialCache.addMaterial(i.Material.CircleSpiralType,{fabric:{type:i.Material.CircleSpiralType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Fu},translucent:function(a){return!0}});i.Material.CircleVaryType="CircleVary";i.Material._materialCache.addMaterial(i.Material.CircleVaryType,{fabric:{type:i.Material.CircleVaryType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:zu},translucent:function(a){return!0}});i.Material.CircleWaveType="CircleWave";i.Material._materialCache.addMaterial(i.Material.CircleWaveType,{fabric:{type:i.Material.CircleWaveType,uniforms:{color:new i.Color(1,0,0,.7),speed:3,count:1,gradient:.1},source:Nu},translucent:function(a){return!0}});var Hu=`uniform vec4 color;\r
1071
+ `;i.Material.CircleBlurType="CircleBlur";i.Material._materialCache.addMaterial(i.Material.CircleBlurType,{fabric:{type:i.Material.CircleBlurType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:gc},translucent:function(a){return!0}});i.Material.CircleDiffuseType="CircleDiffuse";i.Material._materialCache.addMaterial(i.Material.CircleDiffuseType,{fabric:{type:i.Material.CircleDiffuseType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:yc},translucent:function(a){return!0}});i.Material.CircleFadeType="CircleFade";i.Material._materialCache.addMaterial(i.Material.CircleFadeType,{fabric:{type:i.Material.CircleFadeType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:vc},translucent:function(a){return!0}});i.Material.CirclePulseType="CirclePulse";i.Material._materialCache.addMaterial(i.Material.CirclePulseType,{fabric:{type:i.Material.CirclePulseType,uniforms:{color:new i.Color(1,0,0,.7),speed:12},source:wc},translucent:function(a){return!0}});i.Material.CircleRingType="CircleRing";i.Material._materialCache.addMaterial(i.Material.CircleRingType,{fabric:{type:i.Material.CircleRingType,uniforms:{color:new i.Color(1,0,0,.7)},source:Cc},translucent:function(a){return!0}});i.Material.CircleRotateType="CircleRotate";i.Material._materialCache.addMaterial(i.Material.CircleRotateType,{fabric:{type:i.Material.CircleRotateType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId},source:xc},translucent:function(a){return!0}});i.Material.CircleScanType="CircleScan";i.Material._materialCache.addMaterial(i.Material.CircleScanType,{fabric:{type:i.Material.CircleScanType,uniforms:{color:new i.Color(1,0,0,.7),speed:1},source:Tc},translucent:function(a){return!0}});i.Material.CircleSpiralType="CircleSpiral";i.Material._materialCache.addMaterial(i.Material.CircleSpiralType,{fabric:{type:i.Material.CircleSpiralType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Ec},translucent:function(a){return!0}});i.Material.CircleVaryType="CircleVary";i.Material._materialCache.addMaterial(i.Material.CircleVaryType,{fabric:{type:i.Material.CircleVaryType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Pc},translucent:function(a){return!0}});i.Material.CircleWaveType="CircleWave";i.Material._materialCache.addMaterial(i.Material.CircleWaveType,{fabric:{type:i.Material.CircleWaveType,uniforms:{color:new i.Color(1,0,0,.7),speed:3,count:1,gradient:.1},source:bc},translucent:function(a){return!0}});var Sc=`uniform vec4 color;\r
1090
1072
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
1091
1073
  czm_material material = czm_getDefaultMaterial(materialInput);\r
1092
1074
  vec2 st = materialInput.st;\r
@@ -1097,7 +1079,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1097
1079
  material.alpha = temp.a;\r
1098
1080
  return material;\r
1099
1081
  }\r
1100
- `;var Wu=`uniform vec4 color;\r
1082
+ `;var Ac=`uniform vec4 color;\r
1101
1083
  uniform sampler2D image;\r
1102
1084
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
1103
1085
  czm_material material = czm_getDefaultMaterial(materialInput);\r
@@ -1113,7 +1095,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1113
1095
  material.alpha = alpha * pow(1. - st.t,color.a);\r
1114
1096
  return material;\r
1115
1097
  }\r
1116
- `;i.Material.CylinderFadeType="CylinderFade";i.Material._materialCache.addMaterial(i.Material.CylinderFadeType,{fabric:{type:i.Material.CylinderFadeType,uniforms:{color:new i.Color(1,0,0,.7)},source:Hu},translucent:function(a){return!0}});i.Material.CylinderParticlesType="CylinderParticles";i.Material._materialCache.addMaterial(i.Material.CylinderParticlesType,{fabric:{type:i.Material.CylinderParticlesType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId},source:Wu},translucent:function(a){return!0}});var Gu=`uniform vec4 color;\r
1098
+ `;i.Material.CylinderFadeType="CylinderFade";i.Material._materialCache.addMaterial(i.Material.CylinderFadeType,{fabric:{type:i.Material.CylinderFadeType,uniforms:{color:new i.Color(1,0,0,.7)},source:Sc},translucent:function(a){return!0}});i.Material.CylinderParticlesType="CylinderParticles";i.Material._materialCache.addMaterial(i.Material.CylinderParticlesType,{fabric:{type:i.Material.CylinderParticlesType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId},source:Ac},translucent:function(a){return!0}});var Mc=`uniform vec4 color;\r
1117
1099
  uniform float speed;\r
1118
1100
  \r
1119
1101
  #define pi 3.1415926535\r
@@ -1191,7 +1173,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)\r
1191
1173
  material.alpha = temp.a * 2.0;\r
1192
1174
  return material;\r
1193
1175
  }\r
1194
- `;var Uu=`uniform vec4 color;\r
1176
+ `;var Ic=`uniform vec4 color;\r
1195
1177
  uniform float speed;\r
1196
1178
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
1197
1179
  czm_material material = czm_getDefaultMaterial(materialInput);\r
@@ -1203,7 +1185,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1203
1185
  material.diffuse = color.rgb;\r
1204
1186
  return material;\r
1205
1187
  }\r
1206
- `;i.Material.EllipsoidElectricType="EllipsoidElectric";i.Material._materialCache.addMaterial(i.Material.EllipsoidElectricType,{fabric:{type:i.Material.EllipsoidElectricType,uniforms:{color:new i.Color(1,0,0,.7),speed:1},source:Gu},translucent:function(a){return!0}});i.Material.EllipsoidTrailType="EllipsoidTrail";i.Material._materialCache.addMaterial(i.Material.EllipsoidTrailType,{fabric:{type:i.Material.EllipsoidTrailType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Uu},translucent:function(a){return!0}});var Bu=`uniform vec4 color;\r
1188
+ `;i.Material.EllipsoidElectricType="EllipsoidElectric";i.Material._materialCache.addMaterial(i.Material.EllipsoidElectricType,{fabric:{type:i.Material.EllipsoidElectricType,uniforms:{color:new i.Color(1,0,0,.7),speed:1},source:Mc},translucent:function(a){return!0}});i.Material.EllipsoidTrailType="EllipsoidTrail";i.Material._materialCache.addMaterial(i.Material.EllipsoidTrailType,{fabric:{type:i.Material.EllipsoidTrailType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Ic},translucent:function(a){return!0}});var Lc=`uniform vec4 color;\r
1207
1189
  uniform float speed;\r
1208
1190
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
1209
1191
  czm_material material = czm_getDefaultMaterial(materialInput);\r
@@ -1214,7 +1196,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1214
1196
  material.alpha = color.a * scalar ;\r
1215
1197
  return material;\r
1216
1198
  }\r
1217
- `;var Vu=`uniform vec4 color;\r
1199
+ `;var Dc=`uniform vec4 color;\r
1218
1200
  uniform float speed;\r
1219
1201
  uniform float percent;\r
1220
1202
  uniform float gradient;\r
@@ -1230,7 +1212,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1230
1212
  material.alpha = alpha;\r
1231
1213
  return material;\r
1232
1214
  }\r
1233
- `;var ju=`uniform sampler2D image;\r
1215
+ `;var Rc=`uniform sampler2D image;\r
1234
1216
  uniform float speed;\r
1235
1217
  uniform vec4 color;\r
1236
1218
  uniform vec2 repeat;\r
@@ -1252,7 +1234,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1252
1234
  }\r
1253
1235
  return material;\r
1254
1236
  }\r
1255
- `;var qu=`uniform sampler2D image;\r
1237
+ `;var Oc=`uniform sampler2D image;\r
1256
1238
  uniform vec4 color;\r
1257
1239
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
1258
1240
  czm_material material = czm_getDefaultMaterial(materialInput);\r
@@ -1263,7 +1245,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1263
1245
  material.diffuse = max(fragColor.rgb + colorImage.rgb , fragColor.rgb);\r
1264
1246
  return material;\r
1265
1247
  }\r
1266
- `;var Zu=`uniform sampler2D image;\r
1248
+ `;var kc=`uniform sampler2D image;\r
1267
1249
  uniform vec4 color;\r
1268
1250
  uniform float speed;\r
1269
1251
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
@@ -1284,7 +1266,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1284
1266
  }\r
1285
1267
  return material;\r
1286
1268
  }\r
1287
- `;var Yu=`uniform vec4 color;\r
1269
+ `;var Nc=`uniform vec4 color;\r
1288
1270
  uniform float speed;\r
1289
1271
  \r
1290
1272
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
@@ -1295,7 +1277,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1295
1277
  material.alpha = color.a * fract(st.s-time);\r
1296
1278
  return material;\r
1297
1279
  }\r
1298
- `;i.Material.PolylineFlickerType="PolylineFlicker";i.Material._materialCache.addMaterial(i.Material.PolylineFlickerType,{fabric:{type:i.Material.PolylineFlickerType,uniforms:{color:new i.Color(1,0,0,.7),speed:1},source:Bu},translucent:function(a){return!0}});i.Material.PolylineFlowType="PolylineFlow";i.Material._materialCache.addMaterial(i.Material.PolylineFlowType,{fabric:{type:i.Material.PolylineFlowType,uniforms:{color:new i.Color(1,0,0,.7),speed:1,percent:.03,gradient:.1},source:Vu},translucent:function(a){return!0}});i.Material.PolylineImageTrailType="PolylineImageTrail";i.Material._materialCache.addMaterial(i.Material.PolylineImageTrailType,{fabric:{type:i.Material.PolylineImageTrailType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId,speed:1,repeat:new i.Cartesian2(1,1)},source:ju},translucent:function(a){return!0}});i.Material.PolylineLightingType="PolylineLighting";i.Material._materialCache.addMaterial(i.Material.PolylineLightingType,{fabric:{type:i.Material.PolylineLightingType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId},source:qu},translucent:function(a){return!0}});i.Material.PolylineLightingTrailType="PolylineLightingTrail";i.Material._materialCache.addMaterial(i.Material.PolylineLightingTrailType,{fabric:{type:i.Material.PolylineLightingTrailType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId,speed:3},source:Zu},translucent:function(a){return!0}});i.Material.PolylineTrailType="PolylineTrail";i.Material._materialCache.addMaterial(i.Material.PolylineTrailType,{fabric:{type:i.Material.PolylineTrailType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId,speed:1,repeat:new i.Cartesian2(1,1)},source:Yu},translucent:function(a){return!0}});var Xu=`uniform vec4 color;\r
1280
+ `;i.Material.PolylineFlickerType="PolylineFlicker";i.Material._materialCache.addMaterial(i.Material.PolylineFlickerType,{fabric:{type:i.Material.PolylineFlickerType,uniforms:{color:new i.Color(1,0,0,.7),speed:1},source:Lc},translucent:function(a){return!0}});i.Material.PolylineFlowType="PolylineFlow";i.Material._materialCache.addMaterial(i.Material.PolylineFlowType,{fabric:{type:i.Material.PolylineFlowType,uniforms:{color:new i.Color(1,0,0,.7),speed:1,percent:.03,gradient:.1},source:Dc},translucent:function(a){return!0}});i.Material.PolylineImageTrailType="PolylineImageTrail";i.Material._materialCache.addMaterial(i.Material.PolylineImageTrailType,{fabric:{type:i.Material.PolylineImageTrailType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId,speed:1,repeat:new i.Cartesian2(1,1)},source:Rc},translucent:function(a){return!0}});i.Material.PolylineLightingType="PolylineLighting";i.Material._materialCache.addMaterial(i.Material.PolylineLightingType,{fabric:{type:i.Material.PolylineLightingType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId},source:Oc},translucent:function(a){return!0}});i.Material.PolylineLightingTrailType="PolylineLightingTrail";i.Material._materialCache.addMaterial(i.Material.PolylineLightingTrailType,{fabric:{type:i.Material.PolylineLightingTrailType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId,speed:3},source:kc},translucent:function(a){return!0}});i.Material.PolylineTrailType="PolylineTrail";i.Material._materialCache.addMaterial(i.Material.PolylineTrailType,{fabric:{type:i.Material.PolylineTrailType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId,speed:1,repeat:new i.Cartesian2(1,1)},source:Nc},translucent:function(a){return!0}});var Fc=`uniform vec4 color;\r
1299
1281
  uniform float speed;\r
1300
1282
  \r
1301
1283
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
@@ -1319,7 +1301,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1319
1301
  material.diffuse = col * 3.0 ;\r
1320
1302
  return material;\r
1321
1303
  }\r
1322
- `;var Ju=`uniform vec4 color;\r
1304
+ `;var Hc=`uniform vec4 color;\r
1323
1305
  uniform float speed;\r
1324
1306
  \r
1325
1307
  #define PI 3.14159265359\r
@@ -1351,7 +1333,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1351
1333
  material.diffuse = (0.5 + pow(angle, 2.0) * falloff ) * color.rgb ;\r
1352
1334
  return material;\r
1353
1335
  }\r
1354
- `;var Ku=`uniform vec4 color;\r
1336
+ `;var zc=`uniform vec4 color;\r
1355
1337
  uniform float speed;\r
1356
1338
  \r
1357
1339
  #define PI 3.14159265359\r
@@ -1378,7 +1360,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1378
1360
  material.diffuse = flagColor * 3.0;\r
1379
1361
  return material;\r
1380
1362
  }\r
1381
- `;i.Material.RadarLineType="RadarLine";i.Material._materialCache.addMaterial(i.Material.RadarLineType,{fabric:{type:i.Material.RadarLineType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Xu},translucent:function(a){return!0}});i.Material.RadarSweepType="RadarSweep";i.Material._materialCache.addMaterial(i.Material.RadarSweepType,{fabric:{type:i.Material.RadarSweepType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Ju},translucent:function(a){return!0}});i.Material.RadarWaveType="RadarWave";i.Material._materialCache.addMaterial(i.Material.RadarWaveType,{fabric:{type:i.Material.RadarWaveType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Ku},translucent:function(a){return!0}});var Qu=`uniform vec4 color;\r
1363
+ `;i.Material.RadarLineType="RadarLine";i.Material._materialCache.addMaterial(i.Material.RadarLineType,{fabric:{type:i.Material.RadarLineType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Fc},translucent:function(a){return!0}});i.Material.RadarSweepType="RadarSweep";i.Material._materialCache.addMaterial(i.Material.RadarSweepType,{fabric:{type:i.Material.RadarSweepType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:Hc},translucent:function(a){return!0}});i.Material.RadarWaveType="RadarWave";i.Material._materialCache.addMaterial(i.Material.RadarWaveType,{fabric:{type:i.Material.RadarWaveType,uniforms:{color:new i.Color(1,0,0,.7),speed:3},source:zc},translucent:function(a){return!0}});var Wc=`uniform vec4 color;\r
1382
1364
  czm_material czm_getMaterial(czm_materialInput materialInput){\r
1383
1365
  czm_material material = czm_getDefaultMaterial(materialInput);\r
1384
1366
  vec2 st = materialInput.st;\r
@@ -1386,7 +1368,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1386
1368
  material.alpha = color.a * (1.0-fract(st.t)) * 0.8;\r
1387
1369
  return material;\r
1388
1370
  }\r
1389
- `;var $u=`uniform sampler2D image;\r
1371
+ `;var Gc=`uniform sampler2D image;\r
1390
1372
  uniform vec4 color;\r
1391
1373
  uniform float speed;\r
1392
1374
  uniform vec2 repeat;\r
@@ -1399,7 +1381,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1399
1381
  material.diffuse = colorImage.rgb * color.rgb * 3.0 ;\r
1400
1382
  return material;\r
1401
1383
  }\r
1402
- `;var e_=`uniform sampler2D image;\r
1384
+ `;var Uc=`uniform sampler2D image;\r
1403
1385
  uniform float speed;\r
1404
1386
  uniform vec4 color;\r
1405
1387
  uniform vec2 repeat;\r
@@ -1415,7 +1397,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1415
1397
  material.emission = max(color.rgb * material.alpha * 1.5, color.rgb);\r
1416
1398
  return material;\r
1417
1399
  }\r
1418
- `;var t_=` uniform sampler2D image;\r
1400
+ `;var Bc=` uniform sampler2D image;\r
1419
1401
  uniform float speed;\r
1420
1402
  uniform vec4 color;\r
1421
1403
  \r
@@ -1433,7 +1415,76 @@ czm_material czm_getMaterial(czm_materialInput materialInput){\r
1433
1415
  }\r
1434
1416
  return material;\r
1435
1417
  }\r
1436
- `;i.Material.WallDiffuseType="WallDiffuse";i.Material._materialCache.addMaterial(i.Material.WallDiffuseType,{fabric:{type:i.Material.WallDiffuseType,uniforms:{color:new i.Color(1,0,0,.7)},source:Qu},translucent:function(a){return!0}});i.Material.WallImageTrailType="WallImageTrail";i.Material._materialCache.addMaterial(i.Material.WallImageTrailType,{fabric:{type:i.Material.WallImageTrailType,uniforms:{image:i.Material.DefaultImageId,color:new i.Color(1,0,0,.7),speed:3,repeat:new i.Cartesian2(1,1)},source:$u},translucent:function(a){return!0}});i.Material.WallLineTrailType="WallLineTrail";i.Material._materialCache.addMaterial(i.Material.WallLineTrailType,{fabric:{type:i.Material.WallLineTrailType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId,repeat:new i.Cartesian2(1,1),speed:3},source:e_},translucent:function(a){return!0}});i.Material.WallTrailType="WallTrail";i.Material._materialCache.addMaterial(i.Material.WallTrailType,{fabric:{type:i.Material.WallTrailType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId,speed:1},source:t_},translucent:function(a){return!0}});var ma=class{constructor(e={}){this._definitionChanged=new i.Event,this._color=void 0,this._colorSubscription=void 0,this._speed=void 0,this._speedSubscription=void 0,this.color=e.color||i.Color.fromBytes(0,255,255,255),this.speed=e.speed||1}get isConstant(){return!1}get definitionChanged(){return this._definitionChanged}getType(e){return null}getValue(e,t){return t=i.defaultValue(t,{}),t}equals(e){return this===e}},L=ma;var li=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.CircleBlurType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(li.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var i_=li;var hi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.CircleDiffuseType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(hi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var r_=hi;var ci=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.CircleFadeType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(ci.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var s_=ci;var pi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.CirclePulseType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(pi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var o_=pi;var di=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.CircleScanType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(di.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var a_=di;var mi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.CircleSpiralType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(mi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var n_=mi;var ui=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.CircleVaryType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(ui.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var l_=ui;var _i=class a extends L{constructor(e={}){super(e),this.count=Math.max(e.count||3,1),this.gradient=i.Math.clamp(e.gradient||.1,0,1)}get isConstant(){return!1}get definitionChanged(){return this._definitionChanged}getType(e){return i.Material.CircleWaveType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t.count=i.Property.getValueOrUndefined(this._count,e),t.gradient=i.Property.getValueOrUndefined(this._gradient,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)&&i.Property.equals(this._count,e._count)&&i.Property.equals(this._gradient,e._gradient)}};Object.defineProperties(_i.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),count:i.createPropertyDescriptor("count"),gradient:i.createPropertyDescriptor("gradient")});var h_=_i;var fi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.EllipsoidElectricType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(fi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var c_=fi;var gi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.EllipsoidTrailType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(gi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var p_=gi;var yi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.PolylineFlickerType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(yi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var d_=yi;var vi=class a extends L{constructor(e={}){super(e),this._percent=void 0,this._percentSubscription=void 0,this._gradient=void 0,this._gradientSubscription=void 0,this.percent=e.percent||.03,this.gradient=e.gradient||.1}getType(e){return i.Material.PolylineFlowType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t.percent=i.Property.getValueOrUndefined(this._percent,e),t.gradient=i.Property.getValueOrUndefined(this._gradient,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)&&i.Property.equals(this._percent,e._percent)&&i.Property.equals(this._gradient,e._gradient)}};Object.defineProperties(vi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),percent:i.createPropertyDescriptor("percent"),gradient:i.createPropertyDescriptor("gradient")});var m_=vi;var wi=class a extends L{constructor(e={}){var t,r;super(e),this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.image=e.image,this.repeat=new i.Cartesian2(((t=e.repeat)==null?void 0:t.x)||1,((r=e.repeat)==null?void 0:r.y)||1)}getType(e){return i.Material.PolylineImageTrailType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t.repeat=i.Property.getValueOrUndefined(this._repeat,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._image,e._image)&&i.Property.equals(this._repeat,e._repeat)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(wi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),image:i.createPropertyDescriptor("image"),repeat:i.createPropertyDescriptor("repeat")});var u_=wi;var Ci="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAACYCAYAAACS0lH9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAJ0GlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRv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AAEAhBQAACvkSIAAUsgAAQCEFAAAKKQAAUMhrgABQyAIAAIUUAAAo5AgAAApZAACgkAIAAIUUAAAo5A4AABT6A6gaPQ6/wRIfAAAAAElFTkSuQmCC";var xi=class a extends L{constructor(e={}){super(e),this._image=void 0,this._imageSubscription=void 0,this.image=Ci}getType(e){return i.Material.PolylineLightingType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._image,e._image)}};Object.defineProperties(xi.prototype,{color:i.createPropertyDescriptor("color"),image:i.createPropertyDescriptor("image")});var __=xi;var Ti=class a extends L{constructor(e={}){super(e),this._image=void 0,this._imageSubscription=void 0,this.image=Ci}getType(e){return i.Material.PolylineLightingTrailType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Ti.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),image:i.createPropertyDescriptor("image")});var f_=Ti;var Ei=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.PolylineTrailType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=this._speed,t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Ei.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var g_=Ei;var Pi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.RadarLineType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Pi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var y_=Pi;var bi=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.RadarSweepType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(bi.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var v_=bi;var Ai=class a extends L{constructor(e={}){super(e)}getType(e){return i.Material.RadarWaveType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Ai.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var w_=Ai;var Mi=class a extends L{constructor(e={}){var t,r;super(e),this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.image=e.image,this.repeat=new i.Cartesian2(((t=e.repeat)==null?void 0:t.x)||1,((r=e.repeat)==null?void 0:r.y)||1)}getType(e){return i.Material.WallImageTrailType}getValue(e,t){return t=i.defaultValue(t,{}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t.repeat=i.Property.getValueOrUndefined(this._repeat,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._image,e._image)&&i.Property.equals(this._repeat,e._repeat)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Mi.prototype,{image:i.createPropertyDescriptor("image"),color:i.createPropertyDescriptor("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pb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjU3NDNjYjQ0LTMzOTctNDk5MC1iODg4LTI0MWU2YTFiZDJhZiIgc3RFdnQ6d2hlbj0iMjAyMS0wMi0yNFQxNDoyMDoxNiswODowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDIxLjIgKE1hY2ludG9zaCkiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPC9yZGY6U2VxPiA8L3htcE1NOkhpc3Rvcnk+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+eAiLkwAAAQZJREFUeJzt3LERwDAMxDAl5/1XdqYIXRiYQBULFf/svQeA/72nDwC4heACRAQXICK4ABHBBYgILkBEcAEiggsQEVyAiOACRAQXICK4ABHBBYgILkBkzYx9RoDAmpnn9BEAN/BSAIgILkBEcAEiggsQEVyAiOACRAQXICK4ABHBBYgILkBEcAEiggsQEVyAiOACRAQXIGKAHCBigBwg4qUAEBFcgIjgAkQEFyAiuAARwQWICC5ARHABIoILEBFcgIjgAkQEFyAiuAARwQWI2MMFiNjDBYh4KQBEBBcgIrgAEcEFiAguQERwASKCCxARXICI4AJEBBcgIrgAEcEFiAguQERwASIfRmAGiWTgoMYAAAAASUVORK5CYII=";var Ii=class a extends L{constructor(e={}){var t,r;super(e),this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.image=x_,this.repeat=new i.Cartesian2(((t=e.repeat)==null?void 0:t.x)||1,((r=e.repeat)==null?void 0:r.y)||1)}getType(e){return i.Material.WallLineTrailType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t.repeat=i.Property.getValueOrUndefined(this._repeat,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)&&i.Property.equals(this._repeat,e._repeat)}};Object.defineProperties(Ii.prototype,{color:i.createPropertyDescriptor("color"),image:i.createPropertyDescriptor("image"),repeat:i.createPropertyDescriptor("repeat"),speed:i.createPropertyDescriptor("speed")});var T_=Ii;var E_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAOhlWElmTU0AKgAAAAgABgESAAMAAAABAAEAAAEaAAUAAAABAAAAVgEbAAUAAAABAAAAXgExAAIAAAAkAAAAZgEyAAIAAAAUAAAAiodpAAQAAAABAAAAngAAAAAAAABIAAAAAQAAAEgAAAABQWRvYmUgUGhvdG9zaG9wIENDIDIwMTggKE1hY2ludG9zaCkAMjAxODoxMDoyNiAxNTozMDozNAAABJAEAAIAAAAUAAAA1KABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAAAyMDE4OjEwOjI2IDE1OjI0OjI1ALUCxicAAAAJcEhZcwAACxMAAAsTAQCanBgAAAdgaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA1LjQuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIgogICAgICAgICAgICB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20ve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DHBFmKolcu6dtdw9WB8srVP3IlXngN28cvgLl6uf4Gl/F2AidwB6pzMuWC7EUm89gOTiU+cjicN1i+vW80tp3ITbJw0RR/IE+J6KkyzMlZuLsUMHrZ8yo9YMeBrjMQezPoW4CWgYYpJ5a7aSfp1cvitOyfo27JTbIRFdHAaBhObskmLG0zYyOoO04IY1zy13TcKnR3Q5lMA2MuHfxp75VN4LgOi4ZNtf74MOUnIwCWDV/5e7uSlkbfCcRMuH2yrvBRlLgcO9xXqjIP/9lUeTLjFI3z8F+ualIvlptDJAAAAAElFTkSuQmCC";var Si=class a extends L{constructor(e={}){super(e),this._image=void 0,this._imageSubscription=void 0,this.image=E_}getType(e){return i.Material.WallTrailType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Si.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),image:i.createPropertyDescriptor("image")});var P_=Si;var Di=class a{constructor(e){e=e||{},this._definitionChanged=new i.Event,this._baseWaterColor=void 0,this._baseWaterColorSubscription=void 0,this.baseWaterColor=e.baseWaterColor||new i.Color(.2,.3,.6,1),this._blendColor=void 0,this._blendColorSubscription=void 0,this.blendColor=e.blendColor||new i.Color(0,1,.699,1),this._specularMap=void 0,this._specularMapSubscription=void 0,this.specularMap=e.specularMap||i.Material.DefaultImageId,this._normalMap=void 0,this._normalMapSubscription=void 0,this.normalMap=e.normalMap||i.Material.DefaultImageId,this.frequency=i.defaultValue(e.frequency,1e3),this.animationSpeed=i.defaultValue(e.animationSpeed,.01),this.amplitude=i.defaultValue(e.amplitude,10),this.specularIntensity=i.defaultValue(e.specularIntensity,.5)}get isConstant(){return!1}get definitionChanged(){return this._definitionChanged}getType(e){return i.Material.WaterType}getValue(e,t){return t||(t={}),t.baseWaterColor=i.Property.getValueOrUndefined(this._baseWaterColor,e),t.blendColor=i.Property.getValueOrUndefined(this._blendColor,e),t.specularMap=i.Property.getValueOrUndefined(this._specularMap,e),t.normalMap=i.Property.getValueOrUndefined(this._normalMap,e),t.frequency=this.frequency,t.animationSpeed=this.animationSpeed,t.amplitude=this.amplitude,t.specularIntensity=this.specularIntensity,t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._baseWaterColor,e._baseWaterColor)}};Object.defineProperties(Di.prototype,{baseWaterColor:i.createPropertyDescriptor("baseWaterColor"),blendColor:i.createPropertyDescriptor("blendColor"),specularMap:i.createPropertyDescriptor("specularMap"),normalMap:i.createPropertyDescriptor("normalMap")});var b_=Di;var ua=class{constructor(e){this._style=e,this._viewer=void 0,this._layer=void 0,this._delegate=void 0,this._options={},this._positions=[]}get drawTool(){return this._viewer.drawTool}_mountedHook(){}_stoppedHook(){}_onDrawAnchor(e){}_onAnchorMoving(e){this._positions.pop(),this._positions.push(e)}_onDrawStop(){this._unbindEvent(),this._viewer.drawTool.deactivate(),this._delegate&&this._layer.entities.remove(this._delegate),this._stoppedHook()}_bindEvent(){this.drawTool.on(E.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.on(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.on(E.DRAW_STOP,this._onDrawStop,this)}_unbindEvent(){this.drawTool.off(E.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.off(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.off(E.DRAW_STOP,this._onDrawStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.drawTool.activate(t),this._mountedHook(),this._unbindEvent(),this._bindEvent(),this}stop(){return this.drawTool.fire(E.DRAW_STOP),this}},V=ua;var NE={pixelSize:10,outlineColor:i.Color.BLUE,outlineWidth:5},_a=class extends V{constructor(e){super(),this._position=i.Cartesian3.ZERO,this._style={...NE,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({position:new i.CallbackProperty(()=>this._position,!1),point:{...this._style}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._position&&(e=new ii(f.transformCartesianToWGS84(this._position)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){this._position=e,this.drawTool.fire(E.DRAW_STOP,e)}_onAnchorMoving(e){this._position=e}},A_=_a;var HE={width:3,material:i.Color.YELLOW.withAlpha(.6)},fa=class extends V{constructor(e){super(),this._style={...HE,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polyline:{...this._style,positions:new i.CallbackProperty(()=>this._positions,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Se(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),t>=this._options.maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},M_=fa;var WE={material:i.Color.YELLOW.withAlpha(.6),fill:!0},ga=class extends V{constructor(e){super(),this._style={...WE,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>2?new i.PolygonHierarchy(this._positions.map(e=>e.clone())):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Ie(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e})}},I_=ga;var GE={material:i.Color.YELLOW.withAlpha(.6),fill:!0},ya=class extends V{constructor(e){super(),this._maxAnchorSize=2,this._radius=0,this._style={...GE,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>{if(this._positions.length>1){if(this._radius=i.Cartesian3.distance(this._positions[0],this._positions[1]),this._radius<=0)return null;let e=i.EllipseGeometryLibrary.computeEllipsePositions({center:this._positions[0],semiMajorAxis:this._radius,semiMinorAxis:this._radius,rotation:0,granularity:.005},!1,!0),t=i.Cartesian3.unpackArray(e.outerPositions);return t.push(t[0]),new i.PolygonHierarchy(t)}else return null},!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new ei(f.transformCartesianToWGS84(this._positions[0]),this._radius).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e,isCenter:t===1}),t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},S_=ya;var UE={material:i.Color.YELLOW.withAlpha(.6)},va=class extends V{constructor(e){super(),this._maxAnchorSize=2,this._style={...UE,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({rectangle:{...this._style,coordinates:new i.CallbackProperty(e=>this._positions.length>1?i.Rectangle.fromCartesianArray(this._positions):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new ri(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},D_=va;var wa=class extends V{constructor(e){super(),this._position=i.Cartesian3.ZERO,this._style={image:We,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({position:new i.CallbackProperty(()=>this._position,!1),billboard:{...this._style}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._position&&(e=new Me(f.transformCartesianToWGS84(this._position),this._style.image).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){this._position=e,this.drawTool.fire(E.DRAW_STOP)}_onAnchorMoving(e){this._position=e}},L_=wa;var Li=Math.PI/2,Ca=class{constructor(e){this._positions=(e==null?void 0:e.positions)||[],this.headHeightFactor=.18,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15,this.headTailFactor=.8}set positions(e){this._positions=e}get positions(){return this._positions}get hierarchy(){return this._createHierarchy()}_getArrowHeadPoints(e,t,r){let s=x.getBaseLength(e),o=s*this.headHeightFactor,n=e[e.length-1];s=x.distance(n,e[e.length-2]);let l=x.distance(t,r);o>l*this.headTailFactor&&(o=l*this.headTailFactor);let h=o*this.headWidthFactor,c=o*this.neckWidthFactor;o=o>s?s:o;let p=o*this.neckHeightFactor,u=x.getThirdPoint(e[e.length-2],n,0,o,!0),g=x.getThirdPoint(e[e.length-2],n,0,p,!0),_=x.getThirdPoint(n,u,Li,h,!1),d=x.getThirdPoint(n,u,Li,h,!0),T=x.getThirdPoint(n,g,Li,c,!1),w=x.getThirdPoint(n,g,Li,c,!0);return[T,_,n,d,w]}_getArrowBodyPoints(e,t,r,s){let o=x.wholeDistance(e),l=x.getBaseLength(e)*s,h=x.distance(t,r),c=(l-h)/2,p=0,u=[],g=[];for(let _=1;_<e.length-1;_++){let d=x.getAngleOfThreePoints(e[_-1],e[_],e[_+1])/2;p+=x.distance(e[_-1],e[_]);let T=(l/2-p/o*c)/Math.sin(d),w=x.getThirdPoint(e[_-1],e[_],Math.PI-d,T,!0),P=x.getThirdPoint(e[_-1],e[_],d,T,!1);u.push(w),g.push(P)}return u.concat(g)}_createHierarchy(){let e=y.parsePolygonCoordToArray(f.transformCartesianArrayToWGS84Array(this._positions))[0],t=e[0],r=e[1];x.isClockWise(e[0],e[1],e[2])&&(t=e[1],r=e[0]);let o=[x.mid(t,r)].concat(e.slice(2)),n=this._getArrowHeadPoints(o,t,r),l=n[0],h=n[4],c=x.distance(t,r)/x.getBaseLength(o),p=this._getArrowBodyPoints(o,l,h,c),u=p.length,g=[t].concat(p.slice(0,u/2));g.push(l);let _=[r].concat(p.slice(u/2,u));return _.push(h),g=x.getQBSplinePoints(g),_=x.getQBSplinePoints(_),new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(g.concat(n,_.reverse()))))}},$e=Ca;var BE={material:i.Color.YELLOW.withAlpha(.6),fill:!0},xa=class extends V{constructor(e){super(),this._maxAnchorSize=3,this._style={...BE,...e},this._graphics=new $e}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Ue(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),this._graphics.positions=this._positions,t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},R_=xa;var $=Math.PI/2,Ta=class{constructor(e){this._positions=(e==null?void 0:e.positions)||[],this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15}set positions(e){this._positions=e}get positions(){return this._positions}get hierarchy(){return this._createHierarchy()}_getArrowPoints(e,t,r,s){let o=x.mid(e,t),n=x.distance(o,r),l=x.getThirdPoint(r,o,0,n*.3,!0),h=x.getThirdPoint(r,o,0,n*.5,!0);l=x.getThirdPoint(o,l,$,n/5,s),h=x.getThirdPoint(o,h,$,n/4,s);let c=[o,l,h,r],p=this._getArrowHeadPoints(c),u=p[0],g=p[4],_=x.distance(e,t)/x.getBaseLength(c)/2,d=this._getArrowBodyPoints(c,u,g,_),T=d.length,w=d.slice(0,T/2),P=d.slice(T/2,T);return w.push(u),P.push(g),w=w.reverse(),w.push(t),P=P.reverse(),P.push(e),w.reverse().concat(p,P)}_getArrowHeadPoints(e){let r=x.getBaseLength(e)*this.headHeightFactor,s=e[e.length-1],o=r*this.headWidthFactor,n=r*this.neckWidthFactor,l=r*this.neckHeightFactor,h=x.getThirdPoint(e[e.length-2],s,0,r,!0),c=x.getThirdPoint(e[e.length-2],s,0,l,!0),p=x.getThirdPoint(s,h,$,o,!1),u=x.getThirdPoint(s,h,$,o,!0),g=x.getThirdPoint(s,c,$,n,!1),_=x.getThirdPoint(s,c,$,n,!0);return[g,p,s,u,_]}_getArrowBodyPoints(e,t,r,s){let o=x.wholeDistance(e),l=x.getBaseLength(e)*s,h=x.distance(t,r),c=(l-h)/2,p=0,u=[],g=[];for(let _=1;_<e.length-1;_++){let d=x.getAngleOfThreePoints(e[_-1],e[_],e[_+1])/2;p+=x.distance(e[_-1],e[_]);let T=(l/2-p/o*c)/Math.sin(d),w=x.getThirdPoint(e[_-1],e[_],Math.PI-d,T,!0),P=x.getThirdPoint(e[_-1],e[_],d,T,!1);u.push(w),g.push(P)}return u.concat(g)}_getTempPoint4(e,t,r){let s=x.mid(e,t),o=x.distance(s,r),n=x.getAngleOfThreePoints(e,s,r),l,h,c,p;return n<$?(h=o*Math.sin(n),c=o*Math.cos(n),p=x.getThirdPoint(e,s,$,h,!1),l=x.getThirdPoint(s,p,$,c,!0)):n>=$&&n<Math.PI?(h=o*Math.sin(Math.PI-n),c=o*Math.cos(Math.PI-n),p=x.getThirdPoint(e,s,$,h,!1),l=x.getThirdPoint(s,p,$,c,!1)):n>=Math.PI&&n<Math.PI*1.5?(h=o*Math.sin(n-Math.PI),c=o*Math.cos(n-Math.PI),p=x.getThirdPoint(e,s,$,h,!0),l=x.getThirdPoint(s,p,$,c,!0)):(h=o*Math.sin(Math.PI*2-n),c=o*Math.cos(Math.PI*2-n),p=x.getThirdPoint(e,s,$,h,!0),l=x.getThirdPoint(s,p,$,c,!1)),l}_createHierarchy(){let e=this._positions.length,t,r,s=y.parsePolygonCoordToArray(f.transformCartesianArrayToWGS84Array(this._positions))[0],o=s[0],n=s[1],l=s[2];e===3?t=this._getTempPoint4(o,n,l):t=s[3],e===3||e===4?r=x.mid(o,n):r=s[4];let h,c;x.isClockWise(o,n,l)?(h=this._getArrowPoints(o,r,t,!1),c=this._getArrowPoints(r,n,l,!0)):(h=this._getArrowPoints(n,r,l,!1),c=this._getArrowPoints(r,o,t,!0));let p=h.length,u=(p-5)/2,g=h.slice(0,u),_=h.slice(u,u+5),d=h.slice(u+5,p),T=c.slice(0,u),w=c.slice(u,u+5),P=c.slice(u+5,p);T=x.getBezierPoints(T);let M=x.getBezierPoints(P.concat(g.slice(1)));return d=x.getBezierPoints(d),new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(T.concat(w,M,_,d))))}},Ri=Ta;var VE={material:i.Color.YELLOW.withAlpha(.6),fill:!0},Ea=class extends V{constructor(e){super(),this._maxAnchorSize=4,this._style={...VE,...e},this._graphics=new Ri}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Ft(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),this._graphics.positions=this._positions,t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},O_=Ea;var k_=Math.PI/2,Pa=class{constructor(e){this._positions=(e==null?void 0:e.positions)||[],this.tailWidthFactor=.15,this.neckWidthFactor=.2,this.headWidthFactor=.25,this.headAngle=Math.PI/8.5,this.neckAngle=Math.PI/13}set positions(e){this._positions=e}get positions(){return this._positions}get hierarchy(){return this._createHierarchy()}_createHierarchy(){let e=y.parsePolygonCoordToArray(f.transformCartesianArrayToWGS84Array(this._positions))[0],t=e[0],r=e[1],s=x.getBaseLength(e),o=s*this.tailWidthFactor,n=s*this.neckWidthFactor,l=s*this.headWidthFactor,h=x.getThirdPoint(r,t,k_,o,!0),c=x.getThirdPoint(r,t,k_,o,!1),p=x.getThirdPoint(t,r,this.headAngle,l,!1),u=x.getThirdPoint(t,r,this.headAngle,l,!0),g=x.getThirdPoint(t,r,this.neckAngle,n,!1),_=x.getThirdPoint(t,r,this.neckAngle,n,!0);return new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions([h,g,p,r,u,_,c])))}},Oi=Pa;var jE={material:i.Color.YELLOW.withAlpha(.6),fill:!0},ba=class extends V{constructor(e){super(),this._maxAnchorSize=2,this._style={...jE,...e},this._graphics=new Oi}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>1?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new zt(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),this._graphics.positions=this._positions,t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},F_=ba;var qE=Math.PI/2,z_=100,Aa=class{constructor(e){this._positions=(e==null?void 0:e.positions)||[],this.t=.4}set positions(e){this._positions=e}get positions(){return this._positions}get hierarchy(){return this._createHierarchy()}_createHierarchy(){let e=y.parsePolygonCoordToArray(f.transformCartesianArrayToWGS84Array(this._positions))[0];if(this._positions.length===2){let n=x.mid(e[0],e[1]),l=x.distance(e[0],n)/.9,h=x.getThirdPoint(e[0],n,qE,l,!0);e=[e[0],h,e[1]]}let t=x.mid(e[0],e[2]);e.push(t,e[0],e[1]);let r=[];for(let n=0;n<e.length-2;n++){let l=e[n],h=e[n+1],c=e[n+2],p=x.getBisectorNormals(this.t,l,h,c);r=r.concat(p)}let s=r.length;r=[r[s-1]].concat(r.slice(0,s-1));let o=[];for(let n=0;n<e.length-2;n++){let l=e[n],h=e[n+1];o.push(l);for(let c=0;c<=z_;c++){let p=x.getCubicValue(c/z_,l,r[n*2],r[n*2+1],h);o.push(p)}o.push(h)}return new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(o)))}},ki=Aa;var ZE={material:i.Color.YELLOW.withAlpha(.6),fill:!0},Ma=class extends V{constructor(e){super(),this._maxAnchorSize=3,this._style={...ZE,...e},this._graphics=new ki}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>1?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Nt(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),this._graphics.positions=this._positions,t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},N_=Ma;var Ia=class extends $e{constructor(e){super(e),this.headHeightFactor=.18,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15,this.tailWidthFactor=.1,this.headTailFactor=.8,this.swallowTailFactor=1}_createHierarchy(){let e=y.parsePolygonCoordToArray(f.transformCartesianArrayToWGS84Array(this._positions))[0],t=e[0],r=e[1];x.isClockWise(e[0],e[1],e[2])&&(t=e[1],r=e[0]);let o=[x.mid(t,r)].concat(e.slice(2)),n=this._getArrowHeadPoints(o,t,r),l=n[0],h=n[4],c=x.distance(t,r),p=x.getBaseLength(o),u=p*this.tailWidthFactor*this.swallowTailFactor,g=x.getThirdPoint(o[1],o[0],0,u,!0),_=c/p,d=this._getArrowBodyPoints(o,l,h,_),T=d.length,w=[t].concat(d.slice(0,T/2));w.push(l);let P=[r].concat(d.slice(T/2,T));return P.push(h),w=x.getQBSplinePoints(w),P=x.getQBSplinePoints(P),new i.PolygonHierarchy(f.transformWGS84ArrayToCartesianArray(y.parsePositions(w.concat(n,P.reverse(),[g,w[0]]))))}},Fi=Ia;var YE={material:i.Color.YELLOW.withAlpha(.6),fill:!0},Sa=class extends V{constructor(e){super(),this._maxAnchorSize=3,this._style={...YE,...e},this._graphics=new Fi}_mountEntity(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Ht(f.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),this._graphics.positions=this._positions,t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP))}},H_=Sa;var Da=class{constructor(e){this._viewer=void 0,this._layer=void 0,this._overlay=e,this._overlay.show=!1,this._delegate=new i.Entity,this._delegate.merge(e.delegate),this._options={},this._positions=[]}get editTool(){return this._viewer.editTool}_mountedHook(){}_stoppedHook(){this._overlay.positions=f.transformCartesianArrayToWGS84Array(this._positions),this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_mountAnchor(){this._positions=[].concat(f.transformWGS84ArrayToCartesianArray(this._overlay.positions)),this._positions.forEach((e,t)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:e,index:t})})}_onEditAnchorStop({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now());this._positions[r.index]=t}_onAnchorMoving({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now());this._positions[r.index]=t}_onEditStop({pickedAnchor:e,position:t}){this._unbindEvent(),this._viewer.editTool.deactivate(),this._layer.entities.remove(this._delegate),this._stoppedHook()}_bindEvent(){return this.editTool.on(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.editTool.on(E.EDIT_ANCHOR_STOP,this._onEditAnchorStop,this),this.editTool.on(E.EDIT_STOP,this._onEditStop,this),this}_unbindEvent(){this.editTool.off(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.editTool.off(E.EDIT_ANCHOR_STOP,this._onEditAnchorStop,this),this.editTool.off(E.EDIT_STOP,this._onEditStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.editTool.tooltipMess="\u70B9\u51FB\u951A\u70B9\u79FB\u52A8,\u53F3\u51FB\u7ED3\u675F\u7F16\u8F91",this._viewer.editTool.activate(t),this._mountedHook(),this._mountAnchor(),this._unbindEvent(),this._bindEvent(),this}stop(){return this.editTool.fire(E.EDIT_STOP,{pickedAnchor:null,position:null}),this}},j=Da;var La=class extends j{constructor(e){super(e),this._position=void 0}_mountedHook(){this.editTool.tooltipMess="\u53F3\u51FB\u7ED3\u675F\u7F16\u8F91",this._position=this._delegate.position.getValue(i.JulianDate.now()),this._delegate.position=new i.CallbackProperty(()=>this._position,!1),this._layer.entities.add(this._delegate)}_stoppedHook(){this._overlay.position=f.transformCartesianToWGS84(this._position),this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_onAnchorMoving({pickedAnchor:e,position:t}){this._position=t}},W_=La;var Ra=class extends j{constructor(e){super(e)}_mountedHook(){this._delegate.polyline.positions=new i.CallbackProperty(()=>this._positions.length>1?this._positions:null,!1),this._layer.entities.add(this._delegate)}_stoppedHook(){this._overlay.positions=f.transformCartesianArrayToWGS84Array(this._positions.filter((e,t)=>t%2===0)),this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_mountAnchor(){this._positions=[];let e=this._overlay.delegate.polyline.positions.getValue(i.JulianDate.now());for(let t=0;t<e.length-1;t++){let r=z(e[t],e[t+1]);this._positions.push(e[t]),this._positions.push(r)}this._positions.push(e[e.length-1]),this._positions.forEach((t,r)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:t,index:r,isMid:r%2!==0})})}_onEditAnchorStop({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(r.isMid){let o=z(this._positions[s],this._positions[s-1]),n=z(this._positions[s],this._positions[s+1]);this._positions.splice(s,1,o,t,n),this.editTool.fire(E.CLEAR_ANCHOR),this._positions.forEach((l,h)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:l,index:h,isMid:h%2!==0})})}}_onAnchorMoving({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(this._positions[s]=t,!r.isMid&&this._options.maxAnchorSize>2){let o=-1,n=-1,l=-1,h=-1,c=this._positions.length;if(s===0?(l=s+2,h=s+1):r.index===c-1?(o=s-2,n=s-1):(o=s-2,n=s-1,l=s+2,h=s+1),o>0){let p=z(this._positions[o],this._positions[s]);this._positions[n]=p,this.editTool.fire(E.UPDATE_ANCHOR,{index:n,position:p})}if(l>0){let p=z(this._positions[l],this._positions[s]);this._positions[h]=p,this.editTool.fire(E.UPDATE_ANCHOR,{index:h,position:p})}}}},G_=Ra;var Oa=class extends j{constructor(e){super(e)}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(e=>this._positions.length>2?new i.PolygonHierarchy(this._positions.map(t=>t.clone())):null,!1),this._layer.entities.add(this._delegate)}_stoppedHook(){this._overlay.positions=f.transformCartesianArrayToWGS84Array(this._positions.filter((e,t)=>t%2===0)),this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_mountAnchor(){this._positions=[];let e=this._overlay.delegate.polygon.hierarchy.getValue(i.JulianDate.now()).positions;e.push(e[0]);for(let t=0;t<e.length-1;t++){let r=z(e[t],e[t+1]);this._positions.push(e[t]),this._positions.push(r)}this._positions.forEach((t,r)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:t,index:r,isMid:r%2!==0})})}_onEditAnchorStop({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(r.isMid){let o,n,l=this._positions.length;s===l-1?(o=z(this._positions[s],this._positions[s-1]),n=z(this._positions[s],this._positions[0])):(o=z(this._positions[s],this._positions[s-1]),n=z(this._positions[s],this._positions[s+1])),this._positions.splice(s,1,o,t,n),this.editTool.fire(E.CLEAR_ANCHOR),this._positions.forEach((h,c)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:h,index:c,isMid:c%2!==0})})}}_onAnchorMoving({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;this._positions[s]=t;let o=this._positions.length;if(!r.isMid){let n=-1,l=-1,h=-1,c=-1;s===0?(n=o-2,l=o-1,h=s+2,c=s+1):s===o-2?(n=s-2,l=s-1,h=0,c=o-1):(n=s-2,l=s-1,h=s+2,c=s+1);let p=z(this._positions[n],this._positions[s]),u=z(this._positions[h],this._positions[s]);this._positions[l]=p,this._positions[c]=u,this.editTool.fire(E.UPDATE_ANCHOR,{index:l,position:p}),this.editTool.fire(E.UPDATE_ANCHOR,{index:c,position:u})}}},U_=Oa;var ka=class extends j{constructor(e){super(e),this._center=void 0,this._radius=0}_mountedHook(){this._radius=this._overlay.radius,this._center=f.transformWGS84ToCartesian(this._overlay.center),this._positions=[].concat([this._center,this._computeCirclePoints(this._center,this._radius)[0]]),this._delegate.ellipse=null,this._delegate.polygon={...this._overlay._style},this._delegate.polygon.hierarchy=new i.CallbackProperty(e=>{if(this._positions.length>1){if(this._radius=i.Cartesian3.distance(this._positions[0],this._positions[1]),this._radius<=0)return null;let t=this._computeCirclePoints(this._positions[0],this._radius);return t.push(t[0]),new i.PolygonHierarchy(t)}else return null},!1),this._layer.entities.add(this._delegate)}_computeCirclePoints(e,t){let r=[],s=i.EllipseGeometryLibrary.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:t,rotation:0,granularity:.005},!1,!0);return s&&s.outerPositions&&(r=i.Cartesian3.unpackArray(s.outerPositions)),r}_stoppedHook(){this._overlay.center=f.transformCartesianToWGS84(this._positions[0]),this._overlay.radius=this._radius,this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_mountAnchor(){this._positions.forEach((e,t)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:e,index:t,isCenter:t%2===0})})}},B_=ka;var Fa=class extends j{constructor(e){super(e),this._overlay=e}_mountedHook(){this._delegate.rectangle.coordinates=new i.CallbackProperty(e=>this._positions.length>1?i.Rectangle.fromCartesianArray(this._positions):null,!1),this._layer.entities.add(this._delegate)}},V_=Fa;var za=class extends j{constructor(e){super(e),this._position=void 0}_mountedHook(){this.editTool.tooltipMess="\u53F3\u51FB\u7ED3\u675F\u7F16\u8F91",this._position=this._delegate.position.getValue(i.JulianDate.now()),this._delegate.position=new i.CallbackProperty(()=>this._position,!1),this._layer.entities.add(this._delegate)}_stoppedHook(){this._overlay.position=f.transformCartesianToWGS84(this._position),this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_onAnchorMoving({pickedAnchor:e,position:t}){this._position=t}},j_=za;var Na=class extends j{constructor(e){super(e),this._graphics=new $e}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1),this._layer.entities.add(this._delegate)}},q_=Na;var Ha=class extends j{constructor(e){super(e),this._graphics=new Ri}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1),this._layer.entities.add(this._delegate)}},Z_=Ha;var Wa=class extends j{constructor(e){super(e),this._graphics=new Oi}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(()=>this._positions.length>1?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1),this._layer.entities.add(this._delegate)}},Y_=Wa;var Ga=class extends j{constructor(e){super(e),this._graphics=new ki}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(()=>this._positions.length>1?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1),this._layer.entities.add(this._delegate)}},X_=Ga;var Ua=class extends j{constructor(e){super(e),this._graphics=new Fi}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1),this._layer.entities.add(this._delegate)}},J_=Ua;var Ba=class{constructor(e,t={}){this._viewer=e,this._options=t,this._layer=new i.CustomDataSource("plot-layer"),this._viewer.dataSources.add(this._layer),this._currentWorker=void 0,this._state=void 0}get viewer(){return this._viewer}get layer(){return this._layer}get state(){return this._state}_createDrawWorker(e,t){let r;switch(e){case N.POINT:r=new A_(t);break;case N.POLYLINE:r=new M_(t);break;case N.POLYGON:r=new I_(t);break;case N.CIRCLE:r=new S_(t);break;case N.RECT:r=new D_(t);break;case N.BILLBOARD:r=new L_(t);break;case N.ATTACK_ARROW:r=new R_(t);break;case N.DOUBLE_ARROW:r=new O_(t);break;case N.FINE_ARROW:r=new F_(t);break;case N.TAILED_ATTACK_ARROW:r=new H_(t);break;case N.GATHERING_PLACE:r=new N_(t);break;default:break}return r}_createEditWorker(e){let t;switch(e.type){case N.POINT:t=new W_(e);break;case N.POLYLINE:t=new G_(e);break;case N.POLYGON:t=new U_(e);break;case N.CIRCLE:t=new B_(e);break;case N.RECT:t=new V_(e);break;case N.BILLBOARD:t=new j_(e);break;case N.ATTACK_ARROW:t=new q_(e);break;case N.DOUBLE_ARROW:t=new Z_(e);break;case N.FINE_ARROW:t=new Y_(e);break;case N.TAILED_ATTACK_ARROW:t=new J_(e);break;case N.GATHERING_PLACE:t=new X_(e);break;default:break}return t}draw(e,t,r={},s=!1){var n;this._state="draw",this._currentWorker&&this._currentWorker.stop();let o=(r==null?void 0:r.maxAnchorSize)||999;return r&&delete r.maxAnchorSize,this._currentWorker=(n=this._createDrawWorker(e,r))==null?void 0:n.start(this,{...this._options,maxAnchorSize:o,onDrawStop:t,clampToModel:s!=null?s:this._options.clampToModel}),this}edit(e,t,r=!1){var s;return this._state="edit",this._currentWorker&&this._currentWorker.stop(),this._currentWorker=(s=this._createEditWorker(e))==null?void 0:s.start(this,{...this._options,onEditStop:t,clampToModel:r!=null?r:this._options.clampToModel}),this}stop(){this._currentWorker&&this._currentWorker.stop(),this._currentWorker=null}destroy(){return this._viewer.dataSources.remove(this._layer),this._viewer=void 0,this}},XE=Ba;var Va=class{constructor(e){this._viewer=e,this._options={}}_bindEvent(){}_unbindEvent(){}start(){if(this._viewer.clock.shouldAnimate=!0,this._unbindEvent(),this._options.duration){let e=setTimeout(()=>{this._unbindEvent(),this._options.callback&&this._options.callback.call(this._options.context||this),clearTimeout(e)},Number(this._options.duration)*1e3)}return this._bindEvent(),this}stop(){return this._unbindEvent(),this}},se=Va;var JE={},Z=JE;var ja=class extends se{constructor(e,t={}){super(e),this._options=t,this._heading=e.camera.heading,this._aroundAmount=.2}get type(){return Z.AROUND_VIEW}set aroundAmount(e){this._aroundAmount=e}_bindEvent(){this._viewer.clock.onTick.addEventListener(this._onAround,this)}_unbindEvent(){this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.clock.onTick.removeEventListener(this._onAround,this)}_onAround(e,t){this._heading+=i.Math.toRadians(this._aroundAmount),(this._heading>=Math.PI*2||this._heading<=-Math.PI*2)&&(this._heading=0),this._viewer.camera.setView({orientation:{heading:this._heading,pitch:this._options.pitch?i.Math.toRadians(this._options.pitch):this._viewer.camera.pitch,roll:this._options.roll?i.Math.toRadians(this._options.roll):this._viewer.camera.roll}})}};Z.AROUND_VIEW="around_view";var K_=ja;var qa=class extends se{constructor(e,t,r={}){super(e),this._position=y.parsePosition(t),this._options=r,this._heading=e.camera.heading,this._aroundAmount=.2}get type(){return Z.AROUND_POINT}set position(e){this._position=y.parsePosition(e)}set aroundAmount(e){this._aroundAmount=e}_bindEvent(){this._viewer.clock.onTick.addEventListener(this._onAround,this)}_unbindEvent(){this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.clock.onTick.removeEventListener(this._onAround,this)}_onAround(e,t){this._heading+=i.Math.toRadians(this._aroundAmount),(this._heading>=Math.PI*2||this._heading<=-Math.PI*2)&&(this._heading=0),this._viewer.camera.lookAt(f.transformWGS84ToCartesian(this._position),new i.HeadingPitchRange(this._heading,i.Math.toRadians(this._options.pitch||0),this._options.range||1e3))}};Z.AROUND_POINT="around_point";var Q_=qa;var $_=`in vec2 v_textureCoordinates;\r
1418
+ `;i.Material.WallDiffuseType="WallDiffuse";i.Material._materialCache.addMaterial(i.Material.WallDiffuseType,{fabric:{type:i.Material.WallDiffuseType,uniforms:{color:new i.Color(1,0,0,.7)},source:Wc},translucent:function(a){return!0}});i.Material.WallImageTrailType="WallImageTrail";i.Material._materialCache.addMaterial(i.Material.WallImageTrailType,{fabric:{type:i.Material.WallImageTrailType,uniforms:{image:i.Material.DefaultImageId,color:new i.Color(1,0,0,.7),speed:3,repeat:new i.Cartesian2(1,1)},source:Gc},translucent:function(a){return!0}});i.Material.WallLineTrailType="WallLineTrail";i.Material._materialCache.addMaterial(i.Material.WallLineTrailType,{fabric:{type:i.Material.WallLineTrailType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId,repeat:new i.Cartesian2(1,1),speed:3},source:Uc},translucent:function(a){return!0}});i.Material.WallTrailType="WallTrail";i.Material._materialCache.addMaterial(i.Material.WallTrailType,{fabric:{type:i.Material.WallTrailType,uniforms:{color:new i.Color(1,0,0,.7),image:i.Material.DefaultImageId,speed:1},source:Bc},translucent:function(a){return!0}});var Vc=`czm_material czm_getMaterial(czm_materialInput materialInput)
1419
+ {
1420
+ czm_material material = czm_getDefaultMaterial(materialInput);
1421
+
1422
+ // IMPORTANT:
1423
+ // materialInput.normalEC is in eye coordinates (EC).
1424
+ // If we compare it with a constant "up" vector in EC, slope will change when camera rotates.
1425
+ // Convert normal to world coordinates (WC) and compute WC-up from the fragment position.
1426
+ vec3 normalEC = normalize(materialInput.normalEC);
1427
+ vec3 normalWC = normalize(czm_inverseViewRotation * normalEC);
1428
+
1429
+ // positionToEyeEC is from position to eye, so positionEC = -positionToEyeEC
1430
+ vec3 positionEC = -materialInput.positionToEyeEC;
1431
+ vec3 positionWC = (czm_inverseView * vec4(positionEC, 1.0)).xyz;
1432
+ vec3 upWC = normalize(positionWC);
1433
+
1434
+ float slopeAngle = acos(clamp(abs(dot(normalWC, upWC)), 0.0, 1.0));
1435
+ float slopeDegrees = degrees(slopeAngle);
1436
+
1437
+ float denom = max(maxSlope - minSlope, 1e-6);
1438
+ float t = clamp((slopeDegrees - minSlope) / denom, 0.0, 1.0);
1439
+
1440
+ vec4 color = mix(minColor, maxColor, t);
1441
+
1442
+ material.diffuse = color.rgb;
1443
+ material.alpha = color.a * clamp(opacity, 0.0, 1.0);
1444
+ return material;
1445
+ }
1446
+
1447
+ `;var jc=`czm_material czm_getMaterial(czm_materialInput materialInput)
1448
+ {
1449
+ czm_material material = czm_getDefaultMaterial(materialInput);
1450
+
1451
+ vec3 normalEC = normalize(materialInput.normalEC);
1452
+ vec3 normalWC = normalize(czm_inverseViewRotation * normalEC);
1453
+
1454
+ vec3 positionEC = -materialInput.positionToEyeEC;
1455
+ vec3 positionWC = (czm_inverseView * vec4(positionEC, 1.0)).xyz;
1456
+ vec3 upWC = normalize(positionWC);
1457
+
1458
+ // local East/North unit vectors in world coordinates
1459
+ vec3 worldZ = vec3(0.0, 0.0, 1.0);
1460
+ vec3 eastWC = cross(worldZ, upWC);
1461
+ float eastLen = length(eastWC);
1462
+ if (eastLen < 1e-6) {
1463
+ eastWC = cross(vec3(1.0, 0.0, 0.0), upWC);
1464
+ eastLen = max(length(eastWC), 1e-6);
1465
+ }
1466
+ eastWC = eastWC / eastLen;
1467
+ vec3 northWC = normalize(cross(upWC, eastWC));
1468
+
1469
+ float eComp = dot(normalWC, eastWC);
1470
+ float nComp = dot(normalWC, northWC);
1471
+
1472
+ // aspect: clockwise from North to East in degrees, range [0,360)
1473
+ float aspectDeg = degrees(atan(eComp, nComp));
1474
+ if (aspectDeg < 0.0) {
1475
+ aspectDeg += 360.0;
1476
+ }
1477
+
1478
+ float denom = max(maxAspect - minAspect, 1e-6);
1479
+ float t = clamp((aspectDeg - minAspect) / denom, 0.0, 1.0);
1480
+ vec4 color = mix(minColor, maxColor, t);
1481
+
1482
+ material.diffuse = color.rgb;
1483
+ material.alpha = color.a * clamp(opacity, 0.0, 1.0);
1484
+ return material;
1485
+ }
1486
+
1487
+ `;i.Material.SlopeAreaType="SlopeArea";i.Material._materialCache.addMaterial(i.Material.SlopeAreaType,{fabric:{type:i.Material.SlopeAreaType,uniforms:{minColor:new i.Color(0,1,0,1),maxColor:new i.Color(1,0,0,1),minSlope:0,maxSlope:60,opacity:.8},source:Vc},translucent:function(a){return a.uniforms.opacity<1||a.uniforms.minColor.alpha<1||a.uniforms.maxColor.alpha<1}});i.Material.AspectAreaType="AspectArea";i.Material._materialCache.addMaterial(i.Material.AspectAreaType,{fabric:{type:i.Material.AspectAreaType,uniforms:{minColor:new i.Color(0,1,0,1),maxColor:new i.Color(1,0,0,1),minAspect:0,maxAspect:360,opacity:.8},source:jc},translucent:function(a){return a.uniforms.opacity<1||a.uniforms.minColor.alpha<1||a.uniforms.maxColor.alpha<1}});var So=class{constructor(e={}){this._definitionChanged=new i.Event,this._color=void 0,this._colorSubscription=void 0,this._speed=void 0,this._speedSubscription=void 0,this.color=e.color||i.Color.fromBytes(0,255,255,255),this.speed=e.speed||1}get isConstant(){return!1}get definitionChanged(){return this._definitionChanged}getType(e){return null}getValue(e,t={}){return t}equals(e){return this===e}},N=So;var Nt=class a extends N{constructor(e={}){super(e)}getType(e){return i.Material.CircleBlurType}getValue(e,t={}){return t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Nt.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var Yc=Nt;var Ft=class a extends N{constructor(e={}){super(e)}getType(e){return i.Material.CircleDiffuseType}getValue(e,t={}){return t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Ft.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var qc=Ft;var Ht=class a extends N{constructor(e={}){super(e)}getType(e){return i.Material.CircleFadeType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Ht.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var Zc=Ht;var zt=class a extends N{constructor(e={}){super(e)}getType(e){return i.Material.CirclePulseType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(zt.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var Xc=zt;var Wt=class a extends N{constructor(e={}){super(e)}getType(e){return i.Material.CircleScanType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Wt.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var Jc=Wt;var Gt=class a extends N{constructor(e={}){super(e)}getType(e){return i.Material.CircleSpiralType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Gt.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var $c=Gt;var Ut=class a extends N{constructor(e={}){super(e)}getType(e){return i.Material.CircleVaryType}getValue(e,t={}){return t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Ut.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var Kc=Ut;var Bt=class a extends N{constructor(e={}){super(e),this.count=Math.max(e.count||3,1),this.gradient=i.Math.clamp(e.gradient||.1,0,1)}get isConstant(){return!1}get definitionChanged(){return this._definitionChanged}getType(e){return i.Material.CircleWaveType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t.count=i.Property.getValueOrUndefined(this._count,e),t.gradient=i.Property.getValueOrUndefined(this._gradient,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)&&i.Property.equals(this._count,e._count)&&i.Property.equals(this._gradient,e._gradient)}};Object.defineProperties(Bt.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),count:i.createPropertyDescriptor("count"),gradient:i.createPropertyDescriptor("gradient")});var Qc=Bt;var Vt=class a extends N{constructor(e={}){super(e)}getType(e){return i.Material.EllipsoidElectricType}getValue(e,t={}){return t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Vt.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var ed=Vt;var jt=class a extends N{constructor(e={}){super(e)}getType(e){return i.Material.EllipsoidTrailType}getValue(e,t={}){return t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(jt.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var td=jt;var Yt=class a extends N{constructor(e={}){super(e)}getType(e){return i.Material.PolylineFlickerType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Yt.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var id=Yt;var qt=class a extends N{constructor(e={}){super(e),this._percent=void 0,this._percentSubscription=void 0,this._gradient=void 0,this._gradientSubscription=void 0,this.percent=e.percent||.03,this.gradient=e.gradient||.1}getType(e){return i.Material.PolylineFlowType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t.percent=i.Property.getValueOrUndefined(this._percent,e),t.gradient=i.Property.getValueOrUndefined(this._gradient,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)&&i.Property.equals(this._percent,e._percent)&&i.Property.equals(this._gradient,e._gradient)}};Object.defineProperties(qt.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),percent:i.createPropertyDescriptor("percent"),gradient:i.createPropertyDescriptor("gradient")});var rd=qt;var Zt=class a extends N{constructor(e={}){var t,r;super(e),this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.image=e.image,this.repeat=new i.Cartesian2(((t=e.repeat)==null?void 0:t.x)||1,((r=e.repeat)==null?void 0:r.y)||1)}getType(e){return i.Material.PolylineImageTrailType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t.repeat=i.Property.getValueOrUndefined(this._repeat,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._image,e._image)&&i.Property.equals(this._repeat,e._repeat)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Zt.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),image:i.createPropertyDescriptor("image"),repeat:i.createPropertyDescriptor("repeat")});var sd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UgAAoJAjAAAopAAAQKFJ8v91CABgly8BAkChSfK4DgEA7PIWAAAUsgAAQCFvAQBAIQsAABRSAACgkEuAAFDo+ToAALDPlwABoJACAACFFAAAKOQtAAAoZAEAgEIWAAAopAAAQCEFAAAKuQMAAIUsAABQyKeAAaCQBQAACrkDAACFHAEAQCELAAAUsgAAQCELAAAUsgAAQCELAAAUsgAAQCEFAAAKOQIAgEIWAAAo5LcAAKCQAgAAhRwBAEAhCwAAFLIAAEAhCwAAFLIAAEAhBQAACvkSIAAUsgAAQCEFAAAKKQAAUMhrgABQyAIAAIUUAAAo5AgAAApZAACgkAIAAIUUAAAo5A4AABT6A6gaPQ6/wRIfAAAAAElFTkSuQmCC";var Jt=class a extends N{constructor(e={}){super(e),this._image=void 0,this._imageSubscription=void 0,this.image=Xt}getType(e){return i.Material.PolylineLightingType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._image,e._image)}};Object.defineProperties(Jt.prototype,{color:i.createPropertyDescriptor("color"),image:i.createPropertyDescriptor("image")});var od=Jt;var $t=class a extends N{constructor(e={}){super(e),this._image=void 0,this._imageSubscription=void 0,this.image=Xt}getType(e){return i.Material.PolylineLightingTrailType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties($t.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),image:i.createPropertyDescriptor("image")});var ad=$t;var Kt=class a extends N{constructor(e={}){super(e)}getType(e){return i.Material.PolylineTrailType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=this._speed,t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Kt.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var nd=Kt;var Qt=class a extends N{constructor(e={}){super(e)}getType(e){return i.Material.RadarLineType}getValue(e,t={}){return t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(Qt.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var ld=Qt;var ei=class a extends N{constructor(e={}){super(e)}getType(e){return i.Material.RadarSweepType}getValue(e,t={}){return t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(ei.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var hd=ei;var ti=class a extends N{constructor(e={}){super(e)}getType(e){return i.Material.RadarWaveType}getValue(e,t={}){return t.color=i.Property.getValueOrUndefined(this._color,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(ti.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed")});var cd=ti;var ii=class a extends N{constructor(e={}){var t,r;super(e),this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.image=e.image,this.repeat=new i.Cartesian2(((t=e.repeat)==null?void 0:t.x)||1,((r=e.repeat)==null?void 0:r.y)||1)}getType(e){return i.Material.WallImageTrailType}getValue(e,t={}){return t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t.repeat=i.Property.getValueOrUndefined(this._repeat,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._image,e._image)&&i.Property.equals(this._repeat,e._repeat)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(ii.prototype,{image:i.createPropertyDescriptor("image"),color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),repeat:i.createPropertyDescriptor("repeat")});var dd=ii;var pd="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVwAAABACAYAAABWdc94AAAACXBIWXMAAAsTAAALEwEAmpwYAAAGx2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDIgMTE2LjE2NDY1NSwgMjAyMS8wMS8yNi0xNTo0MToyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIiB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhvdG9zaG9wLzEuMC8iIHhtcDp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c5LTdkZjc3NDIwZDczOSIgc3RFdnQ6d2hlbj0iMjAyMS0wMi0yM1QxNzoxNDozMiswODowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDIxLjIgKE1hY2ludG9zaCkiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjU3NDNjYjQ0LTMzOTctNDk5MC1iODg4LTI0MWU2YTFiZDJhZiIgc3RFdnQ6d2hlbj0iMjAyMS0wMi0yNFQxNDoyMDoxNiswODowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDIxLjIgKE1hY2ludG9zaCkiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPC9yZGY6U2VxPiA8L3htcE1NOkhpc3Rvcnk+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+eAiLkwAAAQZJREFUeJzt3LERwDAMxDAl5/1XdqYIXRiYQBULFf/svQeA/72nDwC4heACRAQXICK4ABHBBYgILkBEcAEiggsQEVyAiOACRAQXICK4ABHBBYgILkBkzYx9RoDAmpnn9BEAN/BSAIgILkBEcAEiggsQEVyAiOACRAQXICK4ABHBBYgILkBEcAEiggsQEVyAiOACRAQXIGKAHCBigBwg4qUAEBFcgIjgAkQEFyAiuAARwQWICC5ARHABIoILEBFcgIjgAkQEFyAiuAARwQWI2MMFiNjDBYh4KQBEBBcgIrgAEcEFiAguQERwASKCCxARXICI4AJEBBcgIrgAEcEFiAguQERwASIfRmAGiWTgoMYAAAAASUVORK5CYII=";var ri=class a extends N{constructor(e={}){var t,r;super(e),this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.image=pd,this.repeat=new i.Cartesian2(((t=e.repeat)==null?void 0:t.x)||1,((r=e.repeat)==null?void 0:r.y)||1)}getType(e){return i.Material.WallLineTrailType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t.repeat=i.Property.getValueOrUndefined(this._repeat,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)&&i.Property.equals(this._repeat,e._repeat)}};Object.defineProperties(ri.prototype,{color:i.createPropertyDescriptor("color"),image:i.createPropertyDescriptor("image"),repeat:i.createPropertyDescriptor("repeat"),speed:i.createPropertyDescriptor("speed")});var md=ri;var ud="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAOhlWElmTU0AKgAAAAgABgESAAMAAAABAAEAAAEaAAUAAAABAAAAVgEbAAUAAAABAAAAXgExAAIAAAAkAAAAZgEyAAIAAAAUAAAAiodpAAQAAAABAAAAngAAAAAAAABIAAAAAQAAAEgAAAABQWRvYmUgUGhvdG9zaG9wIENDIDIwMTggKE1hY2ludG9zaCkAMjAxODoxMDoyNiAxNTozMDozNAAABJAEAAIAAAAUAAAA1KABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAAAyMDE4OjEwOjI2IDE1OjI0OjI1ALUCxicAAAAJcEhZcwAACxMAAAsTAQCanBgAAAdgaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA1LjQuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnh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3gcNmve/5HYDgDsgHkJkoxdsIx6Mz2P8kfIAn2a9iBUDaw0+fi2FF2KppXpz0sdgxbgzCjjvxt01/dXCLj957oO/A2QEYvf7tpFsgLCgG/w9NjGZycTU0MdXlJD/H5hbjUQg+G2PssYuLXvvowwdfn8AH23cBbfrnH43yc5ixj0Fv1TpIiJ+SXZbvOBu/xRBX2WzzhDHBFmKolcu6dtdw9WB8srVP3IlXngN28cvgLl6uf4Gl/F2AidwB6pzMuWC7EUm89gOTiU+cjicN1i+vW80tp3ITbJw0RR/IE+J6KkyzMlZuLsUMHrZ8yo9YMeBrjMQezPoW4CWgYYpJ5a7aSfp1cvitOyfo27JTbIRFdHAaBhObskmLG0zYyOoO04IY1zy13TcKnR3Q5lMA2MuHfxp75VN4LgOi4ZNtf74MOUnIwCWDV/5e7uSlkbfCcRMuH2yrvBRlLgcO9xXqjIP/9lUeTLjFI3z8F+ualIvlptDJAAAAAElFTkSuQmCC";var si=class a extends N{constructor(e={}){super(e),this._image=void 0,this._imageSubscription=void 0,this.image=ud}getType(e){return i.Material.WallTrailType}getValue(e,t){return t||(t={}),t.color=i.Property.getValueOrUndefined(this._color,e),t.image=i.Property.getValueOrUndefined(this._image,e),t.speed=i.Property.getValueOrUndefined(this._speed,e),t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._color,e._color)&&i.Property.equals(this._speed,e._speed)}};Object.defineProperties(si.prototype,{color:i.createPropertyDescriptor("color"),speed:i.createPropertyDescriptor("speed"),image:i.createPropertyDescriptor("image")});var _d=si;var oi=class a{constructor(e){e=e||{},this._definitionChanged=new i.Event,this._baseWaterColor=void 0,this._baseWaterColorSubscription=void 0,this.baseWaterColor=e.baseWaterColor||new i.Color(.2,.3,.6,1),this._blendColor=void 0,this._blendColorSubscription=void 0,this.blendColor=e.blendColor||new i.Color(0,1,.699,1),this._specularMap=void 0,this._specularMapSubscription=void 0,this.specularMap=e.specularMap||i.Material.DefaultImageId,this._normalMap=void 0,this._normalMapSubscription=void 0,this.normalMap=e.normalMap||i.Material.DefaultImageId,this.frequency=e.frequency||1e3,this.animationSpeed=e.animationSpeed||.01,this.amplitude=e.amplitude||10,this.specularIntensity=e.specularIntensity||.5}get isConstant(){return!1}get definitionChanged(){return this._definitionChanged}getType(e){return i.Material.WaterType}getValue(e,t){return t||(t={}),t.baseWaterColor=i.Property.getValueOrUndefined(this._baseWaterColor,e),t.blendColor=i.Property.getValueOrUndefined(this._blendColor,e),t.specularMap=i.Property.getValueOrUndefined(this._specularMap,e),t.normalMap=i.Property.getValueOrUndefined(this._normalMap,e),t.frequency=this.frequency,t.animationSpeed=this.animationSpeed,t.amplitude=this.amplitude,t.specularIntensity=this.specularIntensity,t}equals(e){return this===e||e instanceof a&&i.Property.equals(this._baseWaterColor,e._baseWaterColor)}};Object.defineProperties(oi.prototype,{baseWaterColor:i.createPropertyDescriptor("baseWaterColor"),blendColor:i.createPropertyDescriptor("blendColor"),specularMap:i.createPropertyDescriptor("specularMap"),normalMap:i.createPropertyDescriptor("normalMap")});var fd=oi;var Ao=class{constructor(e){this._style=e,this._viewer=void 0,this._layer=void 0,this._delegate=void 0,this._options={},this._positions=[]}get drawTool(){return this._viewer.drawTool}_mountedHook(){}_stoppedHook(){}_onDrawAnchor(e){}_onAnchorMoving(e){this._positions.pop(),this._positions.push(e)}_onDrawStop(){this._unbindEvent(),this._viewer.drawTool.deactivate(),this._delegate&&this._layer.entities.remove(this._delegate),this._stoppedHook()}_bindEvent(){this.drawTool.on(P.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.on(P.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.on(P.DRAW_STOP,this._onDrawStop,this)}_unbindEvent(){this.drawTool.off(P.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.off(P.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.off(P.DRAW_STOP,this._onDrawStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.drawTool.activate(t),this._mountedHook(),this._unbindEvent(),this._bindEvent(),this}stop(){return this.drawTool.fire(P.DRAW_STOP),this}},V=Ao;var S_={pixelSize:10,outlineColor:i.Color.BLUE,outlineWidth:5},Mo=class extends V{constructor(e){super(),this._position=i.Cartesian3.ZERO,this._style={...S_,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({position:new i.CallbackProperty(()=>this._position,!1),point:{...this._style}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._position&&(e=new It(g.transformCartesianToWGS84(this._position)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){this._position=e,this.drawTool.fire(P.DRAW_STOP,e)}_onAnchorMoving(e){this._position=e}},gd=Mo;var A_={width:3,material:i.Color.YELLOW.withAlpha(.6)},Io=class extends V{constructor(e){super(),this._style={...A_,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polyline:{...this._style,positions:new i.CallbackProperty(()=>this._positions,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Le(g.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(P.CREATE_ANCHOR,{position:e}),t>=this._options.maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(P.DRAW_STOP))}},yd=Io;var M_={material:i.Color.YELLOW.withAlpha(.6),fill:!0},Lo=class extends V{constructor(e){super(),this._style={...M_,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>2?new i.PolygonHierarchy(this._positions.map(e=>e.clone())):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Ie(g.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){this._positions.push(e),this.drawTool.fire(P.CREATE_ANCHOR,{position:e})}},vd=Lo;var I_={material:i.Color.YELLOW.withAlpha(.6),fill:!0},Do=class extends V{constructor(e){super(),this._maxAnchorSize=2,this._radius=0,this._style={...I_,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>{if(this._positions.length>1){if(this._radius=i.Cartesian3.distance(this._positions[0],this._positions[1]),this._radius<=0)return null;let e=i.EllipseGeometryLibrary.computeEllipsePositions({center:this._positions[0],semiMajorAxis:this._radius,semiMinorAxis:this._radius,rotation:0,granularity:.005},!1,!0),t=i.Cartesian3.unpackArray(e.outerPositions);return t.push(t[0]),new i.PolygonHierarchy(t)}else return null},!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new At(g.transformCartesianToWGS84(this._positions[0]),this._radius).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(P.CREATE_ANCHOR,{position:e,isCenter:t===1}),t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(P.DRAW_STOP))}},wd=Do;var L_={material:i.Color.YELLOW.withAlpha(.6)},Ro=class extends V{constructor(e){super(),this._maxAnchorSize=2,this._style={...L_,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({rectangle:{...this._style,coordinates:new i.CallbackProperty(e=>this._positions.length>1?i.Rectangle.fromCartesianArray(this._positions):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Lt(g.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(P.CREATE_ANCHOR,{position:e}),t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(P.DRAW_STOP))}},Cd=Ro;var Oo=class extends V{constructor(e){super(),this._position=i.Cartesian3.ZERO,this._style={image:Be,...e}}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({position:new i.CallbackProperty(()=>this._position,!1),billboard:{...this._style}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._position&&(e=new Me(g.transformCartesianToWGS84(this._position),this._style.image).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){this._position=e,this.drawTool.fire(P.DRAW_STOP)}_onAnchorMoving(e){this._position=e}},xd=Oo;var ai=Math.PI/2,ko=class{constructor(e){this._positions=(e==null?void 0:e.positions)||[],this.headHeightFactor=.18,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15,this.headTailFactor=.8}set positions(e){this._positions=e}get positions(){return this._positions}get hierarchy(){return this._createHierarchy()}_getArrowHeadPoints(e,t,r){let s=T.getBaseLength(e),o=s*this.headHeightFactor,n=e[e.length-1];s=T.distance(n,e[e.length-2]);let l=T.distance(t,r);o>l*this.headTailFactor&&(o=l*this.headTailFactor);let h=o*this.headWidthFactor,c=o*this.neckWidthFactor;o=o>s?s:o;let d=o*this.neckHeightFactor,m=T.getThirdPoint(e[e.length-2],n,0,o,!0),f=T.getThirdPoint(e[e.length-2],n,0,d,!0),u=T.getThirdPoint(n,m,ai,h,!1),p=T.getThirdPoint(n,m,ai,h,!0),x=T.getThirdPoint(n,f,ai,c,!1),C=T.getThirdPoint(n,f,ai,c,!0);return[x,u,n,p,C]}_getArrowBodyPoints(e,t,r,s){let o=T.wholeDistance(e),l=T.getBaseLength(e)*s,h=T.distance(t,r),c=(l-h)/2,d=0,m=[],f=[];for(let u=1;u<e.length-1;u++){let p=T.getAngleOfThreePoints(e[u-1],e[u],e[u+1])/2;d+=T.distance(e[u-1],e[u]);let x=(l/2-d/o*c)/Math.sin(p),C=T.getThirdPoint(e[u-1],e[u],Math.PI-p,x,!0),E=T.getThirdPoint(e[u-1],e[u],p,x,!1);m.push(C),f.push(E)}return m.concat(f)}_createHierarchy(){let e=y.parsePolygonCoordToArray(g.transformCartesianArrayToWGS84Array(this._positions))[0],t=e[0],r=e[1];T.isClockWise(e[0],e[1],e[2])&&(t=e[1],r=e[0]);let o=[T.mid(t,r)].concat(e.slice(2)),n=this._getArrowHeadPoints(o,t,r),l=n[0],h=n[4],c=T.distance(t,r)/T.getBaseLength(o),d=this._getArrowBodyPoints(o,l,h,c),m=d.length,f=[t].concat(d.slice(0,m/2));f.push(l);let u=[r].concat(d.slice(m/2,m));return u.push(h),f=T.getQBSplinePoints(f),u=T.getQBSplinePoints(u),new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(y.parsePositions(f.concat(n,u.reverse()))))}},Ye=ko;var D_={material:i.Color.YELLOW.withAlpha(.6),fill:!0},No=class extends V{constructor(e){super(),this._maxAnchorSize=3,this._style={...D_,...e},this._graphics=new Ye}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new je(g.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(P.CREATE_ANCHOR,{position:e}),this._graphics.positions=this._positions,t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(P.DRAW_STOP))}},Td=No;var Q=Math.PI/2,Fo=class{constructor(e){this._positions=(e==null?void 0:e.positions)||[],this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15}set positions(e){this._positions=e}get positions(){return this._positions}get hierarchy(){return this._createHierarchy()}_getArrowPoints(e,t,r,s){let o=T.mid(e,t),n=T.distance(o,r),l=T.getThirdPoint(r,o,0,n*.3,!0),h=T.getThirdPoint(r,o,0,n*.5,!0);l=T.getThirdPoint(o,l,Q,n/5,s),h=T.getThirdPoint(o,h,Q,n/4,s);let c=[o,l,h,r],d=this._getArrowHeadPoints(c),m=d[0],f=d[4],u=T.distance(e,t)/T.getBaseLength(c)/2,p=this._getArrowBodyPoints(c,m,f,u),x=p.length,C=p.slice(0,x/2),E=p.slice(x/2,x);return C.push(m),E.push(f),C=C.reverse(),C.push(t),E=E.reverse(),E.push(e),C.reverse().concat(d,E)}_getArrowHeadPoints(e){let r=T.getBaseLength(e)*this.headHeightFactor,s=e[e.length-1],o=r*this.headWidthFactor,n=r*this.neckWidthFactor,l=r*this.neckHeightFactor,h=T.getThirdPoint(e[e.length-2],s,0,r,!0),c=T.getThirdPoint(e[e.length-2],s,0,l,!0),d=T.getThirdPoint(s,h,Q,o,!1),m=T.getThirdPoint(s,h,Q,o,!0),f=T.getThirdPoint(s,c,Q,n,!1),u=T.getThirdPoint(s,c,Q,n,!0);return[f,d,s,m,u]}_getArrowBodyPoints(e,t,r,s){let o=T.wholeDistance(e),l=T.getBaseLength(e)*s,h=T.distance(t,r),c=(l-h)/2,d=0,m=[],f=[];for(let u=1;u<e.length-1;u++){let p=T.getAngleOfThreePoints(e[u-1],e[u],e[u+1])/2;d+=T.distance(e[u-1],e[u]);let x=(l/2-d/o*c)/Math.sin(p),C=T.getThirdPoint(e[u-1],e[u],Math.PI-p,x,!0),E=T.getThirdPoint(e[u-1],e[u],p,x,!1);m.push(C),f.push(E)}return m.concat(f)}_getTempPoint4(e,t,r){let s=T.mid(e,t),o=T.distance(s,r),n=T.getAngleOfThreePoints(e,s,r),l,h,c,d;return n<Q?(h=o*Math.sin(n),c=o*Math.cos(n),d=T.getThirdPoint(e,s,Q,h,!1),l=T.getThirdPoint(s,d,Q,c,!0)):n>=Q&&n<Math.PI?(h=o*Math.sin(Math.PI-n),c=o*Math.cos(Math.PI-n),d=T.getThirdPoint(e,s,Q,h,!1),l=T.getThirdPoint(s,d,Q,c,!1)):n>=Math.PI&&n<Math.PI*1.5?(h=o*Math.sin(n-Math.PI),c=o*Math.cos(n-Math.PI),d=T.getThirdPoint(e,s,Q,h,!0),l=T.getThirdPoint(s,d,Q,c,!0)):(h=o*Math.sin(Math.PI*2-n),c=o*Math.cos(Math.PI*2-n),d=T.getThirdPoint(e,s,Q,h,!0),l=T.getThirdPoint(s,d,Q,c,!1)),l}_createHierarchy(){let e=this._positions.length,t,r,s=y.parsePolygonCoordToArray(g.transformCartesianArrayToWGS84Array(this._positions))[0],o=s[0],n=s[1],l=s[2];e===3?t=this._getTempPoint4(o,n,l):t=s[3],e===3||e===4?r=T.mid(o,n):r=s[4];let h,c;T.isClockWise(o,n,l)?(h=this._getArrowPoints(o,r,t,!1),c=this._getArrowPoints(r,n,l,!0)):(h=this._getArrowPoints(n,r,l,!1),c=this._getArrowPoints(r,o,t,!0));let d=h.length,m=(d-5)/2,f=h.slice(0,m),u=h.slice(m,m+5),p=h.slice(m+5,d),x=c.slice(0,m),C=c.slice(m,m+5),E=c.slice(m+5,d);x=T.getBezierPoints(x);let b=T.getBezierPoints(E.concat(f.slice(1)));return p=T.getBezierPoints(p),new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(y.parsePositions(x.concat(C,b,u,p))))}},ni=Fo;var R_={material:i.Color.YELLOW.withAlpha(.6),fill:!0},Ho=class extends V{constructor(e){super(),this._maxAnchorSize=4,this._style={...R_,...e},this._graphics=new ni}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Ct(g.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(P.CREATE_ANCHOR,{position:e}),this._graphics.positions=this._positions,t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(P.DRAW_STOP))}},Ed=Ho;var Pd=Math.PI/2,zo=class{constructor(e){this._positions=(e==null?void 0:e.positions)||[],this.tailWidthFactor=.15,this.neckWidthFactor=.2,this.headWidthFactor=.25,this.headAngle=Math.PI/8.5,this.neckAngle=Math.PI/13}set positions(e){this._positions=e}get positions(){return this._positions}get hierarchy(){return this._createHierarchy()}_createHierarchy(){let e=y.parsePolygonCoordToArray(g.transformCartesianArrayToWGS84Array(this._positions))[0],t=e[0],r=e[1],s=T.getBaseLength(e),o=s*this.tailWidthFactor,n=s*this.neckWidthFactor,l=s*this.headWidthFactor,h=T.getThirdPoint(r,t,Pd,o,!0),c=T.getThirdPoint(r,t,Pd,o,!1),d=T.getThirdPoint(t,r,this.headAngle,l,!1),m=T.getThirdPoint(t,r,this.headAngle,l,!0),f=T.getThirdPoint(t,r,this.neckAngle,n,!1),u=T.getThirdPoint(t,r,this.neckAngle,n,!0);return new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(y.parsePositions([h,f,d,r,m,u,c])))}},li=zo;var O_={material:i.Color.YELLOW.withAlpha(.6),fill:!0},Wo=class extends V{constructor(e){super(),this._maxAnchorSize=2,this._style={...O_,...e},this._graphics=new li}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>1?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new xt(g.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(P.CREATE_ANCHOR,{position:e}),this._graphics.positions=this._positions,t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(P.DRAW_STOP))}},bd=Wo;var k_=Math.PI/2,Sd=100,Go=class{constructor(e){this._positions=(e==null?void 0:e.positions)||[],this.t=.4}set positions(e){this._positions=e}get positions(){return this._positions}get hierarchy(){return this._createHierarchy()}_createHierarchy(){let e=y.parsePolygonCoordToArray(g.transformCartesianArrayToWGS84Array(this._positions))[0];if(this._positions.length===2){let n=T.mid(e[0],e[1]),l=T.distance(e[0],n)/.9,h=T.getThirdPoint(e[0],n,k_,l,!0);e=[e[0],h,e[1]]}let t=T.mid(e[0],e[2]);e.push(t,e[0],e[1]);let r=[];for(let n=0;n<e.length-2;n++){let l=e[n],h=e[n+1],c=e[n+2],d=T.getBisectorNormals(this.t,l,h,c);r=r.concat(d)}let s=r.length;r=[r[s-1]].concat(r.slice(0,s-1));let o=[];for(let n=0;n<e.length-2;n++){let l=e[n],h=e[n+1];o.push(l);for(let c=0;c<=Sd;c++){let d=T.getCubicValue(c/Sd,l,r[n*2],r[n*2+1],h);o.push(d)}o.push(h)}return new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(y.parsePositions(o)))}},hi=Go;var N_={material:i.Color.YELLOW.withAlpha(.6),fill:!0},Uo=class extends V{constructor(e){super(),this._maxAnchorSize=3,this._style={...N_,...e},this._graphics=new hi}_mountedHook(){this.drawTool.tooltipMess="\u5355\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>1?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Tt(g.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(P.CREATE_ANCHOR,{position:e}),this._graphics.positions=this._positions,t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(P.DRAW_STOP))}},Ad=Uo;var Bo=class extends Ye{constructor(e){super(e),this.headHeightFactor=.18,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15,this.tailWidthFactor=.1,this.headTailFactor=.8,this.swallowTailFactor=1}_createHierarchy(){let e=y.parsePolygonCoordToArray(g.transformCartesianArrayToWGS84Array(this._positions))[0],t=e[0],r=e[1];T.isClockWise(e[0],e[1],e[2])&&(t=e[1],r=e[0]);let o=[T.mid(t,r)].concat(e.slice(2)),n=this._getArrowHeadPoints(o,t,r),l=n[0],h=n[4],c=T.distance(t,r),d=T.getBaseLength(o),m=d*this.tailWidthFactor*this.swallowTailFactor,f=T.getThirdPoint(o[1],o[0],0,m,!0),u=c/d,p=this._getArrowBodyPoints(o,l,h,u),x=p.length,C=[t].concat(p.slice(0,x/2));C.push(l);let E=[r].concat(p.slice(x/2,x));return E.push(h),C=T.getQBSplinePoints(C),E=T.getQBSplinePoints(E),new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(y.parsePositions(C.concat(n,E.reverse(),[f,C[0]]))))}},ci=Bo;var F_={material:i.Color.YELLOW.withAlpha(.6),fill:!0},Vo=class extends V{constructor(e){super(),this._maxAnchorSize=3,this._style={...F_,...e},this._graphics=new ci}_mountEntity(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1)}}),this._layer.entities.add(this._delegate)}_stoppedHook(){let e=null;this._positions.length&&(e=new Et(g.transformCartesianArrayToWGS84Array(this._positions)).setStyle(this._style)),this._options.onDrawStop&&this._options.onDrawStop(e)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),this.drawTool.fire(P.CREATE_ANCHOR,{position:e}),this._graphics.positions=this._positions,t>=this._maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(P.DRAW_STOP))}},Md=Vo;var jo=class{constructor(e){this._viewer=void 0,this._layer=void 0,this._overlay=e,this._overlay.show=!1,this._delegate=new i.Entity,this._delegate.merge(e.delegate),this._options={},this._positions=[]}get editTool(){return this._viewer.editTool}_mountedHook(){}_stoppedHook(){this._overlay.positions=g.transformCartesianArrayToWGS84Array(this._positions),this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_mountAnchor(){this._positions=[].concat(g.transformWGS84ArrayToCartesianArray(this._overlay.positions)),this._positions.forEach((e,t)=>{this.editTool.fire(P.CREATE_ANCHOR,{position:e,index:t})})}_onEditAnchorStop({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now());this._positions[r.index]=t}_onAnchorMoving({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now());this._positions[r.index]=t}_onEditStop({pickedAnchor:e,position:t}){this._unbindEvent(),this._viewer.editTool.deactivate(),this._layer.entities.remove(this._delegate),this._stoppedHook()}_bindEvent(){return this.editTool.on(P.ANCHOR_MOVING,this._onAnchorMoving,this),this.editTool.on(P.EDIT_ANCHOR_STOP,this._onEditAnchorStop,this),this.editTool.on(P.EDIT_STOP,this._onEditStop,this),this}_unbindEvent(){this.editTool.off(P.ANCHOR_MOVING,this._onAnchorMoving,this),this.editTool.off(P.EDIT_ANCHOR_STOP,this._onEditAnchorStop,this),this.editTool.off(P.EDIT_STOP,this._onEditStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.editTool.tooltipMess="\u70B9\u51FB\u951A\u70B9\u79FB\u52A8,\u53F3\u51FB\u7ED3\u675F\u7F16\u8F91",this._viewer.editTool.activate(t),this._mountedHook(),this._mountAnchor(),this._unbindEvent(),this._bindEvent(),this}stop(){return this.editTool.fire(P.EDIT_STOP,{pickedAnchor:null,position:null}),this}},j=jo;var Yo=class extends j{constructor(e){super(e),this._position=void 0}_mountedHook(){this.editTool.tooltipMess="\u53F3\u51FB\u7ED3\u675F\u7F16\u8F91",this._position=this._delegate.position.getValue(i.JulianDate.now()),this._delegate.position=new i.CallbackProperty(()=>this._position,!1),this._layer.entities.add(this._delegate)}_stoppedHook(){this._overlay.position=g.transformCartesianToWGS84(this._position),this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_onAnchorMoving({pickedAnchor:e,position:t}){this._position=t}},Id=Yo;var qo=class extends j{constructor(e){super(e)}_mountedHook(){this._delegate.polyline.positions=new i.CallbackProperty(()=>this._positions.length>1?this._positions:null,!1),this._layer.entities.add(this._delegate)}_stoppedHook(){this._overlay.positions=g.transformCartesianArrayToWGS84Array(this._positions.filter((e,t)=>t%2===0)),this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_mountAnchor(){this._positions=[];let e=this._overlay.delegate.polyline.positions.getValue(i.JulianDate.now());for(let t=0;t<e.length-1;t++){let r=G(e[t],e[t+1]);this._positions.push(e[t]),this._positions.push(r)}this._positions.push(e[e.length-1]),this._positions.forEach((t,r)=>{this.editTool.fire(P.CREATE_ANCHOR,{position:t,index:r,isMid:r%2!==0})})}_onEditAnchorStop({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(r.isMid){let o=G(this._positions[s],this._positions[s-1]),n=G(this._positions[s],this._positions[s+1]);this._positions.splice(s,1,o,t,n),this.editTool.fire(P.CLEAR_ANCHOR),this._positions.forEach((l,h)=>{this.editTool.fire(P.CREATE_ANCHOR,{position:l,index:h,isMid:h%2!==0})})}}_onAnchorMoving({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(this._positions[s]=t,!r.isMid&&this._options.maxAnchorSize>2){let o=-1,n=-1,l=-1,h=-1,c=this._positions.length;if(s===0?(l=s+2,h=s+1):r.index===c-1?(o=s-2,n=s-1):(o=s-2,n=s-1,l=s+2,h=s+1),o>0){let d=G(this._positions[o],this._positions[s]);this._positions[n]=d,this.editTool.fire(P.UPDATE_ANCHOR,{index:n,position:d})}if(l>0){let d=G(this._positions[l],this._positions[s]);this._positions[h]=d,this.editTool.fire(P.UPDATE_ANCHOR,{index:h,position:d})}}}},Ld=qo;var Zo=class extends j{constructor(e){super(e)}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(e=>this._positions.length>2?new i.PolygonHierarchy(this._positions.map(t=>t.clone())):null,!1),this._layer.entities.add(this._delegate)}_stoppedHook(){this._overlay.positions=g.transformCartesianArrayToWGS84Array(this._positions.filter((e,t)=>t%2===0)),this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_mountAnchor(){this._positions=[];let e=this._overlay.delegate.polygon.hierarchy.getValue(i.JulianDate.now()).positions;e.push(e[0]);for(let t=0;t<e.length-1;t++){let r=G(e[t],e[t+1]);this._positions.push(e[t]),this._positions.push(r)}this._positions.forEach((t,r)=>{this.editTool.fire(P.CREATE_ANCHOR,{position:t,index:r,isMid:r%2!==0})})}_onEditAnchorStop({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(r.isMid){let o,n,l=this._positions.length;s===l-1?(o=G(this._positions[s],this._positions[s-1]),n=G(this._positions[s],this._positions[0])):(o=G(this._positions[s],this._positions[s-1]),n=G(this._positions[s],this._positions[s+1])),this._positions.splice(s,1,o,t,n),this.editTool.fire(P.CLEAR_ANCHOR),this._positions.forEach((h,c)=>{this.editTool.fire(P.CREATE_ANCHOR,{position:h,index:c,isMid:c%2!==0})})}}_onAnchorMoving({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;this._positions[s]=t;let o=this._positions.length;if(!r.isMid){let n=-1,l=-1,h=-1,c=-1;s===0?(n=o-2,l=o-1,h=s+2,c=s+1):s===o-2?(n=s-2,l=s-1,h=0,c=o-1):(n=s-2,l=s-1,h=s+2,c=s+1);let d=G(this._positions[n],this._positions[s]),m=G(this._positions[h],this._positions[s]);this._positions[l]=d,this._positions[c]=m,this.editTool.fire(P.UPDATE_ANCHOR,{index:l,position:d}),this.editTool.fire(P.UPDATE_ANCHOR,{index:c,position:m})}}},Dd=Zo;var Xo=class extends j{constructor(e){super(e),this._center=void 0,this._radius=0}_mountedHook(){this._radius=this._overlay.radius,this._center=g.transformWGS84ToCartesian(this._overlay.center),this._positions=[].concat([this._center,this._computeCirclePoints(this._center,this._radius)[0]]),this._delegate.ellipse=null,this._delegate.polygon={...this._overlay._style},this._delegate.polygon.hierarchy=new i.CallbackProperty(e=>{if(this._positions.length>1){if(this._radius=i.Cartesian3.distance(this._positions[0],this._positions[1]),this._radius<=0)return null;let t=this._computeCirclePoints(this._positions[0],this._radius);return t.push(t[0]),new i.PolygonHierarchy(t)}else return null},!1),this._layer.entities.add(this._delegate)}_computeCirclePoints(e,t){let r=[],s=i.EllipseGeometryLibrary.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:t,rotation:0,granularity:.005},!1,!0);return s&&s.outerPositions&&(r=i.Cartesian3.unpackArray(s.outerPositions)),r}_stoppedHook(){this._overlay.center=g.transformCartesianToWGS84(this._positions[0]),this._overlay.radius=this._radius,this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_mountAnchor(){this._positions.forEach((e,t)=>{this.editTool.fire(P.CREATE_ANCHOR,{position:e,index:t,isCenter:t%2===0})})}},Rd=Xo;var Jo=class extends j{constructor(e){super(e),this._overlay=e}_mountedHook(){this._delegate.rectangle.coordinates=new i.CallbackProperty(e=>this._positions.length>1?i.Rectangle.fromCartesianArray(this._positions):null,!1),this._layer.entities.add(this._delegate)}},Od=Jo;var $o=class extends j{constructor(e){super(e),this._position=void 0}_mountedHook(){this.editTool.tooltipMess="\u53F3\u51FB\u7ED3\u675F\u7F16\u8F91",this._position=this._delegate.position.getValue(i.JulianDate.now()),this._delegate.position=new i.CallbackProperty(()=>this._position,!1),this._layer.entities.add(this._delegate)}_stoppedHook(){this._overlay.position=g.transformCartesianToWGS84(this._position),this._overlay.show=!0,this._options.onEditStop&&this._options.onEditStop(this._overlay)}_onAnchorMoving({pickedAnchor:e,position:t}){this._position=t}},kd=$o;var Ko=class extends j{constructor(e){super(e),this._graphics=new Ye}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1),this._layer.entities.add(this._delegate)}},Nd=Ko;var Qo=class extends j{constructor(e){super(e),this._graphics=new ni}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1),this._layer.entities.add(this._delegate)}},Fd=Qo;var ea=class extends j{constructor(e){super(e),this._graphics=new li}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(()=>this._positions.length>1?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1),this._layer.entities.add(this._delegate)}},Hd=ea;var ta=class extends j{constructor(e){super(e),this._graphics=new hi}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(()=>this._positions.length>1?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1),this._layer.entities.add(this._delegate)}},zd=ta;var ia=class extends j{constructor(e){super(e),this._graphics=new ci}_mountedHook(){this._delegate.polygon.hierarchy=new i.CallbackProperty(()=>this._positions.length>2?(this._graphics.positions=this._positions,this._graphics.hierarchy):null,!1),this._layer.entities.add(this._delegate)}},Wd=ia;var ra=class{constructor(e,t={}){this._viewer=e,this._options=t,this._layer=new i.CustomDataSource("plot-layer"),this._viewer.dataSources.add(this._layer),this._currentWorker=void 0,this._state=void 0}get viewer(){return this._viewer}get layer(){return this._layer}get state(){return this._state}_createDrawWorker(e,t){let r;switch(e){case U.POINT:r=new gd(t);break;case U.POLYLINE:r=new yd(t);break;case U.POLYGON:r=new vd(t);break;case U.CIRCLE:r=new wd(t);break;case U.RECT:r=new Cd(t);break;case U.BILLBOARD:r=new xd(t);break;case U.ATTACK_ARROW:r=new Td(t);break;case U.DOUBLE_ARROW:r=new Ed(t);break;case U.FINE_ARROW:r=new bd(t);break;case U.TAILED_ATTACK_ARROW:r=new Md(t);break;case U.GATHERING_PLACE:r=new Ad(t);break;default:break}return r}_createEditWorker(e){let t;switch(e.type){case U.POINT:t=new Id(e);break;case U.POLYLINE:t=new Ld(e);break;case U.POLYGON:t=new Dd(e);break;case U.CIRCLE:t=new Rd(e);break;case U.RECT:t=new Od(e);break;case U.BILLBOARD:t=new kd(e);break;case U.ATTACK_ARROW:t=new Nd(e);break;case U.DOUBLE_ARROW:t=new Fd(e);break;case U.FINE_ARROW:t=new Hd(e);break;case U.TAILED_ATTACK_ARROW:t=new Wd(e);break;case U.GATHERING_PLACE:t=new zd(e);break;default:break}return t}draw(e,t,r={},s=!1){var n;this._state="draw",this._currentWorker&&this._currentWorker.stop();let o=(r==null?void 0:r.maxAnchorSize)||999;return r&&delete r.maxAnchorSize,this._currentWorker=(n=this._createDrawWorker(e,r))==null?void 0:n.start(this,{...this._options,maxAnchorSize:o,onDrawStop:t,clampToModel:s!=null?s:this._options.clampToModel}),this}edit(e,t,r=!1){var s;return this._state="edit",this._currentWorker&&this._currentWorker.stop(),this._currentWorker=(s=this._createEditWorker(e))==null?void 0:s.start(this,{...this._options,onEditStop:t,clampToModel:r!=null?r:this._options.clampToModel}),this}stop(){this._currentWorker&&this._currentWorker.stop(),this._currentWorker=null}destroy(){return this._viewer.dataSources.remove(this._layer),this._viewer=void 0,this}},H_=ra;var sa=class{constructor(e){this._viewer=e,this._options={}}_bindEvent(){}_unbindEvent(){}start(){if(this._viewer.clock.shouldAnimate=!0,this._unbindEvent(),this._options.duration){let e=setTimeout(()=>{this._unbindEvent(),this._options.callback&&this._options.callback.call(this._options.context||this),clearTimeout(e)},Number(this._options.duration)*1e3)}return this._bindEvent(),this}stop(){return this._unbindEvent(),this}},oe=sa;var z_={},q=z_;var oa=class extends oe{constructor(e,t={}){super(e),this._options=t,this._heading=e.camera.heading,this._aroundAmount=.2}get type(){return q.AROUND_VIEW}set aroundAmount(e){this._aroundAmount=e}_bindEvent(){this._viewer.clock.onTick.addEventListener(this._onAround,this)}_unbindEvent(){this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.clock.onTick.removeEventListener(this._onAround,this)}_onAround(e,t){this._heading+=i.Math.toRadians(this._aroundAmount),(this._heading>=Math.PI*2||this._heading<=-Math.PI*2)&&(this._heading=0),this._viewer.camera.setView({orientation:{heading:this._heading,pitch:this._options.pitch?i.Math.toRadians(this._options.pitch):this._viewer.camera.pitch,roll:this._options.roll?i.Math.toRadians(this._options.roll):this._viewer.camera.roll}})}};q.AROUND_VIEW="around_view";var Gd=oa;var aa=class extends oe{constructor(e,t,r={}){super(e),this._position=y.parsePosition(t),this._options=r,this._heading=e.camera.heading,this._aroundAmount=.2}get type(){return q.AROUND_POINT}set position(e){this._position=y.parsePosition(e)}set aroundAmount(e){this._aroundAmount=e}_bindEvent(){this._viewer.clock.onTick.addEventListener(this._onAround,this)}_unbindEvent(){this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.clock.onTick.removeEventListener(this._onAround,this)}_onAround(e,t){this._heading+=i.Math.toRadians(this._aroundAmount),(this._heading>=Math.PI*2||this._heading<=-Math.PI*2)&&(this._heading=0),this._viewer.camera.lookAt(g.transformWGS84ToCartesian(this._position),new i.HeadingPitchRange(this._heading,i.Math.toRadians(this._options.pitch||0),this._options.range||1e3))}};q.AROUND_POINT="around_point";var Ud=aa;var Bd=`in vec2 v_textureCoordinates;\r
1437
1488
  uniform sampler2D colorTexture;\r
1438
1489
  uniform sampler2D depthTexture;\r
1439
1490
  uniform vec3 centerWC;\r
@@ -1479,7 +1530,7 @@ void main() {\r
1479
1530
  out_FragColor = mix(out_FragColor, color, f);\r
1480
1531
  }\r
1481
1532
  }\r
1482
- `;var Za=class extends se{constructor(e,t,r,s={}){super(e),this._delegate=void 0,this._position=y.parsePosition(t),this._radius=r||100,this._color=s.color||i.Color.RED,this._speed=s.speed||2}get type(){return Z.CIRCLE_SCAN}_mountContent(){let e=f.transformWGS84ToCartesian(this._position),t=i.Ellipsoid.WGS84.geodeticSurfaceNormal(e,new i.Cartesian3),r=this;this._delegate=new i.PostProcessStage({name:C.uuid(),fragmentShader:$_,uniforms:{centerWC:function(){return e},normalWC:function(){return t},radius:function(){return r._radius},speed:function(){return r._speed},color:function(){return r._color}}})}start(){return!this._delegate&&this._mountContent(),this._delegate&&this._viewer.scene.postProcessStages.add(this._delegate),this}stop(){return this._delegate&&this._viewer.scene.postProcessStages.remove(this._delegate),this._delegate=void 0,this}};Z.CIRCLE_SCAN="circle_scan";var ef=Za;var Ya=class extends se{constructor(e,t={}){super(e),this._options=t,this._positions=[],this._durations=[3],this._currentIndex=0,this._timer=void 0}get type(){return Z.FLYING}set positions(e){this._positions=y.parsePositions(e)}get positions(){return this._positions}set durations(e){this._durations=e}get durations(){return this._durations}_cameraFly(){let e=this,t=this._viewer.camera,r=this._positions[this._currentIndex],s=()=>{let o=e._positions[e._currentIndex+1];o?(e._currentIndex++,e._currentIndex<=e._positions.length-1&&(e._timer=setTimeout(()=>{e._cameraFly()},(e._options.dwellTime||1)*1e3))):!o&&e._options.loop&&(e._currentIndex=0,e._timer=setTimeout(()=>{e._cameraFly()},(e._options.dwellTime||1)*1e3)),e._options.callback&&e._options.callback(e._currentIndex)};r&&t.flyTo({destination:f.transformWGS84ToCartesian(r),orientation:{heading:i.Math.toRadians(r.heading),pitch:i.Math.toRadians(r.pitch),roll:i.Math.toRadians(r.roll)},complete:s,duration:this._durations.length===1?this._durations[0]:this._durations[this._currentIndex]})}start(){return this._positions&&this._positions.length&&(this._currentIndex=0,this._cameraFly()),this}pause(){return this._viewer.camera.cancelFlight(),this._timer&&clearTimeout(this._timer),this}restore(){return this._positions&&this._positions.length&&this._cameraFly(),this}};Z.FLYING="flying";var tf=Ya;var Xa=class extends se{constructor(e,t={}){super(e),this._options=t}get type(){return Z.GLOBE_ROTATE}_icrf(e,t){if(e.mode!==i.SceneMode.SCENE3D)return!0;let r=i.Transforms.computeIcrfToFixedMatrix(t);if(r){let s=this._viewer.camera,o=i.Cartesian3.clone(s.position),n=i.Matrix4.fromRotationTranslation(r);s.lookAtTransform(n,o)}}_bindEvent(){this._viewer.clock.multiplier=this._options.speed||12*1e3,this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.scene.postUpdate.addEventListener(this._icrf,this)}_unbindEvent(){this._viewer.clock.multiplier=1,this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.scene.postUpdate.removeEventListener(this._icrf,this)}};Z.GLOBE_ROTATE="globe_rotate";var rf=Xa;var sf=`in vec2 v_textureCoordinates;\r
1533
+ `;var na=class extends oe{constructor(e,t,r,s={}){super(e),this._delegate=void 0,this._position=y.parsePosition(t),this._radius=r||100,this._color=s.color||i.Color.RED,this._speed=s.speed||2}get type(){return q.CIRCLE_SCAN}_mountContent(){let e=g.transformWGS84ToCartesian(this._position),t=i.Ellipsoid.WGS84.geodeticSurfaceNormal(e,new i.Cartesian3),r=this;this._delegate=new i.PostProcessStage({name:v.uuid(),fragmentShader:Bd,uniforms:{centerWC:function(){return e},normalWC:function(){return t},radius:function(){return r._radius},speed:function(){return r._speed},color:function(){return r._color}}})}start(){return!this._delegate&&this._mountContent(),this._delegate&&this._viewer.scene.postProcessStages.add(this._delegate),this}stop(){return this._delegate&&this._viewer.scene.postProcessStages.remove(this._delegate),this._delegate=void 0,this}};q.CIRCLE_SCAN="circle_scan";var Vd=na;var la=class extends oe{constructor(e,t={}){super(e),this._options=t,this._positions=[],this._durations=[3],this._currentIndex=0,this._timer=void 0}get type(){return q.FLYING}set positions(e){this._positions=y.parsePositions(e)}get positions(){return this._positions}set durations(e){this._durations=e}get durations(){return this._durations}_cameraFly(){let e=this,t=this._viewer.camera,r=this._positions[this._currentIndex],s=()=>{let o=e._positions[e._currentIndex+1];o?(e._currentIndex++,e._currentIndex<=e._positions.length-1&&(e._timer=setTimeout(()=>{e._cameraFly()},(e._options.dwellTime||1)*1e3))):!o&&e._options.loop&&(e._currentIndex=0,e._timer=setTimeout(()=>{e._cameraFly()},(e._options.dwellTime||1)*1e3)),e._options.callback&&e._options.callback(e._currentIndex)};r&&t.flyTo({destination:g.transformWGS84ToCartesian(r),orientation:{heading:i.Math.toRadians(r.heading),pitch:i.Math.toRadians(r.pitch),roll:i.Math.toRadians(r.roll)},complete:s,duration:this._durations.length===1?this._durations[0]:this._durations[this._currentIndex]})}start(){return this._positions&&this._positions.length&&(this._currentIndex=0,this._cameraFly()),this}pause(){return this._viewer.camera.cancelFlight(),this._timer&&clearTimeout(this._timer),this}restore(){return this._positions&&this._positions.length&&this._cameraFly(),this}};q.FLYING="flying";var jd=la;var ha=class extends oe{constructor(e,t={}){super(e),this._options=t}get type(){return q.GLOBE_ROTATE}_icrf(e,t){if(e.mode!==i.SceneMode.SCENE3D)return!0;let r=i.Transforms.computeIcrfToFixedMatrix(t);if(r){let s=this._viewer.camera,o=i.Cartesian3.clone(s.position),n=i.Matrix4.fromRotationTranslation(r);s.lookAtTransform(n,o)}}_bindEvent(){this._viewer.clock.multiplier=this._options.speed||12*1e3,this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.scene.postUpdate.addEventListener(this._icrf,this)}_unbindEvent(){this._viewer.clock.multiplier=1,this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.scene.postUpdate.removeEventListener(this._icrf,this)}};q.GLOBE_ROTATE="globe_rotate";var Yd=ha;var qd=`in vec2 v_textureCoordinates;\r
1483
1534
  uniform sampler2D colorTexture;\r
1484
1535
  uniform sampler2D depthTexture;\r
1485
1536
  uniform vec3 centerWC;\r
@@ -1549,7 +1600,135 @@ void main() {\r
1549
1600
  out_FragColor = mix(out_FragColor, color, f + f0);\r
1550
1601
  }\r
1551
1602
  }\r
1552
- `;var Ja=class extends se{constructor(e,t,r,s={}){super(e),this._position=y.parsePosition(t),this._radius=r||100,this._color=s.color||i.Color.BLUE,this._speed=s.speed||3,this._delegate=void 0}get type(){return Z.RADAR_SCAN}_mountContent(){let e=f.transformWGS84ToCartesian(this._position),t=i.Ellipsoid.WGS84.geodeticSurfaceNormal(e,new i.Cartesian3),r=new Date().getTime(),s=this;this._delegate=new i.PostProcessStage({name:C.uuid(),fragmentShader:sf,uniforms:{centerWC:function(){return e},planeNormalWC:function(){return t},lineNormalWC:function(){let o=new i.Quaternion,n=new i.Matrix3,l=i.Cartesian3.cross(i.Cartesian3.UNIT_Z,t,new i.Cartesian3),h=new Date().getTime(),c=i.Math.PI*2*((h-r)/1e4)*s._speed;return i.Quaternion.fromAxisAngle(t,c,o),i.Matrix3.fromQuaternion(o,n),i.Matrix3.multiplyByVector(n,l,l),i.Cartesian3.normalize(l,l),l},radius:function(){return s._radius},color:function(){return s._color}}})}start(){return!this._delegate&&this._mountContent(),this._delegate&&this._viewer.scene.postProcessStages.add(this._delegate),this}stop(){return this._delegate&&this._viewer.scene.postProcessStages.remove(this._delegate),this._delegate=void 0,this}};Z.RADAR_SCAN="radar_scan";var of=Ja;var Ka=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._gradations=1,this._selected=[],this._state=m.INITIALIZED}get type(){return"black_and_white"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set gradations(e){this._gradations=e,this._delegate&&(this._delegate.uniforms.gradations=e)}get gradations(){return this._gradations}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createBlackAndWhiteStage(),this._delegate&&(this._delegate.uniforms.gradations=this._gradations,this._viewer.scene.postProcessStages.add(this._delegate))}},af=Ka;var Qa=class{constructor(e){this._viewer=e,this._enable=!1,this._contrast=128,this._brightness=-.3,this._glowOnly=!1,this._delta=1,this._sigma=3.8,this._stepSize=5,this._selected=[],this._state=m.INITIALIZED}get type(){return"bloom"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set contrast(e){this._contrast=e,this._delegate&&(this._delegate.uniforms.contrast=e)}get contrast(){return this._contrast}set brightness(e){this._brightness=e,this._delegate&&(this._delegate.uniforms.brightness=e)}get brightness(){return this._brightness}set glowOnly(e){this._glowOnly=e,this._delegate&&(this._delegate.uniforms.glowOnly=e)}get glowOnly(){return this._glowOnly}set delta(e){this._delta=e,this._delegate&&(this._delegate.uniforms.delta=e)}get delta(){return this._delta}set sigma(e){this._sigma=e,this._delegate&&(this._delegate.uniforms.sigma=e)}get sigma(){return this._sigma}set stepSize(e){this._stepSize=e,this._delegate&&(this._delegate.uniforms.stepSize=e)}get stepSize(){return this._stepSize}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=this._viewer.scene.postProcessStages.bloom,this._delegate.uniforms.contrast=this._contrast,this._delegate.uniforms.brightness=this._brightness,this._delegate.uniforms.glowOnly=this._glowOnly,this._delegate.uniforms.delta=this._delta,this._delegate.uniforms.sigma=this._sigma,this._delegate.uniforms.stepSize=this._stepSize}},nf=Qa;var $a=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._intensity=1,this._selected=[],this._state=m.INITIALIZED}get type(){return"brightness"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set intensity(e){this._intensity=e,this._delegate&&(this._delegate.uniforms.brightness=e)}get intensity(){return this._intensity}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createBrightnessStage(),this._delegate&&(this._delegate.uniforms.brightness=this._intensity,this._viewer.scene.postProcessStages.add(this._delegate))}},lf=$a;var en=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._focalDistance=87,this._delta=1,this._sigma=3.8,this._stepSize=2.5,this._selected=[],this._state=m.INITIALIZED}get type(){return"depth_of_field"}set enable(e){this._enable=e,i.PostProcessStageLibrary.isDepthOfFieldSupported(this._viewer.scene)&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e),this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set focalDistance(e){this._focalDistance=e,this._delegate&&(this._delegate.uniforms.focalDistance=e)}get focalDistance(){return this._focalDistance}set delta(e){this._delta=e,this._delegate&&(this._delegate.uniforms.delta=e)}get delta(){return this._delta}set sigma(e){this._sigma=e,this._delegate&&(this._delegate.uniforms.sigma=e)}get sigma(){return this._sigma}set stepSize(e){this._stepSize=e,this._delegate&&(this._delegate.uniforms.stepSize=e)}get stepSize(){return this._stepSize}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createDepthOfFieldStage(),this._delegate&&(this._delegate.uniforms.focalDistance=this._focalDistance,this._delegate.uniforms.delta=this._delta,this._delegate.uniforms.sigma=this._sigma,this._delegate.uniforms.stepSize=this._stepSize,this._viewer.scene.postProcessStages.add(this._delegate))}},hf=en;var tn=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._intensity=6,this._distortion=61,this._dirtAmount=.4,this._haloWidth=.4,this._selected=[],this._state=m.INITIALIZED}get type(){return"lens_flare"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set intensity(e){this._intensity=e,this._delegate&&(this._delegate.uniforms.intensity=e)}get intensity(){return this._intensity}set distortion(e){this._distortion=e,this._delegate&&(this._delegate.uniforms.distortion=e)}get distortion(){return this._distortion}set dirtAmount(e){this._dirtAmount=e,this._delegate&&(this._delegate.uniforms.dirtAmount=e)}get dirtAmount(){return this._dirtAmount}set haloWidth(e){this._haloWidth=e,this._delegate&&(this._delegate.uniforms.haloWidth=e)}get haloWidth(){return this._haloWidth}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createLensFlareStage(),this._delegate&&(this._delegate.uniforms.intensity=this._intensity,this._delegate.uniforms.distortion=this._distortion,this._delegate.uniforms.dirtAmount=this._dirtAmount,this._delegate.uniforms.haloWidth=this._haloWidth,this._viewer.scene.postProcessStages.add(this._delegate))}},cf=tn;var rn=class{constructor(e){this._viewer=e,this._enable=!1,this._selected=[],this._state=m.INITIALIZED}get type(){return"night"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createNightVisionStage(),this._delegate&&this._viewer.scene.postProcessStages.add(this._delegate)}},pf=rn;var sn=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._color=i.Color.GREEN,this._length=.5,this._selected=[],this._state=m.INITIALIZED}get type(){return"silhouette"}set enable(e){this._enable=e,i.PostProcessStageLibrary.isSilhouetteSupported(this._viewer.scene)&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e),this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set color(e){this._color=e,this._delegate&&(this._delegate.uniforms.color=e)}get color(){return this._color}set length(e){this._length=e,this._delegate&&(this._delegate.uniforms.length=e)}get length(){return this._length}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createSilhouetteStage(),this._delegate&&(this._delegate.uniforms.color=this._color,this._delegate.uniforms.length=this._length,this._viewer.scene.postProcessStages.add(this._delegate))}},df=sn;var mf=`in vec2 v_textureCoordinates;
1603
+ `;var ca=class extends oe{constructor(e,t,r,s={}){super(e),this._position=y.parsePosition(t),this._radius=r||100,this._color=s.color||i.Color.BLUE,this._speed=s.speed||3,this._delegate=void 0}get type(){return q.RADAR_SCAN}_mountContent(){let e=g.transformWGS84ToCartesian(this._position),t=i.Ellipsoid.WGS84.geodeticSurfaceNormal(e,new i.Cartesian3),r=new Date().getTime(),s=this;this._delegate=new i.PostProcessStage({name:v.uuid(),fragmentShader:qd,uniforms:{centerWC:function(){return e},planeNormalWC:function(){return t},lineNormalWC:function(){let o=new i.Quaternion,n=new i.Matrix3,l=i.Cartesian3.cross(i.Cartesian3.UNIT_Z,t,new i.Cartesian3),h=new Date().getTime(),c=i.Math.PI*2*((h-r)/1e4)*s._speed;return i.Quaternion.fromAxisAngle(t,c,o),i.Matrix3.fromQuaternion(o,n),i.Matrix3.multiplyByVector(n,l,l),i.Cartesian3.normalize(l,l),l},radius:function(){return s._radius},color:function(){return s._color}}})}start(){return!this._delegate&&this._mountContent(),this._delegate&&this._viewer.scene.postProcessStages.add(this._delegate),this}stop(){return this._delegate&&this._viewer.scene.postProcessStages.remove(this._delegate),this._delegate=void 0,this}};q.RADAR_SCAN="radar_scan";var Zd=ca;var da=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._gradations=1,this._selected=[],this._state=_.INITIALIZED}get type(){return"black_and_white"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?_.ENABLED:_.DISABLED}get enable(){return this._enable}set gradations(e){this._gradations=e,this._delegate&&(this._delegate.uniforms.gradations=e)}get gradations(){return this._gradations}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createBlackAndWhiteStage(),this._delegate&&(this._delegate.uniforms.gradations=this._gradations,this._viewer.scene.postProcessStages.add(this._delegate))}},Xd=da;var pa=class{constructor(e){this._viewer=e,this._enable=!1,this._contrast=128,this._brightness=-.3,this._glowOnly=!1,this._delta=1,this._sigma=3.8,this._stepSize=5,this._selected=[],this._state=_.INITIALIZED}get type(){return"bloom"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?_.ENABLED:_.DISABLED}get enable(){return this._enable}set contrast(e){this._contrast=e,this._delegate&&(this._delegate.uniforms.contrast=e)}get contrast(){return this._contrast}set brightness(e){this._brightness=e,this._delegate&&(this._delegate.uniforms.brightness=e)}get brightness(){return this._brightness}set glowOnly(e){this._glowOnly=e,this._delegate&&(this._delegate.uniforms.glowOnly=e)}get glowOnly(){return this._glowOnly}set delta(e){this._delta=e,this._delegate&&(this._delegate.uniforms.delta=e)}get delta(){return this._delta}set sigma(e){this._sigma=e,this._delegate&&(this._delegate.uniforms.sigma=e)}get sigma(){return this._sigma}set stepSize(e){this._stepSize=e,this._delegate&&(this._delegate.uniforms.stepSize=e)}get stepSize(){return this._stepSize}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=this._viewer.scene.postProcessStages.bloom,this._delegate.uniforms.contrast=this._contrast,this._delegate.uniforms.brightness=this._brightness,this._delegate.uniforms.glowOnly=this._glowOnly,this._delegate.uniforms.delta=this._delta,this._delegate.uniforms.sigma=this._sigma,this._delegate.uniforms.stepSize=this._stepSize}},Jd=pa;var ma=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._intensity=1,this._selected=[],this._state=_.INITIALIZED}get type(){return"brightness"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?_.ENABLED:_.DISABLED}get enable(){return this._enable}set intensity(e){this._intensity=e,this._delegate&&(this._delegate.uniforms.brightness=e)}get intensity(){return this._intensity}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createBrightnessStage(),this._delegate&&(this._delegate.uniforms.brightness=this._intensity,this._viewer.scene.postProcessStages.add(this._delegate))}},$d=ma;var ua=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._focalDistance=87,this._delta=1,this._sigma=3.8,this._stepSize=2.5,this._selected=[],this._state=_.INITIALIZED}get type(){return"depth_of_field"}set enable(e){this._enable=e,i.PostProcessStageLibrary.isDepthOfFieldSupported(this._viewer.scene)&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e),this._state=e?_.ENABLED:_.DISABLED}get enable(){return this._enable}set focalDistance(e){this._focalDistance=e,this._delegate&&(this._delegate.uniforms.focalDistance=e)}get focalDistance(){return this._focalDistance}set delta(e){this._delta=e,this._delegate&&(this._delegate.uniforms.delta=e)}get delta(){return this._delta}set sigma(e){this._sigma=e,this._delegate&&(this._delegate.uniforms.sigma=e)}get sigma(){return this._sigma}set stepSize(e){this._stepSize=e,this._delegate&&(this._delegate.uniforms.stepSize=e)}get stepSize(){return this._stepSize}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createDepthOfFieldStage(),this._delegate&&(this._delegate.uniforms.focalDistance=this._focalDistance,this._delegate.uniforms.delta=this._delta,this._delegate.uniforms.sigma=this._sigma,this._delegate.uniforms.stepSize=this._stepSize,this._viewer.scene.postProcessStages.add(this._delegate))}},Kd=ua;var _a=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._intensity=6,this._distortion=61,this._dirtAmount=.4,this._haloWidth=.4,this._selected=[],this._state=_.INITIALIZED}get type(){return"lens_flare"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?_.ENABLED:_.DISABLED}get enable(){return this._enable}set intensity(e){this._intensity=e,this._delegate&&(this._delegate.uniforms.intensity=e)}get intensity(){return this._intensity}set distortion(e){this._distortion=e,this._delegate&&(this._delegate.uniforms.distortion=e)}get distortion(){return this._distortion}set dirtAmount(e){this._dirtAmount=e,this._delegate&&(this._delegate.uniforms.dirtAmount=e)}get dirtAmount(){return this._dirtAmount}set haloWidth(e){this._haloWidth=e,this._delegate&&(this._delegate.uniforms.haloWidth=e)}get haloWidth(){return this._haloWidth}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createLensFlareStage(),this._delegate&&(this._delegate.uniforms.intensity=this._intensity,this._delegate.uniforms.distortion=this._distortion,this._delegate.uniforms.dirtAmount=this._dirtAmount,this._delegate.uniforms.haloWidth=this._haloWidth,this._viewer.scene.postProcessStages.add(this._delegate))}},Qd=_a;var fa=class{constructor(e){this._viewer=e,this._enable=!1,this._selected=[],this._state=_.INITIALIZED}get type(){return"night"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?_.ENABLED:_.DISABLED}get enable(){return this._enable}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createNightVisionStage(),this._delegate&&this._viewer.scene.postProcessStages.add(this._delegate)}},ep=fa;var tp=Object.freeze({exposure:1,contrast:1,gamma:1,saturation:1,vibrance:0,temperature:0,shadows:0,midtones:1,highlights:1,sharpen:0,vignette:0}),ip=Object.freeze({enabled:!0,globalViewHeightThreshold:8e6,rightWeight:.9,downWeight:.65,forwardWeight:.1,intensity:.3}),U_=Object.freeze({enabled:!0,fitHeight:1.94,softness:.35,strength:.999}),B_=Object.freeze({active:!1,centerX:.5,centerY:.5,radiusX:.25,radiusY:.25,lightX:0,lightY:0,lightZ:-1}),V_=Object.freeze({ue5:Object.freeze({exposure:1.2,contrast:1.15,gamma:.95,saturation:1.1,vibrance:.2,temperature:.05,shadows:.05,midtones:1.05,highlights:1,sharpen:.25,vignette:.15})}),j_=`
1604
+ uniform sampler2D colorTexture;
1605
+ uniform float exposure;
1606
+ uniform float contrast;
1607
+ uniform float gamma;
1608
+ uniform float saturation;
1609
+ uniform float vibrance;
1610
+ uniform float temperature;
1611
+ uniform float shadows;
1612
+ uniform float midtones;
1613
+ uniform float highlights;
1614
+ uniform float sharpen;
1615
+ uniform float vignette;
1616
+ uniform float globalShadowEnable;
1617
+ uniform float globalShadowActive;
1618
+ uniform float globalShadowCenterX;
1619
+ uniform float globalShadowCenterY;
1620
+ uniform float globalShadowRadiusX;
1621
+ uniform float globalShadowRadiusY;
1622
+ uniform float globalShadowLightX;
1623
+ uniform float globalShadowLightY;
1624
+ uniform float globalShadowLightZ;
1625
+ uniform float globalShadowFitHeight;
1626
+ uniform float globalShadowSoftness;
1627
+ uniform float globalShadowStrength;
1628
+
1629
+ in vec2 v_textureCoordinates;
1630
+
1631
+ vec3 ACESFilm(vec3 x) {
1632
+ float a = 2.51;
1633
+ float b = 0.03;
1634
+ float c = 2.43;
1635
+ float d = 0.59;
1636
+ float e = 0.14;
1637
+ return clamp((x * (a * x + b)) / (x * (c * x + d) + e), 0.0, 1.0);
1638
+ }
1639
+
1640
+ float luminance(vec3 c) {
1641
+ return dot(c, vec3(0.2126, 0.7152, 0.0722));
1642
+ }
1643
+
1644
+ void main() {
1645
+ vec2 uv = v_textureCoordinates;
1646
+ vec2 texelSize = 1.0 / czm_viewport.zw;
1647
+
1648
+ vec3 color;
1649
+ if (sharpen > 0.0) {
1650
+ vec3 center = texture(colorTexture, uv).rgb;
1651
+ vec3 blur = texture(colorTexture, uv + vec2(-texelSize.x, 0.0)).rgb
1652
+ + texture(colorTexture, uv + vec2(texelSize.x, 0.0)).rgb
1653
+ + texture(colorTexture, uv + vec2(0.0, -texelSize.y)).rgb
1654
+ + texture(colorTexture, uv + vec2(0.0, texelSize.y)).rgb;
1655
+ blur *= 0.25;
1656
+ color = center + (center - blur) * sharpen;
1657
+ } else {
1658
+ color = texture(colorTexture, uv).rgb;
1659
+ }
1660
+
1661
+ color = pow(color, vec3(2.2));
1662
+ color *= exposure;
1663
+ color = ACESFilm(color);
1664
+ color = (color - 0.5) * contrast + 0.5;
1665
+ color = color + shadows * (1.0 - color);
1666
+ color = pow(max(color, vec3(0.0)), vec3(1.0 / midtones));
1667
+ color = color * highlights;
1668
+ color.r += temperature * 0.15;
1669
+ color.b -= temperature * 0.15;
1670
+
1671
+ float lum = luminance(color);
1672
+ color = mix(vec3(lum), color, saturation);
1673
+
1674
+ float maxC = max(color.r, max(color.g, color.b));
1675
+ float minC = min(color.r, min(color.g, color.b));
1676
+ float sat = maxC - minC;
1677
+ float amount = vibrance * (1.0 - sat) * (1.0 - sat);
1678
+ color = mix(vec3(lum), color, 1.0 + amount);
1679
+
1680
+ color = pow(max(color, vec3(0.0)), vec3(1.0 / gamma));
1681
+
1682
+ if (globalShadowEnable > 0.5 && globalShadowActive > 0.5) {
1683
+ vec2 shadowCenter = vec2(globalShadowCenterX, globalShadowCenterY);
1684
+ vec2 shadowRadius = vec2(globalShadowRadiusX, globalShadowRadiusY);
1685
+
1686
+ if (shadowRadius.x > 0.0 && shadowRadius.y > 0.0) {
1687
+ vec2 sphereUv = (uv - shadowCenter) / shadowRadius;
1688
+ float sphereDistanceSq = dot(sphereUv, sphereUv);
1689
+
1690
+ if (sphereDistanceSq <= 1.0) {
1691
+ float sphereDistance = sqrt(sphereDistanceSq);
1692
+ float sphereDepth = sqrt(max(1.0 - sphereDistanceSq, 0.0));
1693
+ vec3 fittedNormal = normalize(
1694
+ vec3(
1695
+ sphereUv,
1696
+ sphereDepth * max(globalShadowFitHeight, 0.001)
1697
+ )
1698
+ );
1699
+ vec3 shadowLight = normalize(
1700
+ vec3(
1701
+ globalShadowLightX,
1702
+ globalShadowLightY,
1703
+ globalShadowLightZ
1704
+ )
1705
+ );
1706
+ float lambert = dot(fittedNormal, -shadowLight);
1707
+ float terminatorShadow = 1.0 - smoothstep(
1708
+ -globalShadowSoftness,
1709
+ globalShadowSoftness,
1710
+ lambert
1711
+ );
1712
+ float globeEdge = 1.0 - smoothstep(0.985, 1.0, sphereDistance);
1713
+ float finalShadow =
1714
+ terminatorShadow * globeEdge * globalShadowStrength;
1715
+ color *= 1.0 - finalShadow;
1716
+ }
1717
+ }
1718
+ }
1719
+
1720
+ if (vignette > 0.0) {
1721
+ vec2 vigUV = uv * (1.0 - uv);
1722
+ float vig = vigUV.x * vigUV.y * 15.0;
1723
+ vig = pow(vig, vignette * 0.5);
1724
+ color *= vig;
1725
+ }
1726
+
1727
+ color = pow(color, vec3(1.0 / 2.2));
1728
+
1729
+ out_FragColor = vec4(clamp(color, 0.0, 1.0), 1.0);
1730
+ }
1731
+ `;function z(a,e){let t=Number(a);return Number.isFinite(t)?t:e}var ga=class{constructor(e){this._sceneFilter=e,this.reset(!1)}get enabled(){return this._enabled}set enabled(e){this._enabled=!!e,this._sceneFilter._onGlobalLightChanged()}get globalViewHeightThreshold(){return this._globalViewHeightThreshold}set globalViewHeightThreshold(e){this._globalViewHeightThreshold=z(e,this._globalViewHeightThreshold),this._sceneFilter._onGlobalLightChanged()}get rightWeight(){return this._rightWeight}set rightWeight(e){this._rightWeight=z(e,this._rightWeight),this._sceneFilter._onGlobalLightChanged()}get downWeight(){return this._downWeight}set downWeight(e){this._downWeight=z(e,this._downWeight),this._sceneFilter._onGlobalLightChanged()}get forwardWeight(){return this._forwardWeight}set forwardWeight(e){this._forwardWeight=z(e,this._forwardWeight),this._sceneFilter._onGlobalLightChanged()}get intensity(){return this._intensity}set intensity(e){this._intensity=z(e,this._intensity),this._sceneFilter._onGlobalLightChanged()}get options(){return{enabled:this._enabled,globalViewHeightThreshold:this._globalViewHeightThreshold,rightWeight:this._rightWeight,downWeight:this._downWeight,forwardWeight:this._forwardWeight,intensity:this._intensity}}setOptions(e={},t=!0){return Object.prototype.hasOwnProperty.call(e,"enabled")&&(this._enabled=!!e.enabled),Object.prototype.hasOwnProperty.call(e,"globalViewHeightThreshold")&&(this._globalViewHeightThreshold=z(e.globalViewHeightThreshold,this._globalViewHeightThreshold)),Object.prototype.hasOwnProperty.call(e,"rightWeight")&&(this._rightWeight=z(e.rightWeight,this._rightWeight)),Object.prototype.hasOwnProperty.call(e,"downWeight")&&(this._downWeight=z(e.downWeight,this._downWeight)),Object.prototype.hasOwnProperty.call(e,"forwardWeight")&&(this._forwardWeight=z(e.forwardWeight,this._forwardWeight)),Object.prototype.hasOwnProperty.call(e,"intensity")&&(this._intensity=z(e.intensity,this._intensity)),t&&this._sceneFilter._onGlobalLightChanged(),this}reset(e=!0){return this.setOptions(ip,e)}},ya=class{constructor(e){this._sceneFilter=e,this.reset(!1)}get enabled(){return this._enabled}set enabled(e){this._enabled=!!e,this._sceneFilter._onGlobalShadowChanged()}get fitHeight(){return this._fitHeight}set fitHeight(e){this._fitHeight=z(e,this._fitHeight),this._sceneFilter._onGlobalShadowChanged()}get softness(){return this._softness}set softness(e){this._softness=z(e,this._softness),this._sceneFilter._onGlobalShadowChanged()}get strength(){return this._strength}set strength(e){this._strength=z(e,this._strength),this._sceneFilter._onGlobalShadowChanged()}get active(){return this._active}get centerX(){return this._centerX}get centerY(){return this._centerY}get radiusX(){return this._radiusX}get radiusY(){return this._radiusY}get lightX(){return this._lightX}get lightY(){return this._lightY}get lightZ(){return this._lightZ}get options(){return{enabled:this._enabled,fitHeight:this._fitHeight,softness:this._softness,strength:this._strength}}setOptions(e={},t=!0){return Object.prototype.hasOwnProperty.call(e,"enabled")&&(this._enabled=!!e.enabled),Object.prototype.hasOwnProperty.call(e,"fitHeight")&&(this._fitHeight=z(e.fitHeight,this._fitHeight)),Object.prototype.hasOwnProperty.call(e,"softness")&&(this._softness=z(e.softness,this._softness)),Object.prototype.hasOwnProperty.call(e,"strength")&&(this._strength=z(e.strength,this._strength)),t&&this._sceneFilter._onGlobalShadowChanged(),this}updateState(e={}){return Object.prototype.hasOwnProperty.call(e,"active")&&(this._active=!!e.active),Object.prototype.hasOwnProperty.call(e,"centerX")&&(this._centerX=z(e.centerX,this._centerX)),Object.prototype.hasOwnProperty.call(e,"centerY")&&(this._centerY=z(e.centerY,this._centerY)),Object.prototype.hasOwnProperty.call(e,"radiusX")&&(this._radiusX=z(e.radiusX,this._radiusX)),Object.prototype.hasOwnProperty.call(e,"radiusY")&&(this._radiusY=z(e.radiusY,this._radiusY)),Object.prototype.hasOwnProperty.call(e,"lightX")&&(this._lightX=z(e.lightX,this._lightX)),Object.prototype.hasOwnProperty.call(e,"lightY")&&(this._lightY=z(e.lightY,this._lightY)),Object.prototype.hasOwnProperty.call(e,"lightZ")&&(this._lightZ=z(e.lightZ,this._lightZ)),this}resetState(){return this.updateState(B_)}reset(e=!0){return this.resetState(),this.setOptions(U_,e)}},va=class{constructor(e){var t;this._viewer=e,this._delegate=void 0,this._enable=!1,this._state=_.INITIALIZED,this._defaultSceneLight=(t=e==null?void 0:e.scene)==null?void 0:t.light,this._usingFixedGlobalLight=!1,this._preRenderRegistered=!1,this._scratchCartographic=new i.Cartographic,this._scratchRight=new i.Cartesian3,this._scratchDown=new i.Cartesian3,this._scratchForward=new i.Cartesian3,this._scratchDirection=new i.Cartesian3,this._scratchShadowWindow=new i.Cartesian2,this._scratchShadowForward=new i.Cartesian3,this._earthBoundingSphere=new i.BoundingSphere(i.Cartesian3.ZERO,i.Ellipsoid.WGS84.maximumRadius),this._preRenderListener=this._updateGlobalViewEffects.bind(this),this._fixedGlobalLight=new i.DirectionalLight({direction:new i.Cartesian3(0,0,-1),color:i.Color.WHITE,intensity:ip.intensity}),this._globalLight=new ga(this),this._globalShadow=new ya(this),this.reset(),this._registerPreRenderListener()}get type(){return"sceneFilter"}get enable(){return this._enable}set enable(e){this._enable=!!e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=this._enable,this._state=this._enable?_.ENABLED:_.DISABLED,this._updateGlobalViewEffects(),this._requestRender()}get exposure(){return this._exposure}set exposure(e){this._exposure=z(e,this._exposure),this._requestRender()}get contrast(){return this._contrast}set contrast(e){this._contrast=z(e,this._contrast),this._requestRender()}get gamma(){return this._gamma}set gamma(e){this._gamma=z(e,this._gamma),this._requestRender()}get saturation(){return this._saturation}set saturation(e){this._saturation=z(e,this._saturation),this._requestRender()}get vibrance(){return this._vibrance}set vibrance(e){this._vibrance=z(e,this._vibrance),this._requestRender()}get temperature(){return this._temperature}set temperature(e){this._temperature=z(e,this._temperature),this._requestRender()}get shadows(){return this._shadows}set shadows(e){this._shadows=z(e,this._shadows),this._requestRender()}get midtones(){return this._midtones}set midtones(e){this._midtones=z(e,this._midtones),this._requestRender()}get highlights(){return this._highlights}set highlights(e){this._highlights=z(e,this._highlights),this._requestRender()}get sharpen(){return this._sharpen}set sharpen(e){this._sharpen=z(e,this._sharpen),this._requestRender()}get vignette(){return this._vignette}set vignette(e){this._vignette=z(e,this._vignette),this._requestRender()}get globalLight(){return this._globalLight}get globalShadow(){return this._globalShadow}get options(){return{exposure:this._exposure,contrast:this._contrast,gamma:this._gamma,saturation:this._saturation,vibrance:this._vibrance,temperature:this._temperature,shadows:this._shadows,midtones:this._midtones,highlights:this._highlights,sharpen:this._sharpen,vignette:this._vignette,globalLight:this._globalLight.options,globalShadow:this._globalShadow.options}}setOptions(e={}){return Object.keys(tp).forEach(t=>{Object.prototype.hasOwnProperty.call(e,t)&&(this[t]=e[t])}),Object.prototype.hasOwnProperty.call(e,"globalLight")&&this._globalLight.setOptions(e.globalLight,!1),Object.prototype.hasOwnProperty.call(e,"globalShadow")&&this._globalShadow.setOptions(e.globalShadow,!1),this._onGlobalLightChanged(),this._onGlobalShadowChanged(),this}applyPreset(e){let t=e;return typeof e=="string"&&(t=V_[e.toLowerCase()]),t&&this.setOptions(t),this}reset(){return this.setOptions(tp),this._globalLight.reset(!1),this._globalShadow.reset(!1),this._onGlobalLightChanged(),this._onGlobalShadowChanged(),this}_registerPreRenderListener(){var t,r;if(this._preRenderRegistered)return;let e=(r=(t=this._viewer)==null?void 0:t.scene)==null?void 0:r.preRender;!e||typeof e.addEventListener!="function"||(e.addEventListener(this._preRenderListener),this._preRenderRegistered=!0)}_requestRender(){var t,r;let e=(r=(t=this._viewer)==null?void 0:t.scene)==null?void 0:r.requestRender;typeof e=="function"&&e.call(this._viewer.scene)}_onGlobalLightChanged(){this._fixedGlobalLight.intensity=this._globalLight.intensity,this._updateGlobalViewEffects(),this._requestRender()}_onGlobalShadowChanged(){this._updateGlobalShadowState(),this._requestRender()}_isGlobalViewRange(){var r,s;let e=(s=(r=this._viewer)==null?void 0:r.camera)==null?void 0:s.positionWC;if(!e)return!1;let t=i.Cartographic.fromCartesian(e,i.Ellipsoid.WGS84,this._scratchCartographic);return!!t&&t.height>=this._globalLight.globalViewHeightThreshold}_shouldUseFixedGlobalLight(){return this._enable&&this._globalLight.enabled&&this._isGlobalViewRange()}_computeFixedGlobalLightDirection(){var o;let e=(o=this._viewer)==null?void 0:o.camera;if(!(e!=null&&e.rightWC)||!(e!=null&&e.upWC)||!(e!=null&&e.directionWC))return this._fixedGlobalLight.direction;let t=i.Cartesian3.multiplyByScalar(e.rightWC,this._globalLight.rightWeight,this._scratchRight),r=i.Cartesian3.multiplyByScalar(e.upWC,-this._globalLight.downWeight,this._scratchDown),s=i.Cartesian3.multiplyByScalar(e.directionWC,this._globalLight.forwardWeight,this._scratchForward);return i.Cartesian3.add(t,r,this._scratchDirection),i.Cartesian3.add(this._scratchDirection,s,this._scratchDirection),i.Cartesian3.normalize(this._scratchDirection,this._scratchDirection)}_updateGlobalViewLight(){var t;let e=(t=this._viewer)==null?void 0:t.scene;if(e){if(!this._shouldUseFixedGlobalLight()){this._usingFixedGlobalLight&&(e.light=this._defaultSceneLight,this._usingFixedGlobalLight=!1);return}i.Cartesian3.clone(this._computeFixedGlobalLightDirection(),this._fixedGlobalLight.direction),this._usingFixedGlobalLight||(e.light=this._fixedGlobalLight,this._usingFixedGlobalLight=!0)}}_updateGlobalShadowState(){var h,c;if(!this._enable||!this._globalShadow.enabled||!this._isGlobalViewRange()){this._globalShadow.updateState({active:!1});return}let e=(h=this._viewer)==null?void 0:h.scene,t=(c=this._viewer)==null?void 0:c.camera;if(!e||!(t!=null&&t.directionWC)||!(t!=null&&t.rightWC)||!(t!=null&&t.upWC)||typeof t.getPixelSize!="function"){this._globalShadow.updateState({active:!1});return}let r=i.SceneTransforms.worldToWindowCoordinates(e,i.Cartesian3.ZERO,this._scratchShadowWindow),s=t.getPixelSize(this._earthBoundingSphere,e.drawingBufferWidth,e.drawingBufferHeight);if(!i.defined(r)||!Number.isFinite(s)||s<=0||!Number.isFinite(e.drawingBufferWidth)||!Number.isFinite(e.drawingBufferHeight)||e.drawingBufferWidth<=0||e.drawingBufferHeight<=0){this._globalShadow.updateState({active:!1});return}let o=this._earthBoundingSphere.radius/s;if(!Number.isFinite(o)||o<=0){this._globalShadow.updateState({active:!1});return}let n=this._computeFixedGlobalLightDirection(),l=i.Cartesian3.negate(t.directionWC,this._scratchShadowForward);this._globalShadow.updateState({active:!0,centerX:r.x/e.drawingBufferWidth,centerY:1-r.y/e.drawingBufferHeight,radiusX:o/e.drawingBufferWidth,radiusY:o/e.drawingBufferHeight,lightX:i.Cartesian3.dot(n,t.rightWC),lightY:i.Cartesian3.dot(n,t.upWC),lightZ:i.Cartesian3.dot(n,l)})}_updateGlobalViewEffects(){this._updateGlobalViewLight(),this._updateGlobalShadowState()}_createPostProcessStage(){let e=this;this._delegate=new i.PostProcessStage({fragmentShader:j_,uniforms:{exposure(){return e._exposure},contrast(){return e._contrast},gamma(){return e._gamma},saturation(){return e._saturation},vibrance(){return e._vibrance},temperature(){return e._temperature},shadows(){return e._shadows},midtones(){return e._midtones},highlights(){return e._highlights},sharpen(){return e._sharpen},vignette(){return e._vignette},globalShadowEnable(){return e._globalShadow.enabled?1:0},globalShadowActive(){return e._globalShadow.active?1:0},globalShadowCenterX(){return e._globalShadow.centerX},globalShadowCenterY(){return e._globalShadow.centerY},globalShadowRadiusX(){return e._globalShadow.radiusX},globalShadowRadiusY(){return e._globalShadow.radiusY},globalShadowLightX(){return e._globalShadow.lightX},globalShadowLightY(){return e._globalShadow.lightY},globalShadowLightZ(){return e._globalShadow.lightZ},globalShadowFitHeight(){return e._globalShadow.fitHeight},globalShadowSoftness(){return e._globalShadow.softness},globalShadowStrength(){return e._globalShadow.strength}}}),this._viewer.scene.postProcessStages.add(this._delegate)}},rp=va;var wa=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._color=i.Color.GREEN,this._length=.5,this._selected=[],this._state=_.INITIALIZED}get type(){return"silhouette"}set enable(e){this._enable=e,i.PostProcessStageLibrary.isSilhouetteSupported(this._viewer.scene)&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e),this._state=e?_.ENABLED:_.DISABLED}get enable(){return this._enable}set color(e){this._color=e,this._delegate&&(this._delegate.uniforms.color=e)}get color(){return this._color}set length(e){this._length=e,this._delegate&&(this._delegate.uniforms.length=e)}get length(){return this._length}set selected(e){this._selected=e,this._delegate&&(this._delegate.selected=e)}get selected(){return this._selected}_createPostProcessStage(){this._delegate=i.PostProcessStageLibrary.createSilhouetteStage(),this._delegate&&(this._delegate.uniforms.color=this._color,this._delegate.uniforms.length=this._length,this._viewer.scene.postProcessStages.add(this._delegate))}},sp=wa;var op=`in vec2 v_textureCoordinates;
1553
1732
  uniform sampler2D colorTexture;
1554
1733
  uniform sampler2D depthTexture;
1555
1734
  uniform float u_depthThreshold;
@@ -1564,7 +1743,7 @@ void main(void) {
1564
1743
  out_FragColor = vec4(1.,0.,0.,1.);
1565
1744
  }
1566
1745
  }
1567
- `;var uf=`in vec2 v_textureCoordinates;
1746
+ `;var ap=`in vec2 v_textureCoordinates;
1568
1747
 
1569
1748
 
1570
1749
  uniform sampler2D colorTexture;
@@ -1583,7 +1762,7 @@ void main(void) {
1583
1762
  out_FragColor = color;
1584
1763
  }
1585
1764
  }
1586
- `;var on=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._depthThreshold=1e-5,this._color=i.Color.RED,this._state=m.INITIALIZED}get type(){return"skyLine"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?m.ENABLED:m.DISABLED}get enable(){return this._enable}set depthThreshold(e){this._depthThreshold=e}get depthThreshold(){return this._depthThreshold}set color(e){this._color=e}get color(){return this._color}_createPostProcessStage(){let e=i.PostProcessStageLibrary.createEdgeDetectionStage(),t=this,r=new i.PostProcessStage({fragmentShader:mf,uniforms:{u_depthThreshold:function(){return t._depthThreshold}}}),s=new i.PostProcessStage({fragmentShader:uf,uniforms:{u_silhouetteTexture:e.name,u_redTexture:r.name,u_color:function(){return t._color}}});this._delegate=new i.PostProcessStageComposite({stages:[e,r,s],inputPreviousStageTexture:!1,uniforms:e.uniforms}),this._viewer.scene.postProcessStages.add(this._delegate)}},_f=on;var an=class{constructor(e){if(!e)throw Error("missing viewer param");this._blackAndWhite=new af(e),this._bloom=new nf(e),this._brightness=new lf(e),this._depthOfField=new hf(e),this._lensFlare=new cf(e),this._night=new pf(e),this._silhouette=new df(e),this._skyLine=new _f(e)}get blackAndWhite(){return this._blackAndWhite}get bloom(){return this._bloom}get brightness(){return this._brightness}get depthOfField(){return this._depthOfField}get lensFlare(){return this._lensFlare}get night(){return this._night}get silhouette(){return this._silhouette}get skyLine(){return this._skyLine}},tP=an;var ff=`in vec2 v_textureCoordinates;\r
1765
+ `;var Ca=class{constructor(e){this._viewer=e,this._delegate=void 0,this._enable=!1,this._depthThreshold=1e-5,this._color=i.Color.RED,this._state=_.INITIALIZED}get type(){return"skyLine"}set enable(e){this._enable=e,!this._delegate&&this._createPostProcessStage(),this._delegate.enabled=e,this._state=e?_.ENABLED:_.DISABLED}get enable(){return this._enable}set depthThreshold(e){this._depthThreshold=e}get depthThreshold(){return this._depthThreshold}set color(e){this._color=e}get color(){return this._color}_createPostProcessStage(){let e=i.PostProcessStageLibrary.createEdgeDetectionStage(),t=this,r=new i.PostProcessStage({fragmentShader:op,uniforms:{u_depthThreshold:function(){return t._depthThreshold}}}),s=new i.PostProcessStage({fragmentShader:ap,uniforms:{u_silhouetteTexture:e.name,u_redTexture:r.name,u_color:function(){return t._color}}});this._delegate=new i.PostProcessStageComposite({stages:[e,r,s],inputPreviousStageTexture:!1,uniforms:e.uniforms}),this._viewer.scene.postProcessStages.add(this._delegate)}},np=Ca;var xa=class{constructor(e){if(!e)throw Error("missing viewer param");this._blackAndWhite=new Xd(e),this._bloom=new Jd(e),this._brightness=new $d(e),this._depthOfField=new Kd(e),this._lensFlare=new Qd(e),this._night=new ep(e),this._sceneFilter=new rp(e),this._silhouette=new sp(e),this._skyLine=new np(e)}get blackAndWhite(){return this._blackAndWhite}get bloom(){return this._bloom}get brightness(){return this._brightness}get depthOfField(){return this._depthOfField}get lensFlare(){return this._lensFlare}get night(){return this._night}get sceneFilter(){return this._sceneFilter}get silhouette(){return this._silhouette}get skyLine(){return this._skyLine}},Z_=xa;var lp=`in vec2 v_textureCoordinates;\r
1587
1766
  uniform sampler2D colorTexture;\r
1588
1767
  uniform sampler2D depthTexture;\r
1589
1768
  uniform vec4 fogByDistance;\r
@@ -1620,7 +1799,124 @@ void main(void){\r
1620
1799
  vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);\r
1621
1800
  out_FragColor = alphaBlend(finalFogColor, sceneColor);\r
1622
1801
  }\r
1623
- `;var nn=class{constructor(e){this._id=C.uuid(),this._viewer=e,this._delegate=void 0,this._enable=!1,this._fogByDistance={near:10,nearValue:0,far:2e3,farValue:1},this._color=new i.Color(0,0,0,1),this._state=m.INITIALIZED}get type(){return"fog"}set enable(e){this._enable=e,e&&this._viewer&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e)}get enable(){return this._enable}set fogByDistance(e){var t,r,s,o;this._fogByDistance=e,this._delegate&&(this._delegate.uniforms.fogByDistance=new i.Cartesian4(((t=this._fogByDistance)==null?void 0:t.near)||10,((r=this._fogByDistance)==null?void 0:r.nearValue)||0,((s=this._fogByDistance)==null?void 0:s.far)||2e3,((o=this._fogByDistance)==null?void 0:o.farValue)||1))}get fogByDistance(){return this._fogByDistance}set color(e){this._color=e,this._delegate&&(this._delegate.uniforms.fogColor=e)}get color(){return this._color}_createPostProcessStage(){var e,t,r,s;this._delegate=new i.PostProcessStage({name:this._id,fragmentShader:ff,uniforms:{fogByDistance:new i.Cartesian4(((e=this._fogByDistance)==null?void 0:e.near)||10,((t=this._fogByDistance)==null?void 0:t.nearValue)||0,((r=this._fogByDistance)==null?void 0:r.far)||200,((s=this._fogByDistance)==null?void 0:s.farValue)||1),fogColor:this._color}}),this._viewer.scene.postProcessStages.add(this._delegate)}},gf=nn;var yf=`in vec2 v_textureCoordinates;\r
1802
+ `;var Ta=class{constructor(e){this._id=v.uuid(),this._viewer=e,this._delegate=void 0,this._enable=!1,this._fogByDistance={near:10,nearValue:0,far:2e3,farValue:1},this._color=new i.Color(0,0,0,1),this._state=_.INITIALIZED}get type(){return"fog"}set enable(e){this._enable=e,e&&this._viewer&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e)}get enable(){return this._enable}set fogByDistance(e){var t,r,s,o;this._fogByDistance=e,this._delegate&&(this._delegate.uniforms.fogByDistance=new i.Cartesian4(((t=this._fogByDistance)==null?void 0:t.near)||10,((r=this._fogByDistance)==null?void 0:r.nearValue)||0,((s=this._fogByDistance)==null?void 0:s.far)||2e3,((o=this._fogByDistance)==null?void 0:o.farValue)||1))}get fogByDistance(){return this._fogByDistance}set color(e){this._color=e,this._delegate&&(this._delegate.uniforms.fogColor=e)}get color(){return this._color}_createPostProcessStage(){var e,t,r,s;this._delegate=new i.PostProcessStage({name:this._id,fragmentShader:lp,uniforms:{fogByDistance:new i.Cartesian4(((e=this._fogByDistance)==null?void 0:e.near)||10,((t=this._fogByDistance)==null?void 0:t.nearValue)||0,((r=this._fogByDistance)==null?void 0:r.far)||200,((s=this._fogByDistance)==null?void 0:s.farValue)||1),fogColor:this._color}}),this._viewer.scene.postProcessStages.add(this._delegate)}},hp=Ta;var cp=`uniform sampler2D colorTexture;
1803
+ uniform sampler2D depthTexture;
1804
+ in vec2 v_textureCoordinates;
1805
+
1806
+ uniform vec4 u_fogColor;
1807
+ uniform float u_fogHeight;
1808
+ uniform float u_density;
1809
+ uniform float u_startDistance;
1810
+ uniform float u_maxOpacity;
1811
+
1812
+ vec4 getWorldCoordinate(float depth) {
1813
+ vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);
1814
+ eyeCoordinate = eyeCoordinate / eyeCoordinate.w;
1815
+ vec4 worldCoordinate = czm_inverseView * eyeCoordinate;
1816
+ worldCoordinate = worldCoordinate / worldCoordinate.w;
1817
+ return worldCoordinate;
1818
+ }
1819
+
1820
+ vec3 scaleToGeodeticSurface(vec3 worldPosition) {
1821
+ vec3 oneOverRadii = czm_ellipsoidInverseRadii;
1822
+ vec3 oneOverRadiiSquared = oneOverRadii * oneOverRadii;
1823
+
1824
+ float x2 = worldPosition.x * worldPosition.x * oneOverRadii.x * oneOverRadii.x;
1825
+ float y2 = worldPosition.y * worldPosition.y * oneOverRadii.y * oneOverRadii.y;
1826
+ float z2 = worldPosition.z * worldPosition.z * oneOverRadii.z * oneOverRadii.z;
1827
+ float squaredNorm = x2 + y2 + z2;
1828
+ float ratio = sqrt(1.0 / squaredNorm);
1829
+ vec3 intersection = worldPosition * ratio;
1830
+
1831
+ if (squaredNorm < 0.1) {
1832
+ return intersection;
1833
+ }
1834
+
1835
+ vec3 gradient = intersection * oneOverRadiiSquared * 2.0;
1836
+ float lambda = (1.0 - ratio) * length(worldPosition) / (0.5 * length(gradient));
1837
+ float correction = 0.0;
1838
+ float func = 0.0;
1839
+ float xMultiplier = 1.0;
1840
+ float yMultiplier = 1.0;
1841
+ float zMultiplier = 1.0;
1842
+
1843
+ for (int i = 0; i < 8; ++i) {
1844
+ lambda -= correction;
1845
+
1846
+ xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquared.x);
1847
+ yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquared.y);
1848
+ zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquared.z);
1849
+
1850
+ float xMultiplier2 = xMultiplier * xMultiplier;
1851
+ float yMultiplier2 = yMultiplier * yMultiplier;
1852
+ float zMultiplier2 = zMultiplier * zMultiplier;
1853
+ float xMultiplier3 = xMultiplier2 * xMultiplier;
1854
+ float yMultiplier3 = yMultiplier2 * yMultiplier;
1855
+ float zMultiplier3 = zMultiplier2 * zMultiplier;
1856
+
1857
+ func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0;
1858
+ if (abs(func) <= 1e-6) {
1859
+ break;
1860
+ }
1861
+
1862
+ float denominator =
1863
+ x2 * xMultiplier3 * oneOverRadiiSquared.x +
1864
+ y2 * yMultiplier3 * oneOverRadiiSquared.y +
1865
+ z2 * zMultiplier3 * oneOverRadiiSquared.z;
1866
+ float derivative = -2.0 * denominator;
1867
+ correction = func / derivative;
1868
+ }
1869
+
1870
+ return vec3(
1871
+ worldPosition.x * xMultiplier,
1872
+ worldPosition.y * yMultiplier,
1873
+ worldPosition.z * zMultiplier
1874
+ );
1875
+ }
1876
+
1877
+ float getEllipsoidHeight(vec3 worldPosition) {
1878
+ vec3 surfacePosition = scaleToGeodeticSurface(worldPosition);
1879
+ vec3 oneOverRadiiSquared = czm_ellipsoidInverseRadii * czm_ellipsoidInverseRadii;
1880
+ vec3 normal = czm_geodeticSurfaceNormal(surfacePosition, vec3(0.0), oneOverRadiiSquared);
1881
+ vec3 heightOffset = worldPosition - surfacePosition;
1882
+ return dot(heightOffset, normal);
1883
+ }
1884
+
1885
+ float getHeightFactor(float pixelHeight) {
1886
+ float heightLimit = max(u_fogHeight, 1.0);
1887
+ float heightFade = max(heightLimit * 0.35, 200.0);
1888
+ float heightRatio = 1.0 - smoothstep(heightLimit - heightFade, heightLimit + heightFade * 0.25, pixelHeight);
1889
+ return clamp(pow(heightRatio, 0.9), 0.0, 1.0);
1890
+ }
1891
+
1892
+ float getDistanceFactor(float distanceToCamera) {
1893
+ float fadeDistance = max(u_startDistance * 1.5, 10000.0);
1894
+ return smoothstep(u_startDistance, u_startDistance + fadeDistance, distanceToCamera);
1895
+ }
1896
+
1897
+ void main(void) {
1898
+ vec4 color = texture(colorTexture, v_textureCoordinates);
1899
+ float depth = czm_unpackDepth(texture(depthTexture, v_textureCoordinates));
1900
+
1901
+ // Keep the sky and no-depth pixels clean; this effect targets visible terrain.
1902
+ if (depth == 0.0) {
1903
+ out_FragColor = color;
1904
+ return;
1905
+ }
1906
+
1907
+ vec4 positionWC = getWorldCoordinate(depth);
1908
+ float pixelHeight = getEllipsoidHeight(positionWC.xyz);
1909
+ float distanceToCamera = length(positionWC.xyz - czm_viewerPositionWC);
1910
+
1911
+ float heightFactor = getHeightFactor(pixelHeight);
1912
+ float distanceFactor = getDistanceFactor(distanceToCamera);
1913
+ float distanceBoost = mix(1.0, 1.28, distanceFactor);
1914
+ float opacityCap = clamp(u_maxOpacity, 0.0, 1.0) * clamp(u_fogColor.a, 0.0, 1.0);
1915
+ float fogAmount = clamp(heightFactor * max(u_density, 0.0) * distanceBoost, 0.0, opacityCap);
1916
+
1917
+ out_FragColor = mix(color, vec4(u_fogColor.rgb, color.a), fogAmount);
1918
+ }
1919
+ `;var Ea=class{constructor(e){this._id=v.uuid(),this._viewer=e,this._delegate=void 0,this._enable=!1,this._color=new i.Color(.96,.95,.93,1),this._fogHeight=2200,this._density=1.65,this._startDistance=35e3,this._maxOpacity=.95,this._state=_.INITIALIZED}get type(){return"fog_height"}set enable(e){this._enable=e,e&&this._viewer&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e)}get enable(){return this._enable}set color(e){this._color=e,this._delegate&&(this._delegate.uniforms.u_fogColor=e)}get color(){return this._color}set fogHeight(e){this._fogHeight=e,this._delegate&&(this._delegate.uniforms.u_fogHeight=e)}get fogHeight(){return this._fogHeight}set density(e){this._density=e,this._delegate&&(this._delegate.uniforms.u_density=e)}get density(){return this._density}set startDistance(e){this._startDistance=e,this._delegate&&(this._delegate.uniforms.u_startDistance=e)}get startDistance(){return this._startDistance}set maxOpacity(e){this._maxOpacity=e,this._delegate&&(this._delegate.uniforms.u_maxOpacity=e)}get maxOpacity(){return this._maxOpacity}_createPostProcessStage(){this._delegate=new i.PostProcessStage({name:this._id,fragmentShader:cp,uniforms:{u_fogColor:this._color,u_fogHeight:this._fogHeight,u_density:this._density,u_startDistance:this._startDistance,u_maxOpacity:this._maxOpacity}}),this._viewer.scene.postProcessStages.add(this._delegate)}},dp=Ea;var pp=`in vec2 v_textureCoordinates;\r
1624
1920
  uniform sampler2D colorTexture;\r
1625
1921
  uniform float speed;\r
1626
1922
  uniform float mixNum;\r
@@ -1643,7 +1939,7 @@ void main(){\r
1643
1939
  c*=v*b;\r
1644
1940
  out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c,1), mixNum);\r
1645
1941
  }\r
1646
- `;var ln=class{constructor(e){this._id=C.uuid(),this._viewer=e,this._delegate=void 0,this._enable=!1,this._speed=10,this._mixNum=.5,this._state=m.INITIALIZED}get type(){return"rain"}set enable(e){this._enable=e,e&&this._viewer&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e)}get enable(){return this._enable}set speed(e){this._speed=e,this._delegate&&(this._delegate.uniforms.speed=e)}get speed(){return this._speed}set mixNum(e){this._mixNum=e,this._delegate&&(this._delegate.uniforms.mixNum=e)}get mixNum(){return this._mixNum}_createPostProcessStage(){this._delegate=new i.PostProcessStage({name:this._id,fragmentShader:yf,uniforms:{speed:this._speed,mixNum:this._mixNum}}),this._viewer.scene.postProcessStages.add(this._delegate)}},vf=ln;var wf=`in vec2 v_textureCoordinates;\r
1942
+ `;var Pa=class{constructor(e){this._id=v.uuid(),this._viewer=e,this._delegate=void 0,this._enable=!1,this._speed=10,this._mixNum=.5,this._state=_.INITIALIZED}get type(){return"rain"}set enable(e){this._enable=e,e&&this._viewer&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e)}get enable(){return this._enable}set speed(e){this._speed=e,this._delegate&&(this._delegate.uniforms.speed=e)}get speed(){return this._speed}set mixNum(e){this._mixNum=e,this._delegate&&(this._delegate.uniforms.mixNum=e)}get mixNum(){return this._mixNum}_createPostProcessStage(){this._delegate=new i.PostProcessStage({name:this._id,fragmentShader:pp,uniforms:{speed:this._speed,mixNum:this._mixNum}}),this._viewer.scene.postProcessStages.add(this._delegate)}},mp=Pa;var up=`in vec2 v_textureCoordinates;\r
1647
1943
  uniform sampler2D colorTexture;\r
1648
1944
  uniform float speed;\r
1649
1945
  \r
@@ -1676,7 +1972,271 @@ void main(){\r
1676
1972
  finalColor=(vec3(c));\r
1677
1973
  out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.3);\r
1678
1974
  }\r
1679
- `;var hn=class{constructor(e){this._id=C.uuid(),this._viewer=e,this._delegate=void 0,this._enable=!1,this._speed=10,this._state=m.INITIALIZED}get type(){return"snow"}set enable(e){this._enable=e,e&&this._viewer&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e)}get enable(){return this._enable}set speed(e){this._speed=e,this._delegate&&(this._delegate.uniforms.speed=e)}get speed(){return this._speed}_createPostProcessStage(){this._delegate=new i.PostProcessStage({name:this._id,fragmentShader:wf,uniforms:{speed:this._speed}}),this._viewer.scene.postProcessStages.add(this._delegate)}},Cf=hn;var xf="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAId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aZg1ZIzTNpFAEJWkK1Pg0YYdqAKrCq8lXmBPUVVlX2oAoSVXPWrUq+1ViOaAP/2Q==";var cn=class{constructor(e){this._id=C.uuid(),this._viewer=e,this._delegate=void 0,this._rotateAmount=0,this._enable=!1,this._heading=0,this._state=m.INITIALIZED}get type(){return"cloud"}set enable(e){!this._viewer.scene.mode!==i.SceneMode.SCENE3D&&(this._delegate||this._createPrimitive(),this._enable=this._delegate.show=e,this._enable?this._viewer.scene.postUpdate.addEventListener(this._onRotate,this):this._viewer.scene.postUpdate.removeEventListener(this._onRotate,this))}get enable(){return this._enable}set rotateAmount(e){this._rotateAmount=e}get rotateAmount(){return this._rotateAmount}_onRotate(e,t){this._rotateAmount!==0&&(this._heading+=this._rotateAmount,(this._heading>=360||this._heading<=-360)&&(this._heading=0),this._delegate.modelMatrix=i.Transforms.headingPitchRollToFixedFrame(new i.Cartesian3,new i.HeadingPitchRoll(i.Math.toRadians(this._heading),0,0)))}_createPrimitive(){this._delegate=new i.Primitive({appearance:new i.EllipsoidSurfaceAppearance({material:new i.Material({fabric:{type:"Image",uniforms:{color:new i.Color(1,1,1,1),image:xf},components:{alpha:"texture(image, fract(repeat * materialInput.st)).r * color.a",diffuse:"vec3(1.0)"}}}),translucent:!0,aboveGround:!0})}),this._delegate.geometryInstances=new i.GeometryInstance({geometry:new i.EllipsoidGeometry({vertexFormat:i.VertexFormat.POSITION_AND_ST,radii:this._viewer.scene.globe.ellipsoid.radii}),id:this._id}),this._delegate.show=this._enable,this._viewer.scene.primitives.add(this._delegate)}},Tf=cn;var pn=class{constructor(e){if(!e)throw Error("missing viewer param");this._fog=new gf(e),this._rain=new vf(e),this._snow=new Cf(e),this._cloud=new Tf(e)}get fog(){return this._fog}get rain(){return this._rain}get snow(){return this._snow}get cloud(){return this._cloud}},aP=pn;var dn=class{constructor(e){this._viewer=e,this._enable=!1,this._moveRate=100,this._rotateRate=.01,this._flags={moveForward:!1,moveBackward:!1,moveUp:!1,moveDown:!1,moveLeft:!1,moveRight:!1,turnLeft:!1,turnRight:!1}}set enable(e){this._enable!==e&&this._viewer.scene.mode===i.SceneMode.SCENE3D&&(this._enable=e,this._enable?this._bindEvent():this._unbindEvent())}get enable(){return this._enable}set moveRate(e){this._moveRate=e}get moveRate(){return this._moveRate}set rotateRate(e){this._rotateRate=e}get rotateRate(){return this._rotateRate}_bindEvent(){let e=this._viewer.scene.canvas;e.setAttribute("tabindex","0"),e.addEventListener("click",this._onClick.bind(this),!1),this._viewer.clock.onTick.addEventListener(this._onTick,this),document.addEventListener("keydown",this._onKeydown.bind(this),!1),document.addEventListener("keyup",this._onKeyup.bind(this),!1)}_unbindEvent(){Object.keys(this._flags).forEach(t=>{this._flags[t]=!1});let e=this._viewer.scene.canvas;e.removeAttribute("tabindex"),e.removeEventListener("click",this._onClick,!1),this._viewer.clock.onTick.removeEventListener(this._onTick,this),document.removeEventListener("keydown",this._onKeydown,!1),document.removeEventListener("keyup",this._onKeyup,!1)}_getFlagForKeyCode(e){let t;switch(e.keyCode){case 87:case 38:e.shiftKey?t="moveUp":t="moveForward";break;case 83:case 40:e.shiftKey?t="moveDown":t="moveBackward";break;case 65:case 37:t="moveLeft";break;case 68:case 39:t="moveRight";break;case 81:t="turnLeft";break;case 69:t="turnRight";break;default:break}return t}_onClick(){this._viewer.scene.canvas.focus()}_onKeydown(e){let t=this._getFlagForKeyCode(e);t&&(this._flags[t]=!0)}_onKeyup(e){Object.keys(this._flags).forEach(t=>{this._flags[t]=!1})}_onTick(){let e=this._viewer.scene.camera,r=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(e.position).height/this._moveRate,s=i.Cartesian3.clone(e.position,new i.Cartesian3);this._flags.moveForward&&e.moveForward(r),this._flags.moveBackward&&e.moveBackward(r),this._flags.moveUp&&e.moveUp(r),this._flags.moveDown&&e.moveDown(r),this._flags.moveLeft&&e.moveLeft(r),this._flags.moveRight&&e.moveRight(r),this._flags.turnLeft&&e.rotate(s,-this._rotateRate),this._flags.turnRight&&e.rotate(s,this._rotateRate)}},Ef=dn;var mn=class{constructor(e){this._viewer=e,this._viewOption={},this._cache={},this._activedPath=void 0}_onPostRender(){if(!this._activedPath)return!1;this._activedPath.pathEvent&&this._activedPath.pathEvent.fire(ae.POST_RENDER,{viewer:this._viewer,viewOption:this._viewOption})}addPath(e){return e&&!this._cache.hasOwnProperty(e.pathId)&&(e.pathEvent.fire(ae.ADD),this._cache[e.pathId]=e),this}addPaths(e){return Array.isArray(e)&&e.forEach(t=>{this.addPath(t)}),this}removePath(e){return e&&this._cache.hasOwnProperty(e.pathId)&&(delete this._cache[e.pathId],e.pathEvent.fire(ae.REMOVE)),this}getPath(e){let t=this.getPaths().filter(r=>r.id===e);return t&&t.length?t[0]:void 0}getPaths(){let e=[];return Object.keys(this._cache).forEach(t=>{e.push(this._cache[t])}),e}activate(e,t={}){var r;return!e||(e==null?void 0:e.pathId)===((r=this._activedPath)==null?void 0:r.pathId)||!this._cache.hasOwnProperty(e==null?void 0:e.pathId)?this:(this._viewOption=t,this._activedPath&&this.deactivate(),this._activedPath=e,this._activedPath.pathEvent&&this._activedPath.pathEvent.fire(ae.RESET_TIME_LINE),this._viewer.on(D.POST_RENDER,this._onPostRender,this),this)}deactivate(){return this._activedPath&&(this._activedPath.actived=!1),this._activedPath=void 0,this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this}clear(){return this._cache={},this._activedPath&&(this._activedPath.actived=!1),this._activedPath=void 0,this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this}},Pf=mn;var un=class{constructor(e,t,r){this._id=C.uuid(),this._bid=void 0,this._positions=y.parsePositions(e),this._duration=t||20,this._pathMode=r||"speed",this._timeLine=[],this._sampledPosition=void 0,this._actived=!1,this._endTime=i.JulianDate.now(),this._pathEvent=new xr,this._pathEvent.on(ae.ADD,this._onAdd,this),this._pathEvent.on(ae.REMOVE,this._onRemove,this),this._pathEvent.on(ae.POST_RENDER,this._onPostRender,this),this._pathEvent.on(ae.RESET_TIME_LINE,this._resetTimeLine,this),this._state=m.INITIALIZED}get pathId(){return this._id}set id(e){this._bid=e}get id(){return this._bid}set positions(e){this._positions=y.parsePositions(e)}get positions(){return this._positions}set duration(e){this._duration=e}get duration(){return this._duration}set pathMode(e){this._pathMode=e}get pathMode(){return this._pathMode}get pathEvent(){return this._pathEvent}set actived(e){this._actived=e}get actived(){return this._actived}get state(){return this._state}_onAdd(){this._state=m.ADDED}_onRemove(){this._state=m.REMOVED}_onPostRender({viewer:e,viewOption:t}){if(!this.actived)return!1;let r=i.JulianDate.now();if(i.JulianDate.lessThan(r,this._endTime)&&this._sampledPosition){let s=this._sampledPosition.getValue(r),o=this._sampledPosition.getValue(i.JulianDate.addSeconds(r,.001,new i.JulianDate));s&&o&&e.camera.lookAt(s,new i.HeadingPitchRange(ve(s,o),i.Math.toRadians((t==null?void 0:t.pitch)||-20),(t==null?void 0:t.range)||2e3))}else e.camera.lookAtTransform(i.Matrix4.IDENTITY),this._actived=!1}_resetTimeLine(){if(!this._positions||!this._positions.length)return!1;let e=i.JulianDate.now(),t=0,r=[];if(this._pathMode==="speed"){let s=ie(this._positions)/this._duration;r=this._positions.map((o,n,l)=>(n!==0&&(t+=ie([l[n-1],o])/s),i.JulianDate.addSeconds(e,t,new i.JulianDate)))}else{let s=this._positions.length,o=(this._duration-this._duration%s)/s;r=this._positions.map((n,l)=>i.JulianDate.addSeconds(e,l*o,new i.JulianDate))}this._sampledPosition=new i.SampledPositionProperty,this._sampledPosition.addSamples(r,f.transformWGS84ArrayToCartesianArray(this._positions)),this._sampledPosition.forwardExtrapolationType=i.ExtrapolationType.HOLD,this._sampledPosition.setInterpolationOptions({interpolationDegree:2,interpolationAlgorithm:i.HermitePolynomialApproximation}),this._endTime=r[r.length-1],this._actived=!0}},bf=un;var nP={FP:"1",TP:"2",TRACKED:"tracked",FREE:"free"},De=nP;var _n=class{constructor(e){this._viewer=e,this._cache={},this._delegete=new i.CustomDataSource("history-track-layer"),this._viewer.dataSources.add(this._delegete),this._activedTrack=void 0,this._viewOption={},this._stopTime=void 0,this._state=m.INITIALIZED}get delegate(){return this._delegete.entities}get state(){return this._state}_onPostRender(){Object.keys(this._cache).forEach(e=>{let t=this._cache[e];t.trackEvent&&t.trackEvent.fire(oe.POST_RENDER,{viewer:this._viewer,viewOption:this._viewOption})}),this._viewer.scene.requestRender()}addTrack(e){return e&&e.trackEvent&&!this._cache.hasOwnProperty(e.trackId)&&(e.trackEvent.fire(oe.ADD,this),this._cache[e.trackId]=e),this}addTracks(e){return Array.isArray(e)&&e.forEach(t=>{this.addTrack(t)}),this}getTrack(e){let t=this.getTracks().filter(r=>r.id===e);return t&&t.length?t[0]:void 0}removeTrack(e){return e&&e.trackEvent&&this._cache.hasOwnProperty(e.trackId)&&(e.trackEvent.fire(oe.REMOVE,this),delete this._cache[e.trackId]),this}getTracks(){let e=[];return Object.keys(this._cache).forEach(t=>{e.push(this._cache[t])}),e}play(){let e=i.JulianDate.now();return Object.keys(this._cache).forEach(t=>{let r=this._cache[t];r.startTime=e,r.viewed=!1}),this._activedTrack=void 0,this._stopTime=void 0,this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._viewer.on(D.POST_RENDER,this._onPostRender,this),this._state=m.PLAY,this}pause(){return this._stopTime=i.JulianDate.now(),this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.delegate.trackedEntity=void 0,this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._state=m.PAUSE,this}restore(){if(this._state!==m.PAUSE)return this;if(this._stopTime){let e=i.JulianDate.now();Object.keys(this._cache).forEach(t=>{this._cache[t].trackEvent.fire(oe.RESET_TIME_LINE,{stopTime:this._stopTime,duration:i.JulianDate.secondsDifference(e,this._stopTime)})})}return this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._viewer.on(D.POST_RENDER,this._onPostRender,this),this._state=m.PLAY,this}viewTrack(e,t={}){if(!this._cache.hasOwnProperty(e.trackId))throw new Error("TrackController: track does not added ");return this._viewOption=t,this._activedTrack&&(this._activedTrack.viewed=!1),e.viewed=!0,this._activedTrack=e,t.mode===De.FREE&&(this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.delegate.trackedEntity=void 0),this}releaseTrack(e){if(!this._cache.hasOwnProperty(e.trackId))throw new Error("TrackController: track does not added ");return e.viewed&&(e.viewed=!1),this._activedTrack=void 0,this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.delegate.trackedEntity=void 0,this}clear(){return Object.keys(this._cache).forEach(e=>{this.removeTrack(this._cache[e])}),this._activedTrack&&(this._activedTrack.viewed=!1),this._activedTrack=void 0,this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.delegate.trackedEntity=void 0,this}},Af=_n;var lP={clampToGround:!1,clampToTileset:!1,interpolationType:"Linear",interpolationDegree:2,endDelayTime:.5,headingOffset:0},hP={width:2,material:i.Color.ORANGE,clampToGround:!0,depthFailMaterial:i.Color.ORANGE.withAlpha(.8)},fn=class{constructor(e,t,r,s){this._id=C.uuid(),this._bid=void 0,this._positions=y.parsePositions(e),this._duration=t||20,this._callback=r,this._options={...lP,...s},this._controller=void 0,this._sampledPosition=void 0,this._velocityOrientation=void 0,this._viewed=!1,this._delegate=new i.Entity,this._pathPositions=[],this._path=new i.Entity({show:!1,polyline:{positions:new i.CallbackProperty(()=>this._pathPositions,!1)}}),this._positionIndex=0,this._timeLine=[],this._startTime=void 0,this._endTime=void 0,this._trackEvent=new wr,this._trackEvent.on(oe.POST_RENDER,this._onPostRender,this),this._trackEvent.on(oe.ADD,this._onAdd,this),this._trackEvent.on(oe.REMOVE,this._onRemove,this),this._trackEvent.on(oe.RESET_TIME_LINE,this._resetTimeLine,this),this._state=m.INITIALIZED}get currentDistance(){return ie(y.parsePositions(this._pathPositions))}get currentPosition(){let[e]=this._pathPositions.slice(-1);return y.parsePosition(e)}get allDistance(){return ie(this._positions)}get trackId(){return this._id}set id(e){this._bid=e}get id(){return this._bid}set positions(e){this._positions=y.parsePositions(e),this._resetTimeLine({})}get positions(){return this._positions}set duration(e){this._duration=e,this._resetTimeLine({})}get duration(){return this._duration}set startTime(e){e instanceof Date?this._startTime=i.JulianDate.fromDate(e):this._startTime=e,this._resetTimeLine({})}get startTime(){return this._startTime}set viewed(e){this._viewed=e}get viewed(){return this._viewed}get trackEvent(){return this._trackEvent}get state(){return this._state}_onAdd(e){if(!e)return!1;this._controller=e,this._controller.delegate.add(this._delegate),this._controller.delegate.add(this._path),!this._startTime&&(this._startTime=i.JulianDate.now()),this._state=m.ADDED}_onRemove(){if(!this._controller)return!1;this._controller.delegate.remove(this._delegate),this._controller.delegate.remove(this._path),this._viewed=!1,this._startTime=void 0,this._state=m.REMOVED}_onPostRender({viewer:e,viewOption:t}){if(!this._startTime||!this._endTime)return!1;let r=i.JulianDate.now();if(i.JulianDate.lessThanOrEquals(r,this._endTime)){let s=this._sampledPosition.getValue(r);if(!s)return!1;this._pathPositions.push(s),this._options.clampToTileset?this._delegate.position=e.scene.clampToHeight(s,[this._delegate]):this._delegate.position=s;let o=this._velocityOrientation.getValue(r);if(o){let l=i.Quaternion.fromHeadingPitchRoll(new i.HeadingPitchRoll(i.Math.toRadians(this._options.headingOffset||0),0,0),new i.Quaternion);this._delegate.orientation=i.Quaternion.multiply(o,l,new i.Quaternion)}let n=this._timeLine[this._positionIndex];if(n){let l=i.JulianDate.secondsDifference(r,n);if(l>=0&&l<=1){let h=this._positions[this._positionIndex]||void 0;if(h&&o){let c=i.Matrix3.fromQuaternion(o),p=i.Matrix4.fromRotationTranslation(c,s),u=i.Transforms.fixedFrameToHeadingPitchRoll(p);h.heading=i.Math.toDegrees(u.heading),h.pitch=i.Math.toDegrees(u.pitch),h.roll=i.Math.toDegrees(u.roll)}this._callback&&this._callback(h,this._positionIndex+1===this._positions.length),this._positionIndex++,this._options.loop&&this._positionIndex===this._positions.length&&this._restart()}}}this._setCameraView(e,t)}_restart(){this._startTime=i.JulianDate.now(),this._resetTimeLine({})}_setCameraView(e,t){var s,o,n;if(!this._viewed)return!1;let r=i.JulianDate.now();if(i.JulianDate.greaterThan(r,this._endTime))e.camera.lookAtTransform(i.Matrix4.IDENTITY),e.delegate.trackedEntity&&(e.delegate.trackedEntity=void 0),this._viewed=!1;else{let l=this._sampledPosition.getValue(r),h=this._sampledPosition.getValue(i.JulianDate.addSeconds(r,1/60,new i.JulianDate));l&&h&&((t==null?void 0:t.mode)===De.TRACKED&&((o=(s=e.delegate)==null?void 0:s.trackedEntity)==null?void 0:o.id)!==((n=this._delegate)==null?void 0:n.id)?e.delegate.trackedEntity=this._delegate:(t==null?void 0:t.mode)===De.FP?e.camera.lookAt(l,new i.HeadingPitchRange(ve(l,h),i.Math.toRadians((t==null?void 0:t.pitch)||0),(t==null?void 0:t.range)||10)):(t==null?void 0:t.mode)===De.TP&&e.camera.lookAt(l,new i.HeadingPitchRange(0,i.Math.toRadians((t==null?void 0:t.pitch)||-90),(t==null?void 0:t.range)||1e3)))}}_resetTimeLine(e){var r;if(!this._startTime||!this._duration||!((r=this._positions)!=null&&r.length))return!1;let t=0;if(!(e!=null&&e.stopTime)&&!(e!=null&&e.duration)){let s=ie(this._positions)/this._duration;this._timeLine=this._positions.map((o,n,l)=>(n!==0&&(t+=ie([l[n-1],o])/s),i.JulianDate.addSeconds(this._startTime,t,new i.JulianDate))),this._pathPositions=[],this._positionIndex=0}else e!=null&&e.stopTime&&(e!=null&&e.duration)&&(this._duration+=e.duration,this._timeLine=this._timeLine.map(s=>i.JulianDate.addSeconds(s,e.duration,new i.JulianDate)));this._sampledPosition=new i.SampledPositionProperty,this._sampledPosition.addSamples(this._timeLine,f.transformWGS84ArrayToCartesianArray(this._positions)),this._sampledPosition.forwardExtrapolationType=i.ExtrapolationType.HOLD,this._options.interpolationType==="Hermite"?this._sampledPosition.setInterpolationOptions({interpolationDegree:this._options.interpolationDegree||2,interpolationAlgorithm:i.HermitePolynomialApproximation}):this._options.interpolationType==="Linear"?this._sampledPosition.setInterpolationOptions({interpolationDegree:this._options.interpolationDegree||1,interpolationAlgorithm:i.LinearApproximation}):this._options.interpolationType==="Lagrange"&&this._sampledPosition.setInterpolationOptions({interpolationDegree:this._options.interpolationDegree||5,interpolationAlgorithm:i.LagrangePolynomialApproximation}),this._velocityOrientation=new i.VelocityOrientationProperty(this._sampledPosition),this._endTime=i.JulianDate.addSeconds(this._timeLine[this._timeLine.length-1],this._options.endDelayTime,new i.JulianDate)}addPosition(e,t){return this._positions.push(y.parsePosition(e)),this._duration+=t,this._resetTimeLine({}),this}setModel(e,t){return this._delegate.model={...t,uri:e,heightReference:this._options.clampToGround?i.HeightReference.CLAMP_TO_GROUND:i.HeightReference.NONE},this}setBillboard(e,t){return this._delegate.billboard={...t,image:e,heightReference:this._options.clampToGround?i.HeightReference.CLAMP_TO_GROUND:i.HeightReference.NONE},this}setLabel(e,t){return this._delegate.label={...t,text:e,heightReference:this._options.clampToGround?i.HeightReference.CLAMP_TO_GROUND:i.HeightReference.NONE},this}setPath(e,t={}){return this._path.show=!!e,C.merge(this._path.polyline,hP,t),this}},Mf=fn;var cP={ANGLE:"angle",AREA:"area",AREA_HEIGHT:"area_height",AREA_SURFACE:"area_surface",DISTANCE:"distance",DISTANCE_SURFACE:"distance_surface",HEADING:"heading",HEIGHT:"height",TRIANGLE_HEIGHT:"triangle_height"},ne=cP;var gn=class{constructor(e){this._style=e,this._viewer=void 0,this._layer=void 0,this._delegate=void 0,this._options={},this._positions=[]}get drawTool(){return this._viewer.drawTool}_mountedHook(){}_onDrawAnchor(e){}_onAnchorMoving(e){this._positions.pop(),this._positions.push(e),this._options.onCalc&&this._options.onCalc(this._positions)}_onDrawStop(){this._unbindEvent(),this._viewer.drawTool.deactivate(),this._options.onDrawStop&&this._options.onDrawStop(this._delegate)}_bindEvent(){this.drawTool.on(E.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.on(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.on(E.DRAW_STOP,this._onDrawStop,this)}_unbindEvent(){this.drawTool.off(E.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.off(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.off(E.DRAW_STOP,this._onDrawStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.drawTool.activate(t),this._mountedHook(),this._unbindEvent(),this._bindEvent(),this}},zi=gn;var yn=class extends zi{constructor(e){super(e)}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polyline:{...this._style,positions:new i.CallbackProperty(()=>this._positions,!1)}}),this._layer.entities.add(this._delegate)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),t>0&&this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),t>=this._options.maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP,e))}},le=yn;var vn=class{constructor(e){this._viewer=void 0,this._layer=void 0,this._overlay=e,this._delegate=new i.Entity,this._delegate.merge(e),this._options={},this._positions=[]}get editTool(){return this._viewer.editTool}_mountedHook(){}_mountAnchor(){}_onAnchorMoving({pickedAnchor:e,position:t}){}_onEditAnchorStop({pickedAnchor:e,position:t}){}_onEditStop({pickedAnchor:e,position:t}){this._unbindEvent(),this._viewer.editTool.deactivate()}_bindEvent(){return this.editTool.on(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.editTool.on(E.EDIT_ANCHOR_STOP,this._onEditAnchorStop,this),this.editTool.on(E.EDIT_STOP,this._onEditStop,this),this}_unbindEvent(){this.editTool.off(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.editTool.off(E.EDIT_ANCHOR_STOP,this._onEditAnchorStop,this),this.editTool.off(E.EDIT_STOP,this._onEditStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.editTool.activate(t),this._mountedHook(),this._mountAnchor(),this._unbindEvent(),this._bindEvent(),this}},Ni=vn;var wn=class extends Ni{constructor(e){super(e)}_mountedHook(){this.editTool.tooltipMess="\u70B9\u51FB\u951A\u70B9\u79FB\u52A8,\u53F3\u51FB\u7ED3\u675F\u7F16\u8F91",this._delegate.polyline.positions=new i.CallbackProperty(()=>this._positions.length>1?this._positions:null,!1),this._layer.entities.add(this._delegate)}_mountAnchor(){let e=[].concat(this._overlay.polyline.positions.getValue(i.JulianDate.now()));if(this._options.maxAnchorSize>2){for(let t=0;t<e.length-1;t++){let r=z(e[t],e[t+1]);this._positions.push(e[t]),this._positions.push(r)}this._positions.push(e[e.length-1]),this._positions.forEach((t,r)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:t,index:r,isMid:r%2!==0})})}else this._positions=e,this._positions.forEach((t,r)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:t,index:r})});this._layer.entities.remove(this._overlay)}_onEditAnchorStop({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(r.isMid){let o=z(this._positions[s],this._positions[s-1]),n=z(this._positions[s],this._positions[s+1]);this._positions.splice(s,1,o,t,n),this.editTool.fire(E.CLEAR_ANCHOR),this._positions.forEach((l,h)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:l,index:h,isMid:h%2!==0})})}}_onAnchorMoving({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(this._positions[s]=t,!r.isMid&&this._options.maxAnchorSize>2){let o=-1,n=-1,l=-1,h=-1,c=this._positions.length;if(s===0?(l=s+2,h=s+1):r.index===c-1?(o=s-2,n=s-1):(o=s-2,n=s-1,l=s+2,h=s+1),o>0){let p=z(this._positions[o],this._positions[s]);this._positions[n]=p,this.editTool.fire(E.UPDATE_ANCHOR,{index:n,position:p})}if(l>0){let p=z(this._positions[l],this._positions[s]);this._positions[h]=p,this.editTool.fire(E.UPDATE_ANCHOR,{index:h,position:p})}}this._options.onCalc&&this._options.onCalc(this._positions)}},he=wn;var Cn=class{constructor(){this._viewer=void 0,this._layer=void 0,this._startLabel=new i.Entity({label:{text:"\u5F00\u59CB",font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._resultLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._options={}}_getSampledHeight(e,t=!1){let r=this._viewer.terrainProvider&&!(this._viewer.terrainProvider instanceof i.EllipsoidTerrainProvider)?i.sampleTerrainMostDetailed(this._viewer.terrainProvider,e.map(o=>i.Cartographic.fromCartesian(o))):Promise.resolve(e.map(o=>i.Cartographic.fromCartesian(o))),s=this._viewer.scene.clampToHeightSupported&&t?this._viewer.scene.clampToHeightMostDetailed(e,this._layer.entities.values):Promise.resolve(e);return Promise.all([r,s])}_onDrawStop(e){}_onCalc(e){}_startHook(e,t){this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._options.onDrawStop=this._onDrawStop.bind(this),this._options.onCalc=this._onCalc.bind(this),this._layer.entities.add(this._startLabel),this._layer.entities.add(this._resultLabel)}start(e,t){return this}},J=Cn;var xn=class extends J{constructor(){super(),this._maxAnchorSize=2,this._helpLinePositions=[],this._helpLine=new i.Entity({polyline:{positions:new i.CallbackProperty(()=>this._helpLinePositions.length>1?this._helpLinePositions:null,!1)}})}_onDrawStop(e){new he(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){this._resultLabel.position=e[1];let t=i.Ellipsoid.WGS84.geodeticSurfaceNormal(e[0],new i.Cartesian3),r=i.Plane.fromPointNormal(e[0],t);this._helpLinePositions=[e[0],i.Plane.projectPointOntoPlane(r,e[1],new i.Cartesian3),e[1]];let s=Math.abs(i.Plane.getPointDistance(r,e[1]));this._resultLabel.label.text=`\u89D2\u5EA6\uFF1A${i.Math.toDegrees(Math.asin(s/i.Cartesian3.distance(e[0],e[1]))).toFixed(2)} \u5EA6`}}start(e,t){this._startHook(e,t);let r=new i.PolylineDashMaterialProperty({color:i.Color.GREENYELLOW});return this._helpLine.polyline.material=r,this._helpLine.polyline.depthFailMaterial=r,this._layer.entities.add(this._helpLine),new le({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2,clampToGround:!1}).start(e,{...t,maxAnchorSize:this._maxAnchorSize}),this}},If=xn;var Tn=class extends zi{constructor(e){super(e)}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>2?new i.PolygonHierarchy(this._positions.map(e=>e.clone())):null,!1)}}),this._layer.entities.add(this._delegate)}_onDrawAnchor(e){this._positions.push(e),this.drawTool.fire(E.CREATE_ANCHOR,{position:e})}},et=Tn;var En=class extends Ni{constructor(e){super(e)}_mountedHook(){this.editTool.tooltipMess="\u70B9\u51FB\u951A\u70B9\u79FB\u52A8,\u53F3\u51FB\u7ED3\u675F\u7F16\u8F91",this._delegate.polygon.hierarchy=new i.CallbackProperty(e=>this._positions.length>2?new i.PolygonHierarchy(this._positions):null,!1),this._layer.entities.add(this._delegate)}_mountAnchor(){let e=[].concat(this._overlay.polygon.hierarchy.getValue(i.JulianDate.now()).positions);e.push(e[0]);for(let t=0;t<e.length-1;t++){let r=z(e[t],e[t+1]);this._positions.push(e[t]),this._positions.push(r)}this._positions.forEach((t,r)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:t,index:r,isMid:r%2!==0})}),this._layer.entities.remove(this._overlay)}_onEditAnchorStop({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(r.isMid){let o,n,l=this._positions.length;s===l-1?(o=z(this._positions[s],this._positions[s-1]),n=z(this._positions[s],this._positions[0])):(o=z(this._positions[s],this._positions[s-1]),n=z(this._positions[s],this._positions[s+1])),this._positions.splice(s,1,o,t,n),this.editTool.fire(E.CLEAR_ANCHOR),this._positions.forEach((h,c)=>{this.editTool.fire(E.CREATE_ANCHOR,{position:h,index:c,isMid:c%2!==0})})}}_onAnchorMoving({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;this._positions[s]=t;let o=this._positions.length;if(!r.isMid){let n=-1,l=-1,h=-1,c=-1;s===0?(n=o-2,l=o-1,h=s+2,c=s+1):s===o-2?(n=s-2,l=s-1,h=0,c=o-1):(n=s-2,l=s-1,h=s+2,c=s+1);let p=z(this._positions[n],this._positions[s]),u=z(this._positions[h],this._positions[s]);this._positions[l]=p,this._positions[c]=u,this.editTool.fire(E.UPDATE_ANCHOR,{index:l,position:p}),this.editTool.fire(E.UPDATE_ANCHOR,{index:c,position:u})}this._options.onCalc&&this._options.onCalc(this._positions)}},tt=En;var Pn=class extends J{constructor(){super()}_onDrawStop(e){new tt(e).start({viewer:this._viewer,layer:this._layer},this._options)}_onCalc(e){var t;e.length>2&&(this._resultLabel.position=(t=i.BoundingSphere.fromPoints(e))==null?void 0:t.center,this._resultLabel.label.text=`\u9762\u79EF\uFF1A${ge(e).toFixed(2)} \u5E73\u65B9\u7C73`)}start(e,t){return this._startHook(e,t),new et({material:t.material||i.Color.YELLOW.withAlpha(.6),perPositionHeight:!0}).start(e,this._options),this}},Sf=Pn;var bn=class extends J{constructor(){super()}_onDrawStop(e){new tt(e).start({viewer:this._viewer,layer:this._layer},this._options)}_lerp(e,t=4){let r=[];for(let s=0;s<t;++s)for(let o=0;o<t;++o){let n=i.Math.lerp(e.west,e.east,o/(t-1)),l=i.Math.lerp(e.south,e.north,s/(t-1));r.push(i.Cartesian3.fromRadians(n,l))}return r}_onCalc(e){if(e.length>2){let t=this._lerp(i.Rectangle.fromCartesianArray(e),this._options.lerpNum);this._getSampledHeight(t,!0).then(([r,s])=>r.map((o,n)=>({lng:o.longitude,lat:o.latitude,alt:Math.max(o.height||0,s[n]?i.Cartographic.fromCartesian(s[n]).height:0)}))).then(r=>{let s=0,o;r.forEach(n=>{n.alt>s&&(s=n.alt,o=n)}),o&&(this._resultLabel.position=i.Cartesian3.fromRadians(o.lng,o.lat,o.alt),this._resultLabel.label.text=`\u9AD8\u5EA6\uFF1A${s.toFixed(2)} \u7C73`)})}}start(e,t){return this._startHook(e,t),new et({material:t.material||i.Color.YELLOW.withAlpha(.6)}).start(e,this._options),this}},Df=bn;var An=class extends J{constructor(){super()}_lerp(e,t=4){let r=[];for(let s=0;s<t;++s)for(let o=0;o<t;++o){let n=i.Math.lerp(e.west,e.east,o/(t-1)),l=i.Math.lerp(e.south,e.north,s/(t-1));r.push(i.Cartesian3.fromRadians(n,l))}return r}_onDrawStop(e){new tt(e).start({viewer:this._viewer,layer:this._layer},this._options)}_onCalc(e){var t;if(e.length>2){this._resultLabel.position=(t=i.BoundingSphere.fromPoints(e))==null?void 0:t.center;let r=this._lerp(i.Rectangle.fromCartesianArray(e),this._options.lerpNum);this._getSampledHeight(r.concat(e),!1).then(([s])=>s.map(o=>i.Cartesian3.fromDegrees(i.Math.toDegrees(o.longitude),i.Math.toDegrees(o.latitude),o.height))).then(s=>{this._resultLabel.label.text=`\u9762\u79EF\uFF1A${ge(s).toFixed(2)} \u5E73\u65B9\u7C73`})}}start(e,t){return this._startHook(e,t),new et({material:t.material||i.Color.YELLOW.withAlpha(.6)}).start(e,this._options),this}},Lf=An;var Mn=class extends J{constructor(){super(),this._maxAnchorSize=9999}_onDrawStop(e){new he(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){this._resultLabel.position=e[e.length-1];let t=0;for(let r=0;r<e.length-1;r++){let s=i.Cartesian3.distance(e[r],e[r+1]);t+=s}this._resultLabel.label.text=t>1e3?`\u8DDD\u79BB\uFF1A${(t/1e3).toFixed(2)} \u516C\u91CC`:`\u8DDD\u79BB\uFF1A${t.toFixed(2)} \u7C73`}}start(e,t){return this._startHook(e,t),new le({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2,clampToGround:!1}).start(e,{...t,maxAnchorSize:this._maxAnchorSize}),this}},Rf=Mn;var In=class extends J{constructor(){super(),this._maxAnchorSize=9999}_lerp(e,t,r=5){let s=[],o=i.Cartographic.fromCartesian(e),n=i.Cartographic.fromCartesian(t);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),p=o.height-(o.height-n.height)*(l/r);s.push(i.Cartesian3.fromRadians(h,c,p))}return s}_onDrawStop(e){new he(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){let t=[e[0]];this._resultLabel.position=e[e.length-1];for(let r=0;r<e.length-1;r++)t=t.concat(this._lerp(e[r],e[r+1],this._options.lerpNum));t.push(e[e.length-1]),this._getSampledHeight(t).then(([r,s])=>r.map((o,n)=>i.Cartesian3.fromDegrees(i.Math.toDegrees(o.longitude),i.Math.toDegrees(o.latitude),Math.max(o.height||0,s[n]?i.Cartographic.fromCartesian(s[n]).height:0)))).then(r=>{let s=0;for(let o=0;o<r.length-1;o++){let n=i.Cartesian3.distance(r[o],r[o+1]);s+=n}this._resultLabel.label.text=s>1e3?`\u8DDD\u79BB\uFF1A${(s/1e3).toFixed(2)} \u516C\u91CC`:`\u8DDD\u79BB\uFF1A${s.toFixed(2)} \u7C73`})}}start(e,t){return this._startHook(e,t),new le({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2,clampToGround:!0}).start(e,{...this._options,maxAnchorSize:this._maxAnchorSize}),this}},Of=In;var Sn=class extends J{constructor(){super(),this._maxAnchorSize=2}_onDrawStop(e){new he(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){e.length>0&&(this._startLabel.position=e[0]),e.length>1&&(this._resultLabel.position=e[e.length-1],this._resultLabel.label.text=`\u504F\u822A\uFF1A${i.Math.toDegrees(ve(e[0],e[1])).toFixed(1)} \u5EA6`)}start(e,t){return this._startHook(e,t),new le({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2}).start(e,{...this._options,maxAnchorSize:this._maxAnchorSize}),this}},kf=Sn;var Dn=class extends J{constructor(){super(),this._maxAnchorSize=2,this._helpLinePositions=[],this._helpLine=new i.Entity({polyline:{positions:new i.CallbackProperty(()=>this._helpLinePositions.length>1?this._helpLinePositions:null,!1)}})}_onDrawStop(e){new he(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){this._resultLabel.position=e[1];let t=i.Ellipsoid.WGS84.geodeticSurfaceNormal(e[0],new i.Cartesian3),r=i.Plane.fromPointNormal(e[0],t);this._helpLinePositions=[e[0],i.Plane.projectPointOntoPlane(r,e[1],new i.Cartesian3),e[1]];let s=Math.abs(i.Plane.getPointDistance(r,e[1]));this._resultLabel.label.text=`\u9AD8\u5EA6\uFF1A${s.toFixed(2)} \u7C73`}}start(e,t){this._startHook(e,t);let r=new i.PolylineDashMaterialProperty({color:i.Color.GREENYELLOW});return this._helpLine.polyline.material=r,this._helpLine.polyline.depthFailMaterial=r,this._layer.entities.add(this._helpLine),new le({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2}).start(e,{...this._options,maxAnchorSize:this._maxAnchorSize}),this}},Ff=Dn;var Ln=class extends J{constructor(){super(),this._maxAnchorSize=2,this._helpLinePositions=[],this._helpLine=new i.Entity({polyline:{positions:new i.CallbackProperty(()=>this._helpLinePositions.length>1?this._helpLinePositions:null,!1)}}),this._lengthLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._heightLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._distanceLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}})}_onDrawStop(e){new he(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){let t=i.Ellipsoid.WGS84.geodeticSurfaceNormal(e[0],new i.Cartesian3),r=i.Plane.fromPointNormal(e[0],t),s=i.Plane.projectPointOntoPlane(r,e[1],new i.Cartesian3);this._helpLinePositions=[e[0],s,e[1]];let o=i.Cartesian3.distance(e[0],s),n=Math.abs(i.Plane.getPointDistance(r,e[1])),l=i.Cartesian3.distance(e[0],e[1]);this._lengthLabel.position=i.Cartesian3.midpoint(e[0],s,new i.Cartesian3),this._lengthLabel.label.text=o>1e3?`${(o/1e3).toFixed(2)} \u516C\u91CC`:`${o.toFixed(2)} \u7C73`,this._distanceLabel.position=i.Cartesian3.midpoint(e[0],e[1],new i.Cartesian3),this._distanceLabel.label.text=l>1e3?`${(l/1e3).toFixed(2)} \u516C\u91CC`:`${l.toFixed(2)} \u7C73`,this._heightLabel.position=i.Cartesian3.midpoint(s,e[1],new i.Cartesian3),this._heightLabel.label.text=n>1e3?`${(n/1e3).toFixed(2)} \u516C\u91CC`:`${n.toFixed(2)} \u7C73`}}start(e,t){this._startHook(e,t);let r=new i.PolylineDashMaterialProperty({color:i.Color.GREENYELLOW});return this._helpLine.polyline.material=r,this._helpLine.polyline.depthFailMaterial=r,this._layer.entities.add(this._helpLine),this._layer.entities.add(this._lengthLabel),this._layer.entities.add(this._heightLabel),this._layer.entities.add(this._distanceLabel),new le({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2,clampToGround:!1}).start(e,{...t,maxAnchorSize:this._maxAnchorSize}),this}},zf=Ln;var Rn=class{constructor(e){if(!e)throw Error("missing viewer param");this._viewer=e,this._layer=new i.CustomDataSource("measure-layer"),this._viewer.dataSources.add(this._layer)}get viewer(){return this._viewer}get layer(){return this._layer}angle(e={}){return new If().start(this,e),this}area(e={}){return new Sf().start(this,e),this}areaHeight(e={}){return new Df().start(this,e),this}areaSurface(e={}){return new Lf().start(this,e),this}distance(e={}){return new Rf().start(this,e),this}distanceSurface(e={}){return new Of().start(this,e),this}heading(e={}){return new kf().start(this,e),this}height(e={}){return new Ff().start(this,e),this}triangleHeight(e={}){return new zf().start(this,e),this}activate(e,t){switch(e){case ne.ANGLE:this.angle(t);break;case ne.AREA:this.area(t);break;case ne.AREA_HEIGHT:this.areaHeight(t);break;case ne.AREA_SURFACE:this.areaSurface(t);break;case ne.DISTANCE:this.distance(t);break;case ne.DISTANCE_SURFACE:this.distanceSurface(t);break;case ne.HEADING:this.heading(t);break;case ne.HEIGHT:this.height(t);break;case ne.TRIANGLE_HEIGHT:this.triangleHeight(t);break;default:break}return this}deactivate(){return this._layer.entities.removeAll(),this._viewer.drawTool.tooltipMess="",this._viewer.drawTool.deactivate(),this._viewer.editTool.tooltipMess="",this._viewer.editTool.deactivate(),this}},Nf=Rn;var On=class{static pointBuffer(e,t,r=8){var l;let s=q("turf");if(!s)throw"missing turf";let o=s.point(y.parsePointCoordToArray(e)),n=s.buffer(o,t,{units:"meters",steps:r});return((l=n==null?void 0:n.geometry)==null?void 0:l.coordinates[0])||[]}static polylineBuffer(e,t,r=8){var l;let s=q("turf");if(!s)throw"missing turf";let o=s.lineString(y.parsePolylineCoordToArray(e)),n=s.buffer(o,t,{units:"meters",steps:r});return((l=n==null?void 0:n.geometry)==null?void 0:l.coordinates[0])||[]}static polygonBuffer(e,t,r=8){var l;let s=q("turf");if(!s)throw"missing turf";let o=s.polygon(y.parsePolygonCoordToArray(e,!0)),n=s.buffer(o,t,{units:"meters",steps:r});return((l=n==null?void 0:n.geometry)==null?void 0:l.coordinates[0])||[]}static sector(e,t,r,s,o=64){var c;let n=q("turf");if(!n)throw"missing turf";let l=n.point(y.parsePointCoordToArray(e)),h=n.sector(l,t,r,s,{units:"meters",steps:o});return((c=h==null?void 0:h.geometry)==null?void 0:c.coordinates[0])||[]}static transformPolylineScale(e,t){var n;let r=q("turf");if(!r)throw"missing turf";let s=r.lineString(y.parsePolylineCoordToArray(e)),o=r.transformScale(s,t,{units:"meters"});return((n=o==null?void 0:o.geometry)==null?void 0:n.coordinates)||[]}static transformPolygonScale(e,t){var n;let r=q("turf");if(!r)throw"missing turf";let s=r.polygon(y.parsePolygonCoordToArray(e,!0)),o=r.transformScale(s,t,{units:"meters"});return((n=o==null?void 0:o.geometry)==null?void 0:n.coordinates[0])||[]}static transformPolylineRotate(e,t){var n;let r=q("turf");if(!r)throw"missing turf";let s=r.lineString(y.parsePolylineCoordToArray(e)),o=r.transformRotate(s,t);return((n=o==null?void 0:o.geometry)==null?void 0:n.coordinates)||[]}static transformPolygonRotate(e,t){var n;let r=q("turf");if(!r)throw"missing turf";let s=r.polygon(y.parsePolygonCoordToArray(e,!0)),o=r.transformRotate(s,t);return((n=o==null?void 0:o.geometry)==null?void 0:n.coordinates[0])||[]}static polygonEquivalent(e,t,r,s=null){let o=q("turf");if(!o)throw"missing turf";let n=[];for(let p=0,u=e.length;p<u;p++){let g=e[p];n.push({type:"Feature",properties:g,geometry:{type:"Point",coordinates:[g.x,g.y]}})}let l={type:"FeatureCollection",features:n};s&&s!==null&&(l=o.interpolate(l,s.cellSize||10,{gridType:"point",property:r,units:(s==null?void 0:s.units)||"kilometers",weight:(s==null?void 0:s.weight)||1}));let h=o.isobands(l,t,{zProperty:r}),c=o.isolines(l,t,{zProperty:r});return{geojsonPoly:h,geojsonLine:c}}},Hf=On;var pP={SIGHT_LINE:"sightLine",VIEW_SHED:"viewshed"},xt=pP;var dP={PROFILE:"profile"},Hi=dP;var kn=class{constructor(e){this._id=C.uuid(),this._viewer=e,this._delegate=void 0,this._enable=!1,this._color=i.Color.YELLOW,this._width=1,this._spacing=100,this._state=m.INITIALIZED}get type(){return"contourLine"}set enable(e){this._enable=e,e&&this._viewer?this._createAnalysis():(this._delegate&&(this._delegate=null),this._viewer&&(this._viewer.scene.globe.material=null))}get enable(){return this._enable}set color(e){this._color=e,this._delegate&&(this._delegate.uniforms.color=e)}get color(){return this._color}set width(e){this._width=e,this._delegate&&(this._delegate.uniforms.width=e)}get width(){return this._width}set spacing(e){this._spacing=e,this._delegate&&(this._delegate.uniforms.spacing=e)}get spacing(){return this._spacing}_init(e,t,r){this._enable=!0,this._color=e||i.Color.YELLOW,this._width=t||1,this._spacing=r||100,this._enable&&this._viewer&&this._createAnalysis()}deactivate(){this._enable=!1,this._delegate&&(this._delegate=null),this._viewer&&(this._viewer.scene.globe.material=null)}_createAnalysis(){let e=this._viewer.scene.globe,t=i.Material.fromType("ElevationContour"),r=t.uniforms;r.width=this._width,r.spacing=this._spacing,r.color=this._color,e.material=t,this._delegate=t}},Wf=kn;var Fn=class{constructor(e){this._id=C.uuid(),this._viewer=e,this._enable=!1,this._positions=[],this._maxDistance=5,this._speed=1e3,this._maxHeight=20,this._inRangeColor=i.Color.YELLOW,this._outRangeColor=i.Color.WHITE,this._state=m.INITIALIZED}get type(){return"tilesetShake"}set enable(e){this._enable=e,this.tileset_arr.forEach(t=>{let r=null;this._enable?r=this._getShader(t.tileset2):r=new window.GM.CustomShader,t.tileset.setCustomShader(r)})}get enable(){return this._enable}set maxDistance(e){this._maxDistance=e,this._enable&&this._changeSettings()}get maxDistance(){return this._maxDistance}set speed(e){this._speed=e,this._enable&&this._changeSettings()}get speed(){return this._speed}set maxHeight(e){this._maxHeight=e,this._enable&&this._changeSettings()}get maxHeight(){return this._maxHeight}_getShader(e){let t=e.boundingSphere.center.clone(),r=i.Transforms.eastNorthUpToFixedFrame(t),s=i.Matrix4.inverse(r,new i.Matrix4);return new i.CustomShader({uniforms:{M_LocaltoWorld:{type:i.UniformType.MAT4,value:r},M_WorldtoLocal:{type:i.UniformType.MAT4,value:s},center:{type:i.UniformType.VEC3,value:t},MAX_Distance:{type:i.UniformType.FLOAT,value:this._maxDistance},Speed:{type:i.UniformType.FLOAT,value:this._speed},height:{type:i.UniformType.FLOAT,value:this._maxHeight}},vertexShaderText:this._getVs(),fragmentShaderText:this._getFs()})}_changeSettings(){this.tileset_arr.forEach(e=>{let t=this._getShader(e.tileset2);e.tileset.setCustomShader(t)})}_getVs(){return`
1975
+ `;var ba=class{constructor(e){this._id=v.uuid(),this._viewer=e,this._delegate=void 0,this._enable=!1,this._speed=10,this._state=_.INITIALIZED}get type(){return"snow"}set enable(e){this._enable=e,e&&this._viewer&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e)}get enable(){return this._enable}set speed(e){this._speed=e,this._delegate&&(this._delegate.uniforms.speed=e)}get speed(){return this._speed}_createPostProcessStage(){this._delegate=new i.PostProcessStage({name:this._id,fragmentShader:up,uniforms:{speed:this._speed}}),this._viewer.scene.postProcessStages.add(this._delegate)}},_p=ba;var fp="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASg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NS+WtLsHpQBHz6UeWW9Kl2CjFAELRkdaZg1ZIzTNpFAEJWkK1Pg0YYdqAKrCq8lXmBPUVVlX2oAoSVXPWrUq+1ViOaAP/2Q==";var Sa=class{constructor(e){this._id=v.uuid(),this._viewer=e,this._delegate=void 0,this._rotateAmount=0,this._enable=!1,this._heading=0,this._state=_.INITIALIZED}get type(){return"cloud"}set enable(e){!this._viewer.scene.mode!==i.SceneMode.SCENE3D&&(this._delegate||this._createPrimitive(),this._enable=this._delegate.show=e,this._enable?this._viewer.scene.postUpdate.addEventListener(this._onRotate,this):this._viewer.scene.postUpdate.removeEventListener(this._onRotate,this))}get enable(){return this._enable}set rotateAmount(e){this._rotateAmount=e}get rotateAmount(){return this._rotateAmount}_onRotate(e,t){this._rotateAmount!==0&&(this._heading+=this._rotateAmount,(this._heading>=360||this._heading<=-360)&&(this._heading=0),this._delegate.modelMatrix=i.Transforms.headingPitchRollToFixedFrame(new i.Cartesian3,new i.HeadingPitchRoll(i.Math.toRadians(this._heading),0,0)))}_createPrimitive(){this._delegate=new i.Primitive({appearance:new i.EllipsoidSurfaceAppearance({material:new i.Material({fabric:{type:"Image",uniforms:{color:new i.Color(1,1,1,1),image:fp},components:{alpha:"texture(image, fract(repeat * materialInput.st)).r * color.a",diffuse:"vec3(1.0)"}}}),translucent:!0,aboveGround:!0})}),this._delegate.geometryInstances=new i.GeometryInstance({geometry:new i.EllipsoidGeometry({vertexFormat:i.VertexFormat.POSITION_AND_ST,radii:this._viewer.scene.globe.ellipsoid.radii}),id:this._id}),this._delegate.show=this._enable,this._viewer.scene.primitives.add(this._delegate)}},gp=Sa;var yp=`precision highp float; \r
1976
+ uniform float realPlanetRadius; //\u5730\u7403\u534A\u5F84 \r
1977
+ // const float windSpeedRatio = 0.0002;//\u98CE\u901F\r
1978
+ uniform float windSpeedRatio;//\u98CE\u901F\r
1979
+ uniform float cloudCover;//\u4E91\u91CF\r
1980
+ uniform float cloudBase;//\u4E91\u7684\u5E95\u90E8\u9AD8\u5EA6\r
1981
+ uniform float cloudTop;//\u4E91\u7684\u9876\u90E8\u9AD8\u5EA6\r
1982
+ uniform vec3 windVector;//\u65B9\u5411\r
1983
+ uniform float cloudThickness; //\u4E91\u5C42\u539A\u5EA6 \r
1984
+ uniform float cloudBaseRadius;//\u4E91\u5C42\u5E95\u90E8\u534A\u5F84\r
1985
+ uniform float cloudTopRadius; //\u4E91\u5C42\u9876\u90E8\u534A\u5F84 \r
1986
+ \r
1987
+ const float PI = 3.14159265359;\r
1988
+ const float TWO_PI = 6.28318530718;\r
1989
+ const float FOUR_PI = 12.5663706144; \r
1990
+ \r
1991
+ #define CLOUDS_MAX_LOD 1\r
1992
+ #define CLOUDS_MARCH_STEP 500.0 //\u5916\u90E8\u6BCF\u6B21\u6B65\u8FDB\r
1993
+ #define CLOUDS_DENS_MARCH_STEP 100.0 //\u4E91\u5185\u6BCF\u6B21\u6B65\u8FDB\r
1994
+ #define MAXIMUM_CLOUDS_STEPS 300 //\u6700\u5927\u6B65\u8FDB\u6B21\u6570 \r
1995
+ #define CLOUDS_MAX_VIEWING_DISTANCE 250000.0\r
1996
+ \r
1997
+ //\u5C04\u7EBF\u4E0E\u7403\u4F53\u76F8\u4EA4 \u53EF\u53C2\u8003 https://zhuanlan.zhihu.com/p/645281439 \r
1998
+ vec2 raySphereIntersect(vec3 r0, vec3 rd, float sr) {\r
1999
+ float a = dot(rd, rd);\r
2000
+ float b = 2.0 * dot(rd, r0);\r
2001
+ float c = dot(r0, r0) - (sr * sr);\r
2002
+ float d = (b * b) - 4.0 * a * c;\r
2003
+ \r
2004
+ if (d < 0.0) return vec2(-1.0, -1.0);\r
2005
+ float squaredD = sqrt(d);\r
2006
+ \r
2007
+ return vec2(\r
2008
+ (-b - squaredD) / (2.0 * a),\r
2009
+ (-b + squaredD) / (2.0 * a)\r
2010
+ );\r
2011
+ }\r
2012
+ \r
2013
+ \r
2014
+ float saturate (float value) {\r
2015
+ return clamp(value, 0.0, 1.0);\r
2016
+ }\r
2017
+ \r
2018
+ float isotropic() {\r
2019
+ return 0.07957747154594767; //1.0 / (4.0 * PI);\r
2020
+ }\r
2021
+ \r
2022
+ float rayleigh(float costh) {\r
2023
+ return (3.0 / (16.0 * PI)) * (1.0 + pow(costh, 2.0));\r
2024
+ } \r
2025
+ \r
2026
+ float Schlick(float k, float costh) {\r
2027
+ return (1.0 - k * k) / (FOUR_PI * pow(1.0 - k * costh, 2.0));\r
2028
+ } \r
2029
+ float g = 0.9; \r
2030
+ \r
2031
+ float hash(float p) {\r
2032
+ p = fract(p * .1031);\r
2033
+ p *= p + 33.33;\r
2034
+ p *= p + p;\r
2035
+ return fract(p);\r
2036
+ }\r
2037
+ \r
2038
+ //\u566A\u58F0\r
2039
+ float noise(in vec3 x) {\r
2040
+ vec3 p = floor(x);\r
2041
+ vec3 f = fract(x);\r
2042
+ f = f*f*(3.0 - 2.0*f);\r
2043
+ float n = p.x + p.y*157.0 + 113.0*p.z;\r
2044
+ return mix(mix(mix( hash(n+ 0.0), hash(n+ 1.0),f.x),\r
2045
+ mix( hash(n+157.0), hash(n+158.0),f.x),f.y),\r
2046
+ mix(mix( hash(n+113.0), hash(n+114.0),f.x),\r
2047
+ mix(hash(n+270.0), hash(n+271.0),f.x),f.y),f.z);\r
2048
+ }\r
2049
+ \r
2050
+ //\u4E91\u7684\u5BC6\u5EA6\r
2051
+ float cloudDensity(vec3 p, vec3 wind, int lod, inout float heightRatio) {\r
2052
+ float finalCoverage = cloudCover; \r
2053
+ if (finalCoverage <= 0.1) {\r
2054
+ return 0.0;\r
2055
+ }\r
2056
+ float height = length(p) - realPlanetRadius;\r
2057
+ heightRatio = (height - cloudBase) / cloudThickness;\r
2058
+ float positionResolution = 0.002;\r
2059
+ p = p * positionResolution + wind;\r
2060
+ float shape = noise(p * 0.3);\r
2061
+ float shapeHeight = noise(p * 0.05);\r
2062
+ float bn = 0.50000 * noise(p); p = p * 2.0;\r
2063
+ if( lod>=1 ) {\r
2064
+ bn += 0.20000 * noise(p); p = p * 2.11;\r
2065
+ }\r
2066
+ float cumuloNimbus = saturate((shapeHeight - 0.5) * 2.0);\r
2067
+ cumuloNimbus *= saturate(1.0 - pow(heightRatio - 0.5, 2.0) * 4.0);\r
2068
+ float cumulus = saturate(1.0 - pow(heightRatio - 0.25, 2.0) * 25.0) * shapeHeight;\r
2069
+ float stratoCumulus = saturate(1.0 - pow(heightRatio - 0.12, 2.0) * 60.0) * (1.0 - shapeHeight);\r
2070
+ float dens = saturate(stratoCumulus + cumulus + cumuloNimbus) * 2.0 * finalCoverage;\r
2071
+ dens -= 1.0 - shape;\r
2072
+ dens -= bn;\r
2073
+ return clamp(dens, 0.0, 1.0);\r
2074
+ } \r
2075
+ \r
2076
+ precision highp float;\r
2077
+ in vec2 v_textureCoordinates;\r
2078
+ vec3 skyAmbientColor = vec3(0.705, 0.850, 0.952); //0.219, 0.380, 0.541\r
2079
+ vec3 groundAmbientColor = vec3(0.741, 0.898, 0.823); //0.639, 0.858, 0.721\r
2080
+ float distanceQualityR = 0.00005; // LOD/quality ratio\r
2081
+ float minDistance = 10.0; // avoid cloud in cockpit \r
2082
+ \r
2083
+ vec4 calculate_clouds(\r
2084
+ vec3 start,\r
2085
+ vec3 dir,\r
2086
+ float maxDistance,\r
2087
+ vec3 light_dir,\r
2088
+ vec3 wind\r
2089
+ ) {\r
2090
+ vec4 cloud = vec4(0.0, 0.0, 0.0, 1.0);\r
2091
+ vec2 toTop = raySphereIntersect(start, dir, cloudTopRadius);\r
2092
+ vec2 toCloudBase = raySphereIntersect(start, dir, cloudBaseRadius);\r
2093
+ float startHeight = length(start) - realPlanetRadius;\r
2094
+ float absoluteMaxDistance = CLOUDS_MAX_VIEWING_DISTANCE;\r
2095
+ float tmin = minDistance;\r
2096
+ float tmax = maxDistance;\r
2097
+ \r
2098
+ if (startHeight > cloudTop) {\r
2099
+ if (toTop.x < 0.0) return vec4(0.0); // no intersection with cloud layer\r
2100
+ tmin = toTop.x;\r
2101
+ if (toCloudBase.x > 0.0) {\r
2102
+ tmax = min(toCloudBase.x, maxDistance);\r
2103
+ }\r
2104
+ else {\r
2105
+ tmax = min(toTop.y, maxDistance);\r
2106
+ }\r
2107
+ } else if (startHeight < cloudBase) {\r
2108
+ tmin = toCloudBase.y;\r
2109
+ tmax = min(toTop.y, maxDistance);\r
2110
+ } else {\r
2111
+ if (toCloudBase.x > 0.0) {\r
2112
+ tmax = min(toCloudBase.x, maxDistance);\r
2113
+ }\r
2114
+ else {\r
2115
+ tmax = min(toTop.y, maxDistance);\r
2116
+ }\r
2117
+ }\r
2118
+ \r
2119
+ tmin = max(tmin, minDistance);\r
2120
+ tmax = min(tmax, absoluteMaxDistance);\r
2121
+ \r
2122
+ if (tmax < tmin) return vec4(0.0); // object obstruction\r
2123
+ \r
2124
+ float rayLength = tmax - tmin;//\u6B65\u8FDB\u603B\u8DDD\u79BB\r
2125
+ float longMarchStep = rayLength / float(MAXIMUM_CLOUDS_STEPS);//\u6B65\u8FDB\u8DDD\u79BB/\u6B65\u8FDB\u6B21\u6570=\u6BCF\u6B21\u6B65\u8FDB\u7684\u8DDD\u79BB\r
2126
+ longMarchStep = max(longMarchStep, CLOUDS_MARCH_STEP);//\u6BCF\u6B21\u6B65\u8FDB\u591A\u5C11\r
2127
+ \r
2128
+ float shortMarchStep = CLOUDS_DENS_MARCH_STEP;\r
2129
+ float numberApproachSteps = (CLOUDS_MARCH_STEP / CLOUDS_DENS_MARCH_STEP) * 2.0; \r
2130
+ float distance = tmin;//\r
2131
+ float dens = 0.0;\r
2132
+ float marchStep;\r
2133
+ \r
2134
+ float lastDensity; \r
2135
+ float kInScattering = 0.99;\r
2136
+ float dotLightRay = dot(dir, light_dir);\r
2137
+ float inScattering = Schlick(kInScattering, dotLightRay); \r
2138
+ float outScattering = isotropic(); \r
2139
+ float sunScatteringPhase = mix(outScattering, inScattering, dotLightRay);\r
2140
+ float ambientScatteringPhase = isotropic();\r
2141
+ bool inCloud = false; \r
2142
+ float stepsBeforeExitingCloud = 0.0;\r
2143
+ \r
2144
+ for (int i = 0; i < MAXIMUM_CLOUDS_STEPS; i++) {\r
2145
+ vec3 position = start + dir * distance; \r
2146
+ int qualityRatio = int(distance * distanceQualityR);\r
2147
+ int lod = CLOUDS_MAX_LOD - qualityRatio;\r
2148
+ float heightRatio;\r
2149
+ \r
2150
+ if (inCloud == true) {\r
2151
+ marchStep = shortMarchStep;\r
2152
+ } else {\r
2153
+ marchStep = longMarchStep;\r
2154
+ lod = 0;\r
2155
+ }\r
2156
+ \r
2157
+ dens = cloudDensity(position, wind, lod, heightRatio);\r
2158
+ \r
2159
+ if(dens > 0.01) {\r
2160
+ if (inCloud != true) {\r
2161
+ inCloud = true;\r
2162
+ stepsBeforeExitingCloud = numberApproachSteps;\r
2163
+ distance = clamp(distance - CLOUDS_MARCH_STEP, tmin, tmax); // \u7B2C\u4E00\u6B21\u8FDB\u5165\u4E91 \u56DE\u9000\u4E00\u6B65\r
2164
+ continue;\r
2165
+ }\r
2166
+ \r
2167
+ float deltaDens = clamp((dens - lastDensity) * 10.0, -1.0, 1.0);\r
2168
+ float lighting = (abs(deltaDens - dotLightRay) / 2.0) * clamp((heightRatio - 0.02) * 20.0, 0.5, 1.0);\r
2169
+ lastDensity = dens;\r
2170
+ float scatteringCoeff = 0.15 * dens;\r
2171
+ float extinctionCoeff = 0.01 * dens;\r
2172
+ cloud.a *= exp(-extinctionCoeff * marchStep);\r
2173
+ float sunIntensityAtSurface = clamp(0.2 - dens, 0.0, 1.0);\r
2174
+ vec3 sunLight = lighting * czm_lightColor * sunIntensityAtSurface * czm_lightColor.z;\r
2175
+ vec3 ambientSun = czm_lightColor * sunIntensityAtSurface * czm_lightColor.z * isotropic();\r
2176
+ vec3 skyAmbientLight = (skyAmbientColor * czm_lightColor.z + ambientSun);\r
2177
+ vec3 groundAmbientLight = (groundAmbientColor * czm_lightColor.z * 0.5 + ambientSun);\r
2178
+ vec3 ambientLight = mix(groundAmbientLight, skyAmbientLight, heightRatio);\r
2179
+ vec3 stepScattering = scatteringCoeff * marchStep * (sunScatteringPhase * sunLight + ambientScatteringPhase * ambientLight);\r
2180
+ cloud.rgb += cloud.a * stepScattering;\r
2181
+ \r
2182
+ if (cloud.a < 0.01) {\r
2183
+ cloud.a = 0.0;\r
2184
+ break;\r
2185
+ }\r
2186
+ } else {\r
2187
+ if (stepsBeforeExitingCloud > 0.0) {\r
2188
+ stepsBeforeExitingCloud--;\r
2189
+ }\r
2190
+ else {\r
2191
+ inCloud = false;\r
2192
+ }\r
2193
+ }\r
2194
+ \r
2195
+ distance += marchStep;\r
2196
+ \r
2197
+ //\u6B65\u8FDB\u8DDD\u79BB\u8D85\u51FA\u603B\u7684\u8DDD\u79BB \u9000\u51FA\r
2198
+ if (distance > tmax) {\r
2199
+ break; \r
2200
+ }\r
2201
+ } \r
2202
+ cloud.a = (1.0 - cloud.a);\r
2203
+ return cloud;\r
2204
+ }\r
2205
+ \r
2206
+ uniform sampler2D colorTexture; \r
2207
+ void main() {\r
2208
+ vec4 color = texture(colorTexture, v_textureCoordinates); \r
2209
+ vec4 rawDepthColor = texture(czm_globeDepthTexture, v_textureCoordinates);\r
2210
+ float depth = czm_unpackDepth(rawDepthColor);\r
2211
+ if (depth == 0.0) {\r
2212
+ depth = 1.0; \r
2213
+ } \r
2214
+ vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);\r
2215
+ vec4 worldCoordinate = czm_inverseView * positionEC;\r
2216
+ vec3 vWorldPosition = worldCoordinate.xyz / worldCoordinate.w;\r
2217
+ vec3 posToEye = vWorldPosition - czm_viewerPositionWC;\r
2218
+ vec3 direction = normalize(posToEye);\r
2219
+ vec3 lightDirection = normalize(czm_sunPositionWC);\r
2220
+ float distance = length(posToEye);\r
2221
+ \r
2222
+ if (depth == 1.0) {\r
2223
+ distance = CLOUDS_MAX_VIEWING_DISTANCE;\r
2224
+ }\r
2225
+ vec3 wind = windVector * czm_frameNumber * windSpeedRatio; \r
2226
+ vec4 clouds = calculate_clouds(\r
2227
+ czm_viewerPositionWC, // the position of the camera\r
2228
+ direction, // the camera vector (ray direction of this pixel)\r
2229
+ distance, // max dist, essentially the scene depth\r
2230
+ lightDirection, // light direction\r
2231
+ wind\r
2232
+ );\r
2233
+ clouds.rgb *= 3.0;\r
2234
+ color = mix(color, clouds, clouds.a * clouds.a ); \r
2235
+ \r
2236
+ float exposure = 1.2;\r
2237
+ color = vec4(1.0 - exp(-exposure * color)); \r
2238
+ out_FragColor = color;\r
2239
+ }`;var Aa=class{constructor(e){this._id=v.uuid(),this._viewer=e,this._delegate=void 0,this._enable=!1,this._realPlanetRadius=6378137,this._windSpeedRatio=2e-4,this._cloudCover=.45,this._cloudBase=6190,this._cloudTop=10190,this._cloudThickness=4e3,this._cloudBaseRadius=6380137,this._cloudTopRadius=6384137,this._currentWindVectorWC=new i.Cartesian3(100,0,0),this._state=_.INITIALIZED}get type(){return"density_cloud"}set enable(e){this._enable=e,e&&this._viewer&&!this._delegate&&this._createPostProcessStage(),this._delegate&&(this._delegate.enabled=e)}get enable(){return this._enable}set windSpeedRatio(e){this._windSpeedRatio=e,this._delegate&&(this._delegate.uniforms.windSpeedRatio=e)}get windSpeedRatio(){return this._windSpeedRatio}set cloudCover(e){this._cloudCover=e,this._delegate&&(this._delegate.uniforms.cloudCover=e)}get cloudCover(){return this._cloudCover}set cloudBase(e){this._cloudBase=e,this._cloudThickness=this._cloudTop-e,this._delegate&&(this._delegate.uniforms.cloudBase=e),this._delegate&&(this._delegate.uniforms.cloudThickness=this._cloudThickness)}get cloudBase(){return this._cloudBase}set cloudTop(e){this._cloudTop=e,this._cloudThickness=e-this._cloudBase,this._delegate&&(this._delegate.uniforms.cloudTop=e),this._delegate&&(this._delegate.uniforms.cloudThickness=this._cloudThickness)}get cloudTop(){return this._cloudTop}set windVector(e){this._currentWindVectorWC=e,this._delegate&&(this._delegate.uniforms.windVector=e)}get windVector(){return this._currentWindVectorWC}_createPostProcessStage(){this._delegate=new i.PostProcessStage({name:this._id,fragmentShader:yp,uniforms:{realPlanetRadius:this._realPlanetRadius,windSpeedRatio:this._windSpeedRatio,windVector:this._currentWindVectorWC,cloudCover:this._cloudCover,cloudBase:this._cloudBase,cloudTop:this._cloudTop,cloudThickness:this._cloudThickness,cloudBaseRadius:this._cloudBaseRadius,cloudTopRadius:this._cloudTopRadius}});let e=setInterval(()=>{viewer.scene.context._us&&viewer.scene.context._us.globeDepthTexture&&(this._viewer.scene.postProcessStages.add(this._delegate),clearInterval(e),this._updateCloudUniforms())},200)}_updateCloudUniforms(){var l;if(!((l=viewer.scene.context._us)!=null&&l.globeDepthTexture))return;let e=viewer.camera.positionCartographic,t=viewer.scene.globe.ellipsoid.cartographicToCartesian(new i.Cartographic(e.longitude,e.latitude,0)),r=i.Cartesian3.magnitude(t),s=this._cloudTop-this._cloudBase,o=r+this._cloudBase,n=o+s;Object.assign(this._delegate.uniforms,{realPlanetRadius:r,cloudThickness:s,cloudBaseRadius:o,cloudTopRadius:n})}},vp=Aa;var Ma=class{constructor(e){if(!e)throw Error("missing viewer param");this._fog=new hp(e),this._highFog=new dp(e),this._rain=new mp(e),this._snow=new _p(e),this._cloud=new gp(e),this._densityCloud=new vp(e)}get fog(){return this._fog}get highFog(){return this._highFog}get rain(){return this._rain}get snow(){return this._snow}get cloud(){return this._cloud}get densityCloud(){return this._densityCloud}},tf=Ma;var Ia=class{constructor(e){this._viewer=e,this._enable=!1,this._moveRate=100,this._rotateRate=.01,this._flags={moveForward:!1,moveBackward:!1,moveUp:!1,moveDown:!1,moveLeft:!1,moveRight:!1,turnLeft:!1,turnRight:!1}}set enable(e){this._enable!==e&&this._viewer.scene.mode===i.SceneMode.SCENE3D&&(this._enable=e,this._enable?this._bindEvent():this._unbindEvent())}get enable(){return this._enable}set moveRate(e){this._moveRate=e}get moveRate(){return this._moveRate}set rotateRate(e){this._rotateRate=e}get rotateRate(){return this._rotateRate}_bindEvent(){let e=this._viewer.scene.canvas;e.setAttribute("tabindex","0"),e.addEventListener("click",this._onClick.bind(this),!1),this._viewer.clock.onTick.addEventListener(this._onTick,this),document.addEventListener("keydown",this._onKeydown.bind(this),!1),document.addEventListener("keyup",this._onKeyup.bind(this),!1)}_unbindEvent(){Object.keys(this._flags).forEach(t=>{this._flags[t]=!1});let e=this._viewer.scene.canvas;e.removeAttribute("tabindex"),e.removeEventListener("click",this._onClick,!1),this._viewer.clock.onTick.removeEventListener(this._onTick,this),document.removeEventListener("keydown",this._onKeydown,!1),document.removeEventListener("keyup",this._onKeyup,!1)}_getFlagForKeyCode(e){let t;switch(e.keyCode){case 87:case 38:e.shiftKey?t="moveUp":t="moveForward";break;case 83:case 40:e.shiftKey?t="moveDown":t="moveBackward";break;case 65:case 37:t="moveLeft";break;case 68:case 39:t="moveRight";break;case 81:t="turnLeft";break;case 69:t="turnRight";break;default:break}return t}_onClick(){this._viewer.scene.canvas.focus()}_onKeydown(e){let t=this._getFlagForKeyCode(e);t&&(this._flags[t]=!0)}_onKeyup(e){Object.keys(this._flags).forEach(t=>{this._flags[t]=!1})}_onTick(){let e=this._viewer.scene.camera,r=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(e.position).height/this._moveRate,s=i.Cartesian3.clone(e.position,new i.Cartesian3);this._flags.moveForward&&e.moveForward(r),this._flags.moveBackward&&e.moveBackward(r),this._flags.moveUp&&e.moveUp(r),this._flags.moveDown&&e.moveDown(r),this._flags.moveLeft&&e.moveLeft(r),this._flags.moveRight&&e.moveRight(r),this._flags.turnLeft&&e.rotate(s,-this._rotateRate),this._flags.turnRight&&e.rotate(s,this._rotateRate)}},wp=Ia;var La=class{constructor(e){this._viewer=e,this._viewOption={},this._cache={},this._activedPath=void 0}_onPostRender(){if(!this._activedPath)return!1;this._activedPath.pathEvent&&this._activedPath.pathEvent.fire(he.POST_RENDER,{viewer:this._viewer,viewOption:this._viewOption})}addPath(e){return e&&!this._cache.hasOwnProperty(e.pathId)&&(e.pathEvent.fire(he.ADD),this._cache[e.pathId]=e),this}addPaths(e){return Array.isArray(e)&&e.forEach(t=>{this.addPath(t)}),this}removePath(e){return e&&this._cache.hasOwnProperty(e.pathId)&&(delete this._cache[e.pathId],e.pathEvent.fire(he.REMOVE)),this}getPath(e){let t=this.getPaths().filter(r=>r.id===e);return t&&t.length?t[0]:void 0}getPaths(){let e=[];return Object.keys(this._cache).forEach(t=>{e.push(this._cache[t])}),e}activate(e,t={}){var r;return!e||(e==null?void 0:e.pathId)===((r=this._activedPath)==null?void 0:r.pathId)||!this._cache.hasOwnProperty(e==null?void 0:e.pathId)?this:(this._viewOption=t,this._activedPath&&this.deactivate(),this._activedPath=e,this._activedPath.pathEvent&&this._activedPath.pathEvent.fire(he.RESET_TIME_LINE),this._viewer.on(D.POST_RENDER,this._onPostRender,this),this)}deactivate(){return this._activedPath&&(this._activedPath.actived=!1),this._activedPath=void 0,this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this}clear(){return this._cache={},this._activedPath&&(this._activedPath.actived=!1),this._activedPath=void 0,this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this}},Cp=La;var Da=class{constructor(e,t,r,s){this._id=v.uuid(),this._bid=void 0,this._positions=y.parsePositions(e),this._duration=t||20,this._pathMode=r||"speed",this._timeLine=[],this._sampledPosition=void 0,this._actived=!1,this._endTime=i.JulianDate.now(),this._pathEvent=new tr,this._pathEvent.on(he.ADD,this._onAdd,this),this._pathEvent.on(he.REMOVE,this._onRemove,this),this._pathEvent.on(he.POST_RENDER,this._onPostRender,this),this._pathEvent.on(he.RESET_TIME_LINE,this._resetTimeLine,this),this._callback=s,this._state=_.INITIALIZED}get pathId(){return this._id}set id(e){this._bid=e}get id(){return this._bid}set positions(e){this._positions=y.parsePositions(e)}get positions(){return this._positions}set duration(e){this._duration=e}get duration(){return this._duration}set pathMode(e){this._pathMode=e}get pathMode(){return this._pathMode}get pathEvent(){return this._pathEvent}set actived(e){this._actived=e}get actived(){return this._actived}get state(){return this._state}_onAdd(){this._state=_.ADDED}_onRemove(){this._state=_.REMOVED}_onPostRender({viewer:e,viewOption:t}){if(!this.actived)return!1;let r=i.JulianDate.now();if(i.JulianDate.lessThan(r,this._endTime)&&this._sampledPosition){let s=this._sampledPosition.getValue(r),o=this._sampledPosition.getValue(i.JulianDate.addSeconds(r,.001,new i.JulianDate));s&&o&&e.camera.lookAt(s,new i.HeadingPitchRange(we(s,o)+((t==null?void 0:t.heading)||0),i.Math.toRadians((t==null?void 0:t.pitch)||-20),(t==null?void 0:t.range)||2e3))}else e.camera.lookAtTransform(i.Matrix4.IDENTITY),this._actived=!1,this._callback&&this._callback(!0)}_resetTimeLine(){if(!this._positions||!this._positions.length)return!1;let e=i.JulianDate.now(),t=0,r=[];if(this._pathMode==="speed"){let s=te(this._positions)/this._duration;r=this._positions.map((o,n,l)=>(n!==0&&(t+=te([l[n-1],o])/s),i.JulianDate.addSeconds(e,t,new i.JulianDate)))}else{let s=this._positions.length,o=(this._duration-this._duration%s)/s;r=this._positions.map((n,l)=>i.JulianDate.addSeconds(e,l*o,new i.JulianDate))}this._sampledPosition=new i.SampledPositionProperty,this._sampledPosition.addSamples(r,g.transformWGS84ArrayToCartesianArray(this._positions)),this._sampledPosition.forwardExtrapolationType=i.ExtrapolationType.HOLD,this._sampledPosition.setInterpolationOptions({interpolationDegree:2,interpolationAlgorithm:i.HermitePolynomialApproximation}),this._endTime=r[r.length-1],this._actived=!0}},xp=Da;var rf={FP:"1",TP:"2",TRACKED:"tracked",FREE:"free"},De=rf;var Ra=class{constructor(e){this._viewer=e,this._cache={},this._delegete=new i.CustomDataSource("history-track-layer"),this._viewer.dataSources.add(this._delegete),this._activedTrack=void 0,this._viewOption={},this._stopTime=void 0,this._state=_.INITIALIZED}get delegate(){return this._delegete.entities}get state(){return this._state}_onPostRender(){Object.keys(this._cache).forEach(e=>{let t=this._cache[e];t.trackEvent&&t.trackEvent.fire(le.POST_RENDER,{viewer:this._viewer,viewOption:this._viewOption})}),this._viewer.scene.requestRender()}addTrack(e){return e&&e.trackEvent&&!this._cache.hasOwnProperty(e.trackId)&&(e.trackEvent.fire(le.ADD,this),this._cache[e.trackId]=e),this}addTracks(e){return Array.isArray(e)&&e.forEach(t=>{this.addTrack(t)}),this}getTrack(e){let t=this.getTracks().filter(r=>r.id===e);return t&&t.length?t[0]:void 0}removeTrack(e){return e&&e.trackEvent&&this._cache.hasOwnProperty(e.trackId)&&(e.trackEvent.fire(le.REMOVE,this),delete this._cache[e.trackId]),this}getTracks(){let e=[];return Object.keys(this._cache).forEach(t=>{e.push(this._cache[t])}),e}play(){let e=i.JulianDate.now();return Object.keys(this._cache).forEach(t=>{let r=this._cache[t];r.startTime=e,r.viewed=!1}),this._activedTrack=void 0,this._stopTime=void 0,this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._viewer.on(D.POST_RENDER,this._onPostRender,this),this._state=_.PLAY,this}pause(){return this._stopTime=i.JulianDate.now(),this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.delegate.trackedEntity=void 0,this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._state=_.PAUSE,this}restore(){if(this._state!==_.PAUSE)return this;if(this._stopTime){let e=i.JulianDate.now();Object.keys(this._cache).forEach(t=>{this._cache[t].trackEvent.fire(le.RESET_TIME_LINE,{stopTime:this._stopTime,duration:i.JulianDate.secondsDifference(e,this._stopTime)})})}return this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._viewer.on(D.POST_RENDER,this._onPostRender,this),this._state=_.PLAY,this}viewTrack(e,t={}){if(!this._cache.hasOwnProperty(e.trackId))throw new Error("TrackController: track does not added ");return this._viewOption=t,this._activedTrack&&(this._activedTrack.viewed=!1),e.viewed=!0,this._activedTrack=e,t.mode===De.FREE&&(this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.delegate.trackedEntity=void 0),this}releaseTrack(e){if(!this._cache.hasOwnProperty(e.trackId))throw new Error("TrackController: track does not added ");return e.viewed&&(e.viewed=!1),this._activedTrack=void 0,this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.delegate.trackedEntity=void 0,this}clear(){return Object.keys(this._cache).forEach(e=>{this.removeTrack(this._cache[e])}),this._activedTrack&&(this._activedTrack.viewed=!1),this._activedTrack=void 0,this._viewer.off(D.POST_RENDER,this._onPostRender,this),this._viewer.camera.lookAtTransform(i.Matrix4.IDENTITY),this._viewer.delegate.trackedEntity=void 0,this}},Tp=Ra;var sf={clampToGround:!1,clampToTileset:!1,interpolationType:"Linear",interpolationDegree:2,endDelayTime:.5,headingOffset:0},of={width:2,material:i.Color.ORANGE,clampToGround:!0,depthFailMaterial:i.Color.ORANGE.withAlpha(.8)},Oa=class{constructor(e,t,r,s){this._id=v.uuid(),this._bid=void 0,this._positions=y.parsePositions(e),this._duration=t||20,this._callback=r,this._options={...sf,...s},this._controller=void 0,this._sampledPosition=void 0,this._velocityOrientation=void 0,this._viewed=!1,this._delegate=new i.Entity,this._pathPositions=[],this._path=new i.Entity({show:!1,polyline:{positions:new i.CallbackProperty(()=>this._pathPositions,!1)}}),this._positionIndex=0,this._timeLine=[],this._startTime=void 0,this._endTime=void 0,this._trackEvent=new Qi,this._trackEvent.on(le.POST_RENDER,this._onPostRender,this),this._trackEvent.on(le.ADD,this._onAdd,this),this._trackEvent.on(le.REMOVE,this._onRemove,this),this._trackEvent.on(le.RESET_TIME_LINE,this._resetTimeLine,this),this._state=_.INITIALIZED}get currentDistance(){return te(y.parsePositions(this._pathPositions))}get currentPosition(){let[e]=this._pathPositions.slice(-1);return y.parsePosition(e)}get allDistance(){return te(this._positions)}get trackId(){return this._id}set id(e){this._bid=e}get id(){return this._bid}set positions(e){this._positions=y.parsePositions(e),this._resetTimeLine({})}get positions(){return this._positions}set duration(e){this._duration=e,this._resetTimeLine({})}get duration(){return this._duration}set startTime(e){e instanceof Date?this._startTime=i.JulianDate.fromDate(e):this._startTime=e,this._resetTimeLine({})}get startTime(){return this._startTime}set viewed(e){this._viewed=e}get viewed(){return this._viewed}get trackEvent(){return this._trackEvent}get state(){return this._state}_onAdd(e){if(!e)return!1;this._controller=e,this._controller.delegate.add(this._delegate),this._controller.delegate.add(this._path),!this._startTime&&(this._startTime=i.JulianDate.now()),this._state=_.ADDED}_onRemove(){if(!this._controller)return!1;this._controller.delegate.remove(this._delegate),this._controller.delegate.remove(this._path),this._viewed=!1,this._startTime=void 0,this._state=_.REMOVED}_onPostRender({viewer:e,viewOption:t}){if(!this._startTime||!this._endTime)return!1;let r=i.JulianDate.now();if(i.JulianDate.lessThanOrEquals(r,this._endTime)){let s=this._sampledPosition.getValue(r);if(!s)return!1;this._pathPositions.push(s),this._options.clampToTileset?this._delegate.position=e.scene.clampToHeight(s,[this._delegate]):this._delegate.position=s;let o=this._velocityOrientation.getValue(r);if(o){let l=i.Quaternion.fromHeadingPitchRoll(new i.HeadingPitchRoll(i.Math.toRadians(this._options.headingOffset||0),0,0),new i.Quaternion);this._delegate.orientation=i.Quaternion.multiply(o,l,new i.Quaternion)}let n=this._timeLine[this._positionIndex];if(n){let l=i.JulianDate.secondsDifference(r,n);if(l>=0&&l<=1){let h=this._positions[this._positionIndex]||void 0;if(h&&o){let c=i.Matrix3.fromQuaternion(o),d=i.Matrix4.fromRotationTranslation(c,s),m=i.Transforms.fixedFrameToHeadingPitchRoll(d);h.heading=i.Math.toDegrees(m.heading),h.pitch=i.Math.toDegrees(m.pitch),h.roll=i.Math.toDegrees(m.roll)}this._callback&&this._callback(h,this._positionIndex+1===this._positions.length),this._positionIndex++,this._options.loop&&this._positionIndex===this._positions.length&&this._restart()}}}this._setCameraView(e,t)}_restart(){this._startTime=i.JulianDate.now(),this._resetTimeLine({})}_setCameraView(e,t){var s,o,n;if(!this._viewed)return!1;let r=i.JulianDate.now();if(i.JulianDate.greaterThan(r,this._endTime))e.camera.lookAtTransform(i.Matrix4.IDENTITY),e.delegate.trackedEntity&&(e.delegate.trackedEntity=void 0),this._viewed=!1;else{let l=this._sampledPosition.getValue(r),h=this._sampledPosition.getValue(i.JulianDate.addSeconds(r,1/60,new i.JulianDate));l&&h&&((t==null?void 0:t.mode)===De.TRACKED&&((o=(s=e.delegate)==null?void 0:s.trackedEntity)==null?void 0:o.id)!==((n=this._delegate)==null?void 0:n.id)?e.delegate.trackedEntity=this._delegate:(t==null?void 0:t.mode)===De.FP?e.camera.lookAt(l,new i.HeadingPitchRange(we(l,h),i.Math.toRadians((t==null?void 0:t.pitch)||0),(t==null?void 0:t.range)||10)):(t==null?void 0:t.mode)===De.TP&&e.camera.lookAt(l,new i.HeadingPitchRange(0,i.Math.toRadians((t==null?void 0:t.pitch)||-90),(t==null?void 0:t.range)||1e3)))}}_resetTimeLine(e){var r;if(!this._startTime||!this._duration||!((r=this._positions)!=null&&r.length))return!1;let t=0;if(!(e!=null&&e.stopTime)&&!(e!=null&&e.duration)){let s=te(this._positions)/this._duration;this._timeLine=this._positions.map((o,n,l)=>(n!==0&&(t+=te([l[n-1],o])/s),i.JulianDate.addSeconds(this._startTime,t,new i.JulianDate))),this._pathPositions=[],this._positionIndex=0}else e!=null&&e.stopTime&&(e!=null&&e.duration)&&(this._duration+=e.duration,this._timeLine=this._timeLine.map(s=>i.JulianDate.addSeconds(s,e.duration,new i.JulianDate)));this._sampledPosition=new i.SampledPositionProperty,this._sampledPosition.addSamples(this._timeLine,g.transformWGS84ArrayToCartesianArray(this._positions)),this._sampledPosition.forwardExtrapolationType=i.ExtrapolationType.HOLD,this._options.interpolationType==="Hermite"?this._sampledPosition.setInterpolationOptions({interpolationDegree:this._options.interpolationDegree||2,interpolationAlgorithm:i.HermitePolynomialApproximation}):this._options.interpolationType==="Linear"?this._sampledPosition.setInterpolationOptions({interpolationDegree:this._options.interpolationDegree||1,interpolationAlgorithm:i.LinearApproximation}):this._options.interpolationType==="Lagrange"&&this._sampledPosition.setInterpolationOptions({interpolationDegree:this._options.interpolationDegree||5,interpolationAlgorithm:i.LagrangePolynomialApproximation}),this._velocityOrientation=new i.VelocityOrientationProperty(this._sampledPosition),this._endTime=i.JulianDate.addSeconds(this._timeLine[this._timeLine.length-1],this._options.endDelayTime,new i.JulianDate)}addPosition(e,t){return this._positions.push(y.parsePosition(e)),this._duration+=t,this._resetTimeLine({}),this}setModel(e,t){return this._delegate.model={...t,uri:e,heightReference:this._options.clampToGround?i.HeightReference.CLAMP_TO_GROUND:i.HeightReference.NONE},this}setBillboard(e,t){return this._delegate.billboard={...t,image:e,heightReference:this._options.clampToGround?i.HeightReference.CLAMP_TO_GROUND:i.HeightReference.NONE},this}setLabel(e,t){return this._delegate.label={...t,text:e,heightReference:this._options.clampToGround?i.HeightReference.CLAMP_TO_GROUND:i.HeightReference.NONE},this}setPath(e,t={}){return this._path.show=!!e,v.merge(this._path.polyline,of,t),this}},Ep=Oa;var af={ANGLE:"angle",AREA:"area",AREA_HEIGHT:"area_height",AREA_SURFACE:"area_surface",DISTANCE:"distance",DISTANCE_SURFACE:"distance_surface",HEADING:"heading",HEIGHT:"height",TRIANGLE_HEIGHT:"triangle_height"},ce=af;var ka=class{constructor(e){this._style=e,this._viewer=void 0,this._layer=void 0,this._delegate=void 0,this._options={},this._positions=[]}get drawTool(){return this._viewer.drawTool}_mountedHook(){}_onDrawAnchor(e){}_onAnchorMoving(e){this._positions.pop(),this._positions.push(e),this._options.onCalc&&this._options.onCalc(this._positions)}_onDrawStop(){this._unbindEvent(),this._viewer.drawTool.deactivate(),this._options.onDrawStop&&this._options.onDrawStop(this._delegate)}_bindEvent(){this.drawTool.on(P.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.on(P.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.on(P.DRAW_STOP,this._onDrawStop,this)}_unbindEvent(){this.drawTool.off(P.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.off(P.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.off(P.DRAW_STOP,this._onDrawStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.drawTool.activate(t),this._mountedHook(),this._unbindEvent(),this._bindEvent(),this}},di=ka;var Na=class extends di{constructor(e){super(e)}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polyline:{...this._style,positions:new i.CallbackProperty(()=>this._positions,!1)}}),this._layer.entities.add(this._delegate)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),t>0&&this.drawTool.fire(P.CREATE_ANCHOR,{position:e}),t>=this._options.maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(P.DRAW_STOP,e))}},de=Na;var Fa=class{constructor(e){this._viewer=void 0,this._layer=void 0,this._overlay=e,this._delegate=new i.Entity,this._delegate.merge(e),this._options={},this._positions=[]}get editTool(){return this._viewer.editTool}_mountedHook(){}_mountAnchor(){}_onAnchorMoving({pickedAnchor:e,position:t}){}_onEditAnchorStop({pickedAnchor:e,position:t}){}_onEditStop({pickedAnchor:e,position:t}){this._unbindEvent(),this._viewer.editTool.deactivate()}_bindEvent(){return this.editTool.on(P.ANCHOR_MOVING,this._onAnchorMoving,this),this.editTool.on(P.EDIT_ANCHOR_STOP,this._onEditAnchorStop,this),this.editTool.on(P.EDIT_STOP,this._onEditStop,this),this}_unbindEvent(){this.editTool.off(P.ANCHOR_MOVING,this._onAnchorMoving,this),this.editTool.off(P.EDIT_ANCHOR_STOP,this._onEditAnchorStop,this),this.editTool.off(P.EDIT_STOP,this._onEditStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.editTool.activate(t),this._mountedHook(),this._mountAnchor(),this._unbindEvent(),this._bindEvent(),this}},pi=Fa;var Ha=class extends pi{constructor(e){super(e)}_mountedHook(){this.editTool.tooltipMess="\u70B9\u51FB\u951A\u70B9\u79FB\u52A8,\u53F3\u51FB\u7ED3\u675F\u7F16\u8F91",this._delegate.polyline.positions=new i.CallbackProperty(()=>this._positions.length>1?this._positions:null,!1),this._layer.entities.add(this._delegate)}_mountAnchor(){let e=[].concat(this._overlay.polyline.positions.getValue(i.JulianDate.now()));if(this._options.maxAnchorSize>2){for(let t=0;t<e.length-1;t++){let r=G(e[t],e[t+1]);this._positions.push(e[t]),this._positions.push(r)}this._positions.push(e[e.length-1]),this._positions.forEach((t,r)=>{this.editTool.fire(P.CREATE_ANCHOR,{position:t,index:r,isMid:r%2!==0})})}else this._positions=e,this._positions.forEach((t,r)=>{this.editTool.fire(P.CREATE_ANCHOR,{position:t,index:r})});this._layer.entities.remove(this._overlay)}_onEditAnchorStop({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(r.isMid){let o=G(this._positions[s],this._positions[s-1]),n=G(this._positions[s],this._positions[s+1]);this._positions.splice(s,1,o,t,n),this.editTool.fire(P.CLEAR_ANCHOR),this._positions.forEach((l,h)=>{this.editTool.fire(P.CREATE_ANCHOR,{position:l,index:h,isMid:h%2!==0})})}}_onAnchorMoving({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(this._positions[s]=t,!r.isMid&&this._options.maxAnchorSize>2){let o=-1,n=-1,l=-1,h=-1,c=this._positions.length;if(s===0?(l=s+2,h=s+1):r.index===c-1?(o=s-2,n=s-1):(o=s-2,n=s-1,l=s+2,h=s+1),o>0){let d=G(this._positions[o],this._positions[s]);this._positions[n]=d,this.editTool.fire(P.UPDATE_ANCHOR,{index:n,position:d})}if(l>0){let d=G(this._positions[l],this._positions[s]);this._positions[h]=d,this.editTool.fire(P.UPDATE_ANCHOR,{index:h,position:d})}}this._options.onCalc&&this._options.onCalc(this._positions)}},pe=Ha;var za=class{constructor(){this._viewer=void 0,this._layer=void 0,this._startLabel=new i.Entity({label:{text:"\u5F00\u59CB",font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._resultLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._options={}}_getSampledHeight(e,t=!1){let r=this._viewer.terrainProvider&&!(this._viewer.terrainProvider instanceof i.EllipsoidTerrainProvider)?i.sampleTerrainMostDetailed(this._viewer.terrainProvider,e.map(o=>i.Cartographic.fromCartesian(o))):Promise.resolve(e.map(o=>i.Cartographic.fromCartesian(o))),s=this._viewer.scene.clampToHeightSupported&&t?this._viewer.scene.clampToHeightMostDetailed(e,this._layer.entities.values):Promise.resolve(e);return Promise.all([r,s])}_onDrawStop(e){}_onCalc(e){}_startHook(e,t){this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._options.onDrawStop=this._onDrawStop.bind(this),this._options.onCalc=this._onCalc.bind(this),this._layer.entities.add(this._startLabel),this._layer.entities.add(this._resultLabel)}start(e,t){return this}},X=za;var Wa=class extends X{constructor(){super(),this._maxAnchorSize=2,this._helpLinePositions=[],this._helpLine=new i.Entity({polyline:{positions:new i.CallbackProperty(()=>this._helpLinePositions.length>1?this._helpLinePositions:null,!1)}})}_onDrawStop(e){new pe(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){this._resultLabel.position=e[1];let t=i.Ellipsoid.WGS84.geodeticSurfaceNormal(e[0],new i.Cartesian3),r=i.Plane.fromPointNormal(e[0],t);this._helpLinePositions=[e[0],i.Plane.projectPointOntoPlane(r,e[1],new i.Cartesian3),e[1]];let s=Math.abs(i.Plane.getPointDistance(r,e[1]));this._resultLabel.label.text=`\u89D2\u5EA6\uFF1A${i.Math.toDegrees(Math.asin(s/i.Cartesian3.distance(e[0],e[1]))).toFixed(2)} \u5EA6`}}start(e,t){this._startHook(e,t);let r=new i.PolylineDashMaterialProperty({color:i.Color.GREENYELLOW});return this._helpLine.polyline.material=r,this._helpLine.polyline.depthFailMaterial=r,this._layer.entities.add(this._helpLine),new de({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2,clampToGround:!1}).start(e,{...t,maxAnchorSize:this._maxAnchorSize}),this}},Pp=Wa;var Ga=class extends di{constructor(e){super(e)}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polygon:{...this._style,hierarchy:new i.CallbackProperty(()=>this._positions.length>2?new i.PolygonHierarchy(this._positions.map(e=>e.clone())):null,!1)}}),this._layer.entities.add(this._delegate)}_onDrawAnchor(e){this._positions.push(e),this.drawTool.fire(P.CREATE_ANCHOR,{position:e})}},qe=Ga;var Ua=class extends pi{constructor(e){super(e)}_mountedHook(){this.editTool.tooltipMess="\u70B9\u51FB\u951A\u70B9\u79FB\u52A8,\u53F3\u51FB\u7ED3\u675F\u7F16\u8F91",this._delegate.polygon.hierarchy=new i.CallbackProperty(e=>this._positions.length>2?new i.PolygonHierarchy(this._positions):null,!1),this._layer.entities.add(this._delegate)}_mountAnchor(){let e=[].concat(this._overlay.polygon.hierarchy.getValue(i.JulianDate.now()).positions);e.push(e[0]);for(let t=0;t<e.length-1;t++){let r=G(e[t],e[t+1]);this._positions.push(e[t]),this._positions.push(r)}this._positions.forEach((t,r)=>{this.editTool.fire(P.CREATE_ANCHOR,{position:t,index:r,isMid:r%2!==0})}),this._layer.entities.remove(this._overlay)}_onEditAnchorStop({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;if(r.isMid){let o,n,l=this._positions.length;s===l-1?(o=G(this._positions[s],this._positions[s-1]),n=G(this._positions[s],this._positions[0])):(o=G(this._positions[s],this._positions[s-1]),n=G(this._positions[s],this._positions[s+1])),this._positions.splice(s,1,o,t,n),this.editTool.fire(P.CLEAR_ANCHOR),this._positions.forEach((h,c)=>{this.editTool.fire(P.CREATE_ANCHOR,{position:h,index:c,isMid:c%2!==0})})}}_onAnchorMoving({pickedAnchor:e,position:t}){let r=e.properties.getValue(i.JulianDate.now()),s=r.index;this._positions[s]=t;let o=this._positions.length;if(!r.isMid){let n=-1,l=-1,h=-1,c=-1;s===0?(n=o-2,l=o-1,h=s+2,c=s+1):s===o-2?(n=s-2,l=s-1,h=0,c=o-1):(n=s-2,l=s-1,h=s+2,c=s+1);let d=G(this._positions[n],this._positions[s]),m=G(this._positions[h],this._positions[s]);this._positions[l]=d,this._positions[c]=m,this.editTool.fire(P.UPDATE_ANCHOR,{index:l,position:d}),this.editTool.fire(P.UPDATE_ANCHOR,{index:c,position:m})}this._options.onCalc&&this._options.onCalc(this._positions)}},Ze=Ua;var Ba=class extends X{constructor(){super()}_onDrawStop(e){new Ze(e).start({viewer:this._viewer,layer:this._layer},this._options)}_onCalc(e){var t;e.length>2&&(this._resultLabel.position=(t=i.BoundingSphere.fromPoints(e))==null?void 0:t.center,this._resultLabel.label.text=`\u9762\u79EF\uFF1A${ye(e).toFixed(2)} \u5E73\u65B9\u7C73`)}start(e,t){return this._startHook(e,t),new qe({material:t.material||i.Color.YELLOW.withAlpha(.6),perPositionHeight:!0}).start(e,this._options),this}},bp=Ba;var Va=class extends X{constructor(){super()}_onDrawStop(e){new Ze(e).start({viewer:this._viewer,layer:this._layer},this._options)}_lerp(e,t=4){let r=[];for(let s=0;s<t;++s)for(let o=0;o<t;++o){let n=i.Math.lerp(e.west,e.east,o/(t-1)),l=i.Math.lerp(e.south,e.north,s/(t-1));r.push(i.Cartesian3.fromRadians(n,l))}return r}_onCalc(e){if(e.length>2){let t=this._lerp(i.Rectangle.fromCartesianArray(e),this._options.lerpNum);this._getSampledHeight(t,!0).then(([r,s])=>r.map((o,n)=>({lng:o.longitude,lat:o.latitude,alt:Math.max(o.height||0,s[n]?i.Cartographic.fromCartesian(s[n]).height:0)}))).then(r=>{let s=0,o;r.forEach(n=>{n.alt>s&&(s=n.alt,o=n)}),o&&(this._resultLabel.position=i.Cartesian3.fromRadians(o.lng,o.lat,o.alt),this._resultLabel.label.text=`\u9AD8\u5EA6\uFF1A${s.toFixed(2)} \u7C73`)})}}start(e,t){return this._startHook(e,t),new qe({material:t.material||i.Color.YELLOW.withAlpha(.6)}).start(e,this._options),this}},Sp=Va;var ja=class extends X{constructor(){super()}_lerp(e,t=4){let r=[];for(let s=0;s<t;++s)for(let o=0;o<t;++o){let n=i.Math.lerp(e.west,e.east,o/(t-1)),l=i.Math.lerp(e.south,e.north,s/(t-1));r.push(i.Cartesian3.fromRadians(n,l))}return r}_onDrawStop(e){new Ze(e).start({viewer:this._viewer,layer:this._layer},this._options)}_onCalc(e){var t;if(e.length>2){this._resultLabel.position=(t=i.BoundingSphere.fromPoints(e))==null?void 0:t.center;let r=this._lerp(i.Rectangle.fromCartesianArray(e),this._options.lerpNum);this._getSampledHeight(r.concat(e),!1).then(([s])=>s.map(o=>i.Cartesian3.fromDegrees(i.Math.toDegrees(o.longitude),i.Math.toDegrees(o.latitude),o.height))).then(s=>{this._resultLabel.label.text=`\u9762\u79EF\uFF1A${ye(s).toFixed(2)} \u5E73\u65B9\u7C73`})}}start(e,t){return this._startHook(e,t),new qe({material:t.material||i.Color.YELLOW.withAlpha(.6)}).start(e,this._options),this}},Ap=ja;var Ya=class extends X{constructor(){super(),this._maxAnchorSize=9999}_onDrawStop(e){new pe(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){this._resultLabel.position=e[e.length-1];let t=0;for(let r=0;r<e.length-1;r++){let s=i.Cartesian3.distance(e[r],e[r+1]);t+=s}this._resultLabel.label.text=t>1e3?`\u8DDD\u79BB\uFF1A${(t/1e3).toFixed(2)} \u516C\u91CC`:`\u8DDD\u79BB\uFF1A${t.toFixed(2)} \u7C73`}}start(e,t){return this._startHook(e,t),new de({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2,clampToGround:!1}).start(e,{...t,maxAnchorSize:this._maxAnchorSize}),this}},Mp=Ya;var qa=class extends X{constructor(){super(),this._maxAnchorSize=9999}_lerp(e,t,r=5){let s=[],o=i.Cartographic.fromCartesian(e),n=i.Cartographic.fromCartesian(t);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),d=o.height-(o.height-n.height)*(l/r);s.push(i.Cartesian3.fromRadians(h,c,d))}return s}_onDrawStop(e){new pe(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){let t=[e[0]];this._resultLabel.position=e[e.length-1];for(let r=0;r<e.length-1;r++)t=t.concat(this._lerp(e[r],e[r+1],this._options.lerpNum));t.push(e[e.length-1]),this._getSampledHeight(t).then(([r,s])=>r.map((o,n)=>i.Cartesian3.fromDegrees(i.Math.toDegrees(o.longitude),i.Math.toDegrees(o.latitude),Math.max(o.height||0,s[n]?i.Cartographic.fromCartesian(s[n]).height:0)))).then(r=>{let s=0;for(let o=0;o<r.length-1;o++){let n=i.Cartesian3.distance(r[o],r[o+1]);s+=n}this._resultLabel.label.text=s>1e3?`\u8DDD\u79BB\uFF1A${(s/1e3).toFixed(2)} \u516C\u91CC`:`\u8DDD\u79BB\uFF1A${s.toFixed(2)} \u7C73`})}}start(e,t){return this._startHook(e,t),new de({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2,clampToGround:!0}).start(e,{...this._options,maxAnchorSize:this._maxAnchorSize}),this}},Ip=qa;var Za=class extends X{constructor(){super(),this._maxAnchorSize=2}_onDrawStop(e){new pe(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){e.length>0&&(this._startLabel.position=e[0]),e.length>1&&(this._resultLabel.position=e[e.length-1],this._resultLabel.label.text=`\u504F\u822A\uFF1A${i.Math.toDegrees(we(e[0],e[1])).toFixed(1)} \u5EA6`)}start(e,t){return this._startHook(e,t),new de({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2}).start(e,{...this._options,maxAnchorSize:this._maxAnchorSize}),this}},Lp=Za;var Xa=class extends X{constructor(){super(),this._maxAnchorSize=2,this._helpLinePositions=[],this._helpLine=new i.Entity({polyline:{positions:new i.CallbackProperty(()=>this._helpLinePositions.length>1?this._helpLinePositions:null,!1)}})}_onDrawStop(e){new pe(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){this._resultLabel.position=e[1];let t=i.Ellipsoid.WGS84.geodeticSurfaceNormal(e[0],new i.Cartesian3),r=i.Plane.fromPointNormal(e[0],t);this._helpLinePositions=[e[0],i.Plane.projectPointOntoPlane(r,e[1],new i.Cartesian3),e[1]];let s=Math.abs(i.Plane.getPointDistance(r,e[1]));this._resultLabel.label.text=`\u9AD8\u5EA6\uFF1A${s.toFixed(2)} \u7C73`}}start(e,t){this._startHook(e,t);let r=new i.PolylineDashMaterialProperty({color:i.Color.GREENYELLOW});return this._helpLine.polyline.material=r,this._helpLine.polyline.depthFailMaterial=r,this._layer.entities.add(this._helpLine),new de({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2}).start(e,{...this._options,maxAnchorSize:this._maxAnchorSize}),this}},Dp=Xa;var Ja=class extends X{constructor(){super(),this._maxAnchorSize=2,this._helpLinePositions=[],this._helpLine=new i.Entity({polyline:{positions:new i.CallbackProperty(()=>this._helpLinePositions.length>1?this._helpLinePositions:null,!1)}}),this._lengthLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._heightLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._distanceLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}})}_onDrawStop(e){new pe(e).start({viewer:this._viewer,layer:this._layer},{...this._options,maxAnchorSize:this._maxAnchorSize})}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){let t=i.Ellipsoid.WGS84.geodeticSurfaceNormal(e[0],new i.Cartesian3),r=i.Plane.fromPointNormal(e[0],t),s=i.Plane.projectPointOntoPlane(r,e[1],new i.Cartesian3);this._helpLinePositions=[e[0],s,e[1]];let o=i.Cartesian3.distance(e[0],s),n=Math.abs(i.Plane.getPointDistance(r,e[1])),l=i.Cartesian3.distance(e[0],e[1]);this._lengthLabel.position=i.Cartesian3.midpoint(e[0],s,new i.Cartesian3),this._lengthLabel.label.text=o>1e3?`${(o/1e3).toFixed(2)} \u516C\u91CC`:`${o.toFixed(2)} \u7C73`,this._distanceLabel.position=i.Cartesian3.midpoint(e[0],e[1],new i.Cartesian3),this._distanceLabel.label.text=l>1e3?`${(l/1e3).toFixed(2)} \u516C\u91CC`:`${l.toFixed(2)} \u7C73`,this._heightLabel.position=i.Cartesian3.midpoint(s,e[1],new i.Cartesian3),this._heightLabel.label.text=n>1e3?`${(n/1e3).toFixed(2)} \u516C\u91CC`:`${n.toFixed(2)} \u7C73`}}start(e,t){this._startHook(e,t);let r=new i.PolylineDashMaterialProperty({color:i.Color.GREENYELLOW});return this._helpLine.polyline.material=r,this._helpLine.polyline.depthFailMaterial=r,this._layer.entities.add(this._helpLine),this._layer.entities.add(this._lengthLabel),this._layer.entities.add(this._heightLabel),this._layer.entities.add(this._distanceLabel),new de({material:t.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:t.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:t.width||2,clampToGround:!1}).start(e,{...t,maxAnchorSize:this._maxAnchorSize}),this}},Rp=Ja;var $a=class{constructor(e){if(!e)throw Error("missing viewer param");this._viewer=e,this._layer=new i.CustomDataSource("measure-layer"),this._viewer.dataSources.add(this._layer)}get viewer(){return this._viewer}get layer(){return this._layer}angle(e={}){return new Pp().start(this,e),this}area(e={}){return new bp().start(this,e),this}areaHeight(e={}){return new Sp().start(this,e),this}areaSurface(e={}){return new Ap().start(this,e),this}distance(e={}){return new Mp().start(this,e),this}distanceSurface(e={}){return new Ip().start(this,e),this}heading(e={}){return new Lp().start(this,e),this}height(e={}){return new Dp().start(this,e),this}triangleHeight(e={}){return new Rp().start(this,e),this}activate(e,t){switch(e){case ce.ANGLE:this.angle(t);break;case ce.AREA:this.area(t);break;case ce.AREA_HEIGHT:this.areaHeight(t);break;case ce.AREA_SURFACE:this.areaSurface(t);break;case ce.DISTANCE:this.distance(t);break;case ce.DISTANCE_SURFACE:this.distanceSurface(t);break;case ce.HEADING:this.heading(t);break;case ce.HEIGHT:this.height(t);break;case ce.TRIANGLE_HEIGHT:this.triangleHeight(t);break;default:break}return this}deactivate(){return this._layer.entities.removeAll(),this._viewer.drawTool.tooltipMess="",this._viewer.drawTool.deactivate(),this._viewer.editTool.tooltipMess="",this._viewer.editTool.deactivate(),this}},Op=$a;var Ka=class{static pointBuffer(e,t,r=8){var l;let s=Y("turf");if(!s)throw"missing turf";let o=s.point(y.parsePointCoordToArray(e)),n=s.buffer(o,t,{units:"meters",steps:r});return((l=n==null?void 0:n.geometry)==null?void 0:l.coordinates[0])||[]}static polylineBuffer(e,t,r=8){var l;let s=Y("turf");if(!s)throw"missing turf";let o=s.lineString(y.parsePolylineCoordToArray(e)),n=s.buffer(o,t,{units:"meters",steps:r});return((l=n==null?void 0:n.geometry)==null?void 0:l.coordinates)||[]}static polygonBuffer(e,t,r=8){var l;let s=Y("turf");if(!s)throw"missing turf";let o=s.polygon(y.parsePolygonCoordToArray(e,!0)),n=s.buffer(o,t,{units:"meters",steps:r});return((l=n==null?void 0:n.geometry)==null?void 0:l.coordinates[0])||[]}static sector(e,t,r,s,o=64){var c;let n=Y("turf");if(!n)throw"missing turf";let l=n.point(y.parsePointCoordToArray(e)),h=n.sector(l,t,r,s,{units:"meters",steps:o});return((c=h==null?void 0:h.geometry)==null?void 0:c.coordinates[0])||[]}static transformPolylineScale(e,t){var n;let r=Y("turf");if(!r)throw"missing turf";let s=r.lineString(y.parsePolylineCoordToArray(e)),o=r.transformScale(s,t,{units:"meters"});return((n=o==null?void 0:o.geometry)==null?void 0:n.coordinates)||[]}static transformPolygonScale(e,t){var n;let r=Y("turf");if(!r)throw"missing turf";let s=r.polygon(y.parsePolygonCoordToArray(e,!0)),o=r.transformScale(s,t,{units:"meters"});return((n=o==null?void 0:o.geometry)==null?void 0:n.coordinates[0])||[]}static transformPolylineRotate(e,t){var n;let r=Y("turf");if(!r)throw"missing turf";let s=r.lineString(y.parsePolylineCoordToArray(e)),o=r.transformRotate(s,t);return((n=o==null?void 0:o.geometry)==null?void 0:n.coordinates)||[]}static transformPolygonRotate(e,t){var n;let r=Y("turf");if(!r)throw"missing turf";let s=r.polygon(y.parsePolygonCoordToArray(e,!0)),o=r.transformRotate(s,t);return((n=o==null?void 0:o.geometry)==null?void 0:n.coordinates[0])||[]}static polygonEquivalent(e,t,r,s=null){let o=Y("turf");if(!o)throw"missing turf";let n=[];for(let d=0,m=e.length;d<m;d++){let f=e[d];n.push({type:"Feature",properties:f,geometry:{type:"Point",coordinates:[f.x,f.y]}})}let l={type:"FeatureCollection",features:n};s&&s!==null&&(l=o.interpolate(l,s.cellSize||10,{gridType:"point",property:r,units:(s==null?void 0:s.units)||"kilometers",weight:(s==null?void 0:s.weight)||1}));let h=o.isobands(l,t,{zProperty:r}),c=o.isolines(l,t,{zProperty:r});return{geojsonPoly:h,geojsonLine:c}}},kp=Ka;var nf={Contour_Line:"contourLine",Tileset_Shake:"tilesetShake",SIGHT_LINE:"sightLine",VIEW_SHED:"viewshed",MULTI_VIEW_SHED:"multiViewshed",SLOPE:"slope",ASPECT:"aspect",HEIGHT_LIMIT:"heightLimit",TILESET_FLATTEN:"tilesetFlatten",SUNSHINE:"sunshine",INUNDATION:"inundation",Submergence:"submergence"},ae=nf;var lf={PROFILE:"profile"},mi=lf;var Qa=class{constructor(e){this._id=v.uuid(),this._viewer=e,this._delegate=void 0,this._enable=!1,this._color=i.Color.YELLOW,this._width=1,this._spacing=100,this._state=_.INITIALIZED}get type(){return"contourLine"}set enable(e){this._enable=e,e&&this._viewer?this._createAnalysis():(this._delegate&&(this._delegate=null),this._viewer&&(this._viewer.scene.globe.material=null))}get enable(){return this._enable}set color(e){this._color=e,this._delegate&&(this._delegate.uniforms.color=e)}get color(){return this._color}set width(e){this._width=e,this._delegate&&(this._delegate.uniforms.width=e)}get width(){return this._width}set spacing(e){this._spacing=e,this._delegate&&(this._delegate.uniforms.spacing=e)}get spacing(){return this._spacing}_init(e,t,r){this._enable=!0,this._color=e||i.Color.YELLOW,this._width=t||1,this._spacing=r||100,this._enable&&this._viewer&&this._createAnalysis()}deactivate(){this._enable=!1,this._delegate&&(this._delegate=null),this._viewer&&(this._viewer.scene.globe.material=null)}_createAnalysis(){let e=this._viewer.scene.globe,t=i.Material.fromType("ElevationContour"),r=t.uniforms;r.width=this._width,r.spacing=this._spacing,r.color=this._color,e.material=t,this._delegate=t}},Np=Qa;var en=class{constructor(e){this._id=v.uuid(),this._viewer=e,this._enable=!1,this._positions=[],this._maxDistance=5,this._speed=1e3,this._maxHeight=20,this._inRangeColor=i.Color.YELLOW,this._outRangeColor=i.Color.WHITE,this._state=_.INITIALIZED}get type(){return"tilesetShake"}set enable(e){this._enable=e,this.tileset_arr.forEach(t=>{let r=null;this._enable?r=this._getShader(t.tileset2):r=new window.GM.CustomShader,t.tileset.setCustomShader(r)})}get enable(){return this._enable}set maxDistance(e){this._maxDistance=e,this._enable&&this._changeSettings()}get maxDistance(){return this._maxDistance}set speed(e){this._speed=e,this._enable&&this._changeSettings()}get speed(){return this._speed}set maxHeight(e){this._maxHeight=e,this._enable&&this._changeSettings()}get maxHeight(){return this._maxHeight}_getShader(e){let t=e.boundingSphere.center.clone(),r=i.Transforms.eastNorthUpToFixedFrame(t),s=i.Matrix4.inverse(r,new i.Matrix4);return new i.CustomShader({uniforms:{M_LocaltoWorld:{type:i.UniformType.MAT4,value:r},M_WorldtoLocal:{type:i.UniformType.MAT4,value:s},center:{type:i.UniformType.VEC3,value:t},MAX_Distance:{type:i.UniformType.FLOAT,value:this._maxDistance},Speed:{type:i.UniformType.FLOAT,value:this._speed},height:{type:i.UniformType.FLOAT,value:this._maxHeight}},vertexShaderText:this._getVs(),fragmentShaderText:this._getFs()})}_changeSettings(){this.tileset_arr.forEach(e=>{let t=this._getShader(e.tileset2);e.tileset.setCustomShader(t)})}_getVs(){return`
1680
2240
  void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) {
1681
2241
  vec3 positionMC = vsInput.attributes.positionMC;
1682
2242
  //\u4E16\u754C\u5750\u6807\u8F6C\u5C40\u90E8 \u8981\u5C06\u6A21\u578B\u5750\u6807\u8F6C\u4E3A\u4E16\u754C\u5750\u6807
@@ -1721,7 +2281,7 @@ void main(){\r
1721
2281
  void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {
1722
2282
  material.diffuse = vec3(0.2, 0.5, 1.0); // \u5C06\u6750\u8D28\u989C\u8272\u8BBE\u7F6E\u4E3A\u7EA2\u8272 vec3(1.0, 0.0, 0.0) vec3(0.945, 0.459, 0.620)
1723
2283
  }
1724
- `}_init(e,t={}){this._enable=!0,this._maxDistance=t.maxDistance||5,this._speed=t.speed||1e3,this._maxHeight=t.maxHeight||20,e&&(this._layer=e,this.tileset_arr=this._layer.delegate._primitives.map(r=>({overlayId:r.overlayId,tileset2:r,tileset:this._layer._cache[r.overlayId]||null})),this.tileset_arr.forEach(r=>{let s=this._getShader(r.tileset2);r.tileset.setCustomShader(s)}))}deactivate(){this._enable=!1,!(!this.tileset_arr||this.tileset_arr.length===0)&&this.tileset_arr.forEach(e=>{let t=new window.GM.CustomShader;e.tileset.setCustomShader(t)})}},Gf=Fn;var zn=class{constructor(e,t={}){if(!e)throw Error("missing viewer param");this._id=C.uuid(),this._viewer=e,this._delegate=void 0,this._layer=new i.CustomDataSource("terrainClip"),e.dataSources.add(this._layer),this._minHeight=null,this._currentHeight=[],this._area=[],this._enable=t.enable||!0,this._clipOutSide=t.clipOutSide||!1,this._diffHeight=t.diffHeight||0,this._image=t.image||"//data.mars3d.cn/img/textures/poly-land.png",this._imageBottom=t.imageBottom||"//data.mars3d.cn/img/textures/poly-soil.jpg",this._splitNum=t.splitNum||30,this._clippingPolygons=new i.ClippingPolygonCollection({enabled:this._enable,polygons:[],inverse:this._clipOutSide}),this._viewer.scene.globe.backFaceCulling=!0,this._viewer.scene.globe.showSkirts=!0,this._state=m.INITIALIZED,this._callback=null}get type(){return"terrainClip"}get layer(){return this._layer}set enable(e){this._enable=e,this._viewer.scene.globe.clippingPolygons.enabled=e}get enable(){return this._enable}set clipOutSide(e){this._clipOutSide=e,this._viewer.scene.globe.clippingPolygons.inverse=e}get clipOutSide(){return this._clipOutSide}set splitNum(e){this._splitNum=e}get splitNum(){return this._splitNum}set diffHeight(e){this._diffHeight=e}get diffHeight(){return this._diffHeight}addArea(e=[],t={},r){t!=null&&t.diffHeight&&(this._diffHeight=t.diffHeight);let s=e.map(n=>i.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)),o=new i.ClippingPolygon({positions:s});this._id=C.uuid(),o.id=this._id,this._clippingPolygons.add(o),this._viewer.scene.globe.clippingPolygons=this._clippingPolygons,this._prepareWall(e,t),this._callback=r}_prepareWall(e,t={}){let r=e.concat([e[0]]);this._minHeight=null,this._currentHeight=[];let s=this._viewer.terrainProvider;if(s&&!(s instanceof i.EllipsoidTerrainProvider)){let o=[];for(let l=0;l<r.length-1;l++){let h=this._lerp(r[l],r[l+1],this._splitNum);o=o.concat(h)}o.push(r[0]);let n=o.map(l=>i.Cartographic.fromDegrees(l.lng,l.lat,l.alt));i.sampleTerrainMostDetailed(s,n).then(l=>{let h=l.map(c=>{let p=i.Math.toDegrees(c.longitude),u=i.Math.toDegrees(c.latitude);return this._currentHeight.push(parseFloat(c.height)),(!this._minHeight||c.height<this._minHeight)&&(this._minHeight=c.height),{lng:p,lat:u,alt:c.height}});this._perCreateEntity(e,h,t)})}else r.forEach(o=>{this._currentHeight.push(parseFloat(o.alt)),(!this._minHeight||o.alt<this._minHeight)&&(this._minHeight=o.alt)}),this._perCreateEntity(r,r,t)}_perCreateEntity(e,t,r){let s=this._createWallSurface(t),o=this._createBottomSurface(e),n={id:this._id,diffHeight:this._diffHeight,original:r,positions:e,show:!0};this._area.push({id:this._id,diffHeight:this._diffHeight,original:r,positions:e,entityIds:[s,o],show:!0}),typeof this._callback=="function"&&this._callback(n)}_createWallSurface(e){let t=[];return e.forEach(s=>{t.push(parseFloat(s.lng)),t.push(parseFloat(s.lat))}),this._layer.entities.add({wall:{positions:i.Cartesian3.fromDegreesArray(t),material:new i.ImageMaterialProperty({image:this._image,repeat:new i.Cartesian2(8,1)}),minimumHeights:this._getHeights(e.length,this._minHeight-this._diffHeight),maximumHeights:this._currentHeight}}).id}_createBottomSurface(e){let t=[];e.forEach(o=>{t.push(parseFloat(o.lng)),t.push(parseFloat(o.lat)),t.push(this._minHeight-this._diffHeight)});let r=new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(t));return this._layer.entities.add({polygon:{hierarchy:r,material:new i.ImageMaterialProperty({image:this._imageBottom,repeat:new i.Cartesian2(1,2)}),perPositionHeight:!0,outline:!1,outlineColor:i.Color.BLUE}}).id}_getHeights(e,t){let r=[];for(let s=0;s<e;s++)r.push(t);return r}_lerp(e,t,r=10){let s=[],o=i.Cartographic.fromDegrees(e.lng,e.lat,e.alt),n=i.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),p=o.height-(o.height-n.height)*(l/r);s.push({lng:i.Math.toDegrees(h),lat:i.Math.toDegrees(c),alt:p})}return s}getAreaById(e){let t=this._area.filter(r=>r.id===e);return t&&t.length>0?t[0]:null}removeArea(e){let t=this._area.findIndex(n=>n.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];this._layer.entities.removeById(r.entityIds[0]),this._layer.entities.removeById(r.entityIds[1]);let s=this._clippingPolygons._polygons.findIndex(n=>n.id===e),o=this._clippingPolygons.get(s);return this._area.splice(t,1),o&&this._clippingPolygons.remove(o),this}showArea(e){let t=this._area.findIndex(n=>n.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(r.show)return;r.show=!0,this._layer.entities.getById(r.entityIds[0]).show=!0,this._layer.entities.getById(r.entityIds[1]).show=!0;let s=r.positions.map(n=>i.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)),o=new i.ClippingPolygon({positions:s});return o.id=e,this._clippingPolygons.add(o),this}hideArea(e){let t=this._area.findIndex(n=>n.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(!r.show)return;r.show=!1,this._layer.entities.getById(r.entityIds[0]).show=!1,this._layer.entities.getById(r.entityIds[1]).show=!1;let s=this._clippingPolygons._polygons.findIndex(n=>n.id===e),o=this._clippingPolygons.get(s);return o&&this._clippingPolygons.remove(o),this}flyToArea(e){let t=this._area.findIndex(o=>o.id===e);if(t==null)throw Error("missing index result");let r=this._area[t],s=this._layer.entities.getById(r.entityIds[0]);return this._viewer.flyTo(s),this}toJSON(){return this._area}clear(){this._layer.entities.removeAll(),this._clippingPolygons.removeAll()}},Uf=zn;function ce(a,e){this.viewer=a,this.options=e||{},this._positions=[new i.Cartesian3(-1.1825928630924462e6,5.5155809806405855e6,2966674365247578e-9),new i.Cartesian3(-1183337777477057e-9,5515825617716778e-9,2.9659274345367434e6),new i.Cartesian3(-1.1845084932830015e6,5515571328839522e-9,2965932974956288e-9),new i.Cartesian3(-1.1855870332886775e6,5514889448799464e-9,2.9667642948399023e6),new i.Cartesian3(-1.1850990292063756e6,5514576687407264e-9,2967535347584739e-9),new i.Cartesian3(-1.1828409384216308e6,551522464431188e-8,2.9672341119776894e6)],this._height=this.options.height||0,this.bottomImg=e.bottomImg,this.wallImg=e.wallImg,this.splitNum=i.defaultValue(e.splitNum,50),this._positions&&this._positions.length>0&&this.updateData(this._positions)}Object.defineProperties(ce.prototype,{show:{get:function(){return this._show},set:function(a){this._show=a,this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=a),this._switchExcavate(a)}},height:{get:function(){return this._height},set:function(a){this._height=a,this._updateExcavateDepth(a)}}});ce.prototype.updateData=function(a){this.clear();var e=[],t=a.length,r=new i.Cartesian3,s=i.Cartesian3.subtract(a[0],a[1],r);s=s.x>0,this.excavateMinHeight=9999;for(var o=0;o<t;++o){var n=(o+1)%t,l=i.Cartographic.fromCartesian(a[o]),h=viewer.scene.globe.getHeight(l)||l.height;h<this.excavateMinHeight&&(this.excavateMinHeight=h);var c=i.Cartesian3.add(a[o],a[n],new i.Cartesian3);c=i.Cartesian3.multiplyByScalar(c,.5,c);var p=i.Cartesian3.normalize(c,new i.Cartesian3),u=i.Cartesian3.subtract(a[n],c,new i.Cartesian3);u=i.Cartesian3.normalize(u,u);var g=i.Cartesian3.cross(u,p,new i.Cartesian3);g=i.Cartesian3.normalize(g,g);var _=new i.Plane(g,0),d=i.Plane.getPointDistance(_,c);e.push(new i.ClippingPlane(g,d))}this.viewer.scene.globe.clippingPlanes=new i.ClippingPlaneCollection({planes:e,edgeWidth:1,edgeColor:i.Color.WHITE,enabled:!0}),this._prepareWell(a),this._createWell(this.wellData)};ce.prototype.clear=function(){this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=!1,this.viewer.scene.globe.clippingPlanes.removeAll(),this.viewer.scene.globe.clippingPlanes.isDestroyed()||this.viewer.scene.globe.clippingPlanes.destroy()),this.viewer.scene.globe.clippingPlanes=void 0,this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall),delete this.bottomSurface,delete this.wellWall,this.viewer.scene.render()};ce.prototype._prepareWell=function(a){var e=this.splitNum,t=a.length;if(t!=0){for(var r=this.excavateMinHeight-this.height,s=[],o=[],n=[],l=0;l<t;l++){var h=l==t-1?0:l+1,c=i.Cartographic.fromCartesian(a[l]),p=i.Cartographic.fromCartesian(a[h]),u=[c.longitude,c.latitude],g=[p.longitude,p.latitude];l==0&&(n.push(new i.Cartographic(u[0],u[1])),o.push(i.Cartesian3.fromRadians(u[0],u[1],r)),s.push(i.Cartesian3.fromRadians(u[0],u[1],0)));for(var _=1;_<=e;_++){var d=i.Math.lerp(u[0],g[0],_/e),T=i.Math.lerp(u[1],g[1],_/e);l==t-1&&_==e||(n.push(new i.Cartographic(d,T)),o.push(i.Cartesian3.fromRadians(d,T,r)),s.push(i.Cartesian3.fromRadians(d,T,0)))}}this.wellData={lerp_pos:n,bottom_pos:o,no_height_top:s}}};ce.prototype._createWell=function(a){if(this.viewer.terrainProvider._layers){var e=this;this._createBottomSurface(a.bottom_pos);var t=i.sampleTerrainMostDetailed(this.viewer.terrainProvider,a.lerp_pos);i.when(t,function(r){for(var s=r.length,o=[],n=0;n<s;n++){var l=i.Cartesian3.fromRadians(r[n].longitude,r[n].latitude,r[n].height);o.push(l)}e._createWellWall(a.bottom_pos,o)})}else this._createBottomSurface(a.bottom_pos),this._createWellWall(a.bottom_pos,a.no_height_top)};ce.prototype._getMinHeight=function(a){let e=5e6,t=null;for(let r=0;r<a.length;r++){let s=a[r].z;s<e&&(e=s,t=this._ellipsoidToLonLat(a[r]))}return t.altitude};ce.prototype._ellipsoidToLonLat=function(a){let e=this.viewer.scene.globe.ellipsoid,t=new i.Cartesian3(a.x,a.y,a.z),r=e.cartesianToCartographic(t),s=i.Math.toDegrees(r.latitude),o=i.Math.toDegrees(r.longitude),n=r.height;return{longitude:o,latitude:s,altitude:n}};ce.prototype._createBottomSurface=function(a){if(a.length){let r=this._getMinHeight(a),s=[];for(let l=0;l<a.length;l++){let h=this._ellipsoidToLonLat(a[l]);s.push(h.longitude),s.push(h.latitude),s.push(r)}let o=new i.PolygonGeometry({polygonHierarchy:new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(s)),perPositionHeight:!0,closeBottom:!1}),n=i.PolygonGeometry.createGeometry(o);var e=new i.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),t=new i.MaterialAppearance({translucent:!1,flat:!0,material:e});this.bottomSurface=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:n}),appearance:t,asynchronous:!1}),this.viewer.scene.primitives.add(this.bottomSurface)}};ce.prototype._createWellWall=function(a,e){let t=this._getMinHeight(a),r=[],s=[];for(let c=0;c<e.length;c++)r.push(this._ellipsoidToLonLat(e[c]).altitude),s.push(t);let o=new i.WallGeometry({positions:e,maximumHeights:r,minimumHeights:s}),n=i.WallGeometry.createGeometry(o);var l=new i.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),h=new i.MaterialAppearance({translucent:!1,flat:!0,material:l});this.wellWall=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:n,attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(i.Color.GREY)},id:"PitWall"}),appearance:h,asynchronous:!1}),this.viewer.scene.primitives.add(this.wellWall)};ce.prototype._switchExcavate=function(a){a?(this.viewer.scene.globe.material=i.Material.fromType("WaJue"),this.wellWall.show=!0,this.bottomSurface.show=!0):(this.viewer.scene.globe.material=null,this.wellWall.show=!1,this.bottomSurface.show=!1)};ce.prototype._updateExcavateDepth=function(a){this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall);for(var e=this.wellData.lerp_pos,t=[],r=e.length,s=0;s<r;s++)t.push(i.Cartesian3.fromRadians(e[s].longitude,e[s].latitude,this.excavateMinHeight-a));this.wellData.bottom_pos=t,this._createWell(this.wellData),this.viewer.scene.primitives.add(this.bottomSurface),this.viewer.scene.primitives.add(this.wellWall)};var Bf=ce;var Nn=class{constructor(e,t={}){if(!e)throw Error("missing viewer param");this._id=C.uuid(),this._viewer=e,this._delegate=void 0,this._layer=new i.CustomDataSource("TerrainUplift"),e.dataSources.add(this._layer),this._layerUplift=new i.CustomDataSource("TerrainUplift2"),e.dataSources.add(this._layerUplift),this._minHeight=null,this._currentHeight=[],this._area=[],this._enable=t.enable||!0,this._upHeight=t.upHeight||0,this._clipOutSide=t.clipOutSide||!1,this._diffHeight=t.diffHeight||0,this._upHeight=t.upHeight||0,this._image=t.image||"//data.mars3d.cn/img/textures/poly-land.png",this._imageBottom=t.imageBottom||"//data.mars3d.cn/img/textures/poly-soil.jpg",this._splitNum=t.splitNum||30,this._clippingPolygons=new i.ClippingPolygonCollection({enabled:this._enable,polygons:[],inverse:this._clipOutSide}),this._viewer.scene.globe.backFaceCulling=!0,this._viewer.scene.globe.showSkirts=!0,this._state=m.INITIALIZED,this._callback=null}get type(){return"TerrainUplift"}get layer(){return this._layer}set enable(e){this._enable=e,this._viewer.scene.globe.clippingPolygons.enabled=e}get enable(){return this._enable}set clipOutSide(e){this._clipOutSide=e,this._viewer.scene.globe.clippingPolygons.inverse=e}get clipOutSide(){return this._clipOutSide}set splitNum(e){this._splitNum=e}get splitNum(){return this._splitNum}set diffHeight(e){this._diffHeight=e}get diffHeight(){return this._diffHeight}set upHeight(e){this._upHeight=e}get upHeight(){return this._upHeight}addArea(e=[],t={},r){t!=null&&t.diffHeight&&(this._diffHeight=t.diffHeight),t!=null&&t.upHeight&&(this._upHeight=t.upHeight);let s=e.map(n=>i.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)),o=new i.ClippingPolygon({positions:s});this._id=C.uuid(),o.id=this._id,this._clippingPolygons.add(o),this._viewer.scene.globe.clippingPolygons=this._clippingPolygons,this._prepareWall(e,t),this._callback=r}_prepareWall(e,t={}){let r=e.concat([e[0]]);this._minHeight=null,this._currentHeight=[];let s=this._viewer.terrainProvider;if(s&&!(s instanceof i.EllipsoidTerrainProvider)){let o=[];for(let l=0;l<r.length-1;l++){let h=this._lerp(r[l],r[l+1],this._splitNum);o=o.concat(h)}o.push(r[0]);let n=o.map(l=>i.Cartographic.fromDegrees(l.lng,l.lat,l.alt));i.sampleTerrainMostDetailed(s,n).then(l=>{let h=l.map(c=>{let p=i.Math.toDegrees(c.longitude),u=i.Math.toDegrees(c.latitude);return this._currentHeight.push(parseFloat(c.height)),(!this._minHeight||c.height<this._minHeight)&&(this._minHeight=c.height),{lng:p,lat:u,alt:c.height}});this._perCreateEntity(e,h,t),this._createUpliftArea(e,h)})}else r.forEach(o=>{this._currentHeight.push(parseFloat(o.alt)),(!this._minHeight||o.alt<this._minHeight)&&(this._minHeight=o.alt)}),this._perCreateEntity(r,r,t)}_createUpliftArea(e,t=[]){let r=this._viewer.terrainProvider,s=this._getTinPoints(e,t);i.sampleTerrainMostDetailed(r,s).then(o=>{let n=q("turf"),l=o.map(function(p){return n.point([i.Math.toDegrees(p.longitude),i.Math.toDegrees(p.latitude),p.height],{z:p.height})}),h=n.featureCollection(l);n.tin(h,"z").features.forEach(p=>{let u=[];p.geometry.coordinates[0].forEach((d,T)=>{u.push(parseFloat(d[0])),u.push(parseFloat(d[1]));let w=T===1?p.properties.b:T===2?p.properties.c:p.properties.a;u.push(w+this._upHeight)});let g=new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(u)),_=this._layerUplift.entities.add({polygon:{hierarchy:g,material:new i.ImageMaterialProperty({image:"/assets/data/aaa.png",repeat:new i.Cartesian2(1,1)}),perPositionHeight:!0,outline:!1,outlineColor:i.Color.BLUE}})})})}_getTinPoints(e,t=[],r=80){let s=q("turf"),o=e.reduce((w,P)=>w.lng<P.lng?w:P).lng,n=e.reduce((w,P)=>w.lng>P.lng?w:P).lng,l=e.reduce((w,P)=>w.lat<P.lat?w:P).lat,h=e.reduce((w,P)=>w.lat>P.lat?w:P).lat,c=i.Rectangle.fromDegrees(o,l,n,h),p=JSON.parse(JSON.stringify(e)).concat(e[0]).map(w=>[w._lng,w._lat]),u=s.polygon([p]),g=r,_=r,d=[];for(let w=0;w<_;w++)for(var T=0;T<g;T++){let P=i.Math.lerp(c.west,c.east,T/(g-1)),M=i.Math.lerp(c.south,c.north,w/(_-1)),R=s.point([i.Math.toDegrees(P),i.Math.toDegrees(M)]);s.booleanPointInPolygon(R,u)&&d.push(i.Cartographic.fromRadians(P,M))}for(let w=0;w<t.length;w++)d.push(i.Cartographic.fromDegrees(t[w].lng,t[w].lat));return d}_perCreateEntity(e,t,r){let s=this._createWallSurface(t),o=this._createBottomSurface(e),n={id:this._id,diffHeight:this._diffHeight,original:r,positions:e,entityIds:[s[0],o[0]],entityUpliftIds:[s[1],o[1]],show:!0};this._area.push(n),typeof this._callback=="function"&&this._callback(n)}_createWallSurface(e){let t=[];e.forEach(o=>{t.push(parseFloat(o.lng)),t.push(parseFloat(o.lat))});let r=this._layer.entities.add({wall:{positions:i.Cartesian3.fromDegreesArray(t),material:new i.ImageMaterialProperty({image:this._image,repeat:new i.Cartesian2(8,1)}),minimumHeights:this._getHeights(e.length,this._minHeight-this._diffHeight),maximumHeights:this._currentHeight}}),s=this._layerUplift.entities.add({wall:{positions:i.Cartesian3.fromDegreesArray(t),material:new i.ImageMaterialProperty({image:this._image,repeat:new i.Cartesian2(8,1),transparent:!0}),minimumHeights:this._getHeights(e.length,this._minHeight-this._diffHeight,this._upHeight),maximumHeights:this._currentHeight.map(o=>o+this._upHeight)}});return[r.id,s.id]}_createBottomSurface(e){let t=[];e.forEach(h=>{t.push(parseFloat(h.lng)),t.push(parseFloat(h.lat)),t.push(this._minHeight-this._diffHeight)});let r=new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(t)),s=this._layer.entities.add({polygon:{hierarchy:r,material:new i.ImageMaterialProperty({image:this._imageBottom,repeat:new i.Cartesian2(1,2)}),perPositionHeight:!0,outline:!1,outlineColor:i.Color.BLUE}}),o=[];e.forEach(h=>{o.push(parseFloat(h.lng)),o.push(parseFloat(h.lat)),o.push(this._minHeight-this._diffHeight+this._upHeight)});let n=new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(o)),l=this._layerUplift.entities.add({polygon:{hierarchy:n,material:new i.ImageMaterialProperty({image:this._imageBottom,repeat:new i.Cartesian2(1,2),transparent:!0}),perPositionHeight:!0,outline:!1,outlineColor:i.Color.BLUE}});return[s.id,l.id]}_getHeights(e,t,r=0){let s=[];for(let o=0;o<e;o++)s.push(t+r);return s}_lerp(e,t,r=10){let s=[],o=i.Cartographic.fromDegrees(e.lng,e.lat,e.alt),n=i.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),p=o.height-(o.height-n.height)*(l/r);s.push({lng:i.Math.toDegrees(h),lat:i.Math.toDegrees(c),alt:p})}return s}getAreaById(e){let t=this._area.filter(r=>r.id===e);return t&&t.length>0?t[0]:null}removeArea(e){let t=this._area.findIndex(n=>n.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];this._layer.entities.removeById(r.entityIds[0]),this._layer.entities.removeById(r.entityIds[1]),this._layerUplift.entities.removeById(r.entityUpliftIds[0]),this._layerUplift.entities.removeById(r.entityUpliftIds[1]);let s=this._clippingPolygons._polygons.findIndex(n=>n.id===e),o=this._clippingPolygons.get(s);return this._area.splice(t,1),o&&this._clippingPolygons.remove(o),this}showArea(e){let t=this._area.findIndex(n=>n.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(r.show)return;r.show=!0,this._layer.entities.getById(r.entityIds[0]).show=!0,this._layer.entities.getById(r.entityIds[1]).show=!0,this._layerUplift.entities.getById(r.entityUpliftIds[0]).show=!0,this._layerUplift.entities.getById(r.entityUpliftIds[1]).show=!0;let s=r.positions.map(n=>i.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)),o=new i.ClippingPolygon({positions:s});return o.id=e,this._clippingPolygons.add(o),this}hideArea(e){let t=this._area.findIndex(n=>n.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(!r.show)return;r.show=!1,this._layer.entities.getById(r.entityIds[0]).show=!1,this._layer.entities.getById(r.entityIds[1]).show=!1,this._layerUplift.entities.getById(r.entityUpliftIds[0]).show=!1,this._layerUplift.entities.getById(r.entityUpliftIds[1]).show=!1;let s=this._clippingPolygons._polygons.findIndex(n=>n.id===e),o=this._clippingPolygons.get(s);return o&&this._clippingPolygons.remove(o),this}flyToArea(e){let t=this._area.findIndex(o=>o.id===e);if(t==null)throw Error("missing index result");let r=this._area[t],s=this._layerUplift.entities.getById(r.entityUpliftIds[0]);return this._viewer.flyTo(s),this}toJSON(){return this._area}clear(){this._layer.entities.removeAll(),this._layerUplift.entities.removeAll(),this._clippingPolygons.removeAll()}},Vf=Nn;var Hn=class{constructor(e){qi(this,"_analysisTerrainVisible",e=>{let t=this._viewer.terrainProvider,r=e.map(s=>i.Cartographic.fromDegrees(s.lng,s.lat,s.alt));i.sampleTerrainMostDetailed(t,r).then(s=>{let o=0,n=null;for(let l=0;l<s.length-1;l++){if(l<s.length-2){let h=e[l],c=e[l+1],p=i.Cartesian3.fromDegrees(h.lng,h.lat,h.alt),u=i.Cartesian3.fromDegrees(c.lng,c.lat,c.alt);if(n=this._analysisModelVisible([p,u]),i.defined(n)&&i.defined(n.object)){console.log("\u5728\u6A21\u578B\u4E0A.");let g=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat,e[0].alt),_=i.Cartesian3.fromDegrees(e[e.length-1].lng,e[e.length-1].lat,e[e.length-1].alt);this._drawLine(n.position,g,i.Color.GREEN),this._drawLine(n.position,_,i.Color.RED);break}}if(s[l].height>=e[l].alt){console.log("\u5728\u5730\u5F62\u4E0A."),o=l;let h=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat,e[0].alt),c=i.Cartesian3.fromDegrees(e[l].lng,e[l].lat,e[l].alt),p=i.Cartesian3.fromDegrees(e[e.length-1].lng,e[e.length-1].lat,e[e.length-1].alt);this._drawLine(h,c,i.Color.GREEN),this._drawLine(c,p,i.Color.RED);break}}if(o===0&&n===null){console.log("\u5168\u90E8\u53EF\u89C6.");let l=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat,e[0].alt),h=i.Cartesian3.fromDegrees(e[e.length-1].lng,e[e.length-1].lat,e[e.length-1].alt);this._drawLine(l,h,i.Color.GREEN)}})});qi(this,"_analysisModelVisible",e=>{let t=i.Cartesian3.normalize(i.Cartesian3.subtract(e[1],e[0],new i.Cartesian3),new i.Cartesian3),r=new i.Ray(e[0],t);return this._viewer.scene.pickFromRay(r)});this._id=C.uuid(),this._viewer=e,this._layer=new i.CustomDataSource("sightLine"),this._viewer.dataSources.add(this._layer)}get type(){return"sightLine"}get layer(){return this._layer}_init(e,t,r=10){this._layer&&this._layer.entities.removeAll();let s=i.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),o=i.Cartesian3.fromDegrees(t.lng,t.lat,t.alt),n=this._viewer.terrainProvider;if(n&&!(n instanceof i.EllipsoidTerrainProvider)){let l=this._lerp(e,t,r).concat([t]);this._analysisTerrainVisible(l)}else this._analysisVisible([s,o])}_analysisVisible(e){let t=this._analysisModelVisible(e);if(i.defined(t)&&i.defined(t.object)){let r=this._drawLine(t.position,e[0],i.Color.GREEN),s=this._drawLine(t.position,e[1],i.Color.RED);console.log("\u5728\u6A21\u578B\u4E0A.",r,s)}else{let r=this._drawLine(e[0],e[1],i.Color.GREEN);console.log("\u4E0D\u5728\u6A21\u578B\u4E0A",r)}}_drawLine(e,t,r){return this._layer||(this._layer=new i.CustomDataSource("sightLine"),this._viewer.dataSources.add(this._layer)),this._layer&&this._layer.entities.add({polyline:{positions:[e,t],width:2,material:r,depthFailMaterial:r}}),this}_lerp(e,t,r=10){let s=[],o=i.Cartographic.fromDegrees(e.lng,e.lat,e.alt),n=i.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),p=o.height-(o.height-n.height)*(l/r);s.push({lng:i.Math.toDegrees(h),lat:i.Math.toDegrees(c),alt:p})}return s}deactivate(){this._layer&&this._layer.entities.removeAll(),this._layer&&this._viewer.dataSources.remove(this._layer),this._layer=null}},jf=Hn;var qf=`#define USE_CUBE_MAP_SHADOW true
2284
+ `}_init(e,t={}){this._enable=!0,this._maxDistance=t.maxDistance||5,this._speed=t.speed||1e3,this._maxHeight=t.maxHeight||20,e&&(this._layer=e,this.tileset_arr=this._layer.delegate._primitives.map(r=>({overlayId:r.overlayId,tileset2:r,tileset:this._layer._cache[r.overlayId]||null})),this.tileset_arr.forEach(r=>{let s=this._getShader(r.tileset2);r.tileset.setCustomShader(s)}))}deactivate(){this._enable=!1,!(!this.tileset_arr||this.tileset_arr.length===0)&&this.tileset_arr.forEach(e=>{let t=new window.GM.CustomShader;e.tileset.setCustomShader(t)})}},Fp=en;var tn=class{constructor(e,t={}){if(!e)throw Error("missing viewer param");this._id=v.uuid(),this._viewer=e,this._delegate=void 0,this._layer=new i.CustomDataSource("terrainClip"),e.dataSources.add(this._layer),this._minHeight=null,this._currentHeight=[],this._area=[],this._enable=t.enable||!0,this._clipOutSide=t.clipOutSide||!1,this._diffHeight=t.diffHeight||0,this._image=t.image||"//data.mars3d.cn/img/textures/poly-land.png",this._imageBottom=t.imageBottom||"//data.mars3d.cn/img/textures/poly-soil.jpg",this._splitNum=t.splitNum||30,this._clippingPolygons=new i.ClippingPolygonCollection({enabled:this._enable,polygons:[],inverse:this._clipOutSide}),this._viewer.scene.globe.backFaceCulling=!0,this._viewer.scene.globe.showSkirts=!0,this._state=_.INITIALIZED,this._callback=null}get type(){return"terrainClip"}get layer(){return this._layer}set enable(e){this._enable=e,this._viewer.scene.globe.clippingPolygons.enabled=e}get enable(){return this._enable}set clipOutSide(e){this._clipOutSide=e,this._viewer.scene.globe.clippingPolygons.inverse=e}get clipOutSide(){return this._clipOutSide}set splitNum(e){this._splitNum=e}get splitNum(){return this._splitNum}set diffHeight(e){this._diffHeight=e}get diffHeight(){return this._diffHeight}addArea(e=[],t={},r){t!=null&&t.diffHeight&&(this._diffHeight=t.diffHeight);let s=e.map(n=>i.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)),o=new i.ClippingPolygon({positions:s});this._id=v.uuid(),o.id=this._id,this._clippingPolygons.add(o),this._viewer.scene.globe.clippingPolygons=this._clippingPolygons,this._diffHeight>0&&this._prepareWall(e,t),this._callback=r}_prepareWall(e,t={}){let r=e.concat([e[0]]);this._minHeight=null,this._currentHeight=[];let s=this._viewer.terrainProvider;if(s&&!(s instanceof i.EllipsoidTerrainProvider)){let o=[];for(let l=0;l<r.length-1;l++){let h=this._lerp(r[l],r[l+1],this._splitNum);o=o.concat(h)}o.push(r[0]);let n=o.map(l=>i.Cartographic.fromDegrees(l.lng,l.lat,l.alt));i.sampleTerrainMostDetailed(s,n).then(l=>{let h=l.map(c=>{let d=i.Math.toDegrees(c.longitude),m=i.Math.toDegrees(c.latitude);return this._currentHeight.push(parseFloat(c.height)),(!this._minHeight||c.height<this._minHeight)&&(this._minHeight=c.height),{lng:d,lat:m,alt:c.height}});this._perCreateEntity(e,h,t)})}else r.forEach(o=>{this._currentHeight.push(parseFloat(o.alt)),(!this._minHeight||o.alt<this._minHeight)&&(this._minHeight=o.alt)}),this._perCreateEntity(r,r,t)}_perCreateEntity(e,t,r){let s=this._createWallSurface(t),o=this._createBottomSurface(e),n={id:this._id,diffHeight:this._diffHeight,original:r,positions:e,show:!0};this._area.push({id:this._id,diffHeight:this._diffHeight,original:r,positions:e,entityIds:[s,o],show:!0}),typeof this._callback=="function"&&this._callback(n)}_createWallSurface(e){let t=[];return e.forEach(s=>{t.push(parseFloat(s.lng)),t.push(parseFloat(s.lat))}),this._layer.entities.add({wall:{positions:i.Cartesian3.fromDegreesArray(t),material:new i.ImageMaterialProperty({image:this._image,repeat:new i.Cartesian2(8,1)}),minimumHeights:this._getHeights(e.length,this._minHeight-this._diffHeight),maximumHeights:this._currentHeight}}).id}_createBottomSurface(e){let t=[];e.forEach(o=>{t.push(parseFloat(o.lng)),t.push(parseFloat(o.lat)),t.push(this._minHeight-this._diffHeight)});let r=new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(t));return this._layer.entities.add({polygon:{hierarchy:r,material:new i.ImageMaterialProperty({image:this._imageBottom,repeat:new i.Cartesian2(1,2)}),perPositionHeight:!0,outline:!1,outlineColor:i.Color.BLUE}}).id}_getHeights(e,t){let r=[];for(let s=0;s<e;s++)r.push(t);return r}_lerp(e,t,r=10){let s=[],o=i.Cartographic.fromDegrees(e.lng,e.lat,e.alt),n=i.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),d=o.height-(o.height-n.height)*(l/r);s.push({lng:i.Math.toDegrees(h),lat:i.Math.toDegrees(c),alt:d})}return s}getAreaById(e){let t=this._area.filter(r=>r.id===e);return t&&t.length>0?t[0]:null}removeArea(e){let t=this._area.findIndex(n=>n.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];this._layer.entities.removeById(r.entityIds[0]),this._layer.entities.removeById(r.entityIds[1]);let s=this._clippingPolygons._polygons.findIndex(n=>n.id===e),o=this._clippingPolygons.get(s);return this._area.splice(t,1),o&&this._clippingPolygons.remove(o),this}showArea(e){let t=this._area.findIndex(n=>n.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(r.show)return;r.show=!0,this._layer.entities.getById(r.entityIds[0]).show=!0,this._layer.entities.getById(r.entityIds[1]).show=!0;let s=r.positions.map(n=>i.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)),o=new i.ClippingPolygon({positions:s});return o.id=e,this._clippingPolygons.add(o),this}hideArea(e){let t=this._area.findIndex(n=>n.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(!r.show)return;r.show=!1,this._layer.entities.getById(r.entityIds[0]).show=!1,this._layer.entities.getById(r.entityIds[1]).show=!1;let s=this._clippingPolygons._polygons.findIndex(n=>n.id===e),o=this._clippingPolygons.get(s);return o&&this._clippingPolygons.remove(o),this}flyToArea(e){let t=this._area.findIndex(o=>o.id===e);if(t==null)throw Error("missing index result");let r=this._area[t],s=this._layer.entities.getById(r.entityIds[0]);return this._viewer.flyTo(s),this}toJSON(){return this._area}clear(){this._layer.entities.removeAll(),this._clippingPolygons.removeAll()}},Hp=tn;var rn=class{constructor(e,t={}){if(!e)throw Error("missing viewer param");this._id=v.uuid(),this._viewer=e,this._delegate=void 0,this._layer=new i.CustomDataSource("terrainClip"),e.dataSources.add(this._layer),this._minHeight=null,this._currentHeight=[],this._area=[],this._enable=t.enable||!0,this._edgeWidth=t.edgeWidth||0,this._edgeColor=t.edgeColor||i.Color.WHITE,this._clipOutSide=t.clipOutSide||!1,this._diffHeight=t.diffHeight||0,this._image=t.image||"//data.mars3d.cn/img/textures/poly-land.png",this._imageBottom=t.imageBottom||"//data.mars3d.cn/img/textures/poly-soil.jpg",this._splitNum=t.splitNum||30,this._clippingPlanes=new i.ClippingPlaneCollection({enabled:this._enable,planes:[],unionClippingRegions:this._clipOutSide,edgeWidth:this._edgeWidth,edgeColor:this._edgeColor}),this._viewer.scene.globe.backFaceCulling=!0,this._viewer.scene.globe.showSkirts=!0,this._state=_.INITIALIZED,this._callback=null}get type(){return"terrainClip"}get layer(){return this._layer}set enable(e){this._enable=e,this._viewer.scene.globe.clippingPlanes.enabled=e}get enable(){return this._enable}set clipOutSide(e){this._clipOutSide=e,this._viewer.scene.globe.clippingPlanes.unionClippingRegions=e}get clipOutSide(){return this._clipOutSide}set splitNum(e){this._splitNum=e}get splitNum(){return this._splitNum}set diffHeight(e){this._diffHeight=e}get diffHeight(){return this._diffHeight}addPlane(e=[],t={},r){t!=null&&t.diffHeight&&(this._diffHeight=t.diffHeight);let s=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat),o=i.Cartesian3.fromDegrees(e[1].lng,e[1].lat),n=i.Cartesian3.add(s,o,new i.Cartesian3);n=i.Cartesian3.multiplyByScalar(n,.5,n);let l=i.Cartesian3.normalize(n,new i.Cartesian3),h=i.Cartesian3.subtract(o,n,new i.Cartesian3);h=i.Cartesian3.normalize(h,h);let c=i.Cartesian3.cross(h,l,new i.Cartesian3);c=i.Cartesian3.normalize(c,c);let d=new i.Plane(c,0),m=i.Plane.getPointDistance(d,n),f=new i.ClippingPlane(c,m);this._id=v.uuid(),f.id=this._id,this._clippingPlanes.add(f),this._viewer.scene.globe.clippingPlanes=this._clippingPlanes,this._diffHeight>0&&this._prepareWall(e,t),this._callback=r}_prepareWall(e,t={}){let r=e.concat([e[0]]);this._minHeight=null,this._currentHeight=[];let s=this._viewer.terrainProvider;if(s&&!(s instanceof i.EllipsoidTerrainProvider)){let o=[];for(let l=0;l<r.length-1;l++){let h=this._lerp(r[l],r[l+1],this._splitNum);o=o.concat(h)}o.push(r[0]);let n=o.map(l=>i.Cartographic.fromDegrees(l.lng,l.lat,l.alt));i.sampleTerrainMostDetailed(s,n).then(l=>{let h=l.map(c=>{let d=i.Math.toDegrees(c.longitude),m=i.Math.toDegrees(c.latitude);return this._currentHeight.push(parseFloat(c.height)),(!this._minHeight||c.height<this._minHeight)&&(this._minHeight=c.height),{lng:d,lat:m,alt:c.height}});this._perCreateEntity(e,h,t)})}else r.forEach(o=>{this._currentHeight.push(parseFloat(o.alt)),(!this._minHeight||o.alt<this._minHeight)&&(this._minHeight=o.alt)}),this._perCreateEntity(r,r,t)}_perCreateEntity(e,t,r){let s=this._createWallSurface(t),o={id:this._id,diffHeight:this._diffHeight,original:r,positions:e,show:!0};this._area.push({id:this._id,diffHeight:this._diffHeight,original:r,positions:e,entityIds:[s],show:!0}),typeof this._callback=="function"&&this._callback(o)}_createWallSurface(e){let t=[];return e.forEach(s=>{t.push(parseFloat(s.lng)),t.push(parseFloat(s.lat))}),this._layer.entities.add({wall:{positions:i.Cartesian3.fromDegreesArray(t),material:new i.ImageMaterialProperty({image:this._image,repeat:new i.Cartesian2(8,1)}),minimumHeights:this._getHeights(e.length,this._minHeight-this._diffHeight),maximumHeights:this._currentHeight}}).id}_getHeights(e,t){let r=[];for(let s=0;s<e;s++)r.push(t);return r}_lerp(e,t,r=10){let s=[],o=i.Cartographic.fromDegrees(e.lng,e.lat,e.alt),n=i.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),d=o.height-(o.height-n.height)*(l/r);s.push({lng:i.Math.toDegrees(h),lat:i.Math.toDegrees(c),alt:d})}return s}toJSON(){return this._area}clear(){this._layer.entities.removeAll(),this._clippingPlanes.removeAll()}},zp=rn;var sn=class{constructor(e,t={}){if(!e)throw Error("missing viewer param");this._id=v.uuid(),this._viewer=e,this._delegate=void 0,this._layer=new i.CustomDataSource("TerrainUplift"),this._primitives=this._viewer.scene.primitives.add(new i.PrimitiveCollection,"TerrainUplift"),e.dataSources.add(this._layer),this._minHeight=null,this._currentHeight=[],this._area=[],this._enable=t.enable||!0,this._upHeight=t.upHeight||0,this._clipOutSide=t.clipOutSide||!1,this._diffHeight=t.diffHeight||0,this._upHeight=t.upHeight||0,this._image=t.image||"//data.mars3d.cn/img/textures/poly-land.png",this._imageBottom=t.imageBottom||"//data.mars3d.cn/img/textures/poly-soil.jpg",this._splitNum=t.splitNum||30,this._clippingPolygons=new i.ClippingPolygonCollection({enabled:this._enable,polygons:[],inverse:this._clipOutSide}),this._viewer.scene.globe.backFaceCulling=!0,this._viewer.scene.globe.showSkirts=!0,this._state=_.INITIALIZED,this._callback=null}get type(){return"TerrainUplift"}get layer(){return this._layer}set enable(e){this._enable=e,this._viewer.scene.globe.clippingPolygons.enabled=e}get enable(){return this._enable}set clipOutSide(e){this._clipOutSide=e,this._viewer.scene.globe.clippingPolygons.inverse=e}get clipOutSide(){return this._clipOutSide}set splitNum(e){this._splitNum=e}get splitNum(){return this._splitNum}set diffHeight(e){this._diffHeight=e}get diffHeight(){return this._diffHeight}set upHeight(e){this._upHeight=e}get upHeight(){return this._upHeight}addArea(e=[],t={},r){t!=null&&t.diffHeight&&(this._diffHeight=t.diffHeight),t!=null&&t.upHeight&&(this._upHeight=t.upHeight);let s=e.map(n=>i.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)),o=new i.ClippingPolygon({positions:s});this._id=v.uuid(),o.id=this._id,this._viewer.scene.globe.clippingPolygons=this._clippingPolygons,this._prepareWall(e,t,o),this._callback=r}_prepareWall(e,t={},r){let s=e.concat([e[0]]);this._minHeight=null,this._currentHeight=[];let o=this._viewer.terrainProvider;if(o&&!(o instanceof i.EllipsoidTerrainProvider)){let n=[];for(let h=0;h<s.length-1;h++){let c=this._lerp(s[h],s[h+1],this._splitNum);n=n.concat(c)}n.push(s[0]);let l=n.map(h=>i.Cartographic.fromDegrees(h.lng,h.lat,h.alt));i.sampleTerrainMostDetailed(o,l).then(h=>{let c=h.map(d=>{let m=i.Math.toDegrees(d.longitude),f=i.Math.toDegrees(d.latitude);return this._currentHeight.push(parseFloat(d.height)),(!this._minHeight||d.height<this._minHeight)&&(this._minHeight=d.height),{lng:m,lat:f,alt:d.height}});this._perCreateEntity(e,c,t),this._createUpliftArea(e,r)})}else s.forEach(n=>{this._currentHeight.push(parseFloat(n.alt)),(!this._minHeight||n.alt<this._minHeight)&&(this._minHeight=n.alt)}),this._perCreateEntity(s,s,t)}async _createUpliftArea(e,t){let r=Y("turf"),s=this._viewer.terrainProvider,o=this._getTinPoints(e),l=o.positionsResult.map(function(I){return r.point([i.Math.toDegrees(I.longitude),i.Math.toDegrees(I.latitude),I.height],{z:I.height})}),h=r.featureCollection(l),c=r.tin(h,"z"),{uniqueVertices:d,vertexIndexMap:m}=this._extractUniqueVertices(c),f=this._generateTriangleIndices(c,m),u=this._calculateUnifiedUV(d,o.tinExtent),p=d.map(([I,L])=>i.Cartographic.fromDegrees(I,L)),x=await Promise.resolve(this._getSceneImage(o.tinExtent));this._area[this._area.length-1].image=x;let C=await i.sampleTerrainMostDetailed(s,p),E=[];C.forEach(I=>{let L=i.Cartesian3.fromRadians(I.longitude,I.latitude,I.height+this._upHeight);E.push(L.x,L.y,L.z)});let b=new i.Geometry({attributes:{position:new i.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:new Float64Array(E)}),st:new i.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(u)})},indices:new Uint16Array(f),primitiveType:i.PrimitiveType.TRIANGLES,boundingSphere:i.BoundingSphere.fromVertices(E)}),R=new i.MaterialAppearance({material:new i.Material({fabric:{type:"Image",uniforms:{image:this._area[this._area.length-1].image,repeat:new i.Cartesian2(1,1)}}}),translucent:!1,closed:!0}),S=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:b,id:"tinSeamlessTexture"}),appearance:R,asynchronous:!1,releaseGeometryInstances:!0});S.id="dem_"+Date.now(),this._primitives.add(S),this._area[this._area.length-1].entityUpliftIds.push(S.id),this._clippingPolygons.add(t)}async _getCanvasXY(e){let{minLng:t,maxLng:r,minLat:s,maxLat:o}=e,n=this._viewer.terrainProvider,l=[i.Cartographic.fromDegrees(t,s),i.Cartographic.fromDegrees(r,o)],h=await i.sampleTerrainMostDetailed(n,l),c=i.Cartographic.fromRadians(h[0].longitude,h[0].latitude,h[0].height),d=i.Ellipsoid.WGS84.cartographicToCartesian(c),m=this._viewer.scene.cartesianToCanvasCoordinates(d),f=i.Cartographic.fromRadians(h[1].longitude,h[1].latitude,h[1].height),u=i.Ellipsoid.WGS84.cartographicToCartesian(f),p=this._viewer.scene.cartesianToCanvasCoordinates(u);return{x:m.x<p.x?m.x:p.x,y:m.y<p.y?m.y:p.y,width:Math.abs(p.x-m.x),height:Math.abs(p.y-m.y)}}_getSceneImage(e){return new Promise(async(t,r)=>{let{x:s,y:o,width:n,height:l}=await this._getCanvasXY(e),h=this._viewer.cameraPosition,c=this._viewer.scene,d=c.canvas,m=document.createElement("canvas"),f=m.getContext("2d"),u=document.createElement("canvas"),p=u.getContext("2d"),C=document.createElement("canvas").getContext("2d"),E=()=>{try{let b=d.toDataURL("image/png"),R=new Image;R.crossOrigin="anonymous",R.src=b,R.onload=()=>{try{u.width=R.width,u.height=R.height,m.width=n,m.height=l,p.drawImage(R,0,0);let S=p.getImageData(0,0,u.width,u.height);p.putImageData(S,0,0),f.drawImage(u,s,o,n,l,0,0,n,l);let I=m.toDataURL("image/png",1).replace("image/png","image/octet-stream");t(I)}catch(S){r(S)}finally{c.postRender.removeEventListener(E)}},R.onerror=S=>{r(new Error("\u56FE\u50CF\u52A0\u8F7D\u5931\u8D25: "+S)),c.postRender.removeEventListener(E)}}catch(b){console.error("\u622A\u56FE\u5931\u8D25:",b),r(b),c.postRender.removeEventListener(E)}};c.postRender.addEventListener(E),c.render(this._viewer.clock.currentTime)})}_getBase64ImageData(e){let{minLng:t,maxLng:r,minLat:s,maxLat:o}=e,n=new CesiumOffscreenRenderer(this._viewer),l=[t,s,r,o];return console.log("bounds...",l),n.getSceneImageByBounds(l,{orientation:{heading:i.Math.toRadians(0),pitch:i.Math.toRadians(-45),roll:0},imageType:"image/png",quality:1})}initOffscreenRendering(e=1920,t=1080){let r=document.createElement("canvas");r.width=e,r.height=t;let s=r.getContext("webgl2")||r.getContext("webgl"),o=new i.Scene({canvas:r,context:s,globe:this._viewer.scene.globe,terrainProvider:this._viewer.terrainProvider,imageryProvider:this._viewer.imageryLayers._layers[0],skyBox:this._viewer.scene.skyBox,skyAtmosphere:this._viewer.scene.skyAtmosphere,useWebGL2:!0,creditContainer:document.createElement("div")}),n=new i.Camera(o),l=this.syncCameraFromMainScene(n);return{offscreenScene:o,offscreenCamera:l,offscreenCanvas:r}}syncCameraFromMainScene(e){if(!e)return;let t=this._viewer.camera;return e.position=i.Cartesian3.clone(t.position),e.direction=i.Cartesian3.clone(t.direction),e.up=i.Cartesian3.clone(t.up),e.right=i.Cartesian3.clone(t.right),e.frustum=t.frustum.clone(),e}async renderOffscreen(e){let{x:t,y:r,width:s,height:o}=e,n,l,h;try{if(!l){let d=this.initOffscreenRendering(s,o);l=d.offscreenScene,h=this._viewer.camera,n=d.offscreenCanvas}h=this.syncCameraFromMainScene(h),l.camera=h,await new Promise(d=>{l.postRender.addEventListener(function m(){l.postRender.removeEventListener(m),d()}),l.render(this._viewer.clock.currentTime)});let c=n.toDataURL("image/png");return console.log(1111111111,c),c}catch(c){return console.error("\u79BB\u5C4F\u6E32\u67D3\u5931\u8D25\uFF1A",c),null}}_calculateUnifiedUV(e,t){let{minLng:r,maxLng:s,minLat:o,maxLat:n}=t,l=[];return e.forEach(([h,c])=>{let d=(h-r)/(s-r),m=(c-o)/(n-o);l.push(d,m)}),l}_generateTriangleIndices(e,t){let r=[];return e.features.forEach(o=>{let l=o.geometry.coordinates[0].slice(0,3),h=l.map(d=>{let m=d.map(f=>f.toFixed(6)).join(",");return t.get(m)});this._checkClockwise(l)||h.reverse(),r.push(...h)}),r}_checkClockwise(e){let[t,r,s]=e;return(r[0]-t[0])*(s[1]-t[1])-(r[1]-t[1])*(s[0]-t[0])>0}_extractUniqueVertices(e){let t=[],r=new Map,s=6;return e.features.forEach(o=>{o.geometry.coordinates[0].slice(0,3).forEach(h=>{let c=h.map(d=>d.toFixed(s)).join(",");r.has(c)||(r.set(c,t.length),t.push(h))})}),{uniqueVertices:t,vertexIndexMap:r}}_getTinPoints(e,t=100){let r=Y("turf"),s=e.reduce((L,k)=>L.lng<k.lng?L:k).lng,o=e.reduce((L,k)=>L.lng>k.lng?L:k).lng,n=e.reduce((L,k)=>L.lat<k.lat?L:k).lat,l=e.reduce((L,k)=>L.lat>k.lat?L:k).lat,h=i.Rectangle.fromDegrees(s,n,o,l),c=JSON.parse(JSON.stringify(e)).concat(e[0]).map(L=>[L._lng,L._lat]),d=r.polygon([c]),m=t,f=t,u=[],p=[];for(let L=0;L<f;L++)for(var x=0;x<m;x++){let k=i.Math.lerp(h.west,h.east,x/(m-1)),F=i.Math.lerp(h.south,h.north,L/(f-1));p.push([i.Math.toDegrees(k),i.Math.toDegrees(F),0]);let $=r.point([i.Math.toDegrees(k),i.Math.toDegrees(F)]);r.booleanPointInPolygon($,d)&&u.push(i.Cartographic.fromRadians(k,F))}let C=p.map(function(L){return r.point(L,{z:0})}),E=r.featureCollection(C),b=r.tin(E,"z"),R=r.lineString(c),S=[];for(let L=0;L<b.features.length;L++){let k=b.features[L].geometry.coordinates[0],F=r.lineString(k);r.lineIntersect(R,F).features.forEach(ne=>{let re=ne.geometry.coordinates;S.push(i.Cartographic.fromDegrees(re[0],re[1]))})}let I=this._uniqueByKeyOld(S,"longitude");return{positionsResult:u.concat(I),tinExtent:{minLng:s,maxLng:o,minLat:n,maxLat:l}}}_uniqueByKeyOld(e,t){return e.filter((r,s)=>{let o=e.findIndex(n=>n[t]===r[t]);return s===o})}_perCreateEntity(e,t,r){let s=this._createWallSurface(t),o=this._createBottomSurface(e),n={id:this._id,diffHeight:this._diffHeight,original:r,positions:e,entityIds:[s[0],o[0]],entityUpliftIds:[s[1],o[1]],show:!0,image:null};this._area.push(n),typeof this._callback=="function"&&this._callback(n)}_createWallSurface(e){let t=[],r=Date.now();e.forEach(n=>{t.push(parseFloat(n.lng)),t.push(parseFloat(n.lat))});let s=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:new i.WallGeometry({positions:i.Cartesian3.fromDegreesArray(t),minimumHeights:this._getHeights(e.length,this._minHeight-this._diffHeight),maximumHeights:this._currentHeight}),attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(i.Color.WHITE.withAlpha(1))}}),appearance:new i.MaterialAppearance({material:new i.Material({fabric:{type:"Image",uniforms:{image:this._image,repeat:new i.Cartesian2(8,1)}}}),translucent:!1})});s.id="wallSurface_"+r,this._primitives.add(s);let o=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:new i.WallGeometry({positions:i.Cartesian3.fromDegreesArray(t),minimumHeights:this._getHeights(e.length,this._minHeight-this._diffHeight,this._upHeight),maximumHeights:this._currentHeight.map(n=>n+this._upHeight)}),attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(i.Color.WHITE.withAlpha(.5))}}),appearance:new i.MaterialAppearance({material:new i.Material({fabric:{type:"Image",uniforms:{image:this._image,repeat:new i.Cartesian2(8,1)}},translucent:!0}),translucent:!0})});return o.id="wallUplift_"+r,this._primitives.add(o),[s.id,o.id]}_createBottomSurface(e){let t=[],r=Date.now();e.forEach(c=>{t.push(parseFloat(c.lng)),t.push(parseFloat(c.lat)),t.push(this._minHeight-this._diffHeight)});let s=new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(t)),o=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:new i.PolygonGeometry({polygonHierarchy:s,perPositionHeight:!0}),attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(i.Color.WHITE.withAlpha(1))}}),appearance:new i.MaterialAppearance({material:new i.Material({fabric:{type:"Image",uniforms:{image:this._imageBottom,repeat:new i.Cartesian2(1,2)}}}),translucent:!1})});o.id="bottomSurface_"+r,this._primitives.add(o);let n=[];e.forEach(c=>{n.push(parseFloat(c.lng)),n.push(parseFloat(c.lat)),n.push(this._minHeight-this._diffHeight+this._upHeight)});let l=new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(n)),h=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:new i.PolygonGeometry({polygonHierarchy:l,perPositionHeight:!0}),attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(i.Color.WHITE.withAlpha(1))}}),appearance:new i.MaterialAppearance({material:new i.Material({fabric:{type:"Image",uniforms:{image:this._imageBottom,repeat:new i.Cartesian2(1,2)},transparent:!0}}),translucent:!0})});return h.id="bottomUplift_"+r,this._primitives.add(h),[o.id,h.id]}_getHeights(e,t,r=0){let s=[];for(let o=0;o<e;o++)s.push(t+r);return s}_lerp(e,t,r=10){let s=[],o=i.Cartographic.fromDegrees(e.lng,e.lat,e.alt),n=i.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),d=o.height-(o.height-n.height)*(l/r);s.push({lng:i.Math.toDegrees(h),lat:i.Math.toDegrees(c),alt:d})}return s}getAreaById(e){let t=this._area.find(r=>r.id===e);return t&&t!==null?t:null}removeArea(e){let t=this._area.findIndex(l=>l.id===e);if(t==null)throw Error("missing index result");let r=this._area[t],s=[];for(let l=0;l<this._primitives._primitives.length;l++){let h=this._primitives._primitives[l];(r.entityIds.includes(h.id)||r.entityUpliftIds.includes(h.id))&&s.push(h)}s.forEach(l=>{this._primitives.remove(l)});let o=this._clippingPolygons._polygons.findIndex(l=>l.id===e),n=this._clippingPolygons.get(o);return this._area.splice(t,1),n&&this._clippingPolygons.remove(n),this}flyToArea(e){let t=this._area.findIndex(s=>s.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];return this._primitives._primitives.forEach(s=>{r.entityUpliftIds[2]===s.id&&console.log("dem1111111111111",s)}),this}toJSON(){return this._area}clear(){this._primitives.removeAll(),this._primitives.removeAll(),this._clippingPolygons.removeAll()}destroy(){this._primitives.destroy(),this._primitives.destroy(),this._clippingPolygons.removeAll()}},Wp=sn;var on=class{constructor(e){Pi(this,"_analysisTerrainVisible",e=>{let t=this._viewer.terrainProvider,r=e.map(s=>i.Cartographic.fromDegrees(s.lng,s.lat,s.alt));i.sampleTerrainMostDetailed(t,r).then(s=>{let o=0,n=null;for(let l=0;l<s.length-1;l++){if(l<s.length-2){let h=e[l],c=e[l+1],d=i.Cartesian3.fromDegrees(h.lng,h.lat,h.alt),m=i.Cartesian3.fromDegrees(c.lng,c.lat,c.alt);if(n=this._analysisModelVisible([d,m]),i.defined(n)&&i.defined(n.object)){console.log("\u5728\u6A21\u578B\u4E0A.");let f=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat,e[0].alt),u=i.Cartesian3.fromDegrees(e[e.length-1].lng,e[e.length-1].lat,e[e.length-1].alt);this._drawLine(n.position,f,i.Color.GREEN),this._drawLine(n.position,u,i.Color.RED);break}}if(s[l].height>=e[l].alt){console.log("\u5728\u5730\u5F62\u4E0A."),o=l;let h=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat,e[0].alt),c=i.Cartesian3.fromDegrees(e[l].lng,e[l].lat,e[l].alt),d=i.Cartesian3.fromDegrees(e[e.length-1].lng,e[e.length-1].lat,e[e.length-1].alt);this._drawLine(h,c,i.Color.GREEN),this._drawLine(c,d,i.Color.RED);break}}if(o===0&&n===null){console.log("\u5168\u90E8\u53EF\u89C6.");let l=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat,e[0].alt),h=i.Cartesian3.fromDegrees(e[e.length-1].lng,e[e.length-1].lat,e[e.length-1].alt);this._drawLine(l,h,i.Color.GREEN)}})});Pi(this,"_analysisModelVisible",e=>{let t=i.Cartesian3.normalize(i.Cartesian3.subtract(e[1],e[0],new i.Cartesian3),new i.Cartesian3),r=new i.Ray(e[0],t);return this._viewer.scene.pickFromRay(r)});this._id=v.uuid(),this._viewer=e,this._layer=new i.CustomDataSource("sightLine"),this._viewer.dataSources.add(this._layer)}get type(){return"sightLine"}get layer(){return this._layer}_init(e,t,r=10){this._layer&&this._layer.entities.removeAll();let s=i.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),o=i.Cartesian3.fromDegrees(t.lng,t.lat,t.alt),n=this._viewer.terrainProvider;if(n&&!(n instanceof i.EllipsoidTerrainProvider)){let l=this._lerp(e,t,r).concat([t]);this._analysisTerrainVisible(l)}else this._analysisVisible([s,o])}_analysisVisible(e){let t=this._analysisModelVisible(e);if(i.defined(t)&&i.defined(t.object)){let r=this._drawLine(t.position,e[0],i.Color.GREEN),s=this._drawLine(t.position,e[1],i.Color.RED);console.log("\u5728\u6A21\u578B\u4E0A.",r,s)}else{let r=this._drawLine(e[0],e[1],i.Color.GREEN);console.log("\u4E0D\u5728\u6A21\u578B\u4E0A",r)}}_drawLine(e,t,r){return this._layer||(this._layer=new i.CustomDataSource("sightLine"),this._viewer.dataSources.add(this._layer)),this._layer&&this._layer.entities.add({polyline:{positions:[e,t],width:2,material:r,depthFailMaterial:r}}),this}_lerp(e,t,r=10){let s=[],o=i.Cartographic.fromDegrees(e.lng,e.lat,e.alt),n=i.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),d=o.height-(o.height-n.height)*(l/r);s.push({lng:i.Math.toDegrees(h),lat:i.Math.toDegrees(c),alt:d})}return s}deactivate(){this._layer&&this._layer.entities.removeAll(),this._layer&&this._viewer.dataSources.remove(this._layer),this._layer=null}},Gp=on;var Up=`#define USE_CUBE_MAP_SHADOW true
1725
2285
  uniform sampler2D colorTexture;
1726
2286
  uniform sampler2D depthTexture;
1727
2287
  in vec2 v_textureCoordinates;
@@ -1841,8 +2401,388 @@ void main(){
1841
2401
  }
1842
2402
  }
1843
2403
  }
1844
- }`;var Wn=class{constructor(e){this._id=C.uuid(),this._viewer=e,this._sketch=void 0,this._postStage=void 0,this._enable=!0,this._viewPosition=void 0,this._viewPositionEnd=void 0,this._viewDistance=void 0,this._viewHeading=void 0,this._viewPitch=void 0,this._horizontalViewAngle=90,this._verticalViewAngle=60,this._visibleAreaColor=i.Color.GREEN,this._invisibleAreaColor=i.Color.RED,this._softShadows=!0,this._size=2048}get type(){return"viewshed"}set enable(e){this._enable=e,this.update()}get enable(){return this._enable}set viewPosition(e){this._viewPosition=e,this.update()}get viewPosition(){return this._viewPosition}set viewDistance(e){this._viewDistance=e,this.update()}get viewDistance(){return this._viewDistance}set viewHeading(e){this._viewHeading=e,this.update()}get viewHeading(){return this._viewHeading}set viewPitch(e){this._viewPitch=e,this.update()}get viewPitch(){return this._viewPitch}set horizontalViewAngle(e){this._horizontalViewAngle=e,this.update()}get horizontalViewAngle(){return this._horizontalViewAngle}set verticalViewAngle(e){this._verticalViewAngle=e,this.update()}get verticalViewAngle(){return this._verticalViewAngle}set visibleAreaColor(e){this._visibleAreaColor=e,this.update()}get visibleAreaColor(){return this._visibleAreaColor}set invisibleAreaColor(e){this._invisibleAreaColor=e,this.update()}get invisibleAreaColor(){return this._invisibleAreaColor}_init(e,t={}){this._enable=typeof t.enable=="boolean"?t.enable:!0,this._viewPosition=f.transformWGS84ToCartesian(e),this._viewPositionEnd=f.transformWGS84ToCartesian(e),this._viewDistance=t.viewDistance||(this._viewPositionEnd?i.Cartesian3.distance(this._viewPosition,this._viewPositionEnd):100),this._viewHeading=t.viewHeading||(this._viewPositionEnd?this._getHeading(this._viewPosition,this._viewPositionEnd):0),this._viewPitch=t.viewPitch||(this._viewPositionEnd?this._getPitch(this._viewPosition,this._viewPositionEnd):0),this._horizontalViewAngle=t.horizontalViewAngle||90,this._verticalViewAngle=t.verticalViewAngle||60,this._visibleAreaColor=t.visibleAreaColor||i.Color.GREEN,this._invisibleAreaColor=t.invisibleAreaColor||i.Color.RED,this._softShadows=typeof t.softShadows=="boolean"?t.softShadows:!0,this._size=t.size||2048}_add(){this._createLightCamera(),this._createShadowMap(),this._drawSketch(),this._createPostStage()}update(){this.deactivate(),this._add()}updatePosition(e){this._viewPositionEnd=e,this._viewDistance=i.Cartesian3.distance(this._viewPosition,this._viewPositionEnd),this._viewHeading=this._getHeading(this._viewPosition,this._viewPositionEnd),this._viewPitch=this._getPitch(this._viewPosition,this._viewPositionEnd),this._sketch||this._drawSketch()}deactivate(){this._sketch&&(this._viewer.entities.remove(this._sketch),this._sketch=void 0),this._postStage&&(this._viewer.scene.postProcessStages.remove(this._postStage),this._postStage=void 0)}_createLightCamera(){this.lightCamera=new i.Camera(this._viewer.scene),this.lightCamera.position=this._viewPosition,this.lightCamera.frustum.near=this._viewDistance*.001,this.lightCamera.frustum.far=this._viewDistance;let e=i.Math.toRadians(this._horizontalViewAngle),t=i.Math.toRadians(this._verticalViewAngle),r=this._viewDistance*Math.tan(e/2)*2/(this._viewDistance*Math.tan(t/2)*2);this.lightCamera.frustum.aspectRatio=r,e>t?this.lightCamera.frustum.fov=e:this.lightCamera.frustum.fov=t,this.lightCamera.setView({destination:this._viewPosition,orientation:{heading:i.Math.toRadians(this._viewHeading||0),pitch:i.Math.toRadians(this._viewPitch||0),roll:0}})}_createShadowMap(){this.shadowMap=new i.ShadowMap({context:this._viewer.scene.context,lightCamera:this.lightCamera,enabled:this._enable,isPointLight:!0,pointLightRadius:this._viewDistance,cascadesEnabled:!1,size:this._size,softShadows:this._softShadows,normalOffset:!1,fromLightSource:!1,darkness:1}),this._viewer.scene.shadowMap=this.shadowMap}_createPostStage(){let e=new i.PostProcessStage({fragmentShader:qf,uniforms:{shadowMap_textureCube:()=>(this.shadowMap.update(Reflect.get(this._viewer.scene,"_frameState")),Reflect.get(this.shadowMap,"_shadowMapTexture")),shadowMap_matrix:()=>(this.shadowMap.update(Reflect.get(this._viewer.scene,"_frameState")),Reflect.get(this.shadowMap,"_shadowMapMatrix")),shadowMap_lightPositionEC:()=>(this.shadowMap.update(Reflect.get(this._viewer.scene,"_frameState")),Reflect.get(this.shadowMap,"_lightPositionEC")),shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:()=>{this.shadowMap.update(Reflect.get(this._viewer.scene,"_frameState"));let t=this.shadowMap._pointBias;return i.Cartesian4.fromElements(t.normalOffsetScale,this.shadowMap._distance,this.shadowMap.maximumDistance,0,new i.Cartesian4)},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:()=>{this.shadowMap.update(Reflect.get(this._viewer.scene,"_frameState"));let t=this.shadowMap._pointBias,s=new i.Cartesian2;return s.x=1/this.shadowMap._textureSize.x,s.y=1/this.shadowMap._textureSize.y,i.Cartesian4.fromElements(s.x,s.y,t.depthBias,t.normalShadingSmooth,new i.Cartesian4)},camera_projection_matrix:this.lightCamera.frustum.projectionMatrix,camera_view_matrix:this.lightCamera.viewMatrix,helsing_viewDistance:()=>this._viewDistance,helsing_visibleAreaColor:this._visibleAreaColor,helsing_invisibleAreaColor:this._invisibleAreaColor}});this._postStage=this._viewer.scene.postProcessStages.add(e)}drawFrustumOutline(){let e=new i.Cartesian3,t=new i.Matrix3,r=new i.Quaternion,s=this.lightCamera.positionWC,o=this.lightCamera.directionWC,n=this.lightCamera.upWC,l=this.lightCamera.rightWC;l=i.Cartesian3.negate(l,e);let h=t;i.Matrix3.setColumn(h,0,l,h),i.Matrix3.setColumn(h,1,n,h),i.Matrix3.setColumn(h,2,o,h);let c=i.Quaternion.fromRotationMatrix(h,r),p=new i.GeometryInstance({geometry:new i.FrustumOutlineGeometry({frustum:this.lightCamera.frustum,origin:this._viewPosition,orientation:c}),id:Math.random().toString(36).substr(2),attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(i.Color.YELLOWGREEN),show:new i.ShowGeometryInstanceAttribute(!0)}});this.frustumOutline=this._viewer.scene.primitives.add(new i.Primitive({geometryInstances:[p],appearance:new i.PerInstanceColorAppearance({flat:!0,translucent:!1})}))}_drawSketch(){this._sketch=this._viewer.entities.add({name:"sketch",position:this._viewPosition,show:!0,orientation:new i.CallbackProperty(()=>i.Transforms.headingPitchRollQuaternion(this._viewPosition,i.HeadingPitchRoll.fromDegrees(this._viewHeading-90,this._viewPitch,0)),!1),ellipsoid:{radii:new i.CallbackProperty(()=>new i.Cartesian3(this._viewDistance,this._viewDistance,this._viewDistance),!1),innerRadii:new i.Cartesian3(2,2,2),minimumClock:i.Math.toRadians(-this._horizontalViewAngle/2),maximumClock:i.Math.toRadians(this._horizontalViewAngle/2),minimumCone:i.Math.toRadians(this._verticalViewAngle+7.75),maximumCone:i.Math.toRadians(180-this._verticalViewAngle-7.75),fill:!1,outline:!0,subdivisions:256,stackPartitions:64,slicePartitions:64,outlineColor:i.Color.YELLOWGREEN}})}_getHeading(e,t){let r=new i.Cartesian3,s=i.Transforms.eastNorthUpToFixedFrame(e);return i.Matrix4.inverse(s,s),i.Matrix4.multiplyByPoint(s,t,r),i.Cartesian3.normalize(r,r),i.Math.toDegrees(Math.atan2(r.x,r.y))}_getPitch(e,t){let r=new i.Cartesian3,s=i.Transforms.eastNorthUpToFixedFrame(e);return i.Matrix4.inverse(s,s),i.Matrix4.multiplyByPoint(s,t,r),i.Cartesian3.normalize(r,r),i.Math.toDegrees(Math.asin(r.z))}},Zf=Wn;var Gn=class{constructor(e){if(!e)throw Error("missing viewer param");this._viewer=e,this._contourLine=new Wf(e),this._tilesetShake=new Gf(e),this._sightLine=new jf(e),this._viewshed=new Zf(e)}get ContourLine(){return this._contourLine}get TilesetShake(){return this._tilesetShake}get SightLine(){return this._sightLine}get ViewShed(){return this._viewshed}contourLine(e,t,r){this._contourLine._init(e,t,r)}tilesetShake(e,t){this._tilesetShake._init(e,t)}terrainClip(e={}){return new Uf(this._viewer,e)}terrainClipPlan(e={}){return new Bf(this._viewer,e)}terrainUplift(e={}){return new Vf(this._viewer,e)}sightLine(e,t,r){return this._sightLine._init(e,t,r)}viewshed(e,t){return this._viewshed._init(e,t),this._viewshed}deactivate(e=null){switch(e){case xt.SIGHT_LINE:this._sightLine.deactivate();break;case xt.VIEW_SHED:this._viewshed.deactivate();break;default:this._contourLine.deactivate(),this._tilesetShake.deactivate();break}return this}},Yf=Gn;var Un=class{constructor(e){this._style=e,this._viewer=void 0,this._layer=void 0,this._delegate=void 0,this._options={},this._positions=[]}get drawTool(){return this._viewer.drawTool}_mountedHook(){}_onDrawAnchor(e){}_onAnchorMoving(e){this._positions.pop(),this._positions.push(e),this._options.onCalc&&this._options.onCalc(this._positions)}_onDrawStop(){this._unbindEvent(),this._viewer.drawTool.deactivate(),this._options.onDrawStop&&this._options.onDrawStop(this._delegate)}_bindEvent(){this.drawTool.on(E.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.on(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.on(E.DRAW_STOP,this._onDrawStop,this)}_unbindEvent(){this.drawTool.off(E.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.off(E.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.off(E.DRAW_STOP,this._onDrawStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.drawTool.activate(t),this._mountedHook(),this._unbindEvent(),this._bindEvent(),this}},Xf=Un;var Bn=class extends Xf{constructor(e){super(e)}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polyline:{...this._style,positions:new i.CallbackProperty(()=>this._positions,!1)}}),this._layer.entities.add(this._delegate)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),t>0&&this.drawTool.fire(E.CREATE_ANCHOR,{position:e}),t>=this._options.maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(E.DRAW_STOP,e))}},Jf=Bn;var Vn=class{constructor(){this._viewer=void 0,this._layer=void 0,this._startLabel=new i.Entity({label:{text:"\u5F00\u59CB",font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._resultLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._options={}}_getSampledHeight(e,t=!1){let r=this._viewer.terrainProvider&&!(this._viewer.terrainProvider instanceof i.EllipsoidTerrainProvider)?i.sampleTerrainMostDetailed(this._viewer.terrainProvider,e.map(o=>i.Cartographic.fromCartesian(o))):Promise.resolve(e.map(o=>i.Cartographic.fromCartesian(o))),s=this._viewer.scene.clampToHeightSupported&&t?this._viewer.scene.clampToHeightMostDetailed(e,this._layer.entities.values):Promise.resolve(e);return Promise.all([r,s])}_onDrawStop(e){}_onComputedStop(e,t=!1){let r=[];return t?r=e.map((s,o)=>{let l=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(s),h=0;for(let c=1;c<=o;c++){let p=i.Cartesian3.distance(e[c-1],e[c]);h+=p}return{longitude:i.Math.toDegrees(l.longitude),latitude:i.Math.toDegrees(l.latitude),height:l.height,distance:h,cartesian3Position:s}}):r=e.map((s,o)=>{let n=0;for(let l=1;l<=o;l++){let h=i.Cartesian3.fromRadians(e[l-1].longitude,e[l-1].latitude,e[l-1].height),c=i.Cartesian3.fromRadians(e[l].longitude,e[l].latitude,e[l].height),p=i.Cartesian3.distance(h,c);n+=p}return{longitude:i.Math.toDegrees(s.longitude),latitude:i.Math.toDegrees(s.latitude),height:s.height,distance:n,cartesian3Position:i.Cartesian3.fromRadians(s.longitude,s.latitude,s.height)}}),r}_onCalc(e){}_startHook(e,t){this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._options.onDrawStop=this._onDrawStop.bind(this),this._options.onCalc=this._onCalc.bind(this),this._layer.entities.add(this._startLabel),this._layer.entities.add(this._resultLabel)}start(e,t){return this}},Kf=Vn;var jn=class extends Kf{constructor(){super(),this._maxAnchorSize=9999,this._positions=[],this._includeModel=!0,this._callback=null}_lerp(e,t,r=5){let s=[],o=i.Cartographic.fromCartesian(e),n=i.Cartographic.fromCartesian(t);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),p=o.height-(o.height-n.height)*(l/r);s.push(i.Cartesian3.fromRadians(h,c,p))}return s}async _onDrawStop(e){let t=this._positions.filter((s,o)=>o!==1),r=await this._onComputedStop(t,this._includeModel);typeof this._callback=="function"&&await this._callback(r)}_stoppedHook(){this._options.onDrawStop&&this._options.onDrawStop(entity)}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){let t=[e[0]];this._resultLabel.position=e[e.length-1];for(let r=0;r<e.length-1;r++)t=t.concat(this._lerp(e[r],e[r+1],this._options.lerpNum));t.push(e[e.length-1]),this._getSampledHeight(t,this._includeModel).then(([r,s])=>(this._includeModel||(this._positions=r),r.map((o,n)=>i.Cartesian3.fromDegrees(i.Math.toDegrees(o.longitude),i.Math.toDegrees(o.latitude),Math.max(o.height||0,s[n]?i.Cartographic.fromCartesian(s[n]).height:0))))).then(r=>{this._includeModel&&(this._positions=r);let s=0;for(let o=0;o<r.length-1;o++){let n=i.Cartesian3.distance(r[o],r[o+1]);s+=n}this._resultLabel.label.text=s>1e3?`\u8DDD\u79BB\uFF1A${(s/1e3).toFixed(2)} \u516C\u91CC`:`\u8DDD\u79BB\uFF1A${s.toFixed(2)} \u7C73`})}}start(e,t,r={}){return this._startHook(e,r),new Jf({material:r.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:r.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:r.width||2,clampToGround:!0}).start(e,{...this._options,maxAnchorSize:this._maxAnchorSize}),this._includeModel=r==null?void 0:r.includeModel,this._callback=t,this}},Qf=jn;var qn=class{constructor(e){if(!e)throw Error("missing viewer param");this._viewer=e,this._layer=new i.CustomDataSource("plotAnalysis-layer"),this._viewer.dataSources.add(this._layer)}get viewer(){return this._viewer}get layer(){return this._layer}profile(e,t={}){var r;return(r=new Qf)==null||r.start(this,e,t),this}activate(e,t){switch(e){case Hi.PROFILE:this.profile(t);break;default:break}return this}deactivate(){return this._layer.entities.removeAll(),this._viewer.drawTool.tooltipMess="",this._viewer.drawTool.deactivate(),this._viewer.editTool.tooltipMess="",this._viewer.editTool.deactivate(),this}},$f=qn;var dY=i.Cartesian2,mY=i.Cartesian3,uY=i.Matrix3,_Y=i.Matrix4,fY=i.Material,gY=i.SceneMode,yY=i.SkyBox,vY=i.Color,wY=i.Rectangle,CY=i.ShadowMode,xY=i.JulianDate,TY=i.HeightReference,EY=i.HorizontalOrigin,PY=i.VerticalOrigin,bY=i.CallbackProperty,AY=i.ClassificationType,MY=i.Cesium3DTileStyle,IY=i.GeographicTilingScheme,SY=i.WebMercatorTilingScheme,DY=i.ColorMaterialProperty,LY=i.ImageMaterialProperty,RY=i.PolylineDashMaterialProperty,OY=i.PolylineGlowMaterialProperty,kY=i.PolylineOutlineMaterialProperty,FY=i.PolylineArrowMaterialProperty,zY=i.writeTextToCanvas,NY=i.CustomShaderMode,HY=i.CustomShaderTranslucencyMode,WY=i.CustomShader,GY=i.UniformType,UY=i.Ellipsoid,BY=i.Resource,VY=i.createGooglePhotorealistic3DTileset,jY=i.createElevationBandMaterial,qY=i.ModelAnimationLoop,ZY=i.ClippingPlane,YY=i.ClippingPlaneCollection,XY=i.ClippingPolygon,JY=i.ClippingPolygonCollection;globalThis.__cmdOut=()=>{console.clear(),console.log(`%c
2404
+ }`;var an=class{constructor(e){this._id=v.uuid(),this._viewer=e,this._sketch=void 0,this._postStage=void 0,this._enable=!0,this._viewPosition=void 0,this._viewPositionEnd=void 0,this._viewDistance=void 0,this._viewHeading=void 0,this._viewPitch=void 0,this._horizontalViewAngle=90,this._verticalViewAngle=60,this._visibleAreaColor=i.Color.GREEN,this._invisibleAreaColor=i.Color.RED,this._lastUpdateTime=Date.now(),this._softShadows=!1,this._size=1024}get type(){return"viewshed"}set enable(e){this._enable=e,this.update()}get enable(){return this._enable}set viewPosition(e){this._viewPosition=e,this._postStage&&(this._viewer.scene.postProcessStages.remove(this._postStage),this._postStage=void 0),this._add()}get viewPosition(){return this._viewPosition}set viewDistance(e){this._viewDistance=e,this.update()}get viewDistance(){return this._viewDistance}set viewHeading(e){this._viewHeading=e,this.update()}get viewHeading(){return this._viewHeading}set viewPitch(e){this._viewPitch=e,this.update()}get viewPitch(){return this._viewPitch}set horizontalViewAngle(e){this._horizontalViewAngle=e,this.update()}get horizontalViewAngle(){return this._horizontalViewAngle}set verticalViewAngle(e){this._verticalViewAngle=e,this.update()}get verticalViewAngle(){return this._verticalViewAngle}set visibleAreaColor(e){this._visibleAreaColor=e,this.update()}get visibleAreaColor(){return this._visibleAreaColor}set invisibleAreaColor(e){this._invisibleAreaColor=e,this.update()}get invisibleAreaColor(){return this._invisibleAreaColor}_init(e,t={}){this._enable=typeof t.enable=="boolean"?t.enable:!0,this._viewPosition=g.transformWGS84ToCartesian(e),this._viewPositionEnd=g.transformWGS84ToCartesian(e),this._viewDistance=t.viewDistance||(this._viewPositionEnd?i.Cartesian3.distance(this._viewPosition,this._viewPositionEnd):100),this._viewHeading=t.viewHeading||(this._viewPositionEnd?this._getHeading(this._viewPosition,this._viewPositionEnd):0),this._viewPitch=t.viewPitch||(this._viewPositionEnd?this._getPitch(this._viewPosition,this._viewPositionEnd):0),this._horizontalViewAngle=t.horizontalViewAngle||90,this._verticalViewAngle=t.verticalViewAngle||60,this._visibleAreaColor=t.visibleAreaColor||i.Color.GREEN,this._invisibleAreaColor=t.invisibleAreaColor||i.Color.RED,this._softShadows=typeof t.softShadows=="boolean"?t.softShadows:!1,this._size=t.size||1024}_add(){this._createLightCamera(),this._createShadowMap(),this._drawSketch(),this._createPostStage()}update(){this.deactivate(),this._add()}updatePosition(e){this._viewPositionEnd=e,this._viewDistance=i.Cartesian3.distance(this._viewPosition,this._viewPositionEnd),this._viewHeading=this._getHeading(this._viewPosition,this._viewPositionEnd),this._viewPitch=this._getPitch(this._viewPosition,this._viewPositionEnd),this._sketch||this._drawSketch()}deactivate(){this._sketch&&(this._viewer.entities.remove(this._sketch),this._sketch=void 0),this._postStage&&(this._viewer.scene.postProcessStages.remove(this._postStage),this._postStage=void 0),this.shadowMap&&(this._viewer.scene.shadowMap=null,this.shadowMap.destroy(),this.shadowMap=void 0)}_createLightCamera(){this.lightCamera||(this.lightCamera=new i.Camera(this._viewer.scene)),this.lightCamera.position=this._viewPosition,this.lightCamera.frustum.near=this._viewDistance*.001,this.lightCamera.frustum.far=this._viewDistance;let e=i.Math.toRadians(this._horizontalViewAngle),t=i.Math.toRadians(this._verticalViewAngle),r=this._viewDistance*Math.tan(e/2)*2/(this._viewDistance*Math.tan(t/2)*2);this.lightCamera.frustum.aspectRatio=r,e>t?this.lightCamera.frustum.fov=e:this.lightCamera.frustum.fov=t,this.lightCamera.setView({destination:this._viewPosition,orientation:{heading:i.Math.toRadians(this._viewHeading||0),pitch:i.Math.toRadians(this._viewPitch||0),roll:0}})}_createShadowMap(){this.shadowMap=new i.ShadowMap({context:this._viewer.scene.context,lightCamera:this.lightCamera,enabled:this._enable,isPointLight:!0,pointLightRadius:this._viewDistance,cascadesEnabled:!1,size:this._size,softShadows:this._softShadows,normalOffset:!1,fromLightSource:!1,darkness:1}),this._viewer.scene.shadowMap=this.shadowMap}_createPostStage(){if(!this._postStage){let e=new i.PostProcessStage({fragmentShader:Up,uniforms:{shadowMap_textureCube:()=>this.shadowMap._shadowMapTexture,shadowMap_lightPositionEC:()=>(this.shadowMap.update(Reflect.get(this._viewer.scene,"_frameState")),Reflect.get(this.shadowMap,"_lightPositionEC")),shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:()=>{this.shadowMap.update(Reflect.get(this._viewer.scene,"_frameState"));let t=this.shadowMap._pointBias;return i.Cartesian4.fromElements(t.normalOffsetScale,this.shadowMap._distance,this.shadowMap.maximumDistance,0,new i.Cartesian4)},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:()=>{this.shadowMap.update(Reflect.get(this._viewer.scene,"_frameState"));let t=this.shadowMap._pointBias,s=new i.Cartesian2;return s.x=1/this.shadowMap._textureSize.x,s.y=1/this.shadowMap._textureSize.y,i.Cartesian4.fromElements(s.x,s.y,t.depthBias,t.normalShadingSmooth,new i.Cartesian4)},camera_projection_matrix:this.lightCamera.frustum.projectionMatrix,camera_view_matrix:this.lightCamera.viewMatrix,helsing_viewDistance:()=>this._viewDistance,helsing_visibleAreaColor:this._visibleAreaColor,helsing_invisibleAreaColor:this._invisibleAreaColor}});this._postStage=this._viewer.scene.postProcessStages.add(e)}}drawFrustumOutline(){let e=new i.Cartesian3,t=new i.Matrix3,r=new i.Quaternion,s=this.lightCamera.positionWC,o=this.lightCamera.directionWC,n=this.lightCamera.upWC,l=this.lightCamera.rightWC;l=i.Cartesian3.negate(l,e);let h=t;i.Matrix3.setColumn(h,0,l,h),i.Matrix3.setColumn(h,1,n,h),i.Matrix3.setColumn(h,2,o,h);let c=i.Quaternion.fromRotationMatrix(h,r),d=new i.GeometryInstance({geometry:new i.FrustumOutlineGeometry({frustum:this.lightCamera.frustum,origin:this._viewPosition,orientation:c}),id:Math.random().toString(36).substr(2),attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(i.Color.YELLOWGREEN),show:new i.ShowGeometryInstanceAttribute(!0)}});this.frustumOutline=this._viewer.scene.primitives.add(new i.Primitive({geometryInstances:[d],appearance:new i.PerInstanceColorAppearance({flat:!0,translucent:!1})}))}_drawSketch(){this._sketch||(this._sketch=this._viewer.entities.add({name:"sketch",position:new i.CallbackProperty(()=>this._viewPosition,!1),show:!0,orientation:new i.CallbackProperty(()=>i.Transforms.headingPitchRollQuaternion(this._viewPosition,i.HeadingPitchRoll.fromDegrees(this._viewHeading-90,this._viewPitch,0)),!1),ellipsoid:{radii:new i.CallbackProperty(()=>new i.Cartesian3(this._viewDistance,this._viewDistance,this._viewDistance),!1),innerRadii:new i.Cartesian3(2,2,2),minimumClock:i.Math.toRadians(-this._horizontalViewAngle/2),maximumClock:i.Math.toRadians(this._horizontalViewAngle/2),minimumCone:i.Math.toRadians(90-this._verticalViewAngle/2),maximumCone:i.Math.toRadians(90+this._verticalViewAngle/2),fill:!1,outline:!0,subdivisions:256,stackPartitions:64,slicePartitions:64,outlineColor:i.Color.YELLOWGREEN}}))}_getHeading(e,t){let r=new i.Cartesian3,s=i.Transforms.eastNorthUpToFixedFrame(e);return i.Matrix4.inverse(s,s),i.Matrix4.multiplyByPoint(s,t,r),i.Cartesian3.normalize(r,r),i.Math.toDegrees(Math.atan2(r.x,r.y))}_getPitch(e,t){let r=new i.Cartesian3,s=i.Transforms.eastNorthUpToFixedFrame(e);return i.Matrix4.inverse(s,s),i.Matrix4.multiplyByPoint(s,t,r),i.Cartesian3.normalize(r,r),i.Math.toDegrees(Math.asin(r.z))}},Bp=an;var Vp=`#define USE_CUBE_MAP_SHADOW true\r
2405
+ \r
2406
+ uniform sampler2D colorTexture;\r
2407
+ uniform sampler2D depthTexture;\r
2408
+ \r
2409
+ uniform float helsing_opacity;\r
2410
+ uniform vec4 helsing_visibleAreaColor;\r
2411
+ uniform vec4 helsing_invisibleAreaColor;\r
2412
+ \r
2413
+ \r
2414
+ const int LightNum = LightNumVlaue;\r
2415
+ // uniform vec4 lightPositionEC[LightNum];\r
2416
+ // uniform mat4 shadowMapMatrix[LightNum];\r
2417
+ // uniform vec4 shadowMapTexelSizeDepthBiasAndNormalShadingSmooth[LightNum];\r
2418
+ // uniform vec2 shadowMapDarknessType[LightNum];\r
2419
+ // uniform float mars3d_distance[LightNum];\r
2420
+ \r
2421
+ uniform mat4 camera_projection_matrix[LightNum];\r
2422
+ uniform mat4 camera_view_matrix[LightNum];\r
2423
+ uniform vec4 shadowMap_lightPositionEC[LightNum];\r
2424
+ uniform mat4 shadowMap_matrix[LightNum];\r
2425
+ uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth[LightNum];\r
2426
+ uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness[LightNum];\r
2427
+ uniform float helsing_viewDistance[LightNum]; \r
2428
+ \r
2429
+ LightShadowMapsShader\r
2430
+ \r
2431
+ in vec2 v_textureCoordinates;\r
2432
+ \r
2433
+ struct zx_shadowParameters {\r
2434
+ vec3 texCoords;\r
2435
+ float depthBias;\r
2436
+ float depth;\r
2437
+ float nDotL;\r
2438
+ vec2 texelStepSize;\r
2439
+ float normalShadingSmooth;\r
2440
+ float darkness;\r
2441
+ bool outside;\r
2442
+ };\r
2443
+ float czm_shadowVisibility(samplerCube shadowMap, zx_shadowParameters shadowParameters) {\r
2444
+ float depthBias = shadowParameters.depthBias;\r
2445
+ float depth = shadowParameters.depth;\r
2446
+ float nDotL = shadowParameters.nDotL;\r
2447
+ float normalShadingSmooth = shadowParameters.normalShadingSmooth;\r
2448
+ float darkness = shadowParameters.darkness;\r
2449
+ vec3 uvw = shadowParameters.texCoords;\r
2450
+ depth -= depthBias;\r
2451
+ float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\r
2452
+ return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\r
2453
+ }\r
2454
+ vec3 getNormalEC(){\r
2455
+ return vec3(1.);\r
2456
+ }\r
2457
+ vec4 toEye(in vec2 uv,in float depth){\r
2458
+ vec2 xy=vec2((uv.x*2.-1.),(uv.y*2.-1.));\r
2459
+ vec4 posInCamera=czm_inverseProjection*vec4(xy,depth,1.);\r
2460
+ posInCamera=posInCamera/posInCamera.w;\r
2461
+ return posInCamera;\r
2462
+ }\r
2463
+ float getDepth(in vec4 depth){\r
2464
+ float z_window=czm_unpackDepth(depth);\r
2465
+ z_window=czm_reverseLogDepth(z_window);\r
2466
+ float n_range=czm_depthRange.near;\r
2467
+ float f_range=czm_depthRange.far;\r
2468
+ return(2.*z_window-n_range-f_range)/(f_range-n_range);\r
2469
+ }\r
2470
+ zx_shadowParameters getShadowParameters(in vec4 positionEC,int i){\r
2471
+ vec3 normalEC=getNormalEC();\r
2472
+ zx_shadowParameters shadowParameters;\r
2473
+ shadowParameters.outside=false;\r
2474
+ shadowParameters.texelStepSize=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth[i].xy;\r
2475
+ shadowParameters.depthBias=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth[i].z;\r
2476
+ shadowParameters.normalShadingSmooth=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth[i].w;\r
2477
+ shadowParameters.darkness=shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness[i].w;\r
2478
+ vec3 directionEC=positionEC.xyz-shadowMap_lightPositionEC[i].xyz;\r
2479
+ float distance=length(directionEC);\r
2480
+ directionEC=normalize(directionEC);\r
2481
+ float radius=shadowMap_lightPositionEC[i].w;\r
2482
+ if(distance>radius)\r
2483
+ {\r
2484
+ shadowParameters.outside=true;\r
2485
+ return shadowParameters;\r
2486
+ }\r
2487
+ vec3 directionWC=czm_inverseViewRotation*directionEC;\r
2488
+ shadowParameters.depth=distance/radius-0.0003;\r
2489
+ shadowParameters.nDotL=clamp(dot(normalEC,-directionEC),0.,1.);\r
2490
+ shadowParameters.texCoords=directionWC;\r
2491
+ return shadowParameters;\r
2492
+ }\r
2493
+ bool visible(in vec4 result) {\r
2494
+ result.x/=result.w;\r
2495
+ result.y/=result.w;\r
2496
+ result.z/=result.w;\r
2497
+ return result.x>=-1.&&result.x<=1.\r
2498
+ &&result.y>=-1.&&result.y<=1.\r
2499
+ &&result.z>=-1.&&result.z<=1.;\r
2500
+ }\r
2501
+ int shadowVisible(samplerCube shadowMap,vec4 viewPos,in int i){\r
2502
+ // \u4E16\u754C\u5750\u6807\r
2503
+ vec4 wordPos = czm_inverseView * viewPos;\r
2504
+ // \u865A\u62DF\u76F8\u673A\u4E2D\u5750\u6807\r
2505
+ vec4 vcPos = camera_view_matrix[i] * wordPos;\r
2506
+ float near = .001 * helsing_viewDistance[i];\r
2507
+ float dis = length(vcPos.xyz);\r
2508
+ if(dis > near && dis < helsing_viewDistance[i]){\r
2509
+ // \u900F\u89C6\u6295\u5F71\r
2510
+ vec4 posInEye = camera_projection_matrix[i] * vcPos;\r
2511
+ // \u53EF\u89C6\u533A\u989C\u8272\r
2512
+ // vec4 helsing_visibleAreaColor=vec4(0.,1.,0.,.5);\r
2513
+ // vec4 helsing_invisibleAreaColor=vec4(1.,0.,0.,.5);\r
2514
+ if(visible(posInEye)){\r
2515
+ zx_shadowParameters shadowParameters = getShadowParameters(viewPos,i);\r
2516
+ float vis = czm_shadowVisibility(shadowMap,shadowParameters);\r
2517
+ if(vis > 0.3){return 1;}else{return -1;}\r
2518
+ }\r
2519
+ }else{return 0;}\r
2520
+ \r
2521
+ }\r
2522
+ void main() {\r
2523
+ // \u91C9\u8272 = \u7ED3\u6784\u4E8C\u7EF4(\u989C\u8272\u7EB9\u7406, \u7EB9\u7406\u5750\u6807)\r
2524
+ out_FragColor = texture(colorTexture, v_textureCoordinates);\r
2525
+ // \u6DF1\u5EA6 = \u83B7\u53D6\u6DF1\u5EA6(\u7ED3\u6784\u4E8C\u7EF4(\u6DF1\u5EA6\u7EB9\u7406, \u7EB9\u7406\u5750\u6807))\r
2526
+ float depth = getDepth(texture(depthTexture, v_textureCoordinates));\r
2527
+ // \u89C6\u89D2 = (\u7EB9\u7406\u5750\u6807, \u6DF1\u5EA6)\r
2528
+ vec4 viewPos = toEye(v_textureCoordinates, depth);\r
2529
+ \r
2530
+ int visibility = 0;\r
2531
+ int inside = 0;\r
2532
+ \r
2533
+ // if(shadowVisible(shadowMap_textureCube,viewPos,i)){visibility++;} else{inside++;}\r
2534
+ ShadowVisibilityShader\r
2535
+ \r
2536
+ if(visibility > 0){\r
2537
+ out_FragColor = mix(out_FragColor, helsing_visibleAreaColor, helsing_opacity);\r
2538
+ } else if(inside > 0) {\r
2539
+ out_FragColor = mix(out_FragColor, helsing_invisibleAreaColor, helsing_opacity);\r
2540
+ }else{\r
2541
+ out_FragColor = out_FragColor;\r
2542
+ }\r
2543
+ }`;var nn=class{constructor(e,t={}){this._id=v.uuid(),this._viewer=e,this._layer=t.layer||null,this._viewsheds=[],this._postStages=[],this._sketches=[],this._enable=!0,this._show=!0,this._showSketch=!1,this._viewPosition=void 0,this._viewDistance=100,this._viewHeading=0,this._viewPitch=0,this._horizontalViewAngle=90,this._verticalViewAngle=60,this._visibleAreaColor=i.Color.GREEN,this._invisibleAreaColor=i.Color.RED,this._opacity=.6,this._softShadows=!1,this._size=1024,this._preUpdateListener=void 0,this._lastPreUpdateFrameNumber=-1}get type(){return"multiViewshed"}get id(){return this._id}set enable(e){this._enable=e,this._viewsheds.forEach(t=>{t.shadowMap&&(t.shadowMap.enabled=e)}),this._postStages.forEach(t=>{t&&(t.enabled=this._show&&e)})}get enable(){return this._enable}set show(e){this._show=e,this._showSketch=e,this._sketches.forEach(t=>{t&&(t.show=e)}),this._postStages.forEach(t=>{t&&(t.enabled=e&&this._enable)})}get show(){return this._show}get viewsheds(){return this._viewsheds}get count(){return this._viewsheds.length}hideSketch(){this._showSketch=!1,this._sketches.forEach(e=>{e&&(e.show=!1)})}_init(e,t={}){this._enable=typeof t.enable=="boolean"?t.enable:!0;let r=y.parsePosition(e);return this._viewPosition=g.transformWGS84ToCartesian(r),this._viewDistance=t.viewDistance||100,this._viewHeading=t.viewHeading||0,this._viewPitch=t.viewPitch||0,this._horizontalViewAngle=t.horizontalViewAngle||90,this._verticalViewAngle=t.verticalViewAngle||60,this._visibleAreaColor=t.visibleAreaColor||i.Color.GREEN,this._invisibleAreaColor=t.invisibleAreaColor||i.Color.RED,this._opacity=t.opacity!==void 0?t.opacity:.6,this._softShadows=typeof t.softShadows=="boolean"?t.softShadows:!1,this._size=t.size||1024,this}add(e,t={}){t.visibleAreaColor!==void 0&&(this._visibleAreaColor=t.visibleAreaColor),t.invisibleAreaColor!==void 0&&(this._invisibleAreaColor=t.invisibleAreaColor),t.opacity!==void 0&&(this._opacity=t.opacity);let r=y.parsePosition(e),s={id:v.uuid(),viewPosition:g.transformWGS84ToCartesian(r),viewDistance:t.viewDistance||this._viewDistance,viewHeading:t.viewHeading!==void 0?t.viewHeading:this._viewHeading,viewPitch:t.viewPitch!==void 0?t.viewPitch:this._viewPitch,horizontalViewAngle:t.horizontalViewAngle||this._horizontalViewAngle,verticalViewAngle:t.verticalViewAngle||this._verticalViewAngle,visibleAreaColor:t.visibleAreaColor||this._visibleAreaColor,invisibleAreaColor:t.invisibleAreaColor||this._invisibleAreaColor,opacity:t.opacity!==void 0?t.opacity:this._opacity,softShadows:typeof t.softShadows=="boolean"?t.softShadows:this._softShadows,size:t.size||this._size,lightCamera:null,shadowMap:null,sketch:null,postStage:null};return this._createViewshed(s),this._viewsheds.push(s),this._createPostStage(),s.id}_createViewshed(e){this._createShadowMap2(e),this._drawSketch(e)}_createShadowMap2(e){e.lightCamera&&(e.lightCamera.destroy(),delete e.lightCamera),e.lightCamera=new i.Camera(this._viewer.scene),e.lightCamera.position=e.viewPosition,e.lightCamera.frustum.near=e.viewDistance*.001,e.lightCamera.frustum.far=e.viewDistance;let t=i.Math.toRadians(e.horizontalViewAngle),r=i.Math.toRadians(e.verticalViewAngle),s=e.viewDistance*Math.tan(t/2)*2/(e.viewDistance*Math.tan(r/2)*2);e.lightCamera.frustum.aspectRatio=s,e.lightCamera.frustum.fov=t>r?t:r,e.lightCamera.setView({destination:e.viewPosition,orientation:{heading:i.Math.toRadians(e.viewHeading||0),pitch:i.Math.toRadians(e.viewPitch||0),roll:0}});let o={context:this._viewer.scene.context,lightCamera:e.lightCamera,enabled:this._enable,darkness:.3,isPointLight:!0,isSpotLight:!1,pointLightRadius:e.viewDistance,cascadesEnabled:!1,size:e.size,fromLightSource:!1};return e.shadowMap=new i.ShadowMap(o)}_addedHook(){this._viewPosition&&this.add(g.transformCartesianToWGS84(this._viewPosition),{viewDistance:this._viewDistance,viewHeading:this._viewHeading,viewPitch:this._viewPitch,horizontalViewAngle:this._horizontalViewAngle,verticalViewAngle:this._verticalViewAngle,visibleAreaColor:this._visibleAreaColor,invisibleAreaColor:this._invisibleAreaColor,opacity:this._opacity,softShadows:this._softShadows,size:this._size})}remove(e){let t=this._viewsheds.findIndex(r=>r.id===e);if(t!==-1){let r=this._viewsheds[t];return this._removeViewshed(r),this._viewsheds.splice(t,1),this._viewsheds.length===0&&this._unbindPreUpdate(),this._createPostStage(),!0}return!1}_removeViewshed(e){if(e.sketch){let t=e.sketch;this._viewer.entities.remove(t);let r=this._sketches.indexOf(t);r!==-1&&this._sketches.splice(r,1),e.sketch=null}e.postStage&&(this._viewer.scene.postProcessStages.remove(e.postStage),e.postStage=null),e.shadowMap&&(e.shadowMap.destroy(),e.shadowMap=null)}clear(){this._unbindPreUpdate(),this._removePostStages(),this._viewsheds.forEach(e=>{this._removeViewshed(e)}),this._viewsheds=[],this._sketches=[]}deactivate(){this.clear()}_removedHook(){this.deactivate()}update(e,t={}){let r=this._viewsheds.find(s=>s.id===e);return r?(t.viewDistance!==void 0&&(r.viewDistance=t.viewDistance),t.viewHeading!==void 0&&(r.viewHeading=t.viewHeading),t.viewPitch!==void 0&&(r.viewPitch=t.viewPitch),t.horizontalViewAngle!==void 0&&(r.horizontalViewAngle=t.horizontalViewAngle),t.verticalViewAngle!==void 0&&(r.verticalViewAngle=t.verticalViewAngle),t.visibleAreaColor!==void 0&&(r.visibleAreaColor=t.visibleAreaColor,this._visibleAreaColor=t.visibleAreaColor),t.invisibleAreaColor!==void 0&&(r.invisibleAreaColor=t.invisibleAreaColor,this._invisibleAreaColor=t.invisibleAreaColor),t.opacity!==void 0&&(r.opacity=t.opacity,this._opacity=t.opacity),this._removeViewshed(r),this._createViewshed(r),this._createPostStage(),!0):!1}_bindPreUpdate(){this._preUpdateListener||(this._preUpdateListener=e=>{if(!this._enable||!this._show)return;let t=Reflect.get(e,"_frameState");!t||!t.shadowMaps||t.frameNumber!==this._lastPreUpdateFrameNumber&&(this._lastPreUpdateFrameNumber=t.frameNumber,this._viewsheds.forEach(r=>{r&&r.shadowMap&&t.shadowMaps.push(r.shadowMap)}))},this._viewer.scene.preUpdate.addEventListener(this._preUpdateListener))}_unbindPreUpdate(){this._preUpdateListener&&(this._viewer.scene.preUpdate.removeEventListener(this._preUpdateListener),this._preUpdateListener=void 0,this._lastPreUpdateFrameNumber=-1)}_removePostStages(){this._postStages&&this._postStages.length>0&&this._postStages.forEach(e=>{e&&this._viewer.scene.postProcessStages.remove(e)}),this._postStages=[]}_createLightCamera(e){e.lightCamera||(e.lightCamera=new i.Camera(this._viewer.scene)),e.lightCamera.position=e.viewPosition,e.lightCamera.frustum.near=e.viewDistance*.001,e.lightCamera.frustum.far=e.viewDistance;let t=i.Math.toRadians(e.horizontalViewAngle),r=i.Math.toRadians(e.verticalViewAngle),s=e.viewDistance*Math.tan(t/2)*2/(e.viewDistance*Math.tan(r/2)*2);e.lightCamera.frustum.aspectRatio=s,e.lightCamera.frustum.fov=t>r?t:r,e.lightCamera.setView({destination:e.viewPosition,orientation:{heading:i.Math.toRadians(e.viewHeading||0),pitch:i.Math.toRadians(e.viewPitch||0),roll:0}})}_createShadowMap(e){e.shadowMap=new i.ShadowMap({context:this._viewer.scene.context,lightCamera:e.lightCamera,enabled:this._enable,isPointLight:!0,pointLightRadius:e.viewDistance,cascadesEnabled:!1,size:e.size,softShadows:e.softShadows,normalOffset:!1,fromLightSource:!1,darkness:.3})}_createPostStage(){this._removePostStages();let e=14,t=this._viewsheds.filter(r=>r&&r.shadowMap);if(t.length!==0)for(let r=0;r<t.length;r+=e){let s=t.slice(r,r+e),o=s.length;if(o===0)continue;let n=[],l=[],h=[],c=[],d=[],m=[],f=[],u=()=>{n.length=0,l.length=0,h.length=0,c.length=0,d.length=0,m.length=0,f.length=0,this._viewer.scene._frameState.shadowMaps.length=0,s.forEach(S=>{if(!S||!S.shadowMap)return;S.shadowMap.enabled=this._enable,this._viewer.scene._frameState.shadowMaps.push(S.shadowMap),S.shadowMap.update(this._viewer.scene._frameState),n.push(S.shadowMap._lightPositionEC),l.push(S.shadowMap._shadowMapMatrix);let I=S.shadowMap._pointBias;h.push(i.Cartesian4.fromElements(1/S.shadowMap._textureSize.x,1/S.shadowMap._textureSize.y,I.depthBias,I.normalShadingSmooth,new i.Cartesian4)),c.push(new i.Cartesian2(S.shadowMap._darkness,1)),d.push(S.viewDistance),m.push(S.lightCamera.frustum.projectionMatrix),f.push(S.lightCamera.viewMatrix)})},p={shadowMap_lightPositionEC:()=>(u(),n),shadowMap_matrix:()=>l,shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:()=>h,shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:()=>c,helsing_viewDistance:()=>d,camera_projection_matrix:()=>m,camera_view_matrix:()=>f,helsing_opacity:()=>this._opacity,helsing_visibleAreaColor:()=>this._visibleAreaColor,helsing_invisibleAreaColor:()=>this._invisibleAreaColor};u();let x="",C="";for(let S=0;S<o;S++)x+=`uniform samplerCube lightShadowMapCube${S};
2544
+ `,C+=`
2545
+ int vis${S} = shadowVisible(lightShadowMapCube${S},viewPos,${S});
2546
+ if(vis${S}>0){visibility++;}if(vis${S}<0){inside++;}
2547
+ `,p["lightShadowMapCube"+S]=()=>s[S].shadowMap._shadowMapTexture;let E=Vp.replace("LightNumVlaue",o);E=E.replace("LightShadowMapsShader",x),E=E.replace("ShadowVisibilityShader",C);let b=new i.PostProcessStage({sampleMode:i.PostProcessStageSampleMode.NEAREST,fragmentShader:E,uniforms:p}),R=this._viewer.scene.postProcessStages.add(b);R.enabled=this._show&&this._enable,this._postStages.push(R)}}_drawSketch(e){let t=this._viewer.entities.add({name:`multiViewshed-sketch-${e.id}`,position:e.viewPosition,show:this._show,orientation:i.Transforms.headingPitchRollQuaternion(e.viewPosition,i.HeadingPitchRoll.fromDegrees(e.viewHeading-90,e.viewPitch,0)),ellipsoid:{radii:new i.Cartesian3(e.viewDistance,e.viewDistance,e.viewDistance),innerRadii:new i.Cartesian3(2,2,2),minimumClock:i.Math.toRadians(-e.horizontalViewAngle/2),maximumClock:i.Math.toRadians(e.horizontalViewAngle/2),minimumCone:i.Math.toRadians(90-e.verticalViewAngle/2),maximumCone:i.Math.toRadians(90+e.verticalViewAngle/2),fill:!1,outline:!0,subdivisions:256,stackPartitions:64,slicePartitions:64,outlineColor:i.Color.YELLOWGREEN}});e.sketch=t,t.show=this._showSketch,this._sketches.push(t)}};var jp=nn;function Yp(a,e){var t,r,s,o,n,l,h,c;if(!a)return e;if(Object(a)instanceof i.Color)return a;if(typeof a=="string")try{return i.Color.fromCssColorString(a)}catch{return e}if(Array.isArray(a)){let d=(t=a[0])!=null?t:0,m=(r=a[1])!=null?r:0,f=(s=a[2])!=null?s:0,u=a.length>3?a[3]:1,p=Math.max(d,m,f)>1?255:1,x=u>1?u/255:u;return new i.Color(d/p,m/p,f/p,x)}if(typeof a=="object"){let d=(o=a.r)!=null?o:a.red,m=(n=a.g)!=null?n:a.green,f=(l=a.b)!=null?l:a.blue,u=(c=(h=a.a)!=null?h:a.alpha)!=null?c:1;if([d,m,f].every(p=>typeof p=="number")){let p=Math.max(d,m,f)>1?255:1,x=typeof u=="number"?u>1?u/255:u:1;return new i.Color(d/p,m/p,f/p,x)}}return e}function df(a){let e=Math.round(a.red*255),t=Math.round(a.green*255),r=Math.round(a.blue*255),s=Math.round(a.alpha*1e3)/1e3;return`rgba(${e},${t},${r},${s})`}var ln=class{constructor(e){this._id=v.uuid(),this._viewer=e,this._primitive=void 0,this._polygonPositions=[],this._minColor=i.Color.BLUE,this._maxColor=i.Color.RED,this._minSlope=0,this._maxSlope=60,this._opacity=.8,this._granularity=i.Math.RADIANS_PER_DEGREE/200,this._legendSteps=6}get type(){return"slope"}get id(){return this._id}get legend(){return this.getLegend()}getLegend(e=this._legendSteps){let t=Math.max(2,Math.floor(e)),r=[];for(let s=0;s<t;s++){let o=t===1?0:s/(t-1),n=this._minSlope+o*(this._maxSlope-this._minSlope),l=i.Color.lerp(this._minColor,this._maxColor,o,new i.Color);r.push({value:n,label:`${n.toFixed(1)}\xB0`,color:df(l)})}return r}async _init(e,t={}){var s,o;this.deactivate();let r=y.parsePositions(e);return this._polygonPositions=r,this._minColor=Yp((s=t.minColor)!=null?s:t.lowColor,i.Color.BLUE),this._maxColor=Yp((o=t.maxColor)!=null?o:t.highColor,i.Color.RED),this._minSlope=typeof t.minSlope=="number"?t.minSlope:0,this._maxSlope=typeof t.maxSlope=="number"?t.maxSlope:60,this._opacity=typeof t.opacity=="number"?t.opacity:typeof t.mixFactor=="number"?t.mixFactor:.8,this._granularity=typeof t.granularity=="number"?t.granularity:i.Math.RADIANS_PER_DEGREE/200,this._legendSteps=typeof t.legendSteps=="number"?t.legendSteps:6,this._addPrimitive(),this}_addPrimitive(){if(this._primitive||!this._polygonPositions||this._polygonPositions.length<3)return;let e=new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(this._polygonPositions)),t=new i.GeometryInstance({geometry:new i.PolygonGeometry({polygonHierarchy:e,vertexFormat:i.VertexFormat.POSITION_AND_NORMAL,perPositionHeight:!1,granularity:this._granularity})}),r=new i.MaterialAppearance({translucent:!0,closed:!1,faceForward:!0,material:i.Material.fromType(i.Material.SlopeAreaType,{minColor:this._minColor,maxColor:this._maxColor,minSlope:this._minSlope,maxSlope:this._maxSlope,opacity:this._opacity})});this._primitive=this._viewer.scene.primitives.add(new i.GroundPrimitive({geometryInstances:t,appearance:r,asynchronous:!0}))}deactivate(){return this._primitive&&(this._viewer.scene.primitives.remove(this._primitive),this._primitive=void 0),this}},qp=ln;function hn(a,e){var t,r,s,o,n,l,h,c;if(!a)return e;if(Object(a)instanceof i.Color)return a;if(typeof a=="string")try{return i.Color.fromCssColorString(a)}catch{return e}if(Array.isArray(a)){let d=(t=a[0])!=null?t:0,m=(r=a[1])!=null?r:0,f=(s=a[2])!=null?s:0,u=a.length>3?a[3]:1,p=Math.max(d,m,f)>1?255:1,x=u>1?u/255:u;return new i.Color(d/p,m/p,f/p,x)}if(typeof a=="object"){let d=(o=a.r)!=null?o:a.red,m=(n=a.g)!=null?n:a.green,f=(l=a.b)!=null?l:a.blue,u=(c=(h=a.a)!=null?h:a.alpha)!=null?c:1;if([d,m,f].every(p=>typeof p=="number")){let p=Math.max(d,m,f)>1?255:1,x=typeof u=="number"?u>1?u/255:u:1;return new i.Color(d/p,m/p,f/p,x)}}return e}function pf(a){let e=Math.round(a.red*255),t=Math.round(a.green*255),r=Math.round(a.blue*255),s=Math.round(a.alpha*1e3)/1e3;return`rgba(${e},${t},${r},${s})`}function mf(a,e,t){return Math.min(t,Math.max(e,a))}function uf(a,e,t){let r=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){let n=t[s][0],l=t[s][1],h=t[o][0],c=t[o][1];l>e!=c>e&&a<(h-n)*(e-l)/(c-l+0)+n&&(r=!r)}return r}function Zp(a){return a/111e3}function Xp(a,e){let t=Math.cos(i.Math.toRadians(e));return a/(111e3*Math.max(t,1e-6))}function _f(a,e,t){let r=e-a,s=t-a,o=-r,n=-s,l=Math.atan2(o,n);return l<0&&(l+=Math.PI*2),i.Math.toDegrees(l)}var cn=class{constructor(e){this._id=v.uuid(),this._viewer=e,this._primitive=void 0,this._arrowDataSource=void 0,this._polygonPositions=[],this._minColor=i.Color.GREEN,this._maxColor=i.Color.RED,this._minAspect=0,this._maxAspect=360,this._opacity=.8,this._granularity=i.Math.RADIANS_PER_DEGREE/200,this._legendSteps=8,this._showArrows=!0,this._arrowColor=i.Color.WHITE.withAlpha(.9),this._arrowWidth=4,this._arrowLengthMeters=120,this._arrowSpacingMeters=250,this._arrowMaxCount=250,this._gradientDeltaMeters=30,this._arrowHeightOffset=0}get type(){return"aspect"}get id(){return this._id}get legend(){return this.getLegend()}getLegend(e=this._legendSteps){let t=Math.max(2,Math.floor(e)),r=[];for(let s=0;s<t;s++){let o=t===1?0:s/(t-1),n=this._minAspect+o*(this._maxAspect-this._minAspect),l=i.Color.lerp(this._minColor,this._maxColor,o,new i.Color);r.push({value:n,label:`${n.toFixed(0)}\xB0`,color:pf(l)})}return r}async _init(e,t={}){var s,o;this.deactivate();let r=y.parsePositions(e);return this._polygonPositions=r,this._minColor=hn((s=t.minColor)!=null?s:t.lowColor,i.Color.GREEN),this._maxColor=hn((o=t.maxColor)!=null?o:t.highColor,i.Color.RED),this._minAspect=typeof t.minAspect=="number"?t.minAspect:0,this._maxAspect=typeof t.maxAspect=="number"?t.maxAspect:360,this._opacity=typeof t.opacity=="number"?t.opacity:typeof t.mixFactor=="number"?t.mixFactor:.8,this._granularity=typeof t.granularity=="number"?t.granularity:i.Math.RADIANS_PER_DEGREE/200,this._legendSteps=typeof t.legendSteps=="number"?t.legendSteps:8,this._showArrows=t.showArrows!==!1,this._arrowColor=hn(t.arrowColor,i.Color.WHITE.withAlpha(.9)),this._arrowWidth=typeof t.arrowWidth=="number"?t.arrowWidth:4,this._arrowLengthMeters=typeof t.arrowLength=="number"?t.arrowLength:120,this._arrowSpacingMeters=typeof t.arrowSpacing=="number"?t.arrowSpacing:250,this._arrowMaxCount=typeof t.arrowMaxCount=="number"?t.arrowMaxCount:250,this._gradientDeltaMeters=typeof t.gradientDelta=="number"?t.gradientDelta:30,this._arrowHeightOffset=typeof t.arrowHeightOffset=="number"?t.arrowHeightOffset:0,this._addPrimitive(),this._showArrows&&await this._addArrows(),this}_addPrimitive(){if(this._primitive||!this._polygonPositions||this._polygonPositions.length<3)return;let e=new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(this._polygonPositions)),t=new i.GeometryInstance({geometry:new i.PolygonGeometry({polygonHierarchy:e,vertexFormat:i.VertexFormat.POSITION_AND_NORMAL,perPositionHeight:!1,granularity:this._granularity})}),r=new i.MaterialAppearance({translucent:!0,closed:!1,faceForward:!0,material:i.Material.fromType(i.Material.AspectAreaType,{minColor:this._minColor,maxColor:this._maxColor,minAspect:this._minAspect,maxAspect:this._maxAspect,opacity:this._opacity})});this._primitive=this._viewer.scene.primitives.add(new i.GroundPrimitive({geometryInstances:t,appearance:r,asynchronous:!0}))}async _addArrows(){var E,b,R;if(this._arrowDataSource||!this._polygonPositions||this._polygonPositions.length<3)return;let e=new i.CustomDataSource(`aspect-arrows-${this._id}`);this._arrowDataSource=e,this._viewer.dataSources.add(e);let t=this._polygonPositions.map(S=>{var I,L,k,F,$;return[(k=(L=(I=S.lng)!=null?I:S.lon)!=null?L:S.longitude)!=null?k:S[0],($=(F=S.lat)!=null?F:S.latitude)!=null?$:S[1]]}),r=t.map(S=>S[0]),s=t.map(S=>S[1]),o=Math.min(...r),n=Math.max(...r),l=Math.min(...s),h=Math.max(...s),c=(l+h)/2,d=Zp(this._arrowSpacingMeters),m=Xp(this._arrowSpacingMeters,c),f=[];for(let S=l;S<=h;S+=d){for(let I=o;I<=n&&!(uf(I,S,t)&&(f.push({lon:I,lat:S}),f.length>=this._arrowMaxCount));I+=m);if(f.length>=this._arrowMaxCount)break}if(!f.length)return;let u=mf(this._gradientDeltaMeters,5,200),p=[],x=[];for(let S of f){let I=Zp(u),L=Xp(u,S.lat),k=i.Cartographic.fromDegrees(S.lon,S.lat),F=i.Cartographic.fromDegrees(S.lon+L,S.lat),$=i.Cartographic.fromDegrees(S.lon,S.lat+I),ne=p.length;p.push(k,F,$),x.push({baseIndex:ne,lon:S.lon,lat:S.lat})}let C=p;try{C=await i.sampleTerrainMostDetailed(this._viewer.terrainProvider,p)}catch{}for(let S of x){let I=C[S.baseIndex],L=C[S.baseIndex+1],k=C[S.baseIndex+2],F=(E=I.height)!=null?E:0,$=(b=L.height)!=null?b:0,ne=(R=k.height)!=null?R:0,re=_f(F,$,ne),se=i.Math.toRadians(re),me=i.Cartesian3.fromRadians(I.longitude,I.latitude,F+this._arrowHeightOffset),ze=i.Transforms.eastNorthUpToFixedFrame(me),We=new i.Cartesian3(Math.sin(se)*this._arrowLengthMeters,Math.cos(se)*this._arrowLengthMeters,0),Ge=i.Matrix4.multiplyByPointAsVector(ze,We,new i.Cartesian3),ct=i.Cartesian3.add(me,Ge,new i.Cartesian3);e.entities.add({position:me,polyline:{positions:[me,ct],clampToGround:!0,width:this._arrowWidth,material:new i.PolylineArrowMaterialProperty(this._arrowColor)},properties:{aspect:re}})}}deactivate(){return this._primitive&&(this._viewer.scene.primitives.remove(this._primitive),this._primitive=void 0),this._arrowDataSource&&(this._viewer.dataSources.remove(this._arrowDataSource,!0),this._arrowDataSource=void 0),this}},Jp=cn;var Xe=new i.Color(1,0,0,.7),mn=.16,un=.28,dn=1e-6;function ff(a,e,t){return Math.min(t,Math.max(e,a))}function gf(a,e=Xe){var t,r,s,o,n,l,h,c;if(!a)return e;if(Object(a)instanceof i.Color)return a;if(typeof a=="string")try{return i.Color.fromCssColorString(a)||e}catch{return e}if(Array.isArray(a)){let d=(t=a[0])!=null?t:0,m=(r=a[1])!=null?r:0,f=(s=a[2])!=null?s:0,u=a.length>3?a[3]:1,p=Math.max(d,m,f)>1?255:1,x=u>1?u/255:u;return new i.Color(d/p,m/p,f/p,x)}if(typeof a=="object"){let d=(o=a.r)!=null?o:a.red,m=(n=a.g)!=null?n:a.green,f=(l=a.b)!=null?l:a.blue,u=(c=(h=a.a)!=null?h:a.alpha)!=null?c:1;if([d,m,f].every(p=>typeof p=="number")){let p=Math.max(d,m,f)>1?255:1,x=typeof u=="number"?u>1?u/255:u:1;return new i.Color(d/p,m/p,f/p,x)}}return e}function Kp(a){return i.Cartesian4.fromElements(a.red,a.green,a.blue,a.alpha,new i.Cartesian4)}function lt(a,e){return new i.Color(a.red,a.green,a.blue,ff(e,0,1))}function yf(a){var r,s,o;if(!a)throw new Error("heightLimit analysis requires valid polygon positions");if(Array.isArray(a)){if(a.length<2)throw new Error("heightLimit analysis requires valid polygon positions");return{lng:Number(a[0]),lat:Number(a[1])}}let e=(s=(r=a.lng)!=null?r:a.lon)!=null?s:a.longitude,t=(o=a.lat)!=null?o:a.latitude;if(!Number.isFinite(Number(e))||!Number.isFinite(Number(t)))throw new Error("heightLimit analysis requires valid polygon positions");return{lng:Number(e),lat:Number(t)}}function vf(a=[]){if(!Array.isArray(a))throw new Error("heightLimit analysis requires polygon positions array");return a.map(yf)}function Ce(a){return Number(a).toFixed(8)}function wf(a){return`vec2(${Ce(a.x)}, ${Ce(a.y)})`}function pn(a){return`vec3(${Ce(a.x)}, ${Ce(a.y)}, ${Ce(a.z)})`}function $p(a){return!!a&&typeof a.length=="number"&&typeof a.get=="function"}function Cf(a){return a instanceof i.Cesium3DTileset}function Qp(a={}){let e=Number(a.minHeight),t=Number(a.maxHeight);if(!Number.isFinite(e)||!Number.isFinite(t))throw new Error("heightLimit analysis requires numeric minHeight and maxHeight");if(e>t)throw new Error("heightLimit analysis requires minHeight to be less than or equal to maxHeight");let r=gf(a.limitColor,Xe);return{minHeight:e,maxHeight:t,limitColor:r,bottomPlaneColor:lt(r,Math.min(r.alpha*.35,mn)),topPlaneColor:lt(r,Math.min(r.alpha*.5,un))}}function _n(a,e=Cf,t=[],r=new Set,s=new Set){if(!$p(a)||r.has(a))return t;r.add(a);for(let o=0;o<a.length;o++){let n=a.get(o);if(n){if(e(n)){s.has(n)||(s.add(n),t.push(n));continue}(n instanceof i.PrimitiveCollection||$p(n))&&_n(n,e,t,r,s)}}return t}function em(a=[]){a.forEach(e=>{e!=null&&e.tileset&&(e.tileset.customShader=e.originalCustomShader)})}function tm(a=[]){let e=vf(a);if(e.length<3)throw new Error("heightLimit analysis requires at least 3 polygon positions");let t=e.map(E=>E.lng),r=e.map(E=>E.lat),s=i.Cartesian3.fromDegrees(t.reduce((E,b)=>E+b,0)/e.length,r.reduce((E,b)=>E+b,0)/e.length,0),o=i.Transforms.eastNorthUpToFixedFrame(s),n=i.Matrix4.inverseTransformation(o,new i.Matrix4),l=i.Matrix4.getColumn(o,0,new i.Cartesian4),h=i.Matrix4.getColumn(o,1,new i.Cartesian4),c=e.map(E=>{let b=i.Cartesian3.fromDegrees(E.lng,E.lat,0);return i.Matrix4.multiplyByPoint(n,b,new i.Cartesian3)}),d=c.map(wf),m=c.map(E=>E.x),f=c.map(E=>E.y),u=Math.min(...m),p=Math.max(...m),x=Math.min(...f),C=Math.max(...f);return`
2548
+ const int POLYGON_VERTEX_COUNT = ${e.length};
2549
+ const float POLYGON_MIN_X = ${Ce(u)};
2550
+ const float POLYGON_MAX_X = ${Ce(p)};
2551
+ const float POLYGON_MIN_Y = ${Ce(x)};
2552
+ const float POLYGON_MAX_Y = ${Ce(C)};
2553
+ const vec3 LOCAL_FRAME_ORIGIN = ${pn(s)};
2554
+ const vec3 LOCAL_FRAME_EAST = ${pn(l)};
2555
+ const vec3 LOCAL_FRAME_NORTH = ${pn(h)};
2556
+
2557
+ vec2 getLocalPolygonPoint(vec3 positionWC) {
2558
+ vec3 delta = positionWC - LOCAL_FRAME_ORIGIN;
2559
+ float x = dot(delta, LOCAL_FRAME_EAST);
2560
+ float y = dot(delta, LOCAL_FRAME_NORTH);
2561
+ return vec2(x, y);
2562
+ }
2563
+
2564
+ float getApproximateHeight(vec3 positionWC) {
2565
+ vec3 oneOverRadiiSquared = czm_ellipsoidInverseRadii * czm_ellipsoidInverseRadii;
2566
+ vec3 geodeticNormal = normalize(positionWC * oneOverRadiiSquared);
2567
+ vec3 radiiSquared = czm_ellipsoidRadii * czm_ellipsoidRadii;
2568
+ vec3 scaledNormal = radiiSquared * geodeticNormal;
2569
+ float gamma = sqrt(max(dot(scaledNormal, geodeticNormal), ${dn}));
2570
+ vec3 surfacePosition = scaledNormal / gamma;
2571
+ return dot(positionWC - surfacePosition, geodeticNormal);
2572
+ }
2573
+
2574
+ bool isInsideBoundingRect(vec2 point) {
2575
+ return point.x >= POLYGON_MIN_X &&
2576
+ point.x <= POLYGON_MAX_X &&
2577
+ point.y >= POLYGON_MIN_Y &&
2578
+ point.y <= POLYGON_MAX_Y;
2579
+ }
2580
+
2581
+ bool isPointInsidePolygon(vec2 point) {
2582
+ const vec2 polygonVertices[POLYGON_VERTEX_COUNT] = vec2[POLYGON_VERTEX_COUNT](
2583
+ ${d.join(`,
2584
+ `)}
2585
+ );
2586
+
2587
+ bool inside = false;
2588
+ for (int i = 0, j = POLYGON_VERTEX_COUNT - 1; i < POLYGON_VERTEX_COUNT; j = i, i++) {
2589
+ vec2 pi = polygonVertices[i];
2590
+ vec2 pj = polygonVertices[j];
2591
+ float denominator = pj.y - pi.y;
2592
+ bool intersects = ((pi.y > point.y) != (pj.y > point.y)) &&
2593
+ (point.x < ((pj.x - pi.x) * (point.y - pi.y)) / (abs(denominator) < ${dn} ? ${dn} : denominator) + pi.x);
2594
+ if (intersects) {
2595
+ inside = !inside;
2596
+ }
2597
+ }
2598
+ return inside;
2599
+ }
2600
+
2601
+ void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {
2602
+ vec3 positionWC = fsInput.attributes.positionWC;
2603
+ vec2 localPoint = getLocalPolygonPoint(positionWC);
2604
+ if (!isInsideBoundingRect(localPoint) || !isPointInsidePolygon(localPoint)) {
2605
+ return;
2606
+ }
2607
+
2608
+ float height = getApproximateHeight(positionWC);
2609
+ if (height < u_minHeight || height > u_maxHeight) {
2610
+ return;
2611
+ }
2612
+
2613
+ float mixFactor = clamp(u_limitColor.a, 0.0, 1.0);
2614
+ float diffuseMix = clamp(0.35 + mixFactor * 0.65, 0.0, 1.0);
2615
+ float emissiveStrength = clamp(0.40 + mixFactor * 0.60, 0.0, 1.0);
2616
+ material.diffuse = mix(material.diffuse, u_limitColor.rgb, diffuseMix);
2617
+ material.emissive = max(
2618
+ material.emissive,
2619
+ u_limitColor.rgb * emissiveStrength
2620
+ );
2621
+ }
2622
+ `}var fn=class{constructor(e){this._id=v.uuid(),this._viewer=e,this._polygonPositions=[],this._minHeight=0,this._maxHeight=0,this._limitColor=Xe,this._bottomPlaneColor=lt(Xe,mn),this._topPlaneColor=lt(Xe,un),this._minPlaneEntity=void 0,this._maxPlaneEntity=void 0,this._tilesetStates=[]}get type(){return"heightLimit"}get id(){return this._id}async _init(e,t={}){this.deactivate();let r=y.parsePositions(e);if(r.length<3)throw new Error("heightLimit analysis requires at least 3 polygon positions");let s=Qp(t);return this._polygonPositions=r,this._minHeight=s.minHeight,this._maxHeight=s.maxHeight,this._limitColor=s.limitColor,this._bottomPlaneColor=s.bottomPlaneColor,this._topPlaneColor=s.topPlaneColor,this._createPlaneEntities(),this._applyToSceneTilesets(),this}_createPlaneEntities(){let e=new i.PolygonHierarchy(g.transformWGS84ArrayToCartesianArray(this._polygonPositions));this._minPlaneEntity=this._viewer.entities.add({name:`height-limit-min-plane-${this._id}`,polygon:{hierarchy:e,height:this._minHeight,material:this._bottomPlaneColor,perPositionHeight:!1,outline:!1}}),this._maxPlaneEntity=this._viewer.entities.add({name:`height-limit-max-plane-${this._id}`,polygon:{hierarchy:e,height:this._maxHeight,material:this._topPlaneColor,perPositionHeight:!1,outline:!1}})}_applyToSceneTilesets(){let e=_n(this._viewer.scene.primitives);this._tilesetStates=e.map(t=>({tileset:t,originalCustomShader:t.customShader})),this._tilesetStates.forEach(t=>{t.tileset.customShader=this._createCustomShader()})}_createCustomShader(){return new i.CustomShader({mode:i.CustomShaderMode.MODIFY_MATERIAL,translucencyMode:i.CustomShaderTranslucencyMode.INHERIT,uniforms:{u_minHeight:{type:i.UniformType.FLOAT,value:this._minHeight},u_maxHeight:{type:i.UniformType.FLOAT,value:this._maxHeight},u_limitColor:{type:i.UniformType.VEC4,value:Kp(this._limitColor)}},fragmentShaderText:tm(this._polygonPositions)})}deactivate(){return this._minPlaneEntity&&(this._viewer.entities.remove(this._minPlaneEntity),this._minPlaneEntity=void 0),this._maxPlaneEntity&&(this._viewer.entities.remove(this._maxPlaneEntity),this._maxPlaneEntity=void 0),em(this._tilesetStates),this._tilesetStates=[],this._polygonPositions=[],this}},im=fn;function xf(a){var r,s,o;if(!a)throw new Error("tilesetFlatten analysis requires valid polygon positions");if(Array.isArray(a)){if(a.length<2)throw new Error("tilesetFlatten analysis requires valid polygon positions");return{lng:Number(a[0]),lat:Number(a[1])}}let e=(s=(r=a.lng)!=null?r:a.lon)!=null?s:a.longitude,t=(o=a.lat)!=null?o:a.latitude;if(!Number.isFinite(Number(e))||!Number.isFinite(Number(t)))throw new Error("tilesetFlatten analysis requires valid polygon positions");return{lng:Number(e),lat:Number(t)}}function Tf(a=[]){if(!Array.isArray(a))throw new Error("tilesetFlatten analysis requires polygon positions array");return a.map(xf)}function rm(a){return!!a&&typeof a.length=="number"&&typeof a.get=="function"}function yn(a){return a instanceof i.Cesium3DTileset}function sm(a){var t;if(!a)return null;if(yn(a))return a;let e=(t=a.delegate)!=null?t:a._delegate;return yn(e)?e:null}async function Ef(a){var r;if(!a)return null;if(yn(a))return a;let e=(r=a.delegate)!=null?r:a._delegate,t=e&&typeof e.then=="function"?await e:e;return sm(t)}function om(a,e=[],t=new Set,r=new Set){if(!rm(a)||t.has(a))return e;t.add(a);for(let s=0;s<a.length;s++){let o=a.get(s);if(!o)continue;let n=sm(o);if(n){r.has(n)||(r.add(n),e.push(n));continue}(o instanceof i.PrimitiveCollection||rm(o))&&om(o,e,t,r)}return e}async function Pf(a=[]){let e=[],t=new Set;for(let r of a){let s=await Ef(r);s&&!t.has(s)&&(t.add(s),e.push(s))}return e}function Je(a){return Number(a).toFixed(8)}function bf(a){return`vec2(${Je(a.x)}, ${Je(a.y)})`}function gn(a){return`vec3(${Je(a.x)}, ${Je(a.y)}, ${Je(a.z)})`}function Sf(a,e,t){return Math.min(t,Math.max(e,a))}function Af(a=[]){if(a.length<2)return 1;let e=Number.POSITIVE_INFINITY;for(let t=0;t<a.length;t++){let r=a[t],s=a[(t+1)%a.length],o=s.x-r.x,n=s.y-r.y,l=Math.hypot(o,n);l>0&&(e=Math.min(e,l))}return Number.isFinite(e)?Sf(e*.002,.75,3):1}function am(a={}){let e=Number(a.height);if(!Number.isFinite(e))throw new Error("tilesetFlatten analysis requires numeric height");return{...a,height:e}}function nm(a=[]){a.forEach(e=>{e!=null&&e.tileset&&(e.tileset.customShader=e.originalCustomShader)})}async function lm(a,e={}){var s;let t=[];e.tileset&&t.push(e.tileset),Array.isArray(e.tilesets)&&t.push(...e.tilesets);let r=await Pf(t);return r.length?r:om((s=a==null?void 0:a.scene)==null?void 0:s.primitives)}function hm(a=[]){let e=Tf(a);if(e.length<3)throw new Error("tilesetFlatten analysis requires at least 3 polygon positions");let t=i.Cartesian3.fromDegrees(e.reduce((c,d)=>c+d.lng,0)/e.length,e.reduce((c,d)=>c+d.lat,0)/e.length,0),r=i.Transforms.eastNorthUpToFixedFrame(t),s=i.Matrix4.inverseTransformation(r,new i.Matrix4),o=i.Matrix4.getColumn(r,0,new i.Cartesian4),n=i.Matrix4.getColumn(r,1,new i.Cartesian4),l=e.map(c=>{let d=i.Cartesian3.fromDegrees(c.lng,c.lat,0);return i.Matrix4.multiplyByPoint(s,d,new i.Cartesian3)}),h=Af(l);return`
2623
+ const int POLYGON_VERTEX_COUNT = ${e.length};
2624
+ const float POLYGON_EDGE_BLEND_WIDTH = ${Je(h)};
2625
+ const vec3 LOCAL_FRAME_ORIGIN = ${gn(t)};
2626
+ const vec3 LOCAL_FRAME_EAST = ${gn(o)};
2627
+ const vec3 LOCAL_FRAME_NORTH = ${gn(n)};
2628
+ const vec2 polygonVertices[POLYGON_VERTEX_COUNT] = vec2[POLYGON_VERTEX_COUNT](
2629
+ ${l.map(bf).join(`,
2630
+ `)}
2631
+ );
2632
+
2633
+ vec2 getLocalPolygonPoint(vec3 positionWC) {
2634
+ vec3 delta = positionWC - LOCAL_FRAME_ORIGIN;
2635
+ float x = dot(delta, LOCAL_FRAME_EAST);
2636
+ float y = dot(delta, LOCAL_FRAME_NORTH);
2637
+ return vec2(x, y);
2638
+ }
2639
+
2640
+ bool isPointInsidePolygon(vec2 point) {
2641
+ bool inside = false;
2642
+ for (int i = 0, j = POLYGON_VERTEX_COUNT - 1; i < POLYGON_VERTEX_COUNT; j = i, i++) {
2643
+ vec2 current = polygonVertices[i];
2644
+ vec2 previous = polygonVertices[j];
2645
+ bool intersects = ((current.y > point.y) != (previous.y > point.y))
2646
+ && (point.x < (previous.x - current.x) * (point.y - current.y) / (previous.y - current.y + 1.0e-6) + current.x);
2647
+ if (intersects) {
2648
+ inside = !inside;
2649
+ }
2650
+ }
2651
+ return inside;
2652
+ }
2653
+
2654
+ float getDistanceToSegment(vec2 point, vec2 start, vec2 end) {
2655
+ vec2 segment = end - start;
2656
+ float segmentLengthSquared = max(dot(segment, segment), 1.0e-6);
2657
+ float projection = clamp(
2658
+ dot(point - start, segment) / segmentLengthSquared,
2659
+ 0.0,
2660
+ 1.0
2661
+ );
2662
+ vec2 closestPoint = start + segment * projection;
2663
+ return length(point - closestPoint);
2664
+ }
2665
+
2666
+ float getDistanceToPolygonEdge(vec2 point) {
2667
+ float minDistance = 1.0e9;
2668
+ for (int i = 0, j = POLYGON_VERTEX_COUNT - 1; i < POLYGON_VERTEX_COUNT; j = i, i++) {
2669
+ vec2 current = polygonVertices[i];
2670
+ vec2 previous = polygonVertices[j];
2671
+ minDistance = min(
2672
+ minDistance,
2673
+ getDistanceToSegment(point, previous, current)
2674
+ );
2675
+ }
2676
+ return minDistance;
2677
+ }
2678
+
2679
+ float getApproximateHeight(vec3 positionWC) {
2680
+ vec3 oneOverRadiiSquared = czm_ellipsoidInverseRadii * czm_ellipsoidInverseRadii;
2681
+ vec3 geodeticNormal = normalize(positionWC * oneOverRadiiSquared);
2682
+ vec3 radiiSquared = czm_ellipsoidRadii * czm_ellipsoidRadii;
2683
+ vec3 scaledNormal = radiiSquared * geodeticNormal;
2684
+ float gamma = sqrt(max(dot(scaledNormal, geodeticNormal), 1.0e-6));
2685
+ vec3 surfacePosition = scaledNormal / gamma;
2686
+ return dot(positionWC - surfacePosition, geodeticNormal);
2687
+ }
2688
+
2689
+ vec3 getGeodeticNormal(vec3 positionWC) {
2690
+ vec3 oneOverRadiiSquared = czm_ellipsoidInverseRadii * czm_ellipsoidInverseRadii;
2691
+ return normalize(positionWC * oneOverRadiiSquared);
2692
+ }
2693
+
2694
+ void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) {
2695
+ vec3 positionMC = vsInput.attributes.positionMC;
2696
+ vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
2697
+ vec2 localPoint = getLocalPolygonPoint(positionWC);
2698
+ if (!isPointInsidePolygon(localPoint)) {
2699
+ return;
2700
+ }
2701
+
2702
+ float distanceToEdge = getDistanceToPolygonEdge(localPoint);
2703
+ float flattenMix = smoothstep(0.0, POLYGON_EDGE_BLEND_WIDTH, distanceToEdge);
2704
+ if (flattenMix <= 0.0) {
2705
+ return;
2706
+ }
2707
+
2708
+ float currentHeight = getApproximateHeight(positionWC);
2709
+ vec3 geodeticNormal = getGeodeticNormal(positionWC);
2710
+ vec3 flattenedWC = positionWC + geodeticNormal * ((u_height - currentHeight) * flattenMix);
2711
+ vsOutput.positionMC = (czm_inverseModel * vec4(flattenedWC, 1.0)).xyz;
2712
+ }
2713
+ `}var vn=class{constructor(e){this._id=v.uuid(),this._viewer=e,this._polygonPositions=[],this._height=0,this._tilesetStates=[]}get type(){return"tilesetFlatten"}get id(){return this._id}async _init(e,t={}){if(this.deactivate(),!Array.isArray(e)||e.length<3)throw new Error("tilesetFlatten analysis requires at least 3 polygon positions");let r=am(t),s=await lm(this._viewer,r);if((Object.prototype.hasOwnProperty.call(t,"tileset")||Object.prototype.hasOwnProperty.call(t,"tilesets"))&&s.length===0)throw new Error("tilesetFlatten analysis requires valid tileset targets");this._polygonPositions=e,this._height=r.height,this._tilesetStates=s.map(l=>({tileset:l,originalCustomShader:l.customShader}));let n=this._createCustomShader();return this._tilesetStates.forEach(l=>{l.tileset.customShader=n}),this}_createCustomShader(){return new i.CustomShader({mode:i.CustomShaderMode.MODIFY_MATERIAL,translucencyMode:i.CustomShaderTranslucencyMode.INHERIT,uniforms:{u_height:{type:i.UniformType.FLOAT,value:this._height}},vertexShaderText:hm(this._polygonPositions)})}deactivate(){return nm(this._tilesetStates),this._tilesetStates=[],this._polygonPositions=[],this}},cm=vn;var He=24*60,Mf=10,If=240;function ui(a){return a instanceof Date?new Date(a.getTime()):void 0}function $e(a){var e;return typeof((e=i)==null?void 0:e.JulianDate)=="function"&&a instanceof i.JulianDate?i.JulianDate.clone(a):a instanceof Date?ui(a):a&&typeof a.clone=="function"?a.clone():a}function wn(a){var e,t;if(a instanceof Date)return typeof((t=(e=i)==null?void 0:e.JulianDate)==null?void 0:t.fromDate)=="function"?i.JulianDate.fromDate(a):ui(a)}function dm(a,e,t){let r=Number(a!=null?a:e);if(!Number.isFinite(r)||r<=0)throw new Error(`sunshine analysis requires ${t} > 0`);return r}function _m(a){var t;if(a==null||a===""){let r=new Date;return new Date(r.getFullYear(),r.getMonth(),r.getDate(),0,0,0,0)}if(typeof a=="string"){let s=a.trim().match(/^(\d{4})-(\d{2})-(\d{2})$/);if(s){let o=Number(s[1]),n=Number(s[2]),l=Number(s[3]);return new Date(o,n-1,l,0,0,0,0)}}let e=a instanceof Date?ui(a):new Date(a);if(Number.isNaN((t=e==null?void 0:e.getTime)==null?void 0:t.call(e)))throw new Error("sunshine analysis requires a valid date");return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0)}function Lf(a){let e=String(a.getFullYear()).padStart(4,"0"),t=String(a.getMonth()+1).padStart(2,"0"),r=String(a.getDate()).padStart(2,"0");return`${e}-${t}-${r}`}function Df(a){let e=Math.max(0,Math.min(He,Math.round(a)));if(e===He)return"24:00";let t=String(Math.floor(e/60)).padStart(2,"0"),r=String(e%60).padStart(2,"0");return`${t}:${r}`}function pm(a){let t=String(a!=null?a:"").trim().match(/^(\d{1,2}):(\d{2})$/);if(!t)throw new Error("sunshine analysis seek time must be HH:mm");let r=Number(t[1]),s=Number(t[2]);if(r<0||r>24||s<0||s>59)throw new Error("sunshine analysis seek time must be HH:mm");if(r===24&&s!==0)throw new Error("sunshine analysis seek time must be HH:mm");return r*60+s}function Rf(a,e){return!Number.isFinite(a)||a<=0||!Number.isFinite(e)||e<=0?16:Math.max(16,a*60*1e3/e)}function mm(a={}){let e=dm(a.frameStepMinutes,Mf,"frameStepMinutes"),t=dm(a.rate,If,"rate");return{date:_m(a.date),frameStepMinutes:e,rate:t,loop:a.loop===!0,autoPlay:a.autoPlay===!0,syncViewerClock:a.syncViewerClock!==!1}}function Of(a){let e=[],t=a.frameStepMinutes,r=_m(a.date);for(let s=0,o=0;s<He;s+=t,o+=1)e.push({index:o,minutes:s,label:Df(s),time:new Date(r.getTime()+s*60*1e3),progress:s/He});return(e.length===0||e[e.length-1].minutes!==He)&&e.push({index:e.length,minutes:He,label:"24:00",time:new Date(r.getTime()+He*60*1e3),progress:1}),e}function kf(a){var s,o,n,l,h,c;let e=(s=a==null?void 0:a.delegate)!=null?s:a,t=(o=a==null?void 0:a.scene)!=null?o:e==null?void 0:e.scene,r=(n=a==null?void 0:a.clock)!=null?n:e==null?void 0:e.clock;return{delegateShadows:e==null?void 0:e.shadows,shadowMapEnabled:(l=t==null?void 0:t.shadowMap)==null?void 0:l.enabled,globeEnableLighting:(h=t==null?void 0:t.globe)==null?void 0:h.enableLighting,sunShow:(c=t==null?void 0:t.sun)==null?void 0:c.show,clock:{startTime:$e(r==null?void 0:r.startTime),stopTime:$e(r==null?void 0:r.stopTime),currentTime:$e(r==null?void 0:r.currentTime),multiplier:r==null?void 0:r.multiplier,shouldAnimate:r==null?void 0:r.shouldAnimate}}}function um(a,e){var o,n,l;if(!e)return;let t=(o=a==null?void 0:a.delegate)!=null?o:a,r=(n=a==null?void 0:a.scene)!=null?n:t==null?void 0:t.scene,s=(l=a==null?void 0:a.clock)!=null?l:t==null?void 0:t.clock;t&&"delegateShadows"in e&&(t.shadows=e.delegateShadows),r!=null&&r.shadowMap&&"shadowMapEnabled"in e&&(r.shadowMap.enabled=e.shadowMapEnabled),r!=null&&r.globe&&"globeEnableLighting"in e&&(r.globe.enableLighting=e.globeEnableLighting),r!=null&&r.sun&&"sunShow"in e&&(r.sun.show=e.sunShow),s&&e.clock&&(s.startTime=$e(e.clock.startTime),s.stopTime=$e(e.clock.stopTime),s.currentTime=$e(e.clock.currentTime),s.multiplier=e.clock.multiplier,s.shouldAnimate=e.clock.shouldAnimate)}function ht(a){if(a)return{index:a.index,minutes:a.minutes,label:a.label,progress:a.progress,time:ui(a.time)}}function Nf(a,e){let t=Array.isArray(e)?e:[],r=Math.max(0,t.length-1);if(r===0)return 0;let s=l=>Math.max(0,Math.min(r,Math.round(Number(l)||0))),o=l=>{var d,m;let h=0,c=Number.POSITIVE_INFINITY;for(let f=0;f<=r;f++){let u=Math.abs(((m=(d=t[f])==null?void 0:d.minutes)!=null?m:0)-l);u<c&&(c=u,h=f)}return h},n=l=>{var d,m,f;let h=0,c=Number.POSITIVE_INFINITY;for(let u=0;u<=r;u++){let p=(f=(m=(d=t[u])==null?void 0:d.time)==null?void 0:m.getTime)==null?void 0:f.call(m);if(!Number.isFinite(p))continue;let x=Math.abs(p-l);x<c&&(c=x,h=u)}return h};if(a&&typeof a=="object"&&!(a instanceof Date)){if(Number.isFinite(Number(a.index)))return s(a.index);if(Number.isFinite(Number(a.progress))){let l=Math.max(0,Math.min(1,Number(a.progress)));return s(l*r)}if(typeof a.time=="string")return o(pm(a.time));if(a.time instanceof Date)return n(a.time.getTime())}if(a instanceof Date)return n(a.getTime());if(typeof a=="string")return o(pm(a));if(Number.isFinite(Number(a))){let l=Number(a);return l>=0&&l<=1&&!Number.isInteger(l)?s(l*r):s(l)}return 0}var Cn=class{constructor(e){if(!e)throw new Error("missing viewer param");this._viewer=e,this._options=mm(),this._timeline=[],this._frameIndex=0,this._timer=void 0,this._playing=!1,this._destroyed=!1,this._state="idle",this._viewerSnapshot=void 0,this._listeners=new Map}get type(){return"sunshine"}get state(){return this._state}get timeline(){return this.getTimeline()}get currentFrame(){return this.getCurrentFrame()}getSummary(){return{date:Lf(this._options.date),frameStepMinutes:this._options.frameStepMinutes,frameCount:this._timeline.length,rate:this._options.rate,state:this._state,currentFrame:ht(this._timeline[this._frameIndex])}}getTimeline(){return this._timeline.map(e=>ht(e))}getCurrentFrame(){return ht(this._timeline[this._frameIndex])}on(e,t){if(this._assertUsable("on"),typeof t!="function")throw new Error("sunshine session listener must be a function");return this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t),()=>this.off(e,t)}off(e,t){let r=this._listeners.get(e);return r==null||r.delete(t),r&&r.size===0&&this._listeners.delete(e),this}async _init(e,t={}){return this._assertUsable("_init"),this._stopPlayback(),this._viewerSnapshot&&um(this._viewer,this._viewerSnapshot),this._options=mm(t),this._timeline=Of(this._options),this._frameIndex=0,this._state="idle",this._viewerSnapshot=kf(this._viewer),this._applySunshineSceneState(),this.renderFrame(0),this._emit("computed",{summary:this.getSummary(),timeline:this.getTimeline()}),this._options.autoPlay&&this.play(),this}play(){return this._assertUsable("play"),this._timeline.length?this._playing?this:(this._playing=!0,this._setState("playing"),this._syncClock(this._timeline[this._frameIndex]),this._scheduleNextFrame(),this):this}pause(){return this._assertUsable("pause"),this._playing?(this._stopPlayback(),this._setState("paused"),this):this}stop(){return this._assertUsable("stop"),this._stopPlayback(),this.renderFrame(0),this._setState("idle"),this}seek(e){return this._assertUsable("seek"),this.renderFrame(e)}renderFrame(e=this._frameIndex){this._assertUsable("renderFrame"),this._frameIndex=Nf(e,this._timeline);let t=this._timeline[this._frameIndex];return this._syncClock(t),this._emit("framechange",{frame:ht(t),state:this._state}),ht(t)}destroy(){return this._destroyed?this:(this._stopPlayback(),um(this._viewer,this._viewerSnapshot),this._timeline=[],this._frameIndex=0,this._viewerSnapshot=void 0,this._destroyed=!0,this._setState("destroyed"),this._emit("destroy",{type:this.type}),this._listeners.clear(),this)}_assertUsable(e){if(this._destroyed)throw new Error(`sunshine session has been destroyed and cannot ${e}`)}_setState(e){this._state!==e&&(this._state=e,this._emit("statechange",{state:this._state}))}_stopPlayback(){var e,t,r,s;if(this._playing=!1,this._timer&&(clearTimeout(this._timer),this._timer=void 0),this._options.syncViewerClock!==!1){let o=(s=(e=this._viewer)==null?void 0:e.clock)!=null?s:(r=(t=this._viewer)==null?void 0:t.delegate)==null?void 0:r.clock;o&&(o.shouldAnimate=!1)}}_applySunshineSceneState(){var r,s,o,n,l;let e=(s=(r=this._viewer)==null?void 0:r.delegate)!=null?s:this._viewer,t=(n=(o=this._viewer)==null?void 0:o.scene)!=null?n:e==null?void 0:e.scene;e&&(e.shadows=!0),t!=null&&t.shadowMap&&(t.shadowMap.enabled=!0),t!=null&&t.globe&&(t.globe.enableLighting=!0),t!=null&&t.sun&&(t.sun.show=!0),(l=t==null?void 0:t.requestRender)==null||l.call(t)}_syncClock(e){var o,n,l,h,c,d,m;if(this._options.syncViewerClock===!1||!e)return;let t=(h=(o=this._viewer)==null?void 0:o.clock)!=null?h:(l=(n=this._viewer)==null?void 0:n.delegate)==null?void 0:l.clock;if(!t)return;let r=this._timeline[0],s=this._timeline[this._timeline.length-1];t.startTime=wn(r==null?void 0:r.time),t.stopTime=wn(s==null?void 0:s.time),t.currentTime=wn(e.time),t.multiplier=this._options.rate,t.shouldAnimate=this._playing,(m=(d=(c=this._viewer)==null?void 0:c.scene)==null?void 0:d.requestRender)==null||m.call(d)}_scheduleNextFrame(){var l;if(!this._playing)return;let e=this._frameIndex,t=this._timeline.length-1,r=e+1;if(r>t){if(!this._options.loop){this._stopPlayback(),this._setState("ended");return}r=0}let s=this._timeline[e],o=this._timeline[r],n=r>e?Math.max(0,o.minutes-s.minutes):this._options.frameStepMinutes;this._timer=setTimeout(()=>{!this._playing||this._destroyed||(this.renderFrame(r),this._scheduleNextFrame())},Rf(n,this._options.rate)),typeof((l=this._timer)==null?void 0:l.unref)=="function"&&this._timer.unref()}_emit(e,t){let r=this._listeners.get(e);if(r!=null&&r.size)for(let s of[...r])try{s(t)}catch{}}},fm=Cn;var xn=1e-6,Re=Object.freeze({baseWaterColor:"#2f8fff",blendColor:"#49d9b9",frequency:1e3,animationSpeed:.01,amplitude:10,specularIntensity:.5,closeTop:!0,closeBottom:!1}),Tn=Object.freeze({red:.21,green:.58,blue:.95});function _i(a,e){var t,r,s,o,n;if(!a)return e;if(a instanceof i.Color)return a;if(typeof a=="string")try{return i.Color.fromCssColorString(a)}catch{return e}if(Array.isArray(a)){let[l=0,h=0,c=0,d=1]=a,m=Math.max(l,h,c)>1?255:1,f=d>1?d/255:d;return new i.Color(l/m,h/m,c/m,f)}if(typeof a=="object"){let l=(t=a.r)!=null?t:a.red,h=(r=a.g)!=null?r:a.green,c=(s=a.b)!=null?s:a.blue,d=(n=(o=a.a)!=null?o:a.alpha)!=null?n:1;if(Number.isFinite(Number(l))&&Number.isFinite(Number(h))&&Number.isFinite(Number(c))){let m=Number(l),f=Number(h),u=Number(c),p=Number(d),x=Math.max(m,f,u)>1?255:1,C=p>1?p/255:p;return new i.Color(m/x,f/x,u/x,C)}}return e}function gi(a,e){let t=Number(a);if(!Number.isFinite(t))throw new Error(`inundation analysis requires finite ${e}`);return t}function Ff(a,e){let t=gi(a,e);if(t<=0)throw new Error(`inundation analysis requires ${e} to be greater than 0`);return t}function gm(a,e=!0){if(a==null)return e;if(typeof a=="boolean")return a;if(typeof a=="number")return Number.isFinite(a)?a!==0:e;if(typeof a=="string"){let t=a.trim().toLowerCase();return["true","1","yes","y","on"].includes(t)?!0:["false","0","no","n","off"].includes(t)?!1:e}return e}function Hf(a={}){let e=a.startHeight===void 0||a.startHeight===null?void 0:gi(a.startHeight,"startHeight"),t=a.waterStyle&&typeof a.waterStyle=="object"?{...a.waterStyle}:{};return a.waterColor!==void 0&&t.baseWaterColor===void 0&&(t.baseWaterColor=a.waterColor),{waterHeight:gi(a.waterHeight,"waterHeight"),speed:Ff(a.speed,"speed"),startHeight:e,showWater:gm(a.showWater,!0),showTilesetFlood:gm(a.showTilesetFlood,!0),waterStyle:t}}function zf(a){var r,s,o;let e=Number((s=(r=a==null?void 0:a.lng)!=null?r:a==null?void 0:a.lon)!=null?s:a==null?void 0:a.longitude),t=Number((o=a==null?void 0:a.lat)!=null?o:a==null?void 0:a.latitude);if(!(!Number.isFinite(e)||!Number.isFinite(t)))return{lng:e,lat:t}}function Wf(a){var t,r;let e=Number((r=(t=a==null?void 0:a.alt)!=null?t:a==null?void 0:a.height)!=null?r:0);return Number.isFinite(e)?e:void 0}function Gf(a){var r,s,o;if(!a||typeof a!="object")return!1;let e=(s=(r=a.lng)!=null?r:a.lon)!=null?s:a.longitude,t=(o=a.lat)!=null?o:a.latitude;return Number.isFinite(Number(e))&&Number.isFinite(Number(t))}function ym(a,{assumeRadians:e=!1}={}){var l;if(!a)return[];let t=h=>Number(h)*180/Math.PI,r=((l=i.Math)==null?void 0:l.toDegrees)||t,o=[a.west,a.south,a.east,a.north].map(h=>Number(h)).some(h=>Math.abs(h)>Math.PI*2),n=e?o?h=>Number(h):h=>r(h):h=>Number(h);return[{lng:n(a.west),lat:n(a.south)},{lng:n(a.east),lat:n(a.south)},{lng:n(a.east),lat:n(a.north)},{lng:n(a.west),lat:n(a.north)}]}function Uf(a={}){let e=_i(Re.baseWaterColor,new i.Color(.2,.3,.6,1)),t=_i(Re.blendColor,new i.Color(0,1,.699,1));return{baseWaterColor:_i(a.baseWaterColor,e),blendColor:_i(a.blendColor,t),specularMap:a.specularMap,normalMap:a.normalMap,frequency:Number.isFinite(Number(a.frequency))?Number(a.frequency):Re.frequency,animationSpeed:Number.isFinite(Number(a.animationSpeed))?Number(a.animationSpeed):Re.animationSpeed,amplitude:Number.isFinite(Number(a.amplitude))?Number(a.amplitude):Re.amplitude,specularIntensity:Number.isFinite(Number(a.specularIntensity))?Number(a.specularIntensity):Re.specularIntensity,closeTop:a.closeTop===void 0?Re.closeTop:a.closeTop===!0,closeBottom:a.closeBottom===void 0?Re.closeBottom:a.closeBottom===!0}}function Bf(a,e){return a.map(t=>({lng:Number(t.lng),lat:Number(t.lat),alt:e}))}function Vf(a=[]){if(!Array.isArray(a))throw new Error("inundation analysis requires polygon positions array");let e=a.map(t=>zf(t)).filter(t=>!!t);if(e.length<3)throw new Error("inundation analysis requires at least 3 polygon positions");return e}function Oe(a){return Number(a).toFixed(8)}function jf(a){return`vec2(${Oe(a.x)}, ${Oe(a.y)})`}function En(a){return`vec3(${Oe(a.x)}, ${Oe(a.y)}, ${Oe(a.z)})`}function Ke(a){return!!a&&typeof a.length=="number"&&typeof a.get=="function"}function Pn(a){return typeof i.Cesium3DTileset=="function"&&a instanceof i.Cesium3DTileset||(a==null?void 0:a.isCesium3DTileset)===!0}function fi(a,e=[],t=new Set,r=new Set){if(!Ke(a)||t.has(a))return e;t.add(a);for(let s=0;s<a.length;s++){let o=a.get(s);if(!o)continue;if(Pn(o)){r.has(o)||(r.add(o),e.push(o));continue}(typeof i.PrimitiveCollection=="function"&&o instanceof i.PrimitiveCollection||Ke(o))&&fi(o,e,t,r)}return e}function Yf(a=[]){let e=Vf(a),t=i.Cartesian3.fromDegrees(e.reduce((c,d)=>c+d.lng,0)/e.length,e.reduce((c,d)=>c+d.lat,0)/e.length,0),r=i.Transforms.eastNorthUpToFixedFrame(t),s=i.Matrix4.inverseTransformation(r,new i.Matrix4),o=i.Matrix4.getColumn(r,0,new i.Cartesian4),n=i.Matrix4.getColumn(r,1,new i.Cartesian4),h=e.map(c=>{let d=i.Cartesian3.fromDegrees(c.lng,c.lat,0);return i.Matrix4.multiplyByPoint(s,d,new i.Cartesian3)}).map(jf);return`
2714
+ const int POLYGON_VERTEX_COUNT = ${e.length};
2715
+ const vec3 LOCAL_FRAME_ORIGIN = ${En(t)};
2716
+ const vec3 LOCAL_FRAME_EAST = ${En(o)};
2717
+ const vec3 LOCAL_FRAME_NORTH = ${En(n)};
2718
+ const float INUNDATION_EPSILON = 1.0e-6;
2719
+ const vec3 INUNDATION_FLOOD_COLOR = vec3(
2720
+ ${Oe(Tn.red)},
2721
+ ${Oe(Tn.green)},
2722
+ ${Oe(Tn.blue)}
2723
+ );
2724
+
2725
+ vec2 getLocalPolygonPoint(vec3 positionWC) {
2726
+ vec3 delta = positionWC - LOCAL_FRAME_ORIGIN;
2727
+ float x = dot(delta, LOCAL_FRAME_EAST);
2728
+ float y = dot(delta, LOCAL_FRAME_NORTH);
2729
+ return vec2(x, y);
2730
+ }
2731
+
2732
+ bool isPointInsidePolygon(vec2 point) {
2733
+ const vec2 polygonVertices[POLYGON_VERTEX_COUNT] = vec2[POLYGON_VERTEX_COUNT](
2734
+ ${h.join(`,
2735
+ `)}
2736
+ );
2737
+
2738
+ bool inside = false;
2739
+ for (int i = 0, j = POLYGON_VERTEX_COUNT - 1; i < POLYGON_VERTEX_COUNT; j = i, i++) {
2740
+ vec2 current = polygonVertices[i];
2741
+ vec2 previous = polygonVertices[j];
2742
+ float denominator = previous.y - current.y;
2743
+ bool intersects = ((current.y > point.y) != (previous.y > point.y))
2744
+ && (point.x < ((previous.x - current.x) * (point.y - current.y)) / (abs(denominator) < INUNDATION_EPSILON ? INUNDATION_EPSILON : denominator) + current.x);
2745
+ if (intersects) {
2746
+ inside = !inside;
2747
+ }
2748
+ }
2749
+ return inside;
2750
+ }
2751
+
2752
+ float getApproximateHeight(vec3 positionWC) {
2753
+ vec3 oneOverRadiiSquared = czm_ellipsoidInverseRadii * czm_ellipsoidInverseRadii;
2754
+ vec3 geodeticNormal = normalize(positionWC * oneOverRadiiSquared);
2755
+ vec3 radiiSquared = czm_ellipsoidRadii * czm_ellipsoidRadii;
2756
+ vec3 scaledNormal = radiiSquared * geodeticNormal;
2757
+ float gamma = sqrt(max(dot(scaledNormal, geodeticNormal), INUNDATION_EPSILON));
2758
+ vec3 surfacePosition = scaledNormal / gamma;
2759
+ return dot(positionWC - surfacePosition, geodeticNormal);
2760
+ }
2761
+
2762
+ void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {
2763
+ vec3 positionWC = fsInput.attributes.positionWC;
2764
+ vec2 localPoint = getLocalPolygonPoint(positionWC);
2765
+ if (!isPointInsidePolygon(localPoint)) {
2766
+ return;
2767
+ }
2768
+
2769
+ float height = getApproximateHeight(positionWC);
2770
+ if (height > u_waterHeight) {
2771
+ return;
2772
+ }
2773
+
2774
+ float submergedDepth = clamp(u_waterHeight - height, 0.0, 30.0);
2775
+ float floodMix = clamp(0.22 + submergedDepth * 0.03, 0.22, 0.78);
2776
+ float emissiveStrength = clamp(0.20 + submergedDepth * 0.02, 0.20, 0.55);
2777
+ material.diffuse = mix(material.diffuse, INUNDATION_FLOOD_COLOR, floodMix);
2778
+ material.emissive = max(
2779
+ material.emissive,
2780
+ INUNDATION_FLOOD_COLOR * emissiveStrength
2781
+ );
2782
+ }
2783
+ `}var bn=class{constructor(e){if(!e)throw Error("missing viewer param");this._id=v.uuid(),this._viewer=e,this._options=void 0,this._polygonPositions=[],this._waterOverlay=void 0,this._waterPrimitiveDelegate=void 0,this._tilesetStates=[],this._floodShader=void 0,this._animationActive=!1,this._hasClockControl=!1,this._clockState=void 0,this._tickHandler=this._handleTick.bind(this),this._lastTimestamp=0,this._watchedCollections=new Map,this._startHeight=0,this._currentHeight=0,this._targetHeight=0}get type(){return"inundation"}get id(){return this._id}setWaterHeight(e){if(!this._options||this._polygonPositions.length<3)throw new Error("inundation analysis must be initialized before setting water height");let t=gi(e,"waterHeight");return this._targetHeight=t,this._currentHeight=t,this._stopAnimation(),this._applyWaterHeight(t),this}async _init(e,t={}){return this.deactivate(),this._options=Hf(t),this._polygonPositions=this._resolvePolygonPositions(e),this._startHeight=this._resolveStartHeight(),this._currentHeight=this._startHeight,this._targetHeight=this._options.waterHeight,this._applyToSceneTilesets(),this._applyWaterHeight(this._currentHeight),this._targetHeight<=this._currentHeight+xn?(this._currentHeight=this._targetHeight,this._applyWaterHeight(this._currentHeight),this._stopAnimation(),this):(this._startAnimation(),this)}deactivate(){return this._stopAnimation(),this._detachPrimitiveCollectionWatchers(),this._removeWaterEffects(),this._restoreTilesetStates(),this._options=void 0,this._polygonPositions=[],this._clockState=void 0,this._lastTimestamp=0,this._hasClockControl=!1,this._startHeight=0,this._currentHeight=0,this._targetHeight=0,this}_resolvePolygonPositions(e){if(!e)return this._resolveScenePolygonPositions();this._validateRegionInput(e);let t=this._normalizePolygonPositions(y.parsePositions(e));if(t.length<3)throw new Error("inundation analysis requires at least 3 polygon positions");return t}_resolveScenePolygonPositions(){var o,n,l,h;let e=(o=this._viewer)==null?void 0:o.scene,t=(l=e==null?void 0:e.camera)!=null?l:(n=this._viewer)==null?void 0:n.camera,r=t&&typeof t.computeViewRectangle=="function"?t.computeViewRectangle():void 0;if(r)return this._normalizePolygonPositions(ym(r,{assumeRadians:!0}));let s=(h=this._viewer)==null?void 0:h.viewBounds;if(!s)throw new Error("inundation analysis requires a valid scene scope snapshot");return this._normalizePolygonPositions(ym(s,{assumeRadians:!1}))}_normalizePolygonPositions(e=[]){if(!Array.isArray(e))throw new Error("inundation analysis requires polygon positions array");return e.map((t,r)=>{let s=Number(t==null?void 0:t.lng),o=Number(t==null?void 0:t.lat);if(!Number.isFinite(s)||!Number.isFinite(o))throw new Error(`inundation analysis requires valid polygon positions at index ${r}`);return t})}_validateRegionInput(e){if(typeof e!="string"){if(!Array.isArray(e))throw new Error("inundation analysis requires polygon positions array");e.forEach((t,r)=>{if(typeof t=="string")return;if(Array.isArray(t)){if(t.length<2)throw new Error(`inundation analysis requires valid polygon positions at index ${r}`);return}let s=typeof i.Cartesian3=="function"&&t instanceof i.Cartesian3,o=typeof i.Cartographic=="function"&&t instanceof i.Cartographic;if(!(s||o||Gf(t)))throw new Error(`inundation analysis requires valid polygon positions at index ${r}`)})}}_resolveStartHeight(){var t;if(Number.isFinite((t=this._options)==null?void 0:t.startHeight))return this._options.startHeight;let e=[];for(let r of this._polygonPositions){let s=Wf(r);Number.isFinite(s)&&e.push(s)}return e.length?Math.min(...e):0}_removeWaterEffects(){var s,o,n,l;let e=(o=(s=this._viewer)==null?void 0:s.scene)==null?void 0:o.primitives;if(!e||typeof e.remove!="function"){this._waterOverlay=void 0,this._waterPrimitiveDelegate=void 0;return}let t=[this._waterPrimitiveDelegate,(n=this._waterOverlay)==null?void 0:n.delegate,(l=this._waterOverlay)==null?void 0:l._delegate],r=new Set;t.forEach(h=>{!h||r.has(h)||(r.add(h),e.remove(h))}),this._waterPrimitiveDelegate=void 0,this._waterOverlay=void 0}_addWaterPrimitive(e,t){var o;let r=(o=t==null?void 0:t.delegate)!=null?o:t==null?void 0:t._delegate,s=e.add(r!=null?r:t);return s||(r!=null?r:t)}_applyWaterHeight(e){var n,l,h,c,d,m,f,u,p,x,C,E,b;this._updateFloodWaterHeight(e);let t=(l=(n=this._viewer)==null?void 0:n.scene)==null?void 0:l.primitives;if(!t||typeof t.add!="function"){(d=(c=(h=this._viewer)==null?void 0:h.scene)==null?void 0:c.requestRender)==null||d.call(c);return}if(this._removeWaterEffects(),!((m=this._options)!=null&&m.showWater)){(p=(u=(f=this._viewer)==null?void 0:f.scene)==null?void 0:u.requestRender)==null||p.call(u);return}let r=Bf(this._polygonPositions,e);if(r.length<3)return;let s=Uf((x=this._options)==null?void 0:x.waterStyle),o=new St(r);o.setStyle({...s,height:e}),o.positions=r,this._waterOverlay=o,this._waterPrimitiveDelegate=this._addWaterPrimitive(t,o),(b=(E=(C=this._viewer)==null?void 0:C.scene)==null?void 0:E.requestRender)==null||b.call(E)}_applyToSceneTilesets(){var r,s,o;if(this._detachPrimitiveCollectionWatchers(),this._restoreTilesetStates(),!((r=this._options)!=null&&r.showTilesetFlood)){this._floodShader=void 0;return}this._tilesetStates=[],this._floodShader=this._createFloodShader(this._currentHeight);let e=(o=(s=this._viewer)==null?void 0:s.scene)==null?void 0:o.primitives;fi(e).forEach(n=>this._trackTileset(n)),this._attachPrimitiveCollectionWatchers(e)}_trackTileset(e){if(!e)return;this._tilesetStates.some(r=>r.tileset===e)||this._tilesetStates.push({tileset:e,originalCustomShader:e.customShader}),this._floodShader&&(e.customShader=this._floodShader)}_untrackTileset(e){let t=this._tilesetStates.findIndex(s=>s.tileset===e);if(t<0)return;let r=this._tilesetStates[t];(e==null?void 0:e.customShader)===this._floodShader&&(e.customShader=r.originalCustomShader),this._tilesetStates.splice(t,1)}_attachPrimitiveCollectionWatchers(e){var n,l;if(!Ke(e)||this._watchedCollections.has(e))return;let t=h=>this._onPrimitiveAdded(h),r=h=>this._onPrimitiveRemoved(h),s=(n=e==null?void 0:e.primitiveAdded)!=null&&n.addEventListener?e.primitiveAdded.addEventListener(t):void 0,o=(l=e==null?void 0:e.primitiveRemoved)!=null&&l.addEventListener?e.primitiveRemoved.addEventListener(r):void 0;this._watchedCollections.set(e,{addHandler:t,removeHandler:r,addUnsub:s,removeUnsub:o});for(let h=0;h<e.length;h++){let c=e.get(h);Ke(c)&&this._attachPrimitiveCollectionWatchers(c)}}_detachPrimitiveCollectionWatchers(){this._watchedCollections.forEach((e,t)=>{var r,s,o,n;typeof e.addUnsub=="function"?e.addUnsub():(s=(r=t==null?void 0:t.primitiveAdded)==null?void 0:r.removeEventListener)==null||s.call(r,e.addHandler),typeof e.removeUnsub=="function"?e.removeUnsub():(n=(o=t==null?void 0:t.primitiveRemoved)==null?void 0:o.removeEventListener)==null||n.call(o,e.removeHandler)}),this._watchedCollections.clear()}_onPrimitiveAdded(e){if(e){if(Pn(e)){this._trackTileset(e);return}Ke(e)&&(this._attachPrimitiveCollectionWatchers(e),fi(e).forEach(r=>this._trackTileset(r)))}}_onPrimitiveRemoved(e){var t,r,s,o;if(e){if(Pn(e)){this._untrackTileset(e);return}if(Ke(e)){fi(e).forEach(h=>this._untrackTileset(h));let l=this._watchedCollections.get(e);l&&(typeof l.addUnsub=="function"?l.addUnsub():(r=(t=e==null?void 0:e.primitiveAdded)==null?void 0:t.removeEventListener)==null||r.call(t,l.addHandler),typeof l.removeUnsub=="function"?l.removeUnsub():(o=(s=e==null?void 0:e.primitiveRemoved)==null?void 0:s.removeEventListener)==null||o.call(s,l.removeHandler),this._watchedCollections.delete(e))}}}_createFloodShader(e){return new i.CustomShader({mode:i.CustomShaderMode.MODIFY_MATERIAL,translucencyMode:i.CustomShaderTranslucencyMode.INHERIT,uniforms:{u_waterHeight:{type:i.UniformType.FLOAT,value:e}},fragmentShaderText:Yf(this._polygonPositions)})}_updateFloodWaterHeight(e){var r,s;if(!this._floodShader)return;if(typeof this._floodShader.setUniform=="function"){this._floodShader.setUniform("u_waterHeight",e);return}let t=(s=(r=this._floodShader)==null?void 0:r.uniforms)==null?void 0:s.u_waterHeight;t&&(t.value=e)}_restoreTilesetStates(){this._tilesetStates.forEach(e=>{e!=null&&e.tileset&&(e.tileset.customShader=e.originalCustomShader)}),this._tilesetStates=[],this._floodShader=void 0}_startAnimation(){var t,r;if(this._animationActive)return;let e=(t=this._viewer)==null?void 0:t.clock;(r=e==null?void 0:e.onTick)!=null&&r.addEventListener&&(this._animationActive=!0,this._clockState={shouldAnimate:e.shouldAnimate},this._lastTimestamp=Date.now(),e.shouldAnimate=!0,this._hasClockControl=!0,e.onTick.addEventListener(this._tickHandler))}_stopAnimation(){var t,r;let e=(t=this._viewer)==null?void 0:t.clock;this._animationActive&&((r=e==null?void 0:e.onTick)!=null&&r.removeEventListener)&&e.onTick.removeEventListener(this._tickHandler),e&&this._clockState&&this._hasClockControl&&(e.shouldAnimate=this._clockState.shouldAnimate),this._animationActive=!1,this._hasClockControl=!1,this._clockState=void 0}_handleTick(){if(!this._animationActive)return;let e=Date.now(),t=Math.max((e-this._lastTimestamp)/1e3,0);if(this._lastTimestamp=e,t<=0)return;let r=Math.min(this._targetHeight,this._currentHeight+this._options.speed*t);r<=this._currentHeight+xn||(this._currentHeight=r,this._applyWaterHeight(this._currentHeight),this._currentHeight>=this._targetHeight-xn&&this._stopAnimation())}},vm=bn;var Sn=class{constructor(e,t={}){this._id=v.uuid(),this._viewer=e,this._targetHeight=t.targetHeight?t.targetHeight:10,this._startHeight=t.startHeight?t.startHeight:0,this._waterHeight=t.waterHeight?t.waterHeight:this._startHeight,this._adapCoordi=t.adapCoordi?t.adapCoordi:[0,0,0,0,0,0],this._speed=t.speed?t.speed:1,this._color=t.color?t.color:new i.Color.fromBytes(64,157,253,100),this._changetype=t.changetype?t.changetype:"up",this._speedCallback=t.speedCallback?t.speedCallback:r=>{},this._endCallback=t.endCallback?t.endCallback:()=>{},this.polygonEntity=null,this._timer=null,this._state=_.INITIALIZED,this.createEntity()}get type(){return"submergence"}set enable(e){this._enable=e}get enable(){return this._enable}set startHeight(e){this._startHeight=e}get startHeight(){return this._startHeight}set targetHeight(e){this._targetHeight=e}get targetHeight(){return this._targetHeight}set speed(e){this._speed=e}get speed(){return this._speed}createEntity(){if(this.polygonEntity&&this.polygonEntity.length>0)for(let r of this.polygonEntity)this._viewer.entities.remove(r);this.polygonEntity=[];let e=new i.PolygonHierarchy(i.Cartesian3.fromDegreesArray(this._adapCoordi)),t=this._viewer.entities.add({polygon:{hierarchy:e,height:this._startHeight,material:this._color}});t.polygon.extrudedHeight=new i.CallbackProperty(()=>this._waterHeight,!1),this.polygonEntity.push(t)}start(){this._waterHeight=this._startHeight,this._timer=window.setInterval(()=>{var e=this._speed/50;this._changetype=="up"?(this._waterHeight=this.floatObj().add(this._waterHeight,e),this._waterHeight>this._targetHeight&&(this._waterHeight=this._targetHeight,window.clearInterval(this._timer),this._endCallback())):(this._waterHeight-=e,this._waterHeight<this._targetHeight&&(this._waterHeight=this._targetHeight,window.clearInterval(this._timer),this._endCallback())),this._speedCallback(this._waterHeight)},20)}floatObj(){function e(h){return Math.floor(h)===h}function t(h){var c={times:1,num:0};if(e(h))return c.num=h,c;var d=h+"",m=d.indexOf("."),f=d.substr(m+1).length,u=Math.pow(10,f),p=parseInt(h*u+.5,10);return c.times=u,c.num=p,c}function r(h,c,d){var m=t(h),f=t(c),u=m.num,p=f.num,x=m.times,C=f.times,E=x>C?x:C,b=null;switch(d){case"add":return x===C?b=u+p:x>C?b=u+p*(x/C):b=u*(C/x)+p,b/E;case"subtract":return x===C?b=u-p:x>C?b=u-p*(x/C):b=u*(C/x)-p,b/E;case"multiply":return b=u*p/(x*C),b;case"divide":return b=u/p*(C/x),b}}function s(h,c){return r(h,c,"add")}function o(h,c){return r(h,c,"subtract")}function n(h,c){return r(h,c,"multiply")}function l(h,c){return r(h,c,"divide")}return{add:s,subtract:o,multiply:n,divide:l}}deactivate(){if(this._timer&&(window.clearInterval(this._timer),this._timer=null),this._waterHeight=this._startHeight,this.polygonEntity&&this.polygonEntity.length>0)for(let e of this.polygonEntity)this._viewer.entities.remove(e);this.polygonEntity=null}},wm=Sn;var An=class{constructor(e){if(!e)throw Error("missing viewer param");this._viewer=e,this._contourLine=new Np(e),this._tilesetShake=new Fp(e),this._sightLine=new Gp(e),this._viewshed=new Bp(e),this._multiViewshed=new jp(e),this._slopeAnalysis=new qp(e),this._aspectAnalysis=new Jp(e),this._heightLimitAnalysis=new im(e),this._tilesetFlattenAnalysis=void 0,this._sunshineSession=void 0,this._inundationAnalysis=void 0,this._submergence=null}get ContourLine(){return this._contourLine}get TilesetShake(){return this._tilesetShake}get SightLine(){return this._sightLine}get ViewShed(){return this._viewshed}get MultiViewShed(){return this._multiViewshed}get SlopeAnalysis(){return this._slopeAnalysis}get AspectAnalysis(){return this._aspectAnalysis}get HeightLimitAnalysis(){return this._heightLimitAnalysis}get TilesetFlattenAnalysis(){return this._tilesetFlattenAnalysis}get SunshineSession(){return this._sunshineSession}get InundationAnalysis(){return this._inundationAnalysis}get Submergence(){return this._submergence}contourLine(e,t,r){this._contourLine._init(e,t,r)}tilesetShake(e,t){this._tilesetShake._init(e,t)}terrainClip(e={}){return new Hp(this._viewer,e)}terrainClipPlan(e={}){return new zp(this._viewer,e)}terrainUplift(e={}){return new Wp(this._viewer,e)}sightLine(e,t,r){return this._sightLine._init(e,t,r)}viewshed(e,t){return this._viewshed._init(e,t),this._viewshed}multiViewshed(e,t){return this._multiViewshed._init(e,t),this._multiViewshed}async slope(e,t){return await this._slopeAnalysis._init(e,t),this._slopeAnalysis}async aspect(e,t){return await this._aspectAnalysis._init(e,t),this._aspectAnalysis}async heightLimit(e,t){return await this._heightLimitAnalysis._init(e,t),this._heightLimitAnalysis}async tilesetFlatten(e,t){this._destroyTilesetFlattenAnalysis();let r=new cm(this._viewer);this._tilesetFlattenAnalysis=r;try{return await r._init(e,t),r}catch(s){throw this._tilesetFlattenAnalysis===r&&(r.deactivate(),this._tilesetFlattenAnalysis=void 0),s}}async sunshine(e,t){this._destroySunshineSession(),this._destroyInundationAnalysis();let r=new fm(this._viewer);this._sunshineSession=r;try{return await r._init(e,t),r}catch(s){throw this._sunshineSession===r&&(r.destroy(),this._sunshineSession=void 0),s}}async inundation(e,t){var s,o;(o=(s=this._heightLimitAnalysis)==null?void 0:s.deactivate)==null||o.call(s),this._destroyTilesetFlattenAnalysis(),this._destroySunshineSession(),this._destroyInundationAnalysis();let r=new vm(this._viewer);this._inundationAnalysis=r;try{return await r._init(e,t),r}catch(n){throw this._inundationAnalysis===r&&(r.deactivate(),this._inundationAnalysis=void 0),n}}submergence(e={}){return this._submergence=new wm(this._viewer,e),this._submergence}deactivate(e=null){var t,r,s,o;switch(e){case ae.SIGHT_LINE:this._sightLine.deactivate();break;case ae.VIEW_SHED:this._viewshed.deactivate();break;case ae.MULTI_VIEW_SHED:this._multiViewshed.deactivate();break;case ae.SLOPE:this._slopeAnalysis.deactivate();break;case ae.ASPECT:this._aspectAnalysis.deactivate();break;case ae.HEIGHT_LIMIT:this._heightLimitAnalysis.deactivate();break;case ae.TILESET_FLATTEN:this._destroyTilesetFlattenAnalysis();break;case ae.SUNSHINE:this._destroySunshineSession();break;case ae.INUNDATION:this._destroyInundationAnalysis();break;case ae.Submergence:(r=(t=this._submergence)==null?void 0:t.deactivate)==null||r.call(t);break;default:this._contourLine.deactivate(),this._tilesetShake.deactivate(),this._sightLine.deactivate(),this._viewshed.deactivate(),this._multiViewshed.deactivate(),this._slopeAnalysis.deactivate(),this._aspectAnalysis.deactivate(),this._heightLimitAnalysis.deactivate(),this._destroyTilesetFlattenAnalysis(),this._destroySunshineSession(),this._destroyInundationAnalysis(),(o=(s=this._submergence)==null?void 0:s.deactivate)==null||o.call(s);break}return this}_destroyTilesetFlattenAnalysis(){this._tilesetFlattenAnalysis&&(this._tilesetFlattenAnalysis.deactivate(),this._tilesetFlattenAnalysis=void 0)}_destroyInundationAnalysis(){this._inundationAnalysis&&(this._inundationAnalysis.deactivate(),this._inundationAnalysis=void 0)}_destroySunshineSession(){this._sunshineSession&&(this._sunshineSession.destroy(),this._sunshineSession=void 0)}},Cm=An;var Mn=class{constructor(e){this._style=e,this._viewer=void 0,this._layer=void 0,this._delegate=void 0,this._options={},this._positions=[]}get drawTool(){return this._viewer.drawTool}_mountedHook(){}_onDrawAnchor(e){}_onAnchorMoving(e){this._positions.pop(),this._positions.push(e),this._options.onCalc&&this._options.onCalc(this._positions)}_onDrawStop(){this._unbindEvent(),this._viewer.drawTool.deactivate(),this._options.onDrawStop&&this._options.onDrawStop(this._delegate)}_bindEvent(){this.drawTool.on(P.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.on(P.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.on(P.DRAW_STOP,this._onDrawStop,this)}_unbindEvent(){this.drawTool.off(P.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.off(P.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.off(P.DRAW_STOP,this._onDrawStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.drawTool.activate(t),this._mountedHook(),this._unbindEvent(),this._bindEvent(),this}},xm=Mn;var In=class extends xm{constructor(e){super(e)}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polyline:{...this._style,positions:new i.CallbackProperty(()=>this._positions,!1)}}),this._layer.entities.add(this._delegate)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),t>0&&this.drawTool.fire(P.CREATE_ANCHOR,{position:e}),t>=this._options.maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(P.DRAW_STOP,e))}},Tm=In;var Ln=class{constructor(){this._viewer=void 0,this._layer=void 0,this._startLabel=new i.Entity({label:{text:"\u5F00\u59CB",font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._resultLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._options={}}_getSampledHeight(e,t=!1){let r=this._viewer.terrainProvider&&!(this._viewer.terrainProvider instanceof i.EllipsoidTerrainProvider)?i.sampleTerrainMostDetailed(this._viewer.terrainProvider,e.map(o=>i.Cartographic.fromCartesian(o))):Promise.resolve(e.map(o=>i.Cartographic.fromCartesian(o))),s=this._viewer.scene.clampToHeightSupported&&t?this._viewer.scene.clampToHeightMostDetailed(e,this._layer.entities.values):Promise.resolve(e);return Promise.all([r,s])}_onDrawStop(e){}_onComputedStop(e,t=!1){let r=[];return t?r=e.map((s,o)=>{let l=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(s),h=0;for(let c=1;c<=o;c++){let d=i.Cartesian3.distance(e[c-1],e[c]);h+=d}return{longitude:i.Math.toDegrees(l.longitude),latitude:i.Math.toDegrees(l.latitude),height:l.height,distance:h,cartesian3Position:s}}):r=e.map((s,o)=>{let n=0;for(let l=1;l<=o;l++){let h=i.Cartesian3.fromRadians(e[l-1].longitude,e[l-1].latitude,e[l-1].height),c=i.Cartesian3.fromRadians(e[l].longitude,e[l].latitude,e[l].height),d=i.Cartesian3.distance(h,c);n+=d}return{longitude:i.Math.toDegrees(s.longitude),latitude:i.Math.toDegrees(s.latitude),height:s.height,distance:n,cartesian3Position:i.Cartesian3.fromRadians(s.longitude,s.latitude,s.height)}}),r}_onCalc(e){}_startHook(e,t){this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._options.onDrawStop=this._onDrawStop.bind(this),this._options.onCalc=this._onCalc.bind(this),this._layer.entities.add(this._startLabel),this._layer.entities.add(this._resultLabel)}start(e,t){return this}},Em=Ln;var Dn=class extends Em{constructor(){super(),this._maxAnchorSize=9999,this._positions=[],this._includeModel=!0,this._callback=null}_lerp(e,t,r=5){let s=[],o=i.Cartographic.fromCartesian(e),n=i.Cartographic.fromCartesian(t);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,n.longitude,l/r),c=i.Math.lerp(o.latitude,n.latitude,l/r),d=o.height-(o.height-n.height)*(l/r);s.push(i.Cartesian3.fromRadians(h,c,d))}return s}async _onDrawStop(e){let t=this._positions.filter((s,o)=>o!==1),r=await this._onComputedStop(t,this._includeModel);typeof this._callback=="function"&&await this._callback(r)}_stoppedHook(){this._options.onDrawStop&&this._options.onDrawStop(entity)}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){let t=[e[0]];this._resultLabel.position=e[e.length-1];for(let r=0;r<e.length-1;r++)t=t.concat(this._lerp(e[r],e[r+1],this._options.lerpNum));t.push(e[e.length-1]),this._getSampledHeight(t,this._includeModel).then(([r,s])=>(this._includeModel||(this._positions=r),r.map((o,n)=>i.Cartesian3.fromDegrees(i.Math.toDegrees(o.longitude),i.Math.toDegrees(o.latitude),Math.max(o.height||0,s[n]?i.Cartographic.fromCartesian(s[n]).height:0))))).then(r=>{this._includeModel&&(this._positions=r);let s=0;for(let o=0;o<r.length-1;o++){let n=i.Cartesian3.distance(r[o],r[o+1]);s+=n}this._resultLabel.label.text=s>1e3?`\u8DDD\u79BB\uFF1A${(s/1e3).toFixed(2)} \u516C\u91CC`:`\u8DDD\u79BB\uFF1A${s.toFixed(2)} \u7C73`})}}start(e,t,r={}){return this._startHook(e,r),new Tm({material:r.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:r.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:r.width||2,clampToGround:!0}).start(e,{...this._options,maxAnchorSize:this._maxAnchorSize}),this._includeModel=r==null?void 0:r.includeModel,this._callback=t,this}},Pm=Dn;var Rn=class{constructor(e){if(!e)throw Error("missing viewer param");this._viewer=e,this._layer=new i.CustomDataSource("plotAnalysis-layer"),this._viewer.dataSources.add(this._layer)}get viewer(){return this._viewer}get layer(){return this._layer}profile(e,t={}){var r;return(r=new Pm)==null||r.start(this,e,t),this}activate(e,t){switch(e){case mi.PROFILE:this.profile(t);break;default:break}return this}deactivate(){return this._layer.entities.removeAll(),this._viewer.drawTool.tooltipMess="",this._viewer.drawTool.deactivate(),this._viewer.editTool.tooltipMess="",this._viewer.editTool.deactivate(),this}},bm=Rn;var ge={HORIZONTAL:"horizontal",VERTICAL:"vertical",GRID:"grid"},qf=Object.values(ge);function yi(a){let e=Number(a);if(!Number.isFinite(e))return 2;let t=Math.round(e);return t<2?2:t>4?4:t}function vi(a){return qf.includes(a)?a:ge.HORIZONTAL}function Sm(a){return{columns:`repeat(${a}, minmax(0, 1fr))`,rows:"minmax(0, 1fr)"}}function Zf(a){return{columns:"minmax(0, 1fr)",rows:`repeat(${a}, minmax(0, 1fr))`}}function Xf(a){return a===2?{...Sm(2),areas:["screen-0 screen-1"]}:a===3?{columns:"repeat(2, minmax(0, 1fr))",rows:"repeat(2, minmax(0, 1fr))",areas:["screen-0 screen-1","screen-2 screen-2"]}:{columns:"repeat(2, minmax(0, 1fr))",rows:"repeat(2, minmax(0, 1fr))",areas:["screen-0 screen-1","screen-2 screen-3"]}}function Am(a,e){let t=vi(a),r=yi(e);return t===ge.VERTICAL?Zf(r):t===ge.GRID?Xf(r):Sm(r)}var Jf={screenCount:2,layout:ge.HORIZONTAL,viewerOptions:{},syncCamera:!0,syncTime:!0,newScreenBaseLayerFrom:"none"},Qe={NONE:"none",FIRST:"first",SAME_INDEX_MOD:"same-index-mod",ACTIVE:"active"},$f=Object.values(Qe),On=class{constructor(e,t={}){let r=M.get(e);if(!r)throw new Error("MultiScreenCompare: the container is empty");if(!(r instanceof HTMLElement))throw new Error("MultiScreenCompare: invalid container");this._container=r,this._viewers=[],this._viewerBoxes=[],this._listenerCache=[],this._cameraSyncing=!1,this._timeSyncing=!1,this._activeScreenIndex=0,this._viewerBaseLayerMeta=new Map,this._options={...Jf,...t},this._screenCount=yi(this._options.screenCount),this._layout=vi(this._options.layout),this._viewerOptions=this._options.viewerOptions,this._syncCamera=this._options.syncCamera!==!1,this._syncTime=this._options.syncTime!==!1,this._newScreenBaseLayerFrom=this._normalizeBaseLayerStrategy(this._options.newScreenBaseLayerFrom),this._wrapper=M.create("div","gm-multi-screen-compare",this._container),this._buildViewers(),this._applyLayout(),this._bindSync(),this._scheduleResize()}get viewers(){return this._viewers.slice()}get screenCount(){return this._screenCount}get layout(){return this._layout}getViewer(e){return this._viewers[e]}get activeScreen(){return this._activeScreenIndex}setActiveScreen(e){let t=Number(e);return!Number.isInteger(t)||t<0||t>this._viewers.length-1?this:(this._activeScreenIndex=t,this)}setScreenCount(e,t={}){let r=yi(e);return Object.prototype.hasOwnProperty.call(t,"newScreenBaseLayerFrom")&&(this._newScreenBaseLayerFrom=this._normalizeBaseLayerStrategy(t.newScreenBaseLayerFrom)),r===this._screenCount?this:t.preserveExisting!==!1?(this._ensureScreenCount(r,this._newScreenBaseLayerFrom),this):(this._screenCount=r,this._rebuildViewers(),this)}setLayout(e){let t=vi(e);return t===this._layout?this:(this._layout=t,this._applyLayout(),this.resize(),this)}setSyncOptions(e={}){return Object.prototype.hasOwnProperty.call(e,"camera")&&(this._syncCamera=!!e.camera),Object.prototype.hasOwnProperty.call(e,"time")&&(this._syncTime=!!e.time),this}resize(){return this._viewers.forEach(e=>(e==null?void 0:e.resize)&&e.resize()),this}destroy(){var e;return this._destroyViewers(),(e=this._wrapper)!=null&&e.parentNode&&this._wrapper.parentNode.removeChild(this._wrapper),this._wrapper=void 0,this._container=void 0,this}_rebuildViewers(){this._destroyViewers(),this._buildViewers(),this._applyLayout(),this._bindSync(),this._scheduleResize()}_ensureScreenCount(e,t=Qe.NONE){let r=this._viewers.length;if(e>r)for(let s=r;s<e;s++)this._createViewerUnit(s),this._applyBaseLayerStrategyForNewViewer(s,r,t);else for(let s=r-1;s>=e;s--)this._destroyViewerUnit(s);this._screenCount=e,this._activeScreenIndex>this._screenCount-1&&(this._activeScreenIndex=Math.max(0,this._screenCount-1)),this._applyLayout(),this._bindSync(),this._scheduleResize()}_buildViewers(){M.empty(this._wrapper),this._viewerBoxes=[],this._viewers=[];for(let e=0;e<this._screenCount;e++)this._createViewerUnit(e)}_createViewerUnit(e){let t=M.create("div","gm-multi-screen-box",this._wrapper);t.addEventListener("click",()=>{let o=this._viewerBoxes.indexOf(t);o>=0&&(this._activeScreenIndex=o)});let r=M.create("div","gm-multi-screen-viewer",t);r.id=v.uuid(`GM-MSC-${e}`);let s=new Fr(r.id,this._resolveViewerOptions(e));this._patchViewerBaseLayerTracking(s),this._viewerBoxes.push(t),this._viewers.push(s)}_destroyViewerUnit(e){let t=this._viewers[e],r=this._viewerBoxes[e];this._unbindViewerSync(t),r!=null&&r.parentNode&&r.parentNode.removeChild(r);try{t!=null&&t.destroy&&t.destroy()}catch{}this._viewerBaseLayerMeta.delete(t),this._viewers.splice(e,1),this._viewerBoxes.splice(e,1)}_normalizeBaseLayerStrategy(e){return $f.includes(e)?e:Qe.NONE}_patchViewerBaseLayerTracking(e){var o,n;if(!e||this._viewerBaseLayerMeta.has(e))return;let t={entries:[],selectedIndex:-1};this._viewerBaseLayerMeta.set(e,t);let r=(o=e.addBaseLayer)==null?void 0:o.bind(e);r&&(e.addBaseLayer=(l,h={})=>{let c=h?{...h}:{};return t.entries.push({baseLayer:l,options:c}),t.selectedIndex<0&&(t.selectedIndex=0),r(l,h)});let s=(n=e.changeBaseLayer)==null?void 0:n.bind(e);s&&(e.changeBaseLayer=l=>(t.selectedIndex=Number(l),s(l)))}_applyBaseLayerStrategyForNewViewer(e,t,r){let s=this._viewers[e];if(!s||t<=0||r===Qe.NONE)return;let o=0;r===Qe.SAME_INDEX_MOD?o=e%t:r===Qe.ACTIVE&&(o=Math.min(Math.max(0,this._activeScreenIndex),t-1));let n=this._viewers[o],l=this._viewerBaseLayerMeta.get(n);if(!l||!l.entries.length)return;l.entries.forEach(c=>{s.addBaseLayer(c.baseLayer,c.options)});let h=l.selectedIndex;Number.isInteger(h)&&h>=0&&h<l.entries.length&&s.changeBaseLayer(h)}_resolveViewerOptions(e){let t=this._viewerOptions;return typeof t=="function"?t(e)||{}:Array.isArray(t)?t[e]||t[0]||{}:t||{}}_applyLayout(){if(!this._wrapper)return;let e=Am(this._layout,this._screenCount);this._wrapper.style.gridAutoFlow="row",this._wrapper.style.gridTemplateColumns=e.columns,this._wrapper.style.gridTemplateRows=e.rows,this._wrapper.style.gridTemplateAreas=Array.isArray(e.areas)?e.areas.map(t=>`"${t}"`).join(" "):"none",this._viewerBoxes.forEach((t,r)=>{if(t.style.gridArea="",t.style.gridColumn="",t.style.gridRow="",t.style.display="",this._layout===ge.VERTICAL){t.style.gridColumn="1 / span 1",t.style.gridRow=`${r+1} / span 1`;return}if(this._layout===ge.GRID&&Array.isArray(e.areas)){t.style.gridArea=`screen-${r}`;return}t.style.gridColumn=`${r+1} / span 1`,t.style.gridRow="1 / span 1"})}_bindSync(){this._unbindSync(),this._viewers.forEach((e,t)=>{let r=()=>{this._cameraSyncing||(this._activeScreenIndex=t,this._syncCameraFrom(t))},s=()=>{this._syncTimeFrom(t)};e.on(D.CAMERA_CHANGED,r,this),e.on(D.CLOCK_TICK,s,this),this._listenerCache.push({viewer:e,cameraHandler:r,clockHandler:s})})}_unbindViewerSync(e){if(e)for(let t=this._listenerCache.length-1;t>=0;t--){let r=this._listenerCache[t];r.viewer===e&&(e.off(D.CAMERA_CHANGED,r.cameraHandler,this),e.off(D.CLOCK_TICK,r.clockHandler,this),this._listenerCache.splice(t,1))}}_unbindSync(){this._listenerCache.forEach(e=>{let{viewer:t,cameraHandler:r,clockHandler:s}=e;t==null||t.off(D.CAMERA_CHANGED,r,this),t==null||t.off(D.CLOCK_TICK,s,this)}),this._listenerCache=[]}_destroyViewers(){this._unbindSync(),this._viewers.forEach(e=>{try{e!=null&&e.destroy&&e.destroy()}catch{}}),this._viewers=[],this._viewerBoxes=[],this._viewerBaseLayerMeta.clear(),this._cameraSyncing=!1,this._timeSyncing=!1,this._activeScreenIndex=0,this._wrapper&&M.empty(this._wrapper)}_scheduleResize(){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>{this.resize()});return}this.resize()}_syncCameraFrom(e){if(!this._syncCamera||this._cameraSyncing)return;let t=this._viewers[e],r=t==null?void 0:t.camera;if(!r)return;let s=r.positionWC||r.position;if(!s)return;let o=i.Cartesian3.clone(s),n={heading:r.heading,pitch:r.pitch,roll:r.roll};this._cameraSyncing=!0,this._viewers.forEach((l,h)=>{if(!(h===e||!(l!=null&&l.camera)))try{l.camera.setView({destination:i.Cartesian3.clone(o),orientation:n})}catch{}}),Promise.resolve().then(()=>{this._cameraSyncing=!1})}_syncTimeFrom(e){var s;if(!this._syncTime||this._timeSyncing)return;let t=this._viewers[e],r=(s=t==null?void 0:t.clock)==null?void 0:s.currentTime;r&&(this._timeSyncing=!0,this._viewers.forEach((o,n)=>{if(!(n===e||!(o!=null&&o.clock)))try{if(this._isSameTime(o.clock.currentTime,r))return;o.clock.currentTime=this._cloneTime(r)}catch{}}),Promise.resolve().then(()=>{this._timeSyncing=!1}))}_cloneTime(e){var t;return(t=i.JulianDate)!=null&&t.clone?i.JulianDate.clone(e):e!=null&&e.clone?e.clone():e}_isSameTime(e,t){var r;return!e||!t?!1:(r=i.JulianDate)!=null&&r.equals?i.JulianDate.equals(e,t):e===t}},Mm=On;var l9=i.Cartesian2,h9=i.Cartesian3,c9=i.Matrix3,d9=i.Matrix4,p9=i.Material,m9=i.SceneMode,u9=i.SkyBox,_9=i.Color,f9=i.Rectangle,g9=i.ShadowMode,y9=i.JulianDate,v9=i.HeightReference,w9=i.HorizontalOrigin,C9=i.VerticalOrigin,x9=i.CallbackProperty,T9=i.ClassificationType,E9=i.Cesium3DTileStyle,P9=i.GeographicTilingScheme,b9=i.WebMercatorTilingScheme,S9=i.ColorMaterialProperty,A9=i.ImageMaterialProperty,M9=i.PolylineDashMaterialProperty,I9=i.PolylineGlowMaterialProperty,L9=i.PolylineOutlineMaterialProperty,D9=i.PolylineArrowMaterialProperty,R9=i.writeTextToCanvas,O9=i.CustomShaderMode,k9=i.CustomShaderTranslucencyMode,N9=i.CustomShader,F9=i.UniformType,H9=i.Ellipsoid,z9=i.Resource,W9=i.createGooglePhotorealistic3DTileset,G9=i.createElevationBandMaterial,U9=i.ModelAnimationLoop,B9=i.ClippingPlane,V9=i.ClippingPlaneCollection,j9=i.ClippingPolygon,Y9=i.ClippingPolygonCollection,q9=i.Camera,Z9=i.Cartographic,X9=i.CircleGeometry,J9=i.ColorGeometryInstanceAttribute,$9=i.FrustumOutlineGeometry,K9=i.GeometryInstance,Q9=i.PerInstanceColorAppearance,eW=i.Primitive,tW=i.Quaternion,iW=i.Ray,rW=i.ShadowMap,sW=i.Transforms,oW=i.createGuid,aW=i.GroundPrimitive,nW=i.HeadingPitchRange,lW=i.LabelCollection,hW=i.PolylineColorAppearance,cW=i.PolygonGeometry,dW=i.PolygonOutlineGeometry,pW=i.PolygonHierarchy,mW=i.PolylineGeometry,uW=i.RectangleOutlineGeometry,_W=i.DistanceDisplayCondition,fW=i.DistanceDisplayConditionGeometryInstanceAttribute,gW=i.LabelStyle,yW=i.Math,vW=i.ArcType,wW=i.EllipsoidSurfaceAppearance;globalThis.__cmdOut=()=>{console.clear(),console.log(`%c
1845
2784
  GM-SDK %c %c
1846
2785
 
1847
- \u7248\u672C: 2.0.2 - 2025-08-18
1848
- \u7F51\u7AD9\u4E3B\u9875: http://127.0.0.1:8081/greatmap/gm-docs/zh/index.html`,"font-size:20px;padding-left:70px;color:#EEB422","font-size:14px;padding-left:50px;color:#EEB422;font-style:oblique","font-size:12px;color:#0865ba")};var tg="./libs/gm-sdk/resources/",eg=tg;bt("baseUrl",tg);var $Y={set baseUrl(a){eg=a,bt("baseUrl",a)},get baseUrl(){return eg}},eX="2.0.2";export{Yf as Analysis,xt as AnalysisType,Z as AnimationType,Q_ as AroundPoint,K_ as AroundView,Ue as AttackArrow,Me as Billboard,Wt as BillboardPrimitive,xh as BounceBillboardPrimitive,Eh as BounceLabelPrimitive,Wm as Box,bY as CallbackProperty,dY as Cartesian2,mY as Cartesian3,ZT as ChartLayer,ei as Circle,i_ as CircleBlurMaterialProperty,r_ as CircleDiffuseMaterialProperty,s_ as CircleFadeMaterialProperty,o_ as CirclePulseMaterialProperty,ef as CircleScan,a_ as CircleScanMaterialProperty,n_ as CircleSpiralMaterialProperty,l_ as CircleVaryMaterialProperty,h_ as CircleWaveMaterialProperty,AY as ClassificationType,ZY as ClippingPlane,YY as ClippingPlaneCollection,XY as ClippingPolygon,JY as ClippingPolygonCollection,Ph as CloudPrimitive,nh as ClusterLayer,vY as Color,DY as ColorMaterialProperty,me as CoordTransform,Gm as Corridor,ph as CustomBillboard,rh as CustomGeographicTilingScheme,dh as CustomLabel,sh as CustomMercatorTilingScheme,WY as CustomShader,NY as CustomShaderMode,HY as CustomShaderTranslucencyMode,Um as Cylinder,lh as CzmlLayer,bh as DiffuseWallPrimitive,fh as DivIcon,I as DomUtil,Ft as DoubleArrow,mh as DynamicBillboard,hh as DynamicLayer,uh as DynamicModel,tP as Effect,Ah as ElecEllipsoidPrimitive,Bm as Ellipse,UY as Ellipsoid,c_ as EllipsoidElectricMaterialProperty,p_ as EllipsoidTrailMaterialProperty,ch as FeatureGridLayer,zt as FineArrow,Mh as FlowLinePrimitive,tf as Flying,Nt as GatheringPlace,si as GeoJsonLayer,Hf as GeoTools,IY as GeographicTilingScheme,rf as GlobeRotate,Jm as GpxLayer,Km as GraticuleLayer,Qm as GroundPrimitiveLayer,Gl as GroundSkyBox,UT as HeatMapLayer,TY as HeightReference,EY as HorizontalOrigin,$m as HtmlLayer,gh as I3S,eu as I3SLayer,LY as ImageMaterialProperty,ih as ImageryLayerFactory,k as ImageryType,xY as JulianDate,Ef as KeyboardRoaming,tu as KmlLayer,ti as Label,iu as LabelLayer,Gt as LabelPrimitive,A as Layer,ah as LayerGroup,lt as LayerType,Sh as LightCylinderPrimitive,fY as Material,_h as Math,uY as Matrix3,_Y as Matrix4,Nf as Measure,ne as MeasureType,Ge as Model,qY as ModelAnimationLoop,Oe as ModelEventType,Dh as ModelPrimitive,O as MouseEventType,Pe as MouseMode,v as Overlay,N as OverlayType,y as P,y as Parse,jm as Plane,XE as Plot,$f as PlotAnalysis,Hi as PlotAnalysisType,ii as Point,Rh as PointPrimitive,Ie as Polygon,Se as Polyline,FY as PolylineArrowMaterialProperty,RY as PolylineDashMaterialProperty,d_ as PolylineFlickerMaterialProperty,m_ as PolylineFlowMaterialProperty,OY as PolylineGlowMaterialProperty,u_ as PolylineImageTrailMaterialProperty,__ as PolylineLightingMaterialProperty,f_ as PolylineLightingTrailMaterialProperty,kY as PolylineOutlineMaterialProperty,Oh as PolylinePrimitive,g_ as PolylineTrailMaterialProperty,Zm as PolylineVolume,X as Position,ru as PrimitiveLayer,y_ as RadarLineMaterialProperty,of as RadarScan,v_ as RadarSweepMaterialProperty,w_ as RadarWaveMaterialProperty,su as RasterTileLayer,ri as Rect,wY as Rectangle,BY as Resource,Pf as RoamingController,bf as RoamingPath,kh as ScanCirclePrimitive,D as SceneEventType,gY as SceneMode,CY as ShadowMode,au as Shp2JsonLayer,yY as SkyBox,Vm as Sphere,f as T,Ht as TailedAttackArrow,oh as TerrainFactory,be as TerrainType,K as TileSetEventType,yh as Tileset,ou as TilesetLayer,MY as TilesetStyle,Mf as Track,Af as TrackController,De as TrackViewMode,Fh as TrailLinePrimitive,f as Transform,GY as UniformType,C as Util,eX as VERSION,ue as VectorLayer,PY as VerticalOrigin,zh as VideoPrimitive,Nm as VideoProjectionPrimitive,Yg as Viewer,Xm as VolumRadar,Ym as Wall,C_ as WallImageTrailMaterialProperty,T_ as WallLineTrailMaterialProperty,P_ as WallTrailMaterialProperty,b_ as WaterMaterialProperty,Hm as WaterPrimitive,aP as Weather,SY as WebMercatorTilingScheme,VT as WindLayer,$Y as config,jY as createElevationBandMaterial,VY as createGooglePhotorealistic3DTileset,q as getLib,$n as registerLib,zY as writeTextToCanvas};
2786
+ \u7248\u672C: 2.0.3 - 2026-04-16
2787
+ \u7F51\u7AD9\u4E3B\u9875: http://127.0.0.1:8081/greatmap/gm-docs/zh/index.html
2788
+ Cesium \u7248\u672C\uFF1A${Cesium.VERSION}`,"font-size:20px;padding-left:70px;color:#EEB422","font-size:14px;padding-left:50px;color:#EEB422;font-style:oblique","font-size:12px;color:#0865ba")};var Lm="./libs/gm-sdk/resources/",Im=Lm;dt("baseUrl",Lm);var TW={set baseUrl(a){Im=a,dt("baseUrl",a)},get baseUrl(){return Im}},EW="2.0.3";export{Cm as Analysis,ae as AnalysisType,q as AnimationType,vW as ArcType,Ud as AroundPoint,Gd as AroundView,je as AttackArrow,Me as Billboard,Pt as BillboardPrimitive,nh as BounceBillboardPrimitive,hh as BounceLabelPrimitive,Ah as Box,xh as BoxOutlinePrimitive,Ch as BoxPrimitive,x9 as CallbackProperty,q9 as Camera,l9 as Cartesian2,h9 as Cartesian3,Z9 as Cartographic,i as Cesium,Ou as ChartLayer,At as Circle,Yc as CircleBlurMaterialProperty,qc as CircleDiffuseMaterialProperty,Zc as CircleFadeMaterialProperty,X9 as CircleGeometry,Xc as CirclePulseMaterialProperty,Vd as CircleScan,Jc as CircleScanMaterialProperty,$c as CircleSpiralMaterialProperty,Kc as CircleVaryMaterialProperty,Qc as CircleWaveMaterialProperty,T9 as ClassificationType,B9 as ClippingPlane,V9 as ClippingPlaneCollection,j9 as ClippingPolygon,Y9 as ClippingPolygonCollection,ch as CloudPrimitive,Yl as ClusterLayer,_9 as Color,J9 as ColorGeometryInstanceAttribute,S9 as ColorMaterialProperty,ue as CoordTransform,Mh as Corridor,Jl as CustomBillboard,Ul as CustomGeographicTilingScheme,$l as CustomLabel,Bl as CustomMercatorTilingScheme,N9 as CustomShader,O9 as CustomShaderMode,k9 as CustomShaderTranslucencyMode,Ih as Cylinder,ql as CzmlLayer,dh as DiffuseWallPrimitive,_W as DistanceDisplayCondition,fW as DistanceDisplayConditionGeometryInstanceAttribute,th as DivIcon,M as DomUtil,Ct as DoubleArrow,Kl as DynamicBillboard,Zl as DynamicLayer,Ql as DynamicModel,Z_ as Effect,ph as ElecEllipsoidPrimitive,Lh as Ellipse,H9 as Ellipsoid,ed as EllipsoidElectricMaterialProperty,wW as EllipsoidSurfaceAppearance,td as EllipsoidTrailMaterialProperty,Xl as FeatureGridLayer,xt as FineArrow,mh as FlowLinePrimitive,jd as Flying,$9 as FrustumOutlineGeometry,Tt as GatheringPlace,Dt as GeoJsonLayer,kp as GeoTools,P9 as GeographicTilingScheme,K9 as GeometryInstance,Yd as GlobeRotate,Hh as GpxLayer,zh as GraticuleLayer,aW as GroundPrimitive,Wh as GroundPrimitiveLayer,bl as GroundSkyBox,nW as HeadingPitchRange,Mu as HeatMapLayer,v9 as HeightReference,w9 as HorizontalOrigin,Gh as HtmlLayer,ih as I3S,Uh as I3SLayer,A9 as ImageMaterialProperty,Gl as ImageryLayerFactory,W as ImageryType,y9 as JulianDate,wp as KeyboardRoaming,Bh as KmlLayer,Mt as Label,lW as LabelCollection,Vh as LabelLayer,bt as LabelPrimitive,gW as LabelStyle,A as Layer,jl as LayerGroup,ot as LayerType,_h as LightCylinderPrimitive,p9 as Material,eh as Math,c9 as Matrix3,d9 as Matrix4,Op as Measure,ce as MeasureType,Ve as Model,U9 as ModelAnimationLoop,Ne as ModelEventType,fh as ModelPrimitive,H as MouseEventType,Se as MouseMode,Mm as MultiScreenCompare,ge as MultiScreenLayoutType,w as Overlay,U as OverlayType,y as P,y as Parse,Q9 as PerInstanceColorAppearance,Rh as Plane,H_ as Plot,bm as PlotAnalysis,mi as PlotAnalysisType,It as Point,yh as PointPrimitive,Ie as Polygon,cW as PolygonGeometry,pW as PolygonHierarchy,dW as PolygonOutlineGeometry,wh as PolygonPrimitive,Le as Polyline,D9 as PolylineArrowMaterialProperty,hW as PolylineColorAppearance,M9 as PolylineDashMaterialProperty,id as PolylineFlickerMaterialProperty,rd as PolylineFlowMaterialProperty,mW as PolylineGeometry,I9 as PolylineGlowMaterialProperty,sd as PolylineImageTrailMaterialProperty,od as PolylineLightingMaterialProperty,ad as PolylineLightingTrailMaterialProperty,L9 as PolylineOutlineMaterialProperty,vh as PolylinePrimitive,nd as PolylineTrailMaterialProperty,kh as PolylineVolume,Z as Position,eW as Primitive,jh as PrimitiveLayer,tW as Quaternion,ld as RadarLineMaterialProperty,Zd as RadarScan,hd as RadarSweepMaterialProperty,cd as RadarWaveMaterialProperty,Yh as RasterTileLayer,iW as Ray,Lt as Rect,f9 as Rectangle,uW as RectangleOutlineGeometry,z9 as Resource,Cp as RoamingController,xp as RoamingPath,Th as ScanCirclePrimitive,D as SceneEventType,m9 as SceneMode,rW as ShadowMap,g9 as ShadowMode,Zh as Shp2JsonLayer,u9 as SkyBox,Dh as Sphere,g as T,Et as TailedAttackArrow,Vl as TerrainFactory,Ae as TerrainType,J as TileSetEventType,rh as Tileset,qh as TilesetLayer,E9 as TilesetStyle,Ep as Track,Tp as TrackController,De as TrackViewMode,Eh as TrailLinePrimitive,g as Transform,sW as Transforms,F9 as UniformType,v as Util,EW as VERSION,_e as VectorLayer,C9 as VerticalOrigin,Ph as VideoPrimitive,bh as VideoProjectionPrimitive,Fr as Viewer,Fh as VolumRadar,Nh as Wall,dd as WallImageTrailMaterialProperty,md as WallLineTrailMaterialProperty,_d as WallTrailMaterialProperty,fd as WaterMaterialProperty,St as WaterPrimitive,tf as Weather,b9 as WebMercatorTilingScheme,Lu as WindLayer,TW as config,G9 as createElevationBandMaterial,W9 as createGooglePhotorealistic3DTileset,oW as createGuid,Y as getLib,Wn as registerLib,R9 as writeTextToCanvas};