earthsdk3-cesium 3.6.0-beta.119 → 3.6.0-beta.120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/earthsdk3-cesium.iife.js +9 -9
- package/dist/earthsdk3-cesium.js +55 -46
- package/dist/earthsdk3-cesium.umd.cjs +5 -5
- package/dist/types/CzmObjects/general/CzmESMVTLayer/VectorTilesManager/VectorTilesCache.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenLayer.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenObject.d.ts +3 -0
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenObject.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2591,7 +2591,7 @@ ${Rx}
|
|
|
2591
2591
|
// out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, (a + .1)*4.);
|
|
2592
2592
|
out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, a);
|
|
2593
2593
|
}
|
|
2594
|
-
`,r.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let s=this.disposeVar(c.react(void 0));{const l=this.disposeVar(c.createProcessingFromAsyncFunc(async A=>{s.value=void 0;const h=e.url??c.ESDataMesh.defaults.url;if(!h)return;await A.promise(c.sleep(200));const f=(e.maxTime??23)|0;s.value=await A.promise(rO(c.ESSceneObject.context.getStrFromEnv(typeof h=="string"?h:h.url),f+1))}));l.start();const u=this.disposeVar(c.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(u.disposableOn(()=>l.restart()))}{class l{constructor(h){this._buffer=h}[Symbol.iterator](){return oO(this._buffer)}}const u=()=>{if(!s.value)return;const{vertexBuffer:A,propBuffers:h,indexBuffer:f}=s.value,{minPos:p,maxPos:d}=c.getMinMaxCorner(new l(A));r.setLocalAxisedBoundingBox(p,d);const m=(e.maxTime??23)|0;let v=(e.currentTime??c.ESDataMesh.defaults.currentTime)/m;v=v<0?0:v>1?1:v;const y=v*m;let g=v*m|0,_=y-g;if(g>=m&&(g=m-1,_=1),!Number.isFinite(_)){console.error("!Number.isFinite(rr)");debugger;return}if(r.indexTypedArray=f,!h[g]||!h[g+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}r.attributes={a_position:{typedArray:A,componentsPerAttribute:3},a_prop:{typedArray:h[g],componentsPerAttribute:3},a_prop2:{typedArray:h[g+1],componentsPerAttribute:3}},r.uniformMap={u_gradientMap:{type:"texture",id:`${a.id}`},u_stripMinMaxValue:[e.minPropValue??c.ESDataMesh.defaults.minPropValue,e.maxPropValue??c.ESDataMesh.defaults.maxPropValue],u_ratio:_}};u(),this.dispose(e.maxTimeChanged.disposableOn(u)),this.dispose(e.currentTimeChanged.disposableOn(u)),this.dispose(e.minPropValueChanged.disposableOn(u)),this.dispose(e.maxPropValueChanged.disposableOn(u)),this.dispose(s.changed.disposableOn(u))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(bn(r,o,i,e,a,!0),!0):!1}};L(qu,"type",qu.register("ESCesiumViewer",c.ESDataMesh.type,qu));let ig=qu;const us=class us extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_heading",this.disposeVar(c.react(0)));L(this,"_textFunc",this.disposeVar(c.react(void 0)));const o=this;{const s=()=>{if(this.positions&&this.positions.length>=2){let u=0;this.arcType===void 0||this.arcType==="GEODESIC"?u=c.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?u=c.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?u=c.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?c.clampN180_180(u):c.clamp0_360(u)}};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(l.disposableOn(s))}const r=this.disposeVar(new Ye(e,i));r.loop=!1,this.dispose(c.track([r,"allowPicking"],[o,"allowPicking"])),this.dispose(c.bind([r,"arcType"],[o,"arcType"])),this.dispose(c.bind([r,"color"],[o,"color"])),this.dispose(c.bind([r,"dashLength"],[o,"dashLength"])),this.dispose(c.bind([r,"dashPattern"],[o,"dashPattern"])),this.dispose(c.bind([r,"gapColor"],[o,"gapColor"])),this.dispose(c.bind([r,"hasArrow"],[o,"hasArrow"])),this.dispose(c.bind([r,"hasDash"],[o,"hasDash"])),this.dispose(c.bind([r,"positions"],[o,"positions"])),this.dispose(c.bind([r,"show"],[o,"show"])),this.dispose(c.bind([r,"width"],[o,"width"])),this.dispose(c.bind([r,"depthTest"],[o,"depthTest"])),this.dispose(c.bind([r,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(s=>{e.actived&&r.flyTo(s)}));const a=this.disposeVar(new bt(e,i));this.dispose(c.bind([a,"shadowDom"],[o,"shadowDom"])),this.dispose(c.bind([a,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(c.bind([a,"show"],[o,"show"]));{const s=()=>{o.positions&&o.positions.length>=2?a.position=o.positions[1]:a.position=void 0};s(),this.dispose(o.positionsChanged.disposableOn(s))}{const s=()=>{const{heading:u}=o,A=(o.textFunc??us.defaultTextFunc_度格式)(u);a.innerHTML=_o(`方向: ${A}`,24)};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(l.disposableOn(s))}this.ad(a.pickedEvent.don(s=>{Gi(s)===0&&this.pickedEvent.emit(s)}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get heading(){return this._heading.value}get headingChanged(){return this._heading.changed}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}};L(us,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),L(us,"defaultTextFunc_度分格式",e=>`${rl(e,!0)}`),L(us,"defaultTextFunc_度分秒格式",e=>`${rl(e,!1)}`),L(us,"defaults",{positions:[]});let qo=us;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),width:8,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(qo||(qo={})),c.extendClassProps(qo.prototype,qo.createDefaultProps);const Ku=class Ku extends sn{constructor(e,i){super(e,i);L(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new qo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmDirectionMeasurement;r.angleMode="0~360",this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):u==="normal"?(r.hasDash=!1,r.hasArrow=!1):(r.hasDash=!1,r.hasArrow=!0);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Ku,"type",Ku.register("ESCesiumViewer",c.ESDirectionMeasurement.type,Ku));let rg=Ku;class fa extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_distances",this.disposeVar(c.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await R0(e.viewer,this.positions??[]):this._distances.value=c.getDistancesFromPositions(this.positions??[],this.arcType)};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(r.disposableOn(o));const a=this.disposeVar(new Ye(e,i));a.loop=!1,this.dispose(c.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([a,"arcType"],[this,"arcType"])),this.dispose(c.bind([a,"color"],[this,"color"])),this.dispose(c.bind([a,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([a,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([a,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([a,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([a,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([a,"positions"],[this,"positions"])),this.dispose(c.bind([a,"show"],[this,"show"])),this.dispose(c.bind([a,"width"],[this,"width"])),this.dispose(c.bind([a,"depthTest"],[this,"depthTest"])),this.dispose(c.bind([a,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(s=>{e.actived&&a.flyTo(s)}));{const s=[],l=()=>{for(let A of s)A.destroy();s.length=0};this.dispose(l);const u=()=>{if(l(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const h=Dd("起点",this.positions[0],e,i);h.dispose(c.track([h,"show"],[this,"show"])),h.dispose(c.track([h,"shadowDom"],[this,"shadowDom"])),h.dispose(c.track([h,"cssAllInitial"],[this,"cssAllInitial"])),s.push(h)}const A=this.distances.length;for(let h=0;h<A;++h){const f=this.distances[h],p=this.positions[h+1],d=Dd(`长度: ${Mh(f)}`,p,e,i);d.dispose(c.track([d,"show"],[this,"show"])),d.dispose(c.track([d,"shadowDom"],[this,"shadowDom"])),d.dispose(c.track([d,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(d.pickedEvent.don(m=>{Gi(m)===0&&this.pickedEvent.emit(m)})),s.push(d)}};u(),this.dispose(this.distancesChanged.disposableOn(()=>c.inOrderRunning(u)))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distances(){return this._distances.value}get distancesChanged(){return this._distances.changed}}L(fa,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),width:1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(fa||(fa={})),c.extendClassProps(fa.prototype,fa.createDefaultProps);const Zu=class Zu extends sn{constructor(e,i){super(e,i);L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ye(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoPolyline;this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"color"],[e,"strokeColor"])),this.dispose(c.track([r,"ground"],[e,"strokeGround"]));{const a=()=>{r.show=e.show&&e.stroked};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}}get geoPolyline(){return this._geoPolyline}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:a}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Zu,"type",Zu.register("ESCesiumViewer",c.ESGeoLineString.type,Zu));let da=Zu;const $u=class $u extends da{constructor(e,i){super(e,i);L(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new fa(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:r}=this;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L($u,"type",$u.register("ESCesiumViewer",c.ESDistanceMeasurement.type,$u));let og=$u;class pa extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this.id=i)}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,allowPicking:!1,positions:c.reactPositions(void 0),reverse:!1,edgeColor:c.reactArray([1,1,1,1]),edgeWidth:2})})(pa||(pa={})),c.extendClassProps(pa.prototype,pa.createDefaultProps);class sO extends c.Destroyable{constructor(n,e){super(),this._czmESExcavate=n,this._eS3DTileset=e;for(let i=0;i<this._eS3DTileset.excavateId.length;i++){const o=this._eS3DTileset.excavateId[i];c.ESSceneObject.getSceneObjById(o)||this._eS3DTileset.excavateId.splice(i,1)}this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId.filter(i=>i!==this._czmESExcavate.czmPolygonClipping.id)]})}}class aO extends c.Destroyable{constructor(n){if(super(),this._czmESExcavate=n,!!this._czmESExcavate.viewer){for(let e=0;e<this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.length;e++){const i=this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId[e];c.ESSceneObject.getSceneObjById(i)||this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.splice(e,1)}this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._czmESExcavate.viewer&&(this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.filter(e=>e!==this._czmESExcavate.czmPolygonClipping.id)])})}}}const Xu=class Xu extends Ln{constructor(e,i){super(e,i);L(this,"_czmPolygonClipping");L(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new pa(i,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new c.ESSceneObjectWithId);const o=this.ad(c.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const s=c.ESSceneObject.getSceneObject(e.targetID);o.value=s?(s.components.main??s).id:""})),this.dispose(c.track([this._tilesSceneObjectWithId,"id"],o)),this.disposeVar(c.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!i.viewer)return;const a=this._czmPolygonClipping;a.showHelper=!1,this.dispose(c.bind([a,"positions"],[e,"points"])),this.dispose(c.track([a,"allowPicking"],[e,"allowPicking"]));{const s=()=>{a.reverse=e.mode!=="in"};s(),this.dispose(e.modeChanged.disposableOn(s))}c.registerCreatedEventUpdate(this,e,()=>{const s=this.disposeVar(c.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new c.ObjResettingWithEvent(s,()=>{const{sceneObject:l,id:u}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return u===""?new aO(this):!l||!(l instanceof c.ES3DTileset)?void 0:new sO(this,l)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonClipping:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Xu,"type",Xu.register("ESCesiumViewer",c.ESExcavate.type,Xu));let sg=Xu;const Yu=class Yu extends He{constructor(e,i){super(e,i);L(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new wi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmFireParticleSystem;r.endColor=[1,1,0,.4],r.startColor=[1,0,0,.5],r.particleLife=1,r.emissionRate=30,r.lifetime=1,r.imageSize=[1,1],r.emitter={type:"CircleEmitter",radius:.1},r.sizeInMeters=!0;{const a=()=>{r.startScale=10*(e.scale[0]>0?e.scale[0]:1),r.endScale=5*(e.scale[0]>0?e.scale[0]:1),r.minimumSpeed=10*(e.scale[0]>0?e.scale[0]:1),r.maximumSpeed=15*(e.scale[0]>0?e.scale[0]:1)};a(),this.ad(e.scaleChanged.don(a))}this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"translation"],[e,"translation"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmFireParticleSystem:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const s=a.position;return Fe(r.viewer,s,100,Gn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(Yu,"type",Yu.register("ESCesiumViewer",c.ESFireParticleSystem.type,Yu));let ag=Yu;class ma extends c.Destroyable{constructor(e,i){super();L(this,"_geoPath");L(this,"_geoPolyline");L(this,"_geoCanvasPointPoi");L(this,"_player");L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_currentDistance",this.disposeVar(c.react(0)));L(this,"_ratio",this.disposeVar(c.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new c.ESPathImpl),this._geoPolyline=this.disposeVar(new Ye(e,i)),this._geoCanvasPointPoi=this.disposeVar(new Er(e,i)),this._player=this.disposeVar(new c.Player),this.dispose(c.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(c.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(c.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(c.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(c.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(c.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(c.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(c.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(c.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(c.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(c.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(c.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(c.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),this.dispose(c.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(c.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(c.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(c.track([this._geoPath,"show"],[this,"show"])),this.dispose(c.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"]));{const o=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.currentPoiShowChanged.disposableOn(o))}this.dispose(c.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const a=this.granularity*Math.PI/180,s=bd(this.positions,this.arcType??"GEODESIC",a);if(s){this._geoPath.timePosRots=s.timePosRots,this.rotationRadius.some(l=>l>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(r.disposableOn(o))}{const o=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const r=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(r-this.currentDistance)>.01&&(this.currentDistance=r)};o(),this.dispose(this._player.currentTimeChanged.disposableOn(o))}{const o=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const r=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(r-(this._player.currentTime??0))>.01&&(this._player.currentTime=r)};o(),this.dispose(this.currentDistanceChanged.disposableOn(o))}this.dispose(c.bind([this._player,"loop"],[this,"loop"])),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._player,"duration"],[this,"duration"])),this.dispose(c.bind([this._player,"playing"],[this,"playing"])),this.dispose(c.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(o=>{this._geoPolyline.flyTo(o)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,i){const o=this._geoPath.subPath(e,i);if(o)return o.map(r=>r[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:c.reactPositions(void 0),width:1,ground:!1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(ma||(ma={})),c.extendClassProps(ma.prototype,ma.createDefaultProps);class Kl extends c.Destroyable{constructor(e,i){super();L(this,"_geoPolylinePath");L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_currentDistance",this.disposeVar(c.react(0)));this._geoPolylinePath=this.disposeVar(new ma(e,i)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(c.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(c.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(c.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(c.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(c.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(c.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(c.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(c.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(c.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(c.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(c.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(c.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(c.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(c.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(c.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),r=()=>{try{if(this.positions&&this.positions.length>=2){const a=Rd(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=a}else this._geoPolylinePath.positions=void 0}catch(a){console.error(a),this._geoPolylinePath.positions=void 0}};r(),this.dispose(o.disposableOn(r)),this.dispose(this._flyToEvent.disposableOn(a=>{this._geoPolylinePath.flyTo(a)}))}get geoPolylinePath(){return this._geoPolylinePath}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get player(){return this._geoPolylinePath.player}get currentInfo(){return this._geoPolylinePath.currentInfo}get currentInfoChanged(){return this._geoPolylinePath.currentInfoChanged}get currentIndex(){return this._geoPolylinePath.currentIndex}get currentIndexChanged(){return this._geoPolylinePath.currentIndexChanged}get currentPosition(){return this._geoPolylinePath.currentPosition}get currentPositionChanged(){return this._geoPolylinePath.currentPositionChanged}get currentRotation(){return this._geoPolylinePath.currentRotation}get currentRotationChanged(){return this._geoPolylinePath.currentRotationChanged}get accumDistances(){return this._geoPolylinePath.accumDistances}get accumDistancesChanged(){return this._geoPolylinePath.accumDistances}get totalDistance(){return this._geoPolylinePath.totalDistance}get totalDistanceChanged(){return this._geoPolylinePath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:c.reactPositions(void 0),width:1,ground:!1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0})})(Kl||(Kl={})),c.extendClassProps(Kl.prototype,Kl.createDefaultProps);const lO=[["256",256],["512",512],["1024",1024]],uO=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],In=class In extends c.ESVisualObject{constructor(e){super(e);L(this,"_pickFeaturesEvent",this.dv(new c.Event));this.ad(c.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(c.bind([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new c.StringProperty([this,"accessToken"],"令牌",In.defaults.accessToken),new c.Number4Property([this,"rectangle"],"矩形范围",In.defaults.rectangle),new c.JsonProperty([this,"url"],"服务地址",In.defaults.url),new c.JsonProperty([this,"style"],"样式配置",In.defaults.style),new c.NumberProperty([this,"zIndex"],"层级序号",In.defaults.zIndex),new c.EnumProperty([this,"tileSize"],lO,"瓦片大小",256),new c.NumberSliderProperty([this,"maximumLevel"],1,[1,24],"最大层级",In.defaults.maximumLevel),new c.NumberSliderProperty([this,"minimumLevel"],1,[0,24],"最小层级",In.defaults.minimumLevel),new c.EnumProperty([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像类型",In.defaults.scheme)],more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EnumProperty([this,"splitDirection"],uO,"splitDirection","NONE"),new c.GroupProperty([],"czm","czm"),new c.NumberProperty([this,"czmAlpha"],"透明度"),new c.NumberProperty([this,"czmBrightness"],"亮度"),new c.NumberProperty([this,"czmContrast"],"对比度"),new c.NumberProperty([this,"czmHue"],"色相"),new c.NumberProperty([this,"czmSaturation"],"饱和度"),new c.NumberProperty([this,"czmGamma"],"伽马值")]}}};L(In,"createDefaultProps",()=>({...c.ESVisualObject.createDefaultProps(),rectangle:c.reactJsonWithUndefined([-180,-90,180,90]),url:c.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:c.reactArrayWithUndefined([]),scheme:c.react("tms"),czmSplitDirection:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),L(In,"type",In.register("ESMVTLayer",In,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"}));let mf=In;const cO=t=>{const n=[{maxAlt:25e7,level:0},{maxAlt:25e6,level:1},{maxAlt:9e6,level:2},{maxAlt:7e6,level:3},{maxAlt:44e5,level:4},{maxAlt:2e6,level:5},{maxAlt:1e6,level:6},{maxAlt:493977,level:7},{maxAlt:218047,level:8},{maxAlt:124961,level:9},{maxAlt:56110,level:10},{maxAlt:4e4,level:11},{maxAlt:13222,level:12},{maxAlt:7e3,level:13},{maxAlt:4e3,level:14},{maxAlt:2500,level:15},{maxAlt:1500,level:16},{maxAlt:600,level:17},{maxAlt:250,level:18},{maxAlt:150,level:19},{maxAlt:50,level:20}];for(const{maxAlt:e,level:i}of n)if(t>=e)return i;return 20},hO=async(t,n,e)=>(await fetch(`http://abc.gggis.com:13001/xyzinfo/${e}/${t}/${n}`)).json(),AO=async t=>{var u;const n=(u=t.getCurrentCameraInfo())==null?void 0:u.position;if(!n)return;const e=n[0],i=n[1],o=n[2],r=cO(o);let a=Math.floor((e+180)/360*Math.pow(2,r+1)),s=Math.floor((90-i)/180*Math.pow(2,r));return await hO(a,s,r)};class fO extends c.Destroyable{constructor(n,e,i){super();const o=async()=>{const a=await AO(n);e.datesEvent.emit(a,n)};o();let r;r=setInterval(()=>{o()},3e3),this.d(()=>r&&clearInterval(r));{const a=()=>{const s=e.currentDate?e.currentDate:0;i.url=`http://abc.gggis.com:13001/timetile/tms/${s}/tilemapresource.xml`};a(),this.d(e.currentDateChanged.don(a))}}}const qa=class qa extends c.ESVisualObject{constructor(e){super(e);L(this,"_esImageryLayer",this.dv(new c.ESImageryLayer));L(this,"_datesEvent",this.dv(new c.Event));const i=this._esImageryLayer;this.d(this.components.disposableAdd(i)),i.zIndex=1,i.minimumLevel=1,i.maximumLevel=18,this.d(c.track([i,"show"],[this,"show"])),this.d(c.track([i,"zIndex"],[this,"zIndex"])),this.d(c.track([i,"rectangle"],[this,"rectangle"])),this.d(c.bind([i,"flyInParam"],[this,"flyInParam"])),this.d(c.bind([i,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new fO(o,this,i)),this.d(this.flyInEvent.don(o=>{i.flyIn(o)})),this.d(this.flyToEvent.don(o=>{i.flyTo(o)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}get esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new c.StringProperty([this,"currentDate"],"时间","0"),new c.NumberProperty([this,"zIndex"],"层级",0),new c.Number4Property([this,"rectangle"],"矩形范围",[-180,-90,180,90])]}}};L(qa,"createDefaultProps",()=>({...c.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:c.reactArray([-180,-90,180,90])})),L(qa,"type",qa.register("ESGeHistoryImagery",qa,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"}));let gf=qa;const Ox=`async (dataSource, viewer) => {
|
|
2594
|
+
`,r.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let s=this.disposeVar(c.react(void 0));{const l=this.disposeVar(c.createProcessingFromAsyncFunc(async A=>{s.value=void 0;const h=e.url??c.ESDataMesh.defaults.url;if(!h)return;await A.promise(c.sleep(200));const f=(e.maxTime??23)|0;s.value=await A.promise(rO(c.ESSceneObject.context.getStrFromEnv(typeof h=="string"?h:h.url),f+1))}));l.start();const u=this.disposeVar(c.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(u.disposableOn(()=>l.restart()))}{class l{constructor(h){this._buffer=h}[Symbol.iterator](){return oO(this._buffer)}}const u=()=>{if(!s.value)return;const{vertexBuffer:A,propBuffers:h,indexBuffer:f}=s.value,{minPos:p,maxPos:d}=c.getMinMaxCorner(new l(A));r.setLocalAxisedBoundingBox(p,d);const m=(e.maxTime??23)|0;let v=(e.currentTime??c.ESDataMesh.defaults.currentTime)/m;v=v<0?0:v>1?1:v;const y=v*m;let g=v*m|0,_=y-g;if(g>=m&&(g=m-1,_=1),!Number.isFinite(_)){console.error("!Number.isFinite(rr)");debugger;return}if(r.indexTypedArray=f,!h[g]||!h[g+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}r.attributes={a_position:{typedArray:A,componentsPerAttribute:3},a_prop:{typedArray:h[g],componentsPerAttribute:3},a_prop2:{typedArray:h[g+1],componentsPerAttribute:3}},r.uniformMap={u_gradientMap:{type:"texture",id:`${a.id}`},u_stripMinMaxValue:[e.minPropValue??c.ESDataMesh.defaults.minPropValue,e.maxPropValue??c.ESDataMesh.defaults.maxPropValue],u_ratio:_}};u(),this.dispose(e.maxTimeChanged.disposableOn(u)),this.dispose(e.currentTimeChanged.disposableOn(u)),this.dispose(e.minPropValueChanged.disposableOn(u)),this.dispose(e.maxPropValueChanged.disposableOn(u)),this.dispose(s.changed.disposableOn(u))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(bn(r,o,i,e,a,!0),!0):!1}};L(qu,"type",qu.register("ESCesiumViewer",c.ESDataMesh.type,qu));let ig=qu;const us=class us extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_heading",this.disposeVar(c.react(0)));L(this,"_textFunc",this.disposeVar(c.react(void 0)));const o=this;{const s=()=>{if(this.positions&&this.positions.length>=2){let u=0;this.arcType===void 0||this.arcType==="GEODESIC"?u=c.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?u=c.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?u=c.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?c.clampN180_180(u):c.clamp0_360(u)}};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(l.disposableOn(s))}const r=this.disposeVar(new Ye(e,i));r.loop=!1,this.dispose(c.track([r,"allowPicking"],[o,"allowPicking"])),this.dispose(c.bind([r,"arcType"],[o,"arcType"])),this.dispose(c.bind([r,"color"],[o,"color"])),this.dispose(c.bind([r,"dashLength"],[o,"dashLength"])),this.dispose(c.bind([r,"dashPattern"],[o,"dashPattern"])),this.dispose(c.bind([r,"gapColor"],[o,"gapColor"])),this.dispose(c.bind([r,"hasArrow"],[o,"hasArrow"])),this.dispose(c.bind([r,"hasDash"],[o,"hasDash"])),this.dispose(c.bind([r,"positions"],[o,"positions"])),this.dispose(c.bind([r,"show"],[o,"show"])),this.dispose(c.bind([r,"width"],[o,"width"])),this.dispose(c.bind([r,"depthTest"],[o,"depthTest"])),this.dispose(c.bind([r,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(s=>{e.actived&&r.flyTo(s)}));const a=this.disposeVar(new bt(e,i));this.dispose(c.bind([a,"shadowDom"],[o,"shadowDom"])),this.dispose(c.bind([a,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(c.bind([a,"show"],[o,"show"]));{const s=()=>{o.positions&&o.positions.length>=2?a.position=o.positions[1]:a.position=void 0};s(),this.dispose(o.positionsChanged.disposableOn(s))}{const s=()=>{const{heading:u}=o,A=(o.textFunc??us.defaultTextFunc_度格式)(u);a.innerHTML=_o(`方向: ${A}`,24)};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(l.disposableOn(s))}this.ad(a.pickedEvent.don(s=>{Gi(s)===0&&this.pickedEvent.emit(s)}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get heading(){return this._heading.value}get headingChanged(){return this._heading.changed}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}};L(us,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),L(us,"defaultTextFunc_度分格式",e=>`${rl(e,!0)}`),L(us,"defaultTextFunc_度分秒格式",e=>`${rl(e,!1)}`),L(us,"defaults",{positions:[]});let qo=us;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),width:8,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(qo||(qo={})),c.extendClassProps(qo.prototype,qo.createDefaultProps);const Ku=class Ku extends sn{constructor(e,i){super(e,i);L(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new qo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmDirectionMeasurement;r.angleMode="0~360",this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):u==="normal"?(r.hasDash=!1,r.hasArrow=!1):(r.hasDash=!1,r.hasArrow=!0);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Ku,"type",Ku.register("ESCesiumViewer",c.ESDirectionMeasurement.type,Ku));let rg=Ku;class fa extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_distances",this.disposeVar(c.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await R0(e.viewer,this.positions??[]):this._distances.value=c.getDistancesFromPositions(this.positions??[],this.arcType)};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(r.disposableOn(o));const a=this.disposeVar(new Ye(e,i));a.loop=!1,this.dispose(c.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([a,"arcType"],[this,"arcType"])),this.dispose(c.bind([a,"color"],[this,"color"])),this.dispose(c.bind([a,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([a,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([a,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([a,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([a,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([a,"positions"],[this,"positions"])),this.dispose(c.bind([a,"show"],[this,"show"])),this.dispose(c.bind([a,"width"],[this,"width"])),this.dispose(c.bind([a,"depthTest"],[this,"depthTest"])),this.dispose(c.bind([a,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(s=>{e.actived&&a.flyTo(s)}));{const s=[],l=()=>{for(let A of s)A.destroy();s.length=0};this.dispose(l);const u=()=>{if(l(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const h=Dd("起点",this.positions[0],e,i);h.dispose(c.track([h,"show"],[this,"show"])),h.dispose(c.track([h,"shadowDom"],[this,"shadowDom"])),h.dispose(c.track([h,"cssAllInitial"],[this,"cssAllInitial"])),s.push(h)}const A=this.distances.length;for(let h=0;h<A;++h){const f=this.distances[h],p=this.positions[h+1],d=Dd(`长度: ${Mh(f)}`,p,e,i);d.dispose(c.track([d,"show"],[this,"show"])),d.dispose(c.track([d,"shadowDom"],[this,"shadowDom"])),d.dispose(c.track([d,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(d.pickedEvent.don(m=>{Gi(m)===0&&this.pickedEvent.emit(m)})),s.push(d)}};u(),this.dispose(this.distancesChanged.disposableOn(()=>c.inOrderRunning(u)))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distances(){return this._distances.value}get distancesChanged(){return this._distances.changed}}L(fa,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),width:1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(fa||(fa={})),c.extendClassProps(fa.prototype,fa.createDefaultProps);const Zu=class Zu extends sn{constructor(e,i){super(e,i);L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ye(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoPolyline;this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"color"],[e,"strokeColor"])),this.dispose(c.track([r,"ground"],[e,"strokeGround"]));{const a=()=>{r.show=e.show&&e.stroked};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}}get geoPolyline(){return this._geoPolyline}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:a}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Zu,"type",Zu.register("ESCesiumViewer",c.ESGeoLineString.type,Zu));let da=Zu;const $u=class $u extends da{constructor(e,i){super(e,i);L(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new fa(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:r}=this;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L($u,"type",$u.register("ESCesiumViewer",c.ESDistanceMeasurement.type,$u));let og=$u;class pa extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this.id=i)}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,allowPicking:!1,positions:c.reactPositions(void 0),reverse:!1,edgeColor:c.reactArray([1,1,1,1]),edgeWidth:2})})(pa||(pa={})),c.extendClassProps(pa.prototype,pa.createDefaultProps);class sO extends c.Destroyable{constructor(n,e){super(),this._czmESExcavate=n,this._eS3DTileset=e;for(let i=0;i<this._eS3DTileset.excavateId.length;i++){const o=this._eS3DTileset.excavateId[i];c.ESSceneObject.getSceneObjById(o)||this._eS3DTileset.excavateId.splice(i,1)}this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId.filter(i=>i!==this._czmESExcavate.czmPolygonClipping.id)]})}}class aO extends c.Destroyable{constructor(n){if(super(),this._czmESExcavate=n,!!this._czmESExcavate.viewer){for(let e=0;e<this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.length;e++){const i=this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId[e];c.ESSceneObject.getSceneObjById(i)||this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.splice(e,1)}this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._czmESExcavate.viewer&&(this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.filter(e=>e!==this._czmESExcavate.czmPolygonClipping.id)])})}}}const Xu=class Xu extends Ln{constructor(e,i){super(e,i);L(this,"_czmPolygonClipping");L(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new pa(i,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new c.ESSceneObjectWithId);const o=this.ad(c.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const s=c.ESSceneObject.getSceneObject(e.targetID);o.value=s?(s.components.main??s).id:""})),this.dispose(c.track([this._tilesSceneObjectWithId,"id"],o)),this.disposeVar(c.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!i.viewer)return;const a=this._czmPolygonClipping;a.showHelper=!1,this.dispose(c.bind([a,"positions"],[e,"points"])),this.dispose(c.track([a,"allowPicking"],[e,"allowPicking"]));{const s=()=>{a.reverse=e.mode!=="in"};s(),this.dispose(e.modeChanged.disposableOn(s))}c.registerCreatedEventUpdate(this,e,()=>{const s=this.disposeVar(c.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new c.ObjResettingWithEvent(s,()=>{const{sceneObject:l,id:u}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return u===""?new aO(this):!l||!(l instanceof c.ES3DTileset)?void 0:new sO(this,l)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonClipping:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Xu,"type",Xu.register("ESCesiumViewer",c.ESExcavate.type,Xu));let sg=Xu;const Yu=class Yu extends He{constructor(e,i){super(e,i);L(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new wi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmFireParticleSystem;r.endColor=[1,1,0,.4],r.startColor=[1,0,0,.5],r.particleLife=1,r.emissionRate=30,r.lifetime=1,r.imageSize=[1,1],r.emitter={type:"CircleEmitter",radius:.1},r.sizeInMeters=!0;{const a=()=>{r.startScale=10*(e.scale[0]>0?e.scale[0]:1),r.endScale=5*(e.scale[0]>0?e.scale[0]:1),r.minimumSpeed=10*(e.scale[0]>0?e.scale[0]:1),r.maximumSpeed=15*(e.scale[0]>0?e.scale[0]:1)};a(),this.ad(e.scaleChanged.don(a))}this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"translation"],[e,"translation"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmFireParticleSystem:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const s=a.position;return Fe(r.viewer,s,100,Gn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(Yu,"type",Yu.register("ESCesiumViewer",c.ESFireParticleSystem.type,Yu));let ag=Yu;class ma extends c.Destroyable{constructor(e,i){super();L(this,"_geoPath");L(this,"_geoPolyline");L(this,"_geoCanvasPointPoi");L(this,"_player");L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_currentDistance",this.disposeVar(c.react(0)));L(this,"_ratio",this.disposeVar(c.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new c.ESPathImpl),this._geoPolyline=this.disposeVar(new Ye(e,i)),this._geoCanvasPointPoi=this.disposeVar(new Er(e,i)),this._player=this.disposeVar(new c.Player),this.dispose(c.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(c.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(c.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(c.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(c.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(c.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(c.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(c.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(c.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(c.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(c.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(c.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(c.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),this.dispose(c.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(c.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(c.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(c.track([this._geoPath,"show"],[this,"show"])),this.dispose(c.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"]));{const o=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.currentPoiShowChanged.disposableOn(o))}this.dispose(c.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const a=this.granularity*Math.PI/180,s=bd(this.positions,this.arcType??"GEODESIC",a);if(s){this._geoPath.timePosRots=s.timePosRots,this.rotationRadius.some(l=>l>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(r.disposableOn(o))}{const o=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const r=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(r-this.currentDistance)>.01&&(this.currentDistance=r)};o(),this.dispose(this._player.currentTimeChanged.disposableOn(o))}{const o=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const r=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(r-(this._player.currentTime??0))>.01&&(this._player.currentTime=r)};o(),this.dispose(this.currentDistanceChanged.disposableOn(o))}this.dispose(c.bind([this._player,"loop"],[this,"loop"])),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._player,"duration"],[this,"duration"])),this.dispose(c.bind([this._player,"playing"],[this,"playing"])),this.dispose(c.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(o=>{this._geoPolyline.flyTo(o)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,i){const o=this._geoPath.subPath(e,i);if(o)return o.map(r=>r[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:c.reactPositions(void 0),width:1,ground:!1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(ma||(ma={})),c.extendClassProps(ma.prototype,ma.createDefaultProps);class Kl extends c.Destroyable{constructor(e,i){super();L(this,"_geoPolylinePath");L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_currentDistance",this.disposeVar(c.react(0)));this._geoPolylinePath=this.disposeVar(new ma(e,i)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(c.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(c.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(c.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(c.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(c.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(c.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(c.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(c.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(c.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(c.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(c.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(c.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(c.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(c.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(c.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),r=()=>{try{if(this.positions&&this.positions.length>=2){const a=Rd(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=a}else this._geoPolylinePath.positions=void 0}catch(a){console.error(a),this._geoPolylinePath.positions=void 0}};r(),this.dispose(o.disposableOn(r)),this.dispose(this._flyToEvent.disposableOn(a=>{this._geoPolylinePath.flyTo(a)}))}get geoPolylinePath(){return this._geoPolylinePath}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get player(){return this._geoPolylinePath.player}get currentInfo(){return this._geoPolylinePath.currentInfo}get currentInfoChanged(){return this._geoPolylinePath.currentInfoChanged}get currentIndex(){return this._geoPolylinePath.currentIndex}get currentIndexChanged(){return this._geoPolylinePath.currentIndexChanged}get currentPosition(){return this._geoPolylinePath.currentPosition}get currentPositionChanged(){return this._geoPolylinePath.currentPositionChanged}get currentRotation(){return this._geoPolylinePath.currentRotation}get currentRotationChanged(){return this._geoPolylinePath.currentRotationChanged}get accumDistances(){return this._geoPolylinePath.accumDistances}get accumDistancesChanged(){return this._geoPolylinePath.accumDistances}get totalDistance(){return this._geoPolylinePath.totalDistance}get totalDistanceChanged(){return this._geoPolylinePath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:c.reactPositions(void 0),width:1,ground:!1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0})})(Kl||(Kl={})),c.extendClassProps(Kl.prototype,Kl.createDefaultProps);const lO=[["256",256],["512",512],["1024",1024]],uO=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],In=class In extends c.ESVisualObject{constructor(e){super(e);L(this,"_pickFeaturesEvent",this.dv(new c.Event));this.ad(c.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(c.bind([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new c.StringProperty([this,"accessToken"],"令牌",In.defaults.accessToken),new c.Number4Property([this,"rectangle"],"矩形范围",In.defaults.rectangle),new c.JsonProperty([this,"url"],"服务地址",In.defaults.url),new c.JsonProperty([this,"style"],"样式配置",In.defaults.style),new c.NumberProperty([this,"zIndex"],"层级序号",In.defaults.zIndex),new c.EnumProperty([this,"tileSize"],lO,"瓦片大小",256),new c.NumberSliderProperty([this,"maximumLevel"],1,[1,24],"最大层级",In.defaults.maximumLevel),new c.NumberSliderProperty([this,"minimumLevel"],1,[0,24],"最小层级",In.defaults.minimumLevel),new c.EnumProperty([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像类型",In.defaults.scheme)],more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EnumProperty([this,"splitDirection"],uO,"splitDirection","NONE"),new c.GroupProperty([],"czm","czm"),new c.NumberProperty([this,"czmAlpha"],"透明度"),new c.NumberProperty([this,"czmBrightness"],"亮度"),new c.NumberProperty([this,"czmContrast"],"对比度"),new c.NumberProperty([this,"czmHue"],"色相"),new c.NumberProperty([this,"czmSaturation"],"饱和度"),new c.NumberProperty([this,"czmGamma"],"伽马值")]}}};L(In,"createDefaultProps",()=>({...c.ESVisualObject.createDefaultProps(),rectangle:c.reactJsonWithUndefined([-180,-90,180,90]),url:c.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:c.reactArrayWithUndefined([]),scheme:c.react("xyz"),czmSplitDirection:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),L(In,"type",In.register("ESMVTLayer",In,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"}));let mf=In;const cO=t=>{const n=[{maxAlt:25e7,level:0},{maxAlt:25e6,level:1},{maxAlt:9e6,level:2},{maxAlt:7e6,level:3},{maxAlt:44e5,level:4},{maxAlt:2e6,level:5},{maxAlt:1e6,level:6},{maxAlt:493977,level:7},{maxAlt:218047,level:8},{maxAlt:124961,level:9},{maxAlt:56110,level:10},{maxAlt:4e4,level:11},{maxAlt:13222,level:12},{maxAlt:7e3,level:13},{maxAlt:4e3,level:14},{maxAlt:2500,level:15},{maxAlt:1500,level:16},{maxAlt:600,level:17},{maxAlt:250,level:18},{maxAlt:150,level:19},{maxAlt:50,level:20}];for(const{maxAlt:e,level:i}of n)if(t>=e)return i;return 20},hO=async(t,n,e)=>(await fetch(`http://abc.gggis.com:13001/xyzinfo/${e}/${t}/${n}`)).json(),AO=async t=>{var u;const n=(u=t.getCurrentCameraInfo())==null?void 0:u.position;if(!n)return;const e=n[0],i=n[1],o=n[2],r=cO(o);let a=Math.floor((e+180)/360*Math.pow(2,r+1)),s=Math.floor((90-i)/180*Math.pow(2,r));return await hO(a,s,r)};class fO extends c.Destroyable{constructor(n,e,i){super();const o=async()=>{const a=await AO(n);e.datesEvent.emit(a,n)};o();let r;r=setInterval(()=>{o()},3e3),this.d(()=>r&&clearInterval(r));{const a=()=>{const s=e.currentDate?e.currentDate:0;i.url=`http://abc.gggis.com:13001/timetile/tms/${s}/tilemapresource.xml`};a(),this.d(e.currentDateChanged.don(a))}}}const qa=class qa extends c.ESVisualObject{constructor(e){super(e);L(this,"_esImageryLayer",this.dv(new c.ESImageryLayer));L(this,"_datesEvent",this.dv(new c.Event));const i=this._esImageryLayer;this.d(this.components.disposableAdd(i)),i.zIndex=1,i.minimumLevel=1,i.maximumLevel=18,this.d(c.track([i,"show"],[this,"show"])),this.d(c.track([i,"zIndex"],[this,"zIndex"])),this.d(c.track([i,"rectangle"],[this,"rectangle"])),this.d(c.bind([i,"flyInParam"],[this,"flyInParam"])),this.d(c.bind([i,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new fO(o,this,i)),this.d(this.flyInEvent.don(o=>{i.flyIn(o)})),this.d(this.flyToEvent.don(o=>{i.flyTo(o)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}get esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new c.StringProperty([this,"currentDate"],"时间","0"),new c.NumberProperty([this,"zIndex"],"层级",0),new c.Number4Property([this,"rectangle"],"矩形范围",[-180,-90,180,90])]}}};L(qa,"createDefaultProps",()=>({...c.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:c.reactArray([-180,-90,180,90])})),L(qa,"type",qa.register("ESGeHistoryImagery",qa,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"}));let gf=qa;const Ox=`async (dataSource, viewer) => {
|
|
2595
2595
|
viewer.clock.shouldAnimate = false;
|
|
2596
2596
|
const rider = dataSource.entities.getById("tour");
|
|
2597
2597
|
await viewer.flyTo(rider)
|
|
@@ -3594,7 +3594,7 @@ ${r_}
|
|
|
3594
3594
|
vec4 imageColor = texture(u_image, fract(v_st * u_stScale - addst));
|
|
3595
3595
|
out_FragColor = imageColor * u_color;
|
|
3596
3596
|
}
|
|
3597
|
-
`};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(s.disposableOn(a))}this.dispose(this.flyToEvent.disposableOn(a=>{this.czmCustomPrimitive.flyTo(a)}));{const a=()=>{const l=r.value?r.value:1,u=this.height??pr.defaults.height,{textureSizeInMeters:A=pr.defaults.textureSizeInMeters}=this,{textureUri:h=pr.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:h},u_stScale:[l/A[0],u/A[1]],u_speed:this.textureMoveSpeed??pr.defaults.textureMoveSpeed,u_color:this.textureColor??pr.defaults.textureColor}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,r.changed));this.dispose(s.disposableOn(a))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmCustomPrimitive(){return this._czmCustomPrimitive}get geoBoundingSphere(){return this._geoBoundingSphere.value}get geoBoundingSphereChanged(){return this._geoBoundingSphere.changed}};L(pr,"defaults",{show:!0,allowPicking:!1,positions:[],height:1e3,textureSizeInMeters:[500,500],textureUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",textureMoveSpeed:[0,.3],textureColor:[1,1,1,1]});let $o=pr;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:c.reactPositions(void 0),height:void 0,textureSizeInMeters:c.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:c.reactArrayWithUndefined(void 0),textureColor:c.reactArrayWithUndefined(void 0)})})($o||($o={})),c.extendClassProps($o.prototype,$o.createDefaultProps);const Tc=class Tc extends sn{constructor(e,i){super(e,i);L(this,"_czmPolygonFence");L(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new $o(i,e.id)),this._czmPolygon=this.dv(new c.ESGeoPolygon),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmPolygonFence,a=this._czmPolygon;i.add(a),this.dispose(()=>i.delete(a)),a.filled=!1,this.d(c.track([a,"points"],[e,"points"])),this.d(c.track([a,"stroked"],[e,"stroked"])),this.d(c.track([a,"strokeColor"],[e,"strokeColor"])),this.d(c.track([a,"strokeWidth"],[e,"strokeWidth"])),this.d(c.track([a,"strokeGround"],[e,"strokeGround"]));{const s={danger:{color:[.99,.98,.57,1],image:"01.png"},checkerboard:{color:[.88,.98,.99,1],image:"02.png"},warning:{color:[1,.93,.58,1],image:"03.png"},cord:{color:[.91,.87,.56,1],image:"04.png"},scanline:{color:[.43,.78,.8,1],image:"05.png"},honeycomb:{color:[.28,.84,.86,1],image:"06.png"},gradientColor:{color:[1,1,1,1],image:"07.png"}},l=(f,p)=>{switch(f){case"danger":return{textureMoveSpeed:[.05,0],textureSizeInMeters:[2,2]};case"checkerboard":return{textureMoveSpeed:[0,0],textureSizeInMeters:[2,2]};case"warning":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"cord":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"scanline":return{textureMoveSpeed:[0,0],textureSizeInMeters:[p,p]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[p,p]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[p,p]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[p*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",A=()=>{const f=e.materialMode,p=s[f];if(!p)return;r.textureUri=u+p.image,r.textureColor=f!=="gradientColor"?p.color:e.fillColor;const{textureMoveSpeed:d,textureSizeInMeters:m}=l(f,e.height);r.textureMoveSpeed=d,r.textureSizeInMeters=m};A();const h=this.disposeVar(c.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(h.disposableOn(A))}{this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"height"],[e,"height"]));{const s=()=>{r.show=e.show&&e.filled};s();const l=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(l.don(s))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(bn(r,o,i,e,a.czmCustomPrimitive),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(bn(r,o,i,e,a.czmCustomPrimitive),!0):!1}};L(Tc,"type",Tc.register("ESCesiumViewer",c.ESPolygonFence.type,Tc));let Hg=Tc;const Ic=class Ic extends sn{constructor(e,i){super(e,i);L(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRectangle;this.dispose(c.bind([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(c.bind([r,"height"],[e,"height"])),this.dispose(c.bind([r,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(c.bind([r,"rectangle"],[e,"rectangle"])),this.dispose(c.bind([r,"stRotation"],[e,"stRotation"])),this.dispose(c.bind([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"]));{const a=()=>{const s=e.points;if(s&&s.length>=2){const{minPos:l,maxPos:u}=c.getMinMaxCorner(s);r.rectangle=[l[0],l[1],u[0],u[1]],r.height=s[1][2],r.extrudedHeight=s[0][2]}else r.rectangle=void 0,r.height=0,r.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}{const a=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material={type:"Color",color:[1,1,1,0]}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(s.disposableOn(a))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}};L(Ic,"type",Ic.register("ESCesiumViewer",c.ESRectangle.type,Ic));let Gg=Ic;const uo=class uo extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=c.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],uo.defaults.imageUrl),a=this.disposeVar(c.react(void 0)),s=()=>{const g=b.Material.fromType(b.Material.ImageType);g.uniforms.image=r.value,g.uniforms.repeat=Ze(this.repeat??uo.defaults.repeat),a.value=g};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(r.changed,this.repeatChanged));this.dispose(l.disposableOn(s));const u=(g,_)=>{const x=new b.PolylineMaterialAppearance({material:_,renderState:{depthTest:{enabled:!1}}});x.renderState.depthMask=!1;const E=[];if(g.length<2)return;E.push(new b.GeometryInstance({geometry:new b.GroundPolylineGeometry({positions:g,width:this.width??uo.defaults.width,vertexFormat:b.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:b.ArcType[this.arcType??uo.defaults.arcType]}),id:this}));const B=new Bi({geometryInstances:E,appearance:x,asynchronous:!1,allowPicking:this.allowPicking??uo.defaults.allowPicking,compressVertices:!1});return B.ESSceneObjectID=i,B};let A;const h=new b.BoundingSphere,f=()=>{A&&(o.scene.primitives.remove(A),A=void 0)};this.dispose(f);const p=()=>{if(f(),!this.positions)return;const g=Yt(this.positions);if(g.length<2||!a.value){h.radius=-1;return}b.BoundingSphere.fromPoints(g,h),A=u(g,a.value),A&&o.scene.primitives.add(A)},d=()=>{A&&(A.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(g=>{if(e.actived&&h.radius>0){const _=De(h.center);_&&Fe(o,_,h.radius*4,void 0,g)}})),p(),d();const m=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,a.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(m.disposableOn(()=>{p(),d()}));const v=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged));this.dispose(v.disposableOn(()=>{d()}));const{extensions:y}=e;if(!y){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};L(uo,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Xo=uo;(t=>{t.createDefaultProps=()=>({show:void 0,positions:c.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Xo||(Xo={})),c.extendClassProps(Xo.prototype,Xo.createDefaultProps);const Fc=class Fc extends sn{constructor(e,i){super(e,i);L(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Xo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRoad;{const a=()=>{r.show=e.show&&e.stroked};a();const s=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.don(a))}this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"width"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(c.track([r,"repeat"],[e,"repeat"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Fc,"type",Fc.register("ESCesiumViewer",xf.type,Fc));let Wg=Fc;const Mc=class Mc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends c.Destroyable{constructor(s,l,u){super(),this._subContainer=s;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));{const m=()=>{A.style.display=e.show??c.ESScale.defaults.show?"block":"none"};m(),e.dispose(e.showChanged.disposableOn(m))}A.style.position="fixed",A.style.width="125px",A.style.height="30px",A.style.border="1px solid rgba(49,50,56,.8)",A.style.padding="0 5px",A.style.backgroundColor="rgba(37,38,42,.8)",A.style.borderRadius="15px",A.style.pointerEvents="auto",A.style.transition=" right 0.4s linear";{const m=()=>{A.style.bottom=`${e.cssPosition?e.cssPosition[0]:c.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(A.style.right="auto",A.style.left=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`):(A.style.left="auto",A.style.right=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`)},v=this.disposeVar(c.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));m(),this.dispose(v.disposableOn(()=>m()))}const h=document.createElement("div");A.appendChild(h),this.dispose(()=>A.removeChild(h)),h.style.width="125px",h.style.display="inline-block",h.style.textAlign="center",h.style.fontSize="14px",h.style.fontWeight="lighter",h.style.lineHeight="30px",h.style.color="#fff",h.innerHTML="1000km";const f=document.createElement("div");A.appendChild(f),this.dispose(()=>A.removeChild(f)),f.style.borderRight="1px solid #fff",f.style.borderLeft="1px solid #fff",f.style.borderBottom="1px solid #fff",f.style.position="absolute",f.style.height="10px",f.style.top="15px",f.style.width="75px",f.style.left="30px";const p=()=>{const m=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||m&&m>1e6)A.style.display="none";else{A.style.display="block";const v=i.viewerLegend.legend.computedLengthInStr;v&&(h.innerHTML=v);const y=i.viewerLegend.legend.computedLengthInPixels;if(y){f.style.width=`${y}px`;const g=(135-y)/2;f.style.left=`${g}px`}}};p();const d=setInterval(()=>{p()},200);this.dispose(()=>clearInterval(d))}}}get customDiv(){return this._customDiv}};L(Mc,"type",Mc.register("ESCesiumViewer",c.ESScale.type,Mc));let jg=Mc;const Dc=class Dc extends He{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new ut(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmCustomPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"position"],[e,"position"])),this.dispose(c.track([r,"scale"],[e,"scale"])),this.dispose(c.track([r,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(c.track([r,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(c.track([r,"maximumScale"],[e,"maximumScale"])),this.dispose(c.track([r,"minimumScale"],[e,"minimumScale"])),this.dispose(c.track([r,"pixelSize"],[e,"pixelSize"])),this.dispose(c.track([r,"showSceneScale"],[e,"showSceneScale"])),this.dispose(c.track([r,"modelMatrix"],[e,"modelMatrix"])),this.dispose(c.track([r,"cull"],[e,"cull"])),this.dispose(c.track([r,"boundingVolume"],[e,"boundingVolume"])),this.dispose(c.track([r,"pass"],[e,"pass"])),this.dispose(c.track([r,"primitiveType"],[e,"primitiveType"])),this.dispose(c.track([r,"renderState"],[e,"renderState"])),this.dispose(c.track([r,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(c.track([r,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(c.track([r,"uniformMap"],[e,"uniformMap"])),this.dispose(c.track([r,"attributes"],[e,"attributes"])),this.dispose(c.track([r,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(c.track([r,"attributesJson"],[e,"attributesJson"])),this.dispose(c.track([r,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(c.track([r,"count"],[e,"count"])),this.dispose(c.track([r,"offset"],[e,"offset"])),this.dispose(c.track([r,"instanceCount"],[e,"instanceCount"])),this.dispose(c.track([r,"localPosition"],[e,"localPosition"])),this.dispose(c.track([r,"localScale"],[e,"localScale"])),this.dispose(c.track([r,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(c.track([r,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(c.track([r,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(c.track([r,"occlude"],[e,"occlude"])),this.dispose(c.track([r,"castShadows"],[e,"castShadows"])),this.dispose(c.track([r,"receiveShadows"],[e,"receiveShadows"])),this.dispose(c.track([r,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(c.track([r,"pickOnly"],[e,"pickOnly"])),this.dispose(c.track([r,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const a=()=>{if(e.localRotation){const s=[...e.localRotation];s[0]-=90,r.localRotation=s}else r.localRotation=[-90,0,0]};a(),this.dispose(e.localRotationChanged.disposableOn(a))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(bn(r,o,i,e,a,!0),!0):!1}};L(Dc,"type",Dc.register("ESCesiumViewer",wf.type,Dc));let qg=Dc;const Rc=class Rc extends df{constructor(e,i){super(e,i);L(this,"czmGeoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Ot(i.viewer))return;this.czmGeoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Ro(i,e.id));const{czmGeoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??c.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??c.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESDynamicWater.defaults.flowSpeed});else{const A=Object.assign({},Rh[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=e.show&&e.stroked},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=!!(e.show&&e.filled)},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{if(!e.points||e.points&&e.points.length<=2){a.positions=[],s.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const A=e.points.map(f=>[f[0],f[1],0]),[h]=_r({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},A);a.positions=[...h,h[0]],s.points=[...h]};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(l))}}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Mn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&a),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&a)}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmWater:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a!=null&&a.points?(Me(r,o,i,a.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:i}=this;i&&(e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection)}};L(Rc,"type",Rc.register("ESCesiumViewer",c.ESDynamicWater.type,Rc));let Kg=Rc;const it=class it extends Hn{constructor(e,i){super(e,i);L(this,"_dataSource",this.disposeVar(c.react(void 0)));L(this,"_pointFeatures",this.disposeVar(c.reactJsonWithUndefined(void 0)));L(this,"featureArrName","features");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=Ot(o);if(!r)return;const{screenManager:a}=r,s={scale:1*it.scaleFactor,font:"16px sans-serif",verticalOrigin:b.VerticalOrigin.BOTTOM,horizontalOrigin:b.HorizontalOrigin.CENTER,scaleByDistance:it.scaleByDistance,eyeOffset:new b.Cartesian3(0,0,-10),show:!0},l={scale:1*it.scaleFactor,verticalOrigin:b.VerticalOrigin.BOTTOM,horizontalOrigin:b.HorizontalOrigin.CENTER,scaleByDistance:it.scaleByDistance,image:it.clusterImageUrl};(async()=>{if(it.clusterImageAttribute===void 0){const u=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(u).then(A=>A.json()).then(A=>{it.clusterImageAttribute=A}).catch(A=>{console.error(A)})}{const u=()=>{if(!e.data){this.pointFeatures=void 0;return}this.featureArrName=e.data.type=="FeatureCollection"?"features":"geometries";const A={type:e.data.type,[this.featureArrName]:[]};if(e.data.type==="FeatureCollection")for(let h=0;h<e.data.features.length;h++){const f=e.data.features[h];if(f.geometry.type=="Point")A[this.featureArrName].push(f);else if(f.geometry.type=="MultiPoint")for(let p=0;p<f.geometry.coordinates.length;p++)A[this.featureArrName].push({type:"Feature",geometry:{type:"Point",coordinates:f.geometry.coordinates[p]},properties:f.properties??{}});else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",f.geometry.type)}else if(e.data.type=="GeometryCollection")for(let h=0;h<e.data.geometries.length;h++){const f=e.data.geometries[h];if(f.type=="Point")A[this.featureArrName].push(f);else if(f.type=="MultiPoint")for(let p=0;p<f.coordinates.length;p++)A[this.featureArrName].push({type:"Feature",geometry:{type:"Point",coordinates:f.coordinates[p]},properties:f.properties??{}});else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",f.type)}this.pointFeatures=A};u(),this.ad(e.dataChanged.don(u))}{const u=()=>{this.dataSource&&o.dataSources.remove(this.dataSource),this.dataSource=void 0};this.ad(()=>u());const A=()=>{u(),this.pointFeatures&&b.GeoJsonDataSource.load(this.pointFeatures).then(h=>{o.dataSources.add(h).then(()=>{this.dataSource=h})})};A(),this.ad(this.pointFeaturesChanged.don(A))}this.ad(new c.ObjResettingWithEvent(this.dataSourceChanged,()=>{var d;if(!this.dataSource)return;const u=new c.Destroyable,A=this.dataSource;A.clustering.enabled=A.clustering.clusterBillboards=A.clustering.clusterLabels=A.clustering.clusterPoints=!0;for(let m=0;m<A.entities.values.length;m++){const v=A.entities.values[m];v.billboard&&(v.billboard.color=new b.ConstantProperty(b.Color.TRANSPARENT))}{const m=()=>{const y=A.clustering.pixelRange;A.clustering.pixelRange=0,A.clustering.pixelRange=y};m();let v=(d=this.czmViewer.viewer)==null?void 0:d.camera.moveEnd.addEventListener(()=>{m()});u.d(()=>{var y;v&&((y=this.czmViewer.viewer)==null||y.camera.moveEnd.removeEventListener(v))})}u.d(c.track([A.clustering,"pixelRange"],[e,"pixelRange"])),u.d(c.track([A.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),A.clustering.clusterEvent.addEventListener((m,v)=>{v.label&&(v.label.show=!1),v.billboard&&(v.billboard.show=!1),v.point&&(v.point.show=!1)});const h=u.ad(c.react(!1));let f=[];const p=o.scene.postUpdate.addEventListener(()=>{if(A.clustering._clusterLabelCollection)if(A.clustering._clusterLabelCollection._labels.length!=f.length||!A.clustering._clusterLabelCollection._labels.every(m=>f.includes(m.id.length))){f=[];for(let m=0;m<A.clustering._clusterLabelCollection._labels.length;m++){const v=A.clustering._clusterLabelCollection._labels[m];f.push(v.id.length)}h.value=!0}else h.value=!1});u.ad(()=>p());{let m={id:"",layer:"",screenObjectIds:[]},v={id:"",layer:"",screenObjectIds:[]};const y=()=>{m&&(a.remove(m.layer,m.id,{label:m.screenObjectIds}),m={id:"",layer:"",screenObjectIds:[]}),v&&(a.remove(v.layer,v.id,{billboard:v.screenObjectIds}),v={id:"",layer:"",screenObjectIds:[]})};u.ad(()=>{y()});const g=()=>{var F,S,T,w,C,M;if(y(),!e.show||!it.clusterImageAttribute)return;const x=e.style??c.ESEntityCluster.defaults.style,E=it.clusterImageAttribute[((F=x.nonCluster)==null?void 0:F.mode)??"SquareH01"],B=[-E.anchorPixelOffset[0]+E.textPixelOffset[0],-E.anchorPixelOffset[1]-E.textPixelOffset[1]],P={...s,pixelOffset:new b.Cartesian2(B[0]*it.scaleFactor,B[1]*it.scaleFactor),heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()]},I={...l,width:E.imageSize[0],height:E.imageSize[1],heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new b.Cartesian2(-E.anchorPixelOffset[0]*it.scaleFactor,-E.anchorPixelOffset[1]*it.scaleFactor),imageSubRegion:new b.BoundingRectangle(...E.imagePixelOffset,...E.imageSize)},D=new Map;if(A.clustering._clusterLabelCollection)for(let R=0;R<A.clustering._clusterLabelCollection._labels.length;R++){const U=A.clustering._clusterLabelCollection._labels[R];if(!it.clusterImageAttribute)continue;const O=U.text,z=De(U.position),k={index:U.id.map(le=>A.entities.values.length-1-A.clustering._collectionIndicesByEntity[le.id].billboardIndex).sort((le,ue)=>le-ue),name:O,position:z},Q=this.getClusterStyle(x.cluster??c.ESEntityCluster.defaults.style.cluster,U.id.length).mode,V=it.clusterImageAttribute[Q],j=[-V.anchorPixelOffset[0]+V.textPixelOffset[0],-V.anchorPixelOffset[1]-V.textPixelOffset[1]],J={...s,pixelOffset:new b.Cartesian2(j[0]*it.scaleFactor,j[1]*it.scaleFactor),heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()]},ee={...l,width:V.imageSize[0],height:V.imageSize[1],heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new b.Cartesian2(-V.anchorPixelOffset[0]*it.scaleFactor,-V.anchorPixelOffset[1]*it.scaleFactor),imageSubRegion:new b.BoundingRectangle(...V.imagePixelOffset,...V.imageSize)},ie=a.addImage(e.id,e.typeName,ee,k),oe=a.addLabel(e.id,e.typeName,J,k);v.id=ie.id,v.layer=ie.layer,v.screenObjectIds.push(ie.screenObjectId),m.id=oe.id,m.layer=oe.layer,m.screenObjectIds.push(oe.screenObjectId);for(let le=0;le<U.id.length;le++)D.set(U.id[le].id,1)}for(let R=0;R<A.entities.values.length;R++){const U=A.entities.values[R];if(D.has(U.id)||!this.pointFeatures||!i.isPointVisible(De((S=U.position)==null?void 0:S.getValue())))continue;const O=((T=this.pointFeatures[this.featureArrName][R])==null?void 0:T.coordinates)??((w=this.pointFeatures[this.featureArrName][R])==null?void 0:w.geometry.coordinates),z=((C=this.pointFeatures[this.featureArrName][R])==null?void 0:C.name)??((M=this.pointFeatures[this.featureArrName][R].properties)==null?void 0:M.name)??(R+1).toString(),k={index:R,name:z,position:O},Q=a.addImage(e.id,e.typeName,I,k),V=a.addLabel(e.id,e.typeName,P,k);v.id=Q.id,v.layer=Q.layer,v.screenObjectIds.push(Q.screenObjectId),m.id=V.id,m.layer=V.layer,m.screenObjectIds.push(V.screenObjectId)}};g();const _=u.ad(c.createNextAnimateFrameEvent(e.showChanged,e.styleChanged,e.heightReferenceChanged,h.changed));u.ad(_.don(g))}return u}))})()}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}get dataSourceChanged(){return this._dataSource.changed}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}getClusterStyle(e,i){return e.find(o=>{if(o.value!==void 0)return o.value===i;const r=o.minValue!==void 0?o.minValue<=i:!0,a=o.maxValue!==void 0?o.maxValue>=i:!0;return r&&a})}};L(it,"type",it.register("ESCesiumViewer",c.ESEntityCluster.type,it)),L(it,"scaleFactor",.6),L(it,"scaleByDistance",new b.NearFarScalar(100,1,1e3,1)),L(it,"clusterImages"),L(it,"clusterImageAttribute"),L(it,"clusterImageUrl",c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"));let Zg=it;const Uc=class Uc extends Hn{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}};L(Uc,"type",Uc.register("ESCesiumViewer",gf.type,Uc));let $g=Uc;const Oc=class Oc extends Ln{constructor(e,i){super(e,i);L(this,"geoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Ot(i.viewer))return;this.geoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Ro(i,e.id));const{geoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??c.ESGeoWater.defaults.waterColor,frequency:(e.frequency??c.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??c.ESGeoWater.defaults.waterImage});else{const A=Object.assign({},Rh[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=!!(e.show&&e.stroked)},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=e.show&&e.filled},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{e.points&&e.points.length>=3?(a.positions=[...e.points,e.points[0]],s.points=[...e.points]):(a.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],s.points=[])};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(l))}this.ad(e.editingChanged.don(l=>{s.updateBoundingSphere(l)}))}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}updateWater(e){const{czmWater:i}=this;e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection}};L(Oc,"type",Oc.register("ESCesiumViewer",c.ESGeoWater.type,Oc));let Xg=Oc;const Yg=65536*65536,o_=1/Yg,wL=12,s_=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Jg=0,Sf=1,eu=2,Ef=5;class bL{constructor(n=new Uint8Array(16)){this.buf=ArrayBuffer.isView(n)?n:new Uint8Array(n),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(n,e,i=this.length){for(;this.pos<i;){const o=this.readVarint(),r=o>>3,a=this.pos;this.type=o&7,n(r,e,this),this.pos===a&&this.skip(o)}return e}readMessage(n,e){return this.readFields(n,e,this.readVarint()+this.pos)}readFixed32(){const n=this.dataView.getUint32(this.pos,!0);return this.pos+=4,n}readSFixed32(){const n=this.dataView.getInt32(this.pos,!0);return this.pos+=4,n}readFixed64(){const n=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Yg;return this.pos+=8,n}readSFixed64(){const n=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Yg;return this.pos+=8,n}readFloat(){const n=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,n}readDouble(){const n=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,n}readVarint(n){const e=this.buf;let i,o;return o=e[this.pos++],i=o&127,o<128||(o=e[this.pos++],i|=(o&127)<<7,o<128)||(o=e[this.pos++],i|=(o&127)<<14,o<128)||(o=e[this.pos++],i|=(o&127)<<21,o<128)?i:(o=e[this.pos],i|=(o&15)<<28,xL(i,n,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){const n=this.readVarint();return n%2===1?(n+1)/-2:n/2}readBoolean(){return!!this.readVarint()}readString(){const n=this.readVarint()+this.pos,e=this.pos;return this.pos=n,n-e>=wL&&s_?s_.decode(this.buf.subarray(e,n)):UL(this.buf,e,n)}readBytes(){const n=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,n);return this.pos=n,e}readPackedVarint(n=[],e){const i=this.readPackedEnd();for(;this.pos<i;)n.push(this.readVarint(e));return n}readPackedSVarint(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSVarint());return n}readPackedBoolean(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readBoolean());return n}readPackedFloat(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFloat());return n}readPackedDouble(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readDouble());return n}readPackedFixed32(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFixed32());return n}readPackedSFixed32(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSFixed32());return n}readPackedFixed64(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFixed64());return n}readPackedSFixed64(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSFixed64());return n}readPackedEnd(){return this.type===eu?this.readVarint()+this.pos:this.pos+1}skip(n){const e=n&7;if(e===Jg)for(;this.buf[this.pos++]>127;);else if(e===eu)this.pos=this.readVarint()+this.pos;else if(e===Ef)this.pos+=4;else if(e===Sf)this.pos+=8;else throw new Error(`Unimplemented type: ${e}`)}writeTag(n,e){this.writeVarint(n<<3|e)}realloc(n){let e=this.length||16;for(;e<this.pos+n;)e*=2;if(e!==this.length){const i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.dataView=new DataView(i.buffer),this.length=e}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(n){this.realloc(4),this.dataView.setInt32(this.pos,n,!0),this.pos+=4}writeSFixed32(n){this.realloc(4),this.dataView.setInt32(this.pos,n,!0),this.pos+=4}writeFixed64(n){this.realloc(8),this.dataView.setInt32(this.pos,n&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(n*o_),!0),this.pos+=8}writeSFixed64(n){this.realloc(8),this.dataView.setInt32(this.pos,n&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(n*o_),!0),this.pos+=8}writeVarint(n){if(n=+n||0,n>268435455||n<0){_L(n,this);return}this.realloc(4),this.buf[this.pos++]=n&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=n>>>7&127)))}writeSVarint(n){this.writeVarint(n<0?-n*2-1:n*2)}writeBoolean(n){this.writeVarint(+n)}writeString(n){n=String(n),this.realloc(n.length*4),this.pos++;const e=this.pos;this.pos=OL(this.buf,n,this.pos);const i=this.pos-e;i>=128&&a_(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i}writeFloat(n){this.realloc(4),this.dataView.setFloat32(this.pos,n,!0),this.pos+=4}writeDouble(n){this.realloc(8),this.dataView.setFloat64(this.pos,n,!0),this.pos+=8}writeBytes(n){const e=n.length;this.writeVarint(e),this.realloc(e);for(let i=0;i<e;i++)this.buf[this.pos++]=n[i]}writeRawMessage(n,e){this.pos++;const i=this.pos;n(e,this);const o=this.pos-i;o>=128&&a_(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o}writeMessage(n,e,i){this.writeTag(n,eu),this.writeRawMessage(e,i)}writePackedVarint(n,e){e.length&&this.writeMessage(n,EL,e)}writePackedSVarint(n,e){e.length&&this.writeMessage(n,PL,e)}writePackedBoolean(n,e){e.length&&this.writeMessage(n,IL,e)}writePackedFloat(n,e){e.length&&this.writeMessage(n,BL,e)}writePackedDouble(n,e){e.length&&this.writeMessage(n,TL,e)}writePackedFixed32(n,e){e.length&&this.writeMessage(n,FL,e)}writePackedSFixed32(n,e){e.length&&this.writeMessage(n,ML,e)}writePackedFixed64(n,e){e.length&&this.writeMessage(n,DL,e)}writePackedSFixed64(n,e){e.length&&this.writeMessage(n,RL,e)}writeBytesField(n,e){this.writeTag(n,eu),this.writeBytes(e)}writeFixed32Field(n,e){this.writeTag(n,Ef),this.writeFixed32(e)}writeSFixed32Field(n,e){this.writeTag(n,Ef),this.writeSFixed32(e)}writeFixed64Field(n,e){this.writeTag(n,Sf),this.writeFixed64(e)}writeSFixed64Field(n,e){this.writeTag(n,Sf),this.writeSFixed64(e)}writeVarintField(n,e){this.writeTag(n,Jg),this.writeVarint(e)}writeSVarintField(n,e){this.writeTag(n,Jg),this.writeSVarint(e)}writeStringField(n,e){this.writeTag(n,eu),this.writeString(e)}writeFloatField(n,e){this.writeTag(n,Ef),this.writeFloat(e)}writeDoubleField(n,e){this.writeTag(n,Sf),this.writeDouble(e)}writeBooleanField(n,e){this.writeVarintField(n,+e)}}function xL(t,n,e){const i=e.buf;let o,r;if(r=i[e.pos++],o=(r&112)>>4,r<128||(r=i[e.pos++],o|=(r&127)<<3,r<128)||(r=i[e.pos++],o|=(r&127)<<10,r<128)||(r=i[e.pos++],o|=(r&127)<<17,r<128)||(r=i[e.pos++],o|=(r&127)<<24,r<128)||(r=i[e.pos++],o|=(r&1)<<31,r<128))return ya(t,o,n);throw new Error("Expected varint not more than 10 bytes")}function ya(t,n,e){return e?n*4294967296+(t>>>0):(n>>>0)*4294967296+(t>>>0)}function _L(t,n){let e,i;if(t>=0?(e=t%4294967296|0,i=t/4294967296|0):(e=~(-t%4294967296),i=~(-t/4294967296),e^4294967295?e=e+1|0:(e=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),CL(e,i,n),SL(i,n)}function CL(t,n,e){e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos]=t&127}function SL(t,n){const e=(t&7)<<4;n.buf[n.pos++]|=e|((t>>>=3)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127)))))}function a_(t,n,e){const i=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(Math.LN2*7));e.realloc(i);for(let o=e.pos-1;o>=t;o--)e.buf[o+i]=e.buf[o]}function EL(t,n){for(let e=0;e<t.length;e++)n.writeVarint(t[e])}function PL(t,n){for(let e=0;e<t.length;e++)n.writeSVarint(t[e])}function BL(t,n){for(let e=0;e<t.length;e++)n.writeFloat(t[e])}function TL(t,n){for(let e=0;e<t.length;e++)n.writeDouble(t[e])}function IL(t,n){for(let e=0;e<t.length;e++)n.writeBoolean(t[e])}function FL(t,n){for(let e=0;e<t.length;e++)n.writeFixed32(t[e])}function ML(t,n){for(let e=0;e<t.length;e++)n.writeSFixed32(t[e])}function DL(t,n){for(let e=0;e<t.length;e++)n.writeFixed64(t[e])}function RL(t,n){for(let e=0;e<t.length;e++)n.writeSFixed64(t[e])}function UL(t,n,e){let i="",o=n;for(;o<e;){const r=t[o];let a=null,s=r>239?4:r>223?3:r>191?2:1;if(o+s>e)break;let l,u,A;s===1?r<128&&(a=r):s===2?(l=t[o+1],(l&192)===128&&(a=(r&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=t[o+1],u=t[o+2],(l&192)===128&&(u&192)===128&&(a=(r&15)<<12|(l&63)<<6|u&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=t[o+1],u=t[o+2],A=t[o+3],(l&192)===128&&(u&192)===128&&(A&192)===128&&(a=(r&15)<<18|(l&63)<<12|(u&63)<<6|A&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,i+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),i+=String.fromCharCode(a),o+=s}return i}function OL(t,n,e){for(let i=0,o,r;i<n.length;i++){if(o=n.charCodeAt(i),o>55295&&o<57344)if(r)if(o<56320){t[e++]=239,t[e++]=191,t[e++]=189,r=o;continue}else o=r-55296<<10|o-56320|65536,r=null;else{o>56319||i+1===n.length?(t[e++]=239,t[e++]=191,t[e++]=189):r=o;continue}else r&&(t[e++]=239,t[e++]=191,t[e++]=189,r=null);o<128?t[e++]=o:(o<2048?t[e++]=o>>6|192:(o<65536?t[e++]=o>>12|224:(t[e++]=o>>18|240,t[e++]=o>>12&63|128),t[e++]=o>>6&63|128),t[e++]=o&63|128)}return e}function Yr(t,n){this.x=t,this.y=n}Yr.prototype={clone(){return new Yr(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,n){return this.clone()._rotateAround(t,n)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){const n=t.x-this.x,e=t.y-this.y;return n*n+e*e},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},_matMult(t){const n=t[0]*this.x+t[1]*this.y,e=t[2]*this.x+t[3]*this.y;return this.x=n,this.y=e,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){const t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){const n=Math.cos(t),e=Math.sin(t),i=n*this.x-e*this.y,o=e*this.x+n*this.y;return this.x=i,this.y=o,this},_rotateAround(t,n){const e=Math.cos(t),i=Math.sin(t),o=n.x+e*(this.x-n.x)-i*(this.y-n.y),r=n.y+i*(this.x-n.x)+e*(this.y-n.y);return this.x=o,this.y=r,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:Yr},Yr.convert=function(t){if(t instanceof Yr)return t;if(Array.isArray(t))return new Yr(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new Yr(+t.x,+t.y);throw new Error("Expected [x, y] or {x, y} point format")};class l_{constructor(n,e,i,o,r){this.properties={},this.extent=i,this.type=0,this.id=void 0,this._pbf=n,this._geometry=-1,this._keys=o,this._values=r,n.readFields(LL,this,e)}loadGeometry(){const n=this._pbf;n.pos=this._geometry;const e=n.readVarint()+n.pos,i=[];let o,r=1,a=0,s=0,l=0;for(;n.pos<e;){if(a<=0){const u=n.readVarint();r=u&7,a=u>>3}if(a--,r===1||r===2)s+=n.readSVarint(),l+=n.readSVarint(),r===1&&(o&&i.push(o),o=[]),o&&o.push(new Yr(s,l));else if(r===7)o&&o.push(o[0].clone());else throw new Error(`unknown command ${r}`)}return o&&i.push(o),i}bbox(){const n=this._pbf;n.pos=this._geometry;const e=n.readVarint()+n.pos;let i=1,o=0,r=0,a=0,s=1/0,l=-1/0,u=1/0,A=-1/0;for(;n.pos<e;){if(o<=0){const h=n.readVarint();i=h&7,o=h>>3}if(o--,i===1||i===2)r+=n.readSVarint(),a+=n.readSVarint(),r<s&&(s=r),r>l&&(l=r),a<u&&(u=a),a>A&&(A=a);else if(i!==7)throw new Error(`unknown command ${i}`)}return[s,u,l,A]}toGeoJSON(n,e,i){const o=this.extent*Math.pow(2,i),r=this.extent*n,a=this.extent*e,s=this.loadGeometry();function l(f){return[(f.x+r)*360/o-180,360/Math.PI*Math.atan(Math.exp((1-(f.y+a)*2/o)*Math.PI))-90]}function u(f){return f.map(l)}let A;if(this.type===1){const f=[];for(const d of s)f.push(d[0]);const p=u(f);A=f.length===1?{type:"Point",coordinates:p[0]}:{type:"MultiPoint",coordinates:p}}else if(this.type===2){const f=s.map(u);A=f.length===1?{type:"LineString",coordinates:f[0]}:{type:"MultiLineString",coordinates:f}}else if(this.type===3){const f=kL(s),p=[];for(const d of f)p.push(d.map(u));A=p.length===1?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p}}else throw new Error("unknown feature type");const h={type:"Feature",geometry:A,properties:this.properties};return this.id!=null&&(h.id=this.id),h}}l_.types=["Unknown","Point","LineString","Polygon"];function LL(t,n,e){t===1?n.id=e.readVarint():t===2?zL(e,n):t===3?n.type=e.readVarint():t===4&&(n._geometry=e.pos)}function zL(t,n){const e=t.readVarint()+t.pos;for(;t.pos<e;){const i=n._keys[t.readVarint()],o=n._values[t.readVarint()];n.properties[i]=o}}function kL(t){const n=t.length;if(n<=1)return[t];const e=[];let i,o;for(let r=0;r<n;r++){const a=QL(t[r]);a!==0&&(o===void 0&&(o=a<0),o===a<0?(i&&e.push(i),i=[t[r]]):i&&i.push(t[r]))}return i&&e.push(i),e}function QL(t){let n=0;for(let e=0,i=t.length,o=i-1,r,a;e<i;o=e++)r=t[e],a=t[o],n+=(a.x-r.x)*(r.y+a.y);return n}class VL{constructor(n,e){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=n,this._keys=[],this._values=[],this._features=[],n.readFields(NL,this,e),this.length=this._features.length}feature(n){if(n<0||n>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[n];const e=this._pbf.readVarint()+this._pbf.pos;return new l_(this._pbf,e,this.extent,this._keys,this._values)}}function NL(t,n,e){t===15?n.version=e.readVarint():t===1?n.name=e.readString():t===5?n.extent=e.readVarint():t===2?n._features.push(e.pos):t===3?n._keys.push(e.readString()):t===4&&n._values.push(HL(e))}function HL(t){let n=null;const e=t.readVarint()+t.pos;for(;t.pos<e;){const i=t.readVarint()>>3;n=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}if(n==null)throw new Error("unknown feature value");return n}class GL{constructor(n,e){this.layers=n.readFields(WL,{},e)}}function WL(t,n,e){if(t===3){const i=new VL(e,e.readVarint()+e.pos);i.length&&(n[i.name]=i)}}function jL(t){let n,e;if(Reflect.has(t,"type")&&t.type==="symbol"&&Reflect.has(t,"layout")){const i=t.layout;if(Reflect.has(i,"icon-image")){e={},e.image=i["icon-image"];const{horizontalOrigin:o,verticalOrigin:r}=u_(i["icon-anchor"]??"center");if(e.horizontalOrigin=o,e.verticalOrigin=r,Reflect.has(t,"paint")){const a=t.paint;e.color=b.Color.fromCssColorString(a["icon-color"]??"#FF0000").withAlpha(a["icon-opacity"]??1)}e.rotation=b.Math.toRadians(i["icon-rotate"]??0),e.scale=i["icon-size"]??1,e.show=(i.visibility??"visible")==="visible"}if(Reflect.has(i,"text-field")){n={},n.text=i["text-field"];const{horizontalOrigin:o,verticalOrigin:r}=u_(i["text-anchor"]??"center");if(n.horizontalOrigin=o,n.verticalOrigin=r,Reflect.has(t,"paint")){const a=t.paint;n.fillColor=b.Color.fromCssColorString(a["text-color"]??"#FFFFFF").withAlpha(a["text-opacity"]??1)}n.font=`${i["text-size"]??16}px ${i["text-font"]??"sans-serif"}`,n.show=(i.visibility??"visible")==="visible"}}return{labelStyle:n,billboardStyle:e}}function u_(t){let n=b.HorizontalOrigin.CENTER,e=b.VerticalOrigin.CENTER;switch(t){case"center":break;case"left":n=b.HorizontalOrigin.LEFT;break;case"right":n=b.HorizontalOrigin.RIGHT;break;case"top":e=b.VerticalOrigin.TOP;break;case"bottom":e=b.VerticalOrigin.BOTTOM;break;case"top-left":n=b.HorizontalOrigin.LEFT,e=b.VerticalOrigin.TOP;break;case"top-right":n=b.HorizontalOrigin.RIGHT,e=b.VerticalOrigin.TOP;break;case"bottom-left":n=b.HorizontalOrigin.LEFT,e=b.VerticalOrigin.BOTTOM;break;case"bottom-right":n=b.HorizontalOrigin.RIGHT,e=b.VerticalOrigin.BOTTOM;break}return{horizontalOrigin:n,verticalOrigin:e}}class qL extends c.Destroyable{constructor(e,i){super();L(this,"czmViewer");L(this,"czmESMVTLayer");L(this,"screenManager");L(this,"cacheSize",100);L(this,"urlMap",new Map);L(this,"tileScheme","xyz");L(this,"minimumLevel",0);L(this,"maximumLevel",18);L(this,"_cache",new Map);L(this,"lastTiles",new Map);this.czmViewer=e,this.czmESMVTLayer=i;const o=this.czmViewer.viewer;if(!o)return;const r=Ot(o);if(!r)return;this.screenManager=r.screenManager,this.tileScheme=i.sceneObject.scheme??"xyz",this.maximumLevel=i.sceneObject.maximumLevel,this.minimumLevel=i.sceneObject.minimumLevel,(()=>{do{if(!i.mvtLayerJson)break;if(typeof i.mvtLayerJson.mainJson=="string"){this.urlMap.set("customSource",[i.mvtLayerJson.mainJson]);break}if(typeof i.mvtLayerJson.mainJson=="object"){const s=i.mvtLayerJson.mainJson.sources;for(const l in s){const u=s[l];u.type==="vector"&&Reflect.has(u,"tiles")&&this.urlMap.set(l,u.tiles)}break}}while(!1)})(),this.ad(()=>{var l;const s=Array.from(this.lastTiles.values()).map(u=>u.featureTable).map(u=>Object.values(u)).flat(1/0);s&&((l=this.screenManager)==null||l.remove("default",this.czmESMVTLayer.sceneObject.id,s)),this.cache&&(this.cache.clear(),this.cache=null)})}get cache(){return this._cache}set cache(e){this._cache=e}addTiles(e){var a;if(this.urlMap.size==0)return;if(this.cache&&this.cache.has(e)&&this.lastTiles.has(e)){this.updateTiles([e],"show");return}const[i,o,r]=e.split("-").map(Number);(a=this.cache)==null||a.set(e,new Map),this.requestImage(o,r,i,e)}updateTiles(e,i="hide"){var o,r;for(let a=0;a<e.length;a++){const s=e[a],l=this.lastTiles.get(s);if(l){const u=Object.keys(l.featureTable);for(let A=0;A<u.length;A++){const h=u[A],f=l.featureTable[h];i=="delete"?(o=this.screenManager)==null||o.remove(l.layer,l.id,f):(r=this.screenManager)==null||r.update(l.layer,l.id,f,{all:{show:i=="show"}})}}i=="delete"&&this.lastTiles.delete(s)}}update(e){const i=Array.from(this.lastTiles.keys()),o=i.filter(s=>!e.includes(s)),r=i.filter(s=>e.includes(s)),a=e.filter(s=>!i.includes(s));this.updateTiles(o),this.updateTiles(r,"show");for(let s=0;s<a.length;s++){const l=a[s];this.addTiles(l)}}requestImage(e,i,o,r){const a=this.tileScheme=="tms"?Math.pow(2,o)-i-1:i;this.urlMap.size!=0&&this.urlMap.entries().forEach(([s,l])=>{if(l.length!=0&&l[0].includes("{z}")){const u=l[0].replace(/{z}/g,o.toString()).replace(/{x}/g,e.toString()).replace(/{y}/g,a.toString());fetch(u).then(A=>{var h,f;if(A.ok&&((h=this.cache)!=null&&h.has(r))&&((f=this.cache.get(r))==null?void 0:f.size)==0)return A.arrayBuffer()}).then(A=>{var d;const h=new bL(A),f=new GL(h),p=new Map;for(const m in f.layers){const v=f.layers[m];if(v.length<=0||v.feature(0).type!==1)continue;const y=[];for(let g=0;g<v.length;g++){const _=v.feature(g);y.push(_.toGeoJSON(e,i,o))}p.set(m,y)}(d=this.cache)==null||d.set(r,p),this.addScreenManage(r,p),this.clearCache()})}})}clearCache(){if(!this.cache)return;const e=this.cache.size-this.cacheSize;if(!(e<=0))for(let i=0;i<e;i++){const o=this.cache.keys().next().value;o&&(this.updateTiles([o],"delete"),this.cache.delete(o))}}addScreenManage(e,i){this.lastTiles.set(e,{layer:"default",id:this.czmESMVTLayer.sceneObject.id,featureTable:{}});const o=this.lastTiles.get(e);for(const[r,a]of i.entries()){const s=this.czmESMVTLayer.mvtLayerJson.pointJson.find(l=>l["source-layer"]==r)??{};for(const l of a){const{labelStyle:u,billboardStyle:A}=jL(s);let h,f;u&&(u.show=!this.screenManager.avoidanceManager.enable,h=this.screenManager.addLabel(this.czmESMVTLayer.sceneObject.id,"default",u??{},{position:l.geometry.coordinates,name:l.properties.NAME??l.properties.name,index:l.id})),A&&(A.show=!this.screenManager.avoidanceManager.enable,f=this.screenManager.addImage(this.czmESMVTLayer.sceneObject.id,"default",A??{},{position:l.geometry.coordinates,name:l.properties.NAME??l.properties.name,index:l.id})),o.featureTable[r]||(o.featureTable[r]=[]),h&&o.featureTable[r].push(h.screenObjectId),f&&o.featureTable[r].push(f.screenObjectId)}}}reset(){if(!this.cache)return;const e=Array.from(this.cache.keys());this.update([]),setTimeout(()=>{this.update(e)})}}class KL extends c.Destroyable{constructor(e,i){super();L(this,"vectorTilesCache");L(this,"czmViewer");L(this,"czmESMVTLayer");this.czmViewer=e,this.czmESMVTLayer=i,this.vectorTilesCache=this.ad(new qL(e,i)),this.updateTiles();const o=this.czmViewer.viewer.scene.globe._surface.tileLoadProgressEvent.addEventListener(r=>{r==0&&this.updateTiles()});this.ad(()=>{o()})}updateTiles(){const e=this.czmViewer.viewer;if(!e)return;const i=new Set;for(let o=0;o<e.scene.globe._surface._tilesToRender.length;o++){const r=e.scene.globe._surface._tilesToRender[o];if(r.data)for(let a=0;a<r.data.imagery.length;a++){const s=r.data.imagery[a],l=s.loadingImagery??s.readyImagery;if(l){const u=`${l.level}-${l.x}-${l.y}`;i.add(u)}}}this.vectorTilesCache.update(Array.from(i))}}const Lc=class Lc extends Hn{constructor(e,i){super(e,i);L(this,"_czmImagery");L(this,"_mvtLayerJson",this.disposeVar(c.reactJson({mainJson:"",pointJson:[],otherJson:[]})));L(this,"mvtLayerJsonChanged",this.ad(new c.Event));if(this._czmImagery=this.dv(new Zr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"zIndex"],[e,"zIndex"])),this.d(c.track([r,"rectangle"],[e,"rectangle"])),this.d(c.track([r,"alpha"],[e,"opacity"])),this.d(c.track([r,"splitDirection"],[e,"splitDirection"])),this.d(c.track([r,"brightness"],[e,"czmBrightness"])),this.d(c.track([r,"contrast"],[e,"czmContrast"])),this.d(c.track([r,"hue"],[e,"czmHue"])),this.d(c.track([r,"saturation"],[e,"czmSaturation"])),this.d(c.track([r,"gamma"],[e,"czmGamma"]));{const s=this.dv(c.createNextAnimateFrameEvent(e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.schemeChanged,this.mvtLayerJsonChanged)),l=()=>{!this.mvtLayerJson||this.mvtLayerJson.otherJson.length==0||(r.imageryProvider={type:"MVTImageryProvider",url:this.mvtLayerJson.mainJson,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:this.mvtLayerJson.otherJson,scheme:e.scheme})};l(),this.d(s.don(l))}{const s=A=>{const h=structuredClone(A);Reflect.deleteProperty(h,"layers"),this.mvtLayerJson={mainJson:h,pointJson:A.layers.filter(f=>f.type=="symbol"),otherJson:A.layers.filter(f=>f.type!="symbol")}},l=async()=>{var A;if(typeof e.url=="string")if(e.url.includes("{z}"))this.mvtLayerJson.mainJson=e.url;else{const h=await fetch(e.url);if((A=h.headers.get("Content-Type"))!=null&&A.includes("json")){const f=await h.json();s(f)}}else s(e.url);e.style&&e.style.length!=0&&(this.mvtLayerJson.pointJson=e.style.filter(h=>h.type=="symbol"),this.mvtLayerJson.otherJson=e.style.filter(h=>h.type!="symbol")),this.mvtLayerJsonChanged.emit()};l();const u=this.ad(c.createNextAnimateFrameEvent(e.urlChanged,e.styleChanged));this.ad(u.don(l))}const a=this.ad(c.createNextAnimateFrameEvent(e.schemeChanged,e.maximumLevelChanged,e.minimumLevelChanged,this.mvtLayerJsonChanged,e.showChanged));this.ad(new c.ObjResettingWithEvent(a,()=>{if(e.show)return new KL(i,this)}))}get czmImagery(){return this._czmImagery}get mvtLayerJson(){return this._mvtLayerJson.value}set mvtLayerJson(e){this._mvtLayerJson.value=e}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Lc,"type",Lc.register("ESCesiumViewer",mf.type,Lc));let ey=Lc;class ZL extends c.Destroyable{constructor(n,e){super(),this._czmESPipeFence=n,this._sceneObject=e;const i=this._sceneObject,o=this._czmESPipeFence,r=o.czmCustomPrimitive;if(!i.points||i.points.length<2){this.clear(r);return}const a=i.points.length;let s=[],l=[],u=[],A=[],h=[];for(let y=0;y<a-1;y++){const{outlinePionts:g,customPrimitivePoints:_}=this.divideFourPoints(i.points[y],i.points[y+1]);A.push(..._),h.push(...g),u.push(...this.setIndexs(y))}const[f,p,d]=wn({originPosition:A[0]},A),m=this.setFaces(f);s.push(...m.flat());const v=this.setTextureCoordinates(i,o);l.push(...v.flat()),o.computeBoundingBox(),this.updateCustomPrimitive(r,p,s,u,l)}divideFourPoints(n,e){const i=c.geoHeading(n,e),o=c.geoDestination(n,this._sceneObject.width/2,90+i),r=c.geoDestination(n,this._sceneObject.width/2,i-90),a=c.geoDestination(e,this._sceneObject.width/2,i-90),s=c.geoDestination(e,this._sceneObject.width/2,90+i),l=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],A=[r[0],r[1],r[2]+this._sceneObject.height/2],h=[r[0],r[1],r[2]-this._sceneObject.height/2],f=[s[0],s[1],s[2]+this._sceneObject.height/2],p=[s[0],s[1],s[2]-this._sceneObject.height/2],d=[a[0],a[1],a[2]+this._sceneObject.height/2],m=[a[0],a[1],a[2]-this._sceneObject.height/2],v=[[l,A],[l,f],[l,u],[u,p]],y=[[u,h],[A,d],[A,h],[h,m]],g=[[f,p],[f,d],[p,m],[d,m]];return{outlinePionts:[...v,...y,...g],customPrimitivePoints:[u,l,A,h,p,f,d,m]}}setIndexs(n){const e=n*16;return[e+1,e+0,e+3,e+1,e+3,e+2,e+5,e+4,e+7,e+6,e+5,e+7,e+9,e+8,e+11,e+9,e+11,e+10,e+13,e+12,e+15,e+13,e+15,e+14]}setFaces(n){const e=[],i=n.length/8;for(let r=0;r<i;r++){const a=n.slice(8*r,8*(r+1));e.push(a)}return[...e.map(r=>[r[4],r[5],r[1],r[0],r[5],r[6],r[2],r[1],r[6],r[7],r[3],r[2],r[7],r[4],r[0],r[3]]).flat()]}getDistances(n,e){const[i]=wn({originPosition:n[0]},n),o=i.length,r=i.reduce((l,u,A,h)=>{if(A===0)return l.push(0),l;const f=A-1,p=h[f],d=Math.sqrt((p[0]-u[0])*(p[0]-u[0])+(p[1]-u[1])*(p[1]-u[1]));return l.push(l[f]+d),l},[]),a=r[o-1];return e.distances=a,r.map(l=>l/a)}setTextureCoordinates(n,e){if(!n.points||n.points.length<2)return;const i=this.getDistances(n.points,e),o=[];for(let r=1;r<i.length;r++){let a=[];if(r===i.length-1){const s=[1,0,1,1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}else{const s=[i[r],0,i[r],1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}o.push(a)}return o}updateCustomPrimitive(n,e,i,o,r){n.modelMatrix=e,n.indexTypedArray=new Uint16Array(o),n.attributes={position:{typedArray:new Float32Array(i),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(r),componentsPerAttribute:2}}}clear(n){n.indexTypedArray=void 0,n.modelMatrix=void 0,n.attributes=void 0}}const zc=class zc extends sn{constructor(e,i){super(e,i);L(this,"_line",this.dv(new Ye(this.czmViewer,this.sceneObject.id)));L(this,"_czmTexture",this.ad(new ft(this.czmViewer,this.sceneObject.id)));L(this,"_czmCustomPrimitive",this.dv(new ut(this.czmViewer,this.sceneObject.id)));L(this,"_distances",this.dv(c.react(0)));if(!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmTexture,a=this._line;this.d(c.bind([a,"positions"],[e,"points"])),this.d(c.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(c.track([this.line,"color"],[e,"strokeColor"])),this.d(c.track([this.line,"width"],[e,"strokeWidth"])),this.d(c.track([this.line,"ground"],[e,"strokeGround"]));{const A=this.dv(c.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new c.ObjResettingWithEvent(A,()=>new ZL(this,this.sceneObject)))}{const A=()=>{a.show=e.show&&e.stroked};A();const h=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(h.don(A))}this.bindCustomPrimitive(e);let s="";const l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const A=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?s=u:e.materialMode==="color"?s="":s=l,r.uri=s,s==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
|
|
3597
|
+
`};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(s.disposableOn(a))}this.dispose(this.flyToEvent.disposableOn(a=>{this.czmCustomPrimitive.flyTo(a)}));{const a=()=>{const l=r.value?r.value:1,u=this.height??pr.defaults.height,{textureSizeInMeters:A=pr.defaults.textureSizeInMeters}=this,{textureUri:h=pr.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:h},u_stScale:[l/A[0],u/A[1]],u_speed:this.textureMoveSpeed??pr.defaults.textureMoveSpeed,u_color:this.textureColor??pr.defaults.textureColor}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,r.changed));this.dispose(s.disposableOn(a))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmCustomPrimitive(){return this._czmCustomPrimitive}get geoBoundingSphere(){return this._geoBoundingSphere.value}get geoBoundingSphereChanged(){return this._geoBoundingSphere.changed}};L(pr,"defaults",{show:!0,allowPicking:!1,positions:[],height:1e3,textureSizeInMeters:[500,500],textureUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",textureMoveSpeed:[0,.3],textureColor:[1,1,1,1]});let $o=pr;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:c.reactPositions(void 0),height:void 0,textureSizeInMeters:c.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:c.reactArrayWithUndefined(void 0),textureColor:c.reactArrayWithUndefined(void 0)})})($o||($o={})),c.extendClassProps($o.prototype,$o.createDefaultProps);const Tc=class Tc extends sn{constructor(e,i){super(e,i);L(this,"_czmPolygonFence");L(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new $o(i,e.id)),this._czmPolygon=this.dv(new c.ESGeoPolygon),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmPolygonFence,a=this._czmPolygon;i.add(a),this.dispose(()=>i.delete(a)),a.filled=!1,this.d(c.track([a,"points"],[e,"points"])),this.d(c.track([a,"stroked"],[e,"stroked"])),this.d(c.track([a,"strokeColor"],[e,"strokeColor"])),this.d(c.track([a,"strokeWidth"],[e,"strokeWidth"])),this.d(c.track([a,"strokeGround"],[e,"strokeGround"]));{const s={danger:{color:[.99,.98,.57,1],image:"01.png"},checkerboard:{color:[.88,.98,.99,1],image:"02.png"},warning:{color:[1,.93,.58,1],image:"03.png"},cord:{color:[.91,.87,.56,1],image:"04.png"},scanline:{color:[.43,.78,.8,1],image:"05.png"},honeycomb:{color:[.28,.84,.86,1],image:"06.png"},gradientColor:{color:[1,1,1,1],image:"07.png"}},l=(f,p)=>{switch(f){case"danger":return{textureMoveSpeed:[.05,0],textureSizeInMeters:[2,2]};case"checkerboard":return{textureMoveSpeed:[0,0],textureSizeInMeters:[2,2]};case"warning":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"cord":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"scanline":return{textureMoveSpeed:[0,0],textureSizeInMeters:[p,p]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[p,p]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[p,p]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[p*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",A=()=>{const f=e.materialMode,p=s[f];if(!p)return;r.textureUri=u+p.image,r.textureColor=f!=="gradientColor"?p.color:e.fillColor;const{textureMoveSpeed:d,textureSizeInMeters:m}=l(f,e.height);r.textureMoveSpeed=d,r.textureSizeInMeters=m};A();const h=this.disposeVar(c.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(h.disposableOn(A))}{this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"height"],[e,"height"]));{const s=()=>{r.show=e.show&&e.filled};s();const l=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(l.don(s))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(bn(r,o,i,e,a.czmCustomPrimitive),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(bn(r,o,i,e,a.czmCustomPrimitive),!0):!1}};L(Tc,"type",Tc.register("ESCesiumViewer",c.ESPolygonFence.type,Tc));let Hg=Tc;const Ic=class Ic extends sn{constructor(e,i){super(e,i);L(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRectangle;this.dispose(c.bind([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(c.bind([r,"height"],[e,"height"])),this.dispose(c.bind([r,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(c.bind([r,"rectangle"],[e,"rectangle"])),this.dispose(c.bind([r,"stRotation"],[e,"stRotation"])),this.dispose(c.bind([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"]));{const a=()=>{const s=e.points;if(s&&s.length>=2){const{minPos:l,maxPos:u}=c.getMinMaxCorner(s);r.rectangle=[l[0],l[1],u[0],u[1]],r.height=s[1][2],r.extrudedHeight=s[0][2]}else r.rectangle=void 0,r.height=0,r.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}{const a=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material={type:"Color",color:[1,1,1,0]}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(s.disposableOn(a))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}};L(Ic,"type",Ic.register("ESCesiumViewer",c.ESRectangle.type,Ic));let Gg=Ic;const uo=class uo extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=c.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],uo.defaults.imageUrl),a=this.disposeVar(c.react(void 0)),s=()=>{const g=b.Material.fromType(b.Material.ImageType);g.uniforms.image=r.value,g.uniforms.repeat=Ze(this.repeat??uo.defaults.repeat),a.value=g};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(r.changed,this.repeatChanged));this.dispose(l.disposableOn(s));const u=(g,_)=>{const x=new b.PolylineMaterialAppearance({material:_,renderState:{depthTest:{enabled:!1}}});x.renderState.depthMask=!1;const E=[];if(g.length<2)return;E.push(new b.GeometryInstance({geometry:new b.GroundPolylineGeometry({positions:g,width:this.width??uo.defaults.width,vertexFormat:b.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:b.ArcType[this.arcType??uo.defaults.arcType]}),id:this}));const B=new Bi({geometryInstances:E,appearance:x,asynchronous:!1,allowPicking:this.allowPicking??uo.defaults.allowPicking,compressVertices:!1});return B.ESSceneObjectID=i,B};let A;const h=new b.BoundingSphere,f=()=>{A&&(o.scene.primitives.remove(A),A=void 0)};this.dispose(f);const p=()=>{if(f(),!this.positions)return;const g=Yt(this.positions);if(g.length<2||!a.value){h.radius=-1;return}b.BoundingSphere.fromPoints(g,h),A=u(g,a.value),A&&o.scene.primitives.add(A)},d=()=>{A&&(A.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(g=>{if(e.actived&&h.radius>0){const _=De(h.center);_&&Fe(o,_,h.radius*4,void 0,g)}})),p(),d();const m=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,a.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(m.disposableOn(()=>{p(),d()}));const v=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged));this.dispose(v.disposableOn(()=>{d()}));const{extensions:y}=e;if(!y){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};L(uo,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Xo=uo;(t=>{t.createDefaultProps=()=>({show:void 0,positions:c.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Xo||(Xo={})),c.extendClassProps(Xo.prototype,Xo.createDefaultProps);const Fc=class Fc extends sn{constructor(e,i){super(e,i);L(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Xo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRoad;{const a=()=>{r.show=e.show&&e.stroked};a();const s=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.don(a))}this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"width"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(c.track([r,"repeat"],[e,"repeat"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Fc,"type",Fc.register("ESCesiumViewer",xf.type,Fc));let Wg=Fc;const Mc=class Mc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends c.Destroyable{constructor(s,l,u){super(),this._subContainer=s;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));{const m=()=>{A.style.display=e.show??c.ESScale.defaults.show?"block":"none"};m(),e.dispose(e.showChanged.disposableOn(m))}A.style.position="fixed",A.style.width="125px",A.style.height="30px",A.style.border="1px solid rgba(49,50,56,.8)",A.style.padding="0 5px",A.style.backgroundColor="rgba(37,38,42,.8)",A.style.borderRadius="15px",A.style.pointerEvents="auto",A.style.transition=" right 0.4s linear";{const m=()=>{A.style.bottom=`${e.cssPosition?e.cssPosition[0]:c.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(A.style.right="auto",A.style.left=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`):(A.style.left="auto",A.style.right=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`)},v=this.disposeVar(c.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));m(),this.dispose(v.disposableOn(()=>m()))}const h=document.createElement("div");A.appendChild(h),this.dispose(()=>A.removeChild(h)),h.style.width="125px",h.style.display="inline-block",h.style.textAlign="center",h.style.fontSize="14px",h.style.fontWeight="lighter",h.style.lineHeight="30px",h.style.color="#fff",h.innerHTML="1000km";const f=document.createElement("div");A.appendChild(f),this.dispose(()=>A.removeChild(f)),f.style.borderRight="1px solid #fff",f.style.borderLeft="1px solid #fff",f.style.borderBottom="1px solid #fff",f.style.position="absolute",f.style.height="10px",f.style.top="15px",f.style.width="75px",f.style.left="30px";const p=()=>{const m=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||m&&m>1e6)A.style.display="none";else{A.style.display="block";const v=i.viewerLegend.legend.computedLengthInStr;v&&(h.innerHTML=v);const y=i.viewerLegend.legend.computedLengthInPixels;if(y){f.style.width=`${y}px`;const g=(135-y)/2;f.style.left=`${g}px`}}};p();const d=setInterval(()=>{p()},200);this.dispose(()=>clearInterval(d))}}}get customDiv(){return this._customDiv}};L(Mc,"type",Mc.register("ESCesiumViewer",c.ESScale.type,Mc));let jg=Mc;const Dc=class Dc extends He{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new ut(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmCustomPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"position"],[e,"position"])),this.dispose(c.track([r,"scale"],[e,"scale"])),this.dispose(c.track([r,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(c.track([r,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(c.track([r,"maximumScale"],[e,"maximumScale"])),this.dispose(c.track([r,"minimumScale"],[e,"minimumScale"])),this.dispose(c.track([r,"pixelSize"],[e,"pixelSize"])),this.dispose(c.track([r,"showSceneScale"],[e,"showSceneScale"])),this.dispose(c.track([r,"modelMatrix"],[e,"modelMatrix"])),this.dispose(c.track([r,"cull"],[e,"cull"])),this.dispose(c.track([r,"boundingVolume"],[e,"boundingVolume"])),this.dispose(c.track([r,"pass"],[e,"pass"])),this.dispose(c.track([r,"primitiveType"],[e,"primitiveType"])),this.dispose(c.track([r,"renderState"],[e,"renderState"])),this.dispose(c.track([r,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(c.track([r,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(c.track([r,"uniformMap"],[e,"uniformMap"])),this.dispose(c.track([r,"attributes"],[e,"attributes"])),this.dispose(c.track([r,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(c.track([r,"attributesJson"],[e,"attributesJson"])),this.dispose(c.track([r,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(c.track([r,"count"],[e,"count"])),this.dispose(c.track([r,"offset"],[e,"offset"])),this.dispose(c.track([r,"instanceCount"],[e,"instanceCount"])),this.dispose(c.track([r,"localPosition"],[e,"localPosition"])),this.dispose(c.track([r,"localScale"],[e,"localScale"])),this.dispose(c.track([r,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(c.track([r,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(c.track([r,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(c.track([r,"occlude"],[e,"occlude"])),this.dispose(c.track([r,"castShadows"],[e,"castShadows"])),this.dispose(c.track([r,"receiveShadows"],[e,"receiveShadows"])),this.dispose(c.track([r,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(c.track([r,"pickOnly"],[e,"pickOnly"])),this.dispose(c.track([r,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const a=()=>{if(e.localRotation){const s=[...e.localRotation];s[0]-=90,r.localRotation=s}else r.localRotation=[-90,0,0]};a(),this.dispose(e.localRotationChanged.disposableOn(a))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(bn(r,o,i,e,a,!0),!0):!1}};L(Dc,"type",Dc.register("ESCesiumViewer",wf.type,Dc));let qg=Dc;const Rc=class Rc extends df{constructor(e,i){super(e,i);L(this,"czmGeoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Ot(i.viewer))return;this.czmGeoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Ro(i,e.id));const{czmGeoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??c.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??c.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESDynamicWater.defaults.flowSpeed});else{const A=Object.assign({},Rh[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=e.show&&e.stroked},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=!!(e.show&&e.filled)},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{if(!e.points||e.points&&e.points.length<=2){a.positions=[],s.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const A=e.points.map(f=>[f[0],f[1],0]),[h]=_r({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},A);a.positions=[...h,h[0]],s.points=[...h]};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(l))}}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Mn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&a),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&a)}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmWater:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a!=null&&a.points?(Me(r,o,i,a.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:i}=this;i&&(e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection)}};L(Rc,"type",Rc.register("ESCesiumViewer",c.ESDynamicWater.type,Rc));let Kg=Rc;const it=class it extends Hn{constructor(e,i){super(e,i);L(this,"_dataSource",this.disposeVar(c.react(void 0)));L(this,"_pointFeatures",this.disposeVar(c.reactJsonWithUndefined(void 0)));L(this,"featureArrName","features");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=Ot(o);if(!r)return;const{screenManager:a}=r,s={scale:1*it.scaleFactor,font:"16px sans-serif",verticalOrigin:b.VerticalOrigin.BOTTOM,horizontalOrigin:b.HorizontalOrigin.CENTER,scaleByDistance:it.scaleByDistance,eyeOffset:new b.Cartesian3(0,0,-10),show:!0},l={scale:1*it.scaleFactor,verticalOrigin:b.VerticalOrigin.BOTTOM,horizontalOrigin:b.HorizontalOrigin.CENTER,scaleByDistance:it.scaleByDistance,image:it.clusterImageUrl};(async()=>{if(it.clusterImageAttribute===void 0){const u=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(u).then(A=>A.json()).then(A=>{it.clusterImageAttribute=A}).catch(A=>{console.error(A)})}{const u=()=>{if(!e.data){this.pointFeatures=void 0;return}this.featureArrName=e.data.type=="FeatureCollection"?"features":"geometries";const A={type:e.data.type,[this.featureArrName]:[]};if(e.data.type==="FeatureCollection")for(let h=0;h<e.data.features.length;h++){const f=e.data.features[h];if(f.geometry.type=="Point")A[this.featureArrName].push(f);else if(f.geometry.type=="MultiPoint")for(let p=0;p<f.geometry.coordinates.length;p++)A[this.featureArrName].push({type:"Feature",geometry:{type:"Point",coordinates:f.geometry.coordinates[p]},properties:f.properties??{}});else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",f.geometry.type)}else if(e.data.type=="GeometryCollection")for(let h=0;h<e.data.geometries.length;h++){const f=e.data.geometries[h];if(f.type=="Point")A[this.featureArrName].push(f);else if(f.type=="MultiPoint")for(let p=0;p<f.coordinates.length;p++)A[this.featureArrName].push({type:"Feature",geometry:{type:"Point",coordinates:f.coordinates[p]},properties:f.properties??{}});else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",f.type)}this.pointFeatures=A};u(),this.ad(e.dataChanged.don(u))}{const u=()=>{this.dataSource&&o.dataSources.remove(this.dataSource),this.dataSource=void 0};this.ad(()=>u());const A=()=>{u(),this.pointFeatures&&b.GeoJsonDataSource.load(this.pointFeatures).then(h=>{o.dataSources.add(h).then(()=>{this.dataSource=h})})};A(),this.ad(this.pointFeaturesChanged.don(A))}this.ad(new c.ObjResettingWithEvent(this.dataSourceChanged,()=>{var d;if(!this.dataSource)return;const u=new c.Destroyable,A=this.dataSource;A.clustering.enabled=A.clustering.clusterBillboards=A.clustering.clusterLabels=A.clustering.clusterPoints=!0;for(let m=0;m<A.entities.values.length;m++){const v=A.entities.values[m];v.billboard&&(v.billboard.color=new b.ConstantProperty(b.Color.TRANSPARENT))}{const m=()=>{const y=A.clustering.pixelRange;A.clustering.pixelRange=0,A.clustering.pixelRange=y};m();let v=(d=this.czmViewer.viewer)==null?void 0:d.camera.moveEnd.addEventListener(()=>{m()});u.d(()=>{var y;v&&((y=this.czmViewer.viewer)==null||y.camera.moveEnd.removeEventListener(v))})}u.d(c.track([A.clustering,"pixelRange"],[e,"pixelRange"])),u.d(c.track([A.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),A.clustering.clusterEvent.addEventListener((m,v)=>{v.label&&(v.label.show=!1),v.billboard&&(v.billboard.show=!1),v.point&&(v.point.show=!1)});const h=u.ad(c.react(!1));let f=[];const p=o.scene.postUpdate.addEventListener(()=>{if(A.clustering._clusterLabelCollection)if(A.clustering._clusterLabelCollection._labels.length!=f.length||!A.clustering._clusterLabelCollection._labels.every(m=>f.includes(m.id.length))){f=[];for(let m=0;m<A.clustering._clusterLabelCollection._labels.length;m++){const v=A.clustering._clusterLabelCollection._labels[m];f.push(v.id.length)}h.value=!0}else h.value=!1});u.ad(()=>p());{let m={id:"",layer:"",screenObjectIds:[]},v={id:"",layer:"",screenObjectIds:[]};const y=()=>{m&&(a.remove(m.layer,m.id,{label:m.screenObjectIds}),m={id:"",layer:"",screenObjectIds:[]}),v&&(a.remove(v.layer,v.id,{billboard:v.screenObjectIds}),v={id:"",layer:"",screenObjectIds:[]})};u.ad(()=>{y()});const g=()=>{var F,S,T,w,C,M;if(y(),!e.show||!it.clusterImageAttribute)return;const x=e.style??c.ESEntityCluster.defaults.style,E=it.clusterImageAttribute[((F=x.nonCluster)==null?void 0:F.mode)??"SquareH01"],B=[-E.anchorPixelOffset[0]+E.textPixelOffset[0],-E.anchorPixelOffset[1]-E.textPixelOffset[1]],P={...s,pixelOffset:new b.Cartesian2(B[0]*it.scaleFactor,B[1]*it.scaleFactor),heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()]},I={...l,width:E.imageSize[0],height:E.imageSize[1],heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new b.Cartesian2(-E.anchorPixelOffset[0]*it.scaleFactor,-E.anchorPixelOffset[1]*it.scaleFactor),imageSubRegion:new b.BoundingRectangle(...E.imagePixelOffset,...E.imageSize)},D=new Map;if(A.clustering._clusterLabelCollection)for(let R=0;R<A.clustering._clusterLabelCollection._labels.length;R++){const U=A.clustering._clusterLabelCollection._labels[R];if(!it.clusterImageAttribute)continue;const O=U.text,z=De(U.position),k={index:U.id.map(le=>A.entities.values.length-1-A.clustering._collectionIndicesByEntity[le.id].billboardIndex).sort((le,ue)=>le-ue),name:O,position:z},Q=this.getClusterStyle(x.cluster??c.ESEntityCluster.defaults.style.cluster,U.id.length).mode,V=it.clusterImageAttribute[Q],j=[-V.anchorPixelOffset[0]+V.textPixelOffset[0],-V.anchorPixelOffset[1]-V.textPixelOffset[1]],J={...s,pixelOffset:new b.Cartesian2(j[0]*it.scaleFactor,j[1]*it.scaleFactor),heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()]},ee={...l,width:V.imageSize[0],height:V.imageSize[1],heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new b.Cartesian2(-V.anchorPixelOffset[0]*it.scaleFactor,-V.anchorPixelOffset[1]*it.scaleFactor),imageSubRegion:new b.BoundingRectangle(...V.imagePixelOffset,...V.imageSize)},ie=a.addImage(e.id,e.typeName,ee,k),oe=a.addLabel(e.id,e.typeName,J,k);v.id=ie.id,v.layer=ie.layer,v.screenObjectIds.push(ie.screenObjectId),m.id=oe.id,m.layer=oe.layer,m.screenObjectIds.push(oe.screenObjectId);for(let le=0;le<U.id.length;le++)D.set(U.id[le].id,1)}for(let R=0;R<A.entities.values.length;R++){const U=A.entities.values[R];if(D.has(U.id)||!this.pointFeatures||!i.isPointVisible(De((S=U.position)==null?void 0:S.getValue())))continue;const O=((T=this.pointFeatures[this.featureArrName][R])==null?void 0:T.coordinates)??((w=this.pointFeatures[this.featureArrName][R])==null?void 0:w.geometry.coordinates),z=((C=this.pointFeatures[this.featureArrName][R])==null?void 0:C.name)??((M=this.pointFeatures[this.featureArrName][R].properties)==null?void 0:M.name)??(R+1).toString(),k={index:R,name:z,position:O},Q=a.addImage(e.id,e.typeName,I,k),V=a.addLabel(e.id,e.typeName,P,k);v.id=Q.id,v.layer=Q.layer,v.screenObjectIds.push(Q.screenObjectId),m.id=V.id,m.layer=V.layer,m.screenObjectIds.push(V.screenObjectId)}};g();const _=u.ad(c.createNextAnimateFrameEvent(e.showChanged,e.styleChanged,e.heightReferenceChanged,h.changed));u.ad(_.don(g))}return u}))})()}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}get dataSourceChanged(){return this._dataSource.changed}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}getClusterStyle(e,i){return e.find(o=>{if(o.value!==void 0)return o.value===i;const r=o.minValue!==void 0?o.minValue<=i:!0,a=o.maxValue!==void 0?o.maxValue>=i:!0;return r&&a})}};L(it,"type",it.register("ESCesiumViewer",c.ESEntityCluster.type,it)),L(it,"scaleFactor",.6),L(it,"scaleByDistance",new b.NearFarScalar(100,1,1e3,1)),L(it,"clusterImages"),L(it,"clusterImageAttribute"),L(it,"clusterImageUrl",c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"));let Zg=it;const Uc=class Uc extends Hn{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}};L(Uc,"type",Uc.register("ESCesiumViewer",gf.type,Uc));let $g=Uc;const Oc=class Oc extends Ln{constructor(e,i){super(e,i);L(this,"geoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Ot(i.viewer))return;this.geoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Ro(i,e.id));const{geoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??c.ESGeoWater.defaults.waterColor,frequency:(e.frequency??c.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??c.ESGeoWater.defaults.waterImage});else{const A=Object.assign({},Rh[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=!!(e.show&&e.stroked)},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=e.show&&e.filled},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{e.points&&e.points.length>=3?(a.positions=[...e.points,e.points[0]],s.points=[...e.points]):(a.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],s.points=[])};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(l))}this.ad(e.editingChanged.don(l=>{s.updateBoundingSphere(l)}))}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}updateWater(e){const{czmWater:i}=this;e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection}};L(Oc,"type",Oc.register("ESCesiumViewer",c.ESGeoWater.type,Oc));let Xg=Oc;const Yg=65536*65536,o_=1/Yg,wL=12,s_=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Jg=0,Sf=1,eu=2,Ef=5;class bL{constructor(n=new Uint8Array(16)){this.buf=ArrayBuffer.isView(n)?n:new Uint8Array(n),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(n,e,i=this.length){for(;this.pos<i;){const o=this.readVarint(),r=o>>3,a=this.pos;this.type=o&7,n(r,e,this),this.pos===a&&this.skip(o)}return e}readMessage(n,e){return this.readFields(n,e,this.readVarint()+this.pos)}readFixed32(){const n=this.dataView.getUint32(this.pos,!0);return this.pos+=4,n}readSFixed32(){const n=this.dataView.getInt32(this.pos,!0);return this.pos+=4,n}readFixed64(){const n=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Yg;return this.pos+=8,n}readSFixed64(){const n=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Yg;return this.pos+=8,n}readFloat(){const n=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,n}readDouble(){const n=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,n}readVarint(n){const e=this.buf;let i,o;return o=e[this.pos++],i=o&127,o<128||(o=e[this.pos++],i|=(o&127)<<7,o<128)||(o=e[this.pos++],i|=(o&127)<<14,o<128)||(o=e[this.pos++],i|=(o&127)<<21,o<128)?i:(o=e[this.pos],i|=(o&15)<<28,xL(i,n,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){const n=this.readVarint();return n%2===1?(n+1)/-2:n/2}readBoolean(){return!!this.readVarint()}readString(){const n=this.readVarint()+this.pos,e=this.pos;return this.pos=n,n-e>=wL&&s_?s_.decode(this.buf.subarray(e,n)):UL(this.buf,e,n)}readBytes(){const n=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,n);return this.pos=n,e}readPackedVarint(n=[],e){const i=this.readPackedEnd();for(;this.pos<i;)n.push(this.readVarint(e));return n}readPackedSVarint(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSVarint());return n}readPackedBoolean(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readBoolean());return n}readPackedFloat(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFloat());return n}readPackedDouble(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readDouble());return n}readPackedFixed32(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFixed32());return n}readPackedSFixed32(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSFixed32());return n}readPackedFixed64(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFixed64());return n}readPackedSFixed64(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSFixed64());return n}readPackedEnd(){return this.type===eu?this.readVarint()+this.pos:this.pos+1}skip(n){const e=n&7;if(e===Jg)for(;this.buf[this.pos++]>127;);else if(e===eu)this.pos=this.readVarint()+this.pos;else if(e===Ef)this.pos+=4;else if(e===Sf)this.pos+=8;else throw new Error(`Unimplemented type: ${e}`)}writeTag(n,e){this.writeVarint(n<<3|e)}realloc(n){let e=this.length||16;for(;e<this.pos+n;)e*=2;if(e!==this.length){const i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.dataView=new DataView(i.buffer),this.length=e}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(n){this.realloc(4),this.dataView.setInt32(this.pos,n,!0),this.pos+=4}writeSFixed32(n){this.realloc(4),this.dataView.setInt32(this.pos,n,!0),this.pos+=4}writeFixed64(n){this.realloc(8),this.dataView.setInt32(this.pos,n&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(n*o_),!0),this.pos+=8}writeSFixed64(n){this.realloc(8),this.dataView.setInt32(this.pos,n&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(n*o_),!0),this.pos+=8}writeVarint(n){if(n=+n||0,n>268435455||n<0){_L(n,this);return}this.realloc(4),this.buf[this.pos++]=n&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=n>>>7&127)))}writeSVarint(n){this.writeVarint(n<0?-n*2-1:n*2)}writeBoolean(n){this.writeVarint(+n)}writeString(n){n=String(n),this.realloc(n.length*4),this.pos++;const e=this.pos;this.pos=OL(this.buf,n,this.pos);const i=this.pos-e;i>=128&&a_(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i}writeFloat(n){this.realloc(4),this.dataView.setFloat32(this.pos,n,!0),this.pos+=4}writeDouble(n){this.realloc(8),this.dataView.setFloat64(this.pos,n,!0),this.pos+=8}writeBytes(n){const e=n.length;this.writeVarint(e),this.realloc(e);for(let i=0;i<e;i++)this.buf[this.pos++]=n[i]}writeRawMessage(n,e){this.pos++;const i=this.pos;n(e,this);const o=this.pos-i;o>=128&&a_(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o}writeMessage(n,e,i){this.writeTag(n,eu),this.writeRawMessage(e,i)}writePackedVarint(n,e){e.length&&this.writeMessage(n,EL,e)}writePackedSVarint(n,e){e.length&&this.writeMessage(n,PL,e)}writePackedBoolean(n,e){e.length&&this.writeMessage(n,IL,e)}writePackedFloat(n,e){e.length&&this.writeMessage(n,BL,e)}writePackedDouble(n,e){e.length&&this.writeMessage(n,TL,e)}writePackedFixed32(n,e){e.length&&this.writeMessage(n,FL,e)}writePackedSFixed32(n,e){e.length&&this.writeMessage(n,ML,e)}writePackedFixed64(n,e){e.length&&this.writeMessage(n,DL,e)}writePackedSFixed64(n,e){e.length&&this.writeMessage(n,RL,e)}writeBytesField(n,e){this.writeTag(n,eu),this.writeBytes(e)}writeFixed32Field(n,e){this.writeTag(n,Ef),this.writeFixed32(e)}writeSFixed32Field(n,e){this.writeTag(n,Ef),this.writeSFixed32(e)}writeFixed64Field(n,e){this.writeTag(n,Sf),this.writeFixed64(e)}writeSFixed64Field(n,e){this.writeTag(n,Sf),this.writeSFixed64(e)}writeVarintField(n,e){this.writeTag(n,Jg),this.writeVarint(e)}writeSVarintField(n,e){this.writeTag(n,Jg),this.writeSVarint(e)}writeStringField(n,e){this.writeTag(n,eu),this.writeString(e)}writeFloatField(n,e){this.writeTag(n,Ef),this.writeFloat(e)}writeDoubleField(n,e){this.writeTag(n,Sf),this.writeDouble(e)}writeBooleanField(n,e){this.writeVarintField(n,+e)}}function xL(t,n,e){const i=e.buf;let o,r;if(r=i[e.pos++],o=(r&112)>>4,r<128||(r=i[e.pos++],o|=(r&127)<<3,r<128)||(r=i[e.pos++],o|=(r&127)<<10,r<128)||(r=i[e.pos++],o|=(r&127)<<17,r<128)||(r=i[e.pos++],o|=(r&127)<<24,r<128)||(r=i[e.pos++],o|=(r&1)<<31,r<128))return ya(t,o,n);throw new Error("Expected varint not more than 10 bytes")}function ya(t,n,e){return e?n*4294967296+(t>>>0):(n>>>0)*4294967296+(t>>>0)}function _L(t,n){let e,i;if(t>=0?(e=t%4294967296|0,i=t/4294967296|0):(e=~(-t%4294967296),i=~(-t/4294967296),e^4294967295?e=e+1|0:(e=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),CL(e,i,n),SL(i,n)}function CL(t,n,e){e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos]=t&127}function SL(t,n){const e=(t&7)<<4;n.buf[n.pos++]|=e|((t>>>=3)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127)))))}function a_(t,n,e){const i=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(Math.LN2*7));e.realloc(i);for(let o=e.pos-1;o>=t;o--)e.buf[o+i]=e.buf[o]}function EL(t,n){for(let e=0;e<t.length;e++)n.writeVarint(t[e])}function PL(t,n){for(let e=0;e<t.length;e++)n.writeSVarint(t[e])}function BL(t,n){for(let e=0;e<t.length;e++)n.writeFloat(t[e])}function TL(t,n){for(let e=0;e<t.length;e++)n.writeDouble(t[e])}function IL(t,n){for(let e=0;e<t.length;e++)n.writeBoolean(t[e])}function FL(t,n){for(let e=0;e<t.length;e++)n.writeFixed32(t[e])}function ML(t,n){for(let e=0;e<t.length;e++)n.writeSFixed32(t[e])}function DL(t,n){for(let e=0;e<t.length;e++)n.writeFixed64(t[e])}function RL(t,n){for(let e=0;e<t.length;e++)n.writeSFixed64(t[e])}function UL(t,n,e){let i="",o=n;for(;o<e;){const r=t[o];let a=null,s=r>239?4:r>223?3:r>191?2:1;if(o+s>e)break;let l,u,A;s===1?r<128&&(a=r):s===2?(l=t[o+1],(l&192)===128&&(a=(r&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=t[o+1],u=t[o+2],(l&192)===128&&(u&192)===128&&(a=(r&15)<<12|(l&63)<<6|u&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=t[o+1],u=t[o+2],A=t[o+3],(l&192)===128&&(u&192)===128&&(A&192)===128&&(a=(r&15)<<18|(l&63)<<12|(u&63)<<6|A&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,i+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),i+=String.fromCharCode(a),o+=s}return i}function OL(t,n,e){for(let i=0,o,r;i<n.length;i++){if(o=n.charCodeAt(i),o>55295&&o<57344)if(r)if(o<56320){t[e++]=239,t[e++]=191,t[e++]=189,r=o;continue}else o=r-55296<<10|o-56320|65536,r=null;else{o>56319||i+1===n.length?(t[e++]=239,t[e++]=191,t[e++]=189):r=o;continue}else r&&(t[e++]=239,t[e++]=191,t[e++]=189,r=null);o<128?t[e++]=o:(o<2048?t[e++]=o>>6|192:(o<65536?t[e++]=o>>12|224:(t[e++]=o>>18|240,t[e++]=o>>12&63|128),t[e++]=o>>6&63|128),t[e++]=o&63|128)}return e}function Yr(t,n){this.x=t,this.y=n}Yr.prototype={clone(){return new Yr(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,n){return this.clone()._rotateAround(t,n)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){const n=t.x-this.x,e=t.y-this.y;return n*n+e*e},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},_matMult(t){const n=t[0]*this.x+t[1]*this.y,e=t[2]*this.x+t[3]*this.y;return this.x=n,this.y=e,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){const t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){const n=Math.cos(t),e=Math.sin(t),i=n*this.x-e*this.y,o=e*this.x+n*this.y;return this.x=i,this.y=o,this},_rotateAround(t,n){const e=Math.cos(t),i=Math.sin(t),o=n.x+e*(this.x-n.x)-i*(this.y-n.y),r=n.y+i*(this.x-n.x)+e*(this.y-n.y);return this.x=o,this.y=r,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:Yr},Yr.convert=function(t){if(t instanceof Yr)return t;if(Array.isArray(t))return new Yr(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new Yr(+t.x,+t.y);throw new Error("Expected [x, y] or {x, y} point format")};class l_{constructor(n,e,i,o,r){this.properties={},this.extent=i,this.type=0,this.id=void 0,this._pbf=n,this._geometry=-1,this._keys=o,this._values=r,n.readFields(LL,this,e)}loadGeometry(){const n=this._pbf;n.pos=this._geometry;const e=n.readVarint()+n.pos,i=[];let o,r=1,a=0,s=0,l=0;for(;n.pos<e;){if(a<=0){const u=n.readVarint();r=u&7,a=u>>3}if(a--,r===1||r===2)s+=n.readSVarint(),l+=n.readSVarint(),r===1&&(o&&i.push(o),o=[]),o&&o.push(new Yr(s,l));else if(r===7)o&&o.push(o[0].clone());else throw new Error(`unknown command ${r}`)}return o&&i.push(o),i}bbox(){const n=this._pbf;n.pos=this._geometry;const e=n.readVarint()+n.pos;let i=1,o=0,r=0,a=0,s=1/0,l=-1/0,u=1/0,A=-1/0;for(;n.pos<e;){if(o<=0){const h=n.readVarint();i=h&7,o=h>>3}if(o--,i===1||i===2)r+=n.readSVarint(),a+=n.readSVarint(),r<s&&(s=r),r>l&&(l=r),a<u&&(u=a),a>A&&(A=a);else if(i!==7)throw new Error(`unknown command ${i}`)}return[s,u,l,A]}toGeoJSON(n,e,i){const o=this.extent*Math.pow(2,i),r=this.extent*n,a=this.extent*e,s=this.loadGeometry();function l(f){return[(f.x+r)*360/o-180,360/Math.PI*Math.atan(Math.exp((1-(f.y+a)*2/o)*Math.PI))-90]}function u(f){return f.map(l)}let A;if(this.type===1){const f=[];for(const d of s)f.push(d[0]);const p=u(f);A=f.length===1?{type:"Point",coordinates:p[0]}:{type:"MultiPoint",coordinates:p}}else if(this.type===2){const f=s.map(u);A=f.length===1?{type:"LineString",coordinates:f[0]}:{type:"MultiLineString",coordinates:f}}else if(this.type===3){const f=kL(s),p=[];for(const d of f)p.push(d.map(u));A=p.length===1?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p}}else throw new Error("unknown feature type");const h={type:"Feature",geometry:A,properties:this.properties};return this.id!=null&&(h.id=this.id),h}}l_.types=["Unknown","Point","LineString","Polygon"];function LL(t,n,e){t===1?n.id=e.readVarint():t===2?zL(e,n):t===3?n.type=e.readVarint():t===4&&(n._geometry=e.pos)}function zL(t,n){const e=t.readVarint()+t.pos;for(;t.pos<e;){const i=n._keys[t.readVarint()],o=n._values[t.readVarint()];n.properties[i]=o}}function kL(t){const n=t.length;if(n<=1)return[t];const e=[];let i,o;for(let r=0;r<n;r++){const a=QL(t[r]);a!==0&&(o===void 0&&(o=a<0),o===a<0?(i&&e.push(i),i=[t[r]]):i&&i.push(t[r]))}return i&&e.push(i),e}function QL(t){let n=0;for(let e=0,i=t.length,o=i-1,r,a;e<i;o=e++)r=t[e],a=t[o],n+=(a.x-r.x)*(r.y+a.y);return n}class VL{constructor(n,e){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=n,this._keys=[],this._values=[],this._features=[],n.readFields(NL,this,e),this.length=this._features.length}feature(n){if(n<0||n>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[n];const e=this._pbf.readVarint()+this._pbf.pos;return new l_(this._pbf,e,this.extent,this._keys,this._values)}}function NL(t,n,e){t===15?n.version=e.readVarint():t===1?n.name=e.readString():t===5?n.extent=e.readVarint():t===2?n._features.push(e.pos):t===3?n._keys.push(e.readString()):t===4&&n._values.push(HL(e))}function HL(t){let n=null;const e=t.readVarint()+t.pos;for(;t.pos<e;){const i=t.readVarint()>>3;n=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}if(n==null)throw new Error("unknown feature value");return n}class GL{constructor(n,e){this.layers=n.readFields(WL,{},e)}}function WL(t,n,e){if(t===3){const i=new VL(e,e.readVarint()+e.pos);i.length&&(n[i.name]=i)}}function jL(t){let n,e;if(Reflect.has(t,"type")&&t.type==="symbol"&&Reflect.has(t,"layout")){const i=t.layout;if(Reflect.has(i,"icon-image")){e={},e.image=i["icon-image"];const{horizontalOrigin:o,verticalOrigin:r}=u_(i["icon-anchor"]??"center");if(e.horizontalOrigin=o,e.verticalOrigin=r,Reflect.has(t,"paint")){const a=t.paint;e.color=b.Color.fromCssColorString(a["icon-color"]??"#FF0000").withAlpha(a["icon-opacity"]??1)}e.rotation=b.Math.toRadians(i["icon-rotate"]??0),e.scale=i["icon-size"]??1,e.show=(i.visibility??"visible")==="visible"}if(Reflect.has(i,"text-field")){n={},n.text=i["text-field"];const{horizontalOrigin:o,verticalOrigin:r}=u_(i["text-anchor"]??"center");if(n.horizontalOrigin=o,n.verticalOrigin=r,Reflect.has(t,"paint")){const a=t.paint;n.fillColor=b.Color.fromCssColorString(a["text-color"]??"#FFFFFF").withAlpha(a["text-opacity"]??1)}n.font=`${i["text-size"]??16}px ${i["text-font"]??"sans-serif"}`,n.show=(i.visibility??"visible")==="visible"}}return{labelStyle:n,billboardStyle:e}}function u_(t){let n=b.HorizontalOrigin.CENTER,e=b.VerticalOrigin.CENTER;switch(t){case"center":break;case"left":n=b.HorizontalOrigin.LEFT;break;case"right":n=b.HorizontalOrigin.RIGHT;break;case"top":e=b.VerticalOrigin.TOP;break;case"bottom":e=b.VerticalOrigin.BOTTOM;break;case"top-left":n=b.HorizontalOrigin.LEFT,e=b.VerticalOrigin.TOP;break;case"top-right":n=b.HorizontalOrigin.RIGHT,e=b.VerticalOrigin.TOP;break;case"bottom-left":n=b.HorizontalOrigin.LEFT,e=b.VerticalOrigin.BOTTOM;break;case"bottom-right":n=b.HorizontalOrigin.RIGHT,e=b.VerticalOrigin.BOTTOM;break}return{horizontalOrigin:n,verticalOrigin:e}}class qL extends c.Destroyable{constructor(e,i){super();L(this,"czmViewer");L(this,"czmESMVTLayer");L(this,"screenManager");L(this,"cacheSize",300);L(this,"urlMap",new Map);L(this,"tileScheme","xyz");L(this,"minimumLevel",0);L(this,"maximumLevel",18);L(this,"_cache",new Map);L(this,"lastTiles",new Map);this.czmViewer=e,this.czmESMVTLayer=i;const o=this.czmViewer.viewer;if(!o)return;const r=Ot(o);if(!r)return;this.screenManager=r.screenManager,this.tileScheme=i.sceneObject.scheme??"xyz",this.maximumLevel=i.sceneObject.maximumLevel,this.minimumLevel=i.sceneObject.minimumLevel,(()=>{do{if(!i.mvtLayerJson)break;if(typeof i.mvtLayerJson.mainJson=="string"){this.urlMap.set("customSource",[i.mvtLayerJson.mainJson]);break}if(typeof i.mvtLayerJson.mainJson=="object"){const s=i.mvtLayerJson.mainJson.sources;for(const l in s){const u=s[l];u.type==="vector"&&Reflect.has(u,"tiles")&&this.urlMap.set(l,u.tiles)}break}}while(!1)})(),this.ad(()=>{var l;const s=Array.from(this.lastTiles.values()).map(u=>u.featureTable).map(u=>Object.values(u)).flat(1/0);s&&((l=this.screenManager)==null||l.remove("default",this.czmESMVTLayer.sceneObject.id,s)),this.cache&&(this.cache.clear(),this.cache=null)})}get cache(){return this._cache}set cache(e){this._cache=e}addTiles(e){var a;if(this.urlMap.size==0)return;if(this.cache&&this.cache.has(e)&&this.lastTiles.has(e)){this.updateTiles([e],"show");return}const[i,o,r]=e.split("-").map(Number);(a=this.cache)==null||a.set(e,new Map),this.requestImage(o,r,i,e)}updateTiles(e,i="hide"){var o,r,a,s,l;for(let u=0;u<e.length;u++){const A=e[u],h=this.lastTiles.get(A);if(h){const f=Object.keys(h.featureTable);for(let p=0;p<f.length;p++){const d=f[p],m=h.featureTable[d];if(i=="delete")(o=this.screenManager)==null||o.remove(h.layer,h.id,m);else{const v=(r=this.cache)==null?void 0:r.get(A);v&&((a=this.cache)==null||a.delete(A),(s=this.cache)==null||s.set(A,v)),this.screenManager.avoidanceManager.enable||(l=this.screenManager)==null||l.update(h.layer,h.id,m,{all:{show:i=="show"}})}}}i=="delete"&&this.lastTiles.delete(A)}}update(e){const i=Array.from(this.lastTiles.keys()),o=i.filter(s=>!e.includes(s)),r=i.filter(s=>e.includes(s)),a=e.filter(s=>!i.includes(s));this.updateTiles(o,"delete"),this.updateTiles(r,"show");for(let s=0;s<a.length;s++){const l=a[s];this.addTiles(l)}}requestImage(e,i,o,r){const a=this.tileScheme=="tms"?Math.pow(2,o)-i-1:i;this.urlMap.size!=0&&this.urlMap.entries().forEach(([s,l])=>{if(l.length!=0&&l[0].includes("{z}")){const u=l[0].replace(/{z}/g,o.toString()).replace(/{x}/g,e.toString()).replace(/{y}/g,a.toString());fetch(u).then(A=>{var h,f;if(A.ok&&((h=this.cache)!=null&&h.has(r))&&((f=this.cache.get(r))==null?void 0:f.size)==0)return A.arrayBuffer()}).then(A=>{var d,m,v;const h=new bL(A),f=new GL(h),p=new Map;for(const y in f.layers){const g=f.layers[y];if(g.length<=0||g.feature(0).type!==1)continue;const _=[];for(let x=0;x<g.length;x++){const E=g.feature(x);_.push(E.toGeoJSON(e,i,o))}p.set(y,_)}(d=this.cache)!=null&&d.has(r)&&((m=this.cache.get(r))==null?void 0:m.size)==0&&((v=this.cache)==null||v.set(r,p),this.addScreenManage(r,p),this.clearCache())})}})}clearCache(){if(!this.cache)return;const e=this.cache.size-this.cacheSize;if(!(e<=0))for(let i=0;i<e;i++){const o=this.cache.keys().next().value;o&&(this.updateTiles([o],"delete"),this.cache.delete(o))}}addScreenManage(e,i){var r,a;this.lastTiles.set(e,{layer:"default",id:this.czmESMVTLayer.sceneObject.id,featureTable:{}});const o=this.lastTiles.get(e);for(const[s,l]of i.entries()){const u=this.czmESMVTLayer.mvtLayerJson.pointJson.find(A=>A["source-layer"]==s)??{};for(const A of l){const{labelStyle:h,billboardStyle:f}=jL(u);let p,d;h&&(h.show=!this.screenManager.avoidanceManager.enable,p=this.screenManager.addLabel(this.czmESMVTLayer.sceneObject.id,"default",h??{},{position:A.geometry.coordinates,name:A.properties.NAME??A.properties.name,index:A.id??u["source-layer"]+((r=A==null?void 0:A.properties)==null?void 0:r.osm_id)})),f&&(f.show=!this.screenManager.avoidanceManager.enable,d=this.screenManager.addImage(this.czmESMVTLayer.sceneObject.id,"default",f??{},{position:A.geometry.coordinates,name:A.properties.NAME??A.properties.name,index:A.id??u["source-layer"]+((a=A==null?void 0:A.properties)==null?void 0:a.osm_id)})),o.featureTable[s]||(o.featureTable[s]=[]),p&&o.featureTable[s].push(p.screenObjectId),d&&o.featureTable[s].push(d.screenObjectId)}}}reset(){if(!this.cache)return;const e=Array.from(this.cache.keys());this.update([]),setTimeout(()=>{this.update(e)})}}class KL extends c.Destroyable{constructor(e,i){super();L(this,"vectorTilesCache");L(this,"czmViewer");L(this,"czmESMVTLayer");this.czmViewer=e,this.czmESMVTLayer=i,this.vectorTilesCache=this.ad(new qL(e,i)),this.updateTiles();const o=this.czmViewer.viewer.scene.globe._surface.tileLoadProgressEvent.addEventListener(r=>{r==0&&this.updateTiles()});this.ad(()=>{o()})}updateTiles(){const e=this.czmViewer.viewer;if(!e)return;const i=new Set;for(let o=0;o<e.scene.globe._surface._tilesToRender.length;o++){const r=e.scene.globe._surface._tilesToRender[o];if(r.data)for(let a=0;a<r.data.imagery.length;a++){const s=r.data.imagery[a],l=s.loadingImagery??s.readyImagery;if(l){const u=`${l.level}-${l.x}-${l.y}`;i.add(u)}}}this.vectorTilesCache.update(Array.from(i))}}const Lc=class Lc extends Hn{constructor(e,i){super(e,i);L(this,"_czmImagery");L(this,"_mvtLayerJson",this.disposeVar(c.reactJson({mainJson:"",pointJson:[],otherJson:[]})));L(this,"mvtLayerJsonChanged",this.ad(new c.Event));if(this._czmImagery=this.dv(new Zr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"zIndex"],[e,"zIndex"])),this.d(c.track([r,"rectangle"],[e,"rectangle"])),this.d(c.track([r,"alpha"],[e,"opacity"])),this.d(c.track([r,"splitDirection"],[e,"splitDirection"])),this.d(c.track([r,"brightness"],[e,"czmBrightness"])),this.d(c.track([r,"contrast"],[e,"czmContrast"])),this.d(c.track([r,"hue"],[e,"czmHue"])),this.d(c.track([r,"saturation"],[e,"czmSaturation"])),this.d(c.track([r,"gamma"],[e,"czmGamma"]));{const s=this.dv(c.createNextAnimateFrameEvent(e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.schemeChanged,this.mvtLayerJsonChanged)),l=()=>{!this.mvtLayerJson||this.mvtLayerJson.otherJson.length==0||(r.imageryProvider={type:"MVTImageryProvider",url:this.mvtLayerJson.mainJson,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:this.mvtLayerJson.otherJson,scheme:e.scheme})};l(),this.d(s.don(l))}{const s=A=>{const h=structuredClone(A);Reflect.deleteProperty(h,"layers"),this.mvtLayerJson={mainJson:h,pointJson:A.layers.filter(f=>f.type=="symbol"),otherJson:A.layers.filter(f=>f.type!="symbol")}},l=async()=>{var A;if(typeof e.url=="string")if(e.url.includes("{z}"))this.mvtLayerJson.mainJson=e.url;else{const h=await fetch(e.url);if((A=h.headers.get("Content-Type"))!=null&&A.includes("json")){const f=await h.json();s(f)}}else s(e.url);e.style&&e.style.length!=0&&(this.mvtLayerJson.pointJson=e.style.filter(h=>h.type=="symbol"),this.mvtLayerJson.otherJson=e.style.filter(h=>h.type!="symbol")),this.mvtLayerJsonChanged.emit()};l();const u=this.ad(c.createNextAnimateFrameEvent(e.urlChanged,e.styleChanged));this.ad(u.don(l))}const a=this.ad(c.createNextAnimateFrameEvent(e.schemeChanged,e.maximumLevelChanged,e.minimumLevelChanged,this.mvtLayerJsonChanged,e.showChanged));this.ad(new c.ObjResettingWithEvent(a,()=>{if(e.show)return new KL(i,this)}))}get czmImagery(){return this._czmImagery}get mvtLayerJson(){return this._mvtLayerJson.value}set mvtLayerJson(e){this._mvtLayerJson.value=e}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Lc,"type",Lc.register("ESCesiumViewer",mf.type,Lc));let ey=Lc;class ZL extends c.Destroyable{constructor(n,e){super(),this._czmESPipeFence=n,this._sceneObject=e;const i=this._sceneObject,o=this._czmESPipeFence,r=o.czmCustomPrimitive;if(!i.points||i.points.length<2){this.clear(r);return}const a=i.points.length;let s=[],l=[],u=[],A=[],h=[];for(let y=0;y<a-1;y++){const{outlinePionts:g,customPrimitivePoints:_}=this.divideFourPoints(i.points[y],i.points[y+1]);A.push(..._),h.push(...g),u.push(...this.setIndexs(y))}const[f,p,d]=wn({originPosition:A[0]},A),m=this.setFaces(f);s.push(...m.flat());const v=this.setTextureCoordinates(i,o);l.push(...v.flat()),o.computeBoundingBox(),this.updateCustomPrimitive(r,p,s,u,l)}divideFourPoints(n,e){const i=c.geoHeading(n,e),o=c.geoDestination(n,this._sceneObject.width/2,90+i),r=c.geoDestination(n,this._sceneObject.width/2,i-90),a=c.geoDestination(e,this._sceneObject.width/2,i-90),s=c.geoDestination(e,this._sceneObject.width/2,90+i),l=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],A=[r[0],r[1],r[2]+this._sceneObject.height/2],h=[r[0],r[1],r[2]-this._sceneObject.height/2],f=[s[0],s[1],s[2]+this._sceneObject.height/2],p=[s[0],s[1],s[2]-this._sceneObject.height/2],d=[a[0],a[1],a[2]+this._sceneObject.height/2],m=[a[0],a[1],a[2]-this._sceneObject.height/2],v=[[l,A],[l,f],[l,u],[u,p]],y=[[u,h],[A,d],[A,h],[h,m]],g=[[f,p],[f,d],[p,m],[d,m]];return{outlinePionts:[...v,...y,...g],customPrimitivePoints:[u,l,A,h,p,f,d,m]}}setIndexs(n){const e=n*16;return[e+1,e+0,e+3,e+1,e+3,e+2,e+5,e+4,e+7,e+6,e+5,e+7,e+9,e+8,e+11,e+9,e+11,e+10,e+13,e+12,e+15,e+13,e+15,e+14]}setFaces(n){const e=[],i=n.length/8;for(let r=0;r<i;r++){const a=n.slice(8*r,8*(r+1));e.push(a)}return[...e.map(r=>[r[4],r[5],r[1],r[0],r[5],r[6],r[2],r[1],r[6],r[7],r[3],r[2],r[7],r[4],r[0],r[3]]).flat()]}getDistances(n,e){const[i]=wn({originPosition:n[0]},n),o=i.length,r=i.reduce((l,u,A,h)=>{if(A===0)return l.push(0),l;const f=A-1,p=h[f],d=Math.sqrt((p[0]-u[0])*(p[0]-u[0])+(p[1]-u[1])*(p[1]-u[1]));return l.push(l[f]+d),l},[]),a=r[o-1];return e.distances=a,r.map(l=>l/a)}setTextureCoordinates(n,e){if(!n.points||n.points.length<2)return;const i=this.getDistances(n.points,e),o=[];for(let r=1;r<i.length;r++){let a=[];if(r===i.length-1){const s=[1,0,1,1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}else{const s=[i[r],0,i[r],1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}o.push(a)}return o}updateCustomPrimitive(n,e,i,o,r){n.modelMatrix=e,n.indexTypedArray=new Uint16Array(o),n.attributes={position:{typedArray:new Float32Array(i),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(r),componentsPerAttribute:2}}}clear(n){n.indexTypedArray=void 0,n.modelMatrix=void 0,n.attributes=void 0}}const zc=class zc extends sn{constructor(e,i){super(e,i);L(this,"_line",this.dv(new Ye(this.czmViewer,this.sceneObject.id)));L(this,"_czmTexture",this.ad(new ft(this.czmViewer,this.sceneObject.id)));L(this,"_czmCustomPrimitive",this.dv(new ut(this.czmViewer,this.sceneObject.id)));L(this,"_distances",this.dv(c.react(0)));if(!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmTexture,a=this._line;this.d(c.bind([a,"positions"],[e,"points"])),this.d(c.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(c.track([this.line,"color"],[e,"strokeColor"])),this.d(c.track([this.line,"width"],[e,"strokeWidth"])),this.d(c.track([this.line,"ground"],[e,"strokeGround"]));{const A=this.dv(c.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new c.ObjResettingWithEvent(A,()=>new ZL(this,this.sceneObject)))}{const A=()=>{a.show=e.show&&e.stroked};A();const h=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(h.don(A))}this.bindCustomPrimitive(e);let s="";const l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const A=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?s=u:e.materialMode==="color"?s="":s=l,r.uri=s,s==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
|
|
3598
3598
|
in vec2 v_st;
|
|
3599
3599
|
void main()
|
|
3600
3600
|
{
|
|
@@ -3666,7 +3666,7 @@ ${r_}
|
|
|
3666
3666
|
vec4 imageColor = texture(u_image, st);
|
|
3667
3667
|
out_FragColor = imageColor * u_color;
|
|
3668
3668
|
}
|
|
3669
|
-
`;const S=f.computeLocalAxisedBoundingBoxFromAttribute("position");if(!S)return;const{min:T,max:w}=S;f.setLocalAxisedBoundingBox(T,w)},A=async()=>{if(e.points&&e.points.length>2){const{minPos:f,center:p}=c.getMinMaxCorner(e.points),d=f[2]-e.depth;if(!c.equalsN3(e.points[e.points.length-1],e.points[e.points.length-2])){const x=wn({originPosition:p},e.points.map((E,B)=>{let P=[...E];return P[2]=d,P}));u(s,p,x[0],"bottom",!0)}const m=this._interpolationAlongPolygon(e.points.map((x,E)=>b.Cartesian3.fromArray(c.lbhToXyz(x))),e.interpolation),v=await i.getHeightsByLonLats(m.map(x=>[x[0],x[1]]));let y=[];for(let x=0;x<m.length;x++){const E=m[x];y.push([E[0],E[1],v[x]??E[2]],[E[0],E[1],d])}const g=wn({originPosition:p},y);let _=this._isClockwise(e.points,i);u(r,p,g[0],"side",_)}else r.attributes=void 0,s.attributes=void 0};A();const h=this.dv(c.createNextAnimateFrameEvent(e.depthChanged,e.interpolationChanged,e.pointsChanged,e.bottomImageChanged,e.sideImageChanged));this.ad(h.don(A))}{const u=()=>{a.uri=e.sideImage.url,l.uri=e.bottomImage.url,r.uniformMap={u_image:{type:"texture",id:a.id},u_color:[1,1,1,e.opacity]},s.uniformMap={u_image:{type:"texture",id:l.id},u_color:[1,1,1,e.opacity]}};u();const A=this.ad(c.createNextAnimateFrameEvent(e.opacityChanged,e.bottomImageChanged,e.sideImageChanged));this.d(A.don(u))}}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}_interpolationAlongPolygon(e,i){var o=[];for(let l=0;l<e.length;++l){var r=e[l],a=e[(l+1)%e.length],s=this._interpolationAlongLine(r,a,i);o.push(...s)}return o.push(o[0]),o}_interpolationAlongLine(e,i,o){var r=[],a=b.Cartesian3.distance(e,i),s=b.Cartesian3.subtract(i,e,new b.Cartesian3);s.equals(b.Cartesian3.ZERO)||b.Cartesian3.normalize(s,s);for(var l=0;l<a;){var u=new b.Cartesian3(s.x*l,s.y*l,s.z*l),A=b.Cartesian3.add(e,u,new b.Cartesian3);const h=De(A);h&&r.push(h),l+=o}return r}_isClockwise(e,i){if(i.viewer)for(let o=0;o<e.length;o++){let r=b.Cartesian3.fromDegrees(...e[o]),a=b.Cartesian3.fromDegrees(...e[(o+1)%e.length]),s=b.Cartesian3.fromDegrees(...e[(o+2)%e.length]),l=b.Cartesian3.subtract(a,r,new b.Cartesian3),u=b.Cartesian3.subtract(s,a,new b.Cartesian3);if(l.equals(b.Cartesian3.ZERO)||u.equals(b.Cartesian3.ZERO))return!0;if(b.Cartesian3.normalize(l,l),b.Cartesian3.normalize(u,u),Math.abs(b.Cartesian3.dot(l,u))==1){if(o==e.length-1)return!0;continue}let A=b.Cartesian3.cross(l,u,new b.Cartesian3);return b.Cartesian3.dot(A,i.viewer.camera.directionWC)>0}}_triangleIndices(e){let i=new Uint32Array(e*3);for(let o=0;o<e;++o)i[o*3+0]=o,i[o*3+1]=o%2?(o+2)%e:(o+1)%e,i[o*3+2]=o%2?(o+1)%e:(o+2)%e;return i}_getDistance(e,i){return Math.sqrt(Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2))}};L(Vc,"type",Vc.register("ESCesiumViewer",c.ESPit.type,Vc));let uy=Vc;const Nc=class Nc extends Ln{constructor(e,i){super(e,i);L(this,"_czmPolygonPrimitive");L(this,"_geoPolylines");if(this._czmPolygonPrimitive=this.disposeVar(new Lr(i,e.id)),console.log(this.czmPolygonPrimitive),this._geoPolylines=this.disposeVar(new ai(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}{const s=()=>{this.geoPolygon&&(this.geoPolygon.show=!1)};s(),this.ad(this.sceneObject.showChanged.don(s))}const r=this._geoPolylines;r.arcType="RHUMB";const a=this._czmPolygonPrimitive;this.dispose(c.track([a,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"color"],[e,"strokeColor"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"]));{a.perPositionHeight=!0;const s=()=>{r.show=e.show&&e.stroked,a.show=e.show&&e.filled,a.material={type:"Color",color:e.fillColor}};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged,e.fillColorChanged));this.dispose(l.don(s))}{const s=()=>{const u={positions:[],holes:[]};if(e.points&&e.points.length>=3){if(r.positions=[[...e.points,e.points[0]]],u.positions=e.points,e.innerRings&&e.innerRings.length>0)for(let A=0;A<e.innerRings.length;A++){const h=e.innerRings[A];u.holes.push({positions:h}),r.positions.push([...h,h[0]])}a.polygonHierarchy=u}else a.polygonHierarchy=u};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.pointsChanged,e.innerRingsChanged));this.dispose(l.disposableOn(()=>s()))}}get czmPolygonPrimitive(){return this._czmPolygonPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Nc,"type",Nc.register("ESCesiumViewer",c.ESPolygonWithHole.type,Nc));let cy=Nc;var an=63710088e-1,hy={centimeters:an*100,centimetres:an*100,degrees:an/111325,feet:an*3.28084,inches:an*39.37,kilometers:an/1e3,kilometres:an/1e3,meters:an,metres:an,miles:an/1609.344,millimeters:an*1e3,millimetres:an*1e3,nauticalmiles:an/1852,radians:1,yards:an*1.0936},dz={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/an,yards:1.0936133},Ay={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function zn(t,n,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=n||{},i.geometry=t,i}function pz(t,n,e){switch(t){case"Point":return Xt(n).geometry;case"LineString":return Yn(n).geometry;case"Polygon":return Vt(n).geometry;case"MultiPoint":return d_(n).geometry;case"MultiLineString":return fy(n).geometry;case"MultiPolygon":return dy(n).geometry;default:throw new Error(t+" is invalid")}}function Xt(t,n,e){if(e===void 0&&(e={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ff(t[0])||!Ff(t[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:t};return zn(i,n,e)}function mz(t,n,e){return e===void 0&&(e={}),Pn(t.map(function(i){return Xt(i,n)}),e)}function Vt(t,n,e){e===void 0&&(e={});for(var i=0,o=t;i<o.length;i++){var r=o[i];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<r[r.length-1].length;a++)if(r[r.length-1][a]!==r[0][a])throw new Error("First and last Position are not equivalent.")}var s={type:"Polygon",coordinates:t};return zn(s,n,e)}function gz(t,n,e){return e===void 0&&(e={}),Pn(t.map(function(i){return Vt(i,n)}),e)}function Yn(t,n,e){if(e===void 0&&(e={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:t};return zn(i,n,e)}function yz(t,n,e){return e===void 0&&(e={}),Pn(t.map(function(i){return Yn(i,n)}),e)}function Pn(t,n){n===void 0&&(n={});var e={type:"FeatureCollection"};return n.id&&(e.id=n.id),n.bbox&&(e.bbox=n.bbox),e.features=t,e}function fy(t,n,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:t};return zn(i,n,e)}function d_(t,n,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:t};return zn(i,n,e)}function dy(t,n,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:t};return zn(i,n,e)}function vz(t,n,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:t};return zn(i,n,e)}function wz(t,n){if(n===void 0&&(n=0),n&&!(n>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,n||0);return Math.round(t*e)/e}function py(t,n){n===void 0&&(n="kilometers");var e=hy[n];if(!e)throw new Error(n+" units is invalid");return t*e}function my(t,n){n===void 0&&(n="kilometers");var e=hy[n];if(!e)throw new Error(n+" units is invalid");return t/e}function bz(t,n){return p_(my(t,n))}function xz(t){var n=t%360;return n<0&&(n+=360),n}function p_(t){var n=t%(2*Math.PI);return n*180/Math.PI}function ru(t){var n=t%360;return n*Math.PI/180}function _z(t,n,e){if(n===void 0&&(n="kilometers"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("length must be a positive number");return py(my(t,n),e)}function Cz(t,n,e){if(n===void 0&&(n="meters"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=Ay[n];if(!i)throw new Error("invalid original units");var o=Ay[e];if(!o)throw new Error("invalid final units");return t/i*o}function Ff(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function gy(t){return!!t&&t.constructor===Object}function Sz(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(n){if(!Ff(n))throw new Error("bbox must only contain numbers")})}function Ez(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}const Pz=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:Ay,bearingToAzimuth:xz,convertArea:Cz,convertLength:_z,degreesToRadians:ru,earthRadius:an,factors:hy,feature:zn,featureCollection:Pn,geometry:pz,geometryCollection:vz,isNumber:Ff,isObject:gy,lengthToDegrees:bz,lengthToRadians:my,lineString:Yn,lineStrings:yz,multiLineString:fy,multiPoint:d_,multiPolygon:dy,point:Xt,points:mz,polygon:Vt,polygons:gz,radiansToDegrees:p_,radiansToLength:py,round:wz,unitsFactors:dz,validateBBox:Sz,validateId:Ez},Symbol.toStringTag,{value:"Module"}));function Mf(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Ii(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Bz(t,n,e){if(!t)throw new Error("No featureCollection passed");if(!t||t.type!=="FeatureCollection")throw new Error("Invalid input to "+e+", FeatureCollection required");for(var i=0,o=t.features;i<o.length;i++){var r=o[i];if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!r.geometry||r.geometry.type!==n)throw new Error("Invalid input to "+e+": must be a "+n+", given "+r.geometry.type)}}function Fi(t){return t.type==="Feature"?t.geometry:t}function Tz(t,n){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function Mi(t,n,e){e===void 0&&(e={});var i=Mf(t),o=Mf(n),r=ru(o[1]-i[1]),a=ru(o[0]-i[0]),s=ru(i[1]),l=ru(o[1]),u=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return py(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}function Jo(t,n,e){if(t!==null)for(var i,o,r,a,s,l,u,A=0,h=0,f,p=t.type,d=p==="FeatureCollection",m=p==="Feature",v=d?t.features.length:1,y=0;y<v;y++){u=d?t.features[y].geometry:m?t.geometry:t,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var g=0;g<s;g++){var _=0,x=0;if(a=f?u.geometries[g]:u,a!==null){l=a.coordinates;var E=a.type;switch(A=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(n(l,h,y,_,x)===!1)return!1;h++,_++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(n(l[i],h,y,_,x)===!1)return!1;h++,E==="MultiPoint"&&_++}E==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-A;o++){if(n(l[i][o],h,y,_,x)===!1)return!1;h++}E==="MultiLineString"&&_++,E==="Polygon"&&x++}E==="Polygon"&&_++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(x=0,o=0;o<l[i].length;o++){for(r=0;r<l[i][o].length-A;r++){if(n(l[i][o][r],h,y,_,x)===!1)return!1;h++}x++}_++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Jo(a.geometries[i],n,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Iz(t,n,e,i){var o=e;return Jo(t,function(r,a,s,l,u){a===0&&e===void 0?o=r:o=n(o,r,a,s,l,u)},i),o}function m_(t,n){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&n(t.features[e].properties,e)!==!1;e++);break;case"Feature":n(t.properties,0);break}}function Fz(t,n,e){var i=e;return m_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function wa(t,n){if(t.type==="Feature")n(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&n(t.features[e],e)!==!1;e++);}function Mz(t,n,e){var i=e;return wa(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function Dz(t){var n=[];return Jo(t,function(e){n.push(e)}),n}function yy(t,n){var e,i,o,r,a,s,l,u,A,h,f=0,p=t.type==="FeatureCollection",d=t.type==="Feature",m=p?t.features.length:1;for(e=0;e<m;e++){for(s=p?t.features[e].geometry:d?t.geometry:t,u=p?t.features[e].properties:d?t.properties:{},A=p?t.features[e].bbox:d?t.bbox:void 0,h=p?t.features[e].id:d?t.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,o=0;o<a;o++){if(r=l?s.geometries[o]:s,r===null){if(n(null,f,u,A,h)===!1)return!1;continue}switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(r,f,u,A,h)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<r.geometries.length;i++)if(n(r.geometries[i],f,u,A,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Rz(t,n,e){var i=e;return yy(t,function(o,r,a,s,l){r===0&&e===void 0?i=o:i=n(i,o,r,a,s,l)}),i}function rr(t,n){yy(t,function(e,i,o,r,a){var s=e===null?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return n(zn(e,o,{bbox:r,id:a}),i,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var A=e.coordinates[u],h={type:l,coordinates:A};if(n(zn(h,o),i,u)===!1)return!1}})}function Uz(t,n,e){var i=e;return rr(t,function(o,r,a){r===0&&a===0&&e===void 0?i=o:i=n(i,o,r,a)}),i}function g_(t,n){rr(t,function(e,i,o){var r=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var s,l=0,u=0,A=0;if(Jo(e,function(h,f,p,d,m){if(s===void 0||i>l||d>u||m>A){s=h,l=i,u=d,A=m,r=0;return}var v=Yn([s,h],e.properties);if(n(v,i,o,m,r)===!1)return!1;r++,s=h})===!1)return!1}}})}function y_(t,n,e){var i=e,o=!1;return g_(t,function(r,a,s,l,u){o===!1&&e===void 0?i=r:i=n(i,r,a,s,l,u),o=!0}),i}function v_(t,n){if(!t)throw new Error("geojson is required");rr(t,function(e,i,o){if(e.geometry!==null){var r=e.geometry.type,a=e.geometry.coordinates;switch(r){case"LineString":if(n(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(n(Yn(a[s],e.properties),i,o,s)===!1)return!1;break}}})}function Oz(t,n,e){var i=e;return v_(t,function(o,r,a,s){r===0&&e===void 0?i=o:i=n(i,o,r,a,s)}),i}function Lz(t,n){if(n=n||{},!gy(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.segmentIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":case"MultiPoint":return null;case"LineString":return r<0&&(r=l.length+r-1),Yn([l[r],l[r+1]],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r-1),Yn([l[o][r],l[o][r+1]],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r-1),Yn([l[i][r],l[i][r+1]],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r-1),Yn([l[i][o][r],l[i][o][r+1]],a,n)}throw new Error("geojson is invalid")}function zz(t,n){if(n=n||{},!gy(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.coordIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":return Xt(l,a,n);case"MultiPoint":return i<0&&(i=l.length+i),Xt(l[i],a,n);case"LineString":return r<0&&(r=l.length+r),Xt(l[r],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r),Xt(l[o][r],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r),Xt(l[i][r],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r),Xt(l[i][o][r],a,n)}throw new Error("geojson is invalid")}const kz=Object.freeze(Object.defineProperty({__proto__:null,coordAll:Dz,coordEach:Jo,coordReduce:Iz,featureEach:wa,featureReduce:Mz,findPoint:zz,findSegment:Lz,flattenEach:rr,flattenReduce:Uz,geomEach:yy,geomReduce:Rz,lineEach:v_,lineReduce:Oz,propEach:m_,propReduce:Fz,segmentEach:g_,segmentReduce:y_},Symbol.toStringTag,{value:"Module"}));function Qz(t,n){return n===void 0&&(n={}),y_(t,function(e,i){var o=i.geometry.coordinates;return e+Mi(o[0],o[1],n)},0)}function Vz(t){var n=Yn(t),e=Qz(n,{units:"meters"});return e}function*Nz(t){t.type==="FeatureCollection"?yield*t.features.map(n=>[n.geometry,n]):t.type==="Feature"&&(yield[t.geometry,t])}function*Hz(t){for(const[n,e]of Nz(t))if(n.type==="LineString")yield[n.coordinates,e];else if(n.type==="MultiLineString")for(let i of n.coordinates)yield[i,e]}function Gz(t,n,e){return[...Hz(t)].map(([i,o])=>{if(i.length<2)return;const r=i.map(l=>[l[0],l[1],l[2]??0]),s=Vz(r)/e;return{positions:r,repeat:s,width:n,extra:{geojson:{feature:o}}}}).filter(i=>!!i)}const ou=b.ArcType,Wz=b.arrayRemoveDuplicates,jz=b.BoundingSphere,Ft=b.Cartesian3,Bn=b.Color,ba=b.ComponentDatatype,qz=b.Frozen,kn=b.defined,xa=b.DeveloperError,Di=b.Ellipsoid,Kz=b.Geometry,_a=b.GeometryAttribute,Zz=b.GeometryAttributes,$z=b.GeometryType,Xz=b.IndexDatatype,w_=b.Math,su=b.PolylinePipeline,Yz=b.PrimitiveType,or=b.VertexFormat;var b_=[];function Jz(t,n,e,i,o){var r=b_;r.length=o;var a,s=e.red,l=e.green,u=e.blue,A=e.alpha,h=i.red,f=i.green,p=i.blue,d=i.alpha;if(Bn.equals(e,i)){for(a=0;a<o;a++)r[a]=Bn.clone(e);return r}var m=(h-s)/o,v=(f-l)/o,y=(p-u)/o,g=(d-A)/o;for(a=0;a<o;a++)r[a]=new Bn(s+a*m,l+a*v,u+a*y,A+a*g);return r}function Ca(t){t=t??qz.EMPTY_OBJECT;var n=t.positions,e=t.colors,i=t.width??1,o=t.colorsPerVertex??!1;if(!kn(n)||n.length<2)throw new xa("At least two positions are required.");if(typeof i!="number")throw new xa("width must be a number");if(kn(e)&&(o&&e.length<n.length||!o&&e.length<n.length-1))throw new xa("colors has an invalid length.");this._positions=n,this._colors=e,this._width=i,this._colorsPerVertex=o,this._vertexFormat=or.clone(t.vertexFormat??or.DEFAULT),this._arcType=t.arcType??ou.GEODESIC,this._granularity=t.granularity??w_.RADIANS_PER_DEGREE,this._ellipsoid=Di.clone(t.ellipsoid??Di.WGS84),this._workerName="createPolylineGeometry";var r=1+n.length*Ft.packedLength;r+=kn(e)?1+e.length*Bn.packedLength:1,this.packedLength=r+Di.packedLength+or.packedLength+4}Ca.pack=function(t,n,e){if(!kn(t))throw new xa("value is required");if(!kn(n))throw new xa("array is required");e=e??0;var i,o=t._positions,r=o.length;for(n[e++]=r,i=0;i<r;++i,e+=Ft.packedLength)Ft.pack(o[i],n,e);var a=t._colors;for(r=kn(a)?a.length:0,n[e++]=r,i=0;i<r;++i,e+=Bn.packedLength)Bn.pack(a[i],n,e);return Di.pack(t._ellipsoid,n,e),e+=Di.packedLength,or.pack(t._vertexFormat,n,e),e+=or.packedLength,n[e++]=t._width,n[e++]=t._colorsPerVertex?1:0,n[e++]=t._arcType,n[e]=t._granularity,n};var x_=Di.clone(Di.UNIT_SPHERE),__=new or,es={positions:void 0,colors:void 0,ellipsoid:x_,vertexFormat:__,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};Ca.unpack=function(t,n,e){if(!kn(t))throw new xa("array is required");n=n??0;var i,o=t[n++],r=new Array(o);for(i=0;i<o;++i,n+=Ft.packedLength)r[i]=Ft.unpack(t,n);o=t[n++];var a=o>0?new Array(o):void 0;for(i=0;i<o;++i,n+=Bn.packedLength)a[i]=Bn.unpack(t,n);var s=Di.unpack(t,n,x_);n+=Di.packedLength;var l=or.unpack(t,n,__);n+=or.packedLength;var u=t[n++],A=t[n++]===1,h=t[n++],f=t[n];return kn(e)?(e._positions=r,e._colors=a,e._ellipsoid=Di.clone(s,e._ellipsoid),e._vertexFormat=or.clone(l,e._vertexFormat),e._width=u,e._colorsPerVertex=A,e._arcType=h,e._granularity=f,e):(es.positions=r,es.colors=a,es.width=u,es.colorsPerVertex=A,es.arcType=h,es.granularity=f,new Ca(es))};var C_=new Ft,S_=new Ft,E_=new Ft,P_=new Ft;Ca.createGeometry=function(t){var n=t._width,e=t._vertexFormat,i=t._colors,o=t._colorsPerVertex,r=t._arcType,a=t._granularity,s=t._ellipsoid,l,u,A,h=Wz(t._positions,Ft.equalsEpsilon),f=h.length;if(f<2||n<=0)return;if(r===ou.GEODESIC||r===ou.RHUMB){var p,d;r===ou.GEODESIC?(p=w_.chordLength(a,s.maximumRadius),d=su.numberOfPoints):(p=a,d=su.numberOfPointsRhumbLine);var m=su.extractHeights(h,s);if(kn(i)){var v=1;for(l=0;l<f-1;++l)v+=d(h[l],h[l+1],p);var y=new Array(v),g=0;for(l=0;l<f-1;++l){var _=h[l],x=h[l+1],E=i[l],B=d(_,x,p);if(o&&l<v){var P=i[l+1],I=Jz(_,x,E,P,B),D=I.length;for(u=0;u<D;++u)y[g++]=I[u]}else for(u=0;u<B;++u)y[g++]=Bn.clone(E)}y[g]=Bn.clone(i[i.length-1]),i=y,b_.length=0}r===ou.GEODESIC?h=su.generateCartesianArc({positions:h,minDistance:p,ellipsoid:s,height:m}):h=su.generateCartesianRhumbArc({positions:h,granularity:p,ellipsoid:s,height:m})}f=h.length;var F=f*4-4,S=new Float64Array(F*3),T=new Float64Array(F*3),w=new Float64Array(F*3),C=new Float32Array(F*2),M=e.st?new Float32Array(F*2):void 0,R=kn(i)?new Uint8Array(F*4):void 0,U=0,O=0,z=0,k=0,Q;let V=[0];{for(l=0;l<f-1;l++){const G=b.Cartesian3.distance(h[l],h[l+1]);V.push(V[V.length-1]+G)}V=V.map(G=>G/V[V.length-1])}for(u=0;u<f;++u){u===0?(Q=C_,Ft.subtract(h[0],h[1],Q),Ft.add(h[0],Q,Q)):Q=h[u-1],Ft.clone(Q,E_),Ft.clone(h[u],S_),u===f-1?(Q=C_,Ft.subtract(h[f-1],h[f-2],Q),Ft.add(h[f-1],Q,Q)):Q=h[u+1],Ft.clone(Q,P_);var j,J;kn(R)&&(u!==0&&!o?j=i[u-1]:j=i[u],u!==f-1&&(J=i[u]));var ee=u===0?2:0,ie=u===f-1?2:4;for(A=ee;A<ie;++A){Ft.pack(S_,S,U),Ft.pack(E_,T,U),Ft.pack(P_,w,U),U+=3;var oe=A-2<0?-1:1;if(C[O++]=2*(A%2)-1,C[O++]=oe*n,e.st&&(M[z++]=V[u],M[z++]=Math.max(C[O-2],0)),kn(R)){var le=A<2?j:J;R[k++]=Bn.floatToByte(le.red),R[k++]=Bn.floatToByte(le.green),R[k++]=Bn.floatToByte(le.blue),R[k++]=Bn.floatToByte(le.alpha)}}}var ue=new Zz;ue.position=new _a({componentDatatype:ba.DOUBLE,componentsPerAttribute:3,values:S}),ue.prevPosition=new _a({componentDatatype:ba.DOUBLE,componentsPerAttribute:3,values:T}),ue.nextPosition=new _a({componentDatatype:ba.DOUBLE,componentsPerAttribute:3,values:w}),ue.expandAndWidth=new _a({componentDatatype:ba.FLOAT,componentsPerAttribute:2,values:C}),e.st&&(ue.st=new _a({componentDatatype:ba.FLOAT,componentsPerAttribute:2,values:M})),kn(R)&&(ue.color=new _a({componentDatatype:ba.UNSIGNED_BYTE,componentsPerAttribute:4,values:R,normalize:!0}));var re=Xz.createTypedArray(F,f*6-6),ce=0,$=0,q=f-1;for(u=0;u<q;++u)re[$++]=ce,re[$++]=ce+2,re[$++]=ce+1,re[$++]=ce+1,re[$++]=ce+2,re[$++]=ce+3,ce+=4;return new Kz({attributes:ue,indices:re,primitiveType:Yz.TRIANGLES,boundingSphere:jz.fromPoints(h),geometryType:$z.POLYLINES})};var vy;function e6(){return typeof vy>"u"&&(vy=new b.EllipsoidGeodesic),vy}function t6(t,n){var e=n/3e7;return e=Math.min(1,e),e=1-Math.pow(1-e,2),Math.sin(Math.PI*t)*1e6*e}function n6(t,n,e,i=1){var o=e6(),r=b.Cartesian3.fromDegreesArray([t[0],t[1],n[0],n[1]]),a=[0,0];t.length>=3&&n.length>=3&&(a=[t[2],n[2]]);var s=b.Cartographic.fromDegrees(t[0],t[1]),l=b.Cartographic.fromDegrees(n[0],n[1]);o.setEndPoints(s,l);var u=o.surfaceDistance,A=b.PolylinePipeline.generateCartesianArc({positions:r,height:a,minDistance:u/36}),h=A.length;return A.forEach(function(f,p){var d=p/(h-1),m=t6(d,u*i),v=b.Cartographic.fromCartesian(f);v.height+=m,b.Cartesian3.fromRadians(v.longitude,v.latitude,v.height,b.Ellipsoid.WGS84,A[p])}),A}function i6(t=[.8,.8,0,1],n=!0,e=!0,i){var o;const r=i?{type:"Image",uniforms:{color:new b.Color(...t)}}:{type:"Color",uniforms:{color:new b.Color(...t)}};n?(o=new b.PolylineMaterialAppearance({material:new b.Material({fabric:r,translucent:!1}),translucent:!1}),o.renderState.blending=b.BlendingState.ADDITIVE_BLEND,o.renderState.depthMask=!1,o.renderState.depthTest={enabled:!0},o.getRenderState=function(){const A=b.Appearance.prototype.getRenderState.call(this);return A.depthTest={enabled:e},A.depthMask=!1,A},o.material.type==="Image"&&(o.material._uniforms.image_1=i)):(o=new b.PolylineMaterialAppearance({material:new b.Material({fabric:r,translucent:!0})}),o.getRenderState=function(){const A=b.Appearance.prototype.getRenderState.call(this);return A.depthTest={enabled:e},A.depthMask=!1,A},o.material.type==="Image"&&(o.material._uniforms.image_1=i));var a=b.ShaderSource.replaceMain(o._vertexShaderSource,"czm_twp_main"),s=`out vec4 v_twp;
|
|
3669
|
+
`;const S=f.computeLocalAxisedBoundingBoxFromAttribute("position");if(!S)return;const{min:T,max:w}=S;f.setLocalAxisedBoundingBox(T,w)},A=async()=>{if(e.points&&e.points.length>2){const{minPos:f,center:p}=c.getMinMaxCorner(e.points),d=f[2]-e.depth;if(!c.equalsN3(e.points[e.points.length-1],e.points[e.points.length-2])){const x=wn({originPosition:p},e.points.map((E,B)=>{let P=[...E];return P[2]=d,P}));u(s,p,x[0],"bottom",!0)}const m=this._interpolationAlongPolygon(e.points.map((x,E)=>b.Cartesian3.fromArray(c.lbhToXyz(x))),e.interpolation),v=await i.getHeightsByLonLats(m.map(x=>[x[0],x[1]]));let y=[];for(let x=0;x<m.length;x++){const E=m[x];y.push([E[0],E[1],v[x]??E[2]],[E[0],E[1],d])}const g=wn({originPosition:p},y);let _=this._isClockwise(e.points,i);u(r,p,g[0],"side",_)}else r.attributes=void 0,s.attributes=void 0};A();const h=this.dv(c.createNextAnimateFrameEvent(e.depthChanged,e.interpolationChanged,e.pointsChanged,e.bottomImageChanged,e.sideImageChanged));this.ad(h.don(A))}{const u=()=>{a.uri=e.sideImage.url,l.uri=e.bottomImage.url,r.uniformMap={u_image:{type:"texture",id:a.id},u_color:[1,1,1,e.opacity]},s.uniformMap={u_image:{type:"texture",id:l.id},u_color:[1,1,1,e.opacity]}};u();const A=this.ad(c.createNextAnimateFrameEvent(e.opacityChanged,e.bottomImageChanged,e.sideImageChanged));this.d(A.don(u))}}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}_interpolationAlongPolygon(e,i){var o=[];for(let l=0;l<e.length;++l){var r=e[l],a=e[(l+1)%e.length],s=this._interpolationAlongLine(r,a,i);o.push(...s)}return o.push(o[0]),o}_interpolationAlongLine(e,i,o){var r=[],a=b.Cartesian3.distance(e,i),s=b.Cartesian3.subtract(i,e,new b.Cartesian3);s.equals(b.Cartesian3.ZERO)||b.Cartesian3.normalize(s,s);for(var l=0;l<a;){var u=new b.Cartesian3(s.x*l,s.y*l,s.z*l),A=b.Cartesian3.add(e,u,new b.Cartesian3);const h=De(A);h&&r.push(h),l+=o}return r}_isClockwise(e,i){if(i.viewer)for(let o=0;o<e.length;o++){let r=b.Cartesian3.fromDegrees(...e[o]),a=b.Cartesian3.fromDegrees(...e[(o+1)%e.length]),s=b.Cartesian3.fromDegrees(...e[(o+2)%e.length]),l=b.Cartesian3.subtract(a,r,new b.Cartesian3),u=b.Cartesian3.subtract(s,a,new b.Cartesian3);if(l.equals(b.Cartesian3.ZERO)||u.equals(b.Cartesian3.ZERO))return!0;if(b.Cartesian3.normalize(l,l),b.Cartesian3.normalize(u,u),Math.abs(b.Cartesian3.dot(l,u))==1){if(o==e.length-1)return!0;continue}let A=b.Cartesian3.cross(l,u,new b.Cartesian3);return b.Cartesian3.dot(A,i.viewer.camera.directionWC)>0}}_triangleIndices(e){let i=new Uint32Array(e*3);for(let o=0;o<e;++o)i[o*3+0]=o,i[o*3+1]=o%2?(o+2)%e:(o+1)%e,i[o*3+2]=o%2?(o+1)%e:(o+2)%e;return i}_getDistance(e,i){return Math.sqrt(Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2))}};L(Vc,"type",Vc.register("ESCesiumViewer",c.ESPit.type,Vc));let uy=Vc;const Nc=class Nc extends Ln{constructor(e,i){super(e,i);L(this,"_czmPolygonPrimitive");L(this,"_geoPolylines");if(this._czmPolygonPrimitive=this.disposeVar(new Lr(i,e.id)),console.log(this.czmPolygonPrimitive),this._geoPolylines=this.disposeVar(new ai(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}{const s=()=>{this.geoPolygon&&(this.geoPolygon.show=!1)};s(),this.ad(this.sceneObject.showChanged.don(s))}const r=this._geoPolylines;r.arcType="RHUMB";const a=this._czmPolygonPrimitive;this.dispose(c.track([a,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"color"],[e,"strokeColor"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"]));{a.perPositionHeight=!0;const s=()=>{r.show=e.show&&e.stroked,a.show=e.show&&e.filled,a.material={type:"Color",color:e.fillColor}};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged,e.fillColorChanged));this.dispose(l.don(s))}{const s=()=>{const u={positions:[],holes:[]};if(e.points&&e.points.length>=3){if(r.positions=[[...e.points,e.points[0]]],u.positions=e.points,e.innerRings&&e.innerRings.length>0)for(let A=0;A<e.innerRings.length;A++){const h=e.innerRings[A];u.holes.push({positions:h}),r.positions.push([...h,h[0]])}a.polygonHierarchy=u}else a.polygonHierarchy=u};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.pointsChanged,e.innerRingsChanged));this.dispose(l.disposableOn(()=>s()))}}get czmPolygonPrimitive(){return this._czmPolygonPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Nc,"type",Nc.register("ESCesiumViewer",c.ESPolygonWithHole.type,Nc));let cy=Nc;var an=63710088e-1,hy={centimeters:an*100,centimetres:an*100,degrees:an/111325,feet:an*3.28084,inches:an*39.37,kilometers:an/1e3,kilometres:an/1e3,meters:an,metres:an,miles:an/1609.344,millimeters:an*1e3,millimetres:an*1e3,nauticalmiles:an/1852,radians:1,yards:an*1.0936},dz={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/an,yards:1.0936133},Ay={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function zn(t,n,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=n||{},i.geometry=t,i}function pz(t,n,e){switch(t){case"Point":return Xt(n).geometry;case"LineString":return Yn(n).geometry;case"Polygon":return Vt(n).geometry;case"MultiPoint":return d_(n).geometry;case"MultiLineString":return fy(n).geometry;case"MultiPolygon":return dy(n).geometry;default:throw new Error(t+" is invalid")}}function Xt(t,n,e){if(e===void 0&&(e={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ff(t[0])||!Ff(t[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:t};return zn(i,n,e)}function mz(t,n,e){return e===void 0&&(e={}),Pn(t.map(function(i){return Xt(i,n)}),e)}function Vt(t,n,e){e===void 0&&(e={});for(var i=0,o=t;i<o.length;i++){var r=o[i];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<r[r.length-1].length;a++)if(r[r.length-1][a]!==r[0][a])throw new Error("First and last Position are not equivalent.")}var s={type:"Polygon",coordinates:t};return zn(s,n,e)}function gz(t,n,e){return e===void 0&&(e={}),Pn(t.map(function(i){return Vt(i,n)}),e)}function Yn(t,n,e){if(e===void 0&&(e={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:t};return zn(i,n,e)}function yz(t,n,e){return e===void 0&&(e={}),Pn(t.map(function(i){return Yn(i,n)}),e)}function Pn(t,n){n===void 0&&(n={});var e={type:"FeatureCollection"};return n.id&&(e.id=n.id),n.bbox&&(e.bbox=n.bbox),e.features=t,e}function fy(t,n,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:t};return zn(i,n,e)}function d_(t,n,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:t};return zn(i,n,e)}function dy(t,n,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:t};return zn(i,n,e)}function vz(t,n,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:t};return zn(i,n,e)}function wz(t,n){if(n===void 0&&(n=0),n&&!(n>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,n||0);return Math.round(t*e)/e}function py(t,n){n===void 0&&(n="kilometers");var e=hy[n];if(!e)throw new Error(n+" units is invalid");return t*e}function my(t,n){n===void 0&&(n="kilometers");var e=hy[n];if(!e)throw new Error(n+" units is invalid");return t/e}function bz(t,n){return p_(my(t,n))}function xz(t){var n=t%360;return n<0&&(n+=360),n}function p_(t){var n=t%(2*Math.PI);return n*180/Math.PI}function ru(t){var n=t%360;return n*Math.PI/180}function _z(t,n,e){if(n===void 0&&(n="kilometers"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("length must be a positive number");return py(my(t,n),e)}function Cz(t,n,e){if(n===void 0&&(n="meters"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=Ay[n];if(!i)throw new Error("invalid original units");var o=Ay[e];if(!o)throw new Error("invalid final units");return t/i*o}function Ff(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function gy(t){return!!t&&t.constructor===Object}function Sz(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(n){if(!Ff(n))throw new Error("bbox must only contain numbers")})}function Ez(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}const Pz=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:Ay,bearingToAzimuth:xz,convertArea:Cz,convertLength:_z,degreesToRadians:ru,earthRadius:an,factors:hy,feature:zn,featureCollection:Pn,geometry:pz,geometryCollection:vz,isNumber:Ff,isObject:gy,lengthToDegrees:bz,lengthToRadians:my,lineString:Yn,lineStrings:yz,multiLineString:fy,multiPoint:d_,multiPolygon:dy,point:Xt,points:mz,polygon:Vt,polygons:gz,radiansToDegrees:p_,radiansToLength:py,round:wz,unitsFactors:dz,validateBBox:Sz,validateId:Ez},Symbol.toStringTag,{value:"Module"}));function Mf(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Ii(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Bz(t,n,e){if(!t)throw new Error("No featureCollection passed");if(!t||t.type!=="FeatureCollection")throw new Error("Invalid input to "+e+", FeatureCollection required");for(var i=0,o=t.features;i<o.length;i++){var r=o[i];if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!r.geometry||r.geometry.type!==n)throw new Error("Invalid input to "+e+": must be a "+n+", given "+r.geometry.type)}}function Fi(t){return t.type==="Feature"?t.geometry:t}function Tz(t,n){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function Mi(t,n,e){e===void 0&&(e={});var i=Mf(t),o=Mf(n),r=ru(o[1]-i[1]),a=ru(o[0]-i[0]),s=ru(i[1]),l=ru(o[1]),u=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return py(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}function Jo(t,n,e){if(t!==null)for(var i,o,r,a,s,l,u,A=0,h=0,f,p=t.type,d=p==="FeatureCollection",m=p==="Feature",v=d?t.features.length:1,y=0;y<v;y++){u=d?t.features[y].geometry:m?t.geometry:t,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var g=0;g<s;g++){var _=0,x=0;if(a=f?u.geometries[g]:u,a!==null){l=a.coordinates;var E=a.type;switch(A=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(n(l,h,y,_,x)===!1)return!1;h++,_++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(n(l[i],h,y,_,x)===!1)return!1;h++,E==="MultiPoint"&&_++}E==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-A;o++){if(n(l[i][o],h,y,_,x)===!1)return!1;h++}E==="MultiLineString"&&_++,E==="Polygon"&&x++}E==="Polygon"&&_++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(x=0,o=0;o<l[i].length;o++){for(r=0;r<l[i][o].length-A;r++){if(n(l[i][o][r],h,y,_,x)===!1)return!1;h++}x++}_++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Jo(a.geometries[i],n,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Iz(t,n,e,i){var o=e;return Jo(t,function(r,a,s,l,u){a===0&&e===void 0?o=r:o=n(o,r,a,s,l,u)},i),o}function m_(t,n){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&n(t.features[e].properties,e)!==!1;e++);break;case"Feature":n(t.properties,0);break}}function Fz(t,n,e){var i=e;return m_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function wa(t,n){if(t.type==="Feature")n(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&n(t.features[e],e)!==!1;e++);}function Mz(t,n,e){var i=e;return wa(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function Dz(t){var n=[];return Jo(t,function(e){n.push(e)}),n}function yy(t,n){var e,i,o,r,a,s,l,u,A,h,f=0,p=t.type==="FeatureCollection",d=t.type==="Feature",m=p?t.features.length:1;for(e=0;e<m;e++){for(s=p?t.features[e].geometry:d?t.geometry:t,u=p?t.features[e].properties:d?t.properties:{},A=p?t.features[e].bbox:d?t.bbox:void 0,h=p?t.features[e].id:d?t.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,o=0;o<a;o++){if(r=l?s.geometries[o]:s,r===null){if(n(null,f,u,A,h)===!1)return!1;continue}switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(r,f,u,A,h)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<r.geometries.length;i++)if(n(r.geometries[i],f,u,A,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Rz(t,n,e){var i=e;return yy(t,function(o,r,a,s,l){r===0&&e===void 0?i=o:i=n(i,o,r,a,s,l)}),i}function rr(t,n){yy(t,function(e,i,o,r,a){var s=e===null?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return n(zn(e,o,{bbox:r,id:a}),i,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var A=e.coordinates[u],h={type:l,coordinates:A};if(n(zn(h,o),i,u)===!1)return!1}})}function Uz(t,n,e){var i=e;return rr(t,function(o,r,a){r===0&&a===0&&e===void 0?i=o:i=n(i,o,r,a)}),i}function g_(t,n){rr(t,function(e,i,o){var r=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var s,l=0,u=0,A=0;if(Jo(e,function(h,f,p,d,m){if(s===void 0||i>l||d>u||m>A){s=h,l=i,u=d,A=m,r=0;return}var v=Yn([s,h],e.properties);if(n(v,i,o,m,r)===!1)return!1;r++,s=h})===!1)return!1}}})}function y_(t,n,e){var i=e,o=!1;return g_(t,function(r,a,s,l,u){o===!1&&e===void 0?i=r:i=n(i,r,a,s,l,u),o=!0}),i}function v_(t,n){if(!t)throw new Error("geojson is required");rr(t,function(e,i,o){if(e.geometry!==null){var r=e.geometry.type,a=e.geometry.coordinates;switch(r){case"LineString":if(n(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(n(Yn(a[s],e.properties),i,o,s)===!1)return!1;break}}})}function Oz(t,n,e){var i=e;return v_(t,function(o,r,a,s){r===0&&e===void 0?i=o:i=n(i,o,r,a,s)}),i}function Lz(t,n){if(n=n||{},!gy(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.segmentIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":case"MultiPoint":return null;case"LineString":return r<0&&(r=l.length+r-1),Yn([l[r],l[r+1]],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r-1),Yn([l[o][r],l[o][r+1]],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r-1),Yn([l[i][r],l[i][r+1]],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r-1),Yn([l[i][o][r],l[i][o][r+1]],a,n)}throw new Error("geojson is invalid")}function zz(t,n){if(n=n||{},!gy(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.coordIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":return Xt(l,a,n);case"MultiPoint":return i<0&&(i=l.length+i),Xt(l[i],a,n);case"LineString":return r<0&&(r=l.length+r),Xt(l[r],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r),Xt(l[o][r],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r),Xt(l[i][r],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r),Xt(l[i][o][r],a,n)}throw new Error("geojson is invalid")}const kz=Object.freeze(Object.defineProperty({__proto__:null,coordAll:Dz,coordEach:Jo,coordReduce:Iz,featureEach:wa,featureReduce:Mz,findPoint:zz,findSegment:Lz,flattenEach:rr,flattenReduce:Uz,geomEach:yy,geomReduce:Rz,lineEach:v_,lineReduce:Oz,propEach:m_,propReduce:Fz,segmentEach:g_,segmentReduce:y_},Symbol.toStringTag,{value:"Module"}));function Qz(t,n){return n===void 0&&(n={}),y_(t,function(e,i){var o=i.geometry.coordinates;return e+Mi(o[0],o[1],n)},0)}function Vz(t){var n=Yn(t),e=Qz(n,{units:"meters"});return e}function*Nz(t){t.type==="FeatureCollection"?yield*t.features.map(n=>[n.geometry,n]):t.type==="Feature"&&(yield[t.geometry,t])}function*Hz(t){for(const[n,e]of Nz(t))if(n.type==="LineString")yield[n.coordinates,e];else if(n.type==="MultiLineString")for(let i of n.coordinates)yield[i,e]}function Gz(t,n,e){return[...Hz(t)].map(([i,o])=>{if(i.length<2)return;const r=i.map(l=>[l[0],l[1],l[2]??0]),s=Vz(r)/e;return{positions:r,repeat:s,width:n,extra:{geojson:{feature:o}}}}).filter(i=>!!i)}const ou=b.ArcType,Wz=b.arrayRemoveDuplicates,jz=b.BoundingSphere,Ft=b.Cartesian3,Bn=b.Color,ba=b.ComponentDatatype,qz=b.Frozen,kn=b.defined,xa=b.DeveloperError,Di=b.Ellipsoid,Kz=b.Geometry,_a=b.GeometryAttribute,Zz=b.GeometryAttributes,$z=b.GeometryType,Xz=b.IndexDatatype,w_=b.Math,su=b.PolylinePipeline,Yz=b.PrimitiveType,or=b.VertexFormat;var b_=[];function Jz(t,n,e,i,o){var r=b_;r.length=o;var a,s=e.red,l=e.green,u=e.blue,A=e.alpha,h=i.red,f=i.green,p=i.blue,d=i.alpha;if(Bn.equals(e,i)){for(a=0;a<o;a++)r[a]=Bn.clone(e);return r}var m=(h-s)/o,v=(f-l)/o,y=(p-u)/o,g=(d-A)/o;for(a=0;a<o;a++)r[a]=new Bn(s+a*m,l+a*v,u+a*y,A+a*g);return r}function Ca(t){t=t??qz.EMPTY_OBJECT;var n=t.positions,e=t.colors,i=t.width??1,o=t.colorsPerVertex??!1;if(!kn(n)||n.length<2)throw new xa("At least two positions are required.");if(typeof i!="number")throw new xa("width must be a number");if(kn(e)&&(o&&e.length<n.length||!o&&e.length<n.length-1))throw new xa("colors has an invalid length.");this._positions=n,this._colors=e,this._width=i,this._colorsPerVertex=o,this._vertexFormat=or.clone(t.vertexFormat??or.DEFAULT),this._arcType=t.arcType??ou.GEODESIC,this._granularity=t.granularity??w_.RADIANS_PER_DEGREE,this._ellipsoid=Di.clone(t.ellipsoid??Di.WGS84),this._workerName="createPolylineGeometry";var r=1+n.length*Ft.packedLength;r+=kn(e)?1+e.length*Bn.packedLength:1,this.packedLength=r+Di.packedLength+or.packedLength+4}Ca.pack=function(t,n,e){if(!kn(t))throw new xa("value is required");if(!kn(n))throw new xa("array is required");e=e??0;var i,o=t._positions,r=o.length;for(n[e++]=r,i=0;i<r;++i,e+=Ft.packedLength)Ft.pack(o[i],n,e);var a=t._colors;for(r=kn(a)?a.length:0,n[e++]=r,i=0;i<r;++i,e+=Bn.packedLength)Bn.pack(a[i],n,e);return Di.pack(t._ellipsoid,n,e),e+=Di.packedLength,or.pack(t._vertexFormat,n,e),e+=or.packedLength,n[e++]=t._width,n[e++]=t._colorsPerVertex?1:0,n[e++]=t._arcType,n[e]=t._granularity,n};var x_=Di.clone(Di.UNIT_SPHERE),__=new or,es={positions:void 0,colors:void 0,ellipsoid:x_,vertexFormat:__,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};Ca.unpack=function(t,n,e){if(!kn(t))throw new xa("array is required");n=n??0;var i,o=t[n++],r=new Array(o);for(i=0;i<o;++i,n+=Ft.packedLength)r[i]=Ft.unpack(t,n);o=t[n++];var a=o>0?new Array(o):void 0;for(i=0;i<o;++i,n+=Bn.packedLength)a[i]=Bn.unpack(t,n);var s=Di.unpack(t,n,x_);n+=Di.packedLength;var l=or.unpack(t,n,__);n+=or.packedLength;var u=t[n++],A=t[n++]===1,h=t[n++],f=t[n];return kn(e)?(e._positions=r,e._colors=a,e._ellipsoid=Di.clone(s,e._ellipsoid),e._vertexFormat=or.clone(l,e._vertexFormat),e._width=u,e._colorsPerVertex=A,e._arcType=h,e._granularity=f,e):(es.positions=r,es.colors=a,es.width=u,es.colorsPerVertex=A,es.arcType=h,es.granularity=f,new Ca(es))};var C_=new Ft,S_=new Ft,E_=new Ft,P_=new Ft;Ca.createGeometry=function(t){var n=t._width,e=t._vertexFormat,i=t._colors,o=t._colorsPerVertex,r=t._arcType,a=t._granularity,s=t._ellipsoid,l,u,A,h=Wz(t._positions,Ft.equalsEpsilon),f=h.length;if(f<2||n<=0)return;if(r===ou.GEODESIC||r===ou.RHUMB){var p,d;r===ou.GEODESIC?(p=w_.chordLength(a,s.maximumRadius),d=su.numberOfPoints):(p=a,d=su.numberOfPointsRhumbLine);var m=su.extractHeights(h,s);if(kn(i)){var v=1;for(l=0;l<f-1;++l)v+=d(h[l],h[l+1],p);var y=new Array(v),g=0;for(l=0;l<f-1;++l){var _=h[l],x=h[l+1],E=i[l],B=d(_,x,p);if(o&&l<v){var P=i[l+1],I=Jz(_,x,E,P,B),D=I.length;for(u=0;u<D;++u)y[g++]=I[u]}else for(u=0;u<B;++u)y[g++]=Bn.clone(E)}y[g]=Bn.clone(i[i.length-1]),i=y,b_.length=0}r===ou.GEODESIC?h=su.generateCartesianArc({positions:h,minDistance:p,ellipsoid:s,height:m}):h=su.generateCartesianRhumbArc({positions:h,granularity:p,ellipsoid:s,height:m})}f=h.length;var F=f*4-4,S=new Float64Array(F*3),T=new Float64Array(F*3),w=new Float64Array(F*3),C=new Float32Array(F*2),M=e.st?new Float32Array(F*2):void 0,R=kn(i)?new Uint8Array(F*4):void 0,U=0,O=0,z=0,k=0,Q;let V=[0];{for(l=0;l<f-1;l++){const G=b.Cartesian3.distance(h[l],h[l+1]);V.push(V[V.length-1]+G)}V=V.map(G=>G/V[V.length-1])}for(u=0;u<f;++u){u===0?(Q=C_,Ft.subtract(h[0],h[1],Q),Ft.add(h[0],Q,Q)):Q=h[u-1],Ft.clone(Q,E_),Ft.clone(h[u],S_),u===f-1?(Q=C_,Ft.subtract(h[f-1],h[f-2],Q),Ft.add(h[f-1],Q,Q)):Q=h[u+1],Ft.clone(Q,P_);var j,J;kn(R)&&(u!==0&&!o?j=i[u-1]:j=i[u],u!==f-1&&(J=i[u]));var ee=u===0?2:0,ie=u===f-1?2:4;for(A=ee;A<ie;++A){Ft.pack(S_,S,U),Ft.pack(E_,T,U),Ft.pack(P_,w,U),U+=3;var oe=A-2<0?-1:1;if(C[O++]=2*(A%2)-1,C[O++]=oe*n,e.st&&(M[z++]=V[u],M[z++]=Math.max(C[O-2],0)),kn(R)){var le=A<2?j:J;R[k++]=Bn.floatToByte(le.red),R[k++]=Bn.floatToByte(le.green),R[k++]=Bn.floatToByte(le.blue),R[k++]=Bn.floatToByte(le.alpha)}}}var ue=new Zz;ue.position=new _a({componentDatatype:ba.DOUBLE,componentsPerAttribute:3,values:S}),ue.prevPosition=new _a({componentDatatype:ba.DOUBLE,componentsPerAttribute:3,values:T}),ue.nextPosition=new _a({componentDatatype:ba.DOUBLE,componentsPerAttribute:3,values:w}),ue.expandAndWidth=new _a({componentDatatype:ba.FLOAT,componentsPerAttribute:2,values:C}),e.st&&(ue.st=new _a({componentDatatype:ba.FLOAT,componentsPerAttribute:2,values:M})),kn(R)&&(ue.color=new _a({componentDatatype:ba.UNSIGNED_BYTE,componentsPerAttribute:4,values:R,normalize:!0}));var re=Xz.createTypedArray(F,f*6-6),ce=0,$=0,q=f-1;for(u=0;u<q;++u)re[$++]=ce,re[$++]=ce+2,re[$++]=ce+1,re[$++]=ce+1,re[$++]=ce+2,re[$++]=ce+3,ce+=4;return new Kz({attributes:ue,indices:re,primitiveType:Yz.TRIANGLES,boundingSphere:jz.fromPoints(h),geometryType:$z.POLYLINES})};var vy;function ek(){return typeof vy>"u"&&(vy=new b.EllipsoidGeodesic),vy}function tk(t,n){var e=n/3e7;return e=Math.min(1,e),e=1-Math.pow(1-e,2),Math.sin(Math.PI*t)*1e6*e}function nk(t,n,e,i=1){var o=ek(),r=b.Cartesian3.fromDegreesArray([t[0],t[1],n[0],n[1]]),a=[0,0];t.length>=3&&n.length>=3&&(a=[t[2],n[2]]);var s=b.Cartographic.fromDegrees(t[0],t[1]),l=b.Cartographic.fromDegrees(n[0],n[1]);o.setEndPoints(s,l);var u=o.surfaceDistance,A=b.PolylinePipeline.generateCartesianArc({positions:r,height:a,minDistance:u/36}),h=A.length;return A.forEach(function(f,p){var d=p/(h-1),m=tk(d,u*i),v=b.Cartographic.fromCartesian(f);v.height+=m,b.Cartesian3.fromRadians(v.longitude,v.latitude,v.height,b.Ellipsoid.WGS84,A[p])}),A}function ik(t=[.8,.8,0,1],n=!0,e=!0,i){var o;const r=i?{type:"Image",uniforms:{color:new b.Color(...t)}}:{type:"Color",uniforms:{color:new b.Color(...t)}};n?(o=new b.PolylineMaterialAppearance({material:new b.Material({fabric:r,translucent:!1}),translucent:!1}),o.renderState.blending=b.BlendingState.ADDITIVE_BLEND,o.renderState.depthMask=!1,o.renderState.depthTest={enabled:!0},o.getRenderState=function(){const A=b.Appearance.prototype.getRenderState.call(this);return A.depthTest={enabled:e},A.depthMask=!1,A},o.material.type==="Image"&&(o.material._uniforms.image_1=i)):(o=new b.PolylineMaterialAppearance({material:new b.Material({fabric:r,translucent:!0})}),o.getRenderState=function(){const A=b.Appearance.prototype.getRenderState.call(this);return A.depthTest={enabled:e},A.depthMask=!1,A},o.material.type==="Image"&&(o.material._uniforms.image_1=i));var a=b.ShaderSource.replaceMain(o._vertexShaderSource,"czm_twp_main"),s=`out vec4 v_twp;
|
|
3670
3670
|
out vec4 v_color;
|
|
3671
3671
|
out vec4 v_bgColor;
|
|
3672
3672
|
out float v_expand;
|
|
@@ -3692,7 +3692,7 @@ void main()
|
|
|
3692
3692
|
{
|
|
3693
3693
|
czm_twp2_main();
|
|
3694
3694
|
float t = v_twp.x; float bidirectional = v_twp.z; t *= 1.03; float alpha0 = smoothstep(t - 0.03, t, v_st.s) * step(v_st.s, t); float mt = 1. - t; float alpha1 = smoothstep(mt + 0.03, mt, v_st.s) * step(mt, v_st.s); float a0 = step(abs(bidirectional - 0.0) - 0.001, 0.); float a1 = step(abs(bidirectional - 1.0) - 0.001, 0.); float db = step(abs(bidirectional - 2.0) - 0.001, 0.); float alpha = alpha0 * (a0 + db) + alpha1 * (a1 + db); alpha = clamp(alpha, 0., 1.); out_FragColor.rgb *= (v_color.rgb * alpha + v_bgColor.rgb * (1. - alpha)); out_FragColor.a *= (v_color.a * alpha + v_bgColor.a * (1. - alpha));}`;return o._fragmentShaderSource=l+`
|
|
3695
|
-
`+u,o}function
|
|
3695
|
+
`+u,o}function rk(t,n,e,i,o,r,a){const s=Ca.createGeometry(new Ca({positions:n,width:e,vertexFormat:b.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:i}));if(s){r||(r=b.Color.clone(o||b.Color.WHITE),r.alpha=.2);var l=new b.GeometryInstance({geometry:s,id:t,attributes:{color:b.ColorGeometryInstanceAttribute.fromColor(o||b.Color.WHITE),bgColor:b.ColorGeometryInstanceAttribute.fromColor(r),twp:new b.GeometryInstanceAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,value:a})}});return l}}const Df=new b.Cartesian4(0,0,0,0),Ri=new b.Cartesian4(0,0,0,0),au={timeRatio:0,repeat:1,color:[1,1,1,1],bgColor:[1,1,1,1],bidirectional:0};function ok(t,n,e,i,o=!0,r=!0,a,s){var l=[];try{t.forEach(function(A,h){var f=A.positions&&A.positions.map(P=>b.Cartesian3.fromDegrees(...P))||nk(A.startPos,A.endPos,void 0,typeof A.heightRatio>"u"?1:A.heightRatio);const p=i(h,void 0,au),{timeRatio:d,repeat:m,color:v,bidirectional:y,bgColor:g}=p,_=new b.Color(...v),x=new b.Color(...g),E=[d,m,y,0];var B=rk(h,f,A.width,e,_,x,E);if(!B)throw new Error("cannot get geoemetry instance!");l.push(B)})}catch{return}var u=new b.Primitive({geometryInstances:l,appearance:ik(n,o,r,a),asynchronous:!1});return b.Primitive.prototype&&(u.ESSceneObjectID=s),u.update=function(A){const h=this;if(typeof h._batchTable<"u")for(var f=h._batchTableAttributeIndices.twp,p=h._batchTableAttributeIndices.color,d=h._batchTableAttributeIndices.bgColor,m=h._batchTable._numberOfInstances,v=0;v<m;++v){var y=v;au.timeRatio=0,au.repeat=1,au.color.splice(0,4,1,1,1);const g=i(y,A,au),{timeRatio:_,repeat:x,color:E,bidirectional:B,bgColor:P}=g;Df.x=_,Df.y=x,Df.z=typeof B!="number"?0:B,h._batchTable.setBatchedAttribute(y,f,Df),Ri.x=255*E[0],Ri.y=255*E[1],Ri.z=255*E[2],Ri.w=255*E[3],h._batchTable.setBatchedAttribute(y,p,Ri),Ri.x=255*P[0],Ri.y=255*P[1],Ri.z=255*P[2],Ri.w=255*P[3],h._batchTable.setBatchedAttribute(y,d,Ri)}b.Primitive.prototype.update.call(h,A)},u}class sk extends c.Destroyable{constructor(e,i,o){super();L(this,"_nativePrimitive");this._viewer=e;const r=this._viewer,a=i.routePaths;if(!a)throw new Error("!routePath");const s=i.arcType!==void 0?b.ArcType[i.arcType]:b.ArcType.GEODESIC,l=ok(a,i.color,s,(u,A,h)=>{const f=a[u];if(!i)return h;h.repeat=(f.repeat??1)*i.repeat;const p=f.startTime??i.startTime,d=f.transmissionTime??i.transmissionTime??i.duration??sr.defaults.duration,m=i.currentTime??sr.defaults.currentTime,v=c.clamp((m-p)/d,0,1);h.timeRatio=v/h.repeat;const y=f.color??i.color,g=f.bgColor??i.bgColor;return h.color.splice(0,4,...y),h.bgColor.splice(0,4,...g),h.bidirectional=f.bidirectional??i.bidirectional,(i.routePathCallback&&i.routePathCallback(h,u,A))??h},i.brightening,i.depthTest,o,i.id);l&&(r.scene.primitives.add(l),this.dispose(()=>{r.scene.primitives.remove(l)}),l.show=i.show??!0,this.dispose(i.showChanged.disposableOn(()=>{l&&(l.show=i.show??!0)})),this._nativePrimitive=l)}get nativePrimitive(){return this._nativePrimitive}}const ak="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAABCAYAAABubagXAAAATUlEQVQYlaXLOQqEUBQF0SMmojgvpfe/JiccEvlNwwuM24IK7oXKUkof7ylQoUGHHsPDMf4WNcpociTcuHBgx4oFczg9/O0tPKP7D3wBky8UMt76XnoAAAAASUVORK5CYII=",lk=`默认示例代码
|
|
3696
3696
|
\`\`\`
|
|
3697
3697
|
// result 最后的结果
|
|
3698
3698
|
// this 是当前的信号传输器集合
|
|
@@ -3706,7 +3706,7 @@ function (result, this, instanceIndex, frameState) {
|
|
|
3706
3706
|
result.bgColor = [c*.5+.5, (1.0 - c)*.5+.5, 0.5, 0.3];
|
|
3707
3707
|
return result;
|
|
3708
3708
|
}\`\`\`
|
|
3709
|
-
`,co=class co extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_player");L(this,"_finalImageUrlReact",this.disposeVar(c.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));L(this,"_routePaths",this.disposeVar(c.react(void 0)));L(this,"routePathCallback");L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this._id.value=i),this._player=this.disposeVar(new c.Player);{const p=co.defaults;this.dispose(c.bind([this._player,"loop"],[this,"loop"],d=>d??p.loop,d=>d??p.loop)),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"],d=>d??p.currentTime,d=>d??p.currentTime)),this.dispose(c.bind([this._player,"duration"],[this,"duration"],d=>d??p.duration,d=>d??p.duration)),this.dispose(c.bind([this._player,"playing"],[this,"playing"],d=>d??p.playing,d=>d??p.playing)),this.dispose(c.bind([this._player,"speed"],[this,"speed"],d=>d??p.speed,d=>d??p.speed))}const o=this.disposeVar(c.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),r=this.disposeVar(c.createProcessingFromAsyncFunc(async p=>{this.routePaths=void 0;const d=o.value;if(d)try{const v=await(await fetch(d)).json();this.routePaths=Gz(v,this.width,this.repeatLength);return}catch(m){console.error(`geojson加载解析出错!${m}`),console.error(m)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const m=this.positionsSet;if(m){this.routePaths=m.map(v=>({positions:v,width:this.width}));return}}}));{const p=()=>{r.restart()};p();const d=this.disposeVar(c.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(d.disposableOn(p))}{const p=()=>{const d=Id(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);d&&(this.routePathCallback=d)};p(),this.dispose(this.routePathCallbackStrChanged.disposableOn(p))}const a=e.viewer;if(!a){console.warn("viewer is undefined!");return}const s=this.finalImageUrlReact,l=this.disposeVar(new xs),u=this.disposeVar(c.createProcessingFromAsyncFunc(async p=>{if(!s.value)return;const d=V0(a.scene.context).getTextureHandler(s.value);if(d instanceof xs)l.reset(d);else{const m=await p.promise(d);l.reset(m)}})),A=()=>l.valid?l.raw:a.scene.context.defaultTexture,h=()=>u.restart();h(),this.dispose(s.changed.disposableOn(h));const f=this.ad(c.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new c.ObjResettingWithEvent(f,()=>this.routePaths?new s6(a,this,s.value&&A||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(p=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))Fe(a,this.routePaths[0].startPos,a.camera.positionCartographic.height,void 0,p);else{const d=computeBoundingSphere(this.routePaths[0].positions);if(!d)return;const[m,v]=d;Fe(a,m,v*3,void 0,p)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get finalImageUrlReact(){return this._finalImageUrlReact}get routePaths(){return this._routePaths.value}set routePaths(e){this._routePaths.value=e}get routePathsChanged(){return this._routePaths.changed}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}};L(co,"whiteGradientImageBase64",a6),L(co,"defaultRoutePathCallback",function(e,i,o){const r=i/50,a=r-Math.floor(r);return e.color=[a*.5+.5,(1-a)*.5+.5,.5,1],e.bgColor=[a*.5+.5,(1-a)*.5+.5,.5,.3],e}),L(co,"routePathCallbackStrMd",l6),L(co,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(co,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let sr=co;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:c.reactArray([0,1,0,1]),bgColor:c.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:c.reactPositionsSet(void 0),data:c.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(sr||(sr={})),c.extendClassProps(sr.prototype,sr.createDefaultProps);class Jr extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_collection");this._collection=this.disposeVar(new sr(e,i)),this.dispose(c.track([this._collection,"show"],[this,"show"])),this.dispose(c.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(c.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(c.track([this._collection,"color"],[this,"color"])),this.dispose(c.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(c.track([this._collection,"width"],[this,"width"])),this.dispose(c.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(c.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(c.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(c.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(c.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(c.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(c.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([this._collection,"playing"],[this,"playing"])),this.dispose(c.track([this._collection,"loop"],[this,"loop"])),this.dispose(c.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._collection,"duration"],[this,"duration"])),this.dispose(c.bind([this._collection,"speed"],[this,"speed"]));{const o=()=>{this.color=[this.bgColor[0],this.bgColor[1],this.bgColor[2],1]};o(),this.ad(this.bgColorChanged.don(o))}this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=this.positions.map((a,s)=>{var l;if(!(!this.positions||s==((l=this.positions)==null?void 0:l.length)-1))return{startPos:a,endPos:this.positions[s+1],width:this.width,heightRatio:this.heightRatio}}).filter(a=>a!==void 0);return}this._collection.data=void 0};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(r.disposableOn(o))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get collection(){return this._collection}get player(){return this.collection.player}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}}L(Jr,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(Jr,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png"),(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:c.reactArray([0,1,0,1]),bgColor:c.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:c.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Jr||(Jr={})),c.extendClassProps(Jr.prototype,Jr.createDefaultProps);const Hc=class Hc extends sn{constructor(e,i){super(e,i);L(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Jr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmSignalTransmission;{const a=()=>{r.show=e.show&&e.stroked};a(),this.ad(e.showChanged.don(a)),this.ad(e.strokedChanged.don(a))}this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"bgColor"],[e,"strokeColor"])),this.dispose(c.track([r,"startTime"],[e,"startTime"])),this.dispose(c.track([r,"transmissionTime"],[e,"transmissionTime"])),this.dispose(c.track([r,"heightRatio"],[e,"heightRatio"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"brightening"],[e,"brightening"])),this.dispose(c.track([r,"depthTest"],[e,"depthTest"])),this.dispose(c.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(c.track([r,"repeat"],[e,"repeat"])),this.dispose(c.track([r,"bidirectional"],[e,"bidirectional"])),this.dispose(c.track([r,"loop"],[e,"loop"])),this.dispose(c.track([r,"currentTime"],[e,"currentTime"])),this.dispose(c.track([r,"duration"],[e,"duration"])),this.dispose(c.track([r,"playing"],[e,"playing"])),this.dispose(c.track([r,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Hc,"type",Hc.register("ESCesiumViewer",bf.type,Hc));let wy=Hc;function ts(t){var n=[1/0,1/0,-1/0,-1/0];return Jo(t,function(e){n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}ts.default=ts;var B_={exports:{}};(function(t,n){(function(e,i){t.exports=i()})(Oo,function(){function e(g,_,x,E,B){(function P(I,D,F,S,T){for(;S>F;){if(S-F>600){var w=S-F+1,C=D-F+1,M=Math.log(w),R=.5*Math.exp(2*M/3),U=.5*Math.sqrt(M*R*(w-R)/w)*(C-w/2<0?-1:1),O=Math.max(F,Math.floor(D-C*R/w+U)),z=Math.min(S,Math.floor(D+(w-C)*R/w+U));P(I,D,O,z,T)}var k=I[D],Q=F,V=S;for(i(I,F,D),T(I[S],k)>0&&i(I,F,S);Q<V;){for(i(I,Q,V),Q++,V--;T(I[Q],k)<0;)Q++;for(;T(I[V],k)>0;)V--}T(I[F],k)===0?i(I,F,V):i(I,++V,S),V<=D&&(F=V+1),D<=V&&(S=V-1)}})(g,_,x||0,E||g.length-1,B||o)}function i(g,_,x){var E=g[_];g[_]=g[x],g[x]=E}function o(g,_){return g<_?-1:g>_?1:0}var r=function(g){g===void 0&&(g=9),this._maxEntries=Math.max(4,g),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(g,_,x){if(!x)return _.indexOf(g);for(var E=0;E<_.length;E++)if(x(g,_[E]))return E;return-1}function s(g,_){l(g,0,g.children.length,_,g)}function l(g,_,x,E,B){B||(B=v(null)),B.minX=1/0,B.minY=1/0,B.maxX=-1/0,B.maxY=-1/0;for(var P=_;P<x;P++){var I=g.children[P];u(B,g.leaf?E(I):I)}return B}function u(g,_){return g.minX=Math.min(g.minX,_.minX),g.minY=Math.min(g.minY,_.minY),g.maxX=Math.max(g.maxX,_.maxX),g.maxY=Math.max(g.maxY,_.maxY),g}function A(g,_){return g.minX-_.minX}function h(g,_){return g.minY-_.minY}function f(g){return(g.maxX-g.minX)*(g.maxY-g.minY)}function p(g){return g.maxX-g.minX+(g.maxY-g.minY)}function d(g,_){return g.minX<=_.minX&&g.minY<=_.minY&&_.maxX<=g.maxX&&_.maxY<=g.maxY}function m(g,_){return _.minX<=g.maxX&&_.minY<=g.maxY&&_.maxX>=g.minX&&_.maxY>=g.minY}function v(g){return{children:g,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(g,_,x,E,B){for(var P=[_,x];P.length;)if(!((x=P.pop())-(_=P.pop())<=E)){var I=_+Math.ceil((x-_)/E/2)*E;e(g,I,_,x,B),P.push(_,I,I,x)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(g){var _=this.data,x=[];if(!m(g,_))return x;for(var E=this.toBBox,B=[];_;){for(var P=0;P<_.children.length;P++){var I=_.children[P],D=_.leaf?E(I):I;m(g,D)&&(_.leaf?x.push(I):d(g,D)?this._all(I,x):B.push(I))}_=B.pop()}return x},r.prototype.collides=function(g){var _=this.data;if(!m(g,_))return!1;for(var x=[];_;){for(var E=0;E<_.children.length;E++){var B=_.children[E],P=_.leaf?this.toBBox(B):B;if(m(g,P)){if(_.leaf||d(g,P))return!0;x.push(B)}}_=x.pop()}return!1},r.prototype.load=function(g){if(!g||!g.length)return this;if(g.length<this._minEntries){for(var _=0;_<g.length;_++)this.insert(g[_]);return this}var x=this._build(g.slice(),0,g.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var E=this.data;this.data=x,x=E}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},r.prototype.insert=function(g){return g&&this._insert(g,this.data.height-1),this},r.prototype.clear=function(){return this.data=v([]),this},r.prototype.remove=function(g,_){if(!g)return this;for(var x,E,B,P=this.data,I=this.toBBox(g),D=[],F=[];P||D.length;){if(P||(P=D.pop(),E=D[D.length-1],x=F.pop(),B=!0),P.leaf){var S=a(g,P.children,_);if(S!==-1)return P.children.splice(S,1),D.push(P),this._condense(D),this}B||P.leaf||!d(P,I)?E?(x++,P=E.children[x],B=!1):P=null:(D.push(P),F.push(x),x=0,E=P,P=P.children[0])}return this},r.prototype.toBBox=function(g){return g},r.prototype.compareMinX=function(g,_){return g.minX-_.minX},r.prototype.compareMinY=function(g,_){return g.minY-_.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(g){return this.data=g,this},r.prototype._all=function(g,_){for(var x=[];g;)g.leaf?_.push.apply(_,g.children):x.push.apply(x,g.children),g=x.pop();return _},r.prototype._build=function(g,_,x,E){var B,P=x-_+1,I=this._maxEntries;if(P<=I)return s(B=v(g.slice(_,x+1)),this.toBBox),B;E||(E=Math.ceil(Math.log(P)/Math.log(I)),I=Math.ceil(P/Math.pow(I,E-1))),(B=v([])).leaf=!1,B.height=E;var D=Math.ceil(P/I),F=D*Math.ceil(Math.sqrt(I));y(g,_,x,F,this.compareMinX);for(var S=_;S<=x;S+=F){var T=Math.min(S+F-1,x);y(g,S,T,D,this.compareMinY);for(var w=S;w<=T;w+=D){var C=Math.min(w+D-1,T);B.children.push(this._build(g,w,C,E-1))}}return s(B,this.toBBox),B},r.prototype._chooseSubtree=function(g,_,x,E){for(;E.push(_),!_.leaf&&E.length-1!==x;){for(var B=1/0,P=1/0,I=void 0,D=0;D<_.children.length;D++){var F=_.children[D],S=f(F),T=(w=g,C=F,(Math.max(C.maxX,w.maxX)-Math.min(C.minX,w.minX))*(Math.max(C.maxY,w.maxY)-Math.min(C.minY,w.minY))-S);T<P?(P=T,B=S<B?S:B,I=F):T===P&&S<B&&(B=S,I=F)}_=I||_.children[0]}var w,C;return _},r.prototype._insert=function(g,_,x){var E=x?g:this.toBBox(g),B=[],P=this._chooseSubtree(E,this.data,_,B);for(P.children.push(g),u(P,E);_>=0&&B[_].children.length>this._maxEntries;)this._split(B,_),_--;this._adjustParentBBoxes(E,B,_)},r.prototype._split=function(g,_){var x=g[_],E=x.children.length,B=this._minEntries;this._chooseSplitAxis(x,B,E);var P=this._chooseSplitIndex(x,B,E),I=v(x.children.splice(P,x.children.length-P));I.height=x.height,I.leaf=x.leaf,s(x,this.toBBox),s(I,this.toBBox),_?g[_-1].children.push(I):this._splitRoot(x,I)},r.prototype._splitRoot=function(g,_){this.data=v([g,_]),this.data.height=g.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(g,_,x){for(var E,B,P,I,D,F,S,T=1/0,w=1/0,C=_;C<=x-_;C++){var M=l(g,0,C,this.toBBox),R=l(g,C,x,this.toBBox),U=(B=M,P=R,I=void 0,D=void 0,F=void 0,S=void 0,I=Math.max(B.minX,P.minX),D=Math.max(B.minY,P.minY),F=Math.min(B.maxX,P.maxX),S=Math.min(B.maxY,P.maxY),Math.max(0,F-I)*Math.max(0,S-D)),O=f(M)+f(R);U<T?(T=U,E=C,w=O<w?O:w):U===T&&O<w&&(w=O,E=C)}return E||x-_},r.prototype._chooseSplitAxis=function(g,_,x){var E=g.leaf?this.compareMinX:A,B=g.leaf?this.compareMinY:h;this._allDistMargin(g,_,x,E)<this._allDistMargin(g,_,x,B)&&g.children.sort(E)},r.prototype._allDistMargin=function(g,_,x,E){g.children.sort(E);for(var B=this.toBBox,P=l(g,0,_,B),I=l(g,x-_,x,B),D=p(P)+p(I),F=_;F<x-_;F++){var S=g.children[F];u(P,g.leaf?B(S):S),D+=p(P)}for(var T=x-_-1;T>=_;T--){var w=g.children[T];u(I,g.leaf?B(w):w),D+=p(I)}return D},r.prototype._adjustParentBBoxes=function(g,_,x){for(var E=x;E>=0;E--)u(_[E],g)},r.prototype._condense=function(g){for(var _=g.length-1,x=void 0;_>=0;_--)g[_].children.length===0?_>0?(x=g[_-1].children).splice(x.indexOf(g[_]),1):this.clear():s(g[_],this.toBBox)},r})})(B_);var u6=B_.exports;function An(t,n,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!n)throw new Error("polygon is required");var i=Mf(t),o=Fi(n),r=o.type,a=n.bbox,s=o.coordinates;if(a&&c6(i,a)===!1)return!1;r==="Polygon"&&(s=[s]);for(var l=!1,u=0;u<s.length&&!l;u++)if(T_(i,s[u][0],e.ignoreBoundary)){for(var A=!1,h=1;h<s[u].length&&!A;)T_(i,s[u][h],!e.ignoreBoundary)&&(A=!0),h++;A||(l=!0)}return l}function T_(t,n,e){var i=!1;n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&(n=n.slice(0,n.length-1));for(var o=0,r=n.length-1;o<n.length;r=o++){var a=n[o][0],s=n[o][1],l=n[r][0],u=n[r][1],A=t[1]*(a-l)+s*(l-t[0])+u*(t[0]-a)===0&&(a-t[0])*(l-t[0])<=0&&(s-t[1])*(u-t[1])<=0;if(A)return!e;var h=s>t[1]!=u>t[1]&&t[0]<(l-a)*(t[1]-s)/(u-s)+a;h&&(i=!i)}return i}function c6(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function h6(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return I_(t);case"FeatureCollection":return A6(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return by(t);default:throw new Error("unknown GeoJSON type")}}function I_(t){var n={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:n[e]=t[e]}}),n.properties=F_(t.properties),n.geometry=by(t.geometry),n}function F_(t){var n={};return t&&Object.keys(t).forEach(function(e){var i=t[e];typeof i=="object"?i===null?n[e]=null:Array.isArray(i)?n[e]=i.map(function(o){return o}):n[e]=F_(i):n[e]=i}),n}function A6(t){var n={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:n[e]=t[e]}}),n.features=t.features.map(function(e){return I_(e)}),n}function by(t){var n={type:t.type};return t.bbox&&(n.bbox=t.bbox),t.type==="GeometryCollection"?(n.geometries=t.geometries.map(function(e){return by(e)}),n):(n.coordinates=M_(t.coordinates),n)}function M_(t){var n=t;return typeof n[0]!="object"?n.slice():n.map(function(e){return M_(e)})}function D_(t,n){n===void 0&&(n={});var e=typeof n=="object"?n.mutate:n;if(!t)throw new Error("geojson is required");var i=Tz(t),o=[];switch(i){case"LineString":o=xy(t);break;case"MultiLineString":case"Polygon":Ii(t).forEach(function(a){o.push(xy(a))});break;case"MultiPolygon":Ii(t).forEach(function(a){var s=[];a.forEach(function(l){s.push(xy(l))}),o.push(s)});break;case"Point":return t;case"MultiPoint":var r={};Ii(t).forEach(function(a){var s=a.join("-");Object.prototype.hasOwnProperty.call(r,s)||(o.push(a),r[s]=!0)});break;default:throw new Error(i+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:i,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):zn({type:i,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function xy(t){var n=Ii(t);if(n.length===2&&!R_(n[0],n[1]))return n;var e=[],i=n.length-1,o=e.length;e.push(n[0]);for(var r=1;r<i;r++){var a=e[e.length-1];n[r][0]===a[0]&&n[r][1]===a[1]||(e.push(n[r]),o=e.length,o>2&&U_(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(n[n.length-1]),o=e.length,R_(n[0],n[n.length-1])&&o<4)throw new Error("invalid polygon");return U_(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function R_(t,n){return t[0]===n[0]&&t[1]===n[1]}function U_(t,n,e){var i=e[0],o=e[1],r=t[0],a=t[1],s=n[0],l=n[1],u=i-r,A=o-a,h=s-r,f=l-a,p=u*f-A*h;return p!==0?!1:Math.abs(h)>=Math.abs(f)?h>0?r<=i&&i<=s:s<=i&&i<=r:f>0?a<=o&&o<=l:l<=o&&o<=a}function f6(t,n){n===void 0&&(n={});var e=0,i=0,o=0;return Jo(t,function(r){e+=r[0],i+=r[1],o++},!0),Xt([e/o,i/o],n.properties)}function O_(t){if(!t)throw new Error("geojson is required");var n=[];return rr(t,function(e){d6(e,n)}),Pn(n)}function d6(t,n){var e=[],i=t.geometry;if(i!==null){switch(i.type){case"Polygon":e=Ii(i);break;case"LineString":e=[Ii(i)]}e.forEach(function(o){var r=p6(o,t.properties);r.forEach(function(a){a.id=n.length,n.push(a)})})}}function p6(t,n){var e=[];return t.reduce(function(i,o){var r=Yn([i,o],n);return r.bbox=m6(i,o),e.push(r),o}),e}function m6(t,n){var e=t[0],i=t[1],o=n[0],r=n[1],a=e<o?e:o,s=i<r?i:r,l=e>o?e:o,u=i>r?i:r;return[a,s,l,u]}var _y={exports:{}},L_={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=63710088e-1,t.factors={centimeters:t.earthRadius*100,centimetres:t.earthRadius*100,degrees:t.earthRadius/111325,feet:t.earthRadius*3.28084,inches:t.earthRadius*39.37,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:t.earthRadius*1e3,millimetres:t.earthRadius*1e3,nauticalmiles:t.earthRadius/1852,radians:1,yards:t.earthRadius*1.0936},t.unitsFactors={centimeters:100,centimetres:100,degrees:8982708286548395e-21,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:.0006213711922373339,millimeters:1e3,millimetres:1e3,nauticalmiles:.0005399568034557236,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function n(S,T,w){w===void 0&&(w={});var C={type:"Feature"};return(w.id===0||w.id)&&(C.id=w.id),w.bbox&&(C.bbox=w.bbox),C.properties=T||{},C.geometry=S,C}t.feature=n;function e(S,T,w){switch(S){case"Point":return i(T).geometry;case"LineString":return s(T).geometry;case"Polygon":return r(T).geometry;case"MultiPoint":return h(T).geometry;case"MultiLineString":return A(T).geometry;case"MultiPolygon":return f(T).geometry;default:throw new Error(S+" is invalid")}}t.geometry=e;function i(S,T,w){if(w===void 0&&(w={}),!S)throw new Error("coordinates is required");if(!Array.isArray(S))throw new Error("coordinates must be an Array");if(S.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!P(S[0])||!P(S[1]))throw new Error("coordinates must contain numbers");var C={type:"Point",coordinates:S};return n(C,T,w)}t.point=i;function o(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return i(C,T)}),w)}t.points=o;function r(S,T,w){w===void 0&&(w={});for(var C=0,M=S;C<M.length;C++){var R=M[C];if(R.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var U=0;U<R[R.length-1].length;U++)if(R[R.length-1][U]!==R[0][U])throw new Error("First and last Position are not equivalent.")}var O={type:"Polygon",coordinates:S};return n(O,T,w)}t.polygon=r;function a(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return r(C,T)}),w)}t.polygons=a;function s(S,T,w){if(w===void 0&&(w={}),S.length<2)throw new Error("coordinates must be an array of two or more positions");var C={type:"LineString",coordinates:S};return n(C,T,w)}t.lineString=s;function l(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return s(C,T)}),w)}t.lineStrings=l;function u(S,T){T===void 0&&(T={});var w={type:"FeatureCollection"};return T.id&&(w.id=T.id),T.bbox&&(w.bbox=T.bbox),w.features=S,w}t.featureCollection=u;function A(S,T,w){w===void 0&&(w={});var C={type:"MultiLineString",coordinates:S};return n(C,T,w)}t.multiLineString=A;function h(S,T,w){w===void 0&&(w={});var C={type:"MultiPoint",coordinates:S};return n(C,T,w)}t.multiPoint=h;function f(S,T,w){w===void 0&&(w={});var C={type:"MultiPolygon",coordinates:S};return n(C,T,w)}t.multiPolygon=f;function p(S,T,w){w===void 0&&(w={});var C={type:"GeometryCollection",geometries:S};return n(C,T,w)}t.geometryCollection=p;function d(S,T){if(T===void 0&&(T=0),T&&!(T>=0))throw new Error("precision must be a positive number");var w=Math.pow(10,T||0);return Math.round(S*w)/w}t.round=d;function m(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S*w}t.radiansToLength=m;function v(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S/w}t.lengthToRadians=v;function y(S,T){return _(v(S,T))}t.lengthToDegrees=y;function g(S){var T=S%360;return T<0&&(T+=360),T}t.bearingToAzimuth=g;function _(S){var T=S%(2*Math.PI);return T*180/Math.PI}t.radiansToDegrees=_;function x(S){var T=S%360;return T*Math.PI/180}t.degreesToRadians=x;function E(S,T,w){if(T===void 0&&(T="kilometers"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("length must be a positive number");return m(v(S,T),w)}t.convertLength=E;function B(S,T,w){if(T===void 0&&(T="meters"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("area must be a positive number");var C=t.areaFactors[T];if(!C)throw new Error("invalid original units");var M=t.areaFactors[w];if(!M)throw new Error("invalid final units");return S/C*M}t.convertArea=B;function P(S){return!isNaN(S)&&S!==null&&!Array.isArray(S)}t.isNumber=P;function I(S){return!!S&&S.constructor===Object}t.isObject=I;function D(S){if(!S)throw new Error("bbox is required");if(!Array.isArray(S))throw new Error("bbox must be an Array");if(S.length!==4&&S.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");S.forEach(function(T){if(!P(T))throw new Error("bbox must only contain numbers")})}t.validateBBox=D;function F(S){if(!S)throw new Error("id is required");if(["string","number"].indexOf(typeof S)===-1)throw new Error("id must be a number or a string")}t.validateId=F})(L_);var Ut={};const g6=eb(Pz);Object.defineProperty(Ut,"__esModule",{value:!0});var ln=g6;function lu(t,n,e){if(t!==null)for(var i,o,r,a,s,l,u,A=0,h=0,f,p=t.type,d=p==="FeatureCollection",m=p==="Feature",v=d?t.features.length:1,y=0;y<v;y++){u=d?t.features[y].geometry:m?t.geometry:t,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var g=0;g<s;g++){var _=0,x=0;if(a=f?u.geometries[g]:u,a!==null){l=a.coordinates;var E=a.type;switch(A=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(n(l,h,y,_,x)===!1)return!1;h++,_++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(n(l[i],h,y,_,x)===!1)return!1;h++,E==="MultiPoint"&&_++}E==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-A;o++){if(n(l[i][o],h,y,_,x)===!1)return!1;h++}E==="MultiLineString"&&_++,E==="Polygon"&&x++}E==="Polygon"&&_++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(x=0,o=0;o<l[i].length;o++){for(r=0;r<l[i][o].length-A;r++){if(n(l[i][o][r],h,y,_,x)===!1)return!1;h++}x++}_++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(lu(a.geometries[i],n,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function y6(t,n,e,i){var o=e;return lu(t,function(r,a,s,l,u){a===0&&e===void 0?o=r:o=n(o,r,a,s,l,u)},i),o}function z_(t,n){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&n(t.features[e].properties,e)!==!1;e++);break;case"Feature":n(t.properties,0);break}}function v6(t,n,e){var i=e;return z_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function k_(t,n){if(t.type==="Feature")n(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&n(t.features[e],e)!==!1;e++);}function w6(t,n,e){var i=e;return k_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function b6(t){var n=[];return lu(t,function(e){n.push(e)}),n}function Cy(t,n){var e,i,o,r,a,s,l,u,A,h,f=0,p=t.type==="FeatureCollection",d=t.type==="Feature",m=p?t.features.length:1;for(e=0;e<m;e++){for(s=p?t.features[e].geometry:d?t.geometry:t,u=p?t.features[e].properties:d?t.properties:{},A=p?t.features[e].bbox:d?t.bbox:void 0,h=p?t.features[e].id:d?t.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,o=0;o<a;o++){if(r=l?s.geometries[o]:s,r===null){if(n(null,f,u,A,h)===!1)return!1;continue}switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(r,f,u,A,h)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<r.geometries.length;i++)if(n(r.geometries[i],f,u,A,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function x6(t,n,e){var i=e;return Cy(t,function(o,r,a,s,l){r===0&&e===void 0?i=o:i=n(i,o,r,a,s,l)}),i}function Rf(t,n){Cy(t,function(e,i,o,r,a){var s=e===null?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return n(ln.feature(e,o,{bbox:r,id:a}),i,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var A=e.coordinates[u],h={type:l,coordinates:A};if(n(ln.feature(h,o),i,u)===!1)return!1}})}function _6(t,n,e){var i=e;return Rf(t,function(o,r,a){r===0&&a===0&&e===void 0?i=o:i=n(i,o,r,a)}),i}function Q_(t,n){Rf(t,function(e,i,o){var r=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var s,l=0,u=0,A=0;if(lu(e,function(h,f,p,d,m){if(s===void 0||i>l||d>u||m>A){s=h,l=i,u=d,A=m,r=0;return}var v=ln.lineString([s,h],e.properties);if(n(v,i,o,m,r)===!1)return!1;r++,s=h})===!1)return!1}}})}function C6(t,n,e){var i=e,o=!1;return Q_(t,function(r,a,s,l,u){o===!1&&e===void 0?i=r:i=n(i,r,a,s,l,u),o=!0}),i}function V_(t,n){if(!t)throw new Error("geojson is required");Rf(t,function(e,i,o){if(e.geometry!==null){var r=e.geometry.type,a=e.geometry.coordinates;switch(r){case"LineString":if(n(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(n(ln.lineString(a[s],e.properties),i,o,s)===!1)return!1;break}}})}function S6(t,n,e){var i=e;return V_(t,function(o,r,a,s){r===0&&e===void 0?i=o:i=n(i,o,r,a,s)}),i}function E6(t,n){if(n=n||{},!ln.isObject(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.segmentIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":case"MultiPoint":return null;case"LineString":return r<0&&(r=l.length+r-1),ln.lineString([l[r],l[r+1]],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r-1),ln.lineString([l[o][r],l[o][r+1]],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r-1),ln.lineString([l[i][r],l[i][r+1]],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r-1),ln.lineString([l[i][o][r],l[i][o][r+1]],a,n)}throw new Error("geojson is invalid")}function P6(t,n){if(n=n||{},!ln.isObject(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.coordIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":return ln.point(l,a,n);case"MultiPoint":return i<0&&(i=l.length+i),ln.point(l[i],a,n);case"LineString":return r<0&&(r=l.length+r),ln.point(l[r],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r),ln.point(l[o][r],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r),ln.point(l[i][r],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r),ln.point(l[i][o][r],a,n)}throw new Error("geojson is invalid")}Ut.coordAll=b6,Ut.coordEach=lu,Ut.coordReduce=y6,Ut.featureEach=k_,Ut.featureReduce=w6,Ut.findPoint=P6,Ut.findSegment=E6,Ut.flattenEach=Rf,Ut.flattenReduce=_6,Ut.geomEach=Cy,Ut.geomReduce=x6,Ut.lineEach=V_,Ut.lineReduce=S6,Ut.propEach=z_,Ut.propReduce=v6,Ut.segmentEach=Q_,Ut.segmentReduce=C6;var Sy={};const B6=eb(kz);Object.defineProperty(Sy,"__esModule",{value:!0});var T6=B6;function Ey(t){var n=[1/0,1/0,-1/0,-1/0];return T6.coordEach(t,function(e){n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}Ey.default=Ey,Sy.default=Ey;var Ui=u6,N_=L_,H_=Ut,Sa=Sy.default,I6=H_.featureEach;H_.coordEach,N_.polygon;var G_=N_.featureCollection;function W_(t){var n=new Ui(t);return n.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Sa(e),Ui.prototype.insert.call(this,e)},n.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Sa(o),i.push(o)}):I6(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Sa(o),i.push(o)}),Ui.prototype.load.call(this,i)},n.remove=function(e,i){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Sa(e),Ui.prototype.remove.call(this,e,i)},n.clear=function(){return Ui.prototype.clear.call(this)},n.search=function(e){var i=Ui.prototype.search.call(this,this.toBBox(e));return G_(i)},n.collides=function(e){return Ui.prototype.collides.call(this,this.toBBox(e))},n.all=function(){var e=Ui.prototype.all.call(this);return G_(e)},n.toJSON=function(){return Ui.prototype.toJSON.call(this)},n.fromJSON=function(e){return Ui.prototype.fromJSON.call(this,e)},n.toBBox=function(e){var i;if(e.bbox)i=e.bbox;else if(Array.isArray(e)&&e.length===4)i=e;else if(Array.isArray(e)&&e.length===6)i=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")i=Sa(e);else if(e.type==="FeatureCollection")i=Sa(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},n}_y.exports=W_,_y.exports.default=W_;var F6=_y.exports;const M6=Ml(F6);function Py(t,n){var e={},i=[];if(t.type==="LineString"&&(t=zn(t)),n.type==="LineString"&&(n=zn(n)),t.type==="Feature"&&n.type==="Feature"&&t.geometry!==null&&n.geometry!==null&&t.geometry.type==="LineString"&&n.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&n.geometry.coordinates.length===2){var o=j_(t,n);return o&&i.push(o),Pn(i)}var r=M6();return r.load(O_(n)),wa(O_(t),function(a){wa(r.search(a),function(s){var l=j_(a,s);if(l){var u=Ii(l).join(",");e[u]||(e[u]=!0,i.push(l))}})}),Pn(i)}function j_(t,n){var e=Ii(t),i=Ii(n);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],r=e[0][1],a=e[1][0],s=e[1][1],l=i[0][0],u=i[0][1],A=i[1][0],h=i[1][1],f=(h-u)*(a-o)-(A-l)*(s-r),p=(A-l)*(r-u)-(h-u)*(o-l),d=(a-o)*(r-u)-(s-r)*(o-l);if(f===0)return null;var m=p/f,v=d/f;if(m>=0&&m<=1&&v>=0&&v<=1){var y=o+m*(a-o),g=r+m*(s-r);return Xt([y,g])}return null}function Uf(t,n,e){e===void 0&&(e={});for(var i=Mf(t),o=Ii(n),r=0;r<o.length-1;r++){var a=!1;if(e.ignoreEndVertices&&(r===0&&(a="start"),r===o.length-2&&(a="end"),r===0&&r+1===o.length-1&&(a="both")),D6(o[r],o[r+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function D6(t,n,e,i,o){var r=e[0],a=e[1],s=t[0],l=t[1],u=n[0],A=n[1],h=e[0]-s,f=e[1]-l,p=u-s,d=A-l,m=h*d-f*p;if(o!==null){if(Math.abs(m)>o)return!1}else if(m!==0)return!1;if(i){if(i==="start")return Math.abs(p)>=Math.abs(d)?p>0?s<r&&r<=u:u<=r&&r<s:d>0?l<a&&a<=A:A<=a&&a<l;if(i==="end")return Math.abs(p)>=Math.abs(d)?p>0?s<=r&&r<u:u<r&&r<=s:d>0?l<=a&&a<A:A<a&&a<=l;if(i==="both")return Math.abs(p)>=Math.abs(d)?p>0?s<r&&r<u:u<r&&r<s:d>0?l<a&&a<A:A<a&&a<l}else return Math.abs(p)>=Math.abs(d)?p>0?s<=r&&r<=u:u<=r&&r<=s:d>0?l<=a&&a<=A:A<=a&&a<=l;return!1}function R6(t,n){var e=Fi(t),i=Fi(n),o=e.type,r=i.type;switch(o){case"Point":switch(r){case"MultiPoint":return U6(e,i);case"LineString":return Uf(e,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return An(e,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return O6(e,i);case"LineString":return L6(e,i);case"Polygon":case"MultiPolygon":return z6(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return k6(e,i);case"Polygon":case"MultiPolygon":return Q6(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Polygon":case"MultiPolygon":return V6(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function U6(t,n){var e,i=!1;for(e=0;e<n.coordinates.length;e++)if(K_(n.coordinates[e],t.coordinates)){i=!0;break}return i}function O6(t,n){for(var e=0;e<t.coordinates.length;e++){for(var i=!1,o=0;o<n.coordinates.length;o++)K_(t.coordinates[e],n.coordinates[o])&&(i=!0);if(!i)return!1}return!0}function L6(t,n){for(var e=!1,i=0;i<t.coordinates.length;i++){if(!Uf(t.coordinates[i],n))return!1;e||(e=Uf(t.coordinates[i],n,{ignoreEndVertices:!0}))}return e}function z6(t,n){for(var e=!0,i=!1,o=0;o<t.coordinates.length;o++){if(i=An(t.coordinates[1],n),!i){e=!1;break}i=An(t.coordinates[1],n,{ignoreBoundary:!0})}return e&&i}function k6(t,n){for(var e=0;e<t.coordinates.length;e++)if(!Uf(t.coordinates[e],n))return!1;return!0}function Q6(t,n){var e=ts(n),i=ts(t);if(!q_(e,i))return!1;for(var o=!1,r=0;r<t.coordinates.length-1;r++){if(!An(t.coordinates[r],n))return!1;if(o||(o=An(t.coordinates[r],n,{ignoreBoundary:!0})),!o){var a=N6(t.coordinates[r],t.coordinates[r+1]);o=An(a,n,{ignoreBoundary:!0})}}return o}function V6(t,n){var e=ts(t),i=ts(n);if(!q_(i,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!An(t.coordinates[0][o],n))return!1;return!0}function q_(t,n){return!(t[0]>n[0]||t[2]<n[2]||t[1]>n[1]||t[3]<n[3])}function K_(t,n){return t[0]===n[0]&&t[1]===n[1]}function N6(t,n){return[(t[0]+n[0])/2,(t[1]+n[1])/2]}function Z_(t,n,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var i=[],o=t[0],r=t[1],a=t[2],s=t[3],l=n/Mi([o,r],[a,r],e),u=l*(a-o),A=n/Mi([o,r],[o,s],e),h=A*(s-r),f=a-o,p=s-r,d=Math.floor(f/u),m=Math.floor(p/h),v=(f-d*u)/2,y=(p-m*h)/2,g=o+v;g<=a;){for(var _=r+y;_<=s;){var x=Xt([g,_],e.properties);e.mask?R6(x,e.mask)&&i.push(x):i.push(x),_+=h}g+=u}return Pn(i)}function By(t,n){n===void 0&&(n={});var e=Fi(t);switch(!n.properties&&t.type==="Feature"&&(n.properties=t.properties),e.type){case"Polygon":return H6(e,n);case"MultiPolygon":return G6(e,n);default:throw new Error("invalid poly")}}function H6(t,n){n===void 0&&(n={});var e=Fi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{};return $_(i,o)}function G6(t,n){n===void 0&&(n={});var e=Fi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{},r=[];return i.forEach(function(a){r.push($_(a,o))}),Pn(r)}function $_(t,n){return t.length>1?fy(t,n):Yn(t[0],n)}var X_=Object.prototype.toString,Y_=function(n){var e=X_.call(n),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&X_.call(n.callee)==="[object Function]"),i},Ty,J_;function W6(){if(J_)return Ty;J_=1;var t;if(!Object.keys){var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=Y_,o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),a=o.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var p=f.constructor;return p&&p.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},A=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&n.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1}(),h=function(f){if(typeof window>"u"||!A)return l(f);try{return l(f)}catch{return!1}};t=function(p){var d=p!==null&&typeof p=="object",m=e.call(p)==="[object Function]",v=i(p),y=d&&e.call(p)==="[object String]",g=[];if(!d&&!m&&!v)throw new TypeError("Object.keys called on a non-object");var _=a&&m;if(y&&p.length>0&&!n.call(p,0))for(var x=0;x<p.length;++x)g.push(String(x));if(v&&p.length>0)for(var E=0;E<p.length;++E)g.push(String(E));else for(var B in p)!(_&&B==="prototype")&&n.call(p,B)&&g.push(String(B));if(r)for(var P=h(p),I=0;I<s.length;++I)!(P&&s[I]==="constructor")&&n.call(p,s[I])&&g.push(s[I]);return g}}return Ty=t,Ty}var j6=Array.prototype.slice,q6=Y_,eC=Object.keys,Of=eC?function(n){return eC(n)}:W6(),tC=Object.keys;Of.shim=function(){if(Object.keys){var n=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);n||(Object.keys=function(i){return q6(i)?tC(j6.call(i)):tC(i)})}else Object.keys=Of;return Object.keys||Of};var nC=Of,iC=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var o=42;n[e]=o;for(var r in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var a=Object.getOwnPropertySymbols(n);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(n,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(n,e);if(s.value!==o||s.enumerable!==!0)return!1}return!0},K6=iC,Iy=function(){return K6()&&!!Symbol.toStringTag},rC=Object,oC=Error,Z6=EvalError,$6=RangeError,X6=ReferenceError,sC=SyntaxError,Ea=TypeError,Y6=URIError,J6=Math.abs,ek=Math.floor,tk=Math.max,nk=Math.min,ik=Math.pow,rk=Math.round,ok=Number.isNaN||function(n){return n!==n},sk=ok,ak=function(n){return sk(n)||n===0?n:n<0?-1:1},lk=Object.getOwnPropertyDescriptor,Lf=lk;if(Lf)try{Lf([],"length")}catch{Lf=null}var Pa=Lf,zf=Object.defineProperty||!1;if(zf)try{zf({},"a",{value:1})}catch{zf=!1}var kf=zf,Fy,aC;function uk(){if(aC)return Fy;aC=1;var t=typeof Symbol<"u"&&Symbol,n=iC;return Fy=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()},Fy}var lC=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,ck=rC,uC=ck.getPrototypeOf||null,hk="Function.prototype.bind called on incompatible ",Ak=Object.prototype.toString,fk=Math.max,dk="[object Function]",cC=function(n,e){for(var i=[],o=0;o<n.length;o+=1)i[o]=n[o];for(var r=0;r<e.length;r+=1)i[r+n.length]=e[r];return i},pk=function(n,e){for(var i=[],o=e,r=0;o<n.length;o+=1,r+=1)i[r]=n[o];return i},mk=function(t,n){for(var e="",i=0;i<t.length;i+=1)e+=t[i],i+1<t.length&&(e+=n);return e},gk=function(n){var e=this;if(typeof e!="function"||Ak.apply(e)!==dk)throw new TypeError(hk+e);for(var i=pk(arguments,1),o,r=function(){if(this instanceof o){var A=e.apply(this,cC(i,arguments));return Object(A)===A?A:this}return e.apply(n,cC(i,arguments))},a=fk(0,e.length-i.length),s=[],l=0;l<a;l++)s[l]="$"+l;if(o=Function("binder","return function ("+mk(s,",")+"){ return binder.apply(this,arguments); }")(r),e.prototype){var u=function(){};u.prototype=e.prototype,o.prototype=new u,u.prototype=null}return o},yk=gk,uu=Function.prototype.bind||yk,My=Function.prototype.call,Dy=Function.prototype.apply,vk=typeof Reflect<"u"&&Reflect&&Reflect.apply,wk=uu,bk=Dy,xk=My,_k=vk,hC=_k||wk.call(xk,bk),Ck=uu,Sk=Ea,Ek=My,Pk=hC,Ry=function(n){if(n.length<1||typeof n[0]!="function")throw new Sk("a function is required");return Pk(Ck,Ek,n)},Bk=Ry,AC=Pa,fC;try{fC=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Uy=!!fC&&AC&&AC(Object.prototype,"__proto__"),dC=Object,pC=dC.getPrototypeOf,Tk=Uy&&typeof Uy.get=="function"?Bk([Uy.get]):typeof pC=="function"?function(n){return pC(n==null?n:dC(n))}:!1,mC=lC,gC=uC,yC=Tk,vC=mC?function(n){return mC(n)}:gC?function(n){if(!n||typeof n!="object"&&typeof n!="function")throw new TypeError("getProto: not an object");return gC(n)}:yC?function(n){return yC(n)}:null,Ik=Function.prototype.call,Fk=Object.prototype.hasOwnProperty,Mk=uu,wC=Mk.call(Ik,Fk),We,Dk=rC,Rk=oC,Uk=Z6,Ok=$6,Lk=X6,Ba=sC,Ta=Ea,zk=Y6,kk=J6,Qk=ek,Vk=tk,Nk=nk,Hk=ik,Gk=rk,Wk=ak,bC=Function,Oy=function(t){try{return bC('"use strict"; return ('+t+").constructor;")()}catch{}},cu=Pa,jk=kf,Ly=function(){throw new Ta},qk=cu?function(){try{return arguments.callee,Ly}catch{try{return cu(arguments,"callee").get}catch{return Ly}}}():Ly,Ia=uk()(),Nt=vC,Kk=uC,Zk=lC,xC=Dy,hu=My,Fa={},$k=typeof Uint8Array>"u"||!Nt?We:Nt(Uint8Array),ns={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?We:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?We:ArrayBuffer,"%ArrayIteratorPrototype%":Ia&&Nt?Nt([][Symbol.iterator]()):We,"%AsyncFromSyncIteratorPrototype%":We,"%AsyncFunction%":Fa,"%AsyncGenerator%":Fa,"%AsyncGeneratorFunction%":Fa,"%AsyncIteratorPrototype%":Fa,"%Atomics%":typeof Atomics>"u"?We:Atomics,"%BigInt%":typeof BigInt>"u"?We:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?We:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?We:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?We:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Rk,"%eval%":eval,"%EvalError%":Uk,"%Float16Array%":typeof Float16Array>"u"?We:Float16Array,"%Float32Array%":typeof Float32Array>"u"?We:Float32Array,"%Float64Array%":typeof Float64Array>"u"?We:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?We:FinalizationRegistry,"%Function%":bC,"%GeneratorFunction%":Fa,"%Int8Array%":typeof Int8Array>"u"?We:Int8Array,"%Int16Array%":typeof Int16Array>"u"?We:Int16Array,"%Int32Array%":typeof Int32Array>"u"?We:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ia&&Nt?Nt(Nt([][Symbol.iterator]())):We,"%JSON%":typeof JSON=="object"?JSON:We,"%Map%":typeof Map>"u"?We:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ia||!Nt?We:Nt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Dk,"%Object.getOwnPropertyDescriptor%":cu,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?We:Promise,"%Proxy%":typeof Proxy>"u"?We:Proxy,"%RangeError%":Ok,"%ReferenceError%":Lk,"%Reflect%":typeof Reflect>"u"?We:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?We:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ia||!Nt?We:Nt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?We:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ia&&Nt?Nt(""[Symbol.iterator]()):We,"%Symbol%":Ia?Symbol:We,"%SyntaxError%":Ba,"%ThrowTypeError%":qk,"%TypedArray%":$k,"%TypeError%":Ta,"%Uint8Array%":typeof Uint8Array>"u"?We:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?We:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?We:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?We:Uint32Array,"%URIError%":zk,"%WeakMap%":typeof WeakMap>"u"?We:WeakMap,"%WeakRef%":typeof WeakRef>"u"?We:WeakRef,"%WeakSet%":typeof WeakSet>"u"?We:WeakSet,"%Function.prototype.call%":hu,"%Function.prototype.apply%":xC,"%Object.defineProperty%":jk,"%Object.getPrototypeOf%":Kk,"%Math.abs%":kk,"%Math.floor%":Qk,"%Math.max%":Vk,"%Math.min%":Nk,"%Math.pow%":Hk,"%Math.round%":Gk,"%Math.sign%":Wk,"%Reflect.getPrototypeOf%":Zk};if(Nt)try{null.error}catch(t){var Xk=Nt(Nt(t));ns["%Error.prototype%"]=Xk}var Yk=function t(n){var e;if(n==="%AsyncFunction%")e=Oy("async function () {}");else if(n==="%GeneratorFunction%")e=Oy("function* () {}");else if(n==="%AsyncGeneratorFunction%")e=Oy("async function* () {}");else if(n==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(n==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&Nt&&(e=Nt(o.prototype))}return ns[n]=e,e},_C={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Au=uu,Qf=wC,Jk=Au.call(hu,Array.prototype.concat),eQ=Au.call(xC,Array.prototype.splice),CC=Au.call(hu,String.prototype.replace),Vf=Au.call(hu,String.prototype.slice),tQ=Au.call(hu,RegExp.prototype.exec),nQ=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,iQ=/\\(\\)?/g,rQ=function(n){var e=Vf(n,0,1),i=Vf(n,-1);if(e==="%"&&i!=="%")throw new Ba("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new Ba("invalid intrinsic syntax, expected opening `%`");var o=[];return CC(n,nQ,function(r,a,s,l){o[o.length]=s?CC(l,iQ,"$1"):a||r}),o},oQ=function(n,e){var i=n,o;if(Qf(_C,i)&&(o=_C[i],i="%"+o[0]+"%"),Qf(ns,i)){var r=ns[i];if(r===Fa&&(r=Yk(i)),typeof r>"u"&&!e)throw new Ta("intrinsic "+n+" exists, but is not available. Please file an issue!");return{alias:o,name:i,value:r}}throw new Ba("intrinsic "+n+" does not exist!")},SC=function(n,e){if(typeof n!="string"||n.length===0)throw new Ta("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Ta('"allowMissing" argument must be a boolean');if(tQ(/^%?[^%]*%?$/,n)===null)throw new Ba("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=rQ(n),o=i.length>0?i[0]:"",r=oQ("%"+o+"%",e),a=r.name,s=r.value,l=!1,u=r.alias;u&&(o=u[0],eQ(i,Jk([0,1],u)));for(var A=1,h=!0;A<i.length;A+=1){var f=i[A],p=Vf(f,0,1),d=Vf(f,-1);if((p==='"'||p==="'"||p==="`"||d==='"'||d==="'"||d==="`")&&p!==d)throw new Ba("property names with quotes must have matching quotes");if((f==="constructor"||!h)&&(l=!0),o+="."+f,a="%"+o+"%",Qf(ns,a))s=ns[a];else if(s!=null){if(!(f in s)){if(!e)throw new Ta("base intrinsic for "+n+" exists, but the property is not available.");return}if(cu&&A+1>=i.length){var m=cu(s,f);h=!!m,h&&"get"in m&&!("originalValue"in m.get)?s=m.get:s=s[f]}else h=Qf(s,f),s=s[f];h&&!l&&(ns[a]=s)}}return s},EC=SC,PC=Ry,sQ=PC([EC("%String.prototype.indexOf%")]),zy=function(n,e){var i=EC(n,!!e);return typeof i=="function"&&sQ(n,".prototype.")>-1?PC([i]):i},aQ=Iy(),lQ=zy,ky=lQ("Object.prototype.toString"),Nf=function(n){return aQ&&n&&typeof n=="object"&&Symbol.toStringTag in n?!1:ky(n)==="[object Arguments]"},BC=function(n){return Nf(n)?!0:n!==null&&typeof n=="object"&&"length"in n&&typeof n.length=="number"&&n.length>=0&&ky(n)!=="[object Array]"&&"callee"in n&&ky(n.callee)==="[object Function]"},uQ=function(){return Nf(arguments)}();Nf.isLegacyArguments=BC;var cQ=uQ?Nf:BC,TC=kf,hQ=sC,Ma=Ea,IC=Pa,Qy=function(n,e,i){if(!n||typeof n!="object"&&typeof n!="function")throw new Ma("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Ma("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ma("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ma("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ma("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ma("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,r=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,l=!!IC&&IC(n,e);if(TC)TC(n,e,{configurable:a===null&&l?l.configurable:!a,enumerable:o===null&&l?l.enumerable:!o,value:i,writable:r===null&&l?l.writable:!r});else if(s||!o&&!r&&!a)n[e]=i;else throw new hQ("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Vy=kf,FC=function(){return!!Vy};FC.hasArrayLengthDefineBug=function(){if(!Vy)return null;try{return Vy([],"length",{value:1}).length!==1}catch{return!0}};var Ny=FC,AQ=nC,fQ=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",dQ=Object.prototype.toString,pQ=Array.prototype.concat,MC=Qy,mQ=function(t){return typeof t=="function"&&dQ.call(t)==="[object Function]"},DC=Ny(),gQ=function(t,n,e,i){if(n in t){if(i===!0){if(t[n]===e)return}else if(!mQ(i)||!i())return}DC?MC(t,n,e,!0):MC(t,n,e)},RC=function(t,n){var e=arguments.length>2?arguments[2]:{},i=AQ(n);fQ&&(i=pQ.call(i,Object.getOwnPropertySymbols(n)));for(var o=0;o<i.length;o+=1)gQ(t,i[o],n[i[o]],e[i[o]])};RC.supportsDescriptors=!!DC;var fu=RC,UC={exports:{}},yQ=SC,OC=Qy,vQ=Ny(),LC=Pa,zC=Ea,wQ=yQ("%Math.floor%"),bQ=function(n,e){if(typeof n!="function")throw new zC("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||wQ(e)!==e)throw new zC("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],o=!0,r=!0;if("length"in n&&LC){var a=LC(n,"length");a&&!a.configurable&&(o=!1),a&&!a.writable&&(r=!1)}return(o||r||!i)&&(vQ?OC(n,"length",e,!0,!0):OC(n,"length",e)),n},xQ=uu,_Q=Dy,CQ=hC,SQ=function(){return CQ(xQ,_Q,arguments)};(function(t){var n=bQ,e=kf,i=Ry,o=SQ;t.exports=function(a){var s=i(arguments),l=a.length-(arguments.length-1);return n(s,1+(l>0?l:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(UC);var kC=UC.exports,QC=function(t){return t!==t},VC=function(n,e){return n===0&&e===0?1/n===1/e:!!(n===e||QC(n)&&QC(e))},EQ=VC,NC=function(){return typeof Object.is=="function"?Object.is:EQ},PQ=NC,BQ=fu,TQ=function(){var n=PQ();return BQ(Object,{is:n},{is:function(){return Object.is!==n}}),n},IQ=fu,FQ=kC,MQ=VC,HC=NC,DQ=TQ,GC=FQ(HC(),Object);IQ(GC,{getPolyfill:HC,implementation:MQ,shim:DQ});var RQ=GC,WC=zy,UQ=Iy(),OQ=wC,LQ=Pa,Hy;if(UQ){var zQ=WC("RegExp.prototype.exec"),jC={},Gy=function(){throw jC},qC={toString:Gy,valueOf:Gy};typeof Symbol.toPrimitive=="symbol"&&(qC[Symbol.toPrimitive]=Gy),Hy=function(n){if(!n||typeof n!="object")return!1;var e=LQ(n,"lastIndex"),i=e&&OQ(e,"value");if(!i)return!1;try{zQ(n,qC)}catch(o){return o===jC}}}else{var kQ=WC("Object.prototype.toString"),QQ="[object RegExp]";Hy=function(n){return!n||typeof n!="object"&&typeof n!="function"?!1:kQ(n)===QQ}}var VQ=Hy,du=function(){return typeof(function(){}).name=="string"},pu=Object.getOwnPropertyDescriptor;if(pu)try{pu([],"length")}catch{pu=null}du.functionsHaveConfigurableNames=function(){if(!du()||!pu)return!1;var n=pu(function(){},"name");return!!n&&!!n.configurable};var NQ=Function.prototype.bind;du.boundFunctionsHaveNames=function(){return du()&&typeof NQ=="function"&&(function(){}).bind().name!==""};var HQ=du,KC=Qy,GQ=Ny(),WQ=HQ.functionsHaveConfigurableNames(),jQ=Ea,qQ=function(n,e){if(typeof n!="function")throw new jQ("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||WQ)&&(GQ?KC(n,"name",e,!0,!0):KC(n,"name",e)),n},KQ=qQ,ZQ=Ea,$Q=Object,ZC=KQ(function(){if(this==null||this!==$Q(this))throw new ZQ("RegExp.prototype.flags getter called on non-object");var n="";return this.hasIndices&&(n+="d"),this.global&&(n+="g"),this.ignoreCase&&(n+="i"),this.multiline&&(n+="m"),this.dotAll&&(n+="s"),this.unicode&&(n+="u"),this.unicodeSets&&(n+="v"),this.sticky&&(n+="y"),n},"get flags",!0),XQ=ZC,YQ=fu.supportsDescriptors,JQ=Object.getOwnPropertyDescriptor,$C=function(){if(YQ&&/a/mig.flags==="gim"){var n=JQ(RegExp.prototype,"flags");if(n&&typeof n.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),n.get.call(i),e==="dy")return n.get}}return XQ},e8=fu.supportsDescriptors,t8=$C,n8=Pa,i8=Object.defineProperty,r8=oC,XC=vC,o8=/a/,s8=function(){if(!e8||!XC)throw new r8("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var n=t8(),e=XC(o8),i=n8(e,"flags");return(!i||i.get!==n)&&i8(e,"flags",{configurable:!0,enumerable:!1,get:n}),n},a8=fu,l8=kC,u8=ZC,YC=$C,c8=s8,JC=l8(YC());a8(JC,{getPolyfill:YC,implementation:u8,shim:c8});var h8=JC,eS=zy,A8=eS("Date.prototype.getDay"),f8=function(n){try{return A8(n),!0}catch{return!1}},d8=eS("Object.prototype.toString"),p8="[object Date]",m8=Iy(),g8=function(n){return typeof n!="object"||n===null?!1:m8?f8(n):d8(n)===p8},tS=nC,nS=cQ,iS=RQ,rS=VQ,oS=h8,sS=g8,aS=Date.prototype.getTime;function lS(t,n,e){var i=e||{};return(i.strict?iS(t,n):t===n)?!0:!t||!n||typeof t!="object"&&typeof n!="object"?i.strict?iS(t,n):t==n:y8(t,n,i)}function uS(t){return t==null}function cS(t){return!(!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number")}function y8(t,n,e){var i,o;if(typeof t!=typeof n||uS(t)||uS(n)||t.prototype!==n.prototype||nS(t)!==nS(n))return!1;var r=rS(t),a=rS(n);if(r!==a)return!1;if(r||a)return t.source===n.source&&oS(t)===oS(n);if(sS(t)&&sS(n))return aS.call(t)===aS.call(n);var s=cS(t),l=cS(n);if(s!==l)return!1;if(s||l){if(t.length!==n.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==n[i])return!1;return!0}if(typeof t!=typeof n)return!1;try{var u=tS(t),A=tS(n)}catch{return!1}if(u.length!==A.length)return!1;for(u.sort(),A.sort(),i=u.length-1;i>=0;i--)if(u[i]!=A[i])return!1;for(i=u.length-1;i>=0;i--)if(o=u[i],!lS(t[o],n[o],e))return!1;return!0}var v8=lS;function w8(t,n){var e=!0;return rr(t,function(i){rr(n,function(o){if(e===!1)return!1;e=b8(i.geometry,o.geometry)})}),e}function b8(t,n){switch(t.type){case"Point":switch(n.type){case"Point":return!S8(t.coordinates,n.coordinates);case"LineString":return!hS(n,t);case"Polygon":return!An(t,n)}break;case"LineString":switch(n.type){case"Point":return!hS(t,n);case"LineString":return!x8(t,n);case"Polygon":return!AS(n,t)}break;case"Polygon":switch(n.type){case"Point":return!An(n,t);case"LineString":return!AS(t,n);case"Polygon":return!_8(n,t)}}return!1}function hS(t,n){for(var e=0;e<t.coordinates.length-1;e++)if(C8(t.coordinates[e],t.coordinates[e+1],n.coordinates))return!0;return!1}function x8(t,n){var e=Py(t,n);return e.features.length>0}function AS(t,n){for(var e=0,i=n.coordinates;e<i.length;e++){var o=i[e];if(An(o,t))return!0}var r=Py(n,By(t));return r.features.length>0}function _8(t,n){for(var e=0,i=t.coordinates[0];e<i.length;e++){var o=i[e];if(An(o,n))return!0}for(var r=0,a=n.coordinates[0];r<a.length;r++){var s=a[r];if(An(s,t))return!0}var l=Py(By(t),By(n));return l.features.length>0}function C8(t,n,e){var i=e[0]-t[0],o=e[1]-t[1],r=n[0]-t[0],a=n[1]-t[1],s=i*a-o*r;return s!==0?!1:Math.abs(r)>=Math.abs(a)?r>0?t[0]<=e[0]&&e[0]<=n[0]:n[0]<=e[0]&&e[0]<=t[0]:a>0?t[1]<=e[1]&&e[1]<=n[1]:n[1]<=e[1]&&e[1]<=t[1]}function S8(t,n){return t[0]===n[0]&&t[1]===n[1]}var E8=v8,Oi=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=t&&t.direction?t.direction:!1,this.pseudoNode=t&&t.pseudoNode?t.pseudoNode:!1,this.objectComparator=t&&t.objectComparator?t.objectComparator:P8};Oi.prototype.compare=function(t,n){if(t.type!==n.type||!dS(t,n))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,n.coordinates);case"LineString":return this.compareLine(t.coordinates,n.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,n);case"Feature":return this.compareFeature(t,n);default:if(t.type.indexOf("Multi")===0){var e=this,i=fS(t),o=fS(n);return i.every(function(r){return this.some(function(a){return e.compare(r,a)})},o)}}return!1};function fS(t){return t.coordinates.map(function(n){return{type:t.type.replace("Multi",""),coordinates:n}})}function dS(t,n){return t.hasOwnProperty("coordinates")?t.coordinates.length===n.coordinates.length:t.length===n.length}Oi.prototype.compareCoord=function(t,n){if(t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(t[e].toFixed(this.precision)!==n[e].toFixed(this.precision))return!1;return!0},Oi.prototype.compareLine=function(t,n,e,i){if(!dS(t,n))return!1;var o=this.pseudoNode?t:this.removePseudo(t),r=this.pseudoNode?n:this.removePseudo(n);if(!(i&&!this.compareCoord(o[0],r[0])&&(r=this.fixStartIndex(r,o),!r))){var a=this.compareCoord(o[e],r[e]);return this.direction||a?this.comparePath(o,r):this.compareCoord(o[e],r[r.length-(1+e)])?this.comparePath(o.slice().reverse(),r):!1}},Oi.prototype.fixStartIndex=function(t,n){for(var e,i=-1,o=0;o<t.length;o++)if(this.compareCoord(t[o],n[0])){i=o;break}return i>=0&&(e=[].concat(t.slice(i,t.length),t.slice(1,i+1))),e},Oi.prototype.comparePath=function(t,n){var e=this;return t.every(function(i,o){return e.compareCoord(i,this[o])},n)},Oi.prototype.comparePolygon=function(t,n){if(this.compareLine(t.coordinates[0],n.coordinates[0],1,!0)){var e=t.coordinates.slice(1,t.coordinates.length),i=n.coordinates.slice(1,n.coordinates.length),o=this;return e.every(function(r){return this.some(function(a){return o.compareLine(r,a,1,!0)})},i)}else return!1},Oi.prototype.compareFeature=function(t,n){return t.id!==n.id||!this.objectComparator(t.properties,n.properties)||!this.compareBBox(t,n)?!1:this.compare(t.geometry,n.geometry)},Oi.prototype.compareBBox=function(t,n){return!!(!t.bbox&&!n.bbox||t.bbox&&n.bbox&&this.compareCoord(t.bbox,n.bbox))},Oi.prototype.removePseudo=function(t){return t};function P8(t,n){return E8(t,n,{strict:!0})}var B8=Oi;const T8=Ml(B8);function I8(t,n){var e=Fi(t).type,i=Fi(n).type;if(e!==i)return!1;var o=new T8({precision:6});return o.compare(D_(t),D_(n))}function F8(t,n){var e=!1;return rr(t,function(i){rr(n,function(o){if(e===!0)return!0;e=!w8(i.geometry,o.geometry)})}),e}/**
|
|
3709
|
+
`,co=class co extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_player");L(this,"_finalImageUrlReact",this.disposeVar(c.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));L(this,"_routePaths",this.disposeVar(c.react(void 0)));L(this,"routePathCallback");L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this._id.value=i),this._player=this.disposeVar(new c.Player);{const p=co.defaults;this.dispose(c.bind([this._player,"loop"],[this,"loop"],d=>d??p.loop,d=>d??p.loop)),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"],d=>d??p.currentTime,d=>d??p.currentTime)),this.dispose(c.bind([this._player,"duration"],[this,"duration"],d=>d??p.duration,d=>d??p.duration)),this.dispose(c.bind([this._player,"playing"],[this,"playing"],d=>d??p.playing,d=>d??p.playing)),this.dispose(c.bind([this._player,"speed"],[this,"speed"],d=>d??p.speed,d=>d??p.speed))}const o=this.disposeVar(c.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),r=this.disposeVar(c.createProcessingFromAsyncFunc(async p=>{this.routePaths=void 0;const d=o.value;if(d)try{const v=await(await fetch(d)).json();this.routePaths=Gz(v,this.width,this.repeatLength);return}catch(m){console.error(`geojson加载解析出错!${m}`),console.error(m)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const m=this.positionsSet;if(m){this.routePaths=m.map(v=>({positions:v,width:this.width}));return}}}));{const p=()=>{r.restart()};p();const d=this.disposeVar(c.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(d.disposableOn(p))}{const p=()=>{const d=Id(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);d&&(this.routePathCallback=d)};p(),this.dispose(this.routePathCallbackStrChanged.disposableOn(p))}const a=e.viewer;if(!a){console.warn("viewer is undefined!");return}const s=this.finalImageUrlReact,l=this.disposeVar(new xs),u=this.disposeVar(c.createProcessingFromAsyncFunc(async p=>{if(!s.value)return;const d=V0(a.scene.context).getTextureHandler(s.value);if(d instanceof xs)l.reset(d);else{const m=await p.promise(d);l.reset(m)}})),A=()=>l.valid?l.raw:a.scene.context.defaultTexture,h=()=>u.restart();h(),this.dispose(s.changed.disposableOn(h));const f=this.ad(c.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new c.ObjResettingWithEvent(f,()=>this.routePaths?new sk(a,this,s.value&&A||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(p=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))Fe(a,this.routePaths[0].startPos,a.camera.positionCartographic.height,void 0,p);else{const d=computeBoundingSphere(this.routePaths[0].positions);if(!d)return;const[m,v]=d;Fe(a,m,v*3,void 0,p)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get finalImageUrlReact(){return this._finalImageUrlReact}get routePaths(){return this._routePaths.value}set routePaths(e){this._routePaths.value=e}get routePathsChanged(){return this._routePaths.changed}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}};L(co,"whiteGradientImageBase64",ak),L(co,"defaultRoutePathCallback",function(e,i,o){const r=i/50,a=r-Math.floor(r);return e.color=[a*.5+.5,(1-a)*.5+.5,.5,1],e.bgColor=[a*.5+.5,(1-a)*.5+.5,.5,.3],e}),L(co,"routePathCallbackStrMd",lk),L(co,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(co,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let sr=co;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:c.reactArray([0,1,0,1]),bgColor:c.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:c.reactPositionsSet(void 0),data:c.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(sr||(sr={})),c.extendClassProps(sr.prototype,sr.createDefaultProps);class Jr extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_collection");this._collection=this.disposeVar(new sr(e,i)),this.dispose(c.track([this._collection,"show"],[this,"show"])),this.dispose(c.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(c.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(c.track([this._collection,"color"],[this,"color"])),this.dispose(c.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(c.track([this._collection,"width"],[this,"width"])),this.dispose(c.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(c.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(c.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(c.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(c.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(c.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(c.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([this._collection,"playing"],[this,"playing"])),this.dispose(c.track([this._collection,"loop"],[this,"loop"])),this.dispose(c.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._collection,"duration"],[this,"duration"])),this.dispose(c.bind([this._collection,"speed"],[this,"speed"]));{const o=()=>{this.color=[this.bgColor[0],this.bgColor[1],this.bgColor[2],1]};o(),this.ad(this.bgColorChanged.don(o))}this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=this.positions.map((a,s)=>{var l;if(!(!this.positions||s==((l=this.positions)==null?void 0:l.length)-1))return{startPos:a,endPos:this.positions[s+1],width:this.width,heightRatio:this.heightRatio}}).filter(a=>a!==void 0);return}this._collection.data=void 0};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(r.disposableOn(o))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get collection(){return this._collection}get player(){return this.collection.player}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}}L(Jr,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(Jr,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png"),(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:c.reactArray([0,1,0,1]),bgColor:c.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:c.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Jr||(Jr={})),c.extendClassProps(Jr.prototype,Jr.createDefaultProps);const Hc=class Hc extends sn{constructor(e,i){super(e,i);L(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Jr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmSignalTransmission;{const a=()=>{r.show=e.show&&e.stroked};a(),this.ad(e.showChanged.don(a)),this.ad(e.strokedChanged.don(a))}this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"bgColor"],[e,"strokeColor"])),this.dispose(c.track([r,"startTime"],[e,"startTime"])),this.dispose(c.track([r,"transmissionTime"],[e,"transmissionTime"])),this.dispose(c.track([r,"heightRatio"],[e,"heightRatio"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"brightening"],[e,"brightening"])),this.dispose(c.track([r,"depthTest"],[e,"depthTest"])),this.dispose(c.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(c.track([r,"repeat"],[e,"repeat"])),this.dispose(c.track([r,"bidirectional"],[e,"bidirectional"])),this.dispose(c.track([r,"loop"],[e,"loop"])),this.dispose(c.track([r,"currentTime"],[e,"currentTime"])),this.dispose(c.track([r,"duration"],[e,"duration"])),this.dispose(c.track([r,"playing"],[e,"playing"])),this.dispose(c.track([r,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Hc,"type",Hc.register("ESCesiumViewer",bf.type,Hc));let wy=Hc;function ts(t){var n=[1/0,1/0,-1/0,-1/0];return Jo(t,function(e){n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}ts.default=ts;var B_={exports:{}};(function(t,n){(function(e,i){t.exports=i()})(Oo,function(){function e(g,_,x,E,B){(function P(I,D,F,S,T){for(;S>F;){if(S-F>600){var w=S-F+1,C=D-F+1,M=Math.log(w),R=.5*Math.exp(2*M/3),U=.5*Math.sqrt(M*R*(w-R)/w)*(C-w/2<0?-1:1),O=Math.max(F,Math.floor(D-C*R/w+U)),z=Math.min(S,Math.floor(D+(w-C)*R/w+U));P(I,D,O,z,T)}var k=I[D],Q=F,V=S;for(i(I,F,D),T(I[S],k)>0&&i(I,F,S);Q<V;){for(i(I,Q,V),Q++,V--;T(I[Q],k)<0;)Q++;for(;T(I[V],k)>0;)V--}T(I[F],k)===0?i(I,F,V):i(I,++V,S),V<=D&&(F=V+1),D<=V&&(S=V-1)}})(g,_,x||0,E||g.length-1,B||o)}function i(g,_,x){var E=g[_];g[_]=g[x],g[x]=E}function o(g,_){return g<_?-1:g>_?1:0}var r=function(g){g===void 0&&(g=9),this._maxEntries=Math.max(4,g),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(g,_,x){if(!x)return _.indexOf(g);for(var E=0;E<_.length;E++)if(x(g,_[E]))return E;return-1}function s(g,_){l(g,0,g.children.length,_,g)}function l(g,_,x,E,B){B||(B=v(null)),B.minX=1/0,B.minY=1/0,B.maxX=-1/0,B.maxY=-1/0;for(var P=_;P<x;P++){var I=g.children[P];u(B,g.leaf?E(I):I)}return B}function u(g,_){return g.minX=Math.min(g.minX,_.minX),g.minY=Math.min(g.minY,_.minY),g.maxX=Math.max(g.maxX,_.maxX),g.maxY=Math.max(g.maxY,_.maxY),g}function A(g,_){return g.minX-_.minX}function h(g,_){return g.minY-_.minY}function f(g){return(g.maxX-g.minX)*(g.maxY-g.minY)}function p(g){return g.maxX-g.minX+(g.maxY-g.minY)}function d(g,_){return g.minX<=_.minX&&g.minY<=_.minY&&_.maxX<=g.maxX&&_.maxY<=g.maxY}function m(g,_){return _.minX<=g.maxX&&_.minY<=g.maxY&&_.maxX>=g.minX&&_.maxY>=g.minY}function v(g){return{children:g,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(g,_,x,E,B){for(var P=[_,x];P.length;)if(!((x=P.pop())-(_=P.pop())<=E)){var I=_+Math.ceil((x-_)/E/2)*E;e(g,I,_,x,B),P.push(_,I,I,x)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(g){var _=this.data,x=[];if(!m(g,_))return x;for(var E=this.toBBox,B=[];_;){for(var P=0;P<_.children.length;P++){var I=_.children[P],D=_.leaf?E(I):I;m(g,D)&&(_.leaf?x.push(I):d(g,D)?this._all(I,x):B.push(I))}_=B.pop()}return x},r.prototype.collides=function(g){var _=this.data;if(!m(g,_))return!1;for(var x=[];_;){for(var E=0;E<_.children.length;E++){var B=_.children[E],P=_.leaf?this.toBBox(B):B;if(m(g,P)){if(_.leaf||d(g,P))return!0;x.push(B)}}_=x.pop()}return!1},r.prototype.load=function(g){if(!g||!g.length)return this;if(g.length<this._minEntries){for(var _=0;_<g.length;_++)this.insert(g[_]);return this}var x=this._build(g.slice(),0,g.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var E=this.data;this.data=x,x=E}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},r.prototype.insert=function(g){return g&&this._insert(g,this.data.height-1),this},r.prototype.clear=function(){return this.data=v([]),this},r.prototype.remove=function(g,_){if(!g)return this;for(var x,E,B,P=this.data,I=this.toBBox(g),D=[],F=[];P||D.length;){if(P||(P=D.pop(),E=D[D.length-1],x=F.pop(),B=!0),P.leaf){var S=a(g,P.children,_);if(S!==-1)return P.children.splice(S,1),D.push(P),this._condense(D),this}B||P.leaf||!d(P,I)?E?(x++,P=E.children[x],B=!1):P=null:(D.push(P),F.push(x),x=0,E=P,P=P.children[0])}return this},r.prototype.toBBox=function(g){return g},r.prototype.compareMinX=function(g,_){return g.minX-_.minX},r.prototype.compareMinY=function(g,_){return g.minY-_.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(g){return this.data=g,this},r.prototype._all=function(g,_){for(var x=[];g;)g.leaf?_.push.apply(_,g.children):x.push.apply(x,g.children),g=x.pop();return _},r.prototype._build=function(g,_,x,E){var B,P=x-_+1,I=this._maxEntries;if(P<=I)return s(B=v(g.slice(_,x+1)),this.toBBox),B;E||(E=Math.ceil(Math.log(P)/Math.log(I)),I=Math.ceil(P/Math.pow(I,E-1))),(B=v([])).leaf=!1,B.height=E;var D=Math.ceil(P/I),F=D*Math.ceil(Math.sqrt(I));y(g,_,x,F,this.compareMinX);for(var S=_;S<=x;S+=F){var T=Math.min(S+F-1,x);y(g,S,T,D,this.compareMinY);for(var w=S;w<=T;w+=D){var C=Math.min(w+D-1,T);B.children.push(this._build(g,w,C,E-1))}}return s(B,this.toBBox),B},r.prototype._chooseSubtree=function(g,_,x,E){for(;E.push(_),!_.leaf&&E.length-1!==x;){for(var B=1/0,P=1/0,I=void 0,D=0;D<_.children.length;D++){var F=_.children[D],S=f(F),T=(w=g,C=F,(Math.max(C.maxX,w.maxX)-Math.min(C.minX,w.minX))*(Math.max(C.maxY,w.maxY)-Math.min(C.minY,w.minY))-S);T<P?(P=T,B=S<B?S:B,I=F):T===P&&S<B&&(B=S,I=F)}_=I||_.children[0]}var w,C;return _},r.prototype._insert=function(g,_,x){var E=x?g:this.toBBox(g),B=[],P=this._chooseSubtree(E,this.data,_,B);for(P.children.push(g),u(P,E);_>=0&&B[_].children.length>this._maxEntries;)this._split(B,_),_--;this._adjustParentBBoxes(E,B,_)},r.prototype._split=function(g,_){var x=g[_],E=x.children.length,B=this._minEntries;this._chooseSplitAxis(x,B,E);var P=this._chooseSplitIndex(x,B,E),I=v(x.children.splice(P,x.children.length-P));I.height=x.height,I.leaf=x.leaf,s(x,this.toBBox),s(I,this.toBBox),_?g[_-1].children.push(I):this._splitRoot(x,I)},r.prototype._splitRoot=function(g,_){this.data=v([g,_]),this.data.height=g.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(g,_,x){for(var E,B,P,I,D,F,S,T=1/0,w=1/0,C=_;C<=x-_;C++){var M=l(g,0,C,this.toBBox),R=l(g,C,x,this.toBBox),U=(B=M,P=R,I=void 0,D=void 0,F=void 0,S=void 0,I=Math.max(B.minX,P.minX),D=Math.max(B.minY,P.minY),F=Math.min(B.maxX,P.maxX),S=Math.min(B.maxY,P.maxY),Math.max(0,F-I)*Math.max(0,S-D)),O=f(M)+f(R);U<T?(T=U,E=C,w=O<w?O:w):U===T&&O<w&&(w=O,E=C)}return E||x-_},r.prototype._chooseSplitAxis=function(g,_,x){var E=g.leaf?this.compareMinX:A,B=g.leaf?this.compareMinY:h;this._allDistMargin(g,_,x,E)<this._allDistMargin(g,_,x,B)&&g.children.sort(E)},r.prototype._allDistMargin=function(g,_,x,E){g.children.sort(E);for(var B=this.toBBox,P=l(g,0,_,B),I=l(g,x-_,x,B),D=p(P)+p(I),F=_;F<x-_;F++){var S=g.children[F];u(P,g.leaf?B(S):S),D+=p(P)}for(var T=x-_-1;T>=_;T--){var w=g.children[T];u(I,g.leaf?B(w):w),D+=p(I)}return D},r.prototype._adjustParentBBoxes=function(g,_,x){for(var E=x;E>=0;E--)u(_[E],g)},r.prototype._condense=function(g){for(var _=g.length-1,x=void 0;_>=0;_--)g[_].children.length===0?_>0?(x=g[_-1].children).splice(x.indexOf(g[_]),1):this.clear():s(g[_],this.toBBox)},r})})(B_);var uk=B_.exports;function An(t,n,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!n)throw new Error("polygon is required");var i=Mf(t),o=Fi(n),r=o.type,a=n.bbox,s=o.coordinates;if(a&&ck(i,a)===!1)return!1;r==="Polygon"&&(s=[s]);for(var l=!1,u=0;u<s.length&&!l;u++)if(T_(i,s[u][0],e.ignoreBoundary)){for(var A=!1,h=1;h<s[u].length&&!A;)T_(i,s[u][h],!e.ignoreBoundary)&&(A=!0),h++;A||(l=!0)}return l}function T_(t,n,e){var i=!1;n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&(n=n.slice(0,n.length-1));for(var o=0,r=n.length-1;o<n.length;r=o++){var a=n[o][0],s=n[o][1],l=n[r][0],u=n[r][1],A=t[1]*(a-l)+s*(l-t[0])+u*(t[0]-a)===0&&(a-t[0])*(l-t[0])<=0&&(s-t[1])*(u-t[1])<=0;if(A)return!e;var h=s>t[1]!=u>t[1]&&t[0]<(l-a)*(t[1]-s)/(u-s)+a;h&&(i=!i)}return i}function ck(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function hk(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return I_(t);case"FeatureCollection":return Ak(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return by(t);default:throw new Error("unknown GeoJSON type")}}function I_(t){var n={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:n[e]=t[e]}}),n.properties=F_(t.properties),n.geometry=by(t.geometry),n}function F_(t){var n={};return t&&Object.keys(t).forEach(function(e){var i=t[e];typeof i=="object"?i===null?n[e]=null:Array.isArray(i)?n[e]=i.map(function(o){return o}):n[e]=F_(i):n[e]=i}),n}function Ak(t){var n={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:n[e]=t[e]}}),n.features=t.features.map(function(e){return I_(e)}),n}function by(t){var n={type:t.type};return t.bbox&&(n.bbox=t.bbox),t.type==="GeometryCollection"?(n.geometries=t.geometries.map(function(e){return by(e)}),n):(n.coordinates=M_(t.coordinates),n)}function M_(t){var n=t;return typeof n[0]!="object"?n.slice():n.map(function(e){return M_(e)})}function D_(t,n){n===void 0&&(n={});var e=typeof n=="object"?n.mutate:n;if(!t)throw new Error("geojson is required");var i=Tz(t),o=[];switch(i){case"LineString":o=xy(t);break;case"MultiLineString":case"Polygon":Ii(t).forEach(function(a){o.push(xy(a))});break;case"MultiPolygon":Ii(t).forEach(function(a){var s=[];a.forEach(function(l){s.push(xy(l))}),o.push(s)});break;case"Point":return t;case"MultiPoint":var r={};Ii(t).forEach(function(a){var s=a.join("-");Object.prototype.hasOwnProperty.call(r,s)||(o.push(a),r[s]=!0)});break;default:throw new Error(i+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:i,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):zn({type:i,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function xy(t){var n=Ii(t);if(n.length===2&&!R_(n[0],n[1]))return n;var e=[],i=n.length-1,o=e.length;e.push(n[0]);for(var r=1;r<i;r++){var a=e[e.length-1];n[r][0]===a[0]&&n[r][1]===a[1]||(e.push(n[r]),o=e.length,o>2&&U_(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(n[n.length-1]),o=e.length,R_(n[0],n[n.length-1])&&o<4)throw new Error("invalid polygon");return U_(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function R_(t,n){return t[0]===n[0]&&t[1]===n[1]}function U_(t,n,e){var i=e[0],o=e[1],r=t[0],a=t[1],s=n[0],l=n[1],u=i-r,A=o-a,h=s-r,f=l-a,p=u*f-A*h;return p!==0?!1:Math.abs(h)>=Math.abs(f)?h>0?r<=i&&i<=s:s<=i&&i<=r:f>0?a<=o&&o<=l:l<=o&&o<=a}function fk(t,n){n===void 0&&(n={});var e=0,i=0,o=0;return Jo(t,function(r){e+=r[0],i+=r[1],o++},!0),Xt([e/o,i/o],n.properties)}function O_(t){if(!t)throw new Error("geojson is required");var n=[];return rr(t,function(e){dk(e,n)}),Pn(n)}function dk(t,n){var e=[],i=t.geometry;if(i!==null){switch(i.type){case"Polygon":e=Ii(i);break;case"LineString":e=[Ii(i)]}e.forEach(function(o){var r=pk(o,t.properties);r.forEach(function(a){a.id=n.length,n.push(a)})})}}function pk(t,n){var e=[];return t.reduce(function(i,o){var r=Yn([i,o],n);return r.bbox=mk(i,o),e.push(r),o}),e}function mk(t,n){var e=t[0],i=t[1],o=n[0],r=n[1],a=e<o?e:o,s=i<r?i:r,l=e>o?e:o,u=i>r?i:r;return[a,s,l,u]}var _y={exports:{}},L_={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=63710088e-1,t.factors={centimeters:t.earthRadius*100,centimetres:t.earthRadius*100,degrees:t.earthRadius/111325,feet:t.earthRadius*3.28084,inches:t.earthRadius*39.37,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:t.earthRadius*1e3,millimetres:t.earthRadius*1e3,nauticalmiles:t.earthRadius/1852,radians:1,yards:t.earthRadius*1.0936},t.unitsFactors={centimeters:100,centimetres:100,degrees:8982708286548395e-21,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:.0006213711922373339,millimeters:1e3,millimetres:1e3,nauticalmiles:.0005399568034557236,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function n(S,T,w){w===void 0&&(w={});var C={type:"Feature"};return(w.id===0||w.id)&&(C.id=w.id),w.bbox&&(C.bbox=w.bbox),C.properties=T||{},C.geometry=S,C}t.feature=n;function e(S,T,w){switch(S){case"Point":return i(T).geometry;case"LineString":return s(T).geometry;case"Polygon":return r(T).geometry;case"MultiPoint":return h(T).geometry;case"MultiLineString":return A(T).geometry;case"MultiPolygon":return f(T).geometry;default:throw new Error(S+" is invalid")}}t.geometry=e;function i(S,T,w){if(w===void 0&&(w={}),!S)throw new Error("coordinates is required");if(!Array.isArray(S))throw new Error("coordinates must be an Array");if(S.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!P(S[0])||!P(S[1]))throw new Error("coordinates must contain numbers");var C={type:"Point",coordinates:S};return n(C,T,w)}t.point=i;function o(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return i(C,T)}),w)}t.points=o;function r(S,T,w){w===void 0&&(w={});for(var C=0,M=S;C<M.length;C++){var R=M[C];if(R.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var U=0;U<R[R.length-1].length;U++)if(R[R.length-1][U]!==R[0][U])throw new Error("First and last Position are not equivalent.")}var O={type:"Polygon",coordinates:S};return n(O,T,w)}t.polygon=r;function a(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return r(C,T)}),w)}t.polygons=a;function s(S,T,w){if(w===void 0&&(w={}),S.length<2)throw new Error("coordinates must be an array of two or more positions");var C={type:"LineString",coordinates:S};return n(C,T,w)}t.lineString=s;function l(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return s(C,T)}),w)}t.lineStrings=l;function u(S,T){T===void 0&&(T={});var w={type:"FeatureCollection"};return T.id&&(w.id=T.id),T.bbox&&(w.bbox=T.bbox),w.features=S,w}t.featureCollection=u;function A(S,T,w){w===void 0&&(w={});var C={type:"MultiLineString",coordinates:S};return n(C,T,w)}t.multiLineString=A;function h(S,T,w){w===void 0&&(w={});var C={type:"MultiPoint",coordinates:S};return n(C,T,w)}t.multiPoint=h;function f(S,T,w){w===void 0&&(w={});var C={type:"MultiPolygon",coordinates:S};return n(C,T,w)}t.multiPolygon=f;function p(S,T,w){w===void 0&&(w={});var C={type:"GeometryCollection",geometries:S};return n(C,T,w)}t.geometryCollection=p;function d(S,T){if(T===void 0&&(T=0),T&&!(T>=0))throw new Error("precision must be a positive number");var w=Math.pow(10,T||0);return Math.round(S*w)/w}t.round=d;function m(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S*w}t.radiansToLength=m;function v(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S/w}t.lengthToRadians=v;function y(S,T){return _(v(S,T))}t.lengthToDegrees=y;function g(S){var T=S%360;return T<0&&(T+=360),T}t.bearingToAzimuth=g;function _(S){var T=S%(2*Math.PI);return T*180/Math.PI}t.radiansToDegrees=_;function x(S){var T=S%360;return T*Math.PI/180}t.degreesToRadians=x;function E(S,T,w){if(T===void 0&&(T="kilometers"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("length must be a positive number");return m(v(S,T),w)}t.convertLength=E;function B(S,T,w){if(T===void 0&&(T="meters"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("area must be a positive number");var C=t.areaFactors[T];if(!C)throw new Error("invalid original units");var M=t.areaFactors[w];if(!M)throw new Error("invalid final units");return S/C*M}t.convertArea=B;function P(S){return!isNaN(S)&&S!==null&&!Array.isArray(S)}t.isNumber=P;function I(S){return!!S&&S.constructor===Object}t.isObject=I;function D(S){if(!S)throw new Error("bbox is required");if(!Array.isArray(S))throw new Error("bbox must be an Array");if(S.length!==4&&S.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");S.forEach(function(T){if(!P(T))throw new Error("bbox must only contain numbers")})}t.validateBBox=D;function F(S){if(!S)throw new Error("id is required");if(["string","number"].indexOf(typeof S)===-1)throw new Error("id must be a number or a string")}t.validateId=F})(L_);var Ut={};const gk=eb(Pz);Object.defineProperty(Ut,"__esModule",{value:!0});var ln=gk;function lu(t,n,e){if(t!==null)for(var i,o,r,a,s,l,u,A=0,h=0,f,p=t.type,d=p==="FeatureCollection",m=p==="Feature",v=d?t.features.length:1,y=0;y<v;y++){u=d?t.features[y].geometry:m?t.geometry:t,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var g=0;g<s;g++){var _=0,x=0;if(a=f?u.geometries[g]:u,a!==null){l=a.coordinates;var E=a.type;switch(A=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(n(l,h,y,_,x)===!1)return!1;h++,_++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(n(l[i],h,y,_,x)===!1)return!1;h++,E==="MultiPoint"&&_++}E==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-A;o++){if(n(l[i][o],h,y,_,x)===!1)return!1;h++}E==="MultiLineString"&&_++,E==="Polygon"&&x++}E==="Polygon"&&_++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(x=0,o=0;o<l[i].length;o++){for(r=0;r<l[i][o].length-A;r++){if(n(l[i][o][r],h,y,_,x)===!1)return!1;h++}x++}_++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(lu(a.geometries[i],n,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function yk(t,n,e,i){var o=e;return lu(t,function(r,a,s,l,u){a===0&&e===void 0?o=r:o=n(o,r,a,s,l,u)},i),o}function z_(t,n){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&n(t.features[e].properties,e)!==!1;e++);break;case"Feature":n(t.properties,0);break}}function vk(t,n,e){var i=e;return z_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function k_(t,n){if(t.type==="Feature")n(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&n(t.features[e],e)!==!1;e++);}function wk(t,n,e){var i=e;return k_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function bk(t){var n=[];return lu(t,function(e){n.push(e)}),n}function Cy(t,n){var e,i,o,r,a,s,l,u,A,h,f=0,p=t.type==="FeatureCollection",d=t.type==="Feature",m=p?t.features.length:1;for(e=0;e<m;e++){for(s=p?t.features[e].geometry:d?t.geometry:t,u=p?t.features[e].properties:d?t.properties:{},A=p?t.features[e].bbox:d?t.bbox:void 0,h=p?t.features[e].id:d?t.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,o=0;o<a;o++){if(r=l?s.geometries[o]:s,r===null){if(n(null,f,u,A,h)===!1)return!1;continue}switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(r,f,u,A,h)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<r.geometries.length;i++)if(n(r.geometries[i],f,u,A,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function xk(t,n,e){var i=e;return Cy(t,function(o,r,a,s,l){r===0&&e===void 0?i=o:i=n(i,o,r,a,s,l)}),i}function Rf(t,n){Cy(t,function(e,i,o,r,a){var s=e===null?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return n(ln.feature(e,o,{bbox:r,id:a}),i,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var A=e.coordinates[u],h={type:l,coordinates:A};if(n(ln.feature(h,o),i,u)===!1)return!1}})}function _k(t,n,e){var i=e;return Rf(t,function(o,r,a){r===0&&a===0&&e===void 0?i=o:i=n(i,o,r,a)}),i}function Q_(t,n){Rf(t,function(e,i,o){var r=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var s,l=0,u=0,A=0;if(lu(e,function(h,f,p,d,m){if(s===void 0||i>l||d>u||m>A){s=h,l=i,u=d,A=m,r=0;return}var v=ln.lineString([s,h],e.properties);if(n(v,i,o,m,r)===!1)return!1;r++,s=h})===!1)return!1}}})}function Ck(t,n,e){var i=e,o=!1;return Q_(t,function(r,a,s,l,u){o===!1&&e===void 0?i=r:i=n(i,r,a,s,l,u),o=!0}),i}function V_(t,n){if(!t)throw new Error("geojson is required");Rf(t,function(e,i,o){if(e.geometry!==null){var r=e.geometry.type,a=e.geometry.coordinates;switch(r){case"LineString":if(n(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(n(ln.lineString(a[s],e.properties),i,o,s)===!1)return!1;break}}})}function Sk(t,n,e){var i=e;return V_(t,function(o,r,a,s){r===0&&e===void 0?i=o:i=n(i,o,r,a,s)}),i}function Ek(t,n){if(n=n||{},!ln.isObject(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.segmentIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":case"MultiPoint":return null;case"LineString":return r<0&&(r=l.length+r-1),ln.lineString([l[r],l[r+1]],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r-1),ln.lineString([l[o][r],l[o][r+1]],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r-1),ln.lineString([l[i][r],l[i][r+1]],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r-1),ln.lineString([l[i][o][r],l[i][o][r+1]],a,n)}throw new Error("geojson is invalid")}function Pk(t,n){if(n=n||{},!ln.isObject(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.coordIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":return ln.point(l,a,n);case"MultiPoint":return i<0&&(i=l.length+i),ln.point(l[i],a,n);case"LineString":return r<0&&(r=l.length+r),ln.point(l[r],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r),ln.point(l[o][r],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r),ln.point(l[i][r],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r),ln.point(l[i][o][r],a,n)}throw new Error("geojson is invalid")}Ut.coordAll=bk,Ut.coordEach=lu,Ut.coordReduce=yk,Ut.featureEach=k_,Ut.featureReduce=wk,Ut.findPoint=Pk,Ut.findSegment=Ek,Ut.flattenEach=Rf,Ut.flattenReduce=_k,Ut.geomEach=Cy,Ut.geomReduce=xk,Ut.lineEach=V_,Ut.lineReduce=Sk,Ut.propEach=z_,Ut.propReduce=vk,Ut.segmentEach=Q_,Ut.segmentReduce=Ck;var Sy={};const Bk=eb(kz);Object.defineProperty(Sy,"__esModule",{value:!0});var Tk=Bk;function Ey(t){var n=[1/0,1/0,-1/0,-1/0];return Tk.coordEach(t,function(e){n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}Ey.default=Ey,Sy.default=Ey;var Ui=uk,N_=L_,H_=Ut,Sa=Sy.default,Ik=H_.featureEach;H_.coordEach,N_.polygon;var G_=N_.featureCollection;function W_(t){var n=new Ui(t);return n.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Sa(e),Ui.prototype.insert.call(this,e)},n.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Sa(o),i.push(o)}):Ik(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Sa(o),i.push(o)}),Ui.prototype.load.call(this,i)},n.remove=function(e,i){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Sa(e),Ui.prototype.remove.call(this,e,i)},n.clear=function(){return Ui.prototype.clear.call(this)},n.search=function(e){var i=Ui.prototype.search.call(this,this.toBBox(e));return G_(i)},n.collides=function(e){return Ui.prototype.collides.call(this,this.toBBox(e))},n.all=function(){var e=Ui.prototype.all.call(this);return G_(e)},n.toJSON=function(){return Ui.prototype.toJSON.call(this)},n.fromJSON=function(e){return Ui.prototype.fromJSON.call(this,e)},n.toBBox=function(e){var i;if(e.bbox)i=e.bbox;else if(Array.isArray(e)&&e.length===4)i=e;else if(Array.isArray(e)&&e.length===6)i=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")i=Sa(e);else if(e.type==="FeatureCollection")i=Sa(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},n}_y.exports=W_,_y.exports.default=W_;var Fk=_y.exports;const Mk=Ml(Fk);function Py(t,n){var e={},i=[];if(t.type==="LineString"&&(t=zn(t)),n.type==="LineString"&&(n=zn(n)),t.type==="Feature"&&n.type==="Feature"&&t.geometry!==null&&n.geometry!==null&&t.geometry.type==="LineString"&&n.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&n.geometry.coordinates.length===2){var o=j_(t,n);return o&&i.push(o),Pn(i)}var r=Mk();return r.load(O_(n)),wa(O_(t),function(a){wa(r.search(a),function(s){var l=j_(a,s);if(l){var u=Ii(l).join(",");e[u]||(e[u]=!0,i.push(l))}})}),Pn(i)}function j_(t,n){var e=Ii(t),i=Ii(n);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],r=e[0][1],a=e[1][0],s=e[1][1],l=i[0][0],u=i[0][1],A=i[1][0],h=i[1][1],f=(h-u)*(a-o)-(A-l)*(s-r),p=(A-l)*(r-u)-(h-u)*(o-l),d=(a-o)*(r-u)-(s-r)*(o-l);if(f===0)return null;var m=p/f,v=d/f;if(m>=0&&m<=1&&v>=0&&v<=1){var y=o+m*(a-o),g=r+m*(s-r);return Xt([y,g])}return null}function Uf(t,n,e){e===void 0&&(e={});for(var i=Mf(t),o=Ii(n),r=0;r<o.length-1;r++){var a=!1;if(e.ignoreEndVertices&&(r===0&&(a="start"),r===o.length-2&&(a="end"),r===0&&r+1===o.length-1&&(a="both")),Dk(o[r],o[r+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function Dk(t,n,e,i,o){var r=e[0],a=e[1],s=t[0],l=t[1],u=n[0],A=n[1],h=e[0]-s,f=e[1]-l,p=u-s,d=A-l,m=h*d-f*p;if(o!==null){if(Math.abs(m)>o)return!1}else if(m!==0)return!1;if(i){if(i==="start")return Math.abs(p)>=Math.abs(d)?p>0?s<r&&r<=u:u<=r&&r<s:d>0?l<a&&a<=A:A<=a&&a<l;if(i==="end")return Math.abs(p)>=Math.abs(d)?p>0?s<=r&&r<u:u<r&&r<=s:d>0?l<=a&&a<A:A<a&&a<=l;if(i==="both")return Math.abs(p)>=Math.abs(d)?p>0?s<r&&r<u:u<r&&r<s:d>0?l<a&&a<A:A<a&&a<l}else return Math.abs(p)>=Math.abs(d)?p>0?s<=r&&r<=u:u<=r&&r<=s:d>0?l<=a&&a<=A:A<=a&&a<=l;return!1}function Rk(t,n){var e=Fi(t),i=Fi(n),o=e.type,r=i.type;switch(o){case"Point":switch(r){case"MultiPoint":return Uk(e,i);case"LineString":return Uf(e,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return An(e,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return Ok(e,i);case"LineString":return Lk(e,i);case"Polygon":case"MultiPolygon":return zk(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return kk(e,i);case"Polygon":case"MultiPolygon":return Qk(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Polygon":case"MultiPolygon":return Vk(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function Uk(t,n){var e,i=!1;for(e=0;e<n.coordinates.length;e++)if(K_(n.coordinates[e],t.coordinates)){i=!0;break}return i}function Ok(t,n){for(var e=0;e<t.coordinates.length;e++){for(var i=!1,o=0;o<n.coordinates.length;o++)K_(t.coordinates[e],n.coordinates[o])&&(i=!0);if(!i)return!1}return!0}function Lk(t,n){for(var e=!1,i=0;i<t.coordinates.length;i++){if(!Uf(t.coordinates[i],n))return!1;e||(e=Uf(t.coordinates[i],n,{ignoreEndVertices:!0}))}return e}function zk(t,n){for(var e=!0,i=!1,o=0;o<t.coordinates.length;o++){if(i=An(t.coordinates[1],n),!i){e=!1;break}i=An(t.coordinates[1],n,{ignoreBoundary:!0})}return e&&i}function kk(t,n){for(var e=0;e<t.coordinates.length;e++)if(!Uf(t.coordinates[e],n))return!1;return!0}function Qk(t,n){var e=ts(n),i=ts(t);if(!q_(e,i))return!1;for(var o=!1,r=0;r<t.coordinates.length-1;r++){if(!An(t.coordinates[r],n))return!1;if(o||(o=An(t.coordinates[r],n,{ignoreBoundary:!0})),!o){var a=Nk(t.coordinates[r],t.coordinates[r+1]);o=An(a,n,{ignoreBoundary:!0})}}return o}function Vk(t,n){var e=ts(t),i=ts(n);if(!q_(i,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!An(t.coordinates[0][o],n))return!1;return!0}function q_(t,n){return!(t[0]>n[0]||t[2]<n[2]||t[1]>n[1]||t[3]<n[3])}function K_(t,n){return t[0]===n[0]&&t[1]===n[1]}function Nk(t,n){return[(t[0]+n[0])/2,(t[1]+n[1])/2]}function Z_(t,n,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var i=[],o=t[0],r=t[1],a=t[2],s=t[3],l=n/Mi([o,r],[a,r],e),u=l*(a-o),A=n/Mi([o,r],[o,s],e),h=A*(s-r),f=a-o,p=s-r,d=Math.floor(f/u),m=Math.floor(p/h),v=(f-d*u)/2,y=(p-m*h)/2,g=o+v;g<=a;){for(var _=r+y;_<=s;){var x=Xt([g,_],e.properties);e.mask?Rk(x,e.mask)&&i.push(x):i.push(x),_+=h}g+=u}return Pn(i)}function By(t,n){n===void 0&&(n={});var e=Fi(t);switch(!n.properties&&t.type==="Feature"&&(n.properties=t.properties),e.type){case"Polygon":return Hk(e,n);case"MultiPolygon":return Gk(e,n);default:throw new Error("invalid poly")}}function Hk(t,n){n===void 0&&(n={});var e=Fi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{};return $_(i,o)}function Gk(t,n){n===void 0&&(n={});var e=Fi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{},r=[];return i.forEach(function(a){r.push($_(a,o))}),Pn(r)}function $_(t,n){return t.length>1?fy(t,n):Yn(t[0],n)}var X_=Object.prototype.toString,Y_=function(n){var e=X_.call(n),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&X_.call(n.callee)==="[object Function]"),i},Ty,J_;function Wk(){if(J_)return Ty;J_=1;var t;if(!Object.keys){var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=Y_,o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),a=o.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var p=f.constructor;return p&&p.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},A=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&n.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1}(),h=function(f){if(typeof window>"u"||!A)return l(f);try{return l(f)}catch{return!1}};t=function(p){var d=p!==null&&typeof p=="object",m=e.call(p)==="[object Function]",v=i(p),y=d&&e.call(p)==="[object String]",g=[];if(!d&&!m&&!v)throw new TypeError("Object.keys called on a non-object");var _=a&&m;if(y&&p.length>0&&!n.call(p,0))for(var x=0;x<p.length;++x)g.push(String(x));if(v&&p.length>0)for(var E=0;E<p.length;++E)g.push(String(E));else for(var B in p)!(_&&B==="prototype")&&n.call(p,B)&&g.push(String(B));if(r)for(var P=h(p),I=0;I<s.length;++I)!(P&&s[I]==="constructor")&&n.call(p,s[I])&&g.push(s[I]);return g}}return Ty=t,Ty}var jk=Array.prototype.slice,qk=Y_,eC=Object.keys,Of=eC?function(n){return eC(n)}:Wk(),tC=Object.keys;Of.shim=function(){if(Object.keys){var n=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);n||(Object.keys=function(i){return qk(i)?tC(jk.call(i)):tC(i)})}else Object.keys=Of;return Object.keys||Of};var nC=Of,iC=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var o=42;n[e]=o;for(var r in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var a=Object.getOwnPropertySymbols(n);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(n,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(n,e);if(s.value!==o||s.enumerable!==!0)return!1}return!0},Kk=iC,Iy=function(){return Kk()&&!!Symbol.toStringTag},rC=Object,oC=Error,Zk=EvalError,$k=RangeError,Xk=ReferenceError,sC=SyntaxError,Ea=TypeError,Yk=URIError,Jk=Math.abs,e6=Math.floor,t6=Math.max,n6=Math.min,i6=Math.pow,r6=Math.round,o6=Number.isNaN||function(n){return n!==n},s6=o6,a6=function(n){return s6(n)||n===0?n:n<0?-1:1},l6=Object.getOwnPropertyDescriptor,Lf=l6;if(Lf)try{Lf([],"length")}catch{Lf=null}var Pa=Lf,zf=Object.defineProperty||!1;if(zf)try{zf({},"a",{value:1})}catch{zf=!1}var kf=zf,Fy,aC;function u6(){if(aC)return Fy;aC=1;var t=typeof Symbol<"u"&&Symbol,n=iC;return Fy=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()},Fy}var lC=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,c6=rC,uC=c6.getPrototypeOf||null,h6="Function.prototype.bind called on incompatible ",A6=Object.prototype.toString,f6=Math.max,d6="[object Function]",cC=function(n,e){for(var i=[],o=0;o<n.length;o+=1)i[o]=n[o];for(var r=0;r<e.length;r+=1)i[r+n.length]=e[r];return i},p6=function(n,e){for(var i=[],o=e,r=0;o<n.length;o+=1,r+=1)i[r]=n[o];return i},m6=function(t,n){for(var e="",i=0;i<t.length;i+=1)e+=t[i],i+1<t.length&&(e+=n);return e},g6=function(n){var e=this;if(typeof e!="function"||A6.apply(e)!==d6)throw new TypeError(h6+e);for(var i=p6(arguments,1),o,r=function(){if(this instanceof o){var A=e.apply(this,cC(i,arguments));return Object(A)===A?A:this}return e.apply(n,cC(i,arguments))},a=f6(0,e.length-i.length),s=[],l=0;l<a;l++)s[l]="$"+l;if(o=Function("binder","return function ("+m6(s,",")+"){ return binder.apply(this,arguments); }")(r),e.prototype){var u=function(){};u.prototype=e.prototype,o.prototype=new u,u.prototype=null}return o},y6=g6,uu=Function.prototype.bind||y6,My=Function.prototype.call,Dy=Function.prototype.apply,v6=typeof Reflect<"u"&&Reflect&&Reflect.apply,w6=uu,b6=Dy,x6=My,_6=v6,hC=_6||w6.call(x6,b6),C6=uu,S6=Ea,E6=My,P6=hC,Ry=function(n){if(n.length<1||typeof n[0]!="function")throw new S6("a function is required");return P6(C6,E6,n)},B6=Ry,AC=Pa,fC;try{fC=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Uy=!!fC&&AC&&AC(Object.prototype,"__proto__"),dC=Object,pC=dC.getPrototypeOf,T6=Uy&&typeof Uy.get=="function"?B6([Uy.get]):typeof pC=="function"?function(n){return pC(n==null?n:dC(n))}:!1,mC=lC,gC=uC,yC=T6,vC=mC?function(n){return mC(n)}:gC?function(n){if(!n||typeof n!="object"&&typeof n!="function")throw new TypeError("getProto: not an object");return gC(n)}:yC?function(n){return yC(n)}:null,I6=Function.prototype.call,F6=Object.prototype.hasOwnProperty,M6=uu,wC=M6.call(I6,F6),We,D6=rC,R6=oC,U6=Zk,O6=$k,L6=Xk,Ba=sC,Ta=Ea,z6=Yk,k6=Jk,Q6=e6,V6=t6,N6=n6,H6=i6,G6=r6,W6=a6,bC=Function,Oy=function(t){try{return bC('"use strict"; return ('+t+").constructor;")()}catch{}},cu=Pa,j6=kf,Ly=function(){throw new Ta},q6=cu?function(){try{return arguments.callee,Ly}catch{try{return cu(arguments,"callee").get}catch{return Ly}}}():Ly,Ia=u6()(),Nt=vC,K6=uC,Z6=lC,xC=Dy,hu=My,Fa={},$6=typeof Uint8Array>"u"||!Nt?We:Nt(Uint8Array),ns={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?We:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?We:ArrayBuffer,"%ArrayIteratorPrototype%":Ia&&Nt?Nt([][Symbol.iterator]()):We,"%AsyncFromSyncIteratorPrototype%":We,"%AsyncFunction%":Fa,"%AsyncGenerator%":Fa,"%AsyncGeneratorFunction%":Fa,"%AsyncIteratorPrototype%":Fa,"%Atomics%":typeof Atomics>"u"?We:Atomics,"%BigInt%":typeof BigInt>"u"?We:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?We:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?We:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?We:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":R6,"%eval%":eval,"%EvalError%":U6,"%Float16Array%":typeof Float16Array>"u"?We:Float16Array,"%Float32Array%":typeof Float32Array>"u"?We:Float32Array,"%Float64Array%":typeof Float64Array>"u"?We:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?We:FinalizationRegistry,"%Function%":bC,"%GeneratorFunction%":Fa,"%Int8Array%":typeof Int8Array>"u"?We:Int8Array,"%Int16Array%":typeof Int16Array>"u"?We:Int16Array,"%Int32Array%":typeof Int32Array>"u"?We:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ia&&Nt?Nt(Nt([][Symbol.iterator]())):We,"%JSON%":typeof JSON=="object"?JSON:We,"%Map%":typeof Map>"u"?We:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ia||!Nt?We:Nt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":D6,"%Object.getOwnPropertyDescriptor%":cu,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?We:Promise,"%Proxy%":typeof Proxy>"u"?We:Proxy,"%RangeError%":O6,"%ReferenceError%":L6,"%Reflect%":typeof Reflect>"u"?We:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?We:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ia||!Nt?We:Nt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?We:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ia&&Nt?Nt(""[Symbol.iterator]()):We,"%Symbol%":Ia?Symbol:We,"%SyntaxError%":Ba,"%ThrowTypeError%":q6,"%TypedArray%":$6,"%TypeError%":Ta,"%Uint8Array%":typeof Uint8Array>"u"?We:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?We:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?We:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?We:Uint32Array,"%URIError%":z6,"%WeakMap%":typeof WeakMap>"u"?We:WeakMap,"%WeakRef%":typeof WeakRef>"u"?We:WeakRef,"%WeakSet%":typeof WeakSet>"u"?We:WeakSet,"%Function.prototype.call%":hu,"%Function.prototype.apply%":xC,"%Object.defineProperty%":j6,"%Object.getPrototypeOf%":K6,"%Math.abs%":k6,"%Math.floor%":Q6,"%Math.max%":V6,"%Math.min%":N6,"%Math.pow%":H6,"%Math.round%":G6,"%Math.sign%":W6,"%Reflect.getPrototypeOf%":Z6};if(Nt)try{null.error}catch(t){var X6=Nt(Nt(t));ns["%Error.prototype%"]=X6}var Y6=function t(n){var e;if(n==="%AsyncFunction%")e=Oy("async function () {}");else if(n==="%GeneratorFunction%")e=Oy("function* () {}");else if(n==="%AsyncGeneratorFunction%")e=Oy("async function* () {}");else if(n==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(n==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&Nt&&(e=Nt(o.prototype))}return ns[n]=e,e},_C={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Au=uu,Qf=wC,J6=Au.call(hu,Array.prototype.concat),eQ=Au.call(xC,Array.prototype.splice),CC=Au.call(hu,String.prototype.replace),Vf=Au.call(hu,String.prototype.slice),tQ=Au.call(hu,RegExp.prototype.exec),nQ=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,iQ=/\\(\\)?/g,rQ=function(n){var e=Vf(n,0,1),i=Vf(n,-1);if(e==="%"&&i!=="%")throw new Ba("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new Ba("invalid intrinsic syntax, expected opening `%`");var o=[];return CC(n,nQ,function(r,a,s,l){o[o.length]=s?CC(l,iQ,"$1"):a||r}),o},oQ=function(n,e){var i=n,o;if(Qf(_C,i)&&(o=_C[i],i="%"+o[0]+"%"),Qf(ns,i)){var r=ns[i];if(r===Fa&&(r=Y6(i)),typeof r>"u"&&!e)throw new Ta("intrinsic "+n+" exists, but is not available. Please file an issue!");return{alias:o,name:i,value:r}}throw new Ba("intrinsic "+n+" does not exist!")},SC=function(n,e){if(typeof n!="string"||n.length===0)throw new Ta("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Ta('"allowMissing" argument must be a boolean');if(tQ(/^%?[^%]*%?$/,n)===null)throw new Ba("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=rQ(n),o=i.length>0?i[0]:"",r=oQ("%"+o+"%",e),a=r.name,s=r.value,l=!1,u=r.alias;u&&(o=u[0],eQ(i,J6([0,1],u)));for(var A=1,h=!0;A<i.length;A+=1){var f=i[A],p=Vf(f,0,1),d=Vf(f,-1);if((p==='"'||p==="'"||p==="`"||d==='"'||d==="'"||d==="`")&&p!==d)throw new Ba("property names with quotes must have matching quotes");if((f==="constructor"||!h)&&(l=!0),o+="."+f,a="%"+o+"%",Qf(ns,a))s=ns[a];else if(s!=null){if(!(f in s)){if(!e)throw new Ta("base intrinsic for "+n+" exists, but the property is not available.");return}if(cu&&A+1>=i.length){var m=cu(s,f);h=!!m,h&&"get"in m&&!("originalValue"in m.get)?s=m.get:s=s[f]}else h=Qf(s,f),s=s[f];h&&!l&&(ns[a]=s)}}return s},EC=SC,PC=Ry,sQ=PC([EC("%String.prototype.indexOf%")]),zy=function(n,e){var i=EC(n,!!e);return typeof i=="function"&&sQ(n,".prototype.")>-1?PC([i]):i},aQ=Iy(),lQ=zy,ky=lQ("Object.prototype.toString"),Nf=function(n){return aQ&&n&&typeof n=="object"&&Symbol.toStringTag in n?!1:ky(n)==="[object Arguments]"},BC=function(n){return Nf(n)?!0:n!==null&&typeof n=="object"&&"length"in n&&typeof n.length=="number"&&n.length>=0&&ky(n)!=="[object Array]"&&"callee"in n&&ky(n.callee)==="[object Function]"},uQ=function(){return Nf(arguments)}();Nf.isLegacyArguments=BC;var cQ=uQ?Nf:BC,TC=kf,hQ=sC,Ma=Ea,IC=Pa,Qy=function(n,e,i){if(!n||typeof n!="object"&&typeof n!="function")throw new Ma("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Ma("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ma("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ma("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ma("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ma("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,r=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,l=!!IC&&IC(n,e);if(TC)TC(n,e,{configurable:a===null&&l?l.configurable:!a,enumerable:o===null&&l?l.enumerable:!o,value:i,writable:r===null&&l?l.writable:!r});else if(s||!o&&!r&&!a)n[e]=i;else throw new hQ("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Vy=kf,FC=function(){return!!Vy};FC.hasArrayLengthDefineBug=function(){if(!Vy)return null;try{return Vy([],"length",{value:1}).length!==1}catch{return!0}};var Ny=FC,AQ=nC,fQ=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",dQ=Object.prototype.toString,pQ=Array.prototype.concat,MC=Qy,mQ=function(t){return typeof t=="function"&&dQ.call(t)==="[object Function]"},DC=Ny(),gQ=function(t,n,e,i){if(n in t){if(i===!0){if(t[n]===e)return}else if(!mQ(i)||!i())return}DC?MC(t,n,e,!0):MC(t,n,e)},RC=function(t,n){var e=arguments.length>2?arguments[2]:{},i=AQ(n);fQ&&(i=pQ.call(i,Object.getOwnPropertySymbols(n)));for(var o=0;o<i.length;o+=1)gQ(t,i[o],n[i[o]],e[i[o]])};RC.supportsDescriptors=!!DC;var fu=RC,UC={exports:{}},yQ=SC,OC=Qy,vQ=Ny(),LC=Pa,zC=Ea,wQ=yQ("%Math.floor%"),bQ=function(n,e){if(typeof n!="function")throw new zC("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||wQ(e)!==e)throw new zC("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],o=!0,r=!0;if("length"in n&&LC){var a=LC(n,"length");a&&!a.configurable&&(o=!1),a&&!a.writable&&(r=!1)}return(o||r||!i)&&(vQ?OC(n,"length",e,!0,!0):OC(n,"length",e)),n},xQ=uu,_Q=Dy,CQ=hC,SQ=function(){return CQ(xQ,_Q,arguments)};(function(t){var n=bQ,e=kf,i=Ry,o=SQ;t.exports=function(a){var s=i(arguments),l=a.length-(arguments.length-1);return n(s,1+(l>0?l:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(UC);var kC=UC.exports,QC=function(t){return t!==t},VC=function(n,e){return n===0&&e===0?1/n===1/e:!!(n===e||QC(n)&&QC(e))},EQ=VC,NC=function(){return typeof Object.is=="function"?Object.is:EQ},PQ=NC,BQ=fu,TQ=function(){var n=PQ();return BQ(Object,{is:n},{is:function(){return Object.is!==n}}),n},IQ=fu,FQ=kC,MQ=VC,HC=NC,DQ=TQ,GC=FQ(HC(),Object);IQ(GC,{getPolyfill:HC,implementation:MQ,shim:DQ});var RQ=GC,WC=zy,UQ=Iy(),OQ=wC,LQ=Pa,Hy;if(UQ){var zQ=WC("RegExp.prototype.exec"),jC={},Gy=function(){throw jC},qC={toString:Gy,valueOf:Gy};typeof Symbol.toPrimitive=="symbol"&&(qC[Symbol.toPrimitive]=Gy),Hy=function(n){if(!n||typeof n!="object")return!1;var e=LQ(n,"lastIndex"),i=e&&OQ(e,"value");if(!i)return!1;try{zQ(n,qC)}catch(o){return o===jC}}}else{var kQ=WC("Object.prototype.toString"),QQ="[object RegExp]";Hy=function(n){return!n||typeof n!="object"&&typeof n!="function"?!1:kQ(n)===QQ}}var VQ=Hy,du=function(){return typeof(function(){}).name=="string"},pu=Object.getOwnPropertyDescriptor;if(pu)try{pu([],"length")}catch{pu=null}du.functionsHaveConfigurableNames=function(){if(!du()||!pu)return!1;var n=pu(function(){},"name");return!!n&&!!n.configurable};var NQ=Function.prototype.bind;du.boundFunctionsHaveNames=function(){return du()&&typeof NQ=="function"&&(function(){}).bind().name!==""};var HQ=du,KC=Qy,GQ=Ny(),WQ=HQ.functionsHaveConfigurableNames(),jQ=Ea,qQ=function(n,e){if(typeof n!="function")throw new jQ("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||WQ)&&(GQ?KC(n,"name",e,!0,!0):KC(n,"name",e)),n},KQ=qQ,ZQ=Ea,$Q=Object,ZC=KQ(function(){if(this==null||this!==$Q(this))throw new ZQ("RegExp.prototype.flags getter called on non-object");var n="";return this.hasIndices&&(n+="d"),this.global&&(n+="g"),this.ignoreCase&&(n+="i"),this.multiline&&(n+="m"),this.dotAll&&(n+="s"),this.unicode&&(n+="u"),this.unicodeSets&&(n+="v"),this.sticky&&(n+="y"),n},"get flags",!0),XQ=ZC,YQ=fu.supportsDescriptors,JQ=Object.getOwnPropertyDescriptor,$C=function(){if(YQ&&/a/mig.flags==="gim"){var n=JQ(RegExp.prototype,"flags");if(n&&typeof n.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),n.get.call(i),e==="dy")return n.get}}return XQ},e8=fu.supportsDescriptors,t8=$C,n8=Pa,i8=Object.defineProperty,r8=oC,XC=vC,o8=/a/,s8=function(){if(!e8||!XC)throw new r8("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var n=t8(),e=XC(o8),i=n8(e,"flags");return(!i||i.get!==n)&&i8(e,"flags",{configurable:!0,enumerable:!1,get:n}),n},a8=fu,l8=kC,u8=ZC,YC=$C,c8=s8,JC=l8(YC());a8(JC,{getPolyfill:YC,implementation:u8,shim:c8});var h8=JC,eS=zy,A8=eS("Date.prototype.getDay"),f8=function(n){try{return A8(n),!0}catch{return!1}},d8=eS("Object.prototype.toString"),p8="[object Date]",m8=Iy(),g8=function(n){return typeof n!="object"||n===null?!1:m8?f8(n):d8(n)===p8},tS=nC,nS=cQ,iS=RQ,rS=VQ,oS=h8,sS=g8,aS=Date.prototype.getTime;function lS(t,n,e){var i=e||{};return(i.strict?iS(t,n):t===n)?!0:!t||!n||typeof t!="object"&&typeof n!="object"?i.strict?iS(t,n):t==n:y8(t,n,i)}function uS(t){return t==null}function cS(t){return!(!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number")}function y8(t,n,e){var i,o;if(typeof t!=typeof n||uS(t)||uS(n)||t.prototype!==n.prototype||nS(t)!==nS(n))return!1;var r=rS(t),a=rS(n);if(r!==a)return!1;if(r||a)return t.source===n.source&&oS(t)===oS(n);if(sS(t)&&sS(n))return aS.call(t)===aS.call(n);var s=cS(t),l=cS(n);if(s!==l)return!1;if(s||l){if(t.length!==n.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==n[i])return!1;return!0}if(typeof t!=typeof n)return!1;try{var u=tS(t),A=tS(n)}catch{return!1}if(u.length!==A.length)return!1;for(u.sort(),A.sort(),i=u.length-1;i>=0;i--)if(u[i]!=A[i])return!1;for(i=u.length-1;i>=0;i--)if(o=u[i],!lS(t[o],n[o],e))return!1;return!0}var v8=lS;function w8(t,n){var e=!0;return rr(t,function(i){rr(n,function(o){if(e===!1)return!1;e=b8(i.geometry,o.geometry)})}),e}function b8(t,n){switch(t.type){case"Point":switch(n.type){case"Point":return!S8(t.coordinates,n.coordinates);case"LineString":return!hS(n,t);case"Polygon":return!An(t,n)}break;case"LineString":switch(n.type){case"Point":return!hS(t,n);case"LineString":return!x8(t,n);case"Polygon":return!AS(n,t)}break;case"Polygon":switch(n.type){case"Point":return!An(n,t);case"LineString":return!AS(t,n);case"Polygon":return!_8(n,t)}}return!1}function hS(t,n){for(var e=0;e<t.coordinates.length-1;e++)if(C8(t.coordinates[e],t.coordinates[e+1],n.coordinates))return!0;return!1}function x8(t,n){var e=Py(t,n);return e.features.length>0}function AS(t,n){for(var e=0,i=n.coordinates;e<i.length;e++){var o=i[e];if(An(o,t))return!0}var r=Py(n,By(t));return r.features.length>0}function _8(t,n){for(var e=0,i=t.coordinates[0];e<i.length;e++){var o=i[e];if(An(o,n))return!0}for(var r=0,a=n.coordinates[0];r<a.length;r++){var s=a[r];if(An(s,t))return!0}var l=Py(By(t),By(n));return l.features.length>0}function C8(t,n,e){var i=e[0]-t[0],o=e[1]-t[1],r=n[0]-t[0],a=n[1]-t[1],s=i*a-o*r;return s!==0?!1:Math.abs(r)>=Math.abs(a)?r>0?t[0]<=e[0]&&e[0]<=n[0]:n[0]<=e[0]&&e[0]<=t[0]:a>0?t[1]<=e[1]&&e[1]<=n[1]:n[1]<=e[1]&&e[1]<=t[1]}function S8(t,n){return t[0]===n[0]&&t[1]===n[1]}var E8=v8,Oi=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=t&&t.direction?t.direction:!1,this.pseudoNode=t&&t.pseudoNode?t.pseudoNode:!1,this.objectComparator=t&&t.objectComparator?t.objectComparator:P8};Oi.prototype.compare=function(t,n){if(t.type!==n.type||!dS(t,n))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,n.coordinates);case"LineString":return this.compareLine(t.coordinates,n.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,n);case"Feature":return this.compareFeature(t,n);default:if(t.type.indexOf("Multi")===0){var e=this,i=fS(t),o=fS(n);return i.every(function(r){return this.some(function(a){return e.compare(r,a)})},o)}}return!1};function fS(t){return t.coordinates.map(function(n){return{type:t.type.replace("Multi",""),coordinates:n}})}function dS(t,n){return t.hasOwnProperty("coordinates")?t.coordinates.length===n.coordinates.length:t.length===n.length}Oi.prototype.compareCoord=function(t,n){if(t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(t[e].toFixed(this.precision)!==n[e].toFixed(this.precision))return!1;return!0},Oi.prototype.compareLine=function(t,n,e,i){if(!dS(t,n))return!1;var o=this.pseudoNode?t:this.removePseudo(t),r=this.pseudoNode?n:this.removePseudo(n);if(!(i&&!this.compareCoord(o[0],r[0])&&(r=this.fixStartIndex(r,o),!r))){var a=this.compareCoord(o[e],r[e]);return this.direction||a?this.comparePath(o,r):this.compareCoord(o[e],r[r.length-(1+e)])?this.comparePath(o.slice().reverse(),r):!1}},Oi.prototype.fixStartIndex=function(t,n){for(var e,i=-1,o=0;o<t.length;o++)if(this.compareCoord(t[o],n[0])){i=o;break}return i>=0&&(e=[].concat(t.slice(i,t.length),t.slice(1,i+1))),e},Oi.prototype.comparePath=function(t,n){var e=this;return t.every(function(i,o){return e.compareCoord(i,this[o])},n)},Oi.prototype.comparePolygon=function(t,n){if(this.compareLine(t.coordinates[0],n.coordinates[0],1,!0)){var e=t.coordinates.slice(1,t.coordinates.length),i=n.coordinates.slice(1,n.coordinates.length),o=this;return e.every(function(r){return this.some(function(a){return o.compareLine(r,a,1,!0)})},i)}else return!1},Oi.prototype.compareFeature=function(t,n){return t.id!==n.id||!this.objectComparator(t.properties,n.properties)||!this.compareBBox(t,n)?!1:this.compare(t.geometry,n.geometry)},Oi.prototype.compareBBox=function(t,n){return!!(!t.bbox&&!n.bbox||t.bbox&&n.bbox&&this.compareCoord(t.bbox,n.bbox))},Oi.prototype.removePseudo=function(t){return t};function P8(t,n){return E8(t,n,{strict:!0})}var B8=Oi;const T8=Ml(B8);function I8(t,n){var e=Fi(t).type,i=Fi(n).type;if(e!==i)return!1;var o=new T8({precision:6});return o.compare(D_(t),D_(n))}function F8(t,n){var e=!1;return rr(t,function(i){rr(n,function(o){if(e===!0)return!0;e=!w8(i.geometry,o.geometry)})}),e}/**
|
|
3710
3710
|
* splaytree v3.1.2
|
|
3711
3711
|
* Fast Splay tree for Node and browser
|
|
3712
3712
|
*
|
|
@@ -3727,7 +3727,7 @@ function (result, this, instanceIndex, frameState) {
|
|
|
3727
3727
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
3728
3728
|
and limitations under the License.
|
|
3729
3729
|
***************************************************************************** */function M8(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(A){return l([u,A])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,o&&(r=u[0]&2?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,o=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){e.label=u[1];break}if(u[0]===6&&e.label<r[1]){e.label=r[1],r=u;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(u);break}r[2]&&e.ops.pop(),e.trys.pop();continue}u=n.call(t,e)}catch(A){u=[6,A],o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var eo=function(){function t(n,e){this.next=null,this.key=n,this.data=e,this.left=null,this.right=null}return t}();function D8(t,n){return t>n?1:t<n?-1:0}function to(t,n,e){for(var i=new eo(null,null),o=i,r=i;;){var a=e(t,n.key);if(a<0){if(n.left===null)break;if(e(t,n.left.key)<0){var s=n.left;if(n.left=s.right,s.right=n,n=s,n.left===null)break}r.left=n,r=n,n=n.left}else if(a>0){if(n.right===null)break;if(e(t,n.right.key)>0){var s=n.right;if(n.right=s.left,s.left=n,n=s,n.right===null)break}o.right=n,o=n,n=n.right}else break}return o.right=n.left,r.left=n.right,n.left=i.right,n.right=i.left,n}function Wy(t,n,e,i){var o=new eo(t,n);if(e===null)return o.left=o.right=null,o;e=to(t,e,i);var r=i(t,e.key);return r<0?(o.left=e.left,o.right=e,e.left=null):r>=0&&(o.right=e.right,o.left=e,e.right=null),o}function pS(t,n,e){var i=null,o=null;if(n){n=to(t,n,e);var r=e(n.key,t);r===0?(i=n.left,o=n.right):r<0?(o=n.right,n.right=null,i=n):(i=n.left,n.left=null,o=n)}return{left:i,right:o}}function R8(t,n,e){return n===null?t:(t===null||(n=to(t.key,n,e),n.left=t),n)}function jy(t,n,e,i,o){if(t){i(""+n+(e?"└── ":"├── ")+o(t)+`
|
|
3730
|
-
`);var r=n+(e?" ":"│ ");t.left&&jy(t.left,r,!1,i,o),t.right&&jy(t.right,r,!0,i,o)}}var qy=function(){function t(n){n===void 0&&(n=D8),this._root=null,this._size=0,this._comparator=n}return t.prototype.insert=function(n,e){return this._size++,this._root=Wy(n,e,this._root,this._comparator)},t.prototype.add=function(n,e){var i=new eo(n,e);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,r=to(n,this._root,o),a=o(n,r.key);return a===0?this._root=r:(a<0?(i.left=r.left,i.right=r,r.left=null):a>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(n){this._root=this._remove(n,this._root,this._comparator)},t.prototype._remove=function(n,e,i){var o;if(e===null)return null;e=to(n,e,i);var r=i(n,e.key);return r===0?(e.left===null?o=e.right:(o=to(n,e.left,i),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var n=this._root;if(n){for(;n.left;)n=n.left;return this._root=to(n.key,this._root,this._comparator),this._root=this._remove(n.key,this._root,this._comparator),{key:n.key,data:n.data}}return null},t.prototype.findStatic=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(n){return this._root&&(this._root=to(n,this._root,this._comparator),this._comparator(n,this._root.key)!==0)?null:this._root},t.prototype.contains=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(n,e){for(var i=this._root,o=[],r=!1;!r;)i!==null?(o.push(i),i=i.left):o.length!==0?(i=o.pop(),n.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(n,e,i,o){for(var r=[],a=this._comparator,s=this._root,l;r.length!==0||s;)if(s)r.push(s),s=s.left;else{if(s=r.pop(),l=a(s.key,e),l>0)break;if(a(s.key,n)>=0&&i.call(o,s))return this;s=s.right}return this},t.prototype.keys=function(){var n=[];return this.forEach(function(e){var i=e.key;return n.push(i)}),n},t.prototype.values=function(){var n=[];return this.forEach(function(e){var i=e.data;return n.push(i)}),n},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.left;)n=n.left;return n},t.prototype.maxNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.right;)n=n.right;return n},t.prototype.at=function(n){for(var e=this._root,i=!1,o=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),o===n)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(n){var e=this._root,i=null;if(n.right){for(i=n.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(n){var e=this._root,i=null;if(n.left!==null){for(i=n.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return O8(this._root)},t.prototype.load=function(n,e,i){e===void 0&&(e=[]),i===void 0&&(i=!1);var o=n.length,r=this._comparator;if(i&&$y(n,e,0,o-1,r),this._root===null)this._root=Ky(n,e,0,o),this._size=o;else{var a=L8(this.toList(),U8(n,e),r);o=this._size+o,this._root=Zy({head:a},0,o)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(n){n===void 0&&(n=function(i){return String(i.key)});var e=[];return jy(this._root,"",!0,function(i){return e.push(i)},n),e.join("")},t.prototype.update=function(n,e,i){var o=this._comparator,r=pS(n,this._root,o),a=r.left,s=r.right;o(n,e)<0?s=Wy(e,i,s,o):a=Wy(e,i,a,o),this._root=R8(a,s,o)},t.prototype.split=function(n){return pS(n,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var n,e,i;return M8(this,function(o){switch(o.label){case 0:n=this._root,e=[],i=!1,o.label=1;case 1:return i?[3,6]:n===null?[3,2]:(e.push(n),n=n.left,[3,5]);case 2:return e.length===0?[3,4]:(n=e.pop(),[4,n]);case 3:return o.sent(),n=n.right,[3,5];case 4:i=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function Ky(t,n,e,i){var o=i-e;if(o>0){var r=e+Math.floor(o/2),a=t[r],s=n[r],l=new eo(a,s);return l.left=Ky(t,n,e,r),l.right=Ky(t,n,r+1,i),l}return null}function U8(t,n){for(var e=new eo(null,null),i=e,o=0;o<t.length;o++)i=i.next=new eo(t[o],n[o]);return i.next=null,e.next}function O8(t){for(var n=t,e=[],i=!1,o=new eo(null,null),r=o;!i;)n?(e.push(n),n=n.left):e.length>0?(n=r=r.next=e.pop(),n=n.right):i=!0;return r.next=null,o.next}function Zy(t,n,e){var i=e-n;if(i>0){var o=n+Math.floor(i/2),r=Zy(t,n,o),a=t.head;return a.left=r,t.head=t.head.next,a.right=Zy(t,o+1,e),a}return null}function L8(t,n,e){for(var i=new eo(null,null),o=i,r=t,a=n;r!==null&&a!==null;)e(r.key,a.key)<0?(o.next=r,r=r.next):(o.next=a,a=a.next),o=o.next;return r!==null?o.next=r:a!==null&&(o.next=a),i.next}function $y(t,n,e,i,o){if(!(e>=i)){for(var r=t[e+i>>1],a=e-1,s=i+1;;){do a++;while(o(t[a],r)<0);do s--;while(o(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=n[a],n[a]=n[s],n[s]=l}$y(t,n,e,s,o),$y(t,n,s+1,i,o)}}const ar=11102230246251565e-32,un=134217729,z8=(3+8*ar)*ar;function Xy(t,n,e,i,o){let r,a,s,l,u=n[0],A=i[0],h=0,f=0;A>u==A>-u?(r=u,u=n[++h]):(r=A,A=i[++f]);let p=0;if(h<t&&f<e)for(A>u==A>-u?(a=u+r,s=r-(a-u),u=n[++h]):(a=A+r,s=r-(a-A),A=i[++f]),r=a,s!==0&&(o[p++]=s);h<t&&f<e;)A>u==A>-u?(a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++h]):(a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f]),r=a,s!==0&&(o[p++]=s);for(;h<t;)a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++h],r=a,s!==0&&(o[p++]=s);for(;f<e;)a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f],r=a,s!==0&&(o[p++]=s);return(r!==0||p===0)&&(o[p++]=r),p}function k8(t,n){let e=n[0];for(let i=1;i<t;i++)e+=n[i];return e}function mu(t){return new Float64Array(t)}const Q8=(3+16*ar)*ar,V8=(2+12*ar)*ar,N8=(9+64*ar)*ar*ar,Da=mu(4),mS=mu(8),gS=mu(12),yS=mu(16),fn=mu(4);function H8(t,n,e,i,o,r,a){let s,l,u,A,h,f,p,d,m,v,y,g,_,x,E,B,P,I;const D=t-o,F=e-o,S=n-r,T=i-r;x=D*T,f=un*D,p=f-(f-D),d=D-p,f=un*T,m=f-(f-T),v=T-m,E=d*v-(x-p*m-d*m-p*v),B=S*F,f=un*S,p=f-(f-S),d=S-p,f=un*F,m=f-(f-F),v=F-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,Da[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,Da[1]=_-(y+h)+(h-B),I=g+y,h=I-g,Da[2]=g-(I-h)+(y-h),Da[3]=I;let w=k8(4,Da),C=V8*a;if(w>=C||-w>=C||(h=t-D,s=t-(D+h)+(h-o),h=e-F,u=e-(F+h)+(h-o),h=n-S,l=n-(S+h)+(h-r),h=i-T,A=i-(T+h)+(h-r),s===0&&l===0&&u===0&&A===0)||(C=N8*a+z8*Math.abs(w),w+=D*A+T*s-(S*u+F*l),w>=C||-w>=C))return w;x=s*T,f=un*s,p=f-(f-s),d=s-p,f=un*T,m=f-(f-T),v=T-m,E=d*v-(x-p*m-d*m-p*v),B=l*F,f=un*l,p=f-(f-l),d=l-p,f=un*F,m=f-(f-F),v=F-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,fn[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,fn[1]=_-(y+h)+(h-B),I=g+y,h=I-g,fn[2]=g-(I-h)+(y-h),fn[3]=I;const M=Xy(4,Da,4,fn,mS);x=D*A,f=un*D,p=f-(f-D),d=D-p,f=un*A,m=f-(f-A),v=A-m,E=d*v-(x-p*m-d*m-p*v),B=S*u,f=un*S,p=f-(f-S),d=S-p,f=un*u,m=f-(f-u),v=u-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,fn[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,fn[1]=_-(y+h)+(h-B),I=g+y,h=I-g,fn[2]=g-(I-h)+(y-h),fn[3]=I;const R=Xy(M,mS,4,fn,gS);x=s*A,f=un*s,p=f-(f-s),d=s-p,f=un*A,m=f-(f-A),v=A-m,E=d*v-(x-p*m-d*m-p*v),B=l*u,f=un*l,p=f-(f-l),d=l-p,f=un*u,m=f-(f-u),v=u-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,fn[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,fn[1]=_-(y+h)+(h-B),I=g+y,h=I-g,fn[2]=g-(I-h)+(y-h),fn[3]=I;const U=Xy(R,gS,4,fn,yS);return yS[U-1]}function gu(t,n,e,i,o,r){const a=(n-r)*(e-o),s=(t-o)*(i-r),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=Q8*u?l:-H8(t,n,e,i,o,r,u)}const yu=(t,n)=>t.ll.x<=n.x&&n.x<=t.ur.x&&t.ll.y<=n.y&&n.y<=t.ur.y,Yy=(t,n)=>{if(n.ur.x<t.ll.x||t.ur.x<n.ll.x||n.ur.y<t.ll.y||t.ur.y<n.ll.y)return null;const e=t.ll.x<n.ll.x?n.ll.x:t.ll.x,i=t.ur.x<n.ur.x?t.ur.x:n.ur.x,o=t.ll.y<n.ll.y?n.ll.y:t.ll.y,r=t.ur.y<n.ur.y?t.ur.y:n.ur.y;return{ll:{x:e,y:o},ur:{x:i,y:r}}};let no=Number.EPSILON;no===void 0&&(no=Math.pow(2,-52));const G8=no*no,vS=(t,n)=>{if(-no<t&&t<no&&-no<n&&n<no)return 0;const e=t-n;return e*e<G8*t*n?0:t<n?-1:1};class W8{constructor(){this.reset()}reset(){this.xRounder=new wS,this.yRounder=new wS}round(n,e){return{x:this.xRounder.round(n),y:this.yRounder.round(e)}}}class wS{constructor(){this.tree=new qy,this.round(0)}round(n){const e=this.tree.add(n),i=this.tree.prev(e);if(i!==null&&vS(e.key,i.key)===0)return this.tree.remove(n),i.key;const o=this.tree.next(e);return o!==null&&vS(e.key,o.key)===0?(this.tree.remove(n),o.key):n}}const vu=new W8,Hf=(t,n)=>t.x*n.y-t.y*n.x,bS=(t,n)=>t.x*n.x+t.y*n.y,xS=(t,n,e)=>{const i=gu(t.x,t.y,n.x,n.y,e.x,e.y);return i>0?-1:i<0?1:0},Gf=t=>Math.sqrt(bS(t,t)),j8=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return Hf(o,i)/Gf(o)/Gf(i)},q8=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return bS(o,i)/Gf(o)/Gf(i)},_S=(t,n,e)=>n.y===0?null:{x:t.x+n.x/n.y*(e-t.y),y:e},CS=(t,n,e)=>n.x===0?null:{x:e,y:t.y+n.y/n.x*(e-t.x)},K8=(t,n,e,i)=>{if(n.x===0)return CS(e,i,t.x);if(i.x===0)return CS(t,n,e.x);if(n.y===0)return _S(e,i,t.y);if(i.y===0)return _S(t,n,e.y);const o=Hf(n,i);if(o==0)return null;const r={x:e.x-t.x,y:e.y-t.y},a=Hf(r,n)/o,s=Hf(r,i)/o,l=t.x+s*n.x,u=e.x+a*i.x,A=t.y+s*n.y,h=e.y+a*i.y,f=(l+u)/2,p=(A+h)/2;return{x:f,y:p}};class Jn{static compare(n,e){const i=Jn.comparePoints(n.point,e.point);return i!==0?i:(n.point!==e.point&&n.link(e),n.isLeft!==e.isLeft?n.isLeft?1:-1:io.compare(n.segment,e.segment))}static comparePoints(n,e){return n.x<e.x?-1:n.x>e.x?1:n.y<e.y?-1:n.y>e.y?1:0}constructor(n,e){n.events===void 0?n.events=[this]:n.events.push(this),this.point=n,this.isLeft=e}link(n){if(n.point===this.point)throw new Error("Tried to link already linked events");const e=n.point.events;for(let i=0,o=e.length;i<o;i++){const r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}checkForConsuming(){const n=this.point.events.length;for(let e=0;e<n;e++){const i=this.point.events[e];if(i.segment.consumedBy===void 0)for(let o=e+1;o<n;o++){const r=this.point.events[o];r.consumedBy===void 0&&i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment)}}}getAvailableLinkedEvents(){const n=[];for(let e=0,i=this.point.events.length;e<i;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&n.push(o)}return n}getLeftmostComparator(n){const e=new Map,i=o=>{const r=o.otherSE;e.set(o,{sine:j8(this.point,n.point,r.point),cosine:q8(this.point,n.point,r.point)})};return(o,r)=>{e.has(o)||i(o),e.has(r)||i(r);const{sine:a,cosine:s}=e.get(o),{sine:l,cosine:u}=e.get(r);return a>=0&&l>=0?s<u?1:s>u?-1:0:a<0&&l<0?s<u?-1:s>u?1:0:l<a?-1:l>a?1:0}}}let Z8=0;class io{static compare(n,e){const i=n.leftSE.point.x,o=e.leftSE.point.x,r=n.rightSE.point.x,a=e.rightSE.point.x;if(a<i)return 1;if(r<o)return-1;const s=n.leftSE.point.y,l=e.leftSE.point.y,u=n.rightSE.point.y,A=e.rightSE.point.y;if(i<o){if(l<s&&l<u)return 1;if(l>s&&l>u)return-1;const h=n.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;const f=e.comparePoint(n.rightSE.point);return f!==0?f:-1}if(i>o){if(s<l&&s<A)return-1;if(s>l&&s>A)return 1;const h=e.comparePoint(n.leftSE.point);if(h!==0)return h;const f=n.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(s<l)return-1;if(s>l)return 1;if(r<a){const h=e.comparePoint(n.rightSE.point);if(h!==0)return h}if(r>a){const h=n.comparePoint(e.rightSE.point);if(h<0)return 1;if(h>0)return-1}if(r!==a){const h=u-s,f=r-i,p=A-l,d=a-o;if(h>f&&p<d)return 1;if(h<f&&p>d)return-1}return r>a?1:r<a||u<A?-1:u>A?1:n.id<e.id?-1:n.id>e.id?1:0}constructor(n,e,i,o){this.id=++Z8,this.leftSE=n,n.segment=this,n.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=n,this.rings=i,this.windings=o}static fromRing(n,e,i){let o,r,a;const s=Jn.comparePoints(n,e);if(s<0)o=n,r=e,a=1;else if(s>0)o=e,r=n,a=-1;else throw new Error(`Tried to create degenerate segment at [${n.x}, ${n.y}]`);const l=new Jn(o,!0),u=new Jn(r,!1);return new io(l,u,[i],[a])}replaceRightSE(n){this.rightSE=n,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const n=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:n<e?n:e},ur:{x:this.rightSE.point.x,y:n>e?n:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(n){return n.x===this.leftSE.point.x&&n.y===this.leftSE.point.y||n.x===this.rightSE.point.x&&n.y===this.rightSE.point.y}comparePoint(n){if(this.isAnEndpoint(n))return 0;const e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return n.x===e.x?0:n.x<e.x?1:-1;const r=(n.y-e.y)/o.y,a=e.x+r*o.x;if(n.x===a)return 0;const s=(n.x-e.x)/o.x,l=e.y+s*o.y;return n.y===l?0:n.y<l?-1:1}getIntersection(n){const e=this.bbox(),i=n.bbox(),o=Yy(e,i);if(o===null)return null;const r=this.leftSE.point,a=this.rightSE.point,s=n.leftSE.point,l=n.rightSE.point,u=yu(e,s)&&this.comparePoint(s)===0,A=yu(i,r)&&n.comparePoint(r)===0,h=yu(e,l)&&this.comparePoint(l)===0,f=yu(i,a)&&n.comparePoint(a)===0;if(A&&u)return f&&!h?a:!f&&h?l:null;if(A)return h&&r.x===l.x&&r.y===l.y?null:r;if(u)return f&&a.x===s.x&&a.y===s.y?null:s;if(f&&h)return null;if(f)return a;if(h)return l;const p=K8(r,this.vector(),s,n.vector());return p===null||!yu(o,p)?null:vu.round(p.x,p.y)}split(n){const e=[],i=n.events!==void 0,o=new Jn(n,!0),r=new Jn(n,!1),a=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(o);const s=new io(o,a,this.rings.slice(),this.windings.slice());return Jn.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Jn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),r.checkForConsuming()),e}swapEvents(){const n=this.rightSE;this.rightSE=this.leftSE,this.leftSE=n,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}consume(n){let e=this,i=n;for(;e.consumedBy;)e=e.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const o=io.compare(e,i);if(o!==0){if(o>0){const r=e;e=i,i=r}if(e.prev===i){const r=e;e=i,i=r}for(let r=0,a=i.rings.length;r<a;r++){const s=i.rings[r],l=i.windings[r],u=e.rings.indexOf(s);u===-1?(e.rings.push(s),e.windings.push(l)):e.windings[u]+=l}i.rings=null,i.windings=null,i.consumedBy=e,i.leftSE.consumedBy=e.leftSE,i.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const n=this.prev.consumedBy||this.prev;this._beforeState=n.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const n=this.beforeState();this._afterState={rings:n.rings.slice(0),windings:n.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){const u=this.rings[s],A=this.windings[s],h=e.indexOf(u);h===-1?(e.push(u),i.push(A)):i[h]+=A}const r=[],a=[];for(let s=0,l=e.length;s<l;s++){if(i[s]===0)continue;const u=e[s],A=u.poly;if(a.indexOf(A)===-1)if(u.isExterior)r.push(A);else{a.indexOf(A)===-1&&a.push(A);const h=r.indexOf(u.poly);h!==-1&&r.splice(h,1)}}for(let s=0,l=r.length;s<l;s++){const u=r[s].multiPoly;o.indexOf(u)===-1&&o.push(u)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const n=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(fi.type){case"union":{const i=n.length===0,o=e.length===0;this._isInResult=i!==o;break}case"intersection":{let i,o;n.length<e.length?(i=n.length,o=e.length):(i=e.length,o=n.length),this._isInResult=o===fi.numMultiPolys&&i<o;break}case"xor":{const i=Math.abs(n.length-e.length);this._isInResult=i%2===1;break}case"difference":{const i=o=>o.length===1&&o[0].isSubject;this._isInResult=i(n)!==i(e);break}default:throw new Error(`Unrecognized operation type found ${fi.type}`)}return this._isInResult}}class SS{constructor(n,e,i){if(!Array.isArray(n)||n.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=i,this.segments=[],typeof n[0][0]!="number"||typeof n[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=vu.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let r=o;for(let a=1,s=n.length;a<s;a++){if(typeof n[a][0]!="number"||typeof n[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=vu.round(n[a][0],n[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(io.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}(o.x!==r.x||o.y!==r.y)&&this.segments.push(io.fromRing(r,o,this))}getSweepEvents(){const n=[];for(let e=0,i=this.segments.length;e<i;e++){const o=this.segments[e];n.push(o.leftSE),n.push(o.rightSE)}return n}}class $8{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new SS(n[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let i=1,o=n.length;i<o;i++){const r=new SS(n[i],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const n=this.exteriorRing.getSweepEvents();for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class ES{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof n[0][0][0]=="number"&&(n=[n])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let i=0,o=n.length;i<o;i++){const r=new $8(n[i],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class Wf{static factory(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.isInResult()||r.ringOut)continue;let a=null,s=r.leftSE,l=r.rightSE;const u=[s],A=s.point,h=[];for(;a=s,s=l,u.push(s),s.point!==A;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const m=u[0].point,v=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${m.x}, ${m.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(f.length===1){l=f[0].otherSE;break}let p=null;for(let m=0,v=h.length;m<v;m++)if(h[m].point===s.point){p=m;break}if(p!==null){const m=h.splice(p)[0],v=u.splice(m.index);v.unshift(v[0].otherSE),e.push(new Wf(v.reverse()));continue}h.push({index:u.length,point:s.point});const d=s.getLeftmostComparator(a);l=f.sort(d)[0].otherSE;break}e.push(new Wf(u))}return e}constructor(n){this.events=n;for(let e=0,i=n.length;e<i;e++)n[e].segment.ringOut=this;this.poly=null}getGeom(){let n=this.events[0].point;const e=[n];for(let u=1,A=this.events.length-1;u<A;u++){const h=this.events[u].point,f=this.events[u+1].point;xS(h,n,f)!==0&&(e.push(h),n=h)}if(e.length===1)return null;const i=e[0],o=e[1];xS(i,n,o)===0&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,l=[];for(let u=a;u!=s;u+=r)l.push([e[u].x,e[u].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){const n=this.enclosingRing();this._isExteriorRing=n?!n.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let n=this.events[0];for(let o=1,r=this.events.length;o<r;o++){const a=this.events[o];Jn.compare(n,a)>0&&(n=a)}let e=n.segment.prevInResult(),i=e?e.prevInResult():null;for(;;){if(!e)return null;if(!i)return e.ringOut;if(i.ringOut!==e.ringOut)return i.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=i.prevInResult(),i=e?e.prevInResult():null}}}class PS{constructor(n){this.exteriorRing=n,n.poly=this,this.interiorRings=[]}addInterior(n){this.interiorRings.push(n),n.poly=this}getGeom(){const n=[this.exteriorRing.getGeom()];if(n[0]===null)return null;for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getGeom();o!==null&&n.push(o)}return n}}class X8{constructor(n){this.rings=n,this.polys=this._composePolys(n)}getGeom(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getGeom();o!==null&&n.push(o)}return n}_composePolys(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.poly)if(r.isExteriorRing())e.push(new PS(r));else{const a=r.enclosingRing();a.poly||e.push(new PS(a)),a.poly.addInterior(r)}}return e}}class Y8{constructor(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:io.compare;this.queue=n,this.tree=new qy(e),this.segments=[]}process(n){const e=n.segment,i=[];if(n.consumedBy)return n.isLeft?this.queue.remove(n.otherSE):this.tree.remove(e),i;const o=n.isLeft?this.tree.add(e):this.tree.find(e);if(!o)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let r=o,a=o,s,l;for(;s===void 0;)r=this.tree.prev(r),r===null?s=null:r.key.consumedBy===void 0&&(s=r.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(n.isLeft){let u=null;if(s){const h=s.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(u=h),!s.isAnEndpoint(h))){const f=this._splitSafely(s,h);for(let p=0,d=f.length;p<d;p++)i.push(f[p])}}let A=null;if(l){const h=l.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(A=h),!l.isAnEndpoint(h))){const f=this._splitSafely(l,h);for(let p=0,d=f.length;p<d;p++)i.push(f[p])}}if(u!==null||A!==null){let h=null;u===null?h=A:A===null?h=u:h=Jn.comparePoints(u,A)<=0?u:A,this.queue.remove(e.rightSE),i.push(e.rightSE);const f=e.split(h);for(let p=0,d=f.length;p<d;p++)i.push(f[p])}i.length>0?(this.tree.remove(e),i.push(n)):(this.segments.push(e),e.prev=s)}else{if(s&&l){const u=s.getIntersection(l);if(u!==null){if(!s.isAnEndpoint(u)){const A=this._splitSafely(s,u);for(let h=0,f=A.length;h<f;h++)i.push(A[h])}if(!l.isAnEndpoint(u)){const A=this._splitSafely(l,u);for(let h=0,f=A.length;h<f;h++)i.push(A[h])}}}this.tree.remove(e)}return i}_splitSafely(n,e){this.tree.remove(n);const i=n.rightSE;this.queue.remove(i);const o=n.split(e);return o.push(i),n.consumedBy===void 0&&this.tree.add(n),o}}const BS=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,J8=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class eV{run(n,e,i){fi.type=n,vu.reset();const o=[new ES(e,!0)];for(let h=0,f=i.length;h<f;h++)o.push(new ES(i[h],!1));if(fi.numMultiPolys=o.length,fi.type==="difference"){const h=o[0];let f=1;for(;f<o.length;)Yy(o[f].bbox,h.bbox)!==null?f++:o.splice(f,1)}if(fi.type==="intersection")for(let h=0,f=o.length;h<f;h++){const p=o[h];for(let d=h+1,m=o.length;d<m;d++)if(Yy(p.bbox,o[d].bbox)===null)return[]}const r=new qy(Jn.compare);for(let h=0,f=o.length;h<f;h++){const p=o[h].getSweepEvents();for(let d=0,m=p.length;d<m;d++)if(r.insert(p[d]),r.size>BS)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const a=new Y8(r);let s=r.size,l=r.pop();for(;l;){const h=l.key;if(r.size===s){const p=h.segment;throw new Error(`Unable to pop() ${h.isLeft?"left":"right"} SweepEvent [${h.point.x}, ${h.point.y}] from segment #${p.id} [${p.leftSE.point.x}, ${p.leftSE.point.y}] -> [${p.rightSE.point.x}, ${p.rightSE.point.y}] from queue.`)}if(r.size>BS)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>J8)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=a.process(h);for(let p=0,d=f.length;p<d;p++){const m=f[p];m.consumedBy===void 0&&r.insert(m)}s=r.size,l=r.pop()}vu.reset();const u=Wf.factory(a.segments);return new X8(u).getGeom()}}const fi=new eV;var tV={union:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("union",t,e)},intersection:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("intersection",t,e)},xor:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("xor",t,e)},difference:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("difference",t,e)}};function jf(t,n,e){e===void 0&&(e={});var i=Fi(t),o=Fi(n),r=tV.intersection(i.coordinates,o.coordinates);return r.length===0?null:r.length===1?Vt(r[0],e.properties):dy(r,e.properties)}function nV(t,n,e){e===void 0&&(e={});var i=JSON.stringify(e.properties||{}),o=t[0],r=t[1],a=t[2],s=t[3],l=(r+s)/2,u=(o+a)/2,A=n*2/Mi([o,l],[a,l],e),h=A*(a-o),f=n*2/Mi([u,r],[u,s],e),p=f*(s-r),d=h/2,m=d*2,v=Math.sqrt(3)/2*p,y=a-o,g=s-r,_=3/4*m,x=v,E=(y-m)/(m-d/2),B=Math.floor(E),P=(B*_-d/2-y)/2-d/2+_/2,I=Math.floor((g-v)/v),D=(g-I*v)/2,F=I*v-g>v/2;F&&(D-=v/4);for(var S=[],T=[],w=0;w<6;w++){var C=2*Math.PI/6*w;S.push(Math.cos(C)),T.push(Math.sin(C))}for(var M=[],R=0;R<=B;R++)for(var U=0;U<=I;U++){var O=R%2===1;if(!(U===0&&O)&&!(U===0&&F)){var z=R*_+o-P,k=U*x+r+D;if(O&&(k-=v/2),e.triangles===!0)rV([z,k],h/2,p/2,JSON.parse(i),S,T).forEach(function(V){e.mask?jf(e.mask,V)&&M.push(V):M.push(V)});else{var Q=iV([z,k],h/2,p/2,JSON.parse(i),S,T);e.mask?jf(e.mask,Q)&&M.push(Q):M.push(Q)}}}return Pn(M)}function iV(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=t[0]+n*o[s],u=t[1]+e*r[s];a.push([l,u])}return a.push(a[0].slice()),Vt([a],i)}function rV(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=[];l.push(t),l.push([t[0]+n*o[s],t[1]+e*r[s]]),l.push([t[0]+n*o[(s+1)%6],t[1]+e*r[(s+1)%6]]),l.push(t),a.push(Vt([l],i))}return a}function oV(t,n,e,i){i===void 0&&(i={});for(var o=[],r=t[0],a=t[1],s=t[2],l=t[3],u=n/Mi([r,a],[s,a],i),A=u*(s-r),h=e/Mi([r,a],[r,l],i),f=h*(l-a),p=s-r,d=l-a,m=Math.floor(p/A),v=Math.floor(d/f),y=(p-m*A)/2,g=(d-v*f)/2,_=r+y,x=0;x<m;x++){for(var E=a+g,B=0;B<v;B++){var P=Vt([[[_,E],[_,E+f],[_+A,E+f],[_+A,E],[_,E]]],i.properties);i.mask?F8(i.mask,P)&&o.push(P):o.push(P),E+=f}_+=A}return Pn(o)}function sV(t,n,e){return e===void 0&&(e={}),oV(t,n,n,e)}function aV(t,n,e){e===void 0&&(e={});for(var i=[],o=n/Mi([t[0],t[1]],[t[2],t[1]],e),r=o*(t[2]-t[0]),a=n/Mi([t[0],t[1]],[t[0],t[3]],e),s=a*(t[3]-t[1]),l=0,u=t[0];u<=t[2];){for(var A=0,h=t[1];h<=t[3];){var f=null,p=null;l%2===0&&A%2===0?(f=Vt([[[u,h],[u,h+s],[u+r,h],[u,h]]],e.properties),p=Vt([[[u,h+s],[u+r,h+s],[u+r,h],[u,h+s]]],e.properties)):l%2===0&&A%2===1?(f=Vt([[[u,h],[u+r,h+s],[u+r,h],[u,h]]],e.properties),p=Vt([[[u,h],[u,h+s],[u+r,h+s],[u,h]]],e.properties)):A%2===0&&l%2===1?(f=Vt([[[u,h],[u,h+s],[u+r,h+s],[u,h]]],e.properties),p=Vt([[[u,h],[u+r,h+s],[u+r,h],[u,h]]],e.properties)):A%2===1&&l%2===1&&(f=Vt([[[u,h],[u,h+s],[u+r,h],[u,h]]],e.properties),p=Vt([[[u,h+s],[u+r,h+s],[u+r,h],[u,h+s]]],e.properties)),e.mask?(jf(e.mask,f)&&i.push(f),jf(e.mask,p)&&i.push(p)):(i.push(f),i.push(p)),h+=s,A++}l++,u+=r}return Pn(i)}function lV(t,n,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var i=e.gridType,o=e.property,r=e.weight;if(!t)throw new Error("points is required");if(Bz(t,"Point","input must contain Points"),!n)throw new Error("cellSize is required");if(r!==void 0&&typeof r!="number")throw new Error("weight must be a number");o=o||"elevation",i=i||"square",r=r||1;var a=ts(t),s;switch(i){case"point":case"points":s=Z_(a,n,e);break;case"square":case"squares":s=sV(a,n,e);break;case"hex":case"hexes":s=nV(a,n,e);break;case"triangle":case"triangles":s=aV(a,n,e);break;default:throw new Error("invalid gridType")}var l=[];return wa(s,function(u){var A=0,h=0;wa(t,function(p){var d=i==="point"?u:f6(u),m=Mi(d,p,e),v;if(o!==void 0&&(v=p.properties[o]),v===void 0&&(v=p.geometry.coordinates[2]),v===void 0)throw new Error("zValue is missing");m===0&&(A=v);var y=1/Math.pow(m,r);h+=y,A+=y*v});var f=h6(u);f.properties[o]=A/h,l.push(f)}),Pn(l)}function uV(t,n,e){const i=b.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=b.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=b.Cartesian3.subtract(o,i,new b.Cartesian3);b.Cartesian3.normalize(r,r);const a=new b.Ray(i,r),s=e.pickFromRay(a);return!!(e.globe.pick(a,e)||s)}const TS=(t=0)=>new Promise(n=>setTimeout(n,t));function cV(t,n){const e=Pn(t.map(l=>Xt(l))),i=Vt([t]);return lV(e,n,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates).filter(l=>An(Xt(l),i))}function hV(t){const n=b.JulianDate.fromDate(t),e=b.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(n);return Ya(e)}function AV(t,n,e){const i=t[0]+(n[0]-t[0])*e,o=t[1]+(n[1]-t[1])*e,r=t[2]+(n[2]-t[2])*e,a=t[3]+(n[3]-t[3])*e;return[i,o,r,a]}const Gc=class Gc extends Ln{constructor(e,i){super(e,i);L(this,"czmPointPrimitiveCollection");L(this,"_stopRun",!1);const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Uo(i,e.id));this.czmPointPrimitiveCollection=r,this.d(c.track([r,"show"],[e,"show"]));{const a=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){r.pointPrimitiveOptions=void 0;return}const u=[...e.points,e.points[0]],A=e.sampleDistance,h=cV(u,A).map(_=>[..._,e.height]),f=Math.floor(e.extrudedHeight/A);if(f>0){const _=[...h];for(let x=1;x<=f;x++)h.push(..._.map(E=>[E[0],E[1],e.height+x*A]))}const{startTime:p,endTime:d,spanTime:m}=e,v=m*36e5,y=Math.floor((d-p)/v),g=Array(h.length).fill(0);e:for(let _=0;_<y;_++){if(await TS(),this._stopRun)break e;const x=new Date(p+_*v),E=hV(x);t:for(let B=0;B<h.length;B++){if(await TS(),this._stopRun)break t;uV(h[B],E,o.scene)||(g[B]=(g[B]*y+1)/y)}!this._stopRun&&(e.progress=Number(((_+1)/y*100).toFixed(2))),console.log("colorScalelist",g),l(h,g)}},s=this.dv(c.createProcessingFromAsyncFunc(async u=>{await u.promise(a())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,r.pointPrimitiveOptions=void 0,e.progress=0,s.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,r.pointPrimitiveOptions=void 0,e.progress=0,s.isRunning&&s.cancel()}));const l=(u,A)=>{const h=u.map((f,p)=>({position:[...f],color:AV(e.startColor,e.endColor,A[p]),pixelSize:10}));r.pointPrimitiveOptions=h}}}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}};L(Gc,"type",Gc.register("ESCesiumViewer",c.ESSunshineAnalysis.type,Gc));let Jy=Gc;const IS=Math.pow(2,-52),qf=new Uint32Array(512);class ev{static from(n,e=gV,i=yV){const o=n.length,r=new Float64Array(o*2);for(let a=0;a<o;a++){const s=n[a];r[2*a]=e(s),r[2*a+1]=i(s)}return new ev(r)}constructor(n){const e=n.length>>1;if(e>0&&typeof n[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=n;const i=Math.max(2*e-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:n,_hullPrev:e,_hullNext:i,_hullTri:o,_hullHash:r}=this,a=n.length>>1;let s=1/0,l=1/0,u=-1/0,A=-1/0;for(let D=0;D<a;D++){const F=n[2*D],S=n[2*D+1];F<s&&(s=F),S<l&&(l=S),F>u&&(u=F),S>A&&(A=S),this._ids[D]=D}const h=(s+u)/2,f=(l+A)/2;let p,d,m;for(let D=0,F=1/0;D<a;D++){const S=tv(h,f,n[2*D],n[2*D+1]);S<F&&(p=D,F=S)}const v=n[2*p],y=n[2*p+1];for(let D=0,F=1/0;D<a;D++){if(D===p)continue;const S=tv(v,y,n[2*D],n[2*D+1]);S<F&&S>0&&(d=D,F=S)}let g=n[2*d],_=n[2*d+1],x=1/0;for(let D=0;D<a;D++){if(D===p||D===d)continue;const F=pV(v,y,g,_,n[2*D],n[2*D+1]);F<x&&(m=D,x=F)}let E=n[2*m],B=n[2*m+1];if(x===1/0){for(let S=0;S<a;S++)this._dists[S]=n[2*S]-n[0]||n[2*S+1]-n[1];Ra(this._ids,this._dists,0,a-1);const D=new Uint32Array(a);let F=0;for(let S=0,T=-1/0;S<a;S++){const w=this._ids[S],C=this._dists[w];C>T&&(D[F++]=w,T=C)}this.hull=D.subarray(0,F),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(gu(v,y,g,_,E,B)<0){const D=d,F=g,S=_;d=m,g=E,_=B,m=D,E=F,B=S}const P=mV(v,y,g,_,E,B);this._cx=P.x,this._cy=P.y;for(let D=0;D<a;D++)this._dists[D]=tv(n[2*D],n[2*D+1],P.x,P.y);Ra(this._ids,this._dists,0,a-1),this._hullStart=p;let I=3;i[p]=e[m]=d,i[d]=e[p]=m,i[m]=e[d]=p,o[p]=0,o[d]=1,o[m]=2,r.fill(-1),r[this._hashKey(v,y)]=p,r[this._hashKey(g,_)]=d,r[this._hashKey(E,B)]=m,this.trianglesLen=0,this._addTriangle(p,d,m,-1,-1,-1);for(let D=0,F,S;D<this._ids.length;D++){const T=this._ids[D],w=n[2*T],C=n[2*T+1];if(D>0&&Math.abs(w-F)<=IS&&Math.abs(C-S)<=IS||(F=w,S=C,T===p||T===d||T===m))continue;let M=0;for(let k=0,Q=this._hashKey(w,C);k<this._hashSize&&(M=r[(Q+k)%this._hashSize],!(M!==-1&&M!==i[M]));k++);M=e[M];let R=M,U;for(;U=i[R],gu(w,C,n[2*R],n[2*R+1],n[2*U],n[2*U+1])>=0;)if(R=U,R===M){R=-1;break}if(R===-1)continue;let O=this._addTriangle(R,T,i[R],-1,-1,o[R]);o[T]=this._legalize(O+2),o[R]=O,I++;let z=i[R];for(;U=i[z],gu(w,C,n[2*z],n[2*z+1],n[2*U],n[2*U+1])<0;)O=this._addTriangle(z,T,U,o[T],-1,o[z]),o[T]=this._legalize(O+2),i[z]=z,I--,z=U;if(R===M)for(;U=e[R],gu(w,C,n[2*U],n[2*U+1],n[2*R],n[2*R+1])<0;)O=this._addTriangle(U,T,R,-1,o[R],o[U]),this._legalize(O+2),o[U]=O,i[R]=R,I--,R=U;this._hullStart=e[T]=R,i[R]=e[z]=T,i[T]=z,r[this._hashKey(w,C)]=T,r[this._hashKey(n[2*R],n[2*R+1])]=R}this.hull=new Uint32Array(I);for(let D=0,F=this._hullStart;D<I;D++)this.hull[D]=F,F=i[F];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(n,e){return Math.floor(fV(n-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(n){const{_triangles:e,_halfedges:i,coords:o}=this;let r=0,a=0;for(;;){const s=i[n],l=n-n%3;if(a=l+(n+2)%3,s===-1){if(r===0)break;n=qf[--r];continue}const u=s-s%3,A=l+(n+1)%3,h=u+(s+2)%3,f=e[a],p=e[n],d=e[A],m=e[h];if(dV(o[2*f],o[2*f+1],o[2*p],o[2*p+1],o[2*d],o[2*d+1],o[2*m],o[2*m+1])){e[n]=m,e[s]=f;const y=i[h];if(y===-1){let _=this._hullStart;do{if(this._hullTri[_]===h){this._hullTri[_]=n;break}_=this._hullPrev[_]}while(_!==this._hullStart)}this._link(n,y),this._link(s,i[a]),this._link(a,h);const g=u+(s+1)%3;r<qf.length&&(qf[r++]=g)}else{if(r===0)break;n=qf[--r]}}return a}_link(n,e){this._halfedges[n]=e,e!==-1&&(this._halfedges[e]=n)}_addTriangle(n,e,i,o,r,a){const s=this.trianglesLen;return this._triangles[s]=n,this._triangles[s+1]=e,this._triangles[s+2]=i,this._link(s,o),this._link(s+1,r),this._link(s+2,a),this.trianglesLen+=3,s}}function fV(t,n){const e=t/(Math.abs(t)+Math.abs(n));return(n>0?3-e:1+e)/4}function tv(t,n,e,i){const o=t-e,r=n-i;return o*o+r*r}function dV(t,n,e,i,o,r,a,s){const l=t-a,u=n-s,A=e-a,h=i-s,f=o-a,p=r-s,d=l*l+u*u,m=A*A+h*h,v=f*f+p*p;return l*(h*v-m*p)-u*(A*v-m*f)+d*(A*p-h*f)<0}function pV(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),p=(u*A-s*h)*f,d=(a*h-l*A)*f;return p*p+d*d}function mV(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),p=t+(u*A-s*h)*f,d=n+(a*h-l*A)*f;return{x:p,y:d}}function Ra(t,n,e,i){if(i-e<=20)for(let o=e+1;o<=i;o++){const r=t[o],a=n[r];let s=o-1;for(;s>=e&&n[t[s]]>a;)t[s+1]=t[s--];t[s+1]=r}else{const o=e+i>>1;let r=e+1,a=i;wu(t,o,r),n[t[e]]>n[t[i]]&&wu(t,e,i),n[t[r]]>n[t[i]]&&wu(t,r,i),n[t[e]]>n[t[r]]&&wu(t,e,r);const s=t[r],l=n[s];for(;;){do r++;while(n[t[r]]<l);do a--;while(n[t[a]]>l);if(a<r)break;wu(t,r,a)}t[e+1]=t[a],t[a]=s,i-r+1>=a-e?(Ra(t,n,r,i),Ra(t,n,e,a-1)):(Ra(t,n,e,a-1),Ra(t,n,r,i))}}function wu(t,n,e){const i=t[n];t[n]=t[e],t[e]=i}function gV(t){return t[0]}function yV(t){return t[1]}const FS=(t=0)=>new Promise(n=>setTimeout(n,t)),As=class As extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_startEvent",this.disposeVar(new c.Event));L(this,"_stopEvent",this.dv(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_geoPolyline");L(this,"_customPrimitive");L(this,"_geoDivPoi");L(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Ye(e,i)),this._customPrimitive=this.disposeVar(new ut(e,i)),this._geoDivPoi=this.disposeVar(new bt(e,i)),this.ad(this._geoDivPoi.pickedEvent.don(r=>{Gi(r)===0&&this.pickedEvent.emit(r)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(r=>{this._geoPolyline&&this._geoPolyline.flyTo(r)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
|
|
3730
|
+
`);var r=n+(e?" ":"│ ");t.left&&jy(t.left,r,!1,i,o),t.right&&jy(t.right,r,!0,i,o)}}var qy=function(){function t(n){n===void 0&&(n=D8),this._root=null,this._size=0,this._comparator=n}return t.prototype.insert=function(n,e){return this._size++,this._root=Wy(n,e,this._root,this._comparator)},t.prototype.add=function(n,e){var i=new eo(n,e);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,r=to(n,this._root,o),a=o(n,r.key);return a===0?this._root=r:(a<0?(i.left=r.left,i.right=r,r.left=null):a>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(n){this._root=this._remove(n,this._root,this._comparator)},t.prototype._remove=function(n,e,i){var o;if(e===null)return null;e=to(n,e,i);var r=i(n,e.key);return r===0?(e.left===null?o=e.right:(o=to(n,e.left,i),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var n=this._root;if(n){for(;n.left;)n=n.left;return this._root=to(n.key,this._root,this._comparator),this._root=this._remove(n.key,this._root,this._comparator),{key:n.key,data:n.data}}return null},t.prototype.findStatic=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(n){return this._root&&(this._root=to(n,this._root,this._comparator),this._comparator(n,this._root.key)!==0)?null:this._root},t.prototype.contains=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(n,e){for(var i=this._root,o=[],r=!1;!r;)i!==null?(o.push(i),i=i.left):o.length!==0?(i=o.pop(),n.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(n,e,i,o){for(var r=[],a=this._comparator,s=this._root,l;r.length!==0||s;)if(s)r.push(s),s=s.left;else{if(s=r.pop(),l=a(s.key,e),l>0)break;if(a(s.key,n)>=0&&i.call(o,s))return this;s=s.right}return this},t.prototype.keys=function(){var n=[];return this.forEach(function(e){var i=e.key;return n.push(i)}),n},t.prototype.values=function(){var n=[];return this.forEach(function(e){var i=e.data;return n.push(i)}),n},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.left;)n=n.left;return n},t.prototype.maxNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.right;)n=n.right;return n},t.prototype.at=function(n){for(var e=this._root,i=!1,o=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),o===n)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(n){var e=this._root,i=null;if(n.right){for(i=n.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(n){var e=this._root,i=null;if(n.left!==null){for(i=n.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return O8(this._root)},t.prototype.load=function(n,e,i){e===void 0&&(e=[]),i===void 0&&(i=!1);var o=n.length,r=this._comparator;if(i&&$y(n,e,0,o-1,r),this._root===null)this._root=Ky(n,e,0,o),this._size=o;else{var a=L8(this.toList(),U8(n,e),r);o=this._size+o,this._root=Zy({head:a},0,o)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(n){n===void 0&&(n=function(i){return String(i.key)});var e=[];return jy(this._root,"",!0,function(i){return e.push(i)},n),e.join("")},t.prototype.update=function(n,e,i){var o=this._comparator,r=pS(n,this._root,o),a=r.left,s=r.right;o(n,e)<0?s=Wy(e,i,s,o):a=Wy(e,i,a,o),this._root=R8(a,s,o)},t.prototype.split=function(n){return pS(n,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var n,e,i;return M8(this,function(o){switch(o.label){case 0:n=this._root,e=[],i=!1,o.label=1;case 1:return i?[3,6]:n===null?[3,2]:(e.push(n),n=n.left,[3,5]);case 2:return e.length===0?[3,4]:(n=e.pop(),[4,n]);case 3:return o.sent(),n=n.right,[3,5];case 4:i=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function Ky(t,n,e,i){var o=i-e;if(o>0){var r=e+Math.floor(o/2),a=t[r],s=n[r],l=new eo(a,s);return l.left=Ky(t,n,e,r),l.right=Ky(t,n,r+1,i),l}return null}function U8(t,n){for(var e=new eo(null,null),i=e,o=0;o<t.length;o++)i=i.next=new eo(t[o],n[o]);return i.next=null,e.next}function O8(t){for(var n=t,e=[],i=!1,o=new eo(null,null),r=o;!i;)n?(e.push(n),n=n.left):e.length>0?(n=r=r.next=e.pop(),n=n.right):i=!0;return r.next=null,o.next}function Zy(t,n,e){var i=e-n;if(i>0){var o=n+Math.floor(i/2),r=Zy(t,n,o),a=t.head;return a.left=r,t.head=t.head.next,a.right=Zy(t,o+1,e),a}return null}function L8(t,n,e){for(var i=new eo(null,null),o=i,r=t,a=n;r!==null&&a!==null;)e(r.key,a.key)<0?(o.next=r,r=r.next):(o.next=a,a=a.next),o=o.next;return r!==null?o.next=r:a!==null&&(o.next=a),i.next}function $y(t,n,e,i,o){if(!(e>=i)){for(var r=t[e+i>>1],a=e-1,s=i+1;;){do a++;while(o(t[a],r)<0);do s--;while(o(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=n[a],n[a]=n[s],n[s]=l}$y(t,n,e,s,o),$y(t,n,s+1,i,o)}}const ar=11102230246251565e-32,un=134217729,z8=(3+8*ar)*ar;function Xy(t,n,e,i,o){let r,a,s,l,u=n[0],A=i[0],h=0,f=0;A>u==A>-u?(r=u,u=n[++h]):(r=A,A=i[++f]);let p=0;if(h<t&&f<e)for(A>u==A>-u?(a=u+r,s=r-(a-u),u=n[++h]):(a=A+r,s=r-(a-A),A=i[++f]),r=a,s!==0&&(o[p++]=s);h<t&&f<e;)A>u==A>-u?(a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++h]):(a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f]),r=a,s!==0&&(o[p++]=s);for(;h<t;)a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++h],r=a,s!==0&&(o[p++]=s);for(;f<e;)a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f],r=a,s!==0&&(o[p++]=s);return(r!==0||p===0)&&(o[p++]=r),p}function k8(t,n){let e=n[0];for(let i=1;i<t;i++)e+=n[i];return e}function mu(t){return new Float64Array(t)}const Q8=(3+16*ar)*ar,V8=(2+12*ar)*ar,N8=(9+64*ar)*ar*ar,Da=mu(4),mS=mu(8),gS=mu(12),yS=mu(16),fn=mu(4);function H8(t,n,e,i,o,r,a){let s,l,u,A,h,f,p,d,m,v,y,g,_,x,E,B,P,I;const D=t-o,F=e-o,S=n-r,T=i-r;x=D*T,f=un*D,p=f-(f-D),d=D-p,f=un*T,m=f-(f-T),v=T-m,E=d*v-(x-p*m-d*m-p*v),B=S*F,f=un*S,p=f-(f-S),d=S-p,f=un*F,m=f-(f-F),v=F-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,Da[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,Da[1]=_-(y+h)+(h-B),I=g+y,h=I-g,Da[2]=g-(I-h)+(y-h),Da[3]=I;let w=k8(4,Da),C=V8*a;if(w>=C||-w>=C||(h=t-D,s=t-(D+h)+(h-o),h=e-F,u=e-(F+h)+(h-o),h=n-S,l=n-(S+h)+(h-r),h=i-T,A=i-(T+h)+(h-r),s===0&&l===0&&u===0&&A===0)||(C=N8*a+z8*Math.abs(w),w+=D*A+T*s-(S*u+F*l),w>=C||-w>=C))return w;x=s*T,f=un*s,p=f-(f-s),d=s-p,f=un*T,m=f-(f-T),v=T-m,E=d*v-(x-p*m-d*m-p*v),B=l*F,f=un*l,p=f-(f-l),d=l-p,f=un*F,m=f-(f-F),v=F-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,fn[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,fn[1]=_-(y+h)+(h-B),I=g+y,h=I-g,fn[2]=g-(I-h)+(y-h),fn[3]=I;const M=Xy(4,Da,4,fn,mS);x=D*A,f=un*D,p=f-(f-D),d=D-p,f=un*A,m=f-(f-A),v=A-m,E=d*v-(x-p*m-d*m-p*v),B=S*u,f=un*S,p=f-(f-S),d=S-p,f=un*u,m=f-(f-u),v=u-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,fn[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,fn[1]=_-(y+h)+(h-B),I=g+y,h=I-g,fn[2]=g-(I-h)+(y-h),fn[3]=I;const R=Xy(M,mS,4,fn,gS);x=s*A,f=un*s,p=f-(f-s),d=s-p,f=un*A,m=f-(f-A),v=A-m,E=d*v-(x-p*m-d*m-p*v),B=l*u,f=un*l,p=f-(f-l),d=l-p,f=un*u,m=f-(f-u),v=u-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,fn[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,fn[1]=_-(y+h)+(h-B),I=g+y,h=I-g,fn[2]=g-(I-h)+(y-h),fn[3]=I;const U=Xy(R,gS,4,fn,yS);return yS[U-1]}function gu(t,n,e,i,o,r){const a=(n-r)*(e-o),s=(t-o)*(i-r),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=Q8*u?l:-H8(t,n,e,i,o,r,u)}const yu=(t,n)=>t.ll.x<=n.x&&n.x<=t.ur.x&&t.ll.y<=n.y&&n.y<=t.ur.y,Yy=(t,n)=>{if(n.ur.x<t.ll.x||t.ur.x<n.ll.x||n.ur.y<t.ll.y||t.ur.y<n.ll.y)return null;const e=t.ll.x<n.ll.x?n.ll.x:t.ll.x,i=t.ur.x<n.ur.x?t.ur.x:n.ur.x,o=t.ll.y<n.ll.y?n.ll.y:t.ll.y,r=t.ur.y<n.ur.y?t.ur.y:n.ur.y;return{ll:{x:e,y:o},ur:{x:i,y:r}}};let no=Number.EPSILON;no===void 0&&(no=Math.pow(2,-52));const G8=no*no,vS=(t,n)=>{if(-no<t&&t<no&&-no<n&&n<no)return 0;const e=t-n;return e*e<G8*t*n?0:t<n?-1:1};class W8{constructor(){this.reset()}reset(){this.xRounder=new wS,this.yRounder=new wS}round(n,e){return{x:this.xRounder.round(n),y:this.yRounder.round(e)}}}class wS{constructor(){this.tree=new qy,this.round(0)}round(n){const e=this.tree.add(n),i=this.tree.prev(e);if(i!==null&&vS(e.key,i.key)===0)return this.tree.remove(n),i.key;const o=this.tree.next(e);return o!==null&&vS(e.key,o.key)===0?(this.tree.remove(n),o.key):n}}const vu=new W8,Hf=(t,n)=>t.x*n.y-t.y*n.x,bS=(t,n)=>t.x*n.x+t.y*n.y,xS=(t,n,e)=>{const i=gu(t.x,t.y,n.x,n.y,e.x,e.y);return i>0?-1:i<0?1:0},Gf=t=>Math.sqrt(bS(t,t)),j8=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return Hf(o,i)/Gf(o)/Gf(i)},q8=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return bS(o,i)/Gf(o)/Gf(i)},_S=(t,n,e)=>n.y===0?null:{x:t.x+n.x/n.y*(e-t.y),y:e},CS=(t,n,e)=>n.x===0?null:{x:e,y:t.y+n.y/n.x*(e-t.x)},K8=(t,n,e,i)=>{if(n.x===0)return CS(e,i,t.x);if(i.x===0)return CS(t,n,e.x);if(n.y===0)return _S(e,i,t.y);if(i.y===0)return _S(t,n,e.y);const o=Hf(n,i);if(o==0)return null;const r={x:e.x-t.x,y:e.y-t.y},a=Hf(r,n)/o,s=Hf(r,i)/o,l=t.x+s*n.x,u=e.x+a*i.x,A=t.y+s*n.y,h=e.y+a*i.y,f=(l+u)/2,p=(A+h)/2;return{x:f,y:p}};class Jn{static compare(n,e){const i=Jn.comparePoints(n.point,e.point);return i!==0?i:(n.point!==e.point&&n.link(e),n.isLeft!==e.isLeft?n.isLeft?1:-1:io.compare(n.segment,e.segment))}static comparePoints(n,e){return n.x<e.x?-1:n.x>e.x?1:n.y<e.y?-1:n.y>e.y?1:0}constructor(n,e){n.events===void 0?n.events=[this]:n.events.push(this),this.point=n,this.isLeft=e}link(n){if(n.point===this.point)throw new Error("Tried to link already linked events");const e=n.point.events;for(let i=0,o=e.length;i<o;i++){const r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}checkForConsuming(){const n=this.point.events.length;for(let e=0;e<n;e++){const i=this.point.events[e];if(i.segment.consumedBy===void 0)for(let o=e+1;o<n;o++){const r=this.point.events[o];r.consumedBy===void 0&&i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment)}}}getAvailableLinkedEvents(){const n=[];for(let e=0,i=this.point.events.length;e<i;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&n.push(o)}return n}getLeftmostComparator(n){const e=new Map,i=o=>{const r=o.otherSE;e.set(o,{sine:j8(this.point,n.point,r.point),cosine:q8(this.point,n.point,r.point)})};return(o,r)=>{e.has(o)||i(o),e.has(r)||i(r);const{sine:a,cosine:s}=e.get(o),{sine:l,cosine:u}=e.get(r);return a>=0&&l>=0?s<u?1:s>u?-1:0:a<0&&l<0?s<u?-1:s>u?1:0:l<a?-1:l>a?1:0}}}let Z8=0;class io{static compare(n,e){const i=n.leftSE.point.x,o=e.leftSE.point.x,r=n.rightSE.point.x,a=e.rightSE.point.x;if(a<i)return 1;if(r<o)return-1;const s=n.leftSE.point.y,l=e.leftSE.point.y,u=n.rightSE.point.y,A=e.rightSE.point.y;if(i<o){if(l<s&&l<u)return 1;if(l>s&&l>u)return-1;const h=n.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;const f=e.comparePoint(n.rightSE.point);return f!==0?f:-1}if(i>o){if(s<l&&s<A)return-1;if(s>l&&s>A)return 1;const h=e.comparePoint(n.leftSE.point);if(h!==0)return h;const f=n.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(s<l)return-1;if(s>l)return 1;if(r<a){const h=e.comparePoint(n.rightSE.point);if(h!==0)return h}if(r>a){const h=n.comparePoint(e.rightSE.point);if(h<0)return 1;if(h>0)return-1}if(r!==a){const h=u-s,f=r-i,p=A-l,d=a-o;if(h>f&&p<d)return 1;if(h<f&&p>d)return-1}return r>a?1:r<a||u<A?-1:u>A?1:n.id<e.id?-1:n.id>e.id?1:0}constructor(n,e,i,o){this.id=++Z8,this.leftSE=n,n.segment=this,n.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=n,this.rings=i,this.windings=o}static fromRing(n,e,i){let o,r,a;const s=Jn.comparePoints(n,e);if(s<0)o=n,r=e,a=1;else if(s>0)o=e,r=n,a=-1;else throw new Error(`Tried to create degenerate segment at [${n.x}, ${n.y}]`);const l=new Jn(o,!0),u=new Jn(r,!1);return new io(l,u,[i],[a])}replaceRightSE(n){this.rightSE=n,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const n=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:n<e?n:e},ur:{x:this.rightSE.point.x,y:n>e?n:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(n){return n.x===this.leftSE.point.x&&n.y===this.leftSE.point.y||n.x===this.rightSE.point.x&&n.y===this.rightSE.point.y}comparePoint(n){if(this.isAnEndpoint(n))return 0;const e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return n.x===e.x?0:n.x<e.x?1:-1;const r=(n.y-e.y)/o.y,a=e.x+r*o.x;if(n.x===a)return 0;const s=(n.x-e.x)/o.x,l=e.y+s*o.y;return n.y===l?0:n.y<l?-1:1}getIntersection(n){const e=this.bbox(),i=n.bbox(),o=Yy(e,i);if(o===null)return null;const r=this.leftSE.point,a=this.rightSE.point,s=n.leftSE.point,l=n.rightSE.point,u=yu(e,s)&&this.comparePoint(s)===0,A=yu(i,r)&&n.comparePoint(r)===0,h=yu(e,l)&&this.comparePoint(l)===0,f=yu(i,a)&&n.comparePoint(a)===0;if(A&&u)return f&&!h?a:!f&&h?l:null;if(A)return h&&r.x===l.x&&r.y===l.y?null:r;if(u)return f&&a.x===s.x&&a.y===s.y?null:s;if(f&&h)return null;if(f)return a;if(h)return l;const p=K8(r,this.vector(),s,n.vector());return p===null||!yu(o,p)?null:vu.round(p.x,p.y)}split(n){const e=[],i=n.events!==void 0,o=new Jn(n,!0),r=new Jn(n,!1),a=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(o);const s=new io(o,a,this.rings.slice(),this.windings.slice());return Jn.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Jn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),r.checkForConsuming()),e}swapEvents(){const n=this.rightSE;this.rightSE=this.leftSE,this.leftSE=n,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}consume(n){let e=this,i=n;for(;e.consumedBy;)e=e.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const o=io.compare(e,i);if(o!==0){if(o>0){const r=e;e=i,i=r}if(e.prev===i){const r=e;e=i,i=r}for(let r=0,a=i.rings.length;r<a;r++){const s=i.rings[r],l=i.windings[r],u=e.rings.indexOf(s);u===-1?(e.rings.push(s),e.windings.push(l)):e.windings[u]+=l}i.rings=null,i.windings=null,i.consumedBy=e,i.leftSE.consumedBy=e.leftSE,i.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const n=this.prev.consumedBy||this.prev;this._beforeState=n.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const n=this.beforeState();this._afterState={rings:n.rings.slice(0),windings:n.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){const u=this.rings[s],A=this.windings[s],h=e.indexOf(u);h===-1?(e.push(u),i.push(A)):i[h]+=A}const r=[],a=[];for(let s=0,l=e.length;s<l;s++){if(i[s]===0)continue;const u=e[s],A=u.poly;if(a.indexOf(A)===-1)if(u.isExterior)r.push(A);else{a.indexOf(A)===-1&&a.push(A);const h=r.indexOf(u.poly);h!==-1&&r.splice(h,1)}}for(let s=0,l=r.length;s<l;s++){const u=r[s].multiPoly;o.indexOf(u)===-1&&o.push(u)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const n=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(fi.type){case"union":{const i=n.length===0,o=e.length===0;this._isInResult=i!==o;break}case"intersection":{let i,o;n.length<e.length?(i=n.length,o=e.length):(i=e.length,o=n.length),this._isInResult=o===fi.numMultiPolys&&i<o;break}case"xor":{const i=Math.abs(n.length-e.length);this._isInResult=i%2===1;break}case"difference":{const i=o=>o.length===1&&o[0].isSubject;this._isInResult=i(n)!==i(e);break}default:throw new Error(`Unrecognized operation type found ${fi.type}`)}return this._isInResult}}class SS{constructor(n,e,i){if(!Array.isArray(n)||n.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=i,this.segments=[],typeof n[0][0]!="number"||typeof n[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=vu.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let r=o;for(let a=1,s=n.length;a<s;a++){if(typeof n[a][0]!="number"||typeof n[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=vu.round(n[a][0],n[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(io.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}(o.x!==r.x||o.y!==r.y)&&this.segments.push(io.fromRing(r,o,this))}getSweepEvents(){const n=[];for(let e=0,i=this.segments.length;e<i;e++){const o=this.segments[e];n.push(o.leftSE),n.push(o.rightSE)}return n}}class $8{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new SS(n[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let i=1,o=n.length;i<o;i++){const r=new SS(n[i],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const n=this.exteriorRing.getSweepEvents();for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class ES{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof n[0][0][0]=="number"&&(n=[n])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let i=0,o=n.length;i<o;i++){const r=new $8(n[i],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class Wf{static factory(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.isInResult()||r.ringOut)continue;let a=null,s=r.leftSE,l=r.rightSE;const u=[s],A=s.point,h=[];for(;a=s,s=l,u.push(s),s.point!==A;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const m=u[0].point,v=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${m.x}, ${m.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(f.length===1){l=f[0].otherSE;break}let p=null;for(let m=0,v=h.length;m<v;m++)if(h[m].point===s.point){p=m;break}if(p!==null){const m=h.splice(p)[0],v=u.splice(m.index);v.unshift(v[0].otherSE),e.push(new Wf(v.reverse()));continue}h.push({index:u.length,point:s.point});const d=s.getLeftmostComparator(a);l=f.sort(d)[0].otherSE;break}e.push(new Wf(u))}return e}constructor(n){this.events=n;for(let e=0,i=n.length;e<i;e++)n[e].segment.ringOut=this;this.poly=null}getGeom(){let n=this.events[0].point;const e=[n];for(let u=1,A=this.events.length-1;u<A;u++){const h=this.events[u].point,f=this.events[u+1].point;xS(h,n,f)!==0&&(e.push(h),n=h)}if(e.length===1)return null;const i=e[0],o=e[1];xS(i,n,o)===0&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,l=[];for(let u=a;u!=s;u+=r)l.push([e[u].x,e[u].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){const n=this.enclosingRing();this._isExteriorRing=n?!n.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let n=this.events[0];for(let o=1,r=this.events.length;o<r;o++){const a=this.events[o];Jn.compare(n,a)>0&&(n=a)}let e=n.segment.prevInResult(),i=e?e.prevInResult():null;for(;;){if(!e)return null;if(!i)return e.ringOut;if(i.ringOut!==e.ringOut)return i.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=i.prevInResult(),i=e?e.prevInResult():null}}}class PS{constructor(n){this.exteriorRing=n,n.poly=this,this.interiorRings=[]}addInterior(n){this.interiorRings.push(n),n.poly=this}getGeom(){const n=[this.exteriorRing.getGeom()];if(n[0]===null)return null;for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getGeom();o!==null&&n.push(o)}return n}}class X8{constructor(n){this.rings=n,this.polys=this._composePolys(n)}getGeom(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getGeom();o!==null&&n.push(o)}return n}_composePolys(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.poly)if(r.isExteriorRing())e.push(new PS(r));else{const a=r.enclosingRing();a.poly||e.push(new PS(a)),a.poly.addInterior(r)}}return e}}class Y8{constructor(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:io.compare;this.queue=n,this.tree=new qy(e),this.segments=[]}process(n){const e=n.segment,i=[];if(n.consumedBy)return n.isLeft?this.queue.remove(n.otherSE):this.tree.remove(e),i;const o=n.isLeft?this.tree.add(e):this.tree.find(e);if(!o)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let r=o,a=o,s,l;for(;s===void 0;)r=this.tree.prev(r),r===null?s=null:r.key.consumedBy===void 0&&(s=r.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(n.isLeft){let u=null;if(s){const h=s.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(u=h),!s.isAnEndpoint(h))){const f=this._splitSafely(s,h);for(let p=0,d=f.length;p<d;p++)i.push(f[p])}}let A=null;if(l){const h=l.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(A=h),!l.isAnEndpoint(h))){const f=this._splitSafely(l,h);for(let p=0,d=f.length;p<d;p++)i.push(f[p])}}if(u!==null||A!==null){let h=null;u===null?h=A:A===null?h=u:h=Jn.comparePoints(u,A)<=0?u:A,this.queue.remove(e.rightSE),i.push(e.rightSE);const f=e.split(h);for(let p=0,d=f.length;p<d;p++)i.push(f[p])}i.length>0?(this.tree.remove(e),i.push(n)):(this.segments.push(e),e.prev=s)}else{if(s&&l){const u=s.getIntersection(l);if(u!==null){if(!s.isAnEndpoint(u)){const A=this._splitSafely(s,u);for(let h=0,f=A.length;h<f;h++)i.push(A[h])}if(!l.isAnEndpoint(u)){const A=this._splitSafely(l,u);for(let h=0,f=A.length;h<f;h++)i.push(A[h])}}}this.tree.remove(e)}return i}_splitSafely(n,e){this.tree.remove(n);const i=n.rightSE;this.queue.remove(i);const o=n.split(e);return o.push(i),n.consumedBy===void 0&&this.tree.add(n),o}}const BS=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,J8=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class eV{run(n,e,i){fi.type=n,vu.reset();const o=[new ES(e,!0)];for(let h=0,f=i.length;h<f;h++)o.push(new ES(i[h],!1));if(fi.numMultiPolys=o.length,fi.type==="difference"){const h=o[0];let f=1;for(;f<o.length;)Yy(o[f].bbox,h.bbox)!==null?f++:o.splice(f,1)}if(fi.type==="intersection")for(let h=0,f=o.length;h<f;h++){const p=o[h];for(let d=h+1,m=o.length;d<m;d++)if(Yy(p.bbox,o[d].bbox)===null)return[]}const r=new qy(Jn.compare);for(let h=0,f=o.length;h<f;h++){const p=o[h].getSweepEvents();for(let d=0,m=p.length;d<m;d++)if(r.insert(p[d]),r.size>BS)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const a=new Y8(r);let s=r.size,l=r.pop();for(;l;){const h=l.key;if(r.size===s){const p=h.segment;throw new Error(`Unable to pop() ${h.isLeft?"left":"right"} SweepEvent [${h.point.x}, ${h.point.y}] from segment #${p.id} [${p.leftSE.point.x}, ${p.leftSE.point.y}] -> [${p.rightSE.point.x}, ${p.rightSE.point.y}] from queue.`)}if(r.size>BS)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>J8)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=a.process(h);for(let p=0,d=f.length;p<d;p++){const m=f[p];m.consumedBy===void 0&&r.insert(m)}s=r.size,l=r.pop()}vu.reset();const u=Wf.factory(a.segments);return new X8(u).getGeom()}}const fi=new eV;var tV={union:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("union",t,e)},intersection:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("intersection",t,e)},xor:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("xor",t,e)},difference:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("difference",t,e)}};function jf(t,n,e){e===void 0&&(e={});var i=Fi(t),o=Fi(n),r=tV.intersection(i.coordinates,o.coordinates);return r.length===0?null:r.length===1?Vt(r[0],e.properties):dy(r,e.properties)}function nV(t,n,e){e===void 0&&(e={});var i=JSON.stringify(e.properties||{}),o=t[0],r=t[1],a=t[2],s=t[3],l=(r+s)/2,u=(o+a)/2,A=n*2/Mi([o,l],[a,l],e),h=A*(a-o),f=n*2/Mi([u,r],[u,s],e),p=f*(s-r),d=h/2,m=d*2,v=Math.sqrt(3)/2*p,y=a-o,g=s-r,_=3/4*m,x=v,E=(y-m)/(m-d/2),B=Math.floor(E),P=(B*_-d/2-y)/2-d/2+_/2,I=Math.floor((g-v)/v),D=(g-I*v)/2,F=I*v-g>v/2;F&&(D-=v/4);for(var S=[],T=[],w=0;w<6;w++){var C=2*Math.PI/6*w;S.push(Math.cos(C)),T.push(Math.sin(C))}for(var M=[],R=0;R<=B;R++)for(var U=0;U<=I;U++){var O=R%2===1;if(!(U===0&&O)&&!(U===0&&F)){var z=R*_+o-P,k=U*x+r+D;if(O&&(k-=v/2),e.triangles===!0)rV([z,k],h/2,p/2,JSON.parse(i),S,T).forEach(function(V){e.mask?jf(e.mask,V)&&M.push(V):M.push(V)});else{var Q=iV([z,k],h/2,p/2,JSON.parse(i),S,T);e.mask?jf(e.mask,Q)&&M.push(Q):M.push(Q)}}}return Pn(M)}function iV(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=t[0]+n*o[s],u=t[1]+e*r[s];a.push([l,u])}return a.push(a[0].slice()),Vt([a],i)}function rV(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=[];l.push(t),l.push([t[0]+n*o[s],t[1]+e*r[s]]),l.push([t[0]+n*o[(s+1)%6],t[1]+e*r[(s+1)%6]]),l.push(t),a.push(Vt([l],i))}return a}function oV(t,n,e,i){i===void 0&&(i={});for(var o=[],r=t[0],a=t[1],s=t[2],l=t[3],u=n/Mi([r,a],[s,a],i),A=u*(s-r),h=e/Mi([r,a],[r,l],i),f=h*(l-a),p=s-r,d=l-a,m=Math.floor(p/A),v=Math.floor(d/f),y=(p-m*A)/2,g=(d-v*f)/2,_=r+y,x=0;x<m;x++){for(var E=a+g,B=0;B<v;B++){var P=Vt([[[_,E],[_,E+f],[_+A,E+f],[_+A,E],[_,E]]],i.properties);i.mask?F8(i.mask,P)&&o.push(P):o.push(P),E+=f}_+=A}return Pn(o)}function sV(t,n,e){return e===void 0&&(e={}),oV(t,n,n,e)}function aV(t,n,e){e===void 0&&(e={});for(var i=[],o=n/Mi([t[0],t[1]],[t[2],t[1]],e),r=o*(t[2]-t[0]),a=n/Mi([t[0],t[1]],[t[0],t[3]],e),s=a*(t[3]-t[1]),l=0,u=t[0];u<=t[2];){for(var A=0,h=t[1];h<=t[3];){var f=null,p=null;l%2===0&&A%2===0?(f=Vt([[[u,h],[u,h+s],[u+r,h],[u,h]]],e.properties),p=Vt([[[u,h+s],[u+r,h+s],[u+r,h],[u,h+s]]],e.properties)):l%2===0&&A%2===1?(f=Vt([[[u,h],[u+r,h+s],[u+r,h],[u,h]]],e.properties),p=Vt([[[u,h],[u,h+s],[u+r,h+s],[u,h]]],e.properties)):A%2===0&&l%2===1?(f=Vt([[[u,h],[u,h+s],[u+r,h+s],[u,h]]],e.properties),p=Vt([[[u,h],[u+r,h+s],[u+r,h],[u,h]]],e.properties)):A%2===1&&l%2===1&&(f=Vt([[[u,h],[u,h+s],[u+r,h],[u,h]]],e.properties),p=Vt([[[u,h+s],[u+r,h+s],[u+r,h],[u,h+s]]],e.properties)),e.mask?(jf(e.mask,f)&&i.push(f),jf(e.mask,p)&&i.push(p)):(i.push(f),i.push(p)),h+=s,A++}l++,u+=r}return Pn(i)}function lV(t,n,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var i=e.gridType,o=e.property,r=e.weight;if(!t)throw new Error("points is required");if(Bz(t,"Point","input must contain Points"),!n)throw new Error("cellSize is required");if(r!==void 0&&typeof r!="number")throw new Error("weight must be a number");o=o||"elevation",i=i||"square",r=r||1;var a=ts(t),s;switch(i){case"point":case"points":s=Z_(a,n,e);break;case"square":case"squares":s=sV(a,n,e);break;case"hex":case"hexes":s=nV(a,n,e);break;case"triangle":case"triangles":s=aV(a,n,e);break;default:throw new Error("invalid gridType")}var l=[];return wa(s,function(u){var A=0,h=0;wa(t,function(p){var d=i==="point"?u:fk(u),m=Mi(d,p,e),v;if(o!==void 0&&(v=p.properties[o]),v===void 0&&(v=p.geometry.coordinates[2]),v===void 0)throw new Error("zValue is missing");m===0&&(A=v);var y=1/Math.pow(m,r);h+=y,A+=y*v});var f=hk(u);f.properties[o]=A/h,l.push(f)}),Pn(l)}function uV(t,n,e){const i=b.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=b.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=b.Cartesian3.subtract(o,i,new b.Cartesian3);b.Cartesian3.normalize(r,r);const a=new b.Ray(i,r),s=e.pickFromRay(a);return!!(e.globe.pick(a,e)||s)}const TS=(t=0)=>new Promise(n=>setTimeout(n,t));function cV(t,n){const e=Pn(t.map(l=>Xt(l))),i=Vt([t]);return lV(e,n,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates).filter(l=>An(Xt(l),i))}function hV(t){const n=b.JulianDate.fromDate(t),e=b.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(n);return Ya(e)}function AV(t,n,e){const i=t[0]+(n[0]-t[0])*e,o=t[1]+(n[1]-t[1])*e,r=t[2]+(n[2]-t[2])*e,a=t[3]+(n[3]-t[3])*e;return[i,o,r,a]}const Gc=class Gc extends Ln{constructor(e,i){super(e,i);L(this,"czmPointPrimitiveCollection");L(this,"_stopRun",!1);const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Uo(i,e.id));this.czmPointPrimitiveCollection=r,this.d(c.track([r,"show"],[e,"show"]));{const a=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){r.pointPrimitiveOptions=void 0;return}const u=[...e.points,e.points[0]],A=e.sampleDistance,h=cV(u,A).map(_=>[..._,e.height]),f=Math.floor(e.extrudedHeight/A);if(f>0){const _=[...h];for(let x=1;x<=f;x++)h.push(..._.map(E=>[E[0],E[1],e.height+x*A]))}const{startTime:p,endTime:d,spanTime:m}=e,v=m*36e5,y=Math.floor((d-p)/v),g=Array(h.length).fill(0);e:for(let _=0;_<y;_++){if(await TS(),this._stopRun)break e;const x=new Date(p+_*v),E=hV(x);t:for(let B=0;B<h.length;B++){if(await TS(),this._stopRun)break t;uV(h[B],E,o.scene)||(g[B]=(g[B]*y+1)/y)}!this._stopRun&&(e.progress=Number(((_+1)/y*100).toFixed(2))),console.log("colorScalelist",g),l(h,g)}},s=this.dv(c.createProcessingFromAsyncFunc(async u=>{await u.promise(a())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,r.pointPrimitiveOptions=void 0,e.progress=0,s.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,r.pointPrimitiveOptions=void 0,e.progress=0,s.isRunning&&s.cancel()}));const l=(u,A)=>{const h=u.map((f,p)=>({position:[...f],color:AV(e.startColor,e.endColor,A[p]),pixelSize:10}));r.pointPrimitiveOptions=h}}}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}};L(Gc,"type",Gc.register("ESCesiumViewer",c.ESSunshineAnalysis.type,Gc));let Jy=Gc;const IS=Math.pow(2,-52),qf=new Uint32Array(512);class ev{static from(n,e=gV,i=yV){const o=n.length,r=new Float64Array(o*2);for(let a=0;a<o;a++){const s=n[a];r[2*a]=e(s),r[2*a+1]=i(s)}return new ev(r)}constructor(n){const e=n.length>>1;if(e>0&&typeof n[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=n;const i=Math.max(2*e-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:n,_hullPrev:e,_hullNext:i,_hullTri:o,_hullHash:r}=this,a=n.length>>1;let s=1/0,l=1/0,u=-1/0,A=-1/0;for(let D=0;D<a;D++){const F=n[2*D],S=n[2*D+1];F<s&&(s=F),S<l&&(l=S),F>u&&(u=F),S>A&&(A=S),this._ids[D]=D}const h=(s+u)/2,f=(l+A)/2;let p,d,m;for(let D=0,F=1/0;D<a;D++){const S=tv(h,f,n[2*D],n[2*D+1]);S<F&&(p=D,F=S)}const v=n[2*p],y=n[2*p+1];for(let D=0,F=1/0;D<a;D++){if(D===p)continue;const S=tv(v,y,n[2*D],n[2*D+1]);S<F&&S>0&&(d=D,F=S)}let g=n[2*d],_=n[2*d+1],x=1/0;for(let D=0;D<a;D++){if(D===p||D===d)continue;const F=pV(v,y,g,_,n[2*D],n[2*D+1]);F<x&&(m=D,x=F)}let E=n[2*m],B=n[2*m+1];if(x===1/0){for(let S=0;S<a;S++)this._dists[S]=n[2*S]-n[0]||n[2*S+1]-n[1];Ra(this._ids,this._dists,0,a-1);const D=new Uint32Array(a);let F=0;for(let S=0,T=-1/0;S<a;S++){const w=this._ids[S],C=this._dists[w];C>T&&(D[F++]=w,T=C)}this.hull=D.subarray(0,F),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(gu(v,y,g,_,E,B)<0){const D=d,F=g,S=_;d=m,g=E,_=B,m=D,E=F,B=S}const P=mV(v,y,g,_,E,B);this._cx=P.x,this._cy=P.y;for(let D=0;D<a;D++)this._dists[D]=tv(n[2*D],n[2*D+1],P.x,P.y);Ra(this._ids,this._dists,0,a-1),this._hullStart=p;let I=3;i[p]=e[m]=d,i[d]=e[p]=m,i[m]=e[d]=p,o[p]=0,o[d]=1,o[m]=2,r.fill(-1),r[this._hashKey(v,y)]=p,r[this._hashKey(g,_)]=d,r[this._hashKey(E,B)]=m,this.trianglesLen=0,this._addTriangle(p,d,m,-1,-1,-1);for(let D=0,F,S;D<this._ids.length;D++){const T=this._ids[D],w=n[2*T],C=n[2*T+1];if(D>0&&Math.abs(w-F)<=IS&&Math.abs(C-S)<=IS||(F=w,S=C,T===p||T===d||T===m))continue;let M=0;for(let k=0,Q=this._hashKey(w,C);k<this._hashSize&&(M=r[(Q+k)%this._hashSize],!(M!==-1&&M!==i[M]));k++);M=e[M];let R=M,U;for(;U=i[R],gu(w,C,n[2*R],n[2*R+1],n[2*U],n[2*U+1])>=0;)if(R=U,R===M){R=-1;break}if(R===-1)continue;let O=this._addTriangle(R,T,i[R],-1,-1,o[R]);o[T]=this._legalize(O+2),o[R]=O,I++;let z=i[R];for(;U=i[z],gu(w,C,n[2*z],n[2*z+1],n[2*U],n[2*U+1])<0;)O=this._addTriangle(z,T,U,o[T],-1,o[z]),o[T]=this._legalize(O+2),i[z]=z,I--,z=U;if(R===M)for(;U=e[R],gu(w,C,n[2*U],n[2*U+1],n[2*R],n[2*R+1])<0;)O=this._addTriangle(U,T,R,-1,o[R],o[U]),this._legalize(O+2),o[U]=O,i[R]=R,I--,R=U;this._hullStart=e[T]=R,i[R]=e[z]=T,i[T]=z,r[this._hashKey(w,C)]=T,r[this._hashKey(n[2*R],n[2*R+1])]=R}this.hull=new Uint32Array(I);for(let D=0,F=this._hullStart;D<I;D++)this.hull[D]=F,F=i[F];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(n,e){return Math.floor(fV(n-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(n){const{_triangles:e,_halfedges:i,coords:o}=this;let r=0,a=0;for(;;){const s=i[n],l=n-n%3;if(a=l+(n+2)%3,s===-1){if(r===0)break;n=qf[--r];continue}const u=s-s%3,A=l+(n+1)%3,h=u+(s+2)%3,f=e[a],p=e[n],d=e[A],m=e[h];if(dV(o[2*f],o[2*f+1],o[2*p],o[2*p+1],o[2*d],o[2*d+1],o[2*m],o[2*m+1])){e[n]=m,e[s]=f;const y=i[h];if(y===-1){let _=this._hullStart;do{if(this._hullTri[_]===h){this._hullTri[_]=n;break}_=this._hullPrev[_]}while(_!==this._hullStart)}this._link(n,y),this._link(s,i[a]),this._link(a,h);const g=u+(s+1)%3;r<qf.length&&(qf[r++]=g)}else{if(r===0)break;n=qf[--r]}}return a}_link(n,e){this._halfedges[n]=e,e!==-1&&(this._halfedges[e]=n)}_addTriangle(n,e,i,o,r,a){const s=this.trianglesLen;return this._triangles[s]=n,this._triangles[s+1]=e,this._triangles[s+2]=i,this._link(s,o),this._link(s+1,r),this._link(s+2,a),this.trianglesLen+=3,s}}function fV(t,n){const e=t/(Math.abs(t)+Math.abs(n));return(n>0?3-e:1+e)/4}function tv(t,n,e,i){const o=t-e,r=n-i;return o*o+r*r}function dV(t,n,e,i,o,r,a,s){const l=t-a,u=n-s,A=e-a,h=i-s,f=o-a,p=r-s,d=l*l+u*u,m=A*A+h*h,v=f*f+p*p;return l*(h*v-m*p)-u*(A*v-m*f)+d*(A*p-h*f)<0}function pV(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),p=(u*A-s*h)*f,d=(a*h-l*A)*f;return p*p+d*d}function mV(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),p=t+(u*A-s*h)*f,d=n+(a*h-l*A)*f;return{x:p,y:d}}function Ra(t,n,e,i){if(i-e<=20)for(let o=e+1;o<=i;o++){const r=t[o],a=n[r];let s=o-1;for(;s>=e&&n[t[s]]>a;)t[s+1]=t[s--];t[s+1]=r}else{const o=e+i>>1;let r=e+1,a=i;wu(t,o,r),n[t[e]]>n[t[i]]&&wu(t,e,i),n[t[r]]>n[t[i]]&&wu(t,r,i),n[t[e]]>n[t[r]]&&wu(t,e,r);const s=t[r],l=n[s];for(;;){do r++;while(n[t[r]]<l);do a--;while(n[t[a]]>l);if(a<r)break;wu(t,r,a)}t[e+1]=t[a],t[a]=s,i-r+1>=a-e?(Ra(t,n,r,i),Ra(t,n,e,a-1)):(Ra(t,n,e,a-1),Ra(t,n,r,i))}}function wu(t,n,e){const i=t[n];t[n]=t[e],t[e]=i}function gV(t){return t[0]}function yV(t){return t[1]}const FS=(t=0)=>new Promise(n=>setTimeout(n,t)),As=class As extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_startEvent",this.disposeVar(new c.Event));L(this,"_stopEvent",this.dv(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_geoPolyline");L(this,"_customPrimitive");L(this,"_geoDivPoi");L(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Ye(e,i)),this._customPrimitive=this.disposeVar(new ut(e,i)),this._geoDivPoi=this.disposeVar(new bt(e,i)),this.ad(this._geoDivPoi.pickedEvent.don(r=>{Gi(r)===0&&this.pickedEvent.emit(r)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(r=>{this._geoPolyline&&this._geoPolyline.flyTo(r)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
|
|
3731
3731
|
uniform vec4 u_color;
|
|
3732
3732
|
void main()
|
|
3733
3733
|
{
|
|
@@ -3842,7 +3842,7 @@ return material;
|
|
|
3842
3842
|
material.alpha = fragColor.a;
|
|
3843
3843
|
|
|
3844
3844
|
return material;
|
|
3845
|
-
}`},translucent:!0}),h3(),A3(),f3(),g3(),y3(),v3(),w3(),c3(),F3(),M3(),R3(),nN(),b.Camera.DEFAULT_VIEW_RECTANGLE=b.Rectangle.fromDegrees(70,5,140,55);function oH(){return new Promise((t,n)=>b.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class sH extends c.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Ot(s);if(l&&(l.destroy(),Qv(s,void 0)),b.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(c.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=u3;await s.promise(oH());const A=await s.promise(c.createCancelablePromise(u(l,o)));A.scene._xbsjOriginSkyAtmosphere=A.scene.skyAtmosphere,A.scene._xbsjOriginSkyBox=A.scene.skyBox,A.scene.renderError.removeEventListener(A.cesiumWidget._onRenderError),A.clockViewModel.currentTime=b.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const h=b.JulianDate.fromDate(new Date(e.currentTime));b.JulianDate.equals(h,A.clockViewModel.currentTime)||(A.clockViewModel.currentTime=h)})),this.dispose(gi(A.clockViewModel,"currentTime",h=>{const f=b.JulianDate.toDate(A.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const h=new dE(A,e);Qv(A,h)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(A)}));a.start(n),a.errorEvent.don(s=>{console.error(s),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const aH=new b.EllipsoidTerrainProvider;class aE extends c.Destroyable{constructor(e){super();L(this,"_terrainMap",new Map);L(this,"_nextAnimateFrame",this.dv(c.createNextAnimateFrame()));L(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??aH}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const i=new c.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(c.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class lE extends c.Destroyable{constructor(e){super();L(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof bt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new c.Destroyable;{const r=o.dv(c.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof bt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof bt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,A)=>Number(A[1])-Number(u[1]))).forEach((u,A)=>{A instanceof bt&&A.czmDivPoi&&(A.czmDivPoi.zOrder=a),A instanceof Wi&&A.canvasObj&&(A.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class lH extends c.Destroyable{constructor(e){super();L(this,"_czmImageryLayerWrappers",new Set);L(this,"_zIndexChangedEvent",this.dv(new c.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class uH extends c.Destroyable{constructor(e){super();L(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:i}=this,o=i.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class cH extends c.Destroyable{constructor(e){super();L(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new c.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new uH(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class hH extends c.Destroyable{constructor(e,i){super();L(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new c.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new cH(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class uE extends c.Destroyable{constructor(e){super();L(this,"_czmImageryWrappers",new Set);L(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new lH(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new hH(e,this))}has(e){for(let i of this.czmImageryWrappers)if(i.imagery===e)return!0;return!1}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class cE extends c.Destroyable{constructor(e){super();L(this,"_pause",this.disposeVar(c.react(!1)));L(this,"_pickPositionTasks",[]);L(this,"_pickTasks",[]);L(this,"pickHeightMustGreaterThanZero",!0);L(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[A,h,f,p]=u;try{(async()=>{const{scene:d,camera:m}=i,v=Ze(A),y=m.getPickRay(v);if(y){let E;if(h?E=await d.pickFromRayMostDetailed(y,this.objectsToExclude):E=d.pickFromRay(y,this.objectsToExclude),E&&E.position){const B=De(E.position);return B?f(B):p(new Error("positionFromCartesian failed"))}if(!(d.terrainProvider instanceof b.EllipsoidTerrainProvider)){const B=d.globe.pick(y,d);if(!B)return p(new Error("scene.globe.pick failed"));const P=De(B);return P?(this.pickHeightMustGreaterThanZero&&P[2]<0&&(P[2]=0),f(P)):p(new Error("positionFromCartesian failed"))}}const g=d.terrainProvider instanceof b.EllipsoidTerrainProvider?d.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,_=i.camera.pickEllipsoid(Ze(A),g);if(!_)return p(new Error("Pick failed"));const x=De(_);return x?f(x):p(new Error("positionFromCartesian failed"))})()}catch(d){p(d)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[A,h,f,p,d]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,B,P,I;let m=i.scene.pick(Ze(A),h&&h[0],h&&h[1]);!m&&b.defined(i.scene.globe)&&(m=await AH(i,Ze(A)));let v;if(m&&m instanceof b.Cesium3DTileFeature){v={};try{m&&m.getPropertyIds().forEach(F=>{v&&(v[F]=m.getProperty(F))})}catch(D){console.warn(D)}}if(!m){const{left:D,top:F}=e.container.getBoundingClientRect();m=(E=document.elementFromPoint(A[0]+D,A[1]+F))==null?void 0:E.closest("[data-es-scene-object-id]")}let y;m&&(m.id&&m.id instanceof b.Entity&&m.id.ESSceneObjectID?y=m.id.ESSceneObjectID:m.collection&&m.collection.ESSceneObjectID?y=m.collection.ESSceneObjectID:m.primitive&&m.primitive.ESSceneObjectID?y=m.primitive.ESSceneObjectID:Array.isArray(m)&&m[0]instanceof b.ImageryLayerFeatureInfo?y=m[0].imageryLayer.ESSceneObjectID:m instanceof HTMLElement&&(y=m.dataset.esSceneObjectId));let g=y?c.ESSceneObject.getSceneObject(y):void 0;g&&g.parentID&&(g=c.ESSceneObject.getSceneObject(g.parentID));let _={};if(g&&Reflect.has(g,"allowPicking")&&Reflect.has(g,"pickedEvent")&&(g.allowPicking??!1)){if(g instanceof c.ESEntityCluster){const D=new b.JulianDate;_=m.id instanceof b.Entity?{name:m.id.label.text.getValue(D),properties:(B=m.id.properties)==null?void 0:B.getValue(D),coordinates:Ya(m.id.position.getValue(D))}:(P=m.id)==null?void 0:P.map(F=>{var S;return{name:F.id,properties:(S=F.properties)==null?void 0:S.getValue(D),coordinates:Ya(F.position.getValue(D))}})}else if(g instanceof c.ESGeoJson){const D=new b.JulianDate;if(!m.id.entityCollection)return;const F=m.id.polygon?"Polygon":m.id.polyline?"LineString":"Point",S=((I=m.id.properties)==null?void 0:I.getValue(D))??{},T=F=="Point"?De(m.id.position.getValue(D)):F=="LineString"?m.id.polyline.positions.getValue(D).map(w=>De(w)):_d(m.id.polygon.hierarchy.getValue(D));_=g.pickedInfoType=="FeatureCollection"||g.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:F,coordinates:T},properties:S}:{type:F,coordinates:T,properties:S}}else if(g instanceof c.ESGltfModel){let D;Reflect.has(m,"featureId")?D=m.featureId:Reflect.has(m,"instanceId")&&(D=m.instanceId),D&&(m.id=m.primitive.structuralMetadata.getPropertyTable(0).getProperty(m.instanceId,"id"))}g.pickedEvent.emit(new c.ESJPickedResult(m,g,v,_,f,A))}g&&Reflect.has(g,"allowPicking")&&!g.allowPicking&&p(new c.ESJPickedResult);const x=new c.ESJPickedResult(m,g,v,_,f,A);p(x)})()}catch(m){d(m)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function AH(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(b.defined(o))return o}class fH extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.disposeVar(c.react(!1)));L(this,"_cursorPosition",c.react(void 0));L(this,"quickPickPosition",!0);let i=new c.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Ot(e);if(!a)return;i=new c.Destroyable;const s=i.disposeVar(c.react(void 0)),l=i.disposeVar(c.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(A=>{A.pointerEvent&&(s.value=c.getDomEventCurrentTargetPos(A.pointerEvent))}));const u=i.disposeVar(c.createProcessingFromAsyncFunc(async A=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const h=await A.promise(c.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=h}else{const h=await A.promise(c.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=h}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function dH(t){const n=t.cloneNode(!0);n.style.position="absolute",n.style.top="0",n.style.zIndex="-1",document.body.appendChild(n);const e=n.getBoundingClientRect();return document.body.removeChild(n),{width:e.width,height:e.height}}const hE=["label","billboard","rectangle"];class pH extends c.Destroyable{constructor(e,i){super();L(this,"id",c.createGuid());L(this,"position",b.Cartesian3.ZERO);L(this,"label");L(this,"billboard");L(this,"rectangle");L(this,"zOrder");L(this,"_showEvent",this.disposeVar(new c.Event));this.id=e,this.position=i,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e),this.rectangle&&(this.rectangle.show=e)}}class mH extends c.Destroyable{constructor(e){super();L(this,"objects",new Map);L(this,"screenManager");L(this,"czmViewer");L(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=rt(o.position),s=this.getOrCreateObject(r,a);if(s.label)return r;const l=this.screenManager.labelCollection.add({...i,position:a,id:r,text:o.name});return l.ESSceneObjectID=e,s.label=l,s.zOrder=o.zOrder,r}addImage(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=rt(o.position),s=this.getOrCreateObject(r,a);if(s.billboard)return r;const l=this.screenManager.billboardCollection.add({...i,position:a,id:r});return l.ESSceneObjectID=e,s.billboard=l,s.zOrder=o.zOrder,r}addRectangle(e,i,o,r){const a=this.makeScreenObjectId(e,o.index??c.createGuid()),s=rt(o.position),l=this.getOrCreateObject(a,s);if(l.rectangle)return a;const u=this.screenManager.rectangleCollection.add({...dH(i.element),...i,id:a,position:s,callback:r});return r(!0),l.rectangle=u,l.zOrder=o.zOrder,a}update(e,i){const o=Array.isArray(e)?e:[e];for(const r of o){const a=this.objects.get(r);if(a)for(const s of hE){const l=Object.assign({},i[s],(i==null?void 0:i.all)??{});if(!l)continue;const u=a[s];if(u)for(const A in l)A!=="position"&&A!=="id"&&(u[A]=l[A])}}return!0}remove(e){const i=Array.isArray(e)?e:typeof e=="string"?[e]:e;if(Array.isArray(i)){for(const o of i){const r=this.objects.get(o);r&&(r.label&&(this.screenManager.labelCollection.remove(r.label),r.label=void 0),r.billboard&&(this.screenManager.billboardCollection.remove(r.billboard),r.billboard=void 0),r.rectangle&&(this.screenManager.rectangleCollection.remove(r.rectangle),r.rectangle=void 0),this.tryDeleteEmpty(o))}return!0}else{for(const o of Object.keys(i)){const r=Array.isArray(i[o])?i[o]:[i[o]];for(const a of r){if(!a)continue;const s=this.objects.get(a);if(!s)continue;const l=s[o];l&&(this.screenManager.collectionMap[o].remove(l),s[o]=void 0),this.tryDeleteEmpty(a)}}return!0}}makeScreenObjectId(e,i){return`${e}_${i}`}getOrCreateObject(e,i){let o=this.objects.get(e);return o||(o=new pH(e,i),this.objects.set(e,o)),o}tryDeleteEmpty(e){const i=this.objects.get(e);i&&!i.label&&!i.billboard&&!i.rectangle&&this.objects.delete(e)}}function gH(t,n){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&hE.includes(i)){const o=n[i];if(!o)continue;const r=o.computeScreenSpacePosition(t.scene);let a=b[o instanceof b.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,r),{x:s,y:l,width:u,height:A}=a;e[0]=Math.min(e[0],s),e[1]=Math.min(e[1],l),e[2]=Math.max(e[2],s+u),e[3]=Math.max(e[3],l+A)}return new b.Rectangle(...e)}class yH extends c.Destroyable{constructor(e){super();L(this,"rectangleCollisionCheck",new b.RectangleCollisionChecker);L(this,"screenManager");L(this,"enable",!1);L(this,"forceRebuildNext",!1);L(this,"avoidanceLayers",[]);L(this,"_processingQueue",[]);L(this,"_isProcessing",!1);L(this,"BATCH_SIZE",1e3);L(this,"_cache",new Map);L(this,"_lastCameraState",{});L(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const i=this.screenManager.getLayer(this.avoidanceLayers[e]);i.layerIsEffective()&&i.objects.forEach((o,r)=>{o.show(!0)})}this.forceRebuildNext=!0,this.update()}updateAvoidanceLayer(e,i){this.enable=(e==null?void 0:e.enabled)??!1,i?e!=null&&e.enabled?this.avoidanceLayers.includes(i)||this.avoidanceLayers.push(i):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=i):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,i=e.positionWC,o=e.directionWC,r=this._lastCameraState.position,a=this._lastCameraState.direction;if(!r||!a)return this._updateLastCameraState(),!0;const s=b.Cartesian3.distanceSquared(i,r),l=b.Cartesian3.distanceSquared(o,a);return s>this.CAMERA_MOVE_THRESHOLD||l>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=b.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=b.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let i=0;i<this.avoidanceLayers.length;i++){const o=this.screenManager.getLayer(this.avoidanceLayers[i]);o.layerIsEffective()&&o.objects.forEach((r,a)=>{this._processingQueue.push(r)})}this._processingQueue.sort((i,o)=>(o.zOrder||0)-(i.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,i=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<i;){const r=e.shift();this._updateSingleObject(r),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const i=e.id.toString(),o=this._cache.get(i),r=b.Cartesian3.clone(e.position);let a;if(o&&b.Cartesian3.equalsEpsilon(o.worldPos,r,1e-6))a=o.rect,this.rectangleCollisionCheck.remove(i,a);else{if(a=gH(this.screenManager.viewer,e),isNaN(a.width)||isNaN(a.height)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}this._cache.set(i,{rect:a,worldPos:r,lastFrame:Date.now()})}this.rectangleCollisionCheck.collides(a)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),a))}catch(i){console.error("ScreenManager update object error",i)}}}class AE extends c.Destroyable{constructor(){super();L(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class fE extends c.Destroyable{constructor(e){super();L(this,"layers",new Map);L(this,"czmViewer");L(this,"viewer");L(this,"avoidanceManager");L(this,"labelCollection");L(this,"billboardCollection");L(this,"rectangleCollection",this.ad(new AE));L(this,"canvasCollection",this.ad(new AE));L(this,"collectionMap");L(this,"_refreshEvent",this.ad(new c.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new yH(this)),this.labelCollection=new b.LabelCollection({scene:this.viewer.scene}),this.billboardCollection=new b.BillboardCollection({scene:this.viewer.scene}),this.viewer.scene.primitives.add(this.labelCollection),this.viewer.scene.primitives.add(this.billboardCollection),this.collectionMap={label:this.labelCollection,billboard:this.billboardCollection,rectangle:this.rectangleCollection},this.ad(c.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(i=>i.destroy()),this.layers.clear(),this.labelCollection.removeAll(),this.billboardCollection.removeAll(),this.viewer.scene.primitives.remove(this.labelCollection),this.viewer.scene.primitives.remove(this.billboardCollection)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let i=this.layers.get(e);return i||(i=new mH(this),this.layers.set(e,i),this.avoidanceManager.enable&&this.avoidanceManager.updateAvoidanceLayer({enabled:!0})),i}addLabel(e,i,o,r){const s=this.getLayer(i).addLabel(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addImage(e,i,o,r){const s=this.getLayer(i).addImage(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addRectangle(e,i,o,r,a){const l=this.getLayer(i).addRectangle(e,o,r,a);return this.refresh(),{layer:i,id:e,screenObjectId:l}}update(e,i,o,r){const a=this.getLayer(e);return!o||o.length===0?!1:(a.update(o,r),this.refresh(),!0)}remove(e,i,o){const r=this.getLayer(e);if(!r.remove(o)){console.warn(`屏幕管理器,删除${i}下的内容失败!`);return}!r.layerIsEffective()&&!r.isDestroyed()&&(r.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,i){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,i),this.refresh()}}function Ot(t){return c.getExtProp(t,"_viewerExtensions")}function Qv(t,n){c.setExtProp(t,"_viewerExtensions",n)}class dE extends c.Destroyable{constructor(e,i){super();L(this,"_imageriesManager");L(this,"_terrainManager");L(this,"_labelManager");L(this,"_pickingManager");L(this,"_poiContext");L(this,"_cursorPositionInfo");L(this,"_screenManager");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new uE(this.viewer)),this._terrainManager=this.dv(new aE(this.viewer)),this._labelManager=this.dv(new lE(this.viewer)),this._poiContext=this.disposeVar(new N0(this._viewer)),this._cursorPositionInfo=this.disposeVar(new fH(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new cE(i)),this._screenManager=this.ad(new fE(i)),this.ad(c.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}}var pE=new b.Cartesian3,mE=new b.Cartesian3;function gE(t,n,e){let i=b.Matrix4.clone(t.transform);t.lookAtTransform(b.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=b.Cartesian3.normalize(r,pE),s=b.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=b.Cartesian3.cross(t.direction,a,mE);else var l=b.Cartesian3.cross(t.up,a,mE);var u=l;if(e){var A=b.Cartesian3.cross(a,l,pE);u=A}var h=b.Cartesian3.magnitude(r);t.rotate(u,n/h);var f=t.positionCartographic,p=f.longitude,d=f.latitude;b.Cartesian3.fromRadians(p,d,o,void 0,t.position),t.lookAtTransform(i)}function yE(t,n){gE(t,n,!1)}function vE(t,n){gE(t,-n,!0)}class vH extends c.Destroyable{constructor(e){super();L(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),A=u-s;s=u;const h=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(A*h),a.MoveBackword&&r.moveBackward(A*h),a.MoveLeft&&r.moveLeft(A*h),a.MoveRight&&r.moveRight(A*h)):(a.MoveForward&&yE(r,A*h),a.MoveBackword&&yE(r,-A*h),a.MoveLeft&&vE(r,-A*h),a.MoveRight&&vE(r,A*h));{const{rotateSpeed:f}=this.controller,p=b.Math.toRadians(f*A);a.RotateRight?r.lookRight(p):a.RotateLeft?r.lookRight(-p):a.RotateUp?r.lookDown(-p):a.RotateDown&&r.lookDown(p)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class Yf extends c.Destroyable{constructor(e){super();L(this,"_currentKeyIds",new Set);L(this,"_currentKeyIdsChanged",this.dv(new c.Event));L(this,"_debug",this.dv(c.react(!1)));L(this,"_debugResetting",this.dv(new c.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends c.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
|
|
3845
|
+
}`},translucent:!0}),h3(),A3(),f3(),g3(),y3(),v3(),w3(),c3(),F3(),M3(),R3(),nN(),b.Camera.DEFAULT_VIEW_RECTANGLE=b.Rectangle.fromDegrees(70,5,140,55);function oH(){return new Promise((t,n)=>b.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class sH extends c.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Ot(s);if(l&&(l.destroy(),Qv(s,void 0)),b.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(c.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=u3;await s.promise(oH());const A=await s.promise(c.createCancelablePromise(u(l,o)));A.scene._xbsjOriginSkyAtmosphere=A.scene.skyAtmosphere,A.scene._xbsjOriginSkyBox=A.scene.skyBox,A.scene.renderError.removeEventListener(A.cesiumWidget._onRenderError),A.clockViewModel.currentTime=b.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const h=b.JulianDate.fromDate(new Date(e.currentTime));b.JulianDate.equals(h,A.clockViewModel.currentTime)||(A.clockViewModel.currentTime=h)})),this.dispose(gi(A.clockViewModel,"currentTime",h=>{const f=b.JulianDate.toDate(A.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const h=new dE(A,e);Qv(A,h)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(A)}));a.start(n),a.errorEvent.don(s=>{console.error(s),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const aH=new b.EllipsoidTerrainProvider;class aE extends c.Destroyable{constructor(e){super();L(this,"_terrainMap",new Map);L(this,"_nextAnimateFrame",this.dv(c.createNextAnimateFrame()));L(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??aH}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const i=new c.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(c.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class lE extends c.Destroyable{constructor(e){super();L(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof bt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new c.Destroyable;{const r=o.dv(c.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof bt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof bt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,A)=>Number(A[1])-Number(u[1]))).forEach((u,A)=>{A instanceof bt&&A.czmDivPoi&&(A.czmDivPoi.zOrder=a),A instanceof Wi&&A.canvasObj&&(A.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class lH extends c.Destroyable{constructor(e){super();L(this,"_czmImageryLayerWrappers",new Set);L(this,"_zIndexChangedEvent",this.dv(new c.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class uH extends c.Destroyable{constructor(e){super();L(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:i}=this,o=i.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class cH extends c.Destroyable{constructor(e){super();L(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new c.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new uH(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class hH extends c.Destroyable{constructor(e,i){super();L(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new c.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new cH(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class uE extends c.Destroyable{constructor(e){super();L(this,"_czmImageryWrappers",new Set);L(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new lH(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new hH(e,this))}has(e){for(let i of this.czmImageryWrappers)if(i.imagery===e)return!0;return!1}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class cE extends c.Destroyable{constructor(e){super();L(this,"_pause",this.disposeVar(c.react(!1)));L(this,"_pickPositionTasks",[]);L(this,"_pickTasks",[]);L(this,"pickHeightMustGreaterThanZero",!0);L(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[A,h,f,p]=u;try{(async()=>{const{scene:d,camera:m}=i,v=Ze(A),y=m.getPickRay(v);if(y){let E;if(h?E=await d.pickFromRayMostDetailed(y,this.objectsToExclude):E=d.pickFromRay(y,this.objectsToExclude),E&&E.position){const B=De(E.position);return B?f(B):p(new Error("positionFromCartesian failed"))}if(!(d.terrainProvider instanceof b.EllipsoidTerrainProvider)){const B=d.globe.pick(y,d);if(!B)return p(new Error("scene.globe.pick failed"));const P=De(B);return P?(this.pickHeightMustGreaterThanZero&&P[2]<0&&(P[2]=0),f(P)):p(new Error("positionFromCartesian failed"))}}const g=d.terrainProvider instanceof b.EllipsoidTerrainProvider?d.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,_=i.camera.pickEllipsoid(Ze(A),g);if(!_)return p(new Error("Pick failed"));const x=De(_);return x?f(x):p(new Error("positionFromCartesian failed"))})()}catch(d){p(d)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[A,h,f,p,d]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,B,P,I;let m=i.scene.pick(Ze(A),h&&h[0],h&&h[1]);!m&&b.defined(i.scene.globe)&&(m=await AH(i,Ze(A)));let v;if(m&&m instanceof b.Cesium3DTileFeature){v={};try{m&&m.getPropertyIds().forEach(F=>{v&&(v[F]=m.getProperty(F))})}catch(D){console.warn(D)}}if(!m){const{left:D,top:F}=e.container.getBoundingClientRect();m=(E=document.elementFromPoint(A[0]+D,A[1]+F))==null?void 0:E.closest("[data-es-scene-object-id]")}let y;m&&(m.id&&m.id instanceof b.Entity&&m.id.ESSceneObjectID?y=m.id.ESSceneObjectID:m.collection&&m.collection.ESSceneObjectID?y=m.collection.ESSceneObjectID:m.primitive&&m.primitive.ESSceneObjectID?y=m.primitive.ESSceneObjectID:Array.isArray(m)&&m[0]instanceof b.ImageryLayerFeatureInfo?y=m[0].imageryLayer.ESSceneObjectID:m instanceof HTMLElement&&(y=m.dataset.esSceneObjectId));let g=y?c.ESSceneObject.getSceneObject(y):void 0;g&&g.parentID&&(g=c.ESSceneObject.getSceneObject(g.parentID));let _={};if(g&&Reflect.has(g,"allowPicking")&&Reflect.has(g,"pickedEvent")&&(g.allowPicking??!1)){if(g instanceof c.ESEntityCluster){const D=new b.JulianDate;_=m.id instanceof b.Entity?{name:m.id.label.text.getValue(D),properties:(B=m.id.properties)==null?void 0:B.getValue(D),coordinates:Ya(m.id.position.getValue(D))}:(P=m.id)==null?void 0:P.map(F=>{var S;return{name:F.id,properties:(S=F.properties)==null?void 0:S.getValue(D),coordinates:Ya(F.position.getValue(D))}})}else if(g instanceof c.ESGeoJson){const D=new b.JulianDate;if(!m.id.entityCollection)return;const F=m.id.polygon?"Polygon":m.id.polyline?"LineString":"Point",S=((I=m.id.properties)==null?void 0:I.getValue(D))??{},T=F=="Point"?De(m.id.position.getValue(D)):F=="LineString"?m.id.polyline.positions.getValue(D).map(w=>De(w)):_d(m.id.polygon.hierarchy.getValue(D));_=g.pickedInfoType=="FeatureCollection"||g.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:F,coordinates:T},properties:S}:{type:F,coordinates:T,properties:S}}else if(g instanceof c.ESGltfModel){let D;Reflect.has(m,"featureId")?D=m.featureId:Reflect.has(m,"instanceId")&&(D=m.instanceId),D&&(m.id=m.primitive.structuralMetadata.getPropertyTable(0).getProperty(m.instanceId,"id"))}g.pickedEvent.emit(new c.ESJPickedResult(m,g,v,_,f,A))}g&&Reflect.has(g,"allowPicking")&&!g.allowPicking&&p(new c.ESJPickedResult);const x=new c.ESJPickedResult(m,g,v,_,f,A);p(x)})()}catch(m){d(m)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function AH(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(b.defined(o))return o}class fH extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.disposeVar(c.react(!1)));L(this,"_cursorPosition",c.react(void 0));L(this,"quickPickPosition",!0);let i=new c.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Ot(e);if(!a)return;i=new c.Destroyable;const s=i.disposeVar(c.react(void 0)),l=i.disposeVar(c.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(A=>{A.pointerEvent&&(s.value=c.getDomEventCurrentTargetPos(A.pointerEvent))}));const u=i.disposeVar(c.createProcessingFromAsyncFunc(async A=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const h=await A.promise(c.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=h}else{const h=await A.promise(c.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=h}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function dH(t){const n=t.cloneNode(!0);n.style.position="absolute",n.style.top="0",n.style.zIndex="-1",document.body.appendChild(n);const e=n.getBoundingClientRect();return document.body.removeChild(n),{width:e.width,height:e.height}}const hE=["label","billboard","rectangle"];class pH extends c.Destroyable{constructor(e,i){super();L(this,"id",c.createGuid());L(this,"position",b.Cartesian3.ZERO);L(this,"label");L(this,"billboard");L(this,"rectangle");L(this,"zOrder");L(this,"labelRefCount",1);L(this,"billboardRefCount",1);L(this,"rectangleRefCount",1);L(this,"_showEvent",this.disposeVar(new c.Event));this.id=e,this.position=i,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e),this.rectangle&&(this.rectangle.show=e)}}class mH extends c.Destroyable{constructor(e){super();L(this,"objects",new Map);L(this,"screenManager");L(this,"czmViewer");L(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=rt(o.position),s=this.getOrCreateObject(r,a);if(s.label)return s.labelRefCount++,r;const l=this.screenManager.labelCollection.add({...i,position:a,id:r,text:o.name});return l.ESSceneObjectID=e,s.label=l,s.zOrder=o.zOrder,r}addImage(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=rt(o.position),s=this.getOrCreateObject(r,a);if(s.billboard)return s.billboardRefCount++,r;const l=this.screenManager.billboardCollection.add({...i,position:a,id:r});return l.ESSceneObjectID=e,s.billboard=l,s.zOrder=o.zOrder,r}addRectangle(e,i,o,r){const a=this.makeScreenObjectId(e,o.index??c.createGuid()),s=rt(o.position),l=this.getOrCreateObject(a,s);if(l.rectangle)return l.rectangleRefCount++,a;const u=this.screenManager.rectangleCollection.add({...dH(i.element),...i,id:a,position:s,callback:r});return r(!0),l.rectangle=u,l.zOrder=o.zOrder,a}update(e,i){const o=Array.isArray(e)?e:[e];for(const r of o){const a=this.objects.get(r);if(a)for(const s of hE){const l=Object.assign({},i[s],(i==null?void 0:i.all)??{});if(!l)continue;const u=a[s];if(u)for(const A in l)A!=="position"&&A!=="id"&&(u[A]=l[A])}}return!0}remove(e){const i=Array.isArray(e)?e:typeof e=="string"?[e]:e;if(Array.isArray(i)){for(const o of i){const r=this.objects.get(o);r&&(r.label&&(r.labelRefCount>1?r.labelRefCount--:(this.screenManager.labelCollection.remove(r.label),r.label=void 0)),r.billboard&&(r.billboardRefCount>1?r.billboardRefCount--:(this.screenManager.billboardCollection.remove(r.billboard),r.billboard=void 0)),r.rectangle&&(r.rectangleRefCount>1?r.rectangleRefCount--:(this.screenManager.rectangleCollection.remove(r.rectangle),r.rectangle=void 0)),this.tryDeleteEmpty(o))}return!0}else{for(const o of Object.keys(i)){const r=Array.isArray(i[o])?i[o]:[i[o]];for(const a of r){if(!a)continue;const s=this.objects.get(a);if(!s)continue;const l=s[o];l&&(this.screenManager.collectionMap[o].remove(l),s[o]=void 0),this.tryDeleteEmpty(a)}}return!0}}makeScreenObjectId(e,i){return`${e}_${i}`}getOrCreateObject(e,i){let o=this.objects.get(e);return o||(o=new pH(e,i),this.objects.set(e,o)),o}tryDeleteEmpty(e){const i=this.objects.get(e);i&&!i.label&&!i.billboard&&!i.rectangle&&this.objects.delete(e)}}function gH(t,n){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&hE.includes(i)){const o=n[i];if(!o)continue;const r=o.computeScreenSpacePosition(t.scene);let a=b[o instanceof b.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,r),{x:s,y:l,width:u,height:A}=a;e[0]=Math.min(e[0],s),e[1]=Math.min(e[1],l),e[2]=Math.max(e[2],s+u),e[3]=Math.max(e[3],l+A)}return new b.Rectangle(...e)}class yH extends c.Destroyable{constructor(e){super();L(this,"rectangleCollisionCheck",new b.RectangleCollisionChecker);L(this,"screenManager");L(this,"enable",!1);L(this,"forceRebuildNext",!1);L(this,"avoidanceLayers",[]);L(this,"_processingQueue",[]);L(this,"_isProcessing",!1);L(this,"BATCH_SIZE",1e3);L(this,"_cache",new Map);L(this,"_lastCameraState",{});L(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const i=this.screenManager.getLayer(this.avoidanceLayers[e]);i.layerIsEffective()&&i.objects.forEach((o,r)=>{o.show(!0)})}this.forceRebuildNext=!0}updateAvoidanceLayer(e,i){this.enable=(e==null?void 0:e.enabled)??!1,i?e!=null&&e.enabled?this.avoidanceLayers.includes(i)||this.avoidanceLayers.push(i):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=i):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,i=e.positionWC,o=e.directionWC,r=this._lastCameraState.position,a=this._lastCameraState.direction;if(!r||!a)return this._updateLastCameraState(),!0;const s=b.Cartesian3.distanceSquared(i,r),l=b.Cartesian3.distanceSquared(o,a);return s>this.CAMERA_MOVE_THRESHOLD||l>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=b.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=b.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let i=0;i<this.avoidanceLayers.length;i++){const o=this.screenManager.getLayer(this.avoidanceLayers[i]);o.layerIsEffective()&&o.objects.forEach((r,a)=>{this._processingQueue.push(r)})}this._processingQueue.sort((i,o)=>(o.zOrder||0)-(i.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,i=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<i;){const r=e.shift();this._updateSingleObject(r),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const i=e.id.toString(),o=this._cache.get(i),r=b.Cartesian3.clone(e.position);let a;if(o&&b.Cartesian3.equalsEpsilon(o.worldPos,r,1e-6))a=o.rect,this.rectangleCollisionCheck.remove(i,a);else{if(a=gH(this.screenManager.viewer,e),isNaN(a.width)||isNaN(a.height)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}this._cache.set(i,{rect:a,worldPos:r,lastFrame:Date.now()})}this.rectangleCollisionCheck.collides(a)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),a))}catch(i){console.error("ScreenManager update object error",i)}}}class AE extends c.Destroyable{constructor(){super();L(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class fE extends c.Destroyable{constructor(e){super();L(this,"layers",new Map);L(this,"czmViewer");L(this,"viewer");L(this,"avoidanceManager");L(this,"labelCollection");L(this,"billboardCollection");L(this,"rectangleCollection",this.ad(new AE));L(this,"canvasCollection",this.ad(new AE));L(this,"collectionMap");L(this,"_refreshEvent",this.ad(new c.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new yH(this)),this.labelCollection=new b.LabelCollection({scene:this.viewer.scene}),this.billboardCollection=new b.BillboardCollection({scene:this.viewer.scene}),this.viewer.scene.primitives.add(this.labelCollection),this.viewer.scene.primitives.add(this.billboardCollection),this.collectionMap={label:this.labelCollection,billboard:this.billboardCollection,rectangle:this.rectangleCollection},this.ad(c.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(i=>i.destroy()),this.layers.clear(),this.labelCollection.removeAll(),this.billboardCollection.removeAll(),this.viewer.scene.primitives.remove(this.labelCollection),this.viewer.scene.primitives.remove(this.billboardCollection)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let i=this.layers.get(e);return i||(i=new mH(this),this.layers.set(e,i),this.avoidanceManager.enable&&this.avoidanceManager.updateAvoidanceLayer({enabled:!0})),i}addLabel(e,i,o,r){const s=this.getLayer(i).addLabel(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addImage(e,i,o,r){const s=this.getLayer(i).addImage(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addRectangle(e,i,o,r,a){const l=this.getLayer(i).addRectangle(e,o,r,a);return this.refresh(),{layer:i,id:e,screenObjectId:l}}update(e,i,o,r){const a=this.getLayer(e);return!o||o.length===0?!1:(a.update(o,r),this.refresh(),!0)}remove(e,i,o){const r=this.getLayer(e);if(!r.remove(o)){console.warn(`屏幕管理器,删除${i}下的内容失败!`);return}!r.layerIsEffective()&&!r.isDestroyed()&&(r.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,i){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,i),this.refresh()}}function Ot(t){return c.getExtProp(t,"_viewerExtensions")}function Qv(t,n){c.setExtProp(t,"_viewerExtensions",n)}class dE extends c.Destroyable{constructor(e,i){super();L(this,"_imageriesManager");L(this,"_terrainManager");L(this,"_labelManager");L(this,"_pickingManager");L(this,"_poiContext");L(this,"_cursorPositionInfo");L(this,"_screenManager");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new uE(this.viewer)),this._terrainManager=this.dv(new aE(this.viewer)),this._labelManager=this.dv(new lE(this.viewer)),this._poiContext=this.disposeVar(new N0(this._viewer)),this._cursorPositionInfo=this.disposeVar(new fH(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new cE(i)),this._screenManager=this.ad(new fE(i)),this.ad(c.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}}var pE=new b.Cartesian3,mE=new b.Cartesian3;function gE(t,n,e){let i=b.Matrix4.clone(t.transform);t.lookAtTransform(b.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=b.Cartesian3.normalize(r,pE),s=b.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=b.Cartesian3.cross(t.direction,a,mE);else var l=b.Cartesian3.cross(t.up,a,mE);var u=l;if(e){var A=b.Cartesian3.cross(a,l,pE);u=A}var h=b.Cartesian3.magnitude(r);t.rotate(u,n/h);var f=t.positionCartographic,p=f.longitude,d=f.latitude;b.Cartesian3.fromRadians(p,d,o,void 0,t.position),t.lookAtTransform(i)}function yE(t,n){gE(t,n,!1)}function vE(t,n){gE(t,-n,!0)}class vH extends c.Destroyable{constructor(e){super();L(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),A=u-s;s=u;const h=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(A*h),a.MoveBackword&&r.moveBackward(A*h),a.MoveLeft&&r.moveLeft(A*h),a.MoveRight&&r.moveRight(A*h)):(a.MoveForward&&yE(r,A*h),a.MoveBackword&&yE(r,-A*h),a.MoveLeft&&vE(r,-A*h),a.MoveRight&&vE(r,A*h));{const{rotateSpeed:f}=this.controller,p=b.Math.toRadians(f*A);a.RotateRight?r.lookRight(p):a.RotateLeft?r.lookRight(-p):a.RotateUp?r.lookDown(-p):a.RotateDown&&r.lookDown(p)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class Yf extends c.Destroyable{constructor(e){super();L(this,"_currentKeyIds",new Set);L(this,"_currentKeyIdsChanged",this.dv(new c.Event));L(this,"_debug",this.dv(c.react(!1)));L(this,"_debugResetting",this.dv(new c.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends c.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
|
|
3846
3846
|
`))};i(),this.d(e.currentKeyIdsChanged.don(i))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:i}=this._keyboardCameraControllerRunning;{const o=r=>{const a=Yf.getKeyId(r);this._currentKeyIds.has(a)||(this._currentKeyIds.add(a),this._currentKeyIdsChanged.emit())};this.d(i.keyDownEvent.don(o))}{const o=r=>{const a=Yf.getKeyId(r);this._currentKeyIds.has(a)&&(this._currentKeyIds.delete(a),this._currentKeyIdsChanged.emit())};this.d(i.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(i.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class wH extends c.Destroyable{constructor(e){super();L(this,"_keyStatus");L(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new Yf(this)),this._cameraOp=this.dv(new vH(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const od=class od extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"_keyStatusMap",this.dv(c.react(od.defaultKeyStatusMap)));L(this,"_speed",this.dv(c.react(1)));L(this,"_rotateSpeed",this.dv(c.react(.01)));L(this,"_alwaysWithCamera",this.dv(c.react(!1)));L(this,"_keyDownEvent",this.dv(new c.Event));L(this,"_keyUpEvent",this.dv(new c.Event));L(this,"_abortEvent",this.dv(new c.Event));this._firstPersonController=e,this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new wH(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};L(od,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let Jf=od;function bH(t,n){t.lookRight(b.Math.toRadians(n.movementX)*.1),t.lookDown(b.Math.toRadians(n.movementY)*.1);const e=t.pitch,i=b.Math.clamp(e,-b.Math.PI_OVER_TWO,b.Math.PI_OVER_TWO);i!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:i,roll:t.roll}})}class xH extends c.Destroyable{constructor(n,e){super(),this._firstPersonController=n,this._mouseCameraController=e;const{canvas:i}=this._firstPersonController.viewer;{const o=r=>{const{camera:a}=this._firstPersonController.viewer.scene;bH(a,r)};i.addEventListener("pointermove",o),this.dispose(()=>i.removeEventListener("pointermove",o))}}}const sd=class sd extends c.Destroyable{constructor(e){super();L(this,"_mouseMoving",this.dv(new xH(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:i}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=sd.origin_setPointerCapture);const o=i.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const r=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",r,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",r,!1))}{const r=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",r)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};L(sd,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Vv=sd;class _H extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});L(this,"_mouseResetting",this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Vv(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class CH extends c.Destroyable{constructor(e){super();L(this,"viewer");L(this,"_mouseCameraController",this.dv(new _H(this)));L(this,"_keyboardCameraController",this.dv(new Jf(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function wE(t){t.removeInputAction(b.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(b.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(b.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(b.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(b.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(b.ScreenSpaceEventType.MIDDLE_UP)}function Nv(t,n,e,i=void 0){const r=t.camera,a=new b.Cartesian2;a.x=n.startPosition.x,a.y=0;const s=new b.Cartesian2;s.x=n.endPosition.x,s.y=0;let l=r.getPickRay(a,new b.Ray),u=r.getPickRay(s,new b.Ray),A=0,h,f;if(!l||!u)return;r.frustum instanceof b.OrthographicFrustum?(h=l.origin,f=u.origin,b.Cartesian3.add(r.direction,h,h),b.Cartesian3.add(r.direction,f,f),b.Cartesian3.subtract(h,r.position,h),b.Cartesian3.subtract(f,r.position,f),b.Cartesian3.normalize(h,h),b.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction);let p=b.Cartesian3.dot(h,f);p<1&&(A=Math.acos(p)),A=n.startPosition.x>n.endPosition.x?A:-A;const d=e._horizontalRotationAxis;if(b.defined(i)?r.look(i,-A):b.defined(d)?r.look(d,-A):r.lookLeft(A),a.x=0,a.y=n.startPosition.y,s.x=0,s.y=n.endPosition.y,l=r.getPickRay(a,new b.Ray),u=r.getPickRay(s,new b.Ray),A=0,!(!l||!u))if(r.frustum instanceof b.OrthographicFrustum?(h=l.origin,f=u.origin,b.Cartesian3.add(r.direction,h,h),b.Cartesian3.add(r.direction,f,f),b.Cartesian3.subtract(h,r.position,h),b.Cartesian3.subtract(f,r.position,f),b.Cartesian3.normalize(h,h),b.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction),p=b.Cartesian3.dot(h,f),p<1&&(A=Math.acos(p)),A=n.startPosition.y>n.endPosition.y?A:-A,i=i??d,b.defined(i)){const m=r.direction,v=b.Cartesian3.negate(i,new b.Cartesian3),y=b.Cartesian3.equalsEpsilon(m,i,b.Math.EPSILON2),g=b.Cartesian3.equalsEpsilon(m,v,b.Math.EPSILON2);if(!y&&!g){p=b.Cartesian3.dot(m,i);let _=b.Math.acosClamped(p);A>0&&A>_&&(A=_-b.Math.EPSILON4),p=b.Cartesian3.dot(m,v),_=b.Math.acosClamped(p),A<0&&-A>_&&(A=-_+b.Math.EPSILON4);const x=b.Cartesian3.cross(i,m,new b.Cartesian3);r.look(x,A)}else(y&&A<0||g&&A>0)&&r.look(r.right,-A)}else r.lookUp(A)}class SH extends c.Destroyable{constructor(n,e){super();const i=e.viewer;if(!i)throw new Error("viewer is undefined");let o=!0;this.d(n.positionChanged.don(()=>o=!0)),this.d(n.rotationChanged.don(()=>o=!0)),this.d(n.offsetHeightChanged.don(()=>o=!0)),this.d(n.viewDistanceChanged.don(()=>o=!0)),this.d(n.offsetRotationChanged.don(()=>o=!0)),this.d(n.relativeRotationChanged.don(()=>o=!0));const r=[0,0,0],a=[0,0,0];this.d(i.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!n.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(n.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const h=rt(n.position),f=i.camera.positionWC,p=b.Cartesian3.distance(h,f);n.viewDistance=p}c.Vector.clone(n.position,a),n.offsetHeight&&(a[2]+=n.offsetHeight);const{rotation:s,offsetRotation:l=zi.defaults.offsetRotation}=n,u=[...l];c.Vector.set(r,0,0,0),s&&(n.relativeRotation??zi.defaults.relativeRotation)&&(c.Vector.add(s,r,r),u[0]+=90),c.Vector.add(u,r,r);const A={distance:n.viewDistance,heading:r[0],pitch:r[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(A,a)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(s=>{const l=s==null?void 0:s.pointerEvent;if(l&&n.enabledRotationInput&&(l.buttons===1||l.buttons===2)){const{movementX:u,movementY:A}=l;n.offsetRotation=c.Vector.add(n.offsetRotation??zi.defaults.offsetRotation,[u*.2,A*-.2,0])}})),this.d(e.wheelEvent.don(s=>{if(!n.enabledScaleInput)return;const l=s.deltaY,A=Math.max(1,n.viewDistance)*(l*.001);n.viewDistance=n.viewDistance+A}))}}class zi extends c.Destroyable{constructor(e){super();L(this,"_resetWithCameraEvent",this.dv(new c.Event));const i=e.viewer;if(!i)throw new Error("viewer is undefined");const o=this;let r;const a=()=>{r&&(r.destroy(),r=void 0)};this.d(a);const s=()=>{a(),o.enabled&&(r=new SH(o,e))};s(),this.d(o.enabledChanged.don(s)),this.d(o.resetWithCameraEvent.don(l=>{if(!e.actived)return;const u=gs(i.camera);if(!u)return;const A=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?A[0]:90),u[1]-(o.relativeRotation?A[1]:0),u[2]-(o.relativeRotation?A[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}L(zi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(zi||(zi={})),c.extendClassProps(zi.prototype,zi.createDefaultProps);class xu extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");L(this,"_geoPolylinePath");this._geoCameraController=this.dv(new zi(e)),this._geoPolylinePath=this.dv(new aa(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const i=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};i(),this.d(this._geoPolylinePath.currentPositionChanged.don(i)),this.d(this._geoPolylinePath.currentRotationChanged.don(i)),this.dispose(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(c.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(c.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(c.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(c.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(c.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new c.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new EH(this,e);if(this.lineMode==="manual")return new PH(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(xu||(xu={})),c.extendClassProps(xu.prototype,xu.createDefaultProps);class EH extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");n.offsetRotation=[-90,0,0]}}class PH extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=r=>{(r.key==="w"||r.key==="s")&&(n.polylinePath.playing=r.type==="keydown",n.polylinePath.speed=r.key==="w"||r.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class BH extends c.Destroyable{constructor(n,e){super();const i=e.positionPropertyName??"position",o=e.positionChangedPropertyName??i+"Changed",r=e.rotationPropertyName??"rotation",a=e.rotationChangedPropertyName??r+"Changed",s=(e.positionTracking??!0)&&Reflect.has(n,i)&&Reflect.has(n,o),l=(e.rotationTracking??!0)&&Reflect.has(n,r)&&Reflect.has(n,a);if(!(!s&&!l)){if(s){const u=()=>{e.geoCameraController.position=n[i]};u();const A=n[o];this.d(A.don(u))}if(l){const u=()=>{e.geoCameraController.rotation=n[r]};u();const A=n[o];this.d(A.don(u))}}}}class TH extends c.Destroyable{constructor(n,e){super();const i=this.dv(new c.ESSceneObjectWithId);i.id=n;const o=this.dv(c.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,i.sceneObjectChanged));this.disposeVar(new c.ObjResettingWithEvent(o,()=>{const{sceneObject:r}=i;if(!(!e.enabled||!r))return new BH(r,e)}))}}class _u extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");this._geoCameraController=this.dv(new zi(e)),this.d(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new c.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new TH(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(_u||(_u={})),c.extendClassProps(_u.prototype,_u.createDefaultProps);class IH extends c.Destroyable{constructor(e){super();L(this,"height",1e7);L(this,"cycle",60);L(this,"latitude",6.632251044444445);L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");L(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new b.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},b.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,i=e.positionCartographic;e.flyTo({destination:b.Cartesian3.fromRadians(i.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*b.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((r,a)=>{if(!o){o=new Date().getTime();return}const s=(new Date().getTime()-o)/1e3,l=e.positionCartographic.longitude+s*b.Math.PI*2/this.cycle;e.setView({destination:b.Cartesian3.fromRadians(l,this.latitude,this.height),orientation:{heading:0,pitch:-.5*b.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class FH extends c.Destroyable{constructor(e){super();L(this,"_height",this.dv(c.react(1e7)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_latitude",this.dv(c.react(38)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("未初始化viewer");this._inner=this.dv(new IH(i)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class MH extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_transform");L(this,"_headingRadius");L(this,"_pitchRadius");L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");this._viewer=e;const i=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new b.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const r=()=>{let a;if(this.position==null){var s=o.getPickRay(new b.Cartesian2(i.canvas.width*.5,i.canvas.height*.5));if(!s)return;a=i.globe.pick(s,i)}else a=b.Cartesian3.fromDegrees(...this.position);a&&(this._transform=b.Transforms.eastNorthUpToFixedFrame(a),this.start())};r(),this.d(this.positionChanged.don(r))}{const r=()=>{this._headingRadius=b.Math.toRadians(this.heading)};r(),this.d(this.headingChanged.don(r))}{const r=()=>{this._pitchRadius=b.Math.toRadians(this.pitch)};r(),this.d(this.pitchChanged.don(r))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var i=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),r=new b.Cartesian3(0,i,o);e.flyTo({destination:b.Matrix4.multiplyByPoint(this._transform,r,new b.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let a;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,l)=>{if(!a){a=new Date().getTime();return}const u=(new Date().getTime()-a)/1e3;this._headingRadius+=u*b.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new b.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),a=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(b.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class DH extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("viewer is undefined");this._inner=this.dv(new MH(i));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class RH extends c.Destroyable{constructor(e){super();L(this,"_firstPersonController");L(this,"_rotateGlobe");L(this,"_rotatePoint");L(this,"_followController");L(this,"_pathCameraController");L(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new CH(e)),this.d(this._viewer.keyDownEvent.don(i=>this._firstPersonController.keyboardCameraController.keyDown(i))),this.d(this._viewer.keyUpEvent.don(i=>this._firstPersonController.keyboardCameraController.keyUp(i)));{const{subContainer:i}=this._viewer;if(!i)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();i.addEventListener("blur",o,!1),this.d(()=>i.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=Jf.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var i;(i=this._viewer.subContainer)==null||i.focus()}))}this._rotateGlobe=this.dv(new FH(e)),this._rotatePoint=this.dv(new DH(e)),this._followController=this.dv(new _u(e)),this._pathCameraController=this.dv(new xu(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,i=4.2,o=1.6){this.resetNavigation();const r=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const a=this._viewer.getCameraInfo(),s=[(a==null?void 0:a.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(l=>{r?this._viewer.flyIn([e[0],e[1],(l??0)+o],s):this._viewer.viewer&&(this._viewer.viewer.camera.position=b.Cartesian3.fromDegrees(e[0],e[1],(l??0)+o)),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,i=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=i,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,i=5e4,o=60,r=0,a=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=i,this._rotatePoint.cycle=o,this._rotatePoint.heading=r,this._rotatePoint.pitch=a,this._rotatePoint.start()}changeToFollow(e,i=0,o=0,r=-30,a=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,r,0],this._followController.geoCameraController.relativeRotation=a,i!==0?this._followController.geoCameraController.viewDistance=i:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,i=10,o=10,r=!0,a=10,s="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const l=s==="auto",u=c.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:A}=u;if(!A)return;const h=c.getDistancesFromPositions(A,"NONE"),f=h[h.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...A],this._pathCameraController.polylinePath.duration=f/i*1e3,this._pathCameraController.polylinePath.loop=r,this._pathCameraController.offsetHeight=o;const p=x0(A);this._pathCameraController.polylinePath.rotationRadius=!l||p==!1?[0]:p.map(d=>d/a*i),this._pathCameraController.enabledRotationInput=!l,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=l,this._pathCameraController.lineMode=s,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const i=this._viewer.viewer;if(!i)return;this._handler||(this._handler=new b.ScreenSpaceEventHandler(i.scene.canvas));const o=this._handler,r=i.scene.screenSpaceCameraController;this.d(()=>{o&&wE(o)}),e=="Walk"||e=="RotateGlobe"?(r.lookEventTypes=void 0,r.rotateEventTypes=void 0,r.tiltEventTypes=void 0,r.zoomEventTypes=void 0,r.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},b.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(b.ScreenSpaceEventType.LEFT_UP)},b.ScreenSpaceEventType.LEFT_UP)},b.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},b.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(b.ScreenSpaceEventType.RIGHT_UP)},b.ScreenSpaceEventType.RIGHT_UP)},b.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},b.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(b.ScreenSpaceEventType.MIDDLE_UP)},b.ScreenSpaceEventType.MIDDLE_UP)},b.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&wE(o),r.lookEventTypes=b.CameraEventType.RIGHT_DRAG,r.rotateEventTypes=b.CameraEventType.LEFT_DRAG,r.tiltEventTypes=[b.CameraEventType.MIDDLE_DRAG,b.CameraEventType.PINCH,{eventType:b.CameraEventType.LEFT_DRAG,modifier:b.KeyboardEventModifier.CTRL},{eventType:b.CameraEventType.RIGHT_DRAG,modifier:b.KeyboardEventModifier.CTRL}],r.translateEventTypes=b.CameraEventType.LEFT_DRAG,r.zoomEventTypes=[b.CameraEventType.WHEEL,b.CameraEventType.PINCH,{eventType:b.CameraEventType.RIGHT_DRAG,modifier:b.KeyboardEventModifier.SHIFT}])}}const UH=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class OH extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"cloudsPostProcess");const i=e.viewer;if(!i)throw new Error("Cesium Viewer is not initialized");const o=new b.CloudCollection;i.scene.primitives.add(o),this.dispose(()=>i.scene.primitives.remove(o));{const r=()=>{o.show=this.show};r(),this.dispose(this.showChanged.disposableOn(r))}{const r=s=>({slice:s.slice,brightness:s.brightness,scale:Ze(s.scale),maximumSize:ri(s.maximumSize),color:Be(s.color),position:rt(s.position)});(()=>{o.removeAll();for(let s of UH)o.add(r(s))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class Cu extends c.Destroyable{constructor(n){super();const e=n.viewer;if(!e){console.warn("viewer is undefined!");return}const i=e.scene.postProcessStages.add(b.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(i));{const o=()=>{i.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{i.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{i.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{i.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{i.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(Cu||(Cu={})),c.extendClassProps(Cu.prototype,Cu.createDefaultProps);const LH=`
|
|
3847
3847
|
float getDistance(sampler2D depthTexture, vec2 texCoords)
|
|
3848
3848
|
{
|
|
@@ -4142,10 +4142,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
4142
4142
|
`;function P7(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
4143
4143
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
4144
4144
|
gitee地址:${t}
|
|
4145
|
-
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Gt=class Gt extends c.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(c.react(0)));L(this,"_viewer",this.dv(c.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(c.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(c.react(0)));L(this,"_editingSystem",$f);L(this,"_moveObjectsProcess",this.ad(jS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new i3(this)),this.ad(new r3(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new l3(this)})),this._viewerLegend=this.dv(new b7(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Wv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new c.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new sH(this.subContainer,this,o=>this._viewer.value=o,i.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&&Ot(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=b.Cartographic.fromDegrees(e[0],e[1],e[2],Gt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:gs(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:i}=this.viewer;if(!i||!e)return;const o=b.Cartesian3.fromDegrees(...e),r=b.Transforms.eastNorthUpToFixedFrame(o),a=b.Matrix4.inverse(r,new b.Matrix4),s=b.Matrix4.multiplyByPoint(a,i.positionWC,new b.Cartesian3),l=b.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=b.Math.toDegrees(u);let A=b.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-b.Math.PI:b.Math.PI),A=b.Math.toDegrees(A);const h=gs(i),f=h[0]-A,p=h[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:1,hDelta:f,pDelta:p}}flyIn(e,i,o,r="default"){var l;if(!i)return;const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&sl(s,a,r)}flyTo(e,i,o="default"){var p;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,h={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(p=this.viewer)==null?void 0:p.camera;return f&&sl(f,h,o)}flyToBoundingSphere(e,i,o=1){var h;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=c.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(h=this.viewer)==null?void 0:h.camera;return A&&sl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:gs(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),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:b.VERSION},e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=b.Cartographic.fromDegrees(e,i,void 0,Gt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await D0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(rt(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${c.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=c.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Gt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Gt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Gt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return wn(e,i)}localPositionsToPositions(e,i){return _r(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=e instanceof b.Cartesian3?e:rt(e),o=new b.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=Gt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",E7,S7,!0),new c.FunctionProperty([],()=>Gt.getCesiumIonToken(),[],"获取官方token"),new c.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new c.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new c.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new c.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new c.GroupProperty([],"Viewer","Viewer"),new c.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new c.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new c.BooleanProperty([this,"shadows"]),new c.GroupProperty([],"比例尺","比例尺(Legend)"),new c.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new c.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new c.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new c.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new c.GroupProperty([],"场景","场景(Scene)"),new c.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new c.GroupProperty([],"Globe","Globe"),new c.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new c.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new c.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new c.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new c.BooleanProperty([this,"sceneGlobeShowSkirts"]),new c.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new c.ColorProperty([this,"sceneGlobeBaseColor"]),new c.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new c.JsonProperty([this,"sceneGlobeClippingPlanes"]),new c.StringProperty([this,"sceneGlobeClippingPlanesId"]),new c.JsonProperty([this,"sceneGlobeClippingPolygons"]),new c.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new c.GroupProperty([],"underground","underground"),new c.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new c.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new c.GroupProperty([],"Translucency","Translucency"),new c.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new c.GroupProperty([],"Sun","Sun"),new c.BooleanProperty([this,"sun"],"sun",i.sun,!0),new c.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new c.GroupProperty([],"Moon","Moon"),new c.BooleanProperty([this,"moon"],"moon",i.moon,!0),new c.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new c.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new c.GroupProperty([],"SkyBox","SkyBox"),new c.BooleanProperty([this,"sceneSkyBoxShow"]),new c.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new c.GroupProperty([],"Background","Background"),new c.BooleanProperty([this,"xbsjUseBackground"]),new c.StringProperty([this,"xbsjBackgroundImageUri"]),new c.ColorProperty([this,"xbsjBackgroundColor"]),new c.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new c.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new c.ColorProperty([this,"sceneBackgroundColor"]),new c.GroupProperty([],"Fog","Fog"),new c.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new c.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new c.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new c.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new c.GroupProperty([],"Sscc","Sscc"),new c.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new c.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new c.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new c.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new c.GroupProperty([],"后处理","后处理"),new c.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new c.GroupProperty([],"环境遮蔽","环境遮蔽"),new c.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new c.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new c.GroupProperty([],"Bloom","Bloom"),new c.BooleanProperty([this,"scenePpsBloomEnabled"]),new c.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new c.NumberProperty([this,"scenePpsBloomContrast"]),new c.NumberProperty([this,"scenePpsBloomBrightness"]),new c.NumberProperty([this,"scenePpsBloomDelta"]),new c.NumberProperty([this,"scenePpsBloomSigma"]),new c.NumberProperty([this,"scenePpsBloomStepSize"]),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new c.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new c.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new c.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new c.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new c.GroupProperty([],"Inspector","Inspector"),new c.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new c.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new c.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(Gt,"type",Gt.register("ESCesiumViewer",Gt)),L(Gt,"getCesiumIonToken",P7),L(Gt,"currentDefaultAccessToken",b.Ion.defaultAccessToken),L(Gt,"latestDefaultAccessToken"),L(Gt,"ObjectsToExcludeWrapper",a3),L(Gt,"defaults",{...c.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:b.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:b.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}),L(Gt,"getHeightsScartchCarto",new b.Cartographic);let at=Gt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...C7()})})(at||(at={})),c.extendClassProps(at.prototype,at.createDefaultProps),ne.copyright=void 0;try{const t="earthsdk3-cesium",n="3.6.0-beta.119",e="2025-11-04T07:08:24.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="f414a145e6204a2d8a0b511ec4636c035d8718a6",s=((Date.now()-1762240104e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
|
|
4145
|
+
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Gt=class Gt extends c.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(c.react(0)));L(this,"_viewer",this.dv(c.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(c.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(c.react(0)));L(this,"_editingSystem",$f);L(this,"_moveObjectsProcess",this.ad(jS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new i3(this)),this.ad(new r3(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new l3(this)})),this._viewerLegend=this.dv(new b7(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Wv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new c.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new sH(this.subContainer,this,o=>this._viewer.value=o,i.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&&Ot(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=b.Cartographic.fromDegrees(e[0],e[1],e[2],Gt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:gs(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:i}=this.viewer;if(!i||!e)return;const o=b.Cartesian3.fromDegrees(...e),r=b.Transforms.eastNorthUpToFixedFrame(o),a=b.Matrix4.inverse(r,new b.Matrix4),s=b.Matrix4.multiplyByPoint(a,i.positionWC,new b.Cartesian3),l=b.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=b.Math.toDegrees(u);let A=b.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-b.Math.PI:b.Math.PI),A=b.Math.toDegrees(A);const h=gs(i),f=h[0]-A,p=h[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:1,hDelta:f,pDelta:p}}flyIn(e,i,o,r="default"){var l;if(!i)return;const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&sl(s,a,r)}flyTo(e,i,o="default"){var p;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,h={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(p=this.viewer)==null?void 0:p.camera;return f&&sl(f,h,o)}flyToBoundingSphere(e,i,o=1){var h;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=c.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(h=this.viewer)==null?void 0:h.camera;return A&&sl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:gs(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),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:b.VERSION},e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=b.Cartographic.fromDegrees(e,i,void 0,Gt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await D0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(rt(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${c.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=c.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Gt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Gt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Gt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return wn(e,i)}localPositionsToPositions(e,i){return _r(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=e instanceof b.Cartesian3?e:rt(e),o=new b.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=Gt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",E7,S7,!0),new c.FunctionProperty([],()=>Gt.getCesiumIonToken(),[],"获取官方token"),new c.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new c.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new c.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new c.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new c.GroupProperty([],"Viewer","Viewer"),new c.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new c.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new c.BooleanProperty([this,"shadows"]),new c.GroupProperty([],"比例尺","比例尺(Legend)"),new c.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new c.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new c.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new c.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new c.GroupProperty([],"场景","场景(Scene)"),new c.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new c.GroupProperty([],"Globe","Globe"),new c.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new c.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new c.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new c.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new c.BooleanProperty([this,"sceneGlobeShowSkirts"]),new c.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new c.ColorProperty([this,"sceneGlobeBaseColor"]),new c.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new c.JsonProperty([this,"sceneGlobeClippingPlanes"]),new c.StringProperty([this,"sceneGlobeClippingPlanesId"]),new c.JsonProperty([this,"sceneGlobeClippingPolygons"]),new c.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new c.GroupProperty([],"underground","underground"),new c.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new c.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new c.GroupProperty([],"Translucency","Translucency"),new c.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new c.GroupProperty([],"Sun","Sun"),new c.BooleanProperty([this,"sun"],"sun",i.sun,!0),new c.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new c.GroupProperty([],"Moon","Moon"),new c.BooleanProperty([this,"moon"],"moon",i.moon,!0),new c.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new c.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new c.GroupProperty([],"SkyBox","SkyBox"),new c.BooleanProperty([this,"sceneSkyBoxShow"]),new c.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new c.GroupProperty([],"Background","Background"),new c.BooleanProperty([this,"xbsjUseBackground"]),new c.StringProperty([this,"xbsjBackgroundImageUri"]),new c.ColorProperty([this,"xbsjBackgroundColor"]),new c.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new c.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new c.ColorProperty([this,"sceneBackgroundColor"]),new c.GroupProperty([],"Fog","Fog"),new c.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new c.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new c.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new c.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new c.GroupProperty([],"Sscc","Sscc"),new c.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new c.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new c.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new c.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new c.GroupProperty([],"后处理","后处理"),new c.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new c.GroupProperty([],"环境遮蔽","环境遮蔽"),new c.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new c.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new c.GroupProperty([],"Bloom","Bloom"),new c.BooleanProperty([this,"scenePpsBloomEnabled"]),new c.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new c.NumberProperty([this,"scenePpsBloomContrast"]),new c.NumberProperty([this,"scenePpsBloomBrightness"]),new c.NumberProperty([this,"scenePpsBloomDelta"]),new c.NumberProperty([this,"scenePpsBloomSigma"]),new c.NumberProperty([this,"scenePpsBloomStepSize"]),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new c.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new c.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new c.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new c.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new c.GroupProperty([],"Inspector","Inspector"),new c.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new c.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new c.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(Gt,"type",Gt.register("ESCesiumViewer",Gt)),L(Gt,"getCesiumIonToken",P7),L(Gt,"currentDefaultAccessToken",b.Ion.defaultAccessToken),L(Gt,"latestDefaultAccessToken"),L(Gt,"ObjectsToExcludeWrapper",a3),L(Gt,"defaults",{...c.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:b.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:b.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}),L(Gt,"getHeightsScartchCarto",new b.Cartographic);let at=Gt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...C7()})})(at||(at={})),c.extendClassProps(at.prototype,at.createDefaultProps),ne.copyright=void 0;try{const t="earthsdk3-cesium",n="3.6.0-beta.120",e="2025-11-05T02:39:09.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="f37d1422a6b0b8a0489d1bcf153ee59a0a39c2d5",s=((Date.now()-1762310349e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
|
|
4146
4146
|
%c${o?o+`
|
|
4147
4147
|
`:""}当前网站正在使用${t},此软件版权归${i}所有
|
|
4148
|
-
`;ne.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4148
|
+
`;ne.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","f37d1422a6b0b8a0489d1bcf153ee59a0a39c2d5")},get info(){return l},get date(){return"2025-11-05T02:39:09.000Z"},get author(){return"suplyang"},get version(){return"3.6.0-beta.120"},get name(){return"earthsdk3-cesium"},get commitId(){return"f37d1422a6b0b8a0489d1bcf153ee59a0a39c2d5"},print(){console.info(this.info,`
|
|
4149
4149
|
font-size: 18px;
|
|
4150
4150
|
font-weight: 1000;
|
|
4151
4151
|
line-height: 1;
|