earthsdk3-cesium 3.0.8-beta.8 → 3.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -2
- package/dist/earthsdk3-cesium.iife.js +4 -4
- package/dist/earthsdk3-cesium.js +7 -6
- package/dist/earthsdk3-cesium.umd.cjs +4 -4
- package/dist/types/CzmObjects/base/InnerClass/XbsjGroundPolylinePrimitive/GroundPolylinePrimitive.d.ts +148 -0
- package/dist/types/CzmObjects/general/CzmES3DTileset/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESSignalTransmission/XbsjPolyline/XbsjPolylineGeometry.d.ts +3 -0
- package/dist/types/CzmObjects/general/CzmESSignalTransmission/XbsjPolyline/xbsjCreateODLinesPrimitive.d.ts +29 -0
- package/dist/types/CzmObjects/general/CzmESVideoFusion/XbsjCameraVideo/XbsjCameraVideo.d.ts +18 -0
- package/dist/types/CzmObjects/general/CzmESViewShed/XbsjViewshed/XbsjViewshed.d.ts +16 -0
- package/dist/types/ESCesiumViewer/BackGroundImage/BackGroundImage.d.ts +5 -0
- package/dist/types/ESCesiumViewer/LocalSkyBox/SkyAtmosphere.d.ts +14 -0
- package/dist/types/ESCesiumViewer/ViewerExtensions/TerrainManager.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatPipelineStage.d.ts +12 -0
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatTexturePipelineStage.d.ts +11 -0
- package/dist/types/ESCesiumViewer/initCesiumViewer/fixGoogleEarth/cesiumFixGoogleEarth.d.ts +1 -0
- package/dist/types/__declares/cesium.d.ts +405 -0
- package/dist/types/utils/czmUtils/todo/generateCartesianArc/czm/generateCartesianArc.d.ts +8 -0
- package/dist/types/utils/generalUtils/geoPolylineToBezierSpline/bezierSpline/index.d.ts +37 -0
- package/dist/types/utils/generalUtils/geoPolylineToBezierSpline/bezierSpline/lib/spline.d.ts +62 -0
- package/package.json +3 -4
|
@@ -735,7 +735,7 @@ void gaussianSplatStage(ProcessedAttributes attributes, inout vec4 positionClip)
|
|
|
735
735
|
`,Rl={GAUSSIAN_SPLATS:11},D1={name:"GaussianSplatPipelineStage"};D1.process=function(t,n,e){const{shaderBuilder:i}=t,o=t.renderStateOptions;o.cull.enabled=!1,o.depthMask=!1,o.depthTest.enabled=!1,o.blending=Me.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,t.alphaOptions.pass=Rl.GAUSSIAN_SPLATS,i.addDefine("HAS_GAUSSIAN_SPLATS",void 0,Me.ShaderDestination.BOTH),n.hasAttributeTexture&&i.addDefine("HAS_SPLAT_TEXTURE",void 0,Me.ShaderDestination.BOTH),i.addAttribute("vec2","a_screenQuadPosition"),i.addAttribute("vec3","a_splatPosition"),i.addAttribute("vec4","a_splatColor"),i.addVarying("vec4","v_splatColor"),i.addVarying("vec2","v_vertPos"),i.addVarying("float","v_splatOpacity"),i.addVarying("vec4","v_splatScale"),i.addVarying("vec4","v_splatRot"),i.addUniform("float","u_tan_fovX",Me.ShaderDestination.VERTEX),i.addUniform("float","u_tan_fovY",Me.ShaderDestination.VERTEX),i.addUniform("float","u_focalX",Me.ShaderDestination.VERTEX),i.addUniform("float","u_focalY",Me.ShaderDestination.VERTEX),i.addUniform("float","u_splatScale",Me.ShaderDestination.VERTEX),i.addUniform("mat4","u_scalingMatrix",Me.ShaderDestination.VERTEX);const r=t.uniformMap,a=e.camera,s=e.context.drawingBufferWidth,l=e.context.drawingBufferHeight,u=Math.tan(a.frustum.fov*.5),h=Math.tan(a.frustum.fovy*.5),c=s/(u*2),f=l/(h*2);r.u_tan_fovX=function(){return u},r.u_tan_fovY=function(){return h},r.u_focalX=function(){return c},r.u_focalY=function(){return f},r.u_splatScale=function(){var d,p;return((p=(d=t.model)==null?void 0:d.style)==null?void 0:p.splatScale)??1},r.u_scalingMatrix=function(){return t.model.sceneGraph.components.nodes[0].matrix},(()=>{const d=new Me.Matrix4,p=t.model.modelMatrix;Me.Matrix4.multiply(a.viewMatrix,p,d);const v=Me.ModelUtility.getAttributeBySemantic(n,Ie.POSITION),y=Me.ModelUtility.getAttributeBySemantic(n,Ie.SCALE),g=Me.ModelUtility.getAttributeBySemantic(n,Ie.ROTATION),b=Me.ModelUtility.getAttributeBySemantic(n,Ie.COLOR),w=v.typedArray,E=y.typedArray,T=g.typedArray,P=b.typedArray,I=new w.constructor(w.length),B=new E.constructor(E.length),M=new T.constructor(T.length),S=new P.constructor(P.length),k=U=>w[U*3]*d[2]+w[U*3+1]*d[6]+w[U*3+2]*d[10],_=new Int32Array(t.count);let x=1/0;for(let U=0;U<t.count;U++){const z=k(U)*4096|0;_[U]=z,x=Math.min(x,z)}const O=-x;for(let U=0;U<t.count;U++)_[U]+=O;const F=new Uint32Array(t.count);for(let U=0;U<t.count;U++)F[U]=U;const D=new Int32Array(t.count),R=new Uint32Array(t.count);for(let U=0;U<32;U+=8){const z=new Uint32Array(256);for(let V=0;V<t.count;V++){const W=_[V]>>U&255;z[W]++}let Q=0;for(let V=0;V<256;V++){const W=z[V];z[V]=Q,Q+=W}for(let V=0;V<t.count;V++){const W=_[V]>>U&255,J=z[W]++;D[J]=_[V],R[J]=F[V]}_.set(D),F.set(R)}for(let U=0;U<t.count;U++){const z=F[U];I[U*3]=w[z*3],I[U*3+1]=w[z*3+1],I[U*3+2]=w[z*3+2],B[U*3]=E[z*3],B[U*3+1]=E[z*3+1],B[U*3+2]=E[z*3+2],M[U*4]=T[z*4],M[U*4+1]=T[z*4+1],M[U*4+2]=T[z*4+2],M[U*4+3]=T[z*4+3],S[U*4]=P[z*4],S[U*4+1]=P[z*4+1],S[U*4+2]=P[z*4+2],S[U*4+3]=P[z*4+3]}v.typedArray=I,y.typedArray=B,g.typedArray=M,b.typedArray=S})(),t.instanceCount=t.count,t.count=4,t.primitiveType=Me.PrimitiveType.TRIANGLE_STRIP,i.addVertexLines(M1),i.addFragmentLines(B1)};const R1={name:"GaussianSplatTexturePipelineStage"};R1.process=function(t,n,e){const{shaderBuilder:i}=t,o=t.renderStateOptions;o.cull.enabled=!1,o.depthMask=!1,o.depthTest.enabled=!1,o.blending=Me.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,t.alphaOptions.pass=Rl.GAUSSIAN_SPLATS,i.addDefine("HAS_GAUSSIAN_SPLATS",void 0,Me.ShaderDestination.BOTH),i.addDefine("HAS_SPLAT_TEXTURE",void 0,Me.ShaderDestination.BOTH),t.model.content.tileset.debugShowBoundingVolume&&i.addDefine("DEBUG_BOUNDING_VOLUMES",void 0,Me.ShaderDestination.BOTH),i.addAttribute("float","a_splatIndex"),i.addVarying("vec4","v_splatColor"),i.addVarying("vec2","v_vertPos"),i.addUniform("highp usampler2D","u_splatAttributeTexture",Me.ShaderDestination.VERTEX),i.addUniform("float","u_splatScale",Me.ShaderDestination.VERTEX);const r=t.uniformMap;r.u_splatScale=function(){var a,s;return((s=(a=t.model)==null?void 0:a.style)==null?void 0:s.splatScale)??1},r.u_splatAttributeTexture=function(){return n.gaussianSplatTexture},t.instanceCount=t.count,t.count=4,t.primitiveType=Me.PrimitiveType.TRIANGLE_STRIP,i.addVertexLines(M1),i.addFragmentLines(B1)};function lB(){C.ModelRuntimePrimitive.prototype.configurePipeline=function(t){var M;const n=this.pipelineStages;n.length=0;const e=this.primitive,i=this.node,o=this.model,r=o.customShader,a=o.style,s=t.context.webgl2,u=t.mode!==C.SceneMode.SCENE3D&&!t.scene3DOnly&&o._projectTo2D,h=t.verticalExaggeration!==1&&o.hasVerticalExaggeration,c=C.defined(e.morphTargets)&&e.morphTargets.length>0,f=C.defined(i.skin),A=C.defined(r),p=!(A&&C.defined(r.fragmentShaderText))||r.mode!==C.CustomShaderMode.REPLACE_MATERIAL,v=C.ModelUtility.hasQuantizedAttributes(e.attributes),y=o.debugWireframe&&C.PrimitiveType.isTriangles(e.primitiveType)&&(o._enableDebugWireframe||s),g=o.pointCloudShading,b=C.defined(g)&&g.attenuation,w=C.defined(g)&&g.backFaceCulling,E=e.primitiveType===C.PrimitiveType.POINTS&&(C.defined(a)||b||w),T=o._enableShowOutline&&C.defined(e.outlineCoordinates),P=uB(o,i,e),I=C.defined(o.classificationType),B=(((M=o==null?void 0:o.style)==null?void 0:M.showGaussianSplatting)??o.showGaussianSplatting)&&((e==null?void 0:e.isGaussianSplatPrimitive)??!1);u&&n.push(C.SceneMode2DPipelineStage),n.push(C.GeometryPipelineStage),y&&n.push(C.WireframePipelineStage),I&&n.push(C.ClassificationPipelineStage),c&&n.push(C.MorphTargetsPipelineStage),f&&n.push(C.SkinningPipelineStage),E&&n.push(C.PointCloudStylingPipelineStage),v&&n.push(C.DequantizationPipelineStage),p&&n.push(C.MaterialPipelineStage),n.push(C.FeatureIdPipelineStage),n.push(C.MetadataPipelineStage),n.push(C.MetadataPickingPipelineStage),P.hasPropertyTable&&(n.push(C.SelectedFeatureIdPipelineStage),n.push(C.BatchTexturePipelineStage),n.push(C.CPUStylingPipelineStage)),h&&n.push(C.VerticalExaggerationPipelineStage),A&&n.push(C.CustomShaderPipelineStage),n.push(C.LightingPipelineStage),o.allowPicking&&n.push(C.PickingPipelineStage),T&&n.push(C.PrimitiveOutlinePipelineStage),n.push(C.AlphaPipelineStage),n.push(C.PrimitiveStatisticsPipelineStage),B&&(C.defined(e.needsGaussianSplatTexture)?e.needsGaussianSplatTexture===!1&&((e==null?void 0:e.hasGaussianSplatTexture)??!1)&&n.push(R1):n.push(D1))}}function uB(t,n,e){let i;return C.defined(n.instances)&&(i=C.ModelUtility.getFeatureIdsByLabel(n.instances.featureIds,t.instanceFeatureIdLabel),C.defined(i))?{hasFeatureIds:!0,hasPropertyTable:C.defined(i.propertyTableId)}:(i=C.ModelUtility.getFeatureIdsByLabel(e.featureIds,t.featureIdLabel),C.defined(i)?{hasFeatureIds:!0,hasPropertyTable:C.defined(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}const{defined:O1,AttributeType:U1}=C;function cB(){const t=C.ModelUtility.supportedExtensions;C.ModelUtility.supportedExtensions={...t,KHR_gaussian_splatting:!0},C.ModelUtility.getAttributeInfo=function(n){const e=n.semantic,i=n.setIndex;let o,r=!1;O1(e)?(o=Ie.getVariableName(e,i),r=!0):(o=n.name,o=o.replace(/^_/,""),o=o.toLowerCase());const a=/^color_\d+$/.test(o),s=n.type;let l=U1.getGlslType(s);a&&(l="vec4");const u=O1(n.quantization);let h;return u&&(h=a?"vec4":U1.getGlslType(n.quantization.type)),{attribute:n,isQuantized:u,variableName:o,hasSemantic:r,glslType:l,quantizedGlslType:h}}}const{PrimitiveLoadPlan:L1,PrimitiveOutlineGenerator:hB,IndexDatatype:fB,ModelComponents:AB,ComponentDatatype:Ja,AttributeType:z1,AttributeLoadPlan:dB,defined:pB,BufferUsage:Q1,Cartesian3:xp,AttributeCompression:mB}=C;function gB(){Object.defineProperties(L1,{needGaussianSplats:{value:!1},generateGaussianSplatTexture:{value:!1}}),L1.prototype.postProcess=function(e){this.needsOutlines&&(yB(this),wB(this,e)),this.needsGaussianSplats&&(this.primitive.isGaussianSplatPrimitive=!0,n(this),this.generateGaussianSplatTexture&&this.attributePlans.forEach(i=>{t(i),this.primitive.needsGaussianSplatTexture=!0}))};function t(e){if(e.name==="_ROTATION"&&e.componentDatatype===Ja.SHORT&&(e.typedArray=mB.dequantize(e.typedArray,Ja.SHORT,z1.VEC4,e.count),e.componentDatatype=Ja.FLOAT),e.name==="POSITION"&&e.componentDatatype===Ja.UNSIGNED_SHORT){const i=Float32Array.from(e.typedArray,r=>r/e.max.x);e.typedArray=i,e.componentDatatype=Ja.FLOAT,e.normalized=!1,e.constant=new xp(0,0,0);const o=r=>{let a=1/0,s=-1/0,l=1/0,u=-1/0,h=1/0,c=-1/0;for(let f=0;f<r.length;f+=3){const A=r[f],d=r[f+1],p=r[f+2];a=Math.min(a,A),s=Math.max(s,A),l=Math.min(l,d),u=Math.max(u,d),h=Math.min(h,p),c=Math.max(c,p)}return[new xp(a,l,h),new xp(s,u,c)]};[e.min,e.max]=o(e.typedArray)}}function n(e,i){const o=e.attributePlans,r=o.length;for(let a=0;a<r;a++){const s=o[a];s.loadBuffer=!1,s.loadTypedArray=!0;const l=s.attribute;t(l)}}}function yB(t){const n=t.primitive,e=n.indices,i=n.attributes[0].count,o=new hB({triangleIndices:e.typedArray,outlineIndices:t.outlineIndices,originalVertexCount:i});e.typedArray=o.updatedTriangleIndices,e.indexDatatype=fB.fromTypedArray(e.typedArray);const r=vB(o.outlineCoordinates),a=new dB(r);a.loadBuffer=!0,a.loadTypedArray=!1,t.attributePlans.push(a),n.outlineCoordinates=a.attribute;const s=t.attributePlans,l=t.attributePlans.length;for(let u=0;u<l;u++){const h=s[u].attribute;h.typedArray=o.updateAttribute(h.typedArray)}}function vB(t){const n=new AB.Attribute;return n.name="_OUTLINE_COORDINATES",n.typedArray=t,n.componentDatatype=Ja.FLOAT,n.type=z1.VEC3,n.normalized=!1,n.count=t.length/3,n}function wB(t,n){_B(t.attributePlans,n),pB(t.indicesPlan)&&bB(t.indicesPlan,n)}function _B(t,n){const e=t.length;for(let i=0;i<e;i++){const o=t[i],r=o.attribute,a=r.typedArray;if(o.loadBuffer){const s=Buffer.createVertexBuffer({typedArray:a,context:n,usage:Q1.STATIC_DRAW});s.vertexArrayDestroyable=!1,r.buffer=s}o.loadTypedArray||(r.typedArray=void 0)}}function bB(t,n){const e=t.indices;if(t.loadBuffer){const i=Buffer.createIndexBuffer({typedArray:e.typedArray,context:n,usage:Q1.STATIC_DRAW,indexDatatype:e.indexDatatype});e.buffer=i,i.vertexArrayDestroyable=!1}t.loadTypedArray||(e.typedArray=void 0)}const{Scene:CB,defined:Xe,SceneMode:Ol,MapMode2D:xB,Cartesian3:en,BoundingRectangle:N1,Cartographic:SB,Math:of,Matrix4:Ii,Transforms:EB,DebugCameraPrimitive:PB,Pass:ut,ClearCommand:TB,EllipsoidGeometry:V1,Camera:H1,defaultValue:G1,PerspectiveFrustum:IB,PerspectiveOffCenterFrustum:kB,OrthographicFrustum:FB,OrthographicOffCenterFrustum:MB,mergeSort:af,PerInstanceColorAppearance:Sp,BoxGeometry:W1,Primitive:BB,GeometryInstance:DB,GeometryPipeline:RB,ColorGeometryInstanceAttribute:OB,SunPostProcess:UB,DerivedCommand:LB,Color:zB}=C,QB=new N1,NB=new en,VB=new SB(Math.PI,of.PI_OVER_TWO),HB=new en,GB=new Ii,WB=new Ii,qB=new en,KB=new en;function XB(){CB.prototype.updateAndExecuteCommands=function(r,a){hD(this,r,a),this._environmentState.useWebVR?i(this,r):this._frameState.mode!==Ol.SCENE2D||this._mapMode2D===xB.ROTATE?n(!0,this,r):t(this,r)};function t(r,a){const{frameState:s,camera:l}=r,{uniformState:u}=r.context,h=a.viewport,c=N1.clone(h,QB);a.viewport=c;const f=VB,A=HB;r.mapProjection.project(f,A);const p=en.clone(l.position,NB),v=Ii.clone(l.transform,GB),y=l.frustum.clone();l._setTransform(Ii.IDENTITY);const g=Ii.computeViewportTransformation(c,0,1,WB),b=l.frustum.projectionMatrix,w=l.positionWC.y,E=en.fromElements(of.sign(w)*A.x-w,0,-l.positionWC.x,qB),T=EB.pointToGLWindowCoordinates(b,g,E,KB);T.x=Math.floor(T.x);const P=c.x,I=c.width;if(w===0||T.x<=P||T.x>=P+I)n(!0,r,a);else if(Math.abs(P+I*.5-T.x)<1)c.width=T.x-c.x,l.position.x*=of.sign(l.position.x),l.frustum.right=0,s.cullingVolume=l.frustum.computeCullingVolume(l.positionWC,l.directionWC,l.upWC),u.update(s),n(!0,r,a),c.x=T.x,l.position.x=-l.position.x,l.frustum.right=-l.frustum.left,l.frustum.left=0,s.cullingVolume=l.frustum.computeCullingVolume(l.positionWC,l.directionWC,l.upWC),u.update(s),n(!1,r,a);else if(T.x>P+I*.5){c.width=T.x-P;const B=l.frustum.right;l.frustum.right=A.x-w,s.cullingVolume=l.frustum.computeCullingVolume(l.positionWC,l.directionWC,l.upWC),u.update(s),n(!0,r,a),c.x=T.x,c.width=P+I-T.x,l.position.x=-l.position.x,l.frustum.left=-l.frustum.right,l.frustum.right=B-l.frustum.right*2,s.cullingVolume=l.frustum.computeCullingVolume(l.positionWC,l.directionWC,l.upWC),u.update(s),n(!1,r,a)}else{c.x=T.x,c.width=P+I-T.x;const B=l.frustum.left;l.frustum.left=-A.x-w,s.cullingVolume=l.frustum.computeCullingVolume(l.positionWC,l.directionWC,l.upWC),u.update(s),n(!0,r,a),c.x=P,c.width=T.x-P,l.position.x=-l.position.x,l.frustum.right=-l.frustum.left,l.frustum.left=B-l.frustum.left*2,s.cullingVolume=l.frustum.computeCullingVolume(l.positionWC,l.directionWC,l.upWC),u.update(s),n(!1,r,a)}l._setTransform(v),en.clone(p,l.position),l.frustum=y.clone(),a.viewport=h}function n(r,a,s){const l=a._view,{renderTranslucentDepthForPick:u}=a._environmentState;r||(a.frameState.commandList.length=0),Y1(a),l.createPotentiallyVisibleSet(a),r&&(Z1(a),u||$1(a)),o(a,s)}const e=new en;function i(r,a){const s=r._view,l=s.camera,h=r._environmentState.renderTranslucentDepthForPick;Y1(r),s.createPotentiallyVisibleSet(r),Z1(r),h||$1(r);const c=a.viewport;c.x=0,c.y=0,c.width=c.width*.5;const f=H1.clone(l,r._cameraVR);f.frustum=l.frustum;const A=l.frustum.near,d=A*G1(r.focalLength,5),p=G1(r.eyeSeparation,d/30),v=en.multiplyByScalar(f.right,p*.5,e);l.frustum.aspectRatio=c.width/c.height;const y=.5*p*A/d;en.add(f.position,v,l.position),l.frustum.xOffset=y,o(r,a),c.x=c.width,en.subtract(f.position,v,l.position),l.frustum.xOffset=-y,o(r,a),H1.clone(f,l)}function o(r,a){const{camera:s,context:l,frameState:u}=r,{uniformState:h}=l;h.updateCamera(s);const c=mD(s);c.near=s.frustum.near,c.far=s.frustum.far;const f=u.passes,A=f.pick||f.pickVoxel;A||oD(r,a);const{clearGlobeDepth:d,renderTranslucentDepthForPick:p,useDepthPlane:v,useGlobeDepthFramebuffer:y,useInvertClassification:g,usePostProcessSelected:b}=r._environmentState,{globeDepth:w,globeTranslucencyFramebuffer:E,sceneFramebuffer:T,frustumCommandsList:P}=r._view,I=P.length,B=r._globeTranslucencyState,M=r._depthClearCommand,S=r._stencilClearCommand,k=r._classificationStencilClearCommand,_=r._depthPlane,x=s.position.z;function O(D,R){h.updatePass(R);const U=D.commands[R],z=D.indices[R];for(let Q=0;Q<z;++Q)di(U[Q],r,a);return z}function F(D,R){h.updatePass(R);const U=D.commands[R],z=D.indices[R];for(let Q=0;Q<z;++Q)X1(U[Q],r,a)}for(let D=0;D<I;++D){const R=I-D-1,U=P[R];r.mode===Ol.SCENE2D?(s.position.z=x-U.near+1,c.far=Math.max(1,U.far-U.near),c.near=1,h.update(u),h.updateFrustum(c)):(c.near=R!==0?U.near*r.opaqueFrustumNearOffset:U.near,c.far=U.far,h.updateFrustum(c)),M.execute(l,a),l.stencilBuffer&&S.execute(l,a),B.translucent?(h.updatePass(ut.GLOBE),B.executeGlobeCommands(U,di,E,r,a)):O(U,ut.GLOBE),y&&w.executeCopyDepth(l,a),p||(B.translucent?(h.updatePass(ut.TERRAIN_CLASSIFICATION),B.executeGlobeClassificationCommands(U,di,E,r,a)):O(U,ut.TERRAIN_CLASSIFICATION)),d&&(M.execute(l,a),v&&_.execute(l,a));let z;if(!g||A||p)z=O(U,ut.CESIUM_3D_TILE),z>0&&(y&&(w.prepareColorTextures(l,d),w.executeUpdateDepth(l,a,w.depthStencilTexture)),p||(z=O(U,ut.CESIUM_3D_TILE_CLASSIFICATION)));else{r._invertClassification.clear(l,a);const V=a.framebuffer;a.framebuffer=r._invertClassification._fbo.framebuffer,z=O(U,ut.CESIUM_3D_TILE),y&&(r._invertClassification.prepareTextures(l),w.executeUpdateDepth(l,a,r._invertClassification._fbo.getDepthStencilTexture())),z=O(U,ut.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),a.framebuffer=V,r._invertClassification.executeClassified(l,a),u.invertClassificationColor.alpha===1&&r._invertClassification.executeUnclassified(l,a),z>0&&l.stencilBuffer&&k.execute(l,a),z=O(U,ut.CESIUM_3D_TILE_CLASSIFICATION)}if(z>0&&l.stencilBuffer&&S.execute(l,a),tD(r,a,U),O(U,ut.OPAQUE),rD(r,a,U),R!==0&&r.mode!==Ol.SCENE2D&&(c.near=U.near,h.updateFrustum(c)),ZB(r,a,U),$B(r,a,U),l.depthTexture&&r.useDepthPicking&&(y||p)){const V=r._picking.getPickDepth(r,R);V.update(l,w.depthStencilTexture),V.executeCopyDepth(l,a)}if(A||!b)continue;const Q=a.framebuffer;a.framebuffer=T.getIdFramebuffer(),c.near=R!==0?U.near*r.opaqueFrustumNearOffset:U.near,c.far=U.far,h.updateFrustum(c),B.translucent?(h.updatePass(ut.GLOBE),B.executeGlobeCommands(U,X1,E,r,a)):F(U,ut.GLOBE),d&&(M.framebuffer=a.framebuffer,M.execute(l,a),M.framebuffer=void 0),d&&v&&_.execute(l,a),F(U,ut.CESIUM_3D_TILE),F(U,ut.OPAQUE),F(U,ut.TRANSLUCENT),a.framebuffer=Q}}}function $B(t,n,e){const{translucentTileClassification:i,globeDepth:o}=t._view;if(!(e.indices[ut.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;const a=e.commands[ut.TRANSLUCENT];i.executeTranslucentCommands(t,di,n,a,o.depthStencilTexture),i.executeClassificationCommands(t,di,n,e)}function ZB(t,n,e){const{frameState:i,context:o}=t,{pick:r,pickVoxel:a}=i.passes,s=r||a;let l;!s&&t._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(l=t._invertClassification);const u=YB(t);o.uniformState.updatePass(ut.TRANSLUCENT);const h=e.commands[ut.TRANSLUCENT];h.length=e.indices[ut.TRANSLUCENT],u(t,di,n,h,l)}function YB(t){if(t._environmentState.useOIT){if(!Xe(t._executeOITFunction)){const{view:n,context:e}=t;t._executeOITFunction=function(i,o,r,a,s){n.globeDepth.prepareColorTextures(e),n.oit.executeCommands(i,o,r,a,s)}}return t._executeOITFunction}return t.frameState.passes.render?JB:eD}function q1(t,n,e){return n.boundingVolume.distanceSquaredTo(e)-t.boundingVolume.distanceSquaredTo(e)}function JB(t,n,e,i,o){af(i,q1,t.camera.positionWC),Xe(o)&&n(o.unclassifiedCommand,t,e);for(let r=0;r<i.length;++r)n(i[r],t,e)}function jB(t,n,e){return t.boundingVolume.distanceSquaredTo(e)-n.boundingVolume.distanceSquaredTo(e)+of.EPSILON12}function eD(t,n,e,i,o){af(i,jB,t.camera.positionWC),Xe(o)&&n(o.unclassifiedCommand,t,e);for(let r=0;r<i.length;++r)n(i[r],t,e)}function tD(t,n,e){t.context.uniformState.updatePass(ut.VOXELS);const i=e.commands[ut.VOXELS];i.length=e.indices[ut.VOXELS],af(i,q1,t.camera.positionWC);for(let o=0;o<i.length;++o)di(i[o],t,n)}const nD=new en;function K1(t,n){const e=en.subtract(t,n,nD),i=Math.max(0,en.magnitude(e));return i*i}function iD(t,n,e){const i=t.boundingVolume,o=n.boundingVolume;return K1(o.center,e)-K1(i.center,e)}function rD(t,n,e){t.context.uniformState.updatePass(Rl.GAUSSIAN_SPLATS);const i=e.commands[Rl.GAUSSIAN_SPLATS];i.length=e.indices[Rl.GAUSSIAN_SPLATS],af(i,iD,t.camera.positionWC);for(let o=0;o<i.length;++o)di(i[o],t,n)}function X1(t,n,e){const{derivedCommands:i}=t;if(!Xe(i))return;const o=n._frameState,r=n._context;o.useLogDepth&&Xe(i.logDepth)&&(t=i.logDepth.command);const{picking:a,pickingMetadata:s,depth:l}=t.derivedCommands;Xe(s)&&(t=i.pickingMetadata.pickMetadataCommand,t.execute(r,e)),Xe(a)?(t=a.pickCommand,t.execute(r,e)):Xe(l)&&(t=l.depthOnlyCommand,t.execute(r,e))}function oD(t,n){const{context:e,environmentState:i,view:o}=t;if(e.uniformState.updatePass(ut.ENVIRONMENT),Xe(i.skyBoxCommand)&&di(i.skyBoxCommand,t,n),i.isSkyAtmosphereVisible&&di(i.skyAtmosphereCommand,t,n),i.isSunVisible&&(i.sunDrawCommand.execute(e,n),t.sunBloom&&!i.useWebVR)){let r;i.useGlobeDepthFramebuffer?r=o.globeDepth.framebuffer:i.usePostProcess?r=o.sceneFramebuffer.framebuffer:r=i.originalFramebuffer,t._sunPostProcess.execute(e),t._sunPostProcess.copy(e,r),n.framebuffer=r}i.isMoonVisible&&i.moonCommand.execute(e,n)}function aD(t,n,e){const{shadowMapCullingVolume:i,isPointLight:o,passes:r}=e,a=r.length,s=[ut.GLOBE,ut.CESIUM_3D_TILE,ut.OPAQUE,ut.TRANSLUCENT];for(let l=0;l<n.length;++l){const u=n[l];if(t.updateDerivedCommands(u),!(!u.castShadows||s.indexOf(u.pass)<0||!t.isVisible(i,u)))if(o)for(let h=0;h<a;++h)r[h].commandList.push(u);else if(a===1)r[0].commandList.push(u);else{let h=!1;for(let c=a-1;c>=0;--c){const f=r[c].cullingVolume;if(t.isVisible(f,u))r[c].commandList.push(u),h=!0;else if(h)break}}}}function $1(t){const{shadowState:n,commandList:e}=t.frameState,{shadowsEnabled:i,shadowMaps:o}=n;if(!i)return;const{context:r}=t,{uniformState:a}=r;for(let s=0;s<o.length;++s){const l=o[s];if(l.outOfView)continue;const{passes:u}=l;for(let h=0;h<u.length;++h)u[h].commandList.length=0;aD(t,e,l);for(let h=0;h<u.length;++h){const c=l.passes[h],{camera:f,commandList:A}=c;a.updateCamera(f),l.updatePass(r,h);for(let d=0;d<A.length;++d){const p=A[d];a.updatePass(p.pass);const v=p.derivedCommands.shadows.castCommands[s];di(v,t,c.passState)}}}}function di(t,n,e,i){const o=n._frameState,r=n._context;if(Xe(n.debugCommandFilter)&&!n.debugCommandFilter(t))return;if(t instanceof TB){t.execute(r,e);return}t.debugShowBoundingVolume&&Xe(t.boundingVolume)&&lD(t,n,e,i),o.useLogDepth&&Xe(t.derivedCommands.logDepth)&&(t=t.derivedCommands.logDepth.command);const a=o.passes;if(!a.pick&&!a.pickVoxel&&!a.depth&&n._hdr&&Xe(t.derivedCommands)&&Xe(t.derivedCommands.hdr)&&(t=t.derivedCommands.hdr.command),a.pick||a.depth){if(a.pick&&!a.depth){if(o.pickingMetadata&&Xe(t.derivedCommands.pickingMetadata)){t=t.derivedCommands.pickingMetadata.pickMetadataCommand,t.execute(r,e);return}if(!o.pickingMetadata&&Xe(t.derivedCommands.picking)){t=t.derivedCommands.picking.pickCommand,t.execute(r,e);return}}else if(Xe(t.derivedCommands.depth)){t=t.derivedCommands.depth.depthOnlyCommand,t.execute(r,e);return}}if(n.debugShowCommands||n.debugShowFrustums){n._debugInspector.executeDebugShowFrustumsCommand(n,t,e);return}o.shadowState.lightShadowsEnabled&&t.receiveShadows&&Xe(t.derivedCommands.shadows)?t.derivedCommands.shadows.receiveCommand.execute(r,e):t.execute(r,e)}let sD=new Ii(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);function lD(t,n,e,i){const o=n._frameState,r=o.context,a=t.boundingVolume;Xe(n._debugVolume)&&n._debugVolume.destroy();let s=en.clone(a.center);if(o.mode!==Ol.SCENE3D){s=Ii.multiplyByPoint(sD,s,s);const d=o.mapProjection,p=d.unproject(s);s=d.ellipsoid.cartographicToCartesian(p)}let l,u;const{radius:h}=a;Xe(h)?(l=V1.createGeometry(new V1({radii:new en(h,h,h),vertexFormat:Sp.FLAT_VERTEX_FORMAT})),u=Ii.fromTranslation(s)):(l=W1.createGeometry(W1.fromDimensions({dimensions:new en(2,2,2),vertexFormat:Sp.FLAT_VERTEX_FORMAT})),u=Ii.fromRotationTranslation(a.halfAxes,s,new Ii)),n._debugVolume=new BB({geometryInstances:new DB({geometry:RB.toWireframe(l),modelMatrix:u,attributes:{color:new OB(1,0,0,1)}}),appearance:new Sp({flat:!0,translucent:!1}),asynchronous:!1});const c=o.commandList,f=o.commandList=[];n._debugVolume.update(o),t=f[0],o.useLogDepth&&(t=LB.createLogDepthCommand(t,r).command);let A;Xe(i)&&(A=e.framebuffer,e.framebuffer=i),t.execute(r,e),Xe(A)&&(e.framebuffer=A),o.commandList=c}function Z1(t){t.context.uniformState.updatePass(ut.COMPUTE);const n=t._environmentState.sunComputeCommand;Xe(n)&&n.execute(t._computeEngine);const e=t._computeCommandList;for(let i=0;i<e.length;++i)e[i].execute(t._computeEngine)}function Y1(t){const n=t._frameState;t._groundPrimitives.update(n),t._primitives.update(n),uD(t),cD(t),t._globe&&t._globe.render(n)}function uD(t){const n=t._frameState;t.debugShowFrustumPlanes!==t._debugShowFrustumPlanes&&(t.debugShowFrustumPlanes?t._debugFrustumPlanes=new PB({camera:t.camera,updateOnChange:!1,frustumSplits:n.frustumSplits}):t._debugFrustumPlanes=t._debugFrustumPlanes&&t._debugFrustumPlanes.destroy(),t._debugShowFrustumPlanes=t.debugShowFrustumPlanes),Xe(t._debugFrustumPlanes)&&t._debugFrustumPlanes.update(n)}function cD(t){const n=t._frameState,{passes:e,shadowState:i,shadowMaps:o}=n,r=o.length,a=r>0&&!e.pick&&!e.pickVoxel&&t.mode===Ol.SCENE3D;if(a!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=a),i.lightShadowsEnabled=!1,!!a){for(let s=0;s<r;++s)if(o[s]!==i.shadowMaps[s]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let s=0;s<r;++s){const l=o[s];l.update(n),i.shadowMaps.push(l),l.fromLightSource&&(i.lightShadowMaps.push(l),i.lightShadowsEnabled=!0),l.dirty&&(++i.lastDirtyTime,l.dirty=!1)}}}function hD(t,n,e){const i=t._context,o=t._frameState,r=t._environmentState,a=t._view,s=o.passes,l=s.pick||s.pickVoxel;Xe(a.globeDepth)&&(a.globeDepth.picking=l);const u=r.useWebVR;r.originalFramebuffer=n.framebuffer,Xe(t.sun)&&t.sunBloom!==t._sunBloom?(t.sunBloom&&!u?t._sunPostProcess=new UB:Xe(t._sunPostProcess)&&(t._sunPostProcess=t._sunPostProcess.destroy()),t._sunBloom=t.sunBloom):!Xe(t.sun)&&Xe(t._sunPostProcess)&&(t._sunPostProcess=t._sunPostProcess.destroy(),t._sunBloom=!1);const h=t._clearColorCommand;zB.clone(e,h.color),h.execute(i,n);const c=r.useGlobeDepthFramebuffer=Xe(a.globeDepth);c&&(a.globeDepth.update(i,n,a.viewport,t.msaaSamples,t._hdr,r.clearGlobeDepth),a.globeDepth.clear(i,n,e));const f=a.oit,A=r.useOIT=!l&&Xe(f)&&f.isSupported();A&&(f.update(i,n,a.globeDepth.colorFramebufferManager,t._hdr,t.msaaSamples),f.clear(i,n,e),r.useOIT=f.isSupported());const d=t.postProcessStages;let p=r.usePostProcess=!l&&(t._hdr||d.length>0||d.ambientOcclusion.enabled||d.fxaa.enabled||d.bloom.enabled);if(r.usePostProcessSelected=!1,p&&(a.sceneFramebuffer.update(i,a.viewport,t._hdr,t.msaaSamples),a.sceneFramebuffer.clear(i,n,e),d.update(i,o.useLogDepth,t._hdr),d.clear(i),p=r.usePostProcess=d.ready,r.usePostProcessSelected=p&&d.hasSelected),r.isSunVisible&&t.sunBloom&&!u?(n.framebuffer=t._sunPostProcess.update(n),t._sunPostProcess.clear(i,n,e)):c?n.framebuffer=a.globeDepth.framebuffer:p&&(n.framebuffer=a.sceneFramebuffer.framebuffer),Xe(n.framebuffer)&&h.execute(i,n),r.useInvertClassification=!l&&Xe(n.framebuffer)&&t.invertClassification){let y;if(o.invertClassificationColor.alpha===1&&c&&(y=a.globeDepth.framebuffer),Xe(y)||i.depthTexture){if(t._invertClassification.previousFramebuffer=y,t._invertClassification.update(i,t.msaaSamples,a.globeDepth.colorFramebufferManager),t._invertClassification.clear(i,n),o.invertClassificationColor.alpha<1&&A){const g=t._invertClassification.unclassifiedCommand,b=g.derivedCommands;b.oit=f.createDerivedCommands(g,i,b.oit)}}else r.useInvertClassification=!1}t._globeTranslucencyState.translucent&&a.globeTranslucencyFramebuffer.updateAndClear(t._hdr,a.viewport,i,n)}const fD=new IB,AD=new kB,dD=new FB,pD=new MB;function mD(t){const{frustum:n}=t;return Xe(n.fov)?n.clone(fD):Xe(n.infiniteProjectionMatrix)?n.clone(AD):Xe(n.width)?n.clone(dD):n.clone(pD)}class gD{constructor(n,e,i,o){L(this,"name");L(this,"value");L(this,"_gl");L(this,"_location");L(this,"textureUnitIndex");L(this,"_setSampler",n=>(this.textureUnitIndex=n,this._gl.uniform1i(this._location,n),n+1));L(this,"set",()=>{const n=this._gl;n.activeTexture(n.TEXTURE0+this.textureUnitIndex);const e=this.value;n.bindTexture(e._target,e._texture)});this.uniformName=i,this._gl=n,this.name=i,this._location=o}}class yD{constructor(n,e,i,o){L(this,"name");L(this,"value");L(this,"_value");L(this,"_gl");L(this,"_locations");L(this,"textureUnitIndex");L(this,"_setSampler",n=>{this.textureUnitIndex=n;const e=this._locations,i=e.length;for(let o=0;o<i;++o){const r=n+o;this._gl.uniform1i(e[o],r)}return n+i});L(this,"set",()=>{const n=this._gl,e=n.TEXTURE0+this.textureUnitIndex,i=this.value,o=i.length;for(let r=0;r<o;++r){const a=i[r];n.activeTexture(e+r),n.bindTexture(a._target,a._texture)}});this.uniformName=i;const r=o.length;this._gl=n,this.value=new Array(r),this._value=new Float32Array(r),this.name=i,this._locations=o,this.textureUnitIndex=void 0}}const{defined:ur,RuntimeError:vD,AutomaticUniforms:wD,createUniform:_D,createUniformArray:bD}=C;function CD(){Object.defineProperties(C.ShaderProgram,{fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return sf(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return sf(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return sf(this),this._uniformsByName}}}),C.ShaderProgram.prototype._bind=function(){sf(this),this._gl.useProgram(this._program)}}function sf(t){ur(t._program)||J1(t)}function J1(t){const n=t._program,e=t._gl,i=xD(e,t,t._debugShaders),o=e.getProgramParameter(i,e.ACTIVE_ATTRIBUTES),r=SD(e,i),a=ED(t,r.uniformsByName);t._program=i,t._numberOfVertexAttributes=o,t._vertexAttributes=PD(e,i,o),t._uniformsByName=r.uniformsByName,t._uniforms=r.uniforms,t._automaticUniforms=a.automaticUniforms,t._manualUniforms=a.manualUniforms,t.maximumTextureUnitIndex=TD(e,i,r.samplerUniforms),n&&t._gl.deleteProgram(n),typeof spector<"u"&&(t._program.__SPECTOR_rebuildProgram=function(s,l,u,h){const c=t._vertexShaderText,f=t._fragmentShaderText,A=/ ! = /g;t._vertexShaderText=s.replace(A," != "),t._fragmentShaderText=l.replace(A," != ");try{J1(t),u(t._program)}catch(d){t._vertexShaderText=c,t._fragmentShaderText=f;const v=/(?:Compile|Link) error: ([^]*)/.exec(d.message);h(v?v[1]:d.message)}})}const ki="[Cesium WebGL] ";function xD(t,n){const e=n._vertexShaderText,i=n._fragmentShaderText,o=t.createShader(t.VERTEX_SHADER);t.shaderSource(o,e),t.compileShader(o);const r=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(r,i),t.compileShader(r);const a=t.createProgram();t.attachShader(a,o),t.attachShader(a,r);const s=n._attributeLocations;if(ur(s))for(const f in s)s.hasOwnProperty(f)&&t.bindAttribLocation(a,s[f],f);t.linkProgram(a);let l;if(t.getProgramParameter(a,t.LINK_STATUS))return n._logShaderCompilation&&(l=t.getShaderInfoLog(o),ur(l)&&l.length>0&&console.log(`${ki}Vertex shader compile log: ${l}`),l=t.getShaderInfoLog(r),ur(l)&&l.length>0&&console.log(`${ki}Fragment shader compile log: ${l}`),l=t.getProgramInfoLog(a),ur(l)&&l.length>0&&console.log(`${ki}Shader program link log: ${l}`)),t.deleteShader(o),t.deleteShader(r),a;let u;const h=n._debugShaders;throw t.getShaderParameter(r,t.COMPILE_STATUS)?t.getShaderParameter(o,t.COMPILE_STATUS)?(l=t.getProgramInfoLog(a),console.error(`${ki}Shader program link log: ${l}`),c(o,"vertex"),c(r,"fragment"),u=`Program failed to link. Link log: ${l}`):(l=t.getShaderInfoLog(o),console.error(`${ki}Vertex shader compile log: ${l}`),console.error(`${ki} Vertex shader source:
|
|
736
736
|
${e}`),u=`Vertex shader failed to compile. Compile log: ${l}`):(l=t.getShaderInfoLog(r),console.error(`${ki}Fragment shader compile log: ${l}`),console.error(`${ki} Fragment shader source:
|
|
737
737
|
${i}`),u=`Fragment shader failed to compile. Compile log: ${l}`),t.deleteShader(o),t.deleteShader(r),t.deleteProgram(a),new vD(u);function c(f,A){if(!ur(h))return;const d=h.getTranslatedShaderSource(f);if(d===""){console.error(`${ki}${A} shader translation failed.`);return}console.error(`${ki}Translated ${A} shaderSource:
|
|
738
|
-
${d}`)}}function SD(t,n){const e={},i=[],o=[],r=t.getProgramParameter(n,t.ACTIVE_UNIFORMS);for(let a=0;a<r;++a){const s=t.getActiveUniform(n,a),l="[0]",u=s.name.indexOf(l,s.name.length-l.length)!==-1?s.name.slice(0,s.name.length-3):s.name;if(u.indexOf("gl_")!==0)if(s.name.indexOf("[")<0){const h=t.getUniformLocation(n,u);if(h!==null){const c=s.type!=t.UNSIGNED_INT_SAMPLER_2D?_D(t,s,u,h):new gD(t,s,u,h);e[u]=c,i.push(c),c._setSampler&&o.push(c)}}else{let h,c,f,A;const d=u.indexOf("[");if(d>=0){if(h=e[u.slice(0,d)],!ur(h))continue;c=h._locations,c.length<=1&&(f=h.value,A=t.getUniformLocation(n,u),A!==null&&(c.push(A),f.push(t.getUniform(n,A))))}else{c=[];for(let p=0;p<s.size;++p)A=t.getUniformLocation(n,`${u}[${p}]`),A!==null&&c.push(A);h=s.type!=t.UNSIGNED_INT_SAMPLER_2D?bD(t,s,u,c):new yD(t,s,u,c),e[u]=h,i.push(h),h._setSampler&&o.push(h)}}}return{uniformsByName:e,uniforms:i,samplerUniforms:o}}function ED(t,n){const e=[],i=[];for(const o in n)if(n.hasOwnProperty(o)){const r=n[o];let a=o;const s=t._duplicateUniformNames[a];ur(s)&&(r.name=s,a=s);const l=wD[a];ur(l)?e.push({uniform:r,automaticUniform:l}):i.push(r)}return{automaticUniforms:e,manualUniforms:i}}function PD(t,n,e){const i={};for(let o=0;o<e;++o){const r=t.getActiveAttrib(n,o),a=t.getAttribLocation(n,r.name);i[r.name]={name:r.name,type:r.type,index:a}}return i}function TD(t,n,e){t.useProgram(n);let i=0;const o=e.length;for(let r=0;r<o;++r)i=e[r]._setSampler(i);return t.useProgram(null),i}const{defaultValue:Wr,BufferUsage:ID,defined:Fi,ComponentDatatype:Vn,Geometry:kD,Math:FD,IndexDatatype:j1,VertexArray:MD,RuntimeError:BD,Buffer:Ul,AttributeType:DD}=C;function RD(){C.VertexArray.fromGeometry=function(t){t=Wr(t,Wr.EMPTY_OBJECT),C.Check.defined("options.context",t.context);const n=t.context,e=Wr(t.geometry,Wr.EMPTY_OBJECT),i=Wr(t.bufferUsage,ID.DYNAMIC_DRAW),o=Wr(t.attributeLocations,Wr.EMPTY_OBJECT),r=Wr(t.interleave,!1),a=t.vertexArrayAttributes;let s,l,u;const h=Fi(a)?a:[],c=e.attributes;if(r){const d=OD(c);if(Fi(d)){u=Ul.createVertexBuffer({context:n,typedArray:d.buffer,usage:i});const p=d.offsetsInBytes,v=d.vertexSizeInBytes;for(s in c)c.hasOwnProperty(s)&&Fi(c[s])&&(l=c[s],Fi(l.values)?h.push({index:o[s],vertexBuffer:u,componentDatatype:l.componentDatatype,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize,offsetInBytes:p[s],strideInBytes:v}):h.push({index:o[s],value:l.value,componentDatatype:l.componentDatatype,normalize:l.normalize}))}}else for(s in c)if(c.hasOwnProperty(s)&&Fi(c[s])){l=c[s];let d=l.componentDatatype;d===Vn.DOUBLE&&(d=Vn.FLOAT);let p={};u=void 0,Fi(l.values)&&(u=Ul.createVertexBuffer({context:n,typedArray:Vn.createTypedArray(d,l.values),usage:i}),p={index:o[s],vertexBuffer:u,value:l.value,componentDatatype:d,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize}),Fi(l.typedArray)&&(u=Ul.createVertexBuffer({context:n,typedArray:l.typedArray,usage:i}),p={index:o[s],vertexBuffer:u,value:void 0,componentDatatype:d,componentsPerAttribute:DD.getNumberOfComponents(l.type),normalize:l.normalized,instanceDivisor:l.instanceDivisor}),h.push(p)}let f;const A=e.indices;return Fi(A)&&(kD.computeNumberOfVertices(e)>=FD.SIXTY_FOUR_KILOBYTES&&n.elementIndexUint?f=Ul.createIndexBuffer({context:n,typedArray:new Uint32Array(A),usage:i,indexDatatype:j1.UNSIGNED_INT}):f=Ul.createIndexBuffer({context:n,typedArray:new Uint16Array(A),usage:i,indexDatatype:j1.UNSIGNED_SHORT})),new MD({context:n,attributes:h,indexBuffer:f})}}function OD(t){let n,e,i;const o=[];for(e in t)t.hasOwnProperty(e)&&Fi(t[e])&&Fi(t[e].values)&&(o.push(e),t[e].componentDatatype===Vn.DOUBLE&&(t[e].componentDatatype=Vn.FLOAT,t[e].values=Vn.createTypedArray(Vn.FLOAT,t[e].values)));let r;const a=o.length;if(a>0)for(r=e_(t[o[0]]),n=1;n<a;++n){const u=e_(t[o[n]]);if(u!==r)throw new BD(`Each attribute list must have the same number of vertices. Attribute ${o[n]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,h){return Vn.getSizeInBytes(t[h].componentDatatype)-Vn.getSizeInBytes(t[u].componentDatatype)});let s=0;const l={};for(n=0;n<a;++n)e=o[n],i=t[e],l[e]=s,s+=UD(i);if(s>0){const u=Vn.getSizeInBytes(t[o[0]].componentDatatype),h=s%u;h!==0&&(s+=u-h);const c=r*s,f=new ArrayBuffer(c),A={};for(n=0;n<a;++n){e=o[n];const d=Vn.getSizeInBytes(t[e].componentDatatype);A[e]={pointer:Vn.createTypedArray(t[e].componentDatatype,f),index:l[e]/d,strideInComponentType:s/d}}for(n=0;n<r;++n)for(let d=0;d<a;++d){e=o[d],i=t[e];const p=i.values,v=A[e],y=v.pointer,g=i.componentsPerAttribute;for(let b=0;b<g;++b)y[v.index+b]=p[n*g+b];v.index+=v.strideInComponentType}return{buffer:f,offsetsInBytes:l,vertexSizeInBytes:s}}}function e_(t){return t.values.length/t.componentsPerAttribute}function UD(t){return Vn.getSizeInBytes(t.componentDatatype)*t.componentsPerAttribute}const{defaultValue:t_}=C;class LD extends C.FrustumCommands{constructor(n,e){super(n,e),this.near=t_(n,0),this.far=t_(e,0);const i=12,o=new Array(i),r=new Array(i);for(let a=0;a<i;++a)o[a]=[],r[a]=0;this.commands=o,this.indices=r}}const{SceneMode:n_,CullingVolume:zD,Interval:QD,Pass:lf,defined:Ll,ShadowMap:ND,Math:VD,ClearCommand:HD}=C,i_=new zD,GD=new QD;function WD(){C.View.prototype.createPotentiallyVisibleSet=function(t){const{frameState:n}=t,{camera:e,commandList:i,shadowState:o}=n,{positionWC:r,directionWC:a,frustum:s}=e,l=t._computeCommandList,u=t._overlayCommandList;t.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});const h=this.frustumCommandsList;for(let B=0;B<h.length;++B)for(let M=0;M<12;++M)h[B].indices[M]=0;l.length=0,u.length=0;const c=this._commandExtents,f=c.length;let A=0,d=+Number.MAX_VALUE,p=-Number.MAX_VALUE;const{shadowsEnabled:v}=o;let y=+Number.MAX_VALUE,g=-Number.MAX_VALUE,b=Number.MAX_VALUE;const w=n.mode===n_.SCENE3D?n.occluder:void 0;let{cullingVolume:E}=n;const T=i_.planes;for(let B=0;B<5;++B)T[B]=E.planes[B];E=i_;for(let B=0;B<i.length;++B){const M=i[B],{pass:S,boundingVolume:k}=M;if(S===lf.COMPUTE)l.push(M);else if(S===lf.OVERLAY)u.push(M);else{let _,x;if(Ll(k)){if(!t.isVisible(E,M,w))continue;const F=k.computePlaneDistances(r,a,GD);if(_=F.start,x=F.stop,d=Math.min(d,_),p=Math.max(p,x),v&&M.receiveShadows&&_<ND.MAXIMUM_DISTANCE&&!(S===lf.GLOBE&&_<-100&&x>100)){const D=x-_;S!==lf.GLOBE&&_<100&&(b=Math.min(b,D)),y=Math.min(y,_),g=Math.max(g,x)}}else M instanceof HD?(_=s.near,x=s.far):(_=s.near,x=s.far,d=Math.min(d,_),p=Math.max(p,x));let O=c[A];Ll(O)||(O=c[A]=new XD),O.command=M,O.near=_,O.far=x,A++}}v&&(y=Math.min(Math.max(y,s.near),s.far),g=Math.max(Math.min(g,s.far),y),o.nearPlane=y,o.farPlane=g,o.closestObjectSize=b),qD(this,t,d,p);for(let B=0;B<A;B++)KD(this,t,c[B]);if(A<f)for(let B=A;B<f;B++){const M=c[B];if(!Ll(M.command))break;M.command=void 0}const P=h.length,{frustumSplits:I}=n;I.length=P+1;for(let B=0;B<P;++B)I[B]=h[B].near,B===P-1&&(I[B+1]=h[B].far)}}function qD(t,n,e,i){const{frameState:o}=n,{camera:r,useLogDepth:a}=o,s=a?n.logarithmicDepthFarToNearRatio:n.farToNearRatio,l=n.mode===n_.SCENE2D,u=n.nearToFarDistance2D;i*=1+VD.EPSILON2,e=Math.min(Math.max(e,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),e);let h;l?(i=Math.min(i,r.position.z+n.nearToFarDistance2D),e=Math.min(e,i),h=Math.ceil(Math.max(1,i-e)/n.nearToFarDistance2D)):h=Math.ceil(Math.log(i/e)/Math.log(s));const{frustumCommandsList:c}=t;c.length=h;for(let f=0;f<h;++f){let A,d;l?(A=Math.min(i-u,e+f*u),d=Math.min(i,A+u)):(A=Math.max(e,Math.pow(s,f)*e),d=Math.min(i,s*A));let p=c[f];Ll(p)?(p.near=A,p.far=d):p=c[f]=new LD(A,d)}}function KD(t,n,e){const{command:i,near:o,far:r}=e;n.debugShowFrustums&&(i.debugOverlappingFrustums=0);const{frustumCommandsList:a}=t;for(let s=0;s<a.length;++s){const l=a[s];if(o>l.far)continue;if(r<l.near)break;const u=i.pass,h=l.indices[u]++;if(l.commands[u][h]=i,n.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<s),i.executeInClosestFrustum)break}if(n.debugShowFrustums){const{debugFrustumStatistics:s}=t,{debugOverlappingFrustums:l}=i,u=s.commandsInFrustums;u[l]=Ll(u[l])?u[l]+1:1,++s.totalCommands}n.updateDerivedCommands(i)}class XD{constructor(){L(this,"command");L(this,"near");L(this,"far")}}ek(),tk(),fk(),nF(),cM(),jM(),oB(),lB(),cB(),gB(),XB(),WD(),RD(),CD(),MI(),BI(),DI(),LI(),zI(),QI(),NI(),FI(),JI(),jI(),C.Camera.DEFAULT_VIEW_RECTANGLE=C.Rectangle.fromDegrees(70,5,140,55);function $D(){return new Promise((t,n)=>C.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class ZD extends m.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Hn(s);if(l&&(l.destroy(),Ep(s,void 0)),C.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(m.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=kI;await s.promise($D());const h=await s.promise(m.createCancelablePromise(u(l,o)));h.scene._xbsjOriginSkyAtmosphere=h.scene.skyAtmosphere,h.scene._xbsjOriginSkyBox=h.scene.skyBox,h.clockViewModel.currentTime=C.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const c=C.JulianDate.fromDate(new Date(e.currentTime));C.JulianDate.equals(c,h.clockViewModel.currentTime)||(h.clockViewModel.currentTime=c)})),this.dispose(Pi(h.clockViewModel,"currentTime",c=>{const f=C.JulianDate.toDate(h.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const c=new l_(h,e);Ep(h,c)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(h)}));a.start(n),a.errorEvent.don(()=>{e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const YD=new C.EllipsoidTerrainProvider;class r_ extends m.Destroyable{constructor(e){super();L(this,"_terrainMap",new Map);L(this,"_nextAnimateFrame",this.dv(m.createNextAnimateFrame()));L(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{let r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??YD,i.scene.globe.depthTestAgainstTerrain=this.selectedTerrain?this.selectedTerrain.sceneObject.renderMode!="disableDepthTest":!0,i.scene.globe.translucency.enabled=this.selectedTerrain?this.selectedTerrain.sceneObject.renderMode!="default":!1,i.scene.globe.translucency.frontFaceAlpha=this.selectedTerrain?m.clamp(this.selectedTerrain.sceneObject.opacity,0,1):1,i.scene.globe.translucency.backFaceAlpha=this.selectedTerrain?m.clamp(this.selectedTerrain.sceneObject.opacity,0,1):1}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const i=new m.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(m.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged,e.sceneObject.opacityChanged,e.sceneObject.renderModeChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class o_ extends m.Destroyable{constructor(e){super();L(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof Pt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new m.Destroyable;{const r=o.dv(m.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof Pt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof Pt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,h)=>Number(h[1])-Number(u[1]))).forEach((u,h)=>{h instanceof Pt&&h.czmDivPoi&&(h.czmDivPoi.zOrder=a),h instanceof fr&&h.canvasObj&&(h.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class JD extends m.Destroyable{constructor(e){super();L(this,"_czmImageryLayerWrappers",new Set);L(this,"_zIndexChangedEvent",this.dv(new m.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??N.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??N.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class jD extends m.Destroyable{constructor(e){super();L(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:i}=this,o=i.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class e3 extends m.Destroyable{constructor(e){super();L(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new m.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new jD(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class t3 extends m.Destroyable{constructor(e,i){super();L(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new m.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new e3(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class a_ extends m.Destroyable{constructor(e){super();L(this,"_czmImageryWrappers",new Set);L(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new JD(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new t3(e,this))}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class s_ extends m.Destroyable{constructor(e){super();L(this,"_pause",this.disposeVar(m.react(!1)));L(this,"_pickPositionTasks",[]);L(this,"_pickTasks",[]);L(this,"pickHeightMustGreaterThanZero",!0);L(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[h,c,f,A]=u;try{(async()=>{const{scene:d,camera:p}=i,v=tt(h),y=p.getPickRay(v);do{if(!y)break;let g;if(c?g=await d.pickFromRayMostDetailed(y,this.objectsToExclude):g=d.pickFromRay(y,this.objectsToExclude),!g||!g.position)break;const b=Qe(g.position);if(!b){A(new Error("positionFromCartesian failed"));return}f(b);return}while(!1);if(y&&!(d.terrainProvider instanceof C.EllipsoidTerrainProvider)){const g=d.globe.pick(y,d);if(!g){A(new Error("scene.globe.pick failed"));return}const b=Qe(g);if(!b){A(new Error("positionFromCartesian failed"));return}this.pickHeightMustGreaterThanZero&&b[2]<0&&(b[2]=0),f(b);return}{const g=d.terrainProvider instanceof C.EllipsoidTerrainProvider?d.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,b=i.camera.pickEllipsoid(tt(h),g);if(!b){A(new Error("Pick failed"));return}const w=Qe(b);if(!w){A(new Error("positionFromCartesian failed"));return}f(w)}})()}catch(d){A(d)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[h,c,f,A,d]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,T,P;let p=i.scene.pick(tt(h),c&&c[0],c&&c[1]);!p&&C.defined(i.scene.globe)&&(p=await n3(i,tt(h)));let v;if(p&&p instanceof C.Cesium3DTileFeature){v={};try{p&&p.getPropertyIds().forEach(B=>{v&&(v[B]=p.getProperty(B))})}catch(I){console.warn(I)}}let y;do{if(!p)break;if(p.id&&p.id instanceof C.Entity&&p.id.ESSceneObjectID){y=p.id.ESSceneObjectID;break}if(p.primitive&&p.primitive.ESSceneObjectID){y=p.primitive.ESSceneObjectID;break}}while(!1);const g=y?N.ESSceneObject.getSceneObject(y):void 0;let b={};if(g&&Reflect.has(g,"allowPicking")&&Reflect.has(g,"pickedEvent")&&(g.allowPicking??!1)){do{if(g instanceof N.ESEntityCluster){const I=new C.JulianDate;b=p.id instanceof C.Entity?{name:p.id.label.text.getValue(I),properties:(E=p.id.properties)==null?void 0:E.getValue(I),coordinates:wl(p.id.position.getValue(I))}:(T=p.id)==null?void 0:T.map(B=>{var M;return{name:B.id,properties:(M=B.properties)==null?void 0:M.getValue(I),coordinates:wl(B.position.getValue(I))}});break}if(g instanceof N.ESGeoJson){const I=new C.JulianDate;if(!p.id.entityCollection)return;const B=p.id.polygon?"Polygon":p.id.polyline?"LineString":"Point",M=((P=p.id.properties)==null?void 0:P.getValue(I))??{},S=B=="Point"?Qe(p.id.position.getValue(I)):B=="LineString"?p.id.polyline.positions.getValue(I).map(k=>Qe(k)):zd(p.id.polygon.hierarchy.getValue(I));b=g.pickedInfoType=="FeatureCollection"?{type:"Feature",geometry:{type:B,coordinates:S},properties:M}:{type:B,coordinates:S,properties:M};break}if(g instanceof N.ESGltfModel){let I;Reflect.has(p,"featureId")?I=p.featureId:Reflect.has(p,"instanceId")&&(I=p.instanceId),I&&(p.id=p.primitive.structuralMetadata.getPropertyTable(0).getProperty(p.instanceId,"id"))}}while(!1);g.pickedEvent.emit(new N.ESJPickedResult(p,g,v,b,f,h))}g&&Reflect.has(g,"allowPicking")&&!g.allowPicking&&A(new N.ESJPickedResult);const w=new N.ESJPickedResult(p,g,v,b,f,h);A(w)})()}catch(p){d(p)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function n3(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(C.defined(o))return o}class i3 extends m.Destroyable{constructor(e){super();L(this,"_enabled",this.disposeVar(m.react(!1)));L(this,"_cursorPosition",m.react(void 0));L(this,"quickPickPosition",!0);let i=new m.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Hn(e);if(!a)return;i=new m.Destroyable;const s=i.disposeVar(m.react(void 0)),l=i.disposeVar(m.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(h=>{h.pointerEvent&&(s.value=m.getDomEventCurrentTargetPos(h.pointerEvent))}));const u=i.disposeVar(m.createProcessingFromAsyncFunc(async h=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const c=await h.promise(m.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=c}else{const c=await h.promise(m.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=c}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function Hn(t){return m.getExtProp(t,"_viewerExtensions")}function Ep(t,n){m.setExtProp(t,"_viewerExtensions",n)}class l_ extends m.Destroyable{constructor(e,i){super();L(this,"_imageriesManager");L(this,"_terrainManager");L(this,"_labelManager");L(this,"_pickingManager");L(this,"_poiContext");L(this,"_cursorPositionInfo");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new a_(this.viewer)),this._terrainManager=this.dv(new r_(this.viewer)),this._labelManager=this.dv(new o_(this.viewer)),this._poiContext=this.disposeVar(new I_(this._viewer)),this._cursorPositionInfo=this.disposeVar(new i3(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new s_(i))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}}var u_=new C.Cartesian3,c_=new C.Cartesian3;function h_(t,n,e){let i=C.Matrix4.clone(t.transform);t.lookAtTransform(C.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=C.Cartesian3.normalize(r,u_),s=C.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=C.Cartesian3.cross(t.direction,a,c_);else var l=C.Cartesian3.cross(t.up,a,c_);var u=l;if(e){var h=C.Cartesian3.cross(a,l,u_);u=h}var c=C.Cartesian3.magnitude(r);t.rotate(u,n/c);var f=t.positionCartographic,A=f.longitude,d=f.latitude;C.Cartesian3.fromRadians(A,d,o,void 0,t.position),t.lookAtTransform(i)}function f_(t,n){h_(t,n,!1)}function A_(t,n){h_(t,-n,!0)}class r3 extends m.Destroyable{constructor(e){super();L(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),h=u-s;s=u;const c=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(h*c),a.MoveBackword&&r.moveBackward(h*c),a.MoveLeft&&r.moveLeft(h*c),a.MoveRight&&r.moveRight(h*c)):(a.MoveForward&&f_(r,h*c),a.MoveBackword&&f_(r,-h*c),a.MoveLeft&&A_(r,-h*c),a.MoveRight&&A_(r,h*c));{const{rotateSpeed:f}=this.controller,A=C.Math.toRadians(f*h);a.RotateRight?r.lookRight(A):a.RotateLeft?r.lookRight(-A):a.RotateUp?r.lookDown(-A):a.RotateDown&&r.lookDown(A)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class uf extends m.Destroyable{constructor(e){super();L(this,"_currentKeyIds",new Set);L(this,"_currentKeyIdsChanged",this.dv(new m.Event));L(this,"_debug",this.dv(m.react(!1)));L(this,"_debugResetting",this.dv(new m.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends m.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
|
|
738
|
+
${d}`)}}function SD(t,n){const e={},i=[],o=[],r=t.getProgramParameter(n,t.ACTIVE_UNIFORMS);for(let a=0;a<r;++a){const s=t.getActiveUniform(n,a),l="[0]",u=s.name.indexOf(l,s.name.length-l.length)!==-1?s.name.slice(0,s.name.length-3):s.name;if(u.indexOf("gl_")!==0)if(s.name.indexOf("[")<0){const h=t.getUniformLocation(n,u);if(h!==null){const c=s.type!=t.UNSIGNED_INT_SAMPLER_2D?_D(t,s,u,h):new gD(t,s,u,h);e[u]=c,i.push(c),c._setSampler&&o.push(c)}}else{let h,c,f,A;const d=u.indexOf("[");if(d>=0){if(h=e[u.slice(0,d)],!ur(h))continue;c=h._locations,c.length<=1&&(f=h.value,A=t.getUniformLocation(n,u),A!==null&&(c.push(A),f.push(t.getUniform(n,A))))}else{c=[];for(let p=0;p<s.size;++p)A=t.getUniformLocation(n,`${u}[${p}]`),A!==null&&c.push(A);h=s.type!=t.UNSIGNED_INT_SAMPLER_2D?bD(t,s,u,c):new yD(t,s,u,c),e[u]=h,i.push(h),h._setSampler&&o.push(h)}}}return{uniformsByName:e,uniforms:i,samplerUniforms:o}}function ED(t,n){const e=[],i=[];for(const o in n)if(n.hasOwnProperty(o)){const r=n[o];let a=o;const s=t._duplicateUniformNames[a];ur(s)&&(r.name=s,a=s);const l=wD[a];ur(l)?e.push({uniform:r,automaticUniform:l}):i.push(r)}return{automaticUniforms:e,manualUniforms:i}}function PD(t,n,e){const i={};for(let o=0;o<e;++o){const r=t.getActiveAttrib(n,o),a=t.getAttribLocation(n,r.name);i[r.name]={name:r.name,type:r.type,index:a}}return i}function TD(t,n,e){t.useProgram(n);let i=0;const o=e.length;for(let r=0;r<o;++r)i=e[r]._setSampler(i);return t.useProgram(null),i}const{defaultValue:Wr,BufferUsage:ID,defined:Fi,ComponentDatatype:Vn,Geometry:kD,Math:FD,IndexDatatype:j1,VertexArray:MD,RuntimeError:BD,Buffer:Ul,AttributeType:DD}=C;function RD(){C.VertexArray.fromGeometry=function(t){t=Wr(t,Wr.EMPTY_OBJECT),C.Check.defined("options.context",t.context);const n=t.context,e=Wr(t.geometry,Wr.EMPTY_OBJECT),i=Wr(t.bufferUsage,ID.DYNAMIC_DRAW),o=Wr(t.attributeLocations,Wr.EMPTY_OBJECT),r=Wr(t.interleave,!1),a=t.vertexArrayAttributes;let s,l,u;const h=Fi(a)?a:[],c=e.attributes;if(r){const d=OD(c);if(Fi(d)){u=Ul.createVertexBuffer({context:n,typedArray:d.buffer,usage:i});const p=d.offsetsInBytes,v=d.vertexSizeInBytes;for(s in c)c.hasOwnProperty(s)&&Fi(c[s])&&(l=c[s],Fi(l.values)?h.push({index:o[s],vertexBuffer:u,componentDatatype:l.componentDatatype,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize,offsetInBytes:p[s],strideInBytes:v}):h.push({index:o[s],value:l.value,componentDatatype:l.componentDatatype,normalize:l.normalize}))}}else for(s in c)if(c.hasOwnProperty(s)&&Fi(c[s])){l=c[s];let d=l.componentDatatype;d===Vn.DOUBLE&&(d=Vn.FLOAT);let p={};u=void 0,Fi(l.values)&&(u=Ul.createVertexBuffer({context:n,typedArray:Vn.createTypedArray(d,l.values),usage:i}),p={index:o[s],vertexBuffer:u,value:l.value,componentDatatype:d,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize}),Fi(l.typedArray)&&(u=Ul.createVertexBuffer({context:n,typedArray:l.typedArray,usage:i}),p={index:o[s],vertexBuffer:u,value:void 0,componentDatatype:d,componentsPerAttribute:DD.getNumberOfComponents(l.type),normalize:l.normalized,instanceDivisor:l.instanceDivisor}),h.push(p)}let f;const A=e.indices;return Fi(A)&&(kD.computeNumberOfVertices(e)>=FD.SIXTY_FOUR_KILOBYTES&&n.elementIndexUint?f=Ul.createIndexBuffer({context:n,typedArray:new Uint32Array(A),usage:i,indexDatatype:j1.UNSIGNED_INT}):f=Ul.createIndexBuffer({context:n,typedArray:new Uint16Array(A),usage:i,indexDatatype:j1.UNSIGNED_SHORT})),new MD({context:n,attributes:h,indexBuffer:f})}}function OD(t){let n,e,i;const o=[];for(e in t)t.hasOwnProperty(e)&&Fi(t[e])&&Fi(t[e].values)&&(o.push(e),t[e].componentDatatype===Vn.DOUBLE&&(t[e].componentDatatype=Vn.FLOAT,t[e].values=Vn.createTypedArray(Vn.FLOAT,t[e].values)));let r;const a=o.length;if(a>0)for(r=e_(t[o[0]]),n=1;n<a;++n){const u=e_(t[o[n]]);if(u!==r)throw new BD(`Each attribute list must have the same number of vertices. Attribute ${o[n]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,h){return Vn.getSizeInBytes(t[h].componentDatatype)-Vn.getSizeInBytes(t[u].componentDatatype)});let s=0;const l={};for(n=0;n<a;++n)e=o[n],i=t[e],l[e]=s,s+=UD(i);if(s>0){const u=Vn.getSizeInBytes(t[o[0]].componentDatatype),h=s%u;h!==0&&(s+=u-h);const c=r*s,f=new ArrayBuffer(c),A={};for(n=0;n<a;++n){e=o[n];const d=Vn.getSizeInBytes(t[e].componentDatatype);A[e]={pointer:Vn.createTypedArray(t[e].componentDatatype,f),index:l[e]/d,strideInComponentType:s/d}}for(n=0;n<r;++n)for(let d=0;d<a;++d){e=o[d],i=t[e];const p=i.values,v=A[e],y=v.pointer,g=i.componentsPerAttribute;for(let b=0;b<g;++b)y[v.index+b]=p[n*g+b];v.index+=v.strideInComponentType}return{buffer:f,offsetsInBytes:l,vertexSizeInBytes:s}}}function e_(t){return t.values.length/t.componentsPerAttribute}function UD(t){return Vn.getSizeInBytes(t.componentDatatype)*t.componentsPerAttribute}const{defaultValue:t_}=C;class LD extends C.FrustumCommands{constructor(n,e){super(n,e),this.near=t_(n,0),this.far=t_(e,0);const i=12,o=new Array(i),r=new Array(i);for(let a=0;a<i;++a)o[a]=[],r[a]=0;this.commands=o,this.indices=r}}const{SceneMode:n_,CullingVolume:zD,Interval:QD,Pass:lf,defined:Ll,ShadowMap:ND,Math:VD,ClearCommand:HD}=C,i_=new zD,GD=new QD;function WD(){C.View.prototype.createPotentiallyVisibleSet=function(t){const{frameState:n}=t,{camera:e,commandList:i,shadowState:o}=n,{positionWC:r,directionWC:a,frustum:s}=e,l=t._computeCommandList,u=t._overlayCommandList;t.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});const h=this.frustumCommandsList;for(let B=0;B<h.length;++B)for(let M=0;M<12;++M)h[B].indices[M]=0;l.length=0,u.length=0;const c=this._commandExtents,f=c.length;let A=0,d=+Number.MAX_VALUE,p=-Number.MAX_VALUE;const{shadowsEnabled:v}=o;let y=+Number.MAX_VALUE,g=-Number.MAX_VALUE,b=Number.MAX_VALUE;const w=n.mode===n_.SCENE3D?n.occluder:void 0;let{cullingVolume:E}=n;const T=i_.planes;for(let B=0;B<5;++B)T[B]=E.planes[B];E=i_;for(let B=0;B<i.length;++B){const M=i[B],{pass:S,boundingVolume:k}=M;if(S===lf.COMPUTE)l.push(M);else if(S===lf.OVERLAY)u.push(M);else{let _,x;if(Ll(k)){if(!t.isVisible(E,M,w))continue;const F=k.computePlaneDistances(r,a,GD);if(_=F.start,x=F.stop,d=Math.min(d,_),p=Math.max(p,x),v&&M.receiveShadows&&_<ND.MAXIMUM_DISTANCE&&!(S===lf.GLOBE&&_<-100&&x>100)){const D=x-_;S!==lf.GLOBE&&_<100&&(b=Math.min(b,D)),y=Math.min(y,_),g=Math.max(g,x)}}else M instanceof HD?(_=s.near,x=s.far):(_=s.near,x=s.far,d=Math.min(d,_),p=Math.max(p,x));let O=c[A];Ll(O)||(O=c[A]=new XD),O.command=M,O.near=_,O.far=x,A++}}v&&(y=Math.min(Math.max(y,s.near),s.far),g=Math.max(Math.min(g,s.far),y),o.nearPlane=y,o.farPlane=g,o.closestObjectSize=b),qD(this,t,d,p);for(let B=0;B<A;B++)KD(this,t,c[B]);if(A<f)for(let B=A;B<f;B++){const M=c[B];if(!Ll(M.command))break;M.command=void 0}const P=h.length,{frustumSplits:I}=n;I.length=P+1;for(let B=0;B<P;++B)I[B]=h[B].near,B===P-1&&(I[B+1]=h[B].far)}}function qD(t,n,e,i){const{frameState:o}=n,{camera:r,useLogDepth:a}=o,s=a?n.logarithmicDepthFarToNearRatio:n.farToNearRatio,l=n.mode===n_.SCENE2D,u=n.nearToFarDistance2D;i*=1+VD.EPSILON2,e=Math.min(Math.max(e,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),e);let h;l?(i=Math.min(i,r.position.z+n.nearToFarDistance2D),e=Math.min(e,i),h=Math.ceil(Math.max(1,i-e)/n.nearToFarDistance2D)):h=Math.ceil(Math.log(i/e)/Math.log(s));const{frustumCommandsList:c}=t;c.length=h;for(let f=0;f<h;++f){let A,d;l?(A=Math.min(i-u,e+f*u),d=Math.min(i,A+u)):(A=Math.max(e,Math.pow(s,f)*e),d=Math.min(i,s*A));let p=c[f];Ll(p)?(p.near=A,p.far=d):p=c[f]=new LD(A,d)}}function KD(t,n,e){const{command:i,near:o,far:r}=e;n.debugShowFrustums&&(i.debugOverlappingFrustums=0);const{frustumCommandsList:a}=t;for(let s=0;s<a.length;++s){const l=a[s];if(o>l.far)continue;if(r<l.near)break;const u=i.pass,h=l.indices[u]++;if(l.commands[u][h]=i,n.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<s),i.executeInClosestFrustum)break}if(n.debugShowFrustums){const{debugFrustumStatistics:s}=t,{debugOverlappingFrustums:l}=i,u=s.commandsInFrustums;u[l]=Ll(u[l])?u[l]+1:1,++s.totalCommands}n.updateDerivedCommands(i)}class XD{constructor(){L(this,"command");L(this,"near");L(this,"far")}}ek(),tk(),fk(),nF(),cM(),jM(),oB(),lB(),cB(),gB(),XB(),WD(),RD(),CD(),MI(),BI(),DI(),LI(),zI(),QI(),NI(),FI(),JI(),jI(),C.Camera.DEFAULT_VIEW_RECTANGLE=C.Rectangle.fromDegrees(70,5,140,55);function $D(){return new Promise((t,n)=>C.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class ZD extends m.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Hn(s);if(l&&(l.destroy(),Ep(s,void 0)),C.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(m.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=kI;await s.promise($D());const h=await s.promise(m.createCancelablePromise(u(l,o)));h.scene._xbsjOriginSkyAtmosphere=h.scene.skyAtmosphere,h.scene._xbsjOriginSkyBox=h.scene.skyBox,h.clockViewModel.currentTime=C.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const c=C.JulianDate.fromDate(new Date(e.currentTime));C.JulianDate.equals(c,h.clockViewModel.currentTime)||(h.clockViewModel.currentTime=c)})),this.dispose(Pi(h.clockViewModel,"currentTime",c=>{const f=C.JulianDate.toDate(h.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const c=new l_(h,e);Ep(h,c)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(h)}));a.start(n),a.errorEvent.don(()=>{e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const YD=new C.EllipsoidTerrainProvider;class r_ extends m.Destroyable{constructor(e){super();L(this,"_terrainMap",new Map);L(this,"_nextAnimateFrame",this.dv(m.createNextAnimateFrame()));L(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??YD,i.scene.globe.depthTestAgainstTerrain=this.selectedTerrain?this.selectedTerrain.sceneObject.renderMode!="disableDepthTest":!0,i.scene.globe.translucency.enabled=this.selectedTerrain?this.selectedTerrain.sceneObject.renderMode!="default":!1,i.scene.globe.translucency.frontFaceAlpha=this.selectedTerrain?m.clamp(this.selectedTerrain.sceneObject.opacity,0,1):1,i.scene.globe.translucency.backFaceAlpha=this.selectedTerrain?m.clamp(this.selectedTerrain.sceneObject.opacity,0,1):1}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const i=new m.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(m.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged,e.sceneObject.opacityChanged,e.sceneObject.renderModeChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class o_ extends m.Destroyable{constructor(e){super();L(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof Pt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new m.Destroyable;{const r=o.dv(m.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof Pt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof Pt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,h)=>Number(h[1])-Number(u[1]))).forEach((u,h)=>{h instanceof Pt&&h.czmDivPoi&&(h.czmDivPoi.zOrder=a),h instanceof fr&&h.canvasObj&&(h.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class JD extends m.Destroyable{constructor(e){super();L(this,"_czmImageryLayerWrappers",new Set);L(this,"_zIndexChangedEvent",this.dv(new m.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??N.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??N.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class jD extends m.Destroyable{constructor(e){super();L(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:i}=this,o=i.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class e3 extends m.Destroyable{constructor(e){super();L(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new m.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new jD(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class t3 extends m.Destroyable{constructor(e,i){super();L(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new m.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new e3(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class a_ extends m.Destroyable{constructor(e){super();L(this,"_czmImageryWrappers",new Set);L(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new JD(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new t3(e,this))}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class s_ extends m.Destroyable{constructor(e){super();L(this,"_pause",this.disposeVar(m.react(!1)));L(this,"_pickPositionTasks",[]);L(this,"_pickTasks",[]);L(this,"pickHeightMustGreaterThanZero",!0);L(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[h,c,f,A]=u;try{(async()=>{const{scene:d,camera:p}=i,v=tt(h),y=p.getPickRay(v);do{if(!y)break;let g;if(c?g=await d.pickFromRayMostDetailed(y,this.objectsToExclude):g=d.pickFromRay(y,this.objectsToExclude),!g||!g.position)break;const b=Qe(g.position);if(!b){A(new Error("positionFromCartesian failed"));return}f(b);return}while(!1);if(y&&!(d.terrainProvider instanceof C.EllipsoidTerrainProvider)){const g=d.globe.pick(y,d);if(!g){A(new Error("scene.globe.pick failed"));return}const b=Qe(g);if(!b){A(new Error("positionFromCartesian failed"));return}this.pickHeightMustGreaterThanZero&&b[2]<0&&(b[2]=0),f(b);return}{const g=d.terrainProvider instanceof C.EllipsoidTerrainProvider?d.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,b=i.camera.pickEllipsoid(tt(h),g);if(!b){A(new Error("Pick failed"));return}const w=Qe(b);if(!w){A(new Error("positionFromCartesian failed"));return}f(w)}})()}catch(d){A(d)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[h,c,f,A,d]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,T,P;let p=i.scene.pick(tt(h),c&&c[0],c&&c[1]);!p&&C.defined(i.scene.globe)&&(p=await n3(i,tt(h)));let v;if(p&&p instanceof C.Cesium3DTileFeature){v={};try{p&&p.getPropertyIds().forEach(B=>{v&&(v[B]=p.getProperty(B))})}catch(I){console.warn(I)}}let y;do{if(!p)break;if(p.id&&p.id instanceof C.Entity&&p.id.ESSceneObjectID){y=p.id.ESSceneObjectID;break}if(p.primitive&&p.primitive.ESSceneObjectID){y=p.primitive.ESSceneObjectID;break}}while(!1);const g=y?N.ESSceneObject.getSceneObject(y):void 0;let b={};if(g&&Reflect.has(g,"allowPicking")&&Reflect.has(g,"pickedEvent")&&(g.allowPicking??!1)){do{if(g instanceof N.ESEntityCluster){const I=new C.JulianDate;b=p.id instanceof C.Entity?{name:p.id.label.text.getValue(I),properties:(E=p.id.properties)==null?void 0:E.getValue(I),coordinates:wl(p.id.position.getValue(I))}:(T=p.id)==null?void 0:T.map(B=>{var M;return{name:B.id,properties:(M=B.properties)==null?void 0:M.getValue(I),coordinates:wl(B.position.getValue(I))}});break}if(g instanceof N.ESGeoJson){const I=new C.JulianDate;if(!p.id.entityCollection)return;const B=p.id.polygon?"Polygon":p.id.polyline?"LineString":"Point",M=((P=p.id.properties)==null?void 0:P.getValue(I))??{},S=B=="Point"?Qe(p.id.position.getValue(I)):B=="LineString"?p.id.polyline.positions.getValue(I).map(k=>Qe(k)):zd(p.id.polygon.hierarchy.getValue(I));b=g.pickedInfoType=="FeatureCollection"?{type:"Feature",geometry:{type:B,coordinates:S},properties:M}:{type:B,coordinates:S,properties:M};break}if(g instanceof N.ESGltfModel){let I;Reflect.has(p,"featureId")?I=p.featureId:Reflect.has(p,"instanceId")&&(I=p.instanceId),I&&(p.id=p.primitive.structuralMetadata.getPropertyTable(0).getProperty(p.instanceId,"id"))}}while(!1);g.pickedEvent.emit(new N.ESJPickedResult(p,g,v,b,f,h))}g&&Reflect.has(g,"allowPicking")&&!g.allowPicking&&A(new N.ESJPickedResult);const w=new N.ESJPickedResult(p,g,v,b,f,h);A(w)})()}catch(p){d(p)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function n3(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(C.defined(o))return o}class i3 extends m.Destroyable{constructor(e){super();L(this,"_enabled",this.disposeVar(m.react(!1)));L(this,"_cursorPosition",m.react(void 0));L(this,"quickPickPosition",!0);let i=new m.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Hn(e);if(!a)return;i=new m.Destroyable;const s=i.disposeVar(m.react(void 0)),l=i.disposeVar(m.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(h=>{h.pointerEvent&&(s.value=m.getDomEventCurrentTargetPos(h.pointerEvent))}));const u=i.disposeVar(m.createProcessingFromAsyncFunc(async h=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const c=await h.promise(m.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=c}else{const c=await h.promise(m.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=c}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function Hn(t){return m.getExtProp(t,"_viewerExtensions")}function Ep(t,n){m.setExtProp(t,"_viewerExtensions",n)}class l_ extends m.Destroyable{constructor(e,i){super();L(this,"_imageriesManager");L(this,"_terrainManager");L(this,"_labelManager");L(this,"_pickingManager");L(this,"_poiContext");L(this,"_cursorPositionInfo");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new a_(this.viewer)),this._terrainManager=this.dv(new r_(this.viewer)),this._labelManager=this.dv(new o_(this.viewer)),this._poiContext=this.disposeVar(new I_(this._viewer)),this._cursorPositionInfo=this.disposeVar(new i3(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new s_(i))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}}var u_=new C.Cartesian3,c_=new C.Cartesian3;function h_(t,n,e){let i=C.Matrix4.clone(t.transform);t.lookAtTransform(C.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=C.Cartesian3.normalize(r,u_),s=C.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=C.Cartesian3.cross(t.direction,a,c_);else var l=C.Cartesian3.cross(t.up,a,c_);var u=l;if(e){var h=C.Cartesian3.cross(a,l,u_);u=h}var c=C.Cartesian3.magnitude(r);t.rotate(u,n/c);var f=t.positionCartographic,A=f.longitude,d=f.latitude;C.Cartesian3.fromRadians(A,d,o,void 0,t.position),t.lookAtTransform(i)}function f_(t,n){h_(t,n,!1)}function A_(t,n){h_(t,-n,!0)}class r3 extends m.Destroyable{constructor(e){super();L(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),h=u-s;s=u;const c=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(h*c),a.MoveBackword&&r.moveBackward(h*c),a.MoveLeft&&r.moveLeft(h*c),a.MoveRight&&r.moveRight(h*c)):(a.MoveForward&&f_(r,h*c),a.MoveBackword&&f_(r,-h*c),a.MoveLeft&&A_(r,-h*c),a.MoveRight&&A_(r,h*c));{const{rotateSpeed:f}=this.controller,A=C.Math.toRadians(f*h);a.RotateRight?r.lookRight(A):a.RotateLeft?r.lookRight(-A):a.RotateUp?r.lookDown(-A):a.RotateDown&&r.lookDown(A)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class uf extends m.Destroyable{constructor(e){super();L(this,"_currentKeyIds",new Set);L(this,"_currentKeyIdsChanged",this.dv(new m.Event));L(this,"_debug",this.dv(m.react(!1)));L(this,"_debugResetting",this.dv(new m.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends m.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
|
|
739
739
|
`))};i(),this.d(e.currentKeyIdsChanged.don(i))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:i}=this._keyboardCameraControllerRunning;{const o=r=>{const a=uf.getKeyId(r);this._currentKeyIds.has(a)||(this._currentKeyIds.add(a),this._currentKeyIdsChanged.emit())};this.d(i.keyDownEvent.don(o))}{const o=r=>{const a=uf.getKeyId(r);this._currentKeyIds.has(a)&&(this._currentKeyIds.delete(a),this._currentKeyIdsChanged.emit())};this.d(i.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(i.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class o3 extends m.Destroyable{constructor(e){super();L(this,"_keyStatus");L(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new uf(this)),this._cameraOp=this.dv(new r3(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const yd=class yd extends m.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(m.react(!1)));L(this,"_keyStatusMap",this.dv(m.react(yd.defaultKeyStatusMap)));L(this,"_speed",this.dv(m.react(1)));L(this,"_rotateSpeed",this.dv(m.react(.01)));L(this,"_alwaysWithCamera",this.dv(m.react(!1)));L(this,"_keyDownEvent",this.dv(new m.Event));L(this,"_keyUpEvent",this.dv(new m.Event));L(this,"_abortEvent",this.dv(new m.Event));this._firstPersonController=e,this.dv(new m.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new o3(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};L(yd,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let cf=yd;function a3(t,n){t.lookRight(C.Math.toRadians(n.movementX)*.1),t.lookDown(C.Math.toRadians(n.movementY)*.1);const e=t.pitch,i=C.Math.clamp(e,-C.Math.PI_OVER_TWO,C.Math.PI_OVER_TWO);i!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:i,roll:t.roll}})}class s3 extends m.Destroyable{constructor(n,e){super(),this._firstPersonController=n,this._mouseCameraController=e;const{canvas:i}=this._firstPersonController.viewer;{const o=r=>{const{camera:a}=this._firstPersonController.viewer.scene;a3(a,r)};i.addEventListener("pointermove",o),this.dispose(()=>i.removeEventListener("pointermove",o))}}}const vd=class vd extends m.Destroyable{constructor(e){super();L(this,"_mouseMoving",this.dv(new s3(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:i}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=vd.origin_setPointerCapture);const o=i.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const r=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",r,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",r,!1))}{const r=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",r)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};L(vd,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Pp=vd;class l3 extends m.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(m.react(!1)));L(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});L(this,"_mouseResetting",this.dv(new m.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Pp(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class u3 extends m.Destroyable{constructor(e){super();L(this,"viewer");L(this,"_mouseCameraController",this.dv(new l3(this)));L(this,"_keyboardCameraController",this.dv(new cf(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function d_(t){t.removeInputAction(C.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(C.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(C.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(C.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(C.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(C.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(C.ScreenSpaceEventType.MIDDLE_UP)}function Tp(t,n,e,i=void 0){const r=t.camera,a=new C.Cartesian2;a.x=n.startPosition.x,a.y=0;const s=new C.Cartesian2;s.x=n.endPosition.x,s.y=0;let l=r.getPickRay(a,new C.Ray),u=r.getPickRay(s,new C.Ray),h=0,c,f;if(!l||!u)return;r.frustum instanceof C.OrthographicFrustum?(c=l.origin,f=u.origin,C.Cartesian3.add(r.direction,c,c),C.Cartesian3.add(r.direction,f,f),C.Cartesian3.subtract(c,r.position,c),C.Cartesian3.subtract(f,r.position,f),C.Cartesian3.normalize(c,c),C.Cartesian3.normalize(f,f)):(c=l.direction,f=u.direction);let A=C.Cartesian3.dot(c,f);A<1&&(h=Math.acos(A)),h=n.startPosition.x>n.endPosition.x?h:-h;const d=e._horizontalRotationAxis;if(C.defined(i)?r.look(i,-h):C.defined(d)?r.look(d,-h):r.lookLeft(h),a.x=0,a.y=n.startPosition.y,s.x=0,s.y=n.endPosition.y,l=r.getPickRay(a,new C.Ray),u=r.getPickRay(s,new C.Ray),h=0,!(!l||!u))if(r.frustum instanceof C.OrthographicFrustum?(c=l.origin,f=u.origin,C.Cartesian3.add(r.direction,c,c),C.Cartesian3.add(r.direction,f,f),C.Cartesian3.subtract(c,r.position,c),C.Cartesian3.subtract(f,r.position,f),C.Cartesian3.normalize(c,c),C.Cartesian3.normalize(f,f)):(c=l.direction,f=u.direction),A=C.Cartesian3.dot(c,f),A<1&&(h=Math.acos(A)),h=n.startPosition.y>n.endPosition.y?h:-h,i=C.defaultValue(i,d),C.defined(i)){const p=r.direction,v=C.Cartesian3.negate(i,new C.Cartesian3),y=C.Cartesian3.equalsEpsilon(p,i,C.Math.EPSILON2),g=C.Cartesian3.equalsEpsilon(p,v,C.Math.EPSILON2);if(!y&&!g){A=C.Cartesian3.dot(p,i);let b=C.Math.acosClamped(A);h>0&&h>b&&(h=b-C.Math.EPSILON4),A=C.Cartesian3.dot(p,v),b=C.Math.acosClamped(A),h<0&&-h>b&&(h=-b+C.Math.EPSILON4);const w=C.Cartesian3.cross(i,p,new C.Cartesian3);r.look(w,h)}else(y&&h<0||g&&h>0)&&r.look(r.right,-h)}else r.lookUp(h)}class c3 extends m.Destroyable{constructor(n,e){super();const i=e.viewer;if(!i)throw new Error("viewer is undefined");let o=!0;this.d(n.positionChanged.don(()=>o=!0)),this.d(n.rotationChanged.don(()=>o=!0)),this.d(n.offsetHeightChanged.don(()=>o=!0)),this.d(n.viewDistanceChanged.don(()=>o=!0)),this.d(n.offsetRotationChanged.don(()=>o=!0)),this.d(n.relativeRotationChanged.don(()=>o=!0));const r=[0,0,0],a=[0,0,0];this.d(i.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!n.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(n.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const c=Et(n.position),f=i.camera.positionWC,A=C.Cartesian3.distance(c,f);n.viewDistance=A}m.Vector.clone(n.position,a),n.offsetHeight&&(a[2]+=n.offsetHeight);const{rotation:s,offsetRotation:l=Mi.defaults.offsetRotation}=n,u=[...l];m.Vector.set(r,0,0,0),s&&(n.relativeRotation??Mi.defaults.relativeRotation)&&(m.Vector.add(s,r,r),u[0]+=90),m.Vector.add(u,r,r);const h={distance:n.viewDistance,heading:r[0],pitch:r[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(h,a)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(s=>{const l=s==null?void 0:s.pointerEvent;if(l&&n.enabledRotationInput&&(l.buttons===1||l.buttons===2)){const{movementX:u,movementY:h}=l;n.offsetRotation=m.Vector.add(n.offsetRotation??Mi.defaults.offsetRotation,[u*.2,h*-.2,0])}})),this.d(e.wheelEvent.don(s=>{if(!n.enabledScaleInput)return;const l=s.deltaY,h=Math.max(1,n.viewDistance)*(l*.001);n.viewDistance=n.viewDistance+h}))}}class Mi extends m.Destroyable{constructor(e){super();L(this,"_resetWithCameraEvent",this.dv(new m.Event));const i=e.viewer;if(!i)throw new Error("viewer is undefined");const o=this;let r;const a=()=>{r&&(r.destroy(),r=void 0)};this.d(a);const s=()=>{a(),o.enabled&&(r=new c3(o,e))};s(),this.d(o.enabledChanged.don(s)),this.d(o.resetWithCameraEvent.don(l=>{if(!e.actived)return;const u=Va(i.camera);if(!u)return;const h=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?h[0]:90),u[1]-(o.relativeRotation?h[1]:0),u[2]-(o.relativeRotation?h[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}L(Mi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:m.reactArrayWithUndefined(void 0),rotation:m.reactArrayWithUndefined(void 0),positionEditing:!1,rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:m.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(Mi||(Mi={})),m.extendClassProps(Mi.prototype,Mi.createDefaultProps);class zl extends m.Destroyable{constructor(e){super();L(this,"_geoCameraController");L(this,"_geoPolylinePath");this._geoCameraController=this.dv(new Mi(e)),this._geoPolylinePath=this.dv(new Ns(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const i=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};i(),this.d(this._geoPolylinePath.currentPositionChanged.don(i)),this.d(this._geoPolylinePath.currentRotationChanged.don(i)),this.dispose(m.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(m.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(m.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(m.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(m.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(m.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new m.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new h3(this,e);if(this.lineMode==="manual")return new f3(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:m.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(zl||(zl={})),m.extendClassProps(zl.prototype,zl.createDefaultProps);class h3 extends m.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");n.offsetRotation=[-90,0,0]}}class f3 extends m.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=r=>{(r.key==="w"||r.key==="s")&&(n.polylinePath.playing=r.type==="keydown",n.polylinePath.speed=r.key==="w"||r.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class A3 extends m.Destroyable{constructor(n,e){super();const i=e.positionPropertyName??"position",o=e.positionChangedPropertyName??i+"Changed",r=e.rotationPropertyName??"rotation",a=e.rotationChangedPropertyName??r+"Changed",s=(e.positionTracking??!0)&&Reflect.has(n,i)&&Reflect.has(n,o),l=(e.rotationTracking??!0)&&Reflect.has(n,r)&&Reflect.has(n,a);if(!(!s&&!l)){if(s){const u=()=>{e.geoCameraController.position=n[i]};u();const h=n[o];this.d(h.don(u))}if(l){const u=()=>{e.geoCameraController.rotation=n[r]};u();const h=n[o];this.d(h.don(u))}}}}class d3 extends m.Destroyable{constructor(n,e){super();const i=this.dv(new N.ESSceneObjectWithId);i.id=n;const o=this.dv(m.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,i.sceneObjectChanged));this.disposeVar(new m.ObjResettingWithEvent(o,()=>{const{sceneObject:r}=i;if(!(!e.enabled||!r))return new A3(r,e)}))}}class Ql extends m.Destroyable{constructor(e){super();L(this,"_geoCameraController");this._geoCameraController=this.dv(new Mi(e)),this.d(m.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new m.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new d3(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(Ql||(Ql={})),m.extendClassProps(Ql.prototype,Ql.createDefaultProps);class p3 extends m.Destroyable{constructor(e){super();L(this,"height",1e7);L(this,"cycle",60);L(this,"latitude",6.632251044444445);L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");L(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new C.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},C.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,i=e.positionCartographic;e.flyTo({destination:C.Cartesian3.fromRadians(i.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*C.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((r,a)=>{if(!o){o=new Date().getTime();return}const s=(new Date().getTime()-o)/1e3,l=e.positionCartographic.longitude+s*C.Math.PI*2/this.cycle;e.setView({destination:C.Cartesian3.fromRadians(l,this.latitude,this.height),orientation:{heading:0,pitch:-.5*C.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class m3 extends m.Destroyable{constructor(e){super();L(this,"_height",this.dv(m.react(1e7)));L(this,"_cycle",this.dv(m.react(60)));L(this,"_latitude",this.dv(m.react(38)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("未初始化viewer");this._inner=this.dv(new p3(i)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class g3 extends m.Destroyable{constructor(e){super();L(this,"_position",this.dv(m.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(m.react(5e4)));L(this,"_cycle",this.dv(m.react(60)));L(this,"_heading",this.dv(m.react(0)));L(this,"_pitch",this.dv(m.react(-30)));L(this,"_transform");L(this,"_headingRadius");L(this,"_pitchRadius");L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");this._viewer=e;const i=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new C.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const r=()=>{let a;if(this.position==null){var s=o.getPickRay(new C.Cartesian2(i.canvas.width*.5,i.canvas.height*.5));if(!s)return;a=i.globe.pick(s,i)}else a=C.Cartesian3.fromDegrees(...this.position);a&&(this._transform=C.Transforms.eastNorthUpToFixedFrame(a),this.start())};r(),this.d(this.positionChanged.don(r))}{const r=()=>{this._headingRadius=C.Math.toRadians(this.heading)};r(),this.d(this.headingChanged.don(r))}{const r=()=>{this._pitchRadius=C.Math.toRadians(this.pitch)};r(),this.d(this.pitchChanged.don(r))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var i=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),r=new C.Cartesian3(0,i,o);e.flyTo({destination:C.Matrix4.multiplyByPoint(this._transform,r,new C.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let a;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,l)=>{if(!a){a=new Date().getTime();return}const u=(new Date().getTime()-a)/1e3;this._headingRadius+=u*C.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new C.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),a=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(C.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class y3 extends m.Destroyable{constructor(e){super();L(this,"_position",this.dv(m.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(m.react(5e4)));L(this,"_cycle",this.dv(m.react(60)));L(this,"_heading",this.dv(m.react(0)));L(this,"_pitch",this.dv(m.react(-30)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("viewer is undefined");this._inner=this.dv(new g3(i));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class v3 extends m.Destroyable{constructor(e){super();L(this,"_firstPersonController");L(this,"_rotateGlobe");L(this,"_rotatePoint");L(this,"_followController");L(this,"_pathCameraController");L(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new u3(e)),this.d(this._viewer.keyDownEvent.don(i=>this._firstPersonController.keyboardCameraController.keyDown(i))),this.d(this._viewer.keyUpEvent.don(i=>this._firstPersonController.keyboardCameraController.keyUp(i)));{const{subContainer:i}=this._viewer;if(!i)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();i.addEventListener("blur",o,!1),this.d(()=>i.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=1,this._firstPersonController.keyboardCameraController.rotateSpeed=.01,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=cf.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var i;(i=this._viewer.subContainer)==null||i.focus()}))}this._rotateGlobe=this.dv(new m3(e)),this._rotatePoint=this.dv(new y3(e)),this._followController=this.dv(new Ql(e)),this._pathCameraController=this.dv(new zl(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,i=4.2){this.resetNavigation(),this._changedMouseEvent("Walk");const o=this._viewer.getCameraInfo(),r=[(o==null?void 0:o.rotation[0])??0,0,0];this._viewer.flyIn(e,r),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}}changeToRotateGlobe(e=38,i=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=i,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,i=5e4,o=60,r=0,a=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=i,this._rotatePoint.cycle=o,this._rotatePoint.heading=r,this._rotatePoint.pitch=a,this._rotatePoint.start()}changeToFollow(e,i=0,o=0,r=-30,a=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,r,0],this._followController.geoCameraController.relativeRotation=a,i!==0?this._followController.geoCameraController.viewDistance=i:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,i=10,o=10,r=!0,a=10,s="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const l=s==="auto",u=N.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:h}=u;if(!h)return;const c=N.getDistancesFromPositions(h,"NONE"),f=c[c.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...h],this._pathCameraController.polylinePath.duration=f/i*1e3,this._pathCameraController.polylinePath.loop=r,this._pathCameraController.offsetHeight=o;const A=Fw(h);this._pathCameraController.polylinePath.rotationRadius=!l||A==!1?[0]:A.map(d=>d/a*i),this._pathCameraController.enabledRotationInput=!l,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=l,this._pathCameraController.lineMode=s,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const i=this._viewer.viewer;if(!i)return;this._handler||(this._handler=new C.ScreenSpaceEventHandler(i.scene.canvas));const o=this._handler,r=i.scene.screenSpaceCameraController;this.d(()=>{o&&d_(o)}),e=="Walk"||e=="RotateGlobe"?(r.lookEventTypes=void 0,r.rotateEventTypes=void 0,r.tiltEventTypes=void 0,r.zoomEventTypes=void 0,r.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(a=>{o.setInputAction(s=>{Tp(i.scene,s,r)},C.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(C.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(C.ScreenSpaceEventType.LEFT_UP)},C.ScreenSpaceEventType.LEFT_UP)},C.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Tp(i.scene,s,r)},C.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(C.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(C.ScreenSpaceEventType.RIGHT_UP)},C.ScreenSpaceEventType.RIGHT_UP)},C.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Tp(i.scene,s,r)},C.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(C.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(C.ScreenSpaceEventType.MIDDLE_UP)},C.ScreenSpaceEventType.MIDDLE_UP)},C.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&d_(o),r.lookEventTypes=C.CameraEventType.RIGHT_DRAG,r.rotateEventTypes=C.CameraEventType.LEFT_DRAG,r.tiltEventTypes=[C.CameraEventType.MIDDLE_DRAG,C.CameraEventType.PINCH,{eventType:C.CameraEventType.LEFT_DRAG,modifier:C.KeyboardEventModifier.CTRL},{eventType:C.CameraEventType.RIGHT_DRAG,modifier:C.KeyboardEventModifier.CTRL}],r.translateEventTypes=C.CameraEventType.LEFT_DRAG,r.zoomEventTypes=[C.CameraEventType.WHEEL,C.CameraEventType.PINCH,{eventType:C.CameraEventType.RIGHT_DRAG,modifier:C.KeyboardEventModifier.SHIFT}])}}const w3=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class _3 extends m.Destroyable{constructor(e){super();L(this,"_show",this.dv(m.react(!1)));L(this,"cloudsPostProcess");const i=e.viewer;if(!i)throw new Error("Cesium Viewer is not initialized");const o=new C.CloudCollection;i.scene.primitives.add(o),this.dispose(()=>i.scene.primitives.remove(o));{const r=()=>{o.show=this.show};r(),this.dispose(this.showChanged.disposableOn(r))}{const r=s=>({slice:s.slice,brightness:s.brightness,scale:tt(s.scale),maximumSize:Si(s.maximumSize),color:Be(s.color),position:Et(s.position)});(()=>{o.removeAll();for(let s of w3)o.add(r(s))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class Nl extends m.Destroyable{constructor(n){super();const e=n.viewer;if(!e){console.warn("viewer is undefined!");return}const i=e.scene.postProcessStages.add(C.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(i));{const o=()=>{i.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{i.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{i.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{i.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{i.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(Nl||(Nl={})),m.extendClassProps(Nl.prototype,Nl.createDefaultProps);const b3=`
|
|
740
740
|
float getDistance(sampler2D depthTexture, vec2 texCoords)
|
|
741
741
|
{
|
|
@@ -3324,7 +3324,7 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
|
|
|
3324
3324
|
//material.diffuse = vec3(0.0, 0.0, 1.0);
|
|
3325
3325
|
//material.diffuse.g = -fsInput.attributes.positionEC.z / 1.0e4;
|
|
3326
3326
|
}
|
|
3327
|
-
`});this._customShader=o}update(){alert("暂未实现!")}get customShader(){return this._customShader}}const WN=(t,n)=>{if(!t)return;const e=6378137*Math.PI/180,[i,o,r]=t,s=1/(e*Math.cos(o*Math.PI/180));return[n[0]/s,n[1]/s,n[2]]},qN=(t,n)=>{const e=6378137*Math.PI/180,[i,o,r]=t,a=n,l=1/(e*Math.cos(o*Math.PI/180));return[i+l*a[0],o+l*a[1],r+a[2]]};function ZA(t){return`rgba(${t[0]*255},${t[1]*255},${t[2]*255},${t[3]})`}function KN(t,n){const e=Reflect.has(t,"value"),i=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const r=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${n}} === `+r,ZA(t.rgba)];if(i&&o)return[`\${${n}} >= ${t.minValue} && \${${n}} <= ${t.maxValue}`,ZA(t.rgba)];if(i)return[`\${${n}} >= ${t.minValue}`,ZA(t.rgba)];if(o)return[`\${${n}} <= ${t.maxValue}`,ZA(t.rgba)];if(!e&&!i&&!o)throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在!`)}catch(r){throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在! ${r}`)}}function XN(t,n){const e=Reflect.has(t,"value"),i=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const r=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${n}} === `+r,t.visable.toString()];if(i&&o)return[`\${${n}} >= ${t.minValue} && \${${n}} <= ${t.maxValue}`,t.visable.toString()];if(i)return[`\${${n}} >= ${t.minValue}`,t.visable.toString()];if(o)return[`\${${n}} <= ${t.maxValue}`,t.visable.toString()];if(!e&&!i&&!o)throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在!`)}catch(r){throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在! ${r}`)}}const ju=class ju extends Zn{constructor(e,i){super(e,i);L(this,"_czm3DTiles");L(this,"_clippingPlanes");L(this,"_flattenedPlane");L(this,"_styleColor",this.dv(m.react(void 0)));L(this,"_highlightStyleColor",this.dv(m.react(void 0)));L(this,"_styleVisable",this.dv(m.react(void 0)));this._flattenedPlane=this.dv(new _o(i,e.id)),this._czm3DTiles=this.dv(new nt(i,this,e.id)),this._clippingPlanes=this.dv(new Vs(i,e.id));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._czm3DTiles;this.ad(e.setMaterialEvent.don(l=>{r.setMaterial(l)}));{const l=()=>{r.origin&&(e.offset||(e.offset=[0,0,0]),r.position=qN(r.origin,e.offset))};l(),this.d(e.offsetChanged.don(l)),this.d(r.originChanged.don(l))}{const l=()=>{if(!r.position)return;const h=r.position.map((c,f)=>{if(r.origin)return c-r.origin[f]});r.origin&&(e.offset=WN(r.origin,h))};l();const u=this.ad(m.createNextAnimateFrameEvent(r.positionChanged));this.d(u.don(l))}const a=this._clippingPlanes,s=this._flattenedPlane;this.d(e.setFeatureColorEvent.don((l,u)=>{const c=u.reverse().map(f=>KN(f,l));this.setFeatureColor(c)})),this.d(e.setFeatureVisableEvent.don((l,u)=>{const c=u.reverse().map(f=>XN(f,l));this.setFeatureVisable(c)})),this.d(e.resetFeatureStyleEvent.don(()=>{this.resetFeatureStyle()})),this.d(e.highlightFeatureEvent.don((l,u)=>{this.highlightFeature(l,u)})),this.d(e.highlightFeatureAndFlyToEvent.don((l,u,h,c)=>{h&&this.highlightFeature(l,h);const f=new C.Cartesian3(u[0],u[1],u[2]),A=new C.BoundingSphere(f,u[3]);o.camera.flyToBoundingSphere(A,{duration:c??1})})),this.d(r.czmTilesetReadyEvent.don(l=>{const u=h=>{if(l.style=void 0,h.length===0)return;const c=[...h],f=[],A=[];let d;c.forEach(p=>{Array.isArray(p.condition)?(f.push({condition:p.condition,color:p.color??[1,1,1,1]}),A.push({condition:p.condition,show:p.show??!0})):(f.push({condition:[p.condition],color:p.color??[1,1,1,1]}),A.push({condition:[p.condition],show:p.show??!0}))});{const p=(y,g)=>{try{let b;return f.forEach(w=>{if(b===void 0){const E=QN(w,y);E.length>0&&!E.includes(!1)&&(b=UN(w.color,g))}}),b||C.Color.clone(C.Color.WHITE,g)}catch{return C.Color.clone(C.Color.WHITE,g)}},v=y=>{try{let g;return A.forEach(b=>{if(g===void 0){const w=NN(b,y);w.length>0&&!w.includes(!1)&&(g=b.show)}}),g!==void 0?g:!0}catch{return!0}};d=new C.Cesium3DTileStyle({color:{evaluateColor:function(y,g){return p(y,g)}},show:{evaluate:function(y){return v(y)}}})}l.style=d};this.d(e.setFeatureStyleEvent.don(h=>{u(h)})),this.d(e.resetFeatureStyleEvent.don(()=>{l.style=void 0}));{const h=this,c=[],f=l.tileLoad.addEventListener(function(d){try{const v=d.content.getFeature(0),g=v.getPropertyIds().map(E=>{const T=v.getProperty(E);return{key:E,type:typeof T}}),b=c.map(E=>E.key),w=g.filter(E=>!b.includes(E.key));c.push(...w)}catch{}});this.d(()=>{f()});const A=async()=>{try{c.length>0?e._featureTableResultEvent.emit(c):e._featureTableResultEvent.emit(void 0)}catch(d){console.warn(`CzmES3DTileset GetFeatureTable: ${d}`),e._featureTableResultEvent.emit(void 0)}};h.d(e.getFeatureTableEvent.don(()=>{A()}))}{const h=c=>{r.tileset.featureIdLabel=`featureId_${c}`};this.ad(e.featureIdLabelChanged.don(c=>{h(c)}))}})),this.d(r.czmTilesetReadyEvent.don((l,u)=>{e.supportEdit=r.supportEdit,e.tilesetReady.emit(l)})),r.absoluteClippingPlanes=!0,r.czmFlattenedPlaneId=this.flattenedPlane.id,e.flattenedPlaneId=this.flattenedPlane.id,r.clippingPlanesId=this.clippingPlanes.id,this.d(m.track([s,"enabled"],[e,"flattenedPlaneEnabled"])),this.d(m.track([a,"enabled"],[e,"clippingPlaneEnabled"])),this.d(m.track([a,"planeIds"],[e,"clippingPlaneIds"])),this.d(m.track([a,"unionClippingRegions"],[e,"unionClippingRegions"])),this.d(m.track([a,"edgeColor"],[e,"clippingPlaneEdgeColor"])),this.d(m.track([a,"edgeWidth"],[e,"clippingPlaneEdgeWidth"])),this.d(e.clippingPlaneIdChanged.don(()=>{r.clippingPlanesId=e.clippingPlaneId})),this.d(e.excavateIdChanged.don(()=>{r.clippingPolygonsId=e.excavateId}));{const l=()=>{typeof e.url=="string"?e.url=N.ESSceneObject.context.getStrFromEnv(e.url):e.url&&(e.url.url=N.ESSceneObject.context.getStrFromEnv(e.url.url)),r.url=e.url};l(),this.d(e.urlChanged.don(l))}this.d(m.track([r,"show"],[e,"show"])),this.d(m.track([r,"colorBlendMode"],[e,"colorBlendMode"])),this.d(m.track([r,"cacheBytes"],[e,"cacheBytes"])),this.d(m.track([r,"maximumCacheOverflowBytes"],[e,"cacheBytes"])),this.d(m.track([r,"allowPicking"],[e,"allowPicking"])),this.d(m.bind([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(m.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"])),this.d(m.track([r,"maximumScreenSpaceError"],[e,"maximumScreenSpaceError"])),this.d(m.track([r,"maximumMemoryUsage"],[e,"czmMaximumMemoryUsage"])),this.d(m.track([r,"classificationType"],[e,"czmClassificationType"])),this.d(m.track([r,"styleJson"],[e,"czmStyleJson"])),this.d(m.bind([r,"rotation"],[e,"rotation"])),this.d(m.track([r,"backFaceCulling"],[e,"czmBackFaceCulling"])),this.d(m.track([r,"debugShowBoundingVolume"],[e,"czmDebugShowBoundingVolume"])),this.d(m.track([r,"debugShowContentBoundingVolume"],[e,"czmDebugShowContentBoundingVolume"])),this.d(m.track([r,"skipLevelOfDetail"],[e,"czmSkipLevelOfDetail"]));{const l=u=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:u}:{atmosphereScatteringIntensity:u}};l(e.czmAtmosphereScatteringIntensity),l(e.czmLuminanceAtZenith),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(u=>l(u))),this.ad(e.czmLuminanceAtZenithChanged.don(u=>l(u)))}{const l=()=>{var u,h;(u=e.czmEnvironmentMapManager)!=null&&u.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=e.czmLuminanceAtZenith=(h=e.czmEnvironmentMapManager)==null?void 0:h.atmosphereScatteringIntensity)};l(),this.ad(e.czmEnvironmentMapManagerChanged.don(l))}{const l=()=>{const u=e.materialMode??N.ES3DTileset.defaults.materialMode;CS=e.materialParams.baseColor??[1,1,1],u==="normal"?r.customShaderInstanceClass=void 0:u==="technology"&&(r.customShaderInstanceClass=void 0,r.customShaderInstanceClass=GN)};this.d(e.materialModeChanged.don(u=>{l()})),this.d(e.materialParamsChanged.don(()=>{l()})),l()}}get czm3DTiles(){return this._czm3DTiles}get clippingPlanes(){return this._clippingPlanes}get flattenedPlane(){return this._flattenedPlane}get styleColor(){return this._styleColor.value}set styleColor(e){this._styleColor.value=e}get highlightStyleColor(){return this._highlightStyleColor.value}set highlightStyleColor(e){this._highlightStyleColor.value=e}get styleVisable(){return this._styleVisable.value}set styleVisable(e){this._styleVisable.value=e}highlightFeature(e,i){const o=i??"rgba(255,0,0,1)",s=["${id} === "+(typeof e=="string"?`'${e}'`:e),o];let l={};const u=this.styleColor?[s,...this.styleColor]:[s];this.styleVisable?l={show:{conditions:[...this.styleVisable]},color:{conditions:[...u]}}:l={color:{conditions:[...u]}},console.log("style",l),this._czm3DTiles.styleJson=l,this.highlightStyleColor=[...s]}setFeatureColor(e){const i=this.highlightStyleColor,o=this.styleColor?[...e,...this.styleColor]:[...e];let r={};this.styleVisable?i?r={show:{conditions:[...this.styleVisable]},color:{conditions:[...o,i]}}:r={show:{conditions:[...this.styleVisable]},color:{conditions:[...o]}}:i?r={color:{conditions:[...o,i]}}:r={color:{conditions:[...o]}},console.log("style",r),this._czm3DTiles.styleJson=r,this.styleColor=[...o]}setFeatureVisable(e){let i={};const o=this.highlightStyleColor,r=this.styleVisable?[...e,...this.styleVisable]:[...e];this.styleColor?o?i={show:{conditions:[...r]},color:{conditions:[o,...this.styleColor]}}:i={show:{conditions:[...r]},color:{conditions:[...this.styleColor]}}:o?i={show:{conditions:[...r]},color:{conditions:[o]}}:i={show:{conditions:[...r]}},console.log("style",i),this._czm3DTiles.styleJson=i,this.styleVisable=[...r]}resetFeatureStyle(){this.czm3DTiles.styleJson=void 0,this.styleColor=void 0,this.highlightStyleColor=void 0,this.styleVisable=void 0}flyTo(e,i){const{sceneObject:o,czmViewer:r,czm3DTiles:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czm3DTiles:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(ju,"type",ju.register("ESCesiumViewer",N.ES3DTileset.type,ju));let Hs=ju;const ec=class ec extends $e{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");if(!i.viewer){console.warn("viewer is undefined!");return}const r=N.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_b.glb"),a=N.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_a.glb");this._czmModelPrimitive=this.disposeVar(new jt(this.czmViewer,this.sceneObject.id));const s=this._czmModelPrimitive;this.ad(m.bind([s,"position"],[e,"position"])),this.ad(Vt([s,"rotation"],[e,"rotation"])),this.ad(m.track([s,"show"],[e,"show"])),s.activeAnimationsAnimateWhilePaused=!0,s.activeAnimationsJson=N.ESAlarm.defaults.czmAnimations;{const l=this.dv(m.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),u=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};u(),this.d(l.don(u))}{const l=()=>{const u=e.mode;u==="circle"?s.url=r:(u==="cylinder"||u===void 0)&&(s.url=a)};l(),this.dispose(e.modeChanged.disposableOn(()=>{l()}))}{const l=()=>{const h=e.radius??N.ESAlarm.defaults.radius;s.scale=[h*e.scale[0],h*e.scale[1],h*e.scale[2]]};l();const u=this.dv(m.createNextAnimateFrameEvent(e.radiusChanged,e.scaleChanged));this.dispose(u.disposableOn(()=>{l()}))}}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:a}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,i):(a&&Pn(r,o,i,e,a,!0),!0)}};L(ec,"type",ec.register("ESCesiumViewer",N.ESAlarm.type,ec));let Og=ec;const tc=class tc extends $e{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new At(i,this.sceneObject.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmCustomPrimitive:r}=this;this.dispose(m.track([r,"show"],[e,"show"])),this.dispose(m.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(Vt([r,"rotation"],[e,"rotation"])),this.dispose(m.bind([r,"position"],[e,"position"])),this.dispose(m.track([r,"scale"],[e,"scale"])),r.indexTypedArray=new Uint16Array([0,1,2,0,2,3]),r.uniformMap={u_color:[0,.7,1,1]},r.fragmentShaderSource=`
|
|
3327
|
+
`});this._customShader=o}update(){alert("暂未实现!")}get customShader(){return this._customShader}}const WN=(t,n)=>{if(!t)return;const e=6378137*Math.PI/180,[i,o,r]=t,s=1/(e*Math.cos(o*Math.PI/180));return[n[0]/s,n[1]/s,n[2]]},qN=(t,n)=>{const e=6378137*Math.PI/180,[i,o,r]=t,a=n,l=1/(e*Math.cos(o*Math.PI/180));return[i+l*a[0],o+l*a[1],r+a[2]]};function ZA(t){return`rgba(${t[0]*255},${t[1]*255},${t[2]*255},${t[3]})`}function KN(t,n){const e=Reflect.has(t,"value"),i=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const r=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${n}} === `+r,ZA(t.rgba)];if(i&&o)return[`\${${n}} >= ${t.minValue} && \${${n}} <= ${t.maxValue}`,ZA(t.rgba)];if(i)return[`\${${n}} >= ${t.minValue}`,ZA(t.rgba)];if(o)return[`\${${n}} <= ${t.maxValue}`,ZA(t.rgba)];if(!e&&!i&&!o)throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在!`)}catch(r){throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在! ${r}`)}}function XN(t,n){const e=Reflect.has(t,"value"),i=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const r=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${n}} === `+r,t.visable.toString()];if(i&&o)return[`\${${n}} >= ${t.minValue} && \${${n}} <= ${t.maxValue}`,t.visable.toString()];if(i)return[`\${${n}} >= ${t.minValue}`,t.visable.toString()];if(o)return[`\${${n}} <= ${t.maxValue}`,t.visable.toString()];if(!e&&!i&&!o)throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在!`)}catch(r){throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在! ${r}`)}}const ju=class ju extends Zn{constructor(e,i){super(e,i);L(this,"_czm3DTiles");L(this,"_clippingPlanes");L(this,"_flattenedPlane");L(this,"_styleColor",this.dv(m.react(void 0)));L(this,"_highlightStyleColor",this.dv(m.react(void 0)));L(this,"_styleVisable",this.dv(m.react(void 0)));this._flattenedPlane=this.dv(new _o(i,e.id)),this._czm3DTiles=this.dv(new nt(i,this,e.id)),this._clippingPlanes=this.dv(new Vs(i,e.id));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._czm3DTiles;this.ad(e.setMaterialEvent.don(l=>{r.setMaterial(l)}));{const l=()=>{r.origin&&(e.offset||(e.offset=[0,0,0]),r.position=qN(r.origin,e.offset))};l(),this.d(e.offsetChanged.don(l)),this.d(r.originChanged.don(l))}{const l=()=>{if(!r.position)return;const h=r.position.map((c,f)=>{if(r.origin)return c-r.origin[f]});r.origin&&(e.offset=WN(r.origin,h))};l();const u=this.ad(m.createNextAnimateFrameEvent(r.positionChanged));this.d(u.don(l))}const a=this._clippingPlanes,s=this._flattenedPlane;this.d(e.setFeatureColorEvent.don((l,u)=>{const c=u.reverse().map(f=>KN(f,l));this.setFeatureColor(c)})),this.d(e.setFeatureVisableEvent.don((l,u)=>{const c=u.reverse().map(f=>XN(f,l));this.setFeatureVisable(c)})),this.d(e.resetFeatureStyleEvent.don(()=>{this.resetFeatureStyle()})),this.d(e.highlightFeatureEvent.don((l,u)=>{this.highlightFeature(l,u)})),this.d(e.highlightFeatureAndFlyToEvent.don((l,u,h,c)=>{h&&this.highlightFeature(l,h);const f=new C.Cartesian3(u[0],u[1],u[2]),A=new C.BoundingSphere(f,u[3]);o.camera.flyToBoundingSphere(A,{duration:c??1})})),this.d(r.czmTilesetReadyEvent.don(l=>{const u=h=>{if(l.style=void 0,h.length===0)return;const c=[...h],f=[],A=[];let d;c.forEach(p=>{Array.isArray(p.condition)?(f.push({condition:p.condition,color:p.color??[1,1,1,1]}),A.push({condition:p.condition,show:p.show??!0})):(f.push({condition:[p.condition],color:p.color??[1,1,1,1]}),A.push({condition:[p.condition],show:p.show??!0}))});{const p=(y,g)=>{try{let b;return f.forEach(w=>{if(b===void 0){const E=QN(w,y);E.length>0&&!E.includes(!1)&&(b=UN(w.color,g))}}),b||C.Color.clone(C.Color.WHITE,g)}catch{return C.Color.clone(C.Color.WHITE,g)}},v=y=>{try{let g;return A.forEach(b=>{if(g===void 0){const w=NN(b,y);w.length>0&&!w.includes(!1)&&(g=b.show)}}),g!==void 0?g:!0}catch{return!0}};d=new C.Cesium3DTileStyle({color:{evaluateColor:function(y,g){return p(y,g)}},show:{evaluate:function(y){return v(y)}}})}l.style=d};this.d(e.setFeatureStyleEvent.don(h=>{u(h)})),this.d(e.resetFeatureStyleEvent.don(()=>{l.style=void 0}));{const h=this,c=[],f=l.tileLoad.addEventListener(function(d){try{const v=d.content.getFeature(0),g=v.getPropertyIds().map(E=>{const T=v.getProperty(E);return{key:E,type:typeof T}}),b=c.map(E=>E.key),w=g.filter(E=>!b.includes(E.key));c.push(...w)}catch{}});this.d(()=>{f()});const A=async()=>{try{c.length>0?e._featureTableResultEvent.emit(c):e._featureTableResultEvent.emit(void 0)}catch(d){console.warn(`CzmES3DTileset GetFeatureTable: ${d}`),e._featureTableResultEvent.emit(void 0)}};h.d(e.getFeatureTableEvent.don(()=>{A()}))}{const h=c=>{r.tileset.featureIdLabel=`featureId_${c}`};this.ad(e.featureIdLabelChanged.don(c=>{h(c)}))}})),this.d(r.czmTilesetReadyEvent.don((l,u)=>{e.supportEdit=r.supportEdit,e.tilesetReady.emit(l)})),r.absoluteClippingPlanes=!0,r.czmFlattenedPlaneId=this.flattenedPlane.id,e.flattenedPlaneId=this.flattenedPlane.id,r.clippingPlanesId=this.clippingPlanes.id,this.d(m.track([s,"enabled"],[e,"flattenedPlaneEnabled"])),this.d(m.track([a,"enabled"],[e,"clippingPlaneEnabled"])),this.d(m.track([a,"planeIds"],[e,"clippingPlaneIds"])),this.d(m.track([a,"unionClippingRegions"],[e,"unionClippingRegions"])),this.d(m.track([a,"edgeColor"],[e,"clippingPlaneEdgeColor"])),this.d(m.track([a,"edgeWidth"],[e,"clippingPlaneEdgeWidth"])),this.d(e.clippingPlaneIdChanged.don(()=>{r.clippingPlanesId=e.clippingPlaneId})),this.d(e.excavateIdChanged.don(()=>{r.clippingPolygonsId=e.excavateId}));{const l=()=>{typeof e.url=="string"?e.url=N.ESSceneObject.context.getStrFromEnv(e.url):e.url&&(e.url.url=N.ESSceneObject.context.getStrFromEnv(e.url.url)),r.url=e.url};l(),this.d(e.urlChanged.don(l))}this.d(m.track([r,"show"],[e,"show"])),this.d(m.track([r,"colorBlendMode"],[e,"colorBlendMode"])),this.d(m.track([r,"cacheBytes"],[e,"cacheBytes"])),this.d(m.track([r,"maximumCacheOverflowBytes"],[e,"cacheBytes"])),this.d(m.track([r,"allowPicking"],[e,"allowPicking"])),this.d(m.bind([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(m.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"])),this.d(m.track([r,"maximumScreenSpaceError"],[e,"maximumScreenSpaceError"])),this.d(m.track([r,"maximumMemoryUsage"],[e,"czmMaximumMemoryUsage"])),this.d(m.track([r,"classificationType"],[e,"czmClassificationType"])),this.d(m.track([r,"styleJson"],[e,"czmStyleJson"])),this.d(m.bind([r,"rotation"],[e,"rotation"])),this.d(m.track([r,"backFaceCulling"],[e,"czmBackFaceCulling"])),this.d(m.track([r,"debugShowBoundingVolume"],[e,"czmDebugShowBoundingVolume"])),this.d(m.track([r,"debugShowContentBoundingVolume"],[e,"czmDebugShowContentBoundingVolume"])),this.d(m.track([r,"skipLevelOfDetail"],[e,"czmSkipLevelOfDetail"])),this.ad(m.bind([r,"splitDirection"],[e,"splitDirection"]));{const l=u=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:u}:{atmosphereScatteringIntensity:u}};l(e.czmAtmosphereScatteringIntensity),l(e.czmLuminanceAtZenith),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(u=>l(u))),this.ad(e.czmLuminanceAtZenithChanged.don(u=>l(u)))}{const l=()=>{var u,h;(u=e.czmEnvironmentMapManager)!=null&&u.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=e.czmLuminanceAtZenith=(h=e.czmEnvironmentMapManager)==null?void 0:h.atmosphereScatteringIntensity)};l(),this.ad(e.czmEnvironmentMapManagerChanged.don(l))}{const l=()=>{const u=e.materialMode??N.ES3DTileset.defaults.materialMode;CS=e.materialParams.baseColor??[1,1,1],u==="normal"?r.customShaderInstanceClass=void 0:u==="technology"&&(r.customShaderInstanceClass=void 0,r.customShaderInstanceClass=GN)};this.d(e.materialModeChanged.don(u=>{l()})),this.d(e.materialParamsChanged.don(()=>{l()})),l()}}get czm3DTiles(){return this._czm3DTiles}get clippingPlanes(){return this._clippingPlanes}get flattenedPlane(){return this._flattenedPlane}get styleColor(){return this._styleColor.value}set styleColor(e){this._styleColor.value=e}get highlightStyleColor(){return this._highlightStyleColor.value}set highlightStyleColor(e){this._highlightStyleColor.value=e}get styleVisable(){return this._styleVisable.value}set styleVisable(e){this._styleVisable.value=e}highlightFeature(e,i){const o=i??"rgba(255,0,0,1)",s=["${id} === "+(typeof e=="string"?`'${e}'`:e),o];let l={};const u=this.styleColor?[s,...this.styleColor]:[s];this.styleVisable?l={show:{conditions:[...this.styleVisable]},color:{conditions:[...u]}}:l={color:{conditions:[...u]}},console.log("style",l),this._czm3DTiles.styleJson=l,this.highlightStyleColor=[...s]}setFeatureColor(e){const i=this.highlightStyleColor,o=this.styleColor?[...e,...this.styleColor]:[...e];let r={};this.styleVisable?i?r={show:{conditions:[...this.styleVisable]},color:{conditions:[...o,i]}}:r={show:{conditions:[...this.styleVisable]},color:{conditions:[...o]}}:i?r={color:{conditions:[...o,i]}}:r={color:{conditions:[...o]}},console.log("style",r),this._czm3DTiles.styleJson=r,this.styleColor=[...o]}setFeatureVisable(e){let i={};const o=this.highlightStyleColor,r=this.styleVisable?[...e,...this.styleVisable]:[...e];this.styleColor?o?i={show:{conditions:[...r]},color:{conditions:[o,...this.styleColor]}}:i={show:{conditions:[...r]},color:{conditions:[...this.styleColor]}}:o?i={show:{conditions:[...r]},color:{conditions:[o]}}:i={show:{conditions:[...r]}},console.log("style",i),this._czm3DTiles.styleJson=i,this.styleVisable=[...r]}resetFeatureStyle(){this.czm3DTiles.styleJson=void 0,this.styleColor=void 0,this.highlightStyleColor=void 0,this.styleVisable=void 0}flyTo(e,i){const{sceneObject:o,czmViewer:r,czm3DTiles:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czm3DTiles:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(ju,"type",ju.register("ESCesiumViewer",N.ES3DTileset.type,ju));let Hs=ju;const ec=class ec extends $e{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");if(!i.viewer){console.warn("viewer is undefined!");return}const r=N.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_b.glb"),a=N.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_a.glb");this._czmModelPrimitive=this.disposeVar(new jt(this.czmViewer,this.sceneObject.id));const s=this._czmModelPrimitive;this.ad(m.bind([s,"position"],[e,"position"])),this.ad(Vt([s,"rotation"],[e,"rotation"])),this.ad(m.track([s,"show"],[e,"show"])),s.activeAnimationsAnimateWhilePaused=!0,s.activeAnimationsJson=N.ESAlarm.defaults.czmAnimations;{const l=this.dv(m.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),u=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};u(),this.d(l.don(u))}{const l=()=>{const u=e.mode;u==="circle"?s.url=r:(u==="cylinder"||u===void 0)&&(s.url=a)};l(),this.dispose(e.modeChanged.disposableOn(()=>{l()}))}{const l=()=>{const h=e.radius??N.ESAlarm.defaults.radius;s.scale=[h*e.scale[0],h*e.scale[1],h*e.scale[2]]};l();const u=this.dv(m.createNextAnimateFrameEvent(e.radiusChanged,e.scaleChanged));this.dispose(u.disposableOn(()=>{l()}))}}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:a}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,i):(a&&Pn(r,o,i,e,a,!0),!0)}};L(ec,"type",ec.register("ESCesiumViewer",N.ESAlarm.type,ec));let Og=ec;const tc=class tc extends $e{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new At(i,this.sceneObject.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmCustomPrimitive:r}=this;this.dispose(m.track([r,"show"],[e,"show"])),this.dispose(m.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(Vt([r,"rotation"],[e,"rotation"])),this.dispose(m.bind([r,"position"],[e,"position"])),this.dispose(m.track([r,"scale"],[e,"scale"])),r.indexTypedArray=new Uint16Array([0,1,2,0,2,3]),r.uniformMap={u_color:[0,.7,1,1]},r.fragmentShaderSource=`
|
|
3328
3328
|
in vec2 v_st;
|
|
3329
3329
|
uniform vec4 u_color;
|
|
3330
3330
|
void main()
|
|
@@ -4688,10 +4688,10 @@ void main()
|
|
|
4688
4688
|
{
|
|
4689
4689
|
out_FragColor = u_color;
|
|
4690
4690
|
}
|
|
4691
|
-
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},At,t)}class FG extends m.HasOwner{constructor(n){super(n);const{czmViewer:e}=this.owner;let i;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(r=>{const a=i=this._getStartInfo(r.pointerEvent);a&&(this.owner.hoveredPlaneType=a.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(r=>{i&&i.currentPlaneType!=="none"&&(o.restart(void 0,e,i),i=void 0)})),this.dispose(e.dblclickEvent.disposableOn(r=>{do{const a=this._getStartInfo(r.pointerEvent);if(!a||a.currentPlaneType==="none")break;const{currentPlaneType:s}=a,l=[...this.owner.selfRotation];l[Ci.rotationNum[s]]=0,this.owner.selfRotation=l;return}while(!1);this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(m.createProcessingFromAsyncFunc(async(n,e,i)=>{const o=this.owner.circles[i.currentPlaneType];e.incrementDisabledInputStack(),n.disposer.dispose(()=>e.decrementDisabledInputStack()),n.disposer.dispose(e.pointerMoveEvent.don(r=>{if(i&&r.pointerEvent){const{offsetX:a,offsetY:s}=r.pointerEvent,l=[a,s],{currentPlaneType:u}=i;if(u==="none")return;const h=this.owner.getPlane(u);if(!i.currentV)return;const c=h.pick(l);if(!c||!this.owner.cartesian)return;const f=C.Cartesian3.subtract(i.currentV,this.owner.cartesian,new C.Cartesian3);C.Cartesian3.normalize(f,f);const A=C.Cartesian3.subtract(c,this.owner.cartesian,new C.Cartesian3);if(C.Cartesian3.normalize(A,A),!h.normal||!h.origin)return;const d=N0(f,A,h.normal),p=N0(h.origin,f,h.normal),v=N0(h.origin,A,h.normal);{const y=[...this.owner.selfRotation];y[Ci.rotationNum[u]]=i.startRotation+d,this.owner.selfRotation=y,o.circleStartRotation=p,o.circleEndRotation=v}}})),this.owner.movingPlaneType=i.currentPlaneType,n.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),n.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await m.step(n,r=>new Promise((a,s)=>{r.disposer.dispose(s),r.disposer.dispose(e.pointerUpEvent.don(()=>{a()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{a()}))}))}))}_pickPlane(n,e,i,o,r){const a=this.owner.cartesian;if(!a)return;const{selfRotation:s}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const u=C.Cartesian3.distance(a,l),h=r/4,c=h*3/128;if(!(u>=h-c&&u<=h+c))return;const A=C.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=A||(n.currentPlaneType=i,n.currentD2c=A,n.currentV=l,n.startRotation=s[Ci.rotationNum[i]])}_getStartInfo(n){var h;const{czmViewer:e}=this.owner,i=(h=e.viewer)==null?void 0:h.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=rr(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:a}=n,s=[r,a],l=n.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(u,i,"heading",s,o),this._pickPlane(u,i,"pitch",s,o),this._pickPlane(u,i,"roll",s,o),u}}function N0(t,n,e){const i=C.Cartesian3.cross(n,t,new C.Cartesian3);if(i.equals(C.Cartesian3.ZERO))return 0;C.Cartesian3.normalize(i,i);const o=C.Cartesian3.dot(i,e);let r=Math.acos(C.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const La=class La extends Xn{constructor(e){super();L(this,"_hoveredPlaneType",this.disposeVar(m.react("none")));L(this,"_movingPlaneType",this.disposeVar(m.react("none")));L(this,"_circles");L(this,"_czmCameraModel");L(this,"_cartesian");L(this,"_planes",{heading:this.disposeVar(new EG(this)),pitch:this.disposeVar(new PG(this)),roll:this.disposeVar(new TG(this))});L(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new m.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new FG(this)})),this._circles={heading:this._createRotatorCircle(i,"heading"),pitch:this._createRotatorCircle(i,"pitch"),roll:this._createRotatorCircle(i,"roll")},!!i.viewer){{const r=()=>{this._cartesian=this.position&&Et(this.position)||void 0};r(),this.dispose(this.positionChanged.disposableOn(r))}this._createCameraModel(i)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new jt(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(m.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(m.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(m.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=ft({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=C.Matrix4.toArray(o))};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};i(),this.dispose(this.enabledChanged.disposableOn(i)),this.dispose(this.showHelperChanged.disposableOn(i))}}_createRotatorCircle(e,i){const o=this.ad(new ll(e));this.dispose(m.track([o,"position"],[this,"position"])),this.dispose(m.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(m.track([o,"debug"],[this,"debug"])),this.dispose(m.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=La.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[La.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const a=this.movingPlaneType===i,s=this.hoveredPlaneType===i,u=[0,0,0,a||s?1:.8];u[La.rotationNum[i]]=1,o.color=u};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};L(La,"rotationNum",{heading:0,pitch:1,roll:2}),L(La,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let Ci=La;(t=>{t.createDefaultProps=()=>({...Xn.createDefaultProps(),rotation:m.reactArray([0,0,0]),selfRotation:m.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(Ci||(Ci={})),m.extendClassProps(Ci.prototype,Ci.createDefaultProps);const za=class za extends m.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??za.defaults.positions[0],this.stopPosition??za.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??za.defaults.positions[0],n??za.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new rt(n,e));o.arcType="RHUMB";const r=this.ad(new ei(n,e));this.ad(m.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(m.track([r,"allowPicking"],[this,"allowPicking"]));{const a=()=>{o.show=r.show=this.show};a(),this.ad(this.showChanged.don(a))}{const a=()=>{o.width=this.width/2,r.pixelSize=this.width};a(),this.ad(this.widthChanged.don(a))}{const a=()=>{o.color=r.color=this.color};a(),this.ad(this.colorChanged.don(a))}{const a=()=>{o.positions=this.positions,r.position=this.stopPosition};a(),this.dispose(this.startPositionChanged.disposableOn(a)),this.dispose(this.stopPositionChanged.disposableOn(a))}}};L(za,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let ka=za;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:m.reactPositions(t.defaults.positions),width:10,color:m.reactArray([1,0,0,1])})})(ka||(ka={})),m.extendClassProps(ka.prototype,ka.createDefaultProps);class kr extends Xn{constructor(e){super();L(this,"_lastPosition");L(this,"_opInfo",{step:this.ad(m.react(!1)),moved:this.ad(m.react(!1)),constraintMode:this.disposeVar(m.react("none")),originPosition:this.disposeVar(m.reactArray([0,0,0])),originHeading:this.disposeVar(m.react(0)),originDimensions:this.disposeVar(m.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(m.reactArray([0,0,0])),movingPosition:this.disposeVar(m.reactArray([0,0,0])),targetPosition:this.disposeVar(m.reactArray([0,0,0])),targetHeading:this.disposeVar(m.react(0))});L(this,"_scaleAxis");L(this,"_pickingXYProcessing",e=>this.disposeVar(new m.Processing((i,o,r)=>{const a=[0,0,0],s=new C.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const u=hi(m.getDomEventCurrentTargetPos(l.pointerEvent));if(!Ha(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;Na(s,a),this._opInfo.constraintMode.value==="x"?Ho(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="y"?Ho(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const h=[0,0,0];N.geoRhumbDestination(a,r,o,h),this._opInfo.targetPosition.value=h;let c=this.scale[0],f=this.scale[1];const A=N.geoDistance(h,this._opInfo.originPosition.value)-N.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...h];const d=this._opInfo.originDimensions.value[0]/100;A!=0&&this._opInfo.constraintMode.value==="y"&&(A>0?c+=d:c-=d),A!=0&&this._opInfo.constraintMode.value==="x"&&(A>0?f+=d:f-=d),c<=0&&(c+=d),f<=0&&(f+=d),this.scale=[c??1,f??1,this.scale[2]??1]})})));L(this,"_pickingZProcessing",e=>this.disposeVar(new m.Processing(()=>{const i=new C.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const a=hi(m.getDomEventCurrentTargetPos(r.pointerEvent));if(!Hh(e.viewer.scene,Et(this._opInfo.originPosition.value),a,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Qe(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s];let u=this.scale[2];const h=o[2]-this._lastPosition[2];this._lastPosition=[...o];const c=this._opInfo.originDimensions.value[0]/100;h!=0&&(h>0?u+=c:u-=c),u<=0&&(u+=c),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new Qd(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const u=()=>{if(!this._scaleAxis)return;const{zAxis:h,yAxis:c,xAxis:f}=this._scaleAxis,A=this._opInfo.constraintMode.value,d=this._opInfo.step;h.color=[0,0,1,.99],c.color=[0,1,0,.99],f.color=[1,0,0,.99],A==="x"?f.color=d?[1,1,0,.8]:[1,1,0,.99]:A==="y"?c.color=d?[1,1,0,.8]:[1,1,0,.99]:A==="z"&&(h.color=d?[1,1,0,.8]:[1,1,0,.99])};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u)),this.dispose(this._opInfo.step.changed.disposableOn(u))}{const u=()=>{if(!this._scaleAxis)return;const{position:c=kr.defaults.position}=this,{zAxis:f,yAxis:A,xAxis:d}=this._scaleAxis;f.startPosition=A.startPosition=d.startPosition=c;const[p,v,y]=c;f.stopPosition=[p,v,y+this._opInfo.originDimensions.value[2]];const g=N.geoRhumbDestination(c,this._opInfo.originDimensions.value[0],90);g&&(d.stopPosition=g);const b=N.geoRhumbDestination(c,this._opInfo.originDimensions.value[1],0);b&&(A.stopPosition=b)};u();const h=this.ad(m.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(h.don(u))}{const u=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((h,c)=>h===this._opInfo.targetPosition.value[c])){this._opInfo.moved.value=!0;return}};u(),this.dispose(this._opInfo.originHeading.changed.disposableOn(u)),this.dispose(this._opInfo.originPosition.changed.disposableOn(u)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(u)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(u))}const r=this._pickingXYProcessing(e),a=this._pickingZProcessing(e),s=this.disposeVar(m.createProcessingFromAsyncFunc(async u=>{do this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",u.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await m.step(u,async h=>{const c=()=>{const d=[...this.position??kr.defaults.position];e.editingHeightOffset&&(d[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=d};h.disposer.dispose((c(),this.positionChanged.disposableOn(c)));const f={constraintMode:"none",startDragPos:[0,0,0]},A=d=>{if(!this.position)return;const p={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};Td(d,o,p,this.axisSnapPixelSize,f),this._opInfo.constraintMode.value=f.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=f.startDragPos};h.disposer.dispose(e.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&A(d.pointerEvent)})),await m.step(h,d=>new Promise((p,v)=>{d.disposer.dispose(v),d.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&A(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&f.constraintMode!=="none"&&p()}))}))}),this._opInfo.step.value=!1,await m.step(u,async h=>{if(e.incrementDisabledInputStack(),h.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const c=N.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),f=N.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,c,f),h.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(a.restart(),h.disposer.dispose(()=>a.cancel()));await m.step(h,c=>new Promise((f,A)=>{c.disposer.dispose(A),c.disposer.dispose(e.pointerUpEvent.don(()=>{f()})),c.disposer.dispose(e.pointerOutEvent.don(()=>{f()}))})),this._lastPosition=void 0});while(!0)})),l=()=>{this.enabled?s.restart():s.isRunning&&s.cancel()};l(),this.dispose(this.enabledChanged.disposableOn(l))}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new ka(e));return o.width=10,this.ad(m.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Xn.createDefaultProps(),scale:m.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(kr||(kr={})),m.extendClassProps(kr.prototype,kr.createDefaultProps);const No=class No extends xn{constructor(e){super();L(this,"_editingPoints",this.disposeVar(new m.ObservableArray));L(this,"_cancelEvent",this.disposeVar(new m.Event));L(this,"_currentProcess");L(this,"_menuPoiEnabled",this.disposeVar(m.react(!1)));L(this,"_status",this.disposeVar(m.react("None")));L(this,"_positionsChanged",this.ad(new m.Event));L(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(i=>{for(let{start:o,deleteCount:r,items:a}of i){for(const s of a)s.menuPoi.enabled=this.menuPoiEnabled??!1;for(let s=o;s<o+r;++s)this.editingPoints.get(s).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let i of this.editingPoints)i.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(i=>{this.ad(m.nextAnimateFrame(()=>{var o;((o=i.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()}))})),this.dispose(this.enabledChanged.disposableOn(i=>{this._currentProcess&&(i?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const i=()=>{this.polylineShow=this.czmViewer.editingLineShow};i(),this.ad(this.czmViewer.editingLineShowChanged.don(i))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let i of this._editingPoints)i.position&&e.push([...i.position]);return e}resetPositions(e){if(this.enabled??No.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const i=e||[];return!(i.length===this.editingPoints.length&&i.every((o,r)=>o.every((a,s)=>{const l=this.editingPoints.get(r);return l.position&&l.position[s]===a})))}forceResetPositions(e){(this.enabled??No.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const i=this.ad(new rt(e));this.ad(m.track([i,"color"],[this,"polylineColor"])),this.ad(m.track([i,"width"],[this,"polylineWidth"])),this.ad(m.track([i,"show"],[this,"polylineShow"])),this.ad(m.track([i,"arcType"],[this,"polylineArcType"])),this.ad(m.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const a of this.getPositions())a[2]-=e.editingHeightOffset??0,r.push(a);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new m.CursorInfo(e.container,m.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(i){if(!this.hideCursorInfo){i.show=!1;return}o==="Adding"?(i.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",i.show=!0):o==="Modifying"||o==="Modifying_Point"?(i.text="Esc键或左键双击:退出编辑状态",i.show=!0):o==="None"&&(i.text="",i.show=!1)}}))}};L(No,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),L(No,"defaults",{...xn.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:No.baseImageUrl+"point-green.png",otherControlPointImageUrl:No.baseImageUrl+"point-yellow.png"});let li=No;(t=>{t.createDefaultProps=()=>({...xn.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:m.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(li||(li={})),m.extendClassProps(li.prototype,li.createDefaultProps);let MG=0;class v2 extends m.Destroyable{constructor(e,i){super();L(this,"_position",this.disposeVar(m.reactArrayWithUndefined(void 0)));L(this,"_id",MG++);L(this,"_menuPoi");i&&(this.position=i),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new rs(e.czmViewer));o.enabled=!1,this.ad(m.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const a=[...this.position];a[2]-=e.czmViewer.editingHeightOffset??0,o.position=a,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const a=e.editingPoints.indexOf(this)+1;a!==0&&(o.title=`控制点${a}`,a===1?o.imageUri=e.firstControlPointImageUrl??li.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??li.defaults.otherControlPointImageUrl)};r(),this.dispose(e.editingPoints.changedEvent.disposableOn(r))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class w2 extends v2{constructor(n,e){super(n,e)}}class Rt extends li{constructor(e){super(e);L(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new m.Event));L(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new bi(e));i.enabled=!1,this.currentProcess=this.disposeVar(m.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Rt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Rt.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(m.step(o,async r=>{const a=r.disposer,s=a.ad(this._addingEditingProcessing());a.dispose(()=>"adding canceled!"),a.dispose(this.cancelEvent.disposableOn(()=>s.cancel())),await r.promise(new Promise(l=>{a.dispose(s.completeEvent.disposableOnce(l))}))}))})),this.dispose(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new w2(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Rt.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},i=m.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1;do if(!await o.promise(m.step(o,async s=>{let l;!e()&&(l=s.disposer.disposeVar(new BG(this,r)));const h=s.disposer.disposeVar(new RG(this,r));return s.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>h.do())),await s.promise(new Promise(c=>{l&&s.disposer.dispose(l.overEvent.disposableOnce(f=>{f?(r++,c(!0)):c(!1)})),s.disposer.dispose(h.overEvent.disposableOnce(f=>{f?(r--,c(!0)):c(!1)})),s.disposer.dispose(this.cancelEvent.disposableOn(()=>c(!1)))}))})))break;while(!0)});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...li.createDefaultProps()})})(Rt||(Rt={})),m.extendClassProps(Rt.prototype,Rt.createDefaultProps);class BG extends m.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new m.Event));const{placeEditing:o}=e;let r=new w2(e,void 0);e.editingPoints.splice(i,0,r);const a=()=>{(e.debug??Rt.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(r);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(m.track([r,"position"],[o,"position"])),o.enabled=!0;let s=!1;const l=()=>{a(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!s&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{s=!0,r.position===void 0?l():this._overEvent.emit(!0)})),(e.debug??Rt.defaults.debug)&&console.log(`PointAdding creating! index(${i})`),this.dispose(()=>{(e.debug??Rt.defaults.debug)&&console.log(`PointAdding destroying! index(${i})`)})}get overEvent(){return this._overEvent}}function DG(t,n){const e=t.editingPoints,i=n-1;return i<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(i,1),!0)}class RG extends m.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new m.Event));L(this,"_doEvent",this.disposeVar(new m.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(DG(e,i)))),(e.debug??Rt.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${i})`),this.dispose(()=>{(e.debug??Rt.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${i})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class _2 extends Rt{constructor(n){super(n),this.loop=!1}}class b2 extends Rt{constructor(n){super(n),this.loop=!0}}class md extends v2{constructor(n,e){super(n,e);{const{menuPoi:i}=this;i.commands=[["add","增加控制点","",st.baseImageUrl+"add.png"],["delete","删除当前控制点","",st.baseImageUrl+"delete.png"],["modify","修改当前控制点","",st.baseImageUrl+"modify.png"]],i.clickCommandName="modify",i.rightClickCommandName="delete",this.dispose(i.commandEvent.disposableOn(o=>{n.menuPoiCommand(this,o)})),this.dispose(i.dbclickEvent.disposableOn(()=>{n.menuPoiCommand(this,"dbClick")}))}if(n.middlePointShow){const i=this.ad(new Bi(n.czmViewer));{i.imageUri=n.firstControlPointImageUrl??st.defaults.firstControlPointImageUrl,i.tooltip="点击增加一个控制点",i.bgColor=[0,0,0,.6],i.fgColor=[1,1,1,1],i.size=[8,8],i.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{if(!(n.enabled??st.defaults.enabled)){i.enabled=!1,i.show=!1;return}do{const a=n.editingPoints.indexOf(this);if(a===-1)break;const s=n.editingPoints.length;if(s===0){console.error("impl.positionEditors.length === 0!");break}if(!(n.loop??st.defaults.loop)&&a+1>=s)break;const u=this.position;if(!u)break;let h=(a+1)%s;const f=n.editingPoints.get(h).position;if(!f)break;const A=Md(u,f);if(!A)break;A[2]-=n.czmViewer.editingHeightOffset??0,i.position=A;const d=n.editingPoints.length<(n.maxPointsNum??st.defaults.maxPointsNum);i.enabled=d,i.show=d;return}while(!1);i.enabled=!1,i.show=!1};o(),this.dispose(n.positionsChanged.disposableOn(o)),this.dispose(n.loopChanged.disposableOn(o)),this.dispose(n.enabledChanged.disposableOn(o))}this.dispose(i.clickEvent.disposableOn(o=>{if(o.button!==0||n.editingPoints.length>=(n.maxPointsNum??st.defaults.maxPointsNum))return;const r=n.editingPoints.indexOf(this);if(r===-1)return;const a=i.position?[...i.position]:void 0;a&&(a[2]+=n.czmViewer.editingHeightOffset??0);let s=new md(n,a);n.editingPoints.splice(r+1,0,s),n.modify(s)}))}}}}class st extends li{constructor(e){super(e);L(this,"_menuPoiCommand",this.disposeVar(new m.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new m.Event));L(this,"_overEvent",this.disposeVar(new m.Event));L(this,"translationEditing");{const o=this.ad(m.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new m.ObjResettingWithEvent(o,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new OG(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new Ir(e));i.enabled=!1,this.currentProcess=this.disposeVar(m.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??st.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1});let r=-1;do if((this.debug??st.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",r=await o.promise(m.step(o,async a=>{const s=a.disposer,l=s.ad(new UG(this));return s.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&l.modify(this.editingPoints.get(r===-1||r>=this.editingPoints.length?0:r)),s.dispose(this.cancelEvent.disposableOn(()=>l.cancel())),s.dispose(this._forceModifyPosEditorEvent.disposableOn(h=>l.modify(h))),await a.promise(new Promise(h=>{s.dispose(l.overEvent.disposableOnce(c=>{h(c)}))}))})),r===-1){(this.debug??st.defaults.debug)&&console.log("退出编辑状态");break}else{if(this.editingPoints.length>=(this.maxPointsNum??st.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??st.defaults.loop;const s=this.editingPoints.get(r-1).position;if(!s)return;let l=r%this.editingPoints.length;const h=this.editingPoints.get(l).position;if(!h)return;const c=Md(s,h);if(!c)return;c&&(c[2]+=this.czmViewer.editingHeightOffset??0);let f=new md(this,c);this.editingPoints.splice(r,0,f)}while(!0);this.status="None",this.enabled=!1}))}menuPoiCommand(e,i){this._menuPoiCommand.emit(e,i)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new md(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...li.createDefaultProps(),moveWithFirstPosition:!1})})(st||(st={})),m.extendClassProps(st.prototype,st.createDefaultProps);class OG extends m.Destroyable{constructor(n,e){super(),this._firstPositionEditor=n,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((i,o)=>{if(i===void 0||o===void 0)return;var r=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];const a=this.multiPointsModifyEditing.editingPoints.length;for(let s=1;s<a;s++){const l=this.multiPointsModifyEditing.editingPoints.get(s),u=l.position;u!==void 0&&(l.position=[u[0]+r[0],u[1]+r[1],u[2]+r[2]])}})}}class UG extends m.Destroyable{constructor(e){super();L(this,"_overEvent",this.disposeVar(new m.Event));L(this,"_cancelEvent",this.disposeVar(new m.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new m.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let i;const o=()=>{i==null||i.destroy(),i=void 0,e.status="Modifying"};this.dispose(o);const r=a=>{o(),e.status="Modifying_Point",i=new LG(e,a),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((a,s)=>{if(s==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(s==="modify")r(a);else if(s==="add"){const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else s==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${s})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class LG extends m.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new m.Event));this._modifying=e,this._posEditor=i,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(m.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class C2 extends st{constructor(n){super(n),this.loop=!1}}class x2 extends st{constructor(n){super(n),this.loop=!0}}class ul extends Rt{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=N.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const i=N.geoHeading(this.startPosition,this.endPosition),o=N.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/o)*180/Math.PI,s=Math.sqrt(o*o+r*r);this.rotation=[i,a,0],this.distance=s};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Rt.createDefaultProps(),startPosition:m.reactArrayWithUndefined(void 0),endPosition:m.reactArrayWithUndefined(void 0),rotation:m.reactArray([90,0,0]),distance:m.react(1)})})(ul||(ul={})),m.extendClassProps(ul.prototype,ul.createDefaultProps);class Fa extends st{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=N.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{do{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];break}if(this.startPosition=this.positions[0],this.positions.length==1){this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",st.baseImageUrl+"add.png"],["delete","删除当前控制点","",st.baseImageUrl+"delete.png"],["modify","修改当前控制点","",st.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;break}this.endPosition=this.positions[1];for(let l of this.editingPoints)l.menuPoi.commands=[["delete","删除当前控制点","",st.baseImageUrl+"delete.png"],["modify","修改当前控制点","",st.baseImageUrl+"modify.png"]];const i=N.geoHeading(this.startPosition,this.endPosition),o=N.geoDistance(this.startPosition,this.endPosition);if(Math.abs(o)<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/o)*180/Math.PI,s=Math.sqrt(o*o+r*r);this.rotation=[i,a,0],this.distance=s}while(!1)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...st.createDefaultProps(),startPosition:m.reactArrayWithUndefined(void 0),endPosition:m.reactArrayWithUndefined(void 0),rotation:m.reactArray([0,0,0]),distance:m.react(0)})})(Fa||(Fa={})),m.extendClassProps(Fa.prototype,Fa.createDefaultProps);class S2 extends Rt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class E2 extends st{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class cl extends Rt{constructor(n){super(n),n.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(n){const e=this.ad(new pi(n));e.topOrBottom="bottom",this.ad(m.track([e,"color"],[this,"polylineColor"])),this.ad(m.track([e,"width"],[this,"polylineWidth"])),this.ad(m.track([e,"show"],[this,"polylineShow"])),this.ad(m.track([e,"arcType"],[this,"polylineArcType"])),this.ad(m.track([e,"loop"],[this,"loop"])),this.ad(m.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Rt.createDefaultProps(),visibilityPositions:m.reactPositionsSet(void 0)})})(cl||(cl={})),m.extendClassProps(cl.prototype,cl.createDefaultProps);class hl extends st{constructor(n){if(super(n),!!n.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(n){const e=this.ad(new pi(n));e.topOrBottom="bottom",this.ad(m.track([e,"color"],[this,"polylineColor"])),this.ad(m.track([e,"width"],[this,"polylineWidth"])),this.ad(m.track([e,"show"],[this,"polylineShow"])),this.ad(m.track([e,"arcType"],[this,"polylineArcType"])),this.ad(m.track([e,"loop"],[this,"loop"])),this.ad(m.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...st.createDefaultProps(),visibilityPositions:m.reactPositionsSet(void 0)})})(hl||(hl={})),m.extendClassProps(hl.prototype,hl.createDefaultProps);class P2 extends Fa{constructor(n){super(n),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class gn extends N.EngineObject{constructor(e,i,o){super(e,i,o??!0);L(this,"_supportEditing",this.disposeVar(m.react(!0)));L(this,"_currentEditing",this.disposeVar(m.react(void 0)));this.ad(this.supportEditingChanged.don(()=>{this.destroy()})),this.ad(this.toDestroyEvent.don(()=>{var r;if(this.currentEditing){if(this.currentEditing instanceof Rt&&((r=this.currentEditing.currentProcess)!=null&&r.isRunning))if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}else e.points=this.currentEditing.positions;this.currentEditing instanceof bi&&this.currentEditing.enabled&&(e.position=[0,0,0])}}))}get supportEditing(){return this._supportEditing.value}set supportEditing(e){this._supportEditing.value=e}get supportEditingChanged(){return this._supportEditing.changed}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const Sh=class Sh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new bi(e));this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)}));do{if(Reflect.has(n,"position")){this.ad(m.bind([i,"position"],[n,"position"])),i.enabled=!i.position||N.equalsN3(i.position,[0,0,0]);break}this.supportEditing=!1}while(!1)}};L(Sh,"type",Sh.registerEditing("ESCesiumViewer",N.ESJEditingMode.Place,Sh));let V0=Sh;const Eh=class Eh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Ci(e));i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(n instanceof N.ES3DTileset){N.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(m.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(m.bind([i,"selfRotation"],[n,"rotation"])))});break}if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){this.ad(m.bind([i,"position"],[n,"position"])),this.ad(m.bind([i,"selfRotation"],[n,"rotation"]));break}this.supportEditing=!1}while(!1)}};L(Eh,"type",Eh.registerEditing("ESCesiumViewer",N.ESJEditingMode.Rotation,Eh));let H0=Eh;const Ph=class Ph extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new kr(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"position")&&Reflect.has(n,"scale")){this.ad(m.bind([i,"position"],[n,"position"])),this.ad(m.bind([i,"scale"],[n,"scale"]));break}this.supportEditing=!1}while(!1)}};L(Ph,"type",Ph.registerEditing("ESCesiumViewer",N.ESJEditingMode.Scale,Ph));let G0=Ph;const Th=class Th extends gn{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new Ir(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const a=n[r];Reflect.has(a,"position")?o.push(a.position):a.points&&o.push(...a.points)}i.position=N.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(!(!r||!a)){var s=En({originPosition:a},[r])[0][0];n.forEach(l=>{if(Reflect.has(l,"position")){const u=En({originPosition:a},[l.position])[0][0];l.position=Nr({originPosition:a},[[u[0]+s[0],u[1]+s[1],u[2]+s[2]]])[0][0]}else if(Reflect.has(l,"points")&&l.points){const u=En({originPosition:a},l.points)[0];l.points=Nr({originPosition:a},u.map(h=>[h[0]+s[0],h[1]+s[1],h[2]+s[2]]))[0]}})}}));break}if(Reflect.has(n,"position")){this.ad(m.bind([i,"position"],[n,"position"]));break}if(n instanceof N.ES3DTileset){N.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(m.bind([i,"position"],[o.czm3DTiles,"position"]))});break}if(Reflect.has(n,"points")){if(n.points===void 0||n.points.length===0){this.destroy();break}i.position=N.getMinMaxCorner(n.points).center,this.ad(i.positionChanged.disposableOn((o,r)=>{if(o===void 0||r===void 0||n.points===void 0||n.points.length===0){this.destroy();return}var a=En({originPosition:r},[o])[0][0];const s=En({originPosition:r},n.points)[0];n.points=Nr({originPosition:r},s.map(l=>[l[0]+a[0],l[1]+a[1],l[2]+a[2]]))[0]}));break}this.supportEditing=!1}while(!1)}};L(Th,"type",Th.registerEditing("ESCesiumViewer",N.ESJEditingMode.Translation,Th));let gd=Th;const Ih=class Ih extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ul(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"position")){this.ad(m.bind([i,"startPosition"],[n,"position"])),this.ad(Vt([i,"rotation"],[n,"rotation"]));do{if(Reflect.has(n,"far")){this.ad(m.bind([i,"distance"],[n,"far"]));break}if(Reflect.has(n,"radius")){this.ad(m.bind([i,"distance"],[n,"radius"]));break}if(Reflect.has(n,"distance")){this.ad(m.bind([i,"distance"],[n,"distance"]));break}const o=Et(n.position);if(C.Cartesian3.ZERO.equals(o)||!e.viewer)return;i.distance=rr(e.viewer.scene,o,100)??1}while(!1);break}if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1);i.startPosition&&!N.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};L(Ih,"type",Ih.registerEditing("ESCesiumViewer",N.ESJEditingMode.DoublePointsAppend,Ih));let W0=Ih;const kh=class kh extends gn{constructor(n,e){var r;if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new Fa(e));do{if(Reflect.has(n,"position")){this.ad(m.bind([i,"startPosition"],[n,"position"])),this.ad(Vt([i,"rotation"],[n,"rotation"]));do{if(Reflect.has(n,"far")){this.ad(m.bind([i,"distance"],[n,"far"]));break}if(Reflect.has(n,"radius")){this.ad(m.bind([i,"distance"],[n,"radius"]));break}if(Reflect.has(n,"distance")){this.ad(m.bind([i,"distance"],[n,"distance"]));break}const a=Et(n.position);if(C.Cartesian3.ZERO.equals(a)||!e.viewer)return;i.distance=rr(e.viewer.scene,a,100)??1}while(!1);break}if(Reflect.has(n,"points")&&((r=n.points)==null?void 0:r.length)==2){i.moveWithFirstPosition=!1;const a=()=>i.positions=n.points??[];a(),this.ad(n.pointsChanged.don(()=>!i.enabled&&a())),this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1;return}while(!1);i.init(),i.enabled=!0;const o=this.ad(m.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||N.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(kh,"type",kh.registerEditing("ESCesiumViewer",N.ESJEditingMode.DoublePointsModify,kh));let q0=kh;const Fh=class Fh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new b2(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Fh,"type",Fh.registerEditing("ESCesiumViewer",N.ESJEditingMode.CircularAppend,Fh));let K0=Fh;const Mh=class Mh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new x2(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Mh,"type",Mh.registerEditing("ESCesiumViewer",N.ESJEditingMode.CircularInsert,Mh));let X0=Mh;const Bh=class Bh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new _2(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Bh,"type",Bh.registerEditing("ESCesiumViewer",N.ESJEditingMode.LineStringAppend,Bh));let $0=Bh;const Dh=class Dh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new C2(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Dh,"type",Dh.registerEditing("ESCesiumViewer",N.ESJEditingMode.LineStringInsert,Dh));let Z0=Dh;const Rh=class Rh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new S2(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Rh,"type",Rh.registerEditing("ESCesiumViewer",N.ESJEditingMode.ScatterAppend,Rh));let Y0=Rh;const Oh=class Oh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new E2(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Oh,"type",Oh.registerEditing("ESCesiumViewer",N.ESJEditingMode.ScatterModify,Oh));let J0=Oh;const Uh=class Uh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new cl(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Uh,"type",Uh.registerEditing("ESCesiumViewer",N.ESJEditingMode.VisibilityAppend,Uh));let j0=Uh;const Lh=class Lh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new hl(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Lh,"type",Lh.registerEditing("ESCesiumViewer",N.ESJEditingMode.VisibilityModify,Lh));let ew=Lh;const zh=class zh extends gn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new P2(e));do{if(Reflect.has(n,"points")){const r=Reflect.has(n,"extrudedHeight"),a=Reflect.has(n,"height"),s=Reflect.has(n,"perPositionHeight")?n.perPositionHeight:!r,l=n instanceof N.ESClassification||n instanceof N.ESPolygonFence;let u=N.getMinMaxCorner(n.points).center,h=[...u],c=l?n.points[0][2]:0;s?r?h[2]=n.extrudedHeight:h[2]=n.height+c:(a&&(u[2]=n.height),r&&(h[2]=n.extrudedHeight)),i.startPosition=u,i.distance=h[2]-u[2],i.moveWithFirstPosition=!1;let f=[...u];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(s?(n.points=n.points.map(A=>[A[0],A[1],A[2]+i.positions[0][2]-f[2]]),r?n.extrudedHeight=i.positions[1][2]:a&&(n.height=i.positions[1][2]-(l?i.positions[0][2]:0))):(a&&(n.height=i.positions[0][2]),r&&(n.extrudedHeight=i.positions[1][2])),f=[...i.positions[0]])}));break}this.supportEditing=!1;return}while(!1);i.init(),i.enabled=!0;const o=this.ad(m.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||N.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(zh,"type",zh.registerEditing("ESCesiumViewer",N.ESJEditingMode.HeightModify,zh));let tw=zh;function T2(){const t=m.createProcessingFromAsyncFunc(async(n,e,i,o,r=!0)=>{const a=Array.isArray(o)?[...o]:[o],s=i.editingID;e.editingEvent.emit({objectIDs:[i.id.split("_")[0]],editingID:s,type:"start",add:{modes:a}});const l=()=>{e.notSupportEditingCount=0,e.editingEvent.emit({objectIDs:[i.id.split("_")[0]],editingID:s,type:"end",add:{modes:a}}),t.isRunning&&t.cancel()};n.disposer.ad(l),n.disposer.ad(i.toDestroyEvent.don(l)),n.disposer.ad(e.keyDownEvent.don(h=>{h.code=="Escape"&&l()}));let u=0;do{const h=a[u%a.length],c=await m.step(n,async f=>{const A=f.disposer,d=N.EngineObject.contextEditing.getEngineObjConstructor(h,e.typeName);if(!d||!i.supportEditingModes().includes(h))return console.log(`未找到编辑模式或不支持当前编辑模式${h},已跳过当前编辑模式,请检查输入`),e.editingEvent.emit({objectIDs:[i.id.split("_")[0]],editingID:s,type:"changedFailed",add:{cMode:h,cIndex:u}}),e.notSupportEditingCount++,!1;const p=new d(i,e);if(A.ad(()=>{!p.isDestroyed()&&p.destroy()}),p.supportEditing)e.editingEvent.emit({objectIDs:[i.id.split("_")[0]],editingID:s,type:"changed",add:{cMode:h,cIndex:u}}),e.notSupportEditingCount=0;else return console.log(`未找到编辑模式或不支持当前编辑模式${h},已跳过当前编辑模式,请检查输入`),e.editingEvent.emit({objectIDs:[i.id.split("_")[0]],editingID:s,type:"changedFailed",add:{cMode:h,cIndex:u}}),e.notSupportEditingCount++,!1;return await f.promise(new Promise(y=>{p.isDestroyed()&&y(!1),A.ad(p.toDestroyEvent.don(()=>{console.log(`编辑模式${h}结束`),y(!1)})),r&&(A.ad(e.keyDownEvent.don(g=>{g.code=="Space"&&(console.log(`编辑模式${h}结束`),y(!1))})),A.ad(e.dblclickEvent.don(()=>y(!0))))}))});if(r&&c||!r&&u==a.length-1||e.notSupportEditingCount==a.length)break;u++}while(!0)});return t}function I2(){const t=m.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(s=>s.id.split("_")[0]),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(s=>s.id.split("_")[0]),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r),n.disposer.ad(e.keyDownEvent.don(s=>{s.code=="Escape"&&r()}));const a=new gd(i,e);n.disposer.ad(()=>{!a.isDestroyed()&&a.destroy()}),await n.promise(new Promise(s=>{a.isDestroyed()&&s(),n.disposer.ad(a.toDestroyEvent.don(()=>{console.log("移动结束"),s()})),n.disposer.ad(e.dblclickEvent.don(()=>s()))}))});return t}se.copyright=void 0;try{const t="earthsdk3-cesium",n="3.0.8-beta.8",e="2025-06-19T03:35:37.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="64fcc5c9e0b8dbfb173ac9ca2a0ed94573ba85f7",s=((Date.now()-1750304137e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
|
|
4691
|
+
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},At,t)}class FG extends m.HasOwner{constructor(n){super(n);const{czmViewer:e}=this.owner;let i;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(r=>{const a=i=this._getStartInfo(r.pointerEvent);a&&(this.owner.hoveredPlaneType=a.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(r=>{i&&i.currentPlaneType!=="none"&&(o.restart(void 0,e,i),i=void 0)})),this.dispose(e.dblclickEvent.disposableOn(r=>{do{const a=this._getStartInfo(r.pointerEvent);if(!a||a.currentPlaneType==="none")break;const{currentPlaneType:s}=a,l=[...this.owner.selfRotation];l[Ci.rotationNum[s]]=0,this.owner.selfRotation=l;return}while(!1);this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(m.createProcessingFromAsyncFunc(async(n,e,i)=>{const o=this.owner.circles[i.currentPlaneType];e.incrementDisabledInputStack(),n.disposer.dispose(()=>e.decrementDisabledInputStack()),n.disposer.dispose(e.pointerMoveEvent.don(r=>{if(i&&r.pointerEvent){const{offsetX:a,offsetY:s}=r.pointerEvent,l=[a,s],{currentPlaneType:u}=i;if(u==="none")return;const h=this.owner.getPlane(u);if(!i.currentV)return;const c=h.pick(l);if(!c||!this.owner.cartesian)return;const f=C.Cartesian3.subtract(i.currentV,this.owner.cartesian,new C.Cartesian3);C.Cartesian3.normalize(f,f);const A=C.Cartesian3.subtract(c,this.owner.cartesian,new C.Cartesian3);if(C.Cartesian3.normalize(A,A),!h.normal||!h.origin)return;const d=N0(f,A,h.normal),p=N0(h.origin,f,h.normal),v=N0(h.origin,A,h.normal);{const y=[...this.owner.selfRotation];y[Ci.rotationNum[u]]=i.startRotation+d,this.owner.selfRotation=y,o.circleStartRotation=p,o.circleEndRotation=v}}})),this.owner.movingPlaneType=i.currentPlaneType,n.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),n.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await m.step(n,r=>new Promise((a,s)=>{r.disposer.dispose(s),r.disposer.dispose(e.pointerUpEvent.don(()=>{a()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{a()}))}))}))}_pickPlane(n,e,i,o,r){const a=this.owner.cartesian;if(!a)return;const{selfRotation:s}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const u=C.Cartesian3.distance(a,l),h=r/4,c=h*3/128;if(!(u>=h-c&&u<=h+c))return;const A=C.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=A||(n.currentPlaneType=i,n.currentD2c=A,n.currentV=l,n.startRotation=s[Ci.rotationNum[i]])}_getStartInfo(n){var h;const{czmViewer:e}=this.owner,i=(h=e.viewer)==null?void 0:h.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=rr(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:a}=n,s=[r,a],l=n.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(u,i,"heading",s,o),this._pickPlane(u,i,"pitch",s,o),this._pickPlane(u,i,"roll",s,o),u}}function N0(t,n,e){const i=C.Cartesian3.cross(n,t,new C.Cartesian3);if(i.equals(C.Cartesian3.ZERO))return 0;C.Cartesian3.normalize(i,i);const o=C.Cartesian3.dot(i,e);let r=Math.acos(C.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const La=class La extends Xn{constructor(e){super();L(this,"_hoveredPlaneType",this.disposeVar(m.react("none")));L(this,"_movingPlaneType",this.disposeVar(m.react("none")));L(this,"_circles");L(this,"_czmCameraModel");L(this,"_cartesian");L(this,"_planes",{heading:this.disposeVar(new EG(this)),pitch:this.disposeVar(new PG(this)),roll:this.disposeVar(new TG(this))});L(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new m.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new FG(this)})),this._circles={heading:this._createRotatorCircle(i,"heading"),pitch:this._createRotatorCircle(i,"pitch"),roll:this._createRotatorCircle(i,"roll")},!!i.viewer){{const r=()=>{this._cartesian=this.position&&Et(this.position)||void 0};r(),this.dispose(this.positionChanged.disposableOn(r))}this._createCameraModel(i)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new jt(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(m.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(m.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(m.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=ft({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=C.Matrix4.toArray(o))};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};i(),this.dispose(this.enabledChanged.disposableOn(i)),this.dispose(this.showHelperChanged.disposableOn(i))}}_createRotatorCircle(e,i){const o=this.ad(new ll(e));this.dispose(m.track([o,"position"],[this,"position"])),this.dispose(m.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(m.track([o,"debug"],[this,"debug"])),this.dispose(m.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=La.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[La.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const a=this.movingPlaneType===i,s=this.hoveredPlaneType===i,u=[0,0,0,a||s?1:.8];u[La.rotationNum[i]]=1,o.color=u};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};L(La,"rotationNum",{heading:0,pitch:1,roll:2}),L(La,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let Ci=La;(t=>{t.createDefaultProps=()=>({...Xn.createDefaultProps(),rotation:m.reactArray([0,0,0]),selfRotation:m.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(Ci||(Ci={})),m.extendClassProps(Ci.prototype,Ci.createDefaultProps);const za=class za extends m.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??za.defaults.positions[0],this.stopPosition??za.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??za.defaults.positions[0],n??za.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new rt(n,e));o.arcType="RHUMB";const r=this.ad(new ei(n,e));this.ad(m.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(m.track([r,"allowPicking"],[this,"allowPicking"]));{const a=()=>{o.show=r.show=this.show};a(),this.ad(this.showChanged.don(a))}{const a=()=>{o.width=this.width/2,r.pixelSize=this.width};a(),this.ad(this.widthChanged.don(a))}{const a=()=>{o.color=r.color=this.color};a(),this.ad(this.colorChanged.don(a))}{const a=()=>{o.positions=this.positions,r.position=this.stopPosition};a(),this.dispose(this.startPositionChanged.disposableOn(a)),this.dispose(this.stopPositionChanged.disposableOn(a))}}};L(za,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let ka=za;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:m.reactPositions(t.defaults.positions),width:10,color:m.reactArray([1,0,0,1])})})(ka||(ka={})),m.extendClassProps(ka.prototype,ka.createDefaultProps);class kr extends Xn{constructor(e){super();L(this,"_lastPosition");L(this,"_opInfo",{step:this.ad(m.react(!1)),moved:this.ad(m.react(!1)),constraintMode:this.disposeVar(m.react("none")),originPosition:this.disposeVar(m.reactArray([0,0,0])),originHeading:this.disposeVar(m.react(0)),originDimensions:this.disposeVar(m.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(m.reactArray([0,0,0])),movingPosition:this.disposeVar(m.reactArray([0,0,0])),targetPosition:this.disposeVar(m.reactArray([0,0,0])),targetHeading:this.disposeVar(m.react(0))});L(this,"_scaleAxis");L(this,"_pickingXYProcessing",e=>this.disposeVar(new m.Processing((i,o,r)=>{const a=[0,0,0],s=new C.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const u=hi(m.getDomEventCurrentTargetPos(l.pointerEvent));if(!Ha(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;Na(s,a),this._opInfo.constraintMode.value==="x"?Ho(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="y"?Ho(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const h=[0,0,0];N.geoRhumbDestination(a,r,o,h),this._opInfo.targetPosition.value=h;let c=this.scale[0],f=this.scale[1];const A=N.geoDistance(h,this._opInfo.originPosition.value)-N.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...h];const d=this._opInfo.originDimensions.value[0]/100;A!=0&&this._opInfo.constraintMode.value==="y"&&(A>0?c+=d:c-=d),A!=0&&this._opInfo.constraintMode.value==="x"&&(A>0?f+=d:f-=d),c<=0&&(c+=d),f<=0&&(f+=d),this.scale=[c??1,f??1,this.scale[2]??1]})})));L(this,"_pickingZProcessing",e=>this.disposeVar(new m.Processing(()=>{const i=new C.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const a=hi(m.getDomEventCurrentTargetPos(r.pointerEvent));if(!Hh(e.viewer.scene,Et(this._opInfo.originPosition.value),a,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Qe(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s];let u=this.scale[2];const h=o[2]-this._lastPosition[2];this._lastPosition=[...o];const c=this._opInfo.originDimensions.value[0]/100;h!=0&&(h>0?u+=c:u-=c),u<=0&&(u+=c),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new Qd(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const u=()=>{if(!this._scaleAxis)return;const{zAxis:h,yAxis:c,xAxis:f}=this._scaleAxis,A=this._opInfo.constraintMode.value,d=this._opInfo.step;h.color=[0,0,1,.99],c.color=[0,1,0,.99],f.color=[1,0,0,.99],A==="x"?f.color=d?[1,1,0,.8]:[1,1,0,.99]:A==="y"?c.color=d?[1,1,0,.8]:[1,1,0,.99]:A==="z"&&(h.color=d?[1,1,0,.8]:[1,1,0,.99])};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u)),this.dispose(this._opInfo.step.changed.disposableOn(u))}{const u=()=>{if(!this._scaleAxis)return;const{position:c=kr.defaults.position}=this,{zAxis:f,yAxis:A,xAxis:d}=this._scaleAxis;f.startPosition=A.startPosition=d.startPosition=c;const[p,v,y]=c;f.stopPosition=[p,v,y+this._opInfo.originDimensions.value[2]];const g=N.geoRhumbDestination(c,this._opInfo.originDimensions.value[0],90);g&&(d.stopPosition=g);const b=N.geoRhumbDestination(c,this._opInfo.originDimensions.value[1],0);b&&(A.stopPosition=b)};u();const h=this.ad(m.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(h.don(u))}{const u=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((h,c)=>h===this._opInfo.targetPosition.value[c])){this._opInfo.moved.value=!0;return}};u(),this.dispose(this._opInfo.originHeading.changed.disposableOn(u)),this.dispose(this._opInfo.originPosition.changed.disposableOn(u)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(u)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(u))}const r=this._pickingXYProcessing(e),a=this._pickingZProcessing(e),s=this.disposeVar(m.createProcessingFromAsyncFunc(async u=>{do this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",u.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await m.step(u,async h=>{const c=()=>{const d=[...this.position??kr.defaults.position];e.editingHeightOffset&&(d[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=d};h.disposer.dispose((c(),this.positionChanged.disposableOn(c)));const f={constraintMode:"none",startDragPos:[0,0,0]},A=d=>{if(!this.position)return;const p={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};Td(d,o,p,this.axisSnapPixelSize,f),this._opInfo.constraintMode.value=f.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=f.startDragPos};h.disposer.dispose(e.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&A(d.pointerEvent)})),await m.step(h,d=>new Promise((p,v)=>{d.disposer.dispose(v),d.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&A(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&f.constraintMode!=="none"&&p()}))}))}),this._opInfo.step.value=!1,await m.step(u,async h=>{if(e.incrementDisabledInputStack(),h.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const c=N.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),f=N.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,c,f),h.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(a.restart(),h.disposer.dispose(()=>a.cancel()));await m.step(h,c=>new Promise((f,A)=>{c.disposer.dispose(A),c.disposer.dispose(e.pointerUpEvent.don(()=>{f()})),c.disposer.dispose(e.pointerOutEvent.don(()=>{f()}))})),this._lastPosition=void 0});while(!0)})),l=()=>{this.enabled?s.restart():s.isRunning&&s.cancel()};l(),this.dispose(this.enabledChanged.disposableOn(l))}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new ka(e));return o.width=10,this.ad(m.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Xn.createDefaultProps(),scale:m.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(kr||(kr={})),m.extendClassProps(kr.prototype,kr.createDefaultProps);const No=class No extends xn{constructor(e){super();L(this,"_editingPoints",this.disposeVar(new m.ObservableArray));L(this,"_cancelEvent",this.disposeVar(new m.Event));L(this,"_currentProcess");L(this,"_menuPoiEnabled",this.disposeVar(m.react(!1)));L(this,"_status",this.disposeVar(m.react("None")));L(this,"_positionsChanged",this.ad(new m.Event));L(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(i=>{for(let{start:o,deleteCount:r,items:a}of i){for(const s of a)s.menuPoi.enabled=this.menuPoiEnabled??!1;for(let s=o;s<o+r;++s)this.editingPoints.get(s).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let i of this.editingPoints)i.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(i=>{this.ad(m.nextAnimateFrame(()=>{var o;((o=i.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()}))})),this.dispose(this.enabledChanged.disposableOn(i=>{this._currentProcess&&(i?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const i=()=>{this.polylineShow=this.czmViewer.editingLineShow};i(),this.ad(this.czmViewer.editingLineShowChanged.don(i))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let i of this._editingPoints)i.position&&e.push([...i.position]);return e}resetPositions(e){if(this.enabled??No.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const i=e||[];return!(i.length===this.editingPoints.length&&i.every((o,r)=>o.every((a,s)=>{const l=this.editingPoints.get(r);return l.position&&l.position[s]===a})))}forceResetPositions(e){(this.enabled??No.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const i=this.ad(new rt(e));this.ad(m.track([i,"color"],[this,"polylineColor"])),this.ad(m.track([i,"width"],[this,"polylineWidth"])),this.ad(m.track([i,"show"],[this,"polylineShow"])),this.ad(m.track([i,"arcType"],[this,"polylineArcType"])),this.ad(m.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const a of this.getPositions())a[2]-=e.editingHeightOffset??0,r.push(a);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new m.CursorInfo(e.container,m.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(i){if(!this.hideCursorInfo){i.show=!1;return}o==="Adding"?(i.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",i.show=!0):o==="Modifying"||o==="Modifying_Point"?(i.text="Esc键或左键双击:退出编辑状态",i.show=!0):o==="None"&&(i.text="",i.show=!1)}}))}};L(No,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),L(No,"defaults",{...xn.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:No.baseImageUrl+"point-green.png",otherControlPointImageUrl:No.baseImageUrl+"point-yellow.png"});let li=No;(t=>{t.createDefaultProps=()=>({...xn.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:m.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(li||(li={})),m.extendClassProps(li.prototype,li.createDefaultProps);let MG=0;class v2 extends m.Destroyable{constructor(e,i){super();L(this,"_position",this.disposeVar(m.reactArrayWithUndefined(void 0)));L(this,"_id",MG++);L(this,"_menuPoi");i&&(this.position=i),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new rs(e.czmViewer));o.enabled=!1,this.ad(m.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const a=[...this.position];a[2]-=e.czmViewer.editingHeightOffset??0,o.position=a,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const a=e.editingPoints.indexOf(this)+1;a!==0&&(o.title=`控制点${a}`,a===1?o.imageUri=e.firstControlPointImageUrl??li.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??li.defaults.otherControlPointImageUrl)};r(),this.dispose(e.editingPoints.changedEvent.disposableOn(r))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class w2 extends v2{constructor(n,e){super(n,e)}}class Rt extends li{constructor(e){super(e);L(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new m.Event));L(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new bi(e));i.enabled=!1,this.currentProcess=this.disposeVar(m.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Rt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Rt.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(m.step(o,async r=>{const a=r.disposer,s=a.ad(this._addingEditingProcessing());a.dispose(()=>"adding canceled!"),a.dispose(this.cancelEvent.disposableOn(()=>s.cancel())),await r.promise(new Promise(l=>{a.dispose(s.completeEvent.disposableOnce(l))}))}))})),this.dispose(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new w2(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Rt.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},i=m.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1;do if(!await o.promise(m.step(o,async s=>{let l;!e()&&(l=s.disposer.disposeVar(new BG(this,r)));const h=s.disposer.disposeVar(new RG(this,r));return s.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>h.do())),await s.promise(new Promise(c=>{l&&s.disposer.dispose(l.overEvent.disposableOnce(f=>{f?(r++,c(!0)):c(!1)})),s.disposer.dispose(h.overEvent.disposableOnce(f=>{f?(r--,c(!0)):c(!1)})),s.disposer.dispose(this.cancelEvent.disposableOn(()=>c(!1)))}))})))break;while(!0)});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...li.createDefaultProps()})})(Rt||(Rt={})),m.extendClassProps(Rt.prototype,Rt.createDefaultProps);class BG extends m.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new m.Event));const{placeEditing:o}=e;let r=new w2(e,void 0);e.editingPoints.splice(i,0,r);const a=()=>{(e.debug??Rt.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(r);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(m.track([r,"position"],[o,"position"])),o.enabled=!0;let s=!1;const l=()=>{a(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!s&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{s=!0,r.position===void 0?l():this._overEvent.emit(!0)})),(e.debug??Rt.defaults.debug)&&console.log(`PointAdding creating! index(${i})`),this.dispose(()=>{(e.debug??Rt.defaults.debug)&&console.log(`PointAdding destroying! index(${i})`)})}get overEvent(){return this._overEvent}}function DG(t,n){const e=t.editingPoints,i=n-1;return i<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(i,1),!0)}class RG extends m.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new m.Event));L(this,"_doEvent",this.disposeVar(new m.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(DG(e,i)))),(e.debug??Rt.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${i})`),this.dispose(()=>{(e.debug??Rt.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${i})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class _2 extends Rt{constructor(n){super(n),this.loop=!1}}class b2 extends Rt{constructor(n){super(n),this.loop=!0}}class md extends v2{constructor(n,e){super(n,e);{const{menuPoi:i}=this;i.commands=[["add","增加控制点","",st.baseImageUrl+"add.png"],["delete","删除当前控制点","",st.baseImageUrl+"delete.png"],["modify","修改当前控制点","",st.baseImageUrl+"modify.png"]],i.clickCommandName="modify",i.rightClickCommandName="delete",this.dispose(i.commandEvent.disposableOn(o=>{n.menuPoiCommand(this,o)})),this.dispose(i.dbclickEvent.disposableOn(()=>{n.menuPoiCommand(this,"dbClick")}))}if(n.middlePointShow){const i=this.ad(new Bi(n.czmViewer));{i.imageUri=n.firstControlPointImageUrl??st.defaults.firstControlPointImageUrl,i.tooltip="点击增加一个控制点",i.bgColor=[0,0,0,.6],i.fgColor=[1,1,1,1],i.size=[8,8],i.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{if(!(n.enabled??st.defaults.enabled)){i.enabled=!1,i.show=!1;return}do{const a=n.editingPoints.indexOf(this);if(a===-1)break;const s=n.editingPoints.length;if(s===0){console.error("impl.positionEditors.length === 0!");break}if(!(n.loop??st.defaults.loop)&&a+1>=s)break;const u=this.position;if(!u)break;let h=(a+1)%s;const f=n.editingPoints.get(h).position;if(!f)break;const A=Md(u,f);if(!A)break;A[2]-=n.czmViewer.editingHeightOffset??0,i.position=A;const d=n.editingPoints.length<(n.maxPointsNum??st.defaults.maxPointsNum);i.enabled=d,i.show=d;return}while(!1);i.enabled=!1,i.show=!1};o(),this.dispose(n.positionsChanged.disposableOn(o)),this.dispose(n.loopChanged.disposableOn(o)),this.dispose(n.enabledChanged.disposableOn(o))}this.dispose(i.clickEvent.disposableOn(o=>{if(o.button!==0||n.editingPoints.length>=(n.maxPointsNum??st.defaults.maxPointsNum))return;const r=n.editingPoints.indexOf(this);if(r===-1)return;const a=i.position?[...i.position]:void 0;a&&(a[2]+=n.czmViewer.editingHeightOffset??0);let s=new md(n,a);n.editingPoints.splice(r+1,0,s),n.modify(s)}))}}}}class st extends li{constructor(e){super(e);L(this,"_menuPoiCommand",this.disposeVar(new m.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new m.Event));L(this,"_overEvent",this.disposeVar(new m.Event));L(this,"translationEditing");{const o=this.ad(m.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new m.ObjResettingWithEvent(o,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new OG(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new Ir(e));i.enabled=!1,this.currentProcess=this.disposeVar(m.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??st.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1});let r=-1;do if((this.debug??st.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",r=await o.promise(m.step(o,async a=>{const s=a.disposer,l=s.ad(new UG(this));return s.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&l.modify(this.editingPoints.get(r===-1||r>=this.editingPoints.length?0:r)),s.dispose(this.cancelEvent.disposableOn(()=>l.cancel())),s.dispose(this._forceModifyPosEditorEvent.disposableOn(h=>l.modify(h))),await a.promise(new Promise(h=>{s.dispose(l.overEvent.disposableOnce(c=>{h(c)}))}))})),r===-1){(this.debug??st.defaults.debug)&&console.log("退出编辑状态");break}else{if(this.editingPoints.length>=(this.maxPointsNum??st.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??st.defaults.loop;const s=this.editingPoints.get(r-1).position;if(!s)return;let l=r%this.editingPoints.length;const h=this.editingPoints.get(l).position;if(!h)return;const c=Md(s,h);if(!c)return;c&&(c[2]+=this.czmViewer.editingHeightOffset??0);let f=new md(this,c);this.editingPoints.splice(r,0,f)}while(!0);this.status="None",this.enabled=!1}))}menuPoiCommand(e,i){this._menuPoiCommand.emit(e,i)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new md(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...li.createDefaultProps(),moveWithFirstPosition:!1})})(st||(st={})),m.extendClassProps(st.prototype,st.createDefaultProps);class OG extends m.Destroyable{constructor(n,e){super(),this._firstPositionEditor=n,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((i,o)=>{if(i===void 0||o===void 0)return;var r=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];const a=this.multiPointsModifyEditing.editingPoints.length;for(let s=1;s<a;s++){const l=this.multiPointsModifyEditing.editingPoints.get(s),u=l.position;u!==void 0&&(l.position=[u[0]+r[0],u[1]+r[1],u[2]+r[2]])}})}}class UG extends m.Destroyable{constructor(e){super();L(this,"_overEvent",this.disposeVar(new m.Event));L(this,"_cancelEvent",this.disposeVar(new m.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new m.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let i;const o=()=>{i==null||i.destroy(),i=void 0,e.status="Modifying"};this.dispose(o);const r=a=>{o(),e.status="Modifying_Point",i=new LG(e,a),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((a,s)=>{if(s==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(s==="modify")r(a);else if(s==="add"){const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else s==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${s})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class LG extends m.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new m.Event));this._modifying=e,this._posEditor=i,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(m.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class C2 extends st{constructor(n){super(n),this.loop=!1}}class x2 extends st{constructor(n){super(n),this.loop=!0}}class ul extends Rt{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=N.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const i=N.geoHeading(this.startPosition,this.endPosition),o=N.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/o)*180/Math.PI,s=Math.sqrt(o*o+r*r);this.rotation=[i,a,0],this.distance=s};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Rt.createDefaultProps(),startPosition:m.reactArrayWithUndefined(void 0),endPosition:m.reactArrayWithUndefined(void 0),rotation:m.reactArray([90,0,0]),distance:m.react(1)})})(ul||(ul={})),m.extendClassProps(ul.prototype,ul.createDefaultProps);class Fa extends st{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=N.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{do{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];break}if(this.startPosition=this.positions[0],this.positions.length==1){this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",st.baseImageUrl+"add.png"],["delete","删除当前控制点","",st.baseImageUrl+"delete.png"],["modify","修改当前控制点","",st.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;break}this.endPosition=this.positions[1];for(let l of this.editingPoints)l.menuPoi.commands=[["delete","删除当前控制点","",st.baseImageUrl+"delete.png"],["modify","修改当前控制点","",st.baseImageUrl+"modify.png"]];const i=N.geoHeading(this.startPosition,this.endPosition),o=N.geoDistance(this.startPosition,this.endPosition);if(Math.abs(o)<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/o)*180/Math.PI,s=Math.sqrt(o*o+r*r);this.rotation=[i,a,0],this.distance=s}while(!1)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...st.createDefaultProps(),startPosition:m.reactArrayWithUndefined(void 0),endPosition:m.reactArrayWithUndefined(void 0),rotation:m.reactArray([0,0,0]),distance:m.react(0)})})(Fa||(Fa={})),m.extendClassProps(Fa.prototype,Fa.createDefaultProps);class S2 extends Rt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class E2 extends st{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class cl extends Rt{constructor(n){super(n),n.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(n){const e=this.ad(new pi(n));e.topOrBottom="bottom",this.ad(m.track([e,"color"],[this,"polylineColor"])),this.ad(m.track([e,"width"],[this,"polylineWidth"])),this.ad(m.track([e,"show"],[this,"polylineShow"])),this.ad(m.track([e,"arcType"],[this,"polylineArcType"])),this.ad(m.track([e,"loop"],[this,"loop"])),this.ad(m.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Rt.createDefaultProps(),visibilityPositions:m.reactPositionsSet(void 0)})})(cl||(cl={})),m.extendClassProps(cl.prototype,cl.createDefaultProps);class hl extends st{constructor(n){if(super(n),!!n.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(n){const e=this.ad(new pi(n));e.topOrBottom="bottom",this.ad(m.track([e,"color"],[this,"polylineColor"])),this.ad(m.track([e,"width"],[this,"polylineWidth"])),this.ad(m.track([e,"show"],[this,"polylineShow"])),this.ad(m.track([e,"arcType"],[this,"polylineArcType"])),this.ad(m.track([e,"loop"],[this,"loop"])),this.ad(m.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...st.createDefaultProps(),visibilityPositions:m.reactPositionsSet(void 0)})})(hl||(hl={})),m.extendClassProps(hl.prototype,hl.createDefaultProps);class P2 extends Fa{constructor(n){super(n),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class gn extends N.EngineObject{constructor(e,i,o){super(e,i,o??!0);L(this,"_supportEditing",this.disposeVar(m.react(!0)));L(this,"_currentEditing",this.disposeVar(m.react(void 0)));this.ad(this.supportEditingChanged.don(()=>{this.destroy()})),this.ad(this.toDestroyEvent.don(()=>{var r;if(this.currentEditing){if(this.currentEditing instanceof Rt&&((r=this.currentEditing.currentProcess)!=null&&r.isRunning))if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}else e.points=this.currentEditing.positions;this.currentEditing instanceof bi&&this.currentEditing.enabled&&(e.position=[0,0,0])}}))}get supportEditing(){return this._supportEditing.value}set supportEditing(e){this._supportEditing.value=e}get supportEditingChanged(){return this._supportEditing.changed}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const Sh=class Sh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new bi(e));this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)}));do{if(Reflect.has(n,"position")){this.ad(m.bind([i,"position"],[n,"position"])),i.enabled=!i.position||N.equalsN3(i.position,[0,0,0]);break}this.supportEditing=!1}while(!1)}};L(Sh,"type",Sh.registerEditing("ESCesiumViewer",N.ESJEditingMode.Place,Sh));let V0=Sh;const Eh=class Eh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Ci(e));i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(n instanceof N.ES3DTileset){N.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(m.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(m.bind([i,"selfRotation"],[n,"rotation"])))});break}if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){this.ad(m.bind([i,"position"],[n,"position"])),this.ad(m.bind([i,"selfRotation"],[n,"rotation"]));break}this.supportEditing=!1}while(!1)}};L(Eh,"type",Eh.registerEditing("ESCesiumViewer",N.ESJEditingMode.Rotation,Eh));let H0=Eh;const Ph=class Ph extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new kr(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"position")&&Reflect.has(n,"scale")){this.ad(m.bind([i,"position"],[n,"position"])),this.ad(m.bind([i,"scale"],[n,"scale"]));break}this.supportEditing=!1}while(!1)}};L(Ph,"type",Ph.registerEditing("ESCesiumViewer",N.ESJEditingMode.Scale,Ph));let G0=Ph;const Th=class Th extends gn{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new Ir(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const a=n[r];Reflect.has(a,"position")?o.push(a.position):a.points&&o.push(...a.points)}i.position=N.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(!(!r||!a)){var s=En({originPosition:a},[r])[0][0];n.forEach(l=>{if(Reflect.has(l,"position")){const u=En({originPosition:a},[l.position])[0][0];l.position=Nr({originPosition:a},[[u[0]+s[0],u[1]+s[1],u[2]+s[2]]])[0][0]}else if(Reflect.has(l,"points")&&l.points){const u=En({originPosition:a},l.points)[0];l.points=Nr({originPosition:a},u.map(h=>[h[0]+s[0],h[1]+s[1],h[2]+s[2]]))[0]}})}}));break}if(Reflect.has(n,"position")){this.ad(m.bind([i,"position"],[n,"position"]));break}if(n instanceof N.ES3DTileset){N.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(m.bind([i,"position"],[o.czm3DTiles,"position"]))});break}if(Reflect.has(n,"points")){if(n.points===void 0||n.points.length===0){this.destroy();break}i.position=N.getMinMaxCorner(n.points).center,this.ad(i.positionChanged.disposableOn((o,r)=>{if(o===void 0||r===void 0||n.points===void 0||n.points.length===0){this.destroy();return}var a=En({originPosition:r},[o])[0][0];const s=En({originPosition:r},n.points)[0];n.points=Nr({originPosition:r},s.map(l=>[l[0]+a[0],l[1]+a[1],l[2]+a[2]]))[0]}));break}this.supportEditing=!1}while(!1)}};L(Th,"type",Th.registerEditing("ESCesiumViewer",N.ESJEditingMode.Translation,Th));let gd=Th;const Ih=class Ih extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ul(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"position")){this.ad(m.bind([i,"startPosition"],[n,"position"])),this.ad(Vt([i,"rotation"],[n,"rotation"]));do{if(Reflect.has(n,"far")){this.ad(m.bind([i,"distance"],[n,"far"]));break}if(Reflect.has(n,"radius")){this.ad(m.bind([i,"distance"],[n,"radius"]));break}if(Reflect.has(n,"distance")){this.ad(m.bind([i,"distance"],[n,"distance"]));break}const o=Et(n.position);if(C.Cartesian3.ZERO.equals(o)||!e.viewer)return;i.distance=rr(e.viewer.scene,o,100)??1}while(!1);break}if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1);i.startPosition&&!N.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};L(Ih,"type",Ih.registerEditing("ESCesiumViewer",N.ESJEditingMode.DoublePointsAppend,Ih));let W0=Ih;const kh=class kh extends gn{constructor(n,e){var r;if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new Fa(e));do{if(Reflect.has(n,"position")){this.ad(m.bind([i,"startPosition"],[n,"position"])),this.ad(Vt([i,"rotation"],[n,"rotation"]));do{if(Reflect.has(n,"far")){this.ad(m.bind([i,"distance"],[n,"far"]));break}if(Reflect.has(n,"radius")){this.ad(m.bind([i,"distance"],[n,"radius"]));break}if(Reflect.has(n,"distance")){this.ad(m.bind([i,"distance"],[n,"distance"]));break}const a=Et(n.position);if(C.Cartesian3.ZERO.equals(a)||!e.viewer)return;i.distance=rr(e.viewer.scene,a,100)??1}while(!1);break}if(Reflect.has(n,"points")&&((r=n.points)==null?void 0:r.length)==2){i.moveWithFirstPosition=!1;const a=()=>i.positions=n.points??[];a(),this.ad(n.pointsChanged.don(()=>!i.enabled&&a())),this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1;return}while(!1);i.init(),i.enabled=!0;const o=this.ad(m.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||N.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(kh,"type",kh.registerEditing("ESCesiumViewer",N.ESJEditingMode.DoublePointsModify,kh));let q0=kh;const Fh=class Fh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new b2(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Fh,"type",Fh.registerEditing("ESCesiumViewer",N.ESJEditingMode.CircularAppend,Fh));let K0=Fh;const Mh=class Mh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new x2(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Mh,"type",Mh.registerEditing("ESCesiumViewer",N.ESJEditingMode.CircularInsert,Mh));let X0=Mh;const Bh=class Bh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new _2(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Bh,"type",Bh.registerEditing("ESCesiumViewer",N.ESJEditingMode.LineStringAppend,Bh));let $0=Bh;const Dh=class Dh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new C2(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Dh,"type",Dh.registerEditing("ESCesiumViewer",N.ESJEditingMode.LineStringInsert,Dh));let Z0=Dh;const Rh=class Rh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new S2(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Rh,"type",Rh.registerEditing("ESCesiumViewer",N.ESJEditingMode.ScatterAppend,Rh));let Y0=Rh;const Oh=class Oh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new E2(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Oh,"type",Oh.registerEditing("ESCesiumViewer",N.ESJEditingMode.ScatterModify,Oh));let J0=Oh;const Uh=class Uh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new cl(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Uh,"type",Uh.registerEditing("ESCesiumViewer",N.ESJEditingMode.VisibilityAppend,Uh));let j0=Uh;const Lh=class Lh extends gn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new hl(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(m.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(m.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Lh,"type",Lh.registerEditing("ESCesiumViewer",N.ESJEditingMode.VisibilityModify,Lh));let ew=Lh;const zh=class zh extends gn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new P2(e));do{if(Reflect.has(n,"points")){const r=Reflect.has(n,"extrudedHeight"),a=Reflect.has(n,"height"),s=Reflect.has(n,"perPositionHeight")?n.perPositionHeight:!r,l=n instanceof N.ESClassification||n instanceof N.ESPolygonFence;let u=N.getMinMaxCorner(n.points).center,h=[...u],c=l?n.points[0][2]:0;s?r?h[2]=n.extrudedHeight:h[2]=n.height+c:(a&&(u[2]=n.height),r&&(h[2]=n.extrudedHeight)),i.startPosition=u,i.distance=h[2]-u[2],i.moveWithFirstPosition=!1;let f=[...u];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(s?(n.points=n.points.map(A=>[A[0],A[1],A[2]+i.positions[0][2]-f[2]]),r?n.extrudedHeight=i.positions[1][2]:a&&(n.height=i.positions[1][2]-(l?i.positions[0][2]:0))):(a&&(n.height=i.positions[0][2]),r&&(n.extrudedHeight=i.positions[1][2])),f=[...i.positions[0]])}));break}this.supportEditing=!1;return}while(!1);i.init(),i.enabled=!0;const o=this.ad(m.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||N.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(zh,"type",zh.registerEditing("ESCesiumViewer",N.ESJEditingMode.HeightModify,zh));let tw=zh;function T2(){const t=m.createProcessingFromAsyncFunc(async(n,e,i,o,r=!0)=>{const a=Array.isArray(o)?[...o]:[o],s=i.editingID;e.editingEvent.emit({objectIDs:[i.id.split("_")[0]],editingID:s,type:"start",add:{modes:a}});const l=()=>{e.notSupportEditingCount=0,e.editingEvent.emit({objectIDs:[i.id.split("_")[0]],editingID:s,type:"end",add:{modes:a}}),t.isRunning&&t.cancel()};n.disposer.ad(l),n.disposer.ad(i.toDestroyEvent.don(l)),n.disposer.ad(e.keyDownEvent.don(h=>{h.code=="Escape"&&l()}));let u=0;do{const h=a[u%a.length],c=await m.step(n,async f=>{const A=f.disposer,d=N.EngineObject.contextEditing.getEngineObjConstructor(h,e.typeName);if(!d||!i.supportEditingModes().includes(h))return console.log(`未找到编辑模式或不支持当前编辑模式${h},已跳过当前编辑模式,请检查输入`),e.editingEvent.emit({objectIDs:[i.id.split("_")[0]],editingID:s,type:"changedFailed",add:{cMode:h,cIndex:u}}),e.notSupportEditingCount++,!1;const p=new d(i,e);if(A.ad(()=>{!p.isDestroyed()&&p.destroy()}),p.supportEditing)e.editingEvent.emit({objectIDs:[i.id.split("_")[0]],editingID:s,type:"changed",add:{cMode:h,cIndex:u}}),e.notSupportEditingCount=0;else return console.log(`未找到编辑模式或不支持当前编辑模式${h},已跳过当前编辑模式,请检查输入`),e.editingEvent.emit({objectIDs:[i.id.split("_")[0]],editingID:s,type:"changedFailed",add:{cMode:h,cIndex:u}}),e.notSupportEditingCount++,!1;return await f.promise(new Promise(y=>{p.isDestroyed()&&y(!1),A.ad(p.toDestroyEvent.don(()=>{console.log(`编辑模式${h}结束`),y(!1)})),r&&(A.ad(e.keyDownEvent.don(g=>{g.code=="Space"&&(console.log(`编辑模式${h}结束`),y(!1))})),A.ad(e.dblclickEvent.don(()=>y(!0))))}))});if(r&&c||!r&&u==a.length-1||e.notSupportEditingCount==a.length)break;u++}while(!0)});return t}function I2(){const t=m.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(s=>s.id.split("_")[0]),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(s=>s.id.split("_")[0]),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r),n.disposer.ad(e.keyDownEvent.don(s=>{s.code=="Escape"&&r()}));const a=new gd(i,e);n.disposer.ad(()=>{!a.isDestroyed()&&a.destroy()}),await n.promise(new Promise(s=>{a.isDestroyed()&&s(),n.disposer.ad(a.toDestroyEvent.don(()=>{console.log("移动结束"),s()})),n.disposer.ad(e.dblclickEvent.don(()=>s()))}))});return t}se.copyright=void 0;try{const t="earthsdk3-cesium",n="3.2.0-beta.2",e="2025-06-20T09:39:24.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="541f35d8eb94e9d6ae9e8f6de5f1aa5fb9895acd",s=((Date.now()-1750412364e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
|
|
4692
4692
|
%c${o?o+`
|
|
4693
4693
|
`:""}当前网站正在使用${t},此软件版权归${i}所有
|
|
4694
|
-
`;se.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4694
|
+
`;se.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","541f35d8eb94e9d6ae9e8f6de5f1aa5fb9895acd")},get info(){return l},get date(){return"2025-06-20T09:39:24.000Z"},get author(){return"suplyang"},get version(){return"3.2.0-beta.2"},get name(){return"earthsdk3-cesium"},get commitId(){return"541f35d8eb94e9d6ae9e8f6de5f1aa5fb9895acd"},print(){console.info(this.info,`
|
|
4695
4695
|
font-size: 18px;
|
|
4696
4696
|
font-weight: 1000;
|
|
4697
4697
|
line-height: 1;
|