earthsdk3-cesium 3.7.0 → 3.7.1

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.
@@ -1272,7 +1272,7 @@ export type IndexJsonType = {
1272
1272
  \`\`\`
1273
1273
  ${rE}
1274
1274
  \`\`\`
1275
- `,st=class st extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_loadFuncReact",this.disposeVar(A.react(void 0)));y(this,"_dataSource",this.disposeVar(A.react(void 0)));y(this,"_data");y(this,"_defaultHeight",{});y(this,"defaultBoundingSphere");y(this,"_featureStyles",this.disposeVar(A.react(void 0)));const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}let o=()=>{this.dataSource&&r.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{o()});{const s=this.dv(A.createProcessingFromAsyncFunc(async u=>{this.dataSource&&o(),this.url&&(typeof this.url=="object"?this._data=this.url:A.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(A.ESSceneObject.context.getStrFromEnv(this.url)).then(h=>h.json()).then(h=>{this._data=h}).catch(h=>{console.warn("ESGeoJson数据加载失败",h)}),this.dataSource=await d.GeoJsonDataSource.load(this._data),r.dataSources.add(this.dataSource).then(h=>{var f,g;const p=[];for(const m of h.entities.values){if(d.Entity.prototype&&(m.ESSceneObjectID=n),this._isEntityShow(m,e),m.polygon){p.push(...(f=m.polygon.hierarchy)==null?void 0:f.getValue(d.JulianDate.now()).positions);continue}if(m.polyline){p.push(...(g=m.polyline.positions)==null?void 0:g.getValue(d.JulianDate.now()));continue}if(m.position){const v=m.position.getValue(d.JulianDate.now());v&&p.push(v);continue}}this.defaultBoundingSphere=p.length>0?d.BoundingSphere.fromPoints(p):void 0}))})),a=()=>{s.isRunning&&s.cancel(),s.restart()};a();const l=this.dv(A.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(l.don(a))}{const s=()=>{var l,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(h){console.error(h)}else{const h=this.dataSource.entities.values;for(let p=0;p<h.length;p++){const f=h[p],g=this._getFeatureStyles(f);if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(l=f.polygon.height)==null?void 0:l.getValue(d.JulianDate.now())),f.polygon.height=g.fillGround?void 0:new d.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new d.ConstantProperty(!g.fillGround),f.polygon.heightReference=new d.ConstantProperty(d.HeightReference[g.heightReference.toUpperCase()]),f.polygon.show=new d.ConstantProperty(g.filled??st.defaults.filled),f.polygon.material=new d.ColorMaterialProperty(new d.Color(...g.fillColor??st.defaults.fillColor)),f.polygon.outline=new d.ConstantProperty(!1),f.polygon.classificationType=d.ClassificationType[g.classificationType.toUpperCase()],f.polyline=new d.PolylineGraphics;const m=JSON.parse(JSON.stringify((u=f.polygon.hierarchy)==null?void 0:u.getValue(d.JulianDate.now()).positions));d.Cartesian3.equals(m[0],m[m.length-1])||m.push(m[0]),f.polyline.positions=m}if(f.polyline&&(f.polyline.classificationType=d.ClassificationType[g.classificationType.toUpperCase()],f.polyline.show=new d.ConstantProperty(g.stroked??st.defaults.stroked),f.polyline.width=new d.ConstantProperty(g.strokeWidth??st.defaults.strokeWidth),f.polyline.material=new d.ColorMaterialProperty(new d.Color(...g.strokeColor??st.defaults.strokeColor)),f.polyline.clampToGround=new d.ConstantProperty(g.strokeGround)),f.billboard){f.billboard.show=new d.ConstantProperty(g.imageShow??st.defaults.imageShow),f.billboard.width=new d.ConstantProperty(g.imageSize?g.imageSize[0]:st.defaults.imageSize[0]),f.billboard.height=new d.ConstantProperty(g.imageSize?g.imageSize[1]:st.defaults.imageSize[1]);const m=g.imageUrl?typeof g.imageUrl=="string"?g.imageUrl:g.imageUrl.url:st.defaults.imageUrl;f.billboard.image=new d.ConstantProperty(A.ESSceneObject.context.getStrFromEnv(m)),f.billboard.horizontalOrigin=new d.ConstantProperty(d.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new d.ConstantProperty(d.VerticalOrigin.TOP),f.billboard.heightReference=new d.ConstantProperty(d.HeightReference[g.heightReference.toUpperCase()]);const v=g.imageAnchor??st.defaults.imageAnchor,w=g.imageOffset??st.defaults.imageOffset;if(f.billboard.pixelOffset=new d.ConstantProperty(d.Cartesian2.fromArray([-v[0]*f.billboard.width.getValue(d.JulianDate.now())+w[0],-v[1]*f.billboard.height.getValue(d.JulianDate.now())+w[1]])),f.label=new d.LabelGraphics,!f.label)return;f.label.show=new d.ConstantProperty(g.textShow??st.defaults.textShow),f.label.heightReference=new d.ConstantProperty(d.HeightReference[g.heightReference.toUpperCase()]),f.label.text=new d.ConstantProperty(g.textProperty&&g.textProperty!==""&&f.properties&&f.properties[g.textProperty]?f.properties[g.textProperty].getValue():g.textDefaultText??st.defaults.textDefaultText),f.label.fillColor=new d.ConstantProperty(new d.Color(...g.textColor??st.defaults.textColor)),f.label.showBackground=new d.ConstantProperty(g.textBackgroundColor!=null);const C=g.textFontSize&&g.textFontSize!=0?g.textFontSize:st.defaults.textFontSize,x=g.textOffset??st.defaults.textOffset;f.label.backgroundColor=new d.ConstantProperty(new d.Color(...g.textBackgroundColor??st.defaults.textBackgroundColor)),f.label.font=new d.ConstantProperty(`${g.textFontStyle} ${g.textFontWeight} ${C}px ${g.textFontFamily??st.defaults.textFontFamily}`),f.label.horizontalOrigin=new d.ConstantProperty(d.HorizontalOrigin.LEFT),f.label.verticalOrigin=new d.ConstantProperty(d.VerticalOrigin.TOP),f.label.eyeOffset=new d.ConstantProperty(d.Cartesian3.fromArray([0,0,-1]));const B=g.textAnchor??st.defaults.textAnchor;f.label.pixelOffset=new d.ConstantProperty(d.Cartesian2.fromArray([-B[0]*((g.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(d.JulianDate.now()),f.label.font.getValue(d.JulianDate.now())))+x[0],-B[1]*((g.textBackgroundColor?10:0)+C)+x[1]]))}}}};s();const a=this.dv(A.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged,this.classificationTypeChanged,this.featureStylesChanged));this.dispose(a.don(s))}{const s=()=>{if(!this.dataSource)return;const l=this.dataSource.entities.values;for(let u=0;u<l.length;u++){const h=l[u];this._isEntityShow(h,e)}};s();const a=this.ad(A.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(a.don(s))}{const s=()=>{if(this.loadFuncStr)try{const a=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=a}catch(a){console.error(a),this.loadFun=void 0}else this.loadFun=void 0};s(),this.dispose(this.loadFuncStrChanged.disposableOn(s))}this.dispose(this.flyToEvent.disposableOn(s=>{e.actived&&this.dataSource&&this.defaultBoundingSphere&&r.camera.flyToBoundingSphere(this.defaultBoundingSphere,{duration:s?s/1e3:void 0})}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}get featureStyles(){return this._featureStyles.value}set featureStyles(e){this._featureStyles.value=e}get featureStylesChanged(){return this._featureStyles.changed}_getFeatureStyles(e){var n;if(!this.featureStyles||this.featureStyles.length==0)return this.mergeFeatureStyles();for(let r=0;r<this.featureStyles.length;r++){const o=this.featureStyles[r],s=Array.isArray(o.condition)?o.condition:[o.condition],a=[];for(let l=0;l<s.length;l++){if(!e.properties){a.push(!1);continue}const u=s[l];if(typeof u=="boolean"){a.push(!0);continue}const h=(n=e.properties[u.field])==null?void 0:n.getValue(d.JulianDate.now()),p=typeof u.value=="string",f=typeof u.value=="number";if(p){a.push(A0(u,h));continue}else if(f){a.push(l0(u,h));continue}else{a.push(!1);continue}}if(a.length>0&&!a.includes(!1))return this.mergeFeatureStyles(o)}return this.mergeFeatureStyles()}mergeFeatureStyles(e={}){const{filled:n,stroked:r,fillStyle:o,strokeStyle:s,imageShow:a,imageStyle:l,textShow:u,textStyle:h}=e;return{imageShow:a??this.imageShow,imageUrl:(l==null?void 0:l.url)??this.imageUrl,imageAnchor:(l==null?void 0:l.anchor)??this.imageAnchor,imageOffset:(l==null?void 0:l.offset)??this.imageOffset,imageSize:(l==null?void 0:l.size)??this.imageSize,textShow:u??this.textShow,textProperty:(h==null?void 0:h.textProperty)??this.textProperty,textDefaultText:(h==null?void 0:h.defaultText)??this.textDefaultText,textColor:(h==null?void 0:h.color)??this.textColor,textBackgroundColor:(h==null?void 0:h.backgroundColor)??this.textBackgroundColor,textFontFamily:(h==null?void 0:h.fontFamily)??this.textFontFamily,textFontSize:(h==null?void 0:h.fontSize)??this.textFontSize,textFontStyle:(h==null?void 0:h.fontStyle)??this.textFontStyle,textFontWeight:(h==null?void 0:h.fontWeight)??this.textFontWeight,textAnchor:(h==null?void 0:h.anchor)??this.textAnchor,textOffset:(h==null?void 0:h.offset)??this.textOffset,stroked:r??this.stroked,filled:n??this.filled,strokeWidth:(s==null?void 0:s.width)??this.strokeWidth,strokeWidthType:(s==null?void 0:s.widthType)??this.strokeWidthType,strokeColor:(s==null?void 0:s.color)??this.strokeColor,strokeMaterial:(s==null?void 0:s.material)??this.strokeMaterial,strokeMaterialParams:(s==null?void 0:s.materialParams)??this.strokeMaterialParams,strokeGround:(s==null?void 0:s.ground)??this.strokeGround,fillColor:(o==null?void 0:o.color)??this.fillColor,fillMaterial:(o==null?void 0:o.material)??this.fillMaterial,fillMaterialParams:(o==null?void 0:o.materialParams)??this.fillMaterialParams,fillGround:(o==null?void 0:o.ground)??this.fillGround,heightReference:this.heightReference,classificationType:this.classificationType}}_getTextPixelWidth(e,n="16px sans-serif"){const o=document.createElement("canvas").getContext("2d");return o.font=n,o.measureText(e).width}_isEntityShow(e,n){var r;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0)e.show=this.show;else if((r=n.viewer)!=null&&r.camera){if(!this.show){e.show=this.show;return}const o=d.JulianDate.now();let s;if(e.polygon&&e.polygon.hierarchy)s=A.getMinMaxCorner(e.polygon.hierarchy.getValue(o).positions.map(u=>he(u))).center;else if(e.polyline&&e.polyline.positions)s=A.getMinMaxCorner(e.polyline.positions.getValue(o).map(u=>he(u))).center;else if(e.position){const u=e.position.getValue(o);u&&(s=he(u))}if(!s||isNaN(s[0]))return;const a=A.getDistancesFromPositions([s,xi(n.viewer.camera)],"NONE")[0];let l=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?l=this.minFeatureVisibleDistance<a&&a<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?l=a>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(l=a<this.maxFeatureVisibleDistance),e.show=this.show&&l}}};y(st,"defaults",{show:!0,allowPicking:!0,url:oE,defaultLoadFuncStr:rE,defaultLoadFuncDocStr:L5,data:R5,dataMd:Q5,stroked:!0,strokeWidth:1,strokeWidthType:"world",strokeColor:[.79,.91,.06,1],strokeMaterial:"",strokeMaterialParams:{},strokeGround:!1,filled:!0,fillColor:[.79,.91,.06,.2],fillMaterial:"",fillMaterialParams:{},fillGround:!1,imageShow:!0,imageUrl:"${earthsdk3-assets-script-dir}/assets/misc/location.png",imageSize:[64,64],imageAnchor:[.5,1],imageOffset:[0,0],textShow:!0,textProperty:"",textDefaultText:"默认标注",textColor:[1,1,1,1],textBackgroundColor:[.79,.91,.06,1],textFontFamily:"Arial",textFontSize:16,textFontWeight:"normal",textFontStyle:"normal",textAnchor:[.5,1],textOffset:[0,0],strokeWidthTypes:[["screen","screen"],["world","world"]],minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReferences:[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]]});let ss=st;(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:A.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:A.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:A.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:A.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:A.reactArrayWithUndefined(void 0),imageAnchor:A.reactArrayWithUndefined(void 0),imageOffset:A.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:A.reactArrayWithUndefined(void 0),textBackgroundColor:A.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:A.reactArrayWithUndefined(void 0),textOffset:A.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(ss||(ss={})),A.extendClassProps(ss.prototype,ss.createDefaultProps);const zc=class zc extends Ci{constructor(e,n){super(e,n);y(this,"_pointFeatures",this.disposeVar(A.react(void 0)));y(this,"_defaultPointsBoundingSphere");y(this,"screenObjectIdsLabel",new Set);y(this,"screenObjectIdsBillboard",new Set);y(this,"_featureStyles",this.disposeVar(A.react(void 0)));y(this,"_textMeasureCtx");const r=n.viewer;if(!r){console.warn("viewer is undefined!");return}const o=ht(r);if(!o)return;const{screenManager:s}=o,a=this.disposeVar(new ss(n,e.id));{const l=()=>{if(a.featureStyles=this.featureStyles=void 0,!e.features)return;const u=A.toGeoJson(e.features),h={type:u.type,features:[]};a.url={type:u.type,features:u.features.filter(p=>p.geometry.type.toLowerCase().includes("point")?(h.features.push(p),!1):!0)},this.pointFeatures=h};l(),this.ad(e.featuresChanged.don(l))}this.ad(A.track([a,"show"],[e,"show"])),this.ad(A.track([a,"allowPicking"],[e,"allowPicking"])),this.ad(A.track([a,"loadFuncStr"],[e,"loadFuncStr"])),this.ad(A.track([a,"stroked"],[e,"stroked"])),this.ad(A.track([a,"strokeWidth"],[e,"strokeWidth"])),this.ad(A.track([a,"strokeWidthType"],[e,"strokeWidthType"])),this.ad(A.track([a,"strokeColor"],[e,"strokeColor"])),this.ad(A.track([a,"strokeMaterial"],[e,"strokeMaterial"])),this.ad(A.track([a,"strokeMaterialParams"],[e,"strokeMaterialParams"])),this.ad(A.track([a,"strokeGround"],[e,"strokeGround"])),this.ad(A.track([a,"filled"],[e,"filled"])),this.ad(A.track([a,"fillColor"],[e,"fillColor"])),this.ad(A.track([a,"fillMaterial"],[e,"fillMaterial"])),this.ad(A.track([a,"fillMaterialParams"],[e,"fillMaterialParams"])),this.ad(A.track([a,"fillGround"],[e,"fillGround"])),this.ad(A.track([a,"minFeatureVisibleDistance"],[e,"minFeatureVisibleDistance"])),this.ad(A.track([a,"maxFeatureVisibleDistance"],[e,"maxFeatureVisibleDistance"])),this.ad(A.track([a,"heightReference"],[e,"heightReference"])),this.ad(A.track([a,"classificationType"],[e,"classificationType"]));{const l=()=>{!this.pointFeatures||this.pointFeatures.features.length==0||(this._defaultPointsBoundingSphere=d.BoundingSphere.fromPoints(this.pointFeatures.features.map(u=>(u.geometry.type=="Point"?[u.geometry.coordinates]:u.geometry.coordinates).map(p=>Se(p))).flat(1/0)))};l(),this.ad(this.pointFeaturesChanged.don(l))}{const l=()=>{s.remove(e.typeName,e.id,{label:this.screenObjectIdsLabel}),this.screenObjectIdsLabel.clear()};this.ad(()=>{l()});const u=()=>{if(l(),!((e.textShow??A.ESGeoJson.defaults.textShow)&&(e.show??A.ESGeoJson.defaults.show))||!this.pointFeatures)return;const p=e.textFontSize&&e.textFontSize!=0?e.textFontSize:A.ESGeoJson.defaults.textStyle.fontSize,f={show:!0,heightReference:d.HeightReference[e.heightReference??A.ESGeoJson.defaults.heightReference],fillColor:new d.Color(...e.textColor??A.ESGeoJson.defaults.textStyle.color),showBackground:e.textBackgroundColor!=null,backgroundColor:new d.Color(...e.textBackgroundColor??A.ESGeoJson.defaults.textStyle.backgroundColor??[1,1,1,1]),font:`${e.textFontStyle} ${e.textFontWeight} ${p}px ${e.textFontFamily??A.ESGeoJson.defaults.textStyle.fontFamily}`,horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.TOP,eyeOffset:d.Cartesian3.fromArray([0,0,-1]),distanceDisplayCondition:new d.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((g,m)=>{const v=this._getFeatureStyles(g.properties,f);if(!Reflect.has(v,"text")){const C=e.textAnchor??A.ESGeoJson.defaults.textStyle.anchor,x=e.textOffset??A.ESGeoJson.defaults.textStyle.offset,B=e.textProperty??A.ESGeoJson.defaults.textStyle.textProperty,b=e.textDefaultText??A.ESGeoJson.defaults.textStyle.defaultText;v.text=B&&B!==""&&g.properties&&g.properties[B]?g.properties[B]:b,v.pixelOffset=d.Cartesian2.fromArray([-C[0]*((v.showBackground?-14:0)+this._getTextPixelWidth(v.text,v.font))+x[0],-C[1]*((v.showBackground?10:0)+p)+x[1]])}(g.geometry.type=="Point"?[g.geometry.coordinates]:g.geometry.coordinates).forEach((C,x)=>{const B={index:`${m}${x}`,name:v.text,position:C,zOrder:e.zIndex??A.ESGeoJson.defaults.zIndex,properties:g.properties},b=s.addLabel(e.id,e.typeName,v,B);this.screenObjectIdsLabel.add(b.screenObjectId)})})};u();const h=this.ad(A.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.textShowChanged,e.textPropertyChanged,e.textDefaultTextChanged,e.textColorChanged,e.textBackgroundColorChanged,e.textFontFamilyChanged,e.textFontSizeChanged,e.textFontStyleChanged,e.textFontWeightChanged,e.textAnchorChanged,e.textOffsetChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged,this.featureStylesChanged));this.ad(h.don(u))}{const l=()=>{s.remove(e.typeName,e.id,{billboard:this.screenObjectIdsBillboard}),this.screenObjectIdsBillboard.clear()};this.ad(()=>{l()});const u=()=>{if(l(),!((e.imageShow??A.ESGeoJson.defaults.imageShow)&&(e.show??A.ESGeoJson.defaults.show))||!this.pointFeatures)return;const p=e.imageAnchor??A.ESGeoJson.defaults.imageStyle.anchor,f=e.imageOffset??A.ESGeoJson.defaults.imageStyle.offset,g=e.imageSize?e.imageSize[0]:A.ESGeoJson.defaults.imageStyle.size[0],m=e.imageSize?e.imageSize[1]:A.ESGeoJson.defaults.imageStyle.size[1],v={show:!0,width:g,height:m,image:A.ESSceneObject.context.getStrFromEnv(e.imageUrl?typeof e.imageUrl=="string"?e.imageUrl:e.imageUrl.url:A.ESGeoJson.defaults.imageStyle.url),horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.TOP,heightReference:d.HeightReference[e.heightReference??A.ESGeoJson.defaults.heightReference],pixelOffset:d.Cartesian2.fromArray([-p[0]*g+f[0],-p[1]*m+f[1]]),distanceDisplayCondition:new d.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((w,C)=>{const x=this._getFeatureStyles(w.properties,v);(w.geometry.type=="Point"?[w.geometry.coordinates]:w.geometry.coordinates).forEach((b,P)=>{const S={index:`${C}${P}`,name:"",position:b,zOrder:e.zIndex??A.ESGeoJson.defaults.zIndex,properties:w.properties},M=s.addImage(e.id,e.typeName,x,S);this.screenObjectIdsBillboard.add(M.screenObjectId)})})};u();const h=this.ad(A.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.imageAnchorChanged,e.imageOffsetChanged,e.imageShowChanged,e.imageSizeChanged,e.imageUrlChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged,this.featureStylesChanged));this.ad(h.don(u))}this.ad(e.flyToEvent.disposableOn(l=>{if(!n.actived)return;if(e.flyInParam){const{position:h,rotation:p,flyDuration:f}=e.flyInParam;return ae(n.viewer,h,void 0,p,f),!0}let u;a.defaultBoundingSphere&&this._defaultPointsBoundingSphere?u=d.BoundingSphere.fromBoundingSpheres([a.defaultBoundingSphere,this._defaultPointsBoundingSphere]):a.defaultBoundingSphere?u=a.defaultBoundingSphere:this._defaultPointsBoundingSphere&&(u=this._defaultPointsBoundingSphere),u&&Bi(n,e,this.id,he(u.center),u.radius,l)}));{const l=async(u,h,p)=>{if(!n.actived)return;const f=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(u,h)));if(!(!f||!(f!=null&&f.positions)))if(f.type=="Point"||f.type=="MultiPoint")Bi(n,e,this.id,await this._calculateFeatureHeight(f.type=="MultiPoint"?f.positions.flat():f.positions,e.heightReference,n),1e3,p);else{const g=f.type=="Polygon"||f.type=="MultiPolygon"||f.type=="MultiLineString";let m=[];g?m=f.positions.flat(f.type=="MultiPolygon"?2:1).map(x=>this._calculateFeatureHeight(x,e.fillGround?"CLAMP_TO_GROUND":"NONE",n)):m=f.positions.map(x=>this._calculateFeatureHeight(x,e.strokeGround?"CLAMP_TO_GROUND":"NONE",n));const{minPos:v,maxPos:w,center:C}=A.getMinMaxCorner(m);Bi(n,e,this.id,C,A.getDistancesFromPositions([v,w],"NONE")[0],p)}};this.d(e.flyToFeatureEvent.don((u,h,p)=>l(u,h,p))),this.d(e.flyToFeatureIndexEvent.don((u,h)=>l(u,void 0,h)))}this.ad(e.setFeatureStyleEvent.don(l=>{a.featureStyles=this.featureStyles=l})),this.ad(e.resetFeatureStyleEvent.don(()=>{a.featureStyles=this.featureStyles=void 0}))}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}get featureStyles(){return this._featureStyles.value}set featureStyles(e){this._featureStyles.value=e}get featureStylesChanged(){return this._featureStyles.changed}_getFeatureStyles(e,n){const r="image"in n;if(!this.featureStyles||this.featureStyles.length==0)return n;for(let o=0;o<this.featureStyles.length;o++){const s=this.featureStyles[o],a=Array.isArray(s.condition)?s.condition:[s.condition],l=[];for(let u=0;u<a.length;u++){if(!e){l.push(!1);continue}const h=a[u];if(typeof h=="boolean"){l.push(!0);continue}const p=e[h.field],f=typeof h.value=="string",g=typeof h.value=="number";if(f){l.push(A0(h,p));continue}else if(g){l.push(l0(h,p));continue}else{l.push(!1);continue}}if(l.length>0&&!l.includes(!1))if(r){n=structuredClone(n);const{imageShow:u,imageStyle:h={}}=s;n.show=u??n.show,h.anchor=h.anchor??this.sceneObject.imageAnchor??A.ESGeoJson.defaults.billboardStyle.anchor,h.offset=h.offset??this.sceneObject.imageOffset??A.ESGeoJson.defaults.billboardStyle.offset,h.size=h.size??this.sceneObject.imageSize??A.ESGeoJson.defaults.billboardStyle.size,h.url=h.url??this.sceneObject.imageUrl??A.ESGeoJson.defaults.billboardStyle.url;const p=h.anchor,f=h.offset;n.width=h.size[0],n.height=h.size[1];const g=typeof h.url=="string"?h.url:h.url.url;return n.image=A.ESSceneObject.context.getStrFromEnv(g),n.pixelOffset=d.Cartesian2.fromArray([-p[0]*n.width+f[0],-p[1]*n.height+f[1]]),n}else{n=structuredClone(n);const{textShow:u,textStyle:h={}}=s;n.show=u??n.show,h.anchor=h.anchor??this.sceneObject.textAnchor??A.ESGeoJson.defaults.textStyle.anchor,h.backgroundColor=h.backgroundColor??this.sceneObject.textBackgroundColor??A.ESGeoJson.defaults.textStyle.backgroundColor,h.color=h.color??this.sceneObject.textColor??A.ESGeoJson.defaults.textStyle.color,h.defaultText=h.defaultText??this.sceneObject.textDefaultText??A.ESGeoJson.defaults.textStyle.defaultText,h.fontFamily=h.fontFamily??this.sceneObject.textFontFamily??A.ESGeoJson.defaults.textStyle.fontFamily,h.fontSize=h.fontSize??this.sceneObject.textFontSize??A.ESGeoJson.defaults.textStyle.fontSize,h.fontStyle=h.fontStyle??this.sceneObject.textFontStyle??A.ESGeoJson.defaults.textStyle.fontStyle,h.fontWeight=h.fontWeight??this.sceneObject.textFontWeight??A.ESGeoJson.defaults.textStyle.fontWeight,h.offset=h.offset??this.sceneObject.textOffset??A.ESGeoJson.defaults.textStyle.offset,h.textProperty=h.textProperty??this.sceneObject.textProperty??A.ESGeoJson.defaults.textStyle.textProperty;const p=h.fontSize,f=h.offset,g=h.anchor;return n.fillColor=new d.Color(...h.color),n.showBackground=(h==null?void 0:h.backgroundColor)!=null,n.backgroundColor=new d.Color(...h.backgroundColor??[1,1,1,1]),n.font=`${h.fontStyle} ${h.fontWeight} ${p}px ${h.fontFamily}`,n.text=h.textProperty&&h.textProperty!==""&&e&&e[h.textProperty]?e[h.textProperty]:h.defaultText,n.pixelOffset=d.Cartesian2.fromArray([-g[0]*((n.showBackground?-14:0)+this._getTextPixelWidth(n.text,n.font))+f[0],-g[1]*((n.showBackground?10:0)+p)+f[1]]),n}}return n}_getFeatureByIndexOrProperties(e,n){var a,l,u,h,p,f,g,m;const{sceneObject:r}=this,o=r.features;if(!o)return;const s=Reflect.get(o,"features")||Reflect.get(o,"geometries");if(s){if(n){let v=s.find(w=>(w==null?void 0:w.properties[e])==n);return{type:v!=null&&v.coordinates?v.type:(a=v==null?void 0:v.geometry)==null?void 0:a.type,positions:(v==null?void 0:v.coordinates)||((l=v==null?void 0:v.geometry)==null?void 0:l.coordinates)}}else if(typeof e=="number")return{type:(u=s[e])!=null&&u.coordinates?s[e].type:(p=(h=s[e])==null?void 0:h.geometry)==null?void 0:p.type,positions:((f=s[e])==null?void 0:f.coordinates)||((m=(g=s[e])==null?void 0:g.geometry)==null?void 0:m.coordinates)}}}async _calculateFeatureHeight(e,n,r){const o=[...e];return n=="NONE"?o[2]=o[2]??0:n=="CLAMP_TO_GROUND"||!o[2]?o[2]=await r.getTerrainHeight(o)??0:o[2]+=await r.getTerrainHeight(o)??0,o}_getTextPixelWidth(e,n){if(!this._textMeasureCtx){const r=document.createElement("canvas");this._textMeasureCtx=r.getContext("2d")}return this._textMeasureCtx.font=n,this._textMeasureCtx.measureText(e).width}};y(zc,"type",zc.register("ESCesiumViewer",A.ESGeoJson.type,zc));let I0=zc;const Nc=class Nc extends kt{constructor(e,n){super(e,n);y(this,"_czmGeoESRectangle");y(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Me(n,e.id)),this._czmGeoESRectangle=this.disposeVar(new xn(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this._czmGeoESRectangle,s=this._geoPolyline;s.arcType="RHUMB",this.dispose(A.track([s,"color"],[e,"strokeColor"])),this.dispose(A.track([s,"width"],[e,"strokeWidth"])),this.dispose(A.track([s,"ground"],[e,"strokeGround"])),this.dispose(A.track([o,"ground"],[e,"fillGround"])),this.dispose(A.track([o,"allowPicking"],[e,"allowPicking"]));{const a=()=>{s.show=e.show&&e.stroked,o.show=e.show&&e.filled};a();const l=this.disposeVar(A.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(l.disposableOn(a))}{const a=()=>{e.filled?o.material={type:"Color",color:e.fillColor}:o.material=void 0};a();const l=this.disposeVar(A.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(a))}{const a=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:u,maxPos:h}=A.getMinMaxCorner(l);o.rectangle=[u[0],u[1],h[0],h[1]],o.height=l[0][2],o.extrudedHeight=l[0][2];const p=l.map(v=>(l&&(v[2]=l[0][2]),v)),f=p[0],g=p[1],m=[f,[f[0],g[1],f[2]],g,[g[0],f[1],g[2]]];s.positions=[...m,f]}else o.rectangle=void 0,s.positions=void 0,o.height=0,o.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,n){const{sceneObject:r,czmViewer:o}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):r.points?(Ae(o,r,n,r.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:r,czmViewer:o,czmGeoESRectangle:s}=this;return o.actived?r.flyInParam?super.flyIn(e,n):r.points?(Ae(o,r,n,r.points,e),!0):!1:!1}};y(Nc,"type",Nc.register("ESCesiumViewer",A.ESGeoRectangle.type,Nc));let D0=Nc;class bl extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new Wr(e,n));const{geoPolygon:r}=this;this.dispose(A.bind([r,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(s=>{r.flyTo(s)})),this.dispose(A.bind([r,"show"],[this,"show"])),this.dispose(A.bind([r,"fill"],[this,"filled"])),this.dispose(A.bind([r,"strokeGround"],[this,"strokeGround"])),this.dispose(A.bind([r,"ground"],[this,"ground"])),this.dispose(A.bind([r,"outline"],[this,"outline"])),this.dispose(A.bind([r,"outlineColor"],[this,"outlineColor"])),this.dispose(A.bind([r,"outlineWidth"],[this,"outlineWidth"])),this.dispose(A.bind([r,"color"],[this,"color"])),this.dispose(A.bind([r,"depth"],[this,"depth"]));const o=()=>{if(this.positions&&this.positions.length>=2){const s=Yf([...this.positions,this.positions[0]]);r.positions=s}else r.positions=void 0};o(),this.dispose(this.positionsChanged.disposableOn(o))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:A.reactArray([1,1,1,1]),outlineWidth:1,color:A.reactArrayWithUndefined([1,1,1,.5]),positions:A.reactPositions(void 0),depth:0})})(bl||(bl={})),A.extendClassProps(bl.prototype,bl.createDefaultProps);const Vc=class Vc extends kt{constructor(e,n){super(e,n);y(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new bl(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this._geoSmoothPolygon;this.dispose(A.track([o,"show"],[e,"show"])),this.dispose(A.bind([o,"positions"],[e,"points"])),this.dispose(A.track([o,"strokeGround"],[e,"strokeGround"])),this.dispose(A.track([o,"allowPicking"],[e,"allowPicking"])),this.dispose(A.track([o,"outline"],[e,"stroked"])),this.dispose(A.track([o,"outlineColor"],[e,"strokeColor"])),this.dispose(A.track([o,"outlineWidth"],[e,"strokeWidth"])),this.dispose(A.track([o,"strokeGround"],[e,"strokeGround"])),this.dispose(A.track([o,"filled"],[e,"filled"])),this.dispose(A.track([o,"color"],[e,"fillColor"])),this.dispose(A.track([o,"ground"],[e,"ground"]));{const s=()=>{o.ground=e.ground||e.fillGround};s();const a=this.dv(A.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(a.don(s))}{const s=()=>{o.color=e.filled?e.fillColor:Bl.defaults.fillStyle.color};s();const a=this.disposeVar(A.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(a.disposableOn(s))}this.dispose(A.track([o,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,n){const{sceneObject:r,czmViewer:o,geoSmoothPolygon:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):s.positions?(Ae(o,r,n,s.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:r,czmViewer:o,geoSmoothPolygon:s}=this;return o.actived?r.flyInParam?super.flyIn(e,n):s.positions?(Ae(o,r,n,s.positions,e),!0):!1:!1}};y(Vc,"type",Vc.register("ESCesiumViewer",Bl.type,Vc));let M0=Vc;const Gc=class Gc extends xe{constructor(e,n){super(e,n);y(this,"_czmModel");const r=n.viewer;if(!r){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new Mt(n,e.id));const o=this._czmModel;this.d(o.readyEvent.don(a=>{var l;o.activeAnimationsJson=(l=o.gltf.animations)==null?void 0:l.map((u,h)=>({index:h,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"})),e.czmModelReadyEvent.emit(a),e.readyEvent.emit(a)})),this.ad(new wh(r,this._czmModel)),this.d(A.track([o,"show"],[e,"show"])),this.d(A.track([o,"color"],[e,"czmColor"])),this.d(A.track([o,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(A.track([o,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(A.bind([o,"position"],[e,"position"])),this.d(A.track([o,"nativeScale"],[e,"czmNativeScale"])),this.d(A.track([o,"scale"],[e,"scale"])),this.ad(A.track([o,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(A.track([o,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const a=l=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:l}:{atmosphereScatteringIntensity:l}};a(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(l=>a(l)))}{const a=()=>{var l,u;(l=e.czmEnvironmentMapManager)!=null&&l.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};a(),this.ad(e.czmEnvironmentMapManagerChanged.don(a))}{const a=()=>{const l=[...e.rotation??[0,0,0]];l[0]+=e.instances&&e.instances.length!=0?0:90,o.rotation=l};a(),this.d(e.rotationChanged.don(a));{const l=()=>{if(a(),!e.instances||e.instances.length==0){o.instances=void 0;return}o.instances=e.instances.map(u=>{const h=JSON.parse(JSON.stringify(u));return!h.rotation&&(h.rotation=[0,0,0]),h.rotation[0]+=90,h})};l(),this.ad(e.instancesChanged.don(l))}}this.ad(e.setMaterialEvent.don(a=>{o.setMaterial(a)}));{const a=()=>{const l=[...o.rotation];l[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=l};a(),this.d(o.rotationChanged.don(a))}{const a=this.dv(A.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),l=()=>{e.allowPicking&&!e.editing?o.allowPicking=!0:o.allowPicking=!1};l(),this.d(a.don(l))}const s=()=>{var a;o.url=A.ESSceneObject.context.getStrFromEnv(Ch(typeof e.url=="string"?e.url:((a=e.url)==null?void 0:a.url)??A.ESGltfModel.defaults.url))};s(),this.d(e.urlChanged.don(s)),this.d(e.setNodePositionEvent.don((a,l)=>{o.setNodeTranslation(a,l)})),this.d(e.setNodeRotationEvent.don((a,l)=>{o.setNodeRotation(a,l)})),this.d(e.setNodeScaleEvent.don((a,l)=>{o.setNodeScale(a,l)})),this.d(e.printDebugInfoEvent.don(()=>{o.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,n){const{sceneObject:r,czmViewer:o,model:s}=this;return o.actived?r.flyToParam||r.flyInParam?(super.flyTo(e,n),!0):(s&&Vt(o,r,n,e,s,!0),!!s):!1}};y(Gc,"type",Gc.register("ESCesiumViewer",A.ESGltfModel.type,Gc));let U0=Gc;function sE(i,t){const e=i[0]-t[0],n=i[1]-t[1],r=i[2]-t[2];return Math.sqrt(e*e+n*n+r*r)}class El extends A.Destroyable{constructor(e,n){super();y(this,"_pickedEvent",this.disposeVar(new A.Event));y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_distance",this.disposeVar(A.react(0)));y(this,"_surfaceDistance",this.disposeVar(A.react(0)));y(this,"_height",this.disposeVar(A.react(0)));y(this,"_middlePosition",this.disposeVar(A.reactArrayWithUndefined(void 0)));y(this,"_heightPosition",this.disposeVar(A.reactArrayWithUndefined(void 0)));const r=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const s=this._surfaceDistance.value=A.geoDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="RHUMB"){const s=this._surfaceDistance.value=A.geoRhumbDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="NONE"){const s=A.lbhToXyz(this.positions[0]),a=A.lbhToXyz(this.positions[1]);this._distance.value=sE(s,a),this._surfaceDistance.value=sE(A.lbhToXyz(this._middlePosition.value),a),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};r();const o=this.disposeVar(A.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(o.disposableOn(r));{const s=this.disposeVar(new Me(e,n));s.ground=!1,s.loop=!1,this.dispose(A.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(A.bind([s,"arcType"],[this,"arcType"])),this.dispose(A.bind([s,"color"],[this,"color"])),this.dispose(A.bind([s,"dashLength"],[this,"dashLength"])),this.dispose(A.bind([s,"dashPattern"],[this,"dashPattern"])),this.dispose(A.bind([s,"gapColor"],[this,"gapColor"])),this.dispose(A.bind([s,"hasArrow"],[this,"hasArrow"])),this.dispose(A.bind([s,"hasDash"],[this,"hasDash"])),this.dispose(A.bind([s,"show"],[this,"show"])),this.dispose(A.bind([s,"width"],[this,"width"])),this.dispose(A.bind([s,"depthTest"],[this,"depthTest"]));{s.loop=!0;const l=()=>{if(this.positions&&this.positions.length===2){const[u,h]=this.positions;s.positions=[u,h,[u[0],u[1],h[2]]]}else s.positions=void 0};l(),this.dispose(this.positionsChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&s.flyTo(l)}));const a=this.disposeVar(new rt(e,n));this.dispose(A.track([a,"shadowDom"],[this,"shadowDom"])),this.dispose(A.track([a,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(A.track([a,"show"],[this,"show"]));{const l=()=>{a.position=this.heightPosition};l(),this.dispose(this.heightPositionChanged.disposableOn(l))}{const l=()=>{a.innerHTML=Uo(`高度: ${xh(this.height)}`,0)};l(),this.dispose(this.heightChanged.disposableOn(l))}this.ad(a.pickedEvent.don(l=>{Wn(l)===0&&this.pickedEvent.emit(l)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:A.reactPositions(void 0),width:1,color:A.reactArray([1,1,1,1]),hasDash:!1,gapColor:A.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(El||(El={})),A.extendClassProps(El.prototype,El.createDefaultProps);const Wc=class Wc extends kt{constructor(e,n){super(e,n);y(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new El(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:o}=this;this.dispose(A.track([o,"show"],[e,"show"])),this.dispose(A.track([o,"allowPicking"],[e,"allowPicking"])),this.dispose(A.bind([o,"positions"],[e,"points"]));{const s=()=>{if(e.stroked)o.width=e.strokeWidth;else{o.width=0;return}o.width=e.strokeWidth,o.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(o.hasDash=!0,o.hasArrow=!1):u==="hasArrow"?(o.hasDash=!1,o.hasArrow=!0):(o.hasDash=!1,o.hasArrow=!1);const h=e.strokeStyle;if(h.material==="hasDash"&&h.materialParams)try{const p=h.materialParams;Reflect.has(p,"gapColor")&&(o.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(o.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(o.dashPattern=p.dashPattern)}catch(p){console.error(p)}else o.gapColor=[0,0,0,0],o.dashLength=0,o.dashPattern=0};s();const a=this.disposeVar(A.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(o.pickedEvent.disposableOn(s=>{Wn(s)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,n){const{sceneObject:r,czmViewer:o,czmHeightMeasurement:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):s.positions?(Ae(o,r,n,s.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:r,czmViewer:o,czmHeightMeasurement:s}=this;return o.actived?r.flyInParam?super.flyIn(e,n):s.positions?(Ae(o,r,n,s.positions,e),!0):!1:!1}};y(Wc,"type",Wc.register("ESCesiumViewer",A.ESHeightMeasurement.type,Wc));let R0=Wc;const Q0={czmAnimationsStand:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsWalk:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsRun:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},Kc=class Kc extends xe{constructor(e,n){super(e,n);y(this,"_czmModelPrimitive");const r=n.viewer;if(!r){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Mt(n,this.sceneObject.id));const o=this._czmModelPrimitive;this.dispose(A.track([o,"show"],[e,"show"])),this.dispose(A.bind([o,"position"],[e,"position"])),this.dispose(ft([o,"rotation"],[e,"rotation"])),this.dispose(A.bind([o,"scale"],[e,"scale"])),this.d(o.readyEvent.don(w=>{e.readyEvent.emit(w)}));{const w=this.dv(A.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),C=()=>{e.allowPicking&&!e.editing?o.allowPicking=!0:o.allowPicking=!1};C(),this.d(w.don(C))}const s=A.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),a=A.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),l=A.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=A.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),h=A.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),p=A.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=A.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/repairman.glb"),g=()=>{switch(e.mode){case"worker":o.url=s;break;case"police":o.url=a;break;case"pedestrian":o.url=l;break;case"stranger":o.url=u;break;case"suitMan":o.url=h;break;case"suitWoman":o.url=p;break;case"repairMan":o.url=f;break;default:o.url=s;break}};this.dispose(e.modeChanged.disposableOn(()=>{g()})),g();const m=()=>{const w=e.animation??A.ESHuman.defaults.animation;if(!e.show){o.activeAnimationsJson=void 0;return}w==="walking"?o.activeAnimationsJson=Q0.czmAnimationsWalk:w==="standing"?o.activeAnimationsJson=Q0.czmAnimationsStand:w==="running"&&(o.activeAnimationsJson=Q0.czmAnimationsRun)};m();const v=this.ad(A.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(v.disposableOn(()=>m())),this.ad(new wh(r,o))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:r,czmViewer:o,czmModelPrimitive:s}=this;return!o.actived||!o.viewer?!1:r.flyToParam||r.flyInParam?(super.flyTo(e,n),!0):(s&&Vt(o,r,n,e,s,!0),!!s)}};y(Kc,"type",Kc.register("ESCesiumViewer",A.ESHuman.type,Kc));let L0=Kc;class aE extends A.Destroyable{constructor(e,n){super();y(this,"_czmGeoCanvasImagePoi");y(this,"flyTo",(e,n)=>{if(this.czmGeoCanvasImagePoi.position){ae(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Ui,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new gn(n));const r=this._czmGeoCanvasImagePoi;r.pickOnClick=!0,this.d(r.pickedEvent.don(o=>{(e.allowPicking??!1)&&e.pickedEvent.emit(o)}));{const o=h=>{let p=h;return h.includes("inner://")&&(p="${earthsdk3-assets-script-dir}/assets/img/points/"+h.split("inner://")[1]),A.ESSceneObject.context.getStrFromEnv(Ch(p))},s=()=>{const h=o(typeof e.url=="string"?e.url:e.url.url);if(r.imageUri=h,e.sizeByContent){const f=new Image;f.src=h,f.onload=()=>{r.size=[f.width,f.height]}}else{const f=e.size;r.size=[...f]}},a=this.disposeVar(A.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(a.disposableOn(()=>s())),s(),this.d(A.track([r,"zOrder"],[e,"zOrder"])),this.dispose(A.track([r,"show"],[e,"show"])),this.dispose(A.bind([r,"position"],[e,"position"])),this.ad(A.bind([r,"isHoverZoom"],[e,"isHoverZoom"])),this.ad(A.bind([r,"hoverHighlight"],[e,"hoverHighlight"]));{const h=()=>{r.scale=[e.scale[1],e.scale[2]]};h(),this.dispose(e.scaleChanged.don(h))}const l=()=>{const h=e.anchor,p=e.offset;h?r.originRatioAndOffset=[...h,-p[0],-p[1]]:r.originRatioAndOffset=[0,0,0,0]},u=this.ad(A.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>l())),l(),this.dispose(r.clickEvent.disposableOn(h=>{const{offsetX:p,offsetY:f}=h,m={type:h.button===0?"leftClick":h.button===2?"rightClick":void 0,add:{mousePos:[p,f]}};e.widgetEvent.emit(m)})),this.dispose(r.hoveredChanged.disposableOn(h=>{if(h===void 0)return;const p={type:h?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(p)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class AE extends A.Destroyable{constructor(e,n,r){super();y(this,"_czmGeoImageModel");y(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});y(this,"_isPointEvent",!1);y(this,"flyTo",(e,n)=>{if(this.czmGeoImageModel.position)return Bi(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new Zn(n,e.id));const o=this._czmGeoImageModel;this.ad(n.clickEvent.don(f=>{const g=f==null?void 0:f.pointerEvent;g&&(this._isPointEvent=!0,this._eventInfo={type:g.button==0?"leftClick":g.button==2?"rightClick":"leftClick",add:{mousePos:[g.offsetX,g.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var g,m,v;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((g=this._eventInfo.add)!=null&&g.mousePos)&&Math.abs(f.screenPosition[0]-((m=this._eventInfo.add)==null?void 0:m.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((v=this._eventInfo.add)==null?void 0:v.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),A.engineObjectCreatedUpdate(this,e,()=>{const f=n.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((g,m)=>{(g==null?void 0:g.sceneObject)==(m==null?void 0:m.sceneObject)||(g==null?void 0:g.sceneObject)!=e&&(m==null?void 0:m.sceneObject)!=e||(g!=null&&g.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:g==null?void 0:g.screenPosition}},g.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&g.sceneObject.id==e.id&&(o.scale=[o.scale[0]*1.5,o.scale[1]*1.5])),m!=null&&m.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:g==null?void 0:g.screenPosition}},m.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&m.sceneObject.id==e.id&&(o.scale=[o.scale[0]/1.5,o.scale[1]/1.5])))}))});const s=e.sizeByContent,l=(f=>{let g=f;return f.includes("inner://")&&(g="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),A.ESSceneObject.context.getStrFromEnv(Ch(g))})(typeof r.sceneObject.url=="string"?r.sceneObject.url:r.sceneObject.url.url),u=new Image;u.src=l,u.onload=()=>{if(s)o.size=[u.width/100,u.height/100];else{const f=e.size;o.size=[f[0]/100,f[1]/100]}},o.uri=l,this.dispose(A.track([o,"show"],[e,"show"])),this.dispose(A.bind([o,"position"],[e,"position"])),this.dispose(A.track([o,"allowPicking"],[e,"allowPicking"])),o.pixelSize=void 0,o.useAxis="XZ";{const f=()=>{o.scale=[e.scale[1],e.scale[2]]};f(),this.d(e.scaleChanged.don(f))}{const f=()=>{e.rotationType===0&&(o.rotationMode="WithProp",this.d(ft([o,"rotation"],[e,"rotation"]))),e.rotationType===1&&(o.rotationMode="WithCamera"),e.rotationType===2&&(o.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const h=()=>{const f=e.anchor,g=e.offset;f?o.originRatioAndOffset=[...f,-g[0]/100,-g[1]/100]:o.originRatioAndOffset=[0,0,0,0]},p=this.ad(A.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(p.disposableOn(()=>h())),h()}get czmGeoImageModel(){return this._czmGeoImageModel}}const $c=class $c extends vl{constructor(e,n){super(e,n);y(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(A.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new A.ObjResettingWithEvent(o,()=>this.sceneObject.screenRender?new aE(this.sceneObject,this.czmViewer):new AE(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:r,czmViewer:o,resetting:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):(s&&s.obj&&s.obj.flyTo(e,n),r.flyOverEvent.emit(n,"over",o),!0):!1}};y($c,"type",$c.register("ESCesiumViewer",A.ESImageLabel.type,$c));let O0=$c;function O5(i){switch(i){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const qc=class qc extends Ci{constructor(e,n){super(e,n);y(this,"_czmImagery");if(this._czmImagery=this.dv(new to(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this._czmImagery;{const s=this.ad(A.reactJson(""));{const u=()=>{if(typeof e.url=="string")s.value=A.ESSceneObject.context.getStrFromEnv(e.url);else{const h=e.url;h.url=A.ESSceneObject.context.getStrFromEnv(h.url),s.value=h}};u(),this.ad(e.urlChanged.don(u))}const a=()=>{var m;if(!s.value)return;const u=(((m=e.options)==null?void 0:m.type)??"auto").toLowerCase(),h=e.options??{};let p={type:"UrlTemplateImageryProvider",url:s.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...h},f=s.value,g=typeof f=="string"?f:f.url;if(u==="auto"){const v=g.toLowerCase();if(v.startsWith("ion://")){const C=+v.substring(6);p={...h,assetId:C,type:"IonImageryProvider"}}else if(v.includes("{x}")||v.includes("{y}")||v.includes("{z}"))p.type="UrlTemplateImageryProvider";else if(v.includes("wmts"))p.type="WebMapTileServiceImageryProvider";else if(v.includes("wms"))p.type="WebMapServiceImageryProvider";else{if(g.includes("/tilemapresource.xml")){const w=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=w:f.url=w,p.url=f}p.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&g.includes("/tilemapresource.xml")){const v=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=v:f.url=v,p.url=f}else if(u==="ion"&&g.startsWith("ion://")){const w=+g.substring(6);p={...h,assetId:w,type:"IonImageryProvider"}}p.type=O5(u)}console.log("imageryProvider",p),o.imageryProvider=p};a();const l=this.dv(A.createNextAnimateFrameEvent(s.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(l.don(a))}this.d(A.track([o,"show"],[e,"show"])),this.d(A.bind([o,"alpha"],[e,"opacity"])),this.d(A.bind([o,"alpha"],[e,"czmAlpha"])),this.d(A.track([o,"splitDirection"],[e,"splitDirection"])),this.d(A.track([o,"brightness"],[e,"czmBrightness"])),this.d(A.track([o,"contrast"],[e,"czmContrast"])),this.d(A.track([o,"hue"],[e,"czmHue"])),this.d(A.track([o,"saturation"],[e,"czmSaturation"])),this.d(A.track([o,"gamma"],[e,"czmGamma"])),this.d(A.track([o,"rectangle"],[e,"rectangle"])),this.d(A.track([o,"zIndex"],[e,"zIndex"])),this.ad(A.track([o,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:r,czmViewer:o,czmImagery:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):(s.flyTo(e&&e),r.flyOverEvent.emit(n,"over",o),!0):!1}flyIn(e,n){const{sceneObject:r,czmViewer:o,czmImagery:s}=this;return o.actived?r.flyInParam?super.flyIn(e,n):(s.flyTo(e&&e),r.flyOverEvent.emit(n,"over",o),!0):!1}};y(qc,"type",qc.register("ESCesiumViewer",A.ESImageryLayer.type,qc));let H0=qc;class H5 extends A.Destroyable{constructor(e,n,r,o){super();y(this,"_show");y(this,"_czmESCustomPrimitive");y(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(A.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new De(n,this._sceneObject.id)),this._czmTexture=this.dv(new ke(n));const s=e,a=this._czmESCustomPrimitive,l=this._czmTexture;this.dispose(A.track([a,"show"],[this,"show"])),this.dispose(A.track([a,"show"],[s,"show"])),this.dispose(A.track([a,"allowPicking"],[s,"allowPicking"])),this.dispose(A.track([a,"rotation"],[s,"rotation"])),this.dispose(A.track([a,"position"],[s,"position"])),this.dispose(A.track([a,"scale"],[s,"scale"])),this.ad(s.allowPickingChanged.don(()=>{a.allowPicking=s.allowPicking,a.pass=s.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const p=s.size/2,f=o[0].map(U=>U*p),g=o[1].map(U=>U*p),m=o[2].map(U=>U*p),v=o[3].map(U=>U*p),w=[...f,...g,...m,...v];let C=[0,3,2,0,2,1];(r=="north"||r=="west"||r=="bottom")&&(C=C.reverse());const x=[0,0],B=[1,0],b=[1,1],P=[0,1];let S=[];r=="east"||r=="south"?S=[...B,...x,...P,...b]:r=="west"?S=[...B,...b,...P,...x]:r=="top"?S=[...P,...b,...B,...x]:S=[...x,...B,...b,...P],a.indexTypedArray=new Uint16Array(C),a.attributes={position:{typedArray:new Float32Array(w),componentsPerAttribute:3},st:{typedArray:new Float32Array(S),componentsPerAttribute:2}},l.uri=A.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${s.mode}/${r}.${s.mode!="blueSky"?"png":"jpg"}`);const M=n.getCameraInfo();if(M!=null){const O=A.getDistancesFromPositions([s.position,M.position],"NONE")[0]/(s.size/2*s.autoOpacityFactor);this.changeOpacity(s.autoFollow?1:O)}const Q=a.computeLocalAxisedBoundingBoxFromAttribute("position");if(!Q)return;const{min:L,max:H}=Q;a.setLocalAxisedBoundingBox(L,H)};u();const h=this.disposeVar(A.createNextAnimateFrameEvent(s.sizeChanged,s.modeChanged));this.dispose(h.disposableOn(u))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class z5 extends A.Destroyable{constructor(t,e,n){if(super(),!e.viewer)return;let r=!0,o;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{s()}));function s(){var l;if(!((l=e.viewer)!=null&&l.camera))return;const a=e.getCameraInfo();if(a!=null&&(o==null||o.position[0]!=a.position[0]||o.position[1]!=a.position[1]||o.position[2]!=a.position[2]||o.rotation[0]!=a.rotation[0]||o.rotation[1]!=a.rotation[1]||o.rotation[2]!=a.rotation[2])){o=a;const h=A.getDistancesFromPositions([t.position,o.position],"NONE")[0]/(t.size/2*t.autoOpacityFactor);t.autoFollow?(t.position=o.position,r&&(r=!1,n.forEach(p=>{p.changeOpacity(1)}))):n.forEach(p=>{p.changeOpacity(h)})}}s()}}const dt=class dt extends xe{constructor(e,n){super(e,n);y(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!dt._defaultLocalBox&&dt._firstLoad&&(dt._firstLoad=!1,dt._defaultLocalBox=n.xbsjLocalBoxSources),dt._eSLocalSkyBoxArr.push(e),this.d(()=>{dt._eSLocalSkyBoxArr.includes(e)&&dt._eSLocalSkyBoxArr.splice(dt._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const o={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const a=o[s];this._czmSkyBoxComponents.push(this.dv(new H5(e,n,s,a)))}{const s=this.disposeVar(A.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new A.ObjResettingWithEvent(s,()=>(this.ChangeAutoFollow(),new z5(e,n,this._czmSkyBoxComponents))))}{const s=()=>{this.ChangeAutoFollow()},a=this.disposeVar(A.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(a.disposableOn(s))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let n=dt._eSLocalSkyBoxArr.length-1;n>=0;n--){const r=dt._eSLocalSkyBoxArr[n];if(r.autoFollow&&r.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/east.${r.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/west.${r.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/bottom.${r.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/top.${r.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/north.${r.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/south.${r.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(e.xbsjLocalBoxSources=dt._defaultLocalBox)}dt._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=dt._defaultLocalBox)}flyTo(e,n){const{sceneObject:r,czmViewer:o}=this;if(!o.actived)return!1;if(r.flyToParam||r.flyInParam)return super.flyTo(e,n);{const s=r.size??A.ESLocalSkyBox.defaults.size;return r.position?(Bi(o,r,n,r.position,s,e,!0),!0):!1}}};y(dt,"type",dt.register("ESCesiumViewer",A.ESLocalSkyBox.type,dt)),y(dt,"_defaultLocalBox"),y(dt,"_firstLoad",!0),y(dt,"_eSLocalSkyBoxArr",[]);let z0=dt;const Yi=class Yi extends xe{constructor(e,n){super(e,n);y(this,"_geoCustomDivPoi");y(this,"_textFunc",this.disposeVar(A.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new rt(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this.geoCustomDivPoi;this.dispose(A.track([o,"show"],[e,"show"])),this.dispose(A.bind([o,"position"],[e,"position"])),this.dispose(A.track([o,"allowPicking"],[e,"allowPicking"]));{this.dispose(o.pickedEvent.disposableOn(s=>{(e.allowPicking??A.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(s)})),this.dispose(o.innerHtmlMounted.disposableOn(s=>{const a=s.firstElementChild;a&&(a.style.pointerEvents="auto",a.style.cursor="default",a.onclick=l=>o.pickFromDiv(a,{type:"viewerPicking",pointerEvent:l}))}));{const s=()=>{if(!e.position)return;const l=(this.textFunc??Yi.defaultTextFunc_度格式)(e.position);o.innerHTML=Uo(l)};s();const a=this.disposeVar(A.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(a.disposableOn(s))}{const s=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?Yi.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?Yi.defaultTextFunc_度分格式:Yi.defaultTextFunc_度分秒格式};s(),this.d(n.lonLatFormatChanged.don(()=>{s()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,n){const{sceneObject:r,czmViewer:o,geoCustomDivPoi:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):(s.flyTo(e),r.flyOverEvent.emit(n,"over",o),!0):!1}flyIn(e,n){const{sceneObject:r,czmViewer:o,geoCustomDivPoi:s}=this;return o.actived?r.flyInParam?super.flyIn(e,n):(s.flyTo(e),r.flyOverEvent.emit(n,"over",o),!0):!1}};y(Yi,"type",Yi.register("ESCesiumViewer",A.ESLocationMeasurement.type,Yi)),y(Yi,"defaultTextFunc_度格式",e=>{if(!e)return"";const[n=0,r=0,o=0]=e;return`经度: ${n.toFixed(5)}°
1275
+ `,st=class st extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_loadFuncReact",this.disposeVar(A.react(void 0)));y(this,"_dataSource",this.disposeVar(A.react(void 0)));y(this,"_data");y(this,"_defaultHeight",{});y(this,"defaultBoundingSphere");y(this,"_featureStyles",this.disposeVar(A.react(void 0)));const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}let o=()=>{this.dataSource&&r.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{o()});{const s=this.dv(A.createProcessingFromAsyncFunc(async u=>{this.dataSource&&o(),this.url&&(typeof this.url=="object"?this._data=this.url:A.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(A.ESSceneObject.context.getStrFromEnv(this.url)).then(h=>h.json()).then(h=>{this._data=h}).catch(h=>{console.warn("ESGeoJson数据加载失败",h)}),this.dataSource=await d.GeoJsonDataSource.load(this._data),r.dataSources.add(this.dataSource).then(h=>{var f,g;const p=[];for(const m of h.entities.values){if(d.Entity.prototype&&(m.ESSceneObjectID=n),this._isEntityShow(m,e),m.polygon){p.push(...(f=m.polygon.hierarchy)==null?void 0:f.getValue(d.JulianDate.now()).positions);continue}if(m.polyline){p.push(...(g=m.polyline.positions)==null?void 0:g.getValue(d.JulianDate.now()));continue}if(m.position){const v=m.position.getValue(d.JulianDate.now());v&&p.push(v);continue}}this.defaultBoundingSphere=p.length>0?d.BoundingSphere.fromPoints(p):void 0}))})),a=()=>{s.isRunning&&s.cancel(),s.restart()};a();const l=this.dv(A.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(l.don(a))}{const s=()=>{var l,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(h){console.error(h)}else{const h=this.dataSource.entities.values;for(let p=0;p<h.length;p++){const f=h[p],g=this._getFeatureStyles(f);if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(l=f.polygon.height)==null?void 0:l.getValue(d.JulianDate.now())),f.polygon.height=g.fillGround?void 0:new d.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new d.ConstantProperty(!g.fillGround),f.polygon.heightReference=new d.ConstantProperty(d.HeightReference[g.heightReference.toUpperCase()]),f.polygon.show=new d.ConstantProperty(g.filled??st.defaults.filled),f.polygon.material=new d.ColorMaterialProperty(new d.Color(...g.fillColor??st.defaults.fillColor)),f.polygon.outline=new d.ConstantProperty(!1),f.polygon.classificationType=d.ClassificationType[g.classificationType.toUpperCase()],f.polyline=new d.PolylineGraphics;const m=JSON.parse(JSON.stringify((u=f.polygon.hierarchy)==null?void 0:u.getValue(d.JulianDate.now()).positions));d.Cartesian3.equals(m[0],m[m.length-1])||m.push(m[0]),f.polyline.positions=m}if(f.polyline&&(f.polyline.classificationType=d.ClassificationType[g.classificationType.toUpperCase()],f.polyline.show=new d.ConstantProperty(g.stroked??st.defaults.stroked),f.polyline.width=new d.ConstantProperty(g.strokeWidth??st.defaults.strokeWidth),f.polyline.material=new d.ColorMaterialProperty(new d.Color(...g.strokeColor??st.defaults.strokeColor)),f.polyline.clampToGround=new d.ConstantProperty(g.strokeGround)),f.billboard){f.billboard.show=new d.ConstantProperty(g.imageShow??st.defaults.imageShow),f.billboard.width=new d.ConstantProperty(g.imageSize?g.imageSize[0]:st.defaults.imageSize[0]),f.billboard.height=new d.ConstantProperty(g.imageSize?g.imageSize[1]:st.defaults.imageSize[1]);const m=g.imageUrl?typeof g.imageUrl=="string"?g.imageUrl:g.imageUrl.url:st.defaults.imageUrl;f.billboard.image=new d.ConstantProperty(A.ESSceneObject.context.getStrFromEnv(m)),f.billboard.horizontalOrigin=new d.ConstantProperty(d.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new d.ConstantProperty(d.VerticalOrigin.TOP),f.billboard.heightReference=new d.ConstantProperty(d.HeightReference[g.heightReference.toUpperCase()]);const v=g.imageAnchor??st.defaults.imageAnchor,w=g.imageOffset??st.defaults.imageOffset;if(f.billboard.pixelOffset=new d.ConstantProperty(d.Cartesian2.fromArray([-v[0]*f.billboard.width.getValue(d.JulianDate.now())+w[0],-v[1]*f.billboard.height.getValue(d.JulianDate.now())+w[1]])),f.label=new d.LabelGraphics,!f.label)return;f.label.show=new d.ConstantProperty(g.textShow??st.defaults.textShow),f.label.heightReference=new d.ConstantProperty(d.HeightReference[g.heightReference.toUpperCase()]),f.label.text=new d.ConstantProperty(g.textProperty&&g.textProperty!==""&&f.properties&&f.properties[g.textProperty]?f.properties[g.textProperty].getValue():g.textDefaultText??st.defaults.textDefaultText),f.label.fillColor=new d.ConstantProperty(new d.Color(...g.textColor??st.defaults.textColor)),f.label.showBackground=new d.ConstantProperty(g.textBackgroundColor!=null);const C=g.textFontSize&&g.textFontSize!=0?g.textFontSize:st.defaults.textFontSize,x=g.textOffset??st.defaults.textOffset;f.label.backgroundColor=new d.ConstantProperty(new d.Color(...g.textBackgroundColor??st.defaults.textBackgroundColor)),f.label.font=new d.ConstantProperty(`${g.textFontStyle} ${g.textFontWeight} ${C}px ${g.textFontFamily??st.defaults.textFontFamily}`),f.label.horizontalOrigin=new d.ConstantProperty(d.HorizontalOrigin.LEFT),f.label.verticalOrigin=new d.ConstantProperty(d.VerticalOrigin.TOP),f.label.eyeOffset=new d.ConstantProperty(d.Cartesian3.fromArray([0,0,-1]));const B=g.textAnchor??st.defaults.textAnchor;f.label.pixelOffset=new d.ConstantProperty(d.Cartesian2.fromArray([-B[0]*((g.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(d.JulianDate.now()),f.label.font.getValue(d.JulianDate.now())))+x[0],-B[1]*((g.textBackgroundColor?10:0)+C)+x[1]]))}}}};s();const a=this.dv(A.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged,this.classificationTypeChanged,this.featureStylesChanged));this.dispose(a.don(s))}{const s=()=>{if(!this.dataSource)return;const l=this.dataSource.entities.values;for(let u=0;u<l.length;u++){const h=l[u];this._isEntityShow(h,e)}};s();const a=this.ad(A.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(a.don(s))}{const s=()=>{if(this.loadFuncStr)try{const a=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=a}catch(a){console.error(a),this.loadFun=void 0}else this.loadFun=void 0};s(),this.dispose(this.loadFuncStrChanged.disposableOn(s))}this.dispose(this.flyToEvent.disposableOn(s=>{e.actived&&this.dataSource&&this.defaultBoundingSphere&&r.camera.flyToBoundingSphere(this.defaultBoundingSphere,{duration:s?s/1e3:void 0})}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}get featureStyles(){return this._featureStyles.value}set featureStyles(e){this._featureStyles.value=e}get featureStylesChanged(){return this._featureStyles.changed}_getFeatureStyles(e){var n;if(!this.featureStyles||this.featureStyles.length==0)return this.mergeFeatureStyles();for(let r=0;r<this.featureStyles.length;r++){const o=this.featureStyles[r],s=Array.isArray(o.condition)?o.condition:[o.condition],a=[];for(let l=0;l<s.length;l++){if(!e.properties){a.push(!1);continue}const u=s[l];if(typeof u=="boolean"){a.push(!0);continue}const h=(n=e.properties[u.field])==null?void 0:n.getValue(d.JulianDate.now()),p=typeof u.value=="string",f=typeof u.value=="number";if(p){a.push(A0(u,h));continue}else if(f){a.push(l0(u,h));continue}else{a.push(!1);continue}}if(a.length>0&&!a.includes(!1))return this.mergeFeatureStyles(o)}return this.mergeFeatureStyles()}mergeFeatureStyles(e={}){const{filled:n,stroked:r,fillStyle:o,strokeStyle:s,imageShow:a,imageStyle:l,textShow:u,textStyle:h}=e;return{imageShow:a??this.imageShow,imageUrl:(l==null?void 0:l.url)??this.imageUrl,imageAnchor:(l==null?void 0:l.anchor)??this.imageAnchor,imageOffset:(l==null?void 0:l.offset)??this.imageOffset,imageSize:(l==null?void 0:l.size)??this.imageSize,textShow:u??this.textShow,textProperty:(h==null?void 0:h.textProperty)??this.textProperty,textDefaultText:(h==null?void 0:h.defaultText)??this.textDefaultText,textColor:(h==null?void 0:h.color)??this.textColor,textBackgroundColor:(h==null?void 0:h.backgroundColor)??this.textBackgroundColor,textFontFamily:(h==null?void 0:h.fontFamily)??this.textFontFamily,textFontSize:(h==null?void 0:h.fontSize)??this.textFontSize,textFontStyle:(h==null?void 0:h.fontStyle)??this.textFontStyle,textFontWeight:(h==null?void 0:h.fontWeight)??this.textFontWeight,textAnchor:(h==null?void 0:h.anchor)??this.textAnchor,textOffset:(h==null?void 0:h.offset)??this.textOffset,stroked:r??this.stroked,filled:n??this.filled,strokeWidth:(s==null?void 0:s.width)??this.strokeWidth,strokeWidthType:(s==null?void 0:s.widthType)??this.strokeWidthType,strokeColor:(s==null?void 0:s.color)??this.strokeColor,strokeMaterial:(s==null?void 0:s.material)??this.strokeMaterial,strokeMaterialParams:(s==null?void 0:s.materialParams)??this.strokeMaterialParams,strokeGround:(s==null?void 0:s.ground)??this.strokeGround,fillColor:(o==null?void 0:o.color)??this.fillColor,fillMaterial:(o==null?void 0:o.material)??this.fillMaterial,fillMaterialParams:(o==null?void 0:o.materialParams)??this.fillMaterialParams,fillGround:(o==null?void 0:o.ground)??this.fillGround,heightReference:this.heightReference,classificationType:this.classificationType}}_getTextPixelWidth(e,n="16px sans-serif"){const o=document.createElement("canvas").getContext("2d");return o.font=n,o.measureText(e).width}_isEntityShow(e,n){var r;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0)e.show=this.show;else if((r=n.viewer)!=null&&r.camera){if(!this.show){e.show=this.show;return}const o=d.JulianDate.now();let s;if(e.polygon&&e.polygon.hierarchy)s=A.getMinMaxCorner(e.polygon.hierarchy.getValue(o).positions.map(u=>he(u))).center;else if(e.polyline&&e.polyline.positions)s=A.getMinMaxCorner(e.polyline.positions.getValue(o).map(u=>he(u))).center;else if(e.position){const u=e.position.getValue(o);u&&(s=he(u))}if(!s||isNaN(s[0]))return;const a=A.getDistancesFromPositions([s,xi(n.viewer.camera)],"NONE")[0];let l=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?l=this.minFeatureVisibleDistance<a&&a<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?l=a>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(l=a<this.maxFeatureVisibleDistance),e.show=this.show&&l}}};y(st,"defaults",{show:!0,allowPicking:!0,url:oE,defaultLoadFuncStr:rE,defaultLoadFuncDocStr:L5,data:R5,dataMd:Q5,stroked:!0,strokeWidth:1,strokeWidthType:"world",strokeColor:[.79,.91,.06,1],strokeMaterial:"",strokeMaterialParams:{},strokeGround:!1,filled:!0,fillColor:[.79,.91,.06,.2],fillMaterial:"",fillMaterialParams:{},fillGround:!1,imageShow:!0,imageUrl:"${earthsdk3-assets-script-dir}/assets/misc/location.png",imageSize:[64,64],imageAnchor:[.5,1],imageOffset:[0,0],textShow:!0,textProperty:"",textDefaultText:"默认标注",textColor:[1,1,1,1],textBackgroundColor:[.79,.91,.06,1],textFontFamily:"Arial",textFontSize:16,textFontWeight:"normal",textFontStyle:"normal",textAnchor:[.5,1],textOffset:[0,0],strokeWidthTypes:[["screen","screen"],["world","world"]],minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReferences:[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]]});let ss=st;(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:A.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:A.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:A.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:A.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:A.reactArrayWithUndefined(void 0),imageAnchor:A.reactArrayWithUndefined(void 0),imageOffset:A.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:A.reactArrayWithUndefined(void 0),textBackgroundColor:A.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:A.reactArrayWithUndefined(void 0),textOffset:A.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(ss||(ss={})),A.extendClassProps(ss.prototype,ss.createDefaultProps);const zc=class zc extends Ci{constructor(e,n){super(e,n);y(this,"_pointFeatures",this.disposeVar(A.react(void 0)));y(this,"_defaultPointsBoundingSphere");y(this,"screenObjectIdsLabel",new Set);y(this,"screenObjectIdsBillboard",new Set);y(this,"_featureStyles",this.disposeVar(A.react(void 0)));y(this,"_textMeasureCtx");const r=n.viewer;if(!r){console.warn("viewer is undefined!");return}const o=ht(r);if(!o)return;const{screenManager:s}=o,a=this.disposeVar(new ss(n,e.id));{const l=()=>{if(a.featureStyles=this.featureStyles=void 0,!e.features)return;const u=A.toGeoJson(e.features),h={type:u.type,features:[]};a.url={type:u.type,features:u.features.filter(p=>p.geometry.type.toLowerCase().includes("point")?(h.features.push(p),!1):!0)},this.pointFeatures=h};l(),this.ad(e.featuresChanged.don(l))}this.ad(A.track([a,"show"],[e,"show"])),this.ad(A.track([a,"allowPicking"],[e,"allowPicking"])),this.ad(A.track([a,"loadFuncStr"],[e,"loadFuncStr"])),this.ad(A.track([a,"stroked"],[e,"stroked"])),this.ad(A.track([a,"strokeWidth"],[e,"strokeWidth"])),this.ad(A.track([a,"strokeWidthType"],[e,"strokeWidthType"])),this.ad(A.track([a,"strokeColor"],[e,"strokeColor"])),this.ad(A.track([a,"strokeMaterial"],[e,"strokeMaterial"])),this.ad(A.track([a,"strokeMaterialParams"],[e,"strokeMaterialParams"])),this.ad(A.track([a,"strokeGround"],[e,"strokeGround"])),this.ad(A.track([a,"filled"],[e,"filled"])),this.ad(A.track([a,"fillColor"],[e,"fillColor"])),this.ad(A.track([a,"fillMaterial"],[e,"fillMaterial"])),this.ad(A.track([a,"fillMaterialParams"],[e,"fillMaterialParams"])),this.ad(A.track([a,"fillGround"],[e,"fillGround"])),this.ad(A.track([a,"minFeatureVisibleDistance"],[e,"minFeatureVisibleDistance"])),this.ad(A.track([a,"maxFeatureVisibleDistance"],[e,"maxFeatureVisibleDistance"])),this.ad(A.track([a,"heightReference"],[e,"heightReference"])),this.ad(A.track([a,"classificationType"],[e,"classificationType"]));{const l=()=>{!this.pointFeatures||this.pointFeatures.features.length==0||(this._defaultPointsBoundingSphere=d.BoundingSphere.fromPoints(this.pointFeatures.features.map(u=>(u.geometry.type=="Point"?[u.geometry.coordinates]:u.geometry.coordinates).map(p=>Se(p))).flat(1/0)))};l(),this.ad(this.pointFeaturesChanged.don(l))}{const l=()=>{s.remove(e.typeName,e.id,{label:this.screenObjectIdsLabel}),this.screenObjectIdsLabel.clear()};this.ad(()=>{l()});const u=()=>{if(l(),!((e.textShow??A.ESGeoJson.defaults.textShow)&&(e.show??A.ESGeoJson.defaults.show))||!this.pointFeatures)return;const p=e.textFontSize&&e.textFontSize!=0?e.textFontSize:A.ESGeoJson.defaults.textStyle.fontSize,f={show:!0,heightReference:d.HeightReference[e.heightReference??A.ESGeoJson.defaults.heightReference],fillColor:new d.Color(...e.textColor??A.ESGeoJson.defaults.textStyle.color),showBackground:e.textBackgroundColor!=null,backgroundColor:new d.Color(...e.textBackgroundColor??A.ESGeoJson.defaults.textStyle.backgroundColor??[1,1,1,1]),font:`${e.textFontStyle} ${e.textFontWeight} ${p}px ${e.textFontFamily??A.ESGeoJson.defaults.textStyle.fontFamily}`,horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.TOP,eyeOffset:d.Cartesian3.fromArray([0,0,-1]),distanceDisplayCondition:new d.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((g,m)=>{const v=this._getFeatureStyles(g.properties,f);if(!Reflect.has(v,"text")){const C=e.textAnchor??A.ESGeoJson.defaults.textStyle.anchor,x=e.textOffset??A.ESGeoJson.defaults.textStyle.offset,B=e.textProperty??A.ESGeoJson.defaults.textStyle.textProperty,b=e.textDefaultText??A.ESGeoJson.defaults.textStyle.defaultText;v.text=B&&B!==""&&g.properties&&g.properties[B]?g.properties[B]:b,v.pixelOffset=d.Cartesian2.fromArray([-C[0]*((v.showBackground?-14:0)+this._getTextPixelWidth(v.text,v.font))+x[0],-C[1]*((v.showBackground?10:0)+p)+x[1]])}(g.geometry.type=="Point"?[g.geometry.coordinates]:g.geometry.coordinates).forEach((C,x)=>{const B={index:`${m}${x}`,name:v.text,position:C,zOrder:e.zIndex??A.ESGeoJson.defaults.zIndex,properties:g.properties},b=s.addLabel(e.id,e.typeName,v,B);this.screenObjectIdsLabel.add(b.screenObjectId)})})};u();const h=this.ad(A.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.textShowChanged,e.textPropertyChanged,e.textDefaultTextChanged,e.textColorChanged,e.textBackgroundColorChanged,e.textFontFamilyChanged,e.textFontSizeChanged,e.textFontStyleChanged,e.textFontWeightChanged,e.textAnchorChanged,e.textOffsetChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged,this.featureStylesChanged));this.ad(h.don(u))}{const l=()=>{s.remove(e.typeName,e.id,{billboard:this.screenObjectIdsBillboard}),this.screenObjectIdsBillboard.clear()};this.ad(()=>{l()});const u=()=>{if(l(),!((e.imageShow??A.ESGeoJson.defaults.imageShow)&&(e.show??A.ESGeoJson.defaults.show))||!this.pointFeatures)return;const p=e.imageAnchor??A.ESGeoJson.defaults.imageStyle.anchor,f=e.imageOffset??A.ESGeoJson.defaults.imageStyle.offset,g=e.imageSize?e.imageSize[0]:A.ESGeoJson.defaults.imageStyle.size[0],m=e.imageSize?e.imageSize[1]:A.ESGeoJson.defaults.imageStyle.size[1],v={show:!0,width:g,height:m,image:A.ESSceneObject.context.getStrFromEnv(e.imageUrl?typeof e.imageUrl=="string"?e.imageUrl:e.imageUrl.url:A.ESGeoJson.defaults.imageStyle.url),horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.TOP,heightReference:d.HeightReference[e.heightReference??A.ESGeoJson.defaults.heightReference],pixelOffset:d.Cartesian2.fromArray([-p[0]*g+f[0],-p[1]*m+f[1]]),distanceDisplayCondition:new d.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((w,C)=>{const x=this._getFeatureStyles(w.properties,v);(w.geometry.type=="Point"?[w.geometry.coordinates]:w.geometry.coordinates).forEach((b,P)=>{const S={index:`${C}${P}`,name:"",position:b,zOrder:e.zIndex??A.ESGeoJson.defaults.zIndex,properties:w.properties},M=s.addImage(e.id,e.typeName,x,S);this.screenObjectIdsBillboard.add(M.screenObjectId)})})};u();const h=this.ad(A.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.imageAnchorChanged,e.imageOffsetChanged,e.imageShowChanged,e.imageSizeChanged,e.imageUrlChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged,this.featureStylesChanged));this.ad(h.don(u))}this.ad(e.flyToEvent.disposableOn(l=>{if(!n.actived)return;if(e.flyInParam){const{position:h,rotation:p,flyDuration:f}=e.flyInParam;return ae(n.viewer,h,void 0,p,f),!0}let u;a.defaultBoundingSphere&&this._defaultPointsBoundingSphere?u=d.BoundingSphere.fromBoundingSpheres([a.defaultBoundingSphere,this._defaultPointsBoundingSphere]):a.defaultBoundingSphere?u=a.defaultBoundingSphere:this._defaultPointsBoundingSphere&&(u=this._defaultPointsBoundingSphere),u&&Bi(n,e,this.id,he(u.center),u.radius,l)}));{const l=async(u,h,p)=>{if(!n.actived)return;const f=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(u,h)));if(!(!f||!(f!=null&&f.positions)))if(f.type=="Point"||f.type=="MultiPoint")Bi(n,e,this.id,await this._calculateFeatureHeight(f.type=="MultiPoint"?f.positions.flat():f.positions,e.heightReference,n),1e3,p);else{const g=f.type=="Polygon"||f.type=="MultiPolygon"||f.type=="MultiLineString";let m=[];g?m=f.positions.flat(f.type=="MultiPolygon"?2:1).map(x=>this._calculateFeatureHeight(x,e.fillGround?"CLAMP_TO_GROUND":"NONE",n)):m=f.positions.map(x=>this._calculateFeatureHeight(x,e.strokeGround?"CLAMP_TO_GROUND":"NONE",n));const{minPos:v,maxPos:w,center:C}=A.getMinMaxCorner(m);Bi(n,e,this.id,C,A.getDistancesFromPositions([v,w],"NONE")[0],p)}};this.d(e.flyToFeatureEvent.don((u,h,p)=>l(u,h,p))),this.d(e.flyToFeatureIndexEvent.don((u,h)=>l(u,void 0,h)))}this.ad(e.setFeatureStyleEvent.don(l=>{a.featureStyles=this.featureStyles=l})),this.ad(e.resetFeatureStyleEvent.don(()=>{a.featureStyles=this.featureStyles=void 0}))}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}get featureStyles(){return this._featureStyles.value}set featureStyles(e){this._featureStyles.value=e}get featureStylesChanged(){return this._featureStyles.changed}_getFeatureStyles(e,n){const r="image"in n;if(n=structuredClone(n),!this.featureStyles||this.featureStyles.length==0)return n;for(let o=0;o<this.featureStyles.length;o++){const s=this.featureStyles[o],a=Array.isArray(s.condition)?s.condition:[s.condition],l=[];for(let u=0;u<a.length;u++){if(!e){l.push(!1);continue}const h=a[u];if(typeof h=="boolean"){l.push(!0);continue}const p=e[h.field],f=typeof h.value=="string",g=typeof h.value=="number";if(f){l.push(A0(h,p));continue}else if(g){l.push(l0(h,p));continue}else{l.push(!1);continue}}if(l.length>0&&!l.includes(!1))if(r){n=n;const{imageShow:u,imageStyle:h={}}=s;n.show=u??n.show,h.anchor=h.anchor??this.sceneObject.imageAnchor??A.ESGeoJson.defaults.billboardStyle.anchor,h.offset=h.offset??this.sceneObject.imageOffset??A.ESGeoJson.defaults.billboardStyle.offset,h.size=h.size??this.sceneObject.imageSize??A.ESGeoJson.defaults.billboardStyle.size,h.url=h.url??this.sceneObject.imageUrl??A.ESGeoJson.defaults.billboardStyle.url;const p=h.anchor,f=h.offset;n.width=h.size[0],n.height=h.size[1];const g=typeof h.url=="string"?h.url:h.url.url;return n.image=A.ESSceneObject.context.getStrFromEnv(g),n.pixelOffset=d.Cartesian2.fromArray([-p[0]*n.width+f[0],-p[1]*n.height+f[1]]),n}else{n=n;const{textShow:u,textStyle:h={}}=s;n.show=u??n.show,h.anchor=h.anchor??this.sceneObject.textAnchor??A.ESGeoJson.defaults.textStyle.anchor,h.backgroundColor=h.backgroundColor??this.sceneObject.textBackgroundColor??A.ESGeoJson.defaults.textStyle.backgroundColor,h.color=h.color??this.sceneObject.textColor??A.ESGeoJson.defaults.textStyle.color,h.defaultText=h.defaultText??this.sceneObject.textDefaultText??A.ESGeoJson.defaults.textStyle.defaultText,h.fontFamily=h.fontFamily??this.sceneObject.textFontFamily??A.ESGeoJson.defaults.textStyle.fontFamily,h.fontSize=h.fontSize??this.sceneObject.textFontSize??A.ESGeoJson.defaults.textStyle.fontSize,h.fontStyle=h.fontStyle??this.sceneObject.textFontStyle??A.ESGeoJson.defaults.textStyle.fontStyle,h.fontWeight=h.fontWeight??this.sceneObject.textFontWeight??A.ESGeoJson.defaults.textStyle.fontWeight,h.offset=h.offset??this.sceneObject.textOffset??A.ESGeoJson.defaults.textStyle.offset,h.textProperty=h.textProperty??this.sceneObject.textProperty??A.ESGeoJson.defaults.textStyle.textProperty;const p=h.fontSize,f=h.offset,g=h.anchor;return n.fillColor=new d.Color(...h.color),n.showBackground=(h==null?void 0:h.backgroundColor)!=null,n.backgroundColor=new d.Color(...h.backgroundColor??[1,1,1,1]),n.font=`${h.fontStyle} ${h.fontWeight} ${p}px ${h.fontFamily}`,n.text=h.textProperty&&h.textProperty!==""&&e&&e[h.textProperty]?e[h.textProperty]:h.defaultText,n.pixelOffset=d.Cartesian2.fromArray([-g[0]*((n.showBackground?-14:0)+this._getTextPixelWidth(n.text,n.font))+f[0],-g[1]*((n.showBackground?10:0)+p)+f[1]]),n}}return n}_getFeatureByIndexOrProperties(e,n){var a,l,u,h,p,f,g,m;const{sceneObject:r}=this,o=r.features;if(!o)return;const s=Reflect.get(o,"features")||Reflect.get(o,"geometries");if(s){if(n){let v=s.find(w=>(w==null?void 0:w.properties[e])==n);return{type:v!=null&&v.coordinates?v.type:(a=v==null?void 0:v.geometry)==null?void 0:a.type,positions:(v==null?void 0:v.coordinates)||((l=v==null?void 0:v.geometry)==null?void 0:l.coordinates)}}else if(typeof e=="number")return{type:(u=s[e])!=null&&u.coordinates?s[e].type:(p=(h=s[e])==null?void 0:h.geometry)==null?void 0:p.type,positions:((f=s[e])==null?void 0:f.coordinates)||((m=(g=s[e])==null?void 0:g.geometry)==null?void 0:m.coordinates)}}}async _calculateFeatureHeight(e,n,r){const o=[...e];return n=="NONE"?o[2]=o[2]??0:n=="CLAMP_TO_GROUND"||!o[2]?o[2]=await r.getTerrainHeight(o)??0:o[2]+=await r.getTerrainHeight(o)??0,o}_getTextPixelWidth(e,n){if(!this._textMeasureCtx){const r=document.createElement("canvas");this._textMeasureCtx=r.getContext("2d")}return this._textMeasureCtx.font=n,this._textMeasureCtx.measureText(e).width}};y(zc,"type",zc.register("ESCesiumViewer",A.ESGeoJson.type,zc));let I0=zc;const Nc=class Nc extends kt{constructor(e,n){super(e,n);y(this,"_czmGeoESRectangle");y(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Me(n,e.id)),this._czmGeoESRectangle=this.disposeVar(new xn(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this._czmGeoESRectangle,s=this._geoPolyline;s.arcType="RHUMB",this.dispose(A.track([s,"color"],[e,"strokeColor"])),this.dispose(A.track([s,"width"],[e,"strokeWidth"])),this.dispose(A.track([s,"ground"],[e,"strokeGround"])),this.dispose(A.track([o,"ground"],[e,"fillGround"])),this.dispose(A.track([o,"allowPicking"],[e,"allowPicking"]));{const a=()=>{s.show=e.show&&e.stroked,o.show=e.show&&e.filled};a();const l=this.disposeVar(A.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(l.disposableOn(a))}{const a=()=>{e.filled?o.material={type:"Color",color:e.fillColor}:o.material=void 0};a();const l=this.disposeVar(A.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(a))}{const a=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:u,maxPos:h}=A.getMinMaxCorner(l);o.rectangle=[u[0],u[1],h[0],h[1]],o.height=l[0][2],o.extrudedHeight=l[0][2];const p=l.map(v=>(l&&(v[2]=l[0][2]),v)),f=p[0],g=p[1],m=[f,[f[0],g[1],f[2]],g,[g[0],f[1],g[2]]];s.positions=[...m,f]}else o.rectangle=void 0,s.positions=void 0,o.height=0,o.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,n){const{sceneObject:r,czmViewer:o}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):r.points?(Ae(o,r,n,r.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:r,czmViewer:o,czmGeoESRectangle:s}=this;return o.actived?r.flyInParam?super.flyIn(e,n):r.points?(Ae(o,r,n,r.points,e),!0):!1:!1}};y(Nc,"type",Nc.register("ESCesiumViewer",A.ESGeoRectangle.type,Nc));let D0=Nc;class bl extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new Wr(e,n));const{geoPolygon:r}=this;this.dispose(A.bind([r,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(s=>{r.flyTo(s)})),this.dispose(A.bind([r,"show"],[this,"show"])),this.dispose(A.bind([r,"fill"],[this,"filled"])),this.dispose(A.bind([r,"strokeGround"],[this,"strokeGround"])),this.dispose(A.bind([r,"ground"],[this,"ground"])),this.dispose(A.bind([r,"outline"],[this,"outline"])),this.dispose(A.bind([r,"outlineColor"],[this,"outlineColor"])),this.dispose(A.bind([r,"outlineWidth"],[this,"outlineWidth"])),this.dispose(A.bind([r,"color"],[this,"color"])),this.dispose(A.bind([r,"depth"],[this,"depth"]));const o=()=>{if(this.positions&&this.positions.length>=2){const s=Yf([...this.positions,this.positions[0]]);r.positions=s}else r.positions=void 0};o(),this.dispose(this.positionsChanged.disposableOn(o))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:A.reactArray([1,1,1,1]),outlineWidth:1,color:A.reactArrayWithUndefined([1,1,1,.5]),positions:A.reactPositions(void 0),depth:0})})(bl||(bl={})),A.extendClassProps(bl.prototype,bl.createDefaultProps);const Vc=class Vc extends kt{constructor(e,n){super(e,n);y(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new bl(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this._geoSmoothPolygon;this.dispose(A.track([o,"show"],[e,"show"])),this.dispose(A.bind([o,"positions"],[e,"points"])),this.dispose(A.track([o,"strokeGround"],[e,"strokeGround"])),this.dispose(A.track([o,"allowPicking"],[e,"allowPicking"])),this.dispose(A.track([o,"outline"],[e,"stroked"])),this.dispose(A.track([o,"outlineColor"],[e,"strokeColor"])),this.dispose(A.track([o,"outlineWidth"],[e,"strokeWidth"])),this.dispose(A.track([o,"strokeGround"],[e,"strokeGround"])),this.dispose(A.track([o,"filled"],[e,"filled"])),this.dispose(A.track([o,"color"],[e,"fillColor"])),this.dispose(A.track([o,"ground"],[e,"ground"]));{const s=()=>{o.ground=e.ground||e.fillGround};s();const a=this.dv(A.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(a.don(s))}{const s=()=>{o.color=e.filled?e.fillColor:Bl.defaults.fillStyle.color};s();const a=this.disposeVar(A.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(a.disposableOn(s))}this.dispose(A.track([o,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,n){const{sceneObject:r,czmViewer:o,geoSmoothPolygon:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):s.positions?(Ae(o,r,n,s.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:r,czmViewer:o,geoSmoothPolygon:s}=this;return o.actived?r.flyInParam?super.flyIn(e,n):s.positions?(Ae(o,r,n,s.positions,e),!0):!1:!1}};y(Vc,"type",Vc.register("ESCesiumViewer",Bl.type,Vc));let M0=Vc;const Gc=class Gc extends xe{constructor(e,n){super(e,n);y(this,"_czmModel");const r=n.viewer;if(!r){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new Mt(n,e.id));const o=this._czmModel;this.d(o.readyEvent.don(a=>{var l;o.activeAnimationsJson=(l=o.gltf.animations)==null?void 0:l.map((u,h)=>({index:h,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"})),e.czmModelReadyEvent.emit(a),e.readyEvent.emit(a)})),this.ad(new wh(r,this._czmModel)),this.d(A.track([o,"show"],[e,"show"])),this.d(A.track([o,"color"],[e,"czmColor"])),this.d(A.track([o,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(A.track([o,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(A.bind([o,"position"],[e,"position"])),this.d(A.track([o,"nativeScale"],[e,"czmNativeScale"])),this.d(A.track([o,"scale"],[e,"scale"])),this.ad(A.track([o,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(A.track([o,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const a=l=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:l}:{atmosphereScatteringIntensity:l}};a(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(l=>a(l)))}{const a=()=>{var l,u;(l=e.czmEnvironmentMapManager)!=null&&l.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};a(),this.ad(e.czmEnvironmentMapManagerChanged.don(a))}{const a=()=>{const l=[...e.rotation??[0,0,0]];l[0]+=e.instances&&e.instances.length!=0?0:90,o.rotation=l};a(),this.d(e.rotationChanged.don(a));{const l=()=>{if(a(),!e.instances||e.instances.length==0){o.instances=void 0;return}o.instances=e.instances.map(u=>{const h=JSON.parse(JSON.stringify(u));return!h.rotation&&(h.rotation=[0,0,0]),h.rotation[0]+=90,h})};l(),this.ad(e.instancesChanged.don(l))}}this.ad(e.setMaterialEvent.don(a=>{o.setMaterial(a)}));{const a=()=>{const l=[...o.rotation];l[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=l};a(),this.d(o.rotationChanged.don(a))}{const a=this.dv(A.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),l=()=>{e.allowPicking&&!e.editing?o.allowPicking=!0:o.allowPicking=!1};l(),this.d(a.don(l))}const s=()=>{var a;o.url=A.ESSceneObject.context.getStrFromEnv(Ch(typeof e.url=="string"?e.url:((a=e.url)==null?void 0:a.url)??A.ESGltfModel.defaults.url))};s(),this.d(e.urlChanged.don(s)),this.d(e.setNodePositionEvent.don((a,l)=>{o.setNodeTranslation(a,l)})),this.d(e.setNodeRotationEvent.don((a,l)=>{o.setNodeRotation(a,l)})),this.d(e.setNodeScaleEvent.don((a,l)=>{o.setNodeScale(a,l)})),this.d(e.printDebugInfoEvent.don(()=>{o.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,n){const{sceneObject:r,czmViewer:o,model:s}=this;return o.actived?r.flyToParam||r.flyInParam?(super.flyTo(e,n),!0):(s&&Vt(o,r,n,e,s,!0),!!s):!1}};y(Gc,"type",Gc.register("ESCesiumViewer",A.ESGltfModel.type,Gc));let U0=Gc;function sE(i,t){const e=i[0]-t[0],n=i[1]-t[1],r=i[2]-t[2];return Math.sqrt(e*e+n*n+r*r)}class El extends A.Destroyable{constructor(e,n){super();y(this,"_pickedEvent",this.disposeVar(new A.Event));y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_distance",this.disposeVar(A.react(0)));y(this,"_surfaceDistance",this.disposeVar(A.react(0)));y(this,"_height",this.disposeVar(A.react(0)));y(this,"_middlePosition",this.disposeVar(A.reactArrayWithUndefined(void 0)));y(this,"_heightPosition",this.disposeVar(A.reactArrayWithUndefined(void 0)));const r=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const s=this._surfaceDistance.value=A.geoDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="RHUMB"){const s=this._surfaceDistance.value=A.geoRhumbDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="NONE"){const s=A.lbhToXyz(this.positions[0]),a=A.lbhToXyz(this.positions[1]);this._distance.value=sE(s,a),this._surfaceDistance.value=sE(A.lbhToXyz(this._middlePosition.value),a),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};r();const o=this.disposeVar(A.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(o.disposableOn(r));{const s=this.disposeVar(new Me(e,n));s.ground=!1,s.loop=!1,this.dispose(A.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(A.bind([s,"arcType"],[this,"arcType"])),this.dispose(A.bind([s,"color"],[this,"color"])),this.dispose(A.bind([s,"dashLength"],[this,"dashLength"])),this.dispose(A.bind([s,"dashPattern"],[this,"dashPattern"])),this.dispose(A.bind([s,"gapColor"],[this,"gapColor"])),this.dispose(A.bind([s,"hasArrow"],[this,"hasArrow"])),this.dispose(A.bind([s,"hasDash"],[this,"hasDash"])),this.dispose(A.bind([s,"show"],[this,"show"])),this.dispose(A.bind([s,"width"],[this,"width"])),this.dispose(A.bind([s,"depthTest"],[this,"depthTest"]));{s.loop=!0;const l=()=>{if(this.positions&&this.positions.length===2){const[u,h]=this.positions;s.positions=[u,h,[u[0],u[1],h[2]]]}else s.positions=void 0};l(),this.dispose(this.positionsChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&s.flyTo(l)}));const a=this.disposeVar(new rt(e,n));this.dispose(A.track([a,"shadowDom"],[this,"shadowDom"])),this.dispose(A.track([a,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(A.track([a,"show"],[this,"show"]));{const l=()=>{a.position=this.heightPosition};l(),this.dispose(this.heightPositionChanged.disposableOn(l))}{const l=()=>{a.innerHTML=Uo(`高度: ${xh(this.height)}`,0)};l(),this.dispose(this.heightChanged.disposableOn(l))}this.ad(a.pickedEvent.don(l=>{Wn(l)===0&&this.pickedEvent.emit(l)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:A.reactPositions(void 0),width:1,color:A.reactArray([1,1,1,1]),hasDash:!1,gapColor:A.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(El||(El={})),A.extendClassProps(El.prototype,El.createDefaultProps);const Wc=class Wc extends kt{constructor(e,n){super(e,n);y(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new El(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:o}=this;this.dispose(A.track([o,"show"],[e,"show"])),this.dispose(A.track([o,"allowPicking"],[e,"allowPicking"])),this.dispose(A.bind([o,"positions"],[e,"points"]));{const s=()=>{if(e.stroked)o.width=e.strokeWidth;else{o.width=0;return}o.width=e.strokeWidth,o.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(o.hasDash=!0,o.hasArrow=!1):u==="hasArrow"?(o.hasDash=!1,o.hasArrow=!0):(o.hasDash=!1,o.hasArrow=!1);const h=e.strokeStyle;if(h.material==="hasDash"&&h.materialParams)try{const p=h.materialParams;Reflect.has(p,"gapColor")&&(o.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(o.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(o.dashPattern=p.dashPattern)}catch(p){console.error(p)}else o.gapColor=[0,0,0,0],o.dashLength=0,o.dashPattern=0};s();const a=this.disposeVar(A.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(o.pickedEvent.disposableOn(s=>{Wn(s)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,n){const{sceneObject:r,czmViewer:o,czmHeightMeasurement:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):s.positions?(Ae(o,r,n,s.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:r,czmViewer:o,czmHeightMeasurement:s}=this;return o.actived?r.flyInParam?super.flyIn(e,n):s.positions?(Ae(o,r,n,s.positions,e),!0):!1:!1}};y(Wc,"type",Wc.register("ESCesiumViewer",A.ESHeightMeasurement.type,Wc));let R0=Wc;const Q0={czmAnimationsStand:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsWalk:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsRun:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},Kc=class Kc extends xe{constructor(e,n){super(e,n);y(this,"_czmModelPrimitive");const r=n.viewer;if(!r){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Mt(n,this.sceneObject.id));const o=this._czmModelPrimitive;this.dispose(A.track([o,"show"],[e,"show"])),this.dispose(A.bind([o,"position"],[e,"position"])),this.dispose(ft([o,"rotation"],[e,"rotation"])),this.dispose(A.bind([o,"scale"],[e,"scale"])),this.d(o.readyEvent.don(w=>{e.readyEvent.emit(w)}));{const w=this.dv(A.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),C=()=>{e.allowPicking&&!e.editing?o.allowPicking=!0:o.allowPicking=!1};C(),this.d(w.don(C))}const s=A.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),a=A.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),l=A.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=A.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),h=A.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),p=A.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=A.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/repairman.glb"),g=()=>{switch(e.mode){case"worker":o.url=s;break;case"police":o.url=a;break;case"pedestrian":o.url=l;break;case"stranger":o.url=u;break;case"suitMan":o.url=h;break;case"suitWoman":o.url=p;break;case"repairMan":o.url=f;break;default:o.url=s;break}};this.dispose(e.modeChanged.disposableOn(()=>{g()})),g();const m=()=>{const w=e.animation??A.ESHuman.defaults.animation;if(!e.show){o.activeAnimationsJson=void 0;return}w==="walking"?o.activeAnimationsJson=Q0.czmAnimationsWalk:w==="standing"?o.activeAnimationsJson=Q0.czmAnimationsStand:w==="running"&&(o.activeAnimationsJson=Q0.czmAnimationsRun)};m();const v=this.ad(A.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(v.disposableOn(()=>m())),this.ad(new wh(r,o))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:r,czmViewer:o,czmModelPrimitive:s}=this;return!o.actived||!o.viewer?!1:r.flyToParam||r.flyInParam?(super.flyTo(e,n),!0):(s&&Vt(o,r,n,e,s,!0),!!s)}};y(Kc,"type",Kc.register("ESCesiumViewer",A.ESHuman.type,Kc));let L0=Kc;class aE extends A.Destroyable{constructor(e,n){super();y(this,"_czmGeoCanvasImagePoi");y(this,"flyTo",(e,n)=>{if(this.czmGeoCanvasImagePoi.position){ae(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Ui,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new gn(n));const r=this._czmGeoCanvasImagePoi;r.pickOnClick=!0,this.d(r.pickedEvent.don(o=>{(e.allowPicking??!1)&&e.pickedEvent.emit(o)}));{const o=h=>{let p=h;return h.includes("inner://")&&(p="${earthsdk3-assets-script-dir}/assets/img/points/"+h.split("inner://")[1]),A.ESSceneObject.context.getStrFromEnv(Ch(p))},s=()=>{const h=o(typeof e.url=="string"?e.url:e.url.url);if(r.imageUri=h,e.sizeByContent){const f=new Image;f.src=h,f.onload=()=>{r.size=[f.width,f.height]}}else{const f=e.size;r.size=[...f]}},a=this.disposeVar(A.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(a.disposableOn(()=>s())),s(),this.d(A.track([r,"zOrder"],[e,"zOrder"])),this.dispose(A.track([r,"show"],[e,"show"])),this.dispose(A.bind([r,"position"],[e,"position"])),this.ad(A.bind([r,"isHoverZoom"],[e,"isHoverZoom"])),this.ad(A.bind([r,"hoverHighlight"],[e,"hoverHighlight"]));{const h=()=>{r.scale=[e.scale[1],e.scale[2]]};h(),this.dispose(e.scaleChanged.don(h))}const l=()=>{const h=e.anchor,p=e.offset;h?r.originRatioAndOffset=[...h,-p[0],-p[1]]:r.originRatioAndOffset=[0,0,0,0]},u=this.ad(A.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>l())),l(),this.dispose(r.clickEvent.disposableOn(h=>{const{offsetX:p,offsetY:f}=h,m={type:h.button===0?"leftClick":h.button===2?"rightClick":void 0,add:{mousePos:[p,f]}};e.widgetEvent.emit(m)})),this.dispose(r.hoveredChanged.disposableOn(h=>{if(h===void 0)return;const p={type:h?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(p)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class AE extends A.Destroyable{constructor(e,n,r){super();y(this,"_czmGeoImageModel");y(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});y(this,"_isPointEvent",!1);y(this,"flyTo",(e,n)=>{if(this.czmGeoImageModel.position)return Bi(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new Zn(n,e.id));const o=this._czmGeoImageModel;this.ad(n.clickEvent.don(f=>{const g=f==null?void 0:f.pointerEvent;g&&(this._isPointEvent=!0,this._eventInfo={type:g.button==0?"leftClick":g.button==2?"rightClick":"leftClick",add:{mousePos:[g.offsetX,g.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var g,m,v;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((g=this._eventInfo.add)!=null&&g.mousePos)&&Math.abs(f.screenPosition[0]-((m=this._eventInfo.add)==null?void 0:m.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((v=this._eventInfo.add)==null?void 0:v.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),A.engineObjectCreatedUpdate(this,e,()=>{const f=n.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((g,m)=>{(g==null?void 0:g.sceneObject)==(m==null?void 0:m.sceneObject)||(g==null?void 0:g.sceneObject)!=e&&(m==null?void 0:m.sceneObject)!=e||(g!=null&&g.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:g==null?void 0:g.screenPosition}},g.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&g.sceneObject.id==e.id&&(o.scale=[o.scale[0]*1.5,o.scale[1]*1.5])),m!=null&&m.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:g==null?void 0:g.screenPosition}},m.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&m.sceneObject.id==e.id&&(o.scale=[o.scale[0]/1.5,o.scale[1]/1.5])))}))});const s=e.sizeByContent,l=(f=>{let g=f;return f.includes("inner://")&&(g="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),A.ESSceneObject.context.getStrFromEnv(Ch(g))})(typeof r.sceneObject.url=="string"?r.sceneObject.url:r.sceneObject.url.url),u=new Image;u.src=l,u.onload=()=>{if(s)o.size=[u.width/100,u.height/100];else{const f=e.size;o.size=[f[0]/100,f[1]/100]}},o.uri=l,this.dispose(A.track([o,"show"],[e,"show"])),this.dispose(A.bind([o,"position"],[e,"position"])),this.dispose(A.track([o,"allowPicking"],[e,"allowPicking"])),o.pixelSize=void 0,o.useAxis="XZ";{const f=()=>{o.scale=[e.scale[1],e.scale[2]]};f(),this.d(e.scaleChanged.don(f))}{const f=()=>{e.rotationType===0&&(o.rotationMode="WithProp",this.d(ft([o,"rotation"],[e,"rotation"]))),e.rotationType===1&&(o.rotationMode="WithCamera"),e.rotationType===2&&(o.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const h=()=>{const f=e.anchor,g=e.offset;f?o.originRatioAndOffset=[...f,-g[0]/100,-g[1]/100]:o.originRatioAndOffset=[0,0,0,0]},p=this.ad(A.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(p.disposableOn(()=>h())),h()}get czmGeoImageModel(){return this._czmGeoImageModel}}const $c=class $c extends vl{constructor(e,n){super(e,n);y(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(A.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new A.ObjResettingWithEvent(o,()=>this.sceneObject.screenRender?new aE(this.sceneObject,this.czmViewer):new AE(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:r,czmViewer:o,resetting:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):(s&&s.obj&&s.obj.flyTo(e,n),r.flyOverEvent.emit(n,"over",o),!0):!1}};y($c,"type",$c.register("ESCesiumViewer",A.ESImageLabel.type,$c));let O0=$c;function O5(i){switch(i){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const qc=class qc extends Ci{constructor(e,n){super(e,n);y(this,"_czmImagery");if(this._czmImagery=this.dv(new to(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this._czmImagery;{const s=this.ad(A.reactJson(""));{const u=()=>{if(typeof e.url=="string")s.value=A.ESSceneObject.context.getStrFromEnv(e.url);else{const h=e.url;h.url=A.ESSceneObject.context.getStrFromEnv(h.url),s.value=h}};u(),this.ad(e.urlChanged.don(u))}const a=()=>{var m;if(!s.value)return;const u=(((m=e.options)==null?void 0:m.type)??"auto").toLowerCase(),h=e.options??{};let p={type:"UrlTemplateImageryProvider",url:s.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...h},f=s.value,g=typeof f=="string"?f:f.url;if(u==="auto"){const v=g.toLowerCase();if(v.startsWith("ion://")){const C=+v.substring(6);p={...h,assetId:C,type:"IonImageryProvider"}}else if(v.includes("{x}")||v.includes("{y}")||v.includes("{z}"))p.type="UrlTemplateImageryProvider";else if(v.includes("wmts"))p.type="WebMapTileServiceImageryProvider";else if(v.includes("wms"))p.type="WebMapServiceImageryProvider";else{if(g.includes("/tilemapresource.xml")){const w=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=w:f.url=w,p.url=f}p.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&g.includes("/tilemapresource.xml")){const v=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=v:f.url=v,p.url=f}else if(u==="ion"&&g.startsWith("ion://")){const w=+g.substring(6);p={...h,assetId:w,type:"IonImageryProvider"}}p.type=O5(u)}console.log("imageryProvider",p),o.imageryProvider=p};a();const l=this.dv(A.createNextAnimateFrameEvent(s.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(l.don(a))}this.d(A.track([o,"show"],[e,"show"])),this.d(A.bind([o,"alpha"],[e,"opacity"])),this.d(A.bind([o,"alpha"],[e,"czmAlpha"])),this.d(A.track([o,"splitDirection"],[e,"splitDirection"])),this.d(A.track([o,"brightness"],[e,"czmBrightness"])),this.d(A.track([o,"contrast"],[e,"czmContrast"])),this.d(A.track([o,"hue"],[e,"czmHue"])),this.d(A.track([o,"saturation"],[e,"czmSaturation"])),this.d(A.track([o,"gamma"],[e,"czmGamma"])),this.d(A.track([o,"rectangle"],[e,"rectangle"])),this.d(A.track([o,"zIndex"],[e,"zIndex"])),this.ad(A.track([o,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:r,czmViewer:o,czmImagery:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):(s.flyTo(e&&e),r.flyOverEvent.emit(n,"over",o),!0):!1}flyIn(e,n){const{sceneObject:r,czmViewer:o,czmImagery:s}=this;return o.actived?r.flyInParam?super.flyIn(e,n):(s.flyTo(e&&e),r.flyOverEvent.emit(n,"over",o),!0):!1}};y(qc,"type",qc.register("ESCesiumViewer",A.ESImageryLayer.type,qc));let H0=qc;class H5 extends A.Destroyable{constructor(e,n,r,o){super();y(this,"_show");y(this,"_czmESCustomPrimitive");y(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(A.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new De(n,this._sceneObject.id)),this._czmTexture=this.dv(new ke(n));const s=e,a=this._czmESCustomPrimitive,l=this._czmTexture;this.dispose(A.track([a,"show"],[this,"show"])),this.dispose(A.track([a,"show"],[s,"show"])),this.dispose(A.track([a,"allowPicking"],[s,"allowPicking"])),this.dispose(A.track([a,"rotation"],[s,"rotation"])),this.dispose(A.track([a,"position"],[s,"position"])),this.dispose(A.track([a,"scale"],[s,"scale"])),this.ad(s.allowPickingChanged.don(()=>{a.allowPicking=s.allowPicking,a.pass=s.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const p=s.size/2,f=o[0].map(U=>U*p),g=o[1].map(U=>U*p),m=o[2].map(U=>U*p),v=o[3].map(U=>U*p),w=[...f,...g,...m,...v];let C=[0,3,2,0,2,1];(r=="north"||r=="west"||r=="bottom")&&(C=C.reverse());const x=[0,0],B=[1,0],b=[1,1],P=[0,1];let S=[];r=="east"||r=="south"?S=[...B,...x,...P,...b]:r=="west"?S=[...B,...b,...P,...x]:r=="top"?S=[...P,...b,...B,...x]:S=[...x,...B,...b,...P],a.indexTypedArray=new Uint16Array(C),a.attributes={position:{typedArray:new Float32Array(w),componentsPerAttribute:3},st:{typedArray:new Float32Array(S),componentsPerAttribute:2}},l.uri=A.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${s.mode}/${r}.${s.mode!="blueSky"?"png":"jpg"}`);const M=n.getCameraInfo();if(M!=null){const O=A.getDistancesFromPositions([s.position,M.position],"NONE")[0]/(s.size/2*s.autoOpacityFactor);this.changeOpacity(s.autoFollow?1:O)}const Q=a.computeLocalAxisedBoundingBoxFromAttribute("position");if(!Q)return;const{min:L,max:H}=Q;a.setLocalAxisedBoundingBox(L,H)};u();const h=this.disposeVar(A.createNextAnimateFrameEvent(s.sizeChanged,s.modeChanged));this.dispose(h.disposableOn(u))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class z5 extends A.Destroyable{constructor(t,e,n){if(super(),!e.viewer)return;let r=!0,o;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{s()}));function s(){var l;if(!((l=e.viewer)!=null&&l.camera))return;const a=e.getCameraInfo();if(a!=null&&(o==null||o.position[0]!=a.position[0]||o.position[1]!=a.position[1]||o.position[2]!=a.position[2]||o.rotation[0]!=a.rotation[0]||o.rotation[1]!=a.rotation[1]||o.rotation[2]!=a.rotation[2])){o=a;const h=A.getDistancesFromPositions([t.position,o.position],"NONE")[0]/(t.size/2*t.autoOpacityFactor);t.autoFollow?(t.position=o.position,r&&(r=!1,n.forEach(p=>{p.changeOpacity(1)}))):n.forEach(p=>{p.changeOpacity(h)})}}s()}}const dt=class dt extends xe{constructor(e,n){super(e,n);y(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!dt._defaultLocalBox&&dt._firstLoad&&(dt._firstLoad=!1,dt._defaultLocalBox=n.xbsjLocalBoxSources),dt._eSLocalSkyBoxArr.push(e),this.d(()=>{dt._eSLocalSkyBoxArr.includes(e)&&dt._eSLocalSkyBoxArr.splice(dt._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const o={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const a=o[s];this._czmSkyBoxComponents.push(this.dv(new H5(e,n,s,a)))}{const s=this.disposeVar(A.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new A.ObjResettingWithEvent(s,()=>(this.ChangeAutoFollow(),new z5(e,n,this._czmSkyBoxComponents))))}{const s=()=>{this.ChangeAutoFollow()},a=this.disposeVar(A.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(a.disposableOn(s))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let n=dt._eSLocalSkyBoxArr.length-1;n>=0;n--){const r=dt._eSLocalSkyBoxArr[n];if(r.autoFollow&&r.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/east.${r.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/west.${r.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/bottom.${r.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/top.${r.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/north.${r.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/south.${r.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(e.xbsjLocalBoxSources=dt._defaultLocalBox)}dt._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=dt._defaultLocalBox)}flyTo(e,n){const{sceneObject:r,czmViewer:o}=this;if(!o.actived)return!1;if(r.flyToParam||r.flyInParam)return super.flyTo(e,n);{const s=r.size??A.ESLocalSkyBox.defaults.size;return r.position?(Bi(o,r,n,r.position,s,e,!0),!0):!1}}};y(dt,"type",dt.register("ESCesiumViewer",A.ESLocalSkyBox.type,dt)),y(dt,"_defaultLocalBox"),y(dt,"_firstLoad",!0),y(dt,"_eSLocalSkyBoxArr",[]);let z0=dt;const Yi=class Yi extends xe{constructor(e,n){super(e,n);y(this,"_geoCustomDivPoi");y(this,"_textFunc",this.disposeVar(A.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new rt(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this.geoCustomDivPoi;this.dispose(A.track([o,"show"],[e,"show"])),this.dispose(A.bind([o,"position"],[e,"position"])),this.dispose(A.track([o,"allowPicking"],[e,"allowPicking"]));{this.dispose(o.pickedEvent.disposableOn(s=>{(e.allowPicking??A.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(s)})),this.dispose(o.innerHtmlMounted.disposableOn(s=>{const a=s.firstElementChild;a&&(a.style.pointerEvents="auto",a.style.cursor="default",a.onclick=l=>o.pickFromDiv(a,{type:"viewerPicking",pointerEvent:l}))}));{const s=()=>{if(!e.position)return;const l=(this.textFunc??Yi.defaultTextFunc_度格式)(e.position);o.innerHTML=Uo(l)};s();const a=this.disposeVar(A.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(a.disposableOn(s))}{const s=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?Yi.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?Yi.defaultTextFunc_度分格式:Yi.defaultTextFunc_度分秒格式};s(),this.d(n.lonLatFormatChanged.don(()=>{s()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,n){const{sceneObject:r,czmViewer:o,geoCustomDivPoi:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):(s.flyTo(e),r.flyOverEvent.emit(n,"over",o),!0):!1}flyIn(e,n){const{sceneObject:r,czmViewer:o,geoCustomDivPoi:s}=this;return o.actived?r.flyInParam?super.flyIn(e,n):(s.flyTo(e),r.flyOverEvent.emit(n,"over",o),!0):!1}};y(Yi,"type",Yi.register("ESCesiumViewer",A.ESLocationMeasurement.type,Yi)),y(Yi,"defaultTextFunc_度格式",e=>{if(!e)return"";const[n=0,r=0,o=0]=e;return`经度: ${n.toFixed(5)}°
1276
1276
  纬度: ${r.toFixed(5)}°
1277
1277
  高度: ${o.toFixed(2)}m`}),y(Yi,"defaultTextFunc_度分格式",e=>{if(!e)return"";const[n,r,o]=Xf(e,!0);return`经度: ${n}
1278
1278
  纬度: ${r}
@@ -3724,10 +3724,10 @@ async function initCesiumViewer(container, czmViewer) {
3724
3724
  `;function pX(){const i="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
3725
3725
  github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
3726
3726
  gitee地址:${i}
3727
- `;console.log(e);const n=window.prompt(e,i);n&&window.open(n,"_blank")}const Dt=class Dt extends A.ESViewer{constructor(e){super(e);y(this,"_disabledInputStack",this.disposeVar(A.react(0)));y(this,"_viewer",this.dv(A.react(void 0)));y(this,"_viewerInstance");y(this,"_viewerLegend");y(this,"pickCustomAttachedInfo");y(this,"_fps",this.dv(A.react(0)));y(this,"_notSupportEditingCount",this.disposeVar(A.react(0)));y(this,"_editingSystem",Op);y(this,"_moveObjectsProcess",this.ad(jP()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new $W(this)),this.ad(new qW(this)),this.dv(new A.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new ZW(this)})),this._viewerLegend=this.dv(new AX(this)),this._viewerInstance=this.dv(new A.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new jw(this,this.viewer)})),this.d(this.viewerChanged.don(r=>{this.viewer&&(this.viewer.scene.globe.baseColor=re([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(r=>{this.viewerChanged.emit(r)})),this.dv(new A.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new vK(this.subContainer,this,r=>this._viewer.value=r,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&ht(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,r){if(!this.extensions)return;const{pickingManager:o}=this.extensions;return await o.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){var s;const{viewer:n}=this;if(!n)return;const r=d.Cartographic.fromDegrees(e[0],e[1],e[2],Dt.getHeightsScartchCarto),o=n.scene.globe.terrainProvider;return o instanceof d.EllipsoidTerrainProvider?n.scene.globe.getHeight(r):(s=(await d.sampleTerrainMostDetailed(o,[r]))[0])==null?void 0:s.height}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:xi(e),rotation:Qs(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const r=d.Cartesian3.fromDegrees(...e),o=d.Transforms.eastNorthUpToFixedFrame(r),s=d.Matrix4.inverse(o,new d.Matrix4),a=d.Matrix4.multiplyByPoint(s,n.positionWC,new d.Cartesian3),l=d.Cartesian3.magnitude(a);let u=-Math.asin(a.z/l);u=d.Math.toDegrees(u);let h=d.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(h+=a.y<0?-d.Math.PI:d.Math.PI),h=d.Math.toDegrees(h);const p=Qs(n),f=p[0]-h,g=p[1]-u;return{distance:l,heading:h,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,r,o="default"){var l;const s={position:e,rotation:n,duration:(r??1)*1e3},a=(l=this.viewer)==null?void 0:l.camera;return a&&UA(a,s,o)}flyTo(e,n,r="default"){var g;const{distance:o,heading:s,pitch:a,flyDuration:l,hDelta:u,pDelta:h}=e,p={position:n,viewDistance:o,rotation:[s,a,0],duration:l*1e3,hdelta:u,pdelta:h},f=(g=this.viewer)==null?void 0:g.camera;return f&&UA(f,p,r)}flyToBoundingSphere(e,n,r=1){var p;const o=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],s=A.getGeoBoundingSphereFromPositions(o);if(!s)return;const{center:a,radius:l}=s,u={position:a,viewDistance:n??l,rotation:[0,-90,0],duration:r*1e3},h=(p=this.viewer)==null?void 0:p.camera;return h&&UA(h,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:xi(e),rotation:Qs(e)}}transformFlyParam(e,n){if("position"in n){const r=d.Cartesian3.fromDegrees(...e),o=d.Transforms.eastNorthUpToFixedFrame(r),s=d.Matrix4.inverse(o,new d.Matrix4),a=d.Matrix4.multiplyByPoint(s,Se(n.position),new d.Cartesian3),l=d.Cartesian3.magnitude(a);let u=-Math.asin(a.z/l);u=d.Math.toDegrees(u);let h=d.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(h+=a.y<0?-d.Math.PI:d.Math.PI),h=d.Math.toDegrees(h);const p=n.rotation[0]-h,f=n.rotation[1]-u;return{distance:l,heading:h,pitch:u,flyDuration:n.flyDuration??1,hDelta:p,pDelta:f}}else{const r=Se(e);let o={heading:d.Math.toRadians(n.heading),pitch:d.Math.toRadians(n.pitch),roll:0};const s=new d.HeadingPitchRoll;if(n.distance){s.heading=o.heading,s.pitch=o.pitch,s.roll=0,s.heading-=d.Math.PI_OVER_TWO;const l=d.Transforms.headingPitchRollToFixedFrame(r,s,void 0,void 0),u=d.Matrix4.multiplyByPointAsVector(l,d.Cartesian3.UNIT_X,new d.Cartesian3);d.Cartesian3.multiplyByScalar(u,n.distance,u),d.Cartesian3.subtract(r,u,r)}n.hDelta&&(o.heading+=d.Math.toRadians(n.hDelta)),n.pDelta&&(o.pitch+=d.Math.toRadians(n.pDelta));const a=he(r);return a?{position:a,rotation:[d.Math.toDegrees(o.heading),d.Math.toDegrees(o.pitch),d.Math.toDegrees(o.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,r=1.6){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToWalk(e,n,r),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,r){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToRotateGlobe(e,n,r),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,r,o,s,a){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,n,r,o,s,a),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,r,o,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToRotatePoint(e,n,r,o,s),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,r,o,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToFollow(e,n,r,o,s),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium={version:d.VERSION},e}async getHeightByLonLat(e,n,r){if(!this.viewer)return null;const o=d.Cartographic.fromDegrees(e,n,void 0,Dt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(o)??null}async getHeightsByLonLats(e,n){const r=e.map(s=>this.getHeightByLonLat(...s));return await Promise.all(r)}async capture(e,n){if(this.viewer)return await VC(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Se(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,r){r=Object.assign({useKeyToSwitch:!0,callSource:"outer"},r);const o=e.components.main??e;o&&n!=null&&(o.editingID=`${r.callSource}_${A.createGuid()}`,this._editingSystem.create(this,o,n,r.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],r=A.createGuid();for(let o=0;o<e.length;o++){const s=e[o],a=s.components.main??s;a.editingID=r,a&&n.push(a)}this._moveObjectsProcess.restart(void 0,this,n,r)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Dt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Dt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Dt.latestDefaultAccessToken}positionsToLocalPositions(e,n){return ei(e,n)}localPositionsToPositions(e,n){return Fr(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof d.Cartesian3?e:Se(e),r=new d.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(r.cameraPosition=this.viewer.scene.camera.positionWC,!r.isPointVisible(n))return!1;const o=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!o||o.x<0||o.y<0)}getESProperties(){const e={...super.getESProperties()},n=Dt.defaults;return{...e,more:[...e.more,new A.GroupProperty([],"通用","通用"),new A.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",dX,hX,!0),new A.FunctionProperty([],()=>Dt.getCesiumIonToken(),[],"获取官方token"),new A.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new A.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new A.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new A.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new A.GroupProperty([],"Viewer","Viewer"),new A.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new A.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new A.BooleanProperty([this,"shadows"]),new A.GroupProperty([],"比例尺","比例尺(Legend)"),new A.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new A.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new A.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new A.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new A.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new A.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new A.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new A.GroupProperty([],"场景","场景(Scene)"),new A.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new A.GroupProperty([],"Globe","Globe"),new A.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new A.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new A.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new A.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new A.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new A.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new A.BooleanProperty([this,"sceneGlobeShowSkirts"]),new A.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new A.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new A.JsonProperty([this,"sceneGlobeClippingPlanes"]),new A.StringProperty([this,"sceneGlobeClippingPlanesId"]),new A.JsonProperty([this,"sceneGlobeClippingPolygons"]),new A.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new A.GroupProperty([],"underground","underground"),new A.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new A.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new A.GroupProperty([],"Translucency","Translucency"),new A.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new A.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new A.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new A.GroupProperty([],"Sun","Sun"),new A.BooleanProperty([this,"sun"],"sun",n.sun,!0),new A.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new A.GroupProperty([],"Moon","Moon"),new A.BooleanProperty([this,"moon"],"moon",n.moon,!0),new A.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new A.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new A.GroupProperty([],"SkyBox","SkyBox"),new A.BooleanProperty([this,"sceneSkyBoxShow"]),new A.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new A.GroupProperty([],"Background","Background"),new A.BooleanProperty([this,"xbsjUseBackground"]),new A.StringProperty([this,"xbsjBackgroundImageUri"]),new A.ColorProperty([this,"xbsjBackgroundColor"]),new A.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new A.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new A.GroupProperty([],"Fog","Fog"),new A.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new A.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new A.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new A.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new A.GroupProperty([],"Sscc","Sscc"),new A.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new A.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new A.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new A.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new A.GroupProperty([],"后处理","后处理"),new A.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new A.GroupProperty([],"环境遮蔽","环境遮蔽"),new A.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new A.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new A.GroupProperty([],"Bloom","Bloom"),new A.BooleanProperty([this,"scenePpsBloomEnabled"]),new A.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new A.NumberProperty([this,"scenePpsBloomContrast"]),new A.NumberProperty([this,"scenePpsBloomBrightness"]),new A.NumberProperty([this,"scenePpsBloomDelta"]),new A.NumberProperty([this,"scenePpsBloomSigma"]),new A.NumberProperty([this,"scenePpsBloomStepSize"]),new A.GroupProperty([],"调试","调试"),new A.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new A.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new A.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new A.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new A.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new A.GroupProperty([],"Inspector","Inspector"),new A.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new A.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new A.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};y(Dt,"type",Dt.register("ESCesiumViewer",Dt)),y(Dt,"getCesiumIonToken",pX),y(Dt,"currentDefaultAccessToken",d.Ion.defaultAccessToken),y(Dt,"latestDefaultAccessToken"),y(Dt,"ObjectsToExcludeWrapper",YW),y(Dt,"defaults",{...A.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:d.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),y(Dt,"getHeightsScartchCarto",new d.Cartographic);let Ne=Dt;(i=>{i.createDefaultProps=()=>({...A.ESViewer.createDefaultProps(),...uX()})})(Ne||(Ne={})),A.extendClassProps(Ne.prototype,Ne.createDefaultProps),I.copyright=void 0;try{const i="earthsdk3-cesium",t="3.7.0",e="2026-01-30T07:34:05.000Z",n="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",o="e4bcbcd9777e3de84a145e74a2222c7441d43b0b",a=((Date.now()-1769758445e3)/36e5).toFixed(1),l=`%c🌏 ${i}%c ${t}.${o.slice(0,8)}.${e} (距今${a}个小时)
3727
+ `;console.log(e);const n=window.prompt(e,i);n&&window.open(n,"_blank")}const Dt=class Dt extends A.ESViewer{constructor(e){super(e);y(this,"_disabledInputStack",this.disposeVar(A.react(0)));y(this,"_viewer",this.dv(A.react(void 0)));y(this,"_viewerInstance");y(this,"_viewerLegend");y(this,"pickCustomAttachedInfo");y(this,"_fps",this.dv(A.react(0)));y(this,"_notSupportEditingCount",this.disposeVar(A.react(0)));y(this,"_editingSystem",Op);y(this,"_moveObjectsProcess",this.ad(jP()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new $W(this)),this.ad(new qW(this)),this.dv(new A.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new ZW(this)})),this._viewerLegend=this.dv(new AX(this)),this._viewerInstance=this.dv(new A.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new jw(this,this.viewer)})),this.d(this.viewerChanged.don(r=>{this.viewer&&(this.viewer.scene.globe.baseColor=re([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(r=>{this.viewerChanged.emit(r)})),this.dv(new A.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new vK(this.subContainer,this,r=>this._viewer.value=r,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&ht(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,r){if(!this.extensions)return;const{pickingManager:o}=this.extensions;return await o.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){var s;const{viewer:n}=this;if(!n)return;const r=d.Cartographic.fromDegrees(e[0],e[1],e[2],Dt.getHeightsScartchCarto),o=n.scene.globe.terrainProvider;return o instanceof d.EllipsoidTerrainProvider?n.scene.globe.getHeight(r):(s=(await d.sampleTerrainMostDetailed(o,[r]))[0])==null?void 0:s.height}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:xi(e),rotation:Qs(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const r=d.Cartesian3.fromDegrees(...e),o=d.Transforms.eastNorthUpToFixedFrame(r),s=d.Matrix4.inverse(o,new d.Matrix4),a=d.Matrix4.multiplyByPoint(s,n.positionWC,new d.Cartesian3),l=d.Cartesian3.magnitude(a);let u=-Math.asin(a.z/l);u=d.Math.toDegrees(u);let h=d.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(h+=a.y<0?-d.Math.PI:d.Math.PI),h=d.Math.toDegrees(h);const p=Qs(n),f=p[0]-h,g=p[1]-u;return{distance:l,heading:h,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,r,o="default"){var l;const s={position:e,rotation:n,duration:(r??1)*1e3},a=(l=this.viewer)==null?void 0:l.camera;return a&&UA(a,s,o)}flyTo(e,n,r="default"){var g;const{distance:o,heading:s,pitch:a,flyDuration:l,hDelta:u,pDelta:h}=e,p={position:n,viewDistance:o,rotation:[s,a,0],duration:l*1e3,hdelta:u,pdelta:h},f=(g=this.viewer)==null?void 0:g.camera;return f&&UA(f,p,r)}flyToBoundingSphere(e,n,r=1){var p;const o=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],s=A.getGeoBoundingSphereFromPositions(o);if(!s)return;const{center:a,radius:l}=s,u={position:a,viewDistance:n??l,rotation:[0,-90,0],duration:r*1e3},h=(p=this.viewer)==null?void 0:p.camera;return h&&UA(h,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:xi(e),rotation:Qs(e)}}transformFlyParam(e,n){if("position"in n){const r=d.Cartesian3.fromDegrees(...e),o=d.Transforms.eastNorthUpToFixedFrame(r),s=d.Matrix4.inverse(o,new d.Matrix4),a=d.Matrix4.multiplyByPoint(s,Se(n.position),new d.Cartesian3),l=d.Cartesian3.magnitude(a);let u=-Math.asin(a.z/l);u=d.Math.toDegrees(u);let h=d.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(h+=a.y<0?-d.Math.PI:d.Math.PI),h=d.Math.toDegrees(h);const p=n.rotation[0]-h,f=n.rotation[1]-u;return{distance:l,heading:h,pitch:u,flyDuration:n.flyDuration??1,hDelta:p,pDelta:f}}else{const r=Se(e);let o={heading:d.Math.toRadians(n.heading),pitch:d.Math.toRadians(n.pitch),roll:0};const s=new d.HeadingPitchRoll;if(n.distance){s.heading=o.heading,s.pitch=o.pitch,s.roll=0,s.heading-=d.Math.PI_OVER_TWO;const l=d.Transforms.headingPitchRollToFixedFrame(r,s,void 0,void 0),u=d.Matrix4.multiplyByPointAsVector(l,d.Cartesian3.UNIT_X,new d.Cartesian3);d.Cartesian3.multiplyByScalar(u,n.distance,u),d.Cartesian3.subtract(r,u,r)}n.hDelta&&(o.heading+=d.Math.toRadians(n.hDelta)),n.pDelta&&(o.pitch+=d.Math.toRadians(n.pDelta));const a=he(r);return a?{position:a,rotation:[d.Math.toDegrees(o.heading),d.Math.toDegrees(o.pitch),d.Math.toDegrees(o.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,r=1.6){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToWalk(e,n,r),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,r){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToRotateGlobe(e,n,r),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,r,o,s,a){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,n,r,o,s,a),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,r,o,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToRotatePoint(e,n,r,o,s),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,r,o,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToFollow(e,n,r,o,s),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium={version:d.VERSION},e}async getHeightByLonLat(e,n,r){if(!this.viewer)return null;const o=d.Cartographic.fromDegrees(e,n,void 0,Dt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(o)??null}async getHeightsByLonLats(e,n){const r=e.map(s=>this.getHeightByLonLat(...s));return await Promise.all(r)}async capture(e,n){if(this.viewer)return await VC(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Se(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,r){r=Object.assign({useKeyToSwitch:!0,callSource:"outer"},r);const o=e.components.main??e;o&&n!=null&&(o.editingID=`${r.callSource}_${A.createGuid()}`,this._editingSystem.create(this,o,n,r.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],r=A.createGuid();for(let o=0;o<e.length;o++){const s=e[o],a=s.components.main??s;a.editingID=r,a&&n.push(a)}this._moveObjectsProcess.restart(void 0,this,n,r)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Dt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Dt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Dt.latestDefaultAccessToken}positionsToLocalPositions(e,n){return ei(e,n)}localPositionsToPositions(e,n){return Fr(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof d.Cartesian3?e:Se(e),r=new d.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(r.cameraPosition=this.viewer.scene.camera.positionWC,!r.isPointVisible(n))return!1;const o=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!o||o.x<0||o.y<0)}getESProperties(){const e={...super.getESProperties()},n=Dt.defaults;return{...e,more:[...e.more,new A.GroupProperty([],"通用","通用"),new A.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",dX,hX,!0),new A.FunctionProperty([],()=>Dt.getCesiumIonToken(),[],"获取官方token"),new A.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new A.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new A.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new A.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new A.GroupProperty([],"Viewer","Viewer"),new A.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new A.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new A.BooleanProperty([this,"shadows"]),new A.GroupProperty([],"比例尺","比例尺(Legend)"),new A.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new A.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new A.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new A.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new A.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new A.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new A.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new A.GroupProperty([],"场景","场景(Scene)"),new A.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new A.GroupProperty([],"Globe","Globe"),new A.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new A.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new A.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new A.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new A.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new A.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new A.BooleanProperty([this,"sceneGlobeShowSkirts"]),new A.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new A.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new A.JsonProperty([this,"sceneGlobeClippingPlanes"]),new A.StringProperty([this,"sceneGlobeClippingPlanesId"]),new A.JsonProperty([this,"sceneGlobeClippingPolygons"]),new A.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new A.GroupProperty([],"underground","underground"),new A.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new A.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new A.GroupProperty([],"Translucency","Translucency"),new A.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new A.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new A.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new A.GroupProperty([],"Sun","Sun"),new A.BooleanProperty([this,"sun"],"sun",n.sun,!0),new A.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new A.GroupProperty([],"Moon","Moon"),new A.BooleanProperty([this,"moon"],"moon",n.moon,!0),new A.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new A.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new A.GroupProperty([],"SkyBox","SkyBox"),new A.BooleanProperty([this,"sceneSkyBoxShow"]),new A.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new A.GroupProperty([],"Background","Background"),new A.BooleanProperty([this,"xbsjUseBackground"]),new A.StringProperty([this,"xbsjBackgroundImageUri"]),new A.ColorProperty([this,"xbsjBackgroundColor"]),new A.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new A.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new A.GroupProperty([],"Fog","Fog"),new A.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new A.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new A.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new A.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new A.GroupProperty([],"Sscc","Sscc"),new A.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new A.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new A.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new A.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new A.GroupProperty([],"后处理","后处理"),new A.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new A.GroupProperty([],"环境遮蔽","环境遮蔽"),new A.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new A.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new A.GroupProperty([],"Bloom","Bloom"),new A.BooleanProperty([this,"scenePpsBloomEnabled"]),new A.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new A.NumberProperty([this,"scenePpsBloomContrast"]),new A.NumberProperty([this,"scenePpsBloomBrightness"]),new A.NumberProperty([this,"scenePpsBloomDelta"]),new A.NumberProperty([this,"scenePpsBloomSigma"]),new A.NumberProperty([this,"scenePpsBloomStepSize"]),new A.GroupProperty([],"调试","调试"),new A.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new A.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new A.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new A.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new A.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new A.GroupProperty([],"Inspector","Inspector"),new A.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new A.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new A.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};y(Dt,"type",Dt.register("ESCesiumViewer",Dt)),y(Dt,"getCesiumIonToken",pX),y(Dt,"currentDefaultAccessToken",d.Ion.defaultAccessToken),y(Dt,"latestDefaultAccessToken"),y(Dt,"ObjectsToExcludeWrapper",YW),y(Dt,"defaults",{...A.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:d.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),y(Dt,"getHeightsScartchCarto",new d.Cartographic);let Ne=Dt;(i=>{i.createDefaultProps=()=>({...A.ESViewer.createDefaultProps(),...uX()})})(Ne||(Ne={})),A.extendClassProps(Ne.prototype,Ne.createDefaultProps),I.copyright=void 0;try{const i="earthsdk3-cesium",t="3.7.1",e="2026-02-02T01:37:27.000Z",n="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",o="c5260443b67d109c10ea6436337c86544eef1450",a=((Date.now()-1769996247e3)/36e5).toFixed(1),l=`%c🌏 ${i}%c ${t}.${o.slice(0,8)}.${e} (距今${a}个小时)
3728
3728
  %c${r?r+`
3729
3729
  `:""}当前网站正在使用${i},此软件版权归${n}所有
3730
- `;I.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","e4bcbcd9777e3de84a145e74a2222c7441d43b0b")},get info(){return l},get date(){return"2026-01-30T07:34:05.000Z"},get author(){return"suplyang"},get version(){return"3.7.0"},get name(){return"earthsdk3-cesium"},get commitId(){return"e4bcbcd9777e3de84a145e74a2222c7441d43b0b"},print(){console.info(this.info,`
3730
+ `;I.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","c5260443b67d109c10ea6436337c86544eef1450")},get info(){return l},get date(){return"2026-02-02T01:37:27.000Z"},get author(){return"suplyang"},get version(){return"3.7.1"},get name(){return"earthsdk3-cesium"},get commitId(){return"c5260443b67d109c10ea6436337c86544eef1450"},print(){console.info(this.info,`
3731
3731
  font-size: 18px;
3732
3732
  font-weight: 1000;
3733
3733
  line-height: 1;
@@ -29326,7 +29326,7 @@ const wl = class wl extends Wi {
29326
29326
  }
29327
29327
  _getFeatureStyles(e, n) {
29328
29328
  const s = "image" in n;
29329
- if (!this.featureStyles || this.featureStyles.length == 0) return n;
29329
+ if (n = structuredClone(n), !this.featureStyles || this.featureStyles.length == 0) return n;
29330
29330
  for (let o = 0; o < this.featureStyles.length; o++) {
29331
29331
  const r = this.featureStyles[o], a = Array.isArray(r.condition) ? r.condition : [r.condition], h = [];
29332
29332
  for (let c = 0; c < a.length; c++) {
@@ -29353,7 +29353,7 @@ const wl = class wl extends Wi {
29353
29353
  }
29354
29354
  if (h.length > 0 && !h.includes(!1))
29355
29355
  if (s) {
29356
- n = structuredClone(n);
29356
+ n = n;
29357
29357
  const { imageShow: c, imageStyle: u = {} } = r;
29358
29358
  n.show = c ?? n.show, u.anchor = u.anchor ?? this.sceneObject.imageAnchor ?? Se.defaults.billboardStyle.anchor, u.offset = u.offset ?? this.sceneObject.imageOffset ?? Se.defaults.billboardStyle.offset, u.size = u.size ?? this.sceneObject.imageSize ?? Se.defaults.billboardStyle.size, u.url = u.url ?? this.sceneObject.imageUrl ?? Se.defaults.billboardStyle.url;
29359
29359
  const p = u.anchor, f = u.offset;
@@ -29364,7 +29364,7 @@ const wl = class wl extends Wi {
29364
29364
  -p[1] * n.height + f[1]
29365
29365
  ]), n;
29366
29366
  } else {
29367
- n = structuredClone(n);
29367
+ n = n;
29368
29368
  const { textShow: c, textStyle: u = {} } = r;
29369
29369
  n.show = c ?? n.show, u.anchor = u.anchor ?? this.sceneObject.textAnchor ?? Se.defaults.textStyle.anchor, u.backgroundColor = u.backgroundColor ?? this.sceneObject.textBackgroundColor ?? Se.defaults.textStyle.backgroundColor, u.color = u.color ?? this.sceneObject.textColor ?? Se.defaults.textStyle.color, u.defaultText = u.defaultText ?? this.sceneObject.textDefaultText ?? Se.defaults.textStyle.defaultText, u.fontFamily = u.fontFamily ?? this.sceneObject.textFontFamily ?? Se.defaults.textStyle.fontFamily, u.fontSize = u.fontSize ?? this.sceneObject.textFontSize ?? Se.defaults.textStyle.fontSize, u.fontStyle = u.fontStyle ?? this.sceneObject.textFontStyle ?? Se.defaults.textStyle.fontStyle, u.fontWeight = u.fontWeight ?? this.sceneObject.textFontWeight ?? Se.defaults.textStyle.fontWeight, u.offset = u.offset ?? this.sceneObject.textOffset ?? Se.defaults.textStyle.offset, u.textProperty = u.textProperty ?? this.sceneObject.textProperty ?? Se.defaults.textStyle.textProperty;
29370
29370
  const p = u.fontSize, f = u.offset, g = u.anchor;
@@ -55838,7 +55838,7 @@ let Ze = bt;
55838
55838
  ae(Ze.prototype, Ze.createDefaultProps);
55839
55839
  let Fp;
55840
55840
  try {
55841
- const t = "earthsdk3-cesium", i = "3.7.0", e = "2026-01-30T07:34:05.000Z", n = "北京西部世界科技有限公司", s = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", o = "e4bcbcd9777e3de84a145e74a2222c7441d43b0b", a = ((Date.now() - 1769758445e3) / 36e5).toFixed(1), h = `%c🌏 ${t}%c ${i}.${o.slice(0, 8)}.${e} (距今${a}个小时)
55841
+ const t = "earthsdk3-cesium", i = "3.7.1", e = "2026-02-02T01:37:27.000Z", n = "北京西部世界科技有限公司", s = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", o = "c5260443b67d109c10ea6436337c86544eef1450", a = ((Date.now() - 1769996247e3) / 36e5).toFixed(1), h = `%c🌏 ${t}%c ${i}.${o.slice(0, 8)}.${e} (距今${a}个小时)
55842
55842
  %c${s ? s + `
55843
55843
  ` : ""}当前网站正在使用${t},此软件版权归${n}所有
55844
55844
  `;
@@ -55852,7 +55852,7 @@ try {
55852
55852
  },
55853
55853
  // @ts-ignore
55854
55854
  get gituri() {
55855
- return GITURI_ && GITURI_.replace("${commitId}", "e4bcbcd9777e3de84a145e74a2222c7441d43b0b");
55855
+ return GITURI_ && GITURI_.replace("${commitId}", "c5260443b67d109c10ea6436337c86544eef1450");
55856
55856
  },
55857
55857
  // @ts-ignore
55858
55858
  get info() {
@@ -55860,7 +55860,7 @@ try {
55860
55860
  },
55861
55861
  // @ts-ignore
55862
55862
  get date() {
55863
- return "2026-01-30T07:34:05.000Z";
55863
+ return "2026-02-02T01:37:27.000Z";
55864
55864
  },
55865
55865
  // @ts-ignore
55866
55866
  get author() {
@@ -55868,7 +55868,7 @@ try {
55868
55868
  },
55869
55869
  // @ts-ignore
55870
55870
  get version() {
55871
- return "3.7.0";
55871
+ return "3.7.1";
55872
55872
  },
55873
55873
  // @ts-ignore
55874
55874
  get name() {
@@ -55876,7 +55876,7 @@ try {
55876
55876
  },
55877
55877
  // @ts-ignore
55878
55878
  get commitId() {
55879
- return "e4bcbcd9777e3de84a145e74a2222c7441d43b0b";
55879
+ return "c5260443b67d109c10ea6436337c86544eef1450";
55880
55880
  },
55881
55881
  print() {
55882
55882
  console.info(
@@ -1251,7 +1251,7 @@ export type IndexJsonType = {
1251
1251
  \`\`\`
1252
1252
  ${gy}
1253
1253
  \`\`\`
1254
- `,qe=class qe extends a.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new a.Event));y(this,"_loadFuncReact",this.disposeVar(a.react(void 0)));y(this,"_dataSource",this.disposeVar(a.react(void 0)));y(this,"_data");y(this,"_defaultHeight",{});y(this,"defaultBoundingSphere");y(this,"_featureStyles",this.disposeVar(a.react(void 0)));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let s=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{s()});{const r=this.dv(a.createProcessingFromAsyncFunc(async u=>{this.dataSource&&s(),this.url&&(typeof this.url=="object"?this._data=this.url:a.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(a.ESSceneObject.context.getStrFromEnv(this.url)).then(p=>p.json()).then(p=>{this._data=p}).catch(p=>{console.warn("ESGeoJson数据加载失败",p)}),this.dataSource=await d.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(p=>{var g,m;const f=[];for(const v of p.entities.values){if(d.Entity.prototype&&(v.ESSceneObjectID=n),this._isEntityShow(v,e),v.polygon){f.push(...(g=v.polygon.hierarchy)==null?void 0:g.getValue(d.JulianDate.now()).positions);continue}if(v.polyline){f.push(...(m=v.polyline.positions)==null?void 0:m.getValue(d.JulianDate.now()));continue}if(v.position){const w=v.position.getValue(d.JulianDate.now());w&&f.push(w);continue}}this.defaultBoundingSphere=f.length>0?d.BoundingSphere.fromPoints(f):void 0}))})),l=()=>{r.isRunning&&r.cancel(),r.restart()};l();const h=this.dv(a.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(h.don(l))}{const r=()=>{var h,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(p){console.error(p)}else{const p=this.dataSource.entities.values;for(let f=0;f<p.length;f++){const g=p[f],m=this._getFeatureStyles(g);if(g.polygon){this._defaultHeight[g.id]||(this._defaultHeight[g.id]=(h=g.polygon.height)==null?void 0:h.getValue(d.JulianDate.now())),g.polygon.height=m.fillGround?void 0:new d.ConstantProperty(this._defaultHeight[g.id]),g.polygon.perPositionHeight=new d.ConstantProperty(!m.fillGround),g.polygon.heightReference=new d.ConstantProperty(d.HeightReference[m.heightReference.toUpperCase()]),g.polygon.show=new d.ConstantProperty(m.filled??qe.defaults.filled),g.polygon.material=new d.ColorMaterialProperty(new d.Color(...m.fillColor??qe.defaults.fillColor)),g.polygon.outline=new d.ConstantProperty(!1),g.polygon.classificationType=d.ClassificationType[m.classificationType.toUpperCase()],g.polyline=new d.PolylineGraphics;const v=JSON.parse(JSON.stringify((u=g.polygon.hierarchy)==null?void 0:u.getValue(d.JulianDate.now()).positions));d.Cartesian3.equals(v[0],v[v.length-1])||v.push(v[0]),g.polyline.positions=v}if(g.polyline&&(g.polyline.classificationType=d.ClassificationType[m.classificationType.toUpperCase()],g.polyline.show=new d.ConstantProperty(m.stroked??qe.defaults.stroked),g.polyline.width=new d.ConstantProperty(m.strokeWidth??qe.defaults.strokeWidth),g.polyline.material=new d.ColorMaterialProperty(new d.Color(...m.strokeColor??qe.defaults.strokeColor)),g.polyline.clampToGround=new d.ConstantProperty(m.strokeGround)),g.billboard){g.billboard.show=new d.ConstantProperty(m.imageShow??qe.defaults.imageShow),g.billboard.width=new d.ConstantProperty(m.imageSize?m.imageSize[0]:qe.defaults.imageSize[0]),g.billboard.height=new d.ConstantProperty(m.imageSize?m.imageSize[1]:qe.defaults.imageSize[1]);const v=m.imageUrl?typeof m.imageUrl=="string"?m.imageUrl:m.imageUrl.url:qe.defaults.imageUrl;g.billboard.image=new d.ConstantProperty(a.ESSceneObject.context.getStrFromEnv(v)),g.billboard.horizontalOrigin=new d.ConstantProperty(d.HorizontalOrigin.LEFT),g.billboard.verticalOrigin=new d.ConstantProperty(d.VerticalOrigin.TOP),g.billboard.heightReference=new d.ConstantProperty(d.HeightReference[m.heightReference.toUpperCase()]);const w=m.imageAnchor??qe.defaults.imageAnchor,C=m.imageOffset??qe.defaults.imageOffset;if(g.billboard.pixelOffset=new d.ConstantProperty(d.Cartesian2.fromArray([-w[0]*g.billboard.width.getValue(d.JulianDate.now())+C[0],-w[1]*g.billboard.height.getValue(d.JulianDate.now())+C[1]])),g.label=new d.LabelGraphics,!g.label)return;g.label.show=new d.ConstantProperty(m.textShow??qe.defaults.textShow),g.label.heightReference=new d.ConstantProperty(d.HeightReference[m.heightReference.toUpperCase()]),g.label.text=new d.ConstantProperty(m.textProperty&&m.textProperty!==""&&g.properties&&g.properties[m.textProperty]?g.properties[m.textProperty].getValue():m.textDefaultText??qe.defaults.textDefaultText),g.label.fillColor=new d.ConstantProperty(new d.Color(...m.textColor??qe.defaults.textColor)),g.label.showBackground=new d.ConstantProperty(m.textBackgroundColor!=null);const x=m.textFontSize&&m.textFontSize!=0?m.textFontSize:qe.defaults.textFontSize,_=m.textOffset??qe.defaults.textOffset;g.label.backgroundColor=new d.ConstantProperty(new d.Color(...m.textBackgroundColor??qe.defaults.textBackgroundColor)),g.label.font=new d.ConstantProperty(`${m.textFontStyle} ${m.textFontWeight} ${x}px ${m.textFontFamily??qe.defaults.textFontFamily}`),g.label.horizontalOrigin=new d.ConstantProperty(d.HorizontalOrigin.LEFT),g.label.verticalOrigin=new d.ConstantProperty(d.VerticalOrigin.TOP),g.label.eyeOffset=new d.ConstantProperty(d.Cartesian3.fromArray([0,0,-1]));const P=m.textAnchor??qe.defaults.textAnchor;g.label.pixelOffset=new d.ConstantProperty(d.Cartesian2.fromArray([-P[0]*((m.textBackgroundColor?-14:0)+this._getTextPixelWidth(g.label.text.getValue(d.JulianDate.now()),g.label.font.getValue(d.JulianDate.now())))+_[0],-P[1]*((m.textBackgroundColor?10:0)+x)+_[1]]))}}}};r();const l=this.dv(a.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged,this.classificationTypeChanged,this.featureStylesChanged));this.dispose(l.don(r))}{const r=()=>{if(!this.dataSource)return;const h=this.dataSource.entities.values;for(let u=0;u<h.length;u++){const p=h[u];this._isEntityShow(p,e)}};r();const l=this.ad(a.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(l.don(r))}{const r=()=>{if(this.loadFuncStr)try{const l=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=l}catch(l){console.error(l),this.loadFun=void 0}else this.loadFun=void 0};r(),this.dispose(this.loadFuncStrChanged.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{e.actived&&this.dataSource&&this.defaultBoundingSphere&&o.camera.flyToBoundingSphere(this.defaultBoundingSphere,{duration:r?r/1e3:void 0})}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}get featureStyles(){return this._featureStyles.value}set featureStyles(e){this._featureStyles.value=e}get featureStylesChanged(){return this._featureStyles.changed}_getFeatureStyles(e){var n;if(!this.featureStyles||this.featureStyles.length==0)return this.mergeFeatureStyles();for(let o=0;o<this.featureStyles.length;o++){const s=this.featureStyles[o],r=Array.isArray(s.condition)?s.condition:[s.condition],l=[];for(let h=0;h<r.length;h++){if(!e.properties){l.push(!1);continue}const u=r[h];if(typeof u=="boolean"){l.push(!0);continue}const p=(n=e.properties[u.field])==null?void 0:n.getValue(d.JulianDate.now()),f=typeof u.value=="string",g=typeof u.value=="number";if(f){l.push(up(u,p));continue}else if(g){l.push(dp(u,p));continue}else{l.push(!1);continue}}if(l.length>0&&!l.includes(!1))return this.mergeFeatureStyles(s)}return this.mergeFeatureStyles()}mergeFeatureStyles(e={}){const{filled:n,stroked:o,fillStyle:s,strokeStyle:r,imageShow:l,imageStyle:h,textShow:u,textStyle:p}=e;return{imageShow:l??this.imageShow,imageUrl:(h==null?void 0:h.url)??this.imageUrl,imageAnchor:(h==null?void 0:h.anchor)??this.imageAnchor,imageOffset:(h==null?void 0:h.offset)??this.imageOffset,imageSize:(h==null?void 0:h.size)??this.imageSize,textShow:u??this.textShow,textProperty:(p==null?void 0:p.textProperty)??this.textProperty,textDefaultText:(p==null?void 0:p.defaultText)??this.textDefaultText,textColor:(p==null?void 0:p.color)??this.textColor,textBackgroundColor:(p==null?void 0:p.backgroundColor)??this.textBackgroundColor,textFontFamily:(p==null?void 0:p.fontFamily)??this.textFontFamily,textFontSize:(p==null?void 0:p.fontSize)??this.textFontSize,textFontStyle:(p==null?void 0:p.fontStyle)??this.textFontStyle,textFontWeight:(p==null?void 0:p.fontWeight)??this.textFontWeight,textAnchor:(p==null?void 0:p.anchor)??this.textAnchor,textOffset:(p==null?void 0:p.offset)??this.textOffset,stroked:o??this.stroked,filled:n??this.filled,strokeWidth:(r==null?void 0:r.width)??this.strokeWidth,strokeWidthType:(r==null?void 0:r.widthType)??this.strokeWidthType,strokeColor:(r==null?void 0:r.color)??this.strokeColor,strokeMaterial:(r==null?void 0:r.material)??this.strokeMaterial,strokeMaterialParams:(r==null?void 0:r.materialParams)??this.strokeMaterialParams,strokeGround:(r==null?void 0:r.ground)??this.strokeGround,fillColor:(s==null?void 0:s.color)??this.fillColor,fillMaterial:(s==null?void 0:s.material)??this.fillMaterial,fillMaterialParams:(s==null?void 0:s.materialParams)??this.fillMaterialParams,fillGround:(s==null?void 0:s.ground)??this.fillGround,heightReference:this.heightReference,classificationType:this.classificationType}}_getTextPixelWidth(e,n="16px sans-serif"){const s=document.createElement("canvas").getContext("2d");return s.font=n,s.measureText(e).width}_isEntityShow(e,n){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0)e.show=this.show;else if((o=n.viewer)!=null&&o.camera){if(!this.show){e.show=this.show;return}const s=d.JulianDate.now();let r;if(e.polygon&&e.polygon.hierarchy)r=a.getMinMaxCorner(e.polygon.hierarchy.getValue(s).positions.map(u=>re(u))).center;else if(e.polyline&&e.polyline.positions)r=a.getMinMaxCorner(e.polyline.positions.getValue(s).map(u=>re(u))).center;else if(e.position){const u=e.position.getValue(s);u&&(r=re(u))}if(!r||isNaN(r[0]))return;const l=a.getDistancesFromPositions([r,Xt(n.viewer.camera)],"NONE")[0];let h=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?h=this.minFeatureVisibleDistance<l&&l<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?h=l>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(h=l<this.maxFeatureVisibleDistance),e.show=this.show&&h}}};y(qe,"defaults",{show:!0,allowPicking:!0,url:my,defaultLoadFuncStr:gy,defaultLoadFuncDocStr:DT,data:AT,dataMd:TT,stroked:!0,strokeWidth:1,strokeWidthType:"world",strokeColor:[.79,.91,.06,1],strokeMaterial:"",strokeMaterialParams:{},strokeGround:!1,filled:!0,fillColor:[.79,.91,.06,.2],fillMaterial:"",fillMaterialParams:{},fillGround:!1,imageShow:!0,imageUrl:"${earthsdk3-assets-script-dir}/assets/misc/location.png",imageSize:[64,64],imageAnchor:[.5,1],imageOffset:[0,0],textShow:!0,textProperty:"",textDefaultText:"默认标注",textColor:[1,1,1,1],textBackgroundColor:[.79,.91,.06,1],textFontFamily:"Arial",textFontSize:16,textFontWeight:"normal",textFontStyle:"normal",textAnchor:[.5,1],textOffset:[0,0],strokeWidthTypes:[["screen","screen"],["world","world"]],minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReferences:[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]]});let Uo=qe;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:a.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:a.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:a.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:a.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:a.reactArrayWithUndefined(void 0),imageAnchor:a.reactArrayWithUndefined(void 0),imageOffset:a.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:a.reactArrayWithUndefined(void 0),textBackgroundColor:a.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:a.reactArrayWithUndefined(void 0),textOffset:a.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(Uo||(Uo={})),a.extendClassProps(Uo.prototype,Uo.createDefaultProps);const hl=class hl extends qt{constructor(e,n){super(e,n);y(this,"_pointFeatures",this.disposeVar(a.react(void 0)));y(this,"_defaultPointsBoundingSphere");y(this,"screenObjectIdsLabel",new Set);y(this,"screenObjectIdsBillboard",new Set);y(this,"_featureStyles",this.disposeVar(a.react(void 0)));y(this,"_textMeasureCtx");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=Qe(o);if(!s)return;const{screenManager:r}=s,l=this.disposeVar(new Uo(n,e.id));{const h=()=>{if(l.featureStyles=this.featureStyles=void 0,!e.features)return;const u=a.toGeoJson(e.features),p={type:u.type,features:[]};l.url={type:u.type,features:u.features.filter(f=>f.geometry.type.toLowerCase().includes("point")?(p.features.push(f),!1):!0)},this.pointFeatures=p};h(),this.ad(e.featuresChanged.don(h))}this.ad(a.track([l,"show"],[e,"show"])),this.ad(a.track([l,"allowPicking"],[e,"allowPicking"])),this.ad(a.track([l,"loadFuncStr"],[e,"loadFuncStr"])),this.ad(a.track([l,"stroked"],[e,"stroked"])),this.ad(a.track([l,"strokeWidth"],[e,"strokeWidth"])),this.ad(a.track([l,"strokeWidthType"],[e,"strokeWidthType"])),this.ad(a.track([l,"strokeColor"],[e,"strokeColor"])),this.ad(a.track([l,"strokeMaterial"],[e,"strokeMaterial"])),this.ad(a.track([l,"strokeMaterialParams"],[e,"strokeMaterialParams"])),this.ad(a.track([l,"strokeGround"],[e,"strokeGround"])),this.ad(a.track([l,"filled"],[e,"filled"])),this.ad(a.track([l,"fillColor"],[e,"fillColor"])),this.ad(a.track([l,"fillMaterial"],[e,"fillMaterial"])),this.ad(a.track([l,"fillMaterialParams"],[e,"fillMaterialParams"])),this.ad(a.track([l,"fillGround"],[e,"fillGround"])),this.ad(a.track([l,"minFeatureVisibleDistance"],[e,"minFeatureVisibleDistance"])),this.ad(a.track([l,"maxFeatureVisibleDistance"],[e,"maxFeatureVisibleDistance"])),this.ad(a.track([l,"heightReference"],[e,"heightReference"])),this.ad(a.track([l,"classificationType"],[e,"classificationType"]));{const h=()=>{!this.pointFeatures||this.pointFeatures.features.length==0||(this._defaultPointsBoundingSphere=d.BoundingSphere.fromPoints(this.pointFeatures.features.map(u=>(u.geometry.type=="Point"?[u.geometry.coordinates]:u.geometry.coordinates).map(f=>xe(f))).flat(1/0)))};h(),this.ad(this.pointFeaturesChanged.don(h))}{const h=()=>{r.remove(e.typeName,e.id,{label:this.screenObjectIdsLabel}),this.screenObjectIdsLabel.clear()};this.ad(()=>{h()});const u=()=>{if(h(),!((e.textShow??a.ESGeoJson.defaults.textShow)&&(e.show??a.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.textFontSize&&e.textFontSize!=0?e.textFontSize:a.ESGeoJson.defaults.textStyle.fontSize,g={show:!0,heightReference:d.HeightReference[e.heightReference??a.ESGeoJson.defaults.heightReference],fillColor:new d.Color(...e.textColor??a.ESGeoJson.defaults.textStyle.color),showBackground:e.textBackgroundColor!=null,backgroundColor:new d.Color(...e.textBackgroundColor??a.ESGeoJson.defaults.textStyle.backgroundColor??[1,1,1,1]),font:`${e.textFontStyle} ${e.textFontWeight} ${f}px ${e.textFontFamily??a.ESGeoJson.defaults.textStyle.fontFamily}`,horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.TOP,eyeOffset:d.Cartesian3.fromArray([0,0,-1]),distanceDisplayCondition:new d.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((m,v)=>{const w=this._getFeatureStyles(m.properties,g);if(!Reflect.has(w,"text")){const x=e.textAnchor??a.ESGeoJson.defaults.textStyle.anchor,_=e.textOffset??a.ESGeoJson.defaults.textStyle.offset,P=e.textProperty??a.ESGeoJson.defaults.textStyle.textProperty,E=e.textDefaultText??a.ESGeoJson.defaults.textStyle.defaultText;w.text=P&&P!==""&&m.properties&&m.properties[P]?m.properties[P]:E,w.pixelOffset=d.Cartesian2.fromArray([-x[0]*((w.showBackground?-14:0)+this._getTextPixelWidth(w.text,w.font))+_[0],-x[1]*((w.showBackground?10:0)+f)+_[1]])}(m.geometry.type=="Point"?[m.geometry.coordinates]:m.geometry.coordinates).forEach((x,_)=>{const P={index:`${v}${_}`,name:w.text,position:x,zOrder:e.zIndex??a.ESGeoJson.defaults.zIndex,properties:m.properties},E=r.addLabel(e.id,e.typeName,w,P);this.screenObjectIdsLabel.add(E.screenObjectId)})})};u();const p=this.ad(a.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.textShowChanged,e.textPropertyChanged,e.textDefaultTextChanged,e.textColorChanged,e.textBackgroundColorChanged,e.textFontFamilyChanged,e.textFontSizeChanged,e.textFontStyleChanged,e.textFontWeightChanged,e.textAnchorChanged,e.textOffsetChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged,this.featureStylesChanged));this.ad(p.don(u))}{const h=()=>{r.remove(e.typeName,e.id,{billboard:this.screenObjectIdsBillboard}),this.screenObjectIdsBillboard.clear()};this.ad(()=>{h()});const u=()=>{if(h(),!((e.imageShow??a.ESGeoJson.defaults.imageShow)&&(e.show??a.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.imageAnchor??a.ESGeoJson.defaults.imageStyle.anchor,g=e.imageOffset??a.ESGeoJson.defaults.imageStyle.offset,m=e.imageSize?e.imageSize[0]:a.ESGeoJson.defaults.imageStyle.size[0],v=e.imageSize?e.imageSize[1]:a.ESGeoJson.defaults.imageStyle.size[1],w={show:!0,width:m,height:v,image:a.ESSceneObject.context.getStrFromEnv(e.imageUrl?typeof e.imageUrl=="string"?e.imageUrl:e.imageUrl.url:a.ESGeoJson.defaults.imageStyle.url),horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.TOP,heightReference:d.HeightReference[e.heightReference??a.ESGeoJson.defaults.heightReference],pixelOffset:d.Cartesian2.fromArray([-f[0]*m+g[0],-f[1]*v+g[1]]),distanceDisplayCondition:new d.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((C,x)=>{const _=this._getFeatureStyles(C.properties,w);(C.geometry.type=="Point"?[C.geometry.coordinates]:C.geometry.coordinates).forEach((E,A)=>{const M={index:`${x}${A}`,name:"",position:E,zOrder:e.zIndex??a.ESGeoJson.defaults.zIndex,properties:C.properties},B=r.addImage(e.id,e.typeName,_,M);this.screenObjectIdsBillboard.add(B.screenObjectId)})})};u();const p=this.ad(a.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.imageAnchorChanged,e.imageOffsetChanged,e.imageShowChanged,e.imageSizeChanged,e.imageUrlChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged,this.featureStylesChanged));this.ad(p.don(u))}this.ad(e.flyToEvent.disposableOn(h=>{if(!n.actived)return;if(e.flyInParam){const{position:p,rotation:f,flyDuration:g}=e.flyInParam;return ne(n.viewer,p,void 0,f,g),!0}let u;l.defaultBoundingSphere&&this._defaultPointsBoundingSphere?u=d.BoundingSphere.fromBoundingSpheres([l.defaultBoundingSphere,this._defaultPointsBoundingSphere]):l.defaultBoundingSphere?u=l.defaultBoundingSphere:this._defaultPointsBoundingSphere&&(u=this._defaultPointsBoundingSphere),u&&Yt(n,e,this.id,re(u.center),u.radius,h)}));{const h=async(u,p,f)=>{if(!n.actived)return;const g=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(u,p)));if(!(!g||!(g!=null&&g.positions)))if(g.type=="Point"||g.type=="MultiPoint")Yt(n,e,this.id,await this._calculateFeatureHeight(g.type=="MultiPoint"?g.positions.flat():g.positions,e.heightReference,n),1e3,f);else{const m=g.type=="Polygon"||g.type=="MultiPolygon"||g.type=="MultiLineString";let v=[];m?v=g.positions.flat(g.type=="MultiPolygon"?2:1).map(_=>this._calculateFeatureHeight(_,e.fillGround?"CLAMP_TO_GROUND":"NONE",n)):v=g.positions.map(_=>this._calculateFeatureHeight(_,e.strokeGround?"CLAMP_TO_GROUND":"NONE",n));const{minPos:w,maxPos:C,center:x}=a.getMinMaxCorner(v);Yt(n,e,this.id,x,a.getDistancesFromPositions([w,C],"NONE")[0],f)}};this.d(e.flyToFeatureEvent.don((u,p,f)=>h(u,p,f))),this.d(e.flyToFeatureIndexEvent.don((u,p)=>h(u,void 0,p)))}this.ad(e.setFeatureStyleEvent.don(h=>{l.featureStyles=this.featureStyles=h})),this.ad(e.resetFeatureStyleEvent.don(()=>{l.featureStyles=this.featureStyles=void 0}))}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}get featureStyles(){return this._featureStyles.value}set featureStyles(e){this._featureStyles.value=e}get featureStylesChanged(){return this._featureStyles.changed}_getFeatureStyles(e,n){const o="image"in n;if(!this.featureStyles||this.featureStyles.length==0)return n;for(let s=0;s<this.featureStyles.length;s++){const r=this.featureStyles[s],l=Array.isArray(r.condition)?r.condition:[r.condition],h=[];for(let u=0;u<l.length;u++){if(!e){h.push(!1);continue}const p=l[u];if(typeof p=="boolean"){h.push(!0);continue}const f=e[p.field],g=typeof p.value=="string",m=typeof p.value=="number";if(g){h.push(up(p,f));continue}else if(m){h.push(dp(p,f));continue}else{h.push(!1);continue}}if(h.length>0&&!h.includes(!1))if(o){n=structuredClone(n);const{imageShow:u,imageStyle:p={}}=r;n.show=u??n.show,p.anchor=p.anchor??this.sceneObject.imageAnchor??a.ESGeoJson.defaults.billboardStyle.anchor,p.offset=p.offset??this.sceneObject.imageOffset??a.ESGeoJson.defaults.billboardStyle.offset,p.size=p.size??this.sceneObject.imageSize??a.ESGeoJson.defaults.billboardStyle.size,p.url=p.url??this.sceneObject.imageUrl??a.ESGeoJson.defaults.billboardStyle.url;const f=p.anchor,g=p.offset;n.width=p.size[0],n.height=p.size[1];const m=typeof p.url=="string"?p.url:p.url.url;return n.image=a.ESSceneObject.context.getStrFromEnv(m),n.pixelOffset=d.Cartesian2.fromArray([-f[0]*n.width+g[0],-f[1]*n.height+g[1]]),n}else{n=structuredClone(n);const{textShow:u,textStyle:p={}}=r;n.show=u??n.show,p.anchor=p.anchor??this.sceneObject.textAnchor??a.ESGeoJson.defaults.textStyle.anchor,p.backgroundColor=p.backgroundColor??this.sceneObject.textBackgroundColor??a.ESGeoJson.defaults.textStyle.backgroundColor,p.color=p.color??this.sceneObject.textColor??a.ESGeoJson.defaults.textStyle.color,p.defaultText=p.defaultText??this.sceneObject.textDefaultText??a.ESGeoJson.defaults.textStyle.defaultText,p.fontFamily=p.fontFamily??this.sceneObject.textFontFamily??a.ESGeoJson.defaults.textStyle.fontFamily,p.fontSize=p.fontSize??this.sceneObject.textFontSize??a.ESGeoJson.defaults.textStyle.fontSize,p.fontStyle=p.fontStyle??this.sceneObject.textFontStyle??a.ESGeoJson.defaults.textStyle.fontStyle,p.fontWeight=p.fontWeight??this.sceneObject.textFontWeight??a.ESGeoJson.defaults.textStyle.fontWeight,p.offset=p.offset??this.sceneObject.textOffset??a.ESGeoJson.defaults.textStyle.offset,p.textProperty=p.textProperty??this.sceneObject.textProperty??a.ESGeoJson.defaults.textStyle.textProperty;const f=p.fontSize,g=p.offset,m=p.anchor;return n.fillColor=new d.Color(...p.color),n.showBackground=(p==null?void 0:p.backgroundColor)!=null,n.backgroundColor=new d.Color(...p.backgroundColor??[1,1,1,1]),n.font=`${p.fontStyle} ${p.fontWeight} ${f}px ${p.fontFamily}`,n.text=p.textProperty&&p.textProperty!==""&&e&&e[p.textProperty]?e[p.textProperty]:p.defaultText,n.pixelOffset=d.Cartesian2.fromArray([-m[0]*((n.showBackground?-14:0)+this._getTextPixelWidth(n.text,n.font))+g[0],-m[1]*((n.showBackground?10:0)+f)+g[1]]),n}}return n}_getFeatureByIndexOrProperties(e,n){var l,h,u,p,f,g,m,v;const{sceneObject:o}=this,s=o.features;if(!s)return;const r=Reflect.get(s,"features")||Reflect.get(s,"geometries");if(r){if(n){let w=r.find(C=>(C==null?void 0:C.properties[e])==n);return{type:w!=null&&w.coordinates?w.type:(l=w==null?void 0:w.geometry)==null?void 0:l.type,positions:(w==null?void 0:w.coordinates)||((h=w==null?void 0:w.geometry)==null?void 0:h.coordinates)}}else if(typeof e=="number")return{type:(u=r[e])!=null&&u.coordinates?r[e].type:(f=(p=r[e])==null?void 0:p.geometry)==null?void 0:f.type,positions:((g=r[e])==null?void 0:g.coordinates)||((v=(m=r[e])==null?void 0:m.geometry)==null?void 0:v.coordinates)}}}async _calculateFeatureHeight(e,n,o){const s=[...e];return n=="NONE"?s[2]=s[2]??0:n=="CLAMP_TO_GROUND"||!s[2]?s[2]=await o.getTerrainHeight(s)??0:s[2]+=await o.getTerrainHeight(s)??0,s}_getTextPixelWidth(e,n){if(!this._textMeasureCtx){const o=document.createElement("canvas");this._textMeasureCtx=o.getContext("2d")}return this._textMeasureCtx.font=n,this._textMeasureCtx.measureText(e).width}};y(hl,"type",hl.register("ESCesiumViewer",a.ESGeoJson.type,hl));let Bp=hl;const ul=class ul extends Pt{constructor(e,n){super(e,n);y(this,"_czmGeoESRectangle");y(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ee(n,e.id)),this._czmGeoESRectangle=this.disposeVar(new Di(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoESRectangle,r=this._geoPolyline;r.arcType="RHUMB",this.dispose(a.track([r,"color"],[e,"strokeColor"])),this.dispose(a.track([r,"width"],[e,"strokeWidth"])),this.dispose(a.track([r,"ground"],[e,"strokeGround"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{const l=()=>{r.show=e.show&&e.stroked,s.show=e.show&&e.filled};l();const h=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(h.disposableOn(l))}{const l=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material=void 0};l();const h=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(h.disposableOn(l))}{const l=()=>{const h=e.points;if(h&&h.length>=2){const{minPos:u,maxPos:p}=a.getMinMaxCorner(h);s.rectangle=[u[0],u[1],p[0],p[1]],s.height=h[0][2],s.extrudedHeight=h[0][2];const f=h.map(w=>(h&&(w[2]=h[0][2]),w)),g=f[0],m=f[1],v=[g,[g[0],m[1],g[2]],m,[m[0],g[1],m[2]]];r.positions=[...v,g]}else s.rectangle=void 0,r.positions=void 0,s.height=0,s.extrudedHeight=0};l(),this.dispose(e.pointsChanged.disposableOn(()=>l()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmGeoESRectangle:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}};y(ul,"type",ul.register("ESCesiumViewer",a.ESGeoRectangle.type,ul));let zp=ul;class ca extends a.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new a.Event));y(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new Fn(e,n));const{geoPolygon:o}=this;this.dispose(a.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(a.bind([o,"show"],[this,"show"])),this.dispose(a.bind([o,"fill"],[this,"filled"])),this.dispose(a.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(a.bind([o,"ground"],[this,"ground"])),this.dispose(a.bind([o,"outline"],[this,"outline"])),this.dispose(a.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(a.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(a.bind([o,"color"],[this,"color"])),this.dispose(a.bind([o,"depth"],[this,"depth"]));const s=()=>{if(this.positions&&this.positions.length>=2){const r=Ku([...this.positions,this.positions[0]]);o.positions=r}else o.positions=void 0};s(),this.dispose(this.positionsChanged.disposableOn(s))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:a.reactArray([1,1,1,1]),outlineWidth:1,color:a.reactArrayWithUndefined([1,1,1,.5]),positions:a.reactPositions(void 0),depth:0})})(ca||(ca={})),a.extendClassProps(ca.prototype,ca.createDefaultProps);const dl=class dl extends Pt{constructor(e,n){super(e,n);y(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new ca(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoSmoothPolygon;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"filled"],[e,"filled"])),this.dispose(a.track([s,"color"],[e,"fillColor"])),this.dispose(a.track([s,"ground"],[e,"ground"]));{const r=()=>{s.ground=e.ground||e.fillGround};r();const l=this.dv(a.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(l.don(r))}{const r=()=>{s.color=e.filled?e.fillColor:la.defaults.fillStyle.color};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}this.dispose(a.track([s,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};y(dl,"type",dl.register("ESCesiumViewer",la.type,dl));let Lp=dl;const pl=class pl extends ge{constructor(e,n){super(e,n);y(this,"_czmModel");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new dt(n,e.id));const s=this._czmModel;this.d(s.readyEvent.don(l=>{var h;s.activeAnimationsJson=(h=s.gltf.animations)==null?void 0:h.map((u,p)=>({index:p,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"})),e.czmModelReadyEvent.emit(l),e.readyEvent.emit(l)})),this.ad(new $c(o,this._czmModel)),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"color"],[e,"czmColor"])),this.d(a.track([s,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(a.track([s,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(a.bind([s,"position"],[e,"position"])),this.d(a.track([s,"nativeScale"],[e,"czmNativeScale"])),this.d(a.track([s,"scale"],[e,"scale"])),this.ad(a.track([s,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(a.track([s,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const l=h=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:h}:{atmosphereScatteringIntensity:h}};l(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(h=>l(h)))}{const l=()=>{var h,u;(h=e.czmEnvironmentMapManager)!=null&&h.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};l(),this.ad(e.czmEnvironmentMapManagerChanged.don(l))}{const l=()=>{const h=[...e.rotation??[0,0,0]];h[0]+=e.instances&&e.instances.length!=0?0:90,s.rotation=h};l(),this.d(e.rotationChanged.don(l));{const h=()=>{if(l(),!e.instances||e.instances.length==0){s.instances=void 0;return}s.instances=e.instances.map(u=>{const p=JSON.parse(JSON.stringify(u));return!p.rotation&&(p.rotation=[0,0,0]),p.rotation[0]+=90,p})};h(),this.ad(e.instancesChanged.don(h))}}this.ad(e.setMaterialEvent.don(l=>{s.setMaterial(l)}));{const l=()=>{const h=[...s.rotation];h[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=h};l(),this.d(s.rotationChanged.don(l))}{const l=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),h=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};h(),this.d(l.don(h))}const r=()=>{var l;s.url=a.ESSceneObject.context.getStrFromEnv(qc(typeof e.url=="string"?e.url:((l=e.url)==null?void 0:l.url)??a.ESGltfModel.defaults.url))};r(),this.d(e.urlChanged.don(r)),this.d(e.setNodePositionEvent.don((l,h)=>{s.setNodeTranslation(l,h)})),this.d(e.setNodeRotationEvent.don((l,h)=>{s.setNodeRotation(l,h)})),this.d(e.setNodeScaleEvent.don((l,h)=>{s.setNodeScale(l,h)})),this.d(e.printDebugInfoEvent.don(()=>{s.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,n){const{sceneObject:o,czmViewer:s,model:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&yt(s,o,n,e,r,!0),!!r):!1}};y(pl,"type",pl.register("ESCesiumViewer",a.ESGltfModel.type,pl));let Op=pl;function vy(t,i){const e=t[0]-i[0],n=t[1]-i[1],o=t[2]-i[2];return Math.sqrt(e*e+n*n+o*o)}class ha extends a.Destroyable{constructor(e,n){super();y(this,"_pickedEvent",this.disposeVar(new a.Event));y(this,"_flyToEvent",this.disposeVar(new a.Event));y(this,"_distance",this.disposeVar(a.react(0)));y(this,"_surfaceDistance",this.disposeVar(a.react(0)));y(this,"_height",this.disposeVar(a.react(0)));y(this,"_middlePosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));y(this,"_heightPosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));const o=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const r=this._surfaceDistance.value=a.geoDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="RHUMB"){const r=this._surfaceDistance.value=a.geoRhumbDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="NONE"){const r=a.lbhToXyz(this.positions[0]),l=a.lbhToXyz(this.positions[1]);this._distance.value=vy(r,l),this._surfaceDistance.value=vy(a.lbhToXyz(this._middlePosition.value),l),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(s.disposableOn(o));{const r=this.disposeVar(new Ee(e,n));r.ground=!1,r.loop=!1,this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([r,"arcType"],[this,"arcType"])),this.dispose(a.bind([r,"color"],[this,"color"])),this.dispose(a.bind([r,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([r,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([r,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([r,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([r,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([r,"show"],[this,"show"])),this.dispose(a.bind([r,"width"],[this,"width"])),this.dispose(a.bind([r,"depthTest"],[this,"depthTest"]));{r.loop=!0;const h=()=>{if(this.positions&&this.positions.length===2){const[u,p]=this.positions;r.positions=[u,p,[u[0],u[1],p[2]]]}else r.positions=void 0};h(),this.dispose(this.positionsChanged.disposableOn(h))}this.dispose(this.flyToEvent.disposableOn(h=>{e.actived&&r.flyTo(h)}));const l=this.disposeVar(new He(e,n));this.dispose(a.track([l,"shadowDom"],[this,"shadowDom"])),this.dispose(a.track([l,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(a.track([l,"show"],[this,"show"]));{const h=()=>{l.position=this.heightPosition};h(),this.dispose(this.heightPositionChanged.disposableOn(h))}{const h=()=>{l.innerHTML=Co(`高度: ${Xc(this.height)}`,0)};h(),this.dispose(this.heightChanged.disposableOn(h))}this.ad(l.pickedEvent.don(h=>{Yi(h)===0&&this.pickedEvent.emit(h)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(ha||(ha={})),a.extendClassProps(ha.prototype,ha.createDefaultProps);const fl=class fl extends Pt{constructor(e,n){super(e,n);y(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new ha(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:s}=this;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const p=e.strokeStyle;if(p.material==="hasDash"&&p.materialParams)try{const f=p.materialParams;Reflect.has(f,"gapColor")&&(s.gapColor=f.gapColor??[0,0,0,0]),Reflect.has(f,"dashLength")&&(s.dashLength=f.dashLength),Reflect.has(f,"dashPattern")&&(s.dashPattern=f.dashPattern)}catch(f){console.error(f)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{Yi(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};y(fl,"type",fl.register("ESCesiumViewer",a.ESHeightMeasurement.type,fl));let Np=fl;const Vp={czmAnimationsStand:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsWalk:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsRun:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},gl=class gl extends ge{constructor(e,n){super(e,n);y(this,"_czmModelPrimitive");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new dt(n,this.sceneObject.id));const s=this._czmModelPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(Je([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"scale"],[e,"scale"])),this.d(s.readyEvent.don(C=>{e.readyEvent.emit(C)}));{const C=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),x=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};x(),this.d(C.don(x))}const r=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),l=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),h=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),p=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),f=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),g=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/repairman.glb"),m=()=>{switch(e.mode){case"worker":s.url=r;break;case"police":s.url=l;break;case"pedestrian":s.url=h;break;case"stranger":s.url=u;break;case"suitMan":s.url=p;break;case"suitWoman":s.url=f;break;case"repairMan":s.url=g;break;default:s.url=r;break}};this.dispose(e.modeChanged.disposableOn(()=>{m()})),m();const v=()=>{const C=e.animation??a.ESHuman.defaults.animation;if(!e.show){s.activeAnimationsJson=void 0;return}C==="walking"?s.activeAnimationsJson=Vp.czmAnimationsWalk:C==="standing"?s.activeAnimationsJson=Vp.czmAnimationsStand:C==="running"&&(s.activeAnimationsJson=Vp.czmAnimationsRun)};v();const w=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(w.disposableOn(()=>v())),this.ad(new $c(o,s))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmModelPrimitive:r}=this;return!s.actived||!s.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&yt(s,o,n,e,r,!0),!!r)}};y(gl,"type",gl.register("ESCesiumViewer",a.ESHuman.type,gl));let Up=gl;class yy extends a.Destroyable{constructor(e,n){super();y(this,"_czmGeoCanvasImagePoi");y(this,"flyTo",(e,n)=>{if(this.czmGeoCanvasImagePoi.position){ne(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,ii,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new Ei(n));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(s=>{(e.allowPicking??!1)&&e.pickedEvent.emit(s)}));{const s=p=>{let f=p;return p.includes("inner://")&&(f="${earthsdk3-assets-script-dir}/assets/img/points/"+p.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(qc(f))},r=()=>{const p=s(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=p,e.sizeByContent){const g=new Image;g.src=p,g.onload=()=>{o.size=[g.width,g.height]}}else{const g=e.size;o.size=[...g]}},l=this.disposeVar(a.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(l.disposableOn(()=>r())),r(),this.d(a.track([o,"zOrder"],[e,"zOrder"])),this.dispose(a.track([o,"show"],[e,"show"])),this.dispose(a.bind([o,"position"],[e,"position"])),this.ad(a.bind([o,"isHoverZoom"],[e,"isHoverZoom"])),this.ad(a.bind([o,"hoverHighlight"],[e,"hoverHighlight"]));{const p=()=>{o.scale=[e.scale[1],e.scale[2]]};p(),this.dispose(e.scaleChanged.don(p))}const h=()=>{const p=e.anchor,f=e.offset;p?o.originRatioAndOffset=[...p,-f[0],-f[1]]:o.originRatioAndOffset=[0,0,0,0]},u=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>h())),h(),this.dispose(o.clickEvent.disposableOn(p=>{const{offsetX:f,offsetY:g}=p,v={type:p.button===0?"leftClick":p.button===2?"rightClick":void 0,add:{mousePos:[f,g]}};e.widgetEvent.emit(v)})),this.dispose(o.hoveredChanged.disposableOn(p=>{if(p===void 0)return;const f={type:p?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(f)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class wy extends a.Destroyable{constructor(e,n,o){super();y(this,"_czmGeoImageModel");y(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});y(this,"_isPointEvent",!1);y(this,"flyTo",(e,n)=>{if(this.czmGeoImageModel.position)return Yt(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new ki(n,e.id));const s=this._czmGeoImageModel;this.ad(n.clickEvent.don(g=>{const m=g==null?void 0:g.pointerEvent;m&&(this._isPointEvent=!0,this._eventInfo={type:m.button==0?"leftClick":m.button==2?"rightClick":"leftClick",add:{mousePos:[m.offsetX,m.offsetY]}})})),this.d(e.pickedEvent.don(g=>{var m,v,w;g.screenPosition&&this._isPointEvent&&g.attachedInfo!="innerHoverEvent"&&((m=this._eventInfo.add)!=null&&m.mousePos)&&Math.abs(g.screenPosition[0]-((v=this._eventInfo.add)==null?void 0:v.mousePos[0]))<1&&Math.abs(g.screenPosition[1]-((w=this._eventInfo.add)==null?void 0:w.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.engineObjectCreatedUpdate(this,e,()=>{const g=n.getEngineObject(e);this.ad(g.lastHoverResultChanged.don((m,v)=>{(m==null?void 0:m.sceneObject)==(v==null?void 0:v.sceneObject)||(m==null?void 0:m.sceneObject)!=e&&(v==null?void 0:v.sceneObject)!=e||(m!=null&&m.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:m==null?void 0:m.screenPosition}},m.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&m.sceneObject.id==e.id&&(s.scale=[s.scale[0]*1.5,s.scale[1]*1.5])),v!=null&&v.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:m==null?void 0:m.screenPosition}},v.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&v.sceneObject.id==e.id&&(s.scale=[s.scale[0]/1.5,s.scale[1]/1.5])))}))});const r=e.sizeByContent,h=(g=>{let m=g;return g.includes("inner://")&&(m="${earthsdk3-assets-script-dir}/assets/img/points/"+g.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(qc(m))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),u=new Image;u.src=h,u.onload=()=>{if(r)s.size=[u.width/100,u.height/100];else{const g=e.size;s.size=[g[0]/100,g[1]/100]}},s.uri=h,this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),s.pixelSize=void 0,s.useAxis="XZ";{const g=()=>{s.scale=[e.scale[1],e.scale[2]]};g(),this.d(e.scaleChanged.don(g))}{const g=()=>{e.rotationType===0&&(s.rotationMode="WithProp",this.d(Je([s,"rotation"],[e,"rotation"]))),e.rotationType===1&&(s.rotationMode="WithCamera"),e.rotationType===2&&(s.rotationMode="WithCameraOnlyZ")};g(),this.dispose(e.rotationTypeChanged.disposableOn(g))}const p=()=>{const g=e.anchor,m=e.offset;g?s.originRatioAndOffset=[...g,-m[0]/100,-m[1]/100]:s.originRatioAndOffset=[0,0,0,0]},f=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(f.disposableOn(()=>p())),p()}get czmGeoImageModel(){return this._czmGeoImageModel}}const ml=class ml extends oa{constructor(e,n){super(e,n);y(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.disposeVar(a.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new a.ObjResettingWithEvent(s,()=>this.sceneObject.screenRender?new yy(this.sceneObject,this.czmViewer):new wy(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:o,czmViewer:s,resetting:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r&&r.obj&&r.obj.flyTo(e,n),o.flyOverEvent.emit(n,"over",s),!0):!1}};y(ml,"type",ml.register("ESCesiumViewer",a.ESImageLabel.type,ml));let Wp=ml;function MT(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const vl=class vl extends qt{constructor(e,n){super(e,n);y(this,"_czmImagery");if(this._czmImagery=this.dv(new $n(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;{const r=this.ad(a.reactJson(""));{const u=()=>{if(typeof e.url=="string")r.value=a.ESSceneObject.context.getStrFromEnv(e.url);else{const p=e.url;p.url=a.ESSceneObject.context.getStrFromEnv(p.url),r.value=p}};u(),this.ad(e.urlChanged.don(u))}const l=()=>{var v;if(!r.value)return;const u=(((v=e.options)==null?void 0:v.type)??"auto").toLowerCase(),p=e.options??{};let f={type:"UrlTemplateImageryProvider",url:r.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...p},g=r.value,m=typeof g=="string"?g:g.url;if(u==="auto"){const w=m.toLowerCase();if(w.startsWith("ion://")){const x=+w.substring(6);f={...p,assetId:x,type:"IonImageryProvider"}}else if(w.includes("{x}")||w.includes("{y}")||w.includes("{z}"))f.type="UrlTemplateImageryProvider";else if(w.includes("wmts"))f.type="WebMapTileServiceImageryProvider";else if(w.includes("wms"))f.type="WebMapServiceImageryProvider";else{if(m.includes("/tilemapresource.xml")){const C=m.split("/tilemapresource.xml").join("");typeof g=="string"?g=C:g.url=C,f.url=g}f.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&m.includes("/tilemapresource.xml")){const w=m.split("/tilemapresource.xml").join("");typeof g=="string"?g=w:g.url=w,f.url=g}else if(u==="ion"&&m.startsWith("ion://")){const C=+m.substring(6);f={...p,assetId:C,type:"IonImageryProvider"}}f.type=MT(u)}console.log("imageryProvider",f),s.imageryProvider=f};l();const h=this.dv(a.createNextAnimateFrameEvent(r.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(h.don(l))}this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"alpha"],[e,"opacity"])),this.d(a.bind([s,"alpha"],[e,"czmAlpha"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.ad(a.track([s,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};y(vl,"type",vl.register("ESCesiumViewer",a.ESImageryLayer.type,vl));let Gp=vl;class IT extends a.Destroyable{constructor(e,n,o,s){super();y(this,"_show");y(this,"_czmESCustomPrimitive");y(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(a.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new Se(n,this._sceneObject.id)),this._czmTexture=this.dv(new Oe(n));const r=e,l=this._czmESCustomPrimitive,h=this._czmTexture;this.dispose(a.track([l,"show"],[this,"show"])),this.dispose(a.track([l,"show"],[r,"show"])),this.dispose(a.track([l,"allowPicking"],[r,"allowPicking"])),this.dispose(a.track([l,"rotation"],[r,"rotation"])),this.dispose(a.track([l,"position"],[r,"position"])),this.dispose(a.track([l,"scale"],[r,"scale"])),this.ad(r.allowPickingChanged.don(()=>{l.allowPicking=r.allowPicking,l.pass=r.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const f=r.size/2,g=s[0].map(z=>z*f),m=s[1].map(z=>z*f),v=s[2].map(z=>z*f),w=s[3].map(z=>z*f),C=[...g,...m,...v,...w];let x=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(x=x.reverse());const _=[0,0],P=[1,0],E=[1,1],A=[0,1];let M=[];o=="east"||o=="south"?M=[...P,..._,...A,...E]:o=="west"?M=[...P,...E,...A,..._]:o=="top"?M=[...A,...E,...P,..._]:M=[..._,...P,...E,...A],l.indexTypedArray=new Uint16Array(x),l.attributes={position:{typedArray:new Float32Array(C),componentsPerAttribute:3},st:{typedArray:new Float32Array(M),componentsPerAttribute:2}},h.uri=a.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/${o}.${r.mode!="blueSky"?"png":"jpg"}`);const B=n.getCameraInfo();if(B!=null){const L=a.getDistancesFromPositions([r.position,B.position],"NONE")[0]/(r.size/2*r.autoOpacityFactor);this.changeOpacity(r.autoFollow?1:L)}const O=l.computeLocalAxisedBoundingBoxFromAttribute("position");if(!O)return;const{min:W,max:V}=O;l.setLocalAxisedBoundingBox(W,V)};u();const p=this.disposeVar(a.createNextAnimateFrameEvent(r.sizeChanged,r.modeChanged));this.dispose(p.disposableOn(u))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class RT extends a.Destroyable{constructor(i,e,n){if(super(),!e.viewer)return;let o=!0,s;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{r()}));function r(){var h;if(!((h=e.viewer)!=null&&h.camera))return;const l=e.getCameraInfo();if(l!=null&&(s==null||s.position[0]!=l.position[0]||s.position[1]!=l.position[1]||s.position[2]!=l.position[2]||s.rotation[0]!=l.rotation[0]||s.rotation[1]!=l.rotation[1]||s.rotation[2]!=l.rotation[2])){s=l;const p=a.getDistancesFromPositions([i.position,s.position],"NONE")[0]/(i.size/2*i.autoOpacityFactor);i.autoFollow?(i.position=s.position,o&&(o=!1,n.forEach(f=>{f.changeOpacity(1)}))):n.forEach(f=>{f.changeOpacity(p)})}}r()}}const ke=class ke extends ge{constructor(e,n){super(e,n);y(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!ke._defaultLocalBox&&ke._firstLoad&&(ke._firstLoad=!1,ke._defaultLocalBox=n.xbsjLocalBoxSources),ke._eSLocalSkyBoxArr.push(e),this.d(()=>{ke._eSLocalSkyBoxArr.includes(e)&&ke._eSLocalSkyBoxArr.splice(ke._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const s={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const r in s)if(Object.prototype.hasOwnProperty.call(s,r)){const l=s[r];this._czmSkyBoxComponents.push(this.dv(new IT(e,n,r,l)))}{const r=this.disposeVar(a.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new a.ObjResettingWithEvent(r,()=>(this.ChangeAutoFollow(),new RT(e,n,this._czmSkyBoxComponents))))}{const r=()=>{this.ChangeAutoFollow()},l=this.disposeVar(a.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(l.disposableOn(r))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let n=ke._eSLocalSkyBoxArr.length-1;n>=0;n--){const o=ke._eSLocalSkyBoxArr[n];if(o.autoFollow&&o.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/east.${o.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/west.${o.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/bottom.${o.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/top.${o.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/north.${o.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/south.${o.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(e.xbsjLocalBoxSources=ke._defaultLocalBox)}ke._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=ke._defaultLocalBox)}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const r=o.size??a.ESLocalSkyBox.defaults.size;return o.position?(Yt(s,o,n,o.position,r,e,!0),!0):!1}}};y(ke,"type",ke.register("ESCesiumViewer",a.ESLocalSkyBox.type,ke)),y(ke,"_defaultLocalBox"),y(ke,"_firstLoad",!0),y(ke,"_eSLocalSkyBoxArr",[]);let Hp=ke;const ui=class ui extends ge{constructor(e,n){super(e,n);y(this,"_geoCustomDivPoi");y(this,"_textFunc",this.disposeVar(a.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new He(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this.geoCustomDivPoi;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{this.dispose(s.pickedEvent.disposableOn(r=>{(e.allowPicking??a.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(r)})),this.dispose(s.innerHtmlMounted.disposableOn(r=>{const l=r.firstElementChild;l&&(l.style.pointerEvents="auto",l.style.cursor="default",l.onclick=h=>s.pickFromDiv(l,{type:"viewerPicking",pointerEvent:h}))}));{const r=()=>{if(!e.position)return;const h=(this.textFunc??ui.defaultTextFunc_度格式)(e.position);s.innerHTML=Co(h)};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(l.disposableOn(r))}{const r=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?ui.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?ui.defaultTextFunc_度分格式:ui.defaultTextFunc_度分秒格式};r(),this.d(n.lonLatFormatChanged.don(()=>{r()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};y(ui,"type",ui.register("ESCesiumViewer",a.ESLocationMeasurement.type,ui)),y(ui,"defaultTextFunc_度格式",e=>{if(!e)return"";const[n=0,o=0,s=0]=e;return`经度: ${n.toFixed(5)}°
1254
+ `,qe=class qe extends a.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new a.Event));y(this,"_loadFuncReact",this.disposeVar(a.react(void 0)));y(this,"_dataSource",this.disposeVar(a.react(void 0)));y(this,"_data");y(this,"_defaultHeight",{});y(this,"defaultBoundingSphere");y(this,"_featureStyles",this.disposeVar(a.react(void 0)));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let s=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{s()});{const r=this.dv(a.createProcessingFromAsyncFunc(async u=>{this.dataSource&&s(),this.url&&(typeof this.url=="object"?this._data=this.url:a.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(a.ESSceneObject.context.getStrFromEnv(this.url)).then(p=>p.json()).then(p=>{this._data=p}).catch(p=>{console.warn("ESGeoJson数据加载失败",p)}),this.dataSource=await d.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(p=>{var g,m;const f=[];for(const v of p.entities.values){if(d.Entity.prototype&&(v.ESSceneObjectID=n),this._isEntityShow(v,e),v.polygon){f.push(...(g=v.polygon.hierarchy)==null?void 0:g.getValue(d.JulianDate.now()).positions);continue}if(v.polyline){f.push(...(m=v.polyline.positions)==null?void 0:m.getValue(d.JulianDate.now()));continue}if(v.position){const w=v.position.getValue(d.JulianDate.now());w&&f.push(w);continue}}this.defaultBoundingSphere=f.length>0?d.BoundingSphere.fromPoints(f):void 0}))})),l=()=>{r.isRunning&&r.cancel(),r.restart()};l();const h=this.dv(a.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(h.don(l))}{const r=()=>{var h,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(p){console.error(p)}else{const p=this.dataSource.entities.values;for(let f=0;f<p.length;f++){const g=p[f],m=this._getFeatureStyles(g);if(g.polygon){this._defaultHeight[g.id]||(this._defaultHeight[g.id]=(h=g.polygon.height)==null?void 0:h.getValue(d.JulianDate.now())),g.polygon.height=m.fillGround?void 0:new d.ConstantProperty(this._defaultHeight[g.id]),g.polygon.perPositionHeight=new d.ConstantProperty(!m.fillGround),g.polygon.heightReference=new d.ConstantProperty(d.HeightReference[m.heightReference.toUpperCase()]),g.polygon.show=new d.ConstantProperty(m.filled??qe.defaults.filled),g.polygon.material=new d.ColorMaterialProperty(new d.Color(...m.fillColor??qe.defaults.fillColor)),g.polygon.outline=new d.ConstantProperty(!1),g.polygon.classificationType=d.ClassificationType[m.classificationType.toUpperCase()],g.polyline=new d.PolylineGraphics;const v=JSON.parse(JSON.stringify((u=g.polygon.hierarchy)==null?void 0:u.getValue(d.JulianDate.now()).positions));d.Cartesian3.equals(v[0],v[v.length-1])||v.push(v[0]),g.polyline.positions=v}if(g.polyline&&(g.polyline.classificationType=d.ClassificationType[m.classificationType.toUpperCase()],g.polyline.show=new d.ConstantProperty(m.stroked??qe.defaults.stroked),g.polyline.width=new d.ConstantProperty(m.strokeWidth??qe.defaults.strokeWidth),g.polyline.material=new d.ColorMaterialProperty(new d.Color(...m.strokeColor??qe.defaults.strokeColor)),g.polyline.clampToGround=new d.ConstantProperty(m.strokeGround)),g.billboard){g.billboard.show=new d.ConstantProperty(m.imageShow??qe.defaults.imageShow),g.billboard.width=new d.ConstantProperty(m.imageSize?m.imageSize[0]:qe.defaults.imageSize[0]),g.billboard.height=new d.ConstantProperty(m.imageSize?m.imageSize[1]:qe.defaults.imageSize[1]);const v=m.imageUrl?typeof m.imageUrl=="string"?m.imageUrl:m.imageUrl.url:qe.defaults.imageUrl;g.billboard.image=new d.ConstantProperty(a.ESSceneObject.context.getStrFromEnv(v)),g.billboard.horizontalOrigin=new d.ConstantProperty(d.HorizontalOrigin.LEFT),g.billboard.verticalOrigin=new d.ConstantProperty(d.VerticalOrigin.TOP),g.billboard.heightReference=new d.ConstantProperty(d.HeightReference[m.heightReference.toUpperCase()]);const w=m.imageAnchor??qe.defaults.imageAnchor,C=m.imageOffset??qe.defaults.imageOffset;if(g.billboard.pixelOffset=new d.ConstantProperty(d.Cartesian2.fromArray([-w[0]*g.billboard.width.getValue(d.JulianDate.now())+C[0],-w[1]*g.billboard.height.getValue(d.JulianDate.now())+C[1]])),g.label=new d.LabelGraphics,!g.label)return;g.label.show=new d.ConstantProperty(m.textShow??qe.defaults.textShow),g.label.heightReference=new d.ConstantProperty(d.HeightReference[m.heightReference.toUpperCase()]),g.label.text=new d.ConstantProperty(m.textProperty&&m.textProperty!==""&&g.properties&&g.properties[m.textProperty]?g.properties[m.textProperty].getValue():m.textDefaultText??qe.defaults.textDefaultText),g.label.fillColor=new d.ConstantProperty(new d.Color(...m.textColor??qe.defaults.textColor)),g.label.showBackground=new d.ConstantProperty(m.textBackgroundColor!=null);const x=m.textFontSize&&m.textFontSize!=0?m.textFontSize:qe.defaults.textFontSize,_=m.textOffset??qe.defaults.textOffset;g.label.backgroundColor=new d.ConstantProperty(new d.Color(...m.textBackgroundColor??qe.defaults.textBackgroundColor)),g.label.font=new d.ConstantProperty(`${m.textFontStyle} ${m.textFontWeight} ${x}px ${m.textFontFamily??qe.defaults.textFontFamily}`),g.label.horizontalOrigin=new d.ConstantProperty(d.HorizontalOrigin.LEFT),g.label.verticalOrigin=new d.ConstantProperty(d.VerticalOrigin.TOP),g.label.eyeOffset=new d.ConstantProperty(d.Cartesian3.fromArray([0,0,-1]));const P=m.textAnchor??qe.defaults.textAnchor;g.label.pixelOffset=new d.ConstantProperty(d.Cartesian2.fromArray([-P[0]*((m.textBackgroundColor?-14:0)+this._getTextPixelWidth(g.label.text.getValue(d.JulianDate.now()),g.label.font.getValue(d.JulianDate.now())))+_[0],-P[1]*((m.textBackgroundColor?10:0)+x)+_[1]]))}}}};r();const l=this.dv(a.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged,this.classificationTypeChanged,this.featureStylesChanged));this.dispose(l.don(r))}{const r=()=>{if(!this.dataSource)return;const h=this.dataSource.entities.values;for(let u=0;u<h.length;u++){const p=h[u];this._isEntityShow(p,e)}};r();const l=this.ad(a.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(l.don(r))}{const r=()=>{if(this.loadFuncStr)try{const l=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=l}catch(l){console.error(l),this.loadFun=void 0}else this.loadFun=void 0};r(),this.dispose(this.loadFuncStrChanged.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{e.actived&&this.dataSource&&this.defaultBoundingSphere&&o.camera.flyToBoundingSphere(this.defaultBoundingSphere,{duration:r?r/1e3:void 0})}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}get featureStyles(){return this._featureStyles.value}set featureStyles(e){this._featureStyles.value=e}get featureStylesChanged(){return this._featureStyles.changed}_getFeatureStyles(e){var n;if(!this.featureStyles||this.featureStyles.length==0)return this.mergeFeatureStyles();for(let o=0;o<this.featureStyles.length;o++){const s=this.featureStyles[o],r=Array.isArray(s.condition)?s.condition:[s.condition],l=[];for(let h=0;h<r.length;h++){if(!e.properties){l.push(!1);continue}const u=r[h];if(typeof u=="boolean"){l.push(!0);continue}const p=(n=e.properties[u.field])==null?void 0:n.getValue(d.JulianDate.now()),f=typeof u.value=="string",g=typeof u.value=="number";if(f){l.push(up(u,p));continue}else if(g){l.push(dp(u,p));continue}else{l.push(!1);continue}}if(l.length>0&&!l.includes(!1))return this.mergeFeatureStyles(s)}return this.mergeFeatureStyles()}mergeFeatureStyles(e={}){const{filled:n,stroked:o,fillStyle:s,strokeStyle:r,imageShow:l,imageStyle:h,textShow:u,textStyle:p}=e;return{imageShow:l??this.imageShow,imageUrl:(h==null?void 0:h.url)??this.imageUrl,imageAnchor:(h==null?void 0:h.anchor)??this.imageAnchor,imageOffset:(h==null?void 0:h.offset)??this.imageOffset,imageSize:(h==null?void 0:h.size)??this.imageSize,textShow:u??this.textShow,textProperty:(p==null?void 0:p.textProperty)??this.textProperty,textDefaultText:(p==null?void 0:p.defaultText)??this.textDefaultText,textColor:(p==null?void 0:p.color)??this.textColor,textBackgroundColor:(p==null?void 0:p.backgroundColor)??this.textBackgroundColor,textFontFamily:(p==null?void 0:p.fontFamily)??this.textFontFamily,textFontSize:(p==null?void 0:p.fontSize)??this.textFontSize,textFontStyle:(p==null?void 0:p.fontStyle)??this.textFontStyle,textFontWeight:(p==null?void 0:p.fontWeight)??this.textFontWeight,textAnchor:(p==null?void 0:p.anchor)??this.textAnchor,textOffset:(p==null?void 0:p.offset)??this.textOffset,stroked:o??this.stroked,filled:n??this.filled,strokeWidth:(r==null?void 0:r.width)??this.strokeWidth,strokeWidthType:(r==null?void 0:r.widthType)??this.strokeWidthType,strokeColor:(r==null?void 0:r.color)??this.strokeColor,strokeMaterial:(r==null?void 0:r.material)??this.strokeMaterial,strokeMaterialParams:(r==null?void 0:r.materialParams)??this.strokeMaterialParams,strokeGround:(r==null?void 0:r.ground)??this.strokeGround,fillColor:(s==null?void 0:s.color)??this.fillColor,fillMaterial:(s==null?void 0:s.material)??this.fillMaterial,fillMaterialParams:(s==null?void 0:s.materialParams)??this.fillMaterialParams,fillGround:(s==null?void 0:s.ground)??this.fillGround,heightReference:this.heightReference,classificationType:this.classificationType}}_getTextPixelWidth(e,n="16px sans-serif"){const s=document.createElement("canvas").getContext("2d");return s.font=n,s.measureText(e).width}_isEntityShow(e,n){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0)e.show=this.show;else if((o=n.viewer)!=null&&o.camera){if(!this.show){e.show=this.show;return}const s=d.JulianDate.now();let r;if(e.polygon&&e.polygon.hierarchy)r=a.getMinMaxCorner(e.polygon.hierarchy.getValue(s).positions.map(u=>re(u))).center;else if(e.polyline&&e.polyline.positions)r=a.getMinMaxCorner(e.polyline.positions.getValue(s).map(u=>re(u))).center;else if(e.position){const u=e.position.getValue(s);u&&(r=re(u))}if(!r||isNaN(r[0]))return;const l=a.getDistancesFromPositions([r,Xt(n.viewer.camera)],"NONE")[0];let h=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?h=this.minFeatureVisibleDistance<l&&l<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?h=l>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(h=l<this.maxFeatureVisibleDistance),e.show=this.show&&h}}};y(qe,"defaults",{show:!0,allowPicking:!0,url:my,defaultLoadFuncStr:gy,defaultLoadFuncDocStr:DT,data:AT,dataMd:TT,stroked:!0,strokeWidth:1,strokeWidthType:"world",strokeColor:[.79,.91,.06,1],strokeMaterial:"",strokeMaterialParams:{},strokeGround:!1,filled:!0,fillColor:[.79,.91,.06,.2],fillMaterial:"",fillMaterialParams:{},fillGround:!1,imageShow:!0,imageUrl:"${earthsdk3-assets-script-dir}/assets/misc/location.png",imageSize:[64,64],imageAnchor:[.5,1],imageOffset:[0,0],textShow:!0,textProperty:"",textDefaultText:"默认标注",textColor:[1,1,1,1],textBackgroundColor:[.79,.91,.06,1],textFontFamily:"Arial",textFontSize:16,textFontWeight:"normal",textFontStyle:"normal",textAnchor:[.5,1],textOffset:[0,0],strokeWidthTypes:[["screen","screen"],["world","world"]],minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReferences:[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]]});let Uo=qe;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:a.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:a.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:a.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:a.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:a.reactArrayWithUndefined(void 0),imageAnchor:a.reactArrayWithUndefined(void 0),imageOffset:a.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:a.reactArrayWithUndefined(void 0),textBackgroundColor:a.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:a.reactArrayWithUndefined(void 0),textOffset:a.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(Uo||(Uo={})),a.extendClassProps(Uo.prototype,Uo.createDefaultProps);const hl=class hl extends qt{constructor(e,n){super(e,n);y(this,"_pointFeatures",this.disposeVar(a.react(void 0)));y(this,"_defaultPointsBoundingSphere");y(this,"screenObjectIdsLabel",new Set);y(this,"screenObjectIdsBillboard",new Set);y(this,"_featureStyles",this.disposeVar(a.react(void 0)));y(this,"_textMeasureCtx");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=Qe(o);if(!s)return;const{screenManager:r}=s,l=this.disposeVar(new Uo(n,e.id));{const h=()=>{if(l.featureStyles=this.featureStyles=void 0,!e.features)return;const u=a.toGeoJson(e.features),p={type:u.type,features:[]};l.url={type:u.type,features:u.features.filter(f=>f.geometry.type.toLowerCase().includes("point")?(p.features.push(f),!1):!0)},this.pointFeatures=p};h(),this.ad(e.featuresChanged.don(h))}this.ad(a.track([l,"show"],[e,"show"])),this.ad(a.track([l,"allowPicking"],[e,"allowPicking"])),this.ad(a.track([l,"loadFuncStr"],[e,"loadFuncStr"])),this.ad(a.track([l,"stroked"],[e,"stroked"])),this.ad(a.track([l,"strokeWidth"],[e,"strokeWidth"])),this.ad(a.track([l,"strokeWidthType"],[e,"strokeWidthType"])),this.ad(a.track([l,"strokeColor"],[e,"strokeColor"])),this.ad(a.track([l,"strokeMaterial"],[e,"strokeMaterial"])),this.ad(a.track([l,"strokeMaterialParams"],[e,"strokeMaterialParams"])),this.ad(a.track([l,"strokeGround"],[e,"strokeGround"])),this.ad(a.track([l,"filled"],[e,"filled"])),this.ad(a.track([l,"fillColor"],[e,"fillColor"])),this.ad(a.track([l,"fillMaterial"],[e,"fillMaterial"])),this.ad(a.track([l,"fillMaterialParams"],[e,"fillMaterialParams"])),this.ad(a.track([l,"fillGround"],[e,"fillGround"])),this.ad(a.track([l,"minFeatureVisibleDistance"],[e,"minFeatureVisibleDistance"])),this.ad(a.track([l,"maxFeatureVisibleDistance"],[e,"maxFeatureVisibleDistance"])),this.ad(a.track([l,"heightReference"],[e,"heightReference"])),this.ad(a.track([l,"classificationType"],[e,"classificationType"]));{const h=()=>{!this.pointFeatures||this.pointFeatures.features.length==0||(this._defaultPointsBoundingSphere=d.BoundingSphere.fromPoints(this.pointFeatures.features.map(u=>(u.geometry.type=="Point"?[u.geometry.coordinates]:u.geometry.coordinates).map(f=>xe(f))).flat(1/0)))};h(),this.ad(this.pointFeaturesChanged.don(h))}{const h=()=>{r.remove(e.typeName,e.id,{label:this.screenObjectIdsLabel}),this.screenObjectIdsLabel.clear()};this.ad(()=>{h()});const u=()=>{if(h(),!((e.textShow??a.ESGeoJson.defaults.textShow)&&(e.show??a.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.textFontSize&&e.textFontSize!=0?e.textFontSize:a.ESGeoJson.defaults.textStyle.fontSize,g={show:!0,heightReference:d.HeightReference[e.heightReference??a.ESGeoJson.defaults.heightReference],fillColor:new d.Color(...e.textColor??a.ESGeoJson.defaults.textStyle.color),showBackground:e.textBackgroundColor!=null,backgroundColor:new d.Color(...e.textBackgroundColor??a.ESGeoJson.defaults.textStyle.backgroundColor??[1,1,1,1]),font:`${e.textFontStyle} ${e.textFontWeight} ${f}px ${e.textFontFamily??a.ESGeoJson.defaults.textStyle.fontFamily}`,horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.TOP,eyeOffset:d.Cartesian3.fromArray([0,0,-1]),distanceDisplayCondition:new d.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((m,v)=>{const w=this._getFeatureStyles(m.properties,g);if(!Reflect.has(w,"text")){const x=e.textAnchor??a.ESGeoJson.defaults.textStyle.anchor,_=e.textOffset??a.ESGeoJson.defaults.textStyle.offset,P=e.textProperty??a.ESGeoJson.defaults.textStyle.textProperty,E=e.textDefaultText??a.ESGeoJson.defaults.textStyle.defaultText;w.text=P&&P!==""&&m.properties&&m.properties[P]?m.properties[P]:E,w.pixelOffset=d.Cartesian2.fromArray([-x[0]*((w.showBackground?-14:0)+this._getTextPixelWidth(w.text,w.font))+_[0],-x[1]*((w.showBackground?10:0)+f)+_[1]])}(m.geometry.type=="Point"?[m.geometry.coordinates]:m.geometry.coordinates).forEach((x,_)=>{const P={index:`${v}${_}`,name:w.text,position:x,zOrder:e.zIndex??a.ESGeoJson.defaults.zIndex,properties:m.properties},E=r.addLabel(e.id,e.typeName,w,P);this.screenObjectIdsLabel.add(E.screenObjectId)})})};u();const p=this.ad(a.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.textShowChanged,e.textPropertyChanged,e.textDefaultTextChanged,e.textColorChanged,e.textBackgroundColorChanged,e.textFontFamilyChanged,e.textFontSizeChanged,e.textFontStyleChanged,e.textFontWeightChanged,e.textAnchorChanged,e.textOffsetChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged,this.featureStylesChanged));this.ad(p.don(u))}{const h=()=>{r.remove(e.typeName,e.id,{billboard:this.screenObjectIdsBillboard}),this.screenObjectIdsBillboard.clear()};this.ad(()=>{h()});const u=()=>{if(h(),!((e.imageShow??a.ESGeoJson.defaults.imageShow)&&(e.show??a.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.imageAnchor??a.ESGeoJson.defaults.imageStyle.anchor,g=e.imageOffset??a.ESGeoJson.defaults.imageStyle.offset,m=e.imageSize?e.imageSize[0]:a.ESGeoJson.defaults.imageStyle.size[0],v=e.imageSize?e.imageSize[1]:a.ESGeoJson.defaults.imageStyle.size[1],w={show:!0,width:m,height:v,image:a.ESSceneObject.context.getStrFromEnv(e.imageUrl?typeof e.imageUrl=="string"?e.imageUrl:e.imageUrl.url:a.ESGeoJson.defaults.imageStyle.url),horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.TOP,heightReference:d.HeightReference[e.heightReference??a.ESGeoJson.defaults.heightReference],pixelOffset:d.Cartesian2.fromArray([-f[0]*m+g[0],-f[1]*v+g[1]]),distanceDisplayCondition:new d.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((C,x)=>{const _=this._getFeatureStyles(C.properties,w);(C.geometry.type=="Point"?[C.geometry.coordinates]:C.geometry.coordinates).forEach((E,A)=>{const M={index:`${x}${A}`,name:"",position:E,zOrder:e.zIndex??a.ESGeoJson.defaults.zIndex,properties:C.properties},B=r.addImage(e.id,e.typeName,_,M);this.screenObjectIdsBillboard.add(B.screenObjectId)})})};u();const p=this.ad(a.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.imageAnchorChanged,e.imageOffsetChanged,e.imageShowChanged,e.imageSizeChanged,e.imageUrlChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged,this.featureStylesChanged));this.ad(p.don(u))}this.ad(e.flyToEvent.disposableOn(h=>{if(!n.actived)return;if(e.flyInParam){const{position:p,rotation:f,flyDuration:g}=e.flyInParam;return ne(n.viewer,p,void 0,f,g),!0}let u;l.defaultBoundingSphere&&this._defaultPointsBoundingSphere?u=d.BoundingSphere.fromBoundingSpheres([l.defaultBoundingSphere,this._defaultPointsBoundingSphere]):l.defaultBoundingSphere?u=l.defaultBoundingSphere:this._defaultPointsBoundingSphere&&(u=this._defaultPointsBoundingSphere),u&&Yt(n,e,this.id,re(u.center),u.radius,h)}));{const h=async(u,p,f)=>{if(!n.actived)return;const g=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(u,p)));if(!(!g||!(g!=null&&g.positions)))if(g.type=="Point"||g.type=="MultiPoint")Yt(n,e,this.id,await this._calculateFeatureHeight(g.type=="MultiPoint"?g.positions.flat():g.positions,e.heightReference,n),1e3,f);else{const m=g.type=="Polygon"||g.type=="MultiPolygon"||g.type=="MultiLineString";let v=[];m?v=g.positions.flat(g.type=="MultiPolygon"?2:1).map(_=>this._calculateFeatureHeight(_,e.fillGround?"CLAMP_TO_GROUND":"NONE",n)):v=g.positions.map(_=>this._calculateFeatureHeight(_,e.strokeGround?"CLAMP_TO_GROUND":"NONE",n));const{minPos:w,maxPos:C,center:x}=a.getMinMaxCorner(v);Yt(n,e,this.id,x,a.getDistancesFromPositions([w,C],"NONE")[0],f)}};this.d(e.flyToFeatureEvent.don((u,p,f)=>h(u,p,f))),this.d(e.flyToFeatureIndexEvent.don((u,p)=>h(u,void 0,p)))}this.ad(e.setFeatureStyleEvent.don(h=>{l.featureStyles=this.featureStyles=h})),this.ad(e.resetFeatureStyleEvent.don(()=>{l.featureStyles=this.featureStyles=void 0}))}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}get featureStyles(){return this._featureStyles.value}set featureStyles(e){this._featureStyles.value=e}get featureStylesChanged(){return this._featureStyles.changed}_getFeatureStyles(e,n){const o="image"in n;if(n=structuredClone(n),!this.featureStyles||this.featureStyles.length==0)return n;for(let s=0;s<this.featureStyles.length;s++){const r=this.featureStyles[s],l=Array.isArray(r.condition)?r.condition:[r.condition],h=[];for(let u=0;u<l.length;u++){if(!e){h.push(!1);continue}const p=l[u];if(typeof p=="boolean"){h.push(!0);continue}const f=e[p.field],g=typeof p.value=="string",m=typeof p.value=="number";if(g){h.push(up(p,f));continue}else if(m){h.push(dp(p,f));continue}else{h.push(!1);continue}}if(h.length>0&&!h.includes(!1))if(o){n=n;const{imageShow:u,imageStyle:p={}}=r;n.show=u??n.show,p.anchor=p.anchor??this.sceneObject.imageAnchor??a.ESGeoJson.defaults.billboardStyle.anchor,p.offset=p.offset??this.sceneObject.imageOffset??a.ESGeoJson.defaults.billboardStyle.offset,p.size=p.size??this.sceneObject.imageSize??a.ESGeoJson.defaults.billboardStyle.size,p.url=p.url??this.sceneObject.imageUrl??a.ESGeoJson.defaults.billboardStyle.url;const f=p.anchor,g=p.offset;n.width=p.size[0],n.height=p.size[1];const m=typeof p.url=="string"?p.url:p.url.url;return n.image=a.ESSceneObject.context.getStrFromEnv(m),n.pixelOffset=d.Cartesian2.fromArray([-f[0]*n.width+g[0],-f[1]*n.height+g[1]]),n}else{n=n;const{textShow:u,textStyle:p={}}=r;n.show=u??n.show,p.anchor=p.anchor??this.sceneObject.textAnchor??a.ESGeoJson.defaults.textStyle.anchor,p.backgroundColor=p.backgroundColor??this.sceneObject.textBackgroundColor??a.ESGeoJson.defaults.textStyle.backgroundColor,p.color=p.color??this.sceneObject.textColor??a.ESGeoJson.defaults.textStyle.color,p.defaultText=p.defaultText??this.sceneObject.textDefaultText??a.ESGeoJson.defaults.textStyle.defaultText,p.fontFamily=p.fontFamily??this.sceneObject.textFontFamily??a.ESGeoJson.defaults.textStyle.fontFamily,p.fontSize=p.fontSize??this.sceneObject.textFontSize??a.ESGeoJson.defaults.textStyle.fontSize,p.fontStyle=p.fontStyle??this.sceneObject.textFontStyle??a.ESGeoJson.defaults.textStyle.fontStyle,p.fontWeight=p.fontWeight??this.sceneObject.textFontWeight??a.ESGeoJson.defaults.textStyle.fontWeight,p.offset=p.offset??this.sceneObject.textOffset??a.ESGeoJson.defaults.textStyle.offset,p.textProperty=p.textProperty??this.sceneObject.textProperty??a.ESGeoJson.defaults.textStyle.textProperty;const f=p.fontSize,g=p.offset,m=p.anchor;return n.fillColor=new d.Color(...p.color),n.showBackground=(p==null?void 0:p.backgroundColor)!=null,n.backgroundColor=new d.Color(...p.backgroundColor??[1,1,1,1]),n.font=`${p.fontStyle} ${p.fontWeight} ${f}px ${p.fontFamily}`,n.text=p.textProperty&&p.textProperty!==""&&e&&e[p.textProperty]?e[p.textProperty]:p.defaultText,n.pixelOffset=d.Cartesian2.fromArray([-m[0]*((n.showBackground?-14:0)+this._getTextPixelWidth(n.text,n.font))+g[0],-m[1]*((n.showBackground?10:0)+f)+g[1]]),n}}return n}_getFeatureByIndexOrProperties(e,n){var l,h,u,p,f,g,m,v;const{sceneObject:o}=this,s=o.features;if(!s)return;const r=Reflect.get(s,"features")||Reflect.get(s,"geometries");if(r){if(n){let w=r.find(C=>(C==null?void 0:C.properties[e])==n);return{type:w!=null&&w.coordinates?w.type:(l=w==null?void 0:w.geometry)==null?void 0:l.type,positions:(w==null?void 0:w.coordinates)||((h=w==null?void 0:w.geometry)==null?void 0:h.coordinates)}}else if(typeof e=="number")return{type:(u=r[e])!=null&&u.coordinates?r[e].type:(f=(p=r[e])==null?void 0:p.geometry)==null?void 0:f.type,positions:((g=r[e])==null?void 0:g.coordinates)||((v=(m=r[e])==null?void 0:m.geometry)==null?void 0:v.coordinates)}}}async _calculateFeatureHeight(e,n,o){const s=[...e];return n=="NONE"?s[2]=s[2]??0:n=="CLAMP_TO_GROUND"||!s[2]?s[2]=await o.getTerrainHeight(s)??0:s[2]+=await o.getTerrainHeight(s)??0,s}_getTextPixelWidth(e,n){if(!this._textMeasureCtx){const o=document.createElement("canvas");this._textMeasureCtx=o.getContext("2d")}return this._textMeasureCtx.font=n,this._textMeasureCtx.measureText(e).width}};y(hl,"type",hl.register("ESCesiumViewer",a.ESGeoJson.type,hl));let Bp=hl;const ul=class ul extends Pt{constructor(e,n){super(e,n);y(this,"_czmGeoESRectangle");y(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ee(n,e.id)),this._czmGeoESRectangle=this.disposeVar(new Di(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoESRectangle,r=this._geoPolyline;r.arcType="RHUMB",this.dispose(a.track([r,"color"],[e,"strokeColor"])),this.dispose(a.track([r,"width"],[e,"strokeWidth"])),this.dispose(a.track([r,"ground"],[e,"strokeGround"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{const l=()=>{r.show=e.show&&e.stroked,s.show=e.show&&e.filled};l();const h=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(h.disposableOn(l))}{const l=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material=void 0};l();const h=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(h.disposableOn(l))}{const l=()=>{const h=e.points;if(h&&h.length>=2){const{minPos:u,maxPos:p}=a.getMinMaxCorner(h);s.rectangle=[u[0],u[1],p[0],p[1]],s.height=h[0][2],s.extrudedHeight=h[0][2];const f=h.map(w=>(h&&(w[2]=h[0][2]),w)),g=f[0],m=f[1],v=[g,[g[0],m[1],g[2]],m,[m[0],g[1],m[2]]];r.positions=[...v,g]}else s.rectangle=void 0,r.positions=void 0,s.height=0,s.extrudedHeight=0};l(),this.dispose(e.pointsChanged.disposableOn(()=>l()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmGeoESRectangle:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}};y(ul,"type",ul.register("ESCesiumViewer",a.ESGeoRectangle.type,ul));let zp=ul;class ca extends a.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new a.Event));y(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new Fn(e,n));const{geoPolygon:o}=this;this.dispose(a.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(a.bind([o,"show"],[this,"show"])),this.dispose(a.bind([o,"fill"],[this,"filled"])),this.dispose(a.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(a.bind([o,"ground"],[this,"ground"])),this.dispose(a.bind([o,"outline"],[this,"outline"])),this.dispose(a.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(a.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(a.bind([o,"color"],[this,"color"])),this.dispose(a.bind([o,"depth"],[this,"depth"]));const s=()=>{if(this.positions&&this.positions.length>=2){const r=Ku([...this.positions,this.positions[0]]);o.positions=r}else o.positions=void 0};s(),this.dispose(this.positionsChanged.disposableOn(s))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:a.reactArray([1,1,1,1]),outlineWidth:1,color:a.reactArrayWithUndefined([1,1,1,.5]),positions:a.reactPositions(void 0),depth:0})})(ca||(ca={})),a.extendClassProps(ca.prototype,ca.createDefaultProps);const dl=class dl extends Pt{constructor(e,n){super(e,n);y(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new ca(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoSmoothPolygon;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"filled"],[e,"filled"])),this.dispose(a.track([s,"color"],[e,"fillColor"])),this.dispose(a.track([s,"ground"],[e,"ground"]));{const r=()=>{s.ground=e.ground||e.fillGround};r();const l=this.dv(a.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(l.don(r))}{const r=()=>{s.color=e.filled?e.fillColor:la.defaults.fillStyle.color};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}this.dispose(a.track([s,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};y(dl,"type",dl.register("ESCesiumViewer",la.type,dl));let Lp=dl;const pl=class pl extends ge{constructor(e,n){super(e,n);y(this,"_czmModel");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new dt(n,e.id));const s=this._czmModel;this.d(s.readyEvent.don(l=>{var h;s.activeAnimationsJson=(h=s.gltf.animations)==null?void 0:h.map((u,p)=>({index:p,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"})),e.czmModelReadyEvent.emit(l),e.readyEvent.emit(l)})),this.ad(new $c(o,this._czmModel)),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"color"],[e,"czmColor"])),this.d(a.track([s,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(a.track([s,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(a.bind([s,"position"],[e,"position"])),this.d(a.track([s,"nativeScale"],[e,"czmNativeScale"])),this.d(a.track([s,"scale"],[e,"scale"])),this.ad(a.track([s,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(a.track([s,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const l=h=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:h}:{atmosphereScatteringIntensity:h}};l(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(h=>l(h)))}{const l=()=>{var h,u;(h=e.czmEnvironmentMapManager)!=null&&h.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};l(),this.ad(e.czmEnvironmentMapManagerChanged.don(l))}{const l=()=>{const h=[...e.rotation??[0,0,0]];h[0]+=e.instances&&e.instances.length!=0?0:90,s.rotation=h};l(),this.d(e.rotationChanged.don(l));{const h=()=>{if(l(),!e.instances||e.instances.length==0){s.instances=void 0;return}s.instances=e.instances.map(u=>{const p=JSON.parse(JSON.stringify(u));return!p.rotation&&(p.rotation=[0,0,0]),p.rotation[0]+=90,p})};h(),this.ad(e.instancesChanged.don(h))}}this.ad(e.setMaterialEvent.don(l=>{s.setMaterial(l)}));{const l=()=>{const h=[...s.rotation];h[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=h};l(),this.d(s.rotationChanged.don(l))}{const l=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),h=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};h(),this.d(l.don(h))}const r=()=>{var l;s.url=a.ESSceneObject.context.getStrFromEnv(qc(typeof e.url=="string"?e.url:((l=e.url)==null?void 0:l.url)??a.ESGltfModel.defaults.url))};r(),this.d(e.urlChanged.don(r)),this.d(e.setNodePositionEvent.don((l,h)=>{s.setNodeTranslation(l,h)})),this.d(e.setNodeRotationEvent.don((l,h)=>{s.setNodeRotation(l,h)})),this.d(e.setNodeScaleEvent.don((l,h)=>{s.setNodeScale(l,h)})),this.d(e.printDebugInfoEvent.don(()=>{s.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,n){const{sceneObject:o,czmViewer:s,model:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&yt(s,o,n,e,r,!0),!!r):!1}};y(pl,"type",pl.register("ESCesiumViewer",a.ESGltfModel.type,pl));let Op=pl;function vy(t,i){const e=t[0]-i[0],n=t[1]-i[1],o=t[2]-i[2];return Math.sqrt(e*e+n*n+o*o)}class ha extends a.Destroyable{constructor(e,n){super();y(this,"_pickedEvent",this.disposeVar(new a.Event));y(this,"_flyToEvent",this.disposeVar(new a.Event));y(this,"_distance",this.disposeVar(a.react(0)));y(this,"_surfaceDistance",this.disposeVar(a.react(0)));y(this,"_height",this.disposeVar(a.react(0)));y(this,"_middlePosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));y(this,"_heightPosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));const o=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const r=this._surfaceDistance.value=a.geoDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="RHUMB"){const r=this._surfaceDistance.value=a.geoRhumbDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="NONE"){const r=a.lbhToXyz(this.positions[0]),l=a.lbhToXyz(this.positions[1]);this._distance.value=vy(r,l),this._surfaceDistance.value=vy(a.lbhToXyz(this._middlePosition.value),l),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(s.disposableOn(o));{const r=this.disposeVar(new Ee(e,n));r.ground=!1,r.loop=!1,this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([r,"arcType"],[this,"arcType"])),this.dispose(a.bind([r,"color"],[this,"color"])),this.dispose(a.bind([r,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([r,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([r,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([r,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([r,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([r,"show"],[this,"show"])),this.dispose(a.bind([r,"width"],[this,"width"])),this.dispose(a.bind([r,"depthTest"],[this,"depthTest"]));{r.loop=!0;const h=()=>{if(this.positions&&this.positions.length===2){const[u,p]=this.positions;r.positions=[u,p,[u[0],u[1],p[2]]]}else r.positions=void 0};h(),this.dispose(this.positionsChanged.disposableOn(h))}this.dispose(this.flyToEvent.disposableOn(h=>{e.actived&&r.flyTo(h)}));const l=this.disposeVar(new He(e,n));this.dispose(a.track([l,"shadowDom"],[this,"shadowDom"])),this.dispose(a.track([l,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(a.track([l,"show"],[this,"show"]));{const h=()=>{l.position=this.heightPosition};h(),this.dispose(this.heightPositionChanged.disposableOn(h))}{const h=()=>{l.innerHTML=Co(`高度: ${Xc(this.height)}`,0)};h(),this.dispose(this.heightChanged.disposableOn(h))}this.ad(l.pickedEvent.don(h=>{Yi(h)===0&&this.pickedEvent.emit(h)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(ha||(ha={})),a.extendClassProps(ha.prototype,ha.createDefaultProps);const fl=class fl extends Pt{constructor(e,n){super(e,n);y(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new ha(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:s}=this;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const p=e.strokeStyle;if(p.material==="hasDash"&&p.materialParams)try{const f=p.materialParams;Reflect.has(f,"gapColor")&&(s.gapColor=f.gapColor??[0,0,0,0]),Reflect.has(f,"dashLength")&&(s.dashLength=f.dashLength),Reflect.has(f,"dashPattern")&&(s.dashPattern=f.dashPattern)}catch(f){console.error(f)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{Yi(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};y(fl,"type",fl.register("ESCesiumViewer",a.ESHeightMeasurement.type,fl));let Np=fl;const Vp={czmAnimationsStand:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsWalk:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsRun:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},gl=class gl extends ge{constructor(e,n){super(e,n);y(this,"_czmModelPrimitive");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new dt(n,this.sceneObject.id));const s=this._czmModelPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(Je([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"scale"],[e,"scale"])),this.d(s.readyEvent.don(C=>{e.readyEvent.emit(C)}));{const C=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),x=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};x(),this.d(C.don(x))}const r=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),l=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),h=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),p=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),f=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),g=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/repairman.glb"),m=()=>{switch(e.mode){case"worker":s.url=r;break;case"police":s.url=l;break;case"pedestrian":s.url=h;break;case"stranger":s.url=u;break;case"suitMan":s.url=p;break;case"suitWoman":s.url=f;break;case"repairMan":s.url=g;break;default:s.url=r;break}};this.dispose(e.modeChanged.disposableOn(()=>{m()})),m();const v=()=>{const C=e.animation??a.ESHuman.defaults.animation;if(!e.show){s.activeAnimationsJson=void 0;return}C==="walking"?s.activeAnimationsJson=Vp.czmAnimationsWalk:C==="standing"?s.activeAnimationsJson=Vp.czmAnimationsStand:C==="running"&&(s.activeAnimationsJson=Vp.czmAnimationsRun)};v();const w=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(w.disposableOn(()=>v())),this.ad(new $c(o,s))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmModelPrimitive:r}=this;return!s.actived||!s.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&yt(s,o,n,e,r,!0),!!r)}};y(gl,"type",gl.register("ESCesiumViewer",a.ESHuman.type,gl));let Up=gl;class yy extends a.Destroyable{constructor(e,n){super();y(this,"_czmGeoCanvasImagePoi");y(this,"flyTo",(e,n)=>{if(this.czmGeoCanvasImagePoi.position){ne(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,ii,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new Ei(n));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(s=>{(e.allowPicking??!1)&&e.pickedEvent.emit(s)}));{const s=p=>{let f=p;return p.includes("inner://")&&(f="${earthsdk3-assets-script-dir}/assets/img/points/"+p.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(qc(f))},r=()=>{const p=s(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=p,e.sizeByContent){const g=new Image;g.src=p,g.onload=()=>{o.size=[g.width,g.height]}}else{const g=e.size;o.size=[...g]}},l=this.disposeVar(a.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(l.disposableOn(()=>r())),r(),this.d(a.track([o,"zOrder"],[e,"zOrder"])),this.dispose(a.track([o,"show"],[e,"show"])),this.dispose(a.bind([o,"position"],[e,"position"])),this.ad(a.bind([o,"isHoverZoom"],[e,"isHoverZoom"])),this.ad(a.bind([o,"hoverHighlight"],[e,"hoverHighlight"]));{const p=()=>{o.scale=[e.scale[1],e.scale[2]]};p(),this.dispose(e.scaleChanged.don(p))}const h=()=>{const p=e.anchor,f=e.offset;p?o.originRatioAndOffset=[...p,-f[0],-f[1]]:o.originRatioAndOffset=[0,0,0,0]},u=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>h())),h(),this.dispose(o.clickEvent.disposableOn(p=>{const{offsetX:f,offsetY:g}=p,v={type:p.button===0?"leftClick":p.button===2?"rightClick":void 0,add:{mousePos:[f,g]}};e.widgetEvent.emit(v)})),this.dispose(o.hoveredChanged.disposableOn(p=>{if(p===void 0)return;const f={type:p?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(f)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class wy extends a.Destroyable{constructor(e,n,o){super();y(this,"_czmGeoImageModel");y(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});y(this,"_isPointEvent",!1);y(this,"flyTo",(e,n)=>{if(this.czmGeoImageModel.position)return Yt(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new ki(n,e.id));const s=this._czmGeoImageModel;this.ad(n.clickEvent.don(g=>{const m=g==null?void 0:g.pointerEvent;m&&(this._isPointEvent=!0,this._eventInfo={type:m.button==0?"leftClick":m.button==2?"rightClick":"leftClick",add:{mousePos:[m.offsetX,m.offsetY]}})})),this.d(e.pickedEvent.don(g=>{var m,v,w;g.screenPosition&&this._isPointEvent&&g.attachedInfo!="innerHoverEvent"&&((m=this._eventInfo.add)!=null&&m.mousePos)&&Math.abs(g.screenPosition[0]-((v=this._eventInfo.add)==null?void 0:v.mousePos[0]))<1&&Math.abs(g.screenPosition[1]-((w=this._eventInfo.add)==null?void 0:w.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.engineObjectCreatedUpdate(this,e,()=>{const g=n.getEngineObject(e);this.ad(g.lastHoverResultChanged.don((m,v)=>{(m==null?void 0:m.sceneObject)==(v==null?void 0:v.sceneObject)||(m==null?void 0:m.sceneObject)!=e&&(v==null?void 0:v.sceneObject)!=e||(m!=null&&m.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:m==null?void 0:m.screenPosition}},m.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&m.sceneObject.id==e.id&&(s.scale=[s.scale[0]*1.5,s.scale[1]*1.5])),v!=null&&v.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:m==null?void 0:m.screenPosition}},v.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&v.sceneObject.id==e.id&&(s.scale=[s.scale[0]/1.5,s.scale[1]/1.5])))}))});const r=e.sizeByContent,h=(g=>{let m=g;return g.includes("inner://")&&(m="${earthsdk3-assets-script-dir}/assets/img/points/"+g.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(qc(m))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),u=new Image;u.src=h,u.onload=()=>{if(r)s.size=[u.width/100,u.height/100];else{const g=e.size;s.size=[g[0]/100,g[1]/100]}},s.uri=h,this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),s.pixelSize=void 0,s.useAxis="XZ";{const g=()=>{s.scale=[e.scale[1],e.scale[2]]};g(),this.d(e.scaleChanged.don(g))}{const g=()=>{e.rotationType===0&&(s.rotationMode="WithProp",this.d(Je([s,"rotation"],[e,"rotation"]))),e.rotationType===1&&(s.rotationMode="WithCamera"),e.rotationType===2&&(s.rotationMode="WithCameraOnlyZ")};g(),this.dispose(e.rotationTypeChanged.disposableOn(g))}const p=()=>{const g=e.anchor,m=e.offset;g?s.originRatioAndOffset=[...g,-m[0]/100,-m[1]/100]:s.originRatioAndOffset=[0,0,0,0]},f=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(f.disposableOn(()=>p())),p()}get czmGeoImageModel(){return this._czmGeoImageModel}}const ml=class ml extends oa{constructor(e,n){super(e,n);y(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.disposeVar(a.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new a.ObjResettingWithEvent(s,()=>this.sceneObject.screenRender?new yy(this.sceneObject,this.czmViewer):new wy(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:o,czmViewer:s,resetting:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r&&r.obj&&r.obj.flyTo(e,n),o.flyOverEvent.emit(n,"over",s),!0):!1}};y(ml,"type",ml.register("ESCesiumViewer",a.ESImageLabel.type,ml));let Wp=ml;function MT(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const vl=class vl extends qt{constructor(e,n){super(e,n);y(this,"_czmImagery");if(this._czmImagery=this.dv(new $n(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;{const r=this.ad(a.reactJson(""));{const u=()=>{if(typeof e.url=="string")r.value=a.ESSceneObject.context.getStrFromEnv(e.url);else{const p=e.url;p.url=a.ESSceneObject.context.getStrFromEnv(p.url),r.value=p}};u(),this.ad(e.urlChanged.don(u))}const l=()=>{var v;if(!r.value)return;const u=(((v=e.options)==null?void 0:v.type)??"auto").toLowerCase(),p=e.options??{};let f={type:"UrlTemplateImageryProvider",url:r.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...p},g=r.value,m=typeof g=="string"?g:g.url;if(u==="auto"){const w=m.toLowerCase();if(w.startsWith("ion://")){const x=+w.substring(6);f={...p,assetId:x,type:"IonImageryProvider"}}else if(w.includes("{x}")||w.includes("{y}")||w.includes("{z}"))f.type="UrlTemplateImageryProvider";else if(w.includes("wmts"))f.type="WebMapTileServiceImageryProvider";else if(w.includes("wms"))f.type="WebMapServiceImageryProvider";else{if(m.includes("/tilemapresource.xml")){const C=m.split("/tilemapresource.xml").join("");typeof g=="string"?g=C:g.url=C,f.url=g}f.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&m.includes("/tilemapresource.xml")){const w=m.split("/tilemapresource.xml").join("");typeof g=="string"?g=w:g.url=w,f.url=g}else if(u==="ion"&&m.startsWith("ion://")){const C=+m.substring(6);f={...p,assetId:C,type:"IonImageryProvider"}}f.type=MT(u)}console.log("imageryProvider",f),s.imageryProvider=f};l();const h=this.dv(a.createNextAnimateFrameEvent(r.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(h.don(l))}this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"alpha"],[e,"opacity"])),this.d(a.bind([s,"alpha"],[e,"czmAlpha"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.ad(a.track([s,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};y(vl,"type",vl.register("ESCesiumViewer",a.ESImageryLayer.type,vl));let Gp=vl;class IT extends a.Destroyable{constructor(e,n,o,s){super();y(this,"_show");y(this,"_czmESCustomPrimitive");y(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(a.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new Se(n,this._sceneObject.id)),this._czmTexture=this.dv(new Oe(n));const r=e,l=this._czmESCustomPrimitive,h=this._czmTexture;this.dispose(a.track([l,"show"],[this,"show"])),this.dispose(a.track([l,"show"],[r,"show"])),this.dispose(a.track([l,"allowPicking"],[r,"allowPicking"])),this.dispose(a.track([l,"rotation"],[r,"rotation"])),this.dispose(a.track([l,"position"],[r,"position"])),this.dispose(a.track([l,"scale"],[r,"scale"])),this.ad(r.allowPickingChanged.don(()=>{l.allowPicking=r.allowPicking,l.pass=r.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const f=r.size/2,g=s[0].map(z=>z*f),m=s[1].map(z=>z*f),v=s[2].map(z=>z*f),w=s[3].map(z=>z*f),C=[...g,...m,...v,...w];let x=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(x=x.reverse());const _=[0,0],P=[1,0],E=[1,1],A=[0,1];let M=[];o=="east"||o=="south"?M=[...P,..._,...A,...E]:o=="west"?M=[...P,...E,...A,..._]:o=="top"?M=[...A,...E,...P,..._]:M=[..._,...P,...E,...A],l.indexTypedArray=new Uint16Array(x),l.attributes={position:{typedArray:new Float32Array(C),componentsPerAttribute:3},st:{typedArray:new Float32Array(M),componentsPerAttribute:2}},h.uri=a.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/${o}.${r.mode!="blueSky"?"png":"jpg"}`);const B=n.getCameraInfo();if(B!=null){const L=a.getDistancesFromPositions([r.position,B.position],"NONE")[0]/(r.size/2*r.autoOpacityFactor);this.changeOpacity(r.autoFollow?1:L)}const O=l.computeLocalAxisedBoundingBoxFromAttribute("position");if(!O)return;const{min:W,max:V}=O;l.setLocalAxisedBoundingBox(W,V)};u();const p=this.disposeVar(a.createNextAnimateFrameEvent(r.sizeChanged,r.modeChanged));this.dispose(p.disposableOn(u))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class RT extends a.Destroyable{constructor(i,e,n){if(super(),!e.viewer)return;let o=!0,s;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{r()}));function r(){var h;if(!((h=e.viewer)!=null&&h.camera))return;const l=e.getCameraInfo();if(l!=null&&(s==null||s.position[0]!=l.position[0]||s.position[1]!=l.position[1]||s.position[2]!=l.position[2]||s.rotation[0]!=l.rotation[0]||s.rotation[1]!=l.rotation[1]||s.rotation[2]!=l.rotation[2])){s=l;const p=a.getDistancesFromPositions([i.position,s.position],"NONE")[0]/(i.size/2*i.autoOpacityFactor);i.autoFollow?(i.position=s.position,o&&(o=!1,n.forEach(f=>{f.changeOpacity(1)}))):n.forEach(f=>{f.changeOpacity(p)})}}r()}}const ke=class ke extends ge{constructor(e,n){super(e,n);y(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!ke._defaultLocalBox&&ke._firstLoad&&(ke._firstLoad=!1,ke._defaultLocalBox=n.xbsjLocalBoxSources),ke._eSLocalSkyBoxArr.push(e),this.d(()=>{ke._eSLocalSkyBoxArr.includes(e)&&ke._eSLocalSkyBoxArr.splice(ke._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const s={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const r in s)if(Object.prototype.hasOwnProperty.call(s,r)){const l=s[r];this._czmSkyBoxComponents.push(this.dv(new IT(e,n,r,l)))}{const r=this.disposeVar(a.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new a.ObjResettingWithEvent(r,()=>(this.ChangeAutoFollow(),new RT(e,n,this._czmSkyBoxComponents))))}{const r=()=>{this.ChangeAutoFollow()},l=this.disposeVar(a.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(l.disposableOn(r))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let n=ke._eSLocalSkyBoxArr.length-1;n>=0;n--){const o=ke._eSLocalSkyBoxArr[n];if(o.autoFollow&&o.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/east.${o.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/west.${o.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/bottom.${o.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/top.${o.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/north.${o.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/south.${o.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(e.xbsjLocalBoxSources=ke._defaultLocalBox)}ke._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=ke._defaultLocalBox)}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const r=o.size??a.ESLocalSkyBox.defaults.size;return o.position?(Yt(s,o,n,o.position,r,e,!0),!0):!1}}};y(ke,"type",ke.register("ESCesiumViewer",a.ESLocalSkyBox.type,ke)),y(ke,"_defaultLocalBox"),y(ke,"_firstLoad",!0),y(ke,"_eSLocalSkyBoxArr",[]);let Hp=ke;const ui=class ui extends ge{constructor(e,n){super(e,n);y(this,"_geoCustomDivPoi");y(this,"_textFunc",this.disposeVar(a.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new He(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this.geoCustomDivPoi;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{this.dispose(s.pickedEvent.disposableOn(r=>{(e.allowPicking??a.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(r)})),this.dispose(s.innerHtmlMounted.disposableOn(r=>{const l=r.firstElementChild;l&&(l.style.pointerEvents="auto",l.style.cursor="default",l.onclick=h=>s.pickFromDiv(l,{type:"viewerPicking",pointerEvent:h}))}));{const r=()=>{if(!e.position)return;const h=(this.textFunc??ui.defaultTextFunc_度格式)(e.position);s.innerHTML=Co(h)};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(l.disposableOn(r))}{const r=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?ui.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?ui.defaultTextFunc_度分格式:ui.defaultTextFunc_度分秒格式};r(),this.d(n.lonLatFormatChanged.don(()=>{r()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};y(ui,"type",ui.register("ESCesiumViewer",a.ESLocationMeasurement.type,ui)),y(ui,"defaultTextFunc_度格式",e=>{if(!e)return"";const[n=0,o=0,s=0]=e;return`经度: ${n.toFixed(5)}°
1255
1255
  纬度: ${o.toFixed(5)}°
1256
1256
  高度: ${s.toFixed(2)}m`}),y(ui,"defaultTextFunc_度分格式",e=>{if(!e)return"";const[n,o,s]=Qu(e,!0);return`经度: ${n}
1257
1257
  纬度: ${o}
@@ -3703,10 +3703,10 @@ async function initCesiumViewer(container, czmViewer) {
3703
3703
  `;function A5(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
3704
3704
  github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
3705
3705
  gitee地址:${t}
3706
- `;console.log(e);const n=globalThis.prompt(e,t);n&&globalThis.open(n,"_blank")}const ut=class ut extends a.ESViewer{constructor(e){super(e);y(this,"_disabledInputStack",this.disposeVar(a.react(0)));y(this,"_viewer",this.dv(a.react(void 0)));y(this,"_viewerInstance");y(this,"_viewerLegend");y(this,"pickCustomAttachedInfo");y(this,"_fps",this.dv(a.react(0)));y(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));y(this,"_editingSystem",hu);y(this,"_moveObjectsProcess",this.ad(sx()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new mB(this)),this.ad(new vB(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new xB(this)})),this._viewerLegend=this.dv(new x5(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new dm(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new Hz(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Qe(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){var r;const{viewer:n}=this;if(!n)return;const o=d.Cartographic.fromDegrees(e[0],e[1],e[2],ut.getHeightsScartchCarto),s=n.scene.globe.terrainProvider;return s instanceof d.EllipsoidTerrainProvider?n.scene.globe.getHeight(o):(r=(await d.sampleTerrainMostDetailed(s,[o]))[0])==null?void 0:r.height}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Xt(e),rotation:cs(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=d.Cartesian3.fromDegrees(...e),s=d.Transforms.eastNorthUpToFixedFrame(o),r=d.Matrix4.inverse(s,new d.Matrix4),l=d.Matrix4.multiplyByPoint(r,n.positionWC,new d.Cartesian3),h=d.Cartesian3.magnitude(l);let u=-Math.asin(l.z/h);u=d.Math.toDegrees(u);let p=d.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(p+=l.y<0?-d.Math.PI:d.Math.PI),p=d.Math.toDegrees(p);const f=cs(n),g=f[0]-p,m=f[1]-u;return{distance:h,heading:p,pitch:u,flyDuration:1,hDelta:g,pDelta:m}}flyIn(e,n,o,s="default"){var h;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(h=this.viewer)==null?void 0:h.camera;return l&&Ur(l,r,s)}flyTo(e,n,o="default"){var m;const{distance:s,heading:r,pitch:l,flyDuration:h,hDelta:u,pDelta:p}=e,f={position:n,viewDistance:s,rotation:[r,l,0],duration:h*1e3,hdelta:u,pdelta:p},g=(m=this.viewer)==null?void 0:m.camera;return g&&Ur(g,f,o)}flyToBoundingSphere(e,n,o=1){var f;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:h}=r,u={position:l,viewDistance:n??h,rotation:[0,-90,0],duration:o*1e3},p=(f=this.viewer)==null?void 0:f.camera;return p&&Ur(p,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Xt(e),rotation:cs(e)}}transformFlyParam(e,n){if("position"in n){const o=d.Cartesian3.fromDegrees(...e),s=d.Transforms.eastNorthUpToFixedFrame(o),r=d.Matrix4.inverse(s,new d.Matrix4),l=d.Matrix4.multiplyByPoint(r,xe(n.position),new d.Cartesian3),h=d.Cartesian3.magnitude(l);let u=-Math.asin(l.z/h);u=d.Math.toDegrees(u);let p=d.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(p+=l.y<0?-d.Math.PI:d.Math.PI),p=d.Math.toDegrees(p);const f=n.rotation[0]-p,g=n.rotation[1]-u;return{distance:h,heading:p,pitch:u,flyDuration:n.flyDuration??1,hDelta:f,pDelta:g}}else{const o=xe(e);let s={heading:d.Math.toRadians(n.heading),pitch:d.Math.toRadians(n.pitch),roll:0};const r=new d.HeadingPitchRoll;if(n.distance){r.heading=s.heading,r.pitch=s.pitch,r.roll=0,r.heading-=d.Math.PI_OVER_TWO;const h=d.Transforms.headingPitchRollToFixedFrame(o,r,void 0,void 0),u=d.Matrix4.multiplyByPointAsVector(h,d.Cartesian3.UNIT_X,new d.Cartesian3);d.Cartesian3.multiplyByScalar(u,n.distance,u),d.Cartesian3.subtract(o,u,o)}n.hDelta&&(s.heading+=d.Math.toRadians(n.hDelta)),n.pDelta&&(s.pitch+=d.Math.toRadians(n.pDelta));const l=re(o);return l?{position:l,rotation:[d.Math.toDegrees(s.heading),d.Math.toDegrees(s.pitch),d.Math.toDegrees(s.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var h,u;(u=(h=this._viewerInstance)==null?void 0:h.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,h;(h=(l=this._viewerInstance)==null?void 0:l.obj)==null||h.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,h;(h=(l=this._viewerInstance)==null?void 0:l.obj)==null||h.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=globalThis.g_XE3CopyRights??{};return e.cesium={version:d.VERSION},e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=d.Cartographic.fromDegrees(e,n,void 0,ut.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await t0(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(xe(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=ut.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!ut.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=ut.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Tt(e,n)}localPositionsToPositions(e,n){return An(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof d.Cartesian3?e:xe(e),o=new d.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=ut.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",E5,S5,!0),new a.FunctionProperty([],()=>ut.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};y(ut,"type",ut.register("ESCesiumViewer",ut)),y(ut,"getCesiumIonToken",A5),y(ut,"currentDefaultAccessToken",d.Ion.defaultAccessToken),y(ut,"latestDefaultAccessToken"),y(ut,"ObjectsToExcludeWrapper",CB),y(ut,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:d.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),y(ut,"getHeightsScartchCarto",new d.Cartographic);let Ie=ut;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...b5()})})(Ie||(Ie={})),a.extendClassProps(Ie.prototype,Ie.createDefaultProps),D.copyright=void 0;try{const t="earthsdk3-cesium",i="3.7.0",e="2026-01-30T07:34:05.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="e4bcbcd9777e3de84a145e74a2222c7441d43b0b",l=((Date.now()-1769758445e3)/36e5).toFixed(1),h=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
3706
+ `;console.log(e);const n=globalThis.prompt(e,t);n&&globalThis.open(n,"_blank")}const ut=class ut extends a.ESViewer{constructor(e){super(e);y(this,"_disabledInputStack",this.disposeVar(a.react(0)));y(this,"_viewer",this.dv(a.react(void 0)));y(this,"_viewerInstance");y(this,"_viewerLegend");y(this,"pickCustomAttachedInfo");y(this,"_fps",this.dv(a.react(0)));y(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));y(this,"_editingSystem",hu);y(this,"_moveObjectsProcess",this.ad(sx()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new mB(this)),this.ad(new vB(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new xB(this)})),this._viewerLegend=this.dv(new x5(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new dm(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new Hz(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Qe(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){var r;const{viewer:n}=this;if(!n)return;const o=d.Cartographic.fromDegrees(e[0],e[1],e[2],ut.getHeightsScartchCarto),s=n.scene.globe.terrainProvider;return s instanceof d.EllipsoidTerrainProvider?n.scene.globe.getHeight(o):(r=(await d.sampleTerrainMostDetailed(s,[o]))[0])==null?void 0:r.height}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Xt(e),rotation:cs(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=d.Cartesian3.fromDegrees(...e),s=d.Transforms.eastNorthUpToFixedFrame(o),r=d.Matrix4.inverse(s,new d.Matrix4),l=d.Matrix4.multiplyByPoint(r,n.positionWC,new d.Cartesian3),h=d.Cartesian3.magnitude(l);let u=-Math.asin(l.z/h);u=d.Math.toDegrees(u);let p=d.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(p+=l.y<0?-d.Math.PI:d.Math.PI),p=d.Math.toDegrees(p);const f=cs(n),g=f[0]-p,m=f[1]-u;return{distance:h,heading:p,pitch:u,flyDuration:1,hDelta:g,pDelta:m}}flyIn(e,n,o,s="default"){var h;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(h=this.viewer)==null?void 0:h.camera;return l&&Ur(l,r,s)}flyTo(e,n,o="default"){var m;const{distance:s,heading:r,pitch:l,flyDuration:h,hDelta:u,pDelta:p}=e,f={position:n,viewDistance:s,rotation:[r,l,0],duration:h*1e3,hdelta:u,pdelta:p},g=(m=this.viewer)==null?void 0:m.camera;return g&&Ur(g,f,o)}flyToBoundingSphere(e,n,o=1){var f;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:h}=r,u={position:l,viewDistance:n??h,rotation:[0,-90,0],duration:o*1e3},p=(f=this.viewer)==null?void 0:f.camera;return p&&Ur(p,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Xt(e),rotation:cs(e)}}transformFlyParam(e,n){if("position"in n){const o=d.Cartesian3.fromDegrees(...e),s=d.Transforms.eastNorthUpToFixedFrame(o),r=d.Matrix4.inverse(s,new d.Matrix4),l=d.Matrix4.multiplyByPoint(r,xe(n.position),new d.Cartesian3),h=d.Cartesian3.magnitude(l);let u=-Math.asin(l.z/h);u=d.Math.toDegrees(u);let p=d.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(p+=l.y<0?-d.Math.PI:d.Math.PI),p=d.Math.toDegrees(p);const f=n.rotation[0]-p,g=n.rotation[1]-u;return{distance:h,heading:p,pitch:u,flyDuration:n.flyDuration??1,hDelta:f,pDelta:g}}else{const o=xe(e);let s={heading:d.Math.toRadians(n.heading),pitch:d.Math.toRadians(n.pitch),roll:0};const r=new d.HeadingPitchRoll;if(n.distance){r.heading=s.heading,r.pitch=s.pitch,r.roll=0,r.heading-=d.Math.PI_OVER_TWO;const h=d.Transforms.headingPitchRollToFixedFrame(o,r,void 0,void 0),u=d.Matrix4.multiplyByPointAsVector(h,d.Cartesian3.UNIT_X,new d.Cartesian3);d.Cartesian3.multiplyByScalar(u,n.distance,u),d.Cartesian3.subtract(o,u,o)}n.hDelta&&(s.heading+=d.Math.toRadians(n.hDelta)),n.pDelta&&(s.pitch+=d.Math.toRadians(n.pDelta));const l=re(o);return l?{position:l,rotation:[d.Math.toDegrees(s.heading),d.Math.toDegrees(s.pitch),d.Math.toDegrees(s.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var h,u;(u=(h=this._viewerInstance)==null?void 0:h.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,h;(h=(l=this._viewerInstance)==null?void 0:l.obj)==null||h.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,h;(h=(l=this._viewerInstance)==null?void 0:l.obj)==null||h.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=globalThis.g_XE3CopyRights??{};return e.cesium={version:d.VERSION},e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=d.Cartographic.fromDegrees(e,n,void 0,ut.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await t0(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(xe(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=ut.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!ut.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=ut.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Tt(e,n)}localPositionsToPositions(e,n){return An(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof d.Cartesian3?e:xe(e),o=new d.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=ut.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",E5,S5,!0),new a.FunctionProperty([],()=>ut.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};y(ut,"type",ut.register("ESCesiumViewer",ut)),y(ut,"getCesiumIonToken",A5),y(ut,"currentDefaultAccessToken",d.Ion.defaultAccessToken),y(ut,"latestDefaultAccessToken"),y(ut,"ObjectsToExcludeWrapper",CB),y(ut,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:d.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),y(ut,"getHeightsScartchCarto",new d.Cartographic);let Ie=ut;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...b5()})})(Ie||(Ie={})),a.extendClassProps(Ie.prototype,Ie.createDefaultProps),D.copyright=void 0;try{const t="earthsdk3-cesium",i="3.7.1",e="2026-02-02T01:37:27.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="c5260443b67d109c10ea6436337c86544eef1450",l=((Date.now()-1769996247e3)/36e5).toFixed(1),h=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
3707
3707
  %c${o?o+`
3708
3708
  `:""}当前网站正在使用${t},此软件版权归${n}所有
3709
- `;D.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","e4bcbcd9777e3de84a145e74a2222c7441d43b0b")},get info(){return h},get date(){return"2026-01-30T07:34:05.000Z"},get author(){return"suplyang"},get version(){return"3.7.0"},get name(){return"earthsdk3-cesium"},get commitId(){return"e4bcbcd9777e3de84a145e74a2222c7441d43b0b"},print(){console.info(this.info,`
3709
+ `;D.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","c5260443b67d109c10ea6436337c86544eef1450")},get info(){return h},get date(){return"2026-02-02T01:37:27.000Z"},get author(){return"suplyang"},get version(){return"3.7.1"},get name(){return"earthsdk3-cesium"},get commitId(){return"c5260443b67d109c10ea6436337c86544eef1450"},print(){console.info(this.info,`
3710
3710
  font-size: 18px;
3711
3711
  font-weight: 1000;
3712
3712
  line-height: 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "earthsdk3-cesium",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "description": "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",
5
5
  "type": "module",
6
6
  "main": "./dist/earthsdk3-cesium.umd.cjs",