earthsdk3-cesium 3.5.0-beta.17 → 3.5.0-beta.18

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.
@@ -1854,7 +1854,7 @@ function (result, this, instanceIndex, frameState) {
1854
1854
  result.bgColor = [c*.5+.5, (1.0 - c)*.5+.5, 0.5, 0.3];
1855
1855
  return result;
1856
1856
  }\`\`\`
1857
- `,Qn=class Qn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_player");v(this,"_finalImageUrlReact",this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));v(this,"_routePaths",this.disposeVar(a.react(void 0)));v(this,"routePathCallback");v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this._id.value=n),this._player=this.disposeVar(new a.Player);{const g=Qn.defaults;this.dispose(a.bind([this._player,"loop"],[this,"loop"],m=>m??g.loop,m=>m??g.loop)),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"],m=>m??g.currentTime,m=>m??g.currentTime)),this.dispose(a.bind([this._player,"duration"],[this,"duration"],m=>m??g.duration,m=>m??g.duration)),this.dispose(a.bind([this._player,"playing"],[this,"playing"],m=>m??g.playing,m=>m??g.playing)),this.dispose(a.bind([this._player,"speed"],[this,"speed"],m=>m??g.speed,m=>m??g.speed))}const o=this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),s=this.disposeVar(a.createProcessingFromAsyncFunc(async g=>{this.routePaths=void 0;const m=o.value;if(m)try{const _=await(await fetch(m)).json();this.routePaths=aM(_,this.width,this.repeatLength);return}catch(y){console.error(`geojson加载解析出错!${y}`),console.error(y)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const y=this.positionsSet;if(y){this.routePaths=y.map(_=>({positions:_,width:this.width}));return}}}));{const g=()=>{s.restart()};g();const m=this.disposeVar(a.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(m.disposableOn(g))}{const g=()=>{const m=Pu(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);m&&(this.routePathCallback=m)};g(),this.dispose(this.routePathCallbackStrChanged.disposableOn(g))}const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const l=this.finalImageUrlReact,c=this.disposeVar(new ns),u=this.disposeVar(a.createProcessingFromAsyncFunc(async g=>{if(!l.value)return;const m=Im(r.scene.context).getTextureHandler(l.value);if(m instanceof ns)c.reset(m);else{const y=await g.promise(m);c.reset(y)}})),d=()=>c.valid?c.raw:r.scene.context.defaultTexture,p=()=>u.restart();p(),this.dispose(l.changed.disposableOn(p));const f=this.ad(a.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new a.ObjResettingWithEvent(f,()=>this.routePaths?new bM(r,this,l.value&&d||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(g=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))ne(r,this.routePaths[0].startPos,r.camera.positionCartographic.height,void 0,g);else{const m=computeBoundingSphere(this.routePaths[0].positions);if(!m)return;const[y,_]=m;ne(r,y,_*3,void 0,g)}}))}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}};v(Qn,"whiteGradientImageBase64",SM),v(Qn,"defaultRoutePathCallback",function(e,n,o){const s=n/50,r=s-Math.floor(s);return e.color=[r*.5+.5,(1-r)*.5+.5,.5,1],e.bgColor=[r*.5+.5,(1-r)*.5+.5,.5,.3],e}),v(Qn,"routePathCallbackStrMd",EM),v(Qn,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(Qn,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let tn=Qn;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:a.reactPositionsSet(void 0),data:a.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(tn||(tn={})),a.extendClassProps(tn.prototype,tn.createDefaultProps);class Bn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_collection");this._collection=this.disposeVar(new tn(e,n)),this.dispose(a.track([this._collection,"show"],[this,"show"])),this.dispose(a.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(a.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(a.track([this._collection,"color"],[this,"color"])),this.dispose(a.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(a.track([this._collection,"width"],[this,"width"])),this.dispose(a.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(a.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(a.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(a.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(a.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(a.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(a.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([this._collection,"playing"],[this,"playing"])),this.dispose(a.track([this._collection,"loop"],[this,"loop"])),this.dispose(a.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._collection,"duration"],[this,"duration"])),this.dispose(a.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((r,l)=>{var c;if(!(!this.positions||l==((c=this.positions)==null?void 0:c.length)-1))return{startPos:r,endPos:this.positions[l+1],width:this.width,heightRatio:this.heightRatio}}).filter(r=>r!==void 0);return}this._collection.data=void 0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(s.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}}v(Bn,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(Bn,"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:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:a.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Bn||(Bn={})),a.extendClassProps(Bn.prototype,Bn.createDefaultProps);const Ll=class Ll extends vt{constructor(e,n){super(e,n);v(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Bn(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmSignalTransmission;{const r=()=>{s.show=e.show&&e.stroked};r(),this.ad(e.showChanged.don(r)),this.ad(e.strokedChanged.don(r))}this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"bgColor"],[e,"strokeColor"])),this.dispose(a.track([s,"startTime"],[e,"startTime"])),this.dispose(a.track([s,"transmissionTime"],[e,"transmissionTime"])),this.dispose(a.track([s,"heightRatio"],[e,"heightRatio"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"brightening"],[e,"brightening"])),this.dispose(a.track([s,"depthTest"],[e,"depthTest"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"bidirectional"],[e,"bidirectional"])),this.dispose(a.track([s,"loop"],[e,"loop"])),this.dispose(a.track([s,"currentTime"],[e,"currentTime"])),this.dispose(a.track([s,"duration"],[e,"duration"])),this.dispose(a.track([s,"playing"],[e,"playing"])),this.dispose(a.track([s,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Ll,"type",Ll.register("ESCesiumViewer",wh.type,Ll));let hf=Ll;function Lo(t){var i=[1/0,1/0,-1/0,-1/0];return Fo(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}Lo.default=Lo;var s0={exports:{}};(function(t,i){(function(e,n){t.exports=n()})(vo,function(){function e(C,S,x,A,R){(function O(N,V,U,z,B){for(;z>U;){if(z-U>600){var w=z-U+1,E=V-U+1,D=Math.log(w),L=.5*Math.exp(2*D/3),G=.5*Math.sqrt(D*L*(w-L)/w)*(E-w/2<0?-1:1),Y=Math.max(U,Math.floor(V-E*L/w+G)),q=Math.min(z,Math.floor(V+(w-E)*L/w+G));O(N,V,Y,q,B)}var X=N[V],Q=U,ee=z;for(n(N,U,V),B(N[z],X)>0&&n(N,U,z);Q<ee;){for(n(N,Q,ee),Q++,ee--;B(N[Q],X)<0;)Q++;for(;B(N[ee],X)>0;)ee--}B(N[U],X)===0?n(N,U,ee):n(N,++ee,z),ee<=V&&(U=ee+1),V<=ee&&(z=ee-1)}})(C,S,x||0,A||C.length-1,R||o)}function n(C,S,x){var A=C[S];C[S]=C[x],C[x]=A}function o(C,S){return C<S?-1:C>S?1:0}var s=function(C){C===void 0&&(C=9),this._maxEntries=Math.max(4,C),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function r(C,S,x){if(!x)return S.indexOf(C);for(var A=0;A<S.length;A++)if(x(C,S[A]))return A;return-1}function l(C,S){c(C,0,C.children.length,S,C)}function c(C,S,x,A,R){R||(R=_(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var O=S;O<x;O++){var N=C.children[O];u(R,C.leaf?A(N):N)}return R}function u(C,S){return C.minX=Math.min(C.minX,S.minX),C.minY=Math.min(C.minY,S.minY),C.maxX=Math.max(C.maxX,S.maxX),C.maxY=Math.max(C.maxY,S.maxY),C}function d(C,S){return C.minX-S.minX}function p(C,S){return C.minY-S.minY}function f(C){return(C.maxX-C.minX)*(C.maxY-C.minY)}function g(C){return C.maxX-C.minX+(C.maxY-C.minY)}function m(C,S){return C.minX<=S.minX&&C.minY<=S.minY&&S.maxX<=C.maxX&&S.maxY<=C.maxY}function y(C,S){return S.minX<=C.maxX&&S.minY<=C.maxY&&S.maxX>=C.minX&&S.maxY>=C.minY}function _(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function P(C,S,x,A,R){for(var O=[S,x];O.length;)if(!((x=O.pop())-(S=O.pop())<=A)){var N=S+Math.ceil((x-S)/A/2)*A;e(C,N,S,x,R),O.push(S,N,N,x)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(C){var S=this.data,x=[];if(!y(C,S))return x;for(var A=this.toBBox,R=[];S;){for(var O=0;O<S.children.length;O++){var N=S.children[O],V=S.leaf?A(N):N;y(C,V)&&(S.leaf?x.push(N):m(C,V)?this._all(N,x):R.push(N))}S=R.pop()}return x},s.prototype.collides=function(C){var S=this.data;if(!y(C,S))return!1;for(var x=[];S;){for(var A=0;A<S.children.length;A++){var R=S.children[A],O=S.leaf?this.toBBox(R):R;if(y(C,O)){if(S.leaf||m(C,O))return!0;x.push(R)}}S=x.pop()}return!1},s.prototype.load=function(C){if(!C||!C.length)return this;if(C.length<this._minEntries){for(var S=0;S<C.length;S++)this.insert(C[S]);return this}var x=this._build(C.slice(),0,C.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 A=this.data;this.data=x,x=A}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},s.prototype.insert=function(C){return C&&this._insert(C,this.data.height-1),this},s.prototype.clear=function(){return this.data=_([]),this},s.prototype.remove=function(C,S){if(!C)return this;for(var x,A,R,O=this.data,N=this.toBBox(C),V=[],U=[];O||V.length;){if(O||(O=V.pop(),A=V[V.length-1],x=U.pop(),R=!0),O.leaf){var z=r(C,O.children,S);if(z!==-1)return O.children.splice(z,1),V.push(O),this._condense(V),this}R||O.leaf||!m(O,N)?A?(x++,O=A.children[x],R=!1):O=null:(V.push(O),U.push(x),x=0,A=O,O=O.children[0])}return this},s.prototype.toBBox=function(C){return C},s.prototype.compareMinX=function(C,S){return C.minX-S.minX},s.prototype.compareMinY=function(C,S){return C.minY-S.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(C){return this.data=C,this},s.prototype._all=function(C,S){for(var x=[];C;)C.leaf?S.push.apply(S,C.children):x.push.apply(x,C.children),C=x.pop();return S},s.prototype._build=function(C,S,x,A){var R,O=x-S+1,N=this._maxEntries;if(O<=N)return l(R=_(C.slice(S,x+1)),this.toBBox),R;A||(A=Math.ceil(Math.log(O)/Math.log(N)),N=Math.ceil(O/Math.pow(N,A-1))),(R=_([])).leaf=!1,R.height=A;var V=Math.ceil(O/N),U=V*Math.ceil(Math.sqrt(N));P(C,S,x,U,this.compareMinX);for(var z=S;z<=x;z+=U){var B=Math.min(z+U-1,x);P(C,z,B,V,this.compareMinY);for(var w=z;w<=B;w+=V){var E=Math.min(w+V-1,B);R.children.push(this._build(C,w,E,A-1))}}return l(R,this.toBBox),R},s.prototype._chooseSubtree=function(C,S,x,A){for(;A.push(S),!S.leaf&&A.length-1!==x;){for(var R=1/0,O=1/0,N=void 0,V=0;V<S.children.length;V++){var U=S.children[V],z=f(U),B=(w=C,E=U,(Math.max(E.maxX,w.maxX)-Math.min(E.minX,w.minX))*(Math.max(E.maxY,w.maxY)-Math.min(E.minY,w.minY))-z);B<O?(O=B,R=z<R?z:R,N=U):B===O&&z<R&&(R=z,N=U)}S=N||S.children[0]}var w,E;return S},s.prototype._insert=function(C,S,x){var A=x?C:this.toBBox(C),R=[],O=this._chooseSubtree(A,this.data,S,R);for(O.children.push(C),u(O,A);S>=0&&R[S].children.length>this._maxEntries;)this._split(R,S),S--;this._adjustParentBBoxes(A,R,S)},s.prototype._split=function(C,S){var x=C[S],A=x.children.length,R=this._minEntries;this._chooseSplitAxis(x,R,A);var O=this._chooseSplitIndex(x,R,A),N=_(x.children.splice(O,x.children.length-O));N.height=x.height,N.leaf=x.leaf,l(x,this.toBBox),l(N,this.toBBox),S?C[S-1].children.push(N):this._splitRoot(x,N)},s.prototype._splitRoot=function(C,S){this.data=_([C,S]),this.data.height=C.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(C,S,x){for(var A,R,O,N,V,U,z,B=1/0,w=1/0,E=S;E<=x-S;E++){var D=c(C,0,E,this.toBBox),L=c(C,E,x,this.toBBox),G=(R=D,O=L,N=void 0,V=void 0,U=void 0,z=void 0,N=Math.max(R.minX,O.minX),V=Math.max(R.minY,O.minY),U=Math.min(R.maxX,O.maxX),z=Math.min(R.maxY,O.maxY),Math.max(0,U-N)*Math.max(0,z-V)),Y=f(D)+f(L);G<B?(B=G,A=E,w=Y<w?Y:w):G===B&&Y<w&&(w=Y,A=E)}return A||x-S},s.prototype._chooseSplitAxis=function(C,S,x){var A=C.leaf?this.compareMinX:d,R=C.leaf?this.compareMinY:p;this._allDistMargin(C,S,x,A)<this._allDistMargin(C,S,x,R)&&C.children.sort(A)},s.prototype._allDistMargin=function(C,S,x,A){C.children.sort(A);for(var R=this.toBBox,O=c(C,0,S,R),N=c(C,x-S,x,R),V=g(O)+g(N),U=S;U<x-S;U++){var z=C.children[U];u(O,C.leaf?R(z):z),V+=g(O)}for(var B=x-S-1;B>=S;B--){var w=C.children[B];u(N,C.leaf?R(w):w),V+=g(N)}return V},s.prototype._adjustParentBBoxes=function(C,S,x){for(var A=x;A>=0;A--)u(S[A],C)},s.prototype._condense=function(C){for(var S=C.length-1,x=void 0;S>=0;S--)C[S].children.length===0?S>0?(x=C[S-1].children).splice(x.indexOf(C[S]),1):this.clear():l(C[S],this.toBBox)},s})})(s0);var xM=s0.exports;function Pt(t,i,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!i)throw new Error("polygon is required");var n=Sh(t),o=Di(i),s=o.type,r=i.bbox,l=o.coordinates;if(r&&AM(n,r)===!1)return!1;s==="Polygon"&&(l=[l]);for(var c=!1,u=0;u<l.length&&!c;u++)if(r0(n,l[u][0],e.ignoreBoundary)){for(var d=!1,p=1;p<l[u].length&&!d;)r0(n,l[u][p],!e.ignoreBoundary)&&(d=!0),p++;d||(c=!0)}return c}function r0(t,i,e){var n=!1;i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]&&(i=i.slice(0,i.length-1));for(var o=0,s=i.length-1;o<i.length;s=o++){var r=i[o][0],l=i[o][1],c=i[s][0],u=i[s][1],d=t[1]*(r-c)+l*(c-t[0])+u*(t[0]-r)===0&&(r-t[0])*(c-t[0])<=0&&(l-t[1])*(u-t[1])<=0;if(d)return!e;var p=l>t[1]!=u>t[1]&&t[0]<(c-r)*(t[1]-l)/(u-l)+r;p&&(n=!n)}return n}function AM(t,i){return i[0]<=t[0]&&i[1]<=t[1]&&i[2]>=t[0]&&i[3]>=t[1]}function TM(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return a0(t);case"FeatureCollection":return MM(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return uf(t);default:throw new Error("unknown GeoJSON type")}}function a0(t){var i={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:i[e]=t[e]}}),i.properties=l0(t.properties),i.geometry=uf(t.geometry),i}function l0(t){var i={};return t&&Object.keys(t).forEach(function(e){var n=t[e];typeof n=="object"?n===null?i[e]=null:Array.isArray(n)?i[e]=n.map(function(o){return o}):i[e]=l0(n):i[e]=n}),i}function MM(t){var i={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:i[e]=t[e]}}),i.features=t.features.map(function(e){return a0(e)}),i}function uf(t){var i={type:t.type};return t.bbox&&(i.bbox=t.bbox),t.type==="GeometryCollection"?(i.geometries=t.geometries.map(function(e){return uf(e)}),i):(i.coordinates=c0(t.coordinates),i)}function c0(t){var i=t;return typeof i[0]!="object"?i.slice():i.map(function(e){return c0(e)})}function h0(t,i){i===void 0&&(i={});var e=typeof i=="object"?i.mutate:i;if(!t)throw new Error("geojson is required");var n=XT(t),o=[];switch(n){case"LineString":o=df(t);break;case"MultiLineString":case"Polygon":Ii(t).forEach(function(r){o.push(df(r))});break;case"MultiPolygon":Ii(t).forEach(function(r){var l=[];r.forEach(function(c){l.push(df(c))}),o.push(l)});break;case"Point":return t;case"MultiPoint":var s={};Ii(t).forEach(function(r){var l=r.join("-");Object.prototype.hasOwnProperty.call(s,l)||(o.push(r),s[l]=!0)});break;default:throw new Error(n+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:n,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Xt({type:n,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function df(t){var i=Ii(t);if(i.length===2&&!u0(i[0],i[1]))return i;var e=[],n=i.length-1,o=e.length;e.push(i[0]);for(var s=1;s<n;s++){var r=e[e.length-1];i[s][0]===r[0]&&i[s][1]===r[1]||(e.push(i[s]),o=e.length,o>2&&d0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(i[i.length-1]),o=e.length,u0(i[0],i[i.length-1])&&o<4)throw new Error("invalid polygon");return d0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function u0(t,i){return t[0]===i[0]&&t[1]===i[1]}function d0(t,i,e){var n=e[0],o=e[1],s=t[0],r=t[1],l=i[0],c=i[1],u=n-s,d=o-r,p=l-s,f=c-r,g=u*f-d*p;return g!==0?!1:Math.abs(p)>=Math.abs(f)?p>0?s<=n&&n<=l:l<=n&&n<=s:f>0?r<=o&&o<=c:c<=o&&o<=r}function IM(t,i){i===void 0&&(i={});var e=0,n=0,o=0;return Fo(t,function(s){e+=s[0],n+=s[1],o++},!0),ht([e/o,n/o],i.properties)}function p0(t){if(!t)throw new Error("geojson is required");var i=[];return ji(t,function(e){DM(e,i)}),Ot(i)}function DM(t,i){var e=[],n=t.geometry;if(n!==null){switch(n.type){case"Polygon":e=Ii(n);break;case"LineString":e=[Ii(n)]}e.forEach(function(o){var s=RM(o,t.properties);s.forEach(function(r){r.id=i.length,i.push(r)})})}}function RM(t,i){var e=[];return t.reduce(function(n,o){var s=oi([n,o],i);return s.bbox=FM(n,o),e.push(s),o}),e}function FM(t,i){var e=t[0],n=t[1],o=i[0],s=i[1],r=e<o?e:o,l=n<s?n:s,c=e>o?e:o,u=n>s?n:s;return[r,l,c,u]}var pf={exports:{}},f0={};(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: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/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 i(z,B,w){w===void 0&&(w={});var E={type:"Feature"};return(w.id===0||w.id)&&(E.id=w.id),w.bbox&&(E.bbox=w.bbox),E.properties=B||{},E.geometry=z,E}t.feature=i;function e(z,B,w){switch(z){case"Point":return n(B).geometry;case"LineString":return l(B).geometry;case"Polygon":return s(B).geometry;case"MultiPoint":return p(B).geometry;case"MultiLineString":return d(B).geometry;case"MultiPolygon":return f(B).geometry;default:throw new Error(z+" is invalid")}}t.geometry=e;function n(z,B,w){if(w===void 0&&(w={}),!z)throw new Error("coordinates is required");if(!Array.isArray(z))throw new Error("coordinates must be an Array");if(z.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!O(z[0])||!O(z[1]))throw new Error("coordinates must contain numbers");var E={type:"Point",coordinates:z};return i(E,B,w)}t.point=n;function o(z,B,w){return w===void 0&&(w={}),u(z.map(function(E){return n(E,B)}),w)}t.points=o;function s(z,B,w){w===void 0&&(w={});for(var E=0,D=z;E<D.length;E++){var L=D[E];if(L.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var G=0;G<L[L.length-1].length;G++)if(L[L.length-1][G]!==L[0][G])throw new Error("First and last Position are not equivalent.")}var Y={type:"Polygon",coordinates:z};return i(Y,B,w)}t.polygon=s;function r(z,B,w){return w===void 0&&(w={}),u(z.map(function(E){return s(E,B)}),w)}t.polygons=r;function l(z,B,w){if(w===void 0&&(w={}),z.length<2)throw new Error("coordinates must be an array of two or more positions");var E={type:"LineString",coordinates:z};return i(E,B,w)}t.lineString=l;function c(z,B,w){return w===void 0&&(w={}),u(z.map(function(E){return l(E,B)}),w)}t.lineStrings=c;function u(z,B){B===void 0&&(B={});var w={type:"FeatureCollection"};return B.id&&(w.id=B.id),B.bbox&&(w.bbox=B.bbox),w.features=z,w}t.featureCollection=u;function d(z,B,w){w===void 0&&(w={});var E={type:"MultiLineString",coordinates:z};return i(E,B,w)}t.multiLineString=d;function p(z,B,w){w===void 0&&(w={});var E={type:"MultiPoint",coordinates:z};return i(E,B,w)}t.multiPoint=p;function f(z,B,w){w===void 0&&(w={});var E={type:"MultiPolygon",coordinates:z};return i(E,B,w)}t.multiPolygon=f;function g(z,B,w){w===void 0&&(w={});var E={type:"GeometryCollection",geometries:z};return i(E,B,w)}t.geometryCollection=g;function m(z,B){if(B===void 0&&(B=0),B&&!(B>=0))throw new Error("precision must be a positive number");var w=Math.pow(10,B||0);return Math.round(z*w)/w}t.round=m;function y(z,B){B===void 0&&(B="kilometers");var w=t.factors[B];if(!w)throw new Error(B+" units is invalid");return z*w}t.radiansToLength=y;function _(z,B){B===void 0&&(B="kilometers");var w=t.factors[B];if(!w)throw new Error(B+" units is invalid");return z/w}t.lengthToRadians=_;function P(z,B){return S(_(z,B))}t.lengthToDegrees=P;function C(z){var B=z%360;return B<0&&(B+=360),B}t.bearingToAzimuth=C;function S(z){var B=z%(2*Math.PI);return B*180/Math.PI}t.radiansToDegrees=S;function x(z){var B=z%360;return B*Math.PI/180}t.degreesToRadians=x;function A(z,B,w){if(B===void 0&&(B="kilometers"),w===void 0&&(w="kilometers"),!(z>=0))throw new Error("length must be a positive number");return y(_(z,B),w)}t.convertLength=A;function R(z,B,w){if(B===void 0&&(B="meters"),w===void 0&&(w="kilometers"),!(z>=0))throw new Error("area must be a positive number");var E=t.areaFactors[B];if(!E)throw new Error("invalid original units");var D=t.areaFactors[w];if(!D)throw new Error("invalid final units");return z/E*D}t.convertArea=R;function O(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}t.isNumber=O;function N(z){return!!z&&z.constructor===Object}t.isObject=N;function V(z){if(!z)throw new Error("bbox is required");if(!Array.isArray(z))throw new Error("bbox must be an Array");if(z.length!==4&&z.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");z.forEach(function(B){if(!O(B))throw new Error("bbox must only contain numbers")})}t.validateBBox=V;function U(z){if(!z)throw new Error("id is required");if(["string","number"].indexOf(typeof z)===-1)throw new Error("id must be a number or a string")}t.validateId=U})(f0);var Je={};const zM=Wm($T);Object.defineProperty(Je,"__esModule",{value:!0});var wt=zM;function ta(t,i,e){if(t!==null)for(var n,o,s,r,l,c,u,d=0,p=0,f,g=t.type,m=g==="FeatureCollection",y=g==="Feature",_=m?t.features.length:1,P=0;P<_;P++){u=m?t.features[P].geometry:y?t.geometry:t,f=u?u.type==="GeometryCollection":!1,l=f?u.geometries.length:1;for(var C=0;C<l;C++){var S=0,x=0;if(r=f?u.geometries[C]:u,r!==null){c=r.coordinates;var A=r.type;switch(d=e&&(A==="Polygon"||A==="MultiPolygon")?1:0,A){case null:break;case"Point":if(i(c,p,P,S,x)===!1)return!1;p++,S++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(i(c[n],p,P,S,x)===!1)return!1;p++,A==="MultiPoint"&&S++}A==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-d;o++){if(i(c[n][o],p,P,S,x)===!1)return!1;p++}A==="MultiLineString"&&S++,A==="Polygon"&&x++}A==="Polygon"&&S++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(x=0,o=0;o<c[n].length;o++){for(s=0;s<c[n][o].length-d;s++){if(i(c[n][o][s],p,P,S,x)===!1)return!1;p++}x++}S++}break;case"GeometryCollection":for(n=0;n<r.geometries.length;n++)if(ta(r.geometries[n],i,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function LM(t,i,e,n){var o=e;return ta(t,function(s,r,l,c,u){r===0&&e===void 0?o=s:o=i(o,s,r,l,c,u)},n),o}function g0(t,i){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&i(t.features[e].properties,e)!==!1;e++);break;case"Feature":i(t.properties,0);break}}function OM(t,i,e){var n=e;return g0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function m0(t,i){if(t.type==="Feature")i(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&i(t.features[e],e)!==!1;e++);}function NM(t,i,e){var n=e;return m0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function BM(t){var i=[];return ta(t,function(e){i.push(e)}),i}function ff(t,i){var e,n,o,s,r,l,c,u,d,p,f=0,g=t.type==="FeatureCollection",m=t.type==="Feature",y=g?t.features.length:1;for(e=0;e<y;e++){for(l=g?t.features[e].geometry:m?t.geometry:t,u=g?t.features[e].properties:m?t.properties:{},d=g?t.features[e].bbox:m?t.bbox:void 0,p=g?t.features[e].id:m?t.id:void 0,c=l?l.type==="GeometryCollection":!1,r=c?l.geometries.length:1,o=0;o<r;o++){if(s=c?l.geometries[o]:l,s===null){if(i(null,f,u,d,p)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(i(s,f,u,d,p)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(i(s.geometries[n],f,u,d,p)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function VM(t,i,e){var n=e;return ff(t,function(o,s,r,l,c){s===0&&e===void 0?n=o:n=i(n,o,s,r,l,c)}),n}function xh(t,i){ff(t,function(e,n,o,s,r){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return i(wt.feature(e,o,{bbox:s,id:r}),n,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var d=e.coordinates[u],p={type:c,coordinates:d};if(i(wt.feature(p,o),n,u)===!1)return!1}})}function UM(t,i,e){var n=e;return xh(t,function(o,s,r){s===0&&r===0&&e===void 0?n=o:n=i(n,o,s,r)}),n}function v0(t,i){xh(t,function(e,n,o){var s=0;if(e.geometry){var r=e.geometry.type;if(!(r==="Point"||r==="MultiPoint")){var l,c=0,u=0,d=0;if(ta(e,function(p,f,g,m,y){if(l===void 0||n>c||m>u||y>d){l=p,c=n,u=m,d=y,s=0;return}var _=wt.lineString([l,p],e.properties);if(i(_,n,o,y,s)===!1)return!1;s++,l=p})===!1)return!1}}})}function WM(t,i,e){var n=e,o=!1;return v0(t,function(s,r,l,c,u){o===!1&&e===void 0?n=s:n=i(n,s,r,l,c,u),o=!0}),n}function y0(t,i){if(!t)throw new Error("geojson is required");xh(t,function(e,n,o){if(e.geometry!==null){var s=e.geometry.type,r=e.geometry.coordinates;switch(s){case"LineString":if(i(e,n,o,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<r.length;l++)if(i(wt.lineString(r[l],e.properties),n,o,l)===!1)return!1;break}}})}function GM(t,i,e){var n=e;return y0(t,function(o,s,r,l){s===0&&e===void 0?n=o:n=i(n,o,s,r,l)}),n}function HM(t,i){if(i=i||{},!wt.isObject(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.segmentIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=c.length+s-1),wt.lineString([c[s],c[s+1]],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),wt.lineString([c[o][s],c[o][s+1]],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s-1),wt.lineString([c[n][s],c[n][s+1]],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s-1),wt.lineString([c[n][o][s],c[n][o][s+1]],r,i)}throw new Error("geojson is invalid")}function $M(t,i){if(i=i||{},!wt.isObject(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.coordIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return wt.point(c,r,i);case"MultiPoint":return n<0&&(n=c.length+n),wt.point(c[n],r,i);case"LineString":return s<0&&(s=c.length+s),wt.point(c[s],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),wt.point(c[o][s],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s),wt.point(c[n][s],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s),wt.point(c[n][o][s],r,i)}throw new Error("geojson is invalid")}Je.coordAll=BM,Je.coordEach=ta,Je.coordReduce=LM,Je.featureEach=m0,Je.featureReduce=NM,Je.findPoint=$M,Je.findSegment=HM,Je.flattenEach=xh,Je.flattenReduce=UM,Je.geomEach=ff,Je.geomReduce=VM,Je.lineEach=y0,Je.lineReduce=GM,Je.propEach=g0,Je.propReduce=OM,Je.segmentEach=v0,Je.segmentReduce=WM;var gf={};const qM=Wm(iM);Object.defineProperty(gf,"__esModule",{value:!0});var XM=qM;function mf(t){var i=[1/0,1/0,-1/0,-1/0];return XM.coordEach(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}mf.default=mf,gf.default=mf;var Li=xM,w0=f0,C0=Je,qs=gf.default,YM=C0.featureEach;C0.coordEach,w0.polygon;var _0=w0.featureCollection;function P0(t){var i=new Li(t);return i.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:qs(e),Li.prototype.insert.call(this,e)},i.load=function(e){var n=[];return Array.isArray(e)?e.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:qs(o),n.push(o)}):YM(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:qs(o),n.push(o)}),Li.prototype.load.call(this,n)},i.remove=function(e,n){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:qs(e),Li.prototype.remove.call(this,e,n)},i.clear=function(){return Li.prototype.clear.call(this)},i.search=function(e){var n=Li.prototype.search.call(this,this.toBBox(e));return _0(n)},i.collides=function(e){return Li.prototype.collides.call(this,this.toBBox(e))},i.all=function(){var e=Li.prototype.all.call(this);return _0(e)},i.toJSON=function(){return Li.prototype.toJSON.call(this)},i.fromJSON=function(e){return Li.prototype.fromJSON.call(this,e)},i.toBBox=function(e){var n;if(e.bbox)n=e.bbox;else if(Array.isArray(e)&&e.length===4)n=e;else if(Array.isArray(e)&&e.length===6)n=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")n=qs(e);else if(e.type==="FeatureCollection")n=qs(e);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},i}pf.exports=P0,pf.exports.default=P0;var ZM=pf.exports;const QM=Ic(ZM);function vf(t,i){var e={},n=[];if(t.type==="LineString"&&(t=Xt(t)),i.type==="LineString"&&(i=Xt(i)),t.type==="Feature"&&i.type==="Feature"&&t.geometry!==null&&i.geometry!==null&&t.geometry.type==="LineString"&&i.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&i.geometry.coordinates.length===2){var o=b0(t,i);return o&&n.push(o),Ot(n)}var s=QM();return s.load(p0(i)),Us(p0(t),function(r){Us(s.search(r),function(l){var c=b0(r,l);if(c){var u=Ii(c).join(",");e[u]||(e[u]=!0,n.push(c))}})}),Ot(n)}function b0(t,i){var e=Ii(t),n=Ii(i);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],s=e[0][1],r=e[1][0],l=e[1][1],c=n[0][0],u=n[0][1],d=n[1][0],p=n[1][1],f=(p-u)*(r-o)-(d-c)*(l-s),g=(d-c)*(s-u)-(p-u)*(o-c),m=(r-o)*(s-u)-(l-s)*(o-c);if(f===0)return null;var y=g/f,_=m/f;if(y>=0&&y<=1&&_>=0&&_<=1){var P=o+y*(r-o),C=s+y*(l-s);return ht([P,C])}return null}function Ah(t,i,e){e===void 0&&(e={});for(var n=Sh(t),o=Ii(i),s=0;s<o.length-1;s++){var r=!1;if(e.ignoreEndVertices&&(s===0&&(r="start"),s===o.length-2&&(r="end"),s===0&&s+1===o.length-1&&(r="both")),kM(o[s],o[s+1],n,r,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function kM(t,i,e,n,o){var s=e[0],r=e[1],l=t[0],c=t[1],u=i[0],d=i[1],p=e[0]-l,f=e[1]-c,g=u-l,m=d-c,y=p*m-f*g;if(o!==null){if(Math.abs(y)>o)return!1}else if(y!==0)return!1;if(n){if(n==="start")return Math.abs(g)>=Math.abs(m)?g>0?l<s&&s<=u:u<=s&&s<l:m>0?c<r&&r<=d:d<=r&&r<c;if(n==="end")return Math.abs(g)>=Math.abs(m)?g>0?l<=s&&s<u:u<s&&s<=l:m>0?c<=r&&r<d:d<r&&r<=c;if(n==="both")return Math.abs(g)>=Math.abs(m)?g>0?l<s&&s<u:u<s&&s<l:m>0?c<r&&r<d:d<r&&r<c}else return Math.abs(g)>=Math.abs(m)?g>0?l<=s&&s<=u:u<=s&&s<=l:m>0?c<=r&&r<=d:d<=r&&r<=c;return!1}function KM(t,i){var e=Di(t),n=Di(i),o=e.type,s=n.type;switch(o){case"Point":switch(s){case"MultiPoint":return JM(e,n);case"LineString":return Ah(e,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Pt(e,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return jM(e,n);case"LineString":return eI(e,n);case"Polygon":case"MultiPolygon":return tI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return iI(e,n);case"Polygon":case"MultiPolygon":return nI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return oI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function JM(t,i){var e,n=!1;for(e=0;e<i.coordinates.length;e++)if(E0(i.coordinates[e],t.coordinates)){n=!0;break}return n}function jM(t,i){for(var e=0;e<t.coordinates.length;e++){for(var n=!1,o=0;o<i.coordinates.length;o++)E0(t.coordinates[e],i.coordinates[o])&&(n=!0);if(!n)return!1}return!0}function eI(t,i){for(var e=!1,n=0;n<t.coordinates.length;n++){if(!Ah(t.coordinates[n],i))return!1;e||(e=Ah(t.coordinates[n],i,{ignoreEndVertices:!0}))}return e}function tI(t,i){for(var e=!0,n=!1,o=0;o<t.coordinates.length;o++){if(n=Pt(t.coordinates[1],i),!n){e=!1;break}n=Pt(t.coordinates[1],i,{ignoreBoundary:!0})}return e&&n}function iI(t,i){for(var e=0;e<t.coordinates.length;e++)if(!Ah(t.coordinates[e],i))return!1;return!0}function nI(t,i){var e=Lo(i),n=Lo(t);if(!S0(e,n))return!1;for(var o=!1,s=0;s<t.coordinates.length-1;s++){if(!Pt(t.coordinates[s],i))return!1;if(o||(o=Pt(t.coordinates[s],i,{ignoreBoundary:!0})),!o){var r=sI(t.coordinates[s],t.coordinates[s+1]);o=Pt(r,i,{ignoreBoundary:!0})}}return o}function oI(t,i){var e=Lo(t),n=Lo(i);if(!S0(n,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!Pt(t.coordinates[0][o],i))return!1;return!0}function S0(t,i){return!(t[0]>i[0]||t[2]<i[2]||t[1]>i[1]||t[3]<i[3])}function E0(t,i){return t[0]===i[0]&&t[1]===i[1]}function sI(t,i){return[(t[0]+i[0])/2,(t[1]+i[1])/2]}function x0(t,i,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var n=[],o=t[0],s=t[1],r=t[2],l=t[3],c=i/Ri([o,s],[r,s],e),u=c*(r-o),d=i/Ri([o,s],[o,l],e),p=d*(l-s),f=r-o,g=l-s,m=Math.floor(f/u),y=Math.floor(g/p),_=(f-m*u)/2,P=(g-y*p)/2,C=o+_;C<=r;){for(var S=s+P;S<=l;){var x=ht([C,S],e.properties);e.mask?KM(x,e.mask)&&n.push(x):n.push(x),S+=p}C+=u}return Ot(n)}function yf(t,i){i===void 0&&(i={});var e=Di(t);switch(!i.properties&&t.type==="Feature"&&(i.properties=t.properties),e.type){case"Polygon":return rI(e,i);case"MultiPolygon":return aI(e,i);default:throw new Error("invalid poly")}}function rI(t,i){i===void 0&&(i={});var e=Di(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{};return A0(n,o)}function aI(t,i){i===void 0&&(i={});var e=Di(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{},s=[];return n.forEach(function(r){s.push(A0(r,o))}),Ot(s)}function A0(t,i){return t.length>1?nf(t,i):oi(t[0],i)}var T0=Object.prototype.toString,M0=function(i){var e=T0.call(i),n=e==="[object Arguments]";return n||(n=e!=="[object Array]"&&i!==null&&typeof i=="object"&&typeof i.length=="number"&&i.length>=0&&T0.call(i.callee)==="[object Function]"),n},wf,I0;function lI(){if(I0)return wf;I0=1;var t;if(!Object.keys){var i=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=M0,o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),r=o.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(f){var g=f.constructor;return g&&g.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},d=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&i.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{c(window[f])}catch{return!0}}catch{return!0}return!1}(),p=function(f){if(typeof window>"u"||!d)return c(f);try{return c(f)}catch{return!1}};t=function(g){var m=g!==null&&typeof g=="object",y=e.call(g)==="[object Function]",_=n(g),P=m&&e.call(g)==="[object String]",C=[];if(!m&&!y&&!_)throw new TypeError("Object.keys called on a non-object");var S=r&&y;if(P&&g.length>0&&!i.call(g,0))for(var x=0;x<g.length;++x)C.push(String(x));if(_&&g.length>0)for(var A=0;A<g.length;++A)C.push(String(A));else for(var R in g)!(S&&R==="prototype")&&i.call(g,R)&&C.push(String(R));if(s)for(var O=p(g),N=0;N<l.length;++N)!(O&&l[N]==="constructor")&&i.call(g,l[N])&&C.push(l[N]);return C}}return wf=t,wf}var cI=Array.prototype.slice,hI=M0,D0=Object.keys,Th=D0?function(i){return D0(i)}:lI(),R0=Object.keys;Th.shim=function(){if(Object.keys){var i=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);i||(Object.keys=function(n){return hI(n)?R0(cI.call(n)):R0(n)})}else Object.keys=Th;return Object.keys||Th};var F0=Th,z0=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;i[e]=o;for(var s in i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var r=Object.getOwnPropertySymbols(i);if(r.length!==1||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(i,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(i,e);if(l.value!==o||l.enumerable!==!0)return!1}return!0},uI=z0,Cf=function(){return uI()&&!!Symbol.toStringTag},L0=Object,O0=Error,dI=EvalError,pI=RangeError,fI=ReferenceError,N0=SyntaxError,Xs=TypeError,gI=URIError,mI=Math.abs,vI=Math.floor,yI=Math.max,wI=Math.min,CI=Math.pow,_I=Math.round,PI=Number.isNaN||function(i){return i!==i},bI=PI,SI=function(i){return bI(i)||i===0?i:i<0?-1:1},EI=Object.getOwnPropertyDescriptor,Mh=EI;if(Mh)try{Mh([],"length")}catch{Mh=null}var Ys=Mh,Ih=Object.defineProperty||!1;if(Ih)try{Ih({},"a",{value:1})}catch{Ih=!1}var Dh=Ih,_f,B0;function xI(){if(B0)return _f;B0=1;var t=typeof Symbol<"u"&&Symbol,i=z0;return _f=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()},_f}var V0=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,AI=L0,U0=AI.getPrototypeOf||null,TI="Function.prototype.bind called on incompatible ",MI=Object.prototype.toString,II=Math.max,DI="[object Function]",W0=function(i,e){for(var n=[],o=0;o<i.length;o+=1)n[o]=i[o];for(var s=0;s<e.length;s+=1)n[s+i.length]=e[s];return n},RI=function(i,e){for(var n=[],o=e,s=0;o<i.length;o+=1,s+=1)n[s]=i[o];return n},FI=function(t,i){for(var e="",n=0;n<t.length;n+=1)e+=t[n],n+1<t.length&&(e+=i);return e},zI=function(i){var e=this;if(typeof e!="function"||MI.apply(e)!==DI)throw new TypeError(TI+e);for(var n=RI(arguments,1),o,s=function(){if(this instanceof o){var d=e.apply(this,W0(n,arguments));return Object(d)===d?d:this}return e.apply(i,W0(n,arguments))},r=II(0,e.length-n.length),l=[],c=0;c<r;c++)l[c]="$"+c;if(o=Function("binder","return function ("+FI(l,",")+"){ return binder.apply(this,arguments); }")(s),e.prototype){var u=function(){};u.prototype=e.prototype,o.prototype=new u,u.prototype=null}return o},LI=zI,ia=Function.prototype.bind||LI,Pf=Function.prototype.call,bf=Function.prototype.apply,OI=typeof Reflect<"u"&&Reflect&&Reflect.apply,NI=ia,BI=bf,VI=Pf,UI=OI,G0=UI||NI.call(VI,BI),WI=ia,GI=Xs,HI=Pf,$I=G0,Sf=function(i){if(i.length<1||typeof i[0]!="function")throw new GI("a function is required");return $I(WI,HI,i)},qI=Sf,H0=Ys,$0;try{$0=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ef=!!$0&&H0&&H0(Object.prototype,"__proto__"),q0=Object,X0=q0.getPrototypeOf,XI=Ef&&typeof Ef.get=="function"?qI([Ef.get]):typeof X0=="function"?function(i){return X0(i==null?i:q0(i))}:!1,Y0=V0,Z0=U0,Q0=XI,k0=Y0?function(i){return Y0(i)}:Z0?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return Z0(i)}:Q0?function(i){return Q0(i)}:null,YI=Function.prototype.call,ZI=Object.prototype.hasOwnProperty,QI=ia,K0=QI.call(YI,ZI),me,kI=L0,KI=O0,JI=dI,jI=pI,eD=fI,Zs=N0,Qs=Xs,tD=gI,iD=mI,nD=vI,oD=yI,sD=wI,rD=CI,aD=_I,lD=SI,J0=Function,xf=function(t){try{return J0('"use strict"; return ('+t+").constructor;")()}catch{}},na=Ys,cD=Dh,Af=function(){throw new Qs},hD=na?function(){try{return arguments.callee,Af}catch{try{return na(arguments,"callee").get}catch{return Af}}}():Af,ks=xI()(),nt=k0,uD=U0,dD=V0,j0=bf,oa=Pf,Ks={},pD=typeof Uint8Array>"u"||!nt?me:nt(Uint8Array),Oo={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?me:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?me:ArrayBuffer,"%ArrayIteratorPrototype%":ks&&nt?nt([][Symbol.iterator]()):me,"%AsyncFromSyncIteratorPrototype%":me,"%AsyncFunction%":Ks,"%AsyncGenerator%":Ks,"%AsyncGeneratorFunction%":Ks,"%AsyncIteratorPrototype%":Ks,"%Atomics%":typeof Atomics>"u"?me:Atomics,"%BigInt%":typeof BigInt>"u"?me:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?me:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?me:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?me:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":KI,"%eval%":eval,"%EvalError%":JI,"%Float16Array%":typeof Float16Array>"u"?me:Float16Array,"%Float32Array%":typeof Float32Array>"u"?me:Float32Array,"%Float64Array%":typeof Float64Array>"u"?me:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?me:FinalizationRegistry,"%Function%":J0,"%GeneratorFunction%":Ks,"%Int8Array%":typeof Int8Array>"u"?me:Int8Array,"%Int16Array%":typeof Int16Array>"u"?me:Int16Array,"%Int32Array%":typeof Int32Array>"u"?me:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ks&&nt?nt(nt([][Symbol.iterator]())):me,"%JSON%":typeof JSON=="object"?JSON:me,"%Map%":typeof Map>"u"?me:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ks||!nt?me:nt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":kI,"%Object.getOwnPropertyDescriptor%":na,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?me:Promise,"%Proxy%":typeof Proxy>"u"?me:Proxy,"%RangeError%":jI,"%ReferenceError%":eD,"%Reflect%":typeof Reflect>"u"?me:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?me:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ks||!nt?me:nt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?me:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ks&&nt?nt(""[Symbol.iterator]()):me,"%Symbol%":ks?Symbol:me,"%SyntaxError%":Zs,"%ThrowTypeError%":hD,"%TypedArray%":pD,"%TypeError%":Qs,"%Uint8Array%":typeof Uint8Array>"u"?me:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?me:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?me:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?me:Uint32Array,"%URIError%":tD,"%WeakMap%":typeof WeakMap>"u"?me:WeakMap,"%WeakRef%":typeof WeakRef>"u"?me:WeakRef,"%WeakSet%":typeof WeakSet>"u"?me:WeakSet,"%Function.prototype.call%":oa,"%Function.prototype.apply%":j0,"%Object.defineProperty%":cD,"%Object.getPrototypeOf%":uD,"%Math.abs%":iD,"%Math.floor%":nD,"%Math.max%":oD,"%Math.min%":sD,"%Math.pow%":rD,"%Math.round%":aD,"%Math.sign%":lD,"%Reflect.getPrototypeOf%":dD};if(nt)try{null.error}catch(t){var fD=nt(nt(t));Oo["%Error.prototype%"]=fD}var gD=function t(i){var e;if(i==="%AsyncFunction%")e=xf("async function () {}");else if(i==="%GeneratorFunction%")e=xf("function* () {}");else if(i==="%AsyncGeneratorFunction%")e=xf("async function* () {}");else if(i==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(e=n.prototype)}else if(i==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&nt&&(e=nt(o.prototype))}return Oo[i]=e,e},ew={__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"]},sa=ia,Rh=K0,mD=sa.call(oa,Array.prototype.concat),vD=sa.call(j0,Array.prototype.splice),tw=sa.call(oa,String.prototype.replace),Fh=sa.call(oa,String.prototype.slice),yD=sa.call(oa,RegExp.prototype.exec),wD=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,CD=/\\(\\)?/g,_D=function(i){var e=Fh(i,0,1),n=Fh(i,-1);if(e==="%"&&n!=="%")throw new Zs("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&e!=="%")throw new Zs("invalid intrinsic syntax, expected opening `%`");var o=[];return tw(i,wD,function(s,r,l,c){o[o.length]=l?tw(c,CD,"$1"):r||s}),o},PD=function(i,e){var n=i,o;if(Rh(ew,n)&&(o=ew[n],n="%"+o[0]+"%"),Rh(Oo,n)){var s=Oo[n];if(s===Ks&&(s=gD(n)),typeof s>"u"&&!e)throw new Qs("intrinsic "+i+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Zs("intrinsic "+i+" does not exist!")},iw=function(i,e){if(typeof i!="string"||i.length===0)throw new Qs("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Qs('"allowMissing" argument must be a boolean');if(yD(/^%?[^%]*%?$/,i)===null)throw new Zs("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=_D(i),o=n.length>0?n[0]:"",s=PD("%"+o+"%",e),r=s.name,l=s.value,c=!1,u=s.alias;u&&(o=u[0],vD(n,mD([0,1],u)));for(var d=1,p=!0;d<n.length;d+=1){var f=n[d],g=Fh(f,0,1),m=Fh(f,-1);if((g==='"'||g==="'"||g==="`"||m==='"'||m==="'"||m==="`")&&g!==m)throw new Zs("property names with quotes must have matching quotes");if((f==="constructor"||!p)&&(c=!0),o+="."+f,r="%"+o+"%",Rh(Oo,r))l=Oo[r];else if(l!=null){if(!(f in l)){if(!e)throw new Qs("base intrinsic for "+i+" exists, but the property is not available.");return}if(na&&d+1>=n.length){var y=na(l,f);p=!!y,p&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[f]}else p=Rh(l,f),l=l[f];p&&!c&&(Oo[r]=l)}}return l},nw=iw,ow=Sf,bD=ow([nw("%String.prototype.indexOf%")]),Tf=function(i,e){var n=nw(i,!!e);return typeof n=="function"&&bD(i,".prototype.")>-1?ow([n]):n},SD=Cf(),ED=Tf,Mf=ED("Object.prototype.toString"),zh=function(i){return SD&&i&&typeof i=="object"&&Symbol.toStringTag in i?!1:Mf(i)==="[object Arguments]"},sw=function(i){return zh(i)?!0:i!==null&&typeof i=="object"&&"length"in i&&typeof i.length=="number"&&i.length>=0&&Mf(i)!=="[object Array]"&&"callee"in i&&Mf(i.callee)==="[object Function]"},xD=function(){return zh(arguments)}();zh.isLegacyArguments=sw;var AD=xD?zh:sw,rw=Dh,TD=N0,Js=Xs,aw=Ys,If=function(i,e,n){if(!i||typeof i!="object"&&typeof i!="function")throw new Js("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Js("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Js("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Js("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Js("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Js("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,r=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!aw&&aw(i,e);if(rw)rw(i,e,{configurable:r===null&&c?c.configurable:!r,enumerable:o===null&&c?c.enumerable:!o,value:n,writable:s===null&&c?c.writable:!s});else if(l||!o&&!s&&!r)i[e]=n;else throw new TD("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Df=Dh,lw=function(){return!!Df};lw.hasArrayLengthDefineBug=function(){if(!Df)return null;try{return Df([],"length",{value:1}).length!==1}catch{return!0}};var Rf=lw,MD=F0,ID=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",DD=Object.prototype.toString,RD=Array.prototype.concat,cw=If,FD=function(t){return typeof t=="function"&&DD.call(t)==="[object Function]"},hw=Rf(),zD=function(t,i,e,n){if(i in t){if(n===!0){if(t[i]===e)return}else if(!FD(n)||!n())return}hw?cw(t,i,e,!0):cw(t,i,e)},uw=function(t,i){var e=arguments.length>2?arguments[2]:{},n=MD(i);ID&&(n=RD.call(n,Object.getOwnPropertySymbols(i)));for(var o=0;o<n.length;o+=1)zD(t,n[o],i[n[o]],e[n[o]])};uw.supportsDescriptors=!!hw;var ra=uw,dw={exports:{}},LD=iw,pw=If,OD=Rf(),fw=Ys,gw=Xs,ND=LD("%Math.floor%"),BD=function(i,e){if(typeof i!="function")throw new gw("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||ND(e)!==e)throw new gw("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,s=!0;if("length"in i&&fw){var r=fw(i,"length");r&&!r.configurable&&(o=!1),r&&!r.writable&&(s=!1)}return(o||s||!n)&&(OD?pw(i,"length",e,!0,!0):pw(i,"length",e)),i},VD=ia,UD=bf,WD=G0,GD=function(){return WD(VD,UD,arguments)};(function(t){var i=BD,e=Dh,n=Sf,o=GD;t.exports=function(r){var l=n(arguments),c=r.length-(arguments.length-1);return i(l,1+(c>0?c:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(dw);var mw=dw.exports,vw=function(t){return t!==t},yw=function(i,e){return i===0&&e===0?1/i===1/e:!!(i===e||vw(i)&&vw(e))},HD=yw,ww=function(){return typeof Object.is=="function"?Object.is:HD},$D=ww,qD=ra,XD=function(){var i=$D();return qD(Object,{is:i},{is:function(){return Object.is!==i}}),i},YD=ra,ZD=mw,QD=yw,Cw=ww,kD=XD,_w=ZD(Cw(),Object);YD(_w,{getPolyfill:Cw,implementation:QD,shim:kD});var KD=_w,Pw=Tf,JD=Cf(),jD=K0,eR=Ys,Ff;if(JD){var tR=Pw("RegExp.prototype.exec"),bw={},zf=function(){throw bw},Sw={toString:zf,valueOf:zf};typeof Symbol.toPrimitive=="symbol"&&(Sw[Symbol.toPrimitive]=zf),Ff=function(i){if(!i||typeof i!="object")return!1;var e=eR(i,"lastIndex"),n=e&&jD(e,"value");if(!n)return!1;try{tR(i,Sw)}catch(o){return o===bw}}}else{var iR=Pw("Object.prototype.toString"),nR="[object RegExp]";Ff=function(i){return!i||typeof i!="object"&&typeof i!="function"?!1:iR(i)===nR}}var oR=Ff,aa=function(){return typeof(function(){}).name=="string"},la=Object.getOwnPropertyDescriptor;if(la)try{la([],"length")}catch{la=null}aa.functionsHaveConfigurableNames=function(){if(!aa()||!la)return!1;var i=la(function(){},"name");return!!i&&!!i.configurable};var sR=Function.prototype.bind;aa.boundFunctionsHaveNames=function(){return aa()&&typeof sR=="function"&&(function(){}).bind().name!==""};var rR=aa,Ew=If,aR=Rf(),lR=rR.functionsHaveConfigurableNames(),cR=Xs,hR=function(i,e){if(typeof i!="function")throw new cR("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||lR)&&(aR?Ew(i,"name",e,!0,!0):Ew(i,"name",e)),i},uR=hR,dR=Xs,pR=Object,xw=uR(function(){if(this==null||this!==pR(this))throw new dR("RegExp.prototype.flags getter called on non-object");var i="";return this.hasIndices&&(i+="d"),this.global&&(i+="g"),this.ignoreCase&&(i+="i"),this.multiline&&(i+="m"),this.dotAll&&(i+="s"),this.unicode&&(i+="u"),this.unicodeSets&&(i+="v"),this.sticky&&(i+="y"),i},"get flags",!0),fR=xw,gR=ra.supportsDescriptors,mR=Object.getOwnPropertyDescriptor,Aw=function(){if(gR&&/a/mig.flags==="gim"){var i=mR(RegExp.prototype,"flags");if(i&&typeof i.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(n,"sticky",{get:function(){e+="y"}}),i.get.call(n),e==="dy")return i.get}}return fR},vR=ra.supportsDescriptors,yR=Aw,wR=Ys,CR=Object.defineProperty,_R=O0,Tw=k0,PR=/a/,bR=function(){if(!vR||!Tw)throw new _R("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var i=yR(),e=Tw(PR),n=wR(e,"flags");return(!n||n.get!==i)&&CR(e,"flags",{configurable:!0,enumerable:!1,get:i}),i},SR=ra,ER=mw,xR=xw,Mw=Aw,AR=bR,Iw=ER(Mw());SR(Iw,{getPolyfill:Mw,implementation:xR,shim:AR});var TR=Iw,Dw=Tf,MR=Dw("Date.prototype.getDay"),IR=function(i){try{return MR(i),!0}catch{return!1}},DR=Dw("Object.prototype.toString"),RR="[object Date]",FR=Cf(),zR=function(i){return typeof i!="object"||i===null?!1:FR?IR(i):DR(i)===RR},Rw=F0,Fw=AD,zw=KD,Lw=oR,Ow=TR,Nw=zR,Bw=Date.prototype.getTime;function Vw(t,i,e){var n=e||{};return(n.strict?zw(t,i):t===i)?!0:!t||!i||typeof t!="object"&&typeof i!="object"?n.strict?zw(t,i):t==i:LR(t,i,n)}function Uw(t){return t==null}function Ww(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 LR(t,i,e){var n,o;if(typeof t!=typeof i||Uw(t)||Uw(i)||t.prototype!==i.prototype||Fw(t)!==Fw(i))return!1;var s=Lw(t),r=Lw(i);if(s!==r)return!1;if(s||r)return t.source===i.source&&Ow(t)===Ow(i);if(Nw(t)&&Nw(i))return Bw.call(t)===Bw.call(i);var l=Ww(t),c=Ww(i);if(l!==c)return!1;if(l||c){if(t.length!==i.length)return!1;for(n=0;n<t.length;n++)if(t[n]!==i[n])return!1;return!0}if(typeof t!=typeof i)return!1;try{var u=Rw(t),d=Rw(i)}catch{return!1}if(u.length!==d.length)return!1;for(u.sort(),d.sort(),n=u.length-1;n>=0;n--)if(u[n]!=d[n])return!1;for(n=u.length-1;n>=0;n--)if(o=u[n],!Vw(t[o],i[o],e))return!1;return!0}var OR=Vw;function NR(t,i){var e=!0;return ji(t,function(n){ji(i,function(o){if(e===!1)return!1;e=BR(n.geometry,o.geometry)})}),e}function BR(t,i){switch(t.type){case"Point":switch(i.type){case"Point":return!GR(t.coordinates,i.coordinates);case"LineString":return!Gw(i,t);case"Polygon":return!Pt(t,i)}break;case"LineString":switch(i.type){case"Point":return!Gw(t,i);case"LineString":return!VR(t,i);case"Polygon":return!Hw(i,t)}break;case"Polygon":switch(i.type){case"Point":return!Pt(i,t);case"LineString":return!Hw(t,i);case"Polygon":return!UR(i,t)}}return!1}function Gw(t,i){for(var e=0;e<t.coordinates.length-1;e++)if(WR(t.coordinates[e],t.coordinates[e+1],i.coordinates))return!0;return!1}function VR(t,i){var e=vf(t,i);return e.features.length>0}function Hw(t,i){for(var e=0,n=i.coordinates;e<n.length;e++){var o=n[e];if(Pt(o,t))return!0}var s=vf(i,yf(t));return s.features.length>0}function UR(t,i){for(var e=0,n=t.coordinates[0];e<n.length;e++){var o=n[e];if(Pt(o,i))return!0}for(var s=0,r=i.coordinates[0];s<r.length;s++){var l=r[s];if(Pt(l,t))return!0}var c=vf(yf(t),yf(i));return c.features.length>0}function WR(t,i,e){var n=e[0]-t[0],o=e[1]-t[1],s=i[0]-t[0],r=i[1]-t[1],l=n*r-o*s;return l!==0?!1:Math.abs(s)>=Math.abs(r)?s>0?t[0]<=e[0]&&e[0]<=i[0]:i[0]<=e[0]&&e[0]<=t[0]:r>0?t[1]<=e[1]&&e[1]<=i[1]:i[1]<=e[1]&&e[1]<=t[1]}function GR(t,i){return t[0]===i[0]&&t[1]===i[1]}var HR=OR,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:$R};Oi.prototype.compare=function(t,i){if(t.type!==i.type||!qw(t,i))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,i.coordinates);case"LineString":return this.compareLine(t.coordinates,i.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,i);case"Feature":return this.compareFeature(t,i);default:if(t.type.indexOf("Multi")===0){var e=this,n=$w(t),o=$w(i);return n.every(function(s){return this.some(function(r){return e.compare(s,r)})},o)}}return!1};function $w(t){return t.coordinates.map(function(i){return{type:t.type.replace("Multi",""),coordinates:i}})}function qw(t,i){return t.hasOwnProperty("coordinates")?t.coordinates.length===i.coordinates.length:t.length===i.length}Oi.prototype.compareCoord=function(t,i){if(t.length!==i.length)return!1;for(var e=0;e<t.length;e++)if(t[e].toFixed(this.precision)!==i[e].toFixed(this.precision))return!1;return!0},Oi.prototype.compareLine=function(t,i,e,n){if(!qw(t,i))return!1;var o=this.pseudoNode?t:this.removePseudo(t),s=this.pseudoNode?i:this.removePseudo(i);if(!(n&&!this.compareCoord(o[0],s[0])&&(s=this.fixStartIndex(s,o),!s))){var r=this.compareCoord(o[e],s[e]);return this.direction||r?this.comparePath(o,s):this.compareCoord(o[e],s[s.length-(1+e)])?this.comparePath(o.slice().reverse(),s):!1}},Oi.prototype.fixStartIndex=function(t,i){for(var e,n=-1,o=0;o<t.length;o++)if(this.compareCoord(t[o],i[0])){n=o;break}return n>=0&&(e=[].concat(t.slice(n,t.length),t.slice(1,n+1))),e},Oi.prototype.comparePath=function(t,i){var e=this;return t.every(function(n,o){return e.compareCoord(n,this[o])},i)},Oi.prototype.comparePolygon=function(t,i){if(this.compareLine(t.coordinates[0],i.coordinates[0],1,!0)){var e=t.coordinates.slice(1,t.coordinates.length),n=i.coordinates.slice(1,i.coordinates.length),o=this;return e.every(function(s){return this.some(function(r){return o.compareLine(s,r,1,!0)})},n)}else return!1},Oi.prototype.compareFeature=function(t,i){return t.id!==i.id||!this.objectComparator(t.properties,i.properties)||!this.compareBBox(t,i)?!1:this.compare(t.geometry,i.geometry)},Oi.prototype.compareBBox=function(t,i){return!!(!t.bbox&&!i.bbox||t.bbox&&i.bbox&&this.compareCoord(t.bbox,i.bbox))},Oi.prototype.removePseudo=function(t){return t};function $R(t,i){return HR(t,i,{strict:!0})}var qR=Oi;const XR=Ic(qR);function YR(t,i){var e=Di(t).type,n=Di(i).type;if(e!==n)return!1;var o=new XR({precision:6});return o.compare(h0(t),h0(i))}function ZR(t,i){var e=!1;return ji(t,function(n){ji(i,function(o){if(e===!0)return!0;e=!NR(n.geometry,o.geometry)})}),e}/**
1857
+ `,Qn=class Qn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_player");v(this,"_finalImageUrlReact",this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));v(this,"_routePaths",this.disposeVar(a.react(void 0)));v(this,"routePathCallback");v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this._id.value=n),this._player=this.disposeVar(new a.Player);{const g=Qn.defaults;this.dispose(a.bind([this._player,"loop"],[this,"loop"],m=>m??g.loop,m=>m??g.loop)),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"],m=>m??g.currentTime,m=>m??g.currentTime)),this.dispose(a.bind([this._player,"duration"],[this,"duration"],m=>m??g.duration,m=>m??g.duration)),this.dispose(a.bind([this._player,"playing"],[this,"playing"],m=>m??g.playing,m=>m??g.playing)),this.dispose(a.bind([this._player,"speed"],[this,"speed"],m=>m??g.speed,m=>m??g.speed))}const o=this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),s=this.disposeVar(a.createProcessingFromAsyncFunc(async g=>{this.routePaths=void 0;const m=o.value;if(m)try{const _=await(await fetch(m)).json();this.routePaths=aM(_,this.width,this.repeatLength);return}catch(y){console.error(`geojson加载解析出错!${y}`),console.error(y)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const y=this.positionsSet;if(y){this.routePaths=y.map(_=>({positions:_,width:this.width}));return}}}));{const g=()=>{s.restart()};g();const m=this.disposeVar(a.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(m.disposableOn(g))}{const g=()=>{const m=Pu(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);m&&(this.routePathCallback=m)};g(),this.dispose(this.routePathCallbackStrChanged.disposableOn(g))}const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const l=this.finalImageUrlReact,c=this.disposeVar(new ns),u=this.disposeVar(a.createProcessingFromAsyncFunc(async g=>{if(!l.value)return;const m=Im(r.scene.context).getTextureHandler(l.value);if(m instanceof ns)c.reset(m);else{const y=await g.promise(m);c.reset(y)}})),d=()=>c.valid?c.raw:r.scene.context.defaultTexture,p=()=>u.restart();p(),this.dispose(l.changed.disposableOn(p));const f=this.ad(a.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new a.ObjResettingWithEvent(f,()=>this.routePaths?new bM(r,this,l.value&&d||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(g=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))ne(r,this.routePaths[0].startPos,r.camera.positionCartographic.height,void 0,g);else{const m=computeBoundingSphere(this.routePaths[0].positions);if(!m)return;const[y,_]=m;ne(r,y,_*3,void 0,g)}}))}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}};v(Qn,"whiteGradientImageBase64",SM),v(Qn,"defaultRoutePathCallback",function(e,n,o){const s=n/50,r=s-Math.floor(s);return e.color=[r*.5+.5,(1-r)*.5+.5,.5,1],e.bgColor=[r*.5+.5,(1-r)*.5+.5,.5,.3],e}),v(Qn,"routePathCallbackStrMd",EM),v(Qn,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(Qn,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let tn=Qn;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:a.reactPositionsSet(void 0),data:a.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(tn||(tn={})),a.extendClassProps(tn.prototype,tn.createDefaultProps);class Bn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_collection");this._collection=this.disposeVar(new tn(e,n)),this.dispose(a.track([this._collection,"show"],[this,"show"])),this.dispose(a.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(a.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(a.track([this._collection,"color"],[this,"color"])),this.dispose(a.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(a.track([this._collection,"width"],[this,"width"])),this.dispose(a.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(a.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(a.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(a.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(a.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(a.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(a.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([this._collection,"playing"],[this,"playing"])),this.dispose(a.track([this._collection,"loop"],[this,"loop"])),this.dispose(a.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._collection,"duration"],[this,"duration"])),this.dispose(a.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((r,l)=>{var c;if(!(!this.positions||l==((c=this.positions)==null?void 0:c.length)-1))return{startPos:r,endPos:this.positions[l+1],width:this.width,heightRatio:this.heightRatio}}).filter(r=>r!==void 0);return}this._collection.data=void 0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(s.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}}v(Bn,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(Bn,"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:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:a.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Bn||(Bn={})),a.extendClassProps(Bn.prototype,Bn.createDefaultProps);const Ll=class Ll extends vt{constructor(e,n){super(e,n);v(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Bn(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmSignalTransmission;{const r=()=>{s.show=e.show&&e.stroked};r(),this.ad(e.showChanged.don(r)),this.ad(e.strokedChanged.don(r))}this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"bgColor"],[e,"strokeColor"])),this.dispose(a.track([s,"startTime"],[e,"startTime"])),this.dispose(a.track([s,"transmissionTime"],[e,"transmissionTime"])),this.dispose(a.track([s,"heightRatio"],[e,"heightRatio"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"brightening"],[e,"brightening"])),this.dispose(a.track([s,"depthTest"],[e,"depthTest"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"bidirectional"],[e,"bidirectional"])),this.dispose(a.track([s,"loop"],[e,"loop"])),this.dispose(a.track([s,"currentTime"],[e,"currentTime"])),this.dispose(a.track([s,"duration"],[e,"duration"])),this.dispose(a.track([s,"playing"],[e,"playing"])),this.dispose(a.track([s,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Ll,"type",Ll.register("ESCesiumViewer",wh.type,Ll));let hf=Ll;function Lo(t){var i=[1/0,1/0,-1/0,-1/0];return Fo(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}Lo.default=Lo;var s0={exports:{}};(function(t,i){(function(e,n){t.exports=n()})(vo,function(){function e(C,S,x,A,R){(function O(N,V,U,z,B){for(;z>U;){if(z-U>600){var w=z-U+1,E=V-U+1,D=Math.log(w),L=.5*Math.exp(2*D/3),G=.5*Math.sqrt(D*L*(w-L)/w)*(E-w/2<0?-1:1),Y=Math.max(U,Math.floor(V-E*L/w+G)),q=Math.min(z,Math.floor(V+(w-E)*L/w+G));O(N,V,Y,q,B)}var X=N[V],Q=U,ee=z;for(n(N,U,V),B(N[z],X)>0&&n(N,U,z);Q<ee;){for(n(N,Q,ee),Q++,ee--;B(N[Q],X)<0;)Q++;for(;B(N[ee],X)>0;)ee--}B(N[U],X)===0?n(N,U,ee):n(N,++ee,z),ee<=V&&(U=ee+1),V<=ee&&(z=ee-1)}})(C,S,x||0,A||C.length-1,R||o)}function n(C,S,x){var A=C[S];C[S]=C[x],C[x]=A}function o(C,S){return C<S?-1:C>S?1:0}var s=function(C){C===void 0&&(C=9),this._maxEntries=Math.max(4,C),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function r(C,S,x){if(!x)return S.indexOf(C);for(var A=0;A<S.length;A++)if(x(C,S[A]))return A;return-1}function l(C,S){c(C,0,C.children.length,S,C)}function c(C,S,x,A,R){R||(R=_(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var O=S;O<x;O++){var N=C.children[O];u(R,C.leaf?A(N):N)}return R}function u(C,S){return C.minX=Math.min(C.minX,S.minX),C.minY=Math.min(C.minY,S.minY),C.maxX=Math.max(C.maxX,S.maxX),C.maxY=Math.max(C.maxY,S.maxY),C}function d(C,S){return C.minX-S.minX}function p(C,S){return C.minY-S.minY}function f(C){return(C.maxX-C.minX)*(C.maxY-C.minY)}function g(C){return C.maxX-C.minX+(C.maxY-C.minY)}function m(C,S){return C.minX<=S.minX&&C.minY<=S.minY&&S.maxX<=C.maxX&&S.maxY<=C.maxY}function y(C,S){return S.minX<=C.maxX&&S.minY<=C.maxY&&S.maxX>=C.minX&&S.maxY>=C.minY}function _(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function P(C,S,x,A,R){for(var O=[S,x];O.length;)if(!((x=O.pop())-(S=O.pop())<=A)){var N=S+Math.ceil((x-S)/A/2)*A;e(C,N,S,x,R),O.push(S,N,N,x)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(C){var S=this.data,x=[];if(!y(C,S))return x;for(var A=this.toBBox,R=[];S;){for(var O=0;O<S.children.length;O++){var N=S.children[O],V=S.leaf?A(N):N;y(C,V)&&(S.leaf?x.push(N):m(C,V)?this._all(N,x):R.push(N))}S=R.pop()}return x},s.prototype.collides=function(C){var S=this.data;if(!y(C,S))return!1;for(var x=[];S;){for(var A=0;A<S.children.length;A++){var R=S.children[A],O=S.leaf?this.toBBox(R):R;if(y(C,O)){if(S.leaf||m(C,O))return!0;x.push(R)}}S=x.pop()}return!1},s.prototype.load=function(C){if(!C||!C.length)return this;if(C.length<this._minEntries){for(var S=0;S<C.length;S++)this.insert(C[S]);return this}var x=this._build(C.slice(),0,C.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 A=this.data;this.data=x,x=A}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},s.prototype.insert=function(C){return C&&this._insert(C,this.data.height-1),this},s.prototype.clear=function(){return this.data=_([]),this},s.prototype.remove=function(C,S){if(!C)return this;for(var x,A,R,O=this.data,N=this.toBBox(C),V=[],U=[];O||V.length;){if(O||(O=V.pop(),A=V[V.length-1],x=U.pop(),R=!0),O.leaf){var z=r(C,O.children,S);if(z!==-1)return O.children.splice(z,1),V.push(O),this._condense(V),this}R||O.leaf||!m(O,N)?A?(x++,O=A.children[x],R=!1):O=null:(V.push(O),U.push(x),x=0,A=O,O=O.children[0])}return this},s.prototype.toBBox=function(C){return C},s.prototype.compareMinX=function(C,S){return C.minX-S.minX},s.prototype.compareMinY=function(C,S){return C.minY-S.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(C){return this.data=C,this},s.prototype._all=function(C,S){for(var x=[];C;)C.leaf?S.push.apply(S,C.children):x.push.apply(x,C.children),C=x.pop();return S},s.prototype._build=function(C,S,x,A){var R,O=x-S+1,N=this._maxEntries;if(O<=N)return l(R=_(C.slice(S,x+1)),this.toBBox),R;A||(A=Math.ceil(Math.log(O)/Math.log(N)),N=Math.ceil(O/Math.pow(N,A-1))),(R=_([])).leaf=!1,R.height=A;var V=Math.ceil(O/N),U=V*Math.ceil(Math.sqrt(N));P(C,S,x,U,this.compareMinX);for(var z=S;z<=x;z+=U){var B=Math.min(z+U-1,x);P(C,z,B,V,this.compareMinY);for(var w=z;w<=B;w+=V){var E=Math.min(w+V-1,B);R.children.push(this._build(C,w,E,A-1))}}return l(R,this.toBBox),R},s.prototype._chooseSubtree=function(C,S,x,A){for(;A.push(S),!S.leaf&&A.length-1!==x;){for(var R=1/0,O=1/0,N=void 0,V=0;V<S.children.length;V++){var U=S.children[V],z=f(U),B=(w=C,E=U,(Math.max(E.maxX,w.maxX)-Math.min(E.minX,w.minX))*(Math.max(E.maxY,w.maxY)-Math.min(E.minY,w.minY))-z);B<O?(O=B,R=z<R?z:R,N=U):B===O&&z<R&&(R=z,N=U)}S=N||S.children[0]}var w,E;return S},s.prototype._insert=function(C,S,x){var A=x?C:this.toBBox(C),R=[],O=this._chooseSubtree(A,this.data,S,R);for(O.children.push(C),u(O,A);S>=0&&R[S].children.length>this._maxEntries;)this._split(R,S),S--;this._adjustParentBBoxes(A,R,S)},s.prototype._split=function(C,S){var x=C[S],A=x.children.length,R=this._minEntries;this._chooseSplitAxis(x,R,A);var O=this._chooseSplitIndex(x,R,A),N=_(x.children.splice(O,x.children.length-O));N.height=x.height,N.leaf=x.leaf,l(x,this.toBBox),l(N,this.toBBox),S?C[S-1].children.push(N):this._splitRoot(x,N)},s.prototype._splitRoot=function(C,S){this.data=_([C,S]),this.data.height=C.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(C,S,x){for(var A,R,O,N,V,U,z,B=1/0,w=1/0,E=S;E<=x-S;E++){var D=c(C,0,E,this.toBBox),L=c(C,E,x,this.toBBox),G=(R=D,O=L,N=void 0,V=void 0,U=void 0,z=void 0,N=Math.max(R.minX,O.minX),V=Math.max(R.minY,O.minY),U=Math.min(R.maxX,O.maxX),z=Math.min(R.maxY,O.maxY),Math.max(0,U-N)*Math.max(0,z-V)),Y=f(D)+f(L);G<B?(B=G,A=E,w=Y<w?Y:w):G===B&&Y<w&&(w=Y,A=E)}return A||x-S},s.prototype._chooseSplitAxis=function(C,S,x){var A=C.leaf?this.compareMinX:d,R=C.leaf?this.compareMinY:p;this._allDistMargin(C,S,x,A)<this._allDistMargin(C,S,x,R)&&C.children.sort(A)},s.prototype._allDistMargin=function(C,S,x,A){C.children.sort(A);for(var R=this.toBBox,O=c(C,0,S,R),N=c(C,x-S,x,R),V=g(O)+g(N),U=S;U<x-S;U++){var z=C.children[U];u(O,C.leaf?R(z):z),V+=g(O)}for(var B=x-S-1;B>=S;B--){var w=C.children[B];u(N,C.leaf?R(w):w),V+=g(N)}return V},s.prototype._adjustParentBBoxes=function(C,S,x){for(var A=x;A>=0;A--)u(S[A],C)},s.prototype._condense=function(C){for(var S=C.length-1,x=void 0;S>=0;S--)C[S].children.length===0?S>0?(x=C[S-1].children).splice(x.indexOf(C[S]),1):this.clear():l(C[S],this.toBBox)},s})})(s0);var xM=s0.exports;function Pt(t,i,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!i)throw new Error("polygon is required");var n=Sh(t),o=Di(i),s=o.type,r=i.bbox,l=o.coordinates;if(r&&AM(n,r)===!1)return!1;s==="Polygon"&&(l=[l]);for(var c=!1,u=0;u<l.length&&!c;u++)if(r0(n,l[u][0],e.ignoreBoundary)){for(var d=!1,p=1;p<l[u].length&&!d;)r0(n,l[u][p],!e.ignoreBoundary)&&(d=!0),p++;d||(c=!0)}return c}function r0(t,i,e){var n=!1;i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]&&(i=i.slice(0,i.length-1));for(var o=0,s=i.length-1;o<i.length;s=o++){var r=i[o][0],l=i[o][1],c=i[s][0],u=i[s][1],d=t[1]*(r-c)+l*(c-t[0])+u*(t[0]-r)===0&&(r-t[0])*(c-t[0])<=0&&(l-t[1])*(u-t[1])<=0;if(d)return!e;var p=l>t[1]!=u>t[1]&&t[0]<(c-r)*(t[1]-l)/(u-l)+r;p&&(n=!n)}return n}function AM(t,i){return i[0]<=t[0]&&i[1]<=t[1]&&i[2]>=t[0]&&i[3]>=t[1]}function TM(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return a0(t);case"FeatureCollection":return MM(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return uf(t);default:throw new Error("unknown GeoJSON type")}}function a0(t){var i={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:i[e]=t[e]}}),i.properties=l0(t.properties),i.geometry=uf(t.geometry),i}function l0(t){var i={};return t&&Object.keys(t).forEach(function(e){var n=t[e];typeof n=="object"?n===null?i[e]=null:Array.isArray(n)?i[e]=n.map(function(o){return o}):i[e]=l0(n):i[e]=n}),i}function MM(t){var i={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:i[e]=t[e]}}),i.features=t.features.map(function(e){return a0(e)}),i}function uf(t){var i={type:t.type};return t.bbox&&(i.bbox=t.bbox),t.type==="GeometryCollection"?(i.geometries=t.geometries.map(function(e){return uf(e)}),i):(i.coordinates=c0(t.coordinates),i)}function c0(t){var i=t;return typeof i[0]!="object"?i.slice():i.map(function(e){return c0(e)})}function h0(t,i){i===void 0&&(i={});var e=typeof i=="object"?i.mutate:i;if(!t)throw new Error("geojson is required");var n=XT(t),o=[];switch(n){case"LineString":o=df(t);break;case"MultiLineString":case"Polygon":Ii(t).forEach(function(r){o.push(df(r))});break;case"MultiPolygon":Ii(t).forEach(function(r){var l=[];r.forEach(function(c){l.push(df(c))}),o.push(l)});break;case"Point":return t;case"MultiPoint":var s={};Ii(t).forEach(function(r){var l=r.join("-");Object.prototype.hasOwnProperty.call(s,l)||(o.push(r),s[l]=!0)});break;default:throw new Error(n+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:n,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Xt({type:n,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function df(t){var i=Ii(t);if(i.length===2&&!u0(i[0],i[1]))return i;var e=[],n=i.length-1,o=e.length;e.push(i[0]);for(var s=1;s<n;s++){var r=e[e.length-1];i[s][0]===r[0]&&i[s][1]===r[1]||(e.push(i[s]),o=e.length,o>2&&d0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(i[i.length-1]),o=e.length,u0(i[0],i[i.length-1])&&o<4)throw new Error("invalid polygon");return d0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function u0(t,i){return t[0]===i[0]&&t[1]===i[1]}function d0(t,i,e){var n=e[0],o=e[1],s=t[0],r=t[1],l=i[0],c=i[1],u=n-s,d=o-r,p=l-s,f=c-r,g=u*f-d*p;return g!==0?!1:Math.abs(p)>=Math.abs(f)?p>0?s<=n&&n<=l:l<=n&&n<=s:f>0?r<=o&&o<=c:c<=o&&o<=r}function IM(t,i){i===void 0&&(i={});var e=0,n=0,o=0;return Fo(t,function(s){e+=s[0],n+=s[1],o++},!0),ht([e/o,n/o],i.properties)}function p0(t){if(!t)throw new Error("geojson is required");var i=[];return ji(t,function(e){DM(e,i)}),Ot(i)}function DM(t,i){var e=[],n=t.geometry;if(n!==null){switch(n.type){case"Polygon":e=Ii(n);break;case"LineString":e=[Ii(n)]}e.forEach(function(o){var s=RM(o,t.properties);s.forEach(function(r){r.id=i.length,i.push(r)})})}}function RM(t,i){var e=[];return t.reduce(function(n,o){var s=oi([n,o],i);return s.bbox=FM(n,o),e.push(s),o}),e}function FM(t,i){var e=t[0],n=t[1],o=i[0],s=i[1],r=e<o?e:o,l=n<s?n:s,c=e>o?e:o,u=n>s?n:s;return[r,l,c,u]}var pf={exports:{}},f0={};(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: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/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 i(z,B,w){w===void 0&&(w={});var E={type:"Feature"};return(w.id===0||w.id)&&(E.id=w.id),w.bbox&&(E.bbox=w.bbox),E.properties=B||{},E.geometry=z,E}t.feature=i;function e(z,B,w){switch(z){case"Point":return n(B).geometry;case"LineString":return l(B).geometry;case"Polygon":return s(B).geometry;case"MultiPoint":return p(B).geometry;case"MultiLineString":return d(B).geometry;case"MultiPolygon":return f(B).geometry;default:throw new Error(z+" is invalid")}}t.geometry=e;function n(z,B,w){if(w===void 0&&(w={}),!z)throw new Error("coordinates is required");if(!Array.isArray(z))throw new Error("coordinates must be an Array");if(z.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!O(z[0])||!O(z[1]))throw new Error("coordinates must contain numbers");var E={type:"Point",coordinates:z};return i(E,B,w)}t.point=n;function o(z,B,w){return w===void 0&&(w={}),u(z.map(function(E){return n(E,B)}),w)}t.points=o;function s(z,B,w){w===void 0&&(w={});for(var E=0,D=z;E<D.length;E++){var L=D[E];if(L.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var G=0;G<L[L.length-1].length;G++)if(L[L.length-1][G]!==L[0][G])throw new Error("First and last Position are not equivalent.")}var Y={type:"Polygon",coordinates:z};return i(Y,B,w)}t.polygon=s;function r(z,B,w){return w===void 0&&(w={}),u(z.map(function(E){return s(E,B)}),w)}t.polygons=r;function l(z,B,w){if(w===void 0&&(w={}),z.length<2)throw new Error("coordinates must be an array of two or more positions");var E={type:"LineString",coordinates:z};return i(E,B,w)}t.lineString=l;function c(z,B,w){return w===void 0&&(w={}),u(z.map(function(E){return l(E,B)}),w)}t.lineStrings=c;function u(z,B){B===void 0&&(B={});var w={type:"FeatureCollection"};return B.id&&(w.id=B.id),B.bbox&&(w.bbox=B.bbox),w.features=z,w}t.featureCollection=u;function d(z,B,w){w===void 0&&(w={});var E={type:"MultiLineString",coordinates:z};return i(E,B,w)}t.multiLineString=d;function p(z,B,w){w===void 0&&(w={});var E={type:"MultiPoint",coordinates:z};return i(E,B,w)}t.multiPoint=p;function f(z,B,w){w===void 0&&(w={});var E={type:"MultiPolygon",coordinates:z};return i(E,B,w)}t.multiPolygon=f;function g(z,B,w){w===void 0&&(w={});var E={type:"GeometryCollection",geometries:z};return i(E,B,w)}t.geometryCollection=g;function m(z,B){if(B===void 0&&(B=0),B&&!(B>=0))throw new Error("precision must be a positive number");var w=Math.pow(10,B||0);return Math.round(z*w)/w}t.round=m;function y(z,B){B===void 0&&(B="kilometers");var w=t.factors[B];if(!w)throw new Error(B+" units is invalid");return z*w}t.radiansToLength=y;function _(z,B){B===void 0&&(B="kilometers");var w=t.factors[B];if(!w)throw new Error(B+" units is invalid");return z/w}t.lengthToRadians=_;function P(z,B){return S(_(z,B))}t.lengthToDegrees=P;function C(z){var B=z%360;return B<0&&(B+=360),B}t.bearingToAzimuth=C;function S(z){var B=z%(2*Math.PI);return B*180/Math.PI}t.radiansToDegrees=S;function x(z){var B=z%360;return B*Math.PI/180}t.degreesToRadians=x;function A(z,B,w){if(B===void 0&&(B="kilometers"),w===void 0&&(w="kilometers"),!(z>=0))throw new Error("length must be a positive number");return y(_(z,B),w)}t.convertLength=A;function R(z,B,w){if(B===void 0&&(B="meters"),w===void 0&&(w="kilometers"),!(z>=0))throw new Error("area must be a positive number");var E=t.areaFactors[B];if(!E)throw new Error("invalid original units");var D=t.areaFactors[w];if(!D)throw new Error("invalid final units");return z/E*D}t.convertArea=R;function O(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}t.isNumber=O;function N(z){return!!z&&z.constructor===Object}t.isObject=N;function V(z){if(!z)throw new Error("bbox is required");if(!Array.isArray(z))throw new Error("bbox must be an Array");if(z.length!==4&&z.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");z.forEach(function(B){if(!O(B))throw new Error("bbox must only contain numbers")})}t.validateBBox=V;function U(z){if(!z)throw new Error("id is required");if(["string","number"].indexOf(typeof z)===-1)throw new Error("id must be a number or a string")}t.validateId=U})(f0);var Je={};const zM=Wm($T);Object.defineProperty(Je,"__esModule",{value:!0});var wt=zM;function ta(t,i,e){if(t!==null)for(var n,o,s,r,l,c,u,d=0,p=0,f,g=t.type,m=g==="FeatureCollection",y=g==="Feature",_=m?t.features.length:1,P=0;P<_;P++){u=m?t.features[P].geometry:y?t.geometry:t,f=u?u.type==="GeometryCollection":!1,l=f?u.geometries.length:1;for(var C=0;C<l;C++){var S=0,x=0;if(r=f?u.geometries[C]:u,r!==null){c=r.coordinates;var A=r.type;switch(d=e&&(A==="Polygon"||A==="MultiPolygon")?1:0,A){case null:break;case"Point":if(i(c,p,P,S,x)===!1)return!1;p++,S++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(i(c[n],p,P,S,x)===!1)return!1;p++,A==="MultiPoint"&&S++}A==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-d;o++){if(i(c[n][o],p,P,S,x)===!1)return!1;p++}A==="MultiLineString"&&S++,A==="Polygon"&&x++}A==="Polygon"&&S++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(x=0,o=0;o<c[n].length;o++){for(s=0;s<c[n][o].length-d;s++){if(i(c[n][o][s],p,P,S,x)===!1)return!1;p++}x++}S++}break;case"GeometryCollection":for(n=0;n<r.geometries.length;n++)if(ta(r.geometries[n],i,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function LM(t,i,e,n){var o=e;return ta(t,function(s,r,l,c,u){r===0&&e===void 0?o=s:o=i(o,s,r,l,c,u)},n),o}function g0(t,i){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&i(t.features[e].properties,e)!==!1;e++);break;case"Feature":i(t.properties,0);break}}function OM(t,i,e){var n=e;return g0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function m0(t,i){if(t.type==="Feature")i(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&i(t.features[e],e)!==!1;e++);}function NM(t,i,e){var n=e;return m0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function BM(t){var i=[];return ta(t,function(e){i.push(e)}),i}function ff(t,i){var e,n,o,s,r,l,c,u,d,p,f=0,g=t.type==="FeatureCollection",m=t.type==="Feature",y=g?t.features.length:1;for(e=0;e<y;e++){for(l=g?t.features[e].geometry:m?t.geometry:t,u=g?t.features[e].properties:m?t.properties:{},d=g?t.features[e].bbox:m?t.bbox:void 0,p=g?t.features[e].id:m?t.id:void 0,c=l?l.type==="GeometryCollection":!1,r=c?l.geometries.length:1,o=0;o<r;o++){if(s=c?l.geometries[o]:l,s===null){if(i(null,f,u,d,p)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(i(s,f,u,d,p)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(i(s.geometries[n],f,u,d,p)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function VM(t,i,e){var n=e;return ff(t,function(o,s,r,l,c){s===0&&e===void 0?n=o:n=i(n,o,s,r,l,c)}),n}function xh(t,i){ff(t,function(e,n,o,s,r){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return i(wt.feature(e,o,{bbox:s,id:r}),n,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var d=e.coordinates[u],p={type:c,coordinates:d};if(i(wt.feature(p,o),n,u)===!1)return!1}})}function UM(t,i,e){var n=e;return xh(t,function(o,s,r){s===0&&r===0&&e===void 0?n=o:n=i(n,o,s,r)}),n}function v0(t,i){xh(t,function(e,n,o){var s=0;if(e.geometry){var r=e.geometry.type;if(!(r==="Point"||r==="MultiPoint")){var l,c=0,u=0,d=0;if(ta(e,function(p,f,g,m,y){if(l===void 0||n>c||m>u||y>d){l=p,c=n,u=m,d=y,s=0;return}var _=wt.lineString([l,p],e.properties);if(i(_,n,o,y,s)===!1)return!1;s++,l=p})===!1)return!1}}})}function WM(t,i,e){var n=e,o=!1;return v0(t,function(s,r,l,c,u){o===!1&&e===void 0?n=s:n=i(n,s,r,l,c,u),o=!0}),n}function y0(t,i){if(!t)throw new Error("geojson is required");xh(t,function(e,n,o){if(e.geometry!==null){var s=e.geometry.type,r=e.geometry.coordinates;switch(s){case"LineString":if(i(e,n,o,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<r.length;l++)if(i(wt.lineString(r[l],e.properties),n,o,l)===!1)return!1;break}}})}function GM(t,i,e){var n=e;return y0(t,function(o,s,r,l){s===0&&e===void 0?n=o:n=i(n,o,s,r,l)}),n}function HM(t,i){if(i=i||{},!wt.isObject(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.segmentIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=c.length+s-1),wt.lineString([c[s],c[s+1]],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),wt.lineString([c[o][s],c[o][s+1]],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s-1),wt.lineString([c[n][s],c[n][s+1]],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s-1),wt.lineString([c[n][o][s],c[n][o][s+1]],r,i)}throw new Error("geojson is invalid")}function $M(t,i){if(i=i||{},!wt.isObject(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.coordIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return wt.point(c,r,i);case"MultiPoint":return n<0&&(n=c.length+n),wt.point(c[n],r,i);case"LineString":return s<0&&(s=c.length+s),wt.point(c[s],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),wt.point(c[o][s],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s),wt.point(c[n][s],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s),wt.point(c[n][o][s],r,i)}throw new Error("geojson is invalid")}Je.coordAll=BM,Je.coordEach=ta,Je.coordReduce=LM,Je.featureEach=m0,Je.featureReduce=NM,Je.findPoint=$M,Je.findSegment=HM,Je.flattenEach=xh,Je.flattenReduce=UM,Je.geomEach=ff,Je.geomReduce=VM,Je.lineEach=y0,Je.lineReduce=GM,Je.propEach=g0,Je.propReduce=OM,Je.segmentEach=v0,Je.segmentReduce=WM;var gf={};const qM=Wm(iM);Object.defineProperty(gf,"__esModule",{value:!0});var XM=qM;function mf(t){var i=[1/0,1/0,-1/0,-1/0];return XM.coordEach(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}mf.default=mf,gf.default=mf;var Li=xM,w0=f0,C0=Je,qs=gf.default,YM=C0.featureEach;C0.coordEach,w0.polygon;var _0=w0.featureCollection;function P0(t){var i=new Li(t);return i.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:qs(e),Li.prototype.insert.call(this,e)},i.load=function(e){var n=[];return Array.isArray(e)?e.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:qs(o),n.push(o)}):YM(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:qs(o),n.push(o)}),Li.prototype.load.call(this,n)},i.remove=function(e,n){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:qs(e),Li.prototype.remove.call(this,e,n)},i.clear=function(){return Li.prototype.clear.call(this)},i.search=function(e){var n=Li.prototype.search.call(this,this.toBBox(e));return _0(n)},i.collides=function(e){return Li.prototype.collides.call(this,this.toBBox(e))},i.all=function(){var e=Li.prototype.all.call(this);return _0(e)},i.toJSON=function(){return Li.prototype.toJSON.call(this)},i.fromJSON=function(e){return Li.prototype.fromJSON.call(this,e)},i.toBBox=function(e){var n;if(e.bbox)n=e.bbox;else if(Array.isArray(e)&&e.length===4)n=e;else if(Array.isArray(e)&&e.length===6)n=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")n=qs(e);else if(e.type==="FeatureCollection")n=qs(e);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},i}pf.exports=P0,pf.exports.default=P0;var ZM=pf.exports;const QM=Ic(ZM);function vf(t,i){var e={},n=[];if(t.type==="LineString"&&(t=Xt(t)),i.type==="LineString"&&(i=Xt(i)),t.type==="Feature"&&i.type==="Feature"&&t.geometry!==null&&i.geometry!==null&&t.geometry.type==="LineString"&&i.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&i.geometry.coordinates.length===2){var o=b0(t,i);return o&&n.push(o),Ot(n)}var s=QM();return s.load(p0(i)),Us(p0(t),function(r){Us(s.search(r),function(l){var c=b0(r,l);if(c){var u=Ii(c).join(",");e[u]||(e[u]=!0,n.push(c))}})}),Ot(n)}function b0(t,i){var e=Ii(t),n=Ii(i);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],s=e[0][1],r=e[1][0],l=e[1][1],c=n[0][0],u=n[0][1],d=n[1][0],p=n[1][1],f=(p-u)*(r-o)-(d-c)*(l-s),g=(d-c)*(s-u)-(p-u)*(o-c),m=(r-o)*(s-u)-(l-s)*(o-c);if(f===0)return null;var y=g/f,_=m/f;if(y>=0&&y<=1&&_>=0&&_<=1){var P=o+y*(r-o),C=s+y*(l-s);return ht([P,C])}return null}function Ah(t,i,e){e===void 0&&(e={});for(var n=Sh(t),o=Ii(i),s=0;s<o.length-1;s++){var r=!1;if(e.ignoreEndVertices&&(s===0&&(r="start"),s===o.length-2&&(r="end"),s===0&&s+1===o.length-1&&(r="both")),kM(o[s],o[s+1],n,r,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function kM(t,i,e,n,o){var s=e[0],r=e[1],l=t[0],c=t[1],u=i[0],d=i[1],p=e[0]-l,f=e[1]-c,g=u-l,m=d-c,y=p*m-f*g;if(o!==null){if(Math.abs(y)>o)return!1}else if(y!==0)return!1;if(n){if(n==="start")return Math.abs(g)>=Math.abs(m)?g>0?l<s&&s<=u:u<=s&&s<l:m>0?c<r&&r<=d:d<=r&&r<c;if(n==="end")return Math.abs(g)>=Math.abs(m)?g>0?l<=s&&s<u:u<s&&s<=l:m>0?c<=r&&r<d:d<r&&r<=c;if(n==="both")return Math.abs(g)>=Math.abs(m)?g>0?l<s&&s<u:u<s&&s<l:m>0?c<r&&r<d:d<r&&r<c}else return Math.abs(g)>=Math.abs(m)?g>0?l<=s&&s<=u:u<=s&&s<=l:m>0?c<=r&&r<=d:d<=r&&r<=c;return!1}function KM(t,i){var e=Di(t),n=Di(i),o=e.type,s=n.type;switch(o){case"Point":switch(s){case"MultiPoint":return JM(e,n);case"LineString":return Ah(e,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Pt(e,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return jM(e,n);case"LineString":return eI(e,n);case"Polygon":case"MultiPolygon":return tI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return iI(e,n);case"Polygon":case"MultiPolygon":return nI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return oI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function JM(t,i){var e,n=!1;for(e=0;e<i.coordinates.length;e++)if(E0(i.coordinates[e],t.coordinates)){n=!0;break}return n}function jM(t,i){for(var e=0;e<t.coordinates.length;e++){for(var n=!1,o=0;o<i.coordinates.length;o++)E0(t.coordinates[e],i.coordinates[o])&&(n=!0);if(!n)return!1}return!0}function eI(t,i){for(var e=!1,n=0;n<t.coordinates.length;n++){if(!Ah(t.coordinates[n],i))return!1;e||(e=Ah(t.coordinates[n],i,{ignoreEndVertices:!0}))}return e}function tI(t,i){for(var e=!0,n=!1,o=0;o<t.coordinates.length;o++){if(n=Pt(t.coordinates[1],i),!n){e=!1;break}n=Pt(t.coordinates[1],i,{ignoreBoundary:!0})}return e&&n}function iI(t,i){for(var e=0;e<t.coordinates.length;e++)if(!Ah(t.coordinates[e],i))return!1;return!0}function nI(t,i){var e=Lo(i),n=Lo(t);if(!S0(e,n))return!1;for(var o=!1,s=0;s<t.coordinates.length-1;s++){if(!Pt(t.coordinates[s],i))return!1;if(o||(o=Pt(t.coordinates[s],i,{ignoreBoundary:!0})),!o){var r=sI(t.coordinates[s],t.coordinates[s+1]);o=Pt(r,i,{ignoreBoundary:!0})}}return o}function oI(t,i){var e=Lo(t),n=Lo(i);if(!S0(n,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!Pt(t.coordinates[0][o],i))return!1;return!0}function S0(t,i){return!(t[0]>i[0]||t[2]<i[2]||t[1]>i[1]||t[3]<i[3])}function E0(t,i){return t[0]===i[0]&&t[1]===i[1]}function sI(t,i){return[(t[0]+i[0])/2,(t[1]+i[1])/2]}function x0(t,i,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var n=[],o=t[0],s=t[1],r=t[2],l=t[3],c=i/Ri([o,s],[r,s],e),u=c*(r-o),d=i/Ri([o,s],[o,l],e),p=d*(l-s),f=r-o,g=l-s,m=Math.floor(f/u),y=Math.floor(g/p),_=(f-m*u)/2,P=(g-y*p)/2,C=o+_;C<=r;){for(var S=s+P;S<=l;){var x=ht([C,S],e.properties);e.mask?KM(x,e.mask)&&n.push(x):n.push(x),S+=p}C+=u}return Ot(n)}function yf(t,i){i===void 0&&(i={});var e=Di(t);switch(!i.properties&&t.type==="Feature"&&(i.properties=t.properties),e.type){case"Polygon":return rI(e,i);case"MultiPolygon":return aI(e,i);default:throw new Error("invalid poly")}}function rI(t,i){i===void 0&&(i={});var e=Di(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{};return A0(n,o)}function aI(t,i){i===void 0&&(i={});var e=Di(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{},s=[];return n.forEach(function(r){s.push(A0(r,o))}),Ot(s)}function A0(t,i){return t.length>1?nf(t,i):oi(t[0],i)}var T0=Object.prototype.toString,M0=function(i){var e=T0.call(i),n=e==="[object Arguments]";return n||(n=e!=="[object Array]"&&i!==null&&typeof i=="object"&&typeof i.length=="number"&&i.length>=0&&T0.call(i.callee)==="[object Function]"),n},wf,I0;function lI(){if(I0)return wf;I0=1;var t;if(!Object.keys){var i=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=M0,o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),r=o.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(f){var g=f.constructor;return g&&g.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},d=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&i.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{c(window[f])}catch{return!0}}catch{return!0}return!1}(),p=function(f){if(typeof window>"u"||!d)return c(f);try{return c(f)}catch{return!1}};t=function(g){var m=g!==null&&typeof g=="object",y=e.call(g)==="[object Function]",_=n(g),P=m&&e.call(g)==="[object String]",C=[];if(!m&&!y&&!_)throw new TypeError("Object.keys called on a non-object");var S=r&&y;if(P&&g.length>0&&!i.call(g,0))for(var x=0;x<g.length;++x)C.push(String(x));if(_&&g.length>0)for(var A=0;A<g.length;++A)C.push(String(A));else for(var R in g)!(S&&R==="prototype")&&i.call(g,R)&&C.push(String(R));if(s)for(var O=p(g),N=0;N<l.length;++N)!(O&&l[N]==="constructor")&&i.call(g,l[N])&&C.push(l[N]);return C}}return wf=t,wf}var cI=Array.prototype.slice,hI=M0,D0=Object.keys,Th=D0?function(i){return D0(i)}:lI(),R0=Object.keys;Th.shim=function(){if(Object.keys){var i=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);i||(Object.keys=function(n){return hI(n)?R0(cI.call(n)):R0(n)})}else Object.keys=Th;return Object.keys||Th};var F0=Th,z0=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;i[e]=o;for(var s in i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var r=Object.getOwnPropertySymbols(i);if(r.length!==1||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(i,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(i,e);if(l.value!==o||l.enumerable!==!0)return!1}return!0},uI=z0,Cf=function(){return uI()&&!!Symbol.toStringTag},L0=Object,O0=Error,dI=EvalError,pI=RangeError,fI=ReferenceError,N0=SyntaxError,Xs=TypeError,gI=URIError,mI=Math.abs,vI=Math.floor,yI=Math.max,wI=Math.min,CI=Math.pow,_I=Math.round,PI=Number.isNaN||function(i){return i!==i},bI=PI,SI=function(i){return bI(i)||i===0?i:i<0?-1:1},EI=Object.getOwnPropertyDescriptor,Mh=EI;if(Mh)try{Mh([],"length")}catch{Mh=null}var Ys=Mh,Ih=Object.defineProperty||!1;if(Ih)try{Ih({},"a",{value:1})}catch{Ih=!1}var Dh=Ih,_f,B0;function xI(){if(B0)return _f;B0=1;var t=typeof Symbol<"u"&&Symbol,i=z0;return _f=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()},_f}var V0=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,AI=L0,U0=AI.getPrototypeOf||null,TI="Function.prototype.bind called on incompatible ",MI=Object.prototype.toString,II=Math.max,DI="[object Function]",W0=function(i,e){for(var n=[],o=0;o<i.length;o+=1)n[o]=i[o];for(var s=0;s<e.length;s+=1)n[s+i.length]=e[s];return n},RI=function(i,e){for(var n=[],o=e,s=0;o<i.length;o+=1,s+=1)n[s]=i[o];return n},FI=function(t,i){for(var e="",n=0;n<t.length;n+=1)e+=t[n],n+1<t.length&&(e+=i);return e},zI=function(i){var e=this;if(typeof e!="function"||MI.apply(e)!==DI)throw new TypeError(TI+e);for(var n=RI(arguments,1),o,s=function(){if(this instanceof o){var d=e.apply(this,W0(n,arguments));return Object(d)===d?d:this}return e.apply(i,W0(n,arguments))},r=II(0,e.length-n.length),l=[],c=0;c<r;c++)l[c]="$"+c;if(o=Function("binder","return function ("+FI(l,",")+"){ return binder.apply(this,arguments); }")(s),e.prototype){var u=function(){};u.prototype=e.prototype,o.prototype=new u,u.prototype=null}return o},LI=zI,ia=Function.prototype.bind||LI,Pf=Function.prototype.call,bf=Function.prototype.apply,OI=typeof Reflect<"u"&&Reflect&&Reflect.apply,NI=ia,BI=bf,VI=Pf,UI=OI,G0=UI||NI.call(VI,BI),WI=ia,GI=Xs,HI=Pf,$I=G0,Sf=function(i){if(i.length<1||typeof i[0]!="function")throw new GI("a function is required");return $I(WI,HI,i)},qI=Sf,H0=Ys,$0;try{$0=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ef=!!$0&&H0&&H0(Object.prototype,"__proto__"),q0=Object,X0=q0.getPrototypeOf,XI=Ef&&typeof Ef.get=="function"?qI([Ef.get]):typeof X0=="function"?function(i){return X0(i==null?i:q0(i))}:!1,Y0=V0,Z0=U0,Q0=XI,k0=Y0?function(i){return Y0(i)}:Z0?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return Z0(i)}:Q0?function(i){return Q0(i)}:null,YI=Function.prototype.call,ZI=Object.prototype.hasOwnProperty,QI=ia,K0=QI.call(YI,ZI),me,kI=L0,KI=O0,JI=dI,jI=pI,eD=fI,Zs=N0,Qs=Xs,tD=gI,iD=mI,nD=vI,oD=yI,sD=wI,rD=CI,aD=_I,lD=SI,J0=Function,xf=function(t){try{return J0('"use strict"; return ('+t+").constructor;")()}catch{}},na=Ys,cD=Dh,Af=function(){throw new Qs},hD=na?function(){try{return arguments.callee,Af}catch{try{return na(arguments,"callee").get}catch{return Af}}}():Af,ks=xI()(),nt=k0,uD=U0,dD=V0,j0=bf,oa=Pf,Ks={},pD=typeof Uint8Array>"u"||!nt?me:nt(Uint8Array),Oo={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?me:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?me:ArrayBuffer,"%ArrayIteratorPrototype%":ks&&nt?nt([][Symbol.iterator]()):me,"%AsyncFromSyncIteratorPrototype%":me,"%AsyncFunction%":Ks,"%AsyncGenerator%":Ks,"%AsyncGeneratorFunction%":Ks,"%AsyncIteratorPrototype%":Ks,"%Atomics%":typeof Atomics>"u"?me:Atomics,"%BigInt%":typeof BigInt>"u"?me:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?me:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?me:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?me:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":KI,"%eval%":eval,"%EvalError%":JI,"%Float16Array%":typeof Float16Array>"u"?me:Float16Array,"%Float32Array%":typeof Float32Array>"u"?me:Float32Array,"%Float64Array%":typeof Float64Array>"u"?me:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?me:FinalizationRegistry,"%Function%":J0,"%GeneratorFunction%":Ks,"%Int8Array%":typeof Int8Array>"u"?me:Int8Array,"%Int16Array%":typeof Int16Array>"u"?me:Int16Array,"%Int32Array%":typeof Int32Array>"u"?me:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ks&&nt?nt(nt([][Symbol.iterator]())):me,"%JSON%":typeof JSON=="object"?JSON:me,"%Map%":typeof Map>"u"?me:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ks||!nt?me:nt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":kI,"%Object.getOwnPropertyDescriptor%":na,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?me:Promise,"%Proxy%":typeof Proxy>"u"?me:Proxy,"%RangeError%":jI,"%ReferenceError%":eD,"%Reflect%":typeof Reflect>"u"?me:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?me:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ks||!nt?me:nt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?me:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ks&&nt?nt(""[Symbol.iterator]()):me,"%Symbol%":ks?Symbol:me,"%SyntaxError%":Zs,"%ThrowTypeError%":hD,"%TypedArray%":pD,"%TypeError%":Qs,"%Uint8Array%":typeof Uint8Array>"u"?me:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?me:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?me:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?me:Uint32Array,"%URIError%":tD,"%WeakMap%":typeof WeakMap>"u"?me:WeakMap,"%WeakRef%":typeof WeakRef>"u"?me:WeakRef,"%WeakSet%":typeof WeakSet>"u"?me:WeakSet,"%Function.prototype.call%":oa,"%Function.prototype.apply%":j0,"%Object.defineProperty%":cD,"%Object.getPrototypeOf%":uD,"%Math.abs%":iD,"%Math.floor%":nD,"%Math.max%":oD,"%Math.min%":sD,"%Math.pow%":rD,"%Math.round%":aD,"%Math.sign%":lD,"%Reflect.getPrototypeOf%":dD};if(nt)try{null.error}catch(t){var fD=nt(nt(t));Oo["%Error.prototype%"]=fD}var gD=function t(i){var e;if(i==="%AsyncFunction%")e=xf("async function () {}");else if(i==="%GeneratorFunction%")e=xf("function* () {}");else if(i==="%AsyncGeneratorFunction%")e=xf("async function* () {}");else if(i==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(e=n.prototype)}else if(i==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&nt&&(e=nt(o.prototype))}return Oo[i]=e,e},ew={__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"]},sa=ia,Rh=K0,mD=sa.call(oa,Array.prototype.concat),vD=sa.call(j0,Array.prototype.splice),tw=sa.call(oa,String.prototype.replace),Fh=sa.call(oa,String.prototype.slice),yD=sa.call(oa,RegExp.prototype.exec),wD=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,CD=/\\(\\)?/g,_D=function(i){var e=Fh(i,0,1),n=Fh(i,-1);if(e==="%"&&n!=="%")throw new Zs("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&e!=="%")throw new Zs("invalid intrinsic syntax, expected opening `%`");var o=[];return tw(i,wD,function(s,r,l,c){o[o.length]=l?tw(c,CD,"$1"):r||s}),o},PD=function(i,e){var n=i,o;if(Rh(ew,n)&&(o=ew[n],n="%"+o[0]+"%"),Rh(Oo,n)){var s=Oo[n];if(s===Ks&&(s=gD(n)),typeof s>"u"&&!e)throw new Qs("intrinsic "+i+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Zs("intrinsic "+i+" does not exist!")},iw=function(i,e){if(typeof i!="string"||i.length===0)throw new Qs("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Qs('"allowMissing" argument must be a boolean');if(yD(/^%?[^%]*%?$/,i)===null)throw new Zs("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=_D(i),o=n.length>0?n[0]:"",s=PD("%"+o+"%",e),r=s.name,l=s.value,c=!1,u=s.alias;u&&(o=u[0],vD(n,mD([0,1],u)));for(var d=1,p=!0;d<n.length;d+=1){var f=n[d],g=Fh(f,0,1),m=Fh(f,-1);if((g==='"'||g==="'"||g==="`"||m==='"'||m==="'"||m==="`")&&g!==m)throw new Zs("property names with quotes must have matching quotes");if((f==="constructor"||!p)&&(c=!0),o+="."+f,r="%"+o+"%",Rh(Oo,r))l=Oo[r];else if(l!=null){if(!(f in l)){if(!e)throw new Qs("base intrinsic for "+i+" exists, but the property is not available.");return}if(na&&d+1>=n.length){var y=na(l,f);p=!!y,p&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[f]}else p=Rh(l,f),l=l[f];p&&!c&&(Oo[r]=l)}}return l},nw=iw,ow=Sf,bD=ow([nw("%String.prototype.indexOf%")]),Tf=function(i,e){var n=nw(i,!!e);return typeof n=="function"&&bD(i,".prototype.")>-1?ow([n]):n},SD=Cf(),ED=Tf,Mf=ED("Object.prototype.toString"),zh=function(i){return SD&&i&&typeof i=="object"&&Symbol.toStringTag in i?!1:Mf(i)==="[object Arguments]"},sw=function(i){return zh(i)?!0:i!==null&&typeof i=="object"&&"length"in i&&typeof i.length=="number"&&i.length>=0&&Mf(i)!=="[object Array]"&&"callee"in i&&Mf(i.callee)==="[object Function]"},xD=function(){return zh(arguments)}();zh.isLegacyArguments=sw;var AD=xD?zh:sw,rw=Dh,TD=N0,Js=Xs,aw=Ys,If=function(i,e,n){if(!i||typeof i!="object"&&typeof i!="function")throw new Js("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Js("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Js("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Js("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Js("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Js("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,r=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!aw&&aw(i,e);if(rw)rw(i,e,{configurable:r===null&&c?c.configurable:!r,enumerable:o===null&&c?c.enumerable:!o,value:n,writable:s===null&&c?c.writable:!s});else if(l||!o&&!s&&!r)i[e]=n;else throw new TD("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Df=Dh,lw=function(){return!!Df};lw.hasArrayLengthDefineBug=function(){if(!Df)return null;try{return Df([],"length",{value:1}).length!==1}catch{return!0}};var Rf=lw,MD=F0,ID=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",DD=Object.prototype.toString,RD=Array.prototype.concat,cw=If,FD=function(t){return typeof t=="function"&&DD.call(t)==="[object Function]"},hw=Rf(),zD=function(t,i,e,n){if(i in t){if(n===!0){if(t[i]===e)return}else if(!FD(n)||!n())return}hw?cw(t,i,e,!0):cw(t,i,e)},uw=function(t,i){var e=arguments.length>2?arguments[2]:{},n=MD(i);ID&&(n=RD.call(n,Object.getOwnPropertySymbols(i)));for(var o=0;o<n.length;o+=1)zD(t,n[o],i[n[o]],e[n[o]])};uw.supportsDescriptors=!!hw;var ra=uw,dw={exports:{}},LD=iw,pw=If,OD=Rf(),fw=Ys,gw=Xs,ND=LD("%Math.floor%"),BD=function(i,e){if(typeof i!="function")throw new gw("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||ND(e)!==e)throw new gw("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,s=!0;if("length"in i&&fw){var r=fw(i,"length");r&&!r.configurable&&(o=!1),r&&!r.writable&&(s=!1)}return(o||s||!n)&&(OD?pw(i,"length",e,!0,!0):pw(i,"length",e)),i},VD=ia,UD=bf,WD=G0,GD=function(){return WD(VD,UD,arguments)};(function(t){var i=BD,e=Dh,n=Sf,o=GD;t.exports=function(r){var l=n(arguments),c=r.length-(arguments.length-1);return i(l,1+(c>0?c:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(dw);var mw=dw.exports,vw=function(t){return t!==t},yw=function(i,e){return i===0&&e===0?1/i===1/e:!!(i===e||vw(i)&&vw(e))},HD=yw,ww=function(){return typeof Object.is=="function"?Object.is:HD},$D=ww,qD=ra,XD=function(){var i=$D();return qD(Object,{is:i},{is:function(){return Object.is!==i}}),i},YD=ra,ZD=mw,QD=yw,Cw=ww,kD=XD,_w=ZD(Cw(),Object);YD(_w,{getPolyfill:Cw,implementation:QD,shim:kD});var KD=_w,Pw=Tf,JD=Cf(),jD=K0,e2=Ys,Ff;if(JD){var t2=Pw("RegExp.prototype.exec"),bw={},zf=function(){throw bw},Sw={toString:zf,valueOf:zf};typeof Symbol.toPrimitive=="symbol"&&(Sw[Symbol.toPrimitive]=zf),Ff=function(i){if(!i||typeof i!="object")return!1;var e=e2(i,"lastIndex"),n=e&&jD(e,"value");if(!n)return!1;try{t2(i,Sw)}catch(o){return o===bw}}}else{var i2=Pw("Object.prototype.toString"),n2="[object RegExp]";Ff=function(i){return!i||typeof i!="object"&&typeof i!="function"?!1:i2(i)===n2}}var o2=Ff,aa=function(){return typeof(function(){}).name=="string"},la=Object.getOwnPropertyDescriptor;if(la)try{la([],"length")}catch{la=null}aa.functionsHaveConfigurableNames=function(){if(!aa()||!la)return!1;var i=la(function(){},"name");return!!i&&!!i.configurable};var s2=Function.prototype.bind;aa.boundFunctionsHaveNames=function(){return aa()&&typeof s2=="function"&&(function(){}).bind().name!==""};var r2=aa,Ew=If,a2=Rf(),l2=r2.functionsHaveConfigurableNames(),c2=Xs,h2=function(i,e){if(typeof i!="function")throw new c2("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||l2)&&(a2?Ew(i,"name",e,!0,!0):Ew(i,"name",e)),i},u2=h2,d2=Xs,p2=Object,xw=u2(function(){if(this==null||this!==p2(this))throw new d2("RegExp.prototype.flags getter called on non-object");var i="";return this.hasIndices&&(i+="d"),this.global&&(i+="g"),this.ignoreCase&&(i+="i"),this.multiline&&(i+="m"),this.dotAll&&(i+="s"),this.unicode&&(i+="u"),this.unicodeSets&&(i+="v"),this.sticky&&(i+="y"),i},"get flags",!0),f2=xw,g2=ra.supportsDescriptors,m2=Object.getOwnPropertyDescriptor,Aw=function(){if(g2&&/a/mig.flags==="gim"){var i=m2(RegExp.prototype,"flags");if(i&&typeof i.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(n,"sticky",{get:function(){e+="y"}}),i.get.call(n),e==="dy")return i.get}}return f2},v2=ra.supportsDescriptors,y2=Aw,w2=Ys,C2=Object.defineProperty,_2=O0,Tw=k0,P2=/a/,b2=function(){if(!v2||!Tw)throw new _2("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var i=y2(),e=Tw(P2),n=w2(e,"flags");return(!n||n.get!==i)&&C2(e,"flags",{configurable:!0,enumerable:!1,get:i}),i},S2=ra,E2=mw,x2=xw,Mw=Aw,A2=b2,Iw=E2(Mw());S2(Iw,{getPolyfill:Mw,implementation:x2,shim:A2});var T2=Iw,Dw=Tf,M2=Dw("Date.prototype.getDay"),I2=function(i){try{return M2(i),!0}catch{return!1}},D2=Dw("Object.prototype.toString"),R2="[object Date]",F2=Cf(),z2=function(i){return typeof i!="object"||i===null?!1:F2?I2(i):D2(i)===R2},Rw=F0,Fw=AD,zw=KD,Lw=o2,Ow=T2,Nw=z2,Bw=Date.prototype.getTime;function Vw(t,i,e){var n=e||{};return(n.strict?zw(t,i):t===i)?!0:!t||!i||typeof t!="object"&&typeof i!="object"?n.strict?zw(t,i):t==i:L2(t,i,n)}function Uw(t){return t==null}function Ww(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 L2(t,i,e){var n,o;if(typeof t!=typeof i||Uw(t)||Uw(i)||t.prototype!==i.prototype||Fw(t)!==Fw(i))return!1;var s=Lw(t),r=Lw(i);if(s!==r)return!1;if(s||r)return t.source===i.source&&Ow(t)===Ow(i);if(Nw(t)&&Nw(i))return Bw.call(t)===Bw.call(i);var l=Ww(t),c=Ww(i);if(l!==c)return!1;if(l||c){if(t.length!==i.length)return!1;for(n=0;n<t.length;n++)if(t[n]!==i[n])return!1;return!0}if(typeof t!=typeof i)return!1;try{var u=Rw(t),d=Rw(i)}catch{return!1}if(u.length!==d.length)return!1;for(u.sort(),d.sort(),n=u.length-1;n>=0;n--)if(u[n]!=d[n])return!1;for(n=u.length-1;n>=0;n--)if(o=u[n],!Vw(t[o],i[o],e))return!1;return!0}var O2=Vw;function N2(t,i){var e=!0;return ji(t,function(n){ji(i,function(o){if(e===!1)return!1;e=B2(n.geometry,o.geometry)})}),e}function B2(t,i){switch(t.type){case"Point":switch(i.type){case"Point":return!G2(t.coordinates,i.coordinates);case"LineString":return!Gw(i,t);case"Polygon":return!Pt(t,i)}break;case"LineString":switch(i.type){case"Point":return!Gw(t,i);case"LineString":return!V2(t,i);case"Polygon":return!Hw(i,t)}break;case"Polygon":switch(i.type){case"Point":return!Pt(i,t);case"LineString":return!Hw(t,i);case"Polygon":return!U2(i,t)}}return!1}function Gw(t,i){for(var e=0;e<t.coordinates.length-1;e++)if(W2(t.coordinates[e],t.coordinates[e+1],i.coordinates))return!0;return!1}function V2(t,i){var e=vf(t,i);return e.features.length>0}function Hw(t,i){for(var e=0,n=i.coordinates;e<n.length;e++){var o=n[e];if(Pt(o,t))return!0}var s=vf(i,yf(t));return s.features.length>0}function U2(t,i){for(var e=0,n=t.coordinates[0];e<n.length;e++){var o=n[e];if(Pt(o,i))return!0}for(var s=0,r=i.coordinates[0];s<r.length;s++){var l=r[s];if(Pt(l,t))return!0}var c=vf(yf(t),yf(i));return c.features.length>0}function W2(t,i,e){var n=e[0]-t[0],o=e[1]-t[1],s=i[0]-t[0],r=i[1]-t[1],l=n*r-o*s;return l!==0?!1:Math.abs(s)>=Math.abs(r)?s>0?t[0]<=e[0]&&e[0]<=i[0]:i[0]<=e[0]&&e[0]<=t[0]:r>0?t[1]<=e[1]&&e[1]<=i[1]:i[1]<=e[1]&&e[1]<=t[1]}function G2(t,i){return t[0]===i[0]&&t[1]===i[1]}var H2=O2,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:$2};Oi.prototype.compare=function(t,i){if(t.type!==i.type||!qw(t,i))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,i.coordinates);case"LineString":return this.compareLine(t.coordinates,i.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,i);case"Feature":return this.compareFeature(t,i);default:if(t.type.indexOf("Multi")===0){var e=this,n=$w(t),o=$w(i);return n.every(function(s){return this.some(function(r){return e.compare(s,r)})},o)}}return!1};function $w(t){return t.coordinates.map(function(i){return{type:t.type.replace("Multi",""),coordinates:i}})}function qw(t,i){return t.hasOwnProperty("coordinates")?t.coordinates.length===i.coordinates.length:t.length===i.length}Oi.prototype.compareCoord=function(t,i){if(t.length!==i.length)return!1;for(var e=0;e<t.length;e++)if(t[e].toFixed(this.precision)!==i[e].toFixed(this.precision))return!1;return!0},Oi.prototype.compareLine=function(t,i,e,n){if(!qw(t,i))return!1;var o=this.pseudoNode?t:this.removePseudo(t),s=this.pseudoNode?i:this.removePseudo(i);if(!(n&&!this.compareCoord(o[0],s[0])&&(s=this.fixStartIndex(s,o),!s))){var r=this.compareCoord(o[e],s[e]);return this.direction||r?this.comparePath(o,s):this.compareCoord(o[e],s[s.length-(1+e)])?this.comparePath(o.slice().reverse(),s):!1}},Oi.prototype.fixStartIndex=function(t,i){for(var e,n=-1,o=0;o<t.length;o++)if(this.compareCoord(t[o],i[0])){n=o;break}return n>=0&&(e=[].concat(t.slice(n,t.length),t.slice(1,n+1))),e},Oi.prototype.comparePath=function(t,i){var e=this;return t.every(function(n,o){return e.compareCoord(n,this[o])},i)},Oi.prototype.comparePolygon=function(t,i){if(this.compareLine(t.coordinates[0],i.coordinates[0],1,!0)){var e=t.coordinates.slice(1,t.coordinates.length),n=i.coordinates.slice(1,i.coordinates.length),o=this;return e.every(function(s){return this.some(function(r){return o.compareLine(s,r,1,!0)})},n)}else return!1},Oi.prototype.compareFeature=function(t,i){return t.id!==i.id||!this.objectComparator(t.properties,i.properties)||!this.compareBBox(t,i)?!1:this.compare(t.geometry,i.geometry)},Oi.prototype.compareBBox=function(t,i){return!!(!t.bbox&&!i.bbox||t.bbox&&i.bbox&&this.compareCoord(t.bbox,i.bbox))},Oi.prototype.removePseudo=function(t){return t};function $2(t,i){return H2(t,i,{strict:!0})}var q2=Oi;const X2=Ic(q2);function Y2(t,i){var e=Di(t).type,n=Di(i).type;if(e!==n)return!1;var o=new X2({precision:6});return o.compare(h0(t),h0(i))}function Z2(t,i){var e=!1;return ji(t,function(n){ji(i,function(o){if(e===!0)return!0;e=!N2(n.geometry,o.geometry)})}),e}/**
1858
1858
  * splaytree v3.1.2
1859
1859
  * Fast Splay tree for Node and browser
1860
1860
  *
@@ -1874,8 +1874,8 @@ function (result, this, instanceIndex, frameState) {
1874
1874
 
1875
1875
  See the Apache Version 2.0 License for specific language governing permissions
1876
1876
  and limitations under the License.
1877
- ***************************************************************************** */function QR(t,i){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,o,s,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,o&&(s=u[0]&2?o.return:u[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,u[1])).done)return s;switch(o=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=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(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){e.label=u[1];break}if(u[0]===6&&e.label<s[1]){e.label=s[1],s=u;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(u);break}s[2]&&e.ops.pop(),e.trys.pop();continue}u=i.call(t,e)}catch(d){u=[6,d],o=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Vn=function(){function t(i,e){this.next=null,this.key=i,this.data=e,this.left=null,this.right=null}return t}();function kR(t,i){return t>i?1:t<i?-1:0}function Un(t,i,e){for(var n=new Vn(null,null),o=n,s=n;;){var r=e(t,i.key);if(r<0){if(i.left===null)break;if(e(t,i.left.key)<0){var l=i.left;if(i.left=l.right,l.right=i,i=l,i.left===null)break}s.left=i,s=i,i=i.left}else if(r>0){if(i.right===null)break;if(e(t,i.right.key)>0){var l=i.right;if(i.right=l.left,l.left=i,i=l,i.right===null)break}o.right=i,o=i,i=i.right}else break}return o.right=i.left,s.left=i.right,i.left=n.right,i.right=n.left,i}function Lf(t,i,e,n){var o=new Vn(t,i);if(e===null)return o.left=o.right=null,o;e=Un(t,e,n);var s=n(t,e.key);return s<0?(o.left=e.left,o.right=e,e.left=null):s>=0&&(o.right=e.right,o.left=e,e.right=null),o}function Xw(t,i,e){var n=null,o=null;if(i){i=Un(t,i,e);var s=e(i.key,t);s===0?(n=i.left,o=i.right):s<0?(o=i.right,i.right=null,n=i):(n=i.left,i.left=null,o=i)}return{left:n,right:o}}function KR(t,i,e){return i===null?t:(t===null||(i=Un(t.key,i,e),i.left=t),i)}function Of(t,i,e,n,o){if(t){n(""+i+(e?"└── ":"├── ")+o(t)+`
1878
- `);var s=i+(e?" ":"│ ");t.left&&Of(t.left,s,!1,n,o),t.right&&Of(t.right,s,!0,n,o)}}var Nf=function(){function t(i){i===void 0&&(i=kR),this._root=null,this._size=0,this._comparator=i}return t.prototype.insert=function(i,e){return this._size++,this._root=Lf(i,e,this._root,this._comparator)},t.prototype.add=function(i,e){var n=new Vn(i,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var o=this._comparator,s=Un(i,this._root,o),r=o(i,s.key);return r===0?this._root=s:(r<0?(n.left=s.left,n.right=s,s.left=null):r>0&&(n.right=s.right,n.left=s,s.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(i){this._root=this._remove(i,this._root,this._comparator)},t.prototype._remove=function(i,e,n){var o;if(e===null)return null;e=Un(i,e,n);var s=n(i,e.key);return s===0?(e.left===null?o=e.right:(o=Un(i,e.left,n),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var i=this._root;if(i){for(;i.left;)i=i.left;return this._root=Un(i.key,this._root,this._comparator),this._root=this._remove(i.key,this._root,this._comparator),{key:i.key,data:i.data}}return null},t.prototype.findStatic=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(i){return this._root&&(this._root=Un(i,this._root,this._comparator),this._comparator(i,this._root.key)!==0)?null:this._root},t.prototype.contains=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(i,e){for(var n=this._root,o=[],s=!1;!s;)n!==null?(o.push(n),n=n.left):o.length!==0?(n=o.pop(),i.call(e,n),n=n.right):s=!0;return this},t.prototype.range=function(i,e,n,o){for(var s=[],r=this._comparator,l=this._root,c;s.length!==0||l;)if(l)s.push(l),l=l.left;else{if(l=s.pop(),c=r(l.key,e),c>0)break;if(r(l.key,i)>=0&&n.call(o,l))return this;l=l.right}return this},t.prototype.keys=function(){var i=[];return this.forEach(function(e){var n=e.key;return i.push(n)}),i},t.prototype.values=function(){var i=[];return this.forEach(function(e){var n=e.data;return i.push(n)}),i},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(i){if(i===void 0&&(i=this._root),i)for(;i.left;)i=i.left;return i},t.prototype.maxNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.right;)i=i.right;return i},t.prototype.at=function(i){for(var e=this._root,n=!1,o=0,s=[];!n;)if(e)s.push(e),e=e.left;else if(s.length>0){if(e=s.pop(),o===i)return e;o++,e=e.right}else n=!0;return null},t.prototype.next=function(i){var e=this._root,n=null;if(i.right){for(n=i.right;n.left;)n=n.left;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(i){var e=this._root,n=null;if(i.left!==null){for(n=i.left;n.right;)n=n.right;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return jR(this._root)},t.prototype.load=function(i,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var o=i.length,s=this._comparator;if(n&&Uf(i,e,0,o-1,s),this._root===null)this._root=Bf(i,e,0,o),this._size=o;else{var r=e2(this.toList(),JR(i,e),s);o=this._size+o,this._root=Vf({head:r},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(i){i===void 0&&(i=function(n){return String(n.key)});var e=[];return Of(this._root,"",!0,function(n){return e.push(n)},i),e.join("")},t.prototype.update=function(i,e,n){var o=this._comparator,s=Xw(i,this._root,o),r=s.left,l=s.right;o(i,e)<0?l=Lf(e,n,l,o):r=Lf(e,n,r,o),this._root=KR(r,l,o)},t.prototype.split=function(i){return Xw(i,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var i,e,n;return QR(this,function(o){switch(o.label){case 0:i=this._root,e=[],n=!1,o.label=1;case 1:return n?[3,6]:i===null?[3,2]:(e.push(i),i=i.left,[3,5]);case 2:return e.length===0?[3,4]:(i=e.pop(),[4,i]);case 3:return o.sent(),i=i.right,[3,5];case 4:n=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function Bf(t,i,e,n){var o=n-e;if(o>0){var s=e+Math.floor(o/2),r=t[s],l=i[s],c=new Vn(r,l);return c.left=Bf(t,i,e,s),c.right=Bf(t,i,s+1,n),c}return null}function JR(t,i){for(var e=new Vn(null,null),n=e,o=0;o<t.length;o++)n=n.next=new Vn(t[o],i[o]);return n.next=null,e.next}function jR(t){for(var i=t,e=[],n=!1,o=new Vn(null,null),s=o;!n;)i?(e.push(i),i=i.left):e.length>0?(i=s=s.next=e.pop(),i=i.right):n=!0;return s.next=null,o.next}function Vf(t,i,e){var n=e-i;if(n>0){var o=i+Math.floor(n/2),s=Vf(t,i,o),r=t.head;return r.left=s,t.head=t.head.next,r.right=Vf(t,o+1,e),r}return null}function e2(t,i,e){for(var n=new Vn(null,null),o=n,s=t,r=i;s!==null&&r!==null;)e(s.key,r.key)<0?(o.next=s,s=s.next):(o.next=r,r=r.next),o=o.next;return s!==null?o.next=s:r!==null&&(o.next=r),n.next}function Uf(t,i,e,n,o){if(!(e>=n)){for(var s=t[e+n>>1],r=e-1,l=n+1;;){do r++;while(o(t[r],s)<0);do l--;while(o(t[l],s)>0);if(r>=l)break;var c=t[r];t[r]=t[l],t[l]=c,c=i[r],i[r]=i[l],i[l]=c}Uf(t,i,e,l,o),Uf(t,i,l+1,n,o)}}const nn=11102230246251565e-32,Ct=134217729,t2=(3+8*nn)*nn;function Wf(t,i,e,n,o){let s,r,l,c,u=i[0],d=n[0],p=0,f=0;d>u==d>-u?(s=u,u=i[++p]):(s=d,d=n[++f]);let g=0;if(p<t&&f<e)for(d>u==d>-u?(r=u+s,l=s-(r-u),u=i[++p]):(r=d+s,l=s-(r-d),d=n[++f]),s=r,l!==0&&(o[g++]=l);p<t&&f<e;)d>u==d>-u?(r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p]):(r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f]),s=r,l!==0&&(o[g++]=l);for(;p<t;)r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p],s=r,l!==0&&(o[g++]=l);for(;f<e;)r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f],s=r,l!==0&&(o[g++]=l);return(s!==0||g===0)&&(o[g++]=s),g}function i2(t,i){let e=i[0];for(let n=1;n<t;n++)e+=i[n];return e}function ca(t){return new Float64Array(t)}const n2=(3+16*nn)*nn,o2=(2+12*nn)*nn,s2=(9+64*nn)*nn*nn,js=ca(4),Yw=ca(8),Zw=ca(12),Qw=ca(16),bt=ca(4);function r2(t,i,e,n,o,s,r){let l,c,u,d,p,f,g,m,y,_,P,C,S,x,A,R,O,N;const V=t-o,U=e-o,z=i-s,B=n-s;x=V*B,f=Ct*V,g=f-(f-V),m=V-g,f=Ct*B,y=f-(f-B),_=B-y,A=m*_-(x-g*y-m*y-g*_),R=z*U,f=Ct*z,g=f-(f-z),m=z-g,f=Ct*U,y=f-(f-U),_=U-y,O=m*_-(R-g*y-m*y-g*_),P=A-O,p=A-P,js[0]=A-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,js[1]=S-(P+p)+(p-R),N=C+P,p=N-C,js[2]=C-(N-p)+(P-p),js[3]=N;let w=i2(4,js),E=o2*r;if(w>=E||-w>=E||(p=t-V,l=t-(V+p)+(p-o),p=e-U,u=e-(U+p)+(p-o),p=i-z,c=i-(z+p)+(p-s),p=n-B,d=n-(B+p)+(p-s),l===0&&c===0&&u===0&&d===0)||(E=s2*r+t2*Math.abs(w),w+=V*d+B*l-(z*u+U*c),w>=E||-w>=E))return w;x=l*B,f=Ct*l,g=f-(f-l),m=l-g,f=Ct*B,y=f-(f-B),_=B-y,A=m*_-(x-g*y-m*y-g*_),R=c*U,f=Ct*c,g=f-(f-c),m=c-g,f=Ct*U,y=f-(f-U),_=U-y,O=m*_-(R-g*y-m*y-g*_),P=A-O,p=A-P,bt[0]=A-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,bt[1]=S-(P+p)+(p-R),N=C+P,p=N-C,bt[2]=C-(N-p)+(P-p),bt[3]=N;const D=Wf(4,js,4,bt,Yw);x=V*d,f=Ct*V,g=f-(f-V),m=V-g,f=Ct*d,y=f-(f-d),_=d-y,A=m*_-(x-g*y-m*y-g*_),R=z*u,f=Ct*z,g=f-(f-z),m=z-g,f=Ct*u,y=f-(f-u),_=u-y,O=m*_-(R-g*y-m*y-g*_),P=A-O,p=A-P,bt[0]=A-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,bt[1]=S-(P+p)+(p-R),N=C+P,p=N-C,bt[2]=C-(N-p)+(P-p),bt[3]=N;const L=Wf(D,Yw,4,bt,Zw);x=l*d,f=Ct*l,g=f-(f-l),m=l-g,f=Ct*d,y=f-(f-d),_=d-y,A=m*_-(x-g*y-m*y-g*_),R=c*u,f=Ct*c,g=f-(f-c),m=c-g,f=Ct*u,y=f-(f-u),_=u-y,O=m*_-(R-g*y-m*y-g*_),P=A-O,p=A-P,bt[0]=A-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,bt[1]=S-(P+p)+(p-R),N=C+P,p=N-C,bt[2]=C-(N-p)+(P-p),bt[3]=N;const G=Wf(L,Zw,4,bt,Qw);return Qw[G-1]}function a2(t,i,e,n,o,s){const r=(i-s)*(e-o),l=(t-o)*(n-s),c=r-l,u=Math.abs(r+l);return Math.abs(c)>=n2*u?c:-r2(t,i,e,n,o,s,u)}const ha=(t,i)=>t.ll.x<=i.x&&i.x<=t.ur.x&&t.ll.y<=i.y&&i.y<=t.ur.y,Gf=(t,i)=>{if(i.ur.x<t.ll.x||t.ur.x<i.ll.x||i.ur.y<t.ll.y||t.ur.y<i.ll.y)return null;const e=t.ll.x<i.ll.x?i.ll.x:t.ll.x,n=t.ur.x<i.ur.x?t.ur.x:i.ur.x,o=t.ll.y<i.ll.y?i.ll.y:t.ll.y,s=t.ur.y<i.ur.y?t.ur.y:i.ur.y;return{ll:{x:e,y:o},ur:{x:n,y:s}}};let Wn=Number.EPSILON;Wn===void 0&&(Wn=Math.pow(2,-52));const l2=Wn*Wn,kw=(t,i)=>{if(-Wn<t&&t<Wn&&-Wn<i&&i<Wn)return 0;const e=t-i;return e*e<l2*t*i?0:t<i?-1:1};class c2{constructor(){this.reset()}reset(){this.xRounder=new Kw,this.yRounder=new Kw}round(i,e){return{x:this.xRounder.round(i),y:this.yRounder.round(e)}}}class Kw{constructor(){this.tree=new Nf,this.round(0)}round(i){const e=this.tree.add(i),n=this.tree.prev(e);if(n!==null&&kw(e.key,n.key)===0)return this.tree.remove(i),n.key;const o=this.tree.next(e);return o!==null&&kw(e.key,o.key)===0?(this.tree.remove(i),o.key):i}}const ua=new c2,Lh=(t,i)=>t.x*i.y-t.y*i.x,Jw=(t,i)=>t.x*i.x+t.y*i.y,jw=(t,i,e)=>{const n=a2(t.x,t.y,i.x,i.y,e.x,e.y);return n>0?-1:n<0?1:0},Oh=t=>Math.sqrt(Jw(t,t)),h2=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return Lh(o,n)/Oh(o)/Oh(n)},u2=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return Jw(o,n)/Oh(o)/Oh(n)},eC=(t,i,e)=>i.y===0?null:{x:t.x+i.x/i.y*(e-t.y),y:e},tC=(t,i,e)=>i.x===0?null:{x:e,y:t.y+i.y/i.x*(e-t.x)},d2=(t,i,e,n)=>{if(i.x===0)return tC(e,n,t.x);if(n.x===0)return tC(t,i,e.x);if(i.y===0)return eC(e,n,t.y);if(n.y===0)return eC(t,i,e.y);const o=Lh(i,n);if(o==0)return null;const s={x:e.x-t.x,y:e.y-t.y},r=Lh(s,i)/o,l=Lh(s,n)/o,c=t.x+l*i.x,u=e.x+r*n.x,d=t.y+l*i.y,p=e.y+r*n.y,f=(c+u)/2,g=(d+p)/2;return{x:f,y:g}};class si{static compare(i,e){const n=si.comparePoints(i.point,e.point);return n!==0?n:(i.point!==e.point&&i.link(e),i.isLeft!==e.isLeft?i.isLeft?1:-1:Gn.compare(i.segment,e.segment))}static comparePoints(i,e){return i.x<e.x?-1:i.x>e.x?1:i.y<e.y?-1:i.y>e.y?1:0}constructor(i,e){i.events===void 0?i.events=[this]:i.events.push(this),this.point=i,this.isLeft=e}link(i){if(i.point===this.point)throw new Error("Tried to link already linked events");const e=i.point.events;for(let n=0,o=e.length;n<o;n++){const s=e[n];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const i=this.point.events.length;for(let e=0;e<i;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let o=e+1;o<i;o++){const s=this.point.events[o];s.consumedBy===void 0&&n.otherSE.point.events===s.otherSE.point.events&&n.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const i=[];for(let e=0,n=this.point.events.length;e<n;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&i.push(o)}return i}getLeftmostComparator(i){const e=new Map,n=o=>{const s=o.otherSE;e.set(o,{sine:h2(this.point,i.point,s.point),cosine:u2(this.point,i.point,s.point)})};return(o,s)=>{e.has(o)||n(o),e.has(s)||n(s);const{sine:r,cosine:l}=e.get(o),{sine:c,cosine:u}=e.get(s);return r>=0&&c>=0?l<u?1:l>u?-1:0:r<0&&c<0?l<u?-1:l>u?1:0:c<r?-1:c>r?1:0}}}let p2=0;class Gn{static compare(i,e){const n=i.leftSE.point.x,o=e.leftSE.point.x,s=i.rightSE.point.x,r=e.rightSE.point.x;if(r<n)return 1;if(s<o)return-1;const l=i.leftSE.point.y,c=e.leftSE.point.y,u=i.rightSE.point.y,d=e.rightSE.point.y;if(n<o){if(c<l&&c<u)return 1;if(c>l&&c>u)return-1;const p=i.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;const f=e.comparePoint(i.rightSE.point);return f!==0?f:-1}if(n>o){if(l<c&&l<d)return-1;if(l>c&&l>d)return 1;const p=e.comparePoint(i.leftSE.point);if(p!==0)return p;const f=i.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(l<c)return-1;if(l>c)return 1;if(s<r){const p=e.comparePoint(i.rightSE.point);if(p!==0)return p}if(s>r){const p=i.comparePoint(e.rightSE.point);if(p<0)return 1;if(p>0)return-1}if(s!==r){const p=u-l,f=s-n,g=d-c,m=r-o;if(p>f&&g<m)return 1;if(p<f&&g>m)return-1}return s>r?1:s<r||u<d?-1:u>d?1:i.id<e.id?-1:i.id>e.id?1:0}constructor(i,e,n,o){this.id=++p2,this.leftSE=i,i.segment=this,i.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=i,this.rings=n,this.windings=o}static fromRing(i,e,n){let o,s,r;const l=si.comparePoints(i,e);if(l<0)o=i,s=e,r=1;else if(l>0)o=e,s=i,r=-1;else throw new Error(`Tried to create degenerate segment at [${i.x}, ${i.y}]`);const c=new si(o,!0),u=new si(s,!1);return new Gn(c,u,[n],[r])}replaceRightSE(i){this.rightSE=i,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const i=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:i<e?i:e},ur:{x:this.rightSE.point.x,y:i>e?i:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(i){return i.x===this.leftSE.point.x&&i.y===this.leftSE.point.y||i.x===this.rightSE.point.x&&i.y===this.rightSE.point.y}comparePoint(i){if(this.isAnEndpoint(i))return 0;const e=this.leftSE.point,n=this.rightSE.point,o=this.vector();if(e.x===n.x)return i.x===e.x?0:i.x<e.x?1:-1;const s=(i.y-e.y)/o.y,r=e.x+s*o.x;if(i.x===r)return 0;const l=(i.x-e.x)/o.x,c=e.y+l*o.y;return i.y===c?0:i.y<c?-1:1}getIntersection(i){const e=this.bbox(),n=i.bbox(),o=Gf(e,n);if(o===null)return null;const s=this.leftSE.point,r=this.rightSE.point,l=i.leftSE.point,c=i.rightSE.point,u=ha(e,l)&&this.comparePoint(l)===0,d=ha(n,s)&&i.comparePoint(s)===0,p=ha(e,c)&&this.comparePoint(c)===0,f=ha(n,r)&&i.comparePoint(r)===0;if(d&&u)return f&&!p?r:!f&&p?c:null;if(d)return p&&s.x===c.x&&s.y===c.y?null:s;if(u)return f&&r.x===l.x&&r.y===l.y?null:l;if(f&&p)return null;if(f)return r;if(p)return c;const g=d2(s,this.vector(),l,i.vector());return g===null||!ha(o,g)?null:ua.round(g.x,g.y)}split(i){const e=[],n=i.events!==void 0,o=new si(i,!0),s=new si(i,!1),r=this.rightSE;this.replaceRightSE(s),e.push(s),e.push(o);const l=new Gn(o,r,this.rings.slice(),this.windings.slice());return si.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),si.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(o.checkForConsuming(),s.checkForConsuming()),e}swapEvents(){const i=this.rightSE;this.rightSE=this.leftSE,this.leftSE=i,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(i){let e=this,n=i;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const o=Gn.compare(e,n);if(o!==0){if(o>0){const s=e;e=n,n=s}if(e.prev===n){const s=e;e=n,n=s}for(let s=0,r=n.rings.length;s<r;s++){const l=n.rings[s],c=n.windings[s],u=e.rings.indexOf(l);u===-1?(e.rings.push(l),e.windings.push(c)):e.windings[u]+=c}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.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 i=this.prev.consumedBy||this.prev;this._beforeState=i.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const i=this.beforeState();this._afterState={rings:i.rings.slice(0),windings:i.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,o=this._afterState.multiPolys;for(let l=0,c=this.rings.length;l<c;l++){const u=this.rings[l],d=this.windings[l],p=e.indexOf(u);p===-1?(e.push(u),n.push(d)):n[p]+=d}const s=[],r=[];for(let l=0,c=e.length;l<c;l++){if(n[l]===0)continue;const u=e[l],d=u.poly;if(r.indexOf(d)===-1)if(u.isExterior)s.push(d);else{r.indexOf(d)===-1&&r.push(d);const p=s.indexOf(u.poly);p!==-1&&s.splice(p,1)}}for(let l=0,c=s.length;l<c;l++){const u=s[l].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 i=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(vi.type){case"union":{const n=i.length===0,o=e.length===0;this._isInResult=n!==o;break}case"intersection":{let n,o;i.length<e.length?(n=i.length,o=e.length):(n=e.length,o=i.length),this._isInResult=o===vi.numMultiPolys&&n<o;break}case"xor":{const n=Math.abs(i.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=o=>o.length===1&&o[0].isSubject;this._isInResult=n(i)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${vi.type}`)}return this._isInResult}}class iC{constructor(i,e,n){if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=ua.round(i[0][0],i[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let s=o;for(let r=1,l=i.length;r<l;r++){if(typeof i[r][0]!="number"||typeof i[r][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=ua.round(i[r][0],i[r][1]);c.x===s.x&&c.y===s.y||(this.segments.push(Gn.fromRing(s,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),s=c)}(o.x!==s.x||o.y!==s.y)&&this.segments.push(Gn.fromRing(s,o,this))}getSweepEvents(){const i=[];for(let e=0,n=this.segments.length;e<n;e++){const o=this.segments[e];i.push(o.leftSE),i.push(o.rightSE)}return i}}class f2{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new iC(i[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 n=1,o=i.length;n<o;n++){const s=new iC(i[n],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class nC{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}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 n=0,o=i.length;n<o;n++){const s=new f2(i[n],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class Nh{static factory(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.isInResult()||s.ringOut)continue;let r=null,l=s.leftSE,c=s.rightSE;const u=[l],d=l.point,p=[];for(;r=l,l=c,u.push(l),l.point!==d;)for(;;){const f=l.getAvailableLinkedEvents();if(f.length===0){const y=u[0].point,_=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${y.x}, ${y.y}]. Last matching segment found ends at [${_.x}, ${_.y}].`)}if(f.length===1){c=f[0].otherSE;break}let g=null;for(let y=0,_=p.length;y<_;y++)if(p[y].point===l.point){g=y;break}if(g!==null){const y=p.splice(g)[0],_=u.splice(y.index);_.unshift(_[0].otherSE),e.push(new Nh(_.reverse()));continue}p.push({index:u.length,point:l.point});const m=l.getLeftmostComparator(r);c=f.sort(m)[0].otherSE;break}e.push(new Nh(u))}return e}constructor(i){this.events=i;for(let e=0,n=i.length;e<n;e++)i[e].segment.ringOut=this;this.poly=null}getGeom(){let i=this.events[0].point;const e=[i];for(let u=1,d=this.events.length-1;u<d;u++){const p=this.events[u].point,f=this.events[u+1].point;jw(p,i,f)!==0&&(e.push(p),i=p)}if(e.length===1)return null;const n=e[0],o=e[1];jw(n,i,o)===0&&e.shift(),e.push(e[0]);const s=this.isExteriorRing()?1:-1,r=this.isExteriorRing()?0:e.length-1,l=this.isExteriorRing()?e.length:-1,c=[];for(let u=r;u!=l;u+=s)c.push([e[u].x,e[u].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const i=this.enclosingRing();this._isExteriorRing=i?!i.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let i=this.events[0];for(let o=1,s=this.events.length;o<s;o++){const r=this.events[o];si.compare(i,r)>0&&(i=r)}let e=i.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class oC{constructor(i){this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=[this.exteriorRing.getGeom()];if(i[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getGeom();o!==null&&i.push(o)}return i}}class g2{constructor(i){this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getGeom();o!==null&&i.push(o)}return i}_composePolys(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.poly)if(s.isExteriorRing())e.push(new oC(s));else{const r=s.enclosingRing();r.poly||e.push(new oC(r)),r.poly.addInterior(s)}}return e}}class m2{constructor(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gn.compare;this.queue=i,this.tree=new Nf(e),this.segments=[]}process(i){const e=i.segment,n=[];if(i.consumedBy)return i.isLeft?this.queue.remove(i.otherSE):this.tree.remove(e),n;const o=i.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 s=o,r=o,l,c;for(;l===void 0;)s=this.tree.prev(s),s===null?l=null:s.key.consumedBy===void 0&&(l=s.key);for(;c===void 0;)r=this.tree.next(r),r===null?c=null:r.key.consumedBy===void 0&&(c=r.key);if(i.isLeft){let u=null;if(l){const p=l.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(u=p),!l.isAnEndpoint(p))){const f=this._splitSafely(l,p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}}let d=null;if(c){const p=c.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(d=p),!c.isAnEndpoint(p))){const f=this._splitSafely(c,p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}}if(u!==null||d!==null){let p=null;u===null?p=d:d===null?p=u:p=si.comparePoints(u,d)<=0?u:d,this.queue.remove(e.rightSE),n.push(e.rightSE);const f=e.split(p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}n.length>0?(this.tree.remove(e),n.push(i)):(this.segments.push(e),e.prev=l)}else{if(l&&c){const u=l.getIntersection(c);if(u!==null){if(!l.isAnEndpoint(u)){const d=this._splitSafely(l,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}if(!c.isAnEndpoint(u)){const d=this._splitSafely(c,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}}}this.tree.remove(e)}return n}_splitSafely(i,e){this.tree.remove(i);const n=i.rightSE;this.queue.remove(n);const o=i.split(e);return o.push(n),i.consumedBy===void 0&&this.tree.add(i),o}}const sC=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,v2=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class y2{run(i,e,n){vi.type=i,ua.reset();const o=[new nC(e,!0)];for(let p=0,f=n.length;p<f;p++)o.push(new nC(n[p],!1));if(vi.numMultiPolys=o.length,vi.type==="difference"){const p=o[0];let f=1;for(;f<o.length;)Gf(o[f].bbox,p.bbox)!==null?f++:o.splice(f,1)}if(vi.type==="intersection")for(let p=0,f=o.length;p<f;p++){const g=o[p];for(let m=p+1,y=o.length;m<y;m++)if(Gf(g.bbox,o[m].bbox)===null)return[]}const s=new Nf(si.compare);for(let p=0,f=o.length;p<f;p++){const g=o[p].getSweepEvents();for(let m=0,y=g.length;m<y;m++)if(s.insert(g[m]),s.size>sC)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const r=new m2(s);let l=s.size,c=s.pop();for(;c;){const p=c.key;if(s.size===l){const g=p.segment;throw new Error(`Unable to pop() ${p.isLeft?"left":"right"} SweepEvent [${p.point.x}, ${p.point.y}] from segment #${g.id} [${g.leftSE.point.x}, ${g.leftSE.point.y}] -> [${g.rightSE.point.x}, ${g.rightSE.point.y}] from queue.`)}if(s.size>sC)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(r.segments.length>v2)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=r.process(p);for(let g=0,m=f.length;g<m;g++){const y=f[g];y.consumedBy===void 0&&s.insert(y)}l=s.size,c=s.pop()}ua.reset();const u=Nh.factory(r.segments);return new g2(u).getGeom()}}const vi=new y2;var w2={union:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("union",t,e)},intersection:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("intersection",t,e)},xor:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("xor",t,e)},difference:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("difference",t,e)}};function Bh(t,i,e){e===void 0&&(e={});var n=Di(t),o=Di(i),s=w2.intersection(n.coordinates,o.coordinates);return s.length===0?null:s.length===1?it(s[0],e.properties):of(s,e.properties)}function C2(t,i,e){e===void 0&&(e={});var n=JSON.stringify(e.properties||{}),o=t[0],s=t[1],r=t[2],l=t[3],c=(s+l)/2,u=(o+r)/2,d=i*2/Ri([o,c],[r,c],e),p=d*(r-o),f=i*2/Ri([u,s],[u,l],e),g=f*(l-s),m=p/2,y=m*2,_=Math.sqrt(3)/2*g,P=r-o,C=l-s,S=3/4*y,x=_,A=(P-y)/(y-m/2),R=Math.floor(A),O=(R*S-m/2-P)/2-m/2+S/2,N=Math.floor((C-_)/_),V=(C-N*_)/2,U=N*_-C>_/2;U&&(V-=_/4);for(var z=[],B=[],w=0;w<6;w++){var E=2*Math.PI/6*w;z.push(Math.cos(E)),B.push(Math.sin(E))}for(var D=[],L=0;L<=R;L++)for(var G=0;G<=N;G++){var Y=L%2===1;if(!(G===0&&Y)&&!(G===0&&U)){var q=L*S+o-O,X=G*x+s+V;if(Y&&(X-=_/2),e.triangles===!0)P2([q,X],p/2,g/2,JSON.parse(n),z,B).forEach(function(ee){e.mask?Bh(e.mask,ee)&&D.push(ee):D.push(ee)});else{var Q=_2([q,X],p/2,g/2,JSON.parse(n),z,B);e.mask?Bh(e.mask,Q)&&D.push(Q):D.push(Q)}}}return Ot(D)}function _2(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=t[0]+i*o[l],u=t[1]+e*s[l];r.push([c,u])}return r.push(r[0].slice()),it([r],n)}function P2(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=[];c.push(t),c.push([t[0]+i*o[l],t[1]+e*s[l]]),c.push([t[0]+i*o[(l+1)%6],t[1]+e*s[(l+1)%6]]),c.push(t),r.push(it([c],n))}return r}function b2(t,i,e,n){n===void 0&&(n={});for(var o=[],s=t[0],r=t[1],l=t[2],c=t[3],u=i/Ri([s,r],[l,r],n),d=u*(l-s),p=e/Ri([s,r],[s,c],n),f=p*(c-r),g=l-s,m=c-r,y=Math.floor(g/d),_=Math.floor(m/f),P=(g-y*d)/2,C=(m-_*f)/2,S=s+P,x=0;x<y;x++){for(var A=r+C,R=0;R<_;R++){var O=it([[[S,A],[S,A+f],[S+d,A+f],[S+d,A],[S,A]]],n.properties);n.mask?ZR(n.mask,O)&&o.push(O):o.push(O),A+=f}S+=d}return Ot(o)}function S2(t,i,e){return e===void 0&&(e={}),b2(t,i,i,e)}function E2(t,i,e){e===void 0&&(e={});for(var n=[],o=i/Ri([t[0],t[1]],[t[2],t[1]],e),s=o*(t[2]-t[0]),r=i/Ri([t[0],t[1]],[t[0],t[3]],e),l=r*(t[3]-t[1]),c=0,u=t[0];u<=t[2];){for(var d=0,p=t[1];p<=t[3];){var f=null,g=null;c%2===0&&d%2===0?(f=it([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),g=it([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)):c%2===0&&d%2===1?(f=it([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties),g=it([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties)):d%2===0&&c%2===1?(f=it([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties),g=it([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties)):d%2===1&&c%2===1&&(f=it([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),g=it([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)),e.mask?(Bh(e.mask,f)&&n.push(f),Bh(e.mask,g)&&n.push(g)):(n.push(f),n.push(g)),p+=l,d++}c++,u+=s}return Ot(n)}function x2(t,i,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var n=e.gridType,o=e.property,s=e.weight;if(!t)throw new Error("points is required");if(qT(t,"Point","input must contain Points"),!i)throw new Error("cellSize is required");if(s!==void 0&&typeof s!="number")throw new Error("weight must be a number");o=o||"elevation",n=n||"square",s=s||1;var r=Lo(t),l;switch(n){case"point":case"points":l=x0(r,i,e);break;case"square":case"squares":l=S2(r,i,e);break;case"hex":case"hexes":l=C2(r,i,e);break;case"triangle":case"triangles":l=E2(r,i,e);break;default:throw new Error("invalid gridType")}var c=[];return Us(l,function(u){var d=0,p=0;Us(t,function(g){var m=n==="point"?u:IM(u),y=Ri(m,g,e),_;if(o!==void 0&&(_=g.properties[o]),_===void 0&&(_=g.geometry.coordinates[2]),_===void 0)throw new Error("zValue is missing");y===0&&(d=_);var P=1/Math.pow(y,s);p+=P,d+=P*_});var f=TM(u);f.properties[o]=d/p,c.push(f)}),Ot(c)}function A2(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r);return!!(e.globe.pick(r,e)||l)}const rC=(t=0)=>new Promise(i=>setTimeout(i,t));function T2(t,i){const e=Ot(t.map(c=>ht(c))),n=it([t]);return x2(e,i,{gridType:"point",units:"meters"}).features.map(c=>c.geometry.coordinates).filter(c=>Pt(ht(c),n))}function M2(t){const i=h.JulianDate.fromDate(t),e=h.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(i);return vr(e)}function I2(t,i,e){const n=t[0]+(i[0]-t[0])*e,o=t[1]+(i[1]-t[1])*e,s=t[2]+(i[2]-t[2])*e,r=t[3]+(i[3]-t[3])*e;return[n,o,s,r]}const Ol=class Ol extends qt{constructor(e,n){super(e,n);v(this,"czmPointPrimitiveCollection");v(this,"_stopRun",!1);const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.czmPointPrimitiveCollection=this.dv(new mo(n,e.id));this.d(a.track([s,"show"],[e,"show"]));{const r=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){s.pointPrimitiveOptions=void 0;return}const u=[...e.points,e.points[0]],d=e.sampleDistance,p=T2(u,d).map(S=>[...S,e.groundHeight]),f=Math.floor(e.height/d);if(f>0){const S=[...p];for(let x=1;x<=f;x++)p.push(...S.map(A=>[A[0],A[1],e.groundHeight+x*d]))}const{startTime:g,endTime:m,spanTime:y}=e,_=y*36e5,P=Math.floor((m-g)/_),C=Array(p.length).fill(0);e:for(let S=0;S<P;S++){if(await rC(),this._stopRun)break e;const x=new Date(g+S*_),A=M2(x);t:for(let R=0;R<p.length;R++){if(await rC(),this._stopRun)break t;A2(p[R],A,o.scene)||(C[R]=(C[R]*P+1)/P)}!this._stopRun&&(e.progress=Number(((S+1)/P*100).toFixed(2))),console.log("colorScalelist",C),c(p,C)}},l=this.dv(a.createProcessingFromAsyncFunc(async u=>{await u.promise(r())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,s.pointPrimitiveOptions=void 0,e.progress=0,l.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,s.pointPrimitiveOptions=void 0,e.progress=0,l.isRunning&&l.cancel()}));const c=(u,d)=>{const p=u.map((f,g)=>({position:[...f],color:I2(e.startColor,e.endColor,d[g]),pixelSize:10}));s.pointPrimitiveOptions=p}}}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.positions){const l=o.groundHeight+o.height,c=[];return r.positions.forEach(u=>{c.push([u[0],u[1],o.groundHeight],[u[0],u[1],l])}),oe(s,o,n,c,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.positions){const l=o.groundHeight+o.height,c=[];return r.positions.forEach(u=>{c.push([u[0],u[1],o.groundHeight],[u[0],u[1],l])}),oe(s,o,n,c,e),!0}return!1}};v(Ol,"type",Ol.register("ESCesiumViewer",a.ESSunshineAnalysis.type,Ol));let Hf=Ol;const aC=(t=0)=>new Promise(i=>setTimeout(i,t)),Xo=class Xo extends a.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new a.Event));v(this,"_startEvent",this.disposeVar(new a.Event));v(this,"_stopEvent",this.dv(new a.Event));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_geoPolyline");v(this,"_customPrimitive");v(this,"_geoDivPoi");v(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new be(e,n)),this._customPrimitive=this.disposeVar(new De(e,n)),this._geoDivPoi=this.disposeVar(new We(e,n)),this.ad(this._geoDivPoi.pickedEvent.don(s=>{Hi(s)===0&&this.pickedEvent.emit(s)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(s=>{this._geoPolyline&&this._geoPolyline.flyTo(s)})),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=`
1877
+ ***************************************************************************** */function Q2(t,i){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,o,s,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,o&&(s=u[0]&2?o.return:u[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,u[1])).done)return s;switch(o=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=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(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){e.label=u[1];break}if(u[0]===6&&e.label<s[1]){e.label=s[1],s=u;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(u);break}s[2]&&e.ops.pop(),e.trys.pop();continue}u=i.call(t,e)}catch(d){u=[6,d],o=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Vn=function(){function t(i,e){this.next=null,this.key=i,this.data=e,this.left=null,this.right=null}return t}();function k2(t,i){return t>i?1:t<i?-1:0}function Un(t,i,e){for(var n=new Vn(null,null),o=n,s=n;;){var r=e(t,i.key);if(r<0){if(i.left===null)break;if(e(t,i.left.key)<0){var l=i.left;if(i.left=l.right,l.right=i,i=l,i.left===null)break}s.left=i,s=i,i=i.left}else if(r>0){if(i.right===null)break;if(e(t,i.right.key)>0){var l=i.right;if(i.right=l.left,l.left=i,i=l,i.right===null)break}o.right=i,o=i,i=i.right}else break}return o.right=i.left,s.left=i.right,i.left=n.right,i.right=n.left,i}function Lf(t,i,e,n){var o=new Vn(t,i);if(e===null)return o.left=o.right=null,o;e=Un(t,e,n);var s=n(t,e.key);return s<0?(o.left=e.left,o.right=e,e.left=null):s>=0&&(o.right=e.right,o.left=e,e.right=null),o}function Xw(t,i,e){var n=null,o=null;if(i){i=Un(t,i,e);var s=e(i.key,t);s===0?(n=i.left,o=i.right):s<0?(o=i.right,i.right=null,n=i):(n=i.left,i.left=null,o=i)}return{left:n,right:o}}function K2(t,i,e){return i===null?t:(t===null||(i=Un(t.key,i,e),i.left=t),i)}function Of(t,i,e,n,o){if(t){n(""+i+(e?"└── ":"├── ")+o(t)+`
1878
+ `);var s=i+(e?" ":"│ ");t.left&&Of(t.left,s,!1,n,o),t.right&&Of(t.right,s,!0,n,o)}}var Nf=function(){function t(i){i===void 0&&(i=k2),this._root=null,this._size=0,this._comparator=i}return t.prototype.insert=function(i,e){return this._size++,this._root=Lf(i,e,this._root,this._comparator)},t.prototype.add=function(i,e){var n=new Vn(i,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var o=this._comparator,s=Un(i,this._root,o),r=o(i,s.key);return r===0?this._root=s:(r<0?(n.left=s.left,n.right=s,s.left=null):r>0&&(n.right=s.right,n.left=s,s.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(i){this._root=this._remove(i,this._root,this._comparator)},t.prototype._remove=function(i,e,n){var o;if(e===null)return null;e=Un(i,e,n);var s=n(i,e.key);return s===0?(e.left===null?o=e.right:(o=Un(i,e.left,n),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var i=this._root;if(i){for(;i.left;)i=i.left;return this._root=Un(i.key,this._root,this._comparator),this._root=this._remove(i.key,this._root,this._comparator),{key:i.key,data:i.data}}return null},t.prototype.findStatic=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(i){return this._root&&(this._root=Un(i,this._root,this._comparator),this._comparator(i,this._root.key)!==0)?null:this._root},t.prototype.contains=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(i,e){for(var n=this._root,o=[],s=!1;!s;)n!==null?(o.push(n),n=n.left):o.length!==0?(n=o.pop(),i.call(e,n),n=n.right):s=!0;return this},t.prototype.range=function(i,e,n,o){for(var s=[],r=this._comparator,l=this._root,c;s.length!==0||l;)if(l)s.push(l),l=l.left;else{if(l=s.pop(),c=r(l.key,e),c>0)break;if(r(l.key,i)>=0&&n.call(o,l))return this;l=l.right}return this},t.prototype.keys=function(){var i=[];return this.forEach(function(e){var n=e.key;return i.push(n)}),i},t.prototype.values=function(){var i=[];return this.forEach(function(e){var n=e.data;return i.push(n)}),i},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(i){if(i===void 0&&(i=this._root),i)for(;i.left;)i=i.left;return i},t.prototype.maxNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.right;)i=i.right;return i},t.prototype.at=function(i){for(var e=this._root,n=!1,o=0,s=[];!n;)if(e)s.push(e),e=e.left;else if(s.length>0){if(e=s.pop(),o===i)return e;o++,e=e.right}else n=!0;return null},t.prototype.next=function(i){var e=this._root,n=null;if(i.right){for(n=i.right;n.left;)n=n.left;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(i){var e=this._root,n=null;if(i.left!==null){for(n=i.left;n.right;)n=n.right;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return j2(this._root)},t.prototype.load=function(i,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var o=i.length,s=this._comparator;if(n&&Uf(i,e,0,o-1,s),this._root===null)this._root=Bf(i,e,0,o),this._size=o;else{var r=eR(this.toList(),J2(i,e),s);o=this._size+o,this._root=Vf({head:r},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(i){i===void 0&&(i=function(n){return String(n.key)});var e=[];return Of(this._root,"",!0,function(n){return e.push(n)},i),e.join("")},t.prototype.update=function(i,e,n){var o=this._comparator,s=Xw(i,this._root,o),r=s.left,l=s.right;o(i,e)<0?l=Lf(e,n,l,o):r=Lf(e,n,r,o),this._root=K2(r,l,o)},t.prototype.split=function(i){return Xw(i,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var i,e,n;return Q2(this,function(o){switch(o.label){case 0:i=this._root,e=[],n=!1,o.label=1;case 1:return n?[3,6]:i===null?[3,2]:(e.push(i),i=i.left,[3,5]);case 2:return e.length===0?[3,4]:(i=e.pop(),[4,i]);case 3:return o.sent(),i=i.right,[3,5];case 4:n=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function Bf(t,i,e,n){var o=n-e;if(o>0){var s=e+Math.floor(o/2),r=t[s],l=i[s],c=new Vn(r,l);return c.left=Bf(t,i,e,s),c.right=Bf(t,i,s+1,n),c}return null}function J2(t,i){for(var e=new Vn(null,null),n=e,o=0;o<t.length;o++)n=n.next=new Vn(t[o],i[o]);return n.next=null,e.next}function j2(t){for(var i=t,e=[],n=!1,o=new Vn(null,null),s=o;!n;)i?(e.push(i),i=i.left):e.length>0?(i=s=s.next=e.pop(),i=i.right):n=!0;return s.next=null,o.next}function Vf(t,i,e){var n=e-i;if(n>0){var o=i+Math.floor(n/2),s=Vf(t,i,o),r=t.head;return r.left=s,t.head=t.head.next,r.right=Vf(t,o+1,e),r}return null}function eR(t,i,e){for(var n=new Vn(null,null),o=n,s=t,r=i;s!==null&&r!==null;)e(s.key,r.key)<0?(o.next=s,s=s.next):(o.next=r,r=r.next),o=o.next;return s!==null?o.next=s:r!==null&&(o.next=r),n.next}function Uf(t,i,e,n,o){if(!(e>=n)){for(var s=t[e+n>>1],r=e-1,l=n+1;;){do r++;while(o(t[r],s)<0);do l--;while(o(t[l],s)>0);if(r>=l)break;var c=t[r];t[r]=t[l],t[l]=c,c=i[r],i[r]=i[l],i[l]=c}Uf(t,i,e,l,o),Uf(t,i,l+1,n,o)}}const nn=11102230246251565e-32,Ct=134217729,tR=(3+8*nn)*nn;function Wf(t,i,e,n,o){let s,r,l,c,u=i[0],d=n[0],p=0,f=0;d>u==d>-u?(s=u,u=i[++p]):(s=d,d=n[++f]);let g=0;if(p<t&&f<e)for(d>u==d>-u?(r=u+s,l=s-(r-u),u=i[++p]):(r=d+s,l=s-(r-d),d=n[++f]),s=r,l!==0&&(o[g++]=l);p<t&&f<e;)d>u==d>-u?(r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p]):(r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f]),s=r,l!==0&&(o[g++]=l);for(;p<t;)r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p],s=r,l!==0&&(o[g++]=l);for(;f<e;)r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f],s=r,l!==0&&(o[g++]=l);return(s!==0||g===0)&&(o[g++]=s),g}function iR(t,i){let e=i[0];for(let n=1;n<t;n++)e+=i[n];return e}function ca(t){return new Float64Array(t)}const nR=(3+16*nn)*nn,oR=(2+12*nn)*nn,sR=(9+64*nn)*nn*nn,js=ca(4),Yw=ca(8),Zw=ca(12),Qw=ca(16),bt=ca(4);function rR(t,i,e,n,o,s,r){let l,c,u,d,p,f,g,m,y,_,P,C,S,x,A,R,O,N;const V=t-o,U=e-o,z=i-s,B=n-s;x=V*B,f=Ct*V,g=f-(f-V),m=V-g,f=Ct*B,y=f-(f-B),_=B-y,A=m*_-(x-g*y-m*y-g*_),R=z*U,f=Ct*z,g=f-(f-z),m=z-g,f=Ct*U,y=f-(f-U),_=U-y,O=m*_-(R-g*y-m*y-g*_),P=A-O,p=A-P,js[0]=A-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,js[1]=S-(P+p)+(p-R),N=C+P,p=N-C,js[2]=C-(N-p)+(P-p),js[3]=N;let w=iR(4,js),E=oR*r;if(w>=E||-w>=E||(p=t-V,l=t-(V+p)+(p-o),p=e-U,u=e-(U+p)+(p-o),p=i-z,c=i-(z+p)+(p-s),p=n-B,d=n-(B+p)+(p-s),l===0&&c===0&&u===0&&d===0)||(E=sR*r+tR*Math.abs(w),w+=V*d+B*l-(z*u+U*c),w>=E||-w>=E))return w;x=l*B,f=Ct*l,g=f-(f-l),m=l-g,f=Ct*B,y=f-(f-B),_=B-y,A=m*_-(x-g*y-m*y-g*_),R=c*U,f=Ct*c,g=f-(f-c),m=c-g,f=Ct*U,y=f-(f-U),_=U-y,O=m*_-(R-g*y-m*y-g*_),P=A-O,p=A-P,bt[0]=A-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,bt[1]=S-(P+p)+(p-R),N=C+P,p=N-C,bt[2]=C-(N-p)+(P-p),bt[3]=N;const D=Wf(4,js,4,bt,Yw);x=V*d,f=Ct*V,g=f-(f-V),m=V-g,f=Ct*d,y=f-(f-d),_=d-y,A=m*_-(x-g*y-m*y-g*_),R=z*u,f=Ct*z,g=f-(f-z),m=z-g,f=Ct*u,y=f-(f-u),_=u-y,O=m*_-(R-g*y-m*y-g*_),P=A-O,p=A-P,bt[0]=A-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,bt[1]=S-(P+p)+(p-R),N=C+P,p=N-C,bt[2]=C-(N-p)+(P-p),bt[3]=N;const L=Wf(D,Yw,4,bt,Zw);x=l*d,f=Ct*l,g=f-(f-l),m=l-g,f=Ct*d,y=f-(f-d),_=d-y,A=m*_-(x-g*y-m*y-g*_),R=c*u,f=Ct*c,g=f-(f-c),m=c-g,f=Ct*u,y=f-(f-u),_=u-y,O=m*_-(R-g*y-m*y-g*_),P=A-O,p=A-P,bt[0]=A-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,bt[1]=S-(P+p)+(p-R),N=C+P,p=N-C,bt[2]=C-(N-p)+(P-p),bt[3]=N;const G=Wf(L,Zw,4,bt,Qw);return Qw[G-1]}function aR(t,i,e,n,o,s){const r=(i-s)*(e-o),l=(t-o)*(n-s),c=r-l,u=Math.abs(r+l);return Math.abs(c)>=nR*u?c:-rR(t,i,e,n,o,s,u)}const ha=(t,i)=>t.ll.x<=i.x&&i.x<=t.ur.x&&t.ll.y<=i.y&&i.y<=t.ur.y,Gf=(t,i)=>{if(i.ur.x<t.ll.x||t.ur.x<i.ll.x||i.ur.y<t.ll.y||t.ur.y<i.ll.y)return null;const e=t.ll.x<i.ll.x?i.ll.x:t.ll.x,n=t.ur.x<i.ur.x?t.ur.x:i.ur.x,o=t.ll.y<i.ll.y?i.ll.y:t.ll.y,s=t.ur.y<i.ur.y?t.ur.y:i.ur.y;return{ll:{x:e,y:o},ur:{x:n,y:s}}};let Wn=Number.EPSILON;Wn===void 0&&(Wn=Math.pow(2,-52));const lR=Wn*Wn,kw=(t,i)=>{if(-Wn<t&&t<Wn&&-Wn<i&&i<Wn)return 0;const e=t-i;return e*e<lR*t*i?0:t<i?-1:1};class cR{constructor(){this.reset()}reset(){this.xRounder=new Kw,this.yRounder=new Kw}round(i,e){return{x:this.xRounder.round(i),y:this.yRounder.round(e)}}}class Kw{constructor(){this.tree=new Nf,this.round(0)}round(i){const e=this.tree.add(i),n=this.tree.prev(e);if(n!==null&&kw(e.key,n.key)===0)return this.tree.remove(i),n.key;const o=this.tree.next(e);return o!==null&&kw(e.key,o.key)===0?(this.tree.remove(i),o.key):i}}const ua=new cR,Lh=(t,i)=>t.x*i.y-t.y*i.x,Jw=(t,i)=>t.x*i.x+t.y*i.y,jw=(t,i,e)=>{const n=aR(t.x,t.y,i.x,i.y,e.x,e.y);return n>0?-1:n<0?1:0},Oh=t=>Math.sqrt(Jw(t,t)),hR=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return Lh(o,n)/Oh(o)/Oh(n)},uR=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return Jw(o,n)/Oh(o)/Oh(n)},eC=(t,i,e)=>i.y===0?null:{x:t.x+i.x/i.y*(e-t.y),y:e},tC=(t,i,e)=>i.x===0?null:{x:e,y:t.y+i.y/i.x*(e-t.x)},dR=(t,i,e,n)=>{if(i.x===0)return tC(e,n,t.x);if(n.x===0)return tC(t,i,e.x);if(i.y===0)return eC(e,n,t.y);if(n.y===0)return eC(t,i,e.y);const o=Lh(i,n);if(o==0)return null;const s={x:e.x-t.x,y:e.y-t.y},r=Lh(s,i)/o,l=Lh(s,n)/o,c=t.x+l*i.x,u=e.x+r*n.x,d=t.y+l*i.y,p=e.y+r*n.y,f=(c+u)/2,g=(d+p)/2;return{x:f,y:g}};class si{static compare(i,e){const n=si.comparePoints(i.point,e.point);return n!==0?n:(i.point!==e.point&&i.link(e),i.isLeft!==e.isLeft?i.isLeft?1:-1:Gn.compare(i.segment,e.segment))}static comparePoints(i,e){return i.x<e.x?-1:i.x>e.x?1:i.y<e.y?-1:i.y>e.y?1:0}constructor(i,e){i.events===void 0?i.events=[this]:i.events.push(this),this.point=i,this.isLeft=e}link(i){if(i.point===this.point)throw new Error("Tried to link already linked events");const e=i.point.events;for(let n=0,o=e.length;n<o;n++){const s=e[n];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const i=this.point.events.length;for(let e=0;e<i;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let o=e+1;o<i;o++){const s=this.point.events[o];s.consumedBy===void 0&&n.otherSE.point.events===s.otherSE.point.events&&n.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const i=[];for(let e=0,n=this.point.events.length;e<n;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&i.push(o)}return i}getLeftmostComparator(i){const e=new Map,n=o=>{const s=o.otherSE;e.set(o,{sine:hR(this.point,i.point,s.point),cosine:uR(this.point,i.point,s.point)})};return(o,s)=>{e.has(o)||n(o),e.has(s)||n(s);const{sine:r,cosine:l}=e.get(o),{sine:c,cosine:u}=e.get(s);return r>=0&&c>=0?l<u?1:l>u?-1:0:r<0&&c<0?l<u?-1:l>u?1:0:c<r?-1:c>r?1:0}}}let pR=0;class Gn{static compare(i,e){const n=i.leftSE.point.x,o=e.leftSE.point.x,s=i.rightSE.point.x,r=e.rightSE.point.x;if(r<n)return 1;if(s<o)return-1;const l=i.leftSE.point.y,c=e.leftSE.point.y,u=i.rightSE.point.y,d=e.rightSE.point.y;if(n<o){if(c<l&&c<u)return 1;if(c>l&&c>u)return-1;const p=i.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;const f=e.comparePoint(i.rightSE.point);return f!==0?f:-1}if(n>o){if(l<c&&l<d)return-1;if(l>c&&l>d)return 1;const p=e.comparePoint(i.leftSE.point);if(p!==0)return p;const f=i.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(l<c)return-1;if(l>c)return 1;if(s<r){const p=e.comparePoint(i.rightSE.point);if(p!==0)return p}if(s>r){const p=i.comparePoint(e.rightSE.point);if(p<0)return 1;if(p>0)return-1}if(s!==r){const p=u-l,f=s-n,g=d-c,m=r-o;if(p>f&&g<m)return 1;if(p<f&&g>m)return-1}return s>r?1:s<r||u<d?-1:u>d?1:i.id<e.id?-1:i.id>e.id?1:0}constructor(i,e,n,o){this.id=++pR,this.leftSE=i,i.segment=this,i.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=i,this.rings=n,this.windings=o}static fromRing(i,e,n){let o,s,r;const l=si.comparePoints(i,e);if(l<0)o=i,s=e,r=1;else if(l>0)o=e,s=i,r=-1;else throw new Error(`Tried to create degenerate segment at [${i.x}, ${i.y}]`);const c=new si(o,!0),u=new si(s,!1);return new Gn(c,u,[n],[r])}replaceRightSE(i){this.rightSE=i,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const i=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:i<e?i:e},ur:{x:this.rightSE.point.x,y:i>e?i:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(i){return i.x===this.leftSE.point.x&&i.y===this.leftSE.point.y||i.x===this.rightSE.point.x&&i.y===this.rightSE.point.y}comparePoint(i){if(this.isAnEndpoint(i))return 0;const e=this.leftSE.point,n=this.rightSE.point,o=this.vector();if(e.x===n.x)return i.x===e.x?0:i.x<e.x?1:-1;const s=(i.y-e.y)/o.y,r=e.x+s*o.x;if(i.x===r)return 0;const l=(i.x-e.x)/o.x,c=e.y+l*o.y;return i.y===c?0:i.y<c?-1:1}getIntersection(i){const e=this.bbox(),n=i.bbox(),o=Gf(e,n);if(o===null)return null;const s=this.leftSE.point,r=this.rightSE.point,l=i.leftSE.point,c=i.rightSE.point,u=ha(e,l)&&this.comparePoint(l)===0,d=ha(n,s)&&i.comparePoint(s)===0,p=ha(e,c)&&this.comparePoint(c)===0,f=ha(n,r)&&i.comparePoint(r)===0;if(d&&u)return f&&!p?r:!f&&p?c:null;if(d)return p&&s.x===c.x&&s.y===c.y?null:s;if(u)return f&&r.x===l.x&&r.y===l.y?null:l;if(f&&p)return null;if(f)return r;if(p)return c;const g=dR(s,this.vector(),l,i.vector());return g===null||!ha(o,g)?null:ua.round(g.x,g.y)}split(i){const e=[],n=i.events!==void 0,o=new si(i,!0),s=new si(i,!1),r=this.rightSE;this.replaceRightSE(s),e.push(s),e.push(o);const l=new Gn(o,r,this.rings.slice(),this.windings.slice());return si.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),si.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(o.checkForConsuming(),s.checkForConsuming()),e}swapEvents(){const i=this.rightSE;this.rightSE=this.leftSE,this.leftSE=i,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(i){let e=this,n=i;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const o=Gn.compare(e,n);if(o!==0){if(o>0){const s=e;e=n,n=s}if(e.prev===n){const s=e;e=n,n=s}for(let s=0,r=n.rings.length;s<r;s++){const l=n.rings[s],c=n.windings[s],u=e.rings.indexOf(l);u===-1?(e.rings.push(l),e.windings.push(c)):e.windings[u]+=c}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.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 i=this.prev.consumedBy||this.prev;this._beforeState=i.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const i=this.beforeState();this._afterState={rings:i.rings.slice(0),windings:i.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,o=this._afterState.multiPolys;for(let l=0,c=this.rings.length;l<c;l++){const u=this.rings[l],d=this.windings[l],p=e.indexOf(u);p===-1?(e.push(u),n.push(d)):n[p]+=d}const s=[],r=[];for(let l=0,c=e.length;l<c;l++){if(n[l]===0)continue;const u=e[l],d=u.poly;if(r.indexOf(d)===-1)if(u.isExterior)s.push(d);else{r.indexOf(d)===-1&&r.push(d);const p=s.indexOf(u.poly);p!==-1&&s.splice(p,1)}}for(let l=0,c=s.length;l<c;l++){const u=s[l].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 i=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(vi.type){case"union":{const n=i.length===0,o=e.length===0;this._isInResult=n!==o;break}case"intersection":{let n,o;i.length<e.length?(n=i.length,o=e.length):(n=e.length,o=i.length),this._isInResult=o===vi.numMultiPolys&&n<o;break}case"xor":{const n=Math.abs(i.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=o=>o.length===1&&o[0].isSubject;this._isInResult=n(i)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${vi.type}`)}return this._isInResult}}class iC{constructor(i,e,n){if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=ua.round(i[0][0],i[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let s=o;for(let r=1,l=i.length;r<l;r++){if(typeof i[r][0]!="number"||typeof i[r][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=ua.round(i[r][0],i[r][1]);c.x===s.x&&c.y===s.y||(this.segments.push(Gn.fromRing(s,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),s=c)}(o.x!==s.x||o.y!==s.y)&&this.segments.push(Gn.fromRing(s,o,this))}getSweepEvents(){const i=[];for(let e=0,n=this.segments.length;e<n;e++){const o=this.segments[e];i.push(o.leftSE),i.push(o.rightSE)}return i}}class fR{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new iC(i[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 n=1,o=i.length;n<o;n++){const s=new iC(i[n],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class nC{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}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 n=0,o=i.length;n<o;n++){const s=new fR(i[n],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class Nh{static factory(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.isInResult()||s.ringOut)continue;let r=null,l=s.leftSE,c=s.rightSE;const u=[l],d=l.point,p=[];for(;r=l,l=c,u.push(l),l.point!==d;)for(;;){const f=l.getAvailableLinkedEvents();if(f.length===0){const y=u[0].point,_=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${y.x}, ${y.y}]. Last matching segment found ends at [${_.x}, ${_.y}].`)}if(f.length===1){c=f[0].otherSE;break}let g=null;for(let y=0,_=p.length;y<_;y++)if(p[y].point===l.point){g=y;break}if(g!==null){const y=p.splice(g)[0],_=u.splice(y.index);_.unshift(_[0].otherSE),e.push(new Nh(_.reverse()));continue}p.push({index:u.length,point:l.point});const m=l.getLeftmostComparator(r);c=f.sort(m)[0].otherSE;break}e.push(new Nh(u))}return e}constructor(i){this.events=i;for(let e=0,n=i.length;e<n;e++)i[e].segment.ringOut=this;this.poly=null}getGeom(){let i=this.events[0].point;const e=[i];for(let u=1,d=this.events.length-1;u<d;u++){const p=this.events[u].point,f=this.events[u+1].point;jw(p,i,f)!==0&&(e.push(p),i=p)}if(e.length===1)return null;const n=e[0],o=e[1];jw(n,i,o)===0&&e.shift(),e.push(e[0]);const s=this.isExteriorRing()?1:-1,r=this.isExteriorRing()?0:e.length-1,l=this.isExteriorRing()?e.length:-1,c=[];for(let u=r;u!=l;u+=s)c.push([e[u].x,e[u].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const i=this.enclosingRing();this._isExteriorRing=i?!i.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let i=this.events[0];for(let o=1,s=this.events.length;o<s;o++){const r=this.events[o];si.compare(i,r)>0&&(i=r)}let e=i.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class oC{constructor(i){this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=[this.exteriorRing.getGeom()];if(i[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getGeom();o!==null&&i.push(o)}return i}}class gR{constructor(i){this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getGeom();o!==null&&i.push(o)}return i}_composePolys(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.poly)if(s.isExteriorRing())e.push(new oC(s));else{const r=s.enclosingRing();r.poly||e.push(new oC(r)),r.poly.addInterior(s)}}return e}}class mR{constructor(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gn.compare;this.queue=i,this.tree=new Nf(e),this.segments=[]}process(i){const e=i.segment,n=[];if(i.consumedBy)return i.isLeft?this.queue.remove(i.otherSE):this.tree.remove(e),n;const o=i.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 s=o,r=o,l,c;for(;l===void 0;)s=this.tree.prev(s),s===null?l=null:s.key.consumedBy===void 0&&(l=s.key);for(;c===void 0;)r=this.tree.next(r),r===null?c=null:r.key.consumedBy===void 0&&(c=r.key);if(i.isLeft){let u=null;if(l){const p=l.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(u=p),!l.isAnEndpoint(p))){const f=this._splitSafely(l,p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}}let d=null;if(c){const p=c.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(d=p),!c.isAnEndpoint(p))){const f=this._splitSafely(c,p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}}if(u!==null||d!==null){let p=null;u===null?p=d:d===null?p=u:p=si.comparePoints(u,d)<=0?u:d,this.queue.remove(e.rightSE),n.push(e.rightSE);const f=e.split(p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}n.length>0?(this.tree.remove(e),n.push(i)):(this.segments.push(e),e.prev=l)}else{if(l&&c){const u=l.getIntersection(c);if(u!==null){if(!l.isAnEndpoint(u)){const d=this._splitSafely(l,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}if(!c.isAnEndpoint(u)){const d=this._splitSafely(c,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}}}this.tree.remove(e)}return n}_splitSafely(i,e){this.tree.remove(i);const n=i.rightSE;this.queue.remove(n);const o=i.split(e);return o.push(n),i.consumedBy===void 0&&this.tree.add(i),o}}const sC=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,vR=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class yR{run(i,e,n){vi.type=i,ua.reset();const o=[new nC(e,!0)];for(let p=0,f=n.length;p<f;p++)o.push(new nC(n[p],!1));if(vi.numMultiPolys=o.length,vi.type==="difference"){const p=o[0];let f=1;for(;f<o.length;)Gf(o[f].bbox,p.bbox)!==null?f++:o.splice(f,1)}if(vi.type==="intersection")for(let p=0,f=o.length;p<f;p++){const g=o[p];for(let m=p+1,y=o.length;m<y;m++)if(Gf(g.bbox,o[m].bbox)===null)return[]}const s=new Nf(si.compare);for(let p=0,f=o.length;p<f;p++){const g=o[p].getSweepEvents();for(let m=0,y=g.length;m<y;m++)if(s.insert(g[m]),s.size>sC)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const r=new mR(s);let l=s.size,c=s.pop();for(;c;){const p=c.key;if(s.size===l){const g=p.segment;throw new Error(`Unable to pop() ${p.isLeft?"left":"right"} SweepEvent [${p.point.x}, ${p.point.y}] from segment #${g.id} [${g.leftSE.point.x}, ${g.leftSE.point.y}] -> [${g.rightSE.point.x}, ${g.rightSE.point.y}] from queue.`)}if(s.size>sC)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(r.segments.length>vR)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=r.process(p);for(let g=0,m=f.length;g<m;g++){const y=f[g];y.consumedBy===void 0&&s.insert(y)}l=s.size,c=s.pop()}ua.reset();const u=Nh.factory(r.segments);return new gR(u).getGeom()}}const vi=new yR;var wR={union:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("union",t,e)},intersection:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("intersection",t,e)},xor:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("xor",t,e)},difference:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("difference",t,e)}};function Bh(t,i,e){e===void 0&&(e={});var n=Di(t),o=Di(i),s=wR.intersection(n.coordinates,o.coordinates);return s.length===0?null:s.length===1?it(s[0],e.properties):of(s,e.properties)}function CR(t,i,e){e===void 0&&(e={});var n=JSON.stringify(e.properties||{}),o=t[0],s=t[1],r=t[2],l=t[3],c=(s+l)/2,u=(o+r)/2,d=i*2/Ri([o,c],[r,c],e),p=d*(r-o),f=i*2/Ri([u,s],[u,l],e),g=f*(l-s),m=p/2,y=m*2,_=Math.sqrt(3)/2*g,P=r-o,C=l-s,S=3/4*y,x=_,A=(P-y)/(y-m/2),R=Math.floor(A),O=(R*S-m/2-P)/2-m/2+S/2,N=Math.floor((C-_)/_),V=(C-N*_)/2,U=N*_-C>_/2;U&&(V-=_/4);for(var z=[],B=[],w=0;w<6;w++){var E=2*Math.PI/6*w;z.push(Math.cos(E)),B.push(Math.sin(E))}for(var D=[],L=0;L<=R;L++)for(var G=0;G<=N;G++){var Y=L%2===1;if(!(G===0&&Y)&&!(G===0&&U)){var q=L*S+o-O,X=G*x+s+V;if(Y&&(X-=_/2),e.triangles===!0)PR([q,X],p/2,g/2,JSON.parse(n),z,B).forEach(function(ee){e.mask?Bh(e.mask,ee)&&D.push(ee):D.push(ee)});else{var Q=_R([q,X],p/2,g/2,JSON.parse(n),z,B);e.mask?Bh(e.mask,Q)&&D.push(Q):D.push(Q)}}}return Ot(D)}function _R(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=t[0]+i*o[l],u=t[1]+e*s[l];r.push([c,u])}return r.push(r[0].slice()),it([r],n)}function PR(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=[];c.push(t),c.push([t[0]+i*o[l],t[1]+e*s[l]]),c.push([t[0]+i*o[(l+1)%6],t[1]+e*s[(l+1)%6]]),c.push(t),r.push(it([c],n))}return r}function bR(t,i,e,n){n===void 0&&(n={});for(var o=[],s=t[0],r=t[1],l=t[2],c=t[3],u=i/Ri([s,r],[l,r],n),d=u*(l-s),p=e/Ri([s,r],[s,c],n),f=p*(c-r),g=l-s,m=c-r,y=Math.floor(g/d),_=Math.floor(m/f),P=(g-y*d)/2,C=(m-_*f)/2,S=s+P,x=0;x<y;x++){for(var A=r+C,R=0;R<_;R++){var O=it([[[S,A],[S,A+f],[S+d,A+f],[S+d,A],[S,A]]],n.properties);n.mask?Z2(n.mask,O)&&o.push(O):o.push(O),A+=f}S+=d}return Ot(o)}function SR(t,i,e){return e===void 0&&(e={}),bR(t,i,i,e)}function ER(t,i,e){e===void 0&&(e={});for(var n=[],o=i/Ri([t[0],t[1]],[t[2],t[1]],e),s=o*(t[2]-t[0]),r=i/Ri([t[0],t[1]],[t[0],t[3]],e),l=r*(t[3]-t[1]),c=0,u=t[0];u<=t[2];){for(var d=0,p=t[1];p<=t[3];){var f=null,g=null;c%2===0&&d%2===0?(f=it([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),g=it([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)):c%2===0&&d%2===1?(f=it([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties),g=it([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties)):d%2===0&&c%2===1?(f=it([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties),g=it([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties)):d%2===1&&c%2===1&&(f=it([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),g=it([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)),e.mask?(Bh(e.mask,f)&&n.push(f),Bh(e.mask,g)&&n.push(g)):(n.push(f),n.push(g)),p+=l,d++}c++,u+=s}return Ot(n)}function xR(t,i,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var n=e.gridType,o=e.property,s=e.weight;if(!t)throw new Error("points is required");if(qT(t,"Point","input must contain Points"),!i)throw new Error("cellSize is required");if(s!==void 0&&typeof s!="number")throw new Error("weight must be a number");o=o||"elevation",n=n||"square",s=s||1;var r=Lo(t),l;switch(n){case"point":case"points":l=x0(r,i,e);break;case"square":case"squares":l=SR(r,i,e);break;case"hex":case"hexes":l=CR(r,i,e);break;case"triangle":case"triangles":l=ER(r,i,e);break;default:throw new Error("invalid gridType")}var c=[];return Us(l,function(u){var d=0,p=0;Us(t,function(g){var m=n==="point"?u:IM(u),y=Ri(m,g,e),_;if(o!==void 0&&(_=g.properties[o]),_===void 0&&(_=g.geometry.coordinates[2]),_===void 0)throw new Error("zValue is missing");y===0&&(d=_);var P=1/Math.pow(y,s);p+=P,d+=P*_});var f=TM(u);f.properties[o]=d/p,c.push(f)}),Ot(c)}function AR(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r);return!!(e.globe.pick(r,e)||l)}const rC=(t=0)=>new Promise(i=>setTimeout(i,t));function TR(t,i){const e=Ot(t.map(c=>ht(c))),n=it([t]);return xR(e,i,{gridType:"point",units:"meters"}).features.map(c=>c.geometry.coordinates).filter(c=>Pt(ht(c),n))}function MR(t){const i=h.JulianDate.fromDate(t),e=h.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(i);return vr(e)}function IR(t,i,e){const n=t[0]+(i[0]-t[0])*e,o=t[1]+(i[1]-t[1])*e,s=t[2]+(i[2]-t[2])*e,r=t[3]+(i[3]-t[3])*e;return[n,o,s,r]}const Ol=class Ol extends qt{constructor(e,n){super(e,n);v(this,"czmPointPrimitiveCollection");v(this,"_stopRun",!1);const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.czmPointPrimitiveCollection=this.dv(new mo(n,e.id));this.d(a.track([s,"show"],[e,"show"]));{const r=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){s.pointPrimitiveOptions=void 0;return}const u=[...e.points,e.points[0]],d=e.sampleDistance,p=TR(u,d).map(S=>[...S,e.groundHeight]),f=Math.floor(e.height/d);if(f>0){const S=[...p];for(let x=1;x<=f;x++)p.push(...S.map(A=>[A[0],A[1],e.groundHeight+x*d]))}const{startTime:g,endTime:m,spanTime:y}=e,_=y*36e5,P=Math.floor((m-g)/_),C=Array(p.length).fill(0);e:for(let S=0;S<P;S++){if(await rC(),this._stopRun)break e;const x=new Date(g+S*_),A=MR(x);t:for(let R=0;R<p.length;R++){if(await rC(),this._stopRun)break t;AR(p[R],A,o.scene)||(C[R]=(C[R]*P+1)/P)}!this._stopRun&&(e.progress=Number(((S+1)/P*100).toFixed(2))),console.log("colorScalelist",C),c(p,C)}},l=this.dv(a.createProcessingFromAsyncFunc(async u=>{await u.promise(r())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,s.pointPrimitiveOptions=void 0,e.progress=0,l.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,s.pointPrimitiveOptions=void 0,e.progress=0,l.isRunning&&l.cancel()}));const c=(u,d)=>{const p=u.map((f,g)=>({position:[...f],color:IR(e.startColor,e.endColor,d[g]),pixelSize:10}));s.pointPrimitiveOptions=p}}}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.positions){const l=o.groundHeight+o.height,c=[];return r.positions.forEach(u=>{c.push([u[0],u[1],o.groundHeight],[u[0],u[1],l])}),oe(s,o,n,c,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.positions){const l=o.groundHeight+o.height,c=[];return r.positions.forEach(u=>{c.push([u[0],u[1],o.groundHeight],[u[0],u[1],l])}),oe(s,o,n,c,e),!0}return!1}};v(Ol,"type",Ol.register("ESCesiumViewer",a.ESSunshineAnalysis.type,Ol));let Hf=Ol;const aC=(t=0)=>new Promise(i=>setTimeout(i,t)),Xo=class Xo extends a.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new a.Event));v(this,"_startEvent",this.disposeVar(new a.Event));v(this,"_stopEvent",this.dv(new a.Event));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_geoPolyline");v(this,"_customPrimitive");v(this,"_geoDivPoi");v(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new be(e,n)),this._customPrimitive=this.disposeVar(new De(e,n)),this._geoDivPoi=this.disposeVar(new We(e,n)),this.ad(this._geoDivPoi.pickedEvent.don(s=>{Hi(s)===0&&this.pickedEvent.emit(s)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(s=>{this._geoPolyline&&this._geoPolyline.flyTo(s)})),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=`
1879
1879
  uniform vec4 u_color;
1880
1880
  void main()
1881
1881
  {
@@ -1887,7 +1887,7 @@ void main()
1887
1887
  gl_Position = czm_modelViewProjection * vec4(position, 1.0);
1888
1888
  }
1889
1889
  `,this._customPrimitive.uniformMap={u_color:[1,1,0,1]},this.d(a.track([this._customPrimitive,"show"],[this,"show"])),this.d(a.track([this._geoPolyline,"show"],[this,"show"])),this.d(a.bind([this._geoPolyline,"positions"],[this,"positions"])),this.d(a.bind([this._geoPolyline,"width"],[this,"outlineWidth"])),this.d(a.bind([this._geoPolyline,"color"],[this,"outlineColor"]));{let s=function(u,d){const p=[];for(const f of d)switch(f){case"SquareMeter_SquareKilometer":u>=1e6?p.push(`面积:${(u/1e6).toFixed(2)} km²`):p.push(`面积:${u.toFixed(2)} m²`);break;case"MU_Hectare":const g=u*(1/666.7);if(g>=15){const m=g/15;p.push(`面积:${m.toFixed(2)} 公顷`)}else p.push(`面积:${g.toFixed(2)} 亩`);break}return p};const r=()=>{let u=[];this.totalArea?this._starting?u=["分析计算中..."]:u=[...s(this.totalArea,this.units)]:this._starting?u=["分析计算中..."]:u=["暂无分析结果"],this._geoDivPoi&&(this._geoDivPoi.innerHTML=ao([...u].join(`
1890
- `),24))};r(),this.d(this.totalAreaChanged.don(r)),this.d(this.unitsChanged.don(r)),this.d(a.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=wy(this.positions):this._geoDivPoi.position=void 0)}));const l=async()=>{if((!this.positions||this.positions.length<3)&&this.customPrimitive){this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1;return}const u=this.interpolationDistance??Xo.defaults.interpolationDistance,d=this.interpolation??Xo.defaults.interpolation,p=this.offsetHeight??Xo.defaults.offsetHeight,f=this.drillDepth??Xo.defaults.drillDepth,g=[];if(this.positions)for(let q=0;q<this.positions.length;++q){const X=h.Cartesian3.fromDegrees(this.positions[q][0],this.positions[q][1],this.positions[q][2]);g.push(X)}var m=R2(g);if(isNaN(m.x)||isNaN(m.y)||isNaN(m.z)){console.warn("法向量计算错误!");return}var y=F2(g),_=h.Cartesian3.normalize(y,new h.Cartesian3),P=h.Cartesian3.dot(_,m);P<0&&(m=lC(m),g.reverse());let C=h.Transforms.eastNorthUpToFixedFrame(y),S=h.Matrix4.inverseTransformation(C,new h.Matrix4);if(Math.abs(P)<.999){const q=z2(m,_);var x=lC(y),A=h.Matrix4.fromTranslation(x,new h.Matrix4);S=h.Matrix4.multiply(q,A,A),C=h.Matrix4.inverse(S,new h.Matrix4)}var R=er(g,S),O=[],N=[],V=O2(R);if(d&&u>0){var U=L2(R);const q=Math.max(U.maxy-U.miny,U.maxx-U.minx);var z=U2(V,U,u);const X=await $f(z,C,S,m,o.scene,p,f,q);var B=W2(R,u);const Q=await $f(B,C,S,m,o.scene,p,f,q);N.push(...X.world_cartesian),O.push(...X.local),N.push(...Q.world_cartesian),O.push(...Q.local);for(let ee=0;ee<R.length;++ee){const he=R[ee];var w=await $f([he],C,S,m,o.scene,p,f,q);if(w.local.length>0)O.push(...w.local),N.push(...w.world_cartesian);else{const ge=[he.x,he.y,he.z+p];O.push(ge);var E=er([h.Cartesian3.fromArray(ge)],C);for(let ve=0;ve<E.length;++ve)N.push(E[ve])}}}else{const q=R.map(X=>h.Cartesian3.fromArray([X.x,X.y,X.z+q]));O=q,N=er(q,C)}var D=N2(O,V);const L=B2(N,D);this.totalArea=L;const G=[];O.forEach(q=>{const X=[q.x,q.y,q.z];X&&G.push(...X)});const Y={position:{typedArray:new Float32Array(G),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=h.Matrix4.toArray(C),this.customPrimitive.attributes=Y;const q=await D2([...D]);this.customPrimitive.indexTypedArray=new Uint32Array(q),this.customPrimitive.show=!0;const X=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!X)return;const{min:Q,max:ee}=X;this.customPrimitive.setLocalAxisedBoundingBox(Q,ee)}},c=this.dv(a.createProcessingFromAsyncFunc(async u=>{await u.promise(l()),this._starting=!1,r()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,r(),c.restart()})),this.d(this.stopEvent.don(()=>{c.cancel(),this._starting=!1,this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1,r()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};v(Xo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let No=Xo;(t=>{t.createDefaultProps=()=>({positions:a.reactArrayWithUndefined(void 0),show:void 0,totalArea:void 0,interpolationDistance:void 0,interpolation:void 0,offsetHeight:void 0,drillDepth:void 0,outlineWidth:void 0,outlineColor:a.reactArray([1,1,1,1]),units:a.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(No||(No={})),a.extendClassProps(No.prototype,No.createDefaultProps);async function D2(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const i=t.length/3|0,e=new Array(i*6);for(let n=0;n<i;++n)await aC(),e[n*6+0]=t[n*3+0],e[n*6+1]=t[n*3+1],e[n*6+2]=t[n*3+2],e[n*6+3]=t[n*3+1],e[n*6+4]=t[n*3+2],e[n*6+5]=t[n*3+0];return e}function R2(t){var i=new h.Cartesian3(0,0,0),e=new h.Cartesian3(0,0,0),n=new h.Cartesian3(0,0,0),o=new h.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var s=t.length;for(let u=0;u<s;++u){var r=t[u],l;u==0?l=t[t.length-1]:l=t[u-1];var c;u==t.length-1?c=t[0]:c=t[u+1],i=h.Cartesian3.subtract(r,l,i),e=h.Cartesian3.subtract(r,c,e),n=h.Cartesian3.cross(i,e,n),!n.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6)&&(n=h.Cartesian3.normalize(n,n),o=h.Cartesian3.add(o,n,o))}return n.x=o.x/s,n.y=o.y/s,n.z=o.z/s,n}function F2(t){var i=new h.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var n=t[o];i=h.Cartesian3.add(i,n,i)}return i.x=i.x/e,i.y=i.y/e,i.z=i.z/e,i}function lC(t){return new h.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function z2(t,i){var e=h.Cartesian3.cross(t,i,new h.Cartesian3);e=h.Cartesian3.normalize(e,e);var n=h.Cartesian3.cross(t,e,new h.Cartesian3);n=h.Cartesian3.normalize(n,n);var o=t,s=new h.Matrix4(e.x,e.y,e.z,0,n.x,n.y,n.z,0,o.x,o.y,o.z,0,0,0,0,1);return s}function er(t,i){var e=[];for(let s=0;s<t.length;++s){var n=t[s],o=h.Matrix4.multiplyByPoint(i,n,new h.Cartesian3);e.push(o)}return e}function L2(t){var i=t[0].x,e=t[0].y,n=t[0].x,o=t[0].y;return t.forEach(s=>{i=Math.min(i,s.x),e=Math.min(e,s.y),n=Math.max(n,s.x),o=Math.max(o,s.y)}),{minx:i,miny:e,maxx:n,maxy:o}}function O2(t){var i=[];return t.forEach(e=>{i.push([e.x,e.y])}),i.push(i[0]),i}function N2(t,i){var e=[];t.forEach(r=>{const l=[r.x,r.y];e.push(l)});var n=c_.from(e).triangles;const o=[],s=it([i]);for(let r=0;r<n.length;r+=3){const l=n[r],c=n[r+1],u=n[r+2],d=(t[l].x+t[c].x+t[u].x)/3,p=(t[l].y+t[c].y+t[u].y)/3;Pt([d,p],s)&&o.push(l,c,u)}return new Uint32Array(o.reverse())}function B2(t,i){for(var e=0,n=0;n<i.length;n+=3){const o=[t[i[n]],t[i[n+1]],t[i[n+2]]];e+=V2(o)}return e}function V2(t){var i=h.Cartesian3.distance(t[0],t[1]),e=h.Cartesian3.distance(t[1],t[2]),n=h.Cartesian3.distance(t[2],t[0]),o=(i+e+n)/2,s=Math.sqrt(o*(o-i)*(o-e)*(o-n));return s||0}function U2(t,i,e){for(var n=[],o=i.minx;o<i.maxx;o+=e)for(var s=i.miny;s<i.maxy;s+=e)H2([o,s],t)&&n.push(new h.Cartesian3(o,s,0));return n}function W2(t,i){var e=[];for(let r=0;r<t.length;++r){var n=t[r],o;r==t.length-1?o=t[0]:o=t[r+1];var s=G2(n,o,i);e.push(...s)}return e}function G2(t,i,e){var n=[],o=h.Cartesian3.distance(t,i),s=h.Cartesian3.subtract(i,t,new h.Cartesian3);if(s.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6))return[];s=h.Cartesian3.normalize(s,s);for(var r=e;r<o;){var l=new h.Cartesian3(s.x*r,s.y*r,s.z*r),c=h.Cartesian3.add(t,l,new h.Cartesian3);n.push(c),r+=e}return n}function H2(t,i){var e=ht(t);if(!YR(ht(i[0]),ht(i[i.length-1])))return!1;var n=[];n.push(i);var o=it(n);return Pt(e,o)}async function $f(t,i,e,n,o,s,r,l){var c=[];t.forEach(S=>{var x=S.clone();x.z=l,c.push(x)});var u=er(c,i),d=new h.Cartesian3(-1*n.x,-1*n.y,-1*n.z),p=[],f=[],g=[];for(let S=0;S<u.length;++S){await aC();var m=u[S],y=new h.Ray(m,d),_=void 0;try{_=o.pickFromRay(y)}catch{}if(!_){y=new h.Ray(m,n);try{_=o.pickFromRay(y)}catch{}}if(_){var P=_.position;if(!(!P||!P.x||isNaN(P.x))){var C=er([P],e);C.forEach(x=>{x.z+=s}),P=er(C,i)[0],g.push(P),P=h.Cartographic.fromCartesian(P),p.push([P.longitude,P.latitude,P.height]),f.push(C[0])}}}return{local:f,world:p,world_cartesian:g}}const Nl=class Nl extends qt{constructor(e,n){super(e,n);v(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new No(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmAreaMeasurement;this.ad(a.track([e,"surfaceArea"],[s,"totalArea"])),this.ad(a.track([s,"units"],[e,"units"])),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"positions"],[e,"points"])),this.d(a.track([s,"interpolationDistance"],[e,"interpolation"])),this.d(a.track([s,"offsetHeight"],[e,"offsetHeight"]));{const r=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)s.outlineWidth=e.strokeWidth;else{s.outlineWidth=0;return}s.outlineWidth=e.strokeWidth,s.outlineColor=e.strokeColor};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(l.disposableOn(r))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.positions&&oe(s,o,n,r.positions,e),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.positions&&oe(s,o,n,r.positions,e),!0):!1}};v(Nl,"type",Nl.register("ESCesiumViewer",a.ESSurfaceAreaMeasurement.type,Nl));let qf=Nl;async function $2(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(i){console.log("复制失败")})}const Bl=class Bl extends a.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof Te))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d)),d.style.width="100%",d.style.position="absolute",d.style.height=`${a.ESViewerStatusBar.defaults.height}px`,d.style.left="0",d.style.bottom="0",d.style.color="#fff",d.style.padding="0 20px 0 0",d.style.boxSizing="border-box",d.style.lineHeight=`${a.ESViewerStatusBar.defaults.height}px`,d.style.zIndex="100",d.style.alignContent="center",d.style.justifyContent="space-between";const p=document.createElement("span");d.appendChild(p),this.dispose(()=>d.removeChild(p));const f=document.createElement("span");p.appendChild(f),this.dispose(()=>p.removeChild(f));const g=document.createElement("span");p.appendChild(g),g.addEventListener("dblclick",function(){let y=g.innerHTML;y.startsWith("鼠标位置")&&(y=y.slice(5)),$2(y)}),g.style.cursor="pointer",this.dispose(()=>p.removeChild(g));const m=document.createElement("span");d.appendChild(m),this.dispose(()=>d.removeChild(m));{const y=()=>{d.style.height=(e.height??a.ESViewerStatusBar.defaults.height)+"px",d.style.lineHeight=(e.height??a.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(y)),y()}{const y=()=>{d.style.fontSize=(e.fontSize??a.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(y)),y()}{const y=()=>{e.bgColor?d.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:d.style.background=`rgba(${a.ESViewerStatusBar.defaults.bgColor[0]},${a.ESViewerStatusBar.defaults.bgColor[1]},${a.ESViewerStatusBar.defaults.bgColor[2]},${a.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(y)),y()}{m.innerText=`Cesium 版本 : ${h.VERSION} `;let y;const _=()=>{e.show?(d.style.display="flex",y=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var A;let P="",C="";const S=u.getCameraInfo();if(S){const R=(N,V)=>S.position[N].toFixed(V),O=(N,V)=>S.rotation[N].toFixed(V);P=`帧率:${u.getFPS()}FPS 经度: ${R(0,5)}° 纬度: ${R(1,5)}° 高度: ${R(2,2)}米 偏航角: ${O(0,2)}° 俯仰角: ${O(1,2)}° 翻滚角:${O(2,2)}° `}f.innerText=P;const x=(A=u.extensions)==null?void 0:A.cursorPositionInfo.cursorPosition;if(x){const R=(O,N)=>x[O].toFixed(N);C=`鼠标位置:${R(0,5)}° ${R(1,5)}° ${R(2,2)}m`}else C="暂时无法获取鼠标位置...";g.innerText=C})),y.start()):(d.style.display="none",y.destroy())};this.dispose(e.showChanged.disposableOn(_)),_()}}}}get customDiv(){return this._customDiv}};v(Bl,"type",Bl.register("ESCesiumViewer",a.ESViewerStatusBar.type,Bl));let Xf=Bl;const Vl=class Vl extends a.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),this.dispose(a.track([s,"show"],[e,"show"])),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof Te))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));const p=document.createElement("div");d.appendChild(p),p.style.width="100%",p.className="ESViewerStatusBarScale",p.style.position="absolute",p.style.display="flex",p.style.height=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.left="0",p.style.bottom="0",p.style.color="#fff",p.style.padding="0 20px 0 0",p.style.boxSizing="border-box",p.style.lineHeight=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.zIndex="100",p.style.alignContent="center",p.style.justifyContent="space-between";const f=document.createElement("div");p.appendChild(f);const g=document.createElement("div");f.appendChild(g);const m=document.createElement("div");f.appendChild(m);const y=document.createElement("div");p.appendChild(y);const _=document.createElement("div");y.appendChild(_);const P=document.createElement("div");_.appendChild(P);const C=document.createElement("div");_.appendChild(C);const S=document.createElement("span");y.appendChild(S);{const N=()=>{p.style.height=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px",p.style.lineHeight=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(N)),N()}{const N=()=>{p.style.fontSize=(e.fontSize??a.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(N)),N()}{const N=()=>{e.bgColor?p.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:p.style.background=`rgba(${a.ESViewerStatusBarScale.defaults.bgColor[0]},${a.ESViewerStatusBarScale.defaults.bgColor[1]},${a.ESViewerStatusBarScale.defaults.bgColor[2]},${a.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(N)),N()}f.style.display="flex",g.style.fontWeight="bold",g.style.padding="0 0 0 25px";let x="EarthSDK";g.innerText=x,m.style.fontWeight="";let A="——免费开源地球可视化开发包";m.innerText=A,y.style.width="550px",_.style.position="fixed",_.style.width="125px",_.style.height="30px",_.style.padding="0 5px",_.style.display="flex",_.style.justifyContent="flex-end",_.style.pointerEvents="auto",_.style.zIndex="101",P.style.width="125px",P.style.display="inline-block",P.style.textAlign="center",P.style.fontSize="14px",P.style.fontWeight="lighter",P.style.lineHeight="30px",P.style.color="#fff",P.innerHTML="1000km",C.style.borderRight="1px solid #fff",C.style.borderLeft="1px solid #fff",C.style.borderBottom="1px solid #fff",C.style.position="absolute",C.style.height="10px",C.style.top="15px",C.style.width="75px",C.style.right=`${60/2}px`,S.style.display="flex",S.style.zIndex="101",S.style.justifyContent="flex-end",S.style.right="0";const R=()=>{const N=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||N&&N>1e6)_.style.display="none";else{_.style.display="block";const V=n.viewerLegend.legend.computedLengthInStr;V&&(P.innerHTML=V);const U=n.viewerLegend.legend.computedLengthInPixels;if(U){C.style.width=`${U}px`;const z=(135-U)/2;C.style.left=`${z}px`}}};R();const O=setInterval(()=>{R()},200);this.dispose(()=>clearInterval(O));{let N;const V=()=>{e.show?(d.style.display="block",N=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var w;let U="";const z=u.getCameraInfo();if(z){const E=(D,L)=>z.position[D].toFixed(L);U+=`帧率:${u.getFPS()}FPS 相机: ${E(2,2)}米 `}const B=(w=u.extensions)==null?void 0:w.cursorPositionInfo.cursorPosition;if(B){const E=(D,L)=>B[D].toFixed(L);U+=`位置:${E(0,5)}° ${E(1,5)}° ${E(2,2)}米`}else U+="暂时无法获取鼠标位置...";S.innerText=U})),N.start()):(d.style.display="none",N.destroy())};this.dispose(e.showChanged.disposableOn(V)),V()}}}}get customDiv(){return this._customDiv}};v(Vl,"type",Vl.register("ESCesiumViewer",a.ESViewerStatusBarScale.type,Vl));let Yf=Vl;const cC=h.Math.toDegrees,q2=new h.Cartographic;function hC(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r),c=e.globe.pick(r,e);var u;if(l&&l.position&&c){const m=h.Cartesian3.distance(n,l.position),y=h.Cartesian3.distance(n,c);u=m<y?l.position:c}else l&&l.position?u=l.position:c&&(u=c);if(!u)return;const d=h.Cartesian3.distance(n,o),f=h.Cartesian3.distance(n,u)>d?o:u,g=h.Cartographic.fromCartesian(f,void 0,q2);return[cC(g.longitude),cC(g.latitude),g.height]}const Ul=class Ul extends vt{constructor(e,n){super(e,n);v(this,"_hideGeoPolylines",this.disposeVar(new $t(this.czmViewer,this.sceneObject.id)));v(this,"_visibleGeoPolylines",this.disposeVar(new $t(this.czmViewer,this.sceneObject.id)));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this._hideGeoPolylines,r=this._visibleGeoPolylines;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([r,"show"],[e,"show"])),this.d(a.track([r,"color"],[e,"visibleColor"])),this.d(a.track([s,"color"],[e,"invisibleColor"]));{const l=()=>{const u=e.points,d=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){s.positions=void 0,r.positions=void 0;return}const p=[],f=[],[g,m,y]=u[0],_=[g,m,y+d];try{u.forEach((P,C)=>{if(C===0)return;const S=hC(_,P,o.scene);S?(p.push([P,S]),f.push([_,S])):f.push([_,P])}),s.positions=p,r.positions=f}catch(P){console.warn(P)}};l();const c=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(c.don(l))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),oe(s,o,n,r,e),!0}}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),oe(s,o,n,r,e),!0}}};v(Ul,"type",Ul.register("ESCesiumViewer",a.ESVisibilityAnalysis.type,Ul));let Zf=Ul;class da extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.dv(new a.Event));v(this,"_enableEvent",this.dv(new a.Event));v(this,"_clearEvent",this.dv(new a.Event));v(this,"_gridPoints",this.dv(a.reactJson([])));v(this,"excavationPolylines");v(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.dv(new $t(e,n)),r=this.dv(new $t(e,n));this.excavationPolylines=s,this.fillPolylines=r;const l=s;l.color=[1,1,0,1],this.d(a.track([l,"show"],[this,"show"])),l.show=!1,l.depthTest=!0;const c=r;c.color=[0,0,1,1],this.d(a.track([c,"show"],[this,"show"])),c.show=!1;{const g=this.ad(new Mi(e,n));this.d(a.track([g,"show"],[this,"show"])),this.d(a.bind([g,"allowPicking"],[this,"allowPicking"])),this.d(a.bind([g,"positions"],[this,"positions"])),this.d(a.bind([g,"depthTest"],[this,"depthTest"])),this.d(a.bind([g,"outlineWidth"],[this,"outlineWidth"])),this.d(a.bind([g,"outlineColor"],[this,"outlineColor"])),this.d(a.bind([g,"outline"],[this,"outline"])),this.d(a.bind([g,"color"],[this,"fillColor"])),this.d(a.bind([g,"fill"],[this,"filled"])),this.d(a.bind([g,"strokeGround"],[this,"strokeGround"])),this.d(a.bind([g,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(_=>{g.flyTo(_)}));const m=()=>{g.positions=this.positions};m();const y=this.dv(a.createNextAnimateFrameEvent(this.positionsChanged));this.d(y.don(m))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:g,maxPos:m}=a.getMinMaxCorner(this.positions),y=g[0],_=g[1],P=m[0],C=m[1],x={type:"Polygon",coordinates:[[...this.positions.map(B=>[B[0],B[1]])]]},A=[y,_,P,C],R=this.gridWidth,V=x0(A,R,{units:"meters",mask:x}).features.map(B=>B.geometry.coordinates),U=h.Math.toRadians;return V.map(B=>new h.Cartographic(U(B[0]),U(B[1])))},d=()=>{l.positions=[],c.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,l.depthTest=!0},p=this.dv(a.createProcessingFromAsyncFunc(async g=>{const m=u();let y=0,_=300;const P=Math.ceil(m.length/_),C=[];do{let S=[];y===P-1?S=m.slice(y*_):S=m.slice(y*_,(y+1)*_);const x=o.scene.sampleHeightMostDetailed(S),A=await g.promise(x);if(y===P-1?this.progress=Math.round(this.progress+100/P):this.progress+=100/P,A&&A.length){const R=h.Math.toDegrees,O=A.filter(N=>N!=null).map(N=>[R(N.longitude),R(N.latitude),N.height]);C.push(...O)}y++}while(y<P);!C||!C.length||(this.gridPoints=C)}));let f=null;{const g=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let m=0;const y=[];let _=0;const P=[];this.gridPoints.forEach(C=>{const S=this.positions;C[2]>S[0][2]?(m+=this.gridWidth*this.gridWidth*(C[2]-S[0][2]),y.push([C,[C[0],C[1],S[0][2]]])):(_+=this.gridWidth*this.gridWidth*(S[0][2]-C[2]),P.push([C,[C[0],C[1],S[0][2]]]))}),l.positions=y,c.positions=P,l.show=!0,c.show=!0,this.area=yy(this.positions),this.cutVolume=m,this.fillVolume=_,this.cutAndFillVolume=_-m,f&&clearTimeout(f),f=setTimeout(()=>{l.depthTest=!1},200)};g(),this.d(this.gridPointsChanged.don(g)),this.d(()=>clearTimeout(f))}{const g=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};g(),this.d(this.positionsChanged.don(g))}{const g=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const m=JSON.parse(JSON.stringify(this.positions.slice(1)));m.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=m};g(),this.d(this.planeHeightChanged.don(g))}this.d(this.enableEvent.don(()=>{d(),this.gridPoints=[],this.progress=0,p.restart()})),this.d(this.clearEvent.don(()=>{d()}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get enableEvent(){return this._enableEvent}enableEmit(){this._enableEvent.emit()}get clearEvent(){return this._clearEvent}clearEmit(){this._clearEvent.emit()}get gridPoints(){return this._gridPoints.value}set gridPoints(e){this._gridPoints.value=e}get gridPointsChanged(){return this._gridPoints.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),planeHeight:a.react(void 0),gridWidth:1,area:0,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,outlineWidth:2,outlineColor:[1,1,1,1],outline:!0,filled:!1,fillColor:[1,1,1,1],fillGround:!1,strokeGround:!1})})(da||(da={})),a.extendClassProps(da.prototype,da.createDefaultProps);const Wl=class Wl extends qt{constructor(e,n){super(e,n);v(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new da(this.czmViewer,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoVolumeMeasurement;this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"positions"],[e,"points"])),this.d(a.track([s,"allowPicking"],[e,"allowPicking"])),this.d(a.bind([s,"planeHeight"],[e,"planeHeight"])),this.d(a.track([s,"gridWidth"],[e,"gridWidth"])),this.d(a.track([e,"cutVolume"],[s,"cutVolume"])),this.d(a.track([e,"fillVolume"],[s,"fillVolume"])),this.d(a.track([e,"cutAndFillVolume"],[s,"cutAndFillVolume"])),this.d(a.bind([e,"progress"],[s,"progress"])),this.d(a.track([s,"depthTest"],[e,"depthTest"])),this.d(a.track([s,"outline"],[e,"stroked"])),this.d(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.d(a.track([s,"outlineColor"],[e,"strokeColor"])),this.d(a.track([s,"filled"],[e,"filled"])),this.d(a.track([s,"fillColor"],[e,"fillColor"])),this.d(a.track([s,"fillGround"],[e,"fillGround"])),this.d(a.track([s,"strokeGround"],[e,"strokeGround"])),this.ad(a.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{s.enableEmit()})),this.d(e.clearEvent.don(()=>{s.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoVolumeMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Wl,"type",Wl.register("ESCesiumViewer",a.ESVolumeMeasurement.type,Wl));let Qf=Wl;const Gl=class Gl extends qt{constructor(e,n){super(e,n);v(this,"czmEntity");v(this,"czmPolyline",this.ad(new a.ESGeoLineString));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.czmPolyline;n.add(s),this.ad(()=>n.delete(s)),this.ad(a.bind([s,"show"],[e,"show"])),this.ad(a.bind([s,"allowPicking"],[e,"allowPicking"])),this.ad(a.bind([s,"stroked"],[e,"stroked"])),this.ad(a.bind([s,"strokeColor"],[e,"strokeColor"])),this.ad(a.bind([s,"strokeWidth"],[e,"strokeWidth"])),this.ad(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)s.points=e.points;else{const p=structuredClone(e.points);p.push(p[0]),e.perPositionHeight?s.points=p:s.points=p.map(f=>(f[2]=e.height??a.ESGeoExtrudedPolygon.defaults.height,f))}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(d.don(u))}const r=this.czmEntity=o.entities.add({polygon:{}});h.Entity.prototype&&(r.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(r));let l=new h.PolygonHierarchy;r.polygon&&(r.polygon.hierarchy=new h.CallbackProperty(()=>l,!1));const c=()=>{const u=ut(e.points??[]);if(u.length<2){l=new h.PolygonHierarchy;return}l=new h.PolygonHierarchy(u)};c(),this.dispose(e.pointsChanged.disposableOn(c));{const u=()=>{r.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!r.show&&e.filled)};u();const d=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(d.don(u))}{const u=()=>{r.polygon&&(r.polygon.perPositionHeight=new h.ConstantProperty(e.perPositionHeight),c())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{r.polygon&&(r.polygon.height=new h.ConstantProperty(e.height??a.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{r.polygon&&(r.polygon.extrudedHeight=new h.ConstantProperty(e.extrudedHeight??a.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const d=h.Color.fromCartesian4(h.Cartesian4.fromArray(e.fillColor));r.polygon&&(r.polygon.material=d)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new a.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new Te.ObjectsToExcludeWrapper(n,r)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:n,maxPos:o}=a.getMinMaxCorner(e.points);return[n[2],o[2]]}return[0,0]}};v(Gl,"type",Gl.register("ESCesiumViewer",a.ESGeoExtrudedPolygon.type,Gl));let kf=Gl;const Hl=class Hl extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:s}=i;this.dispose(a.bind([o,"position"],[i,"position"])),this.dispose(a.bind([o,"rotation"],[i,"rotation"])),this.ad(a.bind([o,"scale"],[i,"scale"])),this.ad(a.track([s,"scale"],[i,"scale"])),this.dispose(a.track([s,"rotation"],[i,"rotation"]));const r=()=>{const c=i.position;s.position=[c[0],c[1],c[2]+i.poiOffsetHeight]};r();const l=this.dv(a.createNextAnimateFrameEvent(i.positionChanged,i.poiOffsetHeightChanged));this.d(l.don(r)),this.ad(s.pickedEvent.don(c=>{c.assign({sceneObject:i}),i.pickedEvent.emit(c)}))}};v(Hl,"type",Hl.register("ESCesiumViewer",a.ESHumanPoi.type,Hl));let Kf=Hl;const $l=class $l extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const s=o.d(o.tilesetReady.donce(c=>{c.allTilesLoaded.addEventListener(()=>{var d,p,f,g;const u=(g=(f=(p=(d=c==null?void 0:c._root)==null?void 0:d._content)==null?void 0:p._model)==null?void 0:f._featureTables[0])==null?void 0:g._features[0];u?o.strokeFeature([u],h.Color.LIME.toBytes().map(m=>m/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",c),s()})})),r=o.url,l=Date.now();r.includes("?reload=")?o.url=r.replace(/\?reload=\d+/,`?reload=${l}`):o.url=r+`?reload=${l}`})),this.d(i.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(i.es3DTileset.tilesetReady.don(o=>{const s=()=>{const l=i.layerConfig;if(!l){o.style=void 0;return}const c=i.colorBlendMode,u=(f,g)=>{try{if(f.getPropertyIds().includes("materialName"))return h.Color.clone(h.Color.WHITE,g);const m=f.getProperty("layer"),y=f.getProperty("dataset"),_=m.toString(),P=y.toString(),C=l.find(x=>x.dataset.toString()===P&&x.layer.toString()===_);if(C&&C.value.color){const x=C.value.color;return h.Color.fromCssColorString(x,g)}const S=l.filter(x=>x.dataset.toString()===P);if(S.length==1&&S[0].value.color){const x=S[0].value.color;return h.Color.fromCssColorString(x,g)}else return h.Color.clone(h.Color.WHITE,g)}catch(m){return console.warn(m),h.Color.clone(h.Color.WHITE,g)}},d=f=>{try{if(f.getPropertyIds().includes("id")){const S=Object.entries(i.visJson);for(let x=0;x<S.length;x++){const A=S[x];if(f.getProperty("id").toString()===A[0])return A[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const g=f.getProperty("layer"),m=f.getProperty("dataset"),y=g.toString(),_=m.toString(),P=l.find(S=>S.dataset.toString()===_&&S.layer.toString()===y);if(P&&P.value.visible===!1)return!1;if(P&&P.value.visible===!0)return!0;const C=l.filter(S=>S.dataset.toString()===_);return!(C.length==1&&C[0].value.visible===!1)}catch(g){return console.warn(g),!0}};let p;c!=="HIGHLIGHT"?p=new h.Cesium3DTileStyle({color:{evaluateColor:function(f,g){return u(f,g)}},show:{evaluate:function(f){return d(f)}}}):p=new h.Cesium3DTileStyle({show:{evaluate:function(f){return d(f)}}}),console.log("style",p),o.style=p};s();const r=this.dv(a.createNextAnimateFrameEvent(i.layerConfigChanged,i.colorBlendModeChanged,i.visJsonChanged));this.d(r.don(()=>{s()}))}))}};v($l,"type",$l.register("ESCesiumViewer",a.ESRtsTileset.type,$l));let Jf=$l;const ql=class ql extends Ds{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(ql,"type",ql.register("ESCesiumViewer",a.ESRtsFeatureEditing.type,ql));let jf=ql;const Xl=class Xl extends Ds{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(Xl,"type",Xl.register("ESCesiumViewer",a.ESMsTileset.type,Xl));let eg=Xl;const Yl=class Yl extends fe{constructor(e,n){super(e,n);v(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new ti(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPoint;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPoint:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(Yl,"type",Yl.register("ESCesiumViewer",a.ESStaticMesh.type,Yl));let tg=Yl;const Zl=class Zl extends vt{constructor(i,e){super(i,e);const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=this.ad(new vm(n));this.ad(i.startEvent.don(async()=>{const s=await o.getDepthsFromScreen(),r=Number.isFinite(i.radius)?i.radius:a.ESSkylineAnalysis.defaults.radius,{depths:l,windowPositions:c,positions:u}=o.getSkylineDepthsAndPositions(s,n.scene.canvas.width,n.scene.canvas.height,r),d=re(n.camera.position);u.push(d),i.depths=l,i.windowPositions=c,i.points=u}))}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):n.points?(oe(o,n,e,n.points,i),!0):!1:!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):n.points?(oe(o,n,e,n.points,i),!0):!1:!1}};v(Zl,"type",Zl.register("ESCesiumViewer",a.ESSkylineAnalysis.type,Zl));let ig=Zl;class X2 extends a.Destroyable{constructor(e,n){super();v(this,"_rectangle");v(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));const o=e.sceneObject;this._rectangle=this.ad(new Si(n,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(a.bind([this.rectangle,"show"],[o,"show"])),this.ad(a.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(s=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:s}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class Y2 extends a.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));v(this,"czmViewer");v(this,"czmESHeatMap");const o=this.czmViewer=n,s=this.czmESHeatMap=e,r=s.sceneObject,l=o.viewer;if(!l)return;let c,u;const d=this.ad(new a.Event),p=()=>{f(),!(!c||!u)&&(this._primitive=l.scene.primitives.add(new h.Primitive({geometryInstances:c,appearance:u,asynchronous:!1,allowPicking:r.allowPicking})))},f=()=>{this.primitive&&l.scene.primitives.remove(this.primitive)};this.ad(f);{const g=()=>{this.primitive&&(this.primitive.show=r.show)};g(),this.ad(r.showChanged.don(g))}{const g=this.ad(a.createNextAnimateFrameEvent(r.allowPickingChanged,d));this.ad(g.don(p))}{const g=()=>{s.rectangle&&(c=new h.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(s.div.style.width),Number.parseFloat(s.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=c,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(m=>{if(!s.rectangle)return;const y=s.rectangle[1]+(s.rectangle[3]-s.rectangle[1])*.5,_=a.getDistancesFromPositions([[s.rectangle[0],y,0],[s.rectangle[2],y,0]],"GEODESIC")[0]/5;u=new h.MaterialAppearance({material:new h.Material({fabric:{type:"Image",uniforms:{image:m}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(_),flat:!0}),this.primitive&&s.rectangle&&(this.primitive.appearance.material.uniforms.image=m,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(_)),g(),this.primitive||d.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
1890
+ `),24))};r(),this.d(this.totalAreaChanged.don(r)),this.d(this.unitsChanged.don(r)),this.d(a.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=wy(this.positions):this._geoDivPoi.position=void 0)}));const l=async()=>{if((!this.positions||this.positions.length<3)&&this.customPrimitive){this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1;return}const u=this.interpolationDistance??Xo.defaults.interpolationDistance,d=this.interpolation??Xo.defaults.interpolation,p=this.offsetHeight??Xo.defaults.offsetHeight,f=this.drillDepth??Xo.defaults.drillDepth,g=[];if(this.positions)for(let q=0;q<this.positions.length;++q){const X=h.Cartesian3.fromDegrees(this.positions[q][0],this.positions[q][1],this.positions[q][2]);g.push(X)}var m=RR(g);if(isNaN(m.x)||isNaN(m.y)||isNaN(m.z)){console.warn("法向量计算错误!");return}var y=FR(g),_=h.Cartesian3.normalize(y,new h.Cartesian3),P=h.Cartesian3.dot(_,m);P<0&&(m=lC(m),g.reverse());let C=h.Transforms.eastNorthUpToFixedFrame(y),S=h.Matrix4.inverseTransformation(C,new h.Matrix4);if(Math.abs(P)<.999){const q=zR(m,_);var x=lC(y),A=h.Matrix4.fromTranslation(x,new h.Matrix4);S=h.Matrix4.multiply(q,A,A),C=h.Matrix4.inverse(S,new h.Matrix4)}var R=er(g,S),O=[],N=[],V=OR(R);if(d&&u>0){var U=LR(R);const q=Math.max(U.maxy-U.miny,U.maxx-U.minx);var z=UR(V,U,u);const X=await $f(z,C,S,m,o.scene,p,f,q);var B=WR(R,u);const Q=await $f(B,C,S,m,o.scene,p,f,q);N.push(...X.world_cartesian),O.push(...X.local),N.push(...Q.world_cartesian),O.push(...Q.local);for(let ee=0;ee<R.length;++ee){const he=R[ee];var w=await $f([he],C,S,m,o.scene,p,f,q);if(w.local.length>0)O.push(...w.local),N.push(...w.world_cartesian);else{const ge=[he.x,he.y,he.z+p];O.push(ge);var E=er([h.Cartesian3.fromArray(ge)],C);for(let ve=0;ve<E.length;++ve)N.push(E[ve])}}}else{const q=R.map(X=>h.Cartesian3.fromArray([X.x,X.y,X.z+q]));O=q,N=er(q,C)}var D=NR(O,V);const L=BR(N,D);this.totalArea=L;const G=[];O.forEach(q=>{const X=[q.x,q.y,q.z];X&&G.push(...X)});const Y={position:{typedArray:new Float32Array(G),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=h.Matrix4.toArray(C),this.customPrimitive.attributes=Y;const q=await DR([...D]);this.customPrimitive.indexTypedArray=new Uint32Array(q),this.customPrimitive.show=!0;const X=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!X)return;const{min:Q,max:ee}=X;this.customPrimitive.setLocalAxisedBoundingBox(Q,ee)}},c=this.dv(a.createProcessingFromAsyncFunc(async u=>{await u.promise(l()),this._starting=!1,r()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,r(),c.restart()})),this.d(this.stopEvent.don(()=>{c.cancel(),this._starting=!1,this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1,r()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};v(Xo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let No=Xo;(t=>{t.createDefaultProps=()=>({positions:a.reactArrayWithUndefined(void 0),show:void 0,totalArea:void 0,interpolationDistance:void 0,interpolation:void 0,offsetHeight:void 0,drillDepth:void 0,outlineWidth:void 0,outlineColor:a.reactArray([1,1,1,1]),units:a.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(No||(No={})),a.extendClassProps(No.prototype,No.createDefaultProps);async function DR(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const i=t.length/3|0,e=new Array(i*6);for(let n=0;n<i;++n)await aC(),e[n*6+0]=t[n*3+0],e[n*6+1]=t[n*3+1],e[n*6+2]=t[n*3+2],e[n*6+3]=t[n*3+1],e[n*6+4]=t[n*3+2],e[n*6+5]=t[n*3+0];return e}function RR(t){var i=new h.Cartesian3(0,0,0),e=new h.Cartesian3(0,0,0),n=new h.Cartesian3(0,0,0),o=new h.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var s=t.length;for(let u=0;u<s;++u){var r=t[u],l;u==0?l=t[t.length-1]:l=t[u-1];var c;u==t.length-1?c=t[0]:c=t[u+1],i=h.Cartesian3.subtract(r,l,i),e=h.Cartesian3.subtract(r,c,e),n=h.Cartesian3.cross(i,e,n),!n.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6)&&(n=h.Cartesian3.normalize(n,n),o=h.Cartesian3.add(o,n,o))}return n.x=o.x/s,n.y=o.y/s,n.z=o.z/s,n}function FR(t){var i=new h.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var n=t[o];i=h.Cartesian3.add(i,n,i)}return i.x=i.x/e,i.y=i.y/e,i.z=i.z/e,i}function lC(t){return new h.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function zR(t,i){var e=h.Cartesian3.cross(t,i,new h.Cartesian3);e=h.Cartesian3.normalize(e,e);var n=h.Cartesian3.cross(t,e,new h.Cartesian3);n=h.Cartesian3.normalize(n,n);var o=t,s=new h.Matrix4(e.x,e.y,e.z,0,n.x,n.y,n.z,0,o.x,o.y,o.z,0,0,0,0,1);return s}function er(t,i){var e=[];for(let s=0;s<t.length;++s){var n=t[s],o=h.Matrix4.multiplyByPoint(i,n,new h.Cartesian3);e.push(o)}return e}function LR(t){var i=t[0].x,e=t[0].y,n=t[0].x,o=t[0].y;return t.forEach(s=>{i=Math.min(i,s.x),e=Math.min(e,s.y),n=Math.max(n,s.x),o=Math.max(o,s.y)}),{minx:i,miny:e,maxx:n,maxy:o}}function OR(t){var i=[];return t.forEach(e=>{i.push([e.x,e.y])}),i.push(i[0]),i}function NR(t,i){var e=[];t.forEach(r=>{const l=[r.x,r.y];e.push(l)});var n=c_.from(e).triangles;const o=[],s=it([i]);for(let r=0;r<n.length;r+=3){const l=n[r],c=n[r+1],u=n[r+2],d=(t[l].x+t[c].x+t[u].x)/3,p=(t[l].y+t[c].y+t[u].y)/3;Pt([d,p],s)&&o.push(l,c,u)}return new Uint32Array(o.reverse())}function BR(t,i){for(var e=0,n=0;n<i.length;n+=3){const o=[t[i[n]],t[i[n+1]],t[i[n+2]]];e+=VR(o)}return e}function VR(t){var i=h.Cartesian3.distance(t[0],t[1]),e=h.Cartesian3.distance(t[1],t[2]),n=h.Cartesian3.distance(t[2],t[0]),o=(i+e+n)/2,s=Math.sqrt(o*(o-i)*(o-e)*(o-n));return s||0}function UR(t,i,e){for(var n=[],o=i.minx;o<i.maxx;o+=e)for(var s=i.miny;s<i.maxy;s+=e)HR([o,s],t)&&n.push(new h.Cartesian3(o,s,0));return n}function WR(t,i){var e=[];for(let r=0;r<t.length;++r){var n=t[r],o;r==t.length-1?o=t[0]:o=t[r+1];var s=GR(n,o,i);e.push(...s)}return e}function GR(t,i,e){var n=[],o=h.Cartesian3.distance(t,i),s=h.Cartesian3.subtract(i,t,new h.Cartesian3);if(s.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6))return[];s=h.Cartesian3.normalize(s,s);for(var r=e;r<o;){var l=new h.Cartesian3(s.x*r,s.y*r,s.z*r),c=h.Cartesian3.add(t,l,new h.Cartesian3);n.push(c),r+=e}return n}function HR(t,i){var e=ht(t);if(!Y2(ht(i[0]),ht(i[i.length-1])))return!1;var n=[];n.push(i);var o=it(n);return Pt(e,o)}async function $f(t,i,e,n,o,s,r,l){var c=[];t.forEach(S=>{var x=S.clone();x.z=l,c.push(x)});var u=er(c,i),d=new h.Cartesian3(-1*n.x,-1*n.y,-1*n.z),p=[],f=[],g=[];for(let S=0;S<u.length;++S){await aC();var m=u[S],y=new h.Ray(m,d),_=void 0;try{_=o.pickFromRay(y)}catch{}if(!_){y=new h.Ray(m,n);try{_=o.pickFromRay(y)}catch{}}if(_){var P=_.position;if(!(!P||!P.x||isNaN(P.x))){var C=er([P],e);C.forEach(x=>{x.z+=s}),P=er(C,i)[0],g.push(P),P=h.Cartographic.fromCartesian(P),p.push([P.longitude,P.latitude,P.height]),f.push(C[0])}}}return{local:f,world:p,world_cartesian:g}}const Nl=class Nl extends qt{constructor(e,n){super(e,n);v(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new No(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmAreaMeasurement;this.ad(a.track([e,"surfaceArea"],[s,"totalArea"])),this.ad(a.track([s,"units"],[e,"units"])),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"positions"],[e,"points"])),this.d(a.track([s,"interpolationDistance"],[e,"interpolation"])),this.d(a.track([s,"offsetHeight"],[e,"offsetHeight"]));{const r=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)s.outlineWidth=e.strokeWidth;else{s.outlineWidth=0;return}s.outlineWidth=e.strokeWidth,s.outlineColor=e.strokeColor};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(l.disposableOn(r))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.positions&&oe(s,o,n,r.positions,e),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.positions&&oe(s,o,n,r.positions,e),!0):!1}};v(Nl,"type",Nl.register("ESCesiumViewer",a.ESSurfaceAreaMeasurement.type,Nl));let qf=Nl;async function $R(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(i){console.log("复制失败")})}const Bl=class Bl extends a.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof Te))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d)),d.style.width="100%",d.style.position="absolute",d.style.height=`${a.ESViewerStatusBar.defaults.height}px`,d.style.left="0",d.style.bottom="0",d.style.color="#fff",d.style.padding="0 20px 0 0",d.style.boxSizing="border-box",d.style.lineHeight=`${a.ESViewerStatusBar.defaults.height}px`,d.style.zIndex="100",d.style.alignContent="center",d.style.justifyContent="space-between";const p=document.createElement("span");d.appendChild(p),this.dispose(()=>d.removeChild(p));const f=document.createElement("span");p.appendChild(f),this.dispose(()=>p.removeChild(f));const g=document.createElement("span");p.appendChild(g),g.addEventListener("dblclick",function(){let y=g.innerHTML;y.startsWith("鼠标位置")&&(y=y.slice(5)),$R(y)}),g.style.cursor="pointer",this.dispose(()=>p.removeChild(g));const m=document.createElement("span");d.appendChild(m),this.dispose(()=>d.removeChild(m));{const y=()=>{d.style.height=(e.height??a.ESViewerStatusBar.defaults.height)+"px",d.style.lineHeight=(e.height??a.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(y)),y()}{const y=()=>{d.style.fontSize=(e.fontSize??a.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(y)),y()}{const y=()=>{e.bgColor?d.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:d.style.background=`rgba(${a.ESViewerStatusBar.defaults.bgColor[0]},${a.ESViewerStatusBar.defaults.bgColor[1]},${a.ESViewerStatusBar.defaults.bgColor[2]},${a.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(y)),y()}{m.innerText=`Cesium 版本 : ${h.VERSION} `;let y;const _=()=>{e.show?(d.style.display="flex",y=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var A;let P="",C="";const S=u.getCameraInfo();if(S){const R=(N,V)=>S.position[N].toFixed(V),O=(N,V)=>S.rotation[N].toFixed(V);P=`帧率:${u.getFPS()}FPS 经度: ${R(0,5)}° 纬度: ${R(1,5)}° 高度: ${R(2,2)}米 偏航角: ${O(0,2)}° 俯仰角: ${O(1,2)}° 翻滚角:${O(2,2)}° `}f.innerText=P;const x=(A=u.extensions)==null?void 0:A.cursorPositionInfo.cursorPosition;if(x){const R=(O,N)=>x[O].toFixed(N);C=`鼠标位置:${R(0,5)}° ${R(1,5)}° ${R(2,2)}m`}else C="暂时无法获取鼠标位置...";g.innerText=C})),y.start()):(d.style.display="none",y.destroy())};this.dispose(e.showChanged.disposableOn(_)),_()}}}}get customDiv(){return this._customDiv}};v(Bl,"type",Bl.register("ESCesiumViewer",a.ESViewerStatusBar.type,Bl));let Xf=Bl;const Vl=class Vl extends a.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),this.dispose(a.track([s,"show"],[e,"show"])),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof Te))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));const p=document.createElement("div");d.appendChild(p),p.style.width="100%",p.className="ESViewerStatusBarScale",p.style.position="absolute",p.style.display="flex",p.style.height=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.left="0",p.style.bottom="0",p.style.color="#fff",p.style.padding="0 20px 0 0",p.style.boxSizing="border-box",p.style.lineHeight=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.zIndex="100",p.style.alignContent="center",p.style.justifyContent="space-between";const f=document.createElement("div");p.appendChild(f);const g=document.createElement("div");f.appendChild(g);const m=document.createElement("div");f.appendChild(m);const y=document.createElement("div");p.appendChild(y);const _=document.createElement("div");y.appendChild(_);const P=document.createElement("div");_.appendChild(P);const C=document.createElement("div");_.appendChild(C);const S=document.createElement("span");y.appendChild(S);{const N=()=>{p.style.height=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px",p.style.lineHeight=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(N)),N()}{const N=()=>{p.style.fontSize=(e.fontSize??a.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(N)),N()}{const N=()=>{e.bgColor?p.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:p.style.background=`rgba(${a.ESViewerStatusBarScale.defaults.bgColor[0]},${a.ESViewerStatusBarScale.defaults.bgColor[1]},${a.ESViewerStatusBarScale.defaults.bgColor[2]},${a.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(N)),N()}f.style.display="flex",g.style.fontWeight="bold",g.style.padding="0 0 0 25px";let x="EarthSDK";g.innerText=x,m.style.fontWeight="";let A="——免费开源地球可视化开发包";m.innerText=A,y.style.width="550px",_.style.position="fixed",_.style.width="125px",_.style.height="30px",_.style.padding="0 5px",_.style.display="flex",_.style.justifyContent="flex-end",_.style.pointerEvents="auto",_.style.zIndex="101",P.style.width="125px",P.style.display="inline-block",P.style.textAlign="center",P.style.fontSize="14px",P.style.fontWeight="lighter",P.style.lineHeight="30px",P.style.color="#fff",P.innerHTML="1000km",C.style.borderRight="1px solid #fff",C.style.borderLeft="1px solid #fff",C.style.borderBottom="1px solid #fff",C.style.position="absolute",C.style.height="10px",C.style.top="15px",C.style.width="75px",C.style.right=`${60/2}px`,S.style.display="flex",S.style.zIndex="101",S.style.justifyContent="flex-end",S.style.right="0";const R=()=>{const N=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||N&&N>1e6)_.style.display="none";else{_.style.display="block";const V=n.viewerLegend.legend.computedLengthInStr;V&&(P.innerHTML=V);const U=n.viewerLegend.legend.computedLengthInPixels;if(U){C.style.width=`${U}px`;const z=(135-U)/2;C.style.left=`${z}px`}}};R();const O=setInterval(()=>{R()},200);this.dispose(()=>clearInterval(O));{let N;const V=()=>{e.show?(d.style.display="block",N=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var w;let U="";const z=u.getCameraInfo();if(z){const E=(D,L)=>z.position[D].toFixed(L);U+=`帧率:${u.getFPS()}FPS 相机: ${E(2,2)}米 `}const B=(w=u.extensions)==null?void 0:w.cursorPositionInfo.cursorPosition;if(B){const E=(D,L)=>B[D].toFixed(L);U+=`位置:${E(0,5)}° ${E(1,5)}° ${E(2,2)}米`}else U+="暂时无法获取鼠标位置...";S.innerText=U})),N.start()):(d.style.display="none",N.destroy())};this.dispose(e.showChanged.disposableOn(V)),V()}}}}get customDiv(){return this._customDiv}};v(Vl,"type",Vl.register("ESCesiumViewer",a.ESViewerStatusBarScale.type,Vl));let Yf=Vl;const cC=h.Math.toDegrees,qR=new h.Cartographic;function hC(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r),c=e.globe.pick(r,e);var u;if(l&&l.position&&c){const m=h.Cartesian3.distance(n,l.position),y=h.Cartesian3.distance(n,c);u=m<y?l.position:c}else l&&l.position?u=l.position:c&&(u=c);if(!u)return;const d=h.Cartesian3.distance(n,o),f=h.Cartesian3.distance(n,u)>d?o:u,g=h.Cartographic.fromCartesian(f,void 0,qR);return[cC(g.longitude),cC(g.latitude),g.height]}const Ul=class Ul extends vt{constructor(e,n){super(e,n);v(this,"_hideGeoPolylines",this.disposeVar(new $t(this.czmViewer,this.sceneObject.id)));v(this,"_visibleGeoPolylines",this.disposeVar(new $t(this.czmViewer,this.sceneObject.id)));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this._hideGeoPolylines,r=this._visibleGeoPolylines;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([r,"show"],[e,"show"])),this.d(a.track([r,"color"],[e,"visibleColor"])),this.d(a.track([s,"color"],[e,"invisibleColor"]));{const l=()=>{const u=e.points,d=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){s.positions=void 0,r.positions=void 0;return}const p=[],f=[],[g,m,y]=u[0],_=[g,m,y+d];try{u.forEach((P,C)=>{if(C===0)return;const S=hC(_,P,o.scene);S?(p.push([P,S]),f.push([_,S])):f.push([_,P])}),s.positions=p,r.positions=f}catch(P){console.warn(P)}};l();const c=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(c.don(l))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),oe(s,o,n,r,e),!0}}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),oe(s,o,n,r,e),!0}}};v(Ul,"type",Ul.register("ESCesiumViewer",a.ESVisibilityAnalysis.type,Ul));let Zf=Ul;class da extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.dv(new a.Event));v(this,"_enableEvent",this.dv(new a.Event));v(this,"_clearEvent",this.dv(new a.Event));v(this,"_gridPoints",this.dv(a.reactJson([])));v(this,"excavationPolylines");v(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.dv(new $t(e,n)),r=this.dv(new $t(e,n));this.excavationPolylines=s,this.fillPolylines=r;const l=s;l.color=[1,1,0,1],this.d(a.track([l,"show"],[this,"show"])),l.show=!1,l.depthTest=!0;const c=r;c.color=[0,0,1,1],this.d(a.track([c,"show"],[this,"show"])),c.show=!1;{const g=this.ad(new Mi(e,n));this.d(a.track([g,"show"],[this,"show"])),this.d(a.bind([g,"allowPicking"],[this,"allowPicking"])),this.d(a.bind([g,"positions"],[this,"positions"])),this.d(a.bind([g,"depthTest"],[this,"depthTest"])),this.d(a.bind([g,"outlineWidth"],[this,"outlineWidth"])),this.d(a.bind([g,"outlineColor"],[this,"outlineColor"])),this.d(a.bind([g,"outline"],[this,"outline"])),this.d(a.bind([g,"color"],[this,"fillColor"])),this.d(a.bind([g,"fill"],[this,"filled"])),this.d(a.bind([g,"strokeGround"],[this,"strokeGround"])),this.d(a.bind([g,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(_=>{g.flyTo(_)}));const m=()=>{g.positions=this.positions};m();const y=this.dv(a.createNextAnimateFrameEvent(this.positionsChanged));this.d(y.don(m))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:g,maxPos:m}=a.getMinMaxCorner(this.positions),y=g[0],_=g[1],P=m[0],C=m[1],x={type:"Polygon",coordinates:[[...this.positions.map(B=>[B[0],B[1]])]]},A=[y,_,P,C],R=this.gridWidth,V=x0(A,R,{units:"meters",mask:x}).features.map(B=>B.geometry.coordinates),U=h.Math.toRadians;return V.map(B=>new h.Cartographic(U(B[0]),U(B[1])))},d=()=>{l.positions=[],c.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,l.depthTest=!0},p=this.dv(a.createProcessingFromAsyncFunc(async g=>{const m=u();let y=0,_=300;const P=Math.ceil(m.length/_),C=[];do{let S=[];y===P-1?S=m.slice(y*_):S=m.slice(y*_,(y+1)*_);const x=o.scene.sampleHeightMostDetailed(S),A=await g.promise(x);if(y===P-1?this.progress=Math.round(this.progress+100/P):this.progress+=100/P,A&&A.length){const R=h.Math.toDegrees,O=A.filter(N=>N!=null).map(N=>[R(N.longitude),R(N.latitude),N.height]);C.push(...O)}y++}while(y<P);!C||!C.length||(this.gridPoints=C)}));let f=null;{const g=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let m=0;const y=[];let _=0;const P=[];this.gridPoints.forEach(C=>{const S=this.positions;C[2]>S[0][2]?(m+=this.gridWidth*this.gridWidth*(C[2]-S[0][2]),y.push([C,[C[0],C[1],S[0][2]]])):(_+=this.gridWidth*this.gridWidth*(S[0][2]-C[2]),P.push([C,[C[0],C[1],S[0][2]]]))}),l.positions=y,c.positions=P,l.show=!0,c.show=!0,this.area=yy(this.positions),this.cutVolume=m,this.fillVolume=_,this.cutAndFillVolume=_-m,f&&clearTimeout(f),f=setTimeout(()=>{l.depthTest=!1},200)};g(),this.d(this.gridPointsChanged.don(g)),this.d(()=>clearTimeout(f))}{const g=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};g(),this.d(this.positionsChanged.don(g))}{const g=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const m=JSON.parse(JSON.stringify(this.positions.slice(1)));m.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=m};g(),this.d(this.planeHeightChanged.don(g))}this.d(this.enableEvent.don(()=>{d(),this.gridPoints=[],this.progress=0,p.restart()})),this.d(this.clearEvent.don(()=>{d()}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get enableEvent(){return this._enableEvent}enableEmit(){this._enableEvent.emit()}get clearEvent(){return this._clearEvent}clearEmit(){this._clearEvent.emit()}get gridPoints(){return this._gridPoints.value}set gridPoints(e){this._gridPoints.value=e}get gridPointsChanged(){return this._gridPoints.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),planeHeight:a.react(void 0),gridWidth:1,area:0,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,outlineWidth:2,outlineColor:[1,1,1,1],outline:!0,filled:!1,fillColor:[1,1,1,1],fillGround:!1,strokeGround:!1})})(da||(da={})),a.extendClassProps(da.prototype,da.createDefaultProps);const Wl=class Wl extends qt{constructor(e,n){super(e,n);v(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new da(this.czmViewer,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoVolumeMeasurement;this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"positions"],[e,"points"])),this.d(a.track([s,"allowPicking"],[e,"allowPicking"])),this.d(a.bind([s,"planeHeight"],[e,"planeHeight"])),this.d(a.track([s,"gridWidth"],[e,"gridWidth"])),this.d(a.track([e,"cutVolume"],[s,"cutVolume"])),this.d(a.track([e,"fillVolume"],[s,"fillVolume"])),this.d(a.track([e,"cutAndFillVolume"],[s,"cutAndFillVolume"])),this.d(a.bind([e,"progress"],[s,"progress"])),this.d(a.track([s,"depthTest"],[e,"depthTest"])),this.d(a.track([s,"outline"],[e,"stroked"])),this.d(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.d(a.track([s,"outlineColor"],[e,"strokeColor"])),this.d(a.track([s,"filled"],[e,"filled"])),this.d(a.track([s,"fillColor"],[e,"fillColor"])),this.d(a.track([s,"fillGround"],[e,"fillGround"])),this.d(a.track([s,"strokeGround"],[e,"strokeGround"])),this.ad(a.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{s.enableEmit()})),this.d(e.clearEvent.don(()=>{s.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoVolumeMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Wl,"type",Wl.register("ESCesiumViewer",a.ESVolumeMeasurement.type,Wl));let Qf=Wl;const Gl=class Gl extends qt{constructor(e,n){super(e,n);v(this,"czmEntity");v(this,"czmPolyline",this.ad(new a.ESGeoLineString));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.czmPolyline;n.add(s),this.ad(()=>n.delete(s)),this.ad(a.bind([s,"show"],[e,"show"])),this.ad(a.bind([s,"allowPicking"],[e,"allowPicking"])),this.ad(a.bind([s,"stroked"],[e,"stroked"])),this.ad(a.bind([s,"strokeColor"],[e,"strokeColor"])),this.ad(a.bind([s,"strokeWidth"],[e,"strokeWidth"])),this.ad(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)s.points=e.points;else{const p=structuredClone(e.points);p.push(p[0]),e.perPositionHeight?s.points=p:s.points=p.map(f=>(f[2]=e.height??a.ESGeoExtrudedPolygon.defaults.height,f))}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(d.don(u))}const r=this.czmEntity=o.entities.add({polygon:{}});h.Entity.prototype&&(r.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(r));let l=new h.PolygonHierarchy;r.polygon&&(r.polygon.hierarchy=new h.CallbackProperty(()=>l,!1));const c=()=>{const u=ut(e.points??[]);if(u.length<2){l=new h.PolygonHierarchy;return}l=new h.PolygonHierarchy(u)};c(),this.dispose(e.pointsChanged.disposableOn(c));{const u=()=>{r.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!r.show&&e.filled)};u();const d=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(d.don(u))}{const u=()=>{r.polygon&&(r.polygon.perPositionHeight=new h.ConstantProperty(e.perPositionHeight),c())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{r.polygon&&(r.polygon.height=new h.ConstantProperty(e.height??a.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{r.polygon&&(r.polygon.extrudedHeight=new h.ConstantProperty(e.extrudedHeight??a.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const d=h.Color.fromCartesian4(h.Cartesian4.fromArray(e.fillColor));r.polygon&&(r.polygon.material=d)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new a.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new Te.ObjectsToExcludeWrapper(n,r)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:n,maxPos:o}=a.getMinMaxCorner(e.points);return[n[2],o[2]]}return[0,0]}};v(Gl,"type",Gl.register("ESCesiumViewer",a.ESGeoExtrudedPolygon.type,Gl));let kf=Gl;const Hl=class Hl extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:s}=i;this.dispose(a.bind([o,"position"],[i,"position"])),this.dispose(a.bind([o,"rotation"],[i,"rotation"])),this.ad(a.bind([o,"scale"],[i,"scale"])),this.ad(a.track([s,"scale"],[i,"scale"])),this.dispose(a.track([s,"rotation"],[i,"rotation"]));const r=()=>{const c=i.position;s.position=[c[0],c[1],c[2]+i.poiOffsetHeight]};r();const l=this.dv(a.createNextAnimateFrameEvent(i.positionChanged,i.poiOffsetHeightChanged));this.d(l.don(r)),this.ad(s.pickedEvent.don(c=>{c.assign({sceneObject:i}),i.pickedEvent.emit(c)}))}};v(Hl,"type",Hl.register("ESCesiumViewer",a.ESHumanPoi.type,Hl));let Kf=Hl;const $l=class $l extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const s=o.d(o.tilesetReady.donce(c=>{c.allTilesLoaded.addEventListener(()=>{var d,p,f,g;const u=(g=(f=(p=(d=c==null?void 0:c._root)==null?void 0:d._content)==null?void 0:p._model)==null?void 0:f._featureTables[0])==null?void 0:g._features[0];u?o.strokeFeature([u],h.Color.LIME.toBytes().map(m=>m/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",c),s()})})),r=o.url,l=Date.now();r.includes("?reload=")?o.url=r.replace(/\?reload=\d+/,`?reload=${l}`):o.url=r+`?reload=${l}`})),this.d(i.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(i.es3DTileset.tilesetReady.don(o=>{const s=()=>{const l=i.layerConfig;if(!l){o.style=void 0;return}const c=i.colorBlendMode,u=(f,g)=>{try{if(f.getPropertyIds().includes("materialName"))return h.Color.clone(h.Color.WHITE,g);const m=f.getProperty("layer"),y=f.getProperty("dataset"),_=m.toString(),P=y.toString(),C=l.find(x=>x.dataset.toString()===P&&x.layer.toString()===_);if(C&&C.value.color){const x=C.value.color;return h.Color.fromCssColorString(x,g)}const S=l.filter(x=>x.dataset.toString()===P);if(S.length==1&&S[0].value.color){const x=S[0].value.color;return h.Color.fromCssColorString(x,g)}else return h.Color.clone(h.Color.WHITE,g)}catch(m){return console.warn(m),h.Color.clone(h.Color.WHITE,g)}},d=f=>{try{if(f.getPropertyIds().includes("id")){const S=Object.entries(i.visJson);for(let x=0;x<S.length;x++){const A=S[x];if(f.getProperty("id").toString()===A[0])return A[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const g=f.getProperty("layer"),m=f.getProperty("dataset"),y=g.toString(),_=m.toString(),P=l.find(S=>S.dataset.toString()===_&&S.layer.toString()===y);if(P&&P.value.visible===!1)return!1;if(P&&P.value.visible===!0)return!0;const C=l.filter(S=>S.dataset.toString()===_);return!(C.length==1&&C[0].value.visible===!1)}catch(g){return console.warn(g),!0}};let p;c!=="HIGHLIGHT"?p=new h.Cesium3DTileStyle({color:{evaluateColor:function(f,g){return u(f,g)}},show:{evaluate:function(f){return d(f)}}}):p=new h.Cesium3DTileStyle({show:{evaluate:function(f){return d(f)}}}),console.log("style",p),o.style=p};s();const r=this.dv(a.createNextAnimateFrameEvent(i.layerConfigChanged,i.colorBlendModeChanged,i.visJsonChanged));this.d(r.don(()=>{s()}))}))}};v($l,"type",$l.register("ESCesiumViewer",a.ESRtsTileset.type,$l));let Jf=$l;const ql=class ql extends Ds{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(ql,"type",ql.register("ESCesiumViewer",a.ESRtsFeatureEditing.type,ql));let jf=ql;const Xl=class Xl extends Ds{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(Xl,"type",Xl.register("ESCesiumViewer",a.ESMsTileset.type,Xl));let eg=Xl;const Yl=class Yl extends fe{constructor(e,n){super(e,n);v(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new ti(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPoint;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPoint:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(Yl,"type",Yl.register("ESCesiumViewer",a.ESStaticMesh.type,Yl));let tg=Yl;const Zl=class Zl extends vt{constructor(i,e){super(i,e);const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=this.ad(new vm(n));this.ad(i.startEvent.don(async()=>{const s=await o.getDepthsFromScreen(),r=Number.isFinite(i.radius)?i.radius:a.ESSkylineAnalysis.defaults.radius,{depths:l,windowPositions:c,positions:u}=o.getSkylineDepthsAndPositions(s,n.scene.canvas.width,n.scene.canvas.height,r),d=re(n.camera.position);u.push(d),i.depths=l,i.windowPositions=c,i.points=u}))}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):n.points?(oe(o,n,e,n.points,i),!0):!1:!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):n.points?(oe(o,n,e,n.points,i),!0):!1:!1}};v(Zl,"type",Zl.register("ESCesiumViewer",a.ESSkylineAnalysis.type,Zl));let ig=Zl;class XR extends a.Destroyable{constructor(e,n){super();v(this,"_rectangle");v(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));const o=e.sceneObject;this._rectangle=this.ad(new Si(n,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(a.bind([this.rectangle,"show"],[o,"show"])),this.ad(a.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(s=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:s}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class YR extends a.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));v(this,"czmViewer");v(this,"czmESHeatMap");const o=this.czmViewer=n,s=this.czmESHeatMap=e,r=s.sceneObject,l=o.viewer;if(!l)return;let c,u;const d=this.ad(new a.Event),p=()=>{f(),!(!c||!u)&&(this._primitive=l.scene.primitives.add(new h.Primitive({geometryInstances:c,appearance:u,asynchronous:!1,allowPicking:r.allowPicking})))},f=()=>{this.primitive&&l.scene.primitives.remove(this.primitive)};this.ad(f);{const g=()=>{this.primitive&&(this.primitive.show=r.show)};g(),this.ad(r.showChanged.don(g))}{const g=this.ad(a.createNextAnimateFrameEvent(r.allowPickingChanged,d));this.ad(g.don(p))}{const g=()=>{s.rectangle&&(c=new h.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(s.div.style.width),Number.parseFloat(s.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=c,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(m=>{if(!s.rectangle)return;const y=s.rectangle[1]+(s.rectangle[3]-s.rectangle[1])*.5,_=a.getDistancesFromPositions([[s.rectangle[0],y,0],[s.rectangle[2],y,0]],"GEODESIC")[0]/5;u=new h.MaterialAppearance({material:new h.Material({fabric:{type:"Image",uniforms:{image:m}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(_),flat:!0}),this.primitive&&s.rectangle&&(this.primitive.appearance.material.uniforms.image=m,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(_)),g(),this.primitive||d.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
1891
1891
  in vec3 position3DHigh;
1892
1892
  in vec3 position3DLow;
1893
1893
  in vec3 normal;
@@ -1910,7 +1910,7 @@ void main()
1910
1910
  p += vec4(color.a * upDir * ${e??1e3}, 0.0);
1911
1911
 
1912
1912
  gl_Position = czm_modelViewProjectionRelativeToEye * p;
1913
- }`}createHeatmapGeometry(e,n){const o=this.czmESHeatMap,s=e||256,r=Math.ceil(n||256),[l,c,u,d]=o.rectangle,p=(u-l)/(s-1),f=(d-c)/(r-1),g=[],m=[],y=[],_=[];for(let P=0;P<s;P++){const C=l+p*P;for(let S=0;S<r;S++){const x=c+f*S;o.heatmap.getValueAt({x:P,y:S});const A=h.Cartesian3.fromDegrees(C,x,o.heatmap._renderer._min);g.push(A.x,A.y,A.z),m.push(P/(s-1),S/(r-1)),S!==r-1&&P!==s-1&&(y.push((P+1)*r+S+1,P*r+S+1,P*r+S),y.push(P*r+S,(P+1)*r+S,(P+1)*r+S+1))}}return this.createGeometry(g,m,y,_)}createGeometry(e,n,o,s){return new h.Geometry({attributes:new h.GeometryAttributes({position:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(n)})}),indices:new Uint32Array(o),boundingSphere:h.BoundingSphere.fromVertices(e,new h.Cartesian3,3),primitiveType:h.PrimitiveType.TRIANGLES})}}const Bt={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}};class Z2{constructor(i){v(this,"_coordinator");v(this,"_data");v(this,"_radi");v(this,"_min");v(this,"_max");v(this,"_xField");v(this,"_yField");v(this,"_valueField");v(this,"_cfgRadius");this._coordinator=new uC,this._data={},this._radi={},this._min=0,this._max=1,this._xField=i.xField||i.defaultXField||Bt.defaultXField,this._yField=i.yField||i.defaultYField||Bt.defaultYField,this._valueField=i.valueField||i.defaultValueField||Bt.defaultValueField,i.radius&&(this._cfgRadius=i.radius)}_organiseData(i,e){const n=i[this._xField],o=i[this._yField],s=i[this._valueField]||1,r=i.radius||this._cfgRadius||Bt.defaultRadius;return this._data[n]||(this._data[n]={},this._radi[n]={}),this._data[n][o]?this._data[n][o]+=s:(this._data[n][o]=s,this._radi[n][o]=r),this._data[n][o]>this._max?(e?this.setDataMax(this._data[n][o]):this._max=this._data[n][o],!1):{x:n,y:o,value:s,radius:r,min:this._min,max:this._max}}_unOrganizeData(){const i=[];for(const e in this._data)for(const n in this._data[e])i.push({x:Number(e),y:Number(n),radius:this._radi[e][n],value:this._data[e][n]});return{min:this._min,max:this._max,data:i}}_onExtremaChange(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})}_getInternalData(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}}addData(i){if(Array.isArray(i))i.forEach(e=>this.addData(e));else{const e=this._organiseData(i,!0);e&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[e]})}return this}setData(i){this._data={},this._radi={};for(const e of i.data)this._organiseData(e,!1);return this._max=i.max,this._min=i.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMax(i){return this._max=i,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMin(i){return this._min=i,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setCoordinator(i){this._coordinator=i}getData(){return this._unOrganizeData()}}class Q2{constructor(i){v(this,"shadowCanvas");v(this,"canvas");v(this,"_renderBoundaries");v(this,"_width");v(this,"_height");v(this,"shadowCtx");v(this,"ctx");v(this,"_palette");v(this,"_templates");v(this,"_blur",Bt.defaultBlur);v(this,"_opacity",0);v(this,"_maxOpacity",Bt.defaultMaxOpacity*255);v(this,"_minOpacity",Bt.defaultMinOpacity*255);v(this,"_useGradientOpacity",!1);v(this,"_min",0);v(this,"_max",1);const e=i.container;this.shadowCanvas=document.createElement("canvas"),this.canvas=i.canvas||document.createElement("canvas"),this._renderBoundaries=[1e4,1e4,0,0];const n=getComputedStyle(e);this.canvas.className="heatmap-canvas",this._width=this.canvas.width=this.shadowCanvas.width=+n.width.replace(/px/,""),this._height=this.canvas.height=this.shadowCanvas.height=+n.height.replace(/px/,""),this.shadowCtx=this.shadowCanvas.getContext("2d"),this.ctx=this.canvas.getContext("2d"),this.canvas.style.cssText=this.shadowCanvas.style.cssText="position:absolute;left:0;top:0;",e.style.position="relative",e.appendChild(this.canvas),this._palette=this._getColorPalette(i),this._templates={},this._setStyles(i)}_getColorPalette(i){const e=i.gradient||i.defaultGradient||Bt.defaultGradient,n=document.createElement("canvas"),o=n.getContext("2d");n.width=256,n.height=1;const s=o.createLinearGradient(0,0,256,1);for(const r in e)s.addColorStop(Number(r),e[r]);return o.fillStyle=s,o.fillRect(0,0,256,1),o.getImageData(0,0,256,1).data}_getPointTemplate(i,e){const n=document.createElement("canvas"),o=n.getContext("2d"),s=i,r=i;if(n.width=n.height=i*2,e===1)o.beginPath(),o.arc(s,r,i,0,2*Math.PI,!1),o.fillStyle="rgba(0,0,0,1)",o.fill();else{const l=o.createRadialGradient(s,r,i*e,s,r,i);l.addColorStop(0,"rgba(0,0,0,1)"),l.addColorStop(1,"rgba(0,0,0,0)"),o.fillStyle=l,o.fillRect(0,0,2*i,2*i)}return n}renderPartial(i){this._drawAlpha(i),this._colorize()}renderAll(i){this._clear(),this._drawAlpha(this._prepareData(i)),this._colorize()}_prepareData(i){const e=[],n=Object.keys(i.data);for(const o of n){const s=Object.keys(i.data[o]);for(const r of s)e.push({x:Number(o),y:Number(r),value:i.data[o][r],radius:i.radi[o][r]})}return{min:i.min,max:i.max,data:e}}updateConfig(i){i.gradient&&(this._palette=this._getColorPalette(i)),this._setStyles(i)}setDimensions(i,e){this._width=i,this._height=e,this.canvas.width=this.shadowCanvas.width=i,this.canvas.height=this.shadowCanvas.height=e}_clear(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)}_setStyles(i){this._blur=i.blur===0?0:i.blur||i.defaultBlur||Bt.defaultBlur,i.backgroundColor&&(this.canvas.style.backgroundColor=i.backgroundColor),this._opacity=(i.opacity||0)*255,this._maxOpacity=(i.maxOpacity||i.defaultMaxOpacity||Bt.defaultMaxOpacity)*255,this._minOpacity=(i.minOpacity||i.defaultMinOpacity||Bt.defaultMinOpacity)*255,this._useGradientOpacity=!!i.useGradientOpacity}_drawAlpha(i){this._min=i.min,this._max=i.max;const e=1-this._blur;for(const n of i.data){const o=n.radius,s=n.x-o,r=n.y-o,l=Math.min(n.value,this._max);this._templates[o]=this._getPointTemplate(o,e),this.shadowCtx.globalAlpha=(l-this._min)/(this._max-this._min),this.shadowCtx.drawImage(this._templates[o],s,r),this._renderBoundaries[0]=Math.min(this._renderBoundaries[0],s),this._renderBoundaries[1]=Math.min(this._renderBoundaries[1],r),this._renderBoundaries[2]=Math.max(this._renderBoundaries[2],s+2*o),this._renderBoundaries[3]=Math.max(this._renderBoundaries[3],r+2*o)}}_colorize(){let[i,e,n,o]=this._renderBoundaries;i=Math.max(0,i),e=Math.max(0,e),n=Math.min(this._width-i,n-i),o=Math.min(this._height-e,o-e);const s=this.shadowCtx.getImageData(i,e,n,o),r=s.data;for(let l=3;l<r.length;l+=4){const c=r[l],u=c*4;if(!u)continue;let d;this._opacity>0?d=this._opacity:d=c<this._maxOpacity?c<this._minOpacity?this._minOpacity:c:this._maxOpacity,r[l-3]=this._palette[u],r[l-2]=this._palette[u+1],r[l-1]=this._palette[u+2],r[l]=this._useGradientOpacity?this._palette[u+3]:d}this.ctx.putImageData(s,i,e),this._renderBoundaries=[1e3,1e3,0,0]}getValueAt(i){const n=this.shadowCtx.getImageData(i.x,i.y,1,1).data[3];return Math.abs(this._max-this._min)*(n/255)>>0}getDataURL(){return this.canvas.toDataURL()}}class uC{constructor(){v(this,"cStore");this.cStore={}}on(i,e,n){this.cStore[i]||(this.cStore[i]=[]),this.cStore[i].push(o=>e.call(n,o))}emit(i,e){this.cStore[i]&&this.cStore[i].forEach(n=>n(e))}}class k2{constructor(i={}){v(this,"_config");v(this,"_coordinator");v(this,"_renderer");v(this,"_store");if(this._config={...Bt,...i},this._coordinator=new uC,this._config.plugin){const e=Bt.plugins[this._config.plugin];if(!e)throw new Error(`Plugin '${this._config.plugin}' not found. Maybe it was not registered.`);this._renderer=new e.renderer(this._config),this._store=new e.store(this._config)}else this._renderer=new Q2(this._config),this._store=new Z2(this._config);this._connect()}_connect(){this._coordinator.on("renderpartial",i=>this._renderer.renderPartial(i),this._renderer),this._coordinator.on("renderall",i=>this._renderer.renderAll(i),this._renderer),this._coordinator.on("extremachange",i=>{var e,n;(n=(e=this._config).onExtremaChange)==null||n.call(e,{min:i.min,max:i.max,gradient:this._config.gradient||this._config.defaultGradient||Bt.defaultGradient})}),this._store.setCoordinator(this._coordinator)}addData(i){return this._store.addData(i),this}setData(i){return this._store.setData(i),this}setDataMax(i){return this._store.setDataMax(i),this}setDataMin(i){return this._store.setDataMin(i),this}configure(i){return this._config={...this._config,...i},this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this}repaint(){return this._coordinator.emit("renderall",this._store._getInternalData()),this}getData(){return this._store.getData()}getDataURL(){return this._renderer.getDataURL()}getValueAt(i){return this._store.getValueAt?this._store.getValueAt(i):this._renderer.getValueAt?this._renderer.getValueAt(i):null}}const K2=t=>new k2(t),Ql=class Ql extends Jt{constructor(e,n){super(e,n);v(this,"_heatmap");v(this,"_div");v(this,"_primitiveObj");v(this,"_rectangle",this.disposeVar(a.react(void 0)));v(this,"onePixelRadius",1e-4);const o=n.viewer,s=256;if(this._primitiveObj=this.ad(new a.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new Y2(this,n):new X2(this,n))),!o){console.warn("viewer is undefined!");return}this._div=document.createElement("div"),this.div.style.display="none",this.div.style.width=`${s}px`,this.div.style.height=`${s}px`,document.body.appendChild(this.div),this.ad(()=>{document.body.removeChild(this.div)}),this._heatmap=K2({container:this.div}),this.heatmap._renderer.setDimensions(s,s);const r=this.ad(new a.Event);let l=[],c={max:100,min:0};{const u=()=>{const p={radius:e.radius??a.ESHeatMap.defaults.radius,gradient:e.gradient??a.ESHeatMap.defaults.gradient,blur:e.blur??a.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(p),this.heatmap._store._cfgRadius=p.radius,r.emit()};u();const d=this.ad(a.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(d.don(u))}{const u=()=>{if(e.data&&e.data.length>2){const{maxPos:p,minPos:f}=a.getMinMaxCorner(e.data),g=p[0]-f[0],m=p[1]-f[1];if(c={max:p[2]??100,min:f[2]??0},!Number.isFinite(g)||!Number.isFinite(m)||g<=0||m<=0)return;const y=1/Math.cos((f[1]+m*.5)*Math.PI/180);if(y==1/0)return;const _=s*m/g*y;this.div.style.width=`${s}px`,this.div.style.height=`${_}px`,this.heatmap._renderer.setDimensions(s,_);const P=g/s*(e.radius??a.ESHeatMap.defaults.radius)*2,C=m/_*(e.radius??a.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(P,C),this.rectangle=[f[0]-P,f[1]-C,p[0]+P,p[1]+C],l=J2(e.data,this.rectangle,s,_),r.emit()}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(d.don(u))}{const u=()=>{const d={max:c.max,min:c.min,data:l};this.heatmap.setData(d),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};u(),this.ad(r.don(u))}this.ad(this._primitiveObj.objChanged.don(()=>{r.emit()}))}get heatmap(){return this._heatmap}get div(){return this._div}get primitiveObj(){var e;return(e=this._primitiveObj)==null?void 0:e.obj}get rectangle(){return this._rectangle.value}set rectangle(e){this._rectangle.value=e}get rectangleChanged(){return this._rectangle.changed}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):this.rectangle?(oe(s,o,n,[[this.rectangle[0],this.rectangle[1],0],[this.rectangle[2],this.rectangle[3],0]],e),!0):!1:!1}};v(Ql,"type",Ql.register("ESCesiumViewer",a.ESHeatMap.type,Ql));let ng=Ql;function J2(t,i,e,n,o){return t.map(s=>({x:(s[0]-i[0])*e/(i[2]-i[0])|0,y:(1-(s[1]-i[1])/(i[3]-i[1]))*n|0,value:s[2]}))}const kl=class kl extends vt{constructor(e,n){super(e,n);v(this,"czmPoints");if(!n.viewer){console.error("viewer is null");return}this.czmPoints=this.ad(new mo(n,e.id)),this._updateShow();const s=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.pointedChanged));this.ad(s.don(()=>this._updateShow())),this._updatePoints();const r=this.ad(a.createNextAnimateFrameEvent(e.pointsChanged,e.pointStyleChanged));this.ad(r.don(()=>this._updatePoints()))}_updateShow(){this.czmPoints&&(this.czmPoints.show=this.sceneObject.show&&this.sceneObject.pointed)}_updatePoints(){var e;this.czmPoints&&(this.czmPoints.pointPrimitiveOptions=(e=this.sceneObject.points)==null?void 0:e.map(n=>{var o,s,r,l;return{position:n,pixelSize:((o=this.sceneObject.pointStyle)==null?void 0:o.size)??a.ESGeoPoints.defaults.pointStyle.size,color:((s=this.sceneObject.pointStyle)==null?void 0:s.color)??a.ESGeoPoints.defaults.pointStyle.color,outlineColor:((r=this.sceneObject.pointStyle)==null?void 0:r.outlineColor)??a.ESGeoPoints.defaults.pointStyle.outlineColor,outlineWidth:((l=this.sceneObject.pointStyle)==null?void 0:l.outlineWidth)??a.ESGeoPoints.defaults.pointStyle.outlineWidth}}))}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyInParam?(super.flyIn(e,n),!0):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}};v(kl,"type",kl.register("ESCesiumViewer",a.ESGeoPoints.type,kl));let og=kl;const Yo=class Yo extends Wt{constructor(e){super();v(this,"_config",this.disposeVar(a.react(Yo.defaultConfig)));v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"_pointerEventFilterFunc",this.disposeVar(a.react(Yo.defaultPointerEventFilterFunc)));v(this,"point");v(this,"czmViewer");this.czmViewer=e,e.viewer&&(this._updateConfig(),this.dispose(this.configChanged.disposableOn(()=>this._updateConfig())),this._createPoint(),this._updatePointPosition(),this.dispose(this.positionChanged.disposableOn(()=>this._updatePointPosition())),this.ad(new a.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new j2(e,this):void 0)))}get config(){return this._config.value}set config(e){this._config.value=e}get configChanged(){return this._config.changed}get overEvent(){return this._overEvent}over(){this._overEvent.emit()}get pointerEventFilterFunc(){return this._pointerEventFilterFunc.value}set pointerEventFilterFunc(e){this._pointerEventFilterFunc.value=e}get pointerEventFilterFuncChanged(){return this._pointerEventFilterFunc.changed}_updateConfig(){const{config:e}=this;e.clickEnabled!==void 0&&(this.clickEnabled=e.clickEnabled),e.dblClickEnabled!==void 0&&(this.dblClickEnabled=e.dblClickEnabled)}_createPoint(){this.point=this.ad(new ti(this.czmViewer)),this.point.pixelSize=4,this.point.outlineColor=[0,0,.8,1],this.point.outlineWidth=2,this.point.allowPicking=!1}_updatePointPosition(){if(!this.position)return;const e=[...this.position];this.czmViewer.editingHeightOffset&&(e[2]-=this.czmViewer.editingHeightOffset),this.point.position=e,this.point.show=!!this.position}};v(Yo,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),v(Yo,"defaultPointerEventFilterFunc",e=>e.button===0),v(Yo,"defaults",{...Wt.defaults,position:[116.39,39.9,0]});let Ni=Yo;(t=>{t.createDefaultProps=()=>({...Wt.createDefaultProps(),position:a.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Ni||(Ni={})),a.extendClassProps(Ni.prototype,Ni.createDefaultProps);class j2 extends a.Destroyable{constructor(e,n){super();v(this,"_doings",[]);v(this,"initDoings",this.ad(()=>{this._doings.forEach(e=>e.destroy()),this._doings.length=0}));this._czmViewer=e,this._placeEditing=n;const o=(s,r)=>{r=="click"&&(!n.clickEnabled||!n.pointerEventFilterFunc(s))||r=="dblclick"&&(!n.dblClickEnabled||!n.pointerEventFilterFunc(s))||(n.over(),n.enabled=!1)};this.ad(e.clickEvent.don(s=>{s.pointerEvent&&o(s.pointerEvent,"click")})),this.ad(e.dblclickEvent.don(s=>{s.pointerEvent&&o(s.pointerEvent,"dblclick")})),this.ad(e.pointerMoveEvent.don(s=>{if(!s.pointerEvent)return;const r=new eF(this,s.pointerEvent,l=>{if(!l||l[2]<-1e5){n.position=void 0;return}const c=[...l];e.editingHeightOffset&&(c[2]+=e.editingHeightOffset),n.position=c,this._doings.splice(0,this._doings.indexOf(r)+1).forEach(d=>d.destroy())});this._doings.push(r)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class eF extends a.Destroyable{constructor(i,e,n){super(),this._owner=i;const{czmViewer:o}=this._owner,s=Yg(o,e,this._owner.placeEditing.virtualHeight),[r]=a.getEventFromPromise(s);this.dispose(r.disposableOn(n))}}class Zt extends Wt{constructor(){super()}}v(Zt,"defaults",{...Wt.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({...Wt.createDefaultProps(),position:a.reactArrayWithUndefined(void 0)})})(Zt||(Zt={})),a.extendClassProps(Zt.prototype,Zt.createDefaultProps);function sg(t,i){const e=new be(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=i,e}const ci=class ci extends a.Destroyable{constructor(i){if(super(),!i.viewer)return;const e=this.disposeVar(sg(i,ci.defaults.xAxisColor)),n=this.disposeVar(sg(i,ci.defaults.yAxisColor)),o=this.disposeVar(sg(i,ci.defaults.zAxisColor));{const s=()=>{e.show=this.xAxisShow&&this.show,n.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};s();const r=this.ad(a.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(r.disposableOn(s))}{const s=()=>{const{position:l=ci.defaults.position,heading:c=ci.defaults.heading}=this,[u,d,p]=l,{dimensions:f=ci.defaults.dimensions}=this;o.positions=[l,[u,d,p+f[2]]];const g=a.geoRhumbDestination(l,f[0],90+c);g&&(e.positions=[l,g]);const m=a.geoRhumbDestination(l,f[1],0+c);m&&(n.positions=[l,m])};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(r.disposableOn(s))}{const s=()=>{e.color=this.xAxisColor??ci.defaults.xAxisColor,n.color=this.yAxisColor??ci.defaults.yAxisColor,o.color=this.zAxisColor??ci.defaults.zAxisColor};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(r.disposableOn(s))}}};v(ci,"defaults",{position:[116.39,39.9,0],heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let Hn=ci;(t=>{t.createDefaultProps=()=>({show:!0,position:a.reactArrayWithUndefined(void 0),heading:0,dimensions:a.reactArray([1e3,1e3,1e3]),xAxisColor:a.reactArray([1,0,0,1]),yAxisColor:a.reactArray([0,1,0,1]),zAxisColor:a.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(Hn||(Hn={})),a.extendClassProps(Hn.prototype,Hn.createDefaultProps);const kn=class kn extends Zt{constructor(e){super();v(this,"_opInfo",{step:this.ad(a.react(!1)),moved:this.ad(a.react(!1)),constraintMode:this.ad(a.react("none")),originPosition:this.disposeVar(a.reactArray(Zt.defaults.position)),originHeading:this.disposeVar(a.react(0)),originDimensions:this.disposeVar(a.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(a.reactArray([0,0,0])),movingPosition:this.disposeVar(a.reactArray([0,0,0])),targetPosition:this.disposeVar(a.reactArray([0,0,0])),targetHeading:this.disposeVar(a.react(0))});v(this,"_createCoordinates",e=>{const n=this.ad(new Hn(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{dC(n,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const r=[...this.position??kn.defaults.position];e.editingHeightOffset&&(r[2]-=e.editingHeightOffset),n.position=r};o(),this.dispose(this.positionChanged.disposableOn(o))}{const o=()=>{n.heading=this.heading??0};o(),this.dispose(this.headingChanged.disposableOn(o))}{const o=()=>{n.dimensions=this._opInfo.originDimensions.value};o(),this.dispose(this._opInfo.originDimensions.changed.disposableOn(o))}return n});v(this,"_createOriginCoordinates",e=>{const n=this.ad(new Hn(e));n.xAxisColor=[1,0,0,.5],n.yAxisColor=[0,1,0,.5],n.zAxisColor=[0,0,1,.5];const{originPosition:o,originHeading:s,originDimensions:r}=this._opInfo;{const l=()=>{n.position=o.value};l(),this.dispose(o.changed.disposableOn(l))}{const l=()=>{n.heading=s.value??0};l(),this.dispose(s.changed.disposableOn(l))}{const l=()=>{n.dimensions=r.value};l(),this.dispose(r.changed.disposableOn(l))}return n});v(this,"_createGrid",e=>{const n=this.ad(new pi(e));{const o=()=>{const r=this._opInfo.originPosition.value,l=this._opInfo.originHeading.value,c=this._opInfo.originDimensions.value[0],u=[];for(let d=-4;d<5;++d){const p=a.geoRhumbDestination(r,c*.2*d,l+90);if(p){const f=a.geoRhumbDestination(p,c,l+180),g=a.geoRhumbDestination(p,c,l);f&&g&&u.push([f,p,g])}}for(let d=-4;d<5;++d){const p=a.geoRhumbDestination(r,c*.2*d,l);if(p){const f=a.geoRhumbDestination(p,c,l-90),g=a.geoRhumbDestination(p,c,l+90);f&&g&&u.push([f,p,g])}}n.positions=u};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originHeading.changed,this._opInfo.originDimensions.changed));this.dispose(s.disposableOn(o))}return n});v(this,"_createHelpLine",e=>{const n=this.ad(new be(e));n.hasDash=!0,n.arcType="RHUMB",n.color=[1,1,0,.99];{const o=()=>{n.positions=[this._opInfo.originPosition.value,this._opInfo.targetPosition.value]},s=this.ad(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.targetPosition.changed));this.ad(s.don(o))}return n});v(this,"_createCircle",e=>{const n=this.ad(new pi(e));n.arcType="RHUMB",n.width=2,n.hasDash=!0;const o=this.disposeVar(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),s=()=>{const r=this._opInfo.originPosition.value,l=this._opInfo.originDimensions.value[0],c=[],u=32;for(let d=0;d<=u;++d){const p=a.geoRhumbDestination(r,l,d*360/u);p&&c.push(p)}n.positions=[c]};return s(),this.dispose(o.disposableOn(s)),n});v(this,"_pickingXYProcessing",e=>this.ad(new a.Processing((n,o,s)=>{const r=[0,0,0],l=new h.Cartographic;return e.pointerMoveEvent.don(c=>{if(!c.pointerEvent||!e.viewer)return;const u=ui(a.getDomEventCurrentTargetPos(c.pointerEvent));if(!jo(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;Jn(l,r),this._opInfo.constraintMode.value==="x"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="y"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,r,r):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=r;const d=[0,0,0];a.geoRhumbDestination(r,s,o,d),this._opInfo.targetPosition.value=d})})));v(this,"_pickingZProcessing",e=>this.ad(new a.Processing(()=>{const n=new h.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!vc(e.viewer.scene,Le(this._opInfo.originPosition.value),r,n))return;const l=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(re(n,o)){this._opInfo.movingPosition.value=o;const c=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[c[0],c[1],o[2]+l]}})})));v(this,"_pickingZAxisProcessing",e=>this.ad(new a.Processing(()=>{const n=[0,0,0],o=new h.Cartographic;return e.pointerMoveEvent.don(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!jo(e.viewer.scene,r,this._opInfo.originPosition.value[2],o))return;Jn(o,n);const l=a.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),u=a.geoRhumbHeading(this._opInfo.originPosition.value,n)-l;let d=this._opInfo.originHeading.value+u;d=h.Math.toDegrees(h.Math.negativePiToPi(h.Math.toRadians(d))),this._opInfo.movingPosition.value=n,this.heading=this._opInfo.targetHeading.value=d})})));if(!e.viewer)return;const n=this.ad(a.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new mu(e,this.positionReact,n,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(s=>{if(this._opInfo.moved){const r=[...s];e.editingHeightOffset&&(r[2]+=e.editingHeightOffset),this.position=r}})),this.ad(this._opInfo.targetHeading.changed.don(s=>this._opInfo.moved&&(this.heading=s)));const o=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((s,r)=>s===this._opInfo.targetPosition.value[r])){this._opInfo.moved.value=!0;return}};o(),this.dispose(this._opInfo.originHeading.changed.disposableOn(o)),this.dispose(this._opInfo.originPosition.changed.disposableOn(o)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(o)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(o))}{const o=this._createCoordinates(e),s=this._createOriginCoordinates(e),r=this._createGrid(e),l=this._createHelpLine(e),c=this._createCircle(e);{const u=()=>{c.show=r.show=this.enabled&&this.showCircle,l.show=this.enabled&&this.showCircle&&this._opInfo.moved.value,o.show=this.enabled&&this.showCoordinates,s.show=this.enabled&&this.showCoordinates&&this._opInfo.moved.value};u();const d=this.ad(a.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(d.don(u))}{const u=()=>{o.xAxisShow=s.xAxisShow=this.xAxisShow,o.yAxisShow=s.yAxisShow=this.yAxisShow,o.zAxisShow=s.zAxisShow=this.zAxisShow};u();const d=this.ad(a.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(d.don(u))}{const u=()=>{r.color=this._opInfo.constraintMode.value!=="none"?[1,1,0,.6]:[1,1,0,.3],c.color=this._opInfo.constraintMode.value==="zAxis"?[1,1,0,.99]:[1,1,0,.5],dC(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u))}{const u=this._pickingXYProcessing(e),d=this._pickingZProcessing(e),p=this._pickingZAxisProcessing(e),f=()=>{const S=[...this.position??kn.defaults.position];e.editingHeightOffset&&(S[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=S},g=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,m=()=>this._opInfo.originDimensions.value=n.value,y={constraintMode:"none",startDragPos:[0,0,0]},_=S=>{const x={position:o.position??kn.defaults.position,heading:o.heading??kn.defaults.heading,dimensions:o.dimensions??kn.defaults.dimensions};e.viewer&&ou(S,e.viewer.scene,x,this.axisSnapPixelSize,y,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=y.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=y.startDragPos},P=this.ad(a.createProcessingFromAsyncFunc(async S=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",S.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await a.step(S,async x=>{x.disposer.dispose((f(),this.positionChanged.don(f))),x.disposer.dispose((g(),this.headingChanged.don(g))),x.disposer.dispose((m(),n.changed.don(m))),x.disposer.dispose(e.pointerMoveEvent.don(A=>{A.pointerEvent&&_(A.pointerEvent)})),await a.step(x,A=>new Promise((R,O)=>{A.disposer.dispose(O),A.disposer.dispose(e.pointerDownEvent.don(N=>{N.pointerEvent&&_(N.pointerEvent),N.pointerEvent&&N.pointerEvent.button===0&&y.constraintMode!=="none"&&R()}))}))}),this._opInfo.step.value=!1,await a.step(S,async x=>{if(e.incrementDisabledInputStack(),x.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const A=a.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),R=a.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);u.restart(void 0,A,R),x.disposer.dispose(()=>u.cancel())}else this._opInfo.constraintMode.value==="z"?(d.restart(),x.disposer.dispose(()=>d.cancel())):this._opInfo.constraintMode.value==="zAxis"?(p.restart(),x.disposer.dispose(()=>p.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await a.step(x,A=>new Promise((R,O)=>{A.disposer.dispose(O),A.disposer.dispose(e.pointerUpEvent.don(()=>{R()})),A.disposer.dispose(e.pointerOutEvent.don(()=>R()))}))}),P.restart()})),C=()=>{this.enabled?P.restart():P.isRunning&&P.cancel()};C(),this.ad(this.enabledChanged.don(C))}}}};v(kn,"defaults",{...Zt.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let on=kn;(t=>{t.createDefaultProps=()=>({...Zt.createDefaultProps(),heading:0,axisPixelSize:100,axisSnapPixelSize:5,showCoordinates:!0,showCircle:!0,disableX:!1,disableY:!1,disableZ:!1,disableXY:!1,disableZAxis:!1,xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(on||(on={})),a.extendClassProps(on.prototype,on.createDefaultProps);function dC(t,i,e){t.xAxisColor=[1,0,0,.99],t.yAxisColor=[0,1,0,.99],t.zAxisColor=[0,0,1,.99],i==="x"?t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="y"?t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="z"?t.zAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="xy"&&(t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99],t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99])}class rg extends a.HasOwner{constructor(e){super(e);v(this,"_valid",!1);v(this,"_normal",new h.Cartesian3(0,0,0));v(this,"_origin",new h.Cartesian3(0,0,0))}get viewer(){return this.owner.czmViewer.viewer}get scene(){return this.viewer.scene}get sceneObject(){return this.owner}get valid(){return this._valid}get normal(){return this._normal}get origin(){return this._valid&&this._origin}pick(e){if(!this.normal||!this.owner.cartesian)return;const n=this.owner.cartesian,o=ui(e);return Zg(this.scene,n,this.normal,o)}}class tF extends rg{constructor(i){super(i);{const e=()=>{const o=Ie({position:this.sceneObject.position,rotation:this.sceneObject.rotation});this._valid=!!o,o&&(this._origin.x=o[4],this._origin.y=o[5],this._origin.z=o[6],this._normal.x=o[8],this._normal.y=o[9],this._normal.z=o[10])};e();const n=this.ad(a.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(n.don(e))}}}class iF extends rg{constructor(i){super(i);const e=()=>{const n=Ie({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!n)throw new Error("PitchPlane: rm is undefined");const o=Ie({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:h.Matrix4.toArray(n)});if(this._valid=!!o,!!o){{const s=this._normal;s.x=-o[0],s.y=-o[1],s.z=-o[2]}{const s=this._origin;s.x=o[4],s.y=o[5],s.z=o[6]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class nF extends rg{constructor(i){super(i);const e=()=>{const n=Ie({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!n)throw new Error("PitchPlane: rm is undefined");const o=Ie({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:h.Matrix4.toArray(n)});if(this._valid=!!o,!!o){{const s=this._normal;s.x=-o[4],s.y=-o[5],s.z=-o[6]}{const s=this._origin;s.x=o[8],s.y=o[9],s.z=o[10]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class tr extends a.Destroyable{constructor(e){super();v(this,"_czmTexture");v(this,"_customPrimitiveForCircle");v(this,"_circleCanvas");v(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new ze(e)),this._czmTexture.uri="",this._createCircleCanvas(e),this._createCustomPrimitiveForCircle(e),this._createDebugAxis(e))}get czmTexture(){return this._czmTexture}get customPrimitiveForCircle(){return this._customPrimitiveForCircle}get circleCanvas(){return this._circleCanvas}get debugAxis(){return this._debugAxis}_createCircleCanvas(e){let n=this.disposeVar(a.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const r=()=>{const c={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},u=this._circleCanvas,d=this.color,p=`rgba(${d[0]*255|0}, ${d[1]*255|0}, ${d[2]*255|0}, ${d[3]})`;u.clearRect(0,0,256,256),u.lineWidth=6,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=`rgba(0,0,0,${d[3]})`,u.stroke(),u.lineWidth=4,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=p,u.stroke();{u.lineWidth=1,u.beginPath();let m=h.Math.zeroToTwoPi(c.startRotation),y=h.Math.zeroToTwoPi(c.endRotation);y<m&&(y+=h.Math.TWO_PI),(m!==y||m!==0)&&(u.moveTo(128,128),u.arc(128,128,64,m,y,y-m>Math.PI),u.lineTo(128,128),u.strokeStyle="rgba(255, 255, 0, 1.0)",u.stroke())}let f=h.Math.negativePiToPi(c.rotation);u.lineWidth=3,u.beginPath(),u.moveTo(128,128),u.arc(128,128,64,0,f,h.Math.negativePiToPi(f-0)<0),u.lineTo(128,128),u.fillStyle=`rgba(${d[0]*255|0}, ${d[1]*255|0}, ${d[2]*255|0}, 0.5)`,u.fill();{u.save(),u.font="16px console",u.textBaseline="middle";const _=`${(h.Math.negativePiToPi(f-0)*180/Math.PI*10|0)/10}°`;var g=u.measureText(_).width;u.translate(128,128),u.rotate(Math.PI*.5),f=h.Math.negativePiToPi(f-0)+0,u.rotate((f+0)*.5),u.scale(n.value?-1:1,1),u.translate(-128,-128),u.fillStyle="white",u.fillText(_,128-g*.5,54),u.lineWidth=1,u.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};r();const l=this.ad(a.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,n.changed));this.ad(l.don(r)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(r))}{const s=()=>{const l=Ie({rotation:this.selfRotation});if(!l)return;const c=Ie({position:this.position,rotation:this.rotation,localModelMatrix:h.Matrix4.toArray(l)});if(!c)return;const{viewer:u}=e;if(!u)return;const d=h.Cartesian3.dot(u.scene.camera.directionWC,new h.Cartesian3(c[8],c[9],c[10]));n.value=d>0};s();const r=this.ad(a.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(r.don(s))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(oF(e)),this.dispose(a.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(a.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(a.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(a.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const n=()=>{const o=Ie({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&h.Matrix4.toArray(o)||void 0)};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this.customPrimitiveForCircle&&this.czmTexture&&(this.customPrimitiveForCircle.uniformMap={u_image:{type:"texture",id:this.czmTexture.id},u_color:this.color})};n(),this.dispose(this.colorChanged.disposableOn(n))}}_createDebugAxis(e){this._debugAxis=this.ad(sF(e)),this.dispose(a.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(a.track([this._debugAxis,"position"],[this,"position"])),this.dispose(a.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(a.track([this._debugAxis,"show"],[this,"debug"]));{const n=()=>{const o=Ie({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&h.Matrix4.toArray(o)||void 0)};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this._debugAxis&&(this._debugAxis.uniformMap={u_color:this.color})};n(),this.dispose(this.colorChanged.disposableOn(n))}}}v(tr,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),selfRotation:a.reactArray([0,0,0]),pixelSize:300,color:a.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(tr||(tr={})),a.extendClassProps(tr.prototype,tr.createDefaultProps);function oF(t){return _u({type:"CzmCustomPrimitive",allowPicking:!0,pixelSize:100,boundingVolume:{type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},renderState:{depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},localPosition:[-.5,-.5,0],localRotation:[-90,0,0]},De,t)}function sF(t){return _u({type:"CzmCustomPrimitive",allowPicking:!0,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
1913
+ }`}createHeatmapGeometry(e,n){const o=this.czmESHeatMap,s=e||256,r=Math.ceil(n||256),[l,c,u,d]=o.rectangle,p=(u-l)/(s-1),f=(d-c)/(r-1),g=[],m=[],y=[],_=[];for(let P=0;P<s;P++){const C=l+p*P;for(let S=0;S<r;S++){const x=c+f*S;o.heatmap.getValueAt({x:P,y:S});const A=h.Cartesian3.fromDegrees(C,x,o.heatmap._renderer._min);g.push(A.x,A.y,A.z),m.push(P/(s-1),S/(r-1)),S!==r-1&&P!==s-1&&(y.push((P+1)*r+S+1,P*r+S+1,P*r+S),y.push(P*r+S,(P+1)*r+S,(P+1)*r+S+1))}}return this.createGeometry(g,m,y,_)}createGeometry(e,n,o,s){return new h.Geometry({attributes:new h.GeometryAttributes({position:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(n)})}),indices:new Uint32Array(o),boundingSphere:h.BoundingSphere.fromVertices(e,new h.Cartesian3,3),primitiveType:h.PrimitiveType.TRIANGLES})}}const Bt={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}};class ZR{constructor(i){v(this,"_coordinator");v(this,"_data");v(this,"_radi");v(this,"_min");v(this,"_max");v(this,"_xField");v(this,"_yField");v(this,"_valueField");v(this,"_cfgRadius");this._coordinator=new uC,this._data={},this._radi={},this._min=0,this._max=1,this._xField=i.xField||i.defaultXField||Bt.defaultXField,this._yField=i.yField||i.defaultYField||Bt.defaultYField,this._valueField=i.valueField||i.defaultValueField||Bt.defaultValueField,i.radius&&(this._cfgRadius=i.radius)}_organiseData(i,e){const n=i[this._xField],o=i[this._yField],s=i[this._valueField]||1,r=i.radius||this._cfgRadius||Bt.defaultRadius;return this._data[n]||(this._data[n]={},this._radi[n]={}),this._data[n][o]?this._data[n][o]+=s:(this._data[n][o]=s,this._radi[n][o]=r),this._data[n][o]>this._max?(e?this.setDataMax(this._data[n][o]):this._max=this._data[n][o],!1):{x:n,y:o,value:s,radius:r,min:this._min,max:this._max}}_unOrganizeData(){const i=[];for(const e in this._data)for(const n in this._data[e])i.push({x:Number(e),y:Number(n),radius:this._radi[e][n],value:this._data[e][n]});return{min:this._min,max:this._max,data:i}}_onExtremaChange(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})}_getInternalData(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}}addData(i){if(Array.isArray(i))i.forEach(e=>this.addData(e));else{const e=this._organiseData(i,!0);e&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[e]})}return this}setData(i){this._data={},this._radi={};for(const e of i.data)this._organiseData(e,!1);return this._max=i.max,this._min=i.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMax(i){return this._max=i,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMin(i){return this._min=i,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setCoordinator(i){this._coordinator=i}getData(){return this._unOrganizeData()}}class QR{constructor(i){v(this,"shadowCanvas");v(this,"canvas");v(this,"_renderBoundaries");v(this,"_width");v(this,"_height");v(this,"shadowCtx");v(this,"ctx");v(this,"_palette");v(this,"_templates");v(this,"_blur",Bt.defaultBlur);v(this,"_opacity",0);v(this,"_maxOpacity",Bt.defaultMaxOpacity*255);v(this,"_minOpacity",Bt.defaultMinOpacity*255);v(this,"_useGradientOpacity",!1);v(this,"_min",0);v(this,"_max",1);const e=i.container;this.shadowCanvas=document.createElement("canvas"),this.canvas=i.canvas||document.createElement("canvas"),this._renderBoundaries=[1e4,1e4,0,0];const n=getComputedStyle(e);this.canvas.className="heatmap-canvas",this._width=this.canvas.width=this.shadowCanvas.width=+n.width.replace(/px/,""),this._height=this.canvas.height=this.shadowCanvas.height=+n.height.replace(/px/,""),this.shadowCtx=this.shadowCanvas.getContext("2d"),this.ctx=this.canvas.getContext("2d"),this.canvas.style.cssText=this.shadowCanvas.style.cssText="position:absolute;left:0;top:0;",e.style.position="relative",e.appendChild(this.canvas),this._palette=this._getColorPalette(i),this._templates={},this._setStyles(i)}_getColorPalette(i){const e=i.gradient||i.defaultGradient||Bt.defaultGradient,n=document.createElement("canvas"),o=n.getContext("2d");n.width=256,n.height=1;const s=o.createLinearGradient(0,0,256,1);for(const r in e)s.addColorStop(Number(r),e[r]);return o.fillStyle=s,o.fillRect(0,0,256,1),o.getImageData(0,0,256,1).data}_getPointTemplate(i,e){const n=document.createElement("canvas"),o=n.getContext("2d"),s=i,r=i;if(n.width=n.height=i*2,e===1)o.beginPath(),o.arc(s,r,i,0,2*Math.PI,!1),o.fillStyle="rgba(0,0,0,1)",o.fill();else{const l=o.createRadialGradient(s,r,i*e,s,r,i);l.addColorStop(0,"rgba(0,0,0,1)"),l.addColorStop(1,"rgba(0,0,0,0)"),o.fillStyle=l,o.fillRect(0,0,2*i,2*i)}return n}renderPartial(i){this._drawAlpha(i),this._colorize()}renderAll(i){this._clear(),this._drawAlpha(this._prepareData(i)),this._colorize()}_prepareData(i){const e=[],n=Object.keys(i.data);for(const o of n){const s=Object.keys(i.data[o]);for(const r of s)e.push({x:Number(o),y:Number(r),value:i.data[o][r],radius:i.radi[o][r]})}return{min:i.min,max:i.max,data:e}}updateConfig(i){i.gradient&&(this._palette=this._getColorPalette(i)),this._setStyles(i)}setDimensions(i,e){this._width=i,this._height=e,this.canvas.width=this.shadowCanvas.width=i,this.canvas.height=this.shadowCanvas.height=e}_clear(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)}_setStyles(i){this._blur=i.blur===0?0:i.blur||i.defaultBlur||Bt.defaultBlur,i.backgroundColor&&(this.canvas.style.backgroundColor=i.backgroundColor),this._opacity=(i.opacity||0)*255,this._maxOpacity=(i.maxOpacity||i.defaultMaxOpacity||Bt.defaultMaxOpacity)*255,this._minOpacity=(i.minOpacity||i.defaultMinOpacity||Bt.defaultMinOpacity)*255,this._useGradientOpacity=!!i.useGradientOpacity}_drawAlpha(i){this._min=i.min,this._max=i.max;const e=1-this._blur;for(const n of i.data){const o=n.radius,s=n.x-o,r=n.y-o,l=Math.min(n.value,this._max);this._templates[o]=this._getPointTemplate(o,e),this.shadowCtx.globalAlpha=(l-this._min)/(this._max-this._min),this.shadowCtx.drawImage(this._templates[o],s,r),this._renderBoundaries[0]=Math.min(this._renderBoundaries[0],s),this._renderBoundaries[1]=Math.min(this._renderBoundaries[1],r),this._renderBoundaries[2]=Math.max(this._renderBoundaries[2],s+2*o),this._renderBoundaries[3]=Math.max(this._renderBoundaries[3],r+2*o)}}_colorize(){let[i,e,n,o]=this._renderBoundaries;i=Math.max(0,i),e=Math.max(0,e),n=Math.min(this._width-i,n-i),o=Math.min(this._height-e,o-e);const s=this.shadowCtx.getImageData(i,e,n,o),r=s.data;for(let l=3;l<r.length;l+=4){const c=r[l],u=c*4;if(!u)continue;let d;this._opacity>0?d=this._opacity:d=c<this._maxOpacity?c<this._minOpacity?this._minOpacity:c:this._maxOpacity,r[l-3]=this._palette[u],r[l-2]=this._palette[u+1],r[l-1]=this._palette[u+2],r[l]=this._useGradientOpacity?this._palette[u+3]:d}this.ctx.putImageData(s,i,e),this._renderBoundaries=[1e3,1e3,0,0]}getValueAt(i){const n=this.shadowCtx.getImageData(i.x,i.y,1,1).data[3];return Math.abs(this._max-this._min)*(n/255)>>0}getDataURL(){return this.canvas.toDataURL()}}class uC{constructor(){v(this,"cStore");this.cStore={}}on(i,e,n){this.cStore[i]||(this.cStore[i]=[]),this.cStore[i].push(o=>e.call(n,o))}emit(i,e){this.cStore[i]&&this.cStore[i].forEach(n=>n(e))}}class kR{constructor(i={}){v(this,"_config");v(this,"_coordinator");v(this,"_renderer");v(this,"_store");if(this._config={...Bt,...i},this._coordinator=new uC,this._config.plugin){const e=Bt.plugins[this._config.plugin];if(!e)throw new Error(`Plugin '${this._config.plugin}' not found. Maybe it was not registered.`);this._renderer=new e.renderer(this._config),this._store=new e.store(this._config)}else this._renderer=new QR(this._config),this._store=new ZR(this._config);this._connect()}_connect(){this._coordinator.on("renderpartial",i=>this._renderer.renderPartial(i),this._renderer),this._coordinator.on("renderall",i=>this._renderer.renderAll(i),this._renderer),this._coordinator.on("extremachange",i=>{var e,n;(n=(e=this._config).onExtremaChange)==null||n.call(e,{min:i.min,max:i.max,gradient:this._config.gradient||this._config.defaultGradient||Bt.defaultGradient})}),this._store.setCoordinator(this._coordinator)}addData(i){return this._store.addData(i),this}setData(i){return this._store.setData(i),this}setDataMax(i){return this._store.setDataMax(i),this}setDataMin(i){return this._store.setDataMin(i),this}configure(i){return this._config={...this._config,...i},this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this}repaint(){return this._coordinator.emit("renderall",this._store._getInternalData()),this}getData(){return this._store.getData()}getDataURL(){return this._renderer.getDataURL()}getValueAt(i){return this._store.getValueAt?this._store.getValueAt(i):this._renderer.getValueAt?this._renderer.getValueAt(i):null}}const KR=t=>new kR(t),Ql=class Ql extends Jt{constructor(e,n){super(e,n);v(this,"_heatmap");v(this,"_div");v(this,"_primitiveObj");v(this,"_rectangle",this.disposeVar(a.react(void 0)));v(this,"onePixelRadius",1e-4);const o=n.viewer,s=256;if(this._primitiveObj=this.ad(new a.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new YR(this,n):new XR(this,n))),!o){console.warn("viewer is undefined!");return}this._div=document.createElement("div"),this.div.style.display="none",this.div.style.width=`${s}px`,this.div.style.height=`${s}px`,document.body.appendChild(this.div),this.ad(()=>{document.body.removeChild(this.div)}),this._heatmap=KR({container:this.div}),this.heatmap._renderer.setDimensions(s,s);const r=this.ad(new a.Event);let l=[],c={max:100,min:0};{const u=()=>{const p={radius:e.radius??a.ESHeatMap.defaults.radius,gradient:e.gradient??a.ESHeatMap.defaults.gradient,blur:e.blur??a.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(p),this.heatmap._store._cfgRadius=p.radius,r.emit()};u();const d=this.ad(a.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(d.don(u))}{const u=()=>{if(e.data&&e.data.length>2){const{maxPos:p,minPos:f}=a.getMinMaxCorner(e.data),g=p[0]-f[0],m=p[1]-f[1];if(c={max:p[2]??100,min:f[2]??0},!Number.isFinite(g)||!Number.isFinite(m)||g<=0||m<=0)return;const y=1/Math.cos((f[1]+m*.5)*Math.PI/180);if(y==1/0)return;const _=s*m/g*y;this.div.style.width=`${s}px`,this.div.style.height=`${_}px`,this.heatmap._renderer.setDimensions(s,_);const P=g/s*(e.radius??a.ESHeatMap.defaults.radius)*2,C=m/_*(e.radius??a.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(P,C),this.rectangle=[f[0]-P,f[1]-C,p[0]+P,p[1]+C],l=JR(e.data,this.rectangle,s,_),r.emit()}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(d.don(u))}{const u=()=>{const d={max:c.max,min:c.min,data:l};this.heatmap.setData(d),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};u(),this.ad(r.don(u))}this.ad(this._primitiveObj.objChanged.don(()=>{r.emit()}))}get heatmap(){return this._heatmap}get div(){return this._div}get primitiveObj(){var e;return(e=this._primitiveObj)==null?void 0:e.obj}get rectangle(){return this._rectangle.value}set rectangle(e){this._rectangle.value=e}get rectangleChanged(){return this._rectangle.changed}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):this.rectangle?(oe(s,o,n,[[this.rectangle[0],this.rectangle[1],0],[this.rectangle[2],this.rectangle[3],0]],e),!0):!1:!1}};v(Ql,"type",Ql.register("ESCesiumViewer",a.ESHeatMap.type,Ql));let ng=Ql;function JR(t,i,e,n,o){return t.map(s=>({x:(s[0]-i[0])*e/(i[2]-i[0])|0,y:(1-(s[1]-i[1])/(i[3]-i[1]))*n|0,value:s[2]}))}const kl=class kl extends vt{constructor(e,n){super(e,n);v(this,"czmPoints");if(!n.viewer){console.error("viewer is null");return}this.czmPoints=this.ad(new mo(n,e.id)),this._updateShow();const s=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.pointedChanged));this.ad(s.don(()=>this._updateShow())),this._updatePoints();const r=this.ad(a.createNextAnimateFrameEvent(e.pointsChanged,e.pointStyleChanged));this.ad(r.don(()=>this._updatePoints()))}_updateShow(){this.czmPoints&&(this.czmPoints.show=this.sceneObject.show&&this.sceneObject.pointed)}_updatePoints(){var e;this.czmPoints&&(this.czmPoints.pointPrimitiveOptions=(e=this.sceneObject.points)==null?void 0:e.map(n=>{var o,s,r,l;return{position:n,pixelSize:((o=this.sceneObject.pointStyle)==null?void 0:o.size)??a.ESGeoPoints.defaults.pointStyle.size,color:((s=this.sceneObject.pointStyle)==null?void 0:s.color)??a.ESGeoPoints.defaults.pointStyle.color,outlineColor:((r=this.sceneObject.pointStyle)==null?void 0:r.outlineColor)??a.ESGeoPoints.defaults.pointStyle.outlineColor,outlineWidth:((l=this.sceneObject.pointStyle)==null?void 0:l.outlineWidth)??a.ESGeoPoints.defaults.pointStyle.outlineWidth}}))}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyInParam?(super.flyIn(e,n),!0):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}};v(kl,"type",kl.register("ESCesiumViewer",a.ESGeoPoints.type,kl));let og=kl;const Yo=class Yo extends Wt{constructor(e){super();v(this,"_config",this.disposeVar(a.react(Yo.defaultConfig)));v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"_pointerEventFilterFunc",this.disposeVar(a.react(Yo.defaultPointerEventFilterFunc)));v(this,"point");v(this,"czmViewer");this.czmViewer=e,e.viewer&&(this._updateConfig(),this.dispose(this.configChanged.disposableOn(()=>this._updateConfig())),this._createPoint(),this._updatePointPosition(),this.dispose(this.positionChanged.disposableOn(()=>this._updatePointPosition())),this.ad(new a.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new jR(e,this):void 0)))}get config(){return this._config.value}set config(e){this._config.value=e}get configChanged(){return this._config.changed}get overEvent(){return this._overEvent}over(){this._overEvent.emit()}get pointerEventFilterFunc(){return this._pointerEventFilterFunc.value}set pointerEventFilterFunc(e){this._pointerEventFilterFunc.value=e}get pointerEventFilterFuncChanged(){return this._pointerEventFilterFunc.changed}_updateConfig(){const{config:e}=this;e.clickEnabled!==void 0&&(this.clickEnabled=e.clickEnabled),e.dblClickEnabled!==void 0&&(this.dblClickEnabled=e.dblClickEnabled)}_createPoint(){this.point=this.ad(new ti(this.czmViewer)),this.point.pixelSize=4,this.point.outlineColor=[0,0,.8,1],this.point.outlineWidth=2,this.point.allowPicking=!1}_updatePointPosition(){if(!this.position)return;const e=[...this.position];this.czmViewer.editingHeightOffset&&(e[2]-=this.czmViewer.editingHeightOffset),this.point.position=e,this.point.show=!!this.position}};v(Yo,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),v(Yo,"defaultPointerEventFilterFunc",e=>e.button===0),v(Yo,"defaults",{...Wt.defaults,position:[116.39,39.9,0]});let Ni=Yo;(t=>{t.createDefaultProps=()=>({...Wt.createDefaultProps(),position:a.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Ni||(Ni={})),a.extendClassProps(Ni.prototype,Ni.createDefaultProps);class jR extends a.Destroyable{constructor(e,n){super();v(this,"_doings",[]);v(this,"initDoings",this.ad(()=>{this._doings.forEach(e=>e.destroy()),this._doings.length=0}));this._czmViewer=e,this._placeEditing=n;const o=(s,r)=>{r=="click"&&(!n.clickEnabled||!n.pointerEventFilterFunc(s))||r=="dblclick"&&(!n.dblClickEnabled||!n.pointerEventFilterFunc(s))||(n.over(),n.enabled=!1)};this.ad(e.clickEvent.don(s=>{s.pointerEvent&&o(s.pointerEvent,"click")})),this.ad(e.dblclickEvent.don(s=>{s.pointerEvent&&o(s.pointerEvent,"dblclick")})),this.ad(e.pointerMoveEvent.don(s=>{if(!s.pointerEvent)return;const r=new eF(this,s.pointerEvent,l=>{if(!l||l[2]<-1e5){n.position=void 0;return}const c=[...l];e.editingHeightOffset&&(c[2]+=e.editingHeightOffset),n.position=c,this._doings.splice(0,this._doings.indexOf(r)+1).forEach(d=>d.destroy())});this._doings.push(r)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class eF extends a.Destroyable{constructor(i,e,n){super(),this._owner=i;const{czmViewer:o}=this._owner,s=Yg(o,e,this._owner.placeEditing.virtualHeight),[r]=a.getEventFromPromise(s);this.dispose(r.disposableOn(n))}}class Zt extends Wt{constructor(){super()}}v(Zt,"defaults",{...Wt.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({...Wt.createDefaultProps(),position:a.reactArrayWithUndefined(void 0)})})(Zt||(Zt={})),a.extendClassProps(Zt.prototype,Zt.createDefaultProps);function sg(t,i){const e=new be(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=i,e}const ci=class ci extends a.Destroyable{constructor(i){if(super(),!i.viewer)return;const e=this.disposeVar(sg(i,ci.defaults.xAxisColor)),n=this.disposeVar(sg(i,ci.defaults.yAxisColor)),o=this.disposeVar(sg(i,ci.defaults.zAxisColor));{const s=()=>{e.show=this.xAxisShow&&this.show,n.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};s();const r=this.ad(a.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(r.disposableOn(s))}{const s=()=>{const{position:l=ci.defaults.position,heading:c=ci.defaults.heading}=this,[u,d,p]=l,{dimensions:f=ci.defaults.dimensions}=this;o.positions=[l,[u,d,p+f[2]]];const g=a.geoRhumbDestination(l,f[0],90+c);g&&(e.positions=[l,g]);const m=a.geoRhumbDestination(l,f[1],0+c);m&&(n.positions=[l,m])};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(r.disposableOn(s))}{const s=()=>{e.color=this.xAxisColor??ci.defaults.xAxisColor,n.color=this.yAxisColor??ci.defaults.yAxisColor,o.color=this.zAxisColor??ci.defaults.zAxisColor};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(r.disposableOn(s))}}};v(ci,"defaults",{position:[116.39,39.9,0],heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let Hn=ci;(t=>{t.createDefaultProps=()=>({show:!0,position:a.reactArrayWithUndefined(void 0),heading:0,dimensions:a.reactArray([1e3,1e3,1e3]),xAxisColor:a.reactArray([1,0,0,1]),yAxisColor:a.reactArray([0,1,0,1]),zAxisColor:a.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(Hn||(Hn={})),a.extendClassProps(Hn.prototype,Hn.createDefaultProps);const kn=class kn extends Zt{constructor(e){super();v(this,"_opInfo",{step:this.ad(a.react(!1)),moved:this.ad(a.react(!1)),constraintMode:this.ad(a.react("none")),originPosition:this.disposeVar(a.reactArray(Zt.defaults.position)),originHeading:this.disposeVar(a.react(0)),originDimensions:this.disposeVar(a.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(a.reactArray([0,0,0])),movingPosition:this.disposeVar(a.reactArray([0,0,0])),targetPosition:this.disposeVar(a.reactArray([0,0,0])),targetHeading:this.disposeVar(a.react(0))});v(this,"_createCoordinates",e=>{const n=this.ad(new Hn(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{dC(n,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const r=[...this.position??kn.defaults.position];e.editingHeightOffset&&(r[2]-=e.editingHeightOffset),n.position=r};o(),this.dispose(this.positionChanged.disposableOn(o))}{const o=()=>{n.heading=this.heading??0};o(),this.dispose(this.headingChanged.disposableOn(o))}{const o=()=>{n.dimensions=this._opInfo.originDimensions.value};o(),this.dispose(this._opInfo.originDimensions.changed.disposableOn(o))}return n});v(this,"_createOriginCoordinates",e=>{const n=this.ad(new Hn(e));n.xAxisColor=[1,0,0,.5],n.yAxisColor=[0,1,0,.5],n.zAxisColor=[0,0,1,.5];const{originPosition:o,originHeading:s,originDimensions:r}=this._opInfo;{const l=()=>{n.position=o.value};l(),this.dispose(o.changed.disposableOn(l))}{const l=()=>{n.heading=s.value??0};l(),this.dispose(s.changed.disposableOn(l))}{const l=()=>{n.dimensions=r.value};l(),this.dispose(r.changed.disposableOn(l))}return n});v(this,"_createGrid",e=>{const n=this.ad(new pi(e));{const o=()=>{const r=this._opInfo.originPosition.value,l=this._opInfo.originHeading.value,c=this._opInfo.originDimensions.value[0],u=[];for(let d=-4;d<5;++d){const p=a.geoRhumbDestination(r,c*.2*d,l+90);if(p){const f=a.geoRhumbDestination(p,c,l+180),g=a.geoRhumbDestination(p,c,l);f&&g&&u.push([f,p,g])}}for(let d=-4;d<5;++d){const p=a.geoRhumbDestination(r,c*.2*d,l);if(p){const f=a.geoRhumbDestination(p,c,l-90),g=a.geoRhumbDestination(p,c,l+90);f&&g&&u.push([f,p,g])}}n.positions=u};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originHeading.changed,this._opInfo.originDimensions.changed));this.dispose(s.disposableOn(o))}return n});v(this,"_createHelpLine",e=>{const n=this.ad(new be(e));n.hasDash=!0,n.arcType="RHUMB",n.color=[1,1,0,.99];{const o=()=>{n.positions=[this._opInfo.originPosition.value,this._opInfo.targetPosition.value]},s=this.ad(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.targetPosition.changed));this.ad(s.don(o))}return n});v(this,"_createCircle",e=>{const n=this.ad(new pi(e));n.arcType="RHUMB",n.width=2,n.hasDash=!0;const o=this.disposeVar(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),s=()=>{const r=this._opInfo.originPosition.value,l=this._opInfo.originDimensions.value[0],c=[],u=32;for(let d=0;d<=u;++d){const p=a.geoRhumbDestination(r,l,d*360/u);p&&c.push(p)}n.positions=[c]};return s(),this.dispose(o.disposableOn(s)),n});v(this,"_pickingXYProcessing",e=>this.ad(new a.Processing((n,o,s)=>{const r=[0,0,0],l=new h.Cartographic;return e.pointerMoveEvent.don(c=>{if(!c.pointerEvent||!e.viewer)return;const u=ui(a.getDomEventCurrentTargetPos(c.pointerEvent));if(!jo(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;Jn(l,r),this._opInfo.constraintMode.value==="x"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="y"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,r,r):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=r;const d=[0,0,0];a.geoRhumbDestination(r,s,o,d),this._opInfo.targetPosition.value=d})})));v(this,"_pickingZProcessing",e=>this.ad(new a.Processing(()=>{const n=new h.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!vc(e.viewer.scene,Le(this._opInfo.originPosition.value),r,n))return;const l=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(re(n,o)){this._opInfo.movingPosition.value=o;const c=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[c[0],c[1],o[2]+l]}})})));v(this,"_pickingZAxisProcessing",e=>this.ad(new a.Processing(()=>{const n=[0,0,0],o=new h.Cartographic;return e.pointerMoveEvent.don(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!jo(e.viewer.scene,r,this._opInfo.originPosition.value[2],o))return;Jn(o,n);const l=a.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),u=a.geoRhumbHeading(this._opInfo.originPosition.value,n)-l;let d=this._opInfo.originHeading.value+u;d=h.Math.toDegrees(h.Math.negativePiToPi(h.Math.toRadians(d))),this._opInfo.movingPosition.value=n,this.heading=this._opInfo.targetHeading.value=d})})));if(!e.viewer)return;const n=this.ad(a.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new mu(e,this.positionReact,n,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(s=>{if(this._opInfo.moved){const r=[...s];e.editingHeightOffset&&(r[2]+=e.editingHeightOffset),this.position=r}})),this.ad(this._opInfo.targetHeading.changed.don(s=>this._opInfo.moved&&(this.heading=s)));const o=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((s,r)=>s===this._opInfo.targetPosition.value[r])){this._opInfo.moved.value=!0;return}};o(),this.dispose(this._opInfo.originHeading.changed.disposableOn(o)),this.dispose(this._opInfo.originPosition.changed.disposableOn(o)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(o)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(o))}{const o=this._createCoordinates(e),s=this._createOriginCoordinates(e),r=this._createGrid(e),l=this._createHelpLine(e),c=this._createCircle(e);{const u=()=>{c.show=r.show=this.enabled&&this.showCircle,l.show=this.enabled&&this.showCircle&&this._opInfo.moved.value,o.show=this.enabled&&this.showCoordinates,s.show=this.enabled&&this.showCoordinates&&this._opInfo.moved.value};u();const d=this.ad(a.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(d.don(u))}{const u=()=>{o.xAxisShow=s.xAxisShow=this.xAxisShow,o.yAxisShow=s.yAxisShow=this.yAxisShow,o.zAxisShow=s.zAxisShow=this.zAxisShow};u();const d=this.ad(a.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(d.don(u))}{const u=()=>{r.color=this._opInfo.constraintMode.value!=="none"?[1,1,0,.6]:[1,1,0,.3],c.color=this._opInfo.constraintMode.value==="zAxis"?[1,1,0,.99]:[1,1,0,.5],dC(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u))}{const u=this._pickingXYProcessing(e),d=this._pickingZProcessing(e),p=this._pickingZAxisProcessing(e),f=()=>{const S=[...this.position??kn.defaults.position];e.editingHeightOffset&&(S[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=S},g=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,m=()=>this._opInfo.originDimensions.value=n.value,y={constraintMode:"none",startDragPos:[0,0,0]},_=S=>{const x={position:o.position??kn.defaults.position,heading:o.heading??kn.defaults.heading,dimensions:o.dimensions??kn.defaults.dimensions};e.viewer&&ou(S,e.viewer.scene,x,this.axisSnapPixelSize,y,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=y.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=y.startDragPos},P=this.ad(a.createProcessingFromAsyncFunc(async S=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",S.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await a.step(S,async x=>{x.disposer.dispose((f(),this.positionChanged.don(f))),x.disposer.dispose((g(),this.headingChanged.don(g))),x.disposer.dispose((m(),n.changed.don(m))),x.disposer.dispose(e.pointerMoveEvent.don(A=>{A.pointerEvent&&_(A.pointerEvent)})),await a.step(x,A=>new Promise((R,O)=>{A.disposer.dispose(O),A.disposer.dispose(e.pointerDownEvent.don(N=>{N.pointerEvent&&_(N.pointerEvent),N.pointerEvent&&N.pointerEvent.button===0&&y.constraintMode!=="none"&&R()}))}))}),this._opInfo.step.value=!1,await a.step(S,async x=>{if(e.incrementDisabledInputStack(),x.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const A=a.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),R=a.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);u.restart(void 0,A,R),x.disposer.dispose(()=>u.cancel())}else this._opInfo.constraintMode.value==="z"?(d.restart(),x.disposer.dispose(()=>d.cancel())):this._opInfo.constraintMode.value==="zAxis"?(p.restart(),x.disposer.dispose(()=>p.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await a.step(x,A=>new Promise((R,O)=>{A.disposer.dispose(O),A.disposer.dispose(e.pointerUpEvent.don(()=>{R()})),A.disposer.dispose(e.pointerOutEvent.don(()=>R()))}))}),P.restart()})),C=()=>{this.enabled?P.restart():P.isRunning&&P.cancel()};C(),this.ad(this.enabledChanged.don(C))}}}};v(kn,"defaults",{...Zt.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let on=kn;(t=>{t.createDefaultProps=()=>({...Zt.createDefaultProps(),heading:0,axisPixelSize:100,axisSnapPixelSize:5,showCoordinates:!0,showCircle:!0,disableX:!1,disableY:!1,disableZ:!1,disableXY:!1,disableZAxis:!1,xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(on||(on={})),a.extendClassProps(on.prototype,on.createDefaultProps);function dC(t,i,e){t.xAxisColor=[1,0,0,.99],t.yAxisColor=[0,1,0,.99],t.zAxisColor=[0,0,1,.99],i==="x"?t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="y"?t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="z"?t.zAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="xy"&&(t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99],t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99])}class rg extends a.HasOwner{constructor(e){super(e);v(this,"_valid",!1);v(this,"_normal",new h.Cartesian3(0,0,0));v(this,"_origin",new h.Cartesian3(0,0,0))}get viewer(){return this.owner.czmViewer.viewer}get scene(){return this.viewer.scene}get sceneObject(){return this.owner}get valid(){return this._valid}get normal(){return this._normal}get origin(){return this._valid&&this._origin}pick(e){if(!this.normal||!this.owner.cartesian)return;const n=this.owner.cartesian,o=ui(e);return Zg(this.scene,n,this.normal,o)}}class tF extends rg{constructor(i){super(i);{const e=()=>{const o=Ie({position:this.sceneObject.position,rotation:this.sceneObject.rotation});this._valid=!!o,o&&(this._origin.x=o[4],this._origin.y=o[5],this._origin.z=o[6],this._normal.x=o[8],this._normal.y=o[9],this._normal.z=o[10])};e();const n=this.ad(a.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(n.don(e))}}}class iF extends rg{constructor(i){super(i);const e=()=>{const n=Ie({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!n)throw new Error("PitchPlane: rm is undefined");const o=Ie({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:h.Matrix4.toArray(n)});if(this._valid=!!o,!!o){{const s=this._normal;s.x=-o[0],s.y=-o[1],s.z=-o[2]}{const s=this._origin;s.x=o[4],s.y=o[5],s.z=o[6]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class nF extends rg{constructor(i){super(i);const e=()=>{const n=Ie({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!n)throw new Error("PitchPlane: rm is undefined");const o=Ie({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:h.Matrix4.toArray(n)});if(this._valid=!!o,!!o){{const s=this._normal;s.x=-o[4],s.y=-o[5],s.z=-o[6]}{const s=this._origin;s.x=o[8],s.y=o[9],s.z=o[10]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class tr extends a.Destroyable{constructor(e){super();v(this,"_czmTexture");v(this,"_customPrimitiveForCircle");v(this,"_circleCanvas");v(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new ze(e)),this._czmTexture.uri="",this._createCircleCanvas(e),this._createCustomPrimitiveForCircle(e),this._createDebugAxis(e))}get czmTexture(){return this._czmTexture}get customPrimitiveForCircle(){return this._customPrimitiveForCircle}get circleCanvas(){return this._circleCanvas}get debugAxis(){return this._debugAxis}_createCircleCanvas(e){let n=this.disposeVar(a.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const r=()=>{const c={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},u=this._circleCanvas,d=this.color,p=`rgba(${d[0]*255|0}, ${d[1]*255|0}, ${d[2]*255|0}, ${d[3]})`;u.clearRect(0,0,256,256),u.lineWidth=6,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=`rgba(0,0,0,${d[3]})`,u.stroke(),u.lineWidth=4,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=p,u.stroke();{u.lineWidth=1,u.beginPath();let m=h.Math.zeroToTwoPi(c.startRotation),y=h.Math.zeroToTwoPi(c.endRotation);y<m&&(y+=h.Math.TWO_PI),(m!==y||m!==0)&&(u.moveTo(128,128),u.arc(128,128,64,m,y,y-m>Math.PI),u.lineTo(128,128),u.strokeStyle="rgba(255, 255, 0, 1.0)",u.stroke())}let f=h.Math.negativePiToPi(c.rotation);u.lineWidth=3,u.beginPath(),u.moveTo(128,128),u.arc(128,128,64,0,f,h.Math.negativePiToPi(f-0)<0),u.lineTo(128,128),u.fillStyle=`rgba(${d[0]*255|0}, ${d[1]*255|0}, ${d[2]*255|0}, 0.5)`,u.fill();{u.save(),u.font="16px console",u.textBaseline="middle";const _=`${(h.Math.negativePiToPi(f-0)*180/Math.PI*10|0)/10}°`;var g=u.measureText(_).width;u.translate(128,128),u.rotate(Math.PI*.5),f=h.Math.negativePiToPi(f-0)+0,u.rotate((f+0)*.5),u.scale(n.value?-1:1,1),u.translate(-128,-128),u.fillStyle="white",u.fillText(_,128-g*.5,54),u.lineWidth=1,u.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};r();const l=this.ad(a.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,n.changed));this.ad(l.don(r)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(r))}{const s=()=>{const l=Ie({rotation:this.selfRotation});if(!l)return;const c=Ie({position:this.position,rotation:this.rotation,localModelMatrix:h.Matrix4.toArray(l)});if(!c)return;const{viewer:u}=e;if(!u)return;const d=h.Cartesian3.dot(u.scene.camera.directionWC,new h.Cartesian3(c[8],c[9],c[10]));n.value=d>0};s();const r=this.ad(a.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(r.don(s))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(oF(e)),this.dispose(a.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(a.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(a.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(a.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const n=()=>{const o=Ie({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&h.Matrix4.toArray(o)||void 0)};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this.customPrimitiveForCircle&&this.czmTexture&&(this.customPrimitiveForCircle.uniformMap={u_image:{type:"texture",id:this.czmTexture.id},u_color:this.color})};n(),this.dispose(this.colorChanged.disposableOn(n))}}_createDebugAxis(e){this._debugAxis=this.ad(sF(e)),this.dispose(a.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(a.track([this._debugAxis,"position"],[this,"position"])),this.dispose(a.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(a.track([this._debugAxis,"show"],[this,"debug"]));{const n=()=>{const o=Ie({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&h.Matrix4.toArray(o)||void 0)};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this._debugAxis&&(this._debugAxis.uniformMap={u_color:this.color})};n(),this.dispose(this.colorChanged.disposableOn(n))}}}v(tr,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),selfRotation:a.reactArray([0,0,0]),pixelSize:300,color:a.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(tr||(tr={})),a.extendClassProps(tr.prototype,tr.createDefaultProps);function oF(t){return _u({type:"CzmCustomPrimitive",allowPicking:!0,pixelSize:100,boundingVolume:{type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},renderState:{depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},localPosition:[-.5,-.5,0],localRotation:[-90,0,0]},De,t)}function sF(t){return _u({type:"CzmCustomPrimitive",allowPicking:!0,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
1914
1914
  void main()
1915
1915
  {
1916
1916
  // 如果这一句注释,要相应地注释掉attribute中的normal,也就是说顶点属性要和shader中的一一匹配!
@@ -2291,10 +2291,10 @@ async function initCesiumViewer(container, czmViewer) {
2291
2291
  `;function z4(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
2292
2292
  github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
2293
2293
  gitee地址:${t}
2294
- `;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const st=class st extends a.ESViewer{constructor(e){super(e);v(this,"_disabledInputStack",this.disposeVar(a.react(0)));v(this,"_viewer",this.dv(a.react(void 0)));v(this,"_viewerInstance");v(this,"_viewerLegend");v(this,"pickCustomAttachedInfo");v(this,"_fps",this.dv(a.react(0)));v(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));v(this,"_editingSystem",Wh);v(this,"_moveObjectsProcess",this.ad(PC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new gF(this)),this.ad(new mF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new CF(this)})),this._viewerLegend=this.dv(new T4(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Fg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new yL(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&kt(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],st.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Gt(e),rotation:Jo(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=Jo(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;if(!n)return;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&Er(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&Er(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&Er(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Gt(e),rotation:Jo(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=h.VERSION,e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,st.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await bm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Le(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=st.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!st.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=st.latestDefaultAccessToken}positionsToLocalPositions(e,n){return It(e,n)}localPositionsToPositions(e,n){return yn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=Le(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=st.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",F4,R4,!0),new a.FunctionProperty([],()=>st.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};v(st,"type",st.register("ESCesiumViewer",st)),v(st,"getCesiumIonToken",z4),v(st,"currentDefaultAccessToken",h.Ion.defaultAccessToken),v(st,"latestDefaultAccessToken"),v(st,"ObjectsToExcludeWrapper",wF),v(st,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.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}),v(st,"getHeightsScartchCarto",new h.Cartographic);let Te=st;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...D4()})})(Te||(Te={})),a.extendClassProps(Te.prototype,Te.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.5.0-beta.17",e="2025-10-22T09:16:13.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="cdf0459633f31b3c6dce81ced3cf33b7abab0ce4",l=((Date.now()-1761124573e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
2294
+ `;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const st=class st extends a.ESViewer{constructor(e){super(e);v(this,"_disabledInputStack",this.disposeVar(a.react(0)));v(this,"_viewer",this.dv(a.react(void 0)));v(this,"_viewerInstance");v(this,"_viewerLegend");v(this,"pickCustomAttachedInfo");v(this,"_fps",this.dv(a.react(0)));v(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));v(this,"_editingSystem",Wh);v(this,"_moveObjectsProcess",this.ad(PC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new gF(this)),this.ad(new mF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new CF(this)})),this._viewerLegend=this.dv(new T4(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Fg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new yL(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&kt(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],st.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Gt(e),rotation:Jo(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=Jo(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;if(!n)return;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&Er(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&Er(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&Er(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Gt(e),rotation:Jo(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=h.VERSION,e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,st.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await bm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Le(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=st.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!st.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=st.latestDefaultAccessToken}positionsToLocalPositions(e,n){return It(e,n)}localPositionsToPositions(e,n){return yn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=Le(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=st.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",F4,R4,!0),new a.FunctionProperty([],()=>st.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};v(st,"type",st.register("ESCesiumViewer",st)),v(st,"getCesiumIonToken",z4),v(st,"currentDefaultAccessToken",h.Ion.defaultAccessToken),v(st,"latestDefaultAccessToken"),v(st,"ObjectsToExcludeWrapper",wF),v(st,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.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}),v(st,"getHeightsScartchCarto",new h.Cartographic);let Te=st;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...D4()})})(Te||(Te={})),a.extendClassProps(Te.prototype,Te.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.5.0-beta.18",e="2025-10-22T10:18:01.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="238c78ef56211d71964dbf6b2ee063b0a75e49bd",l=((Date.now()-1761128281e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
2295
2295
  %c${o?o+`
2296
2296
  `:""}当前网站正在使用${t},此软件版权归${n}所有
2297
- `;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","cdf0459633f31b3c6dce81ced3cf33b7abab0ce4")},get info(){return c},get date(){return"2025-10-22T09:16:13.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.17"},get name(){return"earthsdk3-cesium"},get commitId(){return"cdf0459633f31b3c6dce81ced3cf33b7abab0ce4"},print(){console.info(this.info,`
2297
+ `;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","238c78ef56211d71964dbf6b2ee063b0a75e49bd")},get info(){return c},get date(){return"2025-10-22T10:18:01.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.18"},get name(){return"earthsdk3-cesium"},get commitId(){return"238c78ef56211d71964dbf6b2ee063b0a75e49bd"},print(){console.info(this.info,`
2298
2298
  font-size: 18px;
2299
2299
  font-weight: 1000;
2300
2300
  line-height: 1;