earthsdk3-cesium 3.5.0-beta.4 → 3.5.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/earthsdk3-cesium.iife.js +10 -10
- package/dist/earthsdk3-cesium.js +1340 -1340
- package/dist/earthsdk3-cesium.umd.cjs +48 -48
- package/dist/types/ESCesiumViewer/createBaseProps.d.ts +0 -3
- package/dist/types/ESCesiumViewer/createBaseProps.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/index.d.ts +0 -6
- package/dist/types/ESCesiumViewer/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -3705,7 +3705,7 @@ function (result, this, instanceIndex, frameState) {
|
|
|
3705
3705
|
result.bgColor = [c*.5+.5, (1.0 - c)*.5+.5, 0.5, 0.3];
|
|
3706
3706
|
return result;
|
|
3707
3707
|
}\`\`\`
|
|
3708
|
-
`,to=class to extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_player");z(this,"_finalImageUrlReact",this.disposeVar(h.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));z(this,"_routePaths",this.disposeVar(h.react(void 0)));z(this,"routePathCallback");z(this,"_id",this.disposeVar(h.react(h.createGuid())));i&&(this._id.value=i),this._player=this.disposeVar(new h.Player);{const d=to.defaults;this.dispose(h.bind([this._player,"loop"],[this,"loop"],p=>p??d.loop,p=>p??d.loop)),this.dispose(h.bind([this._player,"currentTime"],[this,"currentTime"],p=>p??d.currentTime,p=>p??d.currentTime)),this.dispose(h.bind([this._player,"duration"],[this,"duration"],p=>p??d.duration,p=>p??d.duration)),this.dispose(h.bind([this._player,"playing"],[this,"playing"],p=>p??d.playing,p=>p??d.playing)),this.dispose(h.bind([this._player,"speed"],[this,"speed"],p=>p??d.speed,p=>p??d.speed))}const o=this.disposeVar(h.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),r=this.disposeVar(h.createProcessingFromAsyncFunc(async d=>{this.routePaths=void 0;const p=o.value;if(p)try{const v=await(await fetch(p)).json();this.routePaths=QL(v,this.width,this.repeatLength);return}catch(g){console.error(`geojson加载解析出错!${g}`),console.error(g)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const g=this.positionsSet;if(g){this.routePaths=g.map(v=>({positions:v,width:this.width}));return}}}));{const d=()=>{r.restart()};d();const p=this.disposeVar(h.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(p.disposableOn(d))}{const d=()=>{const p=$f(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);p&&(this.routePathCallback=p)};d(),this.dispose(this.routePathCallbackStrChanged.disposableOn(d))}const a=e.viewer;if(!a){console.warn("viewer is undefined!");return}const s=this.finalImageUrlReact,l=this.disposeVar(new cs),u=this.disposeVar(h.createProcessingFromAsyncFunc(async d=>{if(!s.value)return;const p=Q0(a.scene.context).getTextureHandler(s.value);if(p instanceof cs)l.reset(p);else{const g=await d.promise(p);l.reset(g)}})),A=()=>l.valid?l.raw:a.scene.context.defaultTexture,c=()=>u.restart();c(),this.dispose(s.changed.disposableOn(c));const f=this.ad(h.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new h.ObjResettingWithEvent(f,()=>this.routePaths?new nz(a,this,s.value&&A||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(d=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))Fe(a,this.routePaths[0].startPos,a.camera.positionCartographic.height,void 0,d);else{const p=computeBoundingSphere(this.routePaths[0].positions);if(!p)return;const[g,v]=p;Fe(a,g,v*3,void 0,d)}}))}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}};z(to,"whiteGradientImageBase64",iz),z(to,"defaultRoutePathCallback",function(e,i,o){const r=i/50,a=r-Math.floor(r);return e.color=[a*.5+.5,(1-a)*.5+.5,.5,1],e.bgColor=[a*.5+.5,(1-a)*.5+.5,.5,.3],e}),z(to,"routePathCallbackStrMd",rz),z(to,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),z(to,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let $i=to;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:h.reactArray([0,1,0,1]),bgColor:h.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:h.reactPositionsSet(void 0),data:h.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})($i||($i={})),h.extendClassProps($i.prototype,$i.createDefaultProps);class Yi extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_collection");this._collection=this.disposeVar(new $i(e,i)),this.dispose(h.track([this._collection,"show"],[this,"show"])),this.dispose(h.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(h.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(h.track([this._collection,"color"],[this,"color"])),this.dispose(h.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(h.track([this._collection,"width"],[this,"width"])),this.dispose(h.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(h.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(h.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(h.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(h.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(h.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(h.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(h.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(h.bind([this._collection,"playing"],[this,"playing"])),this.dispose(h.track([this._collection,"loop"],[this,"loop"])),this.dispose(h.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(h.bind([this._collection,"duration"],[this,"duration"])),this.dispose(h.bind([this._collection,"speed"],[this,"speed"]));{const o=()=>{this.color=[this.bgColor[0],this.bgColor[1],this.bgColor[2],1]};o(),this.ad(this.bgColorChanged.don(o))}this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=this.positions.map((a,s)=>{var l;if(!(!this.positions||s==((l=this.positions)==null?void 0:l.length)-1))return{startPos:a,endPos:this.positions[s+1],width:this.width,heightRatio:this.heightRatio}}).filter(a=>a!==void 0);return}this._collection.data=void 0};o();const r=this.disposeVar(h.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(r.disposableOn(o))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get collection(){return this._collection}get player(){return this.collection.player}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}}z(Yi,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),z(Yi,"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:h.reactArray([0,1,0,1]),bgColor:h.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:h.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Yi||(Yi={})),h.extendClassProps(Yi.prototype,Yi.createDefaultProps);const pc=class pc extends Jt{constructor(e,i){super(e,i);z(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Yi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmSignalTransmission;{const a=()=>{r.show=e.show&&e.stroked};a(),this.ad(e.showChanged.don(a)),this.ad(e.strokedChanged.don(a))}this.dispose(h.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(h.bind([r,"positions"],[e,"points"])),this.dispose(h.track([r,"width"],[e,"strokeWidth"])),this.dispose(h.track([r,"bgColor"],[e,"strokeColor"])),this.dispose(h.track([r,"startTime"],[e,"startTime"])),this.dispose(h.track([r,"transmissionTime"],[e,"transmissionTime"])),this.dispose(h.track([r,"heightRatio"],[e,"heightRatio"])),this.dispose(h.track([r,"arcType"],[e,"arcType"])),this.dispose(h.track([r,"brightening"],[e,"brightening"])),this.dispose(h.track([r,"depthTest"],[e,"depthTest"])),this.dispose(h.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(h.track([r,"repeat"],[e,"repeat"])),this.dispose(h.track([r,"bidirectional"],[e,"bidirectional"])),this.dispose(h.track([r,"loop"],[e,"loop"])),this.dispose(h.track([r,"currentTime"],[e,"currentTime"])),this.dispose(h.track([r,"duration"],[e,"duration"])),this.dispose(h.track([r,"playing"],[e,"playing"])),this.dispose(h.track([r,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};z(pc,"type",pc.register("ESCesiumViewer",qA.type,pc));let Eg=pc;function Ho(t){var n=[1/0,1/0,-1/0,-1/0];return tf(t,function(e){n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}Ho.default=Ho;const Ji=11102230246251565e-32,en=134217729,oz=(3+8*Ji)*Ji;function Pg(t,n,e,i,o){let r,a,s,l,u=n[0],A=i[0],c=0,f=0;A>u==A>-u?(r=u,u=n[++c]):(r=A,A=i[++f]);let d=0;if(c<t&&f<e)for(A>u==A>-u?(a=u+r,s=r-(a-u),u=n[++c]):(a=A+r,s=r-(a-A),A=i[++f]),r=a,s!==0&&(o[d++]=s);c<t&&f<e;)A>u==A>-u?(a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++c]):(a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f]),r=a,s!==0&&(o[d++]=s);for(;c<t;)a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++c],r=a,s!==0&&(o[d++]=s);for(;f<e;)a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f],r=a,s!==0&&(o[d++]=s);return(r!==0||d===0)&&(o[d++]=r),d}function sz(t,n){let e=n[0];for(let i=1;i<t;i++)e+=n[i];return e}function zl(t){return new Float64Array(t)}const az=(3+16*Ji)*Ji,lz=(2+12*Ji)*Ji,uz=(9+64*Ji)*Ji*Ji,ha=zl(4),y_=zl(8),v_=zl(12),w_=zl(16),on=zl(4);function cz(t,n,e,i,o,r,a){let s,l,u,A,c,f,d,p,g,v,y,m,b,x,E,B,P,I;const O=t-o,M=e-o,S=n-r,T=i-r;x=O*T,f=en*O,d=f-(f-O),p=O-d,f=en*T,g=f-(f-T),v=T-g,E=p*v-(x-d*g-p*g-d*v),B=S*M,f=en*S,d=f-(f-S),p=S-d,f=en*M,g=f-(f-M),v=M-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,ha[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,ha[1]=b-(y+c)+(c-B),I=m+y,c=I-m,ha[2]=m-(I-c)+(y-c),ha[3]=I;let w=sz(4,ha),C=lz*a;if(w>=C||-w>=C||(c=t-O,s=t-(O+c)+(c-o),c=e-M,u=e-(M+c)+(c-o),c=n-S,l=n-(S+c)+(c-r),c=i-T,A=i-(T+c)+(c-r),s===0&&l===0&&u===0&&A===0)||(C=uz*a+oz*Math.abs(w),w+=O*A+T*s-(S*u+M*l),w>=C||-w>=C))return w;x=s*T,f=en*s,d=f-(f-s),p=s-d,f=en*T,g=f-(f-T),v=T-g,E=p*v-(x-d*g-p*g-d*v),B=l*M,f=en*l,d=f-(f-l),p=l-d,f=en*M,g=f-(f-M),v=M-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,on[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,on[1]=b-(y+c)+(c-B),I=m+y,c=I-m,on[2]=m-(I-c)+(y-c),on[3]=I;const U=Pg(4,ha,4,on,y_);x=O*A,f=en*O,d=f-(f-O),p=O-d,f=en*A,g=f-(f-A),v=A-g,E=p*v-(x-d*g-p*g-d*v),B=S*u,f=en*S,d=f-(f-S),p=S-d,f=en*u,g=f-(f-u),v=u-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,on[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,on[1]=b-(y+c)+(c-B),I=m+y,c=I-m,on[2]=m-(I-c)+(y-c),on[3]=I;const F=Pg(U,y_,4,on,v_);x=s*A,f=en*s,d=f-(f-s),p=s-d,f=en*A,g=f-(f-A),v=A-g,E=p*v-(x-d*g-p*g-d*v),B=l*u,f=en*l,d=f-(f-l),p=l-d,f=en*u,g=f-(f-u),v=u-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,on[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,on[1]=b-(y+c)+(c-B),I=m+y,c=I-m,on[2]=m-(I-c)+(y-c),on[3]=I;const D=Pg(F,v_,4,on,w_);return w_[D-1]}function kl(t,n,e,i,o,r){const a=(n-r)*(e-o),s=(t-o)*(i-r),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=az*u?l:-cz(t,n,e,i,o,r,u)}function sn(t,n,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!n)throw new Error("polygon is required");var i=ef(t),o=Pi(n),r=o.type,a=n.bbox,s=o.coordinates;if(a&&hz(i,a)===!1)return!1;r==="Polygon"&&(s=[s]);for(var l=!1,u=0;u<s.length&&!l;u++)if(b_(i,s[u][0],e.ignoreBoundary)){for(var A=!1,c=1;c<s[u].length&&!A;)b_(i,s[u][c],!e.ignoreBoundary)&&(A=!0),c++;A||(l=!0)}return l}function b_(t,n,e){var i=!1;n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&(n=n.slice(0,n.length-1));for(var o=0,r=n.length-1;o<n.length;r=o++){var a=n[o][0],s=n[o][1],l=n[r][0],u=n[r][1],A=t[1]*(a-l)+s*(l-t[0])+u*(t[0]-a)===0&&(a-t[0])*(l-t[0])<=0&&(s-t[1])*(u-t[1])<=0;if(A)return!e;var c=s>t[1]!=u>t[1]&&t[0]<(l-a)*(t[1]-s)/(u-s)+a;c&&(i=!i)}return i}function hz(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function Az(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return x_(t);case"FeatureCollection":return fz(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Bg(t);default:throw new Error("unknown GeoJSON type")}}function x_(t){var n={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:n[e]=t[e]}}),n.properties=__(t.properties),n.geometry=Bg(t.geometry),n}function __(t){var n={};return t&&Object.keys(t).forEach(function(e){var i=t[e];typeof i=="object"?i===null?n[e]=null:Array.isArray(i)?n[e]=i.map(function(o){return o}):n[e]=__(i):n[e]=i}),n}function fz(t){var n={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:n[e]=t[e]}}),n.features=t.features.map(function(e){return x_(e)}),n}function Bg(t){var n={type:t.type};return t.bbox&&(n.bbox=t.bbox),t.type==="GeometryCollection"?(n.geometries=t.geometries.map(function(e){return Bg(e)}),n):(n.coordinates=C_(t.coordinates),n)}function C_(t){var n=t;return typeof n[0]!="object"?n.slice():n.map(function(e){return C_(e)})}function S_(t,n){n===void 0&&(n={});var e=typeof n=="object"?n.mutate:n;if(!t)throw new Error("geojson is required");var i=ML(t),o=[];switch(i){case"LineString":o=Tg(t);break;case"MultiLineString":case"Polygon":Ei(t).forEach(function(a){o.push(Tg(a))});break;case"MultiPolygon":Ei(t).forEach(function(a){var s=[];a.forEach(function(l){s.push(Tg(l))}),o.push(s)});break;case"Point":return t;case"MultiPoint":var r={};Ei(t).forEach(function(a){var s=a.join("-");Object.prototype.hasOwnProperty.call(r,s)||(o.push(a),r[s]=!0)});break;default:throw new Error(i+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:i,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Ci({type:i,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function Tg(t){var n=Ei(t);if(n.length===2&&!E_(n[0],n[1]))return n;var e=[],i=n.length-1,o=e.length;e.push(n[0]);for(var r=1;r<i;r++){var a=e[e.length-1];n[r][0]===a[0]&&n[r][1]===a[1]||(e.push(n[r]),o=e.length,o>2&&P_(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(n[n.length-1]),o=e.length,E_(n[0],n[n.length-1])&&o<4)throw new Error("invalid polygon");return P_(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function E_(t,n){return t[0]===n[0]&&t[1]===n[1]}function P_(t,n,e){var i=e[0],o=e[1],r=t[0],a=t[1],s=n[0],l=n[1],u=i-r,A=o-a,c=s-r,f=l-a,d=u*f-A*c;return d!==0?!1:Math.abs(c)>=Math.abs(f)?c>0?r<=i&&i<=s:s<=i&&i<=r:f>0?a<=o&&o<=l:l<=o&&o<=a}function pz(t,n){n===void 0&&(n={});var e=0,i=0,o=0;return tf(t,function(r){e+=r[0],i+=r[1],o++},!0),Gr([e/o,i/o],n.properties)}function B_(t){if(!t)throw new Error("geojson is required");var n=[];return sa(t,function(e){dz(e,n)}),Si(n)}function dz(t,n){var e=[],i=t.geometry;if(i!==null){switch(i.type){case"Polygon":e=Ei(i);break;case"LineString":e=[Ei(i)]}e.forEach(function(o){var r=mz(o,t.properties);r.forEach(function(a){a.id=n.length,n.push(a)})})}}function mz(t,n){var e=[];return t.reduce(function(i,o){var r=YA([i,o],n);return r.bbox=gz(i,o),e.push(r),o}),e}function gz(t,n){var e=t[0],i=t[1],o=n[0],r=n[1],a=e<o?e:o,s=i<r?i:r,l=e>o?e:o,u=i>r?i:r;return[a,s,l,u]}var of={exports:{}},sf={exports:{}},yz=sf.exports,T_;function vz(){return T_||(T_=1,(function(t,n){(function(e,i){t.exports=i()})(yz,function(){function e(m,b,x,E,B){(function P(I,O,M,S,T){for(;S>M;){if(S-M>600){var w=S-M+1,C=O-M+1,U=Math.log(w),F=.5*Math.exp(2*U/3),D=.5*Math.sqrt(U*F*(w-F)/w)*(C-w/2<0?-1:1),R=Math.max(M,Math.floor(O-C*F/w+D)),L=Math.min(S,Math.floor(O+(w-C)*F/w+D));P(I,O,R,L,T)}var k=I[O],Q=M,V=S;for(i(I,M,O),T(I[S],k)>0&&i(I,M,S);Q<V;){for(i(I,Q,V),Q++,V--;T(I[Q],k)<0;)Q++;for(;T(I[V],k)>0;)V--}T(I[M],k)===0?i(I,M,V):i(I,++V,S),V<=O&&(M=V+1),O<=V&&(S=V-1)}})(m,b,x||0,E||m.length-1,B||o)}function i(m,b,x){var E=m[b];m[b]=m[x],m[x]=E}function o(m,b){return m<b?-1:m>b?1:0}var r=function(m){m===void 0&&(m=9),this._maxEntries=Math.max(4,m),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(m,b,x){if(!x)return b.indexOf(m);for(var E=0;E<b.length;E++)if(x(m,b[E]))return E;return-1}function s(m,b){l(m,0,m.children.length,b,m)}function l(m,b,x,E,B){B||(B=v(null)),B.minX=1/0,B.minY=1/0,B.maxX=-1/0,B.maxY=-1/0;for(var P=b;P<x;P++){var I=m.children[P];u(B,m.leaf?E(I):I)}return B}function u(m,b){return m.minX=Math.min(m.minX,b.minX),m.minY=Math.min(m.minY,b.minY),m.maxX=Math.max(m.maxX,b.maxX),m.maxY=Math.max(m.maxY,b.maxY),m}function A(m,b){return m.minX-b.minX}function c(m,b){return m.minY-b.minY}function f(m){return(m.maxX-m.minX)*(m.maxY-m.minY)}function d(m){return m.maxX-m.minX+(m.maxY-m.minY)}function p(m,b){return m.minX<=b.minX&&m.minY<=b.minY&&b.maxX<=m.maxX&&b.maxY<=m.maxY}function g(m,b){return b.minX<=m.maxX&&b.minY<=m.maxY&&b.maxX>=m.minX&&b.maxY>=m.minY}function v(m){return{children:m,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(m,b,x,E,B){for(var P=[b,x];P.length;)if(!((x=P.pop())-(b=P.pop())<=E)){var I=b+Math.ceil((x-b)/E/2)*E;e(m,I,b,x,B),P.push(b,I,I,x)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(m){var b=this.data,x=[];if(!g(m,b))return x;for(var E=this.toBBox,B=[];b;){for(var P=0;P<b.children.length;P++){var I=b.children[P],O=b.leaf?E(I):I;g(m,O)&&(b.leaf?x.push(I):p(m,O)?this._all(I,x):B.push(I))}b=B.pop()}return x},r.prototype.collides=function(m){var b=this.data;if(!g(m,b))return!1;for(var x=[];b;){for(var E=0;E<b.children.length;E++){var B=b.children[E],P=b.leaf?this.toBBox(B):B;if(g(m,P)){if(b.leaf||p(m,P))return!0;x.push(B)}}b=x.pop()}return!1},r.prototype.load=function(m){if(!m||!m.length)return this;if(m.length<this._minEntries){for(var b=0;b<m.length;b++)this.insert(m[b]);return this}var x=this._build(m.slice(),0,m.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var E=this.data;this.data=x,x=E}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},r.prototype.insert=function(m){return m&&this._insert(m,this.data.height-1),this},r.prototype.clear=function(){return this.data=v([]),this},r.prototype.remove=function(m,b){if(!m)return this;for(var x,E,B,P=this.data,I=this.toBBox(m),O=[],M=[];P||O.length;){if(P||(P=O.pop(),E=O[O.length-1],x=M.pop(),B=!0),P.leaf){var S=a(m,P.children,b);if(S!==-1)return P.children.splice(S,1),O.push(P),this._condense(O),this}B||P.leaf||!p(P,I)?E?(x++,P=E.children[x],B=!1):P=null:(O.push(P),M.push(x),x=0,E=P,P=P.children[0])}return this},r.prototype.toBBox=function(m){return m},r.prototype.compareMinX=function(m,b){return m.minX-b.minX},r.prototype.compareMinY=function(m,b){return m.minY-b.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(m){return this.data=m,this},r.prototype._all=function(m,b){for(var x=[];m;)m.leaf?b.push.apply(b,m.children):x.push.apply(x,m.children),m=x.pop();return b},r.prototype._build=function(m,b,x,E){var B,P=x-b+1,I=this._maxEntries;if(P<=I)return s(B=v(m.slice(b,x+1)),this.toBBox),B;E||(E=Math.ceil(Math.log(P)/Math.log(I)),I=Math.ceil(P/Math.pow(I,E-1))),(B=v([])).leaf=!1,B.height=E;var O=Math.ceil(P/I),M=O*Math.ceil(Math.sqrt(I));y(m,b,x,M,this.compareMinX);for(var S=b;S<=x;S+=M){var T=Math.min(S+M-1,x);y(m,S,T,O,this.compareMinY);for(var w=S;w<=T;w+=O){var C=Math.min(w+O-1,T);B.children.push(this._build(m,w,C,E-1))}}return s(B,this.toBBox),B},r.prototype._chooseSubtree=function(m,b,x,E){for(;E.push(b),!b.leaf&&E.length-1!==x;){for(var B=1/0,P=1/0,I=void 0,O=0;O<b.children.length;O++){var M=b.children[O],S=f(M),T=(w=m,C=M,(Math.max(C.maxX,w.maxX)-Math.min(C.minX,w.minX))*(Math.max(C.maxY,w.maxY)-Math.min(C.minY,w.minY))-S);T<P?(P=T,B=S<B?S:B,I=M):T===P&&S<B&&(B=S,I=M)}b=I||b.children[0]}var w,C;return b},r.prototype._insert=function(m,b,x){var E=x?m:this.toBBox(m),B=[],P=this._chooseSubtree(E,this.data,b,B);for(P.children.push(m),u(P,E);b>=0&&B[b].children.length>this._maxEntries;)this._split(B,b),b--;this._adjustParentBBoxes(E,B,b)},r.prototype._split=function(m,b){var x=m[b],E=x.children.length,B=this._minEntries;this._chooseSplitAxis(x,B,E);var P=this._chooseSplitIndex(x,B,E),I=v(x.children.splice(P,x.children.length-P));I.height=x.height,I.leaf=x.leaf,s(x,this.toBBox),s(I,this.toBBox),b?m[b-1].children.push(I):this._splitRoot(x,I)},r.prototype._splitRoot=function(m,b){this.data=v([m,b]),this.data.height=m.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(m,b,x){for(var E,B,P,I,O,M,S,T=1/0,w=1/0,C=b;C<=x-b;C++){var U=l(m,0,C,this.toBBox),F=l(m,C,x,this.toBBox),D=(B=U,P=F,I=void 0,O=void 0,M=void 0,S=void 0,I=Math.max(B.minX,P.minX),O=Math.max(B.minY,P.minY),M=Math.min(B.maxX,P.maxX),S=Math.min(B.maxY,P.maxY),Math.max(0,M-I)*Math.max(0,S-O)),R=f(U)+f(F);D<T?(T=D,E=C,w=R<w?R:w):D===T&&R<w&&(w=R,E=C)}return E||x-b},r.prototype._chooseSplitAxis=function(m,b,x){var E=m.leaf?this.compareMinX:A,B=m.leaf?this.compareMinY:c;this._allDistMargin(m,b,x,E)<this._allDistMargin(m,b,x,B)&&m.children.sort(E)},r.prototype._allDistMargin=function(m,b,x,E){m.children.sort(E);for(var B=this.toBBox,P=l(m,0,b,B),I=l(m,x-b,x,B),O=d(P)+d(I),M=b;M<x-b;M++){var S=m.children[M];u(P,m.leaf?B(S):S),O+=d(P)}for(var T=x-b-1;T>=b;T--){var w=m.children[T];u(I,m.leaf?B(w):w),O+=d(I)}return O},r.prototype._adjustParentBBoxes=function(m,b,x){for(var E=x;E>=0;E--)u(b[E],m)},r.prototype._condense=function(m){for(var b=m.length-1,x=void 0;b>=0;b--)m[b].children.length===0?b>0?(x=m[b-1].children).splice(x.indexOf(m[b]),1):this.clear():s(m[b],this.toBBox)},r})})(sf)),sf.exports}var Ig={},I_;function F_(){return I_||(I_=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=63710088e-1,t.factors={centimeters:t.earthRadius*100,centimetres:t.earthRadius*100,degrees:t.earthRadius/111325,feet:t.earthRadius*3.28084,inches:t.earthRadius*39.37,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:t.earthRadius*1e3,millimetres:t.earthRadius*1e3,nauticalmiles:t.earthRadius/1852,radians:1,yards:t.earthRadius*1.0936},t.unitsFactors={centimeters:100,centimetres:100,degrees:8982708286548395e-21,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:.0006213711922373339,millimeters:1e3,millimetres:1e3,nauticalmiles:.0005399568034557236,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function n(S,T,w){w===void 0&&(w={});var C={type:"Feature"};return(w.id===0||w.id)&&(C.id=w.id),w.bbox&&(C.bbox=w.bbox),C.properties=T||{},C.geometry=S,C}t.feature=n;function e(S,T,w){switch(S){case"Point":return i(T).geometry;case"LineString":return s(T).geometry;case"Polygon":return r(T).geometry;case"MultiPoint":return c(T).geometry;case"MultiLineString":return A(T).geometry;case"MultiPolygon":return f(T).geometry;default:throw new Error(S+" is invalid")}}t.geometry=e;function i(S,T,w){if(w===void 0&&(w={}),!S)throw new Error("coordinates is required");if(!Array.isArray(S))throw new Error("coordinates must be an Array");if(S.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!P(S[0])||!P(S[1]))throw new Error("coordinates must contain numbers");var C={type:"Point",coordinates:S};return n(C,T,w)}t.point=i;function o(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return i(C,T)}),w)}t.points=o;function r(S,T,w){w===void 0&&(w={});for(var C=0,U=S;C<U.length;C++){var F=U[C];if(F.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var D=0;D<F[F.length-1].length;D++)if(F[F.length-1][D]!==F[0][D])throw new Error("First and last Position are not equivalent.")}var R={type:"Polygon",coordinates:S};return n(R,T,w)}t.polygon=r;function a(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return r(C,T)}),w)}t.polygons=a;function s(S,T,w){if(w===void 0&&(w={}),S.length<2)throw new Error("coordinates must be an array of two or more positions");var C={type:"LineString",coordinates:S};return n(C,T,w)}t.lineString=s;function l(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return s(C,T)}),w)}t.lineStrings=l;function u(S,T){T===void 0&&(T={});var w={type:"FeatureCollection"};return T.id&&(w.id=T.id),T.bbox&&(w.bbox=T.bbox),w.features=S,w}t.featureCollection=u;function A(S,T,w){w===void 0&&(w={});var C={type:"MultiLineString",coordinates:S};return n(C,T,w)}t.multiLineString=A;function c(S,T,w){w===void 0&&(w={});var C={type:"MultiPoint",coordinates:S};return n(C,T,w)}t.multiPoint=c;function f(S,T,w){w===void 0&&(w={});var C={type:"MultiPolygon",coordinates:S};return n(C,T,w)}t.multiPolygon=f;function d(S,T,w){w===void 0&&(w={});var C={type:"GeometryCollection",geometries:S};return n(C,T,w)}t.geometryCollection=d;function p(S,T){if(T===void 0&&(T=0),T&&!(T>=0))throw new Error("precision must be a positive number");var w=Math.pow(10,T||0);return Math.round(S*w)/w}t.round=p;function g(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S*w}t.radiansToLength=g;function v(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S/w}t.lengthToRadians=v;function y(S,T){return b(v(S,T))}t.lengthToDegrees=y;function m(S){var T=S%360;return T<0&&(T+=360),T}t.bearingToAzimuth=m;function b(S){var T=S%(2*Math.PI);return T*180/Math.PI}t.radiansToDegrees=b;function x(S){var T=S%360;return T*Math.PI/180}t.degreesToRadians=x;function E(S,T,w){if(T===void 0&&(T="kilometers"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("length must be a positive number");return g(v(S,T),w)}t.convertLength=E;function B(S,T,w){if(T===void 0&&(T="meters"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("area must be a positive number");var C=t.areaFactors[T];if(!C)throw new Error("invalid original units");var U=t.areaFactors[w];if(!U)throw new Error("invalid final units");return S/C*U}t.convertArea=B;function P(S){return!isNaN(S)&&S!==null&&!Array.isArray(S)}t.isNumber=P;function I(S){return!!S&&S.constructor===Object}t.isObject=I;function O(S){if(!S)throw new Error("bbox is required");if(!Array.isArray(S))throw new Error("bbox must be an Array");if(S.length!==4&&S.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");S.forEach(function(T){if(!P(T))throw new Error("bbox must only contain numbers")})}t.validateBBox=O;function M(S){if(!S)throw new Error("id is required");if(["string","number"].indexOf(typeof S)===-1)throw new Error("id must be a number or a string")}t.validateId=M})(Ig)),Ig}var Tt={},M_;function D_(){if(M_)return Tt;M_=1,Object.defineProperty(Tt,"__esModule",{value:!0});var t=F_();function n(m,b,x){if(m!==null)for(var E,B,P,I,O,M,S,T=0,w=0,C,U=m.type,F=U==="FeatureCollection",D=U==="Feature",R=F?m.features.length:1,L=0;L<R;L++){S=F?m.features[L].geometry:D?m.geometry:m,C=S?S.type==="GeometryCollection":!1,O=C?S.geometries.length:1;for(var k=0;k<O;k++){var Q=0,V=0;if(I=C?S.geometries[k]:S,I!==null){M=I.coordinates;var G=I.type;switch(T=x&&(G==="Polygon"||G==="MultiPolygon")?1:0,G){case null:break;case"Point":if(b(M,w,L,Q,V)===!1)return!1;w++,Q++;break;case"LineString":case"MultiPoint":for(E=0;E<M.length;E++){if(b(M[E],w,L,Q,V)===!1)return!1;w++,G==="MultiPoint"&&Q++}G==="LineString"&&Q++;break;case"Polygon":case"MultiLineString":for(E=0;E<M.length;E++){for(B=0;B<M[E].length-T;B++){if(b(M[E][B],w,L,Q,V)===!1)return!1;w++}G==="MultiLineString"&&Q++,G==="Polygon"&&V++}G==="Polygon"&&Q++;break;case"MultiPolygon":for(E=0;E<M.length;E++){for(V=0,B=0;B<M[E].length;B++){for(P=0;P<M[E][B].length-T;P++){if(b(M[E][B][P],w,L,Q,V)===!1)return!1;w++}V++}Q++}break;case"GeometryCollection":for(E=0;E<I.geometries.length;E++)if(n(I.geometries[E],b,x)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(m,b,x,E){var B=x;return n(m,function(P,I,O,M,S){I===0&&x===void 0?B=P:B=b(B,P,I,O,M,S)},E),B}function i(m,b){var x;switch(m.type){case"FeatureCollection":for(x=0;x<m.features.length&&b(m.features[x].properties,x)!==!1;x++);break;case"Feature":b(m.properties,0);break}}function o(m,b,x){var E=x;return i(m,function(B,P){P===0&&x===void 0?E=B:E=b(E,B,P)}),E}function r(m,b){if(m.type==="Feature")b(m,0);else if(m.type==="FeatureCollection")for(var x=0;x<m.features.length&&b(m.features[x],x)!==!1;x++);}function a(m,b,x){var E=x;return r(m,function(B,P){P===0&&x===void 0?E=B:E=b(E,B,P)}),E}function s(m){var b=[];return n(m,function(x){b.push(x)}),b}function l(m,b){var x,E,B,P,I,O,M,S,T,w,C=0,U=m.type==="FeatureCollection",F=m.type==="Feature",D=U?m.features.length:1;for(x=0;x<D;x++){for(O=U?m.features[x].geometry:F?m.geometry:m,S=U?m.features[x].properties:F?m.properties:{},T=U?m.features[x].bbox:F?m.bbox:void 0,w=U?m.features[x].id:F?m.id:void 0,M=O?O.type==="GeometryCollection":!1,I=M?O.geometries.length:1,B=0;B<I;B++){if(P=M?O.geometries[B]:O,P===null){if(b(null,C,S,T,w)===!1)return!1;continue}switch(P.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(b(P,C,S,T,w)===!1)return!1;break}case"GeometryCollection":{for(E=0;E<P.geometries.length;E++)if(b(P.geometries[E],C,S,T,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}C++}}function u(m,b,x){var E=x;return l(m,function(B,P,I,O,M){P===0&&x===void 0?E=B:E=b(E,B,P,I,O,M)}),E}function A(m,b){l(m,function(x,E,B,P,I){var O=x===null?null:x.type;switch(O){case null:case"Point":case"LineString":case"Polygon":return b(t.feature(x,B,{bbox:P,id:I}),E,0)===!1?!1:void 0}var M;switch(O){case"MultiPoint":M="Point";break;case"MultiLineString":M="LineString";break;case"MultiPolygon":M="Polygon";break}for(var S=0;S<x.coordinates.length;S++){var T=x.coordinates[S],w={type:M,coordinates:T};if(b(t.feature(w,B),E,S)===!1)return!1}})}function c(m,b,x){var E=x;return A(m,function(B,P,I){P===0&&I===0&&x===void 0?E=B:E=b(E,B,P,I)}),E}function f(m,b){A(m,function(x,E,B){var P=0;if(x.geometry){var I=x.geometry.type;if(!(I==="Point"||I==="MultiPoint")){var O,M=0,S=0,T=0;if(n(x,function(w,C,U,F,D){if(O===void 0||E>M||F>S||D>T){O=w,M=E,S=F,T=D,P=0;return}var R=t.lineString([O,w],x.properties);if(b(R,E,B,D,P)===!1)return!1;P++,O=w})===!1)return!1}}})}function d(m,b,x){var E=x,B=!1;return f(m,function(P,I,O,M,S){B===!1&&x===void 0?E=P:E=b(E,P,I,O,M,S),B=!0}),E}function p(m,b){if(!m)throw new Error("geojson is required");A(m,function(x,E,B){if(x.geometry!==null){var P=x.geometry.type,I=x.geometry.coordinates;switch(P){case"LineString":if(b(x,E,B,0,0)===!1)return!1;break;case"Polygon":for(var O=0;O<I.length;O++)if(b(t.lineString(I[O],x.properties),E,B,O)===!1)return!1;break}}})}function g(m,b,x){var E=x;return p(m,function(B,P,I,O){P===0&&x===void 0?E=B:E=b(E,B,P,I,O)}),E}function v(m,b){if(b=b||{},!t.isObject(b))throw new Error("options is invalid");var x=b.featureIndex||0,E=b.multiFeatureIndex||0,B=b.geometryIndex||0,P=b.segmentIndex||0,I=b.properties,O;switch(m.type){case"FeatureCollection":x<0&&(x=m.features.length+x),I=I||m.features[x].properties,O=m.features[x].geometry;break;case"Feature":I=I||m.properties,O=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":O=m;break;default:throw new Error("geojson is invalid")}if(O===null)return null;var M=O.coordinates;switch(O.type){case"Point":case"MultiPoint":return null;case"LineString":return P<0&&(P=M.length+P-1),t.lineString([M[P],M[P+1]],I,b);case"Polygon":return B<0&&(B=M.length+B),P<0&&(P=M[B].length+P-1),t.lineString([M[B][P],M[B][P+1]],I,b);case"MultiLineString":return E<0&&(E=M.length+E),P<0&&(P=M[E].length+P-1),t.lineString([M[E][P],M[E][P+1]],I,b);case"MultiPolygon":return E<0&&(E=M.length+E),B<0&&(B=M[E].length+B),P<0&&(P=M[E][B].length-P-1),t.lineString([M[E][B][P],M[E][B][P+1]],I,b)}throw new Error("geojson is invalid")}function y(m,b){if(b=b||{},!t.isObject(b))throw new Error("options is invalid");var x=b.featureIndex||0,E=b.multiFeatureIndex||0,B=b.geometryIndex||0,P=b.coordIndex||0,I=b.properties,O;switch(m.type){case"FeatureCollection":x<0&&(x=m.features.length+x),I=I||m.features[x].properties,O=m.features[x].geometry;break;case"Feature":I=I||m.properties,O=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":O=m;break;default:throw new Error("geojson is invalid")}if(O===null)return null;var M=O.coordinates;switch(O.type){case"Point":return t.point(M,I,b);case"MultiPoint":return E<0&&(E=M.length+E),t.point(M[E],I,b);case"LineString":return P<0&&(P=M.length+P),t.point(M[P],I,b);case"Polygon":return B<0&&(B=M.length+B),P<0&&(P=M[B].length+P),t.point(M[B][P],I,b);case"MultiLineString":return E<0&&(E=M.length+E),P<0&&(P=M[E].length+P),t.point(M[E][P],I,b);case"MultiPolygon":return E<0&&(E=M.length+E),B<0&&(B=M[E].length+B),P<0&&(P=M[E][B].length-P),t.point(M[E][B][P],I,b)}throw new Error("geojson is invalid")}return Tt.coordAll=s,Tt.coordEach=n,Tt.coordReduce=e,Tt.featureEach=r,Tt.featureReduce=a,Tt.findPoint=y,Tt.findSegment=v,Tt.flattenEach=A,Tt.flattenReduce=c,Tt.geomEach=l,Tt.geomReduce=u,Tt.lineEach=p,Tt.lineReduce=g,Tt.propEach=i,Tt.propReduce=o,Tt.segmentEach=f,Tt.segmentReduce=d,Tt}var af={},R_;function wz(){if(R_)return af;R_=1,Object.defineProperty(af,"__esModule",{value:!0});var t=D_();function n(e){var i=[1/0,1/0,-1/0,-1/0];return t.coordEach(e,function(o){i[0]>o[0]&&(i[0]=o[0]),i[1]>o[1]&&(i[1]=o[1]),i[2]<o[0]&&(i[2]=o[0]),i[3]<o[1]&&(i[3]=o[1])}),i}return n.default=n,af.default=n,af}var U_;function bz(){if(U_)return of.exports;U_=1;var t=vz(),n=F_(),e=D_(),i=wz().default,o=e.featureEach;e.coordEach,n.polygon;var r=n.featureCollection;function a(s){var l=new t(s);return l.insert=function(u){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:i(u),t.prototype.insert.call(this,u)},l.load=function(u){var A=[];return Array.isArray(u)?u.forEach(function(c){if(c.type!=="Feature")throw new Error("invalid features");c.bbox=c.bbox?c.bbox:i(c),A.push(c)}):o(u,function(c){if(c.type!=="Feature")throw new Error("invalid features");c.bbox=c.bbox?c.bbox:i(c),A.push(c)}),t.prototype.load.call(this,A)},l.remove=function(u,A){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:i(u),t.prototype.remove.call(this,u,A)},l.clear=function(){return t.prototype.clear.call(this)},l.search=function(u){var A=t.prototype.search.call(this,this.toBBox(u));return r(A)},l.collides=function(u){return t.prototype.collides.call(this,this.toBBox(u))},l.all=function(){var u=t.prototype.all.call(this);return r(u)},l.toJSON=function(){return t.prototype.toJSON.call(this)},l.fromJSON=function(u){return t.prototype.fromJSON.call(this,u)},l.toBBox=function(u){var A;if(u.bbox)A=u.bbox;else if(Array.isArray(u)&&u.length===4)A=u;else if(Array.isArray(u)&&u.length===6)A=[u[0],u[1],u[3],u[4]];else if(u.type==="Feature")A=i(u);else if(u.type==="FeatureCollection")A=i(u);else throw new Error("invalid geojson");return{minX:A[0],minY:A[1],maxX:A[2],maxY:A[3]}},l}return of.exports=a,of.exports.default=a,of.exports}var xz=bz();const _z=Al(xz);function Fg(t,n){var e={},i=[];if(t.type==="LineString"&&(t=Ci(t)),n.type==="LineString"&&(n=Ci(n)),t.type==="Feature"&&n.type==="Feature"&&t.geometry!==null&&n.geometry!==null&&t.geometry.type==="LineString"&&n.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&n.geometry.coordinates.length===2){var o=O_(t,n);return o&&i.push(o),Si(i)}var r=_z();return r.load(B_(n)),nf(B_(t),function(a){nf(r.search(a),function(s){var l=O_(a,s);if(l){var u=Ei(l).join(",");e[u]||(e[u]=!0,i.push(l))}})}),Si(i)}function O_(t,n){var e=Ei(t),i=Ei(n);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],r=e[0][1],a=e[1][0],s=e[1][1],l=i[0][0],u=i[0][1],A=i[1][0],c=i[1][1],f=(c-u)*(a-o)-(A-l)*(s-r),d=(A-l)*(r-u)-(c-u)*(o-l),p=(a-o)*(r-u)-(s-r)*(o-l);if(f===0)return null;var g=d/f,v=p/f;if(g>=0&&g<=1&&v>=0&&v<=1){var y=o+g*(a-o),m=r+g*(s-r);return Gr([y,m])}return null}function lf(t,n,e){e===void 0&&(e={});for(var i=ef(t),o=Ei(n),r=0;r<o.length-1;r++){var a=!1;if(e.ignoreEndVertices&&(r===0&&(a="start"),r===o.length-2&&(a="end"),r===0&&r+1===o.length-1&&(a="both")),Cz(o[r],o[r+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function Cz(t,n,e,i,o){var r=e[0],a=e[1],s=t[0],l=t[1],u=n[0],A=n[1],c=e[0]-s,f=e[1]-l,d=u-s,p=A-l,g=c*p-f*d;if(o!==null){if(Math.abs(g)>o)return!1}else if(g!==0)return!1;if(i){if(i==="start")return Math.abs(d)>=Math.abs(p)?d>0?s<r&&r<=u:u<=r&&r<s:p>0?l<a&&a<=A:A<=a&&a<l;if(i==="end")return Math.abs(d)>=Math.abs(p)?d>0?s<=r&&r<u:u<r&&r<=s:p>0?l<=a&&a<A:A<a&&a<=l;if(i==="both")return Math.abs(d)>=Math.abs(p)?d>0?s<r&&r<u:u<r&&r<s:p>0?l<a&&a<A:A<a&&a<l}else return Math.abs(d)>=Math.abs(p)?d>0?s<=r&&r<=u:u<=r&&r<=s:p>0?l<=a&&a<=A:A<=a&&a<=l;return!1}function Sz(t,n){var e=Pi(t),i=Pi(n),o=e.type,r=i.type;switch(o){case"Point":switch(r){case"MultiPoint":return Ez(e,i);case"LineString":return lf(e,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return sn(e,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return Pz(e,i);case"LineString":return Bz(e,i);case"Polygon":case"MultiPolygon":return Tz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return Iz(e,i);case"Polygon":case"MultiPolygon":return Fz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Polygon":case"MultiPolygon":return Mz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function Ez(t,n){var e,i=!1;for(e=0;e<n.coordinates.length;e++)if(z_(n.coordinates[e],t.coordinates)){i=!0;break}return i}function Pz(t,n){for(var e=0;e<t.coordinates.length;e++){for(var i=!1,o=0;o<n.coordinates.length;o++)z_(t.coordinates[e],n.coordinates[o])&&(i=!0);if(!i)return!1}return!0}function Bz(t,n){for(var e=!1,i=0;i<t.coordinates.length;i++){if(!lf(t.coordinates[i],n))return!1;e||(e=lf(t.coordinates[i],n,{ignoreEndVertices:!0}))}return e}function Tz(t,n){for(var e=!0,i=!1,o=0;o<t.coordinates.length;o++){if(i=sn(t.coordinates[1],n),!i){e=!1;break}i=sn(t.coordinates[1],n,{ignoreBoundary:!0})}return e&&i}function Iz(t,n){for(var e=0;e<t.coordinates.length;e++)if(!lf(t.coordinates[e],n))return!1;return!0}function Fz(t,n){var e=Ho(n),i=Ho(t);if(!L_(e,i))return!1;for(var o=!1,r=0;r<t.coordinates.length-1;r++){if(!sn(t.coordinates[r],n))return!1;if(o||(o=sn(t.coordinates[r],n,{ignoreBoundary:!0})),!o){var a=Dz(t.coordinates[r],t.coordinates[r+1]);o=sn(a,n,{ignoreBoundary:!0})}}return o}function Mz(t,n){var e=Ho(t),i=Ho(n);if(!L_(i,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!sn(t.coordinates[0][o],n))return!1;return!0}function L_(t,n){return!(t[0]>n[0]||t[2]<n[2]||t[1]>n[1]||t[3]<n[3])}function z_(t,n){return t[0]===n[0]&&t[1]===n[1]}function Dz(t,n){return[(t[0]+n[0])/2,(t[1]+n[1])/2]}function k_(t,n,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var i=[],o=t[0],r=t[1],a=t[2],s=t[3],l=n/Bi([o,r],[a,r],e),u=l*(a-o),A=n/Bi([o,r],[o,s],e),c=A*(s-r),f=a-o,d=s-r,p=Math.floor(f/u),g=Math.floor(d/c),v=(f-p*u)/2,y=(d-g*c)/2,m=o+v;m<=a;){for(var b=r+y;b<=s;){var x=Gr([m,b],e.properties);e.mask?Sz(x,e.mask)&&i.push(x):i.push(x),b+=c}m+=u}return Si(i)}function Mg(t,n){n===void 0&&(n={});var e=Pi(t);switch(!n.properties&&t.type==="Feature"&&(n.properties=t.properties),e.type){case"Polygon":return Rz(e,n);case"MultiPolygon":return Uz(e,n);default:throw new Error("invalid poly")}}function Rz(t,n){n===void 0&&(n={});var e=Pi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{};return Q_(i,o)}function Uz(t,n){n===void 0&&(n={});var e=Pi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{},r=[];return i.forEach(function(a){r.push(Q_(a,o))}),Si(r)}function Q_(t,n){return t.length>1?BL(t,n):YA(t[0],n)}var Dg,V_;function N_(){if(V_)return Dg;V_=1;var t=Object.prototype.toString;return Dg=function(e){var i=t.call(e),o=i==="[object Arguments]";return o||(o=i!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&t.call(e.callee)==="[object Function]"),o},Dg}var Rg,H_;function Oz(){if(H_)return Rg;H_=1;var t;if(!Object.keys){var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=N_(),o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),a=o.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var d=f.constructor;return d&&d.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},A=(function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&n.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1})(),c=function(f){if(typeof window>"u"||!A)return l(f);try{return l(f)}catch{return!1}};t=function(d){var p=d!==null&&typeof d=="object",g=e.call(d)==="[object Function]",v=i(d),y=p&&e.call(d)==="[object String]",m=[];if(!p&&!g&&!v)throw new TypeError("Object.keys called on a non-object");var b=a&&g;if(y&&d.length>0&&!n.call(d,0))for(var x=0;x<d.length;++x)m.push(String(x));if(v&&d.length>0)for(var E=0;E<d.length;++E)m.push(String(E));else for(var B in d)!(b&&B==="prototype")&&n.call(d,B)&&m.push(String(B));if(r)for(var P=c(d),I=0;I<s.length;++I)!(P&&s[I]==="constructor")&&n.call(d,s[I])&&m.push(s[I]);return m}}return Rg=t,Rg}var Ug,G_;function W_(){if(G_)return Ug;G_=1;var t=Array.prototype.slice,n=N_(),e=Object.keys,i=e?function(a){return e(a)}:Oz(),o=Object.keys;return i.shim=function(){if(Object.keys){var a=(function(){var s=Object.keys(arguments);return s&&s.length===arguments.length})(1,2);a||(Object.keys=function(l){return n(l)?o(t.call(l)):o(l)})}else Object.keys=i;return Object.keys||i},Ug=i,Ug}var Og,j_;function q_(){return j_||(j_=1,Og=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var o=42;n[e]=o;for(var r in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var a=Object.getOwnPropertySymbols(n);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(n,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(n,e);if(s.value!==o||s.enumerable!==!0)return!1}return!0}),Og}var Lg,K_;function zg(){if(K_)return Lg;K_=1;var t=q_();return Lg=function(){return t()&&!!Symbol.toStringTag},Lg}var kg,Z_;function X_(){return Z_||(Z_=1,kg=Object),kg}var Qg,$_;function Y_(){return $_||($_=1,Qg=Error),Qg}var Vg,J_;function Lz(){return J_||(J_=1,Vg=EvalError),Vg}var Ng,eC;function zz(){return eC||(eC=1,Ng=RangeError),Ng}var Hg,tC;function kz(){return tC||(tC=1,Hg=ReferenceError),Hg}var Gg,nC;function iC(){return nC||(nC=1,Gg=SyntaxError),Gg}var Wg,rC;function Aa(){return rC||(rC=1,Wg=TypeError),Wg}var jg,oC;function Qz(){return oC||(oC=1,jg=URIError),jg}var qg,sC;function Vz(){return sC||(sC=1,qg=Math.abs),qg}var Kg,aC;function Nz(){return aC||(aC=1,Kg=Math.floor),Kg}var Zg,lC;function Hz(){return lC||(lC=1,Zg=Math.max),Zg}var Xg,uC;function Gz(){return uC||(uC=1,Xg=Math.min),Xg}var $g,cC;function Wz(){return cC||(cC=1,$g=Math.pow),$g}var Yg,hC;function jz(){return hC||(hC=1,Yg=Math.round),Yg}var Jg,AC;function qz(){return AC||(AC=1,Jg=Number.isNaN||function(n){return n!==n}),Jg}var ey,fC;function Kz(){if(fC)return ey;fC=1;var t=qz();return ey=function(e){return t(e)||e===0?e:e<0?-1:1},ey}var ty,pC;function Zz(){return pC||(pC=1,ty=Object.getOwnPropertyDescriptor),ty}var ny,dC;function fa(){if(dC)return ny;dC=1;var t=Zz();if(t)try{t([],"length")}catch{t=null}return ny=t,ny}var iy,mC;function uf(){if(mC)return iy;mC=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return iy=t,iy}var ry,gC;function Xz(){if(gC)return ry;gC=1;var t=typeof Symbol<"u"&&Symbol,n=q_();return ry=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()},ry}var oy,yC;function vC(){return yC||(yC=1,oy=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),oy}var sy,wC;function bC(){if(wC)return sy;wC=1;var t=X_();return sy=t.getPrototypeOf||null,sy}var ay,xC;function $z(){if(xC)return ay;xC=1;var t="Function.prototype.bind called on incompatible ",n=Object.prototype.toString,e=Math.max,i="[object Function]",o=function(l,u){for(var A=[],c=0;c<l.length;c+=1)A[c]=l[c];for(var f=0;f<u.length;f+=1)A[f+l.length]=u[f];return A},r=function(l,u){for(var A=[],c=u,f=0;c<l.length;c+=1,f+=1)A[f]=l[c];return A},a=function(s,l){for(var u="",A=0;A<s.length;A+=1)u+=s[A],A+1<s.length&&(u+=l);return u};return ay=function(l){var u=this;if(typeof u!="function"||n.apply(u)!==i)throw new TypeError(t+u);for(var A=r(arguments,1),c,f=function(){if(this instanceof c){var y=u.apply(this,o(A,arguments));return Object(y)===y?y:this}return u.apply(l,o(A,arguments))},d=e(0,u.length-A.length),p=[],g=0;g<d;g++)p[g]="$"+g;if(c=Function("binder","return function ("+a(p,",")+"){ return binder.apply(this,arguments); }")(f),u.prototype){var v=function(){};v.prototype=u.prototype,c.prototype=new v,v.prototype=null}return c},ay}var ly,_C;function Ql(){if(_C)return ly;_C=1;var t=$z();return ly=Function.prototype.bind||t,ly}var uy,CC;function cy(){return CC||(CC=1,uy=Function.prototype.call),uy}var hy,SC;function Ay(){return SC||(SC=1,hy=Function.prototype.apply),hy}var fy,EC;function Yz(){return EC||(EC=1,fy=typeof Reflect<"u"&&Reflect&&Reflect.apply),fy}var py,PC;function BC(){if(PC)return py;PC=1;var t=Ql(),n=Ay(),e=cy(),i=Yz();return py=i||t.call(e,n),py}var dy,TC;function my(){if(TC)return dy;TC=1;var t=Ql(),n=Aa(),e=cy(),i=BC();return dy=function(r){if(r.length<1||typeof r[0]!="function")throw new n("a function is required");return i(t,e,r)},dy}var gy,IC;function Jz(){if(IC)return gy;IC=1;var t=my(),n=fa(),e;try{e=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var i=!!e&&n&&n(Object.prototype,"__proto__"),o=Object,r=o.getPrototypeOf;return gy=i&&typeof i.get=="function"?t([i.get]):typeof r=="function"?function(s){return r(s==null?s:o(s))}:!1,gy}var yy,FC;function MC(){if(FC)return yy;FC=1;var t=vC(),n=bC(),e=Jz();return yy=t?function(o){return t(o)}:n?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return n(o)}:e?function(o){return e(o)}:null,yy}var vy,DC;function RC(){if(DC)return vy;DC=1;var t=Function.prototype.call,n=Object.prototype.hasOwnProperty,e=Ql();return vy=e.call(t,n),vy}var wy,UC;function OC(){if(UC)return wy;UC=1;var t,n=X_(),e=Y_(),i=Lz(),o=zz(),r=kz(),a=iC(),s=Aa(),l=Qz(),u=Vz(),A=Nz(),c=Hz(),f=Gz(),d=Wz(),p=jz(),g=Kz(),v=Function,y=function(ue){try{return v('"use strict"; return ('+ue+").constructor;")()}catch{}},m=fa(),b=uf(),x=function(){throw new s},E=m?(function(){try{return arguments.callee,x}catch{try{return m(arguments,"callee").get}catch{return x}}})():x,B=Xz()(),P=MC(),I=bC(),O=vC(),M=Ay(),S=cy(),T={},w=typeof Uint8Array>"u"||!P?t:P(Uint8Array),C={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":B&&P?P([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":i,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":T,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":B&&P?P(P([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!B||!P?t:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":m,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":o,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!B||!P?t:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":B&&P?P(""[Symbol.iterator]()):t,"%Symbol%":B?Symbol:t,"%SyntaxError%":a,"%ThrowTypeError%":E,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":S,"%Function.prototype.apply%":M,"%Object.defineProperty%":b,"%Object.getPrototypeOf%":I,"%Math.abs%":u,"%Math.floor%":A,"%Math.max%":c,"%Math.min%":f,"%Math.pow%":d,"%Math.round%":p,"%Math.sign%":g,"%Reflect.getPrototypeOf%":O};if(P)try{null.error}catch(ue){var U=P(P(ue));C["%Error.prototype%"]=U}var F=function ue(te){var ce;if(te==="%AsyncFunction%")ce=y("async function () {}");else if(te==="%GeneratorFunction%")ce=y("function* () {}");else if(te==="%AsyncGeneratorFunction%")ce=y("async function* () {}");else if(te==="%AsyncGenerator%"){var X=ue("%AsyncGeneratorFunction%");X&&(ce=X.prototype)}else if(te==="%AsyncIteratorPrototype%"){var q=ue("%AsyncGenerator%");q&&P&&(ce=P(q.prototype))}return C[te]=ce,ce},D={__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"]},R=Ql(),L=RC(),k=R.call(S,Array.prototype.concat),Q=R.call(M,Array.prototype.splice),V=R.call(S,String.prototype.replace),G=R.call(S,String.prototype.slice),$=R.call(S,RegExp.prototype.exec),Y=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ie=/\\(\\)?/g,re=function(te){var ce=G(te,0,1),X=G(te,-1);if(ce==="%"&&X!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(X==="%"&&ce!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var q=[];return V(te,Y,function(H,Z,K,j){q[q.length]=K?V(j,ie,"$1"):Z||H}),q},le=function(te,ce){var X=te,q;if(L(D,X)&&(q=D[X],X="%"+q[0]+"%"),L(C,X)){var H=C[X];if(H===T&&(H=F(X)),typeof H>"u"&&!ce)throw new s("intrinsic "+te+" exists, but is not available. Please file an issue!");return{alias:q,name:X,value:H}}throw new a("intrinsic "+te+" does not exist!")};return wy=function(te,ce){if(typeof te!="string"||te.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ce!="boolean")throw new s('"allowMissing" argument must be a boolean');if($(/^%?[^%]*%?$/,te)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var X=re(te),q=X.length>0?X[0]:"",H=le("%"+q+"%",ce),Z=H.name,K=H.value,j=!1,W=H.alias;W&&(q=W[0],Q(X,k([0,1],W)));for(var J=1,ee=!0;J<X.length;J+=1){var se=X[J],Ae=G(se,0,1),fe=G(se,-1);if((Ae==='"'||Ae==="'"||Ae==="`"||fe==='"'||fe==="'"||fe==="`")&&Ae!==fe)throw new a("property names with quotes must have matching quotes");if((se==="constructor"||!ee)&&(j=!0),q+="."+se,Z="%"+q+"%",L(C,Z))K=C[Z];else if(K!=null){if(!(se in K)){if(!ce)throw new s("base intrinsic for "+te+" exists, but the property is not available.");return}if(m&&J+1>=X.length){var de=m(K,se);ee=!!de,ee&&"get"in de&&!("originalValue"in de.get)?K=de.get:K=K[se]}else ee=L(K,se),K=K[se];ee&&!j&&(C[Z]=K)}}return K},wy}var by,LC;function xy(){if(LC)return by;LC=1;var t=OC(),n=my(),e=n([t("%String.prototype.indexOf%")]);return by=function(o,r){var a=t(o,!!r);return typeof a=="function"&&e(o,".prototype.")>-1?n([a]):a},by}var _y,zC;function e6(){if(zC)return _y;zC=1;var t=zg()(),n=xy(),e=n("Object.prototype.toString"),i=function(s){return t&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:e(s)==="[object Arguments]"},o=function(s){return i(s)?!0:s!==null&&typeof s=="object"&&"length"in s&&typeof s.length=="number"&&s.length>=0&&e(s)!=="[object Array]"&&"callee"in s&&e(s.callee)==="[object Function]"},r=(function(){return i(arguments)})();return i.isLegacyArguments=o,_y=r?i:o,_y}var Cy,kC;function Sy(){if(kC)return Cy;kC=1;var t=uf(),n=iC(),e=Aa(),i=fa();return Cy=function(r,a,s){if(!r||typeof r!="object"&&typeof r!="function")throw new e("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new e("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new e("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new e("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new e("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new e("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,A=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,f=!!i&&i(r,a);if(t)t(r,a,{configurable:A===null&&f?f.configurable:!A,enumerable:l===null&&f?f.enumerable:!l,value:s,writable:u===null&&f?f.writable:!u});else if(c||!l&&!u&&!A)r[a]=s;else throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Cy}var Ey,QC;function Py(){if(QC)return Ey;QC=1;var t=uf(),n=function(){return!!t};return n.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Ey=n,Ey}var By,VC;function Vl(){if(VC)return By;VC=1;var t=W_(),n=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",e=Object.prototype.toString,i=Array.prototype.concat,o=Sy(),r=function(u){return typeof u=="function"&&e.call(u)==="[object Function]"},a=Py()(),s=function(u,A,c,f){if(A in u){if(f===!0){if(u[A]===c)return}else if(!r(f)||!f())return}a?o(u,A,c,!0):o(u,A,c)},l=function(u,A){var c=arguments.length>2?arguments[2]:{},f=t(A);n&&(f=i.call(f,Object.getOwnPropertySymbols(A)));for(var d=0;d<f.length;d+=1)s(u,f[d],A[f[d]],c[f[d]])};return l.supportsDescriptors=!!a,By=l,By}var Ty={exports:{}},Iy,NC;function t6(){if(NC)return Iy;NC=1;var t=OC(),n=Sy(),e=Py()(),i=fa(),o=Aa(),r=t("%Math.floor%");return Iy=function(s,l){if(typeof s!="function")throw new o("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||r(l)!==l)throw new o("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],A=!0,c=!0;if("length"in s&&i){var f=i(s,"length");f&&!f.configurable&&(A=!1),f&&!f.writable&&(c=!1)}return(A||c||!u)&&(e?n(s,"length",l,!0,!0):n(s,"length",l)),s},Iy}var Fy,HC;function n6(){if(HC)return Fy;HC=1;var t=Ql(),n=Ay(),e=BC();return Fy=function(){return e(t,n,arguments)},Fy}var GC;function WC(){return GC||(GC=1,(function(t){var n=t6(),e=uf(),i=my(),o=n6();t.exports=function(a){var s=i(arguments),l=a.length-(arguments.length-1);return n(s,1+(l>0?l:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(Ty)),Ty.exports}var My,jC;function qC(){if(jC)return My;jC=1;var t=function(n){return n!==n};return My=function(e,i){return e===0&&i===0?1/e===1/i:!!(e===i||t(e)&&t(i))},My}var Dy,KC;function ZC(){if(KC)return Dy;KC=1;var t=qC();return Dy=function(){return typeof Object.is=="function"?Object.is:t},Dy}var Ry,XC;function i6(){if(XC)return Ry;XC=1;var t=ZC(),n=Vl();return Ry=function(){var i=t();return n(Object,{is:i},{is:function(){return Object.is!==i}}),i},Ry}var Uy,$C;function r6(){if($C)return Uy;$C=1;var t=Vl(),n=WC(),e=qC(),i=ZC(),o=i6(),r=n(i(),Object);return t(r,{getPolyfill:i,implementation:e,shim:o}),Uy=r,Uy}var Oy,YC;function o6(){if(YC)return Oy;YC=1;var t=xy(),n=zg()(),e=RC(),i=fa(),o;if(n){var r=t("RegExp.prototype.exec"),a={},s=function(){throw a},l={toString:s,valueOf:s};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=s),o=function(f){if(!f||typeof f!="object")return!1;var d=i(f,"lastIndex"),p=d&&e(d,"value");if(!p)return!1;try{r(f,l)}catch(g){return g===a}}}else{var u=t("Object.prototype.toString"),A="[object RegExp]";o=function(f){return!f||typeof f!="object"&&typeof f!="function"?!1:u(f)===A}}return Oy=o,Oy}var Ly,JC;function s6(){if(JC)return Ly;JC=1;var t=function(){return typeof(function(){}).name=="string"},n=Object.getOwnPropertyDescriptor;if(n)try{n([],"length")}catch{n=null}t.functionsHaveConfigurableNames=function(){if(!t()||!n)return!1;var o=n(function(){},"name");return!!o&&!!o.configurable};var e=Function.prototype.bind;return t.boundFunctionsHaveNames=function(){return t()&&typeof e=="function"&&(function(){}).bind().name!==""},Ly=t,Ly}var zy,eS;function a6(){if(eS)return zy;eS=1;var t=Sy(),n=Py()(),e=s6().functionsHaveConfigurableNames(),i=Aa();return zy=function(r,a){if(typeof r!="function")throw new i("`fn` is not a function");var s=arguments.length>2&&!!arguments[2];return(!s||e)&&(n?t(r,"name",a,!0,!0):t(r,"name",a)),r},zy}var ky,tS;function nS(){if(tS)return ky;tS=1;var t=a6(),n=Aa(),e=Object;return ky=t(function(){if(this==null||this!==e(this))throw new n("RegExp.prototype.flags getter called on non-object");var o="";return this.hasIndices&&(o+="d"),this.global&&(o+="g"),this.ignoreCase&&(o+="i"),this.multiline&&(o+="m"),this.dotAll&&(o+="s"),this.unicode&&(o+="u"),this.unicodeSets&&(o+="v"),this.sticky&&(o+="y"),o},"get flags",!0),ky}var Qy,iS;function rS(){if(iS)return Qy;iS=1;var t=nS(),n=Vl().supportsDescriptors,e=Object.getOwnPropertyDescriptor;return Qy=function(){if(n&&/a/mig.flags==="gim"){var o=e(RegExp.prototype,"flags");if(o&&typeof o.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var r="",a={};if(Object.defineProperty(a,"hasIndices",{get:function(){r+="d"}}),Object.defineProperty(a,"sticky",{get:function(){r+="y"}}),o.get.call(a),r==="dy")return o.get}}return t},Qy}var Vy,oS;function l6(){if(oS)return Vy;oS=1;var t=Vl().supportsDescriptors,n=rS(),e=fa(),i=Object.defineProperty,o=Y_(),r=MC(),a=/a/;return Vy=function(){if(!t||!r)throw new o("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var l=n(),u=r(a),A=e(u,"flags");return(!A||A.get!==l)&&i(u,"flags",{configurable:!0,enumerable:!1,get:l}),l},Vy}var Ny,sS;function u6(){if(sS)return Ny;sS=1;var t=Vl(),n=WC(),e=nS(),i=rS(),o=l6(),r=n(i());return t(r,{getPolyfill:i,implementation:e,shim:o}),Ny=r,Ny}var Hy,aS;function c6(){if(aS)return Hy;aS=1;var t=xy(),n=t("Date.prototype.getDay"),e=function(s){try{return n(s),!0}catch{return!1}},i=t("Object.prototype.toString"),o="[object Date]",r=zg()();return Hy=function(s){return typeof s!="object"||s===null?!1:r?e(s):i(s)===o},Hy}var Gy,lS;function h6(){if(lS)return Gy;lS=1;var t=W_(),n=e6(),e=r6(),i=o6(),o=u6(),r=c6(),a=Date.prototype.getTime;function s(c,f,d){var p=d||{};return(p.strict?e(c,f):c===f)?!0:!c||!f||typeof c!="object"&&typeof f!="object"?p.strict?e(c,f):c==f:A(c,f,p)}function l(c){return c==null}function u(c){return!(!c||typeof c!="object"||typeof c.length!="number"||typeof c.copy!="function"||typeof c.slice!="function"||c.length>0&&typeof c[0]!="number")}function A(c,f,d){var p,g;if(typeof c!=typeof f||l(c)||l(f)||c.prototype!==f.prototype||n(c)!==n(f))return!1;var v=i(c),y=i(f);if(v!==y)return!1;if(v||y)return c.source===f.source&&o(c)===o(f);if(r(c)&&r(f))return a.call(c)===a.call(f);var m=u(c),b=u(f);if(m!==b)return!1;if(m||b){if(c.length!==f.length)return!1;for(p=0;p<c.length;p++)if(c[p]!==f[p])return!1;return!0}if(typeof c!=typeof f)return!1;try{var x=t(c),E=t(f)}catch{return!1}if(x.length!==E.length)return!1;for(x.sort(),E.sort(),p=x.length-1;p>=0;p--)if(x[p]!=E[p])return!1;for(p=x.length-1;p>=0;p--)if(g=x[p],!s(c[g],f[g],d))return!1;return!0}return Gy=s,Gy}function A6(t,n){var e=!0;return sa(t,function(i){sa(n,function(o){if(e===!1)return!1;e=f6(i.geometry,o.geometry)})}),e}function f6(t,n){switch(t.type){case"Point":switch(n.type){case"Point":return!g6(t.coordinates,n.coordinates);case"LineString":return!uS(n,t);case"Polygon":return!sn(t,n)}break;case"LineString":switch(n.type){case"Point":return!uS(t,n);case"LineString":return!p6(t,n);case"Polygon":return!cS(n,t)}break;case"Polygon":switch(n.type){case"Point":return!sn(n,t);case"LineString":return!cS(t,n);case"Polygon":return!d6(n,t)}}return!1}function uS(t,n){for(var e=0;e<t.coordinates.length-1;e++)if(m6(t.coordinates[e],t.coordinates[e+1],n.coordinates))return!0;return!1}function p6(t,n){var e=Fg(t,n);return e.features.length>0}function cS(t,n){for(var e=0,i=n.coordinates;e<i.length;e++){var o=i[e];if(sn(o,t))return!0}var r=Fg(n,Mg(t));return r.features.length>0}function d6(t,n){for(var e=0,i=t.coordinates[0];e<i.length;e++){var o=i[e];if(sn(o,n))return!0}for(var r=0,a=n.coordinates[0];r<a.length;r++){var s=a[r];if(sn(s,t))return!0}var l=Fg(Mg(t),Mg(n));return l.features.length>0}function m6(t,n,e){var i=e[0]-t[0],o=e[1]-t[1],r=n[0]-t[0],a=n[1]-t[1],s=i*a-o*r;return s!==0?!1:Math.abs(r)>=Math.abs(a)?r>0?t[0]<=e[0]&&e[0]<=n[0]:n[0]<=e[0]&&e[0]<=t[0]:a>0?t[1]<=e[1]&&e[1]<=n[1]:n[1]<=e[1]&&e[1]<=t[1]}function g6(t,n){return t[0]===n[0]&&t[1]===n[1]}var Wy,hS;function y6(){if(hS)return Wy;hS=1;var t=h6(),n=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:o};n.prototype.compare=function(r,a){if(r.type!==a.type||!i(r,a))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,a.coordinates);case"LineString":return this.compareLine(r.coordinates,a.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,a);case"Feature":return this.compareFeature(r,a);default:if(r.type.indexOf("Multi")===0){var s=this,l=e(r),u=e(a);return l.every(function(A){return this.some(function(c){return s.compare(A,c)})},u)}}return!1};function e(r){return r.coordinates.map(function(a){return{type:r.type.replace("Multi",""),coordinates:a}})}function i(r,a){return r.hasOwnProperty("coordinates")?r.coordinates.length===a.coordinates.length:r.length===a.length}n.prototype.compareCoord=function(r,a){if(r.length!==a.length)return!1;for(var s=0;s<r.length;s++)if(r[s].toFixed(this.precision)!==a[s].toFixed(this.precision))return!1;return!0},n.prototype.compareLine=function(r,a,s,l){if(!i(r,a))return!1;var u=this.pseudoNode?r:this.removePseudo(r),A=this.pseudoNode?a:this.removePseudo(a);if(!(l&&!this.compareCoord(u[0],A[0])&&(A=this.fixStartIndex(A,u),!A))){var c=this.compareCoord(u[s],A[s]);return this.direction||c?this.comparePath(u,A):this.compareCoord(u[s],A[A.length-(1+s)])?this.comparePath(u.slice().reverse(),A):!1}},n.prototype.fixStartIndex=function(r,a){for(var s,l=-1,u=0;u<r.length;u++)if(this.compareCoord(r[u],a[0])){l=u;break}return l>=0&&(s=[].concat(r.slice(l,r.length),r.slice(1,l+1))),s},n.prototype.comparePath=function(r,a){var s=this;return r.every(function(l,u){return s.compareCoord(l,this[u])},a)},n.prototype.comparePolygon=function(r,a){if(this.compareLine(r.coordinates[0],a.coordinates[0],1,!0)){var s=r.coordinates.slice(1,r.coordinates.length),l=a.coordinates.slice(1,a.coordinates.length),u=this;return s.every(function(A){return this.some(function(c){return u.compareLine(A,c,1,!0)})},l)}else return!1},n.prototype.compareFeature=function(r,a){return r.id!==a.id||!this.objectComparator(r.properties,a.properties)||!this.compareBBox(r,a)?!1:this.compare(r.geometry,a.geometry)},n.prototype.compareBBox=function(r,a){return!!(!r.bbox&&!a.bbox||r.bbox&&a.bbox&&this.compareCoord(r.bbox,a.bbox))},n.prototype.removePseudo=function(r){return r};function o(r,a){return t(r,a,{strict:!0})}return Wy=n,Wy}var v6=y6();const w6=Al(v6);function b6(t,n){var e=Pi(t).type,i=Pi(n).type;if(e!==i)return!1;var o=new w6({precision:6});return o.compare(S_(t),S_(n))}function x6(t,n){var e=!1;return sa(t,function(i){sa(n,function(o){if(e===!0)return!0;e=!A6(i.geometry,o.geometry)})}),e}/**
|
|
3708
|
+
`,to=class to extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_player");z(this,"_finalImageUrlReact",this.disposeVar(h.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));z(this,"_routePaths",this.disposeVar(h.react(void 0)));z(this,"routePathCallback");z(this,"_id",this.disposeVar(h.react(h.createGuid())));i&&(this._id.value=i),this._player=this.disposeVar(new h.Player);{const d=to.defaults;this.dispose(h.bind([this._player,"loop"],[this,"loop"],p=>p??d.loop,p=>p??d.loop)),this.dispose(h.bind([this._player,"currentTime"],[this,"currentTime"],p=>p??d.currentTime,p=>p??d.currentTime)),this.dispose(h.bind([this._player,"duration"],[this,"duration"],p=>p??d.duration,p=>p??d.duration)),this.dispose(h.bind([this._player,"playing"],[this,"playing"],p=>p??d.playing,p=>p??d.playing)),this.dispose(h.bind([this._player,"speed"],[this,"speed"],p=>p??d.speed,p=>p??d.speed))}const o=this.disposeVar(h.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),r=this.disposeVar(h.createProcessingFromAsyncFunc(async d=>{this.routePaths=void 0;const p=o.value;if(p)try{const v=await(await fetch(p)).json();this.routePaths=QL(v,this.width,this.repeatLength);return}catch(g){console.error(`geojson加载解析出错!${g}`),console.error(g)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const g=this.positionsSet;if(g){this.routePaths=g.map(v=>({positions:v,width:this.width}));return}}}));{const d=()=>{r.restart()};d();const p=this.disposeVar(h.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(p.disposableOn(d))}{const d=()=>{const p=$f(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);p&&(this.routePathCallback=p)};d(),this.dispose(this.routePathCallbackStrChanged.disposableOn(d))}const a=e.viewer;if(!a){console.warn("viewer is undefined!");return}const s=this.finalImageUrlReact,l=this.disposeVar(new cs),u=this.disposeVar(h.createProcessingFromAsyncFunc(async d=>{if(!s.value)return;const p=Q0(a.scene.context).getTextureHandler(s.value);if(p instanceof cs)l.reset(p);else{const g=await d.promise(p);l.reset(g)}})),A=()=>l.valid?l.raw:a.scene.context.defaultTexture,c=()=>u.restart();c(),this.dispose(s.changed.disposableOn(c));const f=this.ad(h.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new h.ObjResettingWithEvent(f,()=>this.routePaths?new nz(a,this,s.value&&A||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(d=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))Fe(a,this.routePaths[0].startPos,a.camera.positionCartographic.height,void 0,d);else{const p=computeBoundingSphere(this.routePaths[0].positions);if(!p)return;const[g,v]=p;Fe(a,g,v*3,void 0,d)}}))}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}};z(to,"whiteGradientImageBase64",iz),z(to,"defaultRoutePathCallback",function(e,i,o){const r=i/50,a=r-Math.floor(r);return e.color=[a*.5+.5,(1-a)*.5+.5,.5,1],e.bgColor=[a*.5+.5,(1-a)*.5+.5,.5,.3],e}),z(to,"routePathCallbackStrMd",rz),z(to,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),z(to,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let $i=to;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:h.reactArray([0,1,0,1]),bgColor:h.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:h.reactPositionsSet(void 0),data:h.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})($i||($i={})),h.extendClassProps($i.prototype,$i.createDefaultProps);class Yi extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_collection");this._collection=this.disposeVar(new $i(e,i)),this.dispose(h.track([this._collection,"show"],[this,"show"])),this.dispose(h.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(h.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(h.track([this._collection,"color"],[this,"color"])),this.dispose(h.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(h.track([this._collection,"width"],[this,"width"])),this.dispose(h.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(h.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(h.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(h.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(h.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(h.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(h.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(h.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(h.bind([this._collection,"playing"],[this,"playing"])),this.dispose(h.track([this._collection,"loop"],[this,"loop"])),this.dispose(h.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(h.bind([this._collection,"duration"],[this,"duration"])),this.dispose(h.bind([this._collection,"speed"],[this,"speed"]));{const o=()=>{this.color=[this.bgColor[0],this.bgColor[1],this.bgColor[2],1]};o(),this.ad(this.bgColorChanged.don(o))}this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=this.positions.map((a,s)=>{var l;if(!(!this.positions||s==((l=this.positions)==null?void 0:l.length)-1))return{startPos:a,endPos:this.positions[s+1],width:this.width,heightRatio:this.heightRatio}}).filter(a=>a!==void 0);return}this._collection.data=void 0};o();const r=this.disposeVar(h.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(r.disposableOn(o))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get collection(){return this._collection}get player(){return this.collection.player}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}}z(Yi,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),z(Yi,"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:h.reactArray([0,1,0,1]),bgColor:h.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:h.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Yi||(Yi={})),h.extendClassProps(Yi.prototype,Yi.createDefaultProps);const pc=class pc extends Jt{constructor(e,i){super(e,i);z(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Yi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmSignalTransmission;{const a=()=>{r.show=e.show&&e.stroked};a(),this.ad(e.showChanged.don(a)),this.ad(e.strokedChanged.don(a))}this.dispose(h.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(h.bind([r,"positions"],[e,"points"])),this.dispose(h.track([r,"width"],[e,"strokeWidth"])),this.dispose(h.track([r,"bgColor"],[e,"strokeColor"])),this.dispose(h.track([r,"startTime"],[e,"startTime"])),this.dispose(h.track([r,"transmissionTime"],[e,"transmissionTime"])),this.dispose(h.track([r,"heightRatio"],[e,"heightRatio"])),this.dispose(h.track([r,"arcType"],[e,"arcType"])),this.dispose(h.track([r,"brightening"],[e,"brightening"])),this.dispose(h.track([r,"depthTest"],[e,"depthTest"])),this.dispose(h.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(h.track([r,"repeat"],[e,"repeat"])),this.dispose(h.track([r,"bidirectional"],[e,"bidirectional"])),this.dispose(h.track([r,"loop"],[e,"loop"])),this.dispose(h.track([r,"currentTime"],[e,"currentTime"])),this.dispose(h.track([r,"duration"],[e,"duration"])),this.dispose(h.track([r,"playing"],[e,"playing"])),this.dispose(h.track([r,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};z(pc,"type",pc.register("ESCesiumViewer",qA.type,pc));let Eg=pc;function Ho(t){var n=[1/0,1/0,-1/0,-1/0];return tf(t,function(e){n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}Ho.default=Ho;const Ji=11102230246251565e-32,en=134217729,oz=(3+8*Ji)*Ji;function Pg(t,n,e,i,o){let r,a,s,l,u=n[0],A=i[0],c=0,f=0;A>u==A>-u?(r=u,u=n[++c]):(r=A,A=i[++f]);let d=0;if(c<t&&f<e)for(A>u==A>-u?(a=u+r,s=r-(a-u),u=n[++c]):(a=A+r,s=r-(a-A),A=i[++f]),r=a,s!==0&&(o[d++]=s);c<t&&f<e;)A>u==A>-u?(a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++c]):(a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f]),r=a,s!==0&&(o[d++]=s);for(;c<t;)a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++c],r=a,s!==0&&(o[d++]=s);for(;f<e;)a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f],r=a,s!==0&&(o[d++]=s);return(r!==0||d===0)&&(o[d++]=r),d}function sz(t,n){let e=n[0];for(let i=1;i<t;i++)e+=n[i];return e}function zl(t){return new Float64Array(t)}const az=(3+16*Ji)*Ji,lz=(2+12*Ji)*Ji,uz=(9+64*Ji)*Ji*Ji,ha=zl(4),y_=zl(8),v_=zl(12),w_=zl(16),on=zl(4);function cz(t,n,e,i,o,r,a){let s,l,u,A,c,f,d,p,g,v,y,m,b,x,E,B,P,I;const O=t-o,M=e-o,S=n-r,T=i-r;x=O*T,f=en*O,d=f-(f-O),p=O-d,f=en*T,g=f-(f-T),v=T-g,E=p*v-(x-d*g-p*g-d*v),B=S*M,f=en*S,d=f-(f-S),p=S-d,f=en*M,g=f-(f-M),v=M-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,ha[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,ha[1]=b-(y+c)+(c-B),I=m+y,c=I-m,ha[2]=m-(I-c)+(y-c),ha[3]=I;let w=sz(4,ha),C=lz*a;if(w>=C||-w>=C||(c=t-O,s=t-(O+c)+(c-o),c=e-M,u=e-(M+c)+(c-o),c=n-S,l=n-(S+c)+(c-r),c=i-T,A=i-(T+c)+(c-r),s===0&&l===0&&u===0&&A===0)||(C=uz*a+oz*Math.abs(w),w+=O*A+T*s-(S*u+M*l),w>=C||-w>=C))return w;x=s*T,f=en*s,d=f-(f-s),p=s-d,f=en*T,g=f-(f-T),v=T-g,E=p*v-(x-d*g-p*g-d*v),B=l*M,f=en*l,d=f-(f-l),p=l-d,f=en*M,g=f-(f-M),v=M-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,on[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,on[1]=b-(y+c)+(c-B),I=m+y,c=I-m,on[2]=m-(I-c)+(y-c),on[3]=I;const U=Pg(4,ha,4,on,y_);x=O*A,f=en*O,d=f-(f-O),p=O-d,f=en*A,g=f-(f-A),v=A-g,E=p*v-(x-d*g-p*g-d*v),B=S*u,f=en*S,d=f-(f-S),p=S-d,f=en*u,g=f-(f-u),v=u-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,on[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,on[1]=b-(y+c)+(c-B),I=m+y,c=I-m,on[2]=m-(I-c)+(y-c),on[3]=I;const F=Pg(U,y_,4,on,v_);x=s*A,f=en*s,d=f-(f-s),p=s-d,f=en*A,g=f-(f-A),v=A-g,E=p*v-(x-d*g-p*g-d*v),B=l*u,f=en*l,d=f-(f-l),p=l-d,f=en*u,g=f-(f-u),v=u-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,c=E-y,on[0]=E-(y+c)+(c-P),m=x+y,c=m-x,b=x-(m-c)+(y-c),y=b-B,c=b-y,on[1]=b-(y+c)+(c-B),I=m+y,c=I-m,on[2]=m-(I-c)+(y-c),on[3]=I;const D=Pg(F,v_,4,on,w_);return w_[D-1]}function kl(t,n,e,i,o,r){const a=(n-r)*(e-o),s=(t-o)*(i-r),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=az*u?l:-cz(t,n,e,i,o,r,u)}function sn(t,n,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!n)throw new Error("polygon is required");var i=ef(t),o=Pi(n),r=o.type,a=n.bbox,s=o.coordinates;if(a&&hz(i,a)===!1)return!1;r==="Polygon"&&(s=[s]);for(var l=!1,u=0;u<s.length&&!l;u++)if(b_(i,s[u][0],e.ignoreBoundary)){for(var A=!1,c=1;c<s[u].length&&!A;)b_(i,s[u][c],!e.ignoreBoundary)&&(A=!0),c++;A||(l=!0)}return l}function b_(t,n,e){var i=!1;n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&(n=n.slice(0,n.length-1));for(var o=0,r=n.length-1;o<n.length;r=o++){var a=n[o][0],s=n[o][1],l=n[r][0],u=n[r][1],A=t[1]*(a-l)+s*(l-t[0])+u*(t[0]-a)===0&&(a-t[0])*(l-t[0])<=0&&(s-t[1])*(u-t[1])<=0;if(A)return!e;var c=s>t[1]!=u>t[1]&&t[0]<(l-a)*(t[1]-s)/(u-s)+a;c&&(i=!i)}return i}function hz(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function Az(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return x_(t);case"FeatureCollection":return fz(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Bg(t);default:throw new Error("unknown GeoJSON type")}}function x_(t){var n={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:n[e]=t[e]}}),n.properties=__(t.properties),n.geometry=Bg(t.geometry),n}function __(t){var n={};return t&&Object.keys(t).forEach(function(e){var i=t[e];typeof i=="object"?i===null?n[e]=null:Array.isArray(i)?n[e]=i.map(function(o){return o}):n[e]=__(i):n[e]=i}),n}function fz(t){var n={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:n[e]=t[e]}}),n.features=t.features.map(function(e){return x_(e)}),n}function Bg(t){var n={type:t.type};return t.bbox&&(n.bbox=t.bbox),t.type==="GeometryCollection"?(n.geometries=t.geometries.map(function(e){return Bg(e)}),n):(n.coordinates=C_(t.coordinates),n)}function C_(t){var n=t;return typeof n[0]!="object"?n.slice():n.map(function(e){return C_(e)})}function S_(t,n){n===void 0&&(n={});var e=typeof n=="object"?n.mutate:n;if(!t)throw new Error("geojson is required");var i=ML(t),o=[];switch(i){case"LineString":o=Tg(t);break;case"MultiLineString":case"Polygon":Ei(t).forEach(function(a){o.push(Tg(a))});break;case"MultiPolygon":Ei(t).forEach(function(a){var s=[];a.forEach(function(l){s.push(Tg(l))}),o.push(s)});break;case"Point":return t;case"MultiPoint":var r={};Ei(t).forEach(function(a){var s=a.join("-");Object.prototype.hasOwnProperty.call(r,s)||(o.push(a),r[s]=!0)});break;default:throw new Error(i+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:i,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Ci({type:i,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function Tg(t){var n=Ei(t);if(n.length===2&&!E_(n[0],n[1]))return n;var e=[],i=n.length-1,o=e.length;e.push(n[0]);for(var r=1;r<i;r++){var a=e[e.length-1];n[r][0]===a[0]&&n[r][1]===a[1]||(e.push(n[r]),o=e.length,o>2&&P_(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(n[n.length-1]),o=e.length,E_(n[0],n[n.length-1])&&o<4)throw new Error("invalid polygon");return P_(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function E_(t,n){return t[0]===n[0]&&t[1]===n[1]}function P_(t,n,e){var i=e[0],o=e[1],r=t[0],a=t[1],s=n[0],l=n[1],u=i-r,A=o-a,c=s-r,f=l-a,d=u*f-A*c;return d!==0?!1:Math.abs(c)>=Math.abs(f)?c>0?r<=i&&i<=s:s<=i&&i<=r:f>0?a<=o&&o<=l:l<=o&&o<=a}function pz(t,n){n===void 0&&(n={});var e=0,i=0,o=0;return tf(t,function(r){e+=r[0],i+=r[1],o++},!0),Gr([e/o,i/o],n.properties)}function B_(t){if(!t)throw new Error("geojson is required");var n=[];return sa(t,function(e){dz(e,n)}),Si(n)}function dz(t,n){var e=[],i=t.geometry;if(i!==null){switch(i.type){case"Polygon":e=Ei(i);break;case"LineString":e=[Ei(i)]}e.forEach(function(o){var r=mz(o,t.properties);r.forEach(function(a){a.id=n.length,n.push(a)})})}}function mz(t,n){var e=[];return t.reduce(function(i,o){var r=YA([i,o],n);return r.bbox=gz(i,o),e.push(r),o}),e}function gz(t,n){var e=t[0],i=t[1],o=n[0],r=n[1],a=e<o?e:o,s=i<r?i:r,l=e>o?e:o,u=i>r?i:r;return[a,s,l,u]}var of={exports:{}},sf={exports:{}},yz=sf.exports,T_;function vz(){return T_||(T_=1,(function(t,n){(function(e,i){t.exports=i()})(yz,function(){function e(m,b,x,E,B){(function P(I,O,M,S,T){for(;S>M;){if(S-M>600){var w=S-M+1,C=O-M+1,U=Math.log(w),F=.5*Math.exp(2*U/3),D=.5*Math.sqrt(U*F*(w-F)/w)*(C-w/2<0?-1:1),R=Math.max(M,Math.floor(O-C*F/w+D)),L=Math.min(S,Math.floor(O+(w-C)*F/w+D));P(I,O,R,L,T)}var k=I[O],Q=M,V=S;for(i(I,M,O),T(I[S],k)>0&&i(I,M,S);Q<V;){for(i(I,Q,V),Q++,V--;T(I[Q],k)<0;)Q++;for(;T(I[V],k)>0;)V--}T(I[M],k)===0?i(I,M,V):i(I,++V,S),V<=O&&(M=V+1),O<=V&&(S=V-1)}})(m,b,x||0,E||m.length-1,B||o)}function i(m,b,x){var E=m[b];m[b]=m[x],m[x]=E}function o(m,b){return m<b?-1:m>b?1:0}var r=function(m){m===void 0&&(m=9),this._maxEntries=Math.max(4,m),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(m,b,x){if(!x)return b.indexOf(m);for(var E=0;E<b.length;E++)if(x(m,b[E]))return E;return-1}function s(m,b){l(m,0,m.children.length,b,m)}function l(m,b,x,E,B){B||(B=v(null)),B.minX=1/0,B.minY=1/0,B.maxX=-1/0,B.maxY=-1/0;for(var P=b;P<x;P++){var I=m.children[P];u(B,m.leaf?E(I):I)}return B}function u(m,b){return m.minX=Math.min(m.minX,b.minX),m.minY=Math.min(m.minY,b.minY),m.maxX=Math.max(m.maxX,b.maxX),m.maxY=Math.max(m.maxY,b.maxY),m}function A(m,b){return m.minX-b.minX}function c(m,b){return m.minY-b.minY}function f(m){return(m.maxX-m.minX)*(m.maxY-m.minY)}function d(m){return m.maxX-m.minX+(m.maxY-m.minY)}function p(m,b){return m.minX<=b.minX&&m.minY<=b.minY&&b.maxX<=m.maxX&&b.maxY<=m.maxY}function g(m,b){return b.minX<=m.maxX&&b.minY<=m.maxY&&b.maxX>=m.minX&&b.maxY>=m.minY}function v(m){return{children:m,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(m,b,x,E,B){for(var P=[b,x];P.length;)if(!((x=P.pop())-(b=P.pop())<=E)){var I=b+Math.ceil((x-b)/E/2)*E;e(m,I,b,x,B),P.push(b,I,I,x)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(m){var b=this.data,x=[];if(!g(m,b))return x;for(var E=this.toBBox,B=[];b;){for(var P=0;P<b.children.length;P++){var I=b.children[P],O=b.leaf?E(I):I;g(m,O)&&(b.leaf?x.push(I):p(m,O)?this._all(I,x):B.push(I))}b=B.pop()}return x},r.prototype.collides=function(m){var b=this.data;if(!g(m,b))return!1;for(var x=[];b;){for(var E=0;E<b.children.length;E++){var B=b.children[E],P=b.leaf?this.toBBox(B):B;if(g(m,P)){if(b.leaf||p(m,P))return!0;x.push(B)}}b=x.pop()}return!1},r.prototype.load=function(m){if(!m||!m.length)return this;if(m.length<this._minEntries){for(var b=0;b<m.length;b++)this.insert(m[b]);return this}var x=this._build(m.slice(),0,m.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var E=this.data;this.data=x,x=E}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},r.prototype.insert=function(m){return m&&this._insert(m,this.data.height-1),this},r.prototype.clear=function(){return this.data=v([]),this},r.prototype.remove=function(m,b){if(!m)return this;for(var x,E,B,P=this.data,I=this.toBBox(m),O=[],M=[];P||O.length;){if(P||(P=O.pop(),E=O[O.length-1],x=M.pop(),B=!0),P.leaf){var S=a(m,P.children,b);if(S!==-1)return P.children.splice(S,1),O.push(P),this._condense(O),this}B||P.leaf||!p(P,I)?E?(x++,P=E.children[x],B=!1):P=null:(O.push(P),M.push(x),x=0,E=P,P=P.children[0])}return this},r.prototype.toBBox=function(m){return m},r.prototype.compareMinX=function(m,b){return m.minX-b.minX},r.prototype.compareMinY=function(m,b){return m.minY-b.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(m){return this.data=m,this},r.prototype._all=function(m,b){for(var x=[];m;)m.leaf?b.push.apply(b,m.children):x.push.apply(x,m.children),m=x.pop();return b},r.prototype._build=function(m,b,x,E){var B,P=x-b+1,I=this._maxEntries;if(P<=I)return s(B=v(m.slice(b,x+1)),this.toBBox),B;E||(E=Math.ceil(Math.log(P)/Math.log(I)),I=Math.ceil(P/Math.pow(I,E-1))),(B=v([])).leaf=!1,B.height=E;var O=Math.ceil(P/I),M=O*Math.ceil(Math.sqrt(I));y(m,b,x,M,this.compareMinX);for(var S=b;S<=x;S+=M){var T=Math.min(S+M-1,x);y(m,S,T,O,this.compareMinY);for(var w=S;w<=T;w+=O){var C=Math.min(w+O-1,T);B.children.push(this._build(m,w,C,E-1))}}return s(B,this.toBBox),B},r.prototype._chooseSubtree=function(m,b,x,E){for(;E.push(b),!b.leaf&&E.length-1!==x;){for(var B=1/0,P=1/0,I=void 0,O=0;O<b.children.length;O++){var M=b.children[O],S=f(M),T=(w=m,C=M,(Math.max(C.maxX,w.maxX)-Math.min(C.minX,w.minX))*(Math.max(C.maxY,w.maxY)-Math.min(C.minY,w.minY))-S);T<P?(P=T,B=S<B?S:B,I=M):T===P&&S<B&&(B=S,I=M)}b=I||b.children[0]}var w,C;return b},r.prototype._insert=function(m,b,x){var E=x?m:this.toBBox(m),B=[],P=this._chooseSubtree(E,this.data,b,B);for(P.children.push(m),u(P,E);b>=0&&B[b].children.length>this._maxEntries;)this._split(B,b),b--;this._adjustParentBBoxes(E,B,b)},r.prototype._split=function(m,b){var x=m[b],E=x.children.length,B=this._minEntries;this._chooseSplitAxis(x,B,E);var P=this._chooseSplitIndex(x,B,E),I=v(x.children.splice(P,x.children.length-P));I.height=x.height,I.leaf=x.leaf,s(x,this.toBBox),s(I,this.toBBox),b?m[b-1].children.push(I):this._splitRoot(x,I)},r.prototype._splitRoot=function(m,b){this.data=v([m,b]),this.data.height=m.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(m,b,x){for(var E,B,P,I,O,M,S,T=1/0,w=1/0,C=b;C<=x-b;C++){var U=l(m,0,C,this.toBBox),F=l(m,C,x,this.toBBox),D=(B=U,P=F,I=void 0,O=void 0,M=void 0,S=void 0,I=Math.max(B.minX,P.minX),O=Math.max(B.minY,P.minY),M=Math.min(B.maxX,P.maxX),S=Math.min(B.maxY,P.maxY),Math.max(0,M-I)*Math.max(0,S-O)),R=f(U)+f(F);D<T?(T=D,E=C,w=R<w?R:w):D===T&&R<w&&(w=R,E=C)}return E||x-b},r.prototype._chooseSplitAxis=function(m,b,x){var E=m.leaf?this.compareMinX:A,B=m.leaf?this.compareMinY:c;this._allDistMargin(m,b,x,E)<this._allDistMargin(m,b,x,B)&&m.children.sort(E)},r.prototype._allDistMargin=function(m,b,x,E){m.children.sort(E);for(var B=this.toBBox,P=l(m,0,b,B),I=l(m,x-b,x,B),O=d(P)+d(I),M=b;M<x-b;M++){var S=m.children[M];u(P,m.leaf?B(S):S),O+=d(P)}for(var T=x-b-1;T>=b;T--){var w=m.children[T];u(I,m.leaf?B(w):w),O+=d(I)}return O},r.prototype._adjustParentBBoxes=function(m,b,x){for(var E=x;E>=0;E--)u(b[E],m)},r.prototype._condense=function(m){for(var b=m.length-1,x=void 0;b>=0;b--)m[b].children.length===0?b>0?(x=m[b-1].children).splice(x.indexOf(m[b]),1):this.clear():s(m[b],this.toBBox)},r})})(sf)),sf.exports}var Ig={},I_;function F_(){return I_||(I_=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=63710088e-1,t.factors={centimeters:t.earthRadius*100,centimetres:t.earthRadius*100,degrees:t.earthRadius/111325,feet:t.earthRadius*3.28084,inches:t.earthRadius*39.37,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:t.earthRadius*1e3,millimetres:t.earthRadius*1e3,nauticalmiles:t.earthRadius/1852,radians:1,yards:t.earthRadius*1.0936},t.unitsFactors={centimeters:100,centimetres:100,degrees:8982708286548395e-21,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:.0006213711922373339,millimeters:1e3,millimetres:1e3,nauticalmiles:.0005399568034557236,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function n(S,T,w){w===void 0&&(w={});var C={type:"Feature"};return(w.id===0||w.id)&&(C.id=w.id),w.bbox&&(C.bbox=w.bbox),C.properties=T||{},C.geometry=S,C}t.feature=n;function e(S,T,w){switch(S){case"Point":return i(T).geometry;case"LineString":return s(T).geometry;case"Polygon":return r(T).geometry;case"MultiPoint":return c(T).geometry;case"MultiLineString":return A(T).geometry;case"MultiPolygon":return f(T).geometry;default:throw new Error(S+" is invalid")}}t.geometry=e;function i(S,T,w){if(w===void 0&&(w={}),!S)throw new Error("coordinates is required");if(!Array.isArray(S))throw new Error("coordinates must be an Array");if(S.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!P(S[0])||!P(S[1]))throw new Error("coordinates must contain numbers");var C={type:"Point",coordinates:S};return n(C,T,w)}t.point=i;function o(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return i(C,T)}),w)}t.points=o;function r(S,T,w){w===void 0&&(w={});for(var C=0,U=S;C<U.length;C++){var F=U[C];if(F.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var D=0;D<F[F.length-1].length;D++)if(F[F.length-1][D]!==F[0][D])throw new Error("First and last Position are not equivalent.")}var R={type:"Polygon",coordinates:S};return n(R,T,w)}t.polygon=r;function a(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return r(C,T)}),w)}t.polygons=a;function s(S,T,w){if(w===void 0&&(w={}),S.length<2)throw new Error("coordinates must be an array of two or more positions");var C={type:"LineString",coordinates:S};return n(C,T,w)}t.lineString=s;function l(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return s(C,T)}),w)}t.lineStrings=l;function u(S,T){T===void 0&&(T={});var w={type:"FeatureCollection"};return T.id&&(w.id=T.id),T.bbox&&(w.bbox=T.bbox),w.features=S,w}t.featureCollection=u;function A(S,T,w){w===void 0&&(w={});var C={type:"MultiLineString",coordinates:S};return n(C,T,w)}t.multiLineString=A;function c(S,T,w){w===void 0&&(w={});var C={type:"MultiPoint",coordinates:S};return n(C,T,w)}t.multiPoint=c;function f(S,T,w){w===void 0&&(w={});var C={type:"MultiPolygon",coordinates:S};return n(C,T,w)}t.multiPolygon=f;function d(S,T,w){w===void 0&&(w={});var C={type:"GeometryCollection",geometries:S};return n(C,T,w)}t.geometryCollection=d;function p(S,T){if(T===void 0&&(T=0),T&&!(T>=0))throw new Error("precision must be a positive number");var w=Math.pow(10,T||0);return Math.round(S*w)/w}t.round=p;function g(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S*w}t.radiansToLength=g;function v(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S/w}t.lengthToRadians=v;function y(S,T){return b(v(S,T))}t.lengthToDegrees=y;function m(S){var T=S%360;return T<0&&(T+=360),T}t.bearingToAzimuth=m;function b(S){var T=S%(2*Math.PI);return T*180/Math.PI}t.radiansToDegrees=b;function x(S){var T=S%360;return T*Math.PI/180}t.degreesToRadians=x;function E(S,T,w){if(T===void 0&&(T="kilometers"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("length must be a positive number");return g(v(S,T),w)}t.convertLength=E;function B(S,T,w){if(T===void 0&&(T="meters"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("area must be a positive number");var C=t.areaFactors[T];if(!C)throw new Error("invalid original units");var U=t.areaFactors[w];if(!U)throw new Error("invalid final units");return S/C*U}t.convertArea=B;function P(S){return!isNaN(S)&&S!==null&&!Array.isArray(S)}t.isNumber=P;function I(S){return!!S&&S.constructor===Object}t.isObject=I;function O(S){if(!S)throw new Error("bbox is required");if(!Array.isArray(S))throw new Error("bbox must be an Array");if(S.length!==4&&S.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");S.forEach(function(T){if(!P(T))throw new Error("bbox must only contain numbers")})}t.validateBBox=O;function M(S){if(!S)throw new Error("id is required");if(["string","number"].indexOf(typeof S)===-1)throw new Error("id must be a number or a string")}t.validateId=M})(Ig)),Ig}var Tt={},M_;function D_(){if(M_)return Tt;M_=1,Object.defineProperty(Tt,"__esModule",{value:!0});var t=F_();function n(m,b,x){if(m!==null)for(var E,B,P,I,O,M,S,T=0,w=0,C,U=m.type,F=U==="FeatureCollection",D=U==="Feature",R=F?m.features.length:1,L=0;L<R;L++){S=F?m.features[L].geometry:D?m.geometry:m,C=S?S.type==="GeometryCollection":!1,O=C?S.geometries.length:1;for(var k=0;k<O;k++){var Q=0,V=0;if(I=C?S.geometries[k]:S,I!==null){M=I.coordinates;var G=I.type;switch(T=x&&(G==="Polygon"||G==="MultiPolygon")?1:0,G){case null:break;case"Point":if(b(M,w,L,Q,V)===!1)return!1;w++,Q++;break;case"LineString":case"MultiPoint":for(E=0;E<M.length;E++){if(b(M[E],w,L,Q,V)===!1)return!1;w++,G==="MultiPoint"&&Q++}G==="LineString"&&Q++;break;case"Polygon":case"MultiLineString":for(E=0;E<M.length;E++){for(B=0;B<M[E].length-T;B++){if(b(M[E][B],w,L,Q,V)===!1)return!1;w++}G==="MultiLineString"&&Q++,G==="Polygon"&&V++}G==="Polygon"&&Q++;break;case"MultiPolygon":for(E=0;E<M.length;E++){for(V=0,B=0;B<M[E].length;B++){for(P=0;P<M[E][B].length-T;P++){if(b(M[E][B][P],w,L,Q,V)===!1)return!1;w++}V++}Q++}break;case"GeometryCollection":for(E=0;E<I.geometries.length;E++)if(n(I.geometries[E],b,x)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(m,b,x,E){var B=x;return n(m,function(P,I,O,M,S){I===0&&x===void 0?B=P:B=b(B,P,I,O,M,S)},E),B}function i(m,b){var x;switch(m.type){case"FeatureCollection":for(x=0;x<m.features.length&&b(m.features[x].properties,x)!==!1;x++);break;case"Feature":b(m.properties,0);break}}function o(m,b,x){var E=x;return i(m,function(B,P){P===0&&x===void 0?E=B:E=b(E,B,P)}),E}function r(m,b){if(m.type==="Feature")b(m,0);else if(m.type==="FeatureCollection")for(var x=0;x<m.features.length&&b(m.features[x],x)!==!1;x++);}function a(m,b,x){var E=x;return r(m,function(B,P){P===0&&x===void 0?E=B:E=b(E,B,P)}),E}function s(m){var b=[];return n(m,function(x){b.push(x)}),b}function l(m,b){var x,E,B,P,I,O,M,S,T,w,C=0,U=m.type==="FeatureCollection",F=m.type==="Feature",D=U?m.features.length:1;for(x=0;x<D;x++){for(O=U?m.features[x].geometry:F?m.geometry:m,S=U?m.features[x].properties:F?m.properties:{},T=U?m.features[x].bbox:F?m.bbox:void 0,w=U?m.features[x].id:F?m.id:void 0,M=O?O.type==="GeometryCollection":!1,I=M?O.geometries.length:1,B=0;B<I;B++){if(P=M?O.geometries[B]:O,P===null){if(b(null,C,S,T,w)===!1)return!1;continue}switch(P.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(b(P,C,S,T,w)===!1)return!1;break}case"GeometryCollection":{for(E=0;E<P.geometries.length;E++)if(b(P.geometries[E],C,S,T,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}C++}}function u(m,b,x){var E=x;return l(m,function(B,P,I,O,M){P===0&&x===void 0?E=B:E=b(E,B,P,I,O,M)}),E}function A(m,b){l(m,function(x,E,B,P,I){var O=x===null?null:x.type;switch(O){case null:case"Point":case"LineString":case"Polygon":return b(t.feature(x,B,{bbox:P,id:I}),E,0)===!1?!1:void 0}var M;switch(O){case"MultiPoint":M="Point";break;case"MultiLineString":M="LineString";break;case"MultiPolygon":M="Polygon";break}for(var S=0;S<x.coordinates.length;S++){var T=x.coordinates[S],w={type:M,coordinates:T};if(b(t.feature(w,B),E,S)===!1)return!1}})}function c(m,b,x){var E=x;return A(m,function(B,P,I){P===0&&I===0&&x===void 0?E=B:E=b(E,B,P,I)}),E}function f(m,b){A(m,function(x,E,B){var P=0;if(x.geometry){var I=x.geometry.type;if(!(I==="Point"||I==="MultiPoint")){var O,M=0,S=0,T=0;if(n(x,function(w,C,U,F,D){if(O===void 0||E>M||F>S||D>T){O=w,M=E,S=F,T=D,P=0;return}var R=t.lineString([O,w],x.properties);if(b(R,E,B,D,P)===!1)return!1;P++,O=w})===!1)return!1}}})}function d(m,b,x){var E=x,B=!1;return f(m,function(P,I,O,M,S){B===!1&&x===void 0?E=P:E=b(E,P,I,O,M,S),B=!0}),E}function p(m,b){if(!m)throw new Error("geojson is required");A(m,function(x,E,B){if(x.geometry!==null){var P=x.geometry.type,I=x.geometry.coordinates;switch(P){case"LineString":if(b(x,E,B,0,0)===!1)return!1;break;case"Polygon":for(var O=0;O<I.length;O++)if(b(t.lineString(I[O],x.properties),E,B,O)===!1)return!1;break}}})}function g(m,b,x){var E=x;return p(m,function(B,P,I,O){P===0&&x===void 0?E=B:E=b(E,B,P,I,O)}),E}function v(m,b){if(b=b||{},!t.isObject(b))throw new Error("options is invalid");var x=b.featureIndex||0,E=b.multiFeatureIndex||0,B=b.geometryIndex||0,P=b.segmentIndex||0,I=b.properties,O;switch(m.type){case"FeatureCollection":x<0&&(x=m.features.length+x),I=I||m.features[x].properties,O=m.features[x].geometry;break;case"Feature":I=I||m.properties,O=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":O=m;break;default:throw new Error("geojson is invalid")}if(O===null)return null;var M=O.coordinates;switch(O.type){case"Point":case"MultiPoint":return null;case"LineString":return P<0&&(P=M.length+P-1),t.lineString([M[P],M[P+1]],I,b);case"Polygon":return B<0&&(B=M.length+B),P<0&&(P=M[B].length+P-1),t.lineString([M[B][P],M[B][P+1]],I,b);case"MultiLineString":return E<0&&(E=M.length+E),P<0&&(P=M[E].length+P-1),t.lineString([M[E][P],M[E][P+1]],I,b);case"MultiPolygon":return E<0&&(E=M.length+E),B<0&&(B=M[E].length+B),P<0&&(P=M[E][B].length-P-1),t.lineString([M[E][B][P],M[E][B][P+1]],I,b)}throw new Error("geojson is invalid")}function y(m,b){if(b=b||{},!t.isObject(b))throw new Error("options is invalid");var x=b.featureIndex||0,E=b.multiFeatureIndex||0,B=b.geometryIndex||0,P=b.coordIndex||0,I=b.properties,O;switch(m.type){case"FeatureCollection":x<0&&(x=m.features.length+x),I=I||m.features[x].properties,O=m.features[x].geometry;break;case"Feature":I=I||m.properties,O=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":O=m;break;default:throw new Error("geojson is invalid")}if(O===null)return null;var M=O.coordinates;switch(O.type){case"Point":return t.point(M,I,b);case"MultiPoint":return E<0&&(E=M.length+E),t.point(M[E],I,b);case"LineString":return P<0&&(P=M.length+P),t.point(M[P],I,b);case"Polygon":return B<0&&(B=M.length+B),P<0&&(P=M[B].length+P),t.point(M[B][P],I,b);case"MultiLineString":return E<0&&(E=M.length+E),P<0&&(P=M[E].length+P),t.point(M[E][P],I,b);case"MultiPolygon":return E<0&&(E=M.length+E),B<0&&(B=M[E].length+B),P<0&&(P=M[E][B].length-P),t.point(M[E][B][P],I,b)}throw new Error("geojson is invalid")}return Tt.coordAll=s,Tt.coordEach=n,Tt.coordReduce=e,Tt.featureEach=r,Tt.featureReduce=a,Tt.findPoint=y,Tt.findSegment=v,Tt.flattenEach=A,Tt.flattenReduce=c,Tt.geomEach=l,Tt.geomReduce=u,Tt.lineEach=p,Tt.lineReduce=g,Tt.propEach=i,Tt.propReduce=o,Tt.segmentEach=f,Tt.segmentReduce=d,Tt}var af={},R_;function wz(){if(R_)return af;R_=1,Object.defineProperty(af,"__esModule",{value:!0});var t=D_();function n(e){var i=[1/0,1/0,-1/0,-1/0];return t.coordEach(e,function(o){i[0]>o[0]&&(i[0]=o[0]),i[1]>o[1]&&(i[1]=o[1]),i[2]<o[0]&&(i[2]=o[0]),i[3]<o[1]&&(i[3]=o[1])}),i}return n.default=n,af.default=n,af}var U_;function bz(){if(U_)return of.exports;U_=1;var t=vz(),n=F_(),e=D_(),i=wz().default,o=e.featureEach;e.coordEach,n.polygon;var r=n.featureCollection;function a(s){var l=new t(s);return l.insert=function(u){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:i(u),t.prototype.insert.call(this,u)},l.load=function(u){var A=[];return Array.isArray(u)?u.forEach(function(c){if(c.type!=="Feature")throw new Error("invalid features");c.bbox=c.bbox?c.bbox:i(c),A.push(c)}):o(u,function(c){if(c.type!=="Feature")throw new Error("invalid features");c.bbox=c.bbox?c.bbox:i(c),A.push(c)}),t.prototype.load.call(this,A)},l.remove=function(u,A){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:i(u),t.prototype.remove.call(this,u,A)},l.clear=function(){return t.prototype.clear.call(this)},l.search=function(u){var A=t.prototype.search.call(this,this.toBBox(u));return r(A)},l.collides=function(u){return t.prototype.collides.call(this,this.toBBox(u))},l.all=function(){var u=t.prototype.all.call(this);return r(u)},l.toJSON=function(){return t.prototype.toJSON.call(this)},l.fromJSON=function(u){return t.prototype.fromJSON.call(this,u)},l.toBBox=function(u){var A;if(u.bbox)A=u.bbox;else if(Array.isArray(u)&&u.length===4)A=u;else if(Array.isArray(u)&&u.length===6)A=[u[0],u[1],u[3],u[4]];else if(u.type==="Feature")A=i(u);else if(u.type==="FeatureCollection")A=i(u);else throw new Error("invalid geojson");return{minX:A[0],minY:A[1],maxX:A[2],maxY:A[3]}},l}return of.exports=a,of.exports.default=a,of.exports}var xz=bz();const _z=Al(xz);function Fg(t,n){var e={},i=[];if(t.type==="LineString"&&(t=Ci(t)),n.type==="LineString"&&(n=Ci(n)),t.type==="Feature"&&n.type==="Feature"&&t.geometry!==null&&n.geometry!==null&&t.geometry.type==="LineString"&&n.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&n.geometry.coordinates.length===2){var o=O_(t,n);return o&&i.push(o),Si(i)}var r=_z();return r.load(B_(n)),nf(B_(t),function(a){nf(r.search(a),function(s){var l=O_(a,s);if(l){var u=Ei(l).join(",");e[u]||(e[u]=!0,i.push(l))}})}),Si(i)}function O_(t,n){var e=Ei(t),i=Ei(n);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],r=e[0][1],a=e[1][0],s=e[1][1],l=i[0][0],u=i[0][1],A=i[1][0],c=i[1][1],f=(c-u)*(a-o)-(A-l)*(s-r),d=(A-l)*(r-u)-(c-u)*(o-l),p=(a-o)*(r-u)-(s-r)*(o-l);if(f===0)return null;var g=d/f,v=p/f;if(g>=0&&g<=1&&v>=0&&v<=1){var y=o+g*(a-o),m=r+g*(s-r);return Gr([y,m])}return null}function lf(t,n,e){e===void 0&&(e={});for(var i=ef(t),o=Ei(n),r=0;r<o.length-1;r++){var a=!1;if(e.ignoreEndVertices&&(r===0&&(a="start"),r===o.length-2&&(a="end"),r===0&&r+1===o.length-1&&(a="both")),Cz(o[r],o[r+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function Cz(t,n,e,i,o){var r=e[0],a=e[1],s=t[0],l=t[1],u=n[0],A=n[1],c=e[0]-s,f=e[1]-l,d=u-s,p=A-l,g=c*p-f*d;if(o!==null){if(Math.abs(g)>o)return!1}else if(g!==0)return!1;if(i){if(i==="start")return Math.abs(d)>=Math.abs(p)?d>0?s<r&&r<=u:u<=r&&r<s:p>0?l<a&&a<=A:A<=a&&a<l;if(i==="end")return Math.abs(d)>=Math.abs(p)?d>0?s<=r&&r<u:u<r&&r<=s:p>0?l<=a&&a<A:A<a&&a<=l;if(i==="both")return Math.abs(d)>=Math.abs(p)?d>0?s<r&&r<u:u<r&&r<s:p>0?l<a&&a<A:A<a&&a<l}else return Math.abs(d)>=Math.abs(p)?d>0?s<=r&&r<=u:u<=r&&r<=s:p>0?l<=a&&a<=A:A<=a&&a<=l;return!1}function Sz(t,n){var e=Pi(t),i=Pi(n),o=e.type,r=i.type;switch(o){case"Point":switch(r){case"MultiPoint":return Ez(e,i);case"LineString":return lf(e,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return sn(e,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return Pz(e,i);case"LineString":return Bz(e,i);case"Polygon":case"MultiPolygon":return Tz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return Iz(e,i);case"Polygon":case"MultiPolygon":return Fz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Polygon":case"MultiPolygon":return Mz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function Ez(t,n){var e,i=!1;for(e=0;e<n.coordinates.length;e++)if(z_(n.coordinates[e],t.coordinates)){i=!0;break}return i}function Pz(t,n){for(var e=0;e<t.coordinates.length;e++){for(var i=!1,o=0;o<n.coordinates.length;o++)z_(t.coordinates[e],n.coordinates[o])&&(i=!0);if(!i)return!1}return!0}function Bz(t,n){for(var e=!1,i=0;i<t.coordinates.length;i++){if(!lf(t.coordinates[i],n))return!1;e||(e=lf(t.coordinates[i],n,{ignoreEndVertices:!0}))}return e}function Tz(t,n){for(var e=!0,i=!1,o=0;o<t.coordinates.length;o++){if(i=sn(t.coordinates[1],n),!i){e=!1;break}i=sn(t.coordinates[1],n,{ignoreBoundary:!0})}return e&&i}function Iz(t,n){for(var e=0;e<t.coordinates.length;e++)if(!lf(t.coordinates[e],n))return!1;return!0}function Fz(t,n){var e=Ho(n),i=Ho(t);if(!L_(e,i))return!1;for(var o=!1,r=0;r<t.coordinates.length-1;r++){if(!sn(t.coordinates[r],n))return!1;if(o||(o=sn(t.coordinates[r],n,{ignoreBoundary:!0})),!o){var a=Dz(t.coordinates[r],t.coordinates[r+1]);o=sn(a,n,{ignoreBoundary:!0})}}return o}function Mz(t,n){var e=Ho(t),i=Ho(n);if(!L_(i,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!sn(t.coordinates[0][o],n))return!1;return!0}function L_(t,n){return!(t[0]>n[0]||t[2]<n[2]||t[1]>n[1]||t[3]<n[3])}function z_(t,n){return t[0]===n[0]&&t[1]===n[1]}function Dz(t,n){return[(t[0]+n[0])/2,(t[1]+n[1])/2]}function k_(t,n,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var i=[],o=t[0],r=t[1],a=t[2],s=t[3],l=n/Bi([o,r],[a,r],e),u=l*(a-o),A=n/Bi([o,r],[o,s],e),c=A*(s-r),f=a-o,d=s-r,p=Math.floor(f/u),g=Math.floor(d/c),v=(f-p*u)/2,y=(d-g*c)/2,m=o+v;m<=a;){for(var b=r+y;b<=s;){var x=Gr([m,b],e.properties);e.mask?Sz(x,e.mask)&&i.push(x):i.push(x),b+=c}m+=u}return Si(i)}function Mg(t,n){n===void 0&&(n={});var e=Pi(t);switch(!n.properties&&t.type==="Feature"&&(n.properties=t.properties),e.type){case"Polygon":return Rz(e,n);case"MultiPolygon":return Uz(e,n);default:throw new Error("invalid poly")}}function Rz(t,n){n===void 0&&(n={});var e=Pi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{};return Q_(i,o)}function Uz(t,n){n===void 0&&(n={});var e=Pi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{},r=[];return i.forEach(function(a){r.push(Q_(a,o))}),Si(r)}function Q_(t,n){return t.length>1?BL(t,n):YA(t[0],n)}var Dg,V_;function N_(){if(V_)return Dg;V_=1;var t=Object.prototype.toString;return Dg=function(e){var i=t.call(e),o=i==="[object Arguments]";return o||(o=i!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&t.call(e.callee)==="[object Function]"),o},Dg}var Rg,H_;function Oz(){if(H_)return Rg;H_=1;var t;if(!Object.keys){var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=N_(),o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),a=o.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var d=f.constructor;return d&&d.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},A=(function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&n.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1})(),c=function(f){if(typeof window>"u"||!A)return l(f);try{return l(f)}catch{return!1}};t=function(d){var p=d!==null&&typeof d=="object",g=e.call(d)==="[object Function]",v=i(d),y=p&&e.call(d)==="[object String]",m=[];if(!p&&!g&&!v)throw new TypeError("Object.keys called on a non-object");var b=a&&g;if(y&&d.length>0&&!n.call(d,0))for(var x=0;x<d.length;++x)m.push(String(x));if(v&&d.length>0)for(var E=0;E<d.length;++E)m.push(String(E));else for(var B in d)!(b&&B==="prototype")&&n.call(d,B)&&m.push(String(B));if(r)for(var P=c(d),I=0;I<s.length;++I)!(P&&s[I]==="constructor")&&n.call(d,s[I])&&m.push(s[I]);return m}}return Rg=t,Rg}var Ug,G_;function W_(){if(G_)return Ug;G_=1;var t=Array.prototype.slice,n=N_(),e=Object.keys,i=e?function(a){return e(a)}:Oz(),o=Object.keys;return i.shim=function(){if(Object.keys){var a=(function(){var s=Object.keys(arguments);return s&&s.length===arguments.length})(1,2);a||(Object.keys=function(l){return n(l)?o(t.call(l)):o(l)})}else Object.keys=i;return Object.keys||i},Ug=i,Ug}var Og,j_;function q_(){return j_||(j_=1,Og=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var o=42;n[e]=o;for(var r in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var a=Object.getOwnPropertySymbols(n);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(n,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(n,e);if(s.value!==o||s.enumerable!==!0)return!1}return!0}),Og}var Lg,K_;function zg(){if(K_)return Lg;K_=1;var t=q_();return Lg=function(){return t()&&!!Symbol.toStringTag},Lg}var kg,Z_;function X_(){return Z_||(Z_=1,kg=Object),kg}var Qg,$_;function Y_(){return $_||($_=1,Qg=Error),Qg}var Vg,J_;function Lz(){return J_||(J_=1,Vg=EvalError),Vg}var Ng,eC;function zz(){return eC||(eC=1,Ng=RangeError),Ng}var Hg,tC;function kz(){return tC||(tC=1,Hg=ReferenceError),Hg}var Gg,nC;function iC(){return nC||(nC=1,Gg=SyntaxError),Gg}var Wg,rC;function Aa(){return rC||(rC=1,Wg=TypeError),Wg}var jg,oC;function Qz(){return oC||(oC=1,jg=URIError),jg}var qg,sC;function Vz(){return sC||(sC=1,qg=Math.abs),qg}var Kg,aC;function Nz(){return aC||(aC=1,Kg=Math.floor),Kg}var Zg,lC;function Hz(){return lC||(lC=1,Zg=Math.max),Zg}var Xg,uC;function Gz(){return uC||(uC=1,Xg=Math.min),Xg}var $g,cC;function Wz(){return cC||(cC=1,$g=Math.pow),$g}var Yg,hC;function jz(){return hC||(hC=1,Yg=Math.round),Yg}var Jg,AC;function qz(){return AC||(AC=1,Jg=Number.isNaN||function(n){return n!==n}),Jg}var ey,fC;function Kz(){if(fC)return ey;fC=1;var t=qz();return ey=function(e){return t(e)||e===0?e:e<0?-1:1},ey}var ty,pC;function Zz(){return pC||(pC=1,ty=Object.getOwnPropertyDescriptor),ty}var ny,dC;function fa(){if(dC)return ny;dC=1;var t=Zz();if(t)try{t([],"length")}catch{t=null}return ny=t,ny}var iy,mC;function uf(){if(mC)return iy;mC=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return iy=t,iy}var ry,gC;function Xz(){if(gC)return ry;gC=1;var t=typeof Symbol<"u"&&Symbol,n=q_();return ry=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()},ry}var oy,yC;function vC(){return yC||(yC=1,oy=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),oy}var sy,wC;function bC(){if(wC)return sy;wC=1;var t=X_();return sy=t.getPrototypeOf||null,sy}var ay,xC;function $z(){if(xC)return ay;xC=1;var t="Function.prototype.bind called on incompatible ",n=Object.prototype.toString,e=Math.max,i="[object Function]",o=function(l,u){for(var A=[],c=0;c<l.length;c+=1)A[c]=l[c];for(var f=0;f<u.length;f+=1)A[f+l.length]=u[f];return A},r=function(l,u){for(var A=[],c=u,f=0;c<l.length;c+=1,f+=1)A[f]=l[c];return A},a=function(s,l){for(var u="",A=0;A<s.length;A+=1)u+=s[A],A+1<s.length&&(u+=l);return u};return ay=function(l){var u=this;if(typeof u!="function"||n.apply(u)!==i)throw new TypeError(t+u);for(var A=r(arguments,1),c,f=function(){if(this instanceof c){var y=u.apply(this,o(A,arguments));return Object(y)===y?y:this}return u.apply(l,o(A,arguments))},d=e(0,u.length-A.length),p=[],g=0;g<d;g++)p[g]="$"+g;if(c=Function("binder","return function ("+a(p,",")+"){ return binder.apply(this,arguments); }")(f),u.prototype){var v=function(){};v.prototype=u.prototype,c.prototype=new v,v.prototype=null}return c},ay}var ly,_C;function Ql(){if(_C)return ly;_C=1;var t=$z();return ly=Function.prototype.bind||t,ly}var uy,CC;function cy(){return CC||(CC=1,uy=Function.prototype.call),uy}var hy,SC;function Ay(){return SC||(SC=1,hy=Function.prototype.apply),hy}var fy,EC;function Yz(){return EC||(EC=1,fy=typeof Reflect<"u"&&Reflect&&Reflect.apply),fy}var py,PC;function BC(){if(PC)return py;PC=1;var t=Ql(),n=Ay(),e=cy(),i=Yz();return py=i||t.call(e,n),py}var dy,TC;function my(){if(TC)return dy;TC=1;var t=Ql(),n=Aa(),e=cy(),i=BC();return dy=function(r){if(r.length<1||typeof r[0]!="function")throw new n("a function is required");return i(t,e,r)},dy}var gy,IC;function Jz(){if(IC)return gy;IC=1;var t=my(),n=fa(),e;try{e=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var i=!!e&&n&&n(Object.prototype,"__proto__"),o=Object,r=o.getPrototypeOf;return gy=i&&typeof i.get=="function"?t([i.get]):typeof r=="function"?function(s){return r(s==null?s:o(s))}:!1,gy}var yy,FC;function MC(){if(FC)return yy;FC=1;var t=vC(),n=bC(),e=Jz();return yy=t?function(o){return t(o)}:n?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return n(o)}:e?function(o){return e(o)}:null,yy}var vy,DC;function RC(){if(DC)return vy;DC=1;var t=Function.prototype.call,n=Object.prototype.hasOwnProperty,e=Ql();return vy=e.call(t,n),vy}var wy,UC;function OC(){if(UC)return wy;UC=1;var t,n=X_(),e=Y_(),i=Lz(),o=zz(),r=kz(),a=iC(),s=Aa(),l=Qz(),u=Vz(),A=Nz(),c=Hz(),f=Gz(),d=Wz(),p=jz(),g=Kz(),v=Function,y=function(ue){try{return v('"use strict"; return ('+ue+").constructor;")()}catch{}},m=fa(),b=uf(),x=function(){throw new s},E=m?(function(){try{return arguments.callee,x}catch{try{return m(arguments,"callee").get}catch{return x}}})():x,B=Xz()(),P=MC(),I=bC(),O=vC(),M=Ay(),S=cy(),T={},w=typeof Uint8Array>"u"||!P?t:P(Uint8Array),C={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":B&&P?P([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":i,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":T,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":B&&P?P(P([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!B||!P?t:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":m,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":o,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!B||!P?t:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":B&&P?P(""[Symbol.iterator]()):t,"%Symbol%":B?Symbol:t,"%SyntaxError%":a,"%ThrowTypeError%":E,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":S,"%Function.prototype.apply%":M,"%Object.defineProperty%":b,"%Object.getPrototypeOf%":I,"%Math.abs%":u,"%Math.floor%":A,"%Math.max%":c,"%Math.min%":f,"%Math.pow%":d,"%Math.round%":p,"%Math.sign%":g,"%Reflect.getPrototypeOf%":O};if(P)try{null.error}catch(ue){var U=P(P(ue));C["%Error.prototype%"]=U}var F=function ue(te){var ce;if(te==="%AsyncFunction%")ce=y("async function () {}");else if(te==="%GeneratorFunction%")ce=y("function* () {}");else if(te==="%AsyncGeneratorFunction%")ce=y("async function* () {}");else if(te==="%AsyncGenerator%"){var X=ue("%AsyncGeneratorFunction%");X&&(ce=X.prototype)}else if(te==="%AsyncIteratorPrototype%"){var q=ue("%AsyncGenerator%");q&&P&&(ce=P(q.prototype))}return C[te]=ce,ce},D={__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"]},R=Ql(),L=RC(),k=R.call(S,Array.prototype.concat),Q=R.call(M,Array.prototype.splice),V=R.call(S,String.prototype.replace),G=R.call(S,String.prototype.slice),$=R.call(S,RegExp.prototype.exec),Y=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ie=/\\(\\)?/g,re=function(te){var ce=G(te,0,1),X=G(te,-1);if(ce==="%"&&X!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(X==="%"&&ce!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var q=[];return V(te,Y,function(H,Z,K,j){q[q.length]=K?V(j,ie,"$1"):Z||H}),q},le=function(te,ce){var X=te,q;if(L(D,X)&&(q=D[X],X="%"+q[0]+"%"),L(C,X)){var H=C[X];if(H===T&&(H=F(X)),typeof H>"u"&&!ce)throw new s("intrinsic "+te+" exists, but is not available. Please file an issue!");return{alias:q,name:X,value:H}}throw new a("intrinsic "+te+" does not exist!")};return wy=function(te,ce){if(typeof te!="string"||te.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ce!="boolean")throw new s('"allowMissing" argument must be a boolean');if($(/^%?[^%]*%?$/,te)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var X=re(te),q=X.length>0?X[0]:"",H=le("%"+q+"%",ce),Z=H.name,K=H.value,j=!1,W=H.alias;W&&(q=W[0],Q(X,k([0,1],W)));for(var J=1,ee=!0;J<X.length;J+=1){var se=X[J],Ae=G(se,0,1),fe=G(se,-1);if((Ae==='"'||Ae==="'"||Ae==="`"||fe==='"'||fe==="'"||fe==="`")&&Ae!==fe)throw new a("property names with quotes must have matching quotes");if((se==="constructor"||!ee)&&(j=!0),q+="."+se,Z="%"+q+"%",L(C,Z))K=C[Z];else if(K!=null){if(!(se in K)){if(!ce)throw new s("base intrinsic for "+te+" exists, but the property is not available.");return}if(m&&J+1>=X.length){var de=m(K,se);ee=!!de,ee&&"get"in de&&!("originalValue"in de.get)?K=de.get:K=K[se]}else ee=L(K,se),K=K[se];ee&&!j&&(C[Z]=K)}}return K},wy}var by,LC;function xy(){if(LC)return by;LC=1;var t=OC(),n=my(),e=n([t("%String.prototype.indexOf%")]);return by=function(o,r){var a=t(o,!!r);return typeof a=="function"&&e(o,".prototype.")>-1?n([a]):a},by}var _y,zC;function ek(){if(zC)return _y;zC=1;var t=zg()(),n=xy(),e=n("Object.prototype.toString"),i=function(s){return t&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:e(s)==="[object Arguments]"},o=function(s){return i(s)?!0:s!==null&&typeof s=="object"&&"length"in s&&typeof s.length=="number"&&s.length>=0&&e(s)!=="[object Array]"&&"callee"in s&&e(s.callee)==="[object Function]"},r=(function(){return i(arguments)})();return i.isLegacyArguments=o,_y=r?i:o,_y}var Cy,kC;function Sy(){if(kC)return Cy;kC=1;var t=uf(),n=iC(),e=Aa(),i=fa();return Cy=function(r,a,s){if(!r||typeof r!="object"&&typeof r!="function")throw new e("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new e("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new e("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new e("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new e("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new e("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,A=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,f=!!i&&i(r,a);if(t)t(r,a,{configurable:A===null&&f?f.configurable:!A,enumerable:l===null&&f?f.enumerable:!l,value:s,writable:u===null&&f?f.writable:!u});else if(c||!l&&!u&&!A)r[a]=s;else throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Cy}var Ey,QC;function Py(){if(QC)return Ey;QC=1;var t=uf(),n=function(){return!!t};return n.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Ey=n,Ey}var By,VC;function Vl(){if(VC)return By;VC=1;var t=W_(),n=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",e=Object.prototype.toString,i=Array.prototype.concat,o=Sy(),r=function(u){return typeof u=="function"&&e.call(u)==="[object Function]"},a=Py()(),s=function(u,A,c,f){if(A in u){if(f===!0){if(u[A]===c)return}else if(!r(f)||!f())return}a?o(u,A,c,!0):o(u,A,c)},l=function(u,A){var c=arguments.length>2?arguments[2]:{},f=t(A);n&&(f=i.call(f,Object.getOwnPropertySymbols(A)));for(var d=0;d<f.length;d+=1)s(u,f[d],A[f[d]],c[f[d]])};return l.supportsDescriptors=!!a,By=l,By}var Ty={exports:{}},Iy,NC;function tk(){if(NC)return Iy;NC=1;var t=OC(),n=Sy(),e=Py()(),i=fa(),o=Aa(),r=t("%Math.floor%");return Iy=function(s,l){if(typeof s!="function")throw new o("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||r(l)!==l)throw new o("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],A=!0,c=!0;if("length"in s&&i){var f=i(s,"length");f&&!f.configurable&&(A=!1),f&&!f.writable&&(c=!1)}return(A||c||!u)&&(e?n(s,"length",l,!0,!0):n(s,"length",l)),s},Iy}var Fy,HC;function nk(){if(HC)return Fy;HC=1;var t=Ql(),n=Ay(),e=BC();return Fy=function(){return e(t,n,arguments)},Fy}var GC;function WC(){return GC||(GC=1,(function(t){var n=tk(),e=uf(),i=my(),o=nk();t.exports=function(a){var s=i(arguments),l=a.length-(arguments.length-1);return n(s,1+(l>0?l:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(Ty)),Ty.exports}var My,jC;function qC(){if(jC)return My;jC=1;var t=function(n){return n!==n};return My=function(e,i){return e===0&&i===0?1/e===1/i:!!(e===i||t(e)&&t(i))},My}var Dy,KC;function ZC(){if(KC)return Dy;KC=1;var t=qC();return Dy=function(){return typeof Object.is=="function"?Object.is:t},Dy}var Ry,XC;function ik(){if(XC)return Ry;XC=1;var t=ZC(),n=Vl();return Ry=function(){var i=t();return n(Object,{is:i},{is:function(){return Object.is!==i}}),i},Ry}var Uy,$C;function rk(){if($C)return Uy;$C=1;var t=Vl(),n=WC(),e=qC(),i=ZC(),o=ik(),r=n(i(),Object);return t(r,{getPolyfill:i,implementation:e,shim:o}),Uy=r,Uy}var Oy,YC;function ok(){if(YC)return Oy;YC=1;var t=xy(),n=zg()(),e=RC(),i=fa(),o;if(n){var r=t("RegExp.prototype.exec"),a={},s=function(){throw a},l={toString:s,valueOf:s};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=s),o=function(f){if(!f||typeof f!="object")return!1;var d=i(f,"lastIndex"),p=d&&e(d,"value");if(!p)return!1;try{r(f,l)}catch(g){return g===a}}}else{var u=t("Object.prototype.toString"),A="[object RegExp]";o=function(f){return!f||typeof f!="object"&&typeof f!="function"?!1:u(f)===A}}return Oy=o,Oy}var Ly,JC;function sk(){if(JC)return Ly;JC=1;var t=function(){return typeof(function(){}).name=="string"},n=Object.getOwnPropertyDescriptor;if(n)try{n([],"length")}catch{n=null}t.functionsHaveConfigurableNames=function(){if(!t()||!n)return!1;var o=n(function(){},"name");return!!o&&!!o.configurable};var e=Function.prototype.bind;return t.boundFunctionsHaveNames=function(){return t()&&typeof e=="function"&&(function(){}).bind().name!==""},Ly=t,Ly}var zy,eS;function ak(){if(eS)return zy;eS=1;var t=Sy(),n=Py()(),e=sk().functionsHaveConfigurableNames(),i=Aa();return zy=function(r,a){if(typeof r!="function")throw new i("`fn` is not a function");var s=arguments.length>2&&!!arguments[2];return(!s||e)&&(n?t(r,"name",a,!0,!0):t(r,"name",a)),r},zy}var ky,tS;function nS(){if(tS)return ky;tS=1;var t=ak(),n=Aa(),e=Object;return ky=t(function(){if(this==null||this!==e(this))throw new n("RegExp.prototype.flags getter called on non-object");var o="";return this.hasIndices&&(o+="d"),this.global&&(o+="g"),this.ignoreCase&&(o+="i"),this.multiline&&(o+="m"),this.dotAll&&(o+="s"),this.unicode&&(o+="u"),this.unicodeSets&&(o+="v"),this.sticky&&(o+="y"),o},"get flags",!0),ky}var Qy,iS;function rS(){if(iS)return Qy;iS=1;var t=nS(),n=Vl().supportsDescriptors,e=Object.getOwnPropertyDescriptor;return Qy=function(){if(n&&/a/mig.flags==="gim"){var o=e(RegExp.prototype,"flags");if(o&&typeof o.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var r="",a={};if(Object.defineProperty(a,"hasIndices",{get:function(){r+="d"}}),Object.defineProperty(a,"sticky",{get:function(){r+="y"}}),o.get.call(a),r==="dy")return o.get}}return t},Qy}var Vy,oS;function lk(){if(oS)return Vy;oS=1;var t=Vl().supportsDescriptors,n=rS(),e=fa(),i=Object.defineProperty,o=Y_(),r=MC(),a=/a/;return Vy=function(){if(!t||!r)throw new o("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var l=n(),u=r(a),A=e(u,"flags");return(!A||A.get!==l)&&i(u,"flags",{configurable:!0,enumerable:!1,get:l}),l},Vy}var Ny,sS;function uk(){if(sS)return Ny;sS=1;var t=Vl(),n=WC(),e=nS(),i=rS(),o=lk(),r=n(i());return t(r,{getPolyfill:i,implementation:e,shim:o}),Ny=r,Ny}var Hy,aS;function ck(){if(aS)return Hy;aS=1;var t=xy(),n=t("Date.prototype.getDay"),e=function(s){try{return n(s),!0}catch{return!1}},i=t("Object.prototype.toString"),o="[object Date]",r=zg()();return Hy=function(s){return typeof s!="object"||s===null?!1:r?e(s):i(s)===o},Hy}var Gy,lS;function hk(){if(lS)return Gy;lS=1;var t=W_(),n=ek(),e=rk(),i=ok(),o=uk(),r=ck(),a=Date.prototype.getTime;function s(c,f,d){var p=d||{};return(p.strict?e(c,f):c===f)?!0:!c||!f||typeof c!="object"&&typeof f!="object"?p.strict?e(c,f):c==f:A(c,f,p)}function l(c){return c==null}function u(c){return!(!c||typeof c!="object"||typeof c.length!="number"||typeof c.copy!="function"||typeof c.slice!="function"||c.length>0&&typeof c[0]!="number")}function A(c,f,d){var p,g;if(typeof c!=typeof f||l(c)||l(f)||c.prototype!==f.prototype||n(c)!==n(f))return!1;var v=i(c),y=i(f);if(v!==y)return!1;if(v||y)return c.source===f.source&&o(c)===o(f);if(r(c)&&r(f))return a.call(c)===a.call(f);var m=u(c),b=u(f);if(m!==b)return!1;if(m||b){if(c.length!==f.length)return!1;for(p=0;p<c.length;p++)if(c[p]!==f[p])return!1;return!0}if(typeof c!=typeof f)return!1;try{var x=t(c),E=t(f)}catch{return!1}if(x.length!==E.length)return!1;for(x.sort(),E.sort(),p=x.length-1;p>=0;p--)if(x[p]!=E[p])return!1;for(p=x.length-1;p>=0;p--)if(g=x[p],!s(c[g],f[g],d))return!1;return!0}return Gy=s,Gy}function Ak(t,n){var e=!0;return sa(t,function(i){sa(n,function(o){if(e===!1)return!1;e=fk(i.geometry,o.geometry)})}),e}function fk(t,n){switch(t.type){case"Point":switch(n.type){case"Point":return!gk(t.coordinates,n.coordinates);case"LineString":return!uS(n,t);case"Polygon":return!sn(t,n)}break;case"LineString":switch(n.type){case"Point":return!uS(t,n);case"LineString":return!pk(t,n);case"Polygon":return!cS(n,t)}break;case"Polygon":switch(n.type){case"Point":return!sn(n,t);case"LineString":return!cS(t,n);case"Polygon":return!dk(n,t)}}return!1}function uS(t,n){for(var e=0;e<t.coordinates.length-1;e++)if(mk(t.coordinates[e],t.coordinates[e+1],n.coordinates))return!0;return!1}function pk(t,n){var e=Fg(t,n);return e.features.length>0}function cS(t,n){for(var e=0,i=n.coordinates;e<i.length;e++){var o=i[e];if(sn(o,t))return!0}var r=Fg(n,Mg(t));return r.features.length>0}function dk(t,n){for(var e=0,i=t.coordinates[0];e<i.length;e++){var o=i[e];if(sn(o,n))return!0}for(var r=0,a=n.coordinates[0];r<a.length;r++){var s=a[r];if(sn(s,t))return!0}var l=Fg(Mg(t),Mg(n));return l.features.length>0}function mk(t,n,e){var i=e[0]-t[0],o=e[1]-t[1],r=n[0]-t[0],a=n[1]-t[1],s=i*a-o*r;return s!==0?!1:Math.abs(r)>=Math.abs(a)?r>0?t[0]<=e[0]&&e[0]<=n[0]:n[0]<=e[0]&&e[0]<=t[0]:a>0?t[1]<=e[1]&&e[1]<=n[1]:n[1]<=e[1]&&e[1]<=t[1]}function gk(t,n){return t[0]===n[0]&&t[1]===n[1]}var Wy,hS;function yk(){if(hS)return Wy;hS=1;var t=hk(),n=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:o};n.prototype.compare=function(r,a){if(r.type!==a.type||!i(r,a))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,a.coordinates);case"LineString":return this.compareLine(r.coordinates,a.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,a);case"Feature":return this.compareFeature(r,a);default:if(r.type.indexOf("Multi")===0){var s=this,l=e(r),u=e(a);return l.every(function(A){return this.some(function(c){return s.compare(A,c)})},u)}}return!1};function e(r){return r.coordinates.map(function(a){return{type:r.type.replace("Multi",""),coordinates:a}})}function i(r,a){return r.hasOwnProperty("coordinates")?r.coordinates.length===a.coordinates.length:r.length===a.length}n.prototype.compareCoord=function(r,a){if(r.length!==a.length)return!1;for(var s=0;s<r.length;s++)if(r[s].toFixed(this.precision)!==a[s].toFixed(this.precision))return!1;return!0},n.prototype.compareLine=function(r,a,s,l){if(!i(r,a))return!1;var u=this.pseudoNode?r:this.removePseudo(r),A=this.pseudoNode?a:this.removePseudo(a);if(!(l&&!this.compareCoord(u[0],A[0])&&(A=this.fixStartIndex(A,u),!A))){var c=this.compareCoord(u[s],A[s]);return this.direction||c?this.comparePath(u,A):this.compareCoord(u[s],A[A.length-(1+s)])?this.comparePath(u.slice().reverse(),A):!1}},n.prototype.fixStartIndex=function(r,a){for(var s,l=-1,u=0;u<r.length;u++)if(this.compareCoord(r[u],a[0])){l=u;break}return l>=0&&(s=[].concat(r.slice(l,r.length),r.slice(1,l+1))),s},n.prototype.comparePath=function(r,a){var s=this;return r.every(function(l,u){return s.compareCoord(l,this[u])},a)},n.prototype.comparePolygon=function(r,a){if(this.compareLine(r.coordinates[0],a.coordinates[0],1,!0)){var s=r.coordinates.slice(1,r.coordinates.length),l=a.coordinates.slice(1,a.coordinates.length),u=this;return s.every(function(A){return this.some(function(c){return u.compareLine(A,c,1,!0)})},l)}else return!1},n.prototype.compareFeature=function(r,a){return r.id!==a.id||!this.objectComparator(r.properties,a.properties)||!this.compareBBox(r,a)?!1:this.compare(r.geometry,a.geometry)},n.prototype.compareBBox=function(r,a){return!!(!r.bbox&&!a.bbox||r.bbox&&a.bbox&&this.compareCoord(r.bbox,a.bbox))},n.prototype.removePseudo=function(r){return r};function o(r,a){return t(r,a,{strict:!0})}return Wy=n,Wy}var vk=yk();const wk=Al(vk);function bk(t,n){var e=Pi(t).type,i=Pi(n).type;if(e!==i)return!1;var o=new wk({precision:6});return o.compare(S_(t),S_(n))}function xk(t,n){var e=!1;return sa(t,function(i){sa(n,function(o){if(e===!0)return!0;e=!Ak(i.geometry,o.geometry)})}),e}/**
|
|
3709
3709
|
* splaytree v3.1.2
|
|
3710
3710
|
* Fast Splay tree for Node and browser
|
|
3711
3711
|
*
|
|
@@ -3725,8 +3725,8 @@ function (result, this, instanceIndex, frameState) {
|
|
|
3725
3725
|
|
|
3726
3726
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
3727
3727
|
and limitations under the License.
|
|
3728
|
-
***************************************************************************** */function
|
|
3729
|
-
`);var r=n+(e?" ":"│ ");t.left&&qy(t.left,r,!1,i,o),t.right&&qy(t.right,r,!0,i,o)}}var Ky=(function(){function t(n){n===void 0&&(n=C6),this._root=null,this._size=0,this._comparator=n}return t.prototype.insert=function(n,e){return this._size++,this._root=jy(n,e,this._root,this._comparator)},t.prototype.add=function(n,e){var i=new Wr(n,e);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,r=jr(n,this._root,o),a=o(n,r.key);return a===0?this._root=r:(a<0?(i.left=r.left,i.right=r,r.left=null):a>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(n){this._root=this._remove(n,this._root,this._comparator)},t.prototype._remove=function(n,e,i){var o;if(e===null)return null;e=jr(n,e,i);var r=i(n,e.key);return r===0?(e.left===null?o=e.right:(o=jr(n,e.left,i),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var n=this._root;if(n){for(;n.left;)n=n.left;return this._root=jr(n.key,this._root,this._comparator),this._root=this._remove(n.key,this._root,this._comparator),{key:n.key,data:n.data}}return null},t.prototype.findStatic=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(n){return this._root&&(this._root=jr(n,this._root,this._comparator),this._comparator(n,this._root.key)!==0)?null:this._root},t.prototype.contains=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(n,e){for(var i=this._root,o=[],r=!1;!r;)i!==null?(o.push(i),i=i.left):o.length!==0?(i=o.pop(),n.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(n,e,i,o){for(var r=[],a=this._comparator,s=this._root,l;r.length!==0||s;)if(s)r.push(s),s=s.left;else{if(s=r.pop(),l=a(s.key,e),l>0)break;if(a(s.key,n)>=0&&i.call(o,s))return this;s=s.right}return this},t.prototype.keys=function(){var n=[];return this.forEach(function(e){var i=e.key;return n.push(i)}),n},t.prototype.values=function(){var n=[];return this.forEach(function(e){var i=e.data;return n.push(i)}),n},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.left;)n=n.left;return n},t.prototype.maxNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.right;)n=n.right;return n},t.prototype.at=function(n){for(var e=this._root,i=!1,o=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),o===n)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(n){var e=this._root,i=null;if(n.right){for(i=n.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(n){var e=this._root,i=null;if(n.left!==null){for(i=n.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return P6(this._root)},t.prototype.load=function(n,e,i){e===void 0&&(e=[]),i===void 0&&(i=!1);var o=n.length,r=this._comparator;if(i&&$y(n,e,0,o-1,r),this._root===null)this._root=Zy(n,e,0,o),this._size=o;else{var a=B6(this.toList(),E6(n,e),r);o=this._size+o,this._root=Xy({head:a},0,o)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(n){n===void 0&&(n=function(i){return String(i.key)});var e=[];return qy(this._root,"",!0,function(i){return e.push(i)},n),e.join("")},t.prototype.update=function(n,e,i){var o=this._comparator,r=AS(n,this._root,o),a=r.left,s=r.right;o(n,e)<0?s=jy(e,i,s,o):a=jy(e,i,a,o),this._root=S6(a,s,o)},t.prototype.split=function(n){return AS(n,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var n,e,i;return _6(this,function(o){switch(o.label){case 0:n=this._root,e=[],i=!1,o.label=1;case 1:return i?[3,6]:n===null?[3,2]:(e.push(n),n=n.left,[3,5]);case 2:return e.length===0?[3,4]:(n=e.pop(),[4,n]);case 3:return o.sent(),n=n.right,[3,5];case 4:i=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t})();function Zy(t,n,e,i){var o=i-e;if(o>0){var r=e+Math.floor(o/2),a=t[r],s=n[r],l=new Wr(a,s);return l.left=Zy(t,n,e,r),l.right=Zy(t,n,r+1,i),l}return null}function E6(t,n){for(var e=new Wr(null,null),i=e,o=0;o<t.length;o++)i=i.next=new Wr(t[o],n[o]);return i.next=null,e.next}function P6(t){for(var n=t,e=[],i=!1,o=new Wr(null,null),r=o;!i;)n?(e.push(n),n=n.left):e.length>0?(n=r=r.next=e.pop(),n=n.right):i=!0;return r.next=null,o.next}function Xy(t,n,e){var i=e-n;if(i>0){var o=n+Math.floor(i/2),r=Xy(t,n,o),a=t.head;return a.left=r,t.head=t.head.next,a.right=Xy(t,o+1,e),a}return null}function B6(t,n,e){for(var i=new Wr(null,null),o=i,r=t,a=n;r!==null&&a!==null;)e(r.key,a.key)<0?(o.next=r,r=r.next):(o.next=a,a=a.next),o=o.next;return r!==null?o.next=r:a!==null&&(o.next=a),i.next}function $y(t,n,e,i,o){if(!(e>=i)){for(var r=t[e+i>>1],a=e-1,s=i+1;;){do a++;while(o(t[a],r)<0);do s--;while(o(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=n[a],n[a]=n[s],n[s]=l}$y(t,n,e,s,o),$y(t,n,s+1,i,o)}}const Nl=(t,n)=>t.ll.x<=n.x&&n.x<=t.ur.x&&t.ll.y<=n.y&&n.y<=t.ur.y,Yy=(t,n)=>{if(n.ur.x<t.ll.x||t.ur.x<n.ll.x||n.ur.y<t.ll.y||t.ur.y<n.ll.y)return null;const e=t.ll.x<n.ll.x?n.ll.x:t.ll.x,i=t.ur.x<n.ur.x?t.ur.x:n.ur.x,o=t.ll.y<n.ll.y?n.ll.y:t.ll.y,r=t.ur.y<n.ur.y?t.ur.y:n.ur.y;return{ll:{x:e,y:o},ur:{x:i,y:r}}};let qr=Number.EPSILON;qr===void 0&&(qr=Math.pow(2,-52));const T6=qr*qr,fS=(t,n)=>{if(-qr<t&&t<qr&&-qr<n&&n<qr)return 0;const e=t-n;return e*e<T6*t*n?0:t<n?-1:1};class I6{constructor(){this.reset()}reset(){this.xRounder=new pS,this.yRounder=new pS}round(n,e){return{x:this.xRounder.round(n),y:this.yRounder.round(e)}}}class pS{constructor(){this.tree=new Ky,this.round(0)}round(n){const e=this.tree.add(n),i=this.tree.prev(e);if(i!==null&&fS(e.key,i.key)===0)return this.tree.remove(n),i.key;const o=this.tree.next(e);return o!==null&&fS(e.key,o.key)===0?(this.tree.remove(n),o.key):n}}const Hl=new I6,cf=(t,n)=>t.x*n.y-t.y*n.x,dS=(t,n)=>t.x*n.x+t.y*n.y,mS=(t,n,e)=>{const i=kl(t.x,t.y,n.x,n.y,e.x,e.y);return i>0?-1:i<0?1:0},hf=t=>Math.sqrt(dS(t,t)),F6=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return cf(o,i)/hf(o)/hf(i)},M6=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return dS(o,i)/hf(o)/hf(i)},gS=(t,n,e)=>n.y===0?null:{x:t.x+n.x/n.y*(e-t.y),y:e},yS=(t,n,e)=>n.x===0?null:{x:e,y:t.y+n.y/n.x*(e-t.x)},D6=(t,n,e,i)=>{if(n.x===0)return yS(e,i,t.x);if(i.x===0)return yS(t,n,e.x);if(n.y===0)return gS(e,i,t.y);if(i.y===0)return gS(t,n,e.y);const o=cf(n,i);if(o==0)return null;const r={x:e.x-t.x,y:e.y-t.y},a=cf(r,n)/o,s=cf(r,i)/o,l=t.x+s*n.x,u=e.x+a*i.x,A=t.y+s*n.y,c=e.y+a*i.y,f=(l+u)/2,d=(A+c)/2;return{x:f,y:d}};class Wn{static compare(n,e){const i=Wn.comparePoints(n.point,e.point);return i!==0?i:(n.point!==e.point&&n.link(e),n.isLeft!==e.isLeft?n.isLeft?1:-1:Kr.compare(n.segment,e.segment))}static comparePoints(n,e){return n.x<e.x?-1:n.x>e.x?1:n.y<e.y?-1:n.y>e.y?1:0}constructor(n,e){n.events===void 0?n.events=[this]:n.events.push(this),this.point=n,this.isLeft=e}link(n){if(n.point===this.point)throw new Error("Tried to link already linked events");const e=n.point.events;for(let i=0,o=e.length;i<o;i++){const r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}checkForConsuming(){const n=this.point.events.length;for(let e=0;e<n;e++){const i=this.point.events[e];if(i.segment.consumedBy===void 0)for(let o=e+1;o<n;o++){const r=this.point.events[o];r.consumedBy===void 0&&i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment)}}}getAvailableLinkedEvents(){const n=[];for(let e=0,i=this.point.events.length;e<i;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&n.push(o)}return n}getLeftmostComparator(n){const e=new Map,i=o=>{const r=o.otherSE;e.set(o,{sine:F6(this.point,n.point,r.point),cosine:M6(this.point,n.point,r.point)})};return(o,r)=>{e.has(o)||i(o),e.has(r)||i(r);const{sine:a,cosine:s}=e.get(o),{sine:l,cosine:u}=e.get(r);return a>=0&&l>=0?s<u?1:s>u?-1:0:a<0&&l<0?s<u?-1:s>u?1:0:l<a?-1:l>a?1:0}}}let R6=0;class Kr{static compare(n,e){const i=n.leftSE.point.x,o=e.leftSE.point.x,r=n.rightSE.point.x,a=e.rightSE.point.x;if(a<i)return 1;if(r<o)return-1;const s=n.leftSE.point.y,l=e.leftSE.point.y,u=n.rightSE.point.y,A=e.rightSE.point.y;if(i<o){if(l<s&&l<u)return 1;if(l>s&&l>u)return-1;const c=n.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;const f=e.comparePoint(n.rightSE.point);return f!==0?f:-1}if(i>o){if(s<l&&s<A)return-1;if(s>l&&s>A)return 1;const c=e.comparePoint(n.leftSE.point);if(c!==0)return c;const f=n.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(s<l)return-1;if(s>l)return 1;if(r<a){const c=e.comparePoint(n.rightSE.point);if(c!==0)return c}if(r>a){const c=n.comparePoint(e.rightSE.point);if(c<0)return 1;if(c>0)return-1}if(r!==a){const c=u-s,f=r-i,d=A-l,p=a-o;if(c>f&&d<p)return 1;if(c<f&&d>p)return-1}return r>a?1:r<a||u<A?-1:u>A?1:n.id<e.id?-1:n.id>e.id?1:0}constructor(n,e,i,o){this.id=++R6,this.leftSE=n,n.segment=this,n.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=n,this.rings=i,this.windings=o}static fromRing(n,e,i){let o,r,a;const s=Wn.comparePoints(n,e);if(s<0)o=n,r=e,a=1;else if(s>0)o=e,r=n,a=-1;else throw new Error(`Tried to create degenerate segment at [${n.x}, ${n.y}]`);const l=new Wn(o,!0),u=new Wn(r,!1);return new Kr(l,u,[i],[a])}replaceRightSE(n){this.rightSE=n,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const n=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:n<e?n:e},ur:{x:this.rightSE.point.x,y:n>e?n:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(n){return n.x===this.leftSE.point.x&&n.y===this.leftSE.point.y||n.x===this.rightSE.point.x&&n.y===this.rightSE.point.y}comparePoint(n){if(this.isAnEndpoint(n))return 0;const e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return n.x===e.x?0:n.x<e.x?1:-1;const r=(n.y-e.y)/o.y,a=e.x+r*o.x;if(n.x===a)return 0;const s=(n.x-e.x)/o.x,l=e.y+s*o.y;return n.y===l?0:n.y<l?-1:1}getIntersection(n){const e=this.bbox(),i=n.bbox(),o=Yy(e,i);if(o===null)return null;const r=this.leftSE.point,a=this.rightSE.point,s=n.leftSE.point,l=n.rightSE.point,u=Nl(e,s)&&this.comparePoint(s)===0,A=Nl(i,r)&&n.comparePoint(r)===0,c=Nl(e,l)&&this.comparePoint(l)===0,f=Nl(i,a)&&n.comparePoint(a)===0;if(A&&u)return f&&!c?a:!f&&c?l:null;if(A)return c&&r.x===l.x&&r.y===l.y?null:r;if(u)return f&&a.x===s.x&&a.y===s.y?null:s;if(f&&c)return null;if(f)return a;if(c)return l;const d=D6(r,this.vector(),s,n.vector());return d===null||!Nl(o,d)?null:Hl.round(d.x,d.y)}split(n){const e=[],i=n.events!==void 0,o=new Wn(n,!0),r=new Wn(n,!1),a=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(o);const s=new Kr(o,a,this.rings.slice(),this.windings.slice());return Wn.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Wn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),r.checkForConsuming()),e}swapEvents(){const n=this.rightSE;this.rightSE=this.leftSE,this.leftSE=n,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}consume(n){let e=this,i=n;for(;e.consumedBy;)e=e.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const o=Kr.compare(e,i);if(o!==0){if(o>0){const r=e;e=i,i=r}if(e.prev===i){const r=e;e=i,i=r}for(let r=0,a=i.rings.length;r<a;r++){const s=i.rings[r],l=i.windings[r],u=e.rings.indexOf(s);u===-1?(e.rings.push(s),e.windings.push(l)):e.windings[u]+=l}i.rings=null,i.windings=null,i.consumedBy=e,i.leftSE.consumedBy=e.leftSE,i.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const n=this.prev.consumedBy||this.prev;this._beforeState=n.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const n=this.beforeState();this._afterState={rings:n.rings.slice(0),windings:n.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){const u=this.rings[s],A=this.windings[s],c=e.indexOf(u);c===-1?(e.push(u),i.push(A)):i[c]+=A}const r=[],a=[];for(let s=0,l=e.length;s<l;s++){if(i[s]===0)continue;const u=e[s],A=u.poly;if(a.indexOf(A)===-1)if(u.isExterior)r.push(A);else{a.indexOf(A)===-1&&a.push(A);const c=r.indexOf(u.poly);c!==-1&&r.splice(c,1)}}for(let s=0,l=r.length;s<l;s++){const u=r[s].multiPoly;o.indexOf(u)===-1&&o.push(u)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const n=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(oi.type){case"union":{const i=n.length===0,o=e.length===0;this._isInResult=i!==o;break}case"intersection":{let i,o;n.length<e.length?(i=n.length,o=e.length):(i=e.length,o=n.length),this._isInResult=o===oi.numMultiPolys&&i<o;break}case"xor":{const i=Math.abs(n.length-e.length);this._isInResult=i%2===1;break}case"difference":{const i=o=>o.length===1&&o[0].isSubject;this._isInResult=i(n)!==i(e);break}default:throw new Error(`Unrecognized operation type found ${oi.type}`)}return this._isInResult}}class vS{constructor(n,e,i){if(!Array.isArray(n)||n.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=i,this.segments=[],typeof n[0][0]!="number"||typeof n[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=Hl.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let r=o;for(let a=1,s=n.length;a<s;a++){if(typeof n[a][0]!="number"||typeof n[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=Hl.round(n[a][0],n[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(Kr.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}(o.x!==r.x||o.y!==r.y)&&this.segments.push(Kr.fromRing(r,o,this))}getSweepEvents(){const n=[];for(let e=0,i=this.segments.length;e<i;e++){const o=this.segments[e];n.push(o.leftSE),n.push(o.rightSE)}return n}}class U6{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new vS(n[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let i=1,o=n.length;i<o;i++){const r=new vS(n[i],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const n=this.exteriorRing.getSweepEvents();for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class wS{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof n[0][0][0]=="number"&&(n=[n])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let i=0,o=n.length;i<o;i++){const r=new U6(n[i],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class Af{static factory(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.isInResult()||r.ringOut)continue;let a=null,s=r.leftSE,l=r.rightSE;const u=[s],A=s.point,c=[];for(;a=s,s=l,u.push(s),s.point!==A;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const g=u[0].point,v=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${g.x}, ${g.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(f.length===1){l=f[0].otherSE;break}let d=null;for(let g=0,v=c.length;g<v;g++)if(c[g].point===s.point){d=g;break}if(d!==null){const g=c.splice(d)[0],v=u.splice(g.index);v.unshift(v[0].otherSE),e.push(new Af(v.reverse()));continue}c.push({index:u.length,point:s.point});const p=s.getLeftmostComparator(a);l=f.sort(p)[0].otherSE;break}e.push(new Af(u))}return e}constructor(n){this.events=n;for(let e=0,i=n.length;e<i;e++)n[e].segment.ringOut=this;this.poly=null}getGeom(){let n=this.events[0].point;const e=[n];for(let u=1,A=this.events.length-1;u<A;u++){const c=this.events[u].point,f=this.events[u+1].point;mS(c,n,f)!==0&&(e.push(c),n=c)}if(e.length===1)return null;const i=e[0],o=e[1];mS(i,n,o)===0&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,l=[];for(let u=a;u!=s;u+=r)l.push([e[u].x,e[u].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){const n=this.enclosingRing();this._isExteriorRing=n?!n.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let n=this.events[0];for(let o=1,r=this.events.length;o<r;o++){const a=this.events[o];Wn.compare(n,a)>0&&(n=a)}let e=n.segment.prevInResult(),i=e?e.prevInResult():null;for(;;){if(!e)return null;if(!i)return e.ringOut;if(i.ringOut!==e.ringOut)return i.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=i.prevInResult(),i=e?e.prevInResult():null}}}class bS{constructor(n){this.exteriorRing=n,n.poly=this,this.interiorRings=[]}addInterior(n){this.interiorRings.push(n),n.poly=this}getGeom(){const n=[this.exteriorRing.getGeom()];if(n[0]===null)return null;for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getGeom();o!==null&&n.push(o)}return n}}class O6{constructor(n){this.rings=n,this.polys=this._composePolys(n)}getGeom(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getGeom();o!==null&&n.push(o)}return n}_composePolys(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.poly)if(r.isExteriorRing())e.push(new bS(r));else{const a=r.enclosingRing();a.poly||e.push(new bS(a)),a.poly.addInterior(r)}}return e}}class L6{constructor(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kr.compare;this.queue=n,this.tree=new Ky(e),this.segments=[]}process(n){const e=n.segment,i=[];if(n.consumedBy)return n.isLeft?this.queue.remove(n.otherSE):this.tree.remove(e),i;const o=n.isLeft?this.tree.add(e):this.tree.find(e);if(!o)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let r=o,a=o,s,l;for(;s===void 0;)r=this.tree.prev(r),r===null?s=null:r.key.consumedBy===void 0&&(s=r.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(n.isLeft){let u=null;if(s){const c=s.getIntersection(e);if(c!==null&&(e.isAnEndpoint(c)||(u=c),!s.isAnEndpoint(c))){const f=this._splitSafely(s,c);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}}let A=null;if(l){const c=l.getIntersection(e);if(c!==null&&(e.isAnEndpoint(c)||(A=c),!l.isAnEndpoint(c))){const f=this._splitSafely(l,c);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}}if(u!==null||A!==null){let c=null;u===null?c=A:A===null?c=u:c=Wn.comparePoints(u,A)<=0?u:A,this.queue.remove(e.rightSE),i.push(e.rightSE);const f=e.split(c);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}i.length>0?(this.tree.remove(e),i.push(n)):(this.segments.push(e),e.prev=s)}else{if(s&&l){const u=s.getIntersection(l);if(u!==null){if(!s.isAnEndpoint(u)){const A=this._splitSafely(s,u);for(let c=0,f=A.length;c<f;c++)i.push(A[c])}if(!l.isAnEndpoint(u)){const A=this._splitSafely(l,u);for(let c=0,f=A.length;c<f;c++)i.push(A[c])}}}this.tree.remove(e)}return i}_splitSafely(n,e){this.tree.remove(n);const i=n.rightSE;this.queue.remove(i);const o=n.split(e);return o.push(i),n.consumedBy===void 0&&this.tree.add(n),o}}const xS=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,z6=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class k6{run(n,e,i){oi.type=n,Hl.reset();const o=[new wS(e,!0)];for(let c=0,f=i.length;c<f;c++)o.push(new wS(i[c],!1));if(oi.numMultiPolys=o.length,oi.type==="difference"){const c=o[0];let f=1;for(;f<o.length;)Yy(o[f].bbox,c.bbox)!==null?f++:o.splice(f,1)}if(oi.type==="intersection")for(let c=0,f=o.length;c<f;c++){const d=o[c];for(let p=c+1,g=o.length;p<g;p++)if(Yy(d.bbox,o[p].bbox)===null)return[]}const r=new Ky(Wn.compare);for(let c=0,f=o.length;c<f;c++){const d=o[c].getSweepEvents();for(let p=0,g=d.length;p<g;p++)if(r.insert(d[p]),r.size>xS)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const a=new L6(r);let s=r.size,l=r.pop();for(;l;){const c=l.key;if(r.size===s){const d=c.segment;throw new Error(`Unable to pop() ${c.isLeft?"left":"right"} SweepEvent [${c.point.x}, ${c.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(r.size>xS)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>z6)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=a.process(c);for(let d=0,p=f.length;d<p;d++){const g=f[d];g.consumedBy===void 0&&r.insert(g)}s=r.size,l=r.pop()}Hl.reset();const u=Af.factory(a.segments);return new O6(u).getGeom()}}const oi=new k6;var Q6={union:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("union",t,e)},intersection:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("intersection",t,e)},xor:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("xor",t,e)},difference:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("difference",t,e)}};function ff(t,n,e){e===void 0&&(e={});var i=Pi(t),o=Pi(n),r=Q6.intersection(i.coordinates,o.coordinates);return r.length===0?null:r.length===1?rn(r[0],e.properties):TL(r,e.properties)}function V6(t,n,e){e===void 0&&(e={});var i=JSON.stringify(e.properties||{}),o=t[0],r=t[1],a=t[2],s=t[3],l=(r+s)/2,u=(o+a)/2,A=n*2/Bi([o,l],[a,l],e),c=A*(a-o),f=n*2/Bi([u,r],[u,s],e),d=f*(s-r),p=c/2,g=p*2,v=Math.sqrt(3)/2*d,y=a-o,m=s-r,b=3/4*g,x=v,E=(y-g)/(g-p/2),B=Math.floor(E),P=(B*b-p/2-y)/2-p/2+b/2,I=Math.floor((m-v)/v),O=(m-I*v)/2,M=I*v-m>v/2;M&&(O-=v/4);for(var S=[],T=[],w=0;w<6;w++){var C=2*Math.PI/6*w;S.push(Math.cos(C)),T.push(Math.sin(C))}for(var U=[],F=0;F<=B;F++)for(var D=0;D<=I;D++){var R=F%2===1;if(!(D===0&&R)&&!(D===0&&M)){var L=F*b+o-P,k=D*x+r+O;if(R&&(k-=v/2),e.triangles===!0)H6([L,k],c/2,d/2,JSON.parse(i),S,T).forEach(function(V){e.mask?ff(e.mask,V)&&U.push(V):U.push(V)});else{var Q=N6([L,k],c/2,d/2,JSON.parse(i),S,T);e.mask?ff(e.mask,Q)&&U.push(Q):U.push(Q)}}}return Si(U)}function N6(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=t[0]+n*o[s],u=t[1]+e*r[s];a.push([l,u])}return a.push(a[0].slice()),rn([a],i)}function H6(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=[];l.push(t),l.push([t[0]+n*o[s],t[1]+e*r[s]]),l.push([t[0]+n*o[(s+1)%6],t[1]+e*r[(s+1)%6]]),l.push(t),a.push(rn([l],i))}return a}function G6(t,n,e,i){i===void 0&&(i={});for(var o=[],r=t[0],a=t[1],s=t[2],l=t[3],u=n/Bi([r,a],[s,a],i),A=u*(s-r),c=e/Bi([r,a],[r,l],i),f=c*(l-a),d=s-r,p=l-a,g=Math.floor(d/A),v=Math.floor(p/f),y=(d-g*A)/2,m=(p-v*f)/2,b=r+y,x=0;x<g;x++){for(var E=a+m,B=0;B<v;B++){var P=rn([[[b,E],[b,E+f],[b+A,E+f],[b+A,E],[b,E]]],i.properties);i.mask?x6(i.mask,P)&&o.push(P):o.push(P),E+=f}b+=A}return Si(o)}function W6(t,n,e){return e===void 0&&(e={}),G6(t,n,n,e)}function j6(t,n,e){e===void 0&&(e={});for(var i=[],o=n/Bi([t[0],t[1]],[t[2],t[1]],e),r=o*(t[2]-t[0]),a=n/Bi([t[0],t[1]],[t[0],t[3]],e),s=a*(t[3]-t[1]),l=0,u=t[0];u<=t[2];){for(var A=0,c=t[1];c<=t[3];){var f=null,d=null;l%2===0&&A%2===0?(f=rn([[[u,c],[u,c+s],[u+r,c],[u,c]]],e.properties),d=rn([[[u,c+s],[u+r,c+s],[u+r,c],[u,c+s]]],e.properties)):l%2===0&&A%2===1?(f=rn([[[u,c],[u+r,c+s],[u+r,c],[u,c]]],e.properties),d=rn([[[u,c],[u,c+s],[u+r,c+s],[u,c]]],e.properties)):A%2===0&&l%2===1?(f=rn([[[u,c],[u,c+s],[u+r,c+s],[u,c]]],e.properties),d=rn([[[u,c],[u+r,c+s],[u+r,c],[u,c]]],e.properties)):A%2===1&&l%2===1&&(f=rn([[[u,c],[u,c+s],[u+r,c],[u,c]]],e.properties),d=rn([[[u,c+s],[u+r,c+s],[u+r,c],[u,c+s]]],e.properties)),e.mask?(ff(e.mask,f)&&i.push(f),ff(e.mask,d)&&i.push(d)):(i.push(f),i.push(d)),c+=s,A++}l++,u+=r}return Si(i)}function q6(t,n,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var i=e.gridType,o=e.property,r=e.weight;if(!t)throw new Error("points is required");if(FL(t,"Point","input must contain Points"),!n)throw new Error("cellSize is required");if(r!==void 0&&typeof r!="number")throw new Error("weight must be a number");o=o||"elevation",i=i||"square",r=r||1;var a=Ho(t),s;switch(i){case"point":case"points":s=k_(a,n,e);break;case"square":case"squares":s=W6(a,n,e);break;case"hex":case"hexes":s=V6(a,n,e);break;case"triangle":case"triangles":s=j6(a,n,e);break;default:throw new Error("invalid gridType")}var l=[];return nf(s,function(u){var A=0,c=0;nf(t,function(d){var p=i==="point"?u:pz(u),g=Bi(p,d,e),v;if(o!==void 0&&(v=d.properties[o]),v===void 0&&(v=d.geometry.coordinates[2]),v===void 0)throw new Error("zValue is missing");g===0&&(A=v);var y=1/Math.pow(g,r);c+=y,A+=y*v});var f=Az(u);f.properties[o]=A/c,l.push(f)}),Si(l)}function K6(t,n,e){const i=_.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=_.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=_.Cartesian3.subtract(o,i,new _.Cartesian3);_.Cartesian3.normalize(r,r);const a=new _.Ray(i,r),s=e.pickFromRay(a);return!!(e.globe.pick(a,e)||s)}const _S=(t=0)=>new Promise(n=>setTimeout(n,t));function Z6(t,n){const e=Si(t.map(l=>Gr(l))),i=rn([t]);return q6(e,n,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates).filter(l=>sn(Gr(l),i))}function X6(t){const n=_.JulianDate.fromDate(t),e=_.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(n);return Ma(e)}function $6(t,n,e){const i=t[0]+(n[0]-t[0])*e,o=t[1]+(n[1]-t[1])*e,r=t[2]+(n[2]-t[2])*e,a=t[3]+(n[3]-t[3])*e;return[i,o,r,a]}const dc=class dc extends Tn{constructor(e,i){super(e,i);z(this,"czmPointPrimitiveCollection");z(this,"_stopRun",!1);const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Eo(i,e.id));this.czmPointPrimitiveCollection=r,this.d(h.track([r,"show"],[e,"show"]));{const a=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){r.pointPrimitiveOptions=void 0;return}const l=[...e.points,e.points[0]],u=e.sampleDistance,A=Z6(l,u).map(b=>[...b,e.height]),c=Math.floor(e.extrudedHeight/u);if(c>0){const b=[...A];for(let x=1;x<=c;x++)A.push(...b.map(E=>[E[0],E[1],e.height+x*u]))}const{startTime:f,endTime:d,spanTime:p}=e,g=p*36e5,v=Math.floor((d-f)/g),y=Array(A.length).fill(0);e:for(let b=0;b<v;b++){if(await _S(),this._stopRun)break e;const x=new Date(f+b*g),E=X6(x);t:for(let B=0;B<A.length;B++){if(await _S(),this._stopRun)break t;K6(A[B],E,o.scene)||(y[B]=(y[B]*v+1)/v)}!this._stopRun&&(e.progress=Number(((b+1)/v*100).toFixed(2)))}const m=A.map((b,x)=>({position:[...b],color:$6(e.startColor,e.endColor,y[x]),pixelSize:10}));r.pointPrimitiveOptions=m},s=this.dv(h.createProcessingFromAsyncFunc(async l=>{await l.promise(a())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,r.pointPrimitiveOptions=void 0,e.progress=0,s.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,r.pointPrimitiveOptions=void 0,e.progress=0,s.isRunning&&s.cancel()}))}}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}};z(dc,"type",dc.register("ESCesiumViewer",h.ESSunshineAnalysis.type,dc));let Jy=dc;const CS=Math.pow(2,-52),pf=new Uint32Array(512);class ev{static from(n,e=nk,i=ik){const o=n.length,r=new Float64Array(o*2);for(let a=0;a<o;a++){const s=n[a];r[2*a]=e(s),r[2*a+1]=i(s)}return new ev(r)}constructor(n){const e=n.length>>1;if(e>0&&typeof n[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=n;const i=Math.max(2*e-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:n,_hullPrev:e,_hullNext:i,_hullTri:o,_hullHash:r}=this,a=n.length>>1;let s=1/0,l=1/0,u=-1/0,A=-1/0;for(let M=0;M<a;M++){const S=n[2*M],T=n[2*M+1];S<s&&(s=S),T<l&&(l=T),S>u&&(u=S),T>A&&(A=T),this._ids[M]=M}const c=(s+u)/2,f=(l+A)/2;let d=1/0,p,g,v;for(let M=0;M<a;M++){const S=tv(c,f,n[2*M],n[2*M+1]);S<d&&(p=M,d=S)}const y=n[2*p],m=n[2*p+1];d=1/0;for(let M=0;M<a;M++){if(M===p)continue;const S=tv(y,m,n[2*M],n[2*M+1]);S<d&&S>0&&(g=M,d=S)}let b=n[2*g],x=n[2*g+1],E=1/0;for(let M=0;M<a;M++){if(M===p||M===g)continue;const S=ek(y,m,b,x,n[2*M],n[2*M+1]);S<E&&(v=M,E=S)}let B=n[2*v],P=n[2*v+1];if(E===1/0){for(let T=0;T<a;T++)this._dists[T]=n[2*T]-n[0]||n[2*T+1]-n[1];pa(this._ids,this._dists,0,a-1);const M=new Uint32Array(a);let S=0;for(let T=0,w=-1/0;T<a;T++){const C=this._ids[T];this._dists[C]>w&&(M[S++]=C,w=this._dists[C])}this.hull=M.subarray(0,S),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(kl(y,m,b,x,B,P)<0){const M=g,S=b,T=x;g=v,b=B,x=P,v=M,B=S,P=T}const I=tk(y,m,b,x,B,P);this._cx=I.x,this._cy=I.y;for(let M=0;M<a;M++)this._dists[M]=tv(n[2*M],n[2*M+1],I.x,I.y);pa(this._ids,this._dists,0,a-1),this._hullStart=p;let O=3;i[p]=e[v]=g,i[g]=e[p]=v,i[v]=e[g]=p,o[p]=0,o[g]=1,o[v]=2,r.fill(-1),r[this._hashKey(y,m)]=p,r[this._hashKey(b,x)]=g,r[this._hashKey(B,P)]=v,this.trianglesLen=0,this._addTriangle(p,g,v,-1,-1,-1);for(let M=0,S,T;M<this._ids.length;M++){const w=this._ids[M],C=n[2*w],U=n[2*w+1];if(M>0&&Math.abs(C-S)<=CS&&Math.abs(U-T)<=CS||(S=C,T=U,w===p||w===g||w===v))continue;let F=0;for(let Q=0,V=this._hashKey(C,U);Q<this._hashSize&&(F=r[(V+Q)%this._hashSize],!(F!==-1&&F!==i[F]));Q++);F=e[F];let D=F,R;for(;R=i[D],kl(C,U,n[2*D],n[2*D+1],n[2*R],n[2*R+1])>=0;)if(D=R,D===F){D=-1;break}if(D===-1)continue;let L=this._addTriangle(D,w,i[D],-1,-1,o[D]);o[w]=this._legalize(L+2),o[D]=L,O++;let k=i[D];for(;R=i[k],kl(C,U,n[2*k],n[2*k+1],n[2*R],n[2*R+1])<0;)L=this._addTriangle(k,w,R,o[w],-1,o[k]),o[w]=this._legalize(L+2),i[k]=k,O--,k=R;if(D===F)for(;R=e[D],kl(C,U,n[2*R],n[2*R+1],n[2*D],n[2*D+1])<0;)L=this._addTriangle(R,w,D,-1,o[D],o[R]),this._legalize(L+2),o[R]=L,i[D]=D,O--,D=R;this._hullStart=e[w]=D,i[D]=e[k]=w,i[w]=k,r[this._hashKey(C,U)]=w,r[this._hashKey(n[2*D],n[2*D+1])]=D}this.hull=new Uint32Array(O);for(let M=0,S=this._hullStart;M<O;M++)this.hull[M]=S,S=i[S];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(n,e){return Math.floor(Y6(n-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(n){const{_triangles:e,_halfedges:i,coords:o}=this;let r=0,a=0;for(;;){const s=i[n],l=n-n%3;if(a=l+(n+2)%3,s===-1){if(r===0)break;n=pf[--r];continue}const u=s-s%3,A=l+(n+1)%3,c=u+(s+2)%3,f=e[a],d=e[n],p=e[A],g=e[c];if(J6(o[2*f],o[2*f+1],o[2*d],o[2*d+1],o[2*p],o[2*p+1],o[2*g],o[2*g+1])){e[n]=g,e[s]=f;const y=i[c];if(y===-1){let b=this._hullStart;do{if(this._hullTri[b]===c){this._hullTri[b]=n;break}b=this._hullPrev[b]}while(b!==this._hullStart)}this._link(n,y),this._link(s,i[a]),this._link(a,c);const m=u+(s+1)%3;r<pf.length&&(pf[r++]=m)}else{if(r===0)break;n=pf[--r]}}return a}_link(n,e){this._halfedges[n]=e,e!==-1&&(this._halfedges[e]=n)}_addTriangle(n,e,i,o,r,a){const s=this.trianglesLen;return this._triangles[s]=n,this._triangles[s+1]=e,this._triangles[s+2]=i,this._link(s,o),this._link(s+1,r),this._link(s+2,a),this.trianglesLen+=3,s}}function Y6(t,n){const e=t/(Math.abs(t)+Math.abs(n));return(n>0?3-e:1+e)/4}function tv(t,n,e,i){const o=t-e,r=n-i;return o*o+r*r}function J6(t,n,e,i,o,r,a,s){const l=t-a,u=n-s,A=e-a,c=i-s,f=o-a,d=r-s,p=l*l+u*u,g=A*A+c*c,v=f*f+d*d;return l*(c*v-g*d)-u*(A*v-g*f)+p*(A*d-c*f)<0}function ek(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,c=l*l+u*u,f=.5/(a*u-s*l),d=(u*A-s*c)*f,p=(a*c-l*A)*f;return d*d+p*p}function tk(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,c=l*l+u*u,f=.5/(a*u-s*l),d=t+(u*A-s*c)*f,p=n+(a*c-l*A)*f;return{x:d,y:p}}function pa(t,n,e,i){if(i-e<=20)for(let o=e+1;o<=i;o++){const r=t[o],a=n[r];let s=o-1;for(;s>=e&&n[t[s]]>a;)t[s+1]=t[s--];t[s+1]=r}else{const o=e+i>>1;let r=e+1,a=i;Gl(t,o,r),n[t[e]]>n[t[i]]&&Gl(t,e,i),n[t[r]]>n[t[i]]&&Gl(t,r,i),n[t[e]]>n[t[r]]&&Gl(t,e,r);const s=t[r],l=n[s];for(;;){do r++;while(n[t[r]]<l);do a--;while(n[t[a]]>l);if(a<r)break;Gl(t,r,a)}t[e+1]=t[a],t[a]=s,i-r+1>=a-e?(pa(t,n,r,i),pa(t,n,e,a-1)):(pa(t,n,e,a-1),pa(t,n,r,i))}}function Gl(t,n,e){const i=t[n];t[n]=t[e],t[e]=i}function nk(t){return t[0]}function ik(t){return t[1]}const SS=(t=0)=>new Promise(n=>setTimeout(n,t)),Jo=class Jo extends h.Destroyable{constructor(e,i){super();z(this,"_pickedEvent",this.disposeVar(new h.Event));z(this,"_startEvent",this.disposeVar(new h.Event));z(this,"_stopEvent",this.dv(new h.Event));z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_geoPolyline");z(this,"_customPrimitive");z(this,"_geoDivPoi");z(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Xe(e,i)),this._customPrimitive=this.disposeVar(new st(e,i)),this._geoDivPoi=this.disposeVar(new yt(e,i)),this.ad(this._geoDivPoi.pickedEvent.don(r=>{zi(r)===0&&this.pickedEvent.emit(r)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(r=>{this._geoPolyline&&this._geoPolyline.flyTo(r)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
|
|
3728
|
+
***************************************************************************** */function _k(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(A){return l([u,A])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,o&&(r=u[0]&2?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,o=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){e.label=u[1];break}if(u[0]===6&&e.label<r[1]){e.label=r[1],r=u;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(u);break}r[2]&&e.ops.pop(),e.trys.pop();continue}u=n.call(t,e)}catch(A){u=[6,A],o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Wr=(function(){function t(n,e){this.next=null,this.key=n,this.data=e,this.left=null,this.right=null}return t})();function Ck(t,n){return t>n?1:t<n?-1:0}function jr(t,n,e){for(var i=new Wr(null,null),o=i,r=i;;){var a=e(t,n.key);if(a<0){if(n.left===null)break;if(e(t,n.left.key)<0){var s=n.left;if(n.left=s.right,s.right=n,n=s,n.left===null)break}r.left=n,r=n,n=n.left}else if(a>0){if(n.right===null)break;if(e(t,n.right.key)>0){var s=n.right;if(n.right=s.left,s.left=n,n=s,n.right===null)break}o.right=n,o=n,n=n.right}else break}return o.right=n.left,r.left=n.right,n.left=i.right,n.right=i.left,n}function jy(t,n,e,i){var o=new Wr(t,n);if(e===null)return o.left=o.right=null,o;e=jr(t,e,i);var r=i(t,e.key);return r<0?(o.left=e.left,o.right=e,e.left=null):r>=0&&(o.right=e.right,o.left=e,e.right=null),o}function AS(t,n,e){var i=null,o=null;if(n){n=jr(t,n,e);var r=e(n.key,t);r===0?(i=n.left,o=n.right):r<0?(o=n.right,n.right=null,i=n):(i=n.left,n.left=null,o=n)}return{left:i,right:o}}function Sk(t,n,e){return n===null?t:(t===null||(n=jr(t.key,n,e),n.left=t),n)}function qy(t,n,e,i,o){if(t){i(""+n+(e?"└── ":"├── ")+o(t)+`
|
|
3729
|
+
`);var r=n+(e?" ":"│ ");t.left&&qy(t.left,r,!1,i,o),t.right&&qy(t.right,r,!0,i,o)}}var Ky=(function(){function t(n){n===void 0&&(n=Ck),this._root=null,this._size=0,this._comparator=n}return t.prototype.insert=function(n,e){return this._size++,this._root=jy(n,e,this._root,this._comparator)},t.prototype.add=function(n,e){var i=new Wr(n,e);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,r=jr(n,this._root,o),a=o(n,r.key);return a===0?this._root=r:(a<0?(i.left=r.left,i.right=r,r.left=null):a>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(n){this._root=this._remove(n,this._root,this._comparator)},t.prototype._remove=function(n,e,i){var o;if(e===null)return null;e=jr(n,e,i);var r=i(n,e.key);return r===0?(e.left===null?o=e.right:(o=jr(n,e.left,i),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var n=this._root;if(n){for(;n.left;)n=n.left;return this._root=jr(n.key,this._root,this._comparator),this._root=this._remove(n.key,this._root,this._comparator),{key:n.key,data:n.data}}return null},t.prototype.findStatic=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(n){return this._root&&(this._root=jr(n,this._root,this._comparator),this._comparator(n,this._root.key)!==0)?null:this._root},t.prototype.contains=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(n,e){for(var i=this._root,o=[],r=!1;!r;)i!==null?(o.push(i),i=i.left):o.length!==0?(i=o.pop(),n.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(n,e,i,o){for(var r=[],a=this._comparator,s=this._root,l;r.length!==0||s;)if(s)r.push(s),s=s.left;else{if(s=r.pop(),l=a(s.key,e),l>0)break;if(a(s.key,n)>=0&&i.call(o,s))return this;s=s.right}return this},t.prototype.keys=function(){var n=[];return this.forEach(function(e){var i=e.key;return n.push(i)}),n},t.prototype.values=function(){var n=[];return this.forEach(function(e){var i=e.data;return n.push(i)}),n},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.left;)n=n.left;return n},t.prototype.maxNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.right;)n=n.right;return n},t.prototype.at=function(n){for(var e=this._root,i=!1,o=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),o===n)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(n){var e=this._root,i=null;if(n.right){for(i=n.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(n){var e=this._root,i=null;if(n.left!==null){for(i=n.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return Pk(this._root)},t.prototype.load=function(n,e,i){e===void 0&&(e=[]),i===void 0&&(i=!1);var o=n.length,r=this._comparator;if(i&&$y(n,e,0,o-1,r),this._root===null)this._root=Zy(n,e,0,o),this._size=o;else{var a=Bk(this.toList(),Ek(n,e),r);o=this._size+o,this._root=Xy({head:a},0,o)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(n){n===void 0&&(n=function(i){return String(i.key)});var e=[];return qy(this._root,"",!0,function(i){return e.push(i)},n),e.join("")},t.prototype.update=function(n,e,i){var o=this._comparator,r=AS(n,this._root,o),a=r.left,s=r.right;o(n,e)<0?s=jy(e,i,s,o):a=jy(e,i,a,o),this._root=Sk(a,s,o)},t.prototype.split=function(n){return AS(n,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var n,e,i;return _k(this,function(o){switch(o.label){case 0:n=this._root,e=[],i=!1,o.label=1;case 1:return i?[3,6]:n===null?[3,2]:(e.push(n),n=n.left,[3,5]);case 2:return e.length===0?[3,4]:(n=e.pop(),[4,n]);case 3:return o.sent(),n=n.right,[3,5];case 4:i=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t})();function Zy(t,n,e,i){var o=i-e;if(o>0){var r=e+Math.floor(o/2),a=t[r],s=n[r],l=new Wr(a,s);return l.left=Zy(t,n,e,r),l.right=Zy(t,n,r+1,i),l}return null}function Ek(t,n){for(var e=new Wr(null,null),i=e,o=0;o<t.length;o++)i=i.next=new Wr(t[o],n[o]);return i.next=null,e.next}function Pk(t){for(var n=t,e=[],i=!1,o=new Wr(null,null),r=o;!i;)n?(e.push(n),n=n.left):e.length>0?(n=r=r.next=e.pop(),n=n.right):i=!0;return r.next=null,o.next}function Xy(t,n,e){var i=e-n;if(i>0){var o=n+Math.floor(i/2),r=Xy(t,n,o),a=t.head;return a.left=r,t.head=t.head.next,a.right=Xy(t,o+1,e),a}return null}function Bk(t,n,e){for(var i=new Wr(null,null),o=i,r=t,a=n;r!==null&&a!==null;)e(r.key,a.key)<0?(o.next=r,r=r.next):(o.next=a,a=a.next),o=o.next;return r!==null?o.next=r:a!==null&&(o.next=a),i.next}function $y(t,n,e,i,o){if(!(e>=i)){for(var r=t[e+i>>1],a=e-1,s=i+1;;){do a++;while(o(t[a],r)<0);do s--;while(o(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=n[a],n[a]=n[s],n[s]=l}$y(t,n,e,s,o),$y(t,n,s+1,i,o)}}const Nl=(t,n)=>t.ll.x<=n.x&&n.x<=t.ur.x&&t.ll.y<=n.y&&n.y<=t.ur.y,Yy=(t,n)=>{if(n.ur.x<t.ll.x||t.ur.x<n.ll.x||n.ur.y<t.ll.y||t.ur.y<n.ll.y)return null;const e=t.ll.x<n.ll.x?n.ll.x:t.ll.x,i=t.ur.x<n.ur.x?t.ur.x:n.ur.x,o=t.ll.y<n.ll.y?n.ll.y:t.ll.y,r=t.ur.y<n.ur.y?t.ur.y:n.ur.y;return{ll:{x:e,y:o},ur:{x:i,y:r}}};let qr=Number.EPSILON;qr===void 0&&(qr=Math.pow(2,-52));const Tk=qr*qr,fS=(t,n)=>{if(-qr<t&&t<qr&&-qr<n&&n<qr)return 0;const e=t-n;return e*e<Tk*t*n?0:t<n?-1:1};class Ik{constructor(){this.reset()}reset(){this.xRounder=new pS,this.yRounder=new pS}round(n,e){return{x:this.xRounder.round(n),y:this.yRounder.round(e)}}}class pS{constructor(){this.tree=new Ky,this.round(0)}round(n){const e=this.tree.add(n),i=this.tree.prev(e);if(i!==null&&fS(e.key,i.key)===0)return this.tree.remove(n),i.key;const o=this.tree.next(e);return o!==null&&fS(e.key,o.key)===0?(this.tree.remove(n),o.key):n}}const Hl=new Ik,cf=(t,n)=>t.x*n.y-t.y*n.x,dS=(t,n)=>t.x*n.x+t.y*n.y,mS=(t,n,e)=>{const i=kl(t.x,t.y,n.x,n.y,e.x,e.y);return i>0?-1:i<0?1:0},hf=t=>Math.sqrt(dS(t,t)),Fk=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return cf(o,i)/hf(o)/hf(i)},Mk=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return dS(o,i)/hf(o)/hf(i)},gS=(t,n,e)=>n.y===0?null:{x:t.x+n.x/n.y*(e-t.y),y:e},yS=(t,n,e)=>n.x===0?null:{x:e,y:t.y+n.y/n.x*(e-t.x)},Dk=(t,n,e,i)=>{if(n.x===0)return yS(e,i,t.x);if(i.x===0)return yS(t,n,e.x);if(n.y===0)return gS(e,i,t.y);if(i.y===0)return gS(t,n,e.y);const o=cf(n,i);if(o==0)return null;const r={x:e.x-t.x,y:e.y-t.y},a=cf(r,n)/o,s=cf(r,i)/o,l=t.x+s*n.x,u=e.x+a*i.x,A=t.y+s*n.y,c=e.y+a*i.y,f=(l+u)/2,d=(A+c)/2;return{x:f,y:d}};class Wn{static compare(n,e){const i=Wn.comparePoints(n.point,e.point);return i!==0?i:(n.point!==e.point&&n.link(e),n.isLeft!==e.isLeft?n.isLeft?1:-1:Kr.compare(n.segment,e.segment))}static comparePoints(n,e){return n.x<e.x?-1:n.x>e.x?1:n.y<e.y?-1:n.y>e.y?1:0}constructor(n,e){n.events===void 0?n.events=[this]:n.events.push(this),this.point=n,this.isLeft=e}link(n){if(n.point===this.point)throw new Error("Tried to link already linked events");const e=n.point.events;for(let i=0,o=e.length;i<o;i++){const r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}checkForConsuming(){const n=this.point.events.length;for(let e=0;e<n;e++){const i=this.point.events[e];if(i.segment.consumedBy===void 0)for(let o=e+1;o<n;o++){const r=this.point.events[o];r.consumedBy===void 0&&i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment)}}}getAvailableLinkedEvents(){const n=[];for(let e=0,i=this.point.events.length;e<i;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&n.push(o)}return n}getLeftmostComparator(n){const e=new Map,i=o=>{const r=o.otherSE;e.set(o,{sine:Fk(this.point,n.point,r.point),cosine:Mk(this.point,n.point,r.point)})};return(o,r)=>{e.has(o)||i(o),e.has(r)||i(r);const{sine:a,cosine:s}=e.get(o),{sine:l,cosine:u}=e.get(r);return a>=0&&l>=0?s<u?1:s>u?-1:0:a<0&&l<0?s<u?-1:s>u?1:0:l<a?-1:l>a?1:0}}}let Rk=0;class Kr{static compare(n,e){const i=n.leftSE.point.x,o=e.leftSE.point.x,r=n.rightSE.point.x,a=e.rightSE.point.x;if(a<i)return 1;if(r<o)return-1;const s=n.leftSE.point.y,l=e.leftSE.point.y,u=n.rightSE.point.y,A=e.rightSE.point.y;if(i<o){if(l<s&&l<u)return 1;if(l>s&&l>u)return-1;const c=n.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;const f=e.comparePoint(n.rightSE.point);return f!==0?f:-1}if(i>o){if(s<l&&s<A)return-1;if(s>l&&s>A)return 1;const c=e.comparePoint(n.leftSE.point);if(c!==0)return c;const f=n.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(s<l)return-1;if(s>l)return 1;if(r<a){const c=e.comparePoint(n.rightSE.point);if(c!==0)return c}if(r>a){const c=n.comparePoint(e.rightSE.point);if(c<0)return 1;if(c>0)return-1}if(r!==a){const c=u-s,f=r-i,d=A-l,p=a-o;if(c>f&&d<p)return 1;if(c<f&&d>p)return-1}return r>a?1:r<a||u<A?-1:u>A?1:n.id<e.id?-1:n.id>e.id?1:0}constructor(n,e,i,o){this.id=++Rk,this.leftSE=n,n.segment=this,n.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=n,this.rings=i,this.windings=o}static fromRing(n,e,i){let o,r,a;const s=Wn.comparePoints(n,e);if(s<0)o=n,r=e,a=1;else if(s>0)o=e,r=n,a=-1;else throw new Error(`Tried to create degenerate segment at [${n.x}, ${n.y}]`);const l=new Wn(o,!0),u=new Wn(r,!1);return new Kr(l,u,[i],[a])}replaceRightSE(n){this.rightSE=n,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const n=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:n<e?n:e},ur:{x:this.rightSE.point.x,y:n>e?n:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(n){return n.x===this.leftSE.point.x&&n.y===this.leftSE.point.y||n.x===this.rightSE.point.x&&n.y===this.rightSE.point.y}comparePoint(n){if(this.isAnEndpoint(n))return 0;const e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return n.x===e.x?0:n.x<e.x?1:-1;const r=(n.y-e.y)/o.y,a=e.x+r*o.x;if(n.x===a)return 0;const s=(n.x-e.x)/o.x,l=e.y+s*o.y;return n.y===l?0:n.y<l?-1:1}getIntersection(n){const e=this.bbox(),i=n.bbox(),o=Yy(e,i);if(o===null)return null;const r=this.leftSE.point,a=this.rightSE.point,s=n.leftSE.point,l=n.rightSE.point,u=Nl(e,s)&&this.comparePoint(s)===0,A=Nl(i,r)&&n.comparePoint(r)===0,c=Nl(e,l)&&this.comparePoint(l)===0,f=Nl(i,a)&&n.comparePoint(a)===0;if(A&&u)return f&&!c?a:!f&&c?l:null;if(A)return c&&r.x===l.x&&r.y===l.y?null:r;if(u)return f&&a.x===s.x&&a.y===s.y?null:s;if(f&&c)return null;if(f)return a;if(c)return l;const d=Dk(r,this.vector(),s,n.vector());return d===null||!Nl(o,d)?null:Hl.round(d.x,d.y)}split(n){const e=[],i=n.events!==void 0,o=new Wn(n,!0),r=new Wn(n,!1),a=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(o);const s=new Kr(o,a,this.rings.slice(),this.windings.slice());return Wn.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Wn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),r.checkForConsuming()),e}swapEvents(){const n=this.rightSE;this.rightSE=this.leftSE,this.leftSE=n,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}consume(n){let e=this,i=n;for(;e.consumedBy;)e=e.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const o=Kr.compare(e,i);if(o!==0){if(o>0){const r=e;e=i,i=r}if(e.prev===i){const r=e;e=i,i=r}for(let r=0,a=i.rings.length;r<a;r++){const s=i.rings[r],l=i.windings[r],u=e.rings.indexOf(s);u===-1?(e.rings.push(s),e.windings.push(l)):e.windings[u]+=l}i.rings=null,i.windings=null,i.consumedBy=e,i.leftSE.consumedBy=e.leftSE,i.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const n=this.prev.consumedBy||this.prev;this._beforeState=n.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const n=this.beforeState();this._afterState={rings:n.rings.slice(0),windings:n.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){const u=this.rings[s],A=this.windings[s],c=e.indexOf(u);c===-1?(e.push(u),i.push(A)):i[c]+=A}const r=[],a=[];for(let s=0,l=e.length;s<l;s++){if(i[s]===0)continue;const u=e[s],A=u.poly;if(a.indexOf(A)===-1)if(u.isExterior)r.push(A);else{a.indexOf(A)===-1&&a.push(A);const c=r.indexOf(u.poly);c!==-1&&r.splice(c,1)}}for(let s=0,l=r.length;s<l;s++){const u=r[s].multiPoly;o.indexOf(u)===-1&&o.push(u)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const n=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(oi.type){case"union":{const i=n.length===0,o=e.length===0;this._isInResult=i!==o;break}case"intersection":{let i,o;n.length<e.length?(i=n.length,o=e.length):(i=e.length,o=n.length),this._isInResult=o===oi.numMultiPolys&&i<o;break}case"xor":{const i=Math.abs(n.length-e.length);this._isInResult=i%2===1;break}case"difference":{const i=o=>o.length===1&&o[0].isSubject;this._isInResult=i(n)!==i(e);break}default:throw new Error(`Unrecognized operation type found ${oi.type}`)}return this._isInResult}}class vS{constructor(n,e,i){if(!Array.isArray(n)||n.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=i,this.segments=[],typeof n[0][0]!="number"||typeof n[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=Hl.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let r=o;for(let a=1,s=n.length;a<s;a++){if(typeof n[a][0]!="number"||typeof n[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=Hl.round(n[a][0],n[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(Kr.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}(o.x!==r.x||o.y!==r.y)&&this.segments.push(Kr.fromRing(r,o,this))}getSweepEvents(){const n=[];for(let e=0,i=this.segments.length;e<i;e++){const o=this.segments[e];n.push(o.leftSE),n.push(o.rightSE)}return n}}class Uk{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new vS(n[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let i=1,o=n.length;i<o;i++){const r=new vS(n[i],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const n=this.exteriorRing.getSweepEvents();for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class wS{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof n[0][0][0]=="number"&&(n=[n])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let i=0,o=n.length;i<o;i++){const r=new Uk(n[i],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class Af{static factory(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.isInResult()||r.ringOut)continue;let a=null,s=r.leftSE,l=r.rightSE;const u=[s],A=s.point,c=[];for(;a=s,s=l,u.push(s),s.point!==A;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const g=u[0].point,v=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${g.x}, ${g.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(f.length===1){l=f[0].otherSE;break}let d=null;for(let g=0,v=c.length;g<v;g++)if(c[g].point===s.point){d=g;break}if(d!==null){const g=c.splice(d)[0],v=u.splice(g.index);v.unshift(v[0].otherSE),e.push(new Af(v.reverse()));continue}c.push({index:u.length,point:s.point});const p=s.getLeftmostComparator(a);l=f.sort(p)[0].otherSE;break}e.push(new Af(u))}return e}constructor(n){this.events=n;for(let e=0,i=n.length;e<i;e++)n[e].segment.ringOut=this;this.poly=null}getGeom(){let n=this.events[0].point;const e=[n];for(let u=1,A=this.events.length-1;u<A;u++){const c=this.events[u].point,f=this.events[u+1].point;mS(c,n,f)!==0&&(e.push(c),n=c)}if(e.length===1)return null;const i=e[0],o=e[1];mS(i,n,o)===0&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,l=[];for(let u=a;u!=s;u+=r)l.push([e[u].x,e[u].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){const n=this.enclosingRing();this._isExteriorRing=n?!n.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let n=this.events[0];for(let o=1,r=this.events.length;o<r;o++){const a=this.events[o];Wn.compare(n,a)>0&&(n=a)}let e=n.segment.prevInResult(),i=e?e.prevInResult():null;for(;;){if(!e)return null;if(!i)return e.ringOut;if(i.ringOut!==e.ringOut)return i.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=i.prevInResult(),i=e?e.prevInResult():null}}}class bS{constructor(n){this.exteriorRing=n,n.poly=this,this.interiorRings=[]}addInterior(n){this.interiorRings.push(n),n.poly=this}getGeom(){const n=[this.exteriorRing.getGeom()];if(n[0]===null)return null;for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getGeom();o!==null&&n.push(o)}return n}}class Ok{constructor(n){this.rings=n,this.polys=this._composePolys(n)}getGeom(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getGeom();o!==null&&n.push(o)}return n}_composePolys(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.poly)if(r.isExteriorRing())e.push(new bS(r));else{const a=r.enclosingRing();a.poly||e.push(new bS(a)),a.poly.addInterior(r)}}return e}}class Lk{constructor(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kr.compare;this.queue=n,this.tree=new Ky(e),this.segments=[]}process(n){const e=n.segment,i=[];if(n.consumedBy)return n.isLeft?this.queue.remove(n.otherSE):this.tree.remove(e),i;const o=n.isLeft?this.tree.add(e):this.tree.find(e);if(!o)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let r=o,a=o,s,l;for(;s===void 0;)r=this.tree.prev(r),r===null?s=null:r.key.consumedBy===void 0&&(s=r.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(n.isLeft){let u=null;if(s){const c=s.getIntersection(e);if(c!==null&&(e.isAnEndpoint(c)||(u=c),!s.isAnEndpoint(c))){const f=this._splitSafely(s,c);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}}let A=null;if(l){const c=l.getIntersection(e);if(c!==null&&(e.isAnEndpoint(c)||(A=c),!l.isAnEndpoint(c))){const f=this._splitSafely(l,c);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}}if(u!==null||A!==null){let c=null;u===null?c=A:A===null?c=u:c=Wn.comparePoints(u,A)<=0?u:A,this.queue.remove(e.rightSE),i.push(e.rightSE);const f=e.split(c);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}i.length>0?(this.tree.remove(e),i.push(n)):(this.segments.push(e),e.prev=s)}else{if(s&&l){const u=s.getIntersection(l);if(u!==null){if(!s.isAnEndpoint(u)){const A=this._splitSafely(s,u);for(let c=0,f=A.length;c<f;c++)i.push(A[c])}if(!l.isAnEndpoint(u)){const A=this._splitSafely(l,u);for(let c=0,f=A.length;c<f;c++)i.push(A[c])}}}this.tree.remove(e)}return i}_splitSafely(n,e){this.tree.remove(n);const i=n.rightSE;this.queue.remove(i);const o=n.split(e);return o.push(i),n.consumedBy===void 0&&this.tree.add(n),o}}const xS=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,zk=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class kk{run(n,e,i){oi.type=n,Hl.reset();const o=[new wS(e,!0)];for(let c=0,f=i.length;c<f;c++)o.push(new wS(i[c],!1));if(oi.numMultiPolys=o.length,oi.type==="difference"){const c=o[0];let f=1;for(;f<o.length;)Yy(o[f].bbox,c.bbox)!==null?f++:o.splice(f,1)}if(oi.type==="intersection")for(let c=0,f=o.length;c<f;c++){const d=o[c];for(let p=c+1,g=o.length;p<g;p++)if(Yy(d.bbox,o[p].bbox)===null)return[]}const r=new Ky(Wn.compare);for(let c=0,f=o.length;c<f;c++){const d=o[c].getSweepEvents();for(let p=0,g=d.length;p<g;p++)if(r.insert(d[p]),r.size>xS)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const a=new Lk(r);let s=r.size,l=r.pop();for(;l;){const c=l.key;if(r.size===s){const d=c.segment;throw new Error(`Unable to pop() ${c.isLeft?"left":"right"} SweepEvent [${c.point.x}, ${c.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(r.size>xS)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>zk)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=a.process(c);for(let d=0,p=f.length;d<p;d++){const g=f[d];g.consumedBy===void 0&&r.insert(g)}s=r.size,l=r.pop()}Hl.reset();const u=Af.factory(a.segments);return new Ok(u).getGeom()}}const oi=new kk;var Qk={union:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("union",t,e)},intersection:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("intersection",t,e)},xor:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("xor",t,e)},difference:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return oi.run("difference",t,e)}};function ff(t,n,e){e===void 0&&(e={});var i=Pi(t),o=Pi(n),r=Qk.intersection(i.coordinates,o.coordinates);return r.length===0?null:r.length===1?rn(r[0],e.properties):TL(r,e.properties)}function Vk(t,n,e){e===void 0&&(e={});var i=JSON.stringify(e.properties||{}),o=t[0],r=t[1],a=t[2],s=t[3],l=(r+s)/2,u=(o+a)/2,A=n*2/Bi([o,l],[a,l],e),c=A*(a-o),f=n*2/Bi([u,r],[u,s],e),d=f*(s-r),p=c/2,g=p*2,v=Math.sqrt(3)/2*d,y=a-o,m=s-r,b=3/4*g,x=v,E=(y-g)/(g-p/2),B=Math.floor(E),P=(B*b-p/2-y)/2-p/2+b/2,I=Math.floor((m-v)/v),O=(m-I*v)/2,M=I*v-m>v/2;M&&(O-=v/4);for(var S=[],T=[],w=0;w<6;w++){var C=2*Math.PI/6*w;S.push(Math.cos(C)),T.push(Math.sin(C))}for(var U=[],F=0;F<=B;F++)for(var D=0;D<=I;D++){var R=F%2===1;if(!(D===0&&R)&&!(D===0&&M)){var L=F*b+o-P,k=D*x+r+O;if(R&&(k-=v/2),e.triangles===!0)Hk([L,k],c/2,d/2,JSON.parse(i),S,T).forEach(function(V){e.mask?ff(e.mask,V)&&U.push(V):U.push(V)});else{var Q=Nk([L,k],c/2,d/2,JSON.parse(i),S,T);e.mask?ff(e.mask,Q)&&U.push(Q):U.push(Q)}}}return Si(U)}function Nk(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=t[0]+n*o[s],u=t[1]+e*r[s];a.push([l,u])}return a.push(a[0].slice()),rn([a],i)}function Hk(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=[];l.push(t),l.push([t[0]+n*o[s],t[1]+e*r[s]]),l.push([t[0]+n*o[(s+1)%6],t[1]+e*r[(s+1)%6]]),l.push(t),a.push(rn([l],i))}return a}function Gk(t,n,e,i){i===void 0&&(i={});for(var o=[],r=t[0],a=t[1],s=t[2],l=t[3],u=n/Bi([r,a],[s,a],i),A=u*(s-r),c=e/Bi([r,a],[r,l],i),f=c*(l-a),d=s-r,p=l-a,g=Math.floor(d/A),v=Math.floor(p/f),y=(d-g*A)/2,m=(p-v*f)/2,b=r+y,x=0;x<g;x++){for(var E=a+m,B=0;B<v;B++){var P=rn([[[b,E],[b,E+f],[b+A,E+f],[b+A,E],[b,E]]],i.properties);i.mask?xk(i.mask,P)&&o.push(P):o.push(P),E+=f}b+=A}return Si(o)}function Wk(t,n,e){return e===void 0&&(e={}),Gk(t,n,n,e)}function jk(t,n,e){e===void 0&&(e={});for(var i=[],o=n/Bi([t[0],t[1]],[t[2],t[1]],e),r=o*(t[2]-t[0]),a=n/Bi([t[0],t[1]],[t[0],t[3]],e),s=a*(t[3]-t[1]),l=0,u=t[0];u<=t[2];){for(var A=0,c=t[1];c<=t[3];){var f=null,d=null;l%2===0&&A%2===0?(f=rn([[[u,c],[u,c+s],[u+r,c],[u,c]]],e.properties),d=rn([[[u,c+s],[u+r,c+s],[u+r,c],[u,c+s]]],e.properties)):l%2===0&&A%2===1?(f=rn([[[u,c],[u+r,c+s],[u+r,c],[u,c]]],e.properties),d=rn([[[u,c],[u,c+s],[u+r,c+s],[u,c]]],e.properties)):A%2===0&&l%2===1?(f=rn([[[u,c],[u,c+s],[u+r,c+s],[u,c]]],e.properties),d=rn([[[u,c],[u+r,c+s],[u+r,c],[u,c]]],e.properties)):A%2===1&&l%2===1&&(f=rn([[[u,c],[u,c+s],[u+r,c],[u,c]]],e.properties),d=rn([[[u,c+s],[u+r,c+s],[u+r,c],[u,c+s]]],e.properties)),e.mask?(ff(e.mask,f)&&i.push(f),ff(e.mask,d)&&i.push(d)):(i.push(f),i.push(d)),c+=s,A++}l++,u+=r}return Si(i)}function qk(t,n,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var i=e.gridType,o=e.property,r=e.weight;if(!t)throw new Error("points is required");if(FL(t,"Point","input must contain Points"),!n)throw new Error("cellSize is required");if(r!==void 0&&typeof r!="number")throw new Error("weight must be a number");o=o||"elevation",i=i||"square",r=r||1;var a=Ho(t),s;switch(i){case"point":case"points":s=k_(a,n,e);break;case"square":case"squares":s=Wk(a,n,e);break;case"hex":case"hexes":s=Vk(a,n,e);break;case"triangle":case"triangles":s=jk(a,n,e);break;default:throw new Error("invalid gridType")}var l=[];return nf(s,function(u){var A=0,c=0;nf(t,function(d){var p=i==="point"?u:pz(u),g=Bi(p,d,e),v;if(o!==void 0&&(v=d.properties[o]),v===void 0&&(v=d.geometry.coordinates[2]),v===void 0)throw new Error("zValue is missing");g===0&&(A=v);var y=1/Math.pow(g,r);c+=y,A+=y*v});var f=Az(u);f.properties[o]=A/c,l.push(f)}),Si(l)}function Kk(t,n,e){const i=_.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=_.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=_.Cartesian3.subtract(o,i,new _.Cartesian3);_.Cartesian3.normalize(r,r);const a=new _.Ray(i,r),s=e.pickFromRay(a);return!!(e.globe.pick(a,e)||s)}const _S=(t=0)=>new Promise(n=>setTimeout(n,t));function Zk(t,n){const e=Si(t.map(l=>Gr(l))),i=rn([t]);return qk(e,n,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates).filter(l=>sn(Gr(l),i))}function Xk(t){const n=_.JulianDate.fromDate(t),e=_.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(n);return Ma(e)}function $k(t,n,e){const i=t[0]+(n[0]-t[0])*e,o=t[1]+(n[1]-t[1])*e,r=t[2]+(n[2]-t[2])*e,a=t[3]+(n[3]-t[3])*e;return[i,o,r,a]}const dc=class dc extends Tn{constructor(e,i){super(e,i);z(this,"czmPointPrimitiveCollection");z(this,"_stopRun",!1);const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Eo(i,e.id));this.czmPointPrimitiveCollection=r,this.d(h.track([r,"show"],[e,"show"]));{const a=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){r.pointPrimitiveOptions=void 0;return}const l=[...e.points,e.points[0]],u=e.sampleDistance,A=Zk(l,u).map(b=>[...b,e.height]),c=Math.floor(e.extrudedHeight/u);if(c>0){const b=[...A];for(let x=1;x<=c;x++)A.push(...b.map(E=>[E[0],E[1],e.height+x*u]))}const{startTime:f,endTime:d,spanTime:p}=e,g=p*36e5,v=Math.floor((d-f)/g),y=Array(A.length).fill(0);e:for(let b=0;b<v;b++){if(await _S(),this._stopRun)break e;const x=new Date(f+b*g),E=Xk(x);t:for(let B=0;B<A.length;B++){if(await _S(),this._stopRun)break t;Kk(A[B],E,o.scene)||(y[B]=(y[B]*v+1)/v)}!this._stopRun&&(e.progress=Number(((b+1)/v*100).toFixed(2)))}const m=A.map((b,x)=>({position:[...b],color:$k(e.startColor,e.endColor,y[x]),pixelSize:10}));r.pointPrimitiveOptions=m},s=this.dv(h.createProcessingFromAsyncFunc(async l=>{await l.promise(a())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,r.pointPrimitiveOptions=void 0,e.progress=0,s.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,r.pointPrimitiveOptions=void 0,e.progress=0,s.isRunning&&s.cancel()}))}}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}};z(dc,"type",dc.register("ESCesiumViewer",h.ESSunshineAnalysis.type,dc));let Jy=dc;const CS=Math.pow(2,-52),pf=new Uint32Array(512);class ev{static from(n,e=n6,i=i6){const o=n.length,r=new Float64Array(o*2);for(let a=0;a<o;a++){const s=n[a];r[2*a]=e(s),r[2*a+1]=i(s)}return new ev(r)}constructor(n){const e=n.length>>1;if(e>0&&typeof n[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=n;const i=Math.max(2*e-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:n,_hullPrev:e,_hullNext:i,_hullTri:o,_hullHash:r}=this,a=n.length>>1;let s=1/0,l=1/0,u=-1/0,A=-1/0;for(let M=0;M<a;M++){const S=n[2*M],T=n[2*M+1];S<s&&(s=S),T<l&&(l=T),S>u&&(u=S),T>A&&(A=T),this._ids[M]=M}const c=(s+u)/2,f=(l+A)/2;let d=1/0,p,g,v;for(let M=0;M<a;M++){const S=tv(c,f,n[2*M],n[2*M+1]);S<d&&(p=M,d=S)}const y=n[2*p],m=n[2*p+1];d=1/0;for(let M=0;M<a;M++){if(M===p)continue;const S=tv(y,m,n[2*M],n[2*M+1]);S<d&&S>0&&(g=M,d=S)}let b=n[2*g],x=n[2*g+1],E=1/0;for(let M=0;M<a;M++){if(M===p||M===g)continue;const S=e6(y,m,b,x,n[2*M],n[2*M+1]);S<E&&(v=M,E=S)}let B=n[2*v],P=n[2*v+1];if(E===1/0){for(let T=0;T<a;T++)this._dists[T]=n[2*T]-n[0]||n[2*T+1]-n[1];pa(this._ids,this._dists,0,a-1);const M=new Uint32Array(a);let S=0;for(let T=0,w=-1/0;T<a;T++){const C=this._ids[T];this._dists[C]>w&&(M[S++]=C,w=this._dists[C])}this.hull=M.subarray(0,S),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(kl(y,m,b,x,B,P)<0){const M=g,S=b,T=x;g=v,b=B,x=P,v=M,B=S,P=T}const I=t6(y,m,b,x,B,P);this._cx=I.x,this._cy=I.y;for(let M=0;M<a;M++)this._dists[M]=tv(n[2*M],n[2*M+1],I.x,I.y);pa(this._ids,this._dists,0,a-1),this._hullStart=p;let O=3;i[p]=e[v]=g,i[g]=e[p]=v,i[v]=e[g]=p,o[p]=0,o[g]=1,o[v]=2,r.fill(-1),r[this._hashKey(y,m)]=p,r[this._hashKey(b,x)]=g,r[this._hashKey(B,P)]=v,this.trianglesLen=0,this._addTriangle(p,g,v,-1,-1,-1);for(let M=0,S,T;M<this._ids.length;M++){const w=this._ids[M],C=n[2*w],U=n[2*w+1];if(M>0&&Math.abs(C-S)<=CS&&Math.abs(U-T)<=CS||(S=C,T=U,w===p||w===g||w===v))continue;let F=0;for(let Q=0,V=this._hashKey(C,U);Q<this._hashSize&&(F=r[(V+Q)%this._hashSize],!(F!==-1&&F!==i[F]));Q++);F=e[F];let D=F,R;for(;R=i[D],kl(C,U,n[2*D],n[2*D+1],n[2*R],n[2*R+1])>=0;)if(D=R,D===F){D=-1;break}if(D===-1)continue;let L=this._addTriangle(D,w,i[D],-1,-1,o[D]);o[w]=this._legalize(L+2),o[D]=L,O++;let k=i[D];for(;R=i[k],kl(C,U,n[2*k],n[2*k+1],n[2*R],n[2*R+1])<0;)L=this._addTriangle(k,w,R,o[w],-1,o[k]),o[w]=this._legalize(L+2),i[k]=k,O--,k=R;if(D===F)for(;R=e[D],kl(C,U,n[2*R],n[2*R+1],n[2*D],n[2*D+1])<0;)L=this._addTriangle(R,w,D,-1,o[D],o[R]),this._legalize(L+2),o[R]=L,i[D]=D,O--,D=R;this._hullStart=e[w]=D,i[D]=e[k]=w,i[w]=k,r[this._hashKey(C,U)]=w,r[this._hashKey(n[2*D],n[2*D+1])]=D}this.hull=new Uint32Array(O);for(let M=0,S=this._hullStart;M<O;M++)this.hull[M]=S,S=i[S];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(n,e){return Math.floor(Yk(n-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(n){const{_triangles:e,_halfedges:i,coords:o}=this;let r=0,a=0;for(;;){const s=i[n],l=n-n%3;if(a=l+(n+2)%3,s===-1){if(r===0)break;n=pf[--r];continue}const u=s-s%3,A=l+(n+1)%3,c=u+(s+2)%3,f=e[a],d=e[n],p=e[A],g=e[c];if(Jk(o[2*f],o[2*f+1],o[2*d],o[2*d+1],o[2*p],o[2*p+1],o[2*g],o[2*g+1])){e[n]=g,e[s]=f;const y=i[c];if(y===-1){let b=this._hullStart;do{if(this._hullTri[b]===c){this._hullTri[b]=n;break}b=this._hullPrev[b]}while(b!==this._hullStart)}this._link(n,y),this._link(s,i[a]),this._link(a,c);const m=u+(s+1)%3;r<pf.length&&(pf[r++]=m)}else{if(r===0)break;n=pf[--r]}}return a}_link(n,e){this._halfedges[n]=e,e!==-1&&(this._halfedges[e]=n)}_addTriangle(n,e,i,o,r,a){const s=this.trianglesLen;return this._triangles[s]=n,this._triangles[s+1]=e,this._triangles[s+2]=i,this._link(s,o),this._link(s+1,r),this._link(s+2,a),this.trianglesLen+=3,s}}function Yk(t,n){const e=t/(Math.abs(t)+Math.abs(n));return(n>0?3-e:1+e)/4}function tv(t,n,e,i){const o=t-e,r=n-i;return o*o+r*r}function Jk(t,n,e,i,o,r,a,s){const l=t-a,u=n-s,A=e-a,c=i-s,f=o-a,d=r-s,p=l*l+u*u,g=A*A+c*c,v=f*f+d*d;return l*(c*v-g*d)-u*(A*v-g*f)+p*(A*d-c*f)<0}function e6(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,c=l*l+u*u,f=.5/(a*u-s*l),d=(u*A-s*c)*f,p=(a*c-l*A)*f;return d*d+p*p}function t6(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,c=l*l+u*u,f=.5/(a*u-s*l),d=t+(u*A-s*c)*f,p=n+(a*c-l*A)*f;return{x:d,y:p}}function pa(t,n,e,i){if(i-e<=20)for(let o=e+1;o<=i;o++){const r=t[o],a=n[r];let s=o-1;for(;s>=e&&n[t[s]]>a;)t[s+1]=t[s--];t[s+1]=r}else{const o=e+i>>1;let r=e+1,a=i;Gl(t,o,r),n[t[e]]>n[t[i]]&&Gl(t,e,i),n[t[r]]>n[t[i]]&&Gl(t,r,i),n[t[e]]>n[t[r]]&&Gl(t,e,r);const s=t[r],l=n[s];for(;;){do r++;while(n[t[r]]<l);do a--;while(n[t[a]]>l);if(a<r)break;Gl(t,r,a)}t[e+1]=t[a],t[a]=s,i-r+1>=a-e?(pa(t,n,r,i),pa(t,n,e,a-1)):(pa(t,n,e,a-1),pa(t,n,r,i))}}function Gl(t,n,e){const i=t[n];t[n]=t[e],t[e]=i}function n6(t){return t[0]}function i6(t){return t[1]}const SS=(t=0)=>new Promise(n=>setTimeout(n,t)),Jo=class Jo extends h.Destroyable{constructor(e,i){super();z(this,"_pickedEvent",this.disposeVar(new h.Event));z(this,"_startEvent",this.disposeVar(new h.Event));z(this,"_stopEvent",this.dv(new h.Event));z(this,"_flyToEvent",this.disposeVar(new h.Event));z(this,"_geoPolyline");z(this,"_customPrimitive");z(this,"_geoDivPoi");z(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Xe(e,i)),this._customPrimitive=this.disposeVar(new st(e,i)),this._geoDivPoi=this.disposeVar(new yt(e,i)),this.ad(this._geoDivPoi.pickedEvent.don(r=>{zi(r)===0&&this.pickedEvent.emit(r)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(r=>{this._geoPolyline&&this._geoPolyline.flyTo(r)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
|
|
3730
3730
|
uniform vec4 u_color;
|
|
3731
3731
|
void main()
|
|
3732
3732
|
{
|
|
@@ -3738,7 +3738,7 @@ void main()
|
|
|
3738
3738
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
3739
3739
|
}
|
|
3740
3740
|
`,this._customPrimitive.uniformMap={u_color:[1,1,0,1]},this.d(h.track([this._customPrimitive,"show"],[this,"show"])),this.d(h.track([this._geoPolyline,"show"],[this,"show"])),this.d(h.bind([this._geoPolyline,"positions"],[this,"positions"])),this.d(h.bind([this._geoPolyline,"width"],[this,"outlineWidth"])),this.d(h.bind([this._geoPolyline,"color"],[this,"outlineColor"]));{let r=function(u,A){const c=[];for(const f of A)switch(f){case"SquareMeter_SquareKilometer":u>=1e6?c.push(`面积:${(u/1e6).toFixed(2)} km²`):c.push(`面积:${u.toFixed(2)} m²`);break;case"MU_Hectare":const d=u*(1/666.7);if(d>=15){const p=d/15;c.push(`面积:${p.toFixed(2)} 公顷`)}else c.push(`面积:${d.toFixed(2)} 亩`);break}return c};const a=()=>{let u=[];this.totalArea?this._starting?u=["分析计算中..."]:u=[...r(this.totalArea,this.units)]:this._starting?u=["分析计算中..."]:u=["暂无分析结果"],this._geoDivPoi&&(this._geoDivPoi.innerHTML=fo([...u].join(`
|
|
3741
|
-
`),24))};a(),this.d(this.totalAreaChanged.don(a)),this.d(this.unitsChanged.don(a)),this.d(h.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=Ox(this.positions):this._geoDivPoi.position=void 0)}));const s=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??Jo.defaults.interpolationDistance,A=this.interpolation??Jo.defaults.interpolation,c=this.offsetHeight??Jo.defaults.offsetHeight,f=this.drillDepth??Jo.defaults.drillDepth,d=[];if(this.positions)for(let L=0;L<this.positions.length;++L){const k=_.Cartesian3.fromDegrees(this.positions[L][0],this.positions[L][1],this.positions[L][2]);d.push(k)}var p=ok(d);if(isNaN(p.x)||isNaN(p.y)||isNaN(p.z)){console.warn("法向量计算错误!");return}var g=sk(d),v=_.Cartesian3.normalize(g,new _.Cartesian3),y=_.Cartesian3.dot(v,p);y<0&&(p=ES(p),d.reverse());let m=_.Transforms.eastNorthUpToFixedFrame(g),b=_.Matrix4.inverseTransformation(m,new _.Matrix4);if(Math.abs(y)<.999){const L=ak(p,v);var x=ES(g),E=_.Matrix4.fromTranslation(x,new _.Matrix4);b=_.Matrix4.multiply(L,E,E),m=_.Matrix4.inverse(b,new _.Matrix4)}var B=da(d,b),P=[],I=[],O=uk(B);if(A&&u>0){var M=lk(B);const L=Math.max(M.maxy-M.miny,M.maxx-M.minx);var S=fk(O,M,u);const k=await nv(S,m,b,p,o.scene,c,f,L);var T=pk(B,u);const Q=await nv(T,m,b,p,o.scene,c,f,L);I.push(...k.world_cartesian),P.push(...k.local),I.push(...Q.world_cartesian),P.push(...Q.local);for(let V=0;V<B.length;++V){const G=B[V];var w=await nv([G],m,b,p,o.scene,c,f,L);if(w.local.length>0)P.push(...w.local),I.push(...w.world_cartesian);else{const $=[G.x,G.y,G.z+c];P.push($);var C=da([_.Cartesian3.fromArray($)],m);for(let Y=0;Y<C.length;++Y)I.push(C[Y])}}}else{const L=B.map(k=>_.Cartesian3.fromArray([k.x,k.y,k.z+L]));P=L,I=da(L,m)}var U=ck(P,O);const F=hk(I,U);this.totalArea=F;const D=[];P.forEach(L=>{const k=[L.x,L.y,L.z];k&&D.push(...k)});const R={position:{typedArray:new Float32Array(D),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=_.Matrix4.toArray(m),this.customPrimitive.attributes=R;const L=await rk([...U]);this.customPrimitive.indexTypedArray=new Uint32Array(L),this.customPrimitive.show=!0;const k=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!k)return;const{min:Q,max:V}=k;this.customPrimitive.setLocalAxisedBoundingBox(Q,V)}},l=this.dv(h.createProcessingFromAsyncFunc(async u=>{await u.promise(s()),this._starting=!1,a()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,a(),l.restart()})),this.d(this.stopEvent.don(()=>{l.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,a()}))}}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}};z(Jo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let Go=Jo;(t=>{t.createDefaultProps=()=>({positions:h.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:h.reactArray([1,1,1,1]),units:h.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(Go||(Go={})),h.extendClassProps(Go.prototype,Go.createDefaultProps);async function rk(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const n=t.length/3|0,e=new Array(n*6);for(let i=0;i<n;++i)await SS(),e[i*6+0]=t[i*3+0],e[i*6+1]=t[i*3+1],e[i*6+2]=t[i*3+2],e[i*6+3]=t[i*3+1],e[i*6+4]=t[i*3+2],e[i*6+5]=t[i*3+0];return e}function ok(t){var n=new _.Cartesian3(0,0,0),e=new _.Cartesian3(0,0,0),i=new _.Cartesian3(0,0,0),o=new _.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var r=t.length;for(let u=0;u<r;++u){var a=t[u],s;u==0?s=t[t.length-1]:s=t[u-1];var l;u==t.length-1?l=t[0]:l=t[u+1],n=_.Cartesian3.subtract(a,s,n),e=_.Cartesian3.subtract(a,l,e),i=_.Cartesian3.cross(n,e,i),!i.equalsEpsilon(_.Cartesian3.ZERO,_.Math.EPSILON6)&&(i=_.Cartesian3.normalize(i,i),o=_.Cartesian3.add(o,i,o))}return i.x=o.x/r,i.y=o.y/r,i.z=o.z/r,i}function sk(t){var n=new _.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var i=t[o];n=_.Cartesian3.add(n,i,n)}return n.x=n.x/e,n.y=n.y/e,n.z=n.z/e,n}function ES(t){return new _.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function ak(t,n){var e=_.Cartesian3.cross(t,n,new _.Cartesian3);e=_.Cartesian3.normalize(e,e);var i=_.Cartesian3.cross(t,e,new _.Cartesian3);i=_.Cartesian3.normalize(i,i);var o=t,r=new _.Matrix4(e.x,e.y,e.z,0,i.x,i.y,i.z,0,o.x,o.y,o.z,0,0,0,0,1);return r}function da(t,n){var e=[];for(let r=0;r<t.length;++r){var i=t[r],o=_.Matrix4.multiplyByPoint(n,i,new _.Cartesian3);e.push(o)}return e}function lk(t){var n=t[0].x,e=t[0].y,i=t[0].x,o=t[0].y;return t.forEach(r=>{n=Math.min(n,r.x),e=Math.min(e,r.y),i=Math.max(i,r.x),o=Math.max(o,r.y)}),{minx:n,miny:e,maxx:i,maxy:o}}function uk(t){var n=[];return t.forEach(e=>{n.push([e.x,e.y])}),n.push(n[0]),n}function ck(t,n){var e=[];t.forEach(a=>{const s=[a.x,a.y];e.push(s)});var i=ev.from(e).triangles;const o=[],r=rn([n]);for(let a=0;a<i.length;a+=3){const s=i[a],l=i[a+1],u=i[a+2],A=(t[s].x+t[l].x+t[u].x)/3,c=(t[s].y+t[l].y+t[u].y)/3;sn([A,c],r)&&o.push(s,l,u)}return new Uint32Array(o.reverse())}function hk(t,n){for(var e=0,i=0;i<n.length;i+=3){const o=[t[n[i]],t[n[i+1]],t[n[i+2]]];e+=Ak(o)}return e}function Ak(t){var n=_.Cartesian3.distance(t[0],t[1]),e=_.Cartesian3.distance(t[1],t[2]),i=_.Cartesian3.distance(t[2],t[0]),o=(n+e+i)/2,r=Math.sqrt(o*(o-n)*(o-e)*(o-i));return r||0}function fk(t,n,e){for(var i=[],o=n.minx;o<n.maxx;o+=e)for(var r=n.miny;r<n.maxy;r+=e)mk([o,r],t)&&i.push(new _.Cartesian3(o,r,0));return i}function pk(t,n){var e=[];for(let a=0;a<t.length;++a){var i=t[a],o;a==t.length-1?o=t[0]:o=t[a+1];var r=dk(i,o,n);e.push(...r)}return e}function dk(t,n,e){var i=[],o=_.Cartesian3.distance(t,n),r=_.Cartesian3.subtract(n,t,new _.Cartesian3);if(r.equalsEpsilon(_.Cartesian3.ZERO,_.Math.EPSILON6))return[];r=_.Cartesian3.normalize(r,r);for(var a=e;a<o;){var s=new _.Cartesian3(r.x*a,r.y*a,r.z*a),l=_.Cartesian3.add(t,s,new _.Cartesian3);i.push(l),a+=e}return i}function mk(t,n){var e=Gr(t);if(!b6(Gr(n[0]),Gr(n[n.length-1])))return!1;var i=[];i.push(n);var o=rn(i);return sn(e,o)}async function nv(t,n,e,i,o,r,a,s){var l=[];t.forEach(b=>{var x=b.clone();x.z=s,l.push(x)});var u=da(l,n),A=new _.Cartesian3(-1*i.x,-1*i.y,-1*i.z),c=[],f=[],d=[];for(let b=0;b<u.length;++b){await SS();var p=u[b],g=new _.Ray(p,A),v=void 0;try{v=o.pickFromRay(g)}catch{}if(!v){g=new _.Ray(p,i);try{v=o.pickFromRay(g)}catch{}}if(v){var y=v.position;if(!(!y||!y.x||isNaN(y.x))){var m=da([y],e);m.forEach(x=>{x.z+=r}),y=da(m,n)[0],d.push(y),y=_.Cartographic.fromCartesian(y),c.push([y.longitude,y.latitude,y.height]),f.push(m[0])}}}return{local:f,world:c,world_cartesian:d}}const mc=class mc extends Tn{constructor(e,i){super(e,i);z(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new Go(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmAreaMeasurement;this.ad(h.track([e,"surfaceArea"],[r,"totalArea"])),this.ad(h.track([r,"units"],[e,"units"])),this.d(h.track([r,"show"],[e,"show"])),this.d(h.track([r,"positions"],[e,"points"])),this.d(h.track([r,"interpolationDistance"],[e,"interpolation"])),this.d(h.track([r,"offsetHeight"],[e,"offsetHeight"]));{const a=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)r.outlineWidth=e.strokeWidth;else{r.outlineWidth=0;return}r.outlineWidth=e.strokeWidth,r.outlineColor=e.strokeColor};a();const s=this.disposeVar(h.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(s.disposableOn(a))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}};z(mc,"type",mc.register("ESCesiumViewer",h.ESSurfaceAreaMeasurement.type,mc));let iv=mc;async function gk(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(n){console.log("复制失败")})}const gc=class gc extends h.EngineObject{constructor(e,i){super(e,i);z(this,"_customDiv");if(this._customDiv=this.disposeVar(new h.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends h.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof rt))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A)),A.style.width="100%",A.style.position="absolute",A.style.height=`${h.ESViewerStatusBar.defaults.height}px`,A.style.left="0",A.style.bottom="0",A.style.color="#fff",A.style.padding="0 20px 0 0",A.style.boxSizing="border-box",A.style.lineHeight=`${h.ESViewerStatusBar.defaults.height}px`,A.style.zIndex="100",A.style.alignContent="center",A.style.justifyContent="space-between";const c=document.createElement("span");A.appendChild(c),this.dispose(()=>A.removeChild(c));const f=document.createElement("span");c.appendChild(f),this.dispose(()=>c.removeChild(f));const d=document.createElement("span");c.appendChild(d),d.addEventListener("dblclick",function(){let g=d.innerHTML;g.startsWith("鼠标位置")&&(g=g.slice(5)),gk(g)}),d.style.cursor="pointer",this.dispose(()=>c.removeChild(d));const p=document.createElement("span");A.appendChild(p),this.dispose(()=>A.removeChild(p));{const g=()=>{A.style.height=(e.height??h.ESViewerStatusBar.defaults.height)+"px",A.style.lineHeight=(e.height??h.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(g)),g()}{const g=()=>{A.style.fontSize=(e.fontSize??h.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(g)),g()}{const g=()=>{e.bgColor?A.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:A.style.background=`rgba(${h.ESViewerStatusBar.defaults.bgColor[0]},${h.ESViewerStatusBar.defaults.bgColor[1]},${h.ESViewerStatusBar.defaults.bgColor[2]},${h.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(g)),g()}{p.innerText=`Cesium 版本 : ${_.VERSION} `;let g;const v=()=>{e.show?(A.style.display="flex",g=this.disposeVar(h.createAnimateFrameWithStartValues(()=>{var E;let y="",m="";const b=u.getCameraInfo();if(b){const B=(I,O)=>b.position[I].toFixed(O),P=(I,O)=>b.rotation[I].toFixed(O);y=`帧率:${u.getFPS()}FPS 经度: ${B(0,5)}° 纬度: ${B(1,5)}° 高度: ${B(2,2)}米 偏航角: ${P(0,2)}° 俯仰角: ${P(1,2)}° 翻滚角:${P(2,2)}° `}f.innerText=y;const x=(E=u.extensions)==null?void 0:E.cursorPositionInfo.cursorPosition;if(x){const B=(P,I)=>x[P].toFixed(I);m=`鼠标位置:${B(0,5)}° ${B(1,5)}° ${B(2,2)}m`}else m="暂时无法获取鼠标位置...";d.innerText=m})),g.start()):(A.style.display="none",g.destroy())};this.dispose(e.showChanged.disposableOn(v)),v()}}}}get customDiv(){return this._customDiv}};z(gc,"type",gc.register("ESCesiumViewer",h.ESViewerStatusBar.type,gc));let rv=gc;const yc=class yc extends h.EngineObject{constructor(e,i){super(e,i);z(this,"_customDiv");if(this._customDiv=this.disposeVar(new h.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(h.track([r,"show"],[e,"show"])),r.instanceClass=class extends h.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof rt))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));const c=document.createElement("div");A.appendChild(c),c.style.width="100%",c.className="ESViewerStatusBarScale",c.style.position="absolute",c.style.display="flex",c.style.height=`${h.ESViewerStatusBarScale.defaults.height}px`,c.style.left="0",c.style.bottom="0",c.style.color="#fff",c.style.padding="0 20px 0 0",c.style.boxSizing="border-box",c.style.lineHeight=`${h.ESViewerStatusBarScale.defaults.height}px`,c.style.zIndex="100",c.style.alignContent="center",c.style.justifyContent="space-between";const f=document.createElement("div");c.appendChild(f);const d=document.createElement("div");f.appendChild(d);const p=document.createElement("div");f.appendChild(p);const g=document.createElement("div");c.appendChild(g);const v=document.createElement("div");g.appendChild(v);const y=document.createElement("div");v.appendChild(y);const m=document.createElement("div");v.appendChild(m);const b=document.createElement("span");g.appendChild(b);{const I=()=>{c.style.height=(e.height??h.ESViewerStatusBarScale.defaults.height)+"px",c.style.lineHeight=(e.height??h.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(I)),I()}{const I=()=>{c.style.fontSize=(e.fontSize??h.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(I)),I()}{const I=()=>{e.bgColor?c.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:c.style.background=`rgba(${h.ESViewerStatusBarScale.defaults.bgColor[0]},${h.ESViewerStatusBarScale.defaults.bgColor[1]},${h.ESViewerStatusBarScale.defaults.bgColor[2]},${h.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(I)),I()}f.style.display="flex",d.style.fontWeight="bold",d.style.padding="0 0 0 25px";let x="EarthSDK";d.innerText=x,p.style.fontWeight="";let E="——免费开源地球可视化开发包";p.innerText=E,g.style.width="550px",v.style.position="fixed",v.style.width="125px",v.style.height="30px",v.style.padding="0 5px",v.style.display="flex",v.style.justifyContent="flex-end",v.style.pointerEvents="auto",v.style.zIndex="101",y.style.width="125px",y.style.display="inline-block",y.style.textAlign="center",y.style.fontSize="14px",y.style.fontWeight="lighter",y.style.lineHeight="30px",y.style.color="#fff",y.innerHTML="1000km",m.style.borderRight="1px solid #fff",m.style.borderLeft="1px solid #fff",m.style.borderBottom="1px solid #fff",m.style.position="absolute",m.style.height="10px",m.style.top="15px",m.style.width="75px",m.style.right="30px",b.style.display="flex",b.style.zIndex="101",b.style.justifyContent="flex-end",b.style.right="0";const B=()=>{const I=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||I&&I>1e6)v.style.display="none";else{v.style.display="block";const O=i.viewerLegend.legend.computedLengthInStr;O&&(y.innerHTML=O);const M=i.viewerLegend.legend.computedLengthInPixels;if(M){m.style.width=`${M}px`;const S=(135-M)/2;m.style.left=`${S}px`}}};B();const P=setInterval(()=>{B()},200);this.dispose(()=>clearInterval(P));{let I;const O=()=>{e.show?(A.style.display="block",I=this.disposeVar(h.createAnimateFrameWithStartValues(()=>{var w;let M="";const S=u.getCameraInfo();if(S){const C=(U,F)=>S.position[U].toFixed(F);M+=`帧率:${u.getFPS()}FPS 相机: ${C(2,2)}米 `}const T=(w=u.extensions)==null?void 0:w.cursorPositionInfo.cursorPosition;if(T){const C=(U,F)=>T[U].toFixed(F);M+=`位置:${C(0,5)}° ${C(1,5)}° ${C(2,2)}米`}else M+="暂时无法获取鼠标位置...";b.innerText=M})),I.start()):(A.style.display="none",I.destroy())};this.dispose(e.showChanged.disposableOn(O)),O()}}}}get customDiv(){return this._customDiv}};z(yc,"type",yc.register("ESCesiumViewer",h.ESViewerStatusBarScale.type,yc));let ov=yc;const PS=_.Math.toDegrees,yk=new _.Cartographic;function BS(t,n,e){const i=_.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=_.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=_.Cartesian3.subtract(o,i,new _.Cartesian3);_.Cartesian3.normalize(r,r);const a=new _.Ray(i,r),s=e.pickFromRay(a),l=e.globe.pick(a,e);var u;if(s&&s.position&&l){const p=_.Cartesian3.distance(i,s.position),g=_.Cartesian3.distance(i,l);u=p<g?s.position:l}else s&&s.position?u=s.position:l&&(u=l);if(!u)return;const A=_.Cartesian3.distance(i,o),f=_.Cartesian3.distance(i,u)>A?o:u,d=_.Cartographic.fromCartesian(f,void 0,yk);return[PS(d.longitude),PS(d.latitude),d.height]}const vc=class vc extends Jt{constructor(e,i){super(e,i);z(this,"_hideGeoPolylines",this.disposeVar(new Pn(this.czmViewer,this.sceneObject.id)));z(this,"_visibleGeoPolylines",this.disposeVar(new Pn(this.czmViewer,this.sceneObject.id)));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._hideGeoPolylines,a=this._visibleGeoPolylines;this.d(h.track([r,"show"],[e,"show"])),this.d(h.track([a,"show"],[e,"show"])),this.d(h.track([a,"color"],[e,"visibleColor"])),this.d(h.track([r,"color"],[e,"invisibleColor"]));{const s=()=>{const u=e.points,A=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){r.positions=void 0,a.positions=void 0;return}const c=[],f=[],[d,p,g]=u[0],v=[d,p,g+A];try{u.forEach((y,m)=>{if(m===0)return;const b=BS(v,y,o.scene);b?(c.push([y,b]),f.push([v,b])):f.push([v,y])}),r.positions=c,a.positions=f}catch(y){console.warn(y)}};s();const l=this.dv(h.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(l.don(s))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{let a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,e),!0}}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);{let a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,e),!0}}};z(vc,"type",vc.register("ESCesiumViewer",h.ESVisibilityAnalysis.type,vc));let sv=vc;class Wl extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.dv(new h.Event));z(this,"_enableEvent",this.dv(new h.Event));z(this,"_clearEvent",this.dv(new h.Event));z(this,"_gridPoints",this.dv(h.reactJson([])));z(this,"excavationPolylines");z(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Pn(e,i)),a=this.dv(new Pn(e,i));this.excavationPolylines=r,this.fillPolylines=a;const s=r;s.color=[1,1,0,1],this.d(h.track([s,"show"],[this,"show"])),s.show=!1,s.depthTest=!0;const l=a;l.color=[0,0,1,1],this.d(h.track([l,"show"],[this,"show"])),l.show=!1;{const d=this.ad(new _i(e,i));this.d(h.track([d,"show"],[this,"show"])),this.d(h.bind([d,"allowPicking"],[this,"allowPicking"])),this.d(h.bind([d,"positions"],[this,"positions"])),this.d(h.bind([d,"depthTest"],[this,"depthTest"])),this.d(h.bind([d,"outlineWidth"],[this,"outlineWidth"])),this.d(h.bind([d,"outlineColor"],[this,"outlineColor"])),this.d(h.bind([d,"outline"],[this,"outline"])),this.d(h.bind([d,"color"],[this,"fillColor"])),this.d(h.bind([d,"fill"],[this,"filled"])),this.d(h.bind([d,"strokeGround"],[this,"strokeGround"])),this.d(h.bind([d,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(v=>{d.flyTo(v)}));const p=()=>{d.positions=this.positions};p();const g=this.dv(h.createNextAnimateFrameEvent(this.positionsChanged));this.d(g.don(p))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:d,maxPos:p}=h.getMinMaxCorner(this.positions),g=d[0],v=d[1],y=p[0],m=p[1],x={type:"Polygon",coordinates:[[...this.positions.map(T=>[T[0],T[1]])]]},E=[g,v,y,m],B=this.gridWidth,O=k_(E,B,{units:"meters",mask:x}).features.map(T=>T.geometry.coordinates),M=_.Math.toRadians;return O.map(T=>new _.Cartographic(M(T[0]),M(T[1])))},A=()=>{s.positions=[],l.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,s.depthTest=!0},c=this.dv(h.createProcessingFromAsyncFunc(async d=>{const p=u();let g=0,v=300;const y=Math.ceil(p.length/v),m=[];do{let b=[];g===y-1?b=p.slice(g*v):b=p.slice(g*v,(g+1)*v);const x=o.scene.sampleHeightMostDetailed(b),E=await d.promise(x);if(g===y-1?this.progress=Math.round(this.progress+100/y):this.progress+=100/y,E&&E.length){const B=_.Math.toDegrees,P=E.filter(I=>I!=null).map(I=>[B(I.longitude),B(I.latitude),I.height]);m.push(...P)}g++}while(g<y);!m||!m.length||(this.gridPoints=m)}));let f=null;{const d=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let p=0;const g=[];let v=0;const y=[];this.gridPoints.forEach(m=>{const b=this.positions;m[2]>b[0][2]?(p+=this.gridWidth*this.gridWidth*(m[2]-b[0][2]),g.push([m,[m[0],m[1],b[0][2]]])):(v+=this.gridWidth*this.gridWidth*(b[0][2]-m[2]),y.push([m,[m[0],m[1],b[0][2]]]))}),s.positions=g,l.positions=y,s.show=!0,l.show=!0,this.area=Ux(this.positions),this.cutVolume=p,this.fillVolume=v,this.cutAndFillVolume=v-p,f&&clearTimeout(f),f=setTimeout(()=>{s.depthTest=!1},200)};d(),this.d(this.gridPointsChanged.don(d)),this.d(()=>clearTimeout(f))}{const d=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};d(),this.d(this.positionsChanged.don(d))}{const d=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const p=JSON.parse(JSON.stringify(this.positions.slice(1)));p.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=p};d(),this.d(this.planeHeightChanged.don(d))}this.d(this.enableEvent.don(()=>{A(),this.gridPoints=[],this.progress=0,c.restart()})),this.d(this.clearEvent.don(()=>{A()}))}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:h.reactPositions(void 0),planeHeight:h.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})})(Wl||(Wl={})),h.extendClassProps(Wl.prototype,Wl.createDefaultProps);const wc=class wc extends Tn{constructor(e,i){super(e,i);z(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new Wl(this.czmViewer,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoVolumeMeasurement;this.d(h.track([r,"show"],[e,"show"])),this.d(h.bind([r,"positions"],[e,"points"])),this.d(h.track([r,"allowPicking"],[e,"allowPicking"])),this.d(h.bind([r,"planeHeight"],[e,"planeHeight"])),this.d(h.track([r,"gridWidth"],[e,"gridWidth"])),this.d(h.track([e,"cutVolume"],[r,"cutVolume"])),this.d(h.track([e,"fillVolume"],[r,"fillVolume"])),this.d(h.track([e,"cutAndFillVolume"],[r,"cutAndFillVolume"])),this.d(h.bind([e,"progress"],[r,"progress"])),this.d(h.track([r,"depthTest"],[e,"depthTest"])),this.d(h.track([r,"outline"],[e,"stroked"])),this.d(h.track([r,"outlineWidth"],[e,"strokeWidth"])),this.d(h.track([r,"outlineColor"],[e,"strokeColor"])),this.d(h.track([r,"filled"],[e,"filled"])),this.d(h.track([r,"fillColor"],[e,"fillColor"])),this.d(h.track([r,"fillGround"],[e,"fillGround"])),this.d(h.track([r,"strokeGround"],[e,"strokeGround"])),this.ad(h.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{r.enableEmit()})),this.d(e.clearEvent.don(()=>{r.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoVolumeMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};z(wc,"type",wc.register("ESCesiumViewer",h.ESVolumeMeasurement.type,wc));let av=wc;const bc=class bc extends Tn{constructor(e,i){super(e,i);z(this,"czmEntity");z(this,"czmPolyline",this.ad(new h.ESGeoLineString));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.czmPolyline;i.add(r),this.ad(()=>i.delete(r)),this.ad(h.bind([r,"show"],[e,"show"])),this.ad(h.bind([r,"allowPicking"],[e,"allowPicking"])),this.ad(h.bind([r,"stroked"],[e,"stroked"])),this.ad(h.bind([r,"strokeColor"],[e,"strokeColor"])),this.ad(h.bind([r,"strokeWidth"],[e,"strokeWidth"])),this.ad(h.bind([r,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)r.points=e.points;else{const c=structuredClone(e.points);c.push(c[0]),e.perPositionHeight?r.points=c:r.points=c.map(f=>(f[2]=e.height??h.ESGeoExtrudedPolygon.defaults.height,f))}};u();const A=this.ad(h.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(A.don(u))}const a=this.czmEntity=o.entities.add({polygon:{}});_.Entity.prototype&&(a.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(a));let s=new _.PolygonHierarchy;a.polygon&&(a.polygon.hierarchy=new _.CallbackProperty(()=>s,!1));const l=()=>{const u=Wt(e.points??[]);if(u.length<2){s=new _.PolygonHierarchy;return}s=new _.PolygonHierarchy(u)};l(),this.dispose(e.pointsChanged.disposableOn(l));{const u=()=>{a.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!a.show&&e.filled)};u();const A=this.ad(h.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(A.don(u))}{const u=()=>{a.polygon&&(a.polygon.perPositionHeight=new _.ConstantProperty(e.perPositionHeight),l())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{a.polygon&&(a.polygon.height=new _.ConstantProperty(e.height??h.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{a.polygon&&(a.polygon.extrudedHeight=new _.ConstantProperty(e.extrudedHeight??h.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const A=_.Color.fromCartesian4(_.Cartesian4.fromArray(e.fillColor));a.polygon&&(a.polygon.material=A)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new h.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new rt.ObjectsToExcludeWrapper(i,a)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:i,maxPos:o}=h.getMinMaxCorner(e.points);return[i[2],o[2]]}return[0,0]}};z(bc,"type",bc.register("ESCesiumViewer",h.ESGeoExtrudedPolygon.type,bc));let lv=bc;const xc=class xc extends h.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:r}=n;this.dispose(h.bind([o,"position"],[n,"position"])),this.dispose(h.bind([o,"rotation"],[n,"rotation"])),this.ad(h.bind([o,"scale"],[n,"scale"])),this.ad(h.track([r,"scale"],[n,"scale"])),this.dispose(h.track([r,"rotation"],[n,"rotation"]));const a=()=>{const l=n.position;r.position=[l[0],l[1],l[2]+n.poiOffsetHeight]};a();const s=this.dv(h.createNextAnimateFrameEvent(n.positionChanged,n.poiOffsetHeightChanged));this.d(s.don(a)),this.ad(r.pickedEvent.don(l=>{l.assign({sceneObject:n}),n.pickedEvent.emit(l)}))}};z(xc,"type",xc.register("ESCesiumViewer",h.ESHumanPoi.type,xc));let uv=xc;const _c=class _c extends h.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const r=o.d(o.tilesetReady.donce(l=>{l.allTilesLoaded.addEventListener(()=>{var A,c,f,d;const u=(d=(f=(c=(A=l==null?void 0:l._root)==null?void 0:A._content)==null?void 0:c._model)==null?void 0:f._featureTables[0])==null?void 0:d._features[0];u?o.strokeFeature([u],_.Color.LIME.toBytes().map(p=>p/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",l),r()})})),a=o.url,s=Date.now();a.includes("?reload=")?o.url=a.replace(/\?reload=\d+/,`?reload=${s}`):o.url=a+`?reload=${s}`})),this.d(n.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(n.es3DTileset.tilesetReady.don(o=>{const r=()=>{const s=n.layerConfig;if(!s){o.style=void 0;return}const l=n.colorBlendMode,u=(f,d)=>{try{if(f.getPropertyIds().includes("materialName"))return _.Color.clone(_.Color.WHITE,d);const p=f.getProperty("layer"),g=f.getProperty("dataset"),v=p.toString(),y=g.toString(),m=s.find(x=>x.dataset.toString()===y&&x.layer.toString()===v);if(m&&m.value.color){const x=m.value.color;return _.Color.fromCssColorString(x,d)}const b=s.filter(x=>x.dataset.toString()===y);if(b.length==1&&b[0].value.color){const x=b[0].value.color;return _.Color.fromCssColorString(x,d)}else return _.Color.clone(_.Color.WHITE,d)}catch(p){return console.warn(p),_.Color.clone(_.Color.WHITE,d)}},A=f=>{try{if(f.getPropertyIds().includes("id")){const b=Object.entries(n.visJson);for(let x=0;x<b.length;x++){const E=b[x];if(f.getProperty("id").toString()===E[0])return E[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const d=f.getProperty("layer"),p=f.getProperty("dataset"),g=d.toString(),v=p.toString(),y=s.find(b=>b.dataset.toString()===v&&b.layer.toString()===g);if(y&&y.value.visible===!1)return!1;if(y&&y.value.visible===!0)return!0;const m=s.filter(b=>b.dataset.toString()===v);return!(m.length==1&&m[0].value.visible===!1)}catch(d){return console.warn(d),!0}};let c;l!=="HIGHLIGHT"?c=new _.Cesium3DTileStyle({color:{evaluateColor:function(f,d){return u(f,d)}},show:{evaluate:function(f){return A(f)}}}):c=new _.Cesium3DTileStyle({show:{evaluate:function(f){return A(f)}}}),console.log("style",c),o.style=c};r();const a=this.dv(h.createNextAnimateFrameEvent(n.layerConfigChanged,n.colorBlendModeChanged,n.visJsonChanged));this.d(a.don(()=>{r()}))}))}};z(_c,"type",_c.register("ESCesiumViewer",h.ESRtsTileset.type,_c));let cv=_c;const Cc=class Cc extends $s{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};z(Cc,"type",Cc.register("ESCesiumViewer",h.ESRtsFeatureEditing.type,Cc));let hv=Cc;const Sc=class Sc extends $s{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};z(Sc,"type",Sc.register("ESCesiumViewer",h.ESMsTileset.type,Sc));let Av=Sc;const Ec=class Ec extends He{constructor(e,i){super(e,i);z(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new zn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(h.track([r,"show"],[e,"show"])),this.dispose(h.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};z(Ec,"type",Ec.register("ESCesiumViewer",h.ESStaticMesh.type,Ec));let fv=Ec;const Pc=class Pc extends Jt{constructor(n,e){super(n,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=this.ad(new P0(i));this.ad(n.startEvent.don(async()=>{const r=await o.getDepthsFromScreen(),a=Number.isFinite(n.radius)?n.radius:h.ESSkylineAnalysis.defaults.radius,{depths:s,windowPositions:l,positions:u}=o.getSkylineDepthsAndPositions(r,i.scene.canvas.width,i.scene.canvas.height,a),A=Ue(i.camera.position);u.push(A),n.depths=s,n.windowPositions=l,n.points=u}))}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}};z(Pc,"type",Pc.register("ESCesiumViewer",h.ESSkylineAnalysis.type,Pc));let pv=Pc;class vk extends h.Destroyable{constructor(e,i){super();z(this,"_rectangle");z(this,"_updateHeatMapEvent",this.disposeVar(new h.Event));const o=e.sceneObject;this._rectangle=this.ad(new mi(i,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(h.bind([this.rectangle,"show"],[o,"show"])),this.ad(h.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(r=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:r}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class wk extends h.Destroyable{constructor(e,i){super();z(this,"_primitive");z(this,"_updateHeatMapEvent",this.disposeVar(new h.Event));z(this,"czmViewer");z(this,"czmESHeatMap");const o=this.czmViewer=i,r=this.czmESHeatMap=e,a=r.sceneObject,s=o.viewer;if(!s)return;let l,u;const A=this.ad(new h.Event),c=()=>{f(),!(!l||!u)&&(this._primitive=s.scene.primitives.add(new _.Primitive({geometryInstances:l,appearance:u,asynchronous:!1,allowPicking:a.allowPicking})))},f=()=>{this.primitive&&s.scene.primitives.remove(this.primitive)};this.ad(f);{const d=()=>{this.primitive&&(this.primitive.show=a.show)};d(),this.ad(a.showChanged.don(d))}{const d=this.ad(h.createNextAnimateFrameEvent(a.allowPickingChanged,A));this.ad(d.don(c))}{const d=()=>{r.rectangle&&(l=new _.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(r.div.style.width),Number.parseFloat(r.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=l,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(p=>{if(!r.rectangle)return;const g=r.rectangle[1]+(r.rectangle[3]-r.rectangle[1])*.5,v=h.getDistancesFromPositions([[r.rectangle[0],g,0],[r.rectangle[2],g,0]],"GEODESIC")[0]/5;u=new _.MaterialAppearance({material:new _.Material({fabric:{type:"Image",uniforms:{image:p}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(v),flat:!0}),this.primitive&&r.rectangle&&(this.primitive.appearance.material.uniforms.image=p,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(v)),d(),this.primitive||A.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
|
|
3741
|
+
`),24))};a(),this.d(this.totalAreaChanged.don(a)),this.d(this.unitsChanged.don(a)),this.d(h.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=Ox(this.positions):this._geoDivPoi.position=void 0)}));const s=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??Jo.defaults.interpolationDistance,A=this.interpolation??Jo.defaults.interpolation,c=this.offsetHeight??Jo.defaults.offsetHeight,f=this.drillDepth??Jo.defaults.drillDepth,d=[];if(this.positions)for(let L=0;L<this.positions.length;++L){const k=_.Cartesian3.fromDegrees(this.positions[L][0],this.positions[L][1],this.positions[L][2]);d.push(k)}var p=o6(d);if(isNaN(p.x)||isNaN(p.y)||isNaN(p.z)){console.warn("法向量计算错误!");return}var g=s6(d),v=_.Cartesian3.normalize(g,new _.Cartesian3),y=_.Cartesian3.dot(v,p);y<0&&(p=ES(p),d.reverse());let m=_.Transforms.eastNorthUpToFixedFrame(g),b=_.Matrix4.inverseTransformation(m,new _.Matrix4);if(Math.abs(y)<.999){const L=a6(p,v);var x=ES(g),E=_.Matrix4.fromTranslation(x,new _.Matrix4);b=_.Matrix4.multiply(L,E,E),m=_.Matrix4.inverse(b,new _.Matrix4)}var B=da(d,b),P=[],I=[],O=u6(B);if(A&&u>0){var M=l6(B);const L=Math.max(M.maxy-M.miny,M.maxx-M.minx);var S=f6(O,M,u);const k=await nv(S,m,b,p,o.scene,c,f,L);var T=p6(B,u);const Q=await nv(T,m,b,p,o.scene,c,f,L);I.push(...k.world_cartesian),P.push(...k.local),I.push(...Q.world_cartesian),P.push(...Q.local);for(let V=0;V<B.length;++V){const G=B[V];var w=await nv([G],m,b,p,o.scene,c,f,L);if(w.local.length>0)P.push(...w.local),I.push(...w.world_cartesian);else{const $=[G.x,G.y,G.z+c];P.push($);var C=da([_.Cartesian3.fromArray($)],m);for(let Y=0;Y<C.length;++Y)I.push(C[Y])}}}else{const L=B.map(k=>_.Cartesian3.fromArray([k.x,k.y,k.z+L]));P=L,I=da(L,m)}var U=c6(P,O);const F=h6(I,U);this.totalArea=F;const D=[];P.forEach(L=>{const k=[L.x,L.y,L.z];k&&D.push(...k)});const R={position:{typedArray:new Float32Array(D),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=_.Matrix4.toArray(m),this.customPrimitive.attributes=R;const L=await r6([...U]);this.customPrimitive.indexTypedArray=new Uint32Array(L),this.customPrimitive.show=!0;const k=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!k)return;const{min:Q,max:V}=k;this.customPrimitive.setLocalAxisedBoundingBox(Q,V)}},l=this.dv(h.createProcessingFromAsyncFunc(async u=>{await u.promise(s()),this._starting=!1,a()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,a(),l.restart()})),this.d(this.stopEvent.don(()=>{l.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,a()}))}}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}};z(Jo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let Go=Jo;(t=>{t.createDefaultProps=()=>({positions:h.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:h.reactArray([1,1,1,1]),units:h.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(Go||(Go={})),h.extendClassProps(Go.prototype,Go.createDefaultProps);async function r6(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const n=t.length/3|0,e=new Array(n*6);for(let i=0;i<n;++i)await SS(),e[i*6+0]=t[i*3+0],e[i*6+1]=t[i*3+1],e[i*6+2]=t[i*3+2],e[i*6+3]=t[i*3+1],e[i*6+4]=t[i*3+2],e[i*6+5]=t[i*3+0];return e}function o6(t){var n=new _.Cartesian3(0,0,0),e=new _.Cartesian3(0,0,0),i=new _.Cartesian3(0,0,0),o=new _.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var r=t.length;for(let u=0;u<r;++u){var a=t[u],s;u==0?s=t[t.length-1]:s=t[u-1];var l;u==t.length-1?l=t[0]:l=t[u+1],n=_.Cartesian3.subtract(a,s,n),e=_.Cartesian3.subtract(a,l,e),i=_.Cartesian3.cross(n,e,i),!i.equalsEpsilon(_.Cartesian3.ZERO,_.Math.EPSILON6)&&(i=_.Cartesian3.normalize(i,i),o=_.Cartesian3.add(o,i,o))}return i.x=o.x/r,i.y=o.y/r,i.z=o.z/r,i}function s6(t){var n=new _.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var i=t[o];n=_.Cartesian3.add(n,i,n)}return n.x=n.x/e,n.y=n.y/e,n.z=n.z/e,n}function ES(t){return new _.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function a6(t,n){var e=_.Cartesian3.cross(t,n,new _.Cartesian3);e=_.Cartesian3.normalize(e,e);var i=_.Cartesian3.cross(t,e,new _.Cartesian3);i=_.Cartesian3.normalize(i,i);var o=t,r=new _.Matrix4(e.x,e.y,e.z,0,i.x,i.y,i.z,0,o.x,o.y,o.z,0,0,0,0,1);return r}function da(t,n){var e=[];for(let r=0;r<t.length;++r){var i=t[r],o=_.Matrix4.multiplyByPoint(n,i,new _.Cartesian3);e.push(o)}return e}function l6(t){var n=t[0].x,e=t[0].y,i=t[0].x,o=t[0].y;return t.forEach(r=>{n=Math.min(n,r.x),e=Math.min(e,r.y),i=Math.max(i,r.x),o=Math.max(o,r.y)}),{minx:n,miny:e,maxx:i,maxy:o}}function u6(t){var n=[];return t.forEach(e=>{n.push([e.x,e.y])}),n.push(n[0]),n}function c6(t,n){var e=[];t.forEach(a=>{const s=[a.x,a.y];e.push(s)});var i=ev.from(e).triangles;const o=[],r=rn([n]);for(let a=0;a<i.length;a+=3){const s=i[a],l=i[a+1],u=i[a+2],A=(t[s].x+t[l].x+t[u].x)/3,c=(t[s].y+t[l].y+t[u].y)/3;sn([A,c],r)&&o.push(s,l,u)}return new Uint32Array(o.reverse())}function h6(t,n){for(var e=0,i=0;i<n.length;i+=3){const o=[t[n[i]],t[n[i+1]],t[n[i+2]]];e+=A6(o)}return e}function A6(t){var n=_.Cartesian3.distance(t[0],t[1]),e=_.Cartesian3.distance(t[1],t[2]),i=_.Cartesian3.distance(t[2],t[0]),o=(n+e+i)/2,r=Math.sqrt(o*(o-n)*(o-e)*(o-i));return r||0}function f6(t,n,e){for(var i=[],o=n.minx;o<n.maxx;o+=e)for(var r=n.miny;r<n.maxy;r+=e)m6([o,r],t)&&i.push(new _.Cartesian3(o,r,0));return i}function p6(t,n){var e=[];for(let a=0;a<t.length;++a){var i=t[a],o;a==t.length-1?o=t[0]:o=t[a+1];var r=d6(i,o,n);e.push(...r)}return e}function d6(t,n,e){var i=[],o=_.Cartesian3.distance(t,n),r=_.Cartesian3.subtract(n,t,new _.Cartesian3);if(r.equalsEpsilon(_.Cartesian3.ZERO,_.Math.EPSILON6))return[];r=_.Cartesian3.normalize(r,r);for(var a=e;a<o;){var s=new _.Cartesian3(r.x*a,r.y*a,r.z*a),l=_.Cartesian3.add(t,s,new _.Cartesian3);i.push(l),a+=e}return i}function m6(t,n){var e=Gr(t);if(!bk(Gr(n[0]),Gr(n[n.length-1])))return!1;var i=[];i.push(n);var o=rn(i);return sn(e,o)}async function nv(t,n,e,i,o,r,a,s){var l=[];t.forEach(b=>{var x=b.clone();x.z=s,l.push(x)});var u=da(l,n),A=new _.Cartesian3(-1*i.x,-1*i.y,-1*i.z),c=[],f=[],d=[];for(let b=0;b<u.length;++b){await SS();var p=u[b],g=new _.Ray(p,A),v=void 0;try{v=o.pickFromRay(g)}catch{}if(!v){g=new _.Ray(p,i);try{v=o.pickFromRay(g)}catch{}}if(v){var y=v.position;if(!(!y||!y.x||isNaN(y.x))){var m=da([y],e);m.forEach(x=>{x.z+=r}),y=da(m,n)[0],d.push(y),y=_.Cartographic.fromCartesian(y),c.push([y.longitude,y.latitude,y.height]),f.push(m[0])}}}return{local:f,world:c,world_cartesian:d}}const mc=class mc extends Tn{constructor(e,i){super(e,i);z(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new Go(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmAreaMeasurement;this.ad(h.track([e,"surfaceArea"],[r,"totalArea"])),this.ad(h.track([r,"units"],[e,"units"])),this.d(h.track([r,"show"],[e,"show"])),this.d(h.track([r,"positions"],[e,"points"])),this.d(h.track([r,"interpolationDistance"],[e,"interpolation"])),this.d(h.track([r,"offsetHeight"],[e,"offsetHeight"]));{const a=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)r.outlineWidth=e.strokeWidth;else{r.outlineWidth=0;return}r.outlineWidth=e.strokeWidth,r.outlineColor=e.strokeColor};a();const s=this.disposeVar(h.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(s.disposableOn(a))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}};z(mc,"type",mc.register("ESCesiumViewer",h.ESSurfaceAreaMeasurement.type,mc));let iv=mc;async function g6(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(n){console.log("复制失败")})}const gc=class gc extends h.EngineObject{constructor(e,i){super(e,i);z(this,"_customDiv");if(this._customDiv=this.disposeVar(new h.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends h.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof rt))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A)),A.style.width="100%",A.style.position="absolute",A.style.height=`${h.ESViewerStatusBar.defaults.height}px`,A.style.left="0",A.style.bottom="0",A.style.color="#fff",A.style.padding="0 20px 0 0",A.style.boxSizing="border-box",A.style.lineHeight=`${h.ESViewerStatusBar.defaults.height}px`,A.style.zIndex="100",A.style.alignContent="center",A.style.justifyContent="space-between";const c=document.createElement("span");A.appendChild(c),this.dispose(()=>A.removeChild(c));const f=document.createElement("span");c.appendChild(f),this.dispose(()=>c.removeChild(f));const d=document.createElement("span");c.appendChild(d),d.addEventListener("dblclick",function(){let g=d.innerHTML;g.startsWith("鼠标位置")&&(g=g.slice(5)),g6(g)}),d.style.cursor="pointer",this.dispose(()=>c.removeChild(d));const p=document.createElement("span");A.appendChild(p),this.dispose(()=>A.removeChild(p));{const g=()=>{A.style.height=(e.height??h.ESViewerStatusBar.defaults.height)+"px",A.style.lineHeight=(e.height??h.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(g)),g()}{const g=()=>{A.style.fontSize=(e.fontSize??h.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(g)),g()}{const g=()=>{e.bgColor?A.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:A.style.background=`rgba(${h.ESViewerStatusBar.defaults.bgColor[0]},${h.ESViewerStatusBar.defaults.bgColor[1]},${h.ESViewerStatusBar.defaults.bgColor[2]},${h.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(g)),g()}{p.innerText=`Cesium 版本 : ${_.VERSION} `;let g;const v=()=>{e.show?(A.style.display="flex",g=this.disposeVar(h.createAnimateFrameWithStartValues(()=>{var E;let y="",m="";const b=u.getCameraInfo();if(b){const B=(I,O)=>b.position[I].toFixed(O),P=(I,O)=>b.rotation[I].toFixed(O);y=`帧率:${u.getFPS()}FPS 经度: ${B(0,5)}° 纬度: ${B(1,5)}° 高度: ${B(2,2)}米 偏航角: ${P(0,2)}° 俯仰角: ${P(1,2)}° 翻滚角:${P(2,2)}° `}f.innerText=y;const x=(E=u.extensions)==null?void 0:E.cursorPositionInfo.cursorPosition;if(x){const B=(P,I)=>x[P].toFixed(I);m=`鼠标位置:${B(0,5)}° ${B(1,5)}° ${B(2,2)}m`}else m="暂时无法获取鼠标位置...";d.innerText=m})),g.start()):(A.style.display="none",g.destroy())};this.dispose(e.showChanged.disposableOn(v)),v()}}}}get customDiv(){return this._customDiv}};z(gc,"type",gc.register("ESCesiumViewer",h.ESViewerStatusBar.type,gc));let rv=gc;const yc=class yc extends h.EngineObject{constructor(e,i){super(e,i);z(this,"_customDiv");if(this._customDiv=this.disposeVar(new h.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(h.track([r,"show"],[e,"show"])),r.instanceClass=class extends h.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof rt))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));const c=document.createElement("div");A.appendChild(c),c.style.width="100%",c.className="ESViewerStatusBarScale",c.style.position="absolute",c.style.display="flex",c.style.height=`${h.ESViewerStatusBarScale.defaults.height}px`,c.style.left="0",c.style.bottom="0",c.style.color="#fff",c.style.padding="0 20px 0 0",c.style.boxSizing="border-box",c.style.lineHeight=`${h.ESViewerStatusBarScale.defaults.height}px`,c.style.zIndex="100",c.style.alignContent="center",c.style.justifyContent="space-between";const f=document.createElement("div");c.appendChild(f);const d=document.createElement("div");f.appendChild(d);const p=document.createElement("div");f.appendChild(p);const g=document.createElement("div");c.appendChild(g);const v=document.createElement("div");g.appendChild(v);const y=document.createElement("div");v.appendChild(y);const m=document.createElement("div");v.appendChild(m);const b=document.createElement("span");g.appendChild(b);{const I=()=>{c.style.height=(e.height??h.ESViewerStatusBarScale.defaults.height)+"px",c.style.lineHeight=(e.height??h.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(I)),I()}{const I=()=>{c.style.fontSize=(e.fontSize??h.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(I)),I()}{const I=()=>{e.bgColor?c.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:c.style.background=`rgba(${h.ESViewerStatusBarScale.defaults.bgColor[0]},${h.ESViewerStatusBarScale.defaults.bgColor[1]},${h.ESViewerStatusBarScale.defaults.bgColor[2]},${h.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(I)),I()}f.style.display="flex",d.style.fontWeight="bold",d.style.padding="0 0 0 25px";let x="EarthSDK";d.innerText=x,p.style.fontWeight="";let E="——免费开源地球可视化开发包";p.innerText=E,g.style.width="550px",v.style.position="fixed",v.style.width="125px",v.style.height="30px",v.style.padding="0 5px",v.style.display="flex",v.style.justifyContent="flex-end",v.style.pointerEvents="auto",v.style.zIndex="101",y.style.width="125px",y.style.display="inline-block",y.style.textAlign="center",y.style.fontSize="14px",y.style.fontWeight="lighter",y.style.lineHeight="30px",y.style.color="#fff",y.innerHTML="1000km",m.style.borderRight="1px solid #fff",m.style.borderLeft="1px solid #fff",m.style.borderBottom="1px solid #fff",m.style.position="absolute",m.style.height="10px",m.style.top="15px",m.style.width="75px",m.style.right="30px",b.style.display="flex",b.style.zIndex="101",b.style.justifyContent="flex-end",b.style.right="0";const B=()=>{const I=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||I&&I>1e6)v.style.display="none";else{v.style.display="block";const O=i.viewerLegend.legend.computedLengthInStr;O&&(y.innerHTML=O);const M=i.viewerLegend.legend.computedLengthInPixels;if(M){m.style.width=`${M}px`;const S=(135-M)/2;m.style.left=`${S}px`}}};B();const P=setInterval(()=>{B()},200);this.dispose(()=>clearInterval(P));{let I;const O=()=>{e.show?(A.style.display="block",I=this.disposeVar(h.createAnimateFrameWithStartValues(()=>{var w;let M="";const S=u.getCameraInfo();if(S){const C=(U,F)=>S.position[U].toFixed(F);M+=`帧率:${u.getFPS()}FPS 相机: ${C(2,2)}米 `}const T=(w=u.extensions)==null?void 0:w.cursorPositionInfo.cursorPosition;if(T){const C=(U,F)=>T[U].toFixed(F);M+=`位置:${C(0,5)}° ${C(1,5)}° ${C(2,2)}米`}else M+="暂时无法获取鼠标位置...";b.innerText=M})),I.start()):(A.style.display="none",I.destroy())};this.dispose(e.showChanged.disposableOn(O)),O()}}}}get customDiv(){return this._customDiv}};z(yc,"type",yc.register("ESCesiumViewer",h.ESViewerStatusBarScale.type,yc));let ov=yc;const PS=_.Math.toDegrees,y6=new _.Cartographic;function BS(t,n,e){const i=_.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=_.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=_.Cartesian3.subtract(o,i,new _.Cartesian3);_.Cartesian3.normalize(r,r);const a=new _.Ray(i,r),s=e.pickFromRay(a),l=e.globe.pick(a,e);var u;if(s&&s.position&&l){const p=_.Cartesian3.distance(i,s.position),g=_.Cartesian3.distance(i,l);u=p<g?s.position:l}else s&&s.position?u=s.position:l&&(u=l);if(!u)return;const A=_.Cartesian3.distance(i,o),f=_.Cartesian3.distance(i,u)>A?o:u,d=_.Cartographic.fromCartesian(f,void 0,y6);return[PS(d.longitude),PS(d.latitude),d.height]}const vc=class vc extends Jt{constructor(e,i){super(e,i);z(this,"_hideGeoPolylines",this.disposeVar(new Pn(this.czmViewer,this.sceneObject.id)));z(this,"_visibleGeoPolylines",this.disposeVar(new Pn(this.czmViewer,this.sceneObject.id)));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._hideGeoPolylines,a=this._visibleGeoPolylines;this.d(h.track([r,"show"],[e,"show"])),this.d(h.track([a,"show"],[e,"show"])),this.d(h.track([a,"color"],[e,"visibleColor"])),this.d(h.track([r,"color"],[e,"invisibleColor"]));{const s=()=>{const u=e.points,A=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){r.positions=void 0,a.positions=void 0;return}const c=[],f=[],[d,p,g]=u[0],v=[d,p,g+A];try{u.forEach((y,m)=>{if(m===0)return;const b=BS(v,y,o.scene);b?(c.push([y,b]),f.push([v,b])):f.push([v,y])}),r.positions=c,a.positions=f}catch(y){console.warn(y)}};s();const l=this.dv(h.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(l.don(s))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{let a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,e),!0}}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);{let a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,e),!0}}};z(vc,"type",vc.register("ESCesiumViewer",h.ESVisibilityAnalysis.type,vc));let sv=vc;class Wl extends h.Destroyable{constructor(e,i){super();z(this,"_flyToEvent",this.dv(new h.Event));z(this,"_enableEvent",this.dv(new h.Event));z(this,"_clearEvent",this.dv(new h.Event));z(this,"_gridPoints",this.dv(h.reactJson([])));z(this,"excavationPolylines");z(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Pn(e,i)),a=this.dv(new Pn(e,i));this.excavationPolylines=r,this.fillPolylines=a;const s=r;s.color=[1,1,0,1],this.d(h.track([s,"show"],[this,"show"])),s.show=!1,s.depthTest=!0;const l=a;l.color=[0,0,1,1],this.d(h.track([l,"show"],[this,"show"])),l.show=!1;{const d=this.ad(new _i(e,i));this.d(h.track([d,"show"],[this,"show"])),this.d(h.bind([d,"allowPicking"],[this,"allowPicking"])),this.d(h.bind([d,"positions"],[this,"positions"])),this.d(h.bind([d,"depthTest"],[this,"depthTest"])),this.d(h.bind([d,"outlineWidth"],[this,"outlineWidth"])),this.d(h.bind([d,"outlineColor"],[this,"outlineColor"])),this.d(h.bind([d,"outline"],[this,"outline"])),this.d(h.bind([d,"color"],[this,"fillColor"])),this.d(h.bind([d,"fill"],[this,"filled"])),this.d(h.bind([d,"strokeGround"],[this,"strokeGround"])),this.d(h.bind([d,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(v=>{d.flyTo(v)}));const p=()=>{d.positions=this.positions};p();const g=this.dv(h.createNextAnimateFrameEvent(this.positionsChanged));this.d(g.don(p))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:d,maxPos:p}=h.getMinMaxCorner(this.positions),g=d[0],v=d[1],y=p[0],m=p[1],x={type:"Polygon",coordinates:[[...this.positions.map(T=>[T[0],T[1]])]]},E=[g,v,y,m],B=this.gridWidth,O=k_(E,B,{units:"meters",mask:x}).features.map(T=>T.geometry.coordinates),M=_.Math.toRadians;return O.map(T=>new _.Cartographic(M(T[0]),M(T[1])))},A=()=>{s.positions=[],l.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,s.depthTest=!0},c=this.dv(h.createProcessingFromAsyncFunc(async d=>{const p=u();let g=0,v=300;const y=Math.ceil(p.length/v),m=[];do{let b=[];g===y-1?b=p.slice(g*v):b=p.slice(g*v,(g+1)*v);const x=o.scene.sampleHeightMostDetailed(b),E=await d.promise(x);if(g===y-1?this.progress=Math.round(this.progress+100/y):this.progress+=100/y,E&&E.length){const B=_.Math.toDegrees,P=E.filter(I=>I!=null).map(I=>[B(I.longitude),B(I.latitude),I.height]);m.push(...P)}g++}while(g<y);!m||!m.length||(this.gridPoints=m)}));let f=null;{const d=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let p=0;const g=[];let v=0;const y=[];this.gridPoints.forEach(m=>{const b=this.positions;m[2]>b[0][2]?(p+=this.gridWidth*this.gridWidth*(m[2]-b[0][2]),g.push([m,[m[0],m[1],b[0][2]]])):(v+=this.gridWidth*this.gridWidth*(b[0][2]-m[2]),y.push([m,[m[0],m[1],b[0][2]]]))}),s.positions=g,l.positions=y,s.show=!0,l.show=!0,this.area=Ux(this.positions),this.cutVolume=p,this.fillVolume=v,this.cutAndFillVolume=v-p,f&&clearTimeout(f),f=setTimeout(()=>{s.depthTest=!1},200)};d(),this.d(this.gridPointsChanged.don(d)),this.d(()=>clearTimeout(f))}{const d=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};d(),this.d(this.positionsChanged.don(d))}{const d=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const p=JSON.parse(JSON.stringify(this.positions.slice(1)));p.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=p};d(),this.d(this.planeHeightChanged.don(d))}this.d(this.enableEvent.don(()=>{A(),this.gridPoints=[],this.progress=0,c.restart()})),this.d(this.clearEvent.don(()=>{A()}))}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:h.reactPositions(void 0),planeHeight:h.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})})(Wl||(Wl={})),h.extendClassProps(Wl.prototype,Wl.createDefaultProps);const wc=class wc extends Tn{constructor(e,i){super(e,i);z(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new Wl(this.czmViewer,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoVolumeMeasurement;this.d(h.track([r,"show"],[e,"show"])),this.d(h.bind([r,"positions"],[e,"points"])),this.d(h.track([r,"allowPicking"],[e,"allowPicking"])),this.d(h.bind([r,"planeHeight"],[e,"planeHeight"])),this.d(h.track([r,"gridWidth"],[e,"gridWidth"])),this.d(h.track([e,"cutVolume"],[r,"cutVolume"])),this.d(h.track([e,"fillVolume"],[r,"fillVolume"])),this.d(h.track([e,"cutAndFillVolume"],[r,"cutAndFillVolume"])),this.d(h.bind([e,"progress"],[r,"progress"])),this.d(h.track([r,"depthTest"],[e,"depthTest"])),this.d(h.track([r,"outline"],[e,"stroked"])),this.d(h.track([r,"outlineWidth"],[e,"strokeWidth"])),this.d(h.track([r,"outlineColor"],[e,"strokeColor"])),this.d(h.track([r,"filled"],[e,"filled"])),this.d(h.track([r,"fillColor"],[e,"fillColor"])),this.d(h.track([r,"fillGround"],[e,"fillGround"])),this.d(h.track([r,"strokeGround"],[e,"strokeGround"])),this.ad(h.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{r.enableEmit()})),this.d(e.clearEvent.don(()=>{r.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoVolumeMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};z(wc,"type",wc.register("ESCesiumViewer",h.ESVolumeMeasurement.type,wc));let av=wc;const bc=class bc extends Tn{constructor(e,i){super(e,i);z(this,"czmEntity");z(this,"czmPolyline",this.ad(new h.ESGeoLineString));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.czmPolyline;i.add(r),this.ad(()=>i.delete(r)),this.ad(h.bind([r,"show"],[e,"show"])),this.ad(h.bind([r,"allowPicking"],[e,"allowPicking"])),this.ad(h.bind([r,"stroked"],[e,"stroked"])),this.ad(h.bind([r,"strokeColor"],[e,"strokeColor"])),this.ad(h.bind([r,"strokeWidth"],[e,"strokeWidth"])),this.ad(h.bind([r,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)r.points=e.points;else{const c=structuredClone(e.points);c.push(c[0]),e.perPositionHeight?r.points=c:r.points=c.map(f=>(f[2]=e.height??h.ESGeoExtrudedPolygon.defaults.height,f))}};u();const A=this.ad(h.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(A.don(u))}const a=this.czmEntity=o.entities.add({polygon:{}});_.Entity.prototype&&(a.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(a));let s=new _.PolygonHierarchy;a.polygon&&(a.polygon.hierarchy=new _.CallbackProperty(()=>s,!1));const l=()=>{const u=Wt(e.points??[]);if(u.length<2){s=new _.PolygonHierarchy;return}s=new _.PolygonHierarchy(u)};l(),this.dispose(e.pointsChanged.disposableOn(l));{const u=()=>{a.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!a.show&&e.filled)};u();const A=this.ad(h.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(A.don(u))}{const u=()=>{a.polygon&&(a.polygon.perPositionHeight=new _.ConstantProperty(e.perPositionHeight),l())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{a.polygon&&(a.polygon.height=new _.ConstantProperty(e.height??h.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{a.polygon&&(a.polygon.extrudedHeight=new _.ConstantProperty(e.extrudedHeight??h.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const A=_.Color.fromCartesian4(_.Cartesian4.fromArray(e.fillColor));a.polygon&&(a.polygon.material=A)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new h.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new rt.ObjectsToExcludeWrapper(i,a)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:i,maxPos:o}=h.getMinMaxCorner(e.points);return[i[2],o[2]]}return[0,0]}};z(bc,"type",bc.register("ESCesiumViewer",h.ESGeoExtrudedPolygon.type,bc));let lv=bc;const xc=class xc extends h.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:r}=n;this.dispose(h.bind([o,"position"],[n,"position"])),this.dispose(h.bind([o,"rotation"],[n,"rotation"])),this.ad(h.bind([o,"scale"],[n,"scale"])),this.ad(h.track([r,"scale"],[n,"scale"])),this.dispose(h.track([r,"rotation"],[n,"rotation"]));const a=()=>{const l=n.position;r.position=[l[0],l[1],l[2]+n.poiOffsetHeight]};a();const s=this.dv(h.createNextAnimateFrameEvent(n.positionChanged,n.poiOffsetHeightChanged));this.d(s.don(a)),this.ad(r.pickedEvent.don(l=>{l.assign({sceneObject:n}),n.pickedEvent.emit(l)}))}};z(xc,"type",xc.register("ESCesiumViewer",h.ESHumanPoi.type,xc));let uv=xc;const _c=class _c extends h.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const r=o.d(o.tilesetReady.donce(l=>{l.allTilesLoaded.addEventListener(()=>{var A,c,f,d;const u=(d=(f=(c=(A=l==null?void 0:l._root)==null?void 0:A._content)==null?void 0:c._model)==null?void 0:f._featureTables[0])==null?void 0:d._features[0];u?o.strokeFeature([u],_.Color.LIME.toBytes().map(p=>p/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",l),r()})})),a=o.url,s=Date.now();a.includes("?reload=")?o.url=a.replace(/\?reload=\d+/,`?reload=${s}`):o.url=a+`?reload=${s}`})),this.d(n.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(n.es3DTileset.tilesetReady.don(o=>{const r=()=>{const s=n.layerConfig;if(!s){o.style=void 0;return}const l=n.colorBlendMode,u=(f,d)=>{try{if(f.getPropertyIds().includes("materialName"))return _.Color.clone(_.Color.WHITE,d);const p=f.getProperty("layer"),g=f.getProperty("dataset"),v=p.toString(),y=g.toString(),m=s.find(x=>x.dataset.toString()===y&&x.layer.toString()===v);if(m&&m.value.color){const x=m.value.color;return _.Color.fromCssColorString(x,d)}const b=s.filter(x=>x.dataset.toString()===y);if(b.length==1&&b[0].value.color){const x=b[0].value.color;return _.Color.fromCssColorString(x,d)}else return _.Color.clone(_.Color.WHITE,d)}catch(p){return console.warn(p),_.Color.clone(_.Color.WHITE,d)}},A=f=>{try{if(f.getPropertyIds().includes("id")){const b=Object.entries(n.visJson);for(let x=0;x<b.length;x++){const E=b[x];if(f.getProperty("id").toString()===E[0])return E[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const d=f.getProperty("layer"),p=f.getProperty("dataset"),g=d.toString(),v=p.toString(),y=s.find(b=>b.dataset.toString()===v&&b.layer.toString()===g);if(y&&y.value.visible===!1)return!1;if(y&&y.value.visible===!0)return!0;const m=s.filter(b=>b.dataset.toString()===v);return!(m.length==1&&m[0].value.visible===!1)}catch(d){return console.warn(d),!0}};let c;l!=="HIGHLIGHT"?c=new _.Cesium3DTileStyle({color:{evaluateColor:function(f,d){return u(f,d)}},show:{evaluate:function(f){return A(f)}}}):c=new _.Cesium3DTileStyle({show:{evaluate:function(f){return A(f)}}}),console.log("style",c),o.style=c};r();const a=this.dv(h.createNextAnimateFrameEvent(n.layerConfigChanged,n.colorBlendModeChanged,n.visJsonChanged));this.d(a.don(()=>{r()}))}))}};z(_c,"type",_c.register("ESCesiumViewer",h.ESRtsTileset.type,_c));let cv=_c;const Cc=class Cc extends $s{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};z(Cc,"type",Cc.register("ESCesiumViewer",h.ESRtsFeatureEditing.type,Cc));let hv=Cc;const Sc=class Sc extends $s{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};z(Sc,"type",Sc.register("ESCesiumViewer",h.ESMsTileset.type,Sc));let Av=Sc;const Ec=class Ec extends He{constructor(e,i){super(e,i);z(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new zn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(h.track([r,"show"],[e,"show"])),this.dispose(h.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};z(Ec,"type",Ec.register("ESCesiumViewer",h.ESStaticMesh.type,Ec));let fv=Ec;const Pc=class Pc extends Jt{constructor(n,e){super(n,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=this.ad(new P0(i));this.ad(n.startEvent.don(async()=>{const r=await o.getDepthsFromScreen(),a=Number.isFinite(n.radius)?n.radius:h.ESSkylineAnalysis.defaults.radius,{depths:s,windowPositions:l,positions:u}=o.getSkylineDepthsAndPositions(r,i.scene.canvas.width,i.scene.canvas.height,a),A=Ue(i.camera.position);u.push(A),n.depths=s,n.windowPositions=l,n.points=u}))}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}};z(Pc,"type",Pc.register("ESCesiumViewer",h.ESSkylineAnalysis.type,Pc));let pv=Pc;class v6 extends h.Destroyable{constructor(e,i){super();z(this,"_rectangle");z(this,"_updateHeatMapEvent",this.disposeVar(new h.Event));const o=e.sceneObject;this._rectangle=this.ad(new mi(i,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(h.bind([this.rectangle,"show"],[o,"show"])),this.ad(h.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(r=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:r}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class w6 extends h.Destroyable{constructor(e,i){super();z(this,"_primitive");z(this,"_updateHeatMapEvent",this.disposeVar(new h.Event));z(this,"czmViewer");z(this,"czmESHeatMap");const o=this.czmViewer=i,r=this.czmESHeatMap=e,a=r.sceneObject,s=o.viewer;if(!s)return;let l,u;const A=this.ad(new h.Event),c=()=>{f(),!(!l||!u)&&(this._primitive=s.scene.primitives.add(new _.Primitive({geometryInstances:l,appearance:u,asynchronous:!1,allowPicking:a.allowPicking})))},f=()=>{this.primitive&&s.scene.primitives.remove(this.primitive)};this.ad(f);{const d=()=>{this.primitive&&(this.primitive.show=a.show)};d(),this.ad(a.showChanged.don(d))}{const d=this.ad(h.createNextAnimateFrameEvent(a.allowPickingChanged,A));this.ad(d.don(c))}{const d=()=>{r.rectangle&&(l=new _.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(r.div.style.width),Number.parseFloat(r.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=l,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(p=>{if(!r.rectangle)return;const g=r.rectangle[1]+(r.rectangle[3]-r.rectangle[1])*.5,v=h.getDistancesFromPositions([[r.rectangle[0],g,0],[r.rectangle[2],g,0]],"GEODESIC")[0]/5;u=new _.MaterialAppearance({material:new _.Material({fabric:{type:"Image",uniforms:{image:p}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(v),flat:!0}),this.primitive&&r.rectangle&&(this.primitive.appearance.material.uniforms.image=p,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(v)),d(),this.primitive||A.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
|
|
3742
3742
|
in vec3 position3DHigh;
|
|
3743
3743
|
in vec3 position3DLow;
|
|
3744
3744
|
in vec3 normal;
|
|
@@ -3761,7 +3761,7 @@ void main()
|
|
|
3761
3761
|
p += vec4(color.a * upDir * ${e??1e3}, 0.0);
|
|
3762
3762
|
|
|
3763
3763
|
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
3764
|
-
}`}createHeatmapGeometry(e,i){const o=this.czmESHeatMap,r=e||256,a=Math.ceil(i||256),[s,l,u,A]=o.rectangle,c=(u-s)/(r-1),f=(A-l)/(a-1),d=[],p=[],g=[],v=[];for(let y=0;y<r;y++){const m=s+c*y;for(let b=0;b<a;b++){const x=l+f*b;o.heatmap.getValueAt({x:y,y:b});const E=_.Cartesian3.fromDegrees(m,x,o.heatmap._renderer._min);d.push(E.x,E.y,E.z),p.push(y/(r-1),b/(a-1)),b!==a-1&&y!==r-1&&(g.push((y+1)*a+b+1,y*a+b+1,y*a+b),g.push(y*a+b,(y+1)*a+b,(y+1)*a+b+1))}}return this.createGeometry(d,p,g,v)}createGeometry(e,i,o,r){return new _.Geometry({attributes:new _.GeometryAttributes({position:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(i)})}),indices:new Uint32Array(o),boundingSphere:_.BoundingSphere.fromVertices(e,new _.Cartesian3,3),primitiveType:_.PrimitiveType.TRIANGLES})}}const bn={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 bk{constructor(n){z(this,"_coordinator");z(this,"_data");z(this,"_radi");z(this,"_min");z(this,"_max");z(this,"_xField");z(this,"_yField");z(this,"_valueField");z(this,"_cfgRadius");this._coordinator=new TS,this._data={},this._radi={},this._min=0,this._max=1,this._xField=n.xField||n.defaultXField||bn.defaultXField,this._yField=n.yField||n.defaultYField||bn.defaultYField,this._valueField=n.valueField||n.defaultValueField||bn.defaultValueField,n.radius&&(this._cfgRadius=n.radius)}_organiseData(n,e){const i=n[this._xField],o=n[this._yField],r=n[this._valueField]||1,a=n.radius||this._cfgRadius||bn.defaultRadius;return this._data[i]||(this._data[i]={},this._radi[i]={}),this._data[i][o]?this._data[i][o]+=r:(this._data[i][o]=r,this._radi[i][o]=a),this._data[i][o]>this._max?(e?this.setDataMax(this._data[i][o]):this._max=this._data[i][o],!1):{x:i,y:o,value:r,radius:a,min:this._min,max:this._max}}_unOrganizeData(){const n=[];for(const e in this._data)for(const i in this._data[e])n.push({x:Number(e),y:Number(i),radius:this._radi[e][i],value:this._data[e][i]});return{min:this._min,max:this._max,data:n}}_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(n){if(Array.isArray(n))n.forEach(e=>this.addData(e));else{const e=this._organiseData(n,!0);e&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[e]})}return this}setData(n){this._data={},this._radi={};for(const e of n.data)this._organiseData(e,!1);return this._max=n.max,this._min=n.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMax(n){return this._max=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMin(n){return this._min=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setCoordinator(n){this._coordinator=n}getData(){return this._unOrganizeData()}}class xk{constructor(n){z(this,"shadowCanvas");z(this,"canvas");z(this,"_renderBoundaries");z(this,"_width");z(this,"_height");z(this,"shadowCtx");z(this,"ctx");z(this,"_palette");z(this,"_templates");z(this,"_blur",bn.defaultBlur);z(this,"_opacity",0);z(this,"_maxOpacity",bn.defaultMaxOpacity*255);z(this,"_minOpacity",bn.defaultMinOpacity*255);z(this,"_useGradientOpacity",!1);z(this,"_min",0);z(this,"_max",1);const e=n.container;this.shadowCanvas=document.createElement("canvas"),this.canvas=n.canvas||document.createElement("canvas"),this._renderBoundaries=[1e4,1e4,0,0];const i=getComputedStyle(e);this.canvas.className="heatmap-canvas",this._width=this.canvas.width=this.shadowCanvas.width=+i.width.replace(/px/,""),this._height=this.canvas.height=this.shadowCanvas.height=+i.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(n),this._templates={},this._setStyles(n)}_getColorPalette(n){const e=n.gradient||n.defaultGradient||bn.defaultGradient,i=document.createElement("canvas"),o=i.getContext("2d");i.width=256,i.height=1;const r=o.createLinearGradient(0,0,256,1);for(const a in e)r.addColorStop(Number(a),e[a]);return o.fillStyle=r,o.fillRect(0,0,256,1),o.getImageData(0,0,256,1).data}_getPointTemplate(n,e){const i=document.createElement("canvas"),o=i.getContext("2d"),r=n,a=n;if(i.width=i.height=n*2,e===1)o.beginPath(),o.arc(r,a,n,0,2*Math.PI,!1),o.fillStyle="rgba(0,0,0,1)",o.fill();else{const s=o.createRadialGradient(r,a,n*e,r,a,n);s.addColorStop(0,"rgba(0,0,0,1)"),s.addColorStop(1,"rgba(0,0,0,0)"),o.fillStyle=s,o.fillRect(0,0,2*n,2*n)}return i}renderPartial(n){this._drawAlpha(n),this._colorize()}renderAll(n){this._clear(),this._drawAlpha(this._prepareData(n)),this._colorize()}_prepareData(n){const e=[],i=Object.keys(n.data);for(const o of i){const r=Object.keys(n.data[o]);for(const a of r)e.push({x:Number(o),y:Number(a),value:n.data[o][a],radius:n.radi[o][a]})}return{min:n.min,max:n.max,data:e}}updateConfig(n){n.gradient&&(this._palette=this._getColorPalette(n)),this._setStyles(n)}setDimensions(n,e){this._width=n,this._height=e,this.canvas.width=this.shadowCanvas.width=n,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(n){this._blur=n.blur===0?0:n.blur||n.defaultBlur||bn.defaultBlur,n.backgroundColor&&(this.canvas.style.backgroundColor=n.backgroundColor),this._opacity=(n.opacity||0)*255,this._maxOpacity=(n.maxOpacity||n.defaultMaxOpacity||bn.defaultMaxOpacity)*255,this._minOpacity=(n.minOpacity||n.defaultMinOpacity||bn.defaultMinOpacity)*255,this._useGradientOpacity=!!n.useGradientOpacity}_drawAlpha(n){this._min=n.min,this._max=n.max;const e=1-this._blur;for(const i of n.data){const o=i.radius,r=i.x-o,a=i.y-o,s=Math.min(i.value,this._max);this._templates[o]=this._getPointTemplate(o,e),this.shadowCtx.globalAlpha=(s-this._min)/(this._max-this._min),this.shadowCtx.drawImage(this._templates[o],r,a),this._renderBoundaries[0]=Math.min(this._renderBoundaries[0],r),this._renderBoundaries[1]=Math.min(this._renderBoundaries[1],a),this._renderBoundaries[2]=Math.max(this._renderBoundaries[2],r+2*o),this._renderBoundaries[3]=Math.max(this._renderBoundaries[3],a+2*o)}}_colorize(){let[n,e,i,o]=this._renderBoundaries;n=Math.max(0,n),e=Math.max(0,e),i=Math.min(this._width-n,i-n),o=Math.min(this._height-e,o-e);const r=this.shadowCtx.getImageData(n,e,i,o),a=r.data;for(let s=3;s<a.length;s+=4){const l=a[s],u=l*4;if(!u)continue;let A;this._opacity>0?A=this._opacity:A=l<this._maxOpacity?l<this._minOpacity?this._minOpacity:l:this._maxOpacity,a[s-3]=this._palette[u],a[s-2]=this._palette[u+1],a[s-1]=this._palette[u+2],a[s]=this._useGradientOpacity?this._palette[u+3]:A}this.ctx.putImageData(r,n,e),this._renderBoundaries=[1e3,1e3,0,0]}getValueAt(n){const i=this.shadowCtx.getImageData(n.x,n.y,1,1).data[3];return Math.abs(this._max-this._min)*(i/255)>>0}getDataURL(){return this.canvas.toDataURL()}}class TS{constructor(){z(this,"cStore");this.cStore={}}on(n,e,i){this.cStore[n]||(this.cStore[n]=[]),this.cStore[n].push(o=>e.call(i,o))}emit(n,e){this.cStore[n]&&this.cStore[n].forEach(i=>i(e))}}class _k{constructor(n={}){z(this,"_config");z(this,"_coordinator");z(this,"_renderer");z(this,"_store");if(this._config={...bn,...n},this._coordinator=new TS,this._config.plugin){const e=bn.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 xk(this._config),this._store=new bk(this._config);this._connect()}_connect(){this._coordinator.on("renderpartial",n=>this._renderer.renderPartial(n),this._renderer),this._coordinator.on("renderall",n=>this._renderer.renderAll(n),this._renderer),this._coordinator.on("extremachange",n=>{var e,i;(i=(e=this._config).onExtremaChange)==null||i.call(e,{min:n.min,max:n.max,gradient:this._config.gradient||this._config.defaultGradient||bn.defaultGradient})}),this._store.setCoordinator(this._coordinator)}addData(n){return this._store.addData(n),this}setData(n){return this._store.setData(n),this}setDataMax(n){return this._store.setDataMax(n),this}setDataMin(n){return this._store.setDataMin(n),this}configure(n){return this._config={...this._config,...n},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(n){return this._store.getValueAt?this._store.getValueAt(n):this._renderer.getValueAt?this._renderer.getValueAt(n):null}}const Ck=t=>new _k(t),Bc=class Bc extends Un{constructor(e,i){super(e,i);z(this,"_heatmap");z(this,"_div");z(this,"_primitiveObj");z(this,"_rectangle",this.disposeVar(h.react(void 0)));z(this,"onePixelRadius",1e-4);const o=i.viewer,r=256;if(this._primitiveObj=this.ad(new h.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new wk(this,i):new vk(this,i))),!o){console.warn("viewer is undefined!");return}this._div=document.createElement("div"),this.div.style.display="none",this.div.style.width=`${r}px`,this.div.style.height=`${r}px`,document.body.appendChild(this.div),this.ad(()=>{document.body.removeChild(this.div)}),this._heatmap=Ck({container:this.div}),this.heatmap._renderer.setDimensions(r,r);const a=this.ad(new h.Event);let s=[],l={max:100,min:0};{const u=()=>{const c={radius:e.radius??h.ESHeatMap.defaults.radius,gradient:e.gradient??h.ESHeatMap.defaults.gradient,blur:e.blur??h.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(c),this.heatmap._store._cfgRadius=c.radius,a.emit()};u();const A=this.ad(h.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(A.don(u))}{const u=()=>{if(e.data&&e.data.length>2){const{maxPos:c,minPos:f}=h.getMinMaxCorner(e.data),d=c[0]-f[0],p=c[1]-f[1];if(l={max:c[2]??100,min:f[2]??0},!Number.isFinite(d)||!Number.isFinite(p)||d<=0||p<=0)return;const g=1/Math.cos((f[1]+p*.5)*Math.PI/180);if(g==1/0)return;const v=r*p/d*g;this.div.style.width=`${r}px`,this.div.style.height=`${v}px`,this.heatmap._renderer.setDimensions(r,v);const y=d/r*(e.radius??h.ESHeatMap.defaults.radius)*2,m=p/v*(e.radius??h.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(y,m),this.rectangle=[f[0]-y,f[1]-m,c[0]+y,c[1]+m],s=Sk(e.data,this.rectangle,r,v),a.emit()}};u();const A=this.ad(h.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(A.don(u))}{const u=()=>{const A={max:l.max,min:l.min,data:s};this.heatmap.setData(A),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};u(),this.ad(a.don(u))}this.ad(this._primitiveObj.objChanged.don(()=>{a.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,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this.rectangle?(Me(r,o,i,[[this.rectangle[0],this.rectangle[1],0],[this.rectangle[2],this.rectangle[3],0]],e),!0):!1:!1}};z(Bc,"type",Bc.register("ESCesiumViewer",h.ESHeatMap.type,Bc));let dv=Bc;function Sk(t,n,e,i,o){return t.map(r=>({x:(r[0]-n[0])*e/(n[2]-n[0])|0,y:(1-(r[1]-n[1])/(n[3]-n[1]))*i|0,value:r[2]}))}const Tc=class Tc extends Jt{constructor(e,i){super(e,i);z(this,"czmPoints");if(!i.viewer){console.error("viewer is null");return}this.czmPoints=this.ad(new Eo(i,e.id)),this._updateShow();const r=this.ad(h.createNextAnimateFrameEvent(e.showChanged,e.pointedChanged));this.ad(r.don(()=>this._updateShow())),this._updatePoints();const a=this.ad(h.createNextAnimateFrameEvent(e.pointsChanged,e.pointStyleChanged));this.ad(a.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(i=>{var o,r,a,s;return{position:i,pixelSize:((o=this.sceneObject.pointStyle)==null?void 0:o.size)??h.ESGeoPoints.defaults.pointStyle.size,color:((r=this.sceneObject.pointStyle)==null?void 0:r.color)??h.ESGeoPoints.defaults.pointStyle.color,outlineColor:((a=this.sceneObject.pointStyle)==null?void 0:a.outlineColor)??h.ESGeoPoints.defaults.pointStyle.outlineColor,outlineWidth:((s=this.sceneObject.pointStyle)==null?void 0:s.outlineWidth)??h.ESGeoPoints.defaults.pointStyle.outlineWidth}}))}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};z(Tc,"type",Tc.register("ESCesiumViewer",h.ESGeoPoints.type,Tc));let mv=Tc;const es=class es extends _n{constructor(e){super();z(this,"_config",this.disposeVar(h.react(es.defaultConfig)));z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"_pointerEventFilterFunc",this.disposeVar(h.react(es.defaultPointerEventFilterFunc)));z(this,"point");z(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 h.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new Ek(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 zn(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}};z(es,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),z(es,"defaultPointerEventFilterFunc",e=>e.button===0),z(es,"defaults",{..._n.defaults,position:[116.39,39.9,0]});let Fi=es;(t=>{t.createDefaultProps=()=>({..._n.createDefaultProps(),position:h.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Fi||(Fi={})),h.extendClassProps(Fi.prototype,Fi.createDefaultProps);class Ek extends h.Destroyable{constructor(e,i){super();z(this,"_doings",[]);z(this,"initDoings",this.ad(()=>{this._doings.forEach(e=>e.destroy()),this._doings.length=0}));this._czmViewer=e,this._placeEditing=i;const o=(r,a)=>{a=="click"&&(!i.clickEnabled||!i.pointerEventFilterFunc(r))||a=="dblclick"&&(!i.dblClickEnabled||!i.pointerEventFilterFunc(r))||(i.over(),i.enabled=!1)};this.ad(e.clickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"click")})),this.ad(e.dblclickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"dblclick")})),this.ad(e.pointerMoveEvent.don(r=>{if(!r.pointerEvent)return;const a=new Pk(this,r.pointerEvent,s=>{if(!s||s[2]<-1e5){i.position=void 0;return}const l=[...s];e.editingHeightOffset&&(l[2]+=e.editingHeightOffset),i.position=l,this._doings.splice(0,this._doings.indexOf(a)+1).forEach(A=>A.destroy())});this._doings.push(a)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class Pk extends h.Destroyable{constructor(n,e,i){super(),this._owner=n;const{czmViewer:o}=this._owner,r=i0(o,e,this._owner.placeEditing.virtualHeight),[a]=h.getEventFromPromise(r);this.dispose(a.disposableOn(i))}}class Fn extends _n{constructor(){super()}}z(Fn,"defaults",{..._n.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({..._n.createDefaultProps(),position:h.reactArrayWithUndefined(void 0)})})(Fn||(Fn={})),h.extendClassProps(Fn.prototype,Fn.createDefaultProps);function gv(t,n){const e=new Xe(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=n,e}const Zn=class Zn extends h.Destroyable{constructor(n){if(super(),!n.viewer)return;const e=this.disposeVar(gv(n,Zn.defaults.xAxisColor)),i=this.disposeVar(gv(n,Zn.defaults.yAxisColor)),o=this.disposeVar(gv(n,Zn.defaults.zAxisColor));{const r=()=>{e.show=this.xAxisShow&&this.show,i.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};r();const a=this.ad(h.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(a.disposableOn(r))}{const r=()=>{const{position:s=Zn.defaults.position,heading:l=Zn.defaults.heading}=this,[u,A,c]=s,{dimensions:f=Zn.defaults.dimensions}=this;o.positions=[s,[u,A,c+f[2]]];const d=h.geoRhumbDestination(s,f[0],90+l);d&&(e.positions=[s,d]);const p=h.geoRhumbDestination(s,f[1],0+l);p&&(i.positions=[s,p])};r();const a=this.disposeVar(h.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(a.disposableOn(r))}{const r=()=>{e.color=this.xAxisColor??Zn.defaults.xAxisColor,i.color=this.yAxisColor??Zn.defaults.yAxisColor,o.color=this.zAxisColor??Zn.defaults.zAxisColor};r();const a=this.disposeVar(h.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(a.disposableOn(r))}}};z(Zn,"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 Zr=Zn;(t=>{t.createDefaultProps=()=>({show:!0,position:h.reactArrayWithUndefined(void 0),heading:0,dimensions:h.reactArray([1e3,1e3,1e3]),xAxisColor:h.reactArray([1,0,0,1]),yAxisColor:h.reactArray([0,1,0,1]),zAxisColor:h.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(Zr||(Zr={})),h.extendClassProps(Zr.prototype,Zr.createDefaultProps);const no=class no extends Fn{constructor(e){super();z(this,"_opInfo",{step:this.ad(h.react(!1)),moved:this.ad(h.react(!1)),constraintMode:this.ad(h.react("none")),originPosition:this.disposeVar(h.reactArray(Fn.defaults.position)),originHeading:this.disposeVar(h.react(0)),originDimensions:this.disposeVar(h.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(h.reactArray([0,0,0])),movingPosition:this.disposeVar(h.reactArray([0,0,0])),targetPosition:this.disposeVar(h.reactArray([0,0,0])),targetHeading:this.disposeVar(h.react(0))});z(this,"_createCoordinates",e=>{const i=this.ad(new Zr(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{IS(i,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const a=[...this.position??no.defaults.position];e.editingHeightOffset&&(a[2]-=e.editingHeightOffset),i.position=a};o(),this.dispose(this.positionChanged.disposableOn(o))}{const o=()=>{i.heading=this.heading??0};o(),this.dispose(this.headingChanged.disposableOn(o))}{const o=()=>{i.dimensions=this._opInfo.originDimensions.value};o(),this.dispose(this._opInfo.originDimensions.changed.disposableOn(o))}return i});z(this,"_createOriginCoordinates",e=>{const i=this.ad(new Zr(e));i.xAxisColor=[1,0,0,.5],i.yAxisColor=[0,1,0,.5],i.zAxisColor=[0,0,1,.5];const{originPosition:o,originHeading:r,originDimensions:a}=this._opInfo;{const s=()=>{i.position=o.value};s(),this.dispose(o.changed.disposableOn(s))}{const s=()=>{i.heading=r.value??0};s(),this.dispose(r.changed.disposableOn(s))}{const s=()=>{i.dimensions=a.value};s(),this.dispose(a.changed.disposableOn(s))}return i});z(this,"_createGrid",e=>{const i=this.ad(new Jn(e));{const o=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originHeading.value,l=this._opInfo.originDimensions.value[0],u=[];for(let A=-4;A<5;++A){const c=h.geoRhumbDestination(a,l*.2*A,s+90);if(c){const f=h.geoRhumbDestination(c,l,s+180),d=h.geoRhumbDestination(c,l,s);f&&d&&u.push([f,c,d])}}for(let A=-4;A<5;++A){const c=h.geoRhumbDestination(a,l*.2*A,s);if(c){const f=h.geoRhumbDestination(c,l,s-90),d=h.geoRhumbDestination(c,l,s+90);f&&d&&u.push([f,c,d])}}i.positions=u};o();const r=this.disposeVar(h.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originHeading.changed,this._opInfo.originDimensions.changed));this.dispose(r.disposableOn(o))}return i});z(this,"_createHelpLine",e=>{const i=this.ad(new Xe(e));i.hasDash=!0,i.arcType="RHUMB",i.color=[1,1,0,.99];{const o=()=>{i.positions=[this._opInfo.originPosition.value,this._opInfo.targetPosition.value]},r=this.ad(h.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.targetPosition.changed));this.ad(r.don(o))}return i});z(this,"_createCircle",e=>{const i=this.ad(new Jn(e));i.arcType="RHUMB",i.width=2,i.hasDash=!0;const o=this.disposeVar(h.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),r=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originDimensions.value[0],l=[],u=32;for(let A=0;A<=u;++A){const c=h.geoRhumbDestination(a,s,A*360/u);c&&l.push(c)}i.positions=[l]};return r(),this.dispose(o.disposableOn(r)),i});z(this,"_pickingXYProcessing",e=>this.ad(new h.Processing((i,o,r)=>{const a=[0,0,0],s=new _.Cartographic;return e.pointerMoveEvent.don(l=>{if(!l.pointerEvent||!e.viewer)return;const u=$n(h.getDomEventCurrentTargetPos(l.pointerEvent));if(!ss(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;rs(s,a),this._opInfo.constraintMode.value==="x"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="y"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a;const A=[0,0,0];h.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A})})));z(this,"_pickingZProcessing",e=>this.ad(new h.Processing(()=>{const i=new _.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=$n(h.getDomEventCurrentTargetPos(r.pointerEvent));if(!Xc(e.viewer.scene,At(this._opInfo.originPosition.value),a,i))return;const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s]}})})));z(this,"_pickingZAxisProcessing",e=>this.ad(new h.Processing(()=>{const i=[0,0,0],o=new _.Cartographic;return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=$n(h.getDomEventCurrentTargetPos(r.pointerEvent));if(!ss(e.viewer.scene,a,this._opInfo.originPosition.value[2],o))return;rs(o,i);const s=h.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),u=h.geoRhumbHeading(this._opInfo.originPosition.value,i)-s;let A=this._opInfo.originHeading.value+u;A=_.Math.toDegrees(_.Math.negativePiToPi(_.Math.toRadians(A))),this._opInfo.movingPosition.value=i,this.heading=this._opInfo.targetHeading.value=A})})));if(!e.viewer)return;const i=this.ad(h.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new Wf(e,this.positionReact,i,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(r=>{if(this._opInfo.moved){const a=[...r];e.editingHeightOffset&&(a[2]+=e.editingHeightOffset),this.position=a}})),this.ad(this._opInfo.targetHeading.changed.don(r=>this._opInfo.moved&&(this.heading=r)));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((r,a)=>r===this._opInfo.targetPosition.value[a])){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),r=this._createOriginCoordinates(e),a=this._createGrid(e),s=this._createHelpLine(e),l=this._createCircle(e);{const u=()=>{l.show=a.show=this.enabled&&this.showCircle,s.show=this.enabled&&this.showCircle&&this._opInfo.moved.value,o.show=this.enabled&&this.showCoordinates,r.show=this.enabled&&this.showCoordinates&&this._opInfo.moved.value};u();const A=this.ad(h.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(A.don(u))}{const u=()=>{o.xAxisShow=r.xAxisShow=this.xAxisShow,o.yAxisShow=r.yAxisShow=this.yAxisShow,o.zAxisShow=r.zAxisShow=this.zAxisShow};u();const A=this.ad(h.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(A.don(u))}{const u=()=>{a.color=this._opInfo.constraintMode.value!=="none"?[1,1,0,.6]:[1,1,0,.3],l.color=this._opInfo.constraintMode.value==="zAxis"?[1,1,0,.99]:[1,1,0,.5],IS(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u))}{const u=this._pickingXYProcessing(e),A=this._pickingZProcessing(e),c=this._pickingZAxisProcessing(e),f=()=>{const b=[...this.position??no.defaults.position];e.editingHeightOffset&&(b[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=b},d=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,p=()=>this._opInfo.originDimensions.value=i.value,g={constraintMode:"none",startDragPos:[0,0,0]},v=b=>{const x={position:o.position??no.defaults.position,heading:o.heading??no.defaults.heading,dimensions:o.dimensions??no.defaults.dimensions};e.viewer&&Df(b,e.viewer.scene,x,this.axisSnapPixelSize,g,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=g.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=g.startDragPos},y=this.ad(h.createProcessingFromAsyncFunc(async b=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",b.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await h.step(b,async x=>{x.disposer.dispose((f(),this.positionChanged.don(f))),x.disposer.dispose((d(),this.headingChanged.don(d))),x.disposer.dispose((p(),i.changed.don(p))),x.disposer.dispose(e.pointerMoveEvent.don(E=>{E.pointerEvent&&v(E.pointerEvent)})),await h.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerDownEvent.don(I=>{I.pointerEvent&&v(I.pointerEvent),I.pointerEvent&&I.pointerEvent.button===0&&g.constraintMode!=="none"&&B()}))}))}),this._opInfo.step.value=!1,await h.step(b,async x=>{if(e.incrementDisabledInputStack(),x.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const E=h.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),B=h.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);u.restart(void 0,E,B),x.disposer.dispose(()=>u.cancel())}else this._opInfo.constraintMode.value==="z"?(A.restart(),x.disposer.dispose(()=>A.cancel())):this._opInfo.constraintMode.value==="zAxis"?(c.restart(),x.disposer.dispose(()=>c.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await h.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerUpEvent.don(()=>{B()})),E.disposer.dispose(e.pointerOutEvent.don(()=>B()))}))}),y.restart()})),m=()=>{this.enabled?y.restart():y.isRunning&&y.cancel()};m(),this.ad(this.enabledChanged.don(m))}}}};z(no,"defaults",{...Fn.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let er=no;(t=>{t.createDefaultProps=()=>({...Fn.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})})(er||(er={})),h.extendClassProps(er.prototype,er.createDefaultProps);function IS(t,n,e){t.xAxisColor=[1,0,0,.99],t.yAxisColor=[0,1,0,.99],t.zAxisColor=[0,0,1,.99],n==="x"?t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="y"?t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="z"?t.zAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="xy"&&(t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99],t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99])}class yv extends h.HasOwner{constructor(e){super(e);z(this,"_valid",!1);z(this,"_normal",new _.Cartesian3(0,0,0));z(this,"_origin",new _.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 i=this.owner.cartesian,o=$n(e);return r0(this.scene,i,this.normal,o)}}class Bk extends yv{constructor(n){super(n);{const e=()=>{const o=ot({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 i=this.ad(h.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(i.don(e))}}}class Tk extends yv{constructor(n){super(n);const e=()=>{const i=ot({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=ot({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:_.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[0],r.y=-o[1],r.z=-o[2]}{const r=this._origin;r.x=o[4],r.y=o[5],r.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 Ik extends yv{constructor(n){super(n);const e=()=>{const i=ot({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=ot({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:_.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[4],r.y=-o[5],r.z=-o[6]}{const r=this._origin;r.x=o[8],r.y=o[9],r.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 ma extends h.Destroyable{constructor(e){super();z(this,"_czmTexture");z(this,"_customPrimitiveForCircle");z(this,"_circleCanvas");z(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new ct(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 i=this.disposeVar(h.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const a=()=>{const l={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},u=this._circleCanvas,A=this.color,c=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, ${A[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,${A[3]})`,u.stroke(),u.lineWidth=4,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=c,u.stroke();{u.lineWidth=1,u.beginPath();let p=_.Math.zeroToTwoPi(l.startRotation),g=_.Math.zeroToTwoPi(l.endRotation);g<p&&(g+=_.Math.TWO_PI),(p!==g||p!==0)&&(u.moveTo(128,128),u.arc(128,128,64,p,g,g-p>Math.PI),u.lineTo(128,128),u.strokeStyle="rgba(255, 255, 0, 1.0)",u.stroke())}let f=_.Math.negativePiToPi(l.rotation);u.lineWidth=3,u.beginPath(),u.moveTo(128,128),u.arc(128,128,64,0,f,_.Math.negativePiToPi(f-0)<0),u.lineTo(128,128),u.fillStyle=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, 0.5)`,u.fill();{u.save(),u.font="16px console",u.textBaseline="middle";const v=`${(_.Math.negativePiToPi(f-0)*180/Math.PI*10|0)/10}°`;var d=u.measureText(v).width;u.translate(128,128),u.rotate(Math.PI*.5),f=_.Math.negativePiToPi(f-0)+0,u.rotate((f+0)*.5),u.scale(i.value?-1:1,1),u.translate(-128,-128),u.fillStyle="white",u.fillText(v,128-d*.5,54),u.lineWidth=1,u.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};a();const s=this.ad(h.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,i.changed));this.ad(s.don(a)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(a))}{const r=()=>{const s=ot({rotation:this.selfRotation});if(!s)return;const l=ot({position:this.position,rotation:this.rotation,localModelMatrix:_.Matrix4.toArray(s)});if(!l)return;const{viewer:u}=e;if(!u)return;const A=_.Cartesian3.dot(u.scene.camera.directionWC,new _.Cartesian3(l[8],l[9],l[10]));i.value=A>0};r();const a=this.ad(h.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(a.don(r))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(Fk(e)),this.dispose(h.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(h.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(h.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(h.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const i=()=>{const o=ot({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&_.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.customPrimitiveForCircle&&this.czmTexture&&(this.customPrimitiveForCircle.uniformMap={u_image:{type:"texture",id:this.czmTexture.id},u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}_createDebugAxis(e){this._debugAxis=this.ad(Mk(e)),this.dispose(h.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(h.track([this._debugAxis,"position"],[this,"position"])),this.dispose(h.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(h.track([this._debugAxis,"show"],[this,"debug"]));{const i=()=>{const o=ot({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&_.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this._debugAxis&&(this._debugAxis.uniformMap={u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}}z(ma,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([0,0,0]),selfRotation:h.reactArray([0,0,0]),pixelSize:300,color:h.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(ma||(ma={})),h.extendClassProps(ma.prototype,ma.createDefaultProps);function Fk(t){return Xf({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]},st,t)}function Mk(t){return Xf({type:"CzmCustomPrimitive",allowPicking:!0,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
|
|
3764
|
+
}`}createHeatmapGeometry(e,i){const o=this.czmESHeatMap,r=e||256,a=Math.ceil(i||256),[s,l,u,A]=o.rectangle,c=(u-s)/(r-1),f=(A-l)/(a-1),d=[],p=[],g=[],v=[];for(let y=0;y<r;y++){const m=s+c*y;for(let b=0;b<a;b++){const x=l+f*b;o.heatmap.getValueAt({x:y,y:b});const E=_.Cartesian3.fromDegrees(m,x,o.heatmap._renderer._min);d.push(E.x,E.y,E.z),p.push(y/(r-1),b/(a-1)),b!==a-1&&y!==r-1&&(g.push((y+1)*a+b+1,y*a+b+1,y*a+b),g.push(y*a+b,(y+1)*a+b,(y+1)*a+b+1))}}return this.createGeometry(d,p,g,v)}createGeometry(e,i,o,r){return new _.Geometry({attributes:new _.GeometryAttributes({position:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(i)})}),indices:new Uint32Array(o),boundingSphere:_.BoundingSphere.fromVertices(e,new _.Cartesian3,3),primitiveType:_.PrimitiveType.TRIANGLES})}}const bn={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 b6{constructor(n){z(this,"_coordinator");z(this,"_data");z(this,"_radi");z(this,"_min");z(this,"_max");z(this,"_xField");z(this,"_yField");z(this,"_valueField");z(this,"_cfgRadius");this._coordinator=new TS,this._data={},this._radi={},this._min=0,this._max=1,this._xField=n.xField||n.defaultXField||bn.defaultXField,this._yField=n.yField||n.defaultYField||bn.defaultYField,this._valueField=n.valueField||n.defaultValueField||bn.defaultValueField,n.radius&&(this._cfgRadius=n.radius)}_organiseData(n,e){const i=n[this._xField],o=n[this._yField],r=n[this._valueField]||1,a=n.radius||this._cfgRadius||bn.defaultRadius;return this._data[i]||(this._data[i]={},this._radi[i]={}),this._data[i][o]?this._data[i][o]+=r:(this._data[i][o]=r,this._radi[i][o]=a),this._data[i][o]>this._max?(e?this.setDataMax(this._data[i][o]):this._max=this._data[i][o],!1):{x:i,y:o,value:r,radius:a,min:this._min,max:this._max}}_unOrganizeData(){const n=[];for(const e in this._data)for(const i in this._data[e])n.push({x:Number(e),y:Number(i),radius:this._radi[e][i],value:this._data[e][i]});return{min:this._min,max:this._max,data:n}}_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(n){if(Array.isArray(n))n.forEach(e=>this.addData(e));else{const e=this._organiseData(n,!0);e&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[e]})}return this}setData(n){this._data={},this._radi={};for(const e of n.data)this._organiseData(e,!1);return this._max=n.max,this._min=n.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMax(n){return this._max=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMin(n){return this._min=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setCoordinator(n){this._coordinator=n}getData(){return this._unOrganizeData()}}class x6{constructor(n){z(this,"shadowCanvas");z(this,"canvas");z(this,"_renderBoundaries");z(this,"_width");z(this,"_height");z(this,"shadowCtx");z(this,"ctx");z(this,"_palette");z(this,"_templates");z(this,"_blur",bn.defaultBlur);z(this,"_opacity",0);z(this,"_maxOpacity",bn.defaultMaxOpacity*255);z(this,"_minOpacity",bn.defaultMinOpacity*255);z(this,"_useGradientOpacity",!1);z(this,"_min",0);z(this,"_max",1);const e=n.container;this.shadowCanvas=document.createElement("canvas"),this.canvas=n.canvas||document.createElement("canvas"),this._renderBoundaries=[1e4,1e4,0,0];const i=getComputedStyle(e);this.canvas.className="heatmap-canvas",this._width=this.canvas.width=this.shadowCanvas.width=+i.width.replace(/px/,""),this._height=this.canvas.height=this.shadowCanvas.height=+i.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(n),this._templates={},this._setStyles(n)}_getColorPalette(n){const e=n.gradient||n.defaultGradient||bn.defaultGradient,i=document.createElement("canvas"),o=i.getContext("2d");i.width=256,i.height=1;const r=o.createLinearGradient(0,0,256,1);for(const a in e)r.addColorStop(Number(a),e[a]);return o.fillStyle=r,o.fillRect(0,0,256,1),o.getImageData(0,0,256,1).data}_getPointTemplate(n,e){const i=document.createElement("canvas"),o=i.getContext("2d"),r=n,a=n;if(i.width=i.height=n*2,e===1)o.beginPath(),o.arc(r,a,n,0,2*Math.PI,!1),o.fillStyle="rgba(0,0,0,1)",o.fill();else{const s=o.createRadialGradient(r,a,n*e,r,a,n);s.addColorStop(0,"rgba(0,0,0,1)"),s.addColorStop(1,"rgba(0,0,0,0)"),o.fillStyle=s,o.fillRect(0,0,2*n,2*n)}return i}renderPartial(n){this._drawAlpha(n),this._colorize()}renderAll(n){this._clear(),this._drawAlpha(this._prepareData(n)),this._colorize()}_prepareData(n){const e=[],i=Object.keys(n.data);for(const o of i){const r=Object.keys(n.data[o]);for(const a of r)e.push({x:Number(o),y:Number(a),value:n.data[o][a],radius:n.radi[o][a]})}return{min:n.min,max:n.max,data:e}}updateConfig(n){n.gradient&&(this._palette=this._getColorPalette(n)),this._setStyles(n)}setDimensions(n,e){this._width=n,this._height=e,this.canvas.width=this.shadowCanvas.width=n,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(n){this._blur=n.blur===0?0:n.blur||n.defaultBlur||bn.defaultBlur,n.backgroundColor&&(this.canvas.style.backgroundColor=n.backgroundColor),this._opacity=(n.opacity||0)*255,this._maxOpacity=(n.maxOpacity||n.defaultMaxOpacity||bn.defaultMaxOpacity)*255,this._minOpacity=(n.minOpacity||n.defaultMinOpacity||bn.defaultMinOpacity)*255,this._useGradientOpacity=!!n.useGradientOpacity}_drawAlpha(n){this._min=n.min,this._max=n.max;const e=1-this._blur;for(const i of n.data){const o=i.radius,r=i.x-o,a=i.y-o,s=Math.min(i.value,this._max);this._templates[o]=this._getPointTemplate(o,e),this.shadowCtx.globalAlpha=(s-this._min)/(this._max-this._min),this.shadowCtx.drawImage(this._templates[o],r,a),this._renderBoundaries[0]=Math.min(this._renderBoundaries[0],r),this._renderBoundaries[1]=Math.min(this._renderBoundaries[1],a),this._renderBoundaries[2]=Math.max(this._renderBoundaries[2],r+2*o),this._renderBoundaries[3]=Math.max(this._renderBoundaries[3],a+2*o)}}_colorize(){let[n,e,i,o]=this._renderBoundaries;n=Math.max(0,n),e=Math.max(0,e),i=Math.min(this._width-n,i-n),o=Math.min(this._height-e,o-e);const r=this.shadowCtx.getImageData(n,e,i,o),a=r.data;for(let s=3;s<a.length;s+=4){const l=a[s],u=l*4;if(!u)continue;let A;this._opacity>0?A=this._opacity:A=l<this._maxOpacity?l<this._minOpacity?this._minOpacity:l:this._maxOpacity,a[s-3]=this._palette[u],a[s-2]=this._palette[u+1],a[s-1]=this._palette[u+2],a[s]=this._useGradientOpacity?this._palette[u+3]:A}this.ctx.putImageData(r,n,e),this._renderBoundaries=[1e3,1e3,0,0]}getValueAt(n){const i=this.shadowCtx.getImageData(n.x,n.y,1,1).data[3];return Math.abs(this._max-this._min)*(i/255)>>0}getDataURL(){return this.canvas.toDataURL()}}class TS{constructor(){z(this,"cStore");this.cStore={}}on(n,e,i){this.cStore[n]||(this.cStore[n]=[]),this.cStore[n].push(o=>e.call(i,o))}emit(n,e){this.cStore[n]&&this.cStore[n].forEach(i=>i(e))}}class _6{constructor(n={}){z(this,"_config");z(this,"_coordinator");z(this,"_renderer");z(this,"_store");if(this._config={...bn,...n},this._coordinator=new TS,this._config.plugin){const e=bn.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 x6(this._config),this._store=new b6(this._config);this._connect()}_connect(){this._coordinator.on("renderpartial",n=>this._renderer.renderPartial(n),this._renderer),this._coordinator.on("renderall",n=>this._renderer.renderAll(n),this._renderer),this._coordinator.on("extremachange",n=>{var e,i;(i=(e=this._config).onExtremaChange)==null||i.call(e,{min:n.min,max:n.max,gradient:this._config.gradient||this._config.defaultGradient||bn.defaultGradient})}),this._store.setCoordinator(this._coordinator)}addData(n){return this._store.addData(n),this}setData(n){return this._store.setData(n),this}setDataMax(n){return this._store.setDataMax(n),this}setDataMin(n){return this._store.setDataMin(n),this}configure(n){return this._config={...this._config,...n},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(n){return this._store.getValueAt?this._store.getValueAt(n):this._renderer.getValueAt?this._renderer.getValueAt(n):null}}const C6=t=>new _6(t),Bc=class Bc extends Un{constructor(e,i){super(e,i);z(this,"_heatmap");z(this,"_div");z(this,"_primitiveObj");z(this,"_rectangle",this.disposeVar(h.react(void 0)));z(this,"onePixelRadius",1e-4);const o=i.viewer,r=256;if(this._primitiveObj=this.ad(new h.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new w6(this,i):new v6(this,i))),!o){console.warn("viewer is undefined!");return}this._div=document.createElement("div"),this.div.style.display="none",this.div.style.width=`${r}px`,this.div.style.height=`${r}px`,document.body.appendChild(this.div),this.ad(()=>{document.body.removeChild(this.div)}),this._heatmap=C6({container:this.div}),this.heatmap._renderer.setDimensions(r,r);const a=this.ad(new h.Event);let s=[],l={max:100,min:0};{const u=()=>{const c={radius:e.radius??h.ESHeatMap.defaults.radius,gradient:e.gradient??h.ESHeatMap.defaults.gradient,blur:e.blur??h.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(c),this.heatmap._store._cfgRadius=c.radius,a.emit()};u();const A=this.ad(h.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(A.don(u))}{const u=()=>{if(e.data&&e.data.length>2){const{maxPos:c,minPos:f}=h.getMinMaxCorner(e.data),d=c[0]-f[0],p=c[1]-f[1];if(l={max:c[2]??100,min:f[2]??0},!Number.isFinite(d)||!Number.isFinite(p)||d<=0||p<=0)return;const g=1/Math.cos((f[1]+p*.5)*Math.PI/180);if(g==1/0)return;const v=r*p/d*g;this.div.style.width=`${r}px`,this.div.style.height=`${v}px`,this.heatmap._renderer.setDimensions(r,v);const y=d/r*(e.radius??h.ESHeatMap.defaults.radius)*2,m=p/v*(e.radius??h.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(y,m),this.rectangle=[f[0]-y,f[1]-m,c[0]+y,c[1]+m],s=S6(e.data,this.rectangle,r,v),a.emit()}};u();const A=this.ad(h.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(A.don(u))}{const u=()=>{const A={max:l.max,min:l.min,data:s};this.heatmap.setData(A),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};u(),this.ad(a.don(u))}this.ad(this._primitiveObj.objChanged.don(()=>{a.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,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this.rectangle?(Me(r,o,i,[[this.rectangle[0],this.rectangle[1],0],[this.rectangle[2],this.rectangle[3],0]],e),!0):!1:!1}};z(Bc,"type",Bc.register("ESCesiumViewer",h.ESHeatMap.type,Bc));let dv=Bc;function S6(t,n,e,i,o){return t.map(r=>({x:(r[0]-n[0])*e/(n[2]-n[0])|0,y:(1-(r[1]-n[1])/(n[3]-n[1]))*i|0,value:r[2]}))}const Tc=class Tc extends Jt{constructor(e,i){super(e,i);z(this,"czmPoints");if(!i.viewer){console.error("viewer is null");return}this.czmPoints=this.ad(new Eo(i,e.id)),this._updateShow();const r=this.ad(h.createNextAnimateFrameEvent(e.showChanged,e.pointedChanged));this.ad(r.don(()=>this._updateShow())),this._updatePoints();const a=this.ad(h.createNextAnimateFrameEvent(e.pointsChanged,e.pointStyleChanged));this.ad(a.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(i=>{var o,r,a,s;return{position:i,pixelSize:((o=this.sceneObject.pointStyle)==null?void 0:o.size)??h.ESGeoPoints.defaults.pointStyle.size,color:((r=this.sceneObject.pointStyle)==null?void 0:r.color)??h.ESGeoPoints.defaults.pointStyle.color,outlineColor:((a=this.sceneObject.pointStyle)==null?void 0:a.outlineColor)??h.ESGeoPoints.defaults.pointStyle.outlineColor,outlineWidth:((s=this.sceneObject.pointStyle)==null?void 0:s.outlineWidth)??h.ESGeoPoints.defaults.pointStyle.outlineWidth}}))}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};z(Tc,"type",Tc.register("ESCesiumViewer",h.ESGeoPoints.type,Tc));let mv=Tc;const es=class es extends _n{constructor(e){super();z(this,"_config",this.disposeVar(h.react(es.defaultConfig)));z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"_pointerEventFilterFunc",this.disposeVar(h.react(es.defaultPointerEventFilterFunc)));z(this,"point");z(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 h.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new E6(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 zn(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}};z(es,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),z(es,"defaultPointerEventFilterFunc",e=>e.button===0),z(es,"defaults",{..._n.defaults,position:[116.39,39.9,0]});let Fi=es;(t=>{t.createDefaultProps=()=>({..._n.createDefaultProps(),position:h.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Fi||(Fi={})),h.extendClassProps(Fi.prototype,Fi.createDefaultProps);class E6 extends h.Destroyable{constructor(e,i){super();z(this,"_doings",[]);z(this,"initDoings",this.ad(()=>{this._doings.forEach(e=>e.destroy()),this._doings.length=0}));this._czmViewer=e,this._placeEditing=i;const o=(r,a)=>{a=="click"&&(!i.clickEnabled||!i.pointerEventFilterFunc(r))||a=="dblclick"&&(!i.dblClickEnabled||!i.pointerEventFilterFunc(r))||(i.over(),i.enabled=!1)};this.ad(e.clickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"click")})),this.ad(e.dblclickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"dblclick")})),this.ad(e.pointerMoveEvent.don(r=>{if(!r.pointerEvent)return;const a=new P6(this,r.pointerEvent,s=>{if(!s||s[2]<-1e5){i.position=void 0;return}const l=[...s];e.editingHeightOffset&&(l[2]+=e.editingHeightOffset),i.position=l,this._doings.splice(0,this._doings.indexOf(a)+1).forEach(A=>A.destroy())});this._doings.push(a)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class P6 extends h.Destroyable{constructor(n,e,i){super(),this._owner=n;const{czmViewer:o}=this._owner,r=i0(o,e,this._owner.placeEditing.virtualHeight),[a]=h.getEventFromPromise(r);this.dispose(a.disposableOn(i))}}class Fn extends _n{constructor(){super()}}z(Fn,"defaults",{..._n.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({..._n.createDefaultProps(),position:h.reactArrayWithUndefined(void 0)})})(Fn||(Fn={})),h.extendClassProps(Fn.prototype,Fn.createDefaultProps);function gv(t,n){const e=new Xe(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=n,e}const Zn=class Zn extends h.Destroyable{constructor(n){if(super(),!n.viewer)return;const e=this.disposeVar(gv(n,Zn.defaults.xAxisColor)),i=this.disposeVar(gv(n,Zn.defaults.yAxisColor)),o=this.disposeVar(gv(n,Zn.defaults.zAxisColor));{const r=()=>{e.show=this.xAxisShow&&this.show,i.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};r();const a=this.ad(h.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(a.disposableOn(r))}{const r=()=>{const{position:s=Zn.defaults.position,heading:l=Zn.defaults.heading}=this,[u,A,c]=s,{dimensions:f=Zn.defaults.dimensions}=this;o.positions=[s,[u,A,c+f[2]]];const d=h.geoRhumbDestination(s,f[0],90+l);d&&(e.positions=[s,d]);const p=h.geoRhumbDestination(s,f[1],0+l);p&&(i.positions=[s,p])};r();const a=this.disposeVar(h.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(a.disposableOn(r))}{const r=()=>{e.color=this.xAxisColor??Zn.defaults.xAxisColor,i.color=this.yAxisColor??Zn.defaults.yAxisColor,o.color=this.zAxisColor??Zn.defaults.zAxisColor};r();const a=this.disposeVar(h.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(a.disposableOn(r))}}};z(Zn,"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 Zr=Zn;(t=>{t.createDefaultProps=()=>({show:!0,position:h.reactArrayWithUndefined(void 0),heading:0,dimensions:h.reactArray([1e3,1e3,1e3]),xAxisColor:h.reactArray([1,0,0,1]),yAxisColor:h.reactArray([0,1,0,1]),zAxisColor:h.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(Zr||(Zr={})),h.extendClassProps(Zr.prototype,Zr.createDefaultProps);const no=class no extends Fn{constructor(e){super();z(this,"_opInfo",{step:this.ad(h.react(!1)),moved:this.ad(h.react(!1)),constraintMode:this.ad(h.react("none")),originPosition:this.disposeVar(h.reactArray(Fn.defaults.position)),originHeading:this.disposeVar(h.react(0)),originDimensions:this.disposeVar(h.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(h.reactArray([0,0,0])),movingPosition:this.disposeVar(h.reactArray([0,0,0])),targetPosition:this.disposeVar(h.reactArray([0,0,0])),targetHeading:this.disposeVar(h.react(0))});z(this,"_createCoordinates",e=>{const i=this.ad(new Zr(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{IS(i,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const a=[...this.position??no.defaults.position];e.editingHeightOffset&&(a[2]-=e.editingHeightOffset),i.position=a};o(),this.dispose(this.positionChanged.disposableOn(o))}{const o=()=>{i.heading=this.heading??0};o(),this.dispose(this.headingChanged.disposableOn(o))}{const o=()=>{i.dimensions=this._opInfo.originDimensions.value};o(),this.dispose(this._opInfo.originDimensions.changed.disposableOn(o))}return i});z(this,"_createOriginCoordinates",e=>{const i=this.ad(new Zr(e));i.xAxisColor=[1,0,0,.5],i.yAxisColor=[0,1,0,.5],i.zAxisColor=[0,0,1,.5];const{originPosition:o,originHeading:r,originDimensions:a}=this._opInfo;{const s=()=>{i.position=o.value};s(),this.dispose(o.changed.disposableOn(s))}{const s=()=>{i.heading=r.value??0};s(),this.dispose(r.changed.disposableOn(s))}{const s=()=>{i.dimensions=a.value};s(),this.dispose(a.changed.disposableOn(s))}return i});z(this,"_createGrid",e=>{const i=this.ad(new Jn(e));{const o=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originHeading.value,l=this._opInfo.originDimensions.value[0],u=[];for(let A=-4;A<5;++A){const c=h.geoRhumbDestination(a,l*.2*A,s+90);if(c){const f=h.geoRhumbDestination(c,l,s+180),d=h.geoRhumbDestination(c,l,s);f&&d&&u.push([f,c,d])}}for(let A=-4;A<5;++A){const c=h.geoRhumbDestination(a,l*.2*A,s);if(c){const f=h.geoRhumbDestination(c,l,s-90),d=h.geoRhumbDestination(c,l,s+90);f&&d&&u.push([f,c,d])}}i.positions=u};o();const r=this.disposeVar(h.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originHeading.changed,this._opInfo.originDimensions.changed));this.dispose(r.disposableOn(o))}return i});z(this,"_createHelpLine",e=>{const i=this.ad(new Xe(e));i.hasDash=!0,i.arcType="RHUMB",i.color=[1,1,0,.99];{const o=()=>{i.positions=[this._opInfo.originPosition.value,this._opInfo.targetPosition.value]},r=this.ad(h.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.targetPosition.changed));this.ad(r.don(o))}return i});z(this,"_createCircle",e=>{const i=this.ad(new Jn(e));i.arcType="RHUMB",i.width=2,i.hasDash=!0;const o=this.disposeVar(h.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),r=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originDimensions.value[0],l=[],u=32;for(let A=0;A<=u;++A){const c=h.geoRhumbDestination(a,s,A*360/u);c&&l.push(c)}i.positions=[l]};return r(),this.dispose(o.disposableOn(r)),i});z(this,"_pickingXYProcessing",e=>this.ad(new h.Processing((i,o,r)=>{const a=[0,0,0],s=new _.Cartographic;return e.pointerMoveEvent.don(l=>{if(!l.pointerEvent||!e.viewer)return;const u=$n(h.getDomEventCurrentTargetPos(l.pointerEvent));if(!ss(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;rs(s,a),this._opInfo.constraintMode.value==="x"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="y"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a;const A=[0,0,0];h.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A})})));z(this,"_pickingZProcessing",e=>this.ad(new h.Processing(()=>{const i=new _.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=$n(h.getDomEventCurrentTargetPos(r.pointerEvent));if(!Xc(e.viewer.scene,At(this._opInfo.originPosition.value),a,i))return;const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s]}})})));z(this,"_pickingZAxisProcessing",e=>this.ad(new h.Processing(()=>{const i=[0,0,0],o=new _.Cartographic;return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=$n(h.getDomEventCurrentTargetPos(r.pointerEvent));if(!ss(e.viewer.scene,a,this._opInfo.originPosition.value[2],o))return;rs(o,i);const s=h.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),u=h.geoRhumbHeading(this._opInfo.originPosition.value,i)-s;let A=this._opInfo.originHeading.value+u;A=_.Math.toDegrees(_.Math.negativePiToPi(_.Math.toRadians(A))),this._opInfo.movingPosition.value=i,this.heading=this._opInfo.targetHeading.value=A})})));if(!e.viewer)return;const i=this.ad(h.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new Wf(e,this.positionReact,i,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(r=>{if(this._opInfo.moved){const a=[...r];e.editingHeightOffset&&(a[2]+=e.editingHeightOffset),this.position=a}})),this.ad(this._opInfo.targetHeading.changed.don(r=>this._opInfo.moved&&(this.heading=r)));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((r,a)=>r===this._opInfo.targetPosition.value[a])){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),r=this._createOriginCoordinates(e),a=this._createGrid(e),s=this._createHelpLine(e),l=this._createCircle(e);{const u=()=>{l.show=a.show=this.enabled&&this.showCircle,s.show=this.enabled&&this.showCircle&&this._opInfo.moved.value,o.show=this.enabled&&this.showCoordinates,r.show=this.enabled&&this.showCoordinates&&this._opInfo.moved.value};u();const A=this.ad(h.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(A.don(u))}{const u=()=>{o.xAxisShow=r.xAxisShow=this.xAxisShow,o.yAxisShow=r.yAxisShow=this.yAxisShow,o.zAxisShow=r.zAxisShow=this.zAxisShow};u();const A=this.ad(h.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(A.don(u))}{const u=()=>{a.color=this._opInfo.constraintMode.value!=="none"?[1,1,0,.6]:[1,1,0,.3],l.color=this._opInfo.constraintMode.value==="zAxis"?[1,1,0,.99]:[1,1,0,.5],IS(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u))}{const u=this._pickingXYProcessing(e),A=this._pickingZProcessing(e),c=this._pickingZAxisProcessing(e),f=()=>{const b=[...this.position??no.defaults.position];e.editingHeightOffset&&(b[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=b},d=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,p=()=>this._opInfo.originDimensions.value=i.value,g={constraintMode:"none",startDragPos:[0,0,0]},v=b=>{const x={position:o.position??no.defaults.position,heading:o.heading??no.defaults.heading,dimensions:o.dimensions??no.defaults.dimensions};e.viewer&&Df(b,e.viewer.scene,x,this.axisSnapPixelSize,g,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=g.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=g.startDragPos},y=this.ad(h.createProcessingFromAsyncFunc(async b=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",b.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await h.step(b,async x=>{x.disposer.dispose((f(),this.positionChanged.don(f))),x.disposer.dispose((d(),this.headingChanged.don(d))),x.disposer.dispose((p(),i.changed.don(p))),x.disposer.dispose(e.pointerMoveEvent.don(E=>{E.pointerEvent&&v(E.pointerEvent)})),await h.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerDownEvent.don(I=>{I.pointerEvent&&v(I.pointerEvent),I.pointerEvent&&I.pointerEvent.button===0&&g.constraintMode!=="none"&&B()}))}))}),this._opInfo.step.value=!1,await h.step(b,async x=>{if(e.incrementDisabledInputStack(),x.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const E=h.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),B=h.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);u.restart(void 0,E,B),x.disposer.dispose(()=>u.cancel())}else this._opInfo.constraintMode.value==="z"?(A.restart(),x.disposer.dispose(()=>A.cancel())):this._opInfo.constraintMode.value==="zAxis"?(c.restart(),x.disposer.dispose(()=>c.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await h.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerUpEvent.don(()=>{B()})),E.disposer.dispose(e.pointerOutEvent.don(()=>B()))}))}),y.restart()})),m=()=>{this.enabled?y.restart():y.isRunning&&y.cancel()};m(),this.ad(this.enabledChanged.don(m))}}}};z(no,"defaults",{...Fn.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let er=no;(t=>{t.createDefaultProps=()=>({...Fn.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})})(er||(er={})),h.extendClassProps(er.prototype,er.createDefaultProps);function IS(t,n,e){t.xAxisColor=[1,0,0,.99],t.yAxisColor=[0,1,0,.99],t.zAxisColor=[0,0,1,.99],n==="x"?t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="y"?t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="z"?t.zAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="xy"&&(t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99],t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99])}class yv extends h.HasOwner{constructor(e){super(e);z(this,"_valid",!1);z(this,"_normal",new _.Cartesian3(0,0,0));z(this,"_origin",new _.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 i=this.owner.cartesian,o=$n(e);return r0(this.scene,i,this.normal,o)}}class B6 extends yv{constructor(n){super(n);{const e=()=>{const o=ot({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 i=this.ad(h.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(i.don(e))}}}class T6 extends yv{constructor(n){super(n);const e=()=>{const i=ot({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=ot({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:_.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[0],r.y=-o[1],r.z=-o[2]}{const r=this._origin;r.x=o[4],r.y=o[5],r.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 I6 extends yv{constructor(n){super(n);const e=()=>{const i=ot({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=ot({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:_.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[4],r.y=-o[5],r.z=-o[6]}{const r=this._origin;r.x=o[8],r.y=o[9],r.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 ma extends h.Destroyable{constructor(e){super();z(this,"_czmTexture");z(this,"_customPrimitiveForCircle");z(this,"_circleCanvas");z(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new ct(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 i=this.disposeVar(h.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const a=()=>{const l={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},u=this._circleCanvas,A=this.color,c=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, ${A[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,${A[3]})`,u.stroke(),u.lineWidth=4,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=c,u.stroke();{u.lineWidth=1,u.beginPath();let p=_.Math.zeroToTwoPi(l.startRotation),g=_.Math.zeroToTwoPi(l.endRotation);g<p&&(g+=_.Math.TWO_PI),(p!==g||p!==0)&&(u.moveTo(128,128),u.arc(128,128,64,p,g,g-p>Math.PI),u.lineTo(128,128),u.strokeStyle="rgba(255, 255, 0, 1.0)",u.stroke())}let f=_.Math.negativePiToPi(l.rotation);u.lineWidth=3,u.beginPath(),u.moveTo(128,128),u.arc(128,128,64,0,f,_.Math.negativePiToPi(f-0)<0),u.lineTo(128,128),u.fillStyle=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, 0.5)`,u.fill();{u.save(),u.font="16px console",u.textBaseline="middle";const v=`${(_.Math.negativePiToPi(f-0)*180/Math.PI*10|0)/10}°`;var d=u.measureText(v).width;u.translate(128,128),u.rotate(Math.PI*.5),f=_.Math.negativePiToPi(f-0)+0,u.rotate((f+0)*.5),u.scale(i.value?-1:1,1),u.translate(-128,-128),u.fillStyle="white",u.fillText(v,128-d*.5,54),u.lineWidth=1,u.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};a();const s=this.ad(h.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,i.changed));this.ad(s.don(a)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(a))}{const r=()=>{const s=ot({rotation:this.selfRotation});if(!s)return;const l=ot({position:this.position,rotation:this.rotation,localModelMatrix:_.Matrix4.toArray(s)});if(!l)return;const{viewer:u}=e;if(!u)return;const A=_.Cartesian3.dot(u.scene.camera.directionWC,new _.Cartesian3(l[8],l[9],l[10]));i.value=A>0};r();const a=this.ad(h.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(a.don(r))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(F6(e)),this.dispose(h.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(h.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(h.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(h.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const i=()=>{const o=ot({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&_.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.customPrimitiveForCircle&&this.czmTexture&&(this.customPrimitiveForCircle.uniformMap={u_image:{type:"texture",id:this.czmTexture.id},u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}_createDebugAxis(e){this._debugAxis=this.ad(M6(e)),this.dispose(h.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(h.track([this._debugAxis,"position"],[this,"position"])),this.dispose(h.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(h.track([this._debugAxis,"show"],[this,"debug"]));{const i=()=>{const o=ot({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&_.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this._debugAxis&&(this._debugAxis.uniformMap={u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}}z(ma,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([0,0,0]),selfRotation:h.reactArray([0,0,0]),pixelSize:300,color:h.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(ma||(ma={})),h.extendClassProps(ma.prototype,ma.createDefaultProps);function F6(t){return Xf({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]},st,t)}function M6(t){return Xf({type:"CzmCustomPrimitive",allowPicking:!0,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
|
|
3765
3765
|
void main()
|
|
3766
3766
|
{
|
|
3767
3767
|
// 如果这一句注释,要相应地注释掉attribute中的normal,也就是说顶点属性要和shader中的一一匹配!
|
|
@@ -3772,7 +3772,7 @@ void main()
|
|
|
3772
3772
|
{
|
|
3773
3773
|
out_FragColor = u_color;
|
|
3774
3774
|
}
|
|
3775
|
-
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},st,t)}class Dk extends h.HasOwner{constructor(n){super(n);const{czmViewer:e}=this.owner;let i;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(r=>{const a=i=this._getStartInfo(r.pointerEvent);a&&(this.owner.hoveredPlaneType=a.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(r=>{i&&i.currentPlaneType!=="none"&&(o.restart(void 0,e,i),i=void 0)})),this.dispose(e.dblclickEvent.disposableOn(r=>{const a=this._getStartInfo(r.pointerEvent);if(a&&a.currentPlaneType!=="none"){const{currentPlaneType:s}=a,l=[...this.owner.selfRotation];l[si.rotationNum[s]]=0,this.owner.selfRotation=l;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(h.createProcessingFromAsyncFunc(async(n,e,i)=>{const o=this.owner.circles[i.currentPlaneType];e.incrementDisabledInputStack(),n.disposer.dispose(()=>e.decrementDisabledInputStack()),n.disposer.dispose(e.pointerMoveEvent.don(r=>{if(i&&r.pointerEvent){const{offsetX:a,offsetY:s}=r.pointerEvent,l=[a,s],{currentPlaneType:u}=i;if(u==="none")return;const A=this.owner.getPlane(u);if(!i.currentV)return;const c=A.pick(l);if(!c||!this.owner.cartesian)return;const f=_.Cartesian3.subtract(i.currentV,this.owner.cartesian,new _.Cartesian3);_.Cartesian3.normalize(f,f);const d=_.Cartesian3.subtract(c,this.owner.cartesian,new _.Cartesian3);if(_.Cartesian3.normalize(d,d),!A.normal||!A.origin)return;const p=vv(f,d,A.normal),g=vv(A.origin,f,A.normal),v=vv(A.origin,d,A.normal);{const y=[...this.owner.selfRotation];y[si.rotationNum[u]]=i.startRotation+p,this.owner.selfRotation=y,o.circleStartRotation=g,o.circleEndRotation=v}}})),this.owner.movingPlaneType=i.currentPlaneType,n.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),n.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await h.step(n,r=>new Promise((a,s)=>{r.disposer.dispose(s),r.disposer.dispose(e.pointerUpEvent.don(()=>{a()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{a()}))}))}))}_pickPlane(n,e,i,o,r){const a=this.owner.cartesian;if(!a)return;const{selfRotation:s}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const u=_.Cartesian3.distance(a,l),A=r/4,c=A*3/128;if(!(u>=A-c&&u<=A+c))return;const d=_.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=d||(n.currentPlaneType=i,n.currentD2c=d,n.currentV=l,n.startRotation=s[si.rotationNum[i]])}_getStartInfo(n){var A;const{czmViewer:e}=this.owner,i=(A=e.viewer)==null?void 0:A.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Oi(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:a}=n,s=[r,a],l=n.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(u,i,"heading",s,o),this._pickPlane(u,i,"pitch",s,o),this._pickPlane(u,i,"roll",s,o),u}}function vv(t,n,e){const i=_.Cartesian3.cross(n,t,new _.Cartesian3);if(i.equals(_.Cartesian3.ZERO))return 0;_.Cartesian3.normalize(i,i);const o=_.Cartesian3.dot(i,e);let r=Math.acos(_.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const ts=class ts extends Fn{constructor(e){super();z(this,"_hoveredPlaneType",this.disposeVar(h.react("none")));z(this,"_movingPlaneType",this.disposeVar(h.react("none")));z(this,"_circles");z(this,"_czmCameraModel");z(this,"_cartesian");z(this,"_planes",{heading:this.disposeVar(new Bk(this)),pitch:this.disposeVar(new Tk(this)),roll:this.disposeVar(new Ik(this))});z(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new h.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Dk(this)})),this._circles={heading:this._createRotatorCircle(i,"heading"),pitch:this._createRotatorCircle(i,"pitch"),roll:this._createRotatorCircle(i,"roll")},!!i.viewer){{const r=()=>{this._cartesian=this.position&&At(this.position)||void 0};r(),this.dispose(this.positionChanged.disposableOn(r))}this._createCameraModel(i)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new kt(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(h.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(h.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(h.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=ot({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=_.Matrix4.toArray(o))};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};i(),this.dispose(this.enabledChanged.disposableOn(i)),this.dispose(this.showHelperChanged.disposableOn(i))}}_createRotatorCircle(e,i){const o=this.ad(new ma(e));this.dispose(h.track([o,"position"],[this,"position"])),this.dispose(h.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(h.track([o,"debug"],[this,"debug"])),this.dispose(h.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=ts.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[ts.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const a=this.movingPlaneType===i,s=this.hoveredPlaneType===i,u=[0,0,0,a||s?1:.8];u[ts.rotationNum[i]]=1,o.color=u};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};z(ts,"rotationNum",{heading:0,pitch:1,roll:2}),z(ts,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let si=ts;(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),rotation:h.reactArray([0,0,0]),selfRotation:h.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(si||(si={})),h.extendClassProps(si.prototype,si.createDefaultProps);const ns=class ns extends h.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??ns.defaults.positions[0],this.stopPosition??ns.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??ns.defaults.positions[0],n??ns.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new Xe(n,e));o.arcType="RHUMB";const r=this.ad(new zn(n,e));this.ad(h.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(h.track([r,"allowPicking"],[this,"allowPicking"]));{const a=()=>{o.show=r.show=this.show};a(),this.ad(this.showChanged.don(a))}{const a=()=>{o.width=this.width/2,r.pixelSize=this.width};a(),this.ad(this.widthChanged.don(a))}{const a=()=>{o.color=r.color=this.color};a(),this.ad(this.colorChanged.don(a))}{const a=()=>{o.positions=this.positions,r.position=this.stopPosition};a(),this.dispose(this.startPositionChanged.disposableOn(a)),this.dispose(this.stopPositionChanged.disposableOn(a))}}};z(ns,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let Wo=ns;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:h.reactPositions(t.defaults.positions),width:10,color:h.reactArray([1,0,0,1])})})(Wo||(Wo={})),h.extendClassProps(Wo.prototype,Wo.createDefaultProps);class tr extends Fn{constructor(e){super();z(this,"_lastPosition");z(this,"_opInfo",{step:this.ad(h.react(!1)),moved:this.ad(h.react(!1)),constraintMode:this.disposeVar(h.react("none")),originPosition:this.disposeVar(h.reactArray([0,0,0])),originHeading:this.disposeVar(h.react(0)),originDimensions:this.disposeVar(h.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(h.reactArray([0,0,0])),movingPosition:this.disposeVar(h.reactArray([0,0,0])),targetPosition:this.disposeVar(h.reactArray([0,0,0])),targetHeading:this.disposeVar(h.react(0))});z(this,"_scaleAxis");z(this,"_pickingXYProcessing",e=>this.disposeVar(new h.Processing((i,o,r)=>{const a=[0,0,0],s=new _.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const u=$n(h.getDomEventCurrentTargetPos(l.pointerEvent));if(!ss(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;rs(s,a),this._opInfo.constraintMode.value==="x"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="y"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const A=[0,0,0];h.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A;let c=this.scale[0],f=this.scale[1];const d=h.geoDistance(A,this._opInfo.originPosition.value)-h.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...A];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&this._opInfo.constraintMode.value==="y"&&(d>0?c+=p:c-=p),d!=0&&this._opInfo.constraintMode.value==="x"&&(d>0?f+=p:f-=p),c<=0&&(c+=p),f<=0&&(f+=p),this.scale=[c??1,f??1,this.scale[2]??1]})})));z(this,"_pickingZProcessing",e=>this.disposeVar(new h.Processing(()=>{const i=new _.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const a=$n(h.getDomEventCurrentTargetPos(r.pointerEvent));if(!Xc(e.viewer.scene,At(this._opInfo.originPosition.value),a,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s];let u=this.scale[2];const A=o[2]-this._lastPosition[2];this._lastPosition=[...o];const c=this._opInfo.originDimensions.value[0]/100;A!=0&&(A>0?u+=c:u-=c),u<=0&&(u+=c),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new Wf(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const r=()=>{if(!this._scaleAxis)return;const{zAxis:a,yAxis:s,xAxis:l}=this._scaleAxis,u=this._opInfo.constraintMode.value,A=this._opInfo.step;a.color=[0,0,1,.99],s.color=[0,1,0,.99],l.color=[1,0,0,.99],u==="x"?l.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="y"?s.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(a.color=A?[1,1,0,.8]:[1,1,0,.99])};r(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(r)),this.dispose(this._opInfo.step.changed.disposableOn(r))}{const r=()=>{if(!this._scaleAxis)return;const{position:s=tr.defaults.position}=this,{zAxis:l,yAxis:u,xAxis:A}=this._scaleAxis;l.startPosition=u.startPosition=A.startPosition=s;const[c,f,d]=s;l.stopPosition=[c,f,d+this._opInfo.originDimensions.value[2]];const p=h.geoRhumbDestination(s,this._opInfo.originDimensions.value[0],90);p&&(A.stopPosition=p);const g=h.geoRhumbDestination(s,this._opInfo.originDimensions.value[1],0);g&&(u.stopPosition=g)};r();const a=this.ad(h.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(a.don(r))}{const r=()=>{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((a,s)=>a===this._opInfo.targetPosition.value[s])){this._opInfo.moved.value=!0;return}};r(),this.dispose(this._opInfo.originHeading.changed.disposableOn(r)),this.dispose(this._opInfo.originPosition.changed.disposableOn(r)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(r)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(r))}{const r=this._pickingXYProcessing(e),a=this._pickingZProcessing(e),s=()=>{const f=[...this.position??tr.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},l={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const d={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};Df(f,o,d,this.axisSnapPixelSize,l),this._opInfo.constraintMode.value=l.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=l.startDragPos},A=this.disposeVar(h.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await h.step(f,async d=>{d.disposer.dispose((s(),this.positionChanged.disposableOn(s))),d.disposer.dispose(e.pointerMoveEvent.disposableOn(p=>{p.pointerEvent&&u(p.pointerEvent)})),await h.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&u(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&l.constraintMode!=="none"&&g()}))}))}),this._opInfo.step.value=!1,await h.step(f,async d=>{if(e.incrementDisabledInputStack(),d.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const p=h.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),g=h.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,p,g),d.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(a.restart(),d.disposer.dispose(()=>a.cancel()));await h.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerUpEvent.don(()=>{g()})),p.disposer.dispose(e.pointerOutEvent.don(()=>{g()}))})),this._lastPosition=void 0}),A.restart()})),c=()=>{this.enabled?A.restart():A.isRunning&&A.cancel()};c(),this.dispose(this.enabledChanged.disposableOn(c))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new Wo(e));return o.width=10,this.ad(h.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),scale:h.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(tr||(tr={})),h.extendClassProps(tr.prototype,tr.createDefaultProps);const io=class io extends _n{constructor(e){super();z(this,"_editingPoints",this.disposeVar(new h.ObservableArray));z(this,"_cancelEvent",this.disposeVar(new h.Event));z(this,"_currentProcess");z(this,"_menuPoiEnabled",this.disposeVar(h.react(!1)));z(this,"_status",this.disposeVar(h.react("None")));z(this,"_positionsChanged",this.ad(new h.Event));z(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(i=>{for(let{start:o,deleteCount:r,items:a}of i){for(const s of a)s.menuPoi.enabled=this.menuPoiEnabled??!1;for(let s=o;s<o+r;++s)this.editingPoints.get(s).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let i of this.editingPoints)i.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(i=>{this.ad(()=>{var o;((o=i.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(i=>{this._currentProcess&&(i?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const i=()=>{this.polylineShow=this.czmViewer.editingLineShow};i(),this.ad(this.czmViewer.editingLineShowChanged.don(i))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let i of this._editingPoints)i.position&&e.push([...i.position]);return e}resetPositions(e){if(this.enabled??io.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const i=e||[];return!(i.length===this.editingPoints.length&&i.every((o,r)=>o.every((a,s)=>{const l=this.editingPoints.get(r);return l.position&&l.position[s]===a})))}forceResetPositions(e){(this.enabled??io.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const i=this.ad(new Xe(e));this.ad(h.track([i,"color"],[this,"polylineColor"])),this.ad(h.track([i,"width"],[this,"polylineWidth"])),this.ad(h.track([i,"show"],[this,"polylineShow"])),this.ad(h.track([i,"arcType"],[this,"polylineArcType"])),this.ad(h.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const a of this.getPositions())a[2]-=e.editingHeightOffset??0,r.push(a);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new h.CursorInfo(e.container,h.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(i){if(!this.hideCursorInfo){i.show=!1;return}o==="Adding"?(i.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",i.show=!0):o==="Modifying"||o==="Modifying_Point"?(i.text="Esc键或左键双击:退出编辑状态",i.show=!0):o==="None"&&(i.text="",i.show=!1)}}))}};z(io,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),z(io,"defaults",{..._n.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:io.baseImageUrl+"point-green.png",otherControlPointImageUrl:io.baseImageUrl+"point-yellow.png"});let jn=io;(t=>{t.createDefaultProps=()=>({..._n.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:h.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(jn||(jn={})),h.extendClassProps(jn.prototype,jn.createDefaultProps);let Rk=0;class FS extends h.Destroyable{constructor(e,i){super();z(this,"_position",this.disposeVar(h.reactArrayWithUndefined(void 0)));z(this,"_id",Rk++);z(this,"_menuPoi");i&&(this.position=i),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new ps(e.czmViewer));o.enabled=!1,this.ad(h.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const a=[...this.position];a[2]-=e.czmViewer.editingHeightOffset??0,o.position=a,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const a=e.editingPoints.indexOf(this)+1;a!==0&&(o.title=`控制点${a}`,a===1?o.imageUri=e.firstControlPointImageUrl??jn.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??jn.defaults.otherControlPointImageUrl)};r(),this.dispose(e.editingPoints.changedEvent.disposableOn(r))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class MS extends FS{constructor(n,e){super(n,e)}}class Ct extends jn{constructor(e){super(e);z(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new h.Event));z(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new Fi(e));i.enabled=!1,this.currentProcess=this.disposeVar(h.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Ct.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Ct.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(h.step(o,async r=>{const a=r.disposer,s=a.ad(this._addingEditingProcessing());a.dispose(()=>"adding canceled!"),a.dispose(this.cancelEvent.disposableOn(()=>s.cancel())),await r.promise(new Promise(l=>{a.dispose(s.completeEvent.disposableOnce(l))}))}))})),this.dispose(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new MS(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Ct.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},i=h.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(h.step(o,async s=>{let l;!e()&&(l=s.disposer.disposeVar(new Uk(this,r)));const A=s.disposer.disposeVar(new Lk(this,r));return s.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>A.do())),await s.promise(new Promise(c=>{l&&s.disposer.dispose(l.overEvent.disposableOnce(f=>{f?(r++,c(!0)):c(!1)})),s.disposer.dispose(A.overEvent.disposableOnce(f=>{f?(r--,c(!0)):c(!1)})),s.disposer.dispose(this.cancelEvent.disposableOn(()=>c(!1)))}))}))&&i.restart()});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...jn.createDefaultProps()})})(Ct||(Ct={})),h.extendClassProps(Ct.prototype,Ct.createDefaultProps);class Uk extends h.Destroyable{constructor(e,i){super();z(this,"_overEvent",this.disposeVar(new h.Event));const{placeEditing:o}=e;let r=new MS(e,void 0);e.editingPoints.splice(i,0,r);const a=()=>{(e.debug??Ct.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(r);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(h.track([r,"position"],[o,"position"])),o.enabled=!0;let s=!1;const l=()=>{a(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!s&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{s=!0,r.position===void 0?l():this._overEvent.emit(!0)})),(e.debug??Ct.defaults.debug)&&console.log(`PointAdding creating! index(${i})`),this.dispose(()=>{(e.debug??Ct.defaults.debug)&&console.log(`PointAdding destroying! index(${i})`)})}get overEvent(){return this._overEvent}}function Ok(t,n){const e=t.editingPoints,i=n-1;return i<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(i,1),!0)}class Lk extends h.Destroyable{constructor(e,i){super();z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"_doEvent",this.disposeVar(new h.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(Ok(e,i)))),(e.debug??Ct.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${i})`),this.dispose(()=>{(e.debug??Ct.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${i})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class DS extends Ct{constructor(n){super(n),this.loop=!1}}class RS extends Ct{constructor(n){super(n),this.loop=!0}}class df extends FS{constructor(n,e){super(n,e);{const{menuPoi:i}=this;i.commands=[["add","增加控制点","",Je.baseImageUrl+"add.png"],["delete","删除当前控制点","",Je.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Je.baseImageUrl+"modify.png"]],i.clickCommandName="modify",i.rightClickCommandName="delete",this.dispose(i.commandEvent.disposableOn(o=>{n.menuPoiCommand(this,o)})),this.dispose(i.dbclickEvent.disposableOn(()=>{n.menuPoiCommand(this,"dbClick")}))}if(n.middlePointShow){const i=this.ad(new ci(n.czmViewer));{i.imageUri=n.firstControlPointImageUrl??Je.defaults.firstControlPointImageUrl,i.tooltip="点击增加一个控制点",i.bgColor=[0,0,0,.6],i.fgColor=[1,1,1,1],i.size=[8,8],i.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{i.enabled=i.show=!1},r=()=>{var d;if(!(n.enabled??Je.defaults.enabled))return o();const a=n.editingPoints.indexOf(this),s=n.editingPoints,l=s.length;if(a===-1||l===0||!(n.loop??Je.defaults.loop)&&a+1>=l)return o();const u=this.position;if(!u)return o();const A=(d=s.get((a+1)%l))==null?void 0:d.position;if(!A)return o();const c=Lf(u,A);if(!c)return o();c[2]-=n.czmViewer.editingHeightOffset??0,i.position=c;const f=l<(n.maxPointsNum??Je.defaults.maxPointsNum);i.enabled=i.show=f};r(),this.dispose(n.positionsChanged.disposableOn(r)),this.dispose(n.loopChanged.disposableOn(r)),this.dispose(n.enabledChanged.disposableOn(r))}this.dispose(i.clickEvent.disposableOn(o=>{if(o.button!==0||n.editingPoints.length>=(n.maxPointsNum??Je.defaults.maxPointsNum))return;const r=n.editingPoints.indexOf(this);if(r===-1)return;const a=i.position?[...i.position]:void 0;a&&(a[2]+=n.czmViewer.editingHeightOffset??0);let s=new df(n,a);n.editingPoints.splice(r+1,0,s),n.modify(s)}))}}}}class Je extends jn{constructor(e){super(e);z(this,"_menuPoiCommand",this.disposeVar(new h.Event));z(this,"_forceModifyPosEditorEvent",this.disposeVar(new h.Event));z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"translationEditing");{const r=this.ad(h.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new h.ObjResettingWithEvent(r,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new zk(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new er(e));i.enabled=!1;const o=async(r,a)=>{if((this.debug??Je.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",a=await r.promise(h.step(r,async s=>{const l=s.disposer,u=l.ad(new kk(this));return l.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(a===-1||a>=this.editingPoints.length?0:a)),l.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),l.dispose(this._forceModifyPosEditorEvent.disposableOn(c=>u.modify(c))),await s.promise(new Promise(c=>{l.dispose(u.overEvent.disposableOnce(f=>{c(f)}))}))})),a===-1)(this.debug??Je.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??Je.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??Je.defaults.loop;const l=this.editingPoints.get(a-1).position;if(!l)return;let u=a%this.editingPoints.length;const c=this.editingPoints.get(u).position;if(!c)return;const f=Lf(l,c);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let d=new df(this,f);this.editingPoints.splice(a,0,d),await o(r,a)}};this.currentProcess=this.disposeVar(h.createProcessingFromAsyncFunc(async r=>{r.disposer.dispose(()=>{(this.debug??Je.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(r,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,i){this._menuPoiCommand.emit(e,i)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new df(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...jn.createDefaultProps(),moveWithFirstPosition:!1})})(Je||(Je={})),h.extendClassProps(Je.prototype,Je.createDefaultProps);class zk extends h.Destroyable{constructor(n,e){super(),this._firstPositionEditor=n,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((i,o)=>{if(i===void 0||o===void 0)return;var r=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];const a=this.multiPointsModifyEditing.editingPoints.length;for(let s=1;s<a;s++){const l=this.multiPointsModifyEditing.editingPoints.get(s),u=l.position;u!==void 0&&(l.position=[u[0]+r[0],u[1]+r[1],u[2]+r[2]])}})}}class kk extends h.Destroyable{constructor(e){super();z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"_cancelEvent",this.disposeVar(new h.Event));z(this,"_forceModifyPosEditorEvent",this.disposeVar(new h.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let i;const o=()=>{i==null||i.destroy(),i=void 0,e.status="Modifying"};this.dispose(o);const r=a=>{o(),e.status="Modifying_Point",i=new Qk(e,a),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((a,s)=>{if(s==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(s==="modify")r(a);else if(s==="add"){const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else s==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${s})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class Qk extends h.Destroyable{constructor(e,i){super();z(this,"_overEvent",this.disposeVar(new h.Event));this._modifying=e,this._posEditor=i,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(h.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class US extends Je{constructor(n){super(n),this.loop=!1}}class OS extends Je{constructor(n){super(n),this.loop=!0}}class ga extends Ct{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=h.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const i=h.geoHeading(this.startPosition,this.endPosition),o=h.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/o)*180/Math.PI,s=Math.sqrt(o*o+r*r);this.rotation=[i,a,0],this.distance=s};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Ct.createDefaultProps(),startPosition:h.reactArrayWithUndefined(void 0),endPosition:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([90,0,0]),distance:h.react(1)})})(ga||(ga={})),h.extendClassProps(ga.prototype,ga.createDefaultProps);class jo extends Je{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=h.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var s;if(!((s=this.positions)!=null&&s.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",Je.baseImageUrl+"add.png"],["delete","删除当前控制点","",Je.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Je.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let l of this.editingPoints)l.menuPoi.commands=[["delete","删除当前控制点","",Je.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Je.baseImageUrl+"modify.png"]];const i=h.geoDistance(this.startPosition,this.endPosition);if(Math.abs(i)<=0)return this.rotation=[90,0,0],this.distance=1;const o=h.geoHeading(this.startPosition,this.endPosition),r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/i)*180/Math.PI;this.rotation=[o,a,0],this.distance=Math.hypot(i,r)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Je.createDefaultProps(),startPosition:h.reactArrayWithUndefined(void 0),endPosition:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([0,0,0]),distance:h.react(0)})})(jo||(jo={})),h.extendClassProps(jo.prototype,jo.createDefaultProps);class LS extends Ct{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class zS extends Je{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class ya extends Ct{constructor(n){super(n),n.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(n){const e=this.ad(new Jn(n));e.topOrBottom="bottom",this.ad(h.track([e,"color"],[this,"polylineColor"])),this.ad(h.track([e,"width"],[this,"polylineWidth"])),this.ad(h.track([e,"show"],[this,"polylineShow"])),this.ad(h.track([e,"arcType"],[this,"polylineArcType"])),this.ad(h.track([e,"loop"],[this,"loop"])),this.ad(h.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Ct.createDefaultProps(),visibilityPositions:h.reactPositionsSet(void 0)})})(ya||(ya={})),h.extendClassProps(ya.prototype,ya.createDefaultProps);class va extends Je{constructor(n){if(super(n),!!n.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(n){const e=this.ad(new Jn(n));e.topOrBottom="bottom",this.ad(h.track([e,"color"],[this,"polylineColor"])),this.ad(h.track([e,"width"],[this,"polylineWidth"])),this.ad(h.track([e,"show"],[this,"polylineShow"])),this.ad(h.track([e,"arcType"],[this,"polylineArcType"])),this.ad(h.track([e,"loop"],[this,"loop"])),this.ad(h.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Je.createDefaultProps(),visibilityPositions:h.reactPositionsSet(void 0)})})(va||(va={})),h.extendClassProps(va.prototype,va.createDefaultProps);class kS extends jo{constructor(n){super(n),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class tn extends h.EngineObject{constructor(e,i,o){super(e,i,o??!0);z(this,"_currentEditing",this.disposeVar(h.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var r;if(this.currentEditing)if(this.currentEditing instanceof Ct&&((r=this.currentEditing.currentProcess)!=null&&r.isRunning))if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}else e.points=this.currentEditing.positions;else this.currentEditing instanceof Fi&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const Ic=class Ic extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Fi(e));if(this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)})),Reflect.has(n,"position")){const o=n;this.ad(h.bind([i,"position"],[o,"position"])),i.enabled=!i.position||h.equalsN3(i.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${n.typeName} 坐标属性无法绑定位置编辑`)}};z(Ic,"type",Ic.registerEditing("ESCesiumViewer",h.ESJEditingMode.Place,Ic));let wv=Ic;const Fc=class Fc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new si(e));if(i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),n instanceof h.ES3DTileset)h.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(h.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(h.bind([i,"selfRotation"],[n,"rotation"])))});else if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){const o=n;this.ad(h.bind([i,"position"],[o,"position"])),this.ad(h.bind([i,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${n.typeName} 旋转属性无法绑定旋转编辑`)}};z(Fc,"type",Fc.registerEditing("ESCesiumViewer",h.ESJEditingMode.Rotation,Fc));let bv=Fc;const Mc=class Mc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new tr(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")&&Reflect.has(n,"scale")){const o=n;this.ad(h.bind([i,"position"],[o,"position"])),this.ad(h.bind([i,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${n.typeName} 缩放属性无法绑定缩放编辑`)}};z(Mc,"type",Mc.registerEditing("ESCesiumViewer",h.ESJEditingMode.Scale,Mc));let xv=Mc;const Dc=class Dc extends tn{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new er(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const a=n[r];Reflect.has(a,"position")?o.push(a.position):a.points&&o.push(...a.points)}i.position=h.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(!(!r||!a)){var s=An({originPosition:a},[r])[0][0];n.forEach(l=>{const u=l;if(Reflect.has(l,"position")){const A=An({originPosition:a},[u.position])[0][0];u.position=dr({originPosition:a},[[A[0]+s[0],A[1]+s[1],A[2]+s[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const A=An({originPosition:a},u.points)[0];u.points=dr({originPosition:a},A.map(c=>[c[0]+s[0],c[1]+s[1],c[2]+s[2]]))[0]}})}}))}else if(Reflect.has(n,"position"))this.ad(h.bind([i,"position"],[n,"position"]));else if(n instanceof h.ES3DTileset)h.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(h.bind([i,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(n,"points")){const o=n;if(o.points===void 0||o.points.length===0){this.destroy();return}i.position=h.getMinMaxCorner(o.points).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(r===void 0||a===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var s=An({originPosition:a},[r])[0][0];const l=An({originPosition:a},o.points)[0];o.points=dr({originPosition:a},l.map(u=>[u[0]+s[0],u[1]+s[1],u[2]+s[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${n.typeName} 坐标属性无法绑定平移编辑`)}};z(Dc,"type",Dc.registerEditing("ESCesiumViewer",h.ESJEditingMode.Translation,Dc));let mf=Dc;const Rc=class Rc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ga(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")){const o=n;if(this.ad(h.bind([i,"startPosition"],[o,"position"])),this.ad(Ft([i,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(h.bind([i,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(h.bind([i,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(h.bind([i,"distance"],[o,"distance"]));else{const r=At(o.position);if(_.Cartesian3.ZERO.equals(r)||!e.viewer)return;i.distance=Oi(e.viewer.scene,r,100)??1}}else if(Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${n.typeName} 坐标属性无法绑定双点追加编辑`);i.startPosition&&!h.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};z(Rc,"type",Rc.registerEditing("ESCesiumViewer",h.ESJEditingMode.DoublePointsAppend,Rc));let _v=Rc;const Uc=class Uc extends tn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new jo(e));if(Reflect.has(n,"position")){const r=n;if(this.ad(h.bind([i,"startPosition"],[r,"position"])),this.ad(Ft([i,"rotation"],[r,"rotation"])),Reflect.has(r,"far"))this.ad(h.bind([i,"distance"],[r,"far"]));else if(Reflect.has(r,"radius"))this.ad(h.bind([i,"distance"],[r,"radius"]));else if(Reflect.has(r,"distance"))this.ad(h.bind([i,"distance"],[r,"distance"]));else{const a=At(r.position);if(_.Cartesian3.ZERO.equals(a)||!e.viewer)return;i.distance=Oi(e.viewer.scene,a,100)??1}}else if(Reflect.has(n,"points")){const r=n;if(r.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.moveWithFirstPosition=!1;const a=()=>i.positions=r.points??[];a(),this.ad(r.pointsChanged.don(()=>!i.enabled&&a())),this.ad(h.track([r,"points"],[i,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.init(),i.enabled=!0;const o=this.ad(h.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||h.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};z(Uc,"type",Uc.registerEditing("ESCesiumViewer",h.ESJEditingMode.DoublePointsModify,Uc));let Cv=Uc;const Oc=class Oc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new RS(e));this.ad(i.enabledChanged.don(r=>{!r&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))}));const o=n;if(Reflect.has(o,"points")){const r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};z(Oc,"type",Oc.registerEditing("ESCesiumViewer",h.ESJEditingMode.CircularAppend,Oc));let Sv=Oc;const Lc=class Lc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new OS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${n.typeName} 坐标属性无法绑定环形插值编辑`)}};z(Lc,"type",Lc.registerEditing("ESCesiumViewer",h.ESJEditingMode.CircularInsert,Lc));let Ev=Lc;const zc=class zc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new DS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${n.typeName} 坐标属性无法绑定线段追加编辑`)}};z(zc,"type",zc.registerEditing("ESCesiumViewer",h.ESJEditingMode.LineStringAppend,zc));let Pv=zc;const kc=class kc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new US(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${n.typeName} 坐标属性无法绑定线段插入编辑`)}};z(kc,"type",kc.registerEditing("ESCesiumViewer",h.ESJEditingMode.LineStringInsert,kc));let Bv=kc;const Qc=class Qc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new LS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${n.typeName} 坐标属性无法绑定散点追加编辑`)}};z(Qc,"type",Qc.registerEditing("ESCesiumViewer",h.ESJEditingMode.ScatterAppend,Qc));let Tv=Qc;const Vc=class Vc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new zS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${n.typeName} 坐标属性无法绑定散点修改编辑`)}};z(Vc,"type",Vc.registerEditing("ESCesiumViewer",h.ESJEditingMode.ScatterModify,Vc));let Iv=Vc;const Nc=class Nc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ya(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${n.typeName} 坐标属性无法绑定可见性追加编辑`)}};z(Nc,"type",Nc.registerEditing("ESCesiumViewer",h.ESJEditingMode.VisibilityAppend,Nc));let Fv=Nc;const Hc=class Hc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new va(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${n.typeName} 坐标属性无法绑定可见性修改编辑`)}};z(Hc,"type",Hc.registerEditing("ESCesiumViewer",h.ESJEditingMode.VisibilityModify,Hc));let Mv=Hc;const Gc=class Gc extends tn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new kS(e));if(Reflect.has(n,"points")){const r=n,a=Reflect.has(r,"extrudedHeight"),s=Reflect.has(r,"height"),l=Reflect.has(r,"perPositionHeight")?r.perPositionHeight:!a,u=r instanceof h.ESClassification||r instanceof h.ESPolygonFence;let A=h.getMinMaxCorner(r.points).center,c=[...A],f=u?r.points[0][2]:0;l?a?c[2]=r.extrudedHeight:c[2]=r.height+f:(s&&(A[2]=r.height),a&&(c[2]=r.extrudedHeight)),i.startPosition=A,i.distance=c[2]-A[2],i.moveWithFirstPosition=!1;let d=[...A];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(l?(r.points=r.points.map(p=>[p[0],p[1],p[2]+i.positions[0][2]-d[2]]),a?r.extrudedHeight=i.positions[1][2]:s&&(r.height=i.positions[1][2]-(u?i.positions[0][2]:0))):(s&&(r.height=i.positions[0][2]),a&&(r.extrudedHeight=i.positions[1][2])),d=[...i.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${n.typeName} 坐标属性无法绑定高度修改编辑`);i.init(),i.enabled=!0;const o=this.ad(h.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||h.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};z(Gc,"type",Gc.registerEditing("ESCesiumViewer",h.ESJEditingMode.HeightModify,Gc));let Dv=Gc;const Lt=class Lt extends h.Destroyable{constructor(e,i,o,r=!0){super();z(this,"czmViewer");z(this,"sceneObject");z(this,"editingModes",[]);z(this,"editingID");z(this,"useKeyToSwitch");z(this,"currentIndex",0);z(this,"currentEditingMode");z(this,"currentEditingWrapper");z(this,"_notSupportedEditCount",this.disposeVar(h.react(0)));z(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&h.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=i;const a=(Array.isArray(o)?o:[o]).filter(s=>i.supportEditingModes().includes(s));if(this.editingModes=a,this.editingID=i.editingID,this.useKeyToSwitch=r,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",a);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,i){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:i})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(Lt.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Lt.KEY_ESCAPE&&Lt.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var i;return((i=e.pointerEvent)==null?void 0:i.button)===Lt.MOUSE_LEFT&&h.nextAnimateFrame(()=>{Lt.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Lt.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&Lt.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const i=h.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!i){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new i(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(i){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,i),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,i,o,r=!0){Lt.stop(),Lt.esEditModeInstance=new Lt(e,i,o,r)}static stop(){const e=Lt.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:i,sceneObject:o,editingID:r,editingModes:a}=e;e.destroy(),i.editingEvent.emit({objectIDs:[o.parentID],editingID:r,type:"end",add:{modes:a}})}Lt.esEditModeInstance=void 0}};z(Lt,"KEY_ESCAPE","Escape"),z(Lt,"KEY_SPACE","Space"),z(Lt,"MOUSE_LEFT",0),z(Lt,"esEditModeInstance");let gf=Lt;function QS(){const t=h.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r);const a=l=>{l.code=="Escape"&&r()};n.disposer.ad(e.keyDownEvent.don(a));const s=new mf(i,e);n.disposer.ad(()=>{!s.isDestroyed()&&s.destroy()}),await n.promise(new Promise(l=>{s.isDestroyed()&&l(),n.disposer.ad(s.toDestroyEvent.don(()=>{console.log("移动结束"),l()})),n.disposer.ad(e.dblclickEvent.don(()=>l()))}))});return t}class Vk extends h.Destroyable{constructor(n,e){super(),this._czmViewer=n,h.registerCreatedEventUpdate(this,e,()=>{let i;const o=n.getEngineObject(e);e instanceof h.ESBoxClipping&&(i=o.czmBoxClippingPlanes),!(!i||!("computedClippingPlanes"in i)||!("computedClippingPlanesChanged"in i))&&(this.dispose(h.track([this._czmViewer,"sceneGlobeClippingPlanes"],[i,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class Nk extends h.Destroyable{constructor(e){super();z(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new h.ESSceneObjectWithId));this.dispose(h.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new h.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:i}=this._clippingPlanesSceneObjectWithId;if(i)return new Vk(e,i)}))}}class Hk extends h.Destroyable{constructor(n){super(),this.dv(new h.ObjResettingWithEvent(n.sceneGlobeClippingPolygonsIdChanged,(e,i)=>{if(!(!e||e===i||e&&e.length===0))return new Gk(n)}))}}class Gk extends h.Destroyable{constructor(n){super(),this._czmViewer=n,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,i=o=>{if(!o)return;const r=this.dv(h.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new h.ObjResettingWithEvent(r,()=>{if(o)return new Wk(n,o)}))};for(let o=0;o<e.length;o++){const r=e[o],a=h.ESSceneObject.getSceneObjById(r);if(!a)return;let s;a instanceof h.ESExcavate?h.registerCreatedEventUpdate(this,a,()=>{s=n.getEngineObject(a).czmPolygonClipping,i(s)}):a instanceof h.ESHole&&h.registerCreatedEventUpdate(this,a.excavate,()=>{s=n.getEngineObject(a.excavate).czmPolygonClipping,i(s)})}}}class Wk extends h.Destroyable{constructor(n,e){super(),this._czmViewer=n;const i=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(i&&i.length>0){const r={polygons:[],enabled:!0,inverse:!1};for(let a=0;a<i.length;a++){const s=i[a],l=h.ESSceneObject.getSceneObjById(s);if(!l)return;let u;if(l instanceof h.ESExcavate?u=n.getEngineObject(l).czmPolygonClipping:l instanceof h.ESHole&&(u=n.getEngineObject(l.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(r.polygons[a]={positions:u.positions},r.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=r}}}class jk extends h.Destroyable{constructor(n,e){var a;super(),this._viewer=n;const i=(a=this._viewer.extensions)==null?void 0:a.pickingManager;if(!i)return;const{objectsToExclude:o}=i,r=Array.isArray(e)?[...e]:[e];for(const s of r){if(o.includes(s))throw new Error("objectsToExclude.includes(p)");o.push(s)}this.dispose(()=>{for(let s of r){const l=o.indexOf(s);if(l===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(l,1)}})}}class qk extends h.Destroyable{constructor(e){var a;super();z(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new Fo(e)),this._czmGlobeMaterial.show=!0;let i=Object.assign({},rt.defaults.terrainShader,this._czmViewer.terrainShader),o=(a=this._czmViewer.viewer)==null?void 0:a.scene.preUpdate.addEventListener(()=>{var l;const s=i.elevationContour.show&&(((l=this._czmViewer.getCameraInfo())==null?void 0:l.position[2])??0)<=i.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==s&&(this._czmGlobeMaterial.enableContour=s)});this.d(()=>{o&&o()});const r=()=>{i=Object.assign({},rt.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",i.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),i.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),i.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=i.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=i.elevationContour.width,this._czmGlobeMaterial.contourColor=i.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:i.elevationRamp.minHeight,maxHeight:i.elevationRamp.maxHeight,color:i.elevationRamp.color}};r(),this.d(this._czmViewer.terrainShaderChanged.don(r))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function Kk(t,n){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...n??{}},i=new _.Viewer(t,e);return i.imageryLayers.removeAll(),i.extend(_.viewerCesiumInspectorMixin),i.cesiumInspector.container.style.display="none",i.extend(_.viewerCesium3DTilesInspectorMixin),i.cesium3DTilesInspector.container.style.display="none",i.cesium3DTilesInspector.viewModel.picking=!1,i.clock.currentTime=_.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),i.scene.screenSpaceCameraController.lookEventTypes=[{eventType:_.CameraEventType.RIGHT_DRAG}],i.scene.screenSpaceCameraController.zoomEventTypes=[_.CameraEventType.WHEEL,_.CameraEventType.PINCH,{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.SHIFT}],i.scene.screenSpaceCameraController.tiltEventTypes=[_.CameraEventType.MIDDLE_DRAG,_.CameraEventType.PINCH,{eventType:_.CameraEventType.LEFT_DRAG,modifier:_.KeyboardEventModifier.CTRL},{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.CTRL}],i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_CLICK),i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i._cesiumWidget._creditContainer.style.display="none",i}function Zk(){_.Cesium3DTile.prototype.updateTransform=function(t,n){t=_.defaultValue(t,_.Matrix4.IDENTITY);const e=_.Matrix4.multiplyTransformation(t,this.transform,new _.Matrix4),i=!_.Matrix4.equals(e,this.computedTransform),o=_.defined(n)&&(this._verticalExaggeration!==n.verticalExaggeration||this._verticalExaggerationRelativeHeight!==n.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&_.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=n.verticalExaggeration,this._verticalExaggerationRelativeHeight=n.verticalExaggerationRelativeHeight);const r=this._header,a=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform),_.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(a.boundingVolume,this.computedTransform)),_.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function Xk(){Reflect.getOwnPropertyDescriptor(_.Camera.prototype,"_currentFlight")||Object.defineProperties(_.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var n=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,n)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new _.Event),this._vtxf_currentFlightEvent}}})}function $k(){const t=new _.Matrix4;function n(i,o){const r=i.positionWC;_.Matrix4.clone(i.transform,t),i.lookAtTransform(_.Matrix4.IDENTITY),i.look(r,o),i.lookAtTransform(t)}const e=Math.PI/60;_.Camera.prototype.lookLeft=function(i){i=_.defaultValue(i,e),this._mode!==_.SceneMode.SCENE2D&&n(this,-i)},_.Camera.prototype.lookRight=function(i){this.lookLeft(-i)}}function Yk(){if(!_.DepthPlane.xbsjFixed){_.DepthPlane.xbsjFixed=!0;var t=_.DepthPlane.prototype.update;_.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var n=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=n.context,i=new _.Geometry({attributes:{position:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:_.PrimitiveType.TRIANGLES});this._va=_.VertexArray.fromGeometry({context:e,geometry:i,attributeLocations:{position:0},bufferUsage:_.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function Jk(t){const n=t.BoundingSphere,e=t.Cartesian3,i=t.defaultValue,o=t.defined,r=t.OrientedBoundingBox,a=t.Rectangle,s=t.TaskProcessor,l=t.TerrainData,u=t.TerrainEncoding,A=t.TerrainMesh,c=t.GoogleEarthEnterpriseTerrainData,f="createVerticesFromGoogleEarthEnterpriseBuffer",d=new s(f),p=new s(f,l.maximumAsynchronousTasks),g=new a,v=new a;c.prototype.createMesh=function(y){y=i(y,i.EMPTY_OBJECT);const m=y.tilingScheme,b=y.x,x=y.y,E=y.level,B=i(y.exaggeration,1),P=i(y.exaggerationRelativeHeight,0),I=i(y.throttle,!0),O=m.ellipsoid;m.tileXYToNativeRectangle(b,x,E,g),m.tileXYToRectangle(b,x,E,v);const M=O.cartographicToCartesian(a.center(v));this._skirtHeight=1.9134410999999999e6;const T=(I?p:d).scheduleTask({buffer:this._buffer,nativeRectangle:g,rectangle:a.clone(v),relativeToCenter:M,ellipsoid:O,skirtHeight:this._skirtHeight,exaggeration:B,exaggerationRelativeHeight:P,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!o(T))return;const w=this;return T.then(function(C){return w._mesh=new A(M,new Float32Array(C.vertices),new Uint16Array(C.indices),C.indexCountWithoutSkirts,C.vertexCountWithoutSkirts,C.minimumHeight,C.maximumHeight,n.clone(C.boundingSphere3D),e.clone(C.occludeePointInScaledSpace),C.numberOfAttributes,r.clone(C.orientedBoundingBox),u.clone(C.encoding),C.westIndicesSouthToNorth,C.southIndicesEastToWest,C.eastIndicesNorthToSouth,C.northIndicesWestToEast),w._minimumHeight=C.minimumHeight,w._maximumHeight=C.maximumHeight,w._buffer=void 0,w._mesh})}}function eQ(){return _.VERSION.split(".").map(n=>parseInt(n))}let Rv;function tQ(){return Rv||(Rv=eQ()),Rv}function nQ(){const t=tQ();t[0]===1&&t[1]>=92?Jk(_):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function iQ(){const t=_.Resource.prototype.fetchJson,n=_.Resource.prototype.fetchArrayBuffer;_.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${h.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return h.defaultLocalFileServer.getJson(i)}else return t.call(this,...e)},_.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${h.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return h.defaultLocalFileServer.getArrayBuffer(i).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return n.call(this,...e)}}function rQ(){const t=_.ModelSceneGraph.prototype.buildDrawCommands;_.ModelSceneGraph.prototype.buildDrawCommands=function(...n){const e=this._model,i=e.modelMatrix;e.modelMatrix=_.Matrix4.IDENTITY;const o=t.call(this,...n);return e.modelMatrix=i,o}}function oQ(){const t=_.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const sQ=`#ifdef GL_OES_standard_derivatives
|
|
3775
|
+
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},st,t)}class D6 extends h.HasOwner{constructor(n){super(n);const{czmViewer:e}=this.owner;let i;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(r=>{const a=i=this._getStartInfo(r.pointerEvent);a&&(this.owner.hoveredPlaneType=a.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(r=>{i&&i.currentPlaneType!=="none"&&(o.restart(void 0,e,i),i=void 0)})),this.dispose(e.dblclickEvent.disposableOn(r=>{const a=this._getStartInfo(r.pointerEvent);if(a&&a.currentPlaneType!=="none"){const{currentPlaneType:s}=a,l=[...this.owner.selfRotation];l[si.rotationNum[s]]=0,this.owner.selfRotation=l;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(h.createProcessingFromAsyncFunc(async(n,e,i)=>{const o=this.owner.circles[i.currentPlaneType];e.incrementDisabledInputStack(),n.disposer.dispose(()=>e.decrementDisabledInputStack()),n.disposer.dispose(e.pointerMoveEvent.don(r=>{if(i&&r.pointerEvent){const{offsetX:a,offsetY:s}=r.pointerEvent,l=[a,s],{currentPlaneType:u}=i;if(u==="none")return;const A=this.owner.getPlane(u);if(!i.currentV)return;const c=A.pick(l);if(!c||!this.owner.cartesian)return;const f=_.Cartesian3.subtract(i.currentV,this.owner.cartesian,new _.Cartesian3);_.Cartesian3.normalize(f,f);const d=_.Cartesian3.subtract(c,this.owner.cartesian,new _.Cartesian3);if(_.Cartesian3.normalize(d,d),!A.normal||!A.origin)return;const p=vv(f,d,A.normal),g=vv(A.origin,f,A.normal),v=vv(A.origin,d,A.normal);{const y=[...this.owner.selfRotation];y[si.rotationNum[u]]=i.startRotation+p,this.owner.selfRotation=y,o.circleStartRotation=g,o.circleEndRotation=v}}})),this.owner.movingPlaneType=i.currentPlaneType,n.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),n.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await h.step(n,r=>new Promise((a,s)=>{r.disposer.dispose(s),r.disposer.dispose(e.pointerUpEvent.don(()=>{a()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{a()}))}))}))}_pickPlane(n,e,i,o,r){const a=this.owner.cartesian;if(!a)return;const{selfRotation:s}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const u=_.Cartesian3.distance(a,l),A=r/4,c=A*3/128;if(!(u>=A-c&&u<=A+c))return;const d=_.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=d||(n.currentPlaneType=i,n.currentD2c=d,n.currentV=l,n.startRotation=s[si.rotationNum[i]])}_getStartInfo(n){var A;const{czmViewer:e}=this.owner,i=(A=e.viewer)==null?void 0:A.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Oi(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:a}=n,s=[r,a],l=n.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(u,i,"heading",s,o),this._pickPlane(u,i,"pitch",s,o),this._pickPlane(u,i,"roll",s,o),u}}function vv(t,n,e){const i=_.Cartesian3.cross(n,t,new _.Cartesian3);if(i.equals(_.Cartesian3.ZERO))return 0;_.Cartesian3.normalize(i,i);const o=_.Cartesian3.dot(i,e);let r=Math.acos(_.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const ts=class ts extends Fn{constructor(e){super();z(this,"_hoveredPlaneType",this.disposeVar(h.react("none")));z(this,"_movingPlaneType",this.disposeVar(h.react("none")));z(this,"_circles");z(this,"_czmCameraModel");z(this,"_cartesian");z(this,"_planes",{heading:this.disposeVar(new B6(this)),pitch:this.disposeVar(new T6(this)),roll:this.disposeVar(new I6(this))});z(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new h.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new D6(this)})),this._circles={heading:this._createRotatorCircle(i,"heading"),pitch:this._createRotatorCircle(i,"pitch"),roll:this._createRotatorCircle(i,"roll")},!!i.viewer){{const r=()=>{this._cartesian=this.position&&At(this.position)||void 0};r(),this.dispose(this.positionChanged.disposableOn(r))}this._createCameraModel(i)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new kt(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(h.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(h.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(h.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=ot({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=_.Matrix4.toArray(o))};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};i(),this.dispose(this.enabledChanged.disposableOn(i)),this.dispose(this.showHelperChanged.disposableOn(i))}}_createRotatorCircle(e,i){const o=this.ad(new ma(e));this.dispose(h.track([o,"position"],[this,"position"])),this.dispose(h.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(h.track([o,"debug"],[this,"debug"])),this.dispose(h.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=ts.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[ts.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const a=this.movingPlaneType===i,s=this.hoveredPlaneType===i,u=[0,0,0,a||s?1:.8];u[ts.rotationNum[i]]=1,o.color=u};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};z(ts,"rotationNum",{heading:0,pitch:1,roll:2}),z(ts,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let si=ts;(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),rotation:h.reactArray([0,0,0]),selfRotation:h.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(si||(si={})),h.extendClassProps(si.prototype,si.createDefaultProps);const ns=class ns extends h.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??ns.defaults.positions[0],this.stopPosition??ns.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??ns.defaults.positions[0],n??ns.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new Xe(n,e));o.arcType="RHUMB";const r=this.ad(new zn(n,e));this.ad(h.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(h.track([r,"allowPicking"],[this,"allowPicking"]));{const a=()=>{o.show=r.show=this.show};a(),this.ad(this.showChanged.don(a))}{const a=()=>{o.width=this.width/2,r.pixelSize=this.width};a(),this.ad(this.widthChanged.don(a))}{const a=()=>{o.color=r.color=this.color};a(),this.ad(this.colorChanged.don(a))}{const a=()=>{o.positions=this.positions,r.position=this.stopPosition};a(),this.dispose(this.startPositionChanged.disposableOn(a)),this.dispose(this.stopPositionChanged.disposableOn(a))}}};z(ns,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let Wo=ns;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:h.reactPositions(t.defaults.positions),width:10,color:h.reactArray([1,0,0,1])})})(Wo||(Wo={})),h.extendClassProps(Wo.prototype,Wo.createDefaultProps);class tr extends Fn{constructor(e){super();z(this,"_lastPosition");z(this,"_opInfo",{step:this.ad(h.react(!1)),moved:this.ad(h.react(!1)),constraintMode:this.disposeVar(h.react("none")),originPosition:this.disposeVar(h.reactArray([0,0,0])),originHeading:this.disposeVar(h.react(0)),originDimensions:this.disposeVar(h.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(h.reactArray([0,0,0])),movingPosition:this.disposeVar(h.reactArray([0,0,0])),targetPosition:this.disposeVar(h.reactArray([0,0,0])),targetHeading:this.disposeVar(h.react(0))});z(this,"_scaleAxis");z(this,"_pickingXYProcessing",e=>this.disposeVar(new h.Processing((i,o,r)=>{const a=[0,0,0],s=new _.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const u=$n(h.getDomEventCurrentTargetPos(l.pointerEvent));if(!ss(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;rs(s,a),this._opInfo.constraintMode.value==="x"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="y"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const A=[0,0,0];h.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A;let c=this.scale[0],f=this.scale[1];const d=h.geoDistance(A,this._opInfo.originPosition.value)-h.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...A];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&this._opInfo.constraintMode.value==="y"&&(d>0?c+=p:c-=p),d!=0&&this._opInfo.constraintMode.value==="x"&&(d>0?f+=p:f-=p),c<=0&&(c+=p),f<=0&&(f+=p),this.scale=[c??1,f??1,this.scale[2]??1]})})));z(this,"_pickingZProcessing",e=>this.disposeVar(new h.Processing(()=>{const i=new _.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const a=$n(h.getDomEventCurrentTargetPos(r.pointerEvent));if(!Xc(e.viewer.scene,At(this._opInfo.originPosition.value),a,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s];let u=this.scale[2];const A=o[2]-this._lastPosition[2];this._lastPosition=[...o];const c=this._opInfo.originDimensions.value[0]/100;A!=0&&(A>0?u+=c:u-=c),u<=0&&(u+=c),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new Wf(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const r=()=>{if(!this._scaleAxis)return;const{zAxis:a,yAxis:s,xAxis:l}=this._scaleAxis,u=this._opInfo.constraintMode.value,A=this._opInfo.step;a.color=[0,0,1,.99],s.color=[0,1,0,.99],l.color=[1,0,0,.99],u==="x"?l.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="y"?s.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(a.color=A?[1,1,0,.8]:[1,1,0,.99])};r(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(r)),this.dispose(this._opInfo.step.changed.disposableOn(r))}{const r=()=>{if(!this._scaleAxis)return;const{position:s=tr.defaults.position}=this,{zAxis:l,yAxis:u,xAxis:A}=this._scaleAxis;l.startPosition=u.startPosition=A.startPosition=s;const[c,f,d]=s;l.stopPosition=[c,f,d+this._opInfo.originDimensions.value[2]];const p=h.geoRhumbDestination(s,this._opInfo.originDimensions.value[0],90);p&&(A.stopPosition=p);const g=h.geoRhumbDestination(s,this._opInfo.originDimensions.value[1],0);g&&(u.stopPosition=g)};r();const a=this.ad(h.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(a.don(r))}{const r=()=>{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((a,s)=>a===this._opInfo.targetPosition.value[s])){this._opInfo.moved.value=!0;return}};r(),this.dispose(this._opInfo.originHeading.changed.disposableOn(r)),this.dispose(this._opInfo.originPosition.changed.disposableOn(r)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(r)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(r))}{const r=this._pickingXYProcessing(e),a=this._pickingZProcessing(e),s=()=>{const f=[...this.position??tr.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},l={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const d={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};Df(f,o,d,this.axisSnapPixelSize,l),this._opInfo.constraintMode.value=l.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=l.startDragPos},A=this.disposeVar(h.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await h.step(f,async d=>{d.disposer.dispose((s(),this.positionChanged.disposableOn(s))),d.disposer.dispose(e.pointerMoveEvent.disposableOn(p=>{p.pointerEvent&&u(p.pointerEvent)})),await h.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&u(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&l.constraintMode!=="none"&&g()}))}))}),this._opInfo.step.value=!1,await h.step(f,async d=>{if(e.incrementDisabledInputStack(),d.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const p=h.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),g=h.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,p,g),d.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(a.restart(),d.disposer.dispose(()=>a.cancel()));await h.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerUpEvent.don(()=>{g()})),p.disposer.dispose(e.pointerOutEvent.don(()=>{g()}))})),this._lastPosition=void 0}),A.restart()})),c=()=>{this.enabled?A.restart():A.isRunning&&A.cancel()};c(),this.dispose(this.enabledChanged.disposableOn(c))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new Wo(e));return o.width=10,this.ad(h.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),scale:h.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(tr||(tr={})),h.extendClassProps(tr.prototype,tr.createDefaultProps);const io=class io extends _n{constructor(e){super();z(this,"_editingPoints",this.disposeVar(new h.ObservableArray));z(this,"_cancelEvent",this.disposeVar(new h.Event));z(this,"_currentProcess");z(this,"_menuPoiEnabled",this.disposeVar(h.react(!1)));z(this,"_status",this.disposeVar(h.react("None")));z(this,"_positionsChanged",this.ad(new h.Event));z(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(i=>{for(let{start:o,deleteCount:r,items:a}of i){for(const s of a)s.menuPoi.enabled=this.menuPoiEnabled??!1;for(let s=o;s<o+r;++s)this.editingPoints.get(s).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let i of this.editingPoints)i.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(i=>{this.ad(()=>{var o;((o=i.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(i=>{this._currentProcess&&(i?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const i=()=>{this.polylineShow=this.czmViewer.editingLineShow};i(),this.ad(this.czmViewer.editingLineShowChanged.don(i))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let i of this._editingPoints)i.position&&e.push([...i.position]);return e}resetPositions(e){if(this.enabled??io.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const i=e||[];return!(i.length===this.editingPoints.length&&i.every((o,r)=>o.every((a,s)=>{const l=this.editingPoints.get(r);return l.position&&l.position[s]===a})))}forceResetPositions(e){(this.enabled??io.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const i=this.ad(new Xe(e));this.ad(h.track([i,"color"],[this,"polylineColor"])),this.ad(h.track([i,"width"],[this,"polylineWidth"])),this.ad(h.track([i,"show"],[this,"polylineShow"])),this.ad(h.track([i,"arcType"],[this,"polylineArcType"])),this.ad(h.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const a of this.getPositions())a[2]-=e.editingHeightOffset??0,r.push(a);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new h.CursorInfo(e.container,h.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(i){if(!this.hideCursorInfo){i.show=!1;return}o==="Adding"?(i.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",i.show=!0):o==="Modifying"||o==="Modifying_Point"?(i.text="Esc键或左键双击:退出编辑状态",i.show=!0):o==="None"&&(i.text="",i.show=!1)}}))}};z(io,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),z(io,"defaults",{..._n.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:io.baseImageUrl+"point-green.png",otherControlPointImageUrl:io.baseImageUrl+"point-yellow.png"});let jn=io;(t=>{t.createDefaultProps=()=>({..._n.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:h.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(jn||(jn={})),h.extendClassProps(jn.prototype,jn.createDefaultProps);let R6=0;class FS extends h.Destroyable{constructor(e,i){super();z(this,"_position",this.disposeVar(h.reactArrayWithUndefined(void 0)));z(this,"_id",R6++);z(this,"_menuPoi");i&&(this.position=i),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new ps(e.czmViewer));o.enabled=!1,this.ad(h.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const a=[...this.position];a[2]-=e.czmViewer.editingHeightOffset??0,o.position=a,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const a=e.editingPoints.indexOf(this)+1;a!==0&&(o.title=`控制点${a}`,a===1?o.imageUri=e.firstControlPointImageUrl??jn.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??jn.defaults.otherControlPointImageUrl)};r(),this.dispose(e.editingPoints.changedEvent.disposableOn(r))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class MS extends FS{constructor(n,e){super(n,e)}}class Ct extends jn{constructor(e){super(e);z(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new h.Event));z(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new Fi(e));i.enabled=!1,this.currentProcess=this.disposeVar(h.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Ct.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Ct.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(h.step(o,async r=>{const a=r.disposer,s=a.ad(this._addingEditingProcessing());a.dispose(()=>"adding canceled!"),a.dispose(this.cancelEvent.disposableOn(()=>s.cancel())),await r.promise(new Promise(l=>{a.dispose(s.completeEvent.disposableOnce(l))}))}))})),this.dispose(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new MS(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Ct.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},i=h.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(h.step(o,async s=>{let l;!e()&&(l=s.disposer.disposeVar(new U6(this,r)));const A=s.disposer.disposeVar(new L6(this,r));return s.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>A.do())),await s.promise(new Promise(c=>{l&&s.disposer.dispose(l.overEvent.disposableOnce(f=>{f?(r++,c(!0)):c(!1)})),s.disposer.dispose(A.overEvent.disposableOnce(f=>{f?(r--,c(!0)):c(!1)})),s.disposer.dispose(this.cancelEvent.disposableOn(()=>c(!1)))}))}))&&i.restart()});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...jn.createDefaultProps()})})(Ct||(Ct={})),h.extendClassProps(Ct.prototype,Ct.createDefaultProps);class U6 extends h.Destroyable{constructor(e,i){super();z(this,"_overEvent",this.disposeVar(new h.Event));const{placeEditing:o}=e;let r=new MS(e,void 0);e.editingPoints.splice(i,0,r);const a=()=>{(e.debug??Ct.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(r);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(h.track([r,"position"],[o,"position"])),o.enabled=!0;let s=!1;const l=()=>{a(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!s&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{s=!0,r.position===void 0?l():this._overEvent.emit(!0)})),(e.debug??Ct.defaults.debug)&&console.log(`PointAdding creating! index(${i})`),this.dispose(()=>{(e.debug??Ct.defaults.debug)&&console.log(`PointAdding destroying! index(${i})`)})}get overEvent(){return this._overEvent}}function O6(t,n){const e=t.editingPoints,i=n-1;return i<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(i,1),!0)}class L6 extends h.Destroyable{constructor(e,i){super();z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"_doEvent",this.disposeVar(new h.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(O6(e,i)))),(e.debug??Ct.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${i})`),this.dispose(()=>{(e.debug??Ct.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${i})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class DS extends Ct{constructor(n){super(n),this.loop=!1}}class RS extends Ct{constructor(n){super(n),this.loop=!0}}class df extends FS{constructor(n,e){super(n,e);{const{menuPoi:i}=this;i.commands=[["add","增加控制点","",Je.baseImageUrl+"add.png"],["delete","删除当前控制点","",Je.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Je.baseImageUrl+"modify.png"]],i.clickCommandName="modify",i.rightClickCommandName="delete",this.dispose(i.commandEvent.disposableOn(o=>{n.menuPoiCommand(this,o)})),this.dispose(i.dbclickEvent.disposableOn(()=>{n.menuPoiCommand(this,"dbClick")}))}if(n.middlePointShow){const i=this.ad(new ci(n.czmViewer));{i.imageUri=n.firstControlPointImageUrl??Je.defaults.firstControlPointImageUrl,i.tooltip="点击增加一个控制点",i.bgColor=[0,0,0,.6],i.fgColor=[1,1,1,1],i.size=[8,8],i.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{i.enabled=i.show=!1},r=()=>{var d;if(!(n.enabled??Je.defaults.enabled))return o();const a=n.editingPoints.indexOf(this),s=n.editingPoints,l=s.length;if(a===-1||l===0||!(n.loop??Je.defaults.loop)&&a+1>=l)return o();const u=this.position;if(!u)return o();const A=(d=s.get((a+1)%l))==null?void 0:d.position;if(!A)return o();const c=Lf(u,A);if(!c)return o();c[2]-=n.czmViewer.editingHeightOffset??0,i.position=c;const f=l<(n.maxPointsNum??Je.defaults.maxPointsNum);i.enabled=i.show=f};r(),this.dispose(n.positionsChanged.disposableOn(r)),this.dispose(n.loopChanged.disposableOn(r)),this.dispose(n.enabledChanged.disposableOn(r))}this.dispose(i.clickEvent.disposableOn(o=>{if(o.button!==0||n.editingPoints.length>=(n.maxPointsNum??Je.defaults.maxPointsNum))return;const r=n.editingPoints.indexOf(this);if(r===-1)return;const a=i.position?[...i.position]:void 0;a&&(a[2]+=n.czmViewer.editingHeightOffset??0);let s=new df(n,a);n.editingPoints.splice(r+1,0,s),n.modify(s)}))}}}}class Je extends jn{constructor(e){super(e);z(this,"_menuPoiCommand",this.disposeVar(new h.Event));z(this,"_forceModifyPosEditorEvent",this.disposeVar(new h.Event));z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"translationEditing");{const r=this.ad(h.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new h.ObjResettingWithEvent(r,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new z6(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new er(e));i.enabled=!1;const o=async(r,a)=>{if((this.debug??Je.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",a=await r.promise(h.step(r,async s=>{const l=s.disposer,u=l.ad(new k6(this));return l.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(a===-1||a>=this.editingPoints.length?0:a)),l.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),l.dispose(this._forceModifyPosEditorEvent.disposableOn(c=>u.modify(c))),await s.promise(new Promise(c=>{l.dispose(u.overEvent.disposableOnce(f=>{c(f)}))}))})),a===-1)(this.debug??Je.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??Je.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??Je.defaults.loop;const l=this.editingPoints.get(a-1).position;if(!l)return;let u=a%this.editingPoints.length;const c=this.editingPoints.get(u).position;if(!c)return;const f=Lf(l,c);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let d=new df(this,f);this.editingPoints.splice(a,0,d),await o(r,a)}};this.currentProcess=this.disposeVar(h.createProcessingFromAsyncFunc(async r=>{r.disposer.dispose(()=>{(this.debug??Je.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(r,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,i){this._menuPoiCommand.emit(e,i)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new df(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...jn.createDefaultProps(),moveWithFirstPosition:!1})})(Je||(Je={})),h.extendClassProps(Je.prototype,Je.createDefaultProps);class z6 extends h.Destroyable{constructor(n,e){super(),this._firstPositionEditor=n,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((i,o)=>{if(i===void 0||o===void 0)return;var r=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];const a=this.multiPointsModifyEditing.editingPoints.length;for(let s=1;s<a;s++){const l=this.multiPointsModifyEditing.editingPoints.get(s),u=l.position;u!==void 0&&(l.position=[u[0]+r[0],u[1]+r[1],u[2]+r[2]])}})}}class k6 extends h.Destroyable{constructor(e){super();z(this,"_overEvent",this.disposeVar(new h.Event));z(this,"_cancelEvent",this.disposeVar(new h.Event));z(this,"_forceModifyPosEditorEvent",this.disposeVar(new h.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let i;const o=()=>{i==null||i.destroy(),i=void 0,e.status="Modifying"};this.dispose(o);const r=a=>{o(),e.status="Modifying_Point",i=new Q6(e,a),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((a,s)=>{if(s==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(s==="modify")r(a);else if(s==="add"){const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else s==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${s})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class Q6 extends h.Destroyable{constructor(e,i){super();z(this,"_overEvent",this.disposeVar(new h.Event));this._modifying=e,this._posEditor=i,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(h.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class US extends Je{constructor(n){super(n),this.loop=!1}}class OS extends Je{constructor(n){super(n),this.loop=!0}}class ga extends Ct{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=h.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const i=h.geoHeading(this.startPosition,this.endPosition),o=h.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/o)*180/Math.PI,s=Math.sqrt(o*o+r*r);this.rotation=[i,a,0],this.distance=s};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Ct.createDefaultProps(),startPosition:h.reactArrayWithUndefined(void 0),endPosition:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([90,0,0]),distance:h.react(1)})})(ga||(ga={})),h.extendClassProps(ga.prototype,ga.createDefaultProps);class jo extends Je{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=h.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var s;if(!((s=this.positions)!=null&&s.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",Je.baseImageUrl+"add.png"],["delete","删除当前控制点","",Je.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Je.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let l of this.editingPoints)l.menuPoi.commands=[["delete","删除当前控制点","",Je.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Je.baseImageUrl+"modify.png"]];const i=h.geoDistance(this.startPosition,this.endPosition);if(Math.abs(i)<=0)return this.rotation=[90,0,0],this.distance=1;const o=h.geoHeading(this.startPosition,this.endPosition),r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/i)*180/Math.PI;this.rotation=[o,a,0],this.distance=Math.hypot(i,r)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Je.createDefaultProps(),startPosition:h.reactArrayWithUndefined(void 0),endPosition:h.reactArrayWithUndefined(void 0),rotation:h.reactArray([0,0,0]),distance:h.react(0)})})(jo||(jo={})),h.extendClassProps(jo.prototype,jo.createDefaultProps);class LS extends Ct{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class zS extends Je{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class ya extends Ct{constructor(n){super(n),n.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(n){const e=this.ad(new Jn(n));e.topOrBottom="bottom",this.ad(h.track([e,"color"],[this,"polylineColor"])),this.ad(h.track([e,"width"],[this,"polylineWidth"])),this.ad(h.track([e,"show"],[this,"polylineShow"])),this.ad(h.track([e,"arcType"],[this,"polylineArcType"])),this.ad(h.track([e,"loop"],[this,"loop"])),this.ad(h.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Ct.createDefaultProps(),visibilityPositions:h.reactPositionsSet(void 0)})})(ya||(ya={})),h.extendClassProps(ya.prototype,ya.createDefaultProps);class va extends Je{constructor(n){if(super(n),!!n.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(n){const e=this.ad(new Jn(n));e.topOrBottom="bottom",this.ad(h.track([e,"color"],[this,"polylineColor"])),this.ad(h.track([e,"width"],[this,"polylineWidth"])),this.ad(h.track([e,"show"],[this,"polylineShow"])),this.ad(h.track([e,"arcType"],[this,"polylineArcType"])),this.ad(h.track([e,"loop"],[this,"loop"])),this.ad(h.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Je.createDefaultProps(),visibilityPositions:h.reactPositionsSet(void 0)})})(va||(va={})),h.extendClassProps(va.prototype,va.createDefaultProps);class kS extends jo{constructor(n){super(n),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class tn extends h.EngineObject{constructor(e,i,o){super(e,i,o??!0);z(this,"_currentEditing",this.disposeVar(h.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var r;if(this.currentEditing)if(this.currentEditing instanceof Ct&&((r=this.currentEditing.currentProcess)!=null&&r.isRunning))if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}else e.points=this.currentEditing.positions;else this.currentEditing instanceof Fi&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const Ic=class Ic extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Fi(e));if(this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)})),Reflect.has(n,"position")){const o=n;this.ad(h.bind([i,"position"],[o,"position"])),i.enabled=!i.position||h.equalsN3(i.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${n.typeName} 坐标属性无法绑定位置编辑`)}};z(Ic,"type",Ic.registerEditing("ESCesiumViewer",h.ESJEditingMode.Place,Ic));let wv=Ic;const Fc=class Fc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new si(e));if(i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),n instanceof h.ES3DTileset)h.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(h.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(h.bind([i,"selfRotation"],[n,"rotation"])))});else if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){const o=n;this.ad(h.bind([i,"position"],[o,"position"])),this.ad(h.bind([i,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${n.typeName} 旋转属性无法绑定旋转编辑`)}};z(Fc,"type",Fc.registerEditing("ESCesiumViewer",h.ESJEditingMode.Rotation,Fc));let bv=Fc;const Mc=class Mc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new tr(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")&&Reflect.has(n,"scale")){const o=n;this.ad(h.bind([i,"position"],[o,"position"])),this.ad(h.bind([i,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${n.typeName} 缩放属性无法绑定缩放编辑`)}};z(Mc,"type",Mc.registerEditing("ESCesiumViewer",h.ESJEditingMode.Scale,Mc));let xv=Mc;const Dc=class Dc extends tn{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new er(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const a=n[r];Reflect.has(a,"position")?o.push(a.position):a.points&&o.push(...a.points)}i.position=h.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(!(!r||!a)){var s=An({originPosition:a},[r])[0][0];n.forEach(l=>{const u=l;if(Reflect.has(l,"position")){const A=An({originPosition:a},[u.position])[0][0];u.position=dr({originPosition:a},[[A[0]+s[0],A[1]+s[1],A[2]+s[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const A=An({originPosition:a},u.points)[0];u.points=dr({originPosition:a},A.map(c=>[c[0]+s[0],c[1]+s[1],c[2]+s[2]]))[0]}})}}))}else if(Reflect.has(n,"position"))this.ad(h.bind([i,"position"],[n,"position"]));else if(n instanceof h.ES3DTileset)h.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(h.bind([i,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(n,"points")){const o=n;if(o.points===void 0||o.points.length===0){this.destroy();return}i.position=h.getMinMaxCorner(o.points).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(r===void 0||a===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var s=An({originPosition:a},[r])[0][0];const l=An({originPosition:a},o.points)[0];o.points=dr({originPosition:a},l.map(u=>[u[0]+s[0],u[1]+s[1],u[2]+s[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${n.typeName} 坐标属性无法绑定平移编辑`)}};z(Dc,"type",Dc.registerEditing("ESCesiumViewer",h.ESJEditingMode.Translation,Dc));let mf=Dc;const Rc=class Rc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ga(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")){const o=n;if(this.ad(h.bind([i,"startPosition"],[o,"position"])),this.ad(Ft([i,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(h.bind([i,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(h.bind([i,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(h.bind([i,"distance"],[o,"distance"]));else{const r=At(o.position);if(_.Cartesian3.ZERO.equals(r)||!e.viewer)return;i.distance=Oi(e.viewer.scene,r,100)??1}}else if(Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${n.typeName} 坐标属性无法绑定双点追加编辑`);i.startPosition&&!h.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};z(Rc,"type",Rc.registerEditing("ESCesiumViewer",h.ESJEditingMode.DoublePointsAppend,Rc));let _v=Rc;const Uc=class Uc extends tn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new jo(e));if(Reflect.has(n,"position")){const r=n;if(this.ad(h.bind([i,"startPosition"],[r,"position"])),this.ad(Ft([i,"rotation"],[r,"rotation"])),Reflect.has(r,"far"))this.ad(h.bind([i,"distance"],[r,"far"]));else if(Reflect.has(r,"radius"))this.ad(h.bind([i,"distance"],[r,"radius"]));else if(Reflect.has(r,"distance"))this.ad(h.bind([i,"distance"],[r,"distance"]));else{const a=At(r.position);if(_.Cartesian3.ZERO.equals(a)||!e.viewer)return;i.distance=Oi(e.viewer.scene,a,100)??1}}else if(Reflect.has(n,"points")){const r=n;if(r.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.moveWithFirstPosition=!1;const a=()=>i.positions=r.points??[];a(),this.ad(r.pointsChanged.don(()=>!i.enabled&&a())),this.ad(h.track([r,"points"],[i,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.init(),i.enabled=!0;const o=this.ad(h.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||h.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};z(Uc,"type",Uc.registerEditing("ESCesiumViewer",h.ESJEditingMode.DoublePointsModify,Uc));let Cv=Uc;const Oc=class Oc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new RS(e));this.ad(i.enabledChanged.don(r=>{!r&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))}));const o=n;if(Reflect.has(o,"points")){const r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};z(Oc,"type",Oc.registerEditing("ESCesiumViewer",h.ESJEditingMode.CircularAppend,Oc));let Sv=Oc;const Lc=class Lc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new OS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${n.typeName} 坐标属性无法绑定环形插值编辑`)}};z(Lc,"type",Lc.registerEditing("ESCesiumViewer",h.ESJEditingMode.CircularInsert,Lc));let Ev=Lc;const zc=class zc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new DS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${n.typeName} 坐标属性无法绑定线段追加编辑`)}};z(zc,"type",zc.registerEditing("ESCesiumViewer",h.ESJEditingMode.LineStringAppend,zc));let Pv=zc;const kc=class kc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new US(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${n.typeName} 坐标属性无法绑定线段插入编辑`)}};z(kc,"type",kc.registerEditing("ESCesiumViewer",h.ESJEditingMode.LineStringInsert,kc));let Bv=kc;const Qc=class Qc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new LS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${n.typeName} 坐标属性无法绑定散点追加编辑`)}};z(Qc,"type",Qc.registerEditing("ESCesiumViewer",h.ESJEditingMode.ScatterAppend,Qc));let Tv=Qc;const Vc=class Vc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new zS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${n.typeName} 坐标属性无法绑定散点修改编辑`)}};z(Vc,"type",Vc.registerEditing("ESCesiumViewer",h.ESJEditingMode.ScatterModify,Vc));let Iv=Vc;const Nc=class Nc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ya(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${n.typeName} 坐标属性无法绑定可见性追加编辑`)}};z(Nc,"type",Nc.registerEditing("ESCesiumViewer",h.ESJEditingMode.VisibilityAppend,Nc));let Fv=Nc;const Hc=class Hc extends tn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new va(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(h.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(h.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${n.typeName} 坐标属性无法绑定可见性修改编辑`)}};z(Hc,"type",Hc.registerEditing("ESCesiumViewer",h.ESJEditingMode.VisibilityModify,Hc));let Mv=Hc;const Gc=class Gc extends tn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new kS(e));if(Reflect.has(n,"points")){const r=n,a=Reflect.has(r,"extrudedHeight"),s=Reflect.has(r,"height"),l=Reflect.has(r,"perPositionHeight")?r.perPositionHeight:!a,u=r instanceof h.ESClassification||r instanceof h.ESPolygonFence;let A=h.getMinMaxCorner(r.points).center,c=[...A],f=u?r.points[0][2]:0;l?a?c[2]=r.extrudedHeight:c[2]=r.height+f:(s&&(A[2]=r.height),a&&(c[2]=r.extrudedHeight)),i.startPosition=A,i.distance=c[2]-A[2],i.moveWithFirstPosition=!1;let d=[...A];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(l?(r.points=r.points.map(p=>[p[0],p[1],p[2]+i.positions[0][2]-d[2]]),a?r.extrudedHeight=i.positions[1][2]:s&&(r.height=i.positions[1][2]-(u?i.positions[0][2]:0))):(s&&(r.height=i.positions[0][2]),a&&(r.extrudedHeight=i.positions[1][2])),d=[...i.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${n.typeName} 坐标属性无法绑定高度修改编辑`);i.init(),i.enabled=!0;const o=this.ad(h.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||h.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};z(Gc,"type",Gc.registerEditing("ESCesiumViewer",h.ESJEditingMode.HeightModify,Gc));let Dv=Gc;const Lt=class Lt extends h.Destroyable{constructor(e,i,o,r=!0){super();z(this,"czmViewer");z(this,"sceneObject");z(this,"editingModes",[]);z(this,"editingID");z(this,"useKeyToSwitch");z(this,"currentIndex",0);z(this,"currentEditingMode");z(this,"currentEditingWrapper");z(this,"_notSupportedEditCount",this.disposeVar(h.react(0)));z(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&h.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=i;const a=(Array.isArray(o)?o:[o]).filter(s=>i.supportEditingModes().includes(s));if(this.editingModes=a,this.editingID=i.editingID,this.useKeyToSwitch=r,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",a);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,i){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:i})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(Lt.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Lt.KEY_ESCAPE&&Lt.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var i;return((i=e.pointerEvent)==null?void 0:i.button)===Lt.MOUSE_LEFT&&h.nextAnimateFrame(()=>{Lt.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Lt.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&Lt.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const i=h.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!i){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new i(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(i){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,i),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,i,o,r=!0){Lt.stop(),Lt.esEditModeInstance=new Lt(e,i,o,r)}static stop(){const e=Lt.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:i,sceneObject:o,editingID:r,editingModes:a}=e;e.destroy(),i.editingEvent.emit({objectIDs:[o.parentID],editingID:r,type:"end",add:{modes:a}})}Lt.esEditModeInstance=void 0}};z(Lt,"KEY_ESCAPE","Escape"),z(Lt,"KEY_SPACE","Space"),z(Lt,"MOUSE_LEFT",0),z(Lt,"esEditModeInstance");let gf=Lt;function QS(){const t=h.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r);const a=l=>{l.code=="Escape"&&r()};n.disposer.ad(e.keyDownEvent.don(a));const s=new mf(i,e);n.disposer.ad(()=>{!s.isDestroyed()&&s.destroy()}),await n.promise(new Promise(l=>{s.isDestroyed()&&l(),n.disposer.ad(s.toDestroyEvent.don(()=>{console.log("移动结束"),l()})),n.disposer.ad(e.dblclickEvent.don(()=>l()))}))});return t}class V6 extends h.Destroyable{constructor(n,e){super(),this._czmViewer=n,h.registerCreatedEventUpdate(this,e,()=>{let i;const o=n.getEngineObject(e);e instanceof h.ESBoxClipping&&(i=o.czmBoxClippingPlanes),!(!i||!("computedClippingPlanes"in i)||!("computedClippingPlanesChanged"in i))&&(this.dispose(h.track([this._czmViewer,"sceneGlobeClippingPlanes"],[i,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class N6 extends h.Destroyable{constructor(e){super();z(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new h.ESSceneObjectWithId));this.dispose(h.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new h.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:i}=this._clippingPlanesSceneObjectWithId;if(i)return new V6(e,i)}))}}class H6 extends h.Destroyable{constructor(n){super(),this.dv(new h.ObjResettingWithEvent(n.sceneGlobeClippingPolygonsIdChanged,(e,i)=>{if(!(!e||e===i||e&&e.length===0))return new G6(n)}))}}class G6 extends h.Destroyable{constructor(n){super(),this._czmViewer=n,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,i=o=>{if(!o)return;const r=this.dv(h.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new h.ObjResettingWithEvent(r,()=>{if(o)return new W6(n,o)}))};for(let o=0;o<e.length;o++){const r=e[o],a=h.ESSceneObject.getSceneObjById(r);if(!a)return;let s;a instanceof h.ESExcavate?h.registerCreatedEventUpdate(this,a,()=>{s=n.getEngineObject(a).czmPolygonClipping,i(s)}):a instanceof h.ESHole&&h.registerCreatedEventUpdate(this,a.excavate,()=>{s=n.getEngineObject(a.excavate).czmPolygonClipping,i(s)})}}}class W6 extends h.Destroyable{constructor(n,e){super(),this._czmViewer=n;const i=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(i&&i.length>0){const r={polygons:[],enabled:!0,inverse:!1};for(let a=0;a<i.length;a++){const s=i[a],l=h.ESSceneObject.getSceneObjById(s);if(!l)return;let u;if(l instanceof h.ESExcavate?u=n.getEngineObject(l).czmPolygonClipping:l instanceof h.ESHole&&(u=n.getEngineObject(l.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(r.polygons[a]={positions:u.positions},r.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=r}}}class j6 extends h.Destroyable{constructor(n,e){var a;super(),this._viewer=n;const i=(a=this._viewer.extensions)==null?void 0:a.pickingManager;if(!i)return;const{objectsToExclude:o}=i,r=Array.isArray(e)?[...e]:[e];for(const s of r){if(o.includes(s))throw new Error("objectsToExclude.includes(p)");o.push(s)}this.dispose(()=>{for(let s of r){const l=o.indexOf(s);if(l===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(l,1)}})}}class q6 extends h.Destroyable{constructor(e){var a;super();z(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new Fo(e)),this._czmGlobeMaterial.show=!0;let i=Object.assign({},rt.defaults.terrainShader,this._czmViewer.terrainShader),o=(a=this._czmViewer.viewer)==null?void 0:a.scene.preUpdate.addEventListener(()=>{var l;const s=i.elevationContour.show&&(((l=this._czmViewer.getCameraInfo())==null?void 0:l.position[2])??0)<=i.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==s&&(this._czmGlobeMaterial.enableContour=s)});this.d(()=>{o&&o()});const r=()=>{i=Object.assign({},rt.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",i.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),i.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),i.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=i.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=i.elevationContour.width,this._czmGlobeMaterial.contourColor=i.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:i.elevationRamp.minHeight,maxHeight:i.elevationRamp.maxHeight,color:i.elevationRamp.color}};r(),this.d(this._czmViewer.terrainShaderChanged.don(r))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function K6(t,n){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...n??{}},i=new _.Viewer(t,e);return i.imageryLayers.removeAll(),i.extend(_.viewerCesiumInspectorMixin),i.cesiumInspector.container.style.display="none",i.extend(_.viewerCesium3DTilesInspectorMixin),i.cesium3DTilesInspector.container.style.display="none",i.cesium3DTilesInspector.viewModel.picking=!1,i.clock.currentTime=_.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),i.scene.screenSpaceCameraController.lookEventTypes=[{eventType:_.CameraEventType.RIGHT_DRAG}],i.scene.screenSpaceCameraController.zoomEventTypes=[_.CameraEventType.WHEEL,_.CameraEventType.PINCH,{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.SHIFT}],i.scene.screenSpaceCameraController.tiltEventTypes=[_.CameraEventType.MIDDLE_DRAG,_.CameraEventType.PINCH,{eventType:_.CameraEventType.LEFT_DRAG,modifier:_.KeyboardEventModifier.CTRL},{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.CTRL}],i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_CLICK),i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i._cesiumWidget._creditContainer.style.display="none",i}function Z6(){_.Cesium3DTile.prototype.updateTransform=function(t,n){t=_.defaultValue(t,_.Matrix4.IDENTITY);const e=_.Matrix4.multiplyTransformation(t,this.transform,new _.Matrix4),i=!_.Matrix4.equals(e,this.computedTransform),o=_.defined(n)&&(this._verticalExaggeration!==n.verticalExaggeration||this._verticalExaggerationRelativeHeight!==n.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&_.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=n.verticalExaggeration,this._verticalExaggerationRelativeHeight=n.verticalExaggerationRelativeHeight);const r=this._header,a=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform),_.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(a.boundingVolume,this.computedTransform)),_.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function X6(){Reflect.getOwnPropertyDescriptor(_.Camera.prototype,"_currentFlight")||Object.defineProperties(_.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var n=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,n)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new _.Event),this._vtxf_currentFlightEvent}}})}function $6(){const t=new _.Matrix4;function n(i,o){const r=i.positionWC;_.Matrix4.clone(i.transform,t),i.lookAtTransform(_.Matrix4.IDENTITY),i.look(r,o),i.lookAtTransform(t)}const e=Math.PI/60;_.Camera.prototype.lookLeft=function(i){i=_.defaultValue(i,e),this._mode!==_.SceneMode.SCENE2D&&n(this,-i)},_.Camera.prototype.lookRight=function(i){this.lookLeft(-i)}}function Y6(){if(!_.DepthPlane.xbsjFixed){_.DepthPlane.xbsjFixed=!0;var t=_.DepthPlane.prototype.update;_.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var n=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=n.context,i=new _.Geometry({attributes:{position:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:_.PrimitiveType.TRIANGLES});this._va=_.VertexArray.fromGeometry({context:e,geometry:i,attributeLocations:{position:0},bufferUsage:_.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function J6(t){const n=t.BoundingSphere,e=t.Cartesian3,i=t.defaultValue,o=t.defined,r=t.OrientedBoundingBox,a=t.Rectangle,s=t.TaskProcessor,l=t.TerrainData,u=t.TerrainEncoding,A=t.TerrainMesh,c=t.GoogleEarthEnterpriseTerrainData,f="createVerticesFromGoogleEarthEnterpriseBuffer",d=new s(f),p=new s(f,l.maximumAsynchronousTasks),g=new a,v=new a;c.prototype.createMesh=function(y){y=i(y,i.EMPTY_OBJECT);const m=y.tilingScheme,b=y.x,x=y.y,E=y.level,B=i(y.exaggeration,1),P=i(y.exaggerationRelativeHeight,0),I=i(y.throttle,!0),O=m.ellipsoid;m.tileXYToNativeRectangle(b,x,E,g),m.tileXYToRectangle(b,x,E,v);const M=O.cartographicToCartesian(a.center(v));this._skirtHeight=1.9134410999999999e6;const T=(I?p:d).scheduleTask({buffer:this._buffer,nativeRectangle:g,rectangle:a.clone(v),relativeToCenter:M,ellipsoid:O,skirtHeight:this._skirtHeight,exaggeration:B,exaggerationRelativeHeight:P,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!o(T))return;const w=this;return T.then(function(C){return w._mesh=new A(M,new Float32Array(C.vertices),new Uint16Array(C.indices),C.indexCountWithoutSkirts,C.vertexCountWithoutSkirts,C.minimumHeight,C.maximumHeight,n.clone(C.boundingSphere3D),e.clone(C.occludeePointInScaledSpace),C.numberOfAttributes,r.clone(C.orientedBoundingBox),u.clone(C.encoding),C.westIndicesSouthToNorth,C.southIndicesEastToWest,C.eastIndicesNorthToSouth,C.northIndicesWestToEast),w._minimumHeight=C.minimumHeight,w._maximumHeight=C.maximumHeight,w._buffer=void 0,w._mesh})}}function eQ(){return _.VERSION.split(".").map(n=>parseInt(n))}let Rv;function tQ(){return Rv||(Rv=eQ()),Rv}function nQ(){const t=tQ();t[0]===1&&t[1]>=92?J6(_):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function iQ(){const t=_.Resource.prototype.fetchJson,n=_.Resource.prototype.fetchArrayBuffer;_.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${h.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return h.defaultLocalFileServer.getJson(i)}else return t.call(this,...e)},_.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${h.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return h.defaultLocalFileServer.getArrayBuffer(i).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return n.call(this,...e)}}function rQ(){const t=_.ModelSceneGraph.prototype.buildDrawCommands;_.ModelSceneGraph.prototype.buildDrawCommands=function(...n){const e=this._model,i=e.modelMatrix;e.modelMatrix=_.Matrix4.IDENTITY;const o=t.call(this,...n);return e.modelMatrix=i,o}}function oQ(){const t=_.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const sQ=`#ifdef GL_OES_standard_derivatives
|
|
3776
3776
|
#extension GL_OES_standard_derivatives : enable
|
|
3777
3777
|
#endif
|
|
3778
3778
|
|
|
@@ -3806,7 +3806,7 @@ material.alpha = materialInput.color.a;
|
|
|
3806
3806
|
|
|
3807
3807
|
return material;
|
|
3808
3808
|
}
|
|
3809
|
-
`;_.Material.GlobeLevelMaterialType="GlobelLevel",_.Material._materialCache.addMaterial(_.Material.GlobeLevelMaterialType,{fabric:{type:_.Material.GlobeLevelMaterialType,uniforms:{input_shadows:new _.Cartesian3(0,0,0),input_highlights:new _.Cartesian3(1,1,1),midtones:new _.Cartesian3(.5,.5,.5),output_shadows:new _.Cartesian3(0,0,0),output_highlights:new _.Cartesian3(1,1,1)},source:sQ},translucent:!1});const{PrimitiveRenderResources:aQ,ModelUtility:lQ,Cartesian3:qn,Matrix4:wa,ModelRenderResources:uQ,defined:cQ,NodeRenderResources:hQ,BoundingSphere:nr,ModelDrawCommands:AQ}=_,fQ=new qn,pQ=new qn,VS=new qn,NS=new qn;class dQ extends aQ{constructor(n,e,i){if(super(n,e),!n.runtimeNode.instancingTranslationMin||!n.runtimeNode.instancingTranslationMax)return;const o=wa.inverse(i,new wa),r=lQ.getPositionMinMax(e.primitive,wa.multiplyByPoint(o,n.runtimeNode.instancingTranslationMin,VS),wa.multiplyByPoint(o,n.runtimeNode.instancingTranslationMax,NS));this.positionMin=qn.clone(r.min,new qn),this.positionMax=qn.clone(r.max,new qn),this.boundingSphere=nr.fromCornerPoints(this.positionMin,this.positionMax,new nr)}}function mQ(){_.ModelSceneGraph.prototype.buildDrawCommands=function(t){const n=this._model,e=new uQ(n);n.statistics.clear(),this.configurePipeline(t);const i=this.modelPipelineStages;let o,r,a;for(o=0;o<i.length;o++)i[o].process(e,n,t);const s=qn.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,fQ),l=qn.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,pQ);for(o=0;o<this._runtimeNodes.length;o++){const u=this._runtimeNodes[o];if(!cQ(u))continue;u.configurePipeline();const A=u.pipelineStages,c=new hQ(e,u);for(r=0;r<A.length;r++)A[r].process(c,u.node,t);const f=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){const d=u.runtimePrimitives[r];d.configurePipeline(t);const p=d.pipelineStages,g=new dQ(c,d,f);for(a=0;a<p.length;a++)p[a].process(g,d.primitive,t);d.boundingSphere=nr.clone(g.boundingSphere,new nr);const v=wa.multiplyByPoint(f,g.positionMin,VS),y=wa.multiplyByPoint(f,g.positionMax,NS);qn.minimumByComponent(s,v,s),qn.maximumByComponent(l,y,l);const m=AQ.buildModelDrawCommand(g,t);d.drawCommand=m}}this._boundingSphere=nr.fromCornerPoints(s,l,new nr),this._boundingSphere=nr.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=nr.transform(this._boundingSphere,this._components.transform,this._boundingSphere),n._boundingSphere=nr.transform(this._boundingSphere,n.modelMatrix,n._boundingSphere),n._initialRadius=n._boundingSphere.radius,n._boundingSphere.radius*=n._clampedScale}}const Wc=class Wc extends h.Destroyable{constructor(){super(),_.ParticleSystem.prototype.update=function(n){const e=n.time;n.time=this._falseTime;try{Wc.oldUpdate.call(this,n),this._particles.forEach(i=>{_.Billboard.prototype&&(i._billboard.ESSceneObjectID=this.ESSceneObjectID)})}catch{}n.time=e},this.d(()=>{_.ParticleSystem.prototype.update=Wc.oldUpdate})}};z(Wc,"oldUpdate",_.ParticleSystem.prototype.update);let Uv=Wc;function gQ(){if(_.ParticleSystem.prototype.timeStamp!==void 0){console.warn("fixParticleSystem已经执行过!");return}Object.defineProperties(_.ParticleSystem.prototype,{timeStamp:{get(){return this._innerCurrentTimeStamp===void 0&&(this._innerCurrentTimeStamp=0),this._innerCurrentTimeStamp},set(t){this.timeStamp!==t&&(this._innerCurrentTimeStamp=t,_.JulianDate.fromDate(new Date(t),this._falseTime))}},_falseTime:{get(){return this.__falseTime||(this.__falseTime=_.JulianDate.fromDate(new Date(0))),this.__falseTime}}})}class yQ{constructor(n){z(this,"index");z(this,"image");z(this,"resolve");z(this,"reject");z(this,"rectangle");this.index=n.index,this.image=n.image,this.resolve=n.resolve,this.reject=n.reject,this.rectangle=void 0}}function vQ(){_.TextureAtlas.prototype._resize=function(t,n=0){const e=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture;let a=r.width,s=r.height;const l=this._subRegions,u=i.map((y,m)=>new yQ({index:m,image:y})).filter((y,m)=>_.defined(y.image)&&!_.defined(l.get(m)));let A=0,c=0,f=0;for(let y=n;y<o.length;++y){const{width:m,height:b}=o[y].image;A=Math.max(A,m),c=Math.max(c,b),f+=m*b,u.push(o[y])}a=Math.max(A,a),s=Math.max(c,s),t.webgl2||(a=_.Math.nextPowerOfTwo(a),s=_.Math.nextPowerOfTwo(s));const d=Math.sqrt(f);s*=Math.ceil(d/s),a*=Math.ceil(d/a),u.sort(({image:y},{image:m})=>m.height*m.width-y.height*y.width);const p=new Array(this._nextIndex);for(const y of this._subRegions.keys())_.defined(l.get(y))&&(p[y]=i[y]);let g,v=!1;for(;!v;){g=new _.TexturePacker({height:s,width:a,borderPadding:e});let y;for(y=0;y<u.length;++y){const{index:m,image:b}=u[y];if(!_.defined(b))continue;const x=g.pack(m,b);if(!_.defined(x)){a>s?s*=2:a*=2;break}p[m]=x.rectangle}v=y===u.length}this._texturePacker=g,this._texture=this._copyFromTexture(t,a,s,p),r.destroy(),this._rectangles=p,this._guid=_.createGuid()}}const Xr={LOADED:2,PROCESSING:3,FAILED:7},{Attribute:wQ,Indices:bQ,FeatureIdAttribute:HS,FeatureIdTexture:GS,FeatureIdImplicitRange:WS,MorphTarget:xQ,Primitive:_Q,Instances:CQ,Skin:SQ,Node:EQ,AnimatedPropertyType:PQ,AnimationSampler:BQ,AnimationTarget:TQ,AnimationChannel:IQ,Animation:FQ,ArticulationStage:MQ,Articulation:DQ,Asset:RQ,Scene:UQ,Components:OQ,MetallicRoughness:LQ,SpecularGlossiness:zQ,Specular:kQ,Anisotropy:Ov,Clearcoat:Lv,Material:QQ}=_.ModelComponents;function VQ(){_.GltfLoader.prototype.process=function(t){if(_.Check.typeOf.object("frameState",t),this._state===Xr.LOADED&&!_.defined(this._loadResourcesPromise)&&(this._loadResourcesPromise=NQ(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),_.defined(this._processError)){this._state=Xr.FAILED;const o=this._processError;this._processError=void 0,zv(this,o)}const n=this._textureErrors.pop();if(_.defined(n)){const o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===Xr.FAILED)return!1;let e=!1;try{e=this._process(t)}catch(o){this._state=Xr.FAILED,zv(this,o)}let i=!1;try{i=this._processTextures(t)}catch(o){this._textureState=Xr.FAILED,zv(this,o)}return this._incrementallyLoadTextures?e:e&&i}}async function NQ(t,n){_.FeatureDetection.supportsWebP.initialized||await _.FeatureDetection.supportsWebP.initialize(),t._supportedImageFormats=new _.SupportedImageFormats({webp:_.FeatureDetection.supportsWebP(),basis:n.context.supportsBasis});const e=GQ(t,n);return t._state=Xr.PROCESSING,t._textureState=Xr.PROCESSING,_.defined(t._gltfJsonLoader)&&t._releaseGltfJson&&(_.ResourceCache.unload(t._gltfJsonLoader),t._gltfJsonLoader=void 0),e}const HQ=new _.Cartesian3;function GQ(t,n){const e=t.gltfJson,i=e.extensions??_.Frozen.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,a=i.CESIUM_RTC;if(_.defined(r)){const m=r.featureTables,b=r.featureTextures,x=_.defined(m)?m:[],E=_.defined(b)?b:[];t._sortedPropertyTableIds=Object.keys(x).sort(),t._sortedFeatureTextureIds=Object.keys(E).sort()}const s=WQ(t,n),l=XQ(t,s),u=$Q(t,s),A=YQ(e),c=JQ(e,s),f=new OQ,d=new RQ,p=e.asset.copyright;if(_.defined(p)){const m=p.split(";").map(function(b){return new _.Credit(b.trim())});d.credits=m}if(f.asset=d,f.scene=c,f.nodes=s,f.skins=l,f.animations=u,f.articulations=A,f.upAxis=t._upAxis,f.forwardAxis=t._forwardAxis,_.defined(a)){const m=_.Cartesian3.fromArray(a.center,0,HQ);f.transform=_.Matrix4.fromTranslation(m,f.transform)}if(t._components=f,_.defined(o)||_.defined(r)){const m=e8(t,o,r,n);t._loaderPromises.push(m)}const g=i.NGA_gpm_local;if(_.defined(g)){const m=_.GltfGpmLoader.load(g);t._components.extensions.NGA_gpm_local=m}const v=e.meshes;if(_.defined(v))for(const m of v){const b=m.primitives;if(_.defined(b))for(const x of b){const E=x.extensions;if(_.defined(E)){const B=E.NGA_gpm_local;if(_.defined(B)){const P=t8(t,e,B,n);t._loaderPromises.push(P)}}}}const y=[];return eE(y,t._loaderPromises),t._incrementallyLoadTextures||eE(y,t._texturesPromises),Promise.all(y)}function WQ(t,n){const e=t.gltfJson.nodes;if(!_.defined(e))return[];const i=e.map(function(o,r){const a=jQ(t,o,n);return a.index=r,a});for(let o=0;o<i.length;++o){const r=e[o].children;if(_.defined(r))for(let a=0;a<r.length;++a)i[o].children.push(i[r[a]])}return i}function jQ(t,n,e){const i=new EQ;i.name=n.name,i.matrix=Mn(_.Matrix4,n.matrix),i.translation=Mn(_.Cartesian3,n.translation),i.rotation=Mn(_.Quaternion,n.rotation),i.scale=Mn(_.Cartesian3,n.scale);const o=n.extensions??_.Frozen.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,a=o.AGI_articulations;if(_.defined(r)){if(t._loadForClassification)throw new _.RuntimeError("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=n8(t,o,e)}_.defined(a)&&(i.articulationName=a.articulationName);const s=n.mesh;if(_.defined(s)){const l=t.gltfJson.meshes[s],u=l.primitives;for(let f=0;f<u.length;++f)i.primitives.push(qQ(t,u[f],_.defined(i.instances),e));const A=n.weights??l.weights,c=i.primitives[0].morphTargets;i.morphWeights=_.defined(A)?A.slice():new Array(c.length).fill(0)}return i}function qQ(t,n,e,i){const o=new _Q,r=new _.PrimitiveLoadPlan(o);t._primitiveLoadPlans.push(r);const a=n.material;_.defined(a)&&(o.material=KQ(t,t.gltfJson.materials[a],i));const s=n.extensions??_.Frozen.EMPTY_OBJECT;let l=!1;const u=s.CESIUM_primitive_outline;t._loadPrimitiveOutline&&_.defined(u)&&(l=!0,r.needsOutlines=!0,r.outlineIndices=i8(t,u));const A=s.KHR_spz_gaussian_splats_compression;_.defined(A)&&(l=!0,r.needsGaussianSplats=!0);const c=t._loadForClassification,f=s.KHR_draco_mesh_compression;let d=!1;const p=n.attributes;if(_.defined(p))for(const B in p){if(!p.hasOwnProperty(B))continue;const P=p[B],I=kv(t,_.VertexAttributeSemantic,B),O=I.modelSemantic;if(c&&!o8(O))continue;O===_.VertexAttributeSemantic.FEATURE_ID&&(d=!0);const M=jS(t,P,I,n,f,A,e,l,i);r.attributePlans.push(M),o.attributes.push(M.attribute)}const g=n.targets;if(_.defined(g)&&!c)for(let B=0;B<g.length;++B)o.morphTargets.push(s8(t,g[B],l,r,i));const v=n.indices;if(_.defined(v)){const B=a8(t,v,n,f,d,l,i);_.defined(B)&&(r.indicesPlan=B,o.indices=B.indices)}const y=s.EXT_structural_metadata,m=s.EXT_mesh_features,b=s.EXT_feature_metadata,x=_.defined(b);_.defined(m)?l8(t,o,m,i):x&&u8(t,o,b,i),_.defined(y)?c8(o,y):x&&h8(t,o,b);const E=n.mode;if(c&&E!==_.PrimitiveType.TRIANGLES)throw new _.RuntimeError("Only triangle meshes can be used for classification.");return o.primitiveType=E,o}function KQ(t,n,e){const i=new QQ,o=n.extensions??_.Frozen.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,a=o.KHR_materials_specular,s=o.KHR_materials_anisotropy,l=o.KHR_materials_clearcoat,u=n.pbrMetallicRoughness;return i.unlit=_.defined(o.KHR_materials_unlit),_.defined(r)?i.specularGlossiness=ZQ(t,r,e):(_.defined(u)&&(i.metallicRoughness=A8(t,u,e)),_.defined(a)&&!i.unlit&&(i.specular=f8(t,a,e)),_.defined(s)&&!i.unlit&&(i.anisotropy=p8(t,s,e)),_.defined(l)&&!i.unlit&&(i.clearcoat=d8(t,l,e))),_.defined(n.emissiveTexture)&&(i.emissiveTexture=an(t,n.emissiveTexture,e,void 0)),_.defined(n.normalTexture)&&!t._loadForClassification&&(i.normalTexture=an(t,n.normalTexture,e,void 0)),_.defined(n.occlusionTexture)&&(i.occlusionTexture=an(t,n.occlusionTexture,e,void 0)),i.emissiveFactor=Mn(_.Cartesian3,n.emissiveFactor),i.alphaMode=n.alphaMode,i.alphaCutoff=n.alphaCutoff,i.doubleSided=n.doubleSided,i.name=n.name,i}function ZQ(t,n,e){const{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:a,glossinessFactor:s}=n,l=new zQ;return _.defined(i)&&(l.diffuseTexture=an(t,i,e,void 0)),_.defined(o)&&(l.specularGlossinessTexture=an(t,o,e,void 0)),l.diffuseFactor=Mn(_.Cartesian4,r),l.specularFactor=Mn(_.Cartesian3,a),l.glossinessFactor=s,l}function zv(t,n){throw t.unload(),t.getError("Failed to load glTF",n)}function XQ(t,n){const e=t.gltfJson.skins;if(t._loadForClassification||!_.defined(e))return[];const i=e.map(function(r,a){const s=m8(t,r,n);return s.index=a,s}),o=t.gltfJson.nodes;for(let r=0;r<n.length;++r){const a=o[r].skin;_.defined(a)&&(n[r].skin=i[a])}return i}function $Q(t,n){const e=t.gltfJson.animations;return t._loadForClassification||!_.defined(e)?[]:e.map(function(o,r){const a=g8(t,o,n);return a.index=r,a})}function YQ(t){var i;const e=(i=(t.extensions??_.Frozen.EMPTY_OBJECT).AGI_articulations)==null?void 0:i.articulations;return _.defined(e)?e.map(y8):[]}function JQ(t,n){const e=new UQ,i=v8(t);return e.nodes=i.map(function(o){return n[o]}),e}async function e8(t,n,e,i){const o=new _.GltfStructuralMetadataLoader({gltf:t.gltfJson,extension:n,extensionLegacy:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._structuralMetadataLoader=o,o.load()}async function t8(t,n,e,i){const o=new _.GltfMeshPrimitiveGpmLoader({gltf:n,extension:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._meshPrimitiveGpmLoader=o,o.load()}function Mn(t,n){if(_.defined(n))return t===Number?n[0]:t.unpack(n)}function n8(t,n,e){const i=n.EXT_mesh_gpu_instancing,o=new CQ,r=i.attributes;if(_.defined(r))for(const u in r){if(!r.hasOwnProperty(u))continue;const A=r[u];o.attributes.push(w8(t,A,r,u,e))}const a=i.extensions??_.Frozen.EMPTY_OBJECT,s=n.EXT_instance_features,l=a.EXT_feature_metadata;return _.defined(s)?b8(o,s):_.defined(l)&&x8(t.gltfJson,o,l,t._sortedPropertyTableIds),o}function i8(t,n){const e=n.indices,i=t.gltfJson.accessors[e];return yf(t,i,!1)}const r8={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function kv(t,n,e){let i=e;t._renameBatchIdSemantic&&(e==="_BATCHID"||e==="BATCHID")&&(i="_FEATURE_ID_0");const o=n.fromGltfSemantic(i),r=r8;return r.gltfSemantic=e,r.renamedSemantic=i,r.modelSemantic=o,r}function o8(t){const n=t===_.VertexAttributeSemantic.POSITION,e=t===_.VertexAttributeSemantic.FEATURE_ID,i=t===_.VertexAttributeSemantic.TEXCOORD;return n||e||i}function jS(t,n,e,i,o,r,a,s,l){const u=e.modelSemantic,A=u===_.VertexAttributeSemantic.POSITION,c=u===_.VertexAttributeSemantic.FEATURE_ID,f=A&&!a&&t._loadAttributesFor2D&&!l.scene3DOnly,d=A&&t._enablePick&&!l.context.webgl2,p=t._loadForClassification&&c,g=t._loadAttributesAsTypedArray,v=!g,y=g||f||d||p,x=qS(t,n,e,i,o,r,s?!1:v,s?!0:y,l),E=new _.PrimitiveLoadPlan.AttributeLoadPlan(x);return E.loadBuffer=v,E.loadTypedArray=y,E}function s8(t,n,e,i,o){const r=new xQ,a=void 0,s=void 0,l=void 0,u=!1;for(const A in n){if(!n.hasOwnProperty(A))continue;const c=n[A],f=kv(t,VertexAttributeSemantic,A),d=jS(t,c,f,a,s,l,u,e,o);r.attributes.push(d.attribute),i.attributePlans.push(d)}return r}function a8(t,n,e,i,o,r,a){const s=t.gltfJson.accessors[n],l=s.bufferView;if(!_.defined(i)&&!_.defined(l))return;const u=new bQ;u.count=s.count;const A=t._loadAttributesAsTypedArray,c=(t._loadIndicesForWireframe||t._enablePick)&&!a.context.webgl2,f=t._loadForClassification&&o,p=!A,g=A||c||f,m=_8(t,n,e,i,r?!1:p,r?!0:g,a),b=t._geometryLoaders.length;t._geometryLoaders.push(m);const x=m.load();t._loaderPromises.push(x),t._geometryCallbacks[b]=()=>{u.indexDatatype=m.indexDatatype,u.buffer=m.buffer,u.typedArray=m.typedArray};const E=new _.PrimitiveLoadPlan.IndicesLoadPlan(u);return E.loadBuffer=p,E.loadTypedArray=g,E}function l8(t,n,e,i){let o;_.defined(e)&&_.defined(e.featureIds)?o=e.featureIds:o=[];for(let r=0;r<o.length;r++){const a=o[r],s=`featureId_${r}`;let l;_.defined(a.texture)?l=C8(t,a,i,s):_.defined(a.attribute)?l=KS(a,s):l=ZS(a,s),n.featureIds.push(l)}}function u8(t,n,e,i){const{featureTables:o}=t.gltfJson.extensions.EXT_feature_metadata;let r=0;const a=e.featureIdAttributes;if(_.defined(a))for(let l=0;l<a.length;++l){const u=a[l],A=u.featureTable,c=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,d=`featureId_${r}`;r++;let p;_.defined(u.featureIds.attribute)?p=XS(u,c,f,d):p=$S(u,c,f,d),n.featureIds.push(p)}const s=e.featureIdTextures;if(_.defined(s))for(let l=0;l<s.length;++l){const u=s[l],A=u.featureTable,c=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,d=`featureId_${r}`;r++;const p=S8(t,u,c,i,f,d);n.featureIds.push(p)}}function c8(t,n){if(!_.defined(n))return;const{propertyTextures:e,propertyAttributes:i}=n;_.defined(e)&&(t.propertyTextureIds=e),_.defined(i)&&(t.propertyAttributeIds=i)}function h8(t,n,e){_.defined(e.featureTextures)&&(n.propertyTextureIds=e.featureTextures.map(function(i){return t._sortedFeatureTextureIds.indexOf(i)}))}function A8(t,n,e){const{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:a,roughnessFactor:s}=n,l=new LQ;return _.defined(i)&&(l.baseColorTexture=an(t,i,e,void 0)),_.defined(o)&&(l.metallicRoughnessTexture=an(t,o,e,void 0)),l.baseColorFactor=Mn(_.Cartesian4,r),l.metallicFactor=a,l.roughnessFactor=s,l}function f8(t,n,e){const{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:a}=n,s=new kQ;return _.defined(o)&&(s.specularTexture=an(t,o,e,void 0)),_.defined(a)&&(s.specularColorTexture=an(t,a,e,void 0)),s.specularFactor=i,s.specularColorFactor=Mn(_.Cartesian3,r),s}function p8(t,n,e){const{anisotropyStrength:i=Ov.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=Ov.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=n,a=new Ov;return _.defined(r)&&(a.anisotropyTexture=an(t,r,e,void 0)),a.anisotropyStrength=i,a.anisotropyRotation=o,a}function d8(t,n,e){const{clearcoatFactor:i=Lv.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=Lv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:a,clearcoatNormalTexture:s}=n,l=new Lv;return _.defined(o)&&(l.clearcoatTexture=an(t,o,e,void 0)),_.defined(a)&&(l.clearcoatRoughnessTexture=an(t,a,e,void 0)),_.defined(s)&&(l.clearcoatNormalTexture=an(t,s,e,void 0)),l.clearcoatFactor=i,l.clearcoatRoughnessFactor=r,l}function an(t,n,e,i){const o=t.gltfJson,r=_.GltfLoaderUtil.getImageIdFromTexture({gltf:o,textureId:n.index,supportedImageFormats:t._supportedImageFormats});if(!_.defined(r))return;const a=_.ResourceCache.getTextureLoader({gltf:o,textureInfo:n,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:e,asynchronous:t._asynchronous}),s=_.GltfLoaderUtil.createModelTextureReader({textureInfo:n}),l=t._textureLoaders.length;t._textureLoaders.push(a);const u=a.load().catch(A=>{if(!t.isDestroyed()){if(!t._incrementallyLoadTextures)throw A;t._textureState=Xr.FAILED,t._textureErrors.push(A)}});return t._texturesPromises.push(u),t._textureCallbacks[l]=()=>{s.texture=a.texture,_.defined(i)&&(s.texture.sampler=i)},s}function m8(t,n,e){const i=new SQ,o=n.joints;i.joints=o.map(a=>e[a]);const r=n.inverseBindMatrices;if(_.defined(r)){const a=t.gltfJson.accessors[r];i.inverseBindMatrices=yf(t,a,void 0)}else i.inverseBindMatrices=new Array(o.length).fill(_.Matrix4.IDENTITY);return i}function g8(t,n,e){const i=new FQ;i.name=n.name;const o=n.samplers.map(function(a,s){const l=E8(t,a);return l.index=s,l}),r=n.channels.map(function(a){return P8(a,o,e)});return i.samplers=o,i.channels=r,i}function y8(t){const n=new DQ;return n.name=t.name,n.stages=t.stages.map(T8),n}function v8(t){let n;return _.defined(t.scenes)&&_.defined(t.scene)&&(n=t.scenes[t.scene].nodes),n=n??t.nodes,n=_.defined(n)?n:[],n}function w8(t,n,e,i,o){const r=t.gltfJson.accessors,a=_.defined(e.ROTATION),s=_.defined(e.TRANSLATION)&&_.defined(r[e.TRANSLATION].min)&&_.defined(r[e.TRANSLATION].max),l=kv(t,_.InstanceAttributeSemantic,i),u=l.modelSemantic,A=u===_.InstanceAttributeSemantic.TRANSLATION||u===_.InstanceAttributeSemantic.ROTATION||u===_.InstanceAttributeSemantic.SCALE,c=u===_.InstanceAttributeSemantic.TRANSLATION,f=t._loadAttributesAsTypedArray||a&&A||!o.context.instancedArrays,d=t._enablePick&&!o.context.webgl2,p=!f,g=t._loadAttributesFor2D&&!o.scene3DOnly;return qS(t,n,l,void 0,void 0,void 0,p,f||c&&(!s||g||d),o)}function b8(t,n){const e=n.featureIds;for(let i=0;i<e.length;i++){const o=e[i],r=`instanceFeatureId_${i}`;let a;_.defined(o.attribute)?a=KS(o,r):a=ZS(o,r),t.featureIds.push(a)}}function x8(t,n,e,i){const o=t.extensions.EXT_feature_metadata.featureTables,r=e.featureIdAttributes;if(_.defined(r))for(let a=0;a<r.length;++a){const s=r[a],l=s.featureTable,u=i.indexOf(l),A=o[l].count,c=`instanceFeatureId_${a}`;let f;_.defined(s.featureIds.attribute)?f=XS(s,u,A,c):f=$S(s,u,A,c),n.featureIds.push(f)}}function yf(t,n,e){const i=new Array(n.count),o=n.bufferView;if(_.defined(o)){const r=B8(t,o),a=I8(t,r,n,e,i);return t._loaderPromises.push(a),i}return F8(n,i)}function qS(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,A=u.accessors[n],c=A.bufferView,f=e.gltfSemantic,d=e.renamedSemantic,p=e.modelSemantic,g=_.defined(p)?YS(d):void 0,y=M8(u,n,f,p,g);if(!_.defined(o)&&!_.defined(c)&&!_.defined(r))return y;const m=D8(t,n,f,i,o,r,a,s,l),b=t._geometryLoaders.length;t._geometryLoaders.push(m);const x=m.load();return t._loaderPromises.push(x),t._geometryCallbacks[b]=()=>{_.defined(o)&&_.defined(o.attributes)&&_.defined(o.attributes[f])?R8(y,m,a,s):_.defined(r)?U8(y,m,a,s):O8(u,A,y,m,a,s)},y}function _8(t,n,e,i,o,r,a){return _.ResourceCache.getIndexBufferLoader({gltf:t.gltfJson,accessorId:n,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:a,primitive:e,draco:i,asynchronous:t._asynchronous,loadBuffer:o,loadTypedArray:r})}function C8(t,n,e,i){const o=new GS;o.featureCount=n.featureCount,o.nullFeatureId=n.nullFeatureId,o.propertyTableId=n.propertyTable,o.label=n.label,o.positionalLabel=i;const r=n.texture;o.textureReader=an(t,r,e,_.Sampler.NEAREST);const s=(_.defined(r.channels)?r.channels:[0]).map(function(l){return"rgba".charAt(l)}).join("");return o.textureReader.channels=s,o}function KS(t,n){const e=new HS;return e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.propertyTableId=t.propertyTable,e.setIndex=t.attribute,e.label=t.label,e.positionalLabel=n,e}function ZS(t,n){const e=new WS;return e.propertyTableId=t.propertyTable,e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.label=t.label,e.positionalLabel=n,e.offset=0,e.repeat=1,e}function XS(t,n,e,i){const o=new HS,r=t.featureIds;return o.featureCount=e,o.propertyTableId=n,o.setIndex=YS(r.attribute),o.positionalLabel=i,o}function $S(t,n,e,i){const o=new WS,r=t.featureIds;o.propertyTableId=n,o.featureCount=e,o.offset=r.constant??0;const a=r.divisor??0;return o.repeat=a===0?void 0:a,o.positionalLabel=i,o}function S8(t,n,e,i,o,r){const a=new GS,s=n.featureIds,l=s.texture;return a.featureCount=o,a.propertyTableId=e,a.textureReader=an(t,l,i,_.Sampler.NEAREST),a.textureReader.channels=s.channels,a.positionalLabel=r,a}function E8(t,n){const e=new BQ,i=t.gltfJson.accessors,o=i[n.input];e.input=yf(t,o,void 0);const r=n.interpolation;e.interpolation=_.InterpolationType[r]??_.InterpolationType.LINEAR;const a=i[n.output];return e.output=yf(t,a,!0),e}function P8(t,n,e){const i=new IQ,o=t.sampler;return i.sampler=n[o],i.target=L8(t.target,e),i}function B8(t,n){const e=_.ResourceCache.getBufferViewLoader({gltf:t.gltfJson,bufferViewId:n,gltfResource:t._gltfResource,baseResource:t._baseResource});return t._bufferViewLoaders.push(e),e}function T8(t){const n=new MQ;n.name=t.name;const e=t.type.toUpperCase();return n.type=_.ArticulationStageType[e],n.minimumValue=t.minimumValue,n.maximumValue=t.maximumValue,n.initialValue=t.initialValue,n}async function I8(t,n,e,i,o){const{gltfJson:r}=t;if(await n.load(),t.isDestroyed())return;const a=JS(r,e,n.typedArray);i=i??!1,z8(e,a,o,i)}function F8(t,n){const e=t.type;if(e===_.AttributeType.SCALAR)return n.fill(0);const i=_.AttributeType.getMathType(e);return n.fill(i.clone(i.ZERO))}function YS(t){const e=/^\w+_(\d+)$/.exec(t);if(e!==null)return parseInt(e[1])}function M8(t,n,e,i,o){var c;const r=t.accessors[n],a=_.AttributeType.getMathType(r.type),s=r.normalized??!1,l=new wQ;l.name=e,l.semantic=i,l.setIndex=o,l.constant=k8(a),l.componentDatatype=r.componentType,l.normalized=s,l.count=r.count,l.type=r.type,l.min=Mn(a,r.min),l.max=Mn(a,r.max),l.byteOffset=r.byteOffset,l.byteStride=_.getAccessorByteStride(t,r),_.hasExtension(r,"WEB3D_quantized_attributes")&&Q8(r.extensions.WEB3D_quantized_attributes,l,a);const u=l.semantic===_.VertexAttributeSemantic.POSITION||l.semantic===_.VertexAttributeSemantic.NORMAL||l.semantic===_.VertexAttributeSemantic.TANGENT||l.semantic===_.VertexAttributeSemantic.TEXCOORD||l.semantic===_.VertexAttributeSemantic.FEATURE_ID||l.semantic===_.VertexAttributeSemantic.SCALE||l.semantic===_.VertexAttributeSemantic.ROTATION;return((c=t.extensionsRequired)==null?void 0:c.includes("KHR_mesh_quantization"))&&s&&u&&N8(l,a),l}function D8(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,c=u.accessors[n].bufferView;return _.ResourceCache.getVertexBufferLoader({gltf:u,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:l,bufferViewId:c,primitive:i,draco:o,spz:r,attributeSemantic:e,accessorId:n,asynchronous:t._asynchronous,loadBuffer:a,loadTypedArray:s})}function R8(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,t.quantization=n.quantization,e&&(t.buffer=n.buffer),i){const o=_.defined(n.quantization)?n.quantization.componentDatatype:t.componentDatatype;t.typedArray=_.ComponentDatatype.createArrayBufferView(o,n.typedArray.buffer)}}function U8(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,e&&(t.buffer=n.buffer),i&&_.defined(n.typedArray)&&(t.typedArray=_.ComponentDatatype.createArrayBufferView(t.componentDatatype,n.typedArray.buffer)),t.semantic===_.VertexAttributeSemantic.POSITION){const o=a=>{let s=1/0,l=-1/0,u=1/0,A=-1/0,c=1/0,f=-1/0;for(let d=0;d<a.length;d+=3){const p=a[d],g=a[d+1],v=a[d+2];s=Math.min(s,p),l=Math.max(l,p),u=Math.min(u,g),A=Math.max(A,g),c=Math.min(c,v),f=Math.max(f,v)}return[new _.Cartesian3(s,u,c),new _.Cartesian3(l,A,f)]},r=t.typedArray;[t.min,t.max]=o(r)}}function O8(t,n,e,i,o,r){if(o&&(e.buffer=i.buffer),r){const a=i.typedArray;e.typedArray=JS(t,n,a),o||(e.byteOffset=0,e.byteStride=void 0)}}function L8(t,n){const e=new TQ,i=t.node;if(!_.defined(i))return;e.node=n[i];const o=t.path.toUpperCase();return e.path=PQ[o],e}function JS(t,n,e){let i=n.byteOffset;const o=_.getAccessorByteStride(t,n),r=n.count,a=_.numberOfComponentsForType(n.type),s=n.componentType,l=_.ComponentDatatype.getSizeInBytes(s),u=l*a,A=r*a;if(o===u)return e=new Uint8Array(e),_.ComponentDatatype.createArrayBufferView(s,e.buffer,e.byteOffset+i,A);const c=_.ComponentDatatype.createTypedArray(s,A),f=new DataView(e.buffer),d=new Array(a),p=_.getComponentReader(n.componentType);i=e.byteOffset+i;for(let g=0;g<r;++g){p(f,i,a,l,d);for(let v=0;v<a;++v)c[g*a+v]=d[v];i+=o}return c}function z8(t,n,e,i){const o=t.type,r=t.count;if(o===_.AttributeType.SCALAR)for(let a=0;a<r;a++)e[a]=n[a];else if(o===_.AttributeType.VEC4&&i)for(let a=0;a<r;a++)e[a]=_.Quaternion.unpack(n,a*4);else{const a=_.AttributeType.getMathType(o),s=_.AttributeType.getNumberOfComponents(o);for(let l=0;l<r;l++)e[l]=a.unpack(n,l*s)}return e}function k8(t){return t===Number?0:new t}function Q8(t,n,e){const i=t.decodeMatrix,o=Mn(e,t.decodedMin),r=Mn(e,t.decodedMax);_.defined(o)&&_.defined(r)&&(n.min=o,n.max=r);const a=new _.ModelComponents.Quantization;a.componentDatatype=n.componentDatatype,a.type=n.type,i.length===4?(a.quantizedVolumeOffset=i[2],a.quantizedVolumeStepSize=i[0]):i.length===9?(a.quantizedVolumeOffset=new _.Cartesian2(i[6],i[7]),a.quantizedVolumeStepSize=new _.Cartesian2(i[0],i[4])):i.length===16?(a.quantizedVolumeOffset=new _.Cartesian3(i[12],i[13],i[14]),a.quantizedVolumeStepSize=new _.Cartesian3(i[0],i[5],i[10])):i.length===25&&(a.quantizedVolumeOffset=new _.Cartesian4(i[20],i[21],i[22],i[23]),a.quantizedVolumeStepSize=new _.Cartesian4(i[0],i[6],i[12],i[18])),n.quantization=a}const V8={VEC2:new _.Cartesian2(-1,-1),VEC3:new _.Cartesian3(-1,-1,-1),VEC4:new _.Cartesian4(-1,-1,-1,-1)};function N8(t,n){const e=H8(t.componentDatatype),i=V8[t.type];let o=t.min;_.defined(o)&&(o=n.divideByScalar(o,e,o),o=n.maximumByComponent(o,i,o));let r=t.max;_.defined(r)&&(r=n.divideByScalar(r,e,r),r=n.maximumByComponent(r,i,r)),t.min=o,t.max=r}function H8(t){switch(t){case _.ComponentDatatype.BYTE:return 127;case _.ComponentDatatype.UNSIGNED_BYTE:return 255;case _.ComponentDatatype.SHORT:return 32767;case _.ComponentDatatype.UNSIGNED_SHORT:return 65535;default:return 1}}function eE(t,n){if(!_.defined(n))return;const e=n.length;if(e===0)return;const i=t.length;t.length+=e;for(let o=0;o<e;o++)t[i+o]=n[o]}Xk(),$k(),Yk(),nQ(),iQ(),rQ(),oQ(),Zk(),mQ(),gQ(),vQ(),VQ(),_.Camera.DEFAULT_VIEW_RECTANGLE=_.Rectangle.fromDegrees(70,5,140,55);function G8(){return new Promise((t,n)=>_.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class W8 extends h.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Dn(s);if(l&&(l.destroy(),Qv(s,void 0)),_.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(h.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=Kk;await s.promise(G8());const A=await s.promise(h.createCancelablePromise(u(l,o)));A.scene._xbsjOriginSkyAtmosphere=A.scene.skyAtmosphere,A.scene._xbsjOriginSkyBox=A.scene.skyBox,A.clockViewModel.currentTime=_.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const c=_.JulianDate.fromDate(new Date(e.currentTime));_.JulianDate.equals(c,A.clockViewModel.currentTime)||(A.clockViewModel.currentTime=c)})),this.dispose(ui(A.clockViewModel,"currentTime",c=>{const f=_.JulianDate.toDate(A.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const c=new oE(A,e);Qv(A,c)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(A)}));a.start(n),a.errorEvent.don(s=>{console.error(s),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const j8=new _.EllipsoidTerrainProvider;class tE extends h.Destroyable{constructor(e){super();z(this,"_terrainMap",new Map);z(this,"_nextAnimateFrame",this.dv(h.createNextAnimateFrame()));z(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??j8}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const i=new h.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(h.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class nE extends h.Destroyable{constructor(e){super();z(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof yt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new h.Destroyable;{const r=o.dv(h.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof yt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof yt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,A)=>Number(A[1])-Number(u[1]))).forEach((u,A)=>{A instanceof yt&&A.czmDivPoi&&(A.czmDivPoi.zOrder=a),A instanceof ki&&A.canvasObj&&(A.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class q8 extends h.Destroyable{constructor(e){super();z(this,"_czmImageryLayerWrappers",new Set);z(this,"_zIndexChangedEvent",this.dv(new h.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??h.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??h.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class K8 extends h.Destroyable{constructor(e){super();z(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:i}=this,o=i.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class Z8 extends h.Destroyable{constructor(e){super();z(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new h.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new K8(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class X8 extends h.Destroyable{constructor(e,i){super();z(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new h.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new Z8(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class iE extends h.Destroyable{constructor(e){super();z(this,"_czmImageryWrappers",new Set);z(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new q8(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new X8(e,this))}has(e){for(let i of this.czmImageryWrappers)if(i.imagery===e)return!0;return!1}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class rE extends h.Destroyable{constructor(e){super();z(this,"_pause",this.disposeVar(h.react(!1)));z(this,"_pickPositionTasks",[]);z(this,"_pickTasks",[]);z(this,"pickHeightMustGreaterThanZero",!0);z(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[A,c,f,d]=u;try{(async()=>{const{scene:p,camera:g}=i,v=Ke(A),y=g.getPickRay(v);if(y){let E;if(c?E=await p.pickFromRayMostDetailed(y,this.objectsToExclude):E=p.pickFromRay(y,this.objectsToExclude),E&&E.position){const B=Ue(E.position);return B?f(B):d(new Error("positionFromCartesian failed"))}if(!(p.terrainProvider instanceof _.EllipsoidTerrainProvider)){const B=p.globe.pick(y,p);if(!B)return d(new Error("scene.globe.pick failed"));const P=Ue(B);return P?(this.pickHeightMustGreaterThanZero&&P[2]<0&&(P[2]=0),f(P)):d(new Error("positionFromCartesian failed"))}}const m=p.terrainProvider instanceof _.EllipsoidTerrainProvider?p.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,b=i.camera.pickEllipsoid(Ke(A),m);if(!b)return d(new Error("Pick failed"));const x=Ue(b);return x?f(x):d(new Error("positionFromCartesian failed"))})()}catch(p){d(p)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[A,c,f,d,p]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,B,P,I;let g=i.scene.pick(Ke(A),c&&c[0],c&&c[1]);!g&&_.defined(i.scene.globe)&&(g=await $8(i,Ke(A)));let v;if(g&&g instanceof _.Cesium3DTileFeature){v={};try{g&&g.getPropertyIds().forEach(M=>{v&&(v[M]=g.getProperty(M))})}catch(O){console.warn(O)}}if(!g){const{left:O,top:M}=e.container.getBoundingClientRect();g=(E=document.elementFromPoint(A[0]+O,A[1]+M))==null?void 0:E.closest("[data-es-scene-object-id]")}let y;g&&(g.id&&g.id instanceof _.Entity&&g.id.ESSceneObjectID?y=g.id.ESSceneObjectID:g.collection&&g.collection.ESSceneObjectID?y=g.collection.ESSceneObjectID:g.primitive&&g.primitive.ESSceneObjectID?y=g.primitive.ESSceneObjectID:Array.isArray(g)&&g[0]instanceof _.ImageryLayerFeatureInfo?y=g[0].imageryLayer.ESSceneObjectID:g instanceof HTMLElement&&(y=g.dataset.esSceneObjectId));let m=y?h.ESSceneObject.getSceneObject(y):void 0;m&&m.parentID&&(m=h.ESSceneObject.getSceneObject(m.parentID));let b={};if(m&&Reflect.has(m,"allowPicking")&&Reflect.has(m,"pickedEvent")&&(m.allowPicking??!1)){if(m instanceof h.ESEntityCluster){const O=new _.JulianDate;b=g.id instanceof _.Entity?{name:g.id.label.text.getValue(O),properties:(B=g.id.properties)==null?void 0:B.getValue(O),coordinates:Ma(g.id.position.getValue(O))}:(P=g.id)==null?void 0:P.map(M=>{var S;return{name:M.id,properties:(S=M.properties)==null?void 0:S.getValue(O),coordinates:Ma(M.position.getValue(O))}})}else if(m instanceof h.ESGeoJson){const O=new _.JulianDate;if(!g.id.entityCollection)return;const M=g.id.polygon?"Polygon":g.id.polyline?"LineString":"Point",S=((I=g.id.properties)==null?void 0:I.getValue(O))??{},T=M=="Point"?Ue(g.id.position.getValue(O)):M=="LineString"?g.id.polyline.positions.getValue(O).map(w=>Ue(w)):Gf(g.id.polygon.hierarchy.getValue(O));b=m.pickedInfoType=="FeatureCollection"?{type:"Feature",geometry:{type:M,coordinates:T},properties:S}:{type:M,coordinates:T,properties:S}}else if(m instanceof h.ESGltfModel){let O;Reflect.has(g,"featureId")?O=g.featureId:Reflect.has(g,"instanceId")&&(O=g.instanceId),O&&(g.id=g.primitive.structuralMetadata.getPropertyTable(0).getProperty(g.instanceId,"id"))}m.pickedEvent.emit(new h.ESJPickedResult(g,m,v,b,f,A))}m&&Reflect.has(m,"allowPicking")&&!m.allowPicking&&d(new h.ESJPickedResult);const x=new h.ESJPickedResult(g,m,v,b,f,A);d(x)})()}catch(g){p(g)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function $8(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(_.defined(o))return o}class Y8 extends h.Destroyable{constructor(e){super();z(this,"_enabled",this.disposeVar(h.react(!1)));z(this,"_cursorPosition",h.react(void 0));z(this,"quickPickPosition",!0);let i=new h.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Dn(e);if(!a)return;i=new h.Destroyable;const s=i.disposeVar(h.react(void 0)),l=i.disposeVar(h.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(A=>{A.pointerEvent&&(s.value=h.getDomEventCurrentTargetPos(A.pointerEvent))}));const u=i.disposeVar(h.createProcessingFromAsyncFunc(async A=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const c=await A.promise(h.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=c}else{const c=await A.promise(h.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=c}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function Dn(t){return h.getExtProp(t,"_viewerExtensions")}function Qv(t,n){h.setExtProp(t,"_viewerExtensions",n)}class oE extends h.Destroyable{constructor(e,i){super();z(this,"_imageriesManager");z(this,"_terrainManager");z(this,"_labelManager");z(this,"_pickingManager");z(this,"_poiContext");z(this,"_cursorPositionInfo");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new iE(this.viewer)),this._terrainManager=this.dv(new tE(this.viewer)),this._labelManager=this.dv(new nE(this.viewer)),this._poiContext=this.disposeVar(new V0(this._viewer)),this._cursorPositionInfo=this.disposeVar(new Y8(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new rE(i))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}}var sE=new _.Cartesian3,aE=new _.Cartesian3;function lE(t,n,e){let i=_.Matrix4.clone(t.transform);t.lookAtTransform(_.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=_.Cartesian3.normalize(r,sE),s=_.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=_.Cartesian3.cross(t.direction,a,aE);else var l=_.Cartesian3.cross(t.up,a,aE);var u=l;if(e){var A=_.Cartesian3.cross(a,l,sE);u=A}var c=_.Cartesian3.magnitude(r);t.rotate(u,n/c);var f=t.positionCartographic,d=f.longitude,p=f.latitude;_.Cartesian3.fromRadians(d,p,o,void 0,t.position),t.lookAtTransform(i)}function uE(t,n){lE(t,n,!1)}function cE(t,n){lE(t,-n,!0)}class J8 extends h.Destroyable{constructor(e){super();z(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),A=u-s;s=u;const c=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(A*c),a.MoveBackword&&r.moveBackward(A*c),a.MoveLeft&&r.moveLeft(A*c),a.MoveRight&&r.moveRight(A*c)):(a.MoveForward&&uE(r,A*c),a.MoveBackword&&uE(r,-A*c),a.MoveLeft&&cE(r,-A*c),a.MoveRight&&cE(r,A*c));{const{rotateSpeed:f}=this.controller,d=_.Math.toRadians(f*A);a.RotateRight?r.lookRight(d):a.RotateLeft?r.lookRight(-d):a.RotateUp?r.lookDown(-d):a.RotateDown&&r.lookDown(d)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class vf extends h.Destroyable{constructor(e){super();z(this,"_currentKeyIds",new Set);z(this,"_currentKeyIdsChanged",this.dv(new h.Event));z(this,"_debug",this.dv(h.react(!1)));z(this,"_debugResetting",this.dv(new h.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends h.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
|
|
3809
|
+
`;_.Material.GlobeLevelMaterialType="GlobelLevel",_.Material._materialCache.addMaterial(_.Material.GlobeLevelMaterialType,{fabric:{type:_.Material.GlobeLevelMaterialType,uniforms:{input_shadows:new _.Cartesian3(0,0,0),input_highlights:new _.Cartesian3(1,1,1),midtones:new _.Cartesian3(.5,.5,.5),output_shadows:new _.Cartesian3(0,0,0),output_highlights:new _.Cartesian3(1,1,1)},source:sQ},translucent:!1});const{PrimitiveRenderResources:aQ,ModelUtility:lQ,Cartesian3:qn,Matrix4:wa,ModelRenderResources:uQ,defined:cQ,NodeRenderResources:hQ,BoundingSphere:nr,ModelDrawCommands:AQ}=_,fQ=new qn,pQ=new qn,VS=new qn,NS=new qn;class dQ extends aQ{constructor(n,e,i){if(super(n,e),!n.runtimeNode.instancingTranslationMin||!n.runtimeNode.instancingTranslationMax)return;const o=wa.inverse(i,new wa),r=lQ.getPositionMinMax(e.primitive,wa.multiplyByPoint(o,n.runtimeNode.instancingTranslationMin,VS),wa.multiplyByPoint(o,n.runtimeNode.instancingTranslationMax,NS));this.positionMin=qn.clone(r.min,new qn),this.positionMax=qn.clone(r.max,new qn),this.boundingSphere=nr.fromCornerPoints(this.positionMin,this.positionMax,new nr)}}function mQ(){_.ModelSceneGraph.prototype.buildDrawCommands=function(t){const n=this._model,e=new uQ(n);n.statistics.clear(),this.configurePipeline(t);const i=this.modelPipelineStages;let o,r,a;for(o=0;o<i.length;o++)i[o].process(e,n,t);const s=qn.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,fQ),l=qn.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,pQ);for(o=0;o<this._runtimeNodes.length;o++){const u=this._runtimeNodes[o];if(!cQ(u))continue;u.configurePipeline();const A=u.pipelineStages,c=new hQ(e,u);for(r=0;r<A.length;r++)A[r].process(c,u.node,t);const f=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){const d=u.runtimePrimitives[r];d.configurePipeline(t);const p=d.pipelineStages,g=new dQ(c,d,f);for(a=0;a<p.length;a++)p[a].process(g,d.primitive,t);d.boundingSphere=nr.clone(g.boundingSphere,new nr);const v=wa.multiplyByPoint(f,g.positionMin,VS),y=wa.multiplyByPoint(f,g.positionMax,NS);qn.minimumByComponent(s,v,s),qn.maximumByComponent(l,y,l);const m=AQ.buildModelDrawCommand(g,t);d.drawCommand=m}}this._boundingSphere=nr.fromCornerPoints(s,l,new nr),this._boundingSphere=nr.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=nr.transform(this._boundingSphere,this._components.transform,this._boundingSphere),n._boundingSphere=nr.transform(this._boundingSphere,n.modelMatrix,n._boundingSphere),n._initialRadius=n._boundingSphere.radius,n._boundingSphere.radius*=n._clampedScale}}const Wc=class Wc extends h.Destroyable{constructor(){super(),_.ParticleSystem.prototype.update=function(n){const e=n.time;n.time=this._falseTime;try{Wc.oldUpdate.call(this,n),this._particles.forEach(i=>{_.Billboard.prototype&&(i._billboard.ESSceneObjectID=this.ESSceneObjectID)})}catch{}n.time=e},this.d(()=>{_.ParticleSystem.prototype.update=Wc.oldUpdate})}};z(Wc,"oldUpdate",_.ParticleSystem.prototype.update);let Uv=Wc;function gQ(){if(_.ParticleSystem.prototype.timeStamp!==void 0){console.warn("fixParticleSystem已经执行过!");return}Object.defineProperties(_.ParticleSystem.prototype,{timeStamp:{get(){return this._innerCurrentTimeStamp===void 0&&(this._innerCurrentTimeStamp=0),this._innerCurrentTimeStamp},set(t){this.timeStamp!==t&&(this._innerCurrentTimeStamp=t,_.JulianDate.fromDate(new Date(t),this._falseTime))}},_falseTime:{get(){return this.__falseTime||(this.__falseTime=_.JulianDate.fromDate(new Date(0))),this.__falseTime}}})}class yQ{constructor(n){z(this,"index");z(this,"image");z(this,"resolve");z(this,"reject");z(this,"rectangle");this.index=n.index,this.image=n.image,this.resolve=n.resolve,this.reject=n.reject,this.rectangle=void 0}}function vQ(){_.TextureAtlas.prototype._resize=function(t,n=0){const e=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture;let a=r.width,s=r.height;const l=this._subRegions,u=i.map((y,m)=>new yQ({index:m,image:y})).filter((y,m)=>_.defined(y.image)&&!_.defined(l.get(m)));let A=0,c=0,f=0;for(let y=n;y<o.length;++y){const{width:m,height:b}=o[y].image;A=Math.max(A,m),c=Math.max(c,b),f+=m*b,u.push(o[y])}a=Math.max(A,a),s=Math.max(c,s),t.webgl2||(a=_.Math.nextPowerOfTwo(a),s=_.Math.nextPowerOfTwo(s));const d=Math.sqrt(f);s*=Math.ceil(d/s),a*=Math.ceil(d/a),u.sort(({image:y},{image:m})=>m.height*m.width-y.height*y.width);const p=new Array(this._nextIndex);for(const y of this._subRegions.keys())_.defined(l.get(y))&&(p[y]=i[y]);let g,v=!1;for(;!v;){g=new _.TexturePacker({height:s,width:a,borderPadding:e});let y;for(y=0;y<u.length;++y){const{index:m,image:b}=u[y];if(!_.defined(b))continue;const x=g.pack(m,b);if(!_.defined(x)){a>s?s*=2:a*=2;break}p[m]=x.rectangle}v=y===u.length}this._texturePacker=g,this._texture=this._copyFromTexture(t,a,s,p),r.destroy(),this._rectangles=p,this._guid=_.createGuid()}}const Xr={LOADED:2,PROCESSING:3,FAILED:7},{Attribute:wQ,Indices:bQ,FeatureIdAttribute:HS,FeatureIdTexture:GS,FeatureIdImplicitRange:WS,MorphTarget:xQ,Primitive:_Q,Instances:CQ,Skin:SQ,Node:EQ,AnimatedPropertyType:PQ,AnimationSampler:BQ,AnimationTarget:TQ,AnimationChannel:IQ,Animation:FQ,ArticulationStage:MQ,Articulation:DQ,Asset:RQ,Scene:UQ,Components:OQ,MetallicRoughness:LQ,SpecularGlossiness:zQ,Specular:kQ,Anisotropy:Ov,Clearcoat:Lv,Material:QQ}=_.ModelComponents;function VQ(){_.GltfLoader.prototype.process=function(t){if(_.Check.typeOf.object("frameState",t),this._state===Xr.LOADED&&!_.defined(this._loadResourcesPromise)&&(this._loadResourcesPromise=NQ(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),_.defined(this._processError)){this._state=Xr.FAILED;const o=this._processError;this._processError=void 0,zv(this,o)}const n=this._textureErrors.pop();if(_.defined(n)){const o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===Xr.FAILED)return!1;let e=!1;try{e=this._process(t)}catch(o){this._state=Xr.FAILED,zv(this,o)}let i=!1;try{i=this._processTextures(t)}catch(o){this._textureState=Xr.FAILED,zv(this,o)}return this._incrementallyLoadTextures?e:e&&i}}async function NQ(t,n){_.FeatureDetection.supportsWebP.initialized||await _.FeatureDetection.supportsWebP.initialize(),t._supportedImageFormats=new _.SupportedImageFormats({webp:_.FeatureDetection.supportsWebP(),basis:n.context.supportsBasis});const e=GQ(t,n);return t._state=Xr.PROCESSING,t._textureState=Xr.PROCESSING,_.defined(t._gltfJsonLoader)&&t._releaseGltfJson&&(_.ResourceCache.unload(t._gltfJsonLoader),t._gltfJsonLoader=void 0),e}const HQ=new _.Cartesian3;function GQ(t,n){const e=t.gltfJson,i=e.extensions??_.Frozen.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,a=i.CESIUM_RTC;if(_.defined(r)){const m=r.featureTables,b=r.featureTextures,x=_.defined(m)?m:[],E=_.defined(b)?b:[];t._sortedPropertyTableIds=Object.keys(x).sort(),t._sortedFeatureTextureIds=Object.keys(E).sort()}const s=WQ(t,n),l=XQ(t,s),u=$Q(t,s),A=YQ(e),c=JQ(e,s),f=new OQ,d=new RQ,p=e.asset.copyright;if(_.defined(p)){const m=p.split(";").map(function(b){return new _.Credit(b.trim())});d.credits=m}if(f.asset=d,f.scene=c,f.nodes=s,f.skins=l,f.animations=u,f.articulations=A,f.upAxis=t._upAxis,f.forwardAxis=t._forwardAxis,_.defined(a)){const m=_.Cartesian3.fromArray(a.center,0,HQ);f.transform=_.Matrix4.fromTranslation(m,f.transform)}if(t._components=f,_.defined(o)||_.defined(r)){const m=e8(t,o,r,n);t._loaderPromises.push(m)}const g=i.NGA_gpm_local;if(_.defined(g)){const m=_.GltfGpmLoader.load(g);t._components.extensions.NGA_gpm_local=m}const v=e.meshes;if(_.defined(v))for(const m of v){const b=m.primitives;if(_.defined(b))for(const x of b){const E=x.extensions;if(_.defined(E)){const B=E.NGA_gpm_local;if(_.defined(B)){const P=t8(t,e,B,n);t._loaderPromises.push(P)}}}}const y=[];return eE(y,t._loaderPromises),t._incrementallyLoadTextures||eE(y,t._texturesPromises),Promise.all(y)}function WQ(t,n){const e=t.gltfJson.nodes;if(!_.defined(e))return[];const i=e.map(function(o,r){const a=jQ(t,o,n);return a.index=r,a});for(let o=0;o<i.length;++o){const r=e[o].children;if(_.defined(r))for(let a=0;a<r.length;++a)i[o].children.push(i[r[a]])}return i}function jQ(t,n,e){const i=new EQ;i.name=n.name,i.matrix=Mn(_.Matrix4,n.matrix),i.translation=Mn(_.Cartesian3,n.translation),i.rotation=Mn(_.Quaternion,n.rotation),i.scale=Mn(_.Cartesian3,n.scale);const o=n.extensions??_.Frozen.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,a=o.AGI_articulations;if(_.defined(r)){if(t._loadForClassification)throw new _.RuntimeError("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=n8(t,o,e)}_.defined(a)&&(i.articulationName=a.articulationName);const s=n.mesh;if(_.defined(s)){const l=t.gltfJson.meshes[s],u=l.primitives;for(let f=0;f<u.length;++f)i.primitives.push(qQ(t,u[f],_.defined(i.instances),e));const A=n.weights??l.weights,c=i.primitives[0].morphTargets;i.morphWeights=_.defined(A)?A.slice():new Array(c.length).fill(0)}return i}function qQ(t,n,e,i){const o=new _Q,r=new _.PrimitiveLoadPlan(o);t._primitiveLoadPlans.push(r);const a=n.material;_.defined(a)&&(o.material=KQ(t,t.gltfJson.materials[a],i));const s=n.extensions??_.Frozen.EMPTY_OBJECT;let l=!1;const u=s.CESIUM_primitive_outline;t._loadPrimitiveOutline&&_.defined(u)&&(l=!0,r.needsOutlines=!0,r.outlineIndices=i8(t,u));const A=s.KHR_spz_gaussian_splats_compression;_.defined(A)&&(l=!0,r.needsGaussianSplats=!0);const c=t._loadForClassification,f=s.KHR_draco_mesh_compression;let d=!1;const p=n.attributes;if(_.defined(p))for(const B in p){if(!p.hasOwnProperty(B))continue;const P=p[B],I=kv(t,_.VertexAttributeSemantic,B),O=I.modelSemantic;if(c&&!o8(O))continue;O===_.VertexAttributeSemantic.FEATURE_ID&&(d=!0);const M=jS(t,P,I,n,f,A,e,l,i);r.attributePlans.push(M),o.attributes.push(M.attribute)}const g=n.targets;if(_.defined(g)&&!c)for(let B=0;B<g.length;++B)o.morphTargets.push(s8(t,g[B],l,r,i));const v=n.indices;if(_.defined(v)){const B=a8(t,v,n,f,d,l,i);_.defined(B)&&(r.indicesPlan=B,o.indices=B.indices)}const y=s.EXT_structural_metadata,m=s.EXT_mesh_features,b=s.EXT_feature_metadata,x=_.defined(b);_.defined(m)?l8(t,o,m,i):x&&u8(t,o,b,i),_.defined(y)?c8(o,y):x&&h8(t,o,b);const E=n.mode;if(c&&E!==_.PrimitiveType.TRIANGLES)throw new _.RuntimeError("Only triangle meshes can be used for classification.");return o.primitiveType=E,o}function KQ(t,n,e){const i=new QQ,o=n.extensions??_.Frozen.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,a=o.KHR_materials_specular,s=o.KHR_materials_anisotropy,l=o.KHR_materials_clearcoat,u=n.pbrMetallicRoughness;return i.unlit=_.defined(o.KHR_materials_unlit),_.defined(r)?i.specularGlossiness=ZQ(t,r,e):(_.defined(u)&&(i.metallicRoughness=A8(t,u,e)),_.defined(a)&&!i.unlit&&(i.specular=f8(t,a,e)),_.defined(s)&&!i.unlit&&(i.anisotropy=p8(t,s,e)),_.defined(l)&&!i.unlit&&(i.clearcoat=d8(t,l,e))),_.defined(n.emissiveTexture)&&(i.emissiveTexture=an(t,n.emissiveTexture,e,void 0)),_.defined(n.normalTexture)&&!t._loadForClassification&&(i.normalTexture=an(t,n.normalTexture,e,void 0)),_.defined(n.occlusionTexture)&&(i.occlusionTexture=an(t,n.occlusionTexture,e,void 0)),i.emissiveFactor=Mn(_.Cartesian3,n.emissiveFactor),i.alphaMode=n.alphaMode,i.alphaCutoff=n.alphaCutoff,i.doubleSided=n.doubleSided,i.name=n.name,i}function ZQ(t,n,e){const{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:a,glossinessFactor:s}=n,l=new zQ;return _.defined(i)&&(l.diffuseTexture=an(t,i,e,void 0)),_.defined(o)&&(l.specularGlossinessTexture=an(t,o,e,void 0)),l.diffuseFactor=Mn(_.Cartesian4,r),l.specularFactor=Mn(_.Cartesian3,a),l.glossinessFactor=s,l}function zv(t,n){throw t.unload(),t.getError("Failed to load glTF",n)}function XQ(t,n){const e=t.gltfJson.skins;if(t._loadForClassification||!_.defined(e))return[];const i=e.map(function(r,a){const s=m8(t,r,n);return s.index=a,s}),o=t.gltfJson.nodes;for(let r=0;r<n.length;++r){const a=o[r].skin;_.defined(a)&&(n[r].skin=i[a])}return i}function $Q(t,n){const e=t.gltfJson.animations;return t._loadForClassification||!_.defined(e)?[]:e.map(function(o,r){const a=g8(t,o,n);return a.index=r,a})}function YQ(t){var i;const e=(i=(t.extensions??_.Frozen.EMPTY_OBJECT).AGI_articulations)==null?void 0:i.articulations;return _.defined(e)?e.map(y8):[]}function JQ(t,n){const e=new UQ,i=v8(t);return e.nodes=i.map(function(o){return n[o]}),e}async function e8(t,n,e,i){const o=new _.GltfStructuralMetadataLoader({gltf:t.gltfJson,extension:n,extensionLegacy:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._structuralMetadataLoader=o,o.load()}async function t8(t,n,e,i){const o=new _.GltfMeshPrimitiveGpmLoader({gltf:n,extension:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._meshPrimitiveGpmLoader=o,o.load()}function Mn(t,n){if(_.defined(n))return t===Number?n[0]:t.unpack(n)}function n8(t,n,e){const i=n.EXT_mesh_gpu_instancing,o=new CQ,r=i.attributes;if(_.defined(r))for(const u in r){if(!r.hasOwnProperty(u))continue;const A=r[u];o.attributes.push(w8(t,A,r,u,e))}const a=i.extensions??_.Frozen.EMPTY_OBJECT,s=n.EXT_instance_features,l=a.EXT_feature_metadata;return _.defined(s)?b8(o,s):_.defined(l)&&x8(t.gltfJson,o,l,t._sortedPropertyTableIds),o}function i8(t,n){const e=n.indices,i=t.gltfJson.accessors[e];return yf(t,i,!1)}const r8={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function kv(t,n,e){let i=e;t._renameBatchIdSemantic&&(e==="_BATCHID"||e==="BATCHID")&&(i="_FEATURE_ID_0");const o=n.fromGltfSemantic(i),r=r8;return r.gltfSemantic=e,r.renamedSemantic=i,r.modelSemantic=o,r}function o8(t){const n=t===_.VertexAttributeSemantic.POSITION,e=t===_.VertexAttributeSemantic.FEATURE_ID,i=t===_.VertexAttributeSemantic.TEXCOORD;return n||e||i}function jS(t,n,e,i,o,r,a,s,l){const u=e.modelSemantic,A=u===_.VertexAttributeSemantic.POSITION,c=u===_.VertexAttributeSemantic.FEATURE_ID,f=A&&!a&&t._loadAttributesFor2D&&!l.scene3DOnly,d=A&&t._enablePick&&!l.context.webgl2,p=t._loadForClassification&&c,g=t._loadAttributesAsTypedArray,v=!g,y=g||f||d||p,x=qS(t,n,e,i,o,r,s?!1:v,s?!0:y,l),E=new _.PrimitiveLoadPlan.AttributeLoadPlan(x);return E.loadBuffer=v,E.loadTypedArray=y,E}function s8(t,n,e,i,o){const r=new xQ,a=void 0,s=void 0,l=void 0,u=!1;for(const A in n){if(!n.hasOwnProperty(A))continue;const c=n[A],f=kv(t,VertexAttributeSemantic,A),d=jS(t,c,f,a,s,l,u,e,o);r.attributes.push(d.attribute),i.attributePlans.push(d)}return r}function a8(t,n,e,i,o,r,a){const s=t.gltfJson.accessors[n],l=s.bufferView;if(!_.defined(i)&&!_.defined(l))return;const u=new bQ;u.count=s.count;const A=t._loadAttributesAsTypedArray,c=(t._loadIndicesForWireframe||t._enablePick)&&!a.context.webgl2,f=t._loadForClassification&&o,p=!A,g=A||c||f,m=_8(t,n,e,i,r?!1:p,r?!0:g,a),b=t._geometryLoaders.length;t._geometryLoaders.push(m);const x=m.load();t._loaderPromises.push(x),t._geometryCallbacks[b]=()=>{u.indexDatatype=m.indexDatatype,u.buffer=m.buffer,u.typedArray=m.typedArray};const E=new _.PrimitiveLoadPlan.IndicesLoadPlan(u);return E.loadBuffer=p,E.loadTypedArray=g,E}function l8(t,n,e,i){let o;_.defined(e)&&_.defined(e.featureIds)?o=e.featureIds:o=[];for(let r=0;r<o.length;r++){const a=o[r],s=`featureId_${r}`;let l;_.defined(a.texture)?l=C8(t,a,i,s):_.defined(a.attribute)?l=KS(a,s):l=ZS(a,s),n.featureIds.push(l)}}function u8(t,n,e,i){const{featureTables:o}=t.gltfJson.extensions.EXT_feature_metadata;let r=0;const a=e.featureIdAttributes;if(_.defined(a))for(let l=0;l<a.length;++l){const u=a[l],A=u.featureTable,c=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,d=`featureId_${r}`;r++;let p;_.defined(u.featureIds.attribute)?p=XS(u,c,f,d):p=$S(u,c,f,d),n.featureIds.push(p)}const s=e.featureIdTextures;if(_.defined(s))for(let l=0;l<s.length;++l){const u=s[l],A=u.featureTable,c=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,d=`featureId_${r}`;r++;const p=S8(t,u,c,i,f,d);n.featureIds.push(p)}}function c8(t,n){if(!_.defined(n))return;const{propertyTextures:e,propertyAttributes:i}=n;_.defined(e)&&(t.propertyTextureIds=e),_.defined(i)&&(t.propertyAttributeIds=i)}function h8(t,n,e){_.defined(e.featureTextures)&&(n.propertyTextureIds=e.featureTextures.map(function(i){return t._sortedFeatureTextureIds.indexOf(i)}))}function A8(t,n,e){const{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:a,roughnessFactor:s}=n,l=new LQ;return _.defined(i)&&(l.baseColorTexture=an(t,i,e,void 0)),_.defined(o)&&(l.metallicRoughnessTexture=an(t,o,e,void 0)),l.baseColorFactor=Mn(_.Cartesian4,r),l.metallicFactor=a,l.roughnessFactor=s,l}function f8(t,n,e){const{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:a}=n,s=new kQ;return _.defined(o)&&(s.specularTexture=an(t,o,e,void 0)),_.defined(a)&&(s.specularColorTexture=an(t,a,e,void 0)),s.specularFactor=i,s.specularColorFactor=Mn(_.Cartesian3,r),s}function p8(t,n,e){const{anisotropyStrength:i=Ov.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=Ov.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=n,a=new Ov;return _.defined(r)&&(a.anisotropyTexture=an(t,r,e,void 0)),a.anisotropyStrength=i,a.anisotropyRotation=o,a}function d8(t,n,e){const{clearcoatFactor:i=Lv.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=Lv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:a,clearcoatNormalTexture:s}=n,l=new Lv;return _.defined(o)&&(l.clearcoatTexture=an(t,o,e,void 0)),_.defined(a)&&(l.clearcoatRoughnessTexture=an(t,a,e,void 0)),_.defined(s)&&(l.clearcoatNormalTexture=an(t,s,e,void 0)),l.clearcoatFactor=i,l.clearcoatRoughnessFactor=r,l}function an(t,n,e,i){const o=t.gltfJson,r=_.GltfLoaderUtil.getImageIdFromTexture({gltf:o,textureId:n.index,supportedImageFormats:t._supportedImageFormats});if(!_.defined(r))return;const a=_.ResourceCache.getTextureLoader({gltf:o,textureInfo:n,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:e,asynchronous:t._asynchronous}),s=_.GltfLoaderUtil.createModelTextureReader({textureInfo:n}),l=t._textureLoaders.length;t._textureLoaders.push(a);const u=a.load().catch(A=>{if(!t.isDestroyed()){if(!t._incrementallyLoadTextures)throw A;t._textureState=Xr.FAILED,t._textureErrors.push(A)}});return t._texturesPromises.push(u),t._textureCallbacks[l]=()=>{s.texture=a.texture,_.defined(i)&&(s.texture.sampler=i)},s}function m8(t,n,e){const i=new SQ,o=n.joints;i.joints=o.map(a=>e[a]);const r=n.inverseBindMatrices;if(_.defined(r)){const a=t.gltfJson.accessors[r];i.inverseBindMatrices=yf(t,a,void 0)}else i.inverseBindMatrices=new Array(o.length).fill(_.Matrix4.IDENTITY);return i}function g8(t,n,e){const i=new FQ;i.name=n.name;const o=n.samplers.map(function(a,s){const l=E8(t,a);return l.index=s,l}),r=n.channels.map(function(a){return P8(a,o,e)});return i.samplers=o,i.channels=r,i}function y8(t){const n=new DQ;return n.name=t.name,n.stages=t.stages.map(T8),n}function v8(t){let n;return _.defined(t.scenes)&&_.defined(t.scene)&&(n=t.scenes[t.scene].nodes),n=n??t.nodes,n=_.defined(n)?n:[],n}function w8(t,n,e,i,o){const r=t.gltfJson.accessors,a=_.defined(e.ROTATION),s=_.defined(e.TRANSLATION)&&_.defined(r[e.TRANSLATION].min)&&_.defined(r[e.TRANSLATION].max),l=kv(t,_.InstanceAttributeSemantic,i),u=l.modelSemantic,A=u===_.InstanceAttributeSemantic.TRANSLATION||u===_.InstanceAttributeSemantic.ROTATION||u===_.InstanceAttributeSemantic.SCALE,c=u===_.InstanceAttributeSemantic.TRANSLATION,f=t._loadAttributesAsTypedArray||a&&A||!o.context.instancedArrays,d=t._enablePick&&!o.context.webgl2,p=!f,g=t._loadAttributesFor2D&&!o.scene3DOnly;return qS(t,n,l,void 0,void 0,void 0,p,f||c&&(!s||g||d),o)}function b8(t,n){const e=n.featureIds;for(let i=0;i<e.length;i++){const o=e[i],r=`instanceFeatureId_${i}`;let a;_.defined(o.attribute)?a=KS(o,r):a=ZS(o,r),t.featureIds.push(a)}}function x8(t,n,e,i){const o=t.extensions.EXT_feature_metadata.featureTables,r=e.featureIdAttributes;if(_.defined(r))for(let a=0;a<r.length;++a){const s=r[a],l=s.featureTable,u=i.indexOf(l),A=o[l].count,c=`instanceFeatureId_${a}`;let f;_.defined(s.featureIds.attribute)?f=XS(s,u,A,c):f=$S(s,u,A,c),n.featureIds.push(f)}}function yf(t,n,e){const i=new Array(n.count),o=n.bufferView;if(_.defined(o)){const r=B8(t,o),a=I8(t,r,n,e,i);return t._loaderPromises.push(a),i}return F8(n,i)}function qS(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,A=u.accessors[n],c=A.bufferView,f=e.gltfSemantic,d=e.renamedSemantic,p=e.modelSemantic,g=_.defined(p)?YS(d):void 0,y=M8(u,n,f,p,g);if(!_.defined(o)&&!_.defined(c)&&!_.defined(r))return y;const m=D8(t,n,f,i,o,r,a,s,l),b=t._geometryLoaders.length;t._geometryLoaders.push(m);const x=m.load();return t._loaderPromises.push(x),t._geometryCallbacks[b]=()=>{_.defined(o)&&_.defined(o.attributes)&&_.defined(o.attributes[f])?R8(y,m,a,s):_.defined(r)?U8(y,m,a,s):O8(u,A,y,m,a,s)},y}function _8(t,n,e,i,o,r,a){return _.ResourceCache.getIndexBufferLoader({gltf:t.gltfJson,accessorId:n,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:a,primitive:e,draco:i,asynchronous:t._asynchronous,loadBuffer:o,loadTypedArray:r})}function C8(t,n,e,i){const o=new GS;o.featureCount=n.featureCount,o.nullFeatureId=n.nullFeatureId,o.propertyTableId=n.propertyTable,o.label=n.label,o.positionalLabel=i;const r=n.texture;o.textureReader=an(t,r,e,_.Sampler.NEAREST);const s=(_.defined(r.channels)?r.channels:[0]).map(function(l){return"rgba".charAt(l)}).join("");return o.textureReader.channels=s,o}function KS(t,n){const e=new HS;return e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.propertyTableId=t.propertyTable,e.setIndex=t.attribute,e.label=t.label,e.positionalLabel=n,e}function ZS(t,n){const e=new WS;return e.propertyTableId=t.propertyTable,e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.label=t.label,e.positionalLabel=n,e.offset=0,e.repeat=1,e}function XS(t,n,e,i){const o=new HS,r=t.featureIds;return o.featureCount=e,o.propertyTableId=n,o.setIndex=YS(r.attribute),o.positionalLabel=i,o}function $S(t,n,e,i){const o=new WS,r=t.featureIds;o.propertyTableId=n,o.featureCount=e,o.offset=r.constant??0;const a=r.divisor??0;return o.repeat=a===0?void 0:a,o.positionalLabel=i,o}function S8(t,n,e,i,o,r){const a=new GS,s=n.featureIds,l=s.texture;return a.featureCount=o,a.propertyTableId=e,a.textureReader=an(t,l,i,_.Sampler.NEAREST),a.textureReader.channels=s.channels,a.positionalLabel=r,a}function E8(t,n){const e=new BQ,i=t.gltfJson.accessors,o=i[n.input];e.input=yf(t,o,void 0);const r=n.interpolation;e.interpolation=_.InterpolationType[r]??_.InterpolationType.LINEAR;const a=i[n.output];return e.output=yf(t,a,!0),e}function P8(t,n,e){const i=new IQ,o=t.sampler;return i.sampler=n[o],i.target=L8(t.target,e),i}function B8(t,n){const e=_.ResourceCache.getBufferViewLoader({gltf:t.gltfJson,bufferViewId:n,gltfResource:t._gltfResource,baseResource:t._baseResource});return t._bufferViewLoaders.push(e),e}function T8(t){const n=new MQ;n.name=t.name;const e=t.type.toUpperCase();return n.type=_.ArticulationStageType[e],n.minimumValue=t.minimumValue,n.maximumValue=t.maximumValue,n.initialValue=t.initialValue,n}async function I8(t,n,e,i,o){const{gltfJson:r}=t;if(await n.load(),t.isDestroyed())return;const a=JS(r,e,n.typedArray);i=i??!1,z8(e,a,o,i)}function F8(t,n){const e=t.type;if(e===_.AttributeType.SCALAR)return n.fill(0);const i=_.AttributeType.getMathType(e);return n.fill(i.clone(i.ZERO))}function YS(t){const e=/^\w+_(\d+)$/.exec(t);if(e!==null)return parseInt(e[1])}function M8(t,n,e,i,o){var c;const r=t.accessors[n],a=_.AttributeType.getMathType(r.type),s=r.normalized??!1,l=new wQ;l.name=e,l.semantic=i,l.setIndex=o,l.constant=k8(a),l.componentDatatype=r.componentType,l.normalized=s,l.count=r.count,l.type=r.type,l.min=Mn(a,r.min),l.max=Mn(a,r.max),l.byteOffset=r.byteOffset,l.byteStride=_.getAccessorByteStride(t,r),_.hasExtension(r,"WEB3D_quantized_attributes")&&Q8(r.extensions.WEB3D_quantized_attributes,l,a);const u=l.semantic===_.VertexAttributeSemantic.POSITION||l.semantic===_.VertexAttributeSemantic.NORMAL||l.semantic===_.VertexAttributeSemantic.TANGENT||l.semantic===_.VertexAttributeSemantic.TEXCOORD||l.semantic===_.VertexAttributeSemantic.FEATURE_ID||l.semantic===_.VertexAttributeSemantic.SCALE||l.semantic===_.VertexAttributeSemantic.ROTATION;return((c=t.extensionsRequired)==null?void 0:c.includes("KHR_mesh_quantization"))&&s&&u&&N8(l,a),l}function D8(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,c=u.accessors[n].bufferView;return _.ResourceCache.getVertexBufferLoader({gltf:u,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:l,bufferViewId:c,primitive:i,draco:o,spz:r,attributeSemantic:e,accessorId:n,asynchronous:t._asynchronous,loadBuffer:a,loadTypedArray:s})}function R8(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,t.quantization=n.quantization,e&&(t.buffer=n.buffer),i){const o=_.defined(n.quantization)?n.quantization.componentDatatype:t.componentDatatype;t.typedArray=_.ComponentDatatype.createArrayBufferView(o,n.typedArray.buffer)}}function U8(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,e&&(t.buffer=n.buffer),i&&_.defined(n.typedArray)&&(t.typedArray=_.ComponentDatatype.createArrayBufferView(t.componentDatatype,n.typedArray.buffer)),t.semantic===_.VertexAttributeSemantic.POSITION){const o=a=>{let s=1/0,l=-1/0,u=1/0,A=-1/0,c=1/0,f=-1/0;for(let d=0;d<a.length;d+=3){const p=a[d],g=a[d+1],v=a[d+2];s=Math.min(s,p),l=Math.max(l,p),u=Math.min(u,g),A=Math.max(A,g),c=Math.min(c,v),f=Math.max(f,v)}return[new _.Cartesian3(s,u,c),new _.Cartesian3(l,A,f)]},r=t.typedArray;[t.min,t.max]=o(r)}}function O8(t,n,e,i,o,r){if(o&&(e.buffer=i.buffer),r){const a=i.typedArray;e.typedArray=JS(t,n,a),o||(e.byteOffset=0,e.byteStride=void 0)}}function L8(t,n){const e=new TQ,i=t.node;if(!_.defined(i))return;e.node=n[i];const o=t.path.toUpperCase();return e.path=PQ[o],e}function JS(t,n,e){let i=n.byteOffset;const o=_.getAccessorByteStride(t,n),r=n.count,a=_.numberOfComponentsForType(n.type),s=n.componentType,l=_.ComponentDatatype.getSizeInBytes(s),u=l*a,A=r*a;if(o===u)return e=new Uint8Array(e),_.ComponentDatatype.createArrayBufferView(s,e.buffer,e.byteOffset+i,A);const c=_.ComponentDatatype.createTypedArray(s,A),f=new DataView(e.buffer),d=new Array(a),p=_.getComponentReader(n.componentType);i=e.byteOffset+i;for(let g=0;g<r;++g){p(f,i,a,l,d);for(let v=0;v<a;++v)c[g*a+v]=d[v];i+=o}return c}function z8(t,n,e,i){const o=t.type,r=t.count;if(o===_.AttributeType.SCALAR)for(let a=0;a<r;a++)e[a]=n[a];else if(o===_.AttributeType.VEC4&&i)for(let a=0;a<r;a++)e[a]=_.Quaternion.unpack(n,a*4);else{const a=_.AttributeType.getMathType(o),s=_.AttributeType.getNumberOfComponents(o);for(let l=0;l<r;l++)e[l]=a.unpack(n,l*s)}return e}function k8(t){return t===Number?0:new t}function Q8(t,n,e){const i=t.decodeMatrix,o=Mn(e,t.decodedMin),r=Mn(e,t.decodedMax);_.defined(o)&&_.defined(r)&&(n.min=o,n.max=r);const a=new _.ModelComponents.Quantization;a.componentDatatype=n.componentDatatype,a.type=n.type,i.length===4?(a.quantizedVolumeOffset=i[2],a.quantizedVolumeStepSize=i[0]):i.length===9?(a.quantizedVolumeOffset=new _.Cartesian2(i[6],i[7]),a.quantizedVolumeStepSize=new _.Cartesian2(i[0],i[4])):i.length===16?(a.quantizedVolumeOffset=new _.Cartesian3(i[12],i[13],i[14]),a.quantizedVolumeStepSize=new _.Cartesian3(i[0],i[5],i[10])):i.length===25&&(a.quantizedVolumeOffset=new _.Cartesian4(i[20],i[21],i[22],i[23]),a.quantizedVolumeStepSize=new _.Cartesian4(i[0],i[6],i[12],i[18])),n.quantization=a}const V8={VEC2:new _.Cartesian2(-1,-1),VEC3:new _.Cartesian3(-1,-1,-1),VEC4:new _.Cartesian4(-1,-1,-1,-1)};function N8(t,n){const e=H8(t.componentDatatype),i=V8[t.type];let o=t.min;_.defined(o)&&(o=n.divideByScalar(o,e,o),o=n.maximumByComponent(o,i,o));let r=t.max;_.defined(r)&&(r=n.divideByScalar(r,e,r),r=n.maximumByComponent(r,i,r)),t.min=o,t.max=r}function H8(t){switch(t){case _.ComponentDatatype.BYTE:return 127;case _.ComponentDatatype.UNSIGNED_BYTE:return 255;case _.ComponentDatatype.SHORT:return 32767;case _.ComponentDatatype.UNSIGNED_SHORT:return 65535;default:return 1}}function eE(t,n){if(!_.defined(n))return;const e=n.length;if(e===0)return;const i=t.length;t.length+=e;for(let o=0;o<e;o++)t[i+o]=n[o]}X6(),$6(),Y6(),nQ(),iQ(),rQ(),oQ(),Z6(),mQ(),gQ(),vQ(),VQ(),_.Camera.DEFAULT_VIEW_RECTANGLE=_.Rectangle.fromDegrees(70,5,140,55);function G8(){return new Promise((t,n)=>_.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class W8 extends h.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Dn(s);if(l&&(l.destroy(),Qv(s,void 0)),_.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(h.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=K6;await s.promise(G8());const A=await s.promise(h.createCancelablePromise(u(l,o)));A.scene._xbsjOriginSkyAtmosphere=A.scene.skyAtmosphere,A.scene._xbsjOriginSkyBox=A.scene.skyBox,A.clockViewModel.currentTime=_.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const c=_.JulianDate.fromDate(new Date(e.currentTime));_.JulianDate.equals(c,A.clockViewModel.currentTime)||(A.clockViewModel.currentTime=c)})),this.dispose(ui(A.clockViewModel,"currentTime",c=>{const f=_.JulianDate.toDate(A.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const c=new oE(A,e);Qv(A,c)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(A)}));a.start(n),a.errorEvent.don(s=>{console.error(s),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const j8=new _.EllipsoidTerrainProvider;class tE extends h.Destroyable{constructor(e){super();z(this,"_terrainMap",new Map);z(this,"_nextAnimateFrame",this.dv(h.createNextAnimateFrame()));z(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??j8}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const i=new h.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(h.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class nE extends h.Destroyable{constructor(e){super();z(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof yt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new h.Destroyable;{const r=o.dv(h.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof yt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof yt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,A)=>Number(A[1])-Number(u[1]))).forEach((u,A)=>{A instanceof yt&&A.czmDivPoi&&(A.czmDivPoi.zOrder=a),A instanceof ki&&A.canvasObj&&(A.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class q8 extends h.Destroyable{constructor(e){super();z(this,"_czmImageryLayerWrappers",new Set);z(this,"_zIndexChangedEvent",this.dv(new h.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??h.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??h.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class K8 extends h.Destroyable{constructor(e){super();z(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:i}=this,o=i.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class Z8 extends h.Destroyable{constructor(e){super();z(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new h.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new K8(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class X8 extends h.Destroyable{constructor(e,i){super();z(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new h.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new Z8(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class iE extends h.Destroyable{constructor(e){super();z(this,"_czmImageryWrappers",new Set);z(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new q8(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new X8(e,this))}has(e){for(let i of this.czmImageryWrappers)if(i.imagery===e)return!0;return!1}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class rE extends h.Destroyable{constructor(e){super();z(this,"_pause",this.disposeVar(h.react(!1)));z(this,"_pickPositionTasks",[]);z(this,"_pickTasks",[]);z(this,"pickHeightMustGreaterThanZero",!0);z(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[A,c,f,d]=u;try{(async()=>{const{scene:p,camera:g}=i,v=Ke(A),y=g.getPickRay(v);if(y){let E;if(c?E=await p.pickFromRayMostDetailed(y,this.objectsToExclude):E=p.pickFromRay(y,this.objectsToExclude),E&&E.position){const B=Ue(E.position);return B?f(B):d(new Error("positionFromCartesian failed"))}if(!(p.terrainProvider instanceof _.EllipsoidTerrainProvider)){const B=p.globe.pick(y,p);if(!B)return d(new Error("scene.globe.pick failed"));const P=Ue(B);return P?(this.pickHeightMustGreaterThanZero&&P[2]<0&&(P[2]=0),f(P)):d(new Error("positionFromCartesian failed"))}}const m=p.terrainProvider instanceof _.EllipsoidTerrainProvider?p.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,b=i.camera.pickEllipsoid(Ke(A),m);if(!b)return d(new Error("Pick failed"));const x=Ue(b);return x?f(x):d(new Error("positionFromCartesian failed"))})()}catch(p){d(p)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[A,c,f,d,p]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,B,P,I;let g=i.scene.pick(Ke(A),c&&c[0],c&&c[1]);!g&&_.defined(i.scene.globe)&&(g=await $8(i,Ke(A)));let v;if(g&&g instanceof _.Cesium3DTileFeature){v={};try{g&&g.getPropertyIds().forEach(M=>{v&&(v[M]=g.getProperty(M))})}catch(O){console.warn(O)}}if(!g){const{left:O,top:M}=e.container.getBoundingClientRect();g=(E=document.elementFromPoint(A[0]+O,A[1]+M))==null?void 0:E.closest("[data-es-scene-object-id]")}let y;g&&(g.id&&g.id instanceof _.Entity&&g.id.ESSceneObjectID?y=g.id.ESSceneObjectID:g.collection&&g.collection.ESSceneObjectID?y=g.collection.ESSceneObjectID:g.primitive&&g.primitive.ESSceneObjectID?y=g.primitive.ESSceneObjectID:Array.isArray(g)&&g[0]instanceof _.ImageryLayerFeatureInfo?y=g[0].imageryLayer.ESSceneObjectID:g instanceof HTMLElement&&(y=g.dataset.esSceneObjectId));let m=y?h.ESSceneObject.getSceneObject(y):void 0;m&&m.parentID&&(m=h.ESSceneObject.getSceneObject(m.parentID));let b={};if(m&&Reflect.has(m,"allowPicking")&&Reflect.has(m,"pickedEvent")&&(m.allowPicking??!1)){if(m instanceof h.ESEntityCluster){const O=new _.JulianDate;b=g.id instanceof _.Entity?{name:g.id.label.text.getValue(O),properties:(B=g.id.properties)==null?void 0:B.getValue(O),coordinates:Ma(g.id.position.getValue(O))}:(P=g.id)==null?void 0:P.map(M=>{var S;return{name:M.id,properties:(S=M.properties)==null?void 0:S.getValue(O),coordinates:Ma(M.position.getValue(O))}})}else if(m instanceof h.ESGeoJson){const O=new _.JulianDate;if(!g.id.entityCollection)return;const M=g.id.polygon?"Polygon":g.id.polyline?"LineString":"Point",S=((I=g.id.properties)==null?void 0:I.getValue(O))??{},T=M=="Point"?Ue(g.id.position.getValue(O)):M=="LineString"?g.id.polyline.positions.getValue(O).map(w=>Ue(w)):Gf(g.id.polygon.hierarchy.getValue(O));b=m.pickedInfoType=="FeatureCollection"?{type:"Feature",geometry:{type:M,coordinates:T},properties:S}:{type:M,coordinates:T,properties:S}}else if(m instanceof h.ESGltfModel){let O;Reflect.has(g,"featureId")?O=g.featureId:Reflect.has(g,"instanceId")&&(O=g.instanceId),O&&(g.id=g.primitive.structuralMetadata.getPropertyTable(0).getProperty(g.instanceId,"id"))}m.pickedEvent.emit(new h.ESJPickedResult(g,m,v,b,f,A))}m&&Reflect.has(m,"allowPicking")&&!m.allowPicking&&d(new h.ESJPickedResult);const x=new h.ESJPickedResult(g,m,v,b,f,A);d(x)})()}catch(g){p(g)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function $8(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(_.defined(o))return o}class Y8 extends h.Destroyable{constructor(e){super();z(this,"_enabled",this.disposeVar(h.react(!1)));z(this,"_cursorPosition",h.react(void 0));z(this,"quickPickPosition",!0);let i=new h.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Dn(e);if(!a)return;i=new h.Destroyable;const s=i.disposeVar(h.react(void 0)),l=i.disposeVar(h.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(A=>{A.pointerEvent&&(s.value=h.getDomEventCurrentTargetPos(A.pointerEvent))}));const u=i.disposeVar(h.createProcessingFromAsyncFunc(async A=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const c=await A.promise(h.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=c}else{const c=await A.promise(h.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=c}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function Dn(t){return h.getExtProp(t,"_viewerExtensions")}function Qv(t,n){h.setExtProp(t,"_viewerExtensions",n)}class oE extends h.Destroyable{constructor(e,i){super();z(this,"_imageriesManager");z(this,"_terrainManager");z(this,"_labelManager");z(this,"_pickingManager");z(this,"_poiContext");z(this,"_cursorPositionInfo");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new iE(this.viewer)),this._terrainManager=this.dv(new tE(this.viewer)),this._labelManager=this.dv(new nE(this.viewer)),this._poiContext=this.disposeVar(new V0(this._viewer)),this._cursorPositionInfo=this.disposeVar(new Y8(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new rE(i))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}}var sE=new _.Cartesian3,aE=new _.Cartesian3;function lE(t,n,e){let i=_.Matrix4.clone(t.transform);t.lookAtTransform(_.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=_.Cartesian3.normalize(r,sE),s=_.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=_.Cartesian3.cross(t.direction,a,aE);else var l=_.Cartesian3.cross(t.up,a,aE);var u=l;if(e){var A=_.Cartesian3.cross(a,l,sE);u=A}var c=_.Cartesian3.magnitude(r);t.rotate(u,n/c);var f=t.positionCartographic,d=f.longitude,p=f.latitude;_.Cartesian3.fromRadians(d,p,o,void 0,t.position),t.lookAtTransform(i)}function uE(t,n){lE(t,n,!1)}function cE(t,n){lE(t,-n,!0)}class J8 extends h.Destroyable{constructor(e){super();z(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),A=u-s;s=u;const c=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(A*c),a.MoveBackword&&r.moveBackward(A*c),a.MoveLeft&&r.moveLeft(A*c),a.MoveRight&&r.moveRight(A*c)):(a.MoveForward&&uE(r,A*c),a.MoveBackword&&uE(r,-A*c),a.MoveLeft&&cE(r,-A*c),a.MoveRight&&cE(r,A*c));{const{rotateSpeed:f}=this.controller,d=_.Math.toRadians(f*A);a.RotateRight?r.lookRight(d):a.RotateLeft?r.lookRight(-d):a.RotateUp?r.lookDown(-d):a.RotateDown&&r.lookDown(d)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class vf extends h.Destroyable{constructor(e){super();z(this,"_currentKeyIds",new Set);z(this,"_currentKeyIdsChanged",this.dv(new h.Event));z(this,"_debug",this.dv(h.react(!1)));z(this,"_debugResetting",this.dv(new h.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends h.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
|
|
3810
3810
|
`))};i(),this.d(e.currentKeyIdsChanged.don(i))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:i}=this._keyboardCameraControllerRunning;{const o=r=>{const a=vf.getKeyId(r);this._currentKeyIds.has(a)||(this._currentKeyIds.add(a),this._currentKeyIdsChanged.emit())};this.d(i.keyDownEvent.don(o))}{const o=r=>{const a=vf.getKeyId(r);this._currentKeyIds.has(a)&&(this._currentKeyIds.delete(a),this._currentKeyIdsChanged.emit())};this.d(i.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(i.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class eV extends h.Destroyable{constructor(e){super();z(this,"_keyStatus");z(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new vf(this)),this._cameraOp=this.dv(new J8(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const Ef=class Ef extends h.Destroyable{constructor(e){super();z(this,"_enabled",this.dv(h.react(!1)));z(this,"_keyStatusMap",this.dv(h.react(Ef.defaultKeyStatusMap)));z(this,"_speed",this.dv(h.react(1)));z(this,"_rotateSpeed",this.dv(h.react(.01)));z(this,"_alwaysWithCamera",this.dv(h.react(!1)));z(this,"_keyDownEvent",this.dv(new h.Event));z(this,"_keyUpEvent",this.dv(new h.Event));z(this,"_abortEvent",this.dv(new h.Event));this._firstPersonController=e,this.dv(new h.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new eV(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};z(Ef,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let wf=Ef;function tV(t,n){t.lookRight(_.Math.toRadians(n.movementX)*.1),t.lookDown(_.Math.toRadians(n.movementY)*.1);const e=t.pitch,i=_.Math.clamp(e,-_.Math.PI_OVER_TWO,_.Math.PI_OVER_TWO);i!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:i,roll:t.roll}})}class nV extends h.Destroyable{constructor(n,e){super(),this._firstPersonController=n,this._mouseCameraController=e;const{canvas:i}=this._firstPersonController.viewer;{const o=r=>{const{camera:a}=this._firstPersonController.viewer.scene;tV(a,r)};i.addEventListener("pointermove",o),this.dispose(()=>i.removeEventListener("pointermove",o))}}}const Pf=class Pf extends h.Destroyable{constructor(e){super();z(this,"_mouseMoving",this.dv(new nV(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:i}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=Pf.origin_setPointerCapture);const o=i.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const r=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",r,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",r,!1))}{const r=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",r)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};z(Pf,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Vv=Pf;class iV extends h.Destroyable{constructor(e){super();z(this,"_enabled",this.dv(h.react(!1)));z(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});z(this,"_mouseResetting",this.dv(new h.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Vv(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class rV extends h.Destroyable{constructor(e){super();z(this,"viewer");z(this,"_mouseCameraController",this.dv(new iV(this)));z(this,"_keyboardCameraController",this.dv(new wf(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function hE(t){t.removeInputAction(_.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(_.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(_.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(_.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(_.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(_.ScreenSpaceEventType.MIDDLE_UP)}function Nv(t,n,e,i=void 0){const r=t.camera,a=new _.Cartesian2;a.x=n.startPosition.x,a.y=0;const s=new _.Cartesian2;s.x=n.endPosition.x,s.y=0;let l=r.getPickRay(a,new _.Ray),u=r.getPickRay(s,new _.Ray),A=0,c,f;if(!l||!u)return;r.frustum instanceof _.OrthographicFrustum?(c=l.origin,f=u.origin,_.Cartesian3.add(r.direction,c,c),_.Cartesian3.add(r.direction,f,f),_.Cartesian3.subtract(c,r.position,c),_.Cartesian3.subtract(f,r.position,f),_.Cartesian3.normalize(c,c),_.Cartesian3.normalize(f,f)):(c=l.direction,f=u.direction);let d=_.Cartesian3.dot(c,f);d<1&&(A=Math.acos(d)),A=n.startPosition.x>n.endPosition.x?A:-A;const p=e._horizontalRotationAxis;if(_.defined(i)?r.look(i,-A):_.defined(p)?r.look(p,-A):r.lookLeft(A),a.x=0,a.y=n.startPosition.y,s.x=0,s.y=n.endPosition.y,l=r.getPickRay(a,new _.Ray),u=r.getPickRay(s,new _.Ray),A=0,!(!l||!u))if(r.frustum instanceof _.OrthographicFrustum?(c=l.origin,f=u.origin,_.Cartesian3.add(r.direction,c,c),_.Cartesian3.add(r.direction,f,f),_.Cartesian3.subtract(c,r.position,c),_.Cartesian3.subtract(f,r.position,f),_.Cartesian3.normalize(c,c),_.Cartesian3.normalize(f,f)):(c=l.direction,f=u.direction),d=_.Cartesian3.dot(c,f),d<1&&(A=Math.acos(d)),A=n.startPosition.y>n.endPosition.y?A:-A,i=_.defaultValue(i,p),_.defined(i)){const g=r.direction,v=_.Cartesian3.negate(i,new _.Cartesian3),y=_.Cartesian3.equalsEpsilon(g,i,_.Math.EPSILON2),m=_.Cartesian3.equalsEpsilon(g,v,_.Math.EPSILON2);if(!y&&!m){d=_.Cartesian3.dot(g,i);let b=_.Math.acosClamped(d);A>0&&A>b&&(A=b-_.Math.EPSILON4),d=_.Cartesian3.dot(g,v),b=_.Math.acosClamped(d),A<0&&-A>b&&(A=-b+_.Math.EPSILON4);const x=_.Cartesian3.cross(i,g,new _.Cartesian3);r.look(x,A)}else(y&&A<0||m&&A>0)&&r.look(r.right,-A)}else r.lookUp(A)}class oV extends h.Destroyable{constructor(n,e){super();const i=e.viewer;if(!i)throw new Error("viewer is undefined");let o=!0;this.d(n.positionChanged.don(()=>o=!0)),this.d(n.rotationChanged.don(()=>o=!0)),this.d(n.offsetHeightChanged.don(()=>o=!0)),this.d(n.viewDistanceChanged.don(()=>o=!0)),this.d(n.offsetRotationChanged.don(()=>o=!0)),this.d(n.relativeRotationChanged.don(()=>o=!0));const r=[0,0,0],a=[0,0,0];this.d(i.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!n.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(n.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const c=At(n.position),f=i.camera.positionWC,d=_.Cartesian3.distance(c,f);n.viewDistance=d}h.Vector.clone(n.position,a),n.offsetHeight&&(a[2]+=n.offsetHeight);const{rotation:s,offsetRotation:l=Mi.defaults.offsetRotation}=n,u=[...l];h.Vector.set(r,0,0,0),s&&(n.relativeRotation??Mi.defaults.relativeRotation)&&(h.Vector.add(s,r,r),u[0]+=90),h.Vector.add(u,r,r);const A={distance:n.viewDistance,heading:r[0],pitch:r[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(A,a)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(s=>{const l=s==null?void 0:s.pointerEvent;if(l&&n.enabledRotationInput&&(l.buttons===1||l.buttons===2)){const{movementX:u,movementY:A}=l;n.offsetRotation=h.Vector.add(n.offsetRotation??Mi.defaults.offsetRotation,[u*.2,A*-.2,0])}})),this.d(e.wheelEvent.don(s=>{if(!n.enabledScaleInput)return;const l=s.deltaY,A=Math.max(1,n.viewDistance)*(l*.001);n.viewDistance=n.viewDistance+A}))}}class Mi extends h.Destroyable{constructor(e){super();z(this,"_resetWithCameraEvent",this.dv(new h.Event));const i=e.viewer;if(!i)throw new Error("viewer is undefined");const o=this;let r;const a=()=>{r&&(r.destroy(),r=void 0)};this.d(a);const s=()=>{a(),o.enabled&&(r=new oV(o,e))};s(),this.d(o.enabledChanged.don(s)),this.d(o.resetWithCameraEvent.don(l=>{if(!e.actived)return;const u=os(i.camera);if(!u)return;const A=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?A[0]:90),u[1]-(o.relativeRotation?A[1]:0),u[2]-(o.relativeRotation?A[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}z(Mi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:h.reactArrayWithUndefined(void 0),rotation:h.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:h.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(Mi||(Mi={})),h.extendClassProps(Mi.prototype,Mi.createDefaultProps);class jl extends h.Destroyable{constructor(e){super();z(this,"_geoCameraController");z(this,"_geoPolylinePath");this._geoCameraController=this.dv(new Mi(e)),this._geoPolylinePath=this.dv(new Zs(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const i=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};i(),this.d(this._geoPolylinePath.currentPositionChanged.don(i)),this.d(this._geoPolylinePath.currentRotationChanged.don(i)),this.dispose(h.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(h.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(h.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(h.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(h.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(h.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new h.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new sV(this,e);if(this.lineMode==="manual")return new aV(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:h.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(jl||(jl={})),h.extendClassProps(jl.prototype,jl.createDefaultProps);class sV extends h.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");n.offsetRotation=[-90,0,0]}}class aV extends h.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=r=>{(r.key==="w"||r.key==="s")&&(n.polylinePath.playing=r.type==="keydown",n.polylinePath.speed=r.key==="w"||r.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class lV extends h.Destroyable{constructor(n,e){super();const i=e.positionPropertyName??"position",o=e.positionChangedPropertyName??i+"Changed",r=e.rotationPropertyName??"rotation",a=e.rotationChangedPropertyName??r+"Changed",s=(e.positionTracking??!0)&&Reflect.has(n,i)&&Reflect.has(n,o),l=(e.rotationTracking??!0)&&Reflect.has(n,r)&&Reflect.has(n,a);if(!(!s&&!l)){if(s){const u=()=>{e.geoCameraController.position=n[i]};u();const A=n[o];this.d(A.don(u))}if(l){const u=()=>{e.geoCameraController.rotation=n[r]};u();const A=n[o];this.d(A.don(u))}}}}class uV extends h.Destroyable{constructor(n,e){super();const i=this.dv(new h.ESSceneObjectWithId);i.id=n;const o=this.dv(h.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,i.sceneObjectChanged));this.disposeVar(new h.ObjResettingWithEvent(o,()=>{const{sceneObject:r}=i;if(!(!e.enabled||!r))return new lV(r,e)}))}}class ql extends h.Destroyable{constructor(e){super();z(this,"_geoCameraController");this._geoCameraController=this.dv(new Mi(e)),this.d(h.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new h.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new uV(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(ql||(ql={})),h.extendClassProps(ql.prototype,ql.createDefaultProps);class cV extends h.Destroyable{constructor(e){super();z(this,"height",1e7);z(this,"cycle",60);z(this,"latitude",6.632251044444445);z(this,"_running",!1);z(this,"_sseh");z(this,"_eventDisposer");z(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new _.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},_.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,i=e.positionCartographic;e.flyTo({destination:_.Cartesian3.fromRadians(i.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*_.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((r,a)=>{if(!o){o=new Date().getTime();return}const s=(new Date().getTime()-o)/1e3,l=e.positionCartographic.longitude+s*_.Math.PI*2/this.cycle;e.setView({destination:_.Cartesian3.fromRadians(l,this.latitude,this.height),orientation:{heading:0,pitch:-.5*_.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class hV extends h.Destroyable{constructor(e){super();z(this,"_height",this.dv(h.react(1e7)));z(this,"_cycle",this.dv(h.react(60)));z(this,"_latitude",this.dv(h.react(38)));z(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("未初始化viewer");this._inner=this.dv(new cV(i)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class AV extends h.Destroyable{constructor(e){super();z(this,"_position",this.dv(h.reactArrayWithUndefined(void 0)));z(this,"_distance",this.dv(h.react(5e4)));z(this,"_cycle",this.dv(h.react(60)));z(this,"_heading",this.dv(h.react(0)));z(this,"_pitch",this.dv(h.react(-30)));z(this,"_transform");z(this,"_headingRadius");z(this,"_pitchRadius");z(this,"_running",!1);z(this,"_sseh");z(this,"_eventDisposer");this._viewer=e;const i=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new _.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const r=()=>{let a;if(this.position==null){var s=o.getPickRay(new _.Cartesian2(i.canvas.width*.5,i.canvas.height*.5));if(!s)return;a=i.globe.pick(s,i)}else a=_.Cartesian3.fromDegrees(...this.position);a&&(this._transform=_.Transforms.eastNorthUpToFixedFrame(a),this.start())};r(),this.d(this.positionChanged.don(r))}{const r=()=>{this._headingRadius=_.Math.toRadians(this.heading)};r(),this.d(this.headingChanged.don(r))}{const r=()=>{this._pitchRadius=_.Math.toRadians(this.pitch)};r(),this.d(this.pitchChanged.don(r))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var i=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),r=new _.Cartesian3(0,i,o);e.flyTo({destination:_.Matrix4.multiplyByPoint(this._transform,r,new _.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let a;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,l)=>{if(!a){a=new Date().getTime();return}const u=(new Date().getTime()-a)/1e3;this._headingRadius+=u*_.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new _.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),a=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(_.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class fV extends h.Destroyable{constructor(e){super();z(this,"_position",this.dv(h.reactArrayWithUndefined(void 0)));z(this,"_distance",this.dv(h.react(5e4)));z(this,"_cycle",this.dv(h.react(60)));z(this,"_heading",this.dv(h.react(0)));z(this,"_pitch",this.dv(h.react(-30)));z(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("viewer is undefined");this._inner=this.dv(new AV(i));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class pV extends h.Destroyable{constructor(e){super();z(this,"_firstPersonController");z(this,"_rotateGlobe");z(this,"_rotatePoint");z(this,"_followController");z(this,"_pathCameraController");z(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new rV(e)),this.d(this._viewer.keyDownEvent.don(i=>this._firstPersonController.keyboardCameraController.keyDown(i))),this.d(this._viewer.keyUpEvent.don(i=>this._firstPersonController.keyboardCameraController.keyUp(i)));{const{subContainer:i}=this._viewer;if(!i)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();i.addEventListener("blur",o,!1),this.d(()=>i.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=wf.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var i;(i=this._viewer.subContainer)==null||i.focus()}))}this._rotateGlobe=this.dv(new hV(e)),this._rotatePoint=this.dv(new fV(e)),this._followController=this.dv(new ql(e)),this._pathCameraController=this.dv(new jl(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,i=4.2,o=1.6){this.resetNavigation();const r=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const a=this._viewer.getCameraInfo(),s=[(a==null?void 0:a.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(l=>{r?this._viewer.flyIn([e[0],e[1],(l??0)+o],s):this._viewer.viewer&&(this._viewer.viewer.camera.position=_.Cartesian3.fromDegrees(e[0],e[1],(l??0)+o)),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,i=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=i,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,i=5e4,o=60,r=0,a=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=i,this._rotatePoint.cycle=o,this._rotatePoint.heading=r,this._rotatePoint.pitch=a,this._rotatePoint.start()}changeToFollow(e,i=0,o=0,r=-30,a=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,r,0],this._followController.geoCameraController.relativeRotation=a,i!==0?this._followController.geoCameraController.viewDistance=i:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,i=10,o=10,r=!0,a=10,s="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const l=s==="auto",u=h.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:A}=u;if(!A)return;const c=h.getDistancesFromPositions(A,"NONE"),f=c[c.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...A],this._pathCameraController.polylinePath.duration=f/i*1e3,this._pathCameraController.polylinePath.loop=r,this._pathCameraController.offsetHeight=o;const d=x0(A);this._pathCameraController.polylinePath.rotationRadius=!l||d==!1?[0]:d.map(p=>p/a*i),this._pathCameraController.enabledRotationInput=!l,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=l,this._pathCameraController.lineMode=s,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const i=this._viewer.viewer;if(!i)return;this._handler||(this._handler=new _.ScreenSpaceEventHandler(i.scene.canvas));const o=this._handler,r=i.scene.screenSpaceCameraController;this.d(()=>{o&&hE(o)}),e=="Walk"||e=="RotateGlobe"?(r.lookEventTypes=void 0,r.rotateEventTypes=void 0,r.tiltEventTypes=void 0,r.zoomEventTypes=void 0,r.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},_.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(_.ScreenSpaceEventType.LEFT_UP)},_.ScreenSpaceEventType.LEFT_UP)},_.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},_.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(_.ScreenSpaceEventType.RIGHT_UP)},_.ScreenSpaceEventType.RIGHT_UP)},_.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},_.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(_.ScreenSpaceEventType.MIDDLE_UP)},_.ScreenSpaceEventType.MIDDLE_UP)},_.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&hE(o),r.lookEventTypes=_.CameraEventType.RIGHT_DRAG,r.rotateEventTypes=_.CameraEventType.LEFT_DRAG,r.tiltEventTypes=[_.CameraEventType.MIDDLE_DRAG,_.CameraEventType.PINCH,{eventType:_.CameraEventType.LEFT_DRAG,modifier:_.KeyboardEventModifier.CTRL},{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.CTRL}],r.translateEventTypes=_.CameraEventType.LEFT_DRAG,r.zoomEventTypes=[_.CameraEventType.WHEEL,_.CameraEventType.PINCH,{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.SHIFT}])}}const dV=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class mV extends h.Destroyable{constructor(e){super();z(this,"_show",this.dv(h.react(!1)));z(this,"cloudsPostProcess");const i=e.viewer;if(!i)throw new Error("Cesium Viewer is not initialized");const o=new _.CloudCollection;i.scene.primitives.add(o),this.dispose(()=>i.scene.primitives.remove(o));{const r=()=>{o.show=this.show};r(),this.dispose(this.showChanged.disposableOn(r))}{const r=s=>({slice:s.slice,brightness:s.brightness,scale:Ke(s.scale),maximumSize:Xn(s.maximumSize),color:Be(s.color),position:At(s.position)});(()=>{o.removeAll();for(let s of dV)o.add(r(s))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class Kl extends h.Destroyable{constructor(n){super();const e=n.viewer;if(!e){console.warn("viewer is undefined!");return}const i=e.scene.postProcessStages.add(_.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(i));{const o=()=>{i.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{i.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{i.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{i.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{i.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(Kl||(Kl={})),h.extendClassProps(Kl.prototype,Kl.createDefaultProps);const gV=`
|
|
3811
3811
|
float getDistance(sampler2D depthTexture, vec2 texCoords)
|
|
3812
3812
|
{
|
|
@@ -4020,7 +4020,7 @@ void main (void)
|
|
|
4020
4020
|
out_FragColor = color;
|
|
4021
4021
|
// ------------------ skybox vtxf end -------------------
|
|
4022
4022
|
}
|
|
4023
|
-
`,Yr=_.Cartesian3,MV=_.defaultValue,ir=_.defined,DV=_.destroyObject,RV=_.Ellipsoid,dE=_.EllipsoidGeometry,UV=_.GeometryPipeline,ba=_.Math,rr=_.Matrix4,OV=_.VertexFormat,LV=_.BufferUsage,zV=_.DrawCommand,kV=_.RenderState,QV=_.ShaderProgram,mE=_.ShaderSource,VV=_.VertexArray,gE=_._shadersAtmosphereCommon,yE=_._shadersSkyAtmosphereCommon,NV=_._shadersSkyAtmosphereVS,HV=_.Axis,GV=_.BlendingState,WV=_.CullFace,vE=_.SceneMode,xf=_.Transforms,jV=_.Matrix3,wE=_.DeveloperError,qV=_.loadCubeMap,KV=_.CubeMap;function xa(t,n){t=MV(t,RV.WGS84),this.show=!0,this.sources=n,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,i=Yr.multiplyByScalar(t.radii,e,new Yr);this._scaleMatrix=rr.fromScale(i),this._modelMatrix=new rr,this._command=new zV({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new Yr(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new Yr(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new Yr;const o=new Yr;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy},u_rotateMatrix:function(){return r._scratchRoateMatrix=r._scratchRoateMatrix||new jV,rr.getMatrix3(r._eunMatrix||rr.IDENTITY,r._scratchRoateMatrix)},u_cubeMap:function(){return r._cubeMap}}}Object.defineProperties(xa.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),xa.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const Gv=new rr;xa.prototype.update=function(t,n){if(!this.show)return;const e=t.mode;if(e!==vE.SCENE3D&&e!==vE.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const p=t.context;var i=this;this._sources=this.sources;var o=this.sources;if(!ir(o.positiveX)||!ir(o.negativeX)||!ir(o.positiveY)||!ir(o.negativeY)||!ir(o.positiveZ)||!ir(o.negativeZ))throw new wE("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new wE("this.sources properties must all be the same type.");typeof o.positiveX=="string"?qV(p,this._sources).then(function(g){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=g}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new KV({context:p,source:o}))}const r=rr.fromRotationTranslation(t.context.uniformState.inverseViewRotation,Yr.ZERO,Gv),a=rr.multiplyTransformation(r,HV.Y_UP_TO_Z_UP,Gv),s=rr.multiply(this._scaleMatrix,a,Gv);rr.clone(s,this._modelMatrix);const l=t.context,u=ZV(this),A=t.globeTranslucencyState.translucent,c=this.perFragmentAtmosphere||A||!ir(n)||!n.show,f=this._command;if(xf.eastUpNorthToFixedFrame=xf.eastUpNorthToFixedFrame||xf.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=xf.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!ir(f.vertexArray)){const p=dE.createGeometry(new dE({radii:new Yr(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:OV.POSITION_ONLY}));f.vertexArray=VV.fromGeometry({context:l,geometry:p,attributeLocations:UV.createAttributeLocations(p),bufferUsage:LV.STATIC_DRAW}),f.renderState=kV.fromCache({cull:{enabled:!0,face:WV.FRONT},blending:GV.ALPHA_BLEND,depthMask:!1})}const d=u|c<<2|A<<3;if(d!==this._flags){this._flags=d;const p=[];u&&p.push("COLOR_CORRECT"),c&&p.push("PER_FRAGMENT_ATMOSPHERE"),A&&p.push("GLOBE_TRANSLUCENT");const g=new mE({defines:p,sources:[gE,yE,NV]}),v=new mE({defines:p,sources:[gE,yE,FV]});this._spSkyAtmosphere=QV.fromCache({context:l,vertexShaderSource:g,fragmentShaderSource:v}),f.shaderProgram=this._spSkyAtmosphere}if(ir(this._cubeMap))return f};function ZV(t){return!(ba.equalsEpsilon(t.hueShift,0,ba.EPSILON7)&&ba.equalsEpsilon(t.saturationShift,0,ba.EPSILON7)&&ba.equalsEpsilon(t.brightnessShift,0,ba.EPSILON7))}xa.prototype.isDestroyed=function(){return!1},xa.prototype.destroy=function(){const t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),DV(this)};const Fa=class Fa extends h.Destroyable{constructor(e,i){super();z(this,"_navigationManager");z(this,"_envManager");z(this,"_reu",(e,i)=>h.registerEventUpdate(this,e,i));this._czmViewer=e,this._viewer=i;const o=this.viewer,r=this.czmViewer,a=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new pV(r)),this._envManager=this.dv(new CV(r)),this.disposeVar(new h.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new Fa.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new h.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const s=pE(this._czmViewer.xbsjLocalBoxSources);if(s)return new Fa.LocalSkyBoxResetting(this._czmViewer,this._viewer,s)}));{this._reu(r.disabledInputStackChanged,()=>{const l=r.disabledInputStack===0;a.enableInputs=l,a.enableTranslate=l,a.enableZoom=l,a.enableRotate=l,a.enableTilt=l,a.enableLook=l});class s extends h.Destroyable{constructor(){super(),r.incrementDisabledInputStack(),this.dispose(()=>r.decrementDisabledInputStack())}}this.disposeVar(new h.ObjResettingWithEvent(r.sceneSsccEnableInputsChanged,()=>r.sceneSsccEnableInputs??!0?void 0:new s))}this.d(o.scene.camera.changed.addEventListener(()=>r.cameraChanged.emit()));{const s=()=>{const l=rt.latestDefaultAccessToken??rt.currentDefaultAccessToken;_.Ion.defaultAccessToken=r.ionAccessToken===""?l:r.ionAccessToken};s(),this.dispose(r.ionAccessTokenChanged.disposableOn(s))}{const{scene:s}=o,l=()=>{if(s.globe.show=r.globeShow??!0,"fov"in s.camera.frustum){const A=s.camera.frustum.aspectRatio;if(!A){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}s.camera.frustum.fov=_.Math.toRadians(A>=1?r.fov:r.fov/A)}};l();const u=this.dv(h.createNextAnimateFrameEvent(r.globeShowChanged,r.fovChanged));this.d(u.don(l))}o.clockViewModel.currentTime=_.JulianDate.fromDate(new Date(r.currentTime)),this.dispose(r.currentTimeChanged.disposableOn(()=>{if(r.currentTime===void 0)return;const s=_.JulianDate.fromDate(new Date(r.currentTime));_.JulianDate.equals(s,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=s)})),this.dispose(ui(o.clockViewModel,"currentTime",s=>{const l=_.JulianDate.toDate(o.clockViewModel.currentTime).getTime();l!==r.currentTime&&(r.currentTime=l)}));{let s=_.getTimestamp(),l=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=_.getTimestamp();l++;var A=u-s;A>1e3&&(r._fps.value=l*1e3/A|0,s=u,l=0)}))}{const s=new _.SunLight,l=new _.DirectionalLight({direction:o.scene.camera.directionWC});class u extends h.Destroyable{constructor(){super();const c=r.flashLighting??!1;o.scene.light=c?l:s,c&&this.dispose(o.scene.preRender.addEventListener(function(f,d){l.direction=_.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new h.ObjResettingWithEvent(r.flashLightingChanged,()=>new u))}{const{scene:s}=o,{screenSpaceCameraController:l,globe:u}=s,A=(p,g)=>h.registerEventUpdate(this,p,g),c=rt.defaults,f=(p,g)=>A(r[p+"Changed"],()=>{if(!Reflect.has(r,p))throw new Error(`!Reflect.has(czmViewer, ${p})`);if(!Reflect.has(c,p))throw new Error(`!Reflect.has(CzmViewer.defaults, ${p})`);g(r[p]??c[p])}),d=(p,g)=>A(r[p+"Changed"],()=>{if(!Reflect.has(r,p))throw new Error(`!Reflect.has(czmViewer, ${p})`);g(r[p])});f("splitPosition",p=>o.scene.splitPosition=p),f("resolutionScale",p=>o.resolutionScale=p),f("msaaSamples",p=>o.scene.msaaSamples=p),d("shadows",p=>o.shadows=p),f("scenePpsfxaaEnabled",p=>s.postProcessStages.fxaa.enabled=p),d("scenePpsAmbientOcclusionEnabled",p=>s.postProcessStages.ambientOcclusion.enabled=p),d("scenePpsAmbientOcclusionAmbientOcclusionOnly",p=>s.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=p),d("scenePpsAmbientOcclusionIntensity",p=>s.postProcessStages.ambientOcclusion.uniforms.intensity=p),d("scenePpsAmbientOcclusionBias",p=>s.postProcessStages.ambientOcclusion.uniforms.bias=p),d("scenePpsAmbientOcclusionLengthCap",p=>s.postProcessStages.ambientOcclusion.uniforms.lengthCap=p),d("scenePpsAmbientOcclusionStepSize",p=>s.postProcessStages.ambientOcclusion.uniforms.stepSize=p),d("scenePpsAmbientOcclusionBlurStepSize",p=>s.postProcessStages.ambientOcclusion.uniforms.blurStepSize=p),d("scenePpsBloomEnabled",p=>s.postProcessStages.bloom.enabled=p),d("scenePpsBloomGlowOnly",p=>s.postProcessStages.bloom.uniforms.glowOnly=p),d("scenePpsBloomContrast",p=>s.postProcessStages.bloom.uniforms.contrast=p),d("scenePpsBloomBrightness",p=>s.postProcessStages.bloom.uniforms.brightness=p),d("scenePpsBloomDelta",p=>s.postProcessStages.bloom.uniforms.delta=p),d("scenePpsBloomSigma",p=>s.postProcessStages.bloom.uniforms.sigma=p),d("scenePpsBloomStepSize",p=>s.postProcessStages.bloom.uniforms.stepSize=p),f("globeShow",p=>s.globe.show=p),f("depthTestAgainstTerrain",p=>{s.globe.depthTestAgainstTerrain=p}),s.globe.translucency.enabled=!0,f("terrainOpacity",p=>{s.globe.translucency.frontFaceAlpha=s.globe.translucency.backFaceAlpha=h.clamp(p,0,1)}),f("sceneGlobeShadows",p=>s.globe.shadows=_.ShadowMode[p]),d("sceneGlobeTerrainExaggeration",p=>s.globe.terrainExaggeration=p),d("sceneGlobeTerrainExaggerationRelativeHeight",p=>s.globe.terrainExaggerationRelativeHeight=p),d("sceneGlobeVerticalExaggeration",p=>s.globe.verticalExaggeration=p),d("sceneGlobeVerticalExaggerationRelativeHeight",p=>s.globe.verticalExaggerationRelativeHeight=p),d("sceneGlobeBackFaceCulling",p=>s.globe.backFaceCulling=p),d("sceneGlobeShowSkirts",p=>s.globe.showSkirts=p),d("sceneGlobeShowWaterEffect",p=>s.globe.showWaterEffect=p),d("sceneGlobeBaseColor",p=>s.globe.baseColor=Be(p)),d("sceneGlobeCartographicLimitRectangle",p=>s.globe.cartographicLimitRectangle=dt(p)),d("sceneGlobeClippingPlanes",p=>{if(!s.globe.clippingPlanes){s.globe.clippingPlanes=Ra(p??{enabled:!1});return}jc(s.globe.clippingPlanes,p)}),d("sceneGlobeClippingPolygons",p=>{s.globe.clippingPolygons=p?qc(p):void 0}),f("sceneSunGlowFactor",p=>s.sun&&(s.sun.glowFactor=p)),f("moon",p=>s.moon&&(s.moon.show=p)),f("sceneMoonOnlySunLighting",p=>s.moon&&(s.moon.onlySunLighting=p)),f("sceneMoonTextureUrl",p=>s.moon&&(s.moon.textureUrl=h.ESSceneObject.context.getStrFromEnv(p))),d("sceneSkyBoxShow",p=>s._xbsjOriginSkyBox.show=p),f("sceneSkyBoxSources",p=>s._xbsjOriginSkyBox.sources=p&&pE(p)),d("atmosphere",p=>o.scene._xbsjOriginSkyAtmosphere.show=p),d("sceneBackgroundColor",p=>o.scene.backgroundColor=Be(p)),f("sceneFogEnabled",p=>s.fog.enabled=p),f("sceneFogDensity",p=>s.fog.density=p),f("sceneFogScreenSpaceErrorFactor",p=>s.fog.screenSpaceErrorFactor=p),f("sceneFogMinimumBrightness",p=>s.fog.minimumBrightness=p),f("sceneDebugShowFramesPerSecond",p=>s.debugShowFramesPerSecond=p),f("sceneDebugShowCommands",p=>s.debugShowCommands=p),f("sceneDebugShowFrustums",p=>s.debugShowFrustums=p),f("sceneDebugShowFrustumPlanes",p=>s.debugShowFrustumPlanes=p),f("sceneDebugShowDepthFrustum",p=>s.debugShowDepthFrustum=p),f("sceneGlobeUndergroundColor",p=>u.undergroundColor=Be(p)),f("sceneGlobeUndergroundColorAlphaByDistance",p=>u.undergroundColorAlphaByDistance=ur(p)),f("sceneGlobeTranslucencyEnabled",p=>u.translucency.enabled=p),f("sceneGlobeTranslucencyBackFaceAlpha",p=>u.translucency.backFaceAlpha=p),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",p=>u.translucency.backFaceAlphaByDistance=p&&ur(p)),f("sceneGlobeTranslucencyFrontFaceAlpha",p=>u.translucency.frontFaceAlpha=p),d("sceneGlobeTranslucencyFrontFaceAlphaByDistance",p=>u.translucency.frontFaceAlphaByDistance=p&&ur(p)),f("sceneGlobeTranslucencyRectangle",p=>u.translucency.rectangle=dt(p)),f("sceneSplitPosition",p=>s.splitPosition=h.clamp(p,0,1)),f("sceneSsccEnableCollisionDetection",p=>s.screenSpaceCameraController.enableCollisionDetection=p),f("sceneSsccZoomFactor",p=>s.screenSpaceCameraController._zoomFactor=p);{const p=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=r.showCesiumInspector??!1?"block":"none")};p(),this.d(r.showCesiumInspectorChanged.don(p))}f("cesiumInspectorWireframe",p=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=p)});{const p=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=r.showCesium3DTilesInspector??!1?"block":"none")};p(),this.dispose(r.showCesium3DTilesInspectorChanged.disposableOn(p))}this.ad(new h.ObjResettingWithEvent(r.particleGlobalControlChanged,()=>{if(!r.particleGlobalControl)return new Uv}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};z(Fa,"BackGroundResetting",class extends h.Destroyable{constructor(i,o){super(),this._czmViewer=i,this._viewer=o;const r=new bf;r.material=_.Material.fromType("Image");const a=this._viewer;a.scene.skyBox=r,this.dispose(()=>a.scene.skyBox=a.scene._xbsjOriginSkyBox);{const s=()=>{r.show=this._czmViewer.sceneSkyBoxShow};s(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.color=Be(this._czmViewer.xbsjBackgroundColor)};s(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};s(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(s))}}}),z(Fa,"LocalSkyBoxResetting",class extends h.Destroyable{constructor(o,r,a){super();z(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=r,this._sources=a,this._skyAtmosphere=new xa(void 0,this._sources);const s=this._viewer;s.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>s.scene.skyAtmosphere=s.scene._xbsjOriginSkyAtmosphere);{const l=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};l(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(l))}}get skyAtmosphere(){return this._skyAtmosphere}});let Wv=Fa;function XV(t,n,e,i,o){var r=_.Cartesian3.subtract(t,e,new _.Cartesian3),a=_.Cartesian3.dot(r,n);if(!(a<=0))return a*Math.tan(i*.5)*2/o}async function $V(t){const{viewer:n}=t;if(!n)return;const{width:e,height:i}=n.canvas,o=t.quickPickPosition([e*.5,i*.5]);if(!o)return;const r=await o;if(!r)return;const a=_.Cartesian3.fromDegrees(...r);if(!a)return;const s=n.camera.positionWC,l=n.camera.directionWC,u=n.camera.frustum.fovy;if(u===void 0)return;const A=n.canvas.height;return[XV(a,l,s,u,A),r]}const YV=_.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function JV(t){return-Math.log2(t/YV)}var jv=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function e3(t){const n=t|0;if(n<1||n>1e8)return;let e=-1;for(;n>=jv[++e];);const i=n/jv[e-1]|0;return[i*jv[e-1],i,e]}class t3 extends h.Destroyable{constructor(){super();z(this,"_lengthInPixels",this.disposeVar(h.react(100)));z(this,"_resolution",this.disposeVar(h.react(void 0)));z(this,"_computedLengthInPixels",this.disposeVar(h.react(void 0)));z(this,"_computedLengthInMeters",this.disposeVar(h.react(void 0)));z(this,"_computedLengthInStr",this.disposeVar(h.react(void 0)));{const e=()=>{let i,o;const{lengthInPixels:r,resolution:a}=this;if(r&&a){const s=e3(r*a);if(s){const[l,u,A]=s;o=l,i=l/a}}this._computedLengthInPixels.value=i,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const i=this.computedLengthInMeters;if(!i){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=i>1e3?`${i/1e3|0}km`:`${i}m`};e(),this.dispose(this.computedLengthInMetersChanged.disposableOn(e))}}get lengthInPixels(){return this._lengthInPixels.value}set lengthInPixels(e){this._lengthInPixels.value=e}get lengthInPixelsChanged(){return this._lengthInPixels.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get computedLengthInPixels(){return this._computedLengthInPixels.value}get computedLengthInPixelsChanged(){return this._computedLengthInPixels.changed}get computedLengthInMeters(){return this._computedLengthInMeters.value}get computedLengthInMetersChanged(){return this._computedLengthInMeters.changed}get computedLengthInStr(){return this._computedLengthInStr.value}get computedLengthInStrChanged(){return this._computedLengthInStr.changed}}class n3 extends h.Destroyable{constructor(e){super();z(this,"_enabled",this.dv(h.react(!0)));z(this,"_resolution",this.dv(h.react(void 0)));z(this,"_center",this.dv(h.react(void 0)));z(this,"_zoom",this.dv(h.react(void 0)));z(this,"_legend",this.dv(new t3));this._czmViewer=e;{const i=this.dv(h.createProcessingFromAsyncFunc(async o=>{let r,a,s;await o.promise(h.sleep(1e3));const l=await o.promise($V(this._czmViewer));if(l){const[u,A]=l;r=u,a=JV(u),s=A}this._resolution.value=r,this._zoom.value=a,this._center.value=s}));i.restart();{const o=()=>{this.enabled?i.restart():i.cancel()};o();const r=this.dv(h.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(r.disposableOn(o))}}{const i=()=>{this._legend.resolution=this.resolution};i(),this.dispose(this.resolutionChanged.disposableOn(i))}}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get center(){return this._center.value}get centerChanged(){return this._center.changed}get zoom(){return this._zoom.value}get zoomChanged(){return this._zoom.changed}get legend(){return this._legend}get length(){return(this.legend.computedLengthInMeters??-1)/(this.legend.computedLengthInPixels??1)}}function i3(t,n){try{const e=_.Ellipsoid.WGS84,i=e.scaleToGeodeticSurface(t);return n=_.Transforms.eastNorthUpToFixedFrame(i,e,n),n}catch{return _.Matrix4.clone(_.Matrix4.IDENTITY,n)}}const{combine:r3}=_,{ShaderDestination:qo}=_,bE={name:"FlattenedPipelineStage"};bE.process=function(t,n,e){if(n.xbsjFlattened){const i=t.shaderBuilder;i.addDefine("XBSJ_FLATTERN",void 0,qo.BOTH),i.addUniform("sampler2D","u_flattenedPolygonTexture",qo.BOTH),i.addUniform("vec4","u_flattenedBound",qo.BOTH),i.addUniform("bool","u_flattened",qo.BOTH),i.addUniform("mat4","u_inverseModelElevationMatrix",qo.BOTH),i.addUniform("mat4","u_inverseElevationModelMatrix",qo.BOTH),i.addUniform("bool","u_flattenDiscard",qo.BOTH);const o={u_flattenedBound:function(){return n.xbsjFlattenedBound??_.Cartesian4.ZERO},u_flattened:function(){return n.xbsjFlattened},u_inverseModelElevationMatrix:function(){const r=e.context.uniformState.inverseModel??_.Matrix4.IDENTITY;return n._uniformElevationInverseModelMatrix=_.Matrix4.multiply(r,n.xbsjElevationMatrix??_.Matrix4.IDENTITY,n._uniformElevationInverseModelMatrix??new _.Matrix4),n._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const r=e.context.uniformState.model??_.Matrix4.IDENTITY;return n._uniformInverseElevationModelMatrix=_.Matrix4.multiply(n.xbsjElevationMatrixInv??_.Matrix4.IDENTITY,r,n._uniformInverseElevationModelMatrix??new _.Matrix4),n._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return n.xbsjGetFlattenedTextureFunc?n.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=r3(o,t.uniformMap)}};function xE(){Object.defineProperties(_.Model.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){t!==this._xbsjFlattened&&this.resetDrawCommands(),this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){t!==this._xbsjElevationMatrix&&this.resetDrawCommands(),this._xbsjElevationMatrix=t,this._xbsjElevationMatrixInv=this._xbsjElevationMatrix&&_.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new _.Matrix4)}},xbsjElevationMatrixInv:{get:function(){return this._xbsjElevationMatrixInv}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){t!==this._xbsjFlattenedBound&&this.resetDrawCommands(),this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){t!==this._xbsjGetFlattenedTextureFunc&&this.resetDrawCommands(),this._xbsjGetFlattenedTextureFunc=t}}})}function _E(){Object.defineProperties(_.Cesium3DTileset.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){this._xbsjElevationMatrix=t}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){this._xbsjGetFlattenedTextureFunc=t}}})}function CE(){const t=_.Model3DTileContent.prototype.update;_.Model3DTileContent.prototype.update=function(n,e,...i){const o=this._model;return o.xbsjFlattened=n.xbsjFlattened,o.xbsjElevationMatrix=n.xbsjElevationMatrix,o.xbsjFlattenedBound=n.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=n.xbsjGetFlattenedTextureFunc,t.call(this,n,e,...i)}}function SE(){const t=_.ModelSceneGraph.prototype.configurePipeline;_.ModelSceneGraph.prototype.configurePipeline=function(n,...e){const i=t.call(this,n,...e),o=this._model,r=this.modelPipelineStages;return o.xbsjFlattened&&r.push(bE),i}}xE(),_E(),CE(),SE();const o3=()=>({createCesiumViewerFuncStr:void 0,flashLighting:void 0,resolutionScale:void 0,msaaSamples:void 0,shadows:!1,sceneSplitPosition:void 0,sceneGlobeShadows:void 0,sceneGlobeTerrainExaggeration:1,sceneGlobeTerrainExaggerationRelativeHeight:0,sceneGlobeVerticalExaggeration:1,sceneGlobeVerticalExaggerationRelativeHeight:0,sceneGlobeBackFaceCulling:!0,sceneGlobeShowSkirts:!0,sceneGlobeShowWaterEffect:!0,sceneGlobeBaseColor:h.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:h.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:h.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:h.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:h.reactArray([]),sceneGlobeUndergroundColor:h.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:h.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyEnabled:void 0,sceneGlobeTranslucencyBackFaceAlpha:void 0,sceneGlobeTranslucencyBackFaceAlphaByDistance:h.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlpha:void 0,sceneGlobeTranslucencyFrontFaceAlphaByDistance:h.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:h.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:h.reactJson(rt.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:h.reactArray([1,1,1,1]),xbsjLocalBoxSources:h.reactJsonWithUndefined(void 0),sceneBackgroundColor:h.reactArray([0,0,0,0]),sceneFogEnabled:void 0,sceneFogDensity:void 0,sceneFogScreenSpaceErrorFactor:void 0,sceneFogMinimumBrightness:void 0,sceneSsccEnableInputs:void 0,sceneSsccEnableCollisionDetection:void 0,sceneSsccZoomFactor:void 0,scenePpsfxaaEnabled:void 0,scenePpsAmbientOcclusionEnabled:!1,scenePpsAmbientOcclusionAmbientOcclusionOnly:!1,scenePpsAmbientOcclusionIntensity:3,scenePpsAmbientOcclusionBias:.1,scenePpsAmbientOcclusionLengthCap:.03,scenePpsAmbientOcclusionStepSize:1,scenePpsAmbientOcclusionBlurStepSize:.86,scenePpsBloomEnabled:!1,scenePpsBloomGlowOnly:!1,scenePpsBloomContrast:128,scenePpsBloomBrightness:-.3,scenePpsBloomDelta:1,scenePpsBloomSigma:3.78,scenePpsBloomStepSize:5,sceneDebugShowFramesPerSecond:void 0,sceneDebugShowCommands:void 0,sceneDebugShowFrustums:void 0,sceneDebugShowFrustumPlanes:void 0,sceneDebugShowDepthFrustum:void 0,showCesiumInspector:void 0,cesiumInspectorWireframe:void 0,showCesium3DTilesInspector:void 0,particleGlobalControl:!1}),s3=`
|
|
4023
|
+
`,Yr=_.Cartesian3,MV=_.defaultValue,ir=_.defined,DV=_.destroyObject,RV=_.Ellipsoid,dE=_.EllipsoidGeometry,UV=_.GeometryPipeline,ba=_.Math,rr=_.Matrix4,OV=_.VertexFormat,LV=_.BufferUsage,zV=_.DrawCommand,kV=_.RenderState,QV=_.ShaderProgram,mE=_.ShaderSource,VV=_.VertexArray,gE=_._shadersAtmosphereCommon,yE=_._shadersSkyAtmosphereCommon,NV=_._shadersSkyAtmosphereVS,HV=_.Axis,GV=_.BlendingState,WV=_.CullFace,vE=_.SceneMode,xf=_.Transforms,jV=_.Matrix3,wE=_.DeveloperError,qV=_.loadCubeMap,KV=_.CubeMap;function xa(t,n){t=MV(t,RV.WGS84),this.show=!0,this.sources=n,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,i=Yr.multiplyByScalar(t.radii,e,new Yr);this._scaleMatrix=rr.fromScale(i),this._modelMatrix=new rr,this._command=new zV({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new Yr(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new Yr(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new Yr;const o=new Yr;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy},u_rotateMatrix:function(){return r._scratchRoateMatrix=r._scratchRoateMatrix||new jV,rr.getMatrix3(r._eunMatrix||rr.IDENTITY,r._scratchRoateMatrix)},u_cubeMap:function(){return r._cubeMap}}}Object.defineProperties(xa.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),xa.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const Gv=new rr;xa.prototype.update=function(t,n){if(!this.show)return;const e=t.mode;if(e!==vE.SCENE3D&&e!==vE.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const p=t.context;var i=this;this._sources=this.sources;var o=this.sources;if(!ir(o.positiveX)||!ir(o.negativeX)||!ir(o.positiveY)||!ir(o.negativeY)||!ir(o.positiveZ)||!ir(o.negativeZ))throw new wE("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new wE("this.sources properties must all be the same type.");typeof o.positiveX=="string"?qV(p,this._sources).then(function(g){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=g}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new KV({context:p,source:o}))}const r=rr.fromRotationTranslation(t.context.uniformState.inverseViewRotation,Yr.ZERO,Gv),a=rr.multiplyTransformation(r,HV.Y_UP_TO_Z_UP,Gv),s=rr.multiply(this._scaleMatrix,a,Gv);rr.clone(s,this._modelMatrix);const l=t.context,u=ZV(this),A=t.globeTranslucencyState.translucent,c=this.perFragmentAtmosphere||A||!ir(n)||!n.show,f=this._command;if(xf.eastUpNorthToFixedFrame=xf.eastUpNorthToFixedFrame||xf.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=xf.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!ir(f.vertexArray)){const p=dE.createGeometry(new dE({radii:new Yr(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:OV.POSITION_ONLY}));f.vertexArray=VV.fromGeometry({context:l,geometry:p,attributeLocations:UV.createAttributeLocations(p),bufferUsage:LV.STATIC_DRAW}),f.renderState=kV.fromCache({cull:{enabled:!0,face:WV.FRONT},blending:GV.ALPHA_BLEND,depthMask:!1})}const d=u|c<<2|A<<3;if(d!==this._flags){this._flags=d;const p=[];u&&p.push("COLOR_CORRECT"),c&&p.push("PER_FRAGMENT_ATMOSPHERE"),A&&p.push("GLOBE_TRANSLUCENT");const g=new mE({defines:p,sources:[gE,yE,NV]}),v=new mE({defines:p,sources:[gE,yE,FV]});this._spSkyAtmosphere=QV.fromCache({context:l,vertexShaderSource:g,fragmentShaderSource:v}),f.shaderProgram=this._spSkyAtmosphere}if(ir(this._cubeMap))return f};function ZV(t){return!(ba.equalsEpsilon(t.hueShift,0,ba.EPSILON7)&&ba.equalsEpsilon(t.saturationShift,0,ba.EPSILON7)&&ba.equalsEpsilon(t.brightnessShift,0,ba.EPSILON7))}xa.prototype.isDestroyed=function(){return!1},xa.prototype.destroy=function(){const t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),DV(this)};const Fa=class Fa extends h.Destroyable{constructor(e,i){super();z(this,"_navigationManager");z(this,"_envManager");z(this,"_reu",(e,i)=>h.registerEventUpdate(this,e,i));this._czmViewer=e,this._viewer=i;const o=this.viewer,r=this.czmViewer,a=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new pV(r)),this._envManager=this.dv(new CV(r)),this.disposeVar(new h.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new Fa.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new h.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const s=pE(this._czmViewer.xbsjLocalBoxSources);if(s)return new Fa.LocalSkyBoxResetting(this._czmViewer,this._viewer,s)}));{this._reu(r.disabledInputStackChanged,()=>{const l=r.disabledInputStack===0;a.enableInputs=l,a.enableTranslate=l,a.enableZoom=l,a.enableRotate=l,a.enableTilt=l,a.enableLook=l});class s extends h.Destroyable{constructor(){super(),r.incrementDisabledInputStack(),this.dispose(()=>r.decrementDisabledInputStack())}}this.disposeVar(new h.ObjResettingWithEvent(r.sceneSsccEnableInputsChanged,()=>r.sceneSsccEnableInputs??!0?void 0:new s))}this.d(o.scene.camera.changed.addEventListener(()=>r.cameraChanged.emit()));{const s=()=>{const l=rt.latestDefaultAccessToken??rt.currentDefaultAccessToken;_.Ion.defaultAccessToken=r.ionAccessToken===""?l:r.ionAccessToken};s(),this.dispose(r.ionAccessTokenChanged.disposableOn(s))}{const{scene:s}=o,l=()=>{if(s.globe.show=r.globeShow??!0,"fov"in s.camera.frustum){const A=s.camera.frustum.aspectRatio;if(!A){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}s.camera.frustum.fov=_.Math.toRadians(A>=1?r.fov:r.fov/A)}};l();const u=this.dv(h.createNextAnimateFrameEvent(r.globeShowChanged,r.fovChanged));this.d(u.don(l))}o.clockViewModel.currentTime=_.JulianDate.fromDate(new Date(r.currentTime)),this.dispose(r.currentTimeChanged.disposableOn(()=>{if(r.currentTime===void 0)return;const s=_.JulianDate.fromDate(new Date(r.currentTime));_.JulianDate.equals(s,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=s)})),this.dispose(ui(o.clockViewModel,"currentTime",s=>{const l=_.JulianDate.toDate(o.clockViewModel.currentTime).getTime();l!==r.currentTime&&(r.currentTime=l)}));{let s=_.getTimestamp(),l=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=_.getTimestamp();l++;var A=u-s;A>1e3&&(r._fps.value=l*1e3/A|0,s=u,l=0)}))}{const s=new _.SunLight,l=new _.DirectionalLight({direction:o.scene.camera.directionWC});class u extends h.Destroyable{constructor(){super();const c=r.flashLighting??!1;o.scene.light=c?l:s,c&&this.dispose(o.scene.preRender.addEventListener(function(f,d){l.direction=_.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new h.ObjResettingWithEvent(r.flashLightingChanged,()=>new u))}{const{scene:s}=o,{screenSpaceCameraController:l,globe:u}=s,A=(p,g)=>h.registerEventUpdate(this,p,g),c=rt.defaults,f=(p,g)=>A(r[p+"Changed"],()=>{if(!Reflect.has(r,p))throw new Error(`!Reflect.has(czmViewer, ${p})`);if(!Reflect.has(c,p))throw new Error(`!Reflect.has(CzmViewer.defaults, ${p})`);g(r[p]??c[p])}),d=(p,g)=>A(r[p+"Changed"],()=>{if(!Reflect.has(r,p))throw new Error(`!Reflect.has(czmViewer, ${p})`);g(r[p])});f("splitPosition",p=>o.scene.splitPosition=p),f("resolutionScale",p=>o.resolutionScale=p),f("msaaSamples",p=>o.scene.msaaSamples=p),d("shadows",p=>o.shadows=p),f("scenePpsfxaaEnabled",p=>s.postProcessStages.fxaa.enabled=p),d("scenePpsAmbientOcclusionEnabled",p=>s.postProcessStages.ambientOcclusion.enabled=p),d("scenePpsAmbientOcclusionAmbientOcclusionOnly",p=>s.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=p),d("scenePpsAmbientOcclusionIntensity",p=>s.postProcessStages.ambientOcclusion.uniforms.intensity=p),d("scenePpsAmbientOcclusionBias",p=>s.postProcessStages.ambientOcclusion.uniforms.bias=p),d("scenePpsAmbientOcclusionLengthCap",p=>s.postProcessStages.ambientOcclusion.uniforms.lengthCap=p),d("scenePpsAmbientOcclusionStepSize",p=>s.postProcessStages.ambientOcclusion.uniforms.stepSize=p),d("scenePpsAmbientOcclusionBlurStepSize",p=>s.postProcessStages.ambientOcclusion.uniforms.blurStepSize=p),d("scenePpsBloomEnabled",p=>s.postProcessStages.bloom.enabled=p),d("scenePpsBloomGlowOnly",p=>s.postProcessStages.bloom.uniforms.glowOnly=p),d("scenePpsBloomContrast",p=>s.postProcessStages.bloom.uniforms.contrast=p),d("scenePpsBloomBrightness",p=>s.postProcessStages.bloom.uniforms.brightness=p),d("scenePpsBloomDelta",p=>s.postProcessStages.bloom.uniforms.delta=p),d("scenePpsBloomSigma",p=>s.postProcessStages.bloom.uniforms.sigma=p),d("scenePpsBloomStepSize",p=>s.postProcessStages.bloom.uniforms.stepSize=p),f("globeShow",p=>s.globe.show=p),f("depthTestAgainstTerrain",p=>{s.globe.depthTestAgainstTerrain=p}),s.globe.translucency.enabled=!0,f("terrainOpacity",p=>{s.globe.translucency.frontFaceAlpha=s.globe.translucency.backFaceAlpha=h.clamp(p,0,1)}),f("sceneGlobeShadows",p=>s.globe.shadows=_.ShadowMode[p]),d("sceneGlobeTerrainExaggeration",p=>s.globe.terrainExaggeration=p),d("sceneGlobeTerrainExaggerationRelativeHeight",p=>s.globe.terrainExaggerationRelativeHeight=p),d("sceneGlobeVerticalExaggeration",p=>s.globe.verticalExaggeration=p),d("sceneGlobeVerticalExaggerationRelativeHeight",p=>s.globe.verticalExaggerationRelativeHeight=p),d("sceneGlobeBackFaceCulling",p=>s.globe.backFaceCulling=p),d("sceneGlobeShowSkirts",p=>s.globe.showSkirts=p),d("sceneGlobeShowWaterEffect",p=>s.globe.showWaterEffect=p),d("sceneGlobeBaseColor",p=>s.globe.baseColor=Be(p)),d("sceneGlobeCartographicLimitRectangle",p=>s.globe.cartographicLimitRectangle=dt(p)),d("sceneGlobeClippingPlanes",p=>{if(!s.globe.clippingPlanes){s.globe.clippingPlanes=Ra(p??{enabled:!1});return}jc(s.globe.clippingPlanes,p)}),d("sceneGlobeClippingPolygons",p=>{s.globe.clippingPolygons=p?qc(p):void 0}),f("sceneSunGlowFactor",p=>s.sun&&(s.sun.glowFactor=p)),f("moon",p=>s.moon&&(s.moon.show=p)),f("sceneMoonOnlySunLighting",p=>s.moon&&(s.moon.onlySunLighting=p)),f("sceneMoonTextureUrl",p=>s.moon&&(s.moon.textureUrl=h.ESSceneObject.context.getStrFromEnv(p))),d("sceneSkyBoxShow",p=>s._xbsjOriginSkyBox.show=p),f("sceneSkyBoxSources",p=>s._xbsjOriginSkyBox.sources=p&&pE(p)),d("atmosphere",p=>o.scene._xbsjOriginSkyAtmosphere.show=p),d("sceneBackgroundColor",p=>o.scene.backgroundColor=Be(p)),f("sceneFogEnabled",p=>s.fog.enabled=p),f("sceneFogDensity",p=>s.fog.density=p),f("sceneFogScreenSpaceErrorFactor",p=>s.fog.screenSpaceErrorFactor=p),f("sceneFogMinimumBrightness",p=>s.fog.minimumBrightness=p),f("sceneDebugShowFramesPerSecond",p=>s.debugShowFramesPerSecond=p),f("sceneDebugShowCommands",p=>s.debugShowCommands=p),f("sceneDebugShowFrustums",p=>s.debugShowFrustums=p),f("sceneDebugShowFrustumPlanes",p=>s.debugShowFrustumPlanes=p),f("sceneDebugShowDepthFrustum",p=>s.debugShowDepthFrustum=p),f("sceneGlobeUndergroundColor",p=>u.undergroundColor=Be(p)),f("sceneGlobeUndergroundColorAlphaByDistance",p=>u.undergroundColorAlphaByDistance=ur(p)),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",p=>u.translucency.backFaceAlphaByDistance=p&&ur(p)),d("sceneGlobeTranslucencyFrontFaceAlphaByDistance",p=>u.translucency.frontFaceAlphaByDistance=p&&ur(p)),f("sceneGlobeTranslucencyRectangle",p=>u.translucency.rectangle=dt(p)),f("sceneSplitPosition",p=>s.splitPosition=h.clamp(p,0,1)),f("sceneSsccEnableCollisionDetection",p=>s.screenSpaceCameraController.enableCollisionDetection=p),f("sceneSsccZoomFactor",p=>s.screenSpaceCameraController._zoomFactor=p);{const p=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=r.showCesiumInspector??!1?"block":"none")};p(),this.d(r.showCesiumInspectorChanged.don(p))}f("cesiumInspectorWireframe",p=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=p)});{const p=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=r.showCesium3DTilesInspector??!1?"block":"none")};p(),this.dispose(r.showCesium3DTilesInspectorChanged.disposableOn(p))}this.ad(new h.ObjResettingWithEvent(r.particleGlobalControlChanged,()=>{if(!r.particleGlobalControl)return new Uv}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};z(Fa,"BackGroundResetting",class extends h.Destroyable{constructor(i,o){super(),this._czmViewer=i,this._viewer=o;const r=new bf;r.material=_.Material.fromType("Image");const a=this._viewer;a.scene.skyBox=r,this.dispose(()=>a.scene.skyBox=a.scene._xbsjOriginSkyBox);{const s=()=>{r.show=this._czmViewer.sceneSkyBoxShow};s(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.color=Be(this._czmViewer.xbsjBackgroundColor)};s(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};s(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(s))}}}),z(Fa,"LocalSkyBoxResetting",class extends h.Destroyable{constructor(o,r,a){super();z(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=r,this._sources=a,this._skyAtmosphere=new xa(void 0,this._sources);const s=this._viewer;s.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>s.scene.skyAtmosphere=s.scene._xbsjOriginSkyAtmosphere);{const l=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};l(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(l))}}get skyAtmosphere(){return this._skyAtmosphere}});let Wv=Fa;function XV(t,n,e,i,o){var r=_.Cartesian3.subtract(t,e,new _.Cartesian3),a=_.Cartesian3.dot(r,n);if(!(a<=0))return a*Math.tan(i*.5)*2/o}async function $V(t){const{viewer:n}=t;if(!n)return;const{width:e,height:i}=n.canvas,o=t.quickPickPosition([e*.5,i*.5]);if(!o)return;const r=await o;if(!r)return;const a=_.Cartesian3.fromDegrees(...r);if(!a)return;const s=n.camera.positionWC,l=n.camera.directionWC,u=n.camera.frustum.fovy;if(u===void 0)return;const A=n.canvas.height;return[XV(a,l,s,u,A),r]}const YV=_.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function JV(t){return-Math.log2(t/YV)}var jv=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function e3(t){const n=t|0;if(n<1||n>1e8)return;let e=-1;for(;n>=jv[++e];);const i=n/jv[e-1]|0;return[i*jv[e-1],i,e]}class t3 extends h.Destroyable{constructor(){super();z(this,"_lengthInPixels",this.disposeVar(h.react(100)));z(this,"_resolution",this.disposeVar(h.react(void 0)));z(this,"_computedLengthInPixels",this.disposeVar(h.react(void 0)));z(this,"_computedLengthInMeters",this.disposeVar(h.react(void 0)));z(this,"_computedLengthInStr",this.disposeVar(h.react(void 0)));{const e=()=>{let i,o;const{lengthInPixels:r,resolution:a}=this;if(r&&a){const s=e3(r*a);if(s){const[l,u,A]=s;o=l,i=l/a}}this._computedLengthInPixels.value=i,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const i=this.computedLengthInMeters;if(!i){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=i>1e3?`${i/1e3|0}km`:`${i}m`};e(),this.dispose(this.computedLengthInMetersChanged.disposableOn(e))}}get lengthInPixels(){return this._lengthInPixels.value}set lengthInPixels(e){this._lengthInPixels.value=e}get lengthInPixelsChanged(){return this._lengthInPixels.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get computedLengthInPixels(){return this._computedLengthInPixels.value}get computedLengthInPixelsChanged(){return this._computedLengthInPixels.changed}get computedLengthInMeters(){return this._computedLengthInMeters.value}get computedLengthInMetersChanged(){return this._computedLengthInMeters.changed}get computedLengthInStr(){return this._computedLengthInStr.value}get computedLengthInStrChanged(){return this._computedLengthInStr.changed}}class n3 extends h.Destroyable{constructor(e){super();z(this,"_enabled",this.dv(h.react(!0)));z(this,"_resolution",this.dv(h.react(void 0)));z(this,"_center",this.dv(h.react(void 0)));z(this,"_zoom",this.dv(h.react(void 0)));z(this,"_legend",this.dv(new t3));this._czmViewer=e;{const i=this.dv(h.createProcessingFromAsyncFunc(async o=>{let r,a,s;await o.promise(h.sleep(1e3));const l=await o.promise($V(this._czmViewer));if(l){const[u,A]=l;r=u,a=JV(u),s=A}this._resolution.value=r,this._zoom.value=a,this._center.value=s}));i.restart();{const o=()=>{this.enabled?i.restart():i.cancel()};o();const r=this.dv(h.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(r.disposableOn(o))}}{const i=()=>{this._legend.resolution=this.resolution};i(),this.dispose(this.resolutionChanged.disposableOn(i))}}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get center(){return this._center.value}get centerChanged(){return this._center.changed}get zoom(){return this._zoom.value}get zoomChanged(){return this._zoom.changed}get legend(){return this._legend}get length(){return(this.legend.computedLengthInMeters??-1)/(this.legend.computedLengthInPixels??1)}}function i3(t,n){try{const e=_.Ellipsoid.WGS84,i=e.scaleToGeodeticSurface(t);return n=_.Transforms.eastNorthUpToFixedFrame(i,e,n),n}catch{return _.Matrix4.clone(_.Matrix4.IDENTITY,n)}}const{combine:r3}=_,{ShaderDestination:qo}=_,bE={name:"FlattenedPipelineStage"};bE.process=function(t,n,e){if(n.xbsjFlattened){const i=t.shaderBuilder;i.addDefine("XBSJ_FLATTERN",void 0,qo.BOTH),i.addUniform("sampler2D","u_flattenedPolygonTexture",qo.BOTH),i.addUniform("vec4","u_flattenedBound",qo.BOTH),i.addUniform("bool","u_flattened",qo.BOTH),i.addUniform("mat4","u_inverseModelElevationMatrix",qo.BOTH),i.addUniform("mat4","u_inverseElevationModelMatrix",qo.BOTH),i.addUniform("bool","u_flattenDiscard",qo.BOTH);const o={u_flattenedBound:function(){return n.xbsjFlattenedBound??_.Cartesian4.ZERO},u_flattened:function(){return n.xbsjFlattened},u_inverseModelElevationMatrix:function(){const r=e.context.uniformState.inverseModel??_.Matrix4.IDENTITY;return n._uniformElevationInverseModelMatrix=_.Matrix4.multiply(r,n.xbsjElevationMatrix??_.Matrix4.IDENTITY,n._uniformElevationInverseModelMatrix??new _.Matrix4),n._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const r=e.context.uniformState.model??_.Matrix4.IDENTITY;return n._uniformInverseElevationModelMatrix=_.Matrix4.multiply(n.xbsjElevationMatrixInv??_.Matrix4.IDENTITY,r,n._uniformInverseElevationModelMatrix??new _.Matrix4),n._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return n.xbsjGetFlattenedTextureFunc?n.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=r3(o,t.uniformMap)}};function xE(){Object.defineProperties(_.Model.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){t!==this._xbsjFlattened&&this.resetDrawCommands(),this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){t!==this._xbsjElevationMatrix&&this.resetDrawCommands(),this._xbsjElevationMatrix=t,this._xbsjElevationMatrixInv=this._xbsjElevationMatrix&&_.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new _.Matrix4)}},xbsjElevationMatrixInv:{get:function(){return this._xbsjElevationMatrixInv}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){t!==this._xbsjFlattenedBound&&this.resetDrawCommands(),this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){t!==this._xbsjGetFlattenedTextureFunc&&this.resetDrawCommands(),this._xbsjGetFlattenedTextureFunc=t}}})}function _E(){Object.defineProperties(_.Cesium3DTileset.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){this._xbsjElevationMatrix=t}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){this._xbsjGetFlattenedTextureFunc=t}}})}function CE(){const t=_.Model3DTileContent.prototype.update;_.Model3DTileContent.prototype.update=function(n,e,...i){const o=this._model;return o.xbsjFlattened=n.xbsjFlattened,o.xbsjElevationMatrix=n.xbsjElevationMatrix,o.xbsjFlattenedBound=n.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=n.xbsjGetFlattenedTextureFunc,t.call(this,n,e,...i)}}function SE(){const t=_.ModelSceneGraph.prototype.configurePipeline;_.ModelSceneGraph.prototype.configurePipeline=function(n,...e){const i=t.call(this,n,...e),o=this._model,r=this.modelPipelineStages;return o.xbsjFlattened&&r.push(bE),i}}xE(),_E(),CE(),SE();const o3=()=>({createCesiumViewerFuncStr:void 0,flashLighting:void 0,resolutionScale:void 0,msaaSamples:void 0,shadows:!1,sceneSplitPosition:void 0,sceneGlobeShadows:void 0,sceneGlobeTerrainExaggeration:1,sceneGlobeTerrainExaggerationRelativeHeight:0,sceneGlobeVerticalExaggeration:1,sceneGlobeVerticalExaggerationRelativeHeight:0,sceneGlobeBackFaceCulling:!0,sceneGlobeShowSkirts:!0,sceneGlobeShowWaterEffect:!0,sceneGlobeBaseColor:h.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:h.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:h.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:h.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:h.reactArray([]),sceneGlobeUndergroundColor:h.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:h.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyBackFaceAlphaByDistance:h.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlphaByDistance:h.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:h.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:h.reactJson(rt.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:h.reactArray([1,1,1,1]),xbsjLocalBoxSources:h.reactJsonWithUndefined(void 0),sceneBackgroundColor:h.reactArray([0,0,0,0]),sceneFogEnabled:void 0,sceneFogDensity:void 0,sceneFogScreenSpaceErrorFactor:void 0,sceneFogMinimumBrightness:void 0,sceneSsccEnableInputs:void 0,sceneSsccEnableCollisionDetection:void 0,sceneSsccZoomFactor:void 0,scenePpsfxaaEnabled:void 0,scenePpsAmbientOcclusionEnabled:!1,scenePpsAmbientOcclusionAmbientOcclusionOnly:!1,scenePpsAmbientOcclusionIntensity:3,scenePpsAmbientOcclusionBias:.1,scenePpsAmbientOcclusionLengthCap:.03,scenePpsAmbientOcclusionStepSize:1,scenePpsAmbientOcclusionBlurStepSize:.86,scenePpsBloomEnabled:!1,scenePpsBloomGlowOnly:!1,scenePpsBloomContrast:128,scenePpsBloomBrightness:-.3,scenePpsBloomDelta:1,scenePpsBloomSigma:3.78,scenePpsBloomStepSize:5,sceneDebugShowFramesPerSecond:void 0,sceneDebugShowCommands:void 0,sceneDebugShowFrustums:void 0,sceneDebugShowFrustumPlanes:void 0,sceneDebugShowDepthFrustum:void 0,showCesiumInspector:void 0,cesiumInspectorWireframe:void 0,showCesium3DTilesInspector:void 0,particleGlobalControl:!1}),s3=`
|
|
4024
4024
|
#### 示例代码1
|
|
4025
4025
|
\`\`\`
|
|
4026
4026
|
async function initCesiumViewer(container, czmViewer) {
|
|
@@ -4106,10 +4106,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
4106
4106
|
`;function l3(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
4107
4107
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
4108
4108
|
gitee地址:${t}
|
|
4109
|
-
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const zt=class zt extends h.ESViewer{constructor(e){super(e);z(this,"_disabledInputStack",this.disposeVar(h.react(0)));z(this,"_viewer",this.dv(h.react(void 0)));z(this,"_viewerInstance");z(this,"_viewerLegend");z(this,"pickCustomAttachedInfo");z(this,"_fps",this.dv(h.react(0)));z(this,"_notSupportEditingCount",this.disposeVar(h.react(0)));z(this,"_editingSystem",gf);z(this,"_moveObjectsProcess",this.ad(QS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new Nk(this)),this.ad(new Hk(this)),this.dv(new h.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new qk(this)})),this._viewerLegend=this.dv(new n3(this)),this._viewerInstance=this.dv(new h.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Wv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new h.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new W8(this.subContainer,this,o=>this._viewer.value=o,i.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Dn(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=_.Cartographic.fromDegrees(e[0],e[1],e[2],zt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Cn(e),rotation:os(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let r=o.positionWC;const a=_.Cartesian3.fromDegrees(...e),s=_.Cartesian3.distance(o.positionWC,a),l=_.Cartesian3.subtract(a,r,new _.Cartesian3);_.Cartesian3.normalize(l,l);const u=_.Transforms.rotationMatrixFromPositionVelocity(r,l,_.Ellipsoid.WGS84),A=_.Matrix4.fromRotationTranslation(u,r);var c=_.Transforms.eastNorthUpToFixedFrame(_.Matrix4.getTranslation(A,new _.Cartesian3),_.Ellipsoid.WGS84,new _.Matrix4),f=_.Matrix4.multiply(_.Matrix4.inverse(c,new _.Matrix4),A,new _.Matrix4),d=_.Matrix4.getMatrix3(f,new _.Matrix3),p=_.Quaternion.fromRotationMatrix(d),g=_.HeadingPitchRoll.fromQuaternion(p);const v=os(o);return{distance:s,heading:_.Math.toDegrees(g.heading)+90,pitch:_.Math.toDegrees(g.pitch),flyDuration:1,hDelta:-(v[0]-(_.Math.toDegrees(g.heading)+90)),pDelta:v[1]-_.Math.toDegrees(g.pitch)}}flyIn(e,i,o,r="default"){var l;if(!i)return;i[0]=-i[0];const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&Qa(s,a)}flyTo(e,i,o="default"){var d;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,c={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(d=this.viewer)==null?void 0:d.camera;return f&&Qa(f,c)}flyToBoundingSphere(e,i,o=1){var c;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=h.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(c=this.viewer)==null?void 0:c.camera;return A&&Qa(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Cn(e),rotation:os(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=_.VERSION,e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=_.Cartographic.fromDegrees(e,i,void 0,zt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await D0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(At(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${h.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=h.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=zt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!zt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=zt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return An(e,i)}localPositionsToPositions(e,i){return dr(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=At(e),o=new _.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=zt.defaults;return{...e,more:[...e.more,new h.GroupProperty([],"通用","通用"),new h.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",a3,s3,!0),new h.FunctionProperty([],()=>zt.getCesiumIonToken(),[],"获取官方token"),new h.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new h.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new h.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new h.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new h.GroupProperty([],"Viewer","Viewer"),new h.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new h.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new h.BooleanProperty([this,"shadows"]),new h.GroupProperty([],"比例尺","比例尺(Legend)"),new h.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new h.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new h.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new h.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new h.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new h.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new h.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new h.GroupProperty([],"场景","场景(Scene)"),new h.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new h.GroupProperty([],"Globe","Globe"),new h.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new h.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new h.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new h.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new h.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new h.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new h.BooleanProperty([this,"sceneGlobeShowSkirts"]),new h.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new h.ColorProperty([this,"sceneGlobeBaseColor"]),new h.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new h.JsonProperty([this,"sceneGlobeClippingPlanes"]),new h.StringProperty([this,"sceneGlobeClippingPlanesId"]),new h.JsonProperty([this,"sceneGlobeClippingPolygons"]),new h.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new h.GroupProperty([],"underground","underground"),new h.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new h.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new h.GroupProperty([],"Translucency","Translucency"),new h.BooleanProperty([this,"sceneGlobeTranslucencyEnabled"],"启用",i.sceneGlobeTranslucencyEnabled,!0),new h.NumberProperty([this,"sceneGlobeTranslucencyBackFaceAlpha"],"背面透明度",i.sceneGlobeTranslucencyBackFaceAlpha,!0),new h.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new h.NumberProperty([this,"sceneGlobeTranslucencyFrontFaceAlpha"],"正面透明度",i.sceneGlobeTranslucencyFrontFaceAlpha,!0),new h.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new h.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new h.GroupProperty([],"Sun","Sun"),new h.BooleanProperty([this,"sun"],"sun",i.sun,!0),new h.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new h.GroupProperty([],"Moon","Moon"),new h.BooleanProperty([this,"moon"],"moon",i.moon,!0),new h.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new h.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new h.GroupProperty([],"SkyBox","SkyBox"),new h.BooleanProperty([this,"sceneSkyBoxShow"]),new h.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new h.GroupProperty([],"Background","Background"),new h.BooleanProperty([this,"xbsjUseBackground"]),new h.StringProperty([this,"xbsjBackgroundImageUri"]),new h.ColorProperty([this,"xbsjBackgroundColor"]),new h.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new h.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new h.ColorProperty([this,"sceneBackgroundColor"]),new h.GroupProperty([],"Fog","Fog"),new h.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new h.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new h.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new h.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new h.GroupProperty([],"Sscc","Sscc"),new h.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new h.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new h.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new h.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new h.GroupProperty([],"后处理","后处理"),new h.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new h.GroupProperty([],"环境遮蔽","环境遮蔽"),new h.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new h.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new h.GroupProperty([],"Bloom","Bloom"),new h.BooleanProperty([this,"scenePpsBloomEnabled"]),new h.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new h.NumberProperty([this,"scenePpsBloomContrast"]),new h.NumberProperty([this,"scenePpsBloomBrightness"]),new h.NumberProperty([this,"scenePpsBloomDelta"]),new h.NumberProperty([this,"scenePpsBloomSigma"]),new h.NumberProperty([this,"scenePpsBloomStepSize"]),new h.GroupProperty([],"调试","调试"),new h.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new h.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new h.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new h.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new h.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new h.GroupProperty([],"Inspector","Inspector"),new h.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new h.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new h.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};z(zt,"type",zt.register("ESCesiumViewer",zt)),z(zt,"getCesiumIonToken",l3),z(zt,"currentDefaultAccessToken",_.Ion.defaultAccessToken),z(zt,"latestDefaultAccessToken"),z(zt,"ObjectsToExcludeWrapper",jk),z(zt,"defaults",{...h.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],sceneGlobeTranslucencyEnabled:!1,sceneGlobeTranslucencyBackFaceAlpha:1,sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlpha: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:_.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:_.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}),z(zt,"getHeightsScartchCarto",new _.Cartographic);let rt=zt;(t=>{t.createDefaultProps=()=>({...h.ESViewer.createDefaultProps(),...o3()})})(rt||(rt={})),h.extendClassProps(rt.prototype,rt.createDefaultProps),oe.copyright=void 0;try{const t="earthsdk3-cesium",n="3.5.0-beta.4",e="2025-09-24T06:57:53.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="68cd621b33e0c85c47fbbd4116bf77c0f96320ec",s=((Date.now()-1758697073e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
|
|
4109
|
+
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const zt=class zt extends h.ESViewer{constructor(e){super(e);z(this,"_disabledInputStack",this.disposeVar(h.react(0)));z(this,"_viewer",this.dv(h.react(void 0)));z(this,"_viewerInstance");z(this,"_viewerLegend");z(this,"pickCustomAttachedInfo");z(this,"_fps",this.dv(h.react(0)));z(this,"_notSupportEditingCount",this.disposeVar(h.react(0)));z(this,"_editingSystem",gf);z(this,"_moveObjectsProcess",this.ad(QS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new N6(this)),this.ad(new H6(this)),this.dv(new h.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new q6(this)})),this._viewerLegend=this.dv(new n3(this)),this._viewerInstance=this.dv(new h.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Wv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new h.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new W8(this.subContainer,this,o=>this._viewer.value=o,i.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Dn(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=_.Cartographic.fromDegrees(e[0],e[1],e[2],zt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Cn(e),rotation:os(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let r=o.positionWC;const a=_.Cartesian3.fromDegrees(...e),s=_.Cartesian3.distance(o.positionWC,a),l=_.Cartesian3.subtract(a,r,new _.Cartesian3);_.Cartesian3.normalize(l,l);const u=_.Transforms.rotationMatrixFromPositionVelocity(r,l,_.Ellipsoid.WGS84),A=_.Matrix4.fromRotationTranslation(u,r);var c=_.Transforms.eastNorthUpToFixedFrame(_.Matrix4.getTranslation(A,new _.Cartesian3),_.Ellipsoid.WGS84,new _.Matrix4),f=_.Matrix4.multiply(_.Matrix4.inverse(c,new _.Matrix4),A,new _.Matrix4),d=_.Matrix4.getMatrix3(f,new _.Matrix3),p=_.Quaternion.fromRotationMatrix(d),g=_.HeadingPitchRoll.fromQuaternion(p);const v=os(o);return{distance:s,heading:_.Math.toDegrees(g.heading)+90,pitch:_.Math.toDegrees(g.pitch),flyDuration:1,hDelta:-(v[0]-(_.Math.toDegrees(g.heading)+90)),pDelta:v[1]-_.Math.toDegrees(g.pitch)}}flyIn(e,i,o,r="default"){var l;if(!i)return;i[0]=-i[0];const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&Qa(s,a)}flyTo(e,i,o="default"){var d;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,c={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(d=this.viewer)==null?void 0:d.camera;return f&&Qa(f,c)}flyToBoundingSphere(e,i,o=1){var c;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=h.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(c=this.viewer)==null?void 0:c.camera;return A&&Qa(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Cn(e),rotation:os(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=_.VERSION,e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=_.Cartographic.fromDegrees(e,i,void 0,zt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await D0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(At(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${h.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=h.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=zt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!zt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=zt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return An(e,i)}localPositionsToPositions(e,i){return dr(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=At(e),o=new _.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=zt.defaults;return{...e,more:[...e.more,new h.GroupProperty([],"通用","通用"),new h.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",a3,s3,!0),new h.FunctionProperty([],()=>zt.getCesiumIonToken(),[],"获取官方token"),new h.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new h.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new h.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new h.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new h.GroupProperty([],"Viewer","Viewer"),new h.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new h.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new h.BooleanProperty([this,"shadows"]),new h.GroupProperty([],"比例尺","比例尺(Legend)"),new h.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new h.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new h.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new h.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new h.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new h.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new h.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new h.GroupProperty([],"场景","场景(Scene)"),new h.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new h.GroupProperty([],"Globe","Globe"),new h.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new h.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new h.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new h.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new h.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new h.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new h.BooleanProperty([this,"sceneGlobeShowSkirts"]),new h.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new h.ColorProperty([this,"sceneGlobeBaseColor"]),new h.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new h.JsonProperty([this,"sceneGlobeClippingPlanes"]),new h.StringProperty([this,"sceneGlobeClippingPlanesId"]),new h.JsonProperty([this,"sceneGlobeClippingPolygons"]),new h.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new h.GroupProperty([],"underground","underground"),new h.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new h.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new h.GroupProperty([],"Translucency","Translucency"),new h.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new h.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new h.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new h.GroupProperty([],"Sun","Sun"),new h.BooleanProperty([this,"sun"],"sun",i.sun,!0),new h.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new h.GroupProperty([],"Moon","Moon"),new h.BooleanProperty([this,"moon"],"moon",i.moon,!0),new h.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new h.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new h.GroupProperty([],"SkyBox","SkyBox"),new h.BooleanProperty([this,"sceneSkyBoxShow"]),new h.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new h.GroupProperty([],"Background","Background"),new h.BooleanProperty([this,"xbsjUseBackground"]),new h.StringProperty([this,"xbsjBackgroundImageUri"]),new h.ColorProperty([this,"xbsjBackgroundColor"]),new h.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new h.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new h.ColorProperty([this,"sceneBackgroundColor"]),new h.GroupProperty([],"Fog","Fog"),new h.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new h.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new h.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new h.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new h.GroupProperty([],"Sscc","Sscc"),new h.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new h.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new h.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new h.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new h.GroupProperty([],"后处理","后处理"),new h.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new h.GroupProperty([],"环境遮蔽","环境遮蔽"),new h.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new h.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new h.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new h.GroupProperty([],"Bloom","Bloom"),new h.BooleanProperty([this,"scenePpsBloomEnabled"]),new h.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new h.NumberProperty([this,"scenePpsBloomContrast"]),new h.NumberProperty([this,"scenePpsBloomBrightness"]),new h.NumberProperty([this,"scenePpsBloomDelta"]),new h.NumberProperty([this,"scenePpsBloomSigma"]),new h.NumberProperty([this,"scenePpsBloomStepSize"]),new h.GroupProperty([],"调试","调试"),new h.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new h.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new h.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new h.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new h.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new h.GroupProperty([],"Inspector","Inspector"),new h.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new h.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new h.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};z(zt,"type",zt.register("ESCesiumViewer",zt)),z(zt,"getCesiumIonToken",l3),z(zt,"currentDefaultAccessToken",_.Ion.defaultAccessToken),z(zt,"latestDefaultAccessToken"),z(zt,"ObjectsToExcludeWrapper",j6),z(zt,"defaults",{...h.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:_.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:_.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}),z(zt,"getHeightsScartchCarto",new _.Cartographic);let rt=zt;(t=>{t.createDefaultProps=()=>({...h.ESViewer.createDefaultProps(),...o3()})})(rt||(rt={})),h.extendClassProps(rt.prototype,rt.createDefaultProps),oe.copyright=void 0;try{const t="earthsdk3-cesium",n="3.5.0-beta.5",e="2025-09-24T07:23:51.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="ea712304739478d789df3bcf0879dd53bb160f02",s=((Date.now()-1758698631e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
|
|
4110
4110
|
%c${o?o+`
|
|
4111
4111
|
`:""}当前网站正在使用${t},此软件版权归${i}所有
|
|
4112
|
-
`;oe.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4112
|
+
`;oe.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","ea712304739478d789df3bcf0879dd53bb160f02")},get info(){return l},get date(){return"2025-09-24T07:23:51.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.5"},get name(){return"earthsdk3-cesium"},get commitId(){return"ea712304739478d789df3bcf0879dd53bb160f02"},print(){console.info(this.info,`
|
|
4113
4113
|
font-size: 18px;
|
|
4114
4114
|
font-weight: 1000;
|
|
4115
4115
|
line-height: 1;
|