zywlgis 0.5.33 → 0.5.34
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/ZYWLGIS.es.js +3 -3
- package/dist/ZYWLGIS.umd.js +1 -1
- package/package.json +1 -1
package/dist/ZYWLGIS.es.js
CHANGED
|
@@ -15572,7 +15572,7 @@ class QX {
|
|
|
15572
15572
|
r,
|
|
15573
15573
|
this.isClampToGround_
|
|
15574
15574
|
));
|
|
15575
|
-
let s =
|
|
15575
|
+
let s = [];
|
|
15576
15576
|
if (this.TakeOffBillboardCoordinate_ && s.length) {
|
|
15577
15577
|
let o = k.transformCartesian3(
|
|
15578
15578
|
this.TakeOffBillboardCoordinate_
|
|
@@ -15610,7 +15610,7 @@ class QX {
|
|
|
15610
15610
|
];
|
|
15611
15611
|
}
|
|
15612
15612
|
}
|
|
15613
|
-
if (this.polylineAppearance || (this.polylineAppearance = k.getCustomAppearance(
|
|
15613
|
+
if (console.log(s), this.polylineAppearance || (this.polylineAppearance = k.getCustomAppearance(
|
|
15614
15614
|
k.getAirRouteTexture(),
|
|
15615
15615
|
100
|
|
15616
15616
|
)), this.polylineHighlightAppearance || (this.polylineHighlightAppearance = k.getCustomAppearance(
|
|
@@ -15655,7 +15655,7 @@ class QX {
|
|
|
15655
15655
|
asynchronous: !1
|
|
15656
15656
|
}), this.geometryInstance_ = e.scene.primitives.add(D));
|
|
15657
15657
|
}
|
|
15658
|
-
if (
|
|
15658
|
+
if (this.data_?.coordinates.length > 1) {
|
|
15659
15659
|
const a = k.setWaypointType(
|
|
15660
15660
|
this.waypointType_,
|
|
15661
15661
|
cA.cloneDeep(this.data_?.coordinates)
|
package/dist/ZYWLGIS.umd.js
CHANGED
|
@@ -23,7 +23,7 @@ __p += '`),er&&(Kt+=`' +
|
|
|
23
23
|
function print() { __p += __j.call(arguments, '') }
|
|
24
24
|
`:`;
|
|
25
25
|
`)+Kt+`return __p
|
|
26
|
-
}`;var Sn=PaA(function(){return tA(KA,Ki+"return "+Kt).apply(e,fe)});if(Sn.source=Kt,_6(Sn))throw Sn;return Sn}function DAe(I){return Mr(I).toLowerCase()}function PAe(I){return Mr(I).toUpperCase()}function cAe(I,x,G){if(I=Mr(I),I&&(G||x===e))return bf(I);if(!I||!(x=Vs(x)))return I;var oA=$a(I),BA=$a(x),KA=zf(oA,BA),fe=pg(oA,BA)+1;return Nl(oA,KA,fe).join("")}function hAe(I,x,G){if(I=Mr(I),I&&(G||x===e))return I.slice(0,FE(I)+1);if(!I||!(x=Vs(x)))return I;var oA=$a(I),BA=pg(oA,$a(x))+1;return Nl(oA,0,BA).join("")}function gAe(I,x,G){if(I=Mr(I),I&&(G||x===e))return I.replace(fn,"");if(!I||!(x=Vs(x)))return I;var oA=$a(I),BA=zf(oA,$a(x));return Nl(oA,BA).join("")}function uAe(I,x){var G=U,oA=Y;if(Bs(x)){var BA="separator"in x?x.separator:BA;G="length"in x?Nn(x.length):G,oA="omission"in x?Vs(x.omission):oA}I=Mr(I);var KA=I.length;if(WD(I)){var fe=$a(I);KA=fe.length}if(G>=KA)return I;var Ie=G-_D(oA);if(Ie<1)return oA;var Ge=fe?Nl(fe,0,Ie).join(""):I.slice(0,Ie);if(BA===e)return Ge+oA;if(fe&&(Ie+=Ge.length-Ie),$6(BA)){if(I.slice(Ie).search(BA)){var xt,Ut=Ge;for(BA.global||(BA=ee(BA.source,Mr(Dt.exec(BA))+"g")),BA.lastIndex=0;xt=BA.exec(Ut);)var Kt=xt.index;Ge=Ge.slice(0,Kt===e?Ie:Kt)}}else if(I.indexOf(Vs(BA),Ie)!=Ie){var fi=Ge.lastIndexOf(BA);fi>-1&&(Ge=Ge.slice(0,fi))}return Ge+oA}function QAe(I){return I=Mr(I),I&&Ve.test(I)?I.replace(Ke,_c):I}var wAe=iP(function(I,x,G){return I+(G?" ":"")+x.toUpperCase()}),tF=tM("toUpperCase");function DaA(I,x,G){return I=Mr(I),x=G?e:x,x===e?CI(I)?Zo(I):Go(I):I.match(x)||[]}var PaA=zn(function(I,x){try{return Io(I,e,x)}catch(G){return _6(G)?G:new K(G)}}),fAe=nP(function(I,x){return ns(x,function(G){G=$r(G),tP(I,G,W6(I[G],I))}),I});function dAe(I){var x=I==null?0:I.length,G=H();return I=x?Lr(I,function(oA){if(typeof oA[1]!="function")throw new Je(s);return[G(oA[0]),oA[1]]}):[],zn(function(oA){for(var BA=-1;++BA<x;){var KA=I[BA];if(Io(KA[0],this,oA))return Io(KA[1],this,oA)}})}function vAe(I){return dk(tl(I,P))}function iF(I){return function(){return I}}function CAe(I,x){return I==null||I!==I?x:I}var EAe=nM(),BAe=nM(!0);function jl(I){return I}function nF(I){return Ok(typeof I=="function"?I:tl(I,P))}function pAe(I){return _E(tl(I,P))}function mAe(I,x){return kk(I,tl(x,P))}var IAe=zn(function(I,x){return function(G){return za(G,I,x)}}),MAe=zn(function(I,x){return function(G){return za(I,G,x)}});function rF(I,x,G){var oA=Ko(x),BA=Vf(x,oA);G==null&&!(Bs(x)&&(BA.length||!oA.length))&&(G=x,x=I,I=this,BA=Vf(x,Ko(x)));var KA=!(Bs(G)&&"chain"in G)||!!G.chain,fe=Ug(I);return ns(BA,function(Ie){var Ge=x[Ie];I[Ie]=Ge,fe&&(I.prototype[Ie]=function(){var xt=this.__chain__;if(KA||xt){var Ut=I(this.__wrapped__),Kt=Ut.__actions__=qs(this.__actions__);return Kt.push({func:Ge,args:arguments,thisArg:I}),Ut.__chain__=xt,Ut}return Ge.apply(I,yl([this.value()],arguments))})}),I}function TAe(){return rt._===this&&(rt._=$D),this}function sF(){}function yAe(I){return I=Nn(I),zn(function(x){return bk(x,I)})}var OAe=KP(Lr),kAe=KP(Eg),bAe=KP(RP);function caA(I){return ti(I)?pQ($r(I)):zk(I)}function zAe(I){return function(x){return I==null?e:yg(I,x)}}var NAe=JQ(),xAe=JQ(!0);function oF(){return[]}function aF(){return!1}function LAe(){return{}}function UAe(){return""}function jAe(){return!0}function SAe(I,x){if(I=Nn(I),I<1||I>_)return[];var G=iA,oA=ao(I,iA);x=H(x),I-=iA;for(var BA=IQ(oA,x);++G<I;)x(G);return BA}function FAe(I){return In(I)?Lr(I,$r):DD(I)?[I]:qs(Es(Mr(I)))}function RAe(I){var x=++ar;return Mr(I)+x}var YAe=ah(function(I,x){return I+x},0),HAe=P0("ceil"),JAe=ah(function(I,x){return I/x},1),GAe=P0("floor");function ZAe(I){return I&&I.length?UQ(I,jl,jI):e}function KAe(I,x){return I&&I.length?UQ(I,H(x,2),jI):e}function VAe(I){return Of(I,jl)}function qAe(I,x){return Of(I,H(x,2))}function WAe(I){return I&&I.length?UQ(I,jl,FI):e}function XAe(I,x){return I&&I.length?UQ(I,H(x,2),FI):e}var _Ae=ah(function(I,x){return I*x},1),$Ae=P0("round"),Aee=ah(function(I,x){return I-x},0);function eee(I){return I&&I.length?mQ(I,jl):0}function tee(I,x){return I&&I.length?mQ(I,H(x,2)):0}return SA.after=p_A,SA.ary=HoA,SA.assign=P$A,SA.assignIn=iaA,SA.assignInWith=ub,SA.assignWith=c$A,SA.at=h$A,SA.before=JoA,SA.bind=W6,SA.bindAll=fAe,SA.bindKey=GoA,SA.castArray=L_A,SA.chain=FoA,SA.chunk=lh,SA.compact=rP,SA.concat=td,SA.cond=dAe,SA.conforms=vAe,SA.constant=iF,SA.countBy=e_A,SA.create=g$A,SA.curry=ZoA,SA.curryRight=KoA,SA.debounce=VoA,SA.defaults=u$A,SA.defaultsDeep=Q$A,SA.defer=m_A,SA.delay=I_A,SA.difference=Dh,SA.differenceBy=Ph,SA.differenceWith=GQ,SA.drop=ZQ,SA.dropRight=KQ,SA.dropRightWhile=VQ,SA.dropWhile=qQ,SA.fill=WQ,SA.filter=i_A,SA.flatMap=s_A,SA.flatMapDeep=o_A,SA.flatMapDepth=a_A,SA.flatten=XQ,SA.flattenDeep=$k,SA.flattenDepth=Ab,SA.flip=M_A,SA.flow=EAe,SA.flowRight=BAe,SA.fromPairs=J6,SA.functions=B$A,SA.functionsIn=p$A,SA.groupBy=l_A,SA.initial=Z6,SA.intersection=K6,SA.intersectionBy=sM,SA.intersectionWith=V6,SA.invert=I$A,SA.invertBy=M$A,SA.invokeMap=P_A,SA.iteratee=nF,SA.keyBy=c_A,SA.keys=Ko,SA.keysIn=Ul,SA.map=lb,SA.mapKeys=y$A,SA.mapValues=O$A,SA.matches=pAe,SA.matchesProperty=mAe,SA.memoize=Pb,SA.merge=k$A,SA.mergeWith=naA,SA.method=IAe,SA.methodOf=MAe,SA.mixin=rF,SA.negate=cb,SA.nthArg=yAe,SA.omit=b$A,SA.omitBy=z$A,SA.once=T_A,SA.orderBy=h_A,SA.over=OAe,SA.overArgs=y_A,SA.overEvery=kAe,SA.overSome=bAe,SA.partial=X6,SA.partialRight=qoA,SA.partition=g_A,SA.pick=N$A,SA.pickBy=raA,SA.property=caA,SA.propertyOf=zAe,SA.pull=la,SA.pullAll=Ws,SA.pullAllBy=lD,SA.pullAllWith=Na,SA.pullAt=il,SA.range=NAe,SA.rangeRight=xAe,SA.rearg=O_A,SA.reject=w_A,SA.remove=nl,SA.rest=k_A,SA.reverse=xg,SA.sampleSize=d_A,SA.set=L$A,SA.setWith=U$A,SA.shuffle=v_A,SA.slice=ch,SA.sortBy=B_A,SA.sortedUniq=ib,SA.sortedUniqBy=nb,SA.split=sAe,SA.spread=b_A,SA.tail=rb,SA.take=sb,SA.takeRight=ob,SA.takeRightWhile=h0,SA.takeWhile=g0,SA.tap=ZXA,SA.throttle=z_A,SA.thru=ab,SA.toArray=AaA,SA.toPairs=saA,SA.toPairsIn=oaA,SA.toPath=FAe,SA.toPlainObject=taA,SA.transform=j$A,SA.unary=N_A,SA.union=u0,SA.unionBy=zXA,SA.unionWith=NXA,SA.uniq=xXA,SA.uniqBy=LXA,SA.uniqWith=UXA,SA.unset=S$A,SA.unzip=q6,SA.unzipWith=SoA,SA.update=F$A,SA.updateWith=R$A,SA.values=w0,SA.valuesIn=Y$A,SA.without=jXA,SA.words=DaA,SA.wrap=x_A,SA.xor=SXA,SA.xorBy=FXA,SA.xorWith=RXA,SA.zip=YXA,SA.zipObject=HXA,SA.zipObjectDeep=JXA,SA.zipWith=GXA,SA.entries=saA,SA.entriesIn=oaA,SA.extend=iaA,SA.extendWith=ub,rF(SA,SA),SA.add=YAe,SA.attempt=PaA,SA.camelCase=Z$A,SA.capitalize=aaA,SA.ceil=HAe,SA.clamp=H$A,SA.clone=U_A,SA.cloneDeep=S_A,SA.cloneDeepWith=F_A,SA.cloneWith=j_A,SA.conformsTo=R_A,SA.deburr=laA,SA.defaultTo=CAe,SA.divide=JAe,SA.endsWith=K$A,SA.eq=qP,SA.escape=V$A,SA.escapeRegExp=q$A,SA.every=t_A,SA.find=n_A,SA.findIndex=zg,SA.findKey=w$A,SA.findLast=r_A,SA.findLastIndex=Ng,SA.findLastKey=f$A,SA.floor=GAe,SA.forEach=RoA,SA.forEachRight=YoA,SA.forIn=d$A,SA.forInRight=v$A,SA.forOwn=C$A,SA.forOwnRight=E$A,SA.get=AF,SA.gt=Y_A,SA.gte=H_A,SA.has=m$A,SA.hasIn=eF,SA.head=eb,SA.identity=jl,SA.includes=D_A,SA.indexOf=G6,SA.inRange=J$A,SA.invoke=T$A,SA.isArguments=nd,SA.isArray=In,SA.isArrayBuffer=J_A,SA.isArrayLike=Ll,SA.isArrayLikeObject=Xs,SA.isBoolean=G_A,SA.isBuffer=_Q,SA.isDate=Z_A,SA.isElement=K_A,SA.isEmpty=V_A,SA.isEqual=q_A,SA.isEqualWith=W_A,SA.isError=_6,SA.isFinite=X_A,SA.isFunction=Ug,SA.isInteger=WoA,SA.isLength=hb,SA.isMap=XoA,SA.isMatch=__A,SA.isMatchWith=$_A,SA.isNaN=A$A,SA.isNative=e$A,SA.isNil=i$A,SA.isNull=t$A,SA.isNumber=_oA,SA.isObject=Bs,SA.isObjectLike=js,SA.isPlainObject=aM,SA.isRegExp=$6,SA.isSafeInteger=n$A,SA.isSet=$oA,SA.isString=gb,SA.isSymbol=DD,SA.isTypedArray=Q0,SA.isUndefined=r$A,SA.isWeakMap=s$A,SA.isWeakSet=o$A,SA.join=ss,SA.kebabCase=W$A,SA.last=yn,SA.lastIndexOf=As,SA.lowerCase=X$A,SA.lowerFirst=_$A,SA.lt=a$A,SA.lte=l$A,SA.max=ZAe,SA.maxBy=KAe,SA.mean=VAe,SA.meanBy=qAe,SA.min=WAe,SA.minBy=XAe,SA.stubArray=oF,SA.stubFalse=aF,SA.stubObject=LAe,SA.stubString=UAe,SA.stubTrue=jAe,SA.multiply=_Ae,SA.nth=aa,SA.noConflict=TAe,SA.noop=sF,SA.now=Db,SA.pad=$$A,SA.padEnd=AAe,SA.padStart=eAe,SA.parseInt=tAe,SA.random=G$A,SA.reduce=u_A,SA.reduceRight=Q_A,SA.repeat=iAe,SA.replace=nAe,SA.result=x$A,SA.round=$Ae,SA.runInContext=f,SA.sample=f_A,SA.size=C_A,SA.snakeCase=rAe,SA.some=E_A,SA.sortedIndex=id,SA.sortedIndexBy=c0,SA.sortedIndexOf=Da,SA.sortedLastIndex=Lg,SA.sortedLastIndexBy=oM,SA.sortedLastIndexOf=tb,SA.startCase=oAe,SA.startsWith=aAe,SA.subtract=Aee,SA.sum=eee,SA.sumBy=tee,SA.template=lAe,SA.times=SAe,SA.toFinite=jg,SA.toInteger=Nn,SA.toLength=eaA,SA.toLower=DAe,SA.toNumber=sP,SA.toSafeInteger=D$A,SA.toString=Mr,SA.toUpper=PAe,SA.trim=cAe,SA.trimEnd=hAe,SA.trimStart=gAe,SA.truncate=uAe,SA.unescape=QAe,SA.uniqueId=RAe,SA.upperCase=wAe,SA.upperFirst=tF,SA.each=RoA,SA.eachRight=YoA,SA.first=eb,rF(SA,(function(){var I={};return oD(SA,function(x,G){Mi.call(SA.prototype,G)||(I[G]=x)}),I})(),{chain:!1}),SA.VERSION=t,ns(["bind","bindKey","curry","curryRight","partial","partialRight"],function(I){SA[I].placeholder=SA}),ns(["drop","take"],function(I,x){Gn.prototype[I]=function(G){G=G===e?1:vs(Nn(G),0);var oA=this.__filtered__&&!x?new Gn(this):this.clone();return oA.__filtered__?oA.__takeCount__=ao(G,oA.__takeCount__):oA.__views__.push({size:ao(G,iA),type:I+(oA.__dir__<0?"Right":"")}),oA},Gn.prototype[I+"Right"]=function(G){return this.reverse()[I](G).reverse()}}),ns(["filter","map","takeWhile"],function(I,x){var G=x+1,oA=G==F||G==W;Gn.prototype[I]=function(BA){var KA=this.clone();return KA.__iteratees__.push({iteratee:H(BA,3),type:G}),KA.__filtered__=KA.__filtered__||oA,KA}}),ns(["head","last"],function(I,x){var G="take"+(x?"Right":"");Gn.prototype[I]=function(){return this[G](1).value()[0]}}),ns(["initial","tail"],function(I,x){var G="drop"+(x?"":"Right");Gn.prototype[I]=function(){return this.__filtered__?new Gn(this):this[G](1)}}),Gn.prototype.compact=function(){return this.filter(jl)},Gn.prototype.find=function(I){return this.filter(I).head()},Gn.prototype.findLast=function(I){return this.reverse().find(I)},Gn.prototype.invokeMap=zn(function(I,x){return typeof I=="function"?new Gn(this):this.map(function(G){return za(G,I,x)})}),Gn.prototype.reject=function(I){return this.filter(cb(H(I)))},Gn.prototype.slice=function(I,x){I=Nn(I);var G=this;return G.__filtered__&&(I>0||x<0)?new Gn(G):(I<0?G=G.takeRight(-I):I&&(G=G.drop(I)),x!==e&&(x=Nn(x),G=x<0?G.dropRight(-x):G.take(x-I)),G)},Gn.prototype.takeRightWhile=function(I){return this.reverse().takeWhile(I).reverse()},Gn.prototype.toArray=function(){return this.take(iA)},oD(Gn.prototype,function(I,x){var G=/^(?:filter|find|map|reject)|While$/.test(x),oA=/^(?:head|last)$/.test(x),BA=SA[oA?"take"+(x=="last"?"Right":""):x],KA=oA||/^find/.test(x);BA&&(SA.prototype[x]=function(){var fe=this.__wrapped__,Ie=oA?[1]:arguments,Ge=fe instanceof Gn,xt=Ie[0],Ut=Ge||In(fe),Kt=function(Vn){var er=BA.apply(SA,yl([Vn],Ie));return oA&&fi?er[0]:er};Ut&&G&&typeof xt=="function"&&xt.length!=1&&(Ge=Ut=!1);var fi=this.__chain__,Ki=!!this.__actions__.length,hn=KA&&!fi,Sn=Ge&&!Ki;if(!KA&&Ut){fe=Sn?fe:new Gn(this);var gn=I.apply(fe,Ie);return gn.__actions__.push({func:ab,args:[Kt],thisArg:e}),new Al(gn,fi)}return hn&&Sn?I.apply(this,Ie):(gn=this.thru(Kt),hn?oA?gn.value()[0]:gn.value():gn)})}),ns(["pop","push","shift","sort","splice","unshift"],function(I){var x=zt[I],G=/^(?:push|sort|unshift)$/.test(I)?"tap":"thru",oA=/^(?:pop|shift)$/.test(I);SA.prototype[I]=function(){var BA=arguments;if(oA&&!this.__chain__){var KA=this.value();return x.apply(In(KA)?KA:[],BA)}return this[G](function(fe){return x.apply(In(fe)?fe:[],BA)})}}),oD(Gn.prototype,function(I,x){var G=SA[x];if(G){var oA=G.name+"";Mi.call(eP,oA)||(eP[oA]=[]),eP[oA].push({name:x,func:G})}}),eP[Ad(e,w).name]=[{name:"wrapper",func:e}],Gn.prototype.clone=ok,Gn.prototype.reverse=ak,Gn.prototype.value=sD,SA.prototype.at=KXA,SA.prototype.chain=VXA,SA.prototype.commit=qXA,SA.prototype.next=WXA,SA.prototype.plant=_XA,SA.prototype.reverse=$XA,SA.prototype.toJSON=SA.prototype.valueOf=SA.prototype.value=A_A,SA.prototype.first=SA.prototype.head,Mg&&(SA.prototype[Mg]=XXA),SA}),O=Oa();Qt?((Qt.exports=O)._=O,Wt._=O):rt._=O}).call(YDA)})(N0,N0.exports)),N0.exports}var cA=HDA();class KR{containerID_=void 0;dataClass_=void 0;data_=void 0;geometryInstance_=void 0;billboardInstances_=[];pointInstances_=[];pointNumberInstances_=[];isPointNumberVisible_=!1;groundPointsInstances_=[];groundVerticalLinesInstances_=[];distanceLabelInstances_=[];centerLabelInstance_=void 0;centerHTMLInstance_=void 0;customLabelInstances_=[];customHTMLInstances_=[];visible_=!0;isClampToGround_=!1;isHighlight_=!1;isEditable_=!1;isDelete_=!1;isCopy_=!1;isStartDraw_=!1;screenSpaceHandler_;nodeMode_="billboard";ALTDragPlane_=void 0;ALTDragIndex_=void 0;heightMode_=0;defaultHeight_=void 0;isContainTakeOffBillboard_=!1;TakeOffBillboard_=void 0;TakeOffBillboardGround_=void 0;TakeOffBillboardVerticalLine_=void 0;TakeOffBillboardHeightLabel_=void 0;TakeOffBillboardHeightLabel1_=void 0;TakeOffBillboardDistanceLabel_=void 0;TakeOffBillboardCoordinate_=void 0;TakeOffBillboardCoordinate1_=void 0;TakeOffBillboardCoordinate2_=void 0;TakeOffBillboardGroundCartographic_=void 0;TakeOffALTDragPlane_=void 0;TakeOffSecureHeight_=void 0;PointOfInterest_=void 0;PointOfInterestCoordinate_=void 0;polylineAppearance=void 0;polylineHighlightAppearance=void 0;positions_=[];groundPositions_=[];isDistanceVisible_=!1;waypointType_=2;airRouteGeometryInstance_=void 0;constructor(A,e){this.containerID_=A,this.dataClass_=e}DataProcessing=A=>{(!cA.isEqual(this.data_,A)||!cA.isEqual(this.data_?.coordinates,A?.coordinates)||!cA.isEqual(this.data_?.symbol,A?.symbol)||!cA.isEqual(this.data_?.takeOffBillboardCoordinate,A?.takeOffBillboardCoordinate)||!cA.isEqual(this.data_?.customLabel,A?.customLabel)||!cA.isEqual(this.data_?.customHTML,A?.customHTML))&&(this.data_=cA.cloneDeep(A),this.data_?.isOpenSecondaryEditing&&this.data_?.coordinates.length&&this.data_?.isEditable&&!this.isStartDraw_&&(this.isStartDraw_=!0),this.reDrawTakeOffBillboard(!0),this.reDraw())};emitGraphClick=()=>{this.isEditable_||k.emitGraphClick(cA.cloneDeep({ID:this.data_.ID,data:this.data_,class:this.dataClass_}))};emitGraphChanging=(A,e)=>{let t,i=this.containerID_.split("-cesium")[0],r=k.addTerrainHeight(i,this.data_.coordinates,this.heightMode_);this.data_.coordinates=r,e!==void 0?t={ID:this.data_.ID,data:this.data_,coordinates:r,takeOffBillboardCoordinate:this.TakeOffBillboardCoordinate_,pointOfInterestCoordinate:this.PointOfInterestCoordinate_,class:this.dataClass_,type:A,index:e}:t={ID:this.data_.ID,data:this.data_,coordinates:r,takeOffBillboardCoordinate:this.TakeOffBillboardCoordinate_,pointOfInterestCoordinate:this.PointOfInterestCoordinate_,class:this.dataClass_,type:A},k.emitGraphChanging(cA.cloneDeep(t))};emitGraphChanged=(A,e)=>{let t,i=this.containerID_.split("-cesium")[0],r=k.addTerrainHeight(i,this.data_.coordinates,this.heightMode_);this.data_.coordinates=r,e!==void 0?t={ID:this.data_.ID,data:this.data_,coordinates:r,takeOffBillboardCoordinate:this.TakeOffBillboardCoordinate_,pointOfInterestCoordinate:this.PointOfInterestCoordinate_,class:this.dataClass_,type:A,index:e}:t={ID:this.data_.ID,data:this.data_,coordinates:r,takeOffBillboardCoordinate:this.TakeOffBillboardCoordinate_,pointOfInterestCoordinate:this.PointOfInterestCoordinate_,class:this.dataClass_,type:A},k.emitGraphChanged(cA.cloneDeep(t))};emitGraphRemoved=()=>{k.emitGraphRemoved(cA.cloneDeep({ID:this.data_.ID,data:this.data_,class:this.dataClass_}))};emitGraphEdited=()=>{window.EditElement=void 0;let A=this.containerID_.split("-cesium")[0],e=k.addTerrainHeight(A,this.data_.coordinates,this.heightMode_);this.data_.coordinates=e,k.emitGraphEdited(cA.cloneDeep({ID:this.data_.ID,data:this.data_,class:this.dataClass_}))};copyPoint=(A,e)=>{if(A!==void 0){const t=this.data_?.coordinates?.length,i=cA.cloneDeep(this.data_?.coordinates[A]),r=Gt([i.longitude,i.latitude]);let s={units:"meters"},o=0,a=100;switch(e){case"front":{if(A===0)if(this.TakeOffBillboardCoordinate_){const P=Gt([this.TakeOffBillboardCoordinate_.longitude,this.TakeOffBillboardCoordinate_.latitude]);o=Do(r,P),a=an(r,P,s)}else if(this.data_?.coordinates?.length>1){const P=cA.cloneDeep(this.data_?.coordinates[A+1]),c=Gt([P.longitude,P.latitude]);o=Do(c,r),a=an(c,r,s)}else o=0,a=100;else{const P=cA.cloneDeep(this.data_?.coordinates[A-1]),c=Gt([P.longitude,P.latitude]);o=Do(r,c),a=an(r,c,s)}const l=kr(r,a*.5,o,s),D=Oo(l);this.data_?.coordinates.splice(A,0,{longitude:D[0],latitude:D[1],altitude:i?.altitude+1})}break;case"after":{if(A===0)if(this.TakeOffBillboardCoordinate_){const P=Gt([this.TakeOffBillboardCoordinate_.longitude,this.TakeOffBillboardCoordinate_.latitude]);o=Do(P,r),a=an(P,r,s)}else if(this.data_?.coordinates?.length>1){const P=cA.cloneDeep(this.data_?.coordinates[A+1]),c=Gt([P.longitude,P.latitude]);o=Do(r,c),a=an(r,c,s)}else o=0,a=100;else if(A===t-1){const P=cA.cloneDeep(this.data_?.coordinates[A-1]),c=Gt([P.longitude,P.latitude]);o=Do(c,r),a=an(c,r,s)}else{const P=cA.cloneDeep(this.data_?.coordinates[A+1]),c=Gt([P.longitude,P.latitude]);o=Do(r,c),a=an(r,c,s)}const l=kr(r,a*.5,o,s),D=Oo(l);this.data_?.coordinates.splice(A+1,0,{longitude:D[0],latitude:D[1],altitude:i?.altitude+1})}break}this.reDrawTakeOffBillboard(!0),this.reDraw(),this.emitGraphChanged("copy",A)}};mouseUp=(A,e)=>{if(k.removeMenu(this.containerID_),!(!this.isEditable_||e===void 0))if(e===-99999){const t=k.getMapEngineInstance(this.containerID_);k.getTerrainHeight(t,this.TakeOffBillboardCoordinate_).then(i=>{this.TakeOffBillboardCoordinate_?.altitude<i?.coordinate?.altitude&&(this.TakeOffBillboardCoordinate_.altitude=i?.coordinate?.altitude),this.reDrawTakeOffBillboard(),this.emitGraphChanged("setTakeOffPoint")})}else e!==void 0&&(this.isStartDraw_||this.emitGraphChanged("update",e))};mouseClick=A=>{if(k.removeMenu(this.containerID_),!this.isEditable_||!A?.position)return;let e=k.getMapEngineInstance(this.containerID_);if(window.isPointOfInterestOpen&&!this.PointOfInterestCoordinate_){this.PointOfInterestCoordinate_=k.getGroundPoint(e,A.position),this.PointOfInterestCoordinate_&&(this.reDrawPointOfInterest(),this.emitGraphChanged("setPointOfInterest"));return}if(this.isContainTakeOffBillboard_&&!this.TakeOffBillboardCoordinate_){this.TakeOffBillboardCoordinate_=k.getGroundPoint(e,A.position),this.TakeOffBillboardCoordinate_&&(this.reDrawTakeOffBillboard(!0),this.reDraw(),this.emitGraphChanged("setTakeOffPoint"),k.recoverCursor(this.containerID_,"TakeOffCursor.png"));return}let t=k.getClampToGroundPosition(e,A.position,this.isClampToGround_,void 0,this.heightMode_,this.defaultHeight_);const i=this.data_?.isSurroundModeEnabled??!1,r=this.data_?.surroundRadius??200,s=this.data_?.steps??8,o=this.data_?.isClockwise??!1;let a=e.scene.pick(A.position);if(t&&t.coordinate){let l=cA.cloneDeep(t.coordinate);if(this.isStartDraw_){if(a){let D=e.scene.drillPick(A.position,20);D=Array.from(new Set(D));let P=!1;for(let c=0;c<D.length;c++){let h=D[c],g=k.extractionIndex(h.id);if(typeof h.id=="string"&&(h.primitive instanceof Cesium.Billboard||h.primitive instanceof Cesium.PointPrimitive)&&(h.id.includes("-&-ZYWL-&-GeometryEditingPolyline-Point-")||h.id.includes("-&-ZYWL-&-GeometryEditingPolyline-PointNumber-")||h.id.includes("-&-ZYWL-&-GeometryEditingPolyline-GroundPoint-"))&&g!==void 0&&this.data_?.coordinates.length>=2&&g===this.data_?.coordinates.length-1){P=!0;break}}if(P){this.isStartDraw_=!1,this.clearScreenSpaceHandler(),this.reDraw(),this.emitGraphChanged("complete");return}}if(i){let D=k.calculateSurroundPoints(t.coordinate,r,s,o);D=k.addTerrainHeight(this.containerID_.split("-cesium")[0],D,this.heightMode_),D.forEach(P=>{this.heightMode_===2?P.altitude=P.terrainHeight+this.defaultHeight_:P.altitude=this.defaultHeight_,this.data_.coordinates.push(cA.cloneDeep(P))})}else this.data_.coordinates.push(cA.cloneDeep(l))}else if(this.data_?.coordinates.length){if(a&&a.id){if(typeof a.id=="string"){let D=a.id;if((a.primitive instanceof Cesium.PointPrimitive||a.primitive instanceof Cesium.Billboard)&&D.includes("-&-ZYWL-&-GeometryEditingPolyline-CenterPoint-")){let P=k.extractionIndex(D),c=a.primitive.position;if(c){let h=k.getWaylineClampToGroundPosition(e,A.position,this.isClampToGround_,c,this.heightMode_,this.defaultHeight_);h&&h.coordinate&&(this.data_.coordinates.splice(P+1,0,h.coordinate),this.reDraw(),this.emitGraphChanged("update"))}}}}else{this.isEditable_=!1,this.reDraw(),this.emitGraphEdited(),this.clearScreenSpaceHandler();return}return}else{if(i){let D=k.calculateSurroundPoints(t.coordinate,r,s,o);D=k.addTerrainHeight(this.containerID_.split("-cesium")[0],D,this.heightMode_),D.forEach(P=>{this.heightMode_===2?P.altitude=P.terrainHeight+this.defaultHeight_:P.altitude=this.defaultHeight_,this.data_.coordinates.push(cA.cloneDeep(P))})}else this.data_.coordinates.push(cA.cloneDeep(l));this.isStartDraw_=!0}this.isContainTakeOffBillboard_&&this.data_?.coordinates.length&&this.reDrawTakeOffBillboard(!0),this.reDraw(),this.emitGraphChanged("update")}};mouseMove=(A,e)=>{if(!this.isEditable_||e===void 0)return;let t=k.getMapEngineInstance(this.containerID_),i;if(e===99999&&this.PointOfInterestCoordinate_)i=k.getClampToGroundPosition(t,A.endPosition,!0,this.PointOfInterestCoordinate_),i&&i.coordinate&&(this.PointOfInterestCoordinate_.longitude=i.coordinate.longitude,this.PointOfInterestCoordinate_.latitude=i.coordinate.latitude,this.reDrawPointOfInterest());else if(e===-99999&&this.isContainTakeOffBillboard_&&this.TakeOffBillboardCoordinate_)i=k.getClampToGroundPosition(t,A.endPosition,!1,this.TakeOffBillboardCoordinate_),i&&i.coordinate&&(this.TakeOffBillboardCoordinate_.longitude=i.coordinate.longitude,this.TakeOffBillboardCoordinate_.latitude=i.coordinate.latitude,this.TakeOffBillboardGroundCartographic_&&(this.TakeOffBillboardGroundCartographic_=k.getCartographicFromCoordinate(t,this.TakeOffBillboardCoordinate_,!0)),this.reDrawTakeOffBillboard(!0),this.reDraw());else if(Array.isArray(this.data_.coordinates)&&this.data_.coordinates.length){let r=k.getClampToGroundPosition(t,A.endPosition,this.isClampToGround_,this.data_?.coordinates[e],this.heightMode_,this.defaultHeight_,this.data_?.coordinates[e]?.followTheSystem);r&&r.coordinate&&(this.data_.coordinates[e].longitude=r.coordinate.longitude,this.data_.coordinates[e].latitude=r.coordinate.latitude,this.data_.coordinates[e].altitude=r.coordinate.altitude,this.reDraw(),e===0&&this.reDrawTakeOffBillboard())}};mouseRightClick=A=>{this.isDelete_&&(A!==void 0?(A===99999?this.clearPointOfInterest():this.data_.coordinates.splice(A,1),this.emitGraphChanged("delete",A)):(this.data_.coordinates=[],this.clearTakeOffBillboardHeightLabel(),this.emitGraphRemoved()),this.clearDistanceLabels(),this.reDrawTakeOffBillboard(),this.clearTakeOffBillboardGround(),this.reDraw())};mouseAltLeftDown=A=>{let t=k.getMapEngineInstance(this.containerID_).scene,i=t.camera,r=t.pick(A.position);if(r){let s=r.primitive;if(s&&(s instanceof Cesium.PointPrimitive||s instanceof Cesium.Billboard||s instanceof Cesium.Label)){let o=r.id;if(typeof o=="string"){if(o.includes("-&-ZYWL-&-GeometryEditingPolyline-Point-")||o.includes("-&-ZYWL-&-GeometryEditingPolyline-PointNumber-")){if(this.ALTDragIndex_=k.extractionIndex(o),!this.ALTDragPlane_&&this.ALTDragIndex_!==void 0){let a=this.data_?.coordinates;if(a&&a.length){let l=a[this.ALTDragIndex_],D=Cesium.Cartesian3.fromDegrees(l.longitude,l.latitude,l.altitude),P=k.offsetHeadingPitch2Position(D,i.heading,0,50),c=Cesium.Cartesian3.subtract(D,P.cartesian3,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(c,c),this.ALTDragPlane_=Cesium.Plane.fromPointNormal(D,c)}}}else if(o===this.data_.ID+"-&-ZYWL-&-TakeOffBillboard"&&!this.TakeOffALTDragPlane_&&this.TakeOffBillboardCoordinate_){let a=Cesium.Cartesian3.fromDegrees(this.TakeOffBillboardCoordinate_.longitude,this.TakeOffBillboardCoordinate_.latitude,this.TakeOffBillboardCoordinate_.altitude),l=k.offsetHeadingPitch2Position(a,i.heading,0,50),D=Cesium.Cartesian3.subtract(a,l.cartesian3,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(D,D),this.TakeOffALTDragPlane_=Cesium.Plane.fromPointNormal(a,D)}}}}};mouseAltLeftUp=A=>{this.TakeOffALTDragPlane_&&(this.TakeOffALTDragPlane_=void 0,this.emitGraphChanged("setTakeOffPoint")),this.ALTDragPlane_&&(this.data_.coordinates[this.ALTDragIndex_].hasOwnProperty("followTheSystem")&&(this.data_.coordinates[this.ALTDragIndex_].followTheSystem=!1),this.emitGraphChanged("update",this.ALTDragIndex_),this.ALTDragPlane_=void 0,this.ALTDragIndex_=void 0)};mouseAltMove=A=>{let r=k.getMapEngineInstance(this.containerID_).scene.camera.getPickRay(A.endPosition);if(this.ALTDragPlane_){let s=Cesium.IntersectionTests.rayPlane(r,this.ALTDragPlane_,new Cesium.Cartesian3);if(s){let o=k.transformCartographic(s);Array.isArray(this.data_.coordinates)&&this.data_.coordinates.length&&(this.data_.coordinates[this.ALTDragIndex_].hasOwnProperty("followTheSystem")&&(this.data_.coordinates[this.ALTDragIndex_].followTheSystem=!1),this.data_.coordinates[this.ALTDragIndex_].altitude=o.height,this.reDraw(),this.ALTDragIndex_===0&&this.reDrawTakeOffBillboard(),this.emitGraphChanging("AltUpdate",this.ALTDragIndex_))}}if(this.TakeOffALTDragPlane_){let s=Cesium.IntersectionTests.rayPlane(r,this.TakeOffALTDragPlane_,new Cesium.Cartesian3);if(s){let o=k.transformCartographic(s);this.TakeOffBillboardCoordinate_&&(this.TakeOffBillboardCoordinate_.altitude=o.height),this.reDrawTakeOffBillboard(!0),this.reDraw()}}};addAltAction=()=>{if(!this.screenSpaceHandler_){let A=k.getMapEngineInstance(this.containerID_);this.screenSpaceHandler_=new Cesium.ScreenSpaceEventHandler(A.scene.canvas)}this.screenSpaceHandler_&&(this.screenSpaceHandler_.getInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN,Cesium.KeyboardEventModifier.ALT)||this.screenSpaceHandler_.setInputAction(A=>{this.mouseAltLeftDown(A)},Cesium.ScreenSpaceEventType.LEFT_DOWN,Cesium.KeyboardEventModifier.ALT),this.screenSpaceHandler_.getInputAction(Cesium.ScreenSpaceEventType.LEFT_UP,Cesium.KeyboardEventModifier.ALT)||this.screenSpaceHandler_.setInputAction(A=>{this.mouseAltLeftUp(A)},Cesium.ScreenSpaceEventType.LEFT_UP,Cesium.KeyboardEventModifier.ALT),this.screenSpaceHandler_.getInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE,Cesium.KeyboardEventModifier.ALT)||this.screenSpaceHandler_.setInputAction(A=>{this.mouseAltMove(A)},Cesium.ScreenSpaceEventType.MOUSE_MOVE,Cesium.KeyboardEventModifier.ALT))};async reDrawPointOfInterest(){let A=k.getMapEngineInstance(this.containerID_);if(this.PointOfInterestCoordinate_){let t=(await k.obtainGroundCartesian3s(A,[this.PointOfInterestCoordinate_],Cesium.ClassificationType.TERRAIN))[0],i=this.data_.ID,r=k.getBillboardCollection(this.containerID_);this.PointOfInterest_?(this.PointOfInterest_.position=t,this.PointOfInterest_.show=this.visible_):this.PointOfInterest_=r.add(new Cesium.Billboard({position:t,id:i+"-&-ZYWL-&-PointOfInterest",show:this.visible_,image:bo.getIconBase64("PointOfInterest.png"),pixelOffset:new Cesium.Cartesian2(0,0),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,width:35,height:40,disableDepthTestDistance:Number.POSITIVE_INFINITY},r))}else this.clearPointOfInterest()}async reDrawTakeOffBillboard(A){let e=k.getMapEngineInstance(this.containerID_);if(this.TakeOffBillboardCoordinate_){let t=this.data_.ID,i=k.transformCartesian3(this.TakeOffBillboardCoordinate_);if(this.TakeOffBillboard_)this.TakeOffBillboard_.position=i,this.TakeOffBillboard_.show=this.visible_;else{let r=k.getBillboardCollection(this.containerID_);this.TakeOffBillboard_=r.add(new Cesium.Billboard({position:i,id:t+"-&-ZYWL-&-TakeOffBillboard",show:this.visible_,image:bo.getIconBase64("TakeOffBillboard.png"),pixelOffset:new Cesium.Cartesian2(0,0),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,width:35,height:35,disableDepthTestDistance:Number.POSITIVE_INFINITY},r))}if(Array.isArray(this.data_.coordinates)&&this.data_.coordinates.length){let r=this.data_.coordinates[0],s=r.altitude,o=this.TakeOffBillboardCoordinate_.altitude;s>o?s-o>this.TakeOffSecureHeight_?(this.TakeOffBillboardCoordinate1_={longitude:this.TakeOffBillboardCoordinate_.longitude,latitude:this.TakeOffBillboardCoordinate_.latitude,altitude:s},this.TakeOffBillboardCoordinate2_=void 0):(this.TakeOffBillboardCoordinate1_={longitude:this.TakeOffBillboardCoordinate_.longitude,latitude:this.TakeOffBillboardCoordinate_.latitude,altitude:o+this.TakeOffSecureHeight_},this.TakeOffBillboardCoordinate2_={longitude:r.longitude,latitude:r.latitude,altitude:o+this.TakeOffSecureHeight_}):(this.TakeOffBillboardCoordinate1_={longitude:this.TakeOffBillboardCoordinate_.longitude,latitude:this.TakeOffBillboardCoordinate_.latitude,altitude:o+this.TakeOffSecureHeight_},this.TakeOffBillboardCoordinate2_={longitude:r.longitude,latitude:r.latitude,altitude:o+this.TakeOffSecureHeight_}),this.clearTakeOffBillboardHeightLabel();let a=k.transformCartesian3(this.TakeOffBillboardCoordinate1_),l;this.TakeOffBillboardCoordinate2_?l=k.transformCartesian3(this.TakeOffBillboardCoordinate2_):l=k.transformCartesian3(r);let D=Cesium.Cartesian3.midpoint(a,i,new Cesium.Cartesian3),P=Cesium.Cartesian3.distance(a,i);P=Number(P.toFixed(1)),this.TakeOffBillboardHeightLabel_=new Yi(this.containerID_),this.TakeOffBillboardHeightLabel_.DataProcessing({ID:t+"-&-ZYWL-&-TakeOffBillboardHeightLabel",center:D,customHTML:{content:`<div style="background-color:rgba(0,0,0,0.8);color:white;text-align: center;padding-bottom: 2px;padding-top: 2px;padding-left: 3px;padding-right: 3px;border-radius: 4px;font-size: 12px;">${P}m</div>`,dx:0,dy:0,presentationMode:1}});let c=Cesium.Cartesian3.midpoint(a,l,new Cesium.Cartesian3),h=Cesium.Cartesian3.distance(a,l);h=Number(h.toFixed(1)),this.TakeOffBillboardDistanceLabel_=new Yi(this.containerID_),this.TakeOffBillboardDistanceLabel_.DataProcessing({ID:t+"-&-ZYWL-&-TakeOffBillboardDistanceLabel",center:c,customHTML:{content:`<div style="background-color:rgba(0,0,0,0.8);color:white;text-align: center;padding-bottom: 2px;padding-top: 2px;padding-left: 3px;padding-right: 3px;border-radius: 4px;font-size: 12px;">${h}m</div>`,dx:0,dy:0,presentationMode:1}});let g=Cesium.Cartesian3.midpoint(k.transformCartesian3(this.data_.coordinates[0]),l,new Cesium.Cartesian3),u=Cesium.Cartesian3.distance(k.transformCartesian3(this.data_.coordinates[0]),l);u=Number(u.toFixed(1)),u!==0&&(this.TakeOffBillboardHeightLabel1_=new Yi(this.containerID_),this.TakeOffBillboardHeightLabel1_.DataProcessing({ID:t+"-&-ZYWL-&-TakeOffBillboardHeightLabel1",center:g,customHTML:{content:`<div style="background-color:rgba(0,0,0,0.8);color:white;text-align: center;padding-bottom: 2px;padding-top: 2px;padding-left: 3px;padding-right: 3px;border-radius: 4px;font-size: 12px;">${u}m</div>`,dx:0,dy:0,presentationMode:1}}))}if(A){let r=await k.obtainGroundCartesian3s(e,[this.TakeOffBillboardCoordinate_],Cesium.ClassificationType.TERRAIN);this.clearTakeOffBillboardGround(),this.TakeOffBillboardGroundCartographic_||(this.TakeOffBillboardGroundCartographic_=k.transformCartographic(r[0]));let s=k.transformCartographic(this.TakeOffBillboardCoordinate_),o;if(s.height>this.TakeOffBillboardGroundCartographic_.height?o=s.height-this.TakeOffBillboardGroundCartographic_.height:o=this.TakeOffBillboardGroundCartographic_.height-s.height,o<1)return;let a=k.transformCartesian3(this.TakeOffBillboardGroundCartographic_);if(this.TakeOffBillboardGround_)this.TakeOffBillboardGround_.position=a,this.TakeOffBillboardGround_.show=this.visible_;else{let l=k.getPointPrimitiveCollection(this.containerID_);this.TakeOffBillboardGround_=l.add(new Cesium.PointPrimitive({position:a,id:t+"-&-ZYWL-&-TakeOffBillboardGround",show:this.visible_,color:Cesium.Color.WHITE,pixelSize:6}))}if(!this.TakeOffBillboardVerticalLine_){let l=new Cesium.PolylineGeometry({positions:[a,i],width:1}),D=new Cesium.GeometryInstance({id:t+"-&-ZYWL-&-TakeOffBillboardVerticalLine",geometry:l}),P=new Cesium.Primitive({geometryInstances:D,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.WHITE}}})}),show:this.visible_,releaseGeometryInstances:!1,asynchronous:!1,allowPicking:!1});this.TakeOffBillboardVerticalLine_=e.scene.primitives.add(P)}}}else this.clearTakeOffBillboard()}reDraw=()=>{this.visible_=this.data_?.visible??!0,this.isClampToGround_=this.data_?.isClampToGround??!1,this.isHighlight_=this.data_?.isHighlight??!1,this.isEditable_=this.data_?.isEditable??!1,this.isDistanceVisible_=this.data_?.isDistanceVisible??!1,this.isPointNumberVisible_=this.data_?.isPointNumberVisible??!1,this.waypointType_=this.data_?.waypointType??2,this.isEditable_&&this.addAltAction(),this.isDelete_=this.data_?.isDelete??!1,this.isCopy_=this.data_?.isCopy??!1,this.defaultHeight_=this.data_?.defaultHeight,this.nodeMode_=this.data_?.nodeMode??"point",this.heightMode_=this.data_?.heightMode??1,this.isContainTakeOffBillboard_=this.data_?.isContainTakeOffBillboard??!1,this.TakeOffSecureHeight_=this.data_?.takeOffSecureHeight??100,this.isContainTakeOffBillboard_&&!this.TakeOffBillboard_&&!this.TakeOffBillboardCoordinate_&&(this.TakeOffBillboardCoordinate_=this.data_?.takeOffBillboardCoordinate,!this.TakeOffBillboardCoordinate_&&this.isEditable_&&k.setCustomCursor(this.containerID_,"TakeOffCursor.png"));const A=this.data_.ID,e=k.getMapEngineInstance(this.containerID_);let t=this.data_?.coordinates,i=[],r;Array.isArray(t)&&(i=t.map(o=>k.getCartesian3FromCoordinate(e,o,this.isClampToGround_))),i.length>0&&(i.length>1?r=Cesium.Cartesian3.divideByScalar(i.reduce((o,a)=>Cesium.Cartesian3.add(o,a,new Cesium.Cartesian3)),i.length,new Cesium.Cartesian3):r=i[0],r=k.getCartesian3FromCartesian3(e,r,this.isClampToGround_));let s=cA.cloneDeep(i);if(this.TakeOffBillboardCoordinate_&&s.length){let o=k.transformCartesian3(this.TakeOffBillboardCoordinate_);if(this.TakeOffBillboardCoordinate1_){let a=k.transformCartesian3(this.TakeOffBillboardCoordinate1_);if(this.TakeOffBillboardCoordinate2_){let l=k.transformCartesian3(this.TakeOffBillboardCoordinate2_);s=[o,a,l]}else s=[o,a]}else{let a=k.transformCartographic(this.TakeOffBillboardCoordinate_);a.height=k.transformCartographic(s[0]).height,s=[o,k.transformCartesian3(a)]}}if(this.polylineAppearance||(this.polylineAppearance=k.getCustomAppearance(k.getAirRouteTexture(),100)),this.polylineHighlightAppearance||(this.polylineHighlightAppearance=k.getCustomAppearance(k.getAirRouteTexture(!0),100)),this.clearGeometry(),this.waypointType_!==2&&this.data_?.coordinates?.length>1){const o=new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"PolylineDash",uniforms:{color:Cesium.Color.fromCssColorString("#00d58f"),gapColor:Cesium.Color.TRANSPARENT,dashLength:15}}})});let a;this.isClampToGround_?a=new Cesium.GroundPolylineGeometry({positions:i,width:2}):a=new Cesium.PolylineGeometry({positions:i,width:2});let l=new Cesium.GeometryInstance({id:A+"-&-ZYWL-&-GeometryEditingPolyline",geometry:a}),D;this.isClampToGround_?(D=new Cesium.GroundPolylinePrimitive({geometryInstances:l,appearance:o,show:this.visible_,asynchronous:!1}),this.geometryInstance_=e.scene.primitives.add(D)):(D=new Cesium.Primitive({geometryInstances:l,appearance:o,show:this.visible_,asynchronous:!1}),this.geometryInstance_=e.scene.primitives.add(D))}if(s.length>1){const a=k.setWaypointType(this.waypointType_,cA.cloneDeep(this.data_?.coordinates)).map(l=>k.transformCartesian3(l));this.isClampToGround_?this.airRouteGeometryInstance_=e.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({id:A+"-&-ZYWL-&-GeometryEditingPolyline-&-AirRoute",geometry:new Cesium.GroundPolylineGeometry({positions:[...s,...a],width:8})}),appearance:this.polylineAppearance,show:this.visible_,asynchronous:!1})):this.airRouteGeometryInstance_=e.scene.primitives.add(new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:A+"-&-ZYWL-&-GeometryEditingPolyline-&-AirRoute",geometry:new Cesium.PolylineGeometry({positions:[...s,...a],width:8})}),appearance:this.polylineAppearance,show:this.visible_,asynchronous:!1}))}this.reDrawPoints(),this.reDrawGroundPoints(),this.reDrawCenterPoints(i),this.reDrawDistanceLabels(i),this.reDrawCenterLabel(r),this.reDrawCenterHTML(r),this.reDrawCustomLabel(i),this.reDrawCustomHTML()};async reDrawPoints(){if(this.visible_&&Array.isArray(this.data_.coordinates)&&this.data_.coordinates.length){let A=k.getMapEngineInstance(this.containerID_),e;if(this.isClampToGround_&&(e=Cesium.ClassificationType.TERRAIN),this.positions_=await k.obtainGroundCartesian3s(A,this.data_.coordinates,e),this.clearPoints(),this.positions_.length===this.data_.coordinates.length){let t;this.nodeMode_==="point"?t=k.getPointPrimitiveCollection(this.containerID_):t=k.getBillboardCollection(this.containerID_);let i=k.getLabelCollection(this.containerID_);for(let r=0;r<this.positions_.length;r++){let s=this.positions_[r],o=this.data_.ID+"-&-ZYWL-&-GeometryEditingPolyline-Point-"+r,a=this.data_.coordinates[r],l=a?.show??!1;if(!this.isEditable_&&!l)continue;let D=a?.symbol;D||(D=this.data_?.symbol);let P;if(this.nodeMode_==="point"){let c=25,h="#fff";if(D&&(c=D?.pixelSize??25,h=D?.pointColor??"#fff"),h=Cesium.Color.fromCssColorString(h),P=t.add(new Cesium.PointPrimitive({position:s,id:o,show:this.visible_,color:h,outlineColor:Cesium.Color.fromCssColorString("#009BCC"),outlineWidth:2,pixelSize:c,disableDepthTestDistance:Number.POSITIVE_INFINITY})),this.isPointNumberVisible_){let g=this.data_.ID+"-&-ZYWL-&-GeometryEditingPolyline-PointNumber-"+r,u=this.pointNumberInstances_.find(Q=>Q.ID===o);if(u)u.primitive.position=s,u.primitive.show=this.visible_?this.isPointNumberVisible_:this.visible_;else{let Q=i.add(new Cesium.Label({position:s,id:g,show:this.visible_?this.isPointNumberVisible_:this.visible_,text:`${r+1}`,font:"14px sans-serif",fillColor:Cesium.Color.fromCssColorString("#009BCC"),outlineColor:Cesium.Color.fromCssColorString("#009BCC"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,disableDepthTestDistance:Number.POSITIVE_INFINITY},i));this.pointNumberInstances_.push({ID:g,index:r,primitive:Q})}}}else{let c=k.getPointIcon(!1,!1),h=20,g=20,u=0,Q=0;D&&(c=D?.image??k.getPointIcon(!1,!1),h=D?.markerWidth??20,g=D?.markerHeight??20,u=D?.markerDx??0,Q=D?.markerDy??0),this.isStartDraw_&&this.data_.coordinates.length>2&&r===this.data_.coordinates.length-1&&(c=D?.imageFinish??k.getPointIcon(!1,!0)),P=t.add(new Cesium.Billboard({position:s,id:o,show:this.visible_,image:c,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,width:h,height:g,pixelOffset:new Cesium.Cartesian2(u,Q),disableDepthTestDistance:Number.POSITIVE_INFINITY},t))}this.billboardInstances_.push({ID:o,index:r,primitive:P})}}}else this.clearPoints()}async reDrawGroundPoints(){let A=this.data_?.isGroundPointVisible??!1,e=this.data_?.isGroundVerticalLineVisible??!1;if(!this.isClampToGround_&&this.visible_&&A&&Array.isArray(this.data_.coordinates)&&this.data_.coordinates.length){let t=k.getMapEngineInstance(this.containerID_);if(this.groundPositions_=await k.obtainGroundCartesian3s(t,this.data_.coordinates,Cesium.ClassificationType.TERRAIN),this.clearGroundPoints(),this.clearGroundVerticalLines(),this.groundPositions_.length===this.data_.coordinates.length){let i=k.getPointPrimitiveCollection(this.containerID_);for(let r=0;r<this.groundPositions_.length;r++){let s=this.data_.ID+"-&-ZYWL-&-GeometryEditingPolyline-GroundPoint-"+r,o=this.groundPositions_[r];if(this.groundPointsInstances_.push({ID:s,index:r,primitive:i.add(new Cesium.PointPrimitive({position:o,id:s,color:Cesium.Color.fromCssColorString("#fff"),pixelSize:8}))}),e){let a=this.data_.ID+"-&-ZYWL-&-GeometryEditingPolyline-VerticalLine-"+r,l=this.data_.coordinates[r],D=new Cesium.PolylineGeometry({positions:[k.transformCartesian3(l),this.groundPositions_[r]],width:3}),P=new Cesium.GeometryInstance({id:a,geometry:D}),c=new Cesium.Primitive({geometryInstances:P,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"PolylineDash",uniforms:{color:Cesium.Color.fromCssColorString("#fff"),gapColor:Cesium.Color.TRANSPARENT,dashLength:15}}})}),releaseGeometryInstances:!1,asynchronous:!1,allowPicking:!1});this.groundVerticalLinesInstances_.push({ID:s,index:r,primitive:t.scene.primitives.add(c)})}}}}else this.clearGroundPoints(),this.clearGroundVerticalLines()}reDrawCenterPoints=A=>{this.clearCenterPoints();let e=k.getMapEngineInstance(this.containerID_);if(e&&this.visible_&&this.isEditable_&&!this.isStartDraw_){let t=k.getBillboardCollection(this.containerID_);for(let i=0;i<A.length-1;i++){let r=this.data_.ID+"-&-ZYWL-&-GeometryEditingPolyline-CenterPoint-"+i,s=A[i],o=A[i+1],a=Cesium.Cartesian3.midpoint(s,o,new Cesium.Cartesian3);a=k.getCartesian3FromCartesian3(e,a,this.isClampToGround_);const l=k.getDotPitchIcon(),D=18,P=18,c=t.add(new Cesium.Billboard({position:a,id:r,show:this.visible_,image:l,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,width:D,height:P,disableDepthTestDistance:Number.POSITIVE_INFINITY},t));this.pointInstances_.push({ID:r,index:i,primitive:c})}}};reDrawDistanceLabels=A=>{this.clearDistanceLabels();let e=k.getMapEngineInstance(this.containerID_),t=this.data_?.coordinates;if(e&&this.visible_&&(this.isEditable_||!this.isEditable_&&this.isDistanceVisible_)&&t&&t.length>=2)for(let i=0;i<A.length-1;i++){let r=this.data_.ID+"-&-ZYWL-&-GeometryEditingPolyline-DistanceLabel-"+i,s=A[i],o=A[i+1],a=Cesium.Cartesian3.midpoint(s,o,new Cesium.Cartesian3);a=k.getCartesian3FromCartesian3(e,a,this.isClampToGround_);let l=Cesium.Cartesian3.distance(s,o),D;l>1e3?(l=l/1e3,l=Number(l.toFixed(2)),D=`${l}km`):(l=Number(l.toFixed(2)),D=`${l}m`);let P=new Yi(this.containerID_),c=0;this.visible_&&this.isEditable_&&!this.isStartDraw_&&(c=-20),P.DataProcessing({ID:r,center:a,customHTML:{content:`<div style="background-color:rgba(0,0,0,0.8);color:white;text-align: center;padding-bottom: 2px;padding-top: 2px;padding-left: 3px;padding-right: 3px;border-radius: 4px;font-size: 12px;">${D}</div>`,dx:0,dy:c,presentationMode:1}}),this.distanceLabelInstances_.push(P)}};reDrawCenterLabel=A=>{let e=k.getMapEngineInstance(this.containerID_),t=this.data_?.customLabel;if(e&&this.visible_&&t&&A){let i=k.getLabelCollection(this.containerID_),r=this.data_.ID+"-&-ZYWL-&-CenterLabel-0",s=t?.show??!1,o=t?.content??"",a=t?.showBackground??!1,l=t?.dx??0,D=t?.dy??0;this.centerLabelInstance_?(this.centerLabelInstance_.position=A,this.centerLabelInstance_.show=s,this.centerLabelInstance_.text=o,this.centerLabelInstance_.showBackground=a,this.centerLabelInstance_.pixelOffset=new Cesium.Cartesian2(l,D)):this.centerLabelInstance_=i.add(new Cesium.Label({position:A,id:r,show:s,text:o,font:"18px sans-serif",showBackground:a,backgroundColor:Cesium.Color.BLACK.withAlpha(.9),pixelOffset:new Cesium.Cartesian2(l,D),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,disableDepthTestDistance:Number.POSITIVE_INFINITY},i))}else this.clearCenterLabel()};reDrawCenterHTML=A=>{this.clearCenterHTML();let e=k.getMapEngineInstance(this.containerID_),t=this.data_?.customHTML;e&&this.visible_&&t&&A&&(this.centerHTMLInstance_=new Yi(this.containerID_),this.centerHTMLInstance_.DataProcessing({ID:this.data_.ID+"-&-ZYWL-&-CenterHTML-0",center:A,customHTML:t}))};reDrawCustomLabel=A=>{if(k.getMapEngineInstance(this.containerID_)&&this.visible_){if(A.length<1){this.clearCustomLabel();return}A.length!==this.customLabelInstances_.length&&this.clearCustomLabel();let t=k.getLabelCollection(this.containerID_),i=this.data_?.coordinates;for(let r=0;r<A.length;r++){let s=A[r],a=i[r]?.customLabel;if(a){let l=this.data_.ID+"-&-ZYWL-&-CustomLabel-"+r,D=a?.show??!1,P=a?.content??"",c=a?.showBackground??!1,h=a?.dx??0,g=a?.dy??0,u=this.customLabelInstances_.find(Q=>Q.ID===l);if(u)u.primitive.position=s,u.primitive.show=D,u.primitive.text=P,u.primitive.showBackground=c,u.primitive.pixelOffset=new Cesium.Cartesian2(h,g);else{let Q=t.add(new Cesium.Label({position:s,id:l,show:D,text:P,font:"18px sans-serif",showBackground:c,backgroundColor:Cesium.Color.BLACK.withAlpha(.9),pixelOffset:new Cesium.Cartesian2(h,g),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,disableDepthTestDistance:Number.POSITIVE_INFINITY},t));this.customLabelInstances_.push({ID:l,index:r,primitive:Q})}}}}else this.clearCustomLabel()};reDrawCustomHTML=()=>{if(this.clearCustomHTML(),this.visible_&&Array.isArray(this.positions_)&&this.positions_.length&&this.positions_.length===this.data_.coordinates.length)for(let A=0;A<this.positions_.length;A++){let t=this.data_.coordinates[A]?.customHTML;if(t){let i=new Yi(this.containerID_);i.DataProcessing({ID:this.data_.ID+"-&-ZYWL-&-CustomHTML-"+A,center:this.positions_[A],customHTML:t}),this.customHTMLInstances_.push(i)}}};primitivesHighlighted=(A,e,t)=>{this.isStartDraw_||this.isEditable_||(k.HighlightHTMLs(A,this.customHTMLInstances_,t),k.HighlightHTML(A,this.centerHTMLInstance_),this.isHighlight_&&this.airRouteGeometryInstance_&&(this.polylineHighlightAppearance&&A&&this.airRouteGeometryInstance_.appearance!==this.polylineHighlightAppearance&&(this.airRouteGeometryInstance_.appearance=this.polylineHighlightAppearance),this.polylineAppearance&&!A&&this.airRouteGeometryInstance_.appearance!==this.polylineAppearance&&(this.airRouteGeometryInstance_.appearance=this.polylineAppearance)))};clear=()=>{window.EditElement=void 0,k.recoverCursor(this.containerID_,"TakeOffCursor.png"),this.clearScreenSpaceHandler(),this.clearPointOfInterest(),this.clearTakeOffBillboard(),this.clearGeometry(),this.clearPoints(),this.clearGroundPoints(),this.clearGroundVerticalLines(),this.clearCenterPoints(),this.clearDistanceLabels(),this.clearCenterLabel(),this.clearCenterHTML(),this.clearCustomLabel(),this.clearCustomHTML(),this.positions_=[],this.groundPositions_=[]};clearScreenSpaceHandler=()=>{this.screenSpaceHandler_&&(this.screenSpaceHandler_.getInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN,Cesium.KeyboardEventModifier.ALT)&&this.screenSpaceHandler_.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN,Cesium.KeyboardEventModifier.ALT),this.screenSpaceHandler_.getInputAction(Cesium.ScreenSpaceEventType.LEFT_UP,Cesium.KeyboardEventModifier.ALT)&&this.screenSpaceHandler_.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP,Cesium.KeyboardEventModifier.ALT),this.screenSpaceHandler_.getInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE,Cesium.KeyboardEventModifier.ALT)&&this.screenSpaceHandler_.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE,Cesium.KeyboardEventModifier.ALT),this.screenSpaceHandler_.getInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE)&&this.screenSpaceHandler_.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.screenSpaceHandler_=void 0)};clearPointOfInterest=()=>{let A=k.getBillboardCollection(this.containerID_);this.PointOfInterest_&&A&&A.remove(this.PointOfInterest_),this.PointOfInterest_=void 0,this.PointOfInterestCoordinate_=void 0,window.isPointOfInterestOpen=!1};clearTakeOffBillboard=()=>{let A=k.getBillboardCollection(this.containerID_);this.TakeOffBillboard_&&A&&A.remove(this.TakeOffBillboard_),this.TakeOffBillboard_=void 0,this.TakeOffBillboardCoordinate_=void 0,this.TakeOffBillboardCoordinate1_=void 0,this.TakeOffBillboardCoordinate2_=void 0,this.TakeOffBillboardGroundCartographic_=void 0,this.clearTakeOffBillboardGround(),this.clearTakeOffBillboardHeightLabel()};clearTakeOffBillboardGround=()=>{let A=k.getPointPrimitiveCollection(this.containerID_);this.TakeOffBillboardGround_&&A&&A.remove(this.TakeOffBillboardGround_);let e=k.getMapEngineInstance(this.containerID_);this.TakeOffBillboardVerticalLine_&&e&&e?.scene&&e?.scene?.primitives&&e.scene.primitives.remove(this.TakeOffBillboardVerticalLine_),this.TakeOffBillboardGround_=void 0,this.TakeOffBillboardVerticalLine_=void 0};clearTakeOffBillboardHeightLabel=()=>{this.TakeOffBillboardHeightLabel_&&this.TakeOffBillboardHeightLabel_.clear(),this.TakeOffBillboardHeightLabel_=void 0,this.TakeOffBillboardHeightLabel1_&&this.TakeOffBillboardHeightLabel1_.clear(),this.TakeOffBillboardHeightLabel1_=void 0,this.TakeOffBillboardDistanceLabel_&&this.TakeOffBillboardDistanceLabel_.clear(),this.TakeOffBillboardDistanceLabel_=void 0};clearGeometry=()=>{let A=k.getMapEngineInstance(this.containerID_);A&&A?.scene&&A?.scene?.primitives&&(this.geometryInstance_&&A.scene.primitives.remove(this.geometryInstance_),this.airRouteGeometryInstance_&&A.scene.primitives.remove(this.airRouteGeometryInstance_)),this.geometryInstance_=void 0,this.airRouteGeometryInstance_=void 0};clearPoints=()=>{const A=k.getPointPrimitiveCollection(this.containerID_),e=k.getBillboardCollection(this.containerID_);if(this.billboardInstances_&&(A||e))for(const i of this.billboardInstances_)i.primitive instanceof Cesium.PointPrimitive?A.remove(i.primitive):e.remove(i.primitive);this.billboardInstances_=[];const t=k.getLabelCollection(this.containerID_);if(this.pointNumberInstances_&&t)for(const i of this.pointNumberInstances_)t.remove(i.primitive);this.pointNumberInstances_=[]};clearGroundPoints=()=>{let A=k.getPointPrimitiveCollection(this.containerID_);if(this.groundPointsInstances_&&A)for(const e of this.groundPointsInstances_)A.remove(e.primitive);this.groundPointsInstances_=[]};clearGroundVerticalLines=()=>{let A=k.getMapEngineInstance(this.containerID_);if(this.groundVerticalLinesInstances_&&A&&A?.scene&&A?.scene?.primitives)for(const e of this.groundVerticalLinesInstances_)A.scene.primitives.remove(e.primitive);this.groundVerticalLinesInstances_=[]};clearCenterPoints=()=>{const A=k.getBillboardCollection(this.containerID_);if(this.pointInstances_&&A)for(const e of this.pointInstances_)A.remove(e.primitive);this.pointInstances_=[]};clearDistanceLabels=()=>{if(this.distanceLabelInstances_)for(const A of this.distanceLabelInstances_)A.clear();this.distanceLabelInstances_=[]};clearCenterLabel=()=>{let A=k.getLabelCollection(this.containerID_);this.centerLabelInstance_&&A&&A.remove(this.centerLabelInstance_),this.centerLabelInstance_=void 0};clearCenterHTML=()=>{this.centerHTMLInstance_&&this.centerHTMLInstance_.clear(),this.centerHTMLInstance_=void 0};clearCustomLabel=()=>{let A=k.getLabelCollection(this.containerID_);if(this.customLabelInstances_&&A)for(const e of this.customLabelInstances_)A.remove(e.primitive);this.customLabelInstances_=[]};clearCustomHTML=()=>{if(this.customHTMLInstances_)for(const A of this.customHTMLInstances_)A.clear();this.customHTMLInstances_=[]}}const Vo=[];for(let n=0;n<256;++n)Vo.push((n+256).toString(16).slice(1));function JDA(n,A=0){return(Vo[n[A+0]]+Vo[n[A+1]]+Vo[n[A+2]]+Vo[n[A+3]]+"-"+Vo[n[A+4]]+Vo[n[A+5]]+"-"+Vo[n[A+6]]+Vo[n[A+7]]+"-"+Vo[n[A+8]]+Vo[n[A+9]]+"-"+Vo[n[A+10]]+Vo[n[A+11]]+Vo[n[A+12]]+Vo[n[A+13]]+Vo[n[A+14]]+Vo[n[A+15]]).toLowerCase()}let Yb;const GDA=new Uint8Array(16);function ZDA(){if(!Yb){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Yb=crypto.getRandomValues.bind(crypto)}return Yb(GDA)}const VR={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function KDA(n,A,e){n=n||{};const t=n.random??n.rng?.()??ZDA();if(t.length<16)throw new Error("Random bytes length must be >= 16");return t[6]=t[6]&15|64,t[8]=t[8]&63|128,JDA(t)}function rw(n,A,e){return VR.randomUUID&&!n?VR.randomUUID():KDA(n)}class x0{constructor(A,e={}){A&&A instanceof Cesium.Viewer&&(this._drawLayer=new Cesium.CustomDataSource("measureLayer"),A&&A.dataSources.add(this._drawLayer),this._basePath=e.basePath||"",this._viewer=A,this.handlers_=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas))}transformWGS84ToCartesian(A,e){if(this._viewer)return A?Cesium.Cartesian3.fromDegrees(A.lng||A.lon,A.lat,A.alt=e||A.alt,Cesium.Ellipsoid.WGS84):Cesium.Cartesian3.ZERO}transformWGS84ArrayToCartesianArray(A,e){if(this._viewer&&A){var t=this;return A?A.map(function(i){return t.transformWGS84ToCartesian(i,e)}):[]}}transformCartesianToWGS84(A){if(this._viewer&&A){var e=Cesium.Ellipsoid.WGS84,t=e.cartesianToCartographic(A);return{lng:Cesium.Math.toDegrees(t.longitude),lat:Cesium.Math.toDegrees(t.latitude),alt:t.height}}}transformCartesianArrayToWGS84Array(A){if(this._viewer){var e=this;return A?A.map(function(t){return e.transformCartesianToWGS84(t)}):[]}}transformWGS84ToCartographic(A){return A?Cesium.Cartographic.fromDegrees(A.lng||A.lon,A.lat,A.alt):Cesium.Cartographic.ZERO}getCatesian3FromPX(A){if(this._viewer&&A)return k.getCartesian(this._viewer.scene,A)}getPositionDistance(A){let e=0;for(let t=0;t<A.length-1;t++){let i=this.transformWGS84ToCartographic(A[t]),r=this.transformWGS84ToCartographic(A[t+1]),s=new Cesium.EllipsoidGeodesic;s.setEndPoints(i,r);let o=s.surfaceDistance;o=Math.sqrt(Math.pow(o,2)+Math.pow(r.height-i.height,2)),e=e+o}return e.toFixed(3)}getPositionsArea(A){let e=0;if(A){let t=0,i=Cesium.Ellipsoid.WGS84;A.push(A[0]);for(let r=1;r<A.length;r++){let s=i.cartographicToCartesian(this.transformWGS84ToCartographic(A[r-1])),o=i.cartographicToCartesian(this.transformWGS84ToCartographic(A[r]));t+=s.x*o.y-o.x*s.y}e=Math.abs(t).toFixed(2)}return e}drawLineMeasureGraphics(A={}){if(this._viewer&&A){let a=function(l,D,P,c){var h=new Cesium.Entity({id:l+"-&ZYWL&-LineMeasureGraphicsLabel-&ZYWL&-"+c});h.position=D,h.point={pixelSize:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:P.pointMaterial||Cesium.Color.BLUE.withAlpha(.8),outlineColor:P.pointoutlineMaterial||Cesium.Color.BLUE.withAlpha(.8),outlineWidth:P.outlineWidth||3};let g=i.getPositionDistance(i.transformCartesianArrayToWGS84Array(e))*1;g>1e3?g=(g/1e3).toFixed(1)+"公里":g=g.toFixed(1)+"米",h.label={text:g,show:!0,showBackground:!0,backgroundColor:Cesium.Color.BLACK.withAlpha(.9),font:"12px sans-serif",horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.CENTER,pixelOffset:new Cesium.Cartesian2(10,0),disableDepthTestDistance:Number.POSITIVE_INFINITY},i._drawLayer.entities.add(h)},e=[],t=new Cesium.Entity,i=this,r,s=rw(),o=this;this.handlers_.setInputAction(function(l){let D=i.getCatesian3FromPX(l.position),P=o._viewer.scene.pick(l.position);if(P&&P.primitive instanceof Cesium.PointPrimitive&&P.id instanceof Cesium.Entity){let c=P.id.id,h=c.split("-&ZYWL&-")[0],g=Number(c.split("-&ZYWL&-")[2]);if(h===s&&g===e.length-1){e.length>=2&&(e.splice(e.length-1,1),o.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),o.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),o.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK),o.handlers_.destroy(),o.handlers_=void 0,typeof A.callback=="function"&&A.callback(i.transformCartesianArrayToWGS84Array(e),r),o.handlers_=new Cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas),o.drawLineMeasureGraphics(A));return}}D&&(e.length===0||e.splice(e.length-1,1),e.push(D.clone()),a(s,D,A,e.length),e.push(D))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handlers_.setInputAction(function(l){let D=i.getCatesian3FromPX(l.endPosition);D&&e.length>=2&&(e[e.length-1]=D)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handlers_.setInputAction(function(l){let D=i.getCatesian3FromPX(l.position),P=o._viewer.scene.pick(l.position);if(P&&P.primitive instanceof Cesium.PointPrimitive&&P.id instanceof Cesium.Entity){let c=P.id.id,h=c.split("-&ZYWL&-")[0],g=Number(c.split("-&ZYWL&-")[2]);h===s&&g===e.length-1&&e.length>=2&&e.splice(e.length-1,1)}else D&&(e.length===0||(e.splice(e.length-1,1),e.push(D.clone()),a(s,D,A,e.length)));o.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),o.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),o.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK),o.handlers_.destroy(),o.handlers_=void 0,o._viewer.container.style.cursor="default",typeof A.callback=="function"&&A.callback(i.transformCartesianArrayToWGS84Array(e),r)},Cesium.ScreenSpaceEventType.RIGHT_CLICK),t.polyline={width:A.width||3,material:A.material||Cesium.Color.BLUE.withAlpha(.8),clampToGround:A.clampToGround||!0},t.polyline.positions=new Cesium.CallbackProperty(function(){return e},!1),r=this._drawLayer.entities.add(t)}}drawAreaMeasureGraphics(A={}){if(this._viewer&&A){let l=function(){i.polyline={width:A.width||3,material:A.material||Cesium.Color.BLUE.withAlpha(.8),clampToGround:A.clampToGround||!0},i.polyline.positions=new Cesium.CallbackProperty(function(){return e},!1),i.polygon={hierarchy:new Cesium.CallbackProperty(function(){return t},!1),material:A.material?Cesium.Color.fromAlpha(A.material,.3):Cesium.Color.WHITE.withAlpha(.3),clampToGround:A.clampToGround||!0},s=r._drawLayer.entities.add(i)},D=function(P,c,h,g,u){if(!window.isStartBoxSelection){var Q=new Cesium.Entity({id:P+"-&ZYWL&-AreaMeasureGraphicsLabel-&ZYWL&-"+g});if(Q.position=c,!u)Q.point={pixelSize:10,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:h.pointMaterial||Cesium.Color.BLUE.withAlpha(.8),outlineColor:h.pointoutlineMaterial||Cesium.Color.BLUE.withAlpha(.8),outlineWidth:h.outlineWidth||3};else{let w=r.getPositionsArea(r.transformCartesianArrayToWGS84Array(e))*1;w>1e6?w=(w/1e6).toFixed(1)+"平方公里":w=w.toFixed(1)+"平方米",Q.label={text:w,show:!0,showBackground:!0,backgroundColor:Cesium.Color.BLACK.withAlpha(.9),font:"12px sans-serif",horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.CENTER,pixelOffset:new Cesium.Cartesian2(10,0),disableDepthTestDistance:Number.POSITIVE_INFINITY}}r._drawLayer.entities.add(Q)}};var e=[],t=new Cesium.PolygonHierarchy,i=new Cesium.Entity,r=this,s=null,o=rw();let a=this;this.isDrawing=!1,this.handlers_.setInputAction(function(P){a.isDrawing||(a.isDrawing=!0,window.isStartBoxSelection&&i&&(a._drawLayer.entities.remove(i),e=[],t=new Cesium.PolygonHierarchy,i=new Cesium.Entity,s=null));let c=r.getCatesian3FromPX(P.position),h=a._viewer.scene.pick(P.position);if(h&&h.primitive instanceof Cesium.PointPrimitive&&h.id instanceof Cesium.Entity){let g=h.id.id,u=g.split("-&ZYWL&-")[0],Q=Number(g.split("-&ZYWL&-")[2]);if(u===o&&(Q===e.length-1||Q===1)){e.length>=3&&t.positions.length>=3&&(e.splice(e.length-1,1),t.positions.splice(t.positions.length-1,1),a.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),a.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),a.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK),a.handlers_.destroy(),a.handlers_=void 0,e.push(e[0]),t.positions.push(t.positions[0]),D(o,c,A,e.length,!0),typeof A.callback=="function"&&A.callback(r.transformCartesianArrayToWGS84Array(e),s),a.handlers_=new Cesium.ScreenSpaceEventHandler(a._viewer.scene.canvas),a.drawAreaMeasureGraphics(A));return}}c&&(e.length===0||(e.splice(e.length-1,1),t.positions.splice(t.positions.length-1,1)),e.push(c.clone()),t.positions.push(c.clone()),D(o,c,A,e.length,!1),e.push(c),t.positions.push(c),s||l())},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handlers_.setInputAction(function(P){if(!a.isDrawing)return;let c=r.getCatesian3FromPX(P.endPosition);c&&e.length>=2&&t.positions.length>=2&&(e[e.length-1]=c,t.positions[t.positions.length-1]=c)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handlers_.setInputAction(function(P){if(a.isDrawing=!1,window.isStartBoxSelection&&i)i.polyline.show=!1;else{a.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),a.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),a.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK),a.handlers_.destroy(),a.handlers_=void 0,a._viewer.container.style.cursor="default";let c=r.getCatesian3FromPX(P.position),h=a._viewer.scene.pick(P.position);if(h&&h.primitive instanceof Cesium.PointPrimitive&&h.id instanceof Cesium.Entity){let g=h.id.id,u=g.split("-&ZYWL&-")[0],Q=Number(g.split("-&ZYWL&-")[2]);u===o&&Q===e.length-1&&e.length>=3&&t.positions.length>=3&&(e.splice(e.length-1,1),t.positions.splice(t.positions.length-1,1))}else c&&e.length!==0&&t.positions.length!==0&&(D(o,c,A,e.length),e.push(c),t.positions.push(c))}e.length!==0&&t.positions.length!==0&&(e.push(e[0]),t.positions.push(t.positions[0]),typeof A.callback=="function"&&A.callback(r.transformCartesianArrayToWGS84Array(e),s))},Cesium.ScreenSpaceEventType.RIGHT_CLICK)}}drawTrianglesMeasureGraphics(A={}){if(A.style=A.style||{width:3,material:Cesium.Color.BLUE.withAlpha(.5)},this._viewer&&A){let P=function(c){if(!c.length)s=[],o=[];else{let h=k.transformCartographic(c[0]),g=k.transformCartographic(c[1]),u,Q,w,C;h.height>g.height?(u=cA.cloneDeep(g),u.height=h.height,Q=k.transformCartesian3(g),C=k.transformCartesian3(h)):(u=cA.cloneDeep(h),u.height=g.height,Q=k.transformCartesian3(h),C=k.transformCartesian3(g)),w=k.transformCartesian3(u),s=[w,Q],o=[w,C]}};var e=new Cesium.Entity,t=new Cesium.Entity,i=new Cesium.Entity,r=[],s=[],o=[],a=this,l=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),D=!1;l.setInputAction(function(c){const h=a.getCatesian3FromPX(c.position);if(!h&&!h.z)return!1;r.length&&!D&&(D=!0,r=[],P(r)),r.length===0?(D=!0,r=[cA.cloneDeep(h),cA.cloneDeep(h)],P(r)):(D=!1,typeof A.callback=="function"&&A.callback({triangles:Cesium.Cartesian3.distance(r[0],r[1]).toFixed(2)*1,vertical:Cesium.Cartesian3.distance(s[0],s[1]).toFixed(2)*1,horizontal:Cesium.Cartesian3.distance(o[0],o[1]).toFixed(2)*1}))},Cesium.ScreenSpaceEventType.LEFT_CLICK),l.setInputAction(function(c){if(D){const h=a.getCatesian3FromPX(c.endPosition);h&&r.length&&(r[1]=cA.cloneDeep(h),P(r))}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),e.polyline={positions:new Cesium.CallbackProperty(()=>r,!1),width:4,material:Cesium.Color.fromCssColorString("#00C8DF")},e.position=new Cesium.CallbackProperty(()=>r.length===2?Cesium.Cartesian3.midpoint(r[0],r[1],new Cesium.Cartesian3):r[0],!1),e.label={text:new Cesium.CallbackProperty(()=>r.length===2?Cesium.Cartesian3.distance(r[0],r[1]).toFixed(2)+"米":"",!1),show:!0,showBackground:!0,font:"12px sans-serif",horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,pixelOffset:new Cesium.Cartesian2(0,0),disableDepthTestDistance:Number.POSITIVE_INFINITY},t.polyline={positions:new Cesium.CallbackProperty(()=>s,!1),width:4,material:Cesium.Color.fromCssColorString("#00C8DF")},t.position=new Cesium.CallbackProperty(()=>s.length===2?Cesium.Cartesian3.midpoint(s[0],s[1],new Cesium.Cartesian3):s[0],!1),t.label={text:new Cesium.CallbackProperty(()=>s.length===2?Cesium.Cartesian3.distance(s[0],s[1]).toFixed(2)+"米":"",!1),show:!0,showBackground:!0,font:"12px sans-serif",horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,pixelOffset:new Cesium.Cartesian2(0,0),disableDepthTestDistance:Number.POSITIVE_INFINITY},i.polyline={positions:new Cesium.CallbackProperty(()=>o,!1),width:4,material:Cesium.Color.fromCssColorString("#00C8DF")},i.position=new Cesium.CallbackProperty(()=>o.length===2?Cesium.Cartesian3.midpoint(o[0],o[1],new Cesium.Cartesian3):o[1],!1),i.label={text:new Cesium.CallbackProperty(()=>o.length===2?Cesium.Cartesian3.distance(o[0],o[1]).toFixed(2)+"米":"",!1),show:!0,showBackground:!0,font:"12px sans-serif",horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,pixelOffset:new Cesium.Cartesian2(0,0),disableDepthTestDistance:Number.POSITIVE_INFINITY},this._drawLayer.entities.add(i),this._drawLayer.entities.add(t),this._drawLayer.entities.add(e)}}drawSectionalMeasureGraphics(A={}){if(this._viewer&&A){let o=function(a){if(a.length===2){const l=Cesium.Cartesian3.distance(a[0],a[1]),D=A?.unit??1,P=l/D;let c=[];for(let h=0;h<P;h++){let g=Cesium.Cartesian3.lerp(a[0],a[1],h/P,new Cesium.Cartesian3);c.push(g)}c.length&&i._viewer.scene.clampToHeightMostDetailed(c).then(h=>{typeof A.callback=="function"&&A.callback(h.map(g=>k.transformCoordinate(g)))})}};var e=new Cesium.Entity,t=[],i=this,r=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),s=!1;r.setInputAction(a=>{let l=this.getCatesian3FromPX(a.position);if(!l&&!l.z)return!1;Cesium.sampleTerrain(this._viewer.scene.terrainProvider,window.terrainMaximumLevel,[k.transformCartographic(l)]).then(D=>{l=k.transformCartesian3(D[0]),t.length&&!s&&(s=!0,t=[]),t.length===0?(s=!0,t=[cA.cloneDeep(l),cA.cloneDeep(l)]):(s=!1,o(t))})},Cesium.ScreenSpaceEventType.LEFT_CLICK),r.setInputAction(a=>{if(s){let l=i.getCatesian3FromPX(a.endPosition);l&&t.length&&Cesium.sampleTerrain(this._viewer.scene.terrainProvider,window.terrainMaximumLevel,[k.transformCartographic(l)]).then(D=>{l=k.transformCartesian3(D[0]),t[1]=cA.cloneDeep(l)})}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),e.polyline={positions:new Cesium.CallbackProperty(()=>t,!1),width:4,material:Cesium.Color.fromCssColorString("#00C8DF"),clampToGround:!0},this._drawLayer.entities.add(e)}}}var di={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function VDA(n="soft"){switch(n){case"auto":{di.session.styleMap=new Map,di.session.nodeMap=new Map;return}case"soft":{di.session.styleMap=new Map,di.session.nodeMap=new Map,di.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{di.session.styleMap=new Map,di.session.nodeMap=new Map,di.session.styleCache=new WeakMap,di.computedStyle=new WeakMap,di.baseStyle=new Map,di.defaultStyle=new Map,di.image=new Map,di.background=new Map,di.resource=new Map,di.font=new Set;return}default:{di.session.styleMap=new Map,di.session.nodeMap=new Map,di.session.styleCache=new WeakMap;return}}}function Hb(n){const A=n.match(/url\((['"]?)(.*?)(\1)\)/);if(!A)return null;const e=A[2].trim();return e.startsWith("#")?null:e}function qDA(n){if(!n||n==="none")return"";let A=n.replace(/translate[XY]?\([^)]*\)/g,"");return A=A.replace(/matrix\(([^)]+)\)/g,(e,t)=>{const i=t.split(",").map(r=>r.trim());return i.length!==6?`matrix(${t})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),A=A.replace(/matrix3d\(([^)]+)\)/g,(e,t)=>{const i=t.split(",").map(r=>r.trim());return i.length!==16?`matrix3d(${t})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),A.trim().replace(/\s{2,}/g," ")}function LM(n){if(/%[0-9A-Fa-f]{2}/.test(n))return n;try{return encodeURI(n)}catch{return n}}function WDA(n="[snapDOM]",{ttlMs:A=5*6e4,maxEntries:e=12}={}){const t=new Map;let i=0;function r(s,o,a){if(i>=e)return;const l=Date.now();(t.get(o)||0)>l||(t.set(o,l+A),i++,s==="warn"&&console&&console.warn?console.warn(`${n} ${a}`):console&&console.error&&console.error(`${n} ${a}`))}return{warnOnce(s,o){r("warn",s,o)},errorOnce(s,o){r("error",s,o)},reset(){t.clear(),i=0}}}var qR=WDA("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Jb=new Map,UM=new Map;function XDA(n){return/^data:|^blob:|^about:blank$/i.test(n)}function _DA(n,A){try{const e=typeof location<"u"&&location.href?location.href:"http://localhost/",t=A.includes("{url}")?A.split("{url}")[0]:A,i=new URL(t||".",e),r=new URL(n,e);if(r.origin===i.origin)return!0;const s=r.searchParams;if(s&&(s.has("url")||s.has("target")))return!0}catch{}return!1}function $DA(n,A){if(!A||XDA(n)||_DA(n,A))return!1;try{const e=typeof location<"u"&&location.href?location.href:"http://localhost/",t=new URL(n,e);return typeof location<"u"?t.origin!==location.origin:!0}catch{return!!A}}function APA(n,A){if(!A)return n;if(A.includes("{url}"))return A.replace("{urlRaw}",LM(n)).replace("{url}",encodeURIComponent(n));if(/[?&]url=?$/.test(A))return`${A}${encodeURIComponent(n)}`;if(A.endsWith("?"))return`${A}url=${encodeURIComponent(n)}`;if(A.endsWith("/"))return`${A}${LM(n)}`;const e=A.includes("?")?"&":"?";return`${A}${e}url=${encodeURIComponent(n)}`}function WR(n){return new Promise((A,e)=>{const t=new FileReader;t.onload=()=>A(String(t.result||"")),t.onerror=()=>e(new Error("read_failed")),t.readAsDataURL(n)})}function ePA(n,A){return[A.as||"blob",A.timeout??3e3,A.useProxy||"",A.errorTTL??8e3,n].join("|")}async function $P(n,A={}){const e=A.as??"blob",t=A.timeout??3e3,i=A.useProxy||"",r=A.errorTTL??8e3,s=A.headers||{},o=!!A.silent;if(/^data:/i.test(n))try{if(e==="text")return{ok:!0,data:String(n),status:200,url:n,fromCache:!1};if(e==="dataURL")return{ok:!0,data:String(n),status:200,url:n,fromCache:!1,mime:String(n).slice(5).split(";")[0]||""};const[,Q="",w=""]=String(n).match(/^data:([^,]*),(.*)$/)||[],E=/;base64/i.test(Q)?atob(w):decodeURIComponent(w),p=new Uint8Array([...E].map(T=>T.charCodeAt(0))),m=new Blob([p],{type:(Q||"").split(";")[0]||""});return{ok:!0,data:m,status:200,url:n,fromCache:!1,mime:m.type||""}}catch{return{ok:!1,data:null,status:0,url:n,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(n))try{const Q=await fetch(n);if(!Q.ok)return{ok:!1,data:null,status:Q.status,url:n,fromCache:!1,reason:"http_error"};const w=await Q.blob(),C=w.type||Q.headers.get("content-type")||"";return e==="dataURL"?{ok:!0,data:await WR(w),status:Q.status,url:n,fromCache:!1,mime:C}:e==="text"?{ok:!0,data:await w.text(),status:Q.status,url:n,fromCache:!1,mime:C}:{ok:!0,data:w,status:Q.status,url:n,fromCache:!1,mime:C}}catch{return{ok:!1,data:null,status:0,url:n,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(n))return e==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:n,fromCache:!1,mime:"image/png"}:{ok:!0,data:e==="text"?"":new Blob([]),status:200,url:n,fromCache:!1};const a=ePA(n,{as:e,timeout:t,useProxy:i,errorTTL:r}),l=UM.get(a);if(l&&l.until>Date.now())return{...l.result,fromCache:!0};l&&UM.delete(a);const D=Jb.get(a);if(D)return D;const P=$DA(n,i)?APA(n,i):n;let c=A.credentials;if(!c)try{const Q=typeof location<"u"&&location.href?location.href:"http://localhost/",w=new URL(n,Q);c=typeof location<"u"&&w.origin===location.origin?"include":"omit"}catch{c="omit"}const h=new AbortController,g=setTimeout(()=>h.abort("timeout"),t),u=(async()=>{try{const Q=await fetch(P,{signal:h.signal,credentials:c,headers:s});if(!Q.ok){const E={ok:!1,data:null,status:Q.status,url:P,fromCache:!1,reason:"http_error"};if(r>0&&UM.set(a,{until:Date.now()+r,result:E}),!o){const p=`${Q.status} ${Q.statusText||""}`.trim();qR.warnOnce(`http:${Q.status}:${e}:${new URL(n,location?.href??"http://localhost/").origin}`,`HTTP error ${p} while fetching ${e} ${n}`)}return A.onError&&A.onError(E),E}if(e==="text")return{ok:!0,data:await Q.text(),status:Q.status,url:P,fromCache:!1};const w=await Q.blob(),C=w.type||Q.headers.get("content-type")||"";return e==="dataURL"?{ok:!0,data:await WR(w),status:Q.status,url:P,fromCache:!1,mime:C}:{ok:!0,data:w,status:Q.status,url:P,fromCache:!1,mime:C}}catch(Q){const w=Q&&typeof Q=="object"&&"name"in Q&&Q.name==="AbortError"?String(Q.message||"").includes("timeout")?"timeout":"abort":"network",C={ok:!1,data:null,status:0,url:P,fromCache:!1,reason:w};if(!/^blob:/i.test(n)&&r>0&&UM.set(a,{until:Date.now()+r,result:C}),!o){const E=`${w}:${e}:${new URL(n,location?.href??"http://localhost/").origin}`,p=w==="timeout"?`Timeout after ${t}ms. Consider increasing timeout or using a proxy for ${n}`:w==="abort"?`Request aborted while fetching ${e} ${n}`:`Network/CORS issue while fetching ${e} ${n}. A proxy may be required`;qR.errorOnce(E,p)}return A.onError&&A.onError(C),C}finally{clearTimeout(g),Jb.delete(a)}})();return Jb.set(a,u),u}function Gb(n,A){if(!A||!n.width||!n.height)return n;const e=document.createElement("canvas");e.width=n.width,e.height=n.height;const t=e.getContext("2d");return t.fillStyle=A,t.fillRect(0,0,e.width,e.height),t.drawImage(n,0,0),e}async function XR(n,A={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(n)||n.trim()==="none")return n;const t=Hb(n);if(!t)return n;const i=LM(t);if(di.background.has(i)){const r=di.background.get(i);return r?`url("${r}")`:"none"}try{const r=await $P(i,{as:"dataURL",useProxy:A.useProxy});return r.ok?(di.background.set(i,r.data),`url("${r.data}")`):(di.background.set(i,null),"none")}catch{return di.background.set(i,null),"none"}}var tPA=new Set(["meta","script","noscript","title","link","template"]),Zb=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]);function iPA(n){if(n=String(n).toLowerCase(),Zb.has(n)){const r={};return di.defaultStyle.set(n,r),r}if(di.defaultStyle.has(n))return di.defaultStyle.get(n);let A=document.getElementById("snapdom-sandbox");A||(A=document.createElement("div"),A.id="snapdom-sandbox",A.setAttribute("data-snapdom-sandbox","true"),A.setAttribute("aria-hidden","true"),A.style.position="absolute",A.style.left="-9999px",A.style.top="-9999px",A.style.width="0px",A.style.height="0px",A.style.overflow="hidden",document.body.appendChild(A));const e=document.createElement(n);e.style.all="initial",A.appendChild(e);const t=getComputedStyle(e),i={};for(let r of t){if(_R(r))continue;const s=t.getPropertyValue(r);i[r]=s}return A.removeChild(e),di.defaultStyle.set(n,i),i}var nPA=/(?:^|-)(animation|transition)(?:-|$)/i,rPA=/^(--|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,sPA=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope"]);function _R(n){const A=String(n).toLowerCase();return!!(sPA.has(A)||rPA.test(A)||nPA.test(A))}function Kb(n,A){if(A=String(A||"").toLowerCase(),Zb.has(A))return"";const e=[],t=iPA(A);for(let[i,r]of Object.entries(n)){if(_R(i))continue;const s=t[i];r&&r!==s&&e.push(`${i}:${r}`)}return e.sort(),e.join(";")}function oPA(n){const A=new Set;return n.nodeType!==Node.ELEMENT_NODE&&n.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(n.tagName&&A.add(n.tagName.toLowerCase()),typeof n.querySelectorAll=="function"&&n.querySelectorAll("*").forEach(e=>A.add(e.tagName.toLowerCase())),Array.from(A))}function aPA(n){const A=new Map;for(let t of n){const i=di.defaultStyle.get(t);if(!i)continue;const r=Object.entries(i).map(([s,o])=>`${s}:${o};`).sort().join("");r&&(A.has(r)||A.set(r,[]),A.get(r).push(t))}let e="";for(let[t,i]of A.entries())e+=`${i.join(",")} { ${t} }
|
|
26
|
+
}`;var Sn=PaA(function(){return tA(KA,Ki+"return "+Kt).apply(e,fe)});if(Sn.source=Kt,_6(Sn))throw Sn;return Sn}function DAe(I){return Mr(I).toLowerCase()}function PAe(I){return Mr(I).toUpperCase()}function cAe(I,x,G){if(I=Mr(I),I&&(G||x===e))return bf(I);if(!I||!(x=Vs(x)))return I;var oA=$a(I),BA=$a(x),KA=zf(oA,BA),fe=pg(oA,BA)+1;return Nl(oA,KA,fe).join("")}function hAe(I,x,G){if(I=Mr(I),I&&(G||x===e))return I.slice(0,FE(I)+1);if(!I||!(x=Vs(x)))return I;var oA=$a(I),BA=pg(oA,$a(x))+1;return Nl(oA,0,BA).join("")}function gAe(I,x,G){if(I=Mr(I),I&&(G||x===e))return I.replace(fn,"");if(!I||!(x=Vs(x)))return I;var oA=$a(I),BA=zf(oA,$a(x));return Nl(oA,BA).join("")}function uAe(I,x){var G=U,oA=Y;if(Bs(x)){var BA="separator"in x?x.separator:BA;G="length"in x?Nn(x.length):G,oA="omission"in x?Vs(x.omission):oA}I=Mr(I);var KA=I.length;if(WD(I)){var fe=$a(I);KA=fe.length}if(G>=KA)return I;var Ie=G-_D(oA);if(Ie<1)return oA;var Ge=fe?Nl(fe,0,Ie).join(""):I.slice(0,Ie);if(BA===e)return Ge+oA;if(fe&&(Ie+=Ge.length-Ie),$6(BA)){if(I.slice(Ie).search(BA)){var xt,Ut=Ge;for(BA.global||(BA=ee(BA.source,Mr(Dt.exec(BA))+"g")),BA.lastIndex=0;xt=BA.exec(Ut);)var Kt=xt.index;Ge=Ge.slice(0,Kt===e?Ie:Kt)}}else if(I.indexOf(Vs(BA),Ie)!=Ie){var fi=Ge.lastIndexOf(BA);fi>-1&&(Ge=Ge.slice(0,fi))}return Ge+oA}function QAe(I){return I=Mr(I),I&&Ve.test(I)?I.replace(Ke,_c):I}var wAe=iP(function(I,x,G){return I+(G?" ":"")+x.toUpperCase()}),tF=tM("toUpperCase");function DaA(I,x,G){return I=Mr(I),x=G?e:x,x===e?CI(I)?Zo(I):Go(I):I.match(x)||[]}var PaA=zn(function(I,x){try{return Io(I,e,x)}catch(G){return _6(G)?G:new K(G)}}),fAe=nP(function(I,x){return ns(x,function(G){G=$r(G),tP(I,G,W6(I[G],I))}),I});function dAe(I){var x=I==null?0:I.length,G=H();return I=x?Lr(I,function(oA){if(typeof oA[1]!="function")throw new Je(s);return[G(oA[0]),oA[1]]}):[],zn(function(oA){for(var BA=-1;++BA<x;){var KA=I[BA];if(Io(KA[0],this,oA))return Io(KA[1],this,oA)}})}function vAe(I){return dk(tl(I,P))}function iF(I){return function(){return I}}function CAe(I,x){return I==null||I!==I?x:I}var EAe=nM(),BAe=nM(!0);function jl(I){return I}function nF(I){return Ok(typeof I=="function"?I:tl(I,P))}function pAe(I){return _E(tl(I,P))}function mAe(I,x){return kk(I,tl(x,P))}var IAe=zn(function(I,x){return function(G){return za(G,I,x)}}),MAe=zn(function(I,x){return function(G){return za(I,G,x)}});function rF(I,x,G){var oA=Ko(x),BA=Vf(x,oA);G==null&&!(Bs(x)&&(BA.length||!oA.length))&&(G=x,x=I,I=this,BA=Vf(x,Ko(x)));var KA=!(Bs(G)&&"chain"in G)||!!G.chain,fe=Ug(I);return ns(BA,function(Ie){var Ge=x[Ie];I[Ie]=Ge,fe&&(I.prototype[Ie]=function(){var xt=this.__chain__;if(KA||xt){var Ut=I(this.__wrapped__),Kt=Ut.__actions__=qs(this.__actions__);return Kt.push({func:Ge,args:arguments,thisArg:I}),Ut.__chain__=xt,Ut}return Ge.apply(I,yl([this.value()],arguments))})}),I}function TAe(){return rt._===this&&(rt._=$D),this}function sF(){}function yAe(I){return I=Nn(I),zn(function(x){return bk(x,I)})}var OAe=KP(Lr),kAe=KP(Eg),bAe=KP(RP);function caA(I){return ti(I)?pQ($r(I)):zk(I)}function zAe(I){return function(x){return I==null?e:yg(I,x)}}var NAe=JQ(),xAe=JQ(!0);function oF(){return[]}function aF(){return!1}function LAe(){return{}}function UAe(){return""}function jAe(){return!0}function SAe(I,x){if(I=Nn(I),I<1||I>_)return[];var G=iA,oA=ao(I,iA);x=H(x),I-=iA;for(var BA=IQ(oA,x);++G<I;)x(G);return BA}function FAe(I){return In(I)?Lr(I,$r):DD(I)?[I]:qs(Es(Mr(I)))}function RAe(I){var x=++ar;return Mr(I)+x}var YAe=ah(function(I,x){return I+x},0),HAe=P0("ceil"),JAe=ah(function(I,x){return I/x},1),GAe=P0("floor");function ZAe(I){return I&&I.length?UQ(I,jl,jI):e}function KAe(I,x){return I&&I.length?UQ(I,H(x,2),jI):e}function VAe(I){return Of(I,jl)}function qAe(I,x){return Of(I,H(x,2))}function WAe(I){return I&&I.length?UQ(I,jl,FI):e}function XAe(I,x){return I&&I.length?UQ(I,H(x,2),FI):e}var _Ae=ah(function(I,x){return I*x},1),$Ae=P0("round"),Aee=ah(function(I,x){return I-x},0);function eee(I){return I&&I.length?mQ(I,jl):0}function tee(I,x){return I&&I.length?mQ(I,H(x,2)):0}return SA.after=p_A,SA.ary=HoA,SA.assign=P$A,SA.assignIn=iaA,SA.assignInWith=ub,SA.assignWith=c$A,SA.at=h$A,SA.before=JoA,SA.bind=W6,SA.bindAll=fAe,SA.bindKey=GoA,SA.castArray=L_A,SA.chain=FoA,SA.chunk=lh,SA.compact=rP,SA.concat=td,SA.cond=dAe,SA.conforms=vAe,SA.constant=iF,SA.countBy=e_A,SA.create=g$A,SA.curry=ZoA,SA.curryRight=KoA,SA.debounce=VoA,SA.defaults=u$A,SA.defaultsDeep=Q$A,SA.defer=m_A,SA.delay=I_A,SA.difference=Dh,SA.differenceBy=Ph,SA.differenceWith=GQ,SA.drop=ZQ,SA.dropRight=KQ,SA.dropRightWhile=VQ,SA.dropWhile=qQ,SA.fill=WQ,SA.filter=i_A,SA.flatMap=s_A,SA.flatMapDeep=o_A,SA.flatMapDepth=a_A,SA.flatten=XQ,SA.flattenDeep=$k,SA.flattenDepth=Ab,SA.flip=M_A,SA.flow=EAe,SA.flowRight=BAe,SA.fromPairs=J6,SA.functions=B$A,SA.functionsIn=p$A,SA.groupBy=l_A,SA.initial=Z6,SA.intersection=K6,SA.intersectionBy=sM,SA.intersectionWith=V6,SA.invert=I$A,SA.invertBy=M$A,SA.invokeMap=P_A,SA.iteratee=nF,SA.keyBy=c_A,SA.keys=Ko,SA.keysIn=Ul,SA.map=lb,SA.mapKeys=y$A,SA.mapValues=O$A,SA.matches=pAe,SA.matchesProperty=mAe,SA.memoize=Pb,SA.merge=k$A,SA.mergeWith=naA,SA.method=IAe,SA.methodOf=MAe,SA.mixin=rF,SA.negate=cb,SA.nthArg=yAe,SA.omit=b$A,SA.omitBy=z$A,SA.once=T_A,SA.orderBy=h_A,SA.over=OAe,SA.overArgs=y_A,SA.overEvery=kAe,SA.overSome=bAe,SA.partial=X6,SA.partialRight=qoA,SA.partition=g_A,SA.pick=N$A,SA.pickBy=raA,SA.property=caA,SA.propertyOf=zAe,SA.pull=la,SA.pullAll=Ws,SA.pullAllBy=lD,SA.pullAllWith=Na,SA.pullAt=il,SA.range=NAe,SA.rangeRight=xAe,SA.rearg=O_A,SA.reject=w_A,SA.remove=nl,SA.rest=k_A,SA.reverse=xg,SA.sampleSize=d_A,SA.set=L$A,SA.setWith=U$A,SA.shuffle=v_A,SA.slice=ch,SA.sortBy=B_A,SA.sortedUniq=ib,SA.sortedUniqBy=nb,SA.split=sAe,SA.spread=b_A,SA.tail=rb,SA.take=sb,SA.takeRight=ob,SA.takeRightWhile=h0,SA.takeWhile=g0,SA.tap=ZXA,SA.throttle=z_A,SA.thru=ab,SA.toArray=AaA,SA.toPairs=saA,SA.toPairsIn=oaA,SA.toPath=FAe,SA.toPlainObject=taA,SA.transform=j$A,SA.unary=N_A,SA.union=u0,SA.unionBy=zXA,SA.unionWith=NXA,SA.uniq=xXA,SA.uniqBy=LXA,SA.uniqWith=UXA,SA.unset=S$A,SA.unzip=q6,SA.unzipWith=SoA,SA.update=F$A,SA.updateWith=R$A,SA.values=w0,SA.valuesIn=Y$A,SA.without=jXA,SA.words=DaA,SA.wrap=x_A,SA.xor=SXA,SA.xorBy=FXA,SA.xorWith=RXA,SA.zip=YXA,SA.zipObject=HXA,SA.zipObjectDeep=JXA,SA.zipWith=GXA,SA.entries=saA,SA.entriesIn=oaA,SA.extend=iaA,SA.extendWith=ub,rF(SA,SA),SA.add=YAe,SA.attempt=PaA,SA.camelCase=Z$A,SA.capitalize=aaA,SA.ceil=HAe,SA.clamp=H$A,SA.clone=U_A,SA.cloneDeep=S_A,SA.cloneDeepWith=F_A,SA.cloneWith=j_A,SA.conformsTo=R_A,SA.deburr=laA,SA.defaultTo=CAe,SA.divide=JAe,SA.endsWith=K$A,SA.eq=qP,SA.escape=V$A,SA.escapeRegExp=q$A,SA.every=t_A,SA.find=n_A,SA.findIndex=zg,SA.findKey=w$A,SA.findLast=r_A,SA.findLastIndex=Ng,SA.findLastKey=f$A,SA.floor=GAe,SA.forEach=RoA,SA.forEachRight=YoA,SA.forIn=d$A,SA.forInRight=v$A,SA.forOwn=C$A,SA.forOwnRight=E$A,SA.get=AF,SA.gt=Y_A,SA.gte=H_A,SA.has=m$A,SA.hasIn=eF,SA.head=eb,SA.identity=jl,SA.includes=D_A,SA.indexOf=G6,SA.inRange=J$A,SA.invoke=T$A,SA.isArguments=nd,SA.isArray=In,SA.isArrayBuffer=J_A,SA.isArrayLike=Ll,SA.isArrayLikeObject=Xs,SA.isBoolean=G_A,SA.isBuffer=_Q,SA.isDate=Z_A,SA.isElement=K_A,SA.isEmpty=V_A,SA.isEqual=q_A,SA.isEqualWith=W_A,SA.isError=_6,SA.isFinite=X_A,SA.isFunction=Ug,SA.isInteger=WoA,SA.isLength=hb,SA.isMap=XoA,SA.isMatch=__A,SA.isMatchWith=$_A,SA.isNaN=A$A,SA.isNative=e$A,SA.isNil=i$A,SA.isNull=t$A,SA.isNumber=_oA,SA.isObject=Bs,SA.isObjectLike=js,SA.isPlainObject=aM,SA.isRegExp=$6,SA.isSafeInteger=n$A,SA.isSet=$oA,SA.isString=gb,SA.isSymbol=DD,SA.isTypedArray=Q0,SA.isUndefined=r$A,SA.isWeakMap=s$A,SA.isWeakSet=o$A,SA.join=ss,SA.kebabCase=W$A,SA.last=yn,SA.lastIndexOf=As,SA.lowerCase=X$A,SA.lowerFirst=_$A,SA.lt=a$A,SA.lte=l$A,SA.max=ZAe,SA.maxBy=KAe,SA.mean=VAe,SA.meanBy=qAe,SA.min=WAe,SA.minBy=XAe,SA.stubArray=oF,SA.stubFalse=aF,SA.stubObject=LAe,SA.stubString=UAe,SA.stubTrue=jAe,SA.multiply=_Ae,SA.nth=aa,SA.noConflict=TAe,SA.noop=sF,SA.now=Db,SA.pad=$$A,SA.padEnd=AAe,SA.padStart=eAe,SA.parseInt=tAe,SA.random=G$A,SA.reduce=u_A,SA.reduceRight=Q_A,SA.repeat=iAe,SA.replace=nAe,SA.result=x$A,SA.round=$Ae,SA.runInContext=f,SA.sample=f_A,SA.size=C_A,SA.snakeCase=rAe,SA.some=E_A,SA.sortedIndex=id,SA.sortedIndexBy=c0,SA.sortedIndexOf=Da,SA.sortedLastIndex=Lg,SA.sortedLastIndexBy=oM,SA.sortedLastIndexOf=tb,SA.startCase=oAe,SA.startsWith=aAe,SA.subtract=Aee,SA.sum=eee,SA.sumBy=tee,SA.template=lAe,SA.times=SAe,SA.toFinite=jg,SA.toInteger=Nn,SA.toLength=eaA,SA.toLower=DAe,SA.toNumber=sP,SA.toSafeInteger=D$A,SA.toString=Mr,SA.toUpper=PAe,SA.trim=cAe,SA.trimEnd=hAe,SA.trimStart=gAe,SA.truncate=uAe,SA.unescape=QAe,SA.uniqueId=RAe,SA.upperCase=wAe,SA.upperFirst=tF,SA.each=RoA,SA.eachRight=YoA,SA.first=eb,rF(SA,(function(){var I={};return oD(SA,function(x,G){Mi.call(SA.prototype,G)||(I[G]=x)}),I})(),{chain:!1}),SA.VERSION=t,ns(["bind","bindKey","curry","curryRight","partial","partialRight"],function(I){SA[I].placeholder=SA}),ns(["drop","take"],function(I,x){Gn.prototype[I]=function(G){G=G===e?1:vs(Nn(G),0);var oA=this.__filtered__&&!x?new Gn(this):this.clone();return oA.__filtered__?oA.__takeCount__=ao(G,oA.__takeCount__):oA.__views__.push({size:ao(G,iA),type:I+(oA.__dir__<0?"Right":"")}),oA},Gn.prototype[I+"Right"]=function(G){return this.reverse()[I](G).reverse()}}),ns(["filter","map","takeWhile"],function(I,x){var G=x+1,oA=G==F||G==W;Gn.prototype[I]=function(BA){var KA=this.clone();return KA.__iteratees__.push({iteratee:H(BA,3),type:G}),KA.__filtered__=KA.__filtered__||oA,KA}}),ns(["head","last"],function(I,x){var G="take"+(x?"Right":"");Gn.prototype[I]=function(){return this[G](1).value()[0]}}),ns(["initial","tail"],function(I,x){var G="drop"+(x?"":"Right");Gn.prototype[I]=function(){return this.__filtered__?new Gn(this):this[G](1)}}),Gn.prototype.compact=function(){return this.filter(jl)},Gn.prototype.find=function(I){return this.filter(I).head()},Gn.prototype.findLast=function(I){return this.reverse().find(I)},Gn.prototype.invokeMap=zn(function(I,x){return typeof I=="function"?new Gn(this):this.map(function(G){return za(G,I,x)})}),Gn.prototype.reject=function(I){return this.filter(cb(H(I)))},Gn.prototype.slice=function(I,x){I=Nn(I);var G=this;return G.__filtered__&&(I>0||x<0)?new Gn(G):(I<0?G=G.takeRight(-I):I&&(G=G.drop(I)),x!==e&&(x=Nn(x),G=x<0?G.dropRight(-x):G.take(x-I)),G)},Gn.prototype.takeRightWhile=function(I){return this.reverse().takeWhile(I).reverse()},Gn.prototype.toArray=function(){return this.take(iA)},oD(Gn.prototype,function(I,x){var G=/^(?:filter|find|map|reject)|While$/.test(x),oA=/^(?:head|last)$/.test(x),BA=SA[oA?"take"+(x=="last"?"Right":""):x],KA=oA||/^find/.test(x);BA&&(SA.prototype[x]=function(){var fe=this.__wrapped__,Ie=oA?[1]:arguments,Ge=fe instanceof Gn,xt=Ie[0],Ut=Ge||In(fe),Kt=function(Vn){var er=BA.apply(SA,yl([Vn],Ie));return oA&&fi?er[0]:er};Ut&&G&&typeof xt=="function"&&xt.length!=1&&(Ge=Ut=!1);var fi=this.__chain__,Ki=!!this.__actions__.length,hn=KA&&!fi,Sn=Ge&&!Ki;if(!KA&&Ut){fe=Sn?fe:new Gn(this);var gn=I.apply(fe,Ie);return gn.__actions__.push({func:ab,args:[Kt],thisArg:e}),new Al(gn,fi)}return hn&&Sn?I.apply(this,Ie):(gn=this.thru(Kt),hn?oA?gn.value()[0]:gn.value():gn)})}),ns(["pop","push","shift","sort","splice","unshift"],function(I){var x=zt[I],G=/^(?:push|sort|unshift)$/.test(I)?"tap":"thru",oA=/^(?:pop|shift)$/.test(I);SA.prototype[I]=function(){var BA=arguments;if(oA&&!this.__chain__){var KA=this.value();return x.apply(In(KA)?KA:[],BA)}return this[G](function(fe){return x.apply(In(fe)?fe:[],BA)})}}),oD(Gn.prototype,function(I,x){var G=SA[x];if(G){var oA=G.name+"";Mi.call(eP,oA)||(eP[oA]=[]),eP[oA].push({name:x,func:G})}}),eP[Ad(e,w).name]=[{name:"wrapper",func:e}],Gn.prototype.clone=ok,Gn.prototype.reverse=ak,Gn.prototype.value=sD,SA.prototype.at=KXA,SA.prototype.chain=VXA,SA.prototype.commit=qXA,SA.prototype.next=WXA,SA.prototype.plant=_XA,SA.prototype.reverse=$XA,SA.prototype.toJSON=SA.prototype.valueOf=SA.prototype.value=A_A,SA.prototype.first=SA.prototype.head,Mg&&(SA.prototype[Mg]=XXA),SA}),O=Oa();Qt?((Qt.exports=O)._=O,Wt._=O):rt._=O}).call(YDA)})(N0,N0.exports)),N0.exports}var cA=HDA();class KR{containerID_=void 0;dataClass_=void 0;data_=void 0;geometryInstance_=void 0;billboardInstances_=[];pointInstances_=[];pointNumberInstances_=[];isPointNumberVisible_=!1;groundPointsInstances_=[];groundVerticalLinesInstances_=[];distanceLabelInstances_=[];centerLabelInstance_=void 0;centerHTMLInstance_=void 0;customLabelInstances_=[];customHTMLInstances_=[];visible_=!0;isClampToGround_=!1;isHighlight_=!1;isEditable_=!1;isDelete_=!1;isCopy_=!1;isStartDraw_=!1;screenSpaceHandler_;nodeMode_="billboard";ALTDragPlane_=void 0;ALTDragIndex_=void 0;heightMode_=0;defaultHeight_=void 0;isContainTakeOffBillboard_=!1;TakeOffBillboard_=void 0;TakeOffBillboardGround_=void 0;TakeOffBillboardVerticalLine_=void 0;TakeOffBillboardHeightLabel_=void 0;TakeOffBillboardHeightLabel1_=void 0;TakeOffBillboardDistanceLabel_=void 0;TakeOffBillboardCoordinate_=void 0;TakeOffBillboardCoordinate1_=void 0;TakeOffBillboardCoordinate2_=void 0;TakeOffBillboardGroundCartographic_=void 0;TakeOffALTDragPlane_=void 0;TakeOffSecureHeight_=void 0;PointOfInterest_=void 0;PointOfInterestCoordinate_=void 0;polylineAppearance=void 0;polylineHighlightAppearance=void 0;positions_=[];groundPositions_=[];isDistanceVisible_=!1;waypointType_=2;airRouteGeometryInstance_=void 0;constructor(A,e){this.containerID_=A,this.dataClass_=e}DataProcessing=A=>{(!cA.isEqual(this.data_,A)||!cA.isEqual(this.data_?.coordinates,A?.coordinates)||!cA.isEqual(this.data_?.symbol,A?.symbol)||!cA.isEqual(this.data_?.takeOffBillboardCoordinate,A?.takeOffBillboardCoordinate)||!cA.isEqual(this.data_?.customLabel,A?.customLabel)||!cA.isEqual(this.data_?.customHTML,A?.customHTML))&&(this.data_=cA.cloneDeep(A),this.data_?.isOpenSecondaryEditing&&this.data_?.coordinates.length&&this.data_?.isEditable&&!this.isStartDraw_&&(this.isStartDraw_=!0),this.reDrawTakeOffBillboard(!0),this.reDraw())};emitGraphClick=()=>{this.isEditable_||k.emitGraphClick(cA.cloneDeep({ID:this.data_.ID,data:this.data_,class:this.dataClass_}))};emitGraphChanging=(A,e)=>{let t,i=this.containerID_.split("-cesium")[0],r=k.addTerrainHeight(i,this.data_.coordinates,this.heightMode_);this.data_.coordinates=r,e!==void 0?t={ID:this.data_.ID,data:this.data_,coordinates:r,takeOffBillboardCoordinate:this.TakeOffBillboardCoordinate_,pointOfInterestCoordinate:this.PointOfInterestCoordinate_,class:this.dataClass_,type:A,index:e}:t={ID:this.data_.ID,data:this.data_,coordinates:r,takeOffBillboardCoordinate:this.TakeOffBillboardCoordinate_,pointOfInterestCoordinate:this.PointOfInterestCoordinate_,class:this.dataClass_,type:A},k.emitGraphChanging(cA.cloneDeep(t))};emitGraphChanged=(A,e)=>{let t,i=this.containerID_.split("-cesium")[0],r=k.addTerrainHeight(i,this.data_.coordinates,this.heightMode_);this.data_.coordinates=r,e!==void 0?t={ID:this.data_.ID,data:this.data_,coordinates:r,takeOffBillboardCoordinate:this.TakeOffBillboardCoordinate_,pointOfInterestCoordinate:this.PointOfInterestCoordinate_,class:this.dataClass_,type:A,index:e}:t={ID:this.data_.ID,data:this.data_,coordinates:r,takeOffBillboardCoordinate:this.TakeOffBillboardCoordinate_,pointOfInterestCoordinate:this.PointOfInterestCoordinate_,class:this.dataClass_,type:A},k.emitGraphChanged(cA.cloneDeep(t))};emitGraphRemoved=()=>{k.emitGraphRemoved(cA.cloneDeep({ID:this.data_.ID,data:this.data_,class:this.dataClass_}))};emitGraphEdited=()=>{window.EditElement=void 0;let A=this.containerID_.split("-cesium")[0],e=k.addTerrainHeight(A,this.data_.coordinates,this.heightMode_);this.data_.coordinates=e,k.emitGraphEdited(cA.cloneDeep({ID:this.data_.ID,data:this.data_,class:this.dataClass_}))};copyPoint=(A,e)=>{if(A!==void 0){const t=this.data_?.coordinates?.length,i=cA.cloneDeep(this.data_?.coordinates[A]),r=Gt([i.longitude,i.latitude]);let s={units:"meters"},o=0,a=100;switch(e){case"front":{if(A===0)if(this.TakeOffBillboardCoordinate_){const P=Gt([this.TakeOffBillboardCoordinate_.longitude,this.TakeOffBillboardCoordinate_.latitude]);o=Do(r,P),a=an(r,P,s)}else if(this.data_?.coordinates?.length>1){const P=cA.cloneDeep(this.data_?.coordinates[A+1]),c=Gt([P.longitude,P.latitude]);o=Do(c,r),a=an(c,r,s)}else o=0,a=100;else{const P=cA.cloneDeep(this.data_?.coordinates[A-1]),c=Gt([P.longitude,P.latitude]);o=Do(r,c),a=an(r,c,s)}const l=kr(r,a*.5,o,s),D=Oo(l);this.data_?.coordinates.splice(A,0,{longitude:D[0],latitude:D[1],altitude:i?.altitude+1})}break;case"after":{if(A===0)if(this.TakeOffBillboardCoordinate_){const P=Gt([this.TakeOffBillboardCoordinate_.longitude,this.TakeOffBillboardCoordinate_.latitude]);o=Do(P,r),a=an(P,r,s)}else if(this.data_?.coordinates?.length>1){const P=cA.cloneDeep(this.data_?.coordinates[A+1]),c=Gt([P.longitude,P.latitude]);o=Do(r,c),a=an(r,c,s)}else o=0,a=100;else if(A===t-1){const P=cA.cloneDeep(this.data_?.coordinates[A-1]),c=Gt([P.longitude,P.latitude]);o=Do(c,r),a=an(c,r,s)}else{const P=cA.cloneDeep(this.data_?.coordinates[A+1]),c=Gt([P.longitude,P.latitude]);o=Do(r,c),a=an(r,c,s)}const l=kr(r,a*.5,o,s),D=Oo(l);this.data_?.coordinates.splice(A+1,0,{longitude:D[0],latitude:D[1],altitude:i?.altitude+1})}break}this.reDrawTakeOffBillboard(!0),this.reDraw(),this.emitGraphChanged("copy",A)}};mouseUp=(A,e)=>{if(k.removeMenu(this.containerID_),!(!this.isEditable_||e===void 0))if(e===-99999){const t=k.getMapEngineInstance(this.containerID_);k.getTerrainHeight(t,this.TakeOffBillboardCoordinate_).then(i=>{this.TakeOffBillboardCoordinate_?.altitude<i?.coordinate?.altitude&&(this.TakeOffBillboardCoordinate_.altitude=i?.coordinate?.altitude),this.reDrawTakeOffBillboard(),this.emitGraphChanged("setTakeOffPoint")})}else e!==void 0&&(this.isStartDraw_||this.emitGraphChanged("update",e))};mouseClick=A=>{if(k.removeMenu(this.containerID_),!this.isEditable_||!A?.position)return;let e=k.getMapEngineInstance(this.containerID_);if(window.isPointOfInterestOpen&&!this.PointOfInterestCoordinate_){this.PointOfInterestCoordinate_=k.getGroundPoint(e,A.position),this.PointOfInterestCoordinate_&&(this.reDrawPointOfInterest(),this.emitGraphChanged("setPointOfInterest"));return}if(this.isContainTakeOffBillboard_&&!this.TakeOffBillboardCoordinate_){this.TakeOffBillboardCoordinate_=k.getGroundPoint(e,A.position),this.TakeOffBillboardCoordinate_&&(this.reDrawTakeOffBillboard(!0),this.reDraw(),this.emitGraphChanged("setTakeOffPoint"),k.recoverCursor(this.containerID_,"TakeOffCursor.png"));return}let t=k.getClampToGroundPosition(e,A.position,this.isClampToGround_,void 0,this.heightMode_,this.defaultHeight_);const i=this.data_?.isSurroundModeEnabled??!1,r=this.data_?.surroundRadius??200,s=this.data_?.steps??8,o=this.data_?.isClockwise??!1;let a=e.scene.pick(A.position);if(t&&t.coordinate){let l=cA.cloneDeep(t.coordinate);if(this.isStartDraw_){if(a){let D=e.scene.drillPick(A.position,20);D=Array.from(new Set(D));let P=!1;for(let c=0;c<D.length;c++){let h=D[c],g=k.extractionIndex(h.id);if(typeof h.id=="string"&&(h.primitive instanceof Cesium.Billboard||h.primitive instanceof Cesium.PointPrimitive)&&(h.id.includes("-&-ZYWL-&-GeometryEditingPolyline-Point-")||h.id.includes("-&-ZYWL-&-GeometryEditingPolyline-PointNumber-")||h.id.includes("-&-ZYWL-&-GeometryEditingPolyline-GroundPoint-"))&&g!==void 0&&this.data_?.coordinates.length>=2&&g===this.data_?.coordinates.length-1){P=!0;break}}if(P){this.isStartDraw_=!1,this.clearScreenSpaceHandler(),this.reDraw(),this.emitGraphChanged("complete");return}}if(i){let D=k.calculateSurroundPoints(t.coordinate,r,s,o);D=k.addTerrainHeight(this.containerID_.split("-cesium")[0],D,this.heightMode_),D.forEach(P=>{this.heightMode_===2?P.altitude=P.terrainHeight+this.defaultHeight_:P.altitude=this.defaultHeight_,this.data_.coordinates.push(cA.cloneDeep(P))})}else this.data_.coordinates.push(cA.cloneDeep(l))}else if(this.data_?.coordinates.length){if(a&&a.id){if(typeof a.id=="string"){let D=a.id;if((a.primitive instanceof Cesium.PointPrimitive||a.primitive instanceof Cesium.Billboard)&&D.includes("-&-ZYWL-&-GeometryEditingPolyline-CenterPoint-")){let P=k.extractionIndex(D),c=a.primitive.position;if(c){let h=k.getWaylineClampToGroundPosition(e,A.position,this.isClampToGround_,c,this.heightMode_,this.defaultHeight_);h&&h.coordinate&&(this.data_.coordinates.splice(P+1,0,h.coordinate),this.reDraw(),this.emitGraphChanged("update"))}}}}else{this.isEditable_=!1,this.reDraw(),this.emitGraphEdited(),this.clearScreenSpaceHandler();return}return}else{if(i){let D=k.calculateSurroundPoints(t.coordinate,r,s,o);D=k.addTerrainHeight(this.containerID_.split("-cesium")[0],D,this.heightMode_),D.forEach(P=>{this.heightMode_===2?P.altitude=P.terrainHeight+this.defaultHeight_:P.altitude=this.defaultHeight_,this.data_.coordinates.push(cA.cloneDeep(P))})}else this.data_.coordinates.push(cA.cloneDeep(l));this.isStartDraw_=!0}this.isContainTakeOffBillboard_&&this.data_?.coordinates.length&&this.reDrawTakeOffBillboard(!0),this.reDraw(),this.emitGraphChanged("update")}};mouseMove=(A,e)=>{if(!this.isEditable_||e===void 0)return;let t=k.getMapEngineInstance(this.containerID_),i;if(e===99999&&this.PointOfInterestCoordinate_)i=k.getClampToGroundPosition(t,A.endPosition,!0,this.PointOfInterestCoordinate_),i&&i.coordinate&&(this.PointOfInterestCoordinate_.longitude=i.coordinate.longitude,this.PointOfInterestCoordinate_.latitude=i.coordinate.latitude,this.reDrawPointOfInterest());else if(e===-99999&&this.isContainTakeOffBillboard_&&this.TakeOffBillboardCoordinate_)i=k.getClampToGroundPosition(t,A.endPosition,!1,this.TakeOffBillboardCoordinate_),i&&i.coordinate&&(this.TakeOffBillboardCoordinate_.longitude=i.coordinate.longitude,this.TakeOffBillboardCoordinate_.latitude=i.coordinate.latitude,this.TakeOffBillboardGroundCartographic_&&(this.TakeOffBillboardGroundCartographic_=k.getCartographicFromCoordinate(t,this.TakeOffBillboardCoordinate_,!0)),this.reDrawTakeOffBillboard(!0),this.reDraw());else if(Array.isArray(this.data_.coordinates)&&this.data_.coordinates.length){let r=k.getClampToGroundPosition(t,A.endPosition,this.isClampToGround_,this.data_?.coordinates[e],this.heightMode_,this.defaultHeight_,this.data_?.coordinates[e]?.followTheSystem);r&&r.coordinate&&(this.data_.coordinates[e].longitude=r.coordinate.longitude,this.data_.coordinates[e].latitude=r.coordinate.latitude,this.data_.coordinates[e].altitude=r.coordinate.altitude,this.reDraw(),e===0&&this.reDrawTakeOffBillboard())}};mouseRightClick=A=>{this.isDelete_&&(A!==void 0?(A===99999?this.clearPointOfInterest():this.data_.coordinates.splice(A,1),this.emitGraphChanged("delete",A)):(this.data_.coordinates=[],this.clearTakeOffBillboardHeightLabel(),this.emitGraphRemoved()),this.clearDistanceLabels(),this.reDrawTakeOffBillboard(),this.clearTakeOffBillboardGround(),this.reDraw())};mouseAltLeftDown=A=>{let t=k.getMapEngineInstance(this.containerID_).scene,i=t.camera,r=t.pick(A.position);if(r){let s=r.primitive;if(s&&(s instanceof Cesium.PointPrimitive||s instanceof Cesium.Billboard||s instanceof Cesium.Label)){let o=r.id;if(typeof o=="string"){if(o.includes("-&-ZYWL-&-GeometryEditingPolyline-Point-")||o.includes("-&-ZYWL-&-GeometryEditingPolyline-PointNumber-")){if(this.ALTDragIndex_=k.extractionIndex(o),!this.ALTDragPlane_&&this.ALTDragIndex_!==void 0){let a=this.data_?.coordinates;if(a&&a.length){let l=a[this.ALTDragIndex_],D=Cesium.Cartesian3.fromDegrees(l.longitude,l.latitude,l.altitude),P=k.offsetHeadingPitch2Position(D,i.heading,0,50),c=Cesium.Cartesian3.subtract(D,P.cartesian3,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(c,c),this.ALTDragPlane_=Cesium.Plane.fromPointNormal(D,c)}}}else if(o===this.data_.ID+"-&-ZYWL-&-TakeOffBillboard"&&!this.TakeOffALTDragPlane_&&this.TakeOffBillboardCoordinate_){let a=Cesium.Cartesian3.fromDegrees(this.TakeOffBillboardCoordinate_.longitude,this.TakeOffBillboardCoordinate_.latitude,this.TakeOffBillboardCoordinate_.altitude),l=k.offsetHeadingPitch2Position(a,i.heading,0,50),D=Cesium.Cartesian3.subtract(a,l.cartesian3,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(D,D),this.TakeOffALTDragPlane_=Cesium.Plane.fromPointNormal(a,D)}}}}};mouseAltLeftUp=A=>{this.TakeOffALTDragPlane_&&(this.TakeOffALTDragPlane_=void 0,this.emitGraphChanged("setTakeOffPoint")),this.ALTDragPlane_&&(this.data_.coordinates[this.ALTDragIndex_].hasOwnProperty("followTheSystem")&&(this.data_.coordinates[this.ALTDragIndex_].followTheSystem=!1),this.emitGraphChanged("update",this.ALTDragIndex_),this.ALTDragPlane_=void 0,this.ALTDragIndex_=void 0)};mouseAltMove=A=>{let r=k.getMapEngineInstance(this.containerID_).scene.camera.getPickRay(A.endPosition);if(this.ALTDragPlane_){let s=Cesium.IntersectionTests.rayPlane(r,this.ALTDragPlane_,new Cesium.Cartesian3);if(s){let o=k.transformCartographic(s);Array.isArray(this.data_.coordinates)&&this.data_.coordinates.length&&(this.data_.coordinates[this.ALTDragIndex_].hasOwnProperty("followTheSystem")&&(this.data_.coordinates[this.ALTDragIndex_].followTheSystem=!1),this.data_.coordinates[this.ALTDragIndex_].altitude=o.height,this.reDraw(),this.ALTDragIndex_===0&&this.reDrawTakeOffBillboard(),this.emitGraphChanging("AltUpdate",this.ALTDragIndex_))}}if(this.TakeOffALTDragPlane_){let s=Cesium.IntersectionTests.rayPlane(r,this.TakeOffALTDragPlane_,new Cesium.Cartesian3);if(s){let o=k.transformCartographic(s);this.TakeOffBillboardCoordinate_&&(this.TakeOffBillboardCoordinate_.altitude=o.height),this.reDrawTakeOffBillboard(!0),this.reDraw()}}};addAltAction=()=>{if(!this.screenSpaceHandler_){let A=k.getMapEngineInstance(this.containerID_);this.screenSpaceHandler_=new Cesium.ScreenSpaceEventHandler(A.scene.canvas)}this.screenSpaceHandler_&&(this.screenSpaceHandler_.getInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN,Cesium.KeyboardEventModifier.ALT)||this.screenSpaceHandler_.setInputAction(A=>{this.mouseAltLeftDown(A)},Cesium.ScreenSpaceEventType.LEFT_DOWN,Cesium.KeyboardEventModifier.ALT),this.screenSpaceHandler_.getInputAction(Cesium.ScreenSpaceEventType.LEFT_UP,Cesium.KeyboardEventModifier.ALT)||this.screenSpaceHandler_.setInputAction(A=>{this.mouseAltLeftUp(A)},Cesium.ScreenSpaceEventType.LEFT_UP,Cesium.KeyboardEventModifier.ALT),this.screenSpaceHandler_.getInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE,Cesium.KeyboardEventModifier.ALT)||this.screenSpaceHandler_.setInputAction(A=>{this.mouseAltMove(A)},Cesium.ScreenSpaceEventType.MOUSE_MOVE,Cesium.KeyboardEventModifier.ALT))};async reDrawPointOfInterest(){let A=k.getMapEngineInstance(this.containerID_);if(this.PointOfInterestCoordinate_){let t=(await k.obtainGroundCartesian3s(A,[this.PointOfInterestCoordinate_],Cesium.ClassificationType.TERRAIN))[0],i=this.data_.ID,r=k.getBillboardCollection(this.containerID_);this.PointOfInterest_?(this.PointOfInterest_.position=t,this.PointOfInterest_.show=this.visible_):this.PointOfInterest_=r.add(new Cesium.Billboard({position:t,id:i+"-&-ZYWL-&-PointOfInterest",show:this.visible_,image:bo.getIconBase64("PointOfInterest.png"),pixelOffset:new Cesium.Cartesian2(0,0),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,width:35,height:40,disableDepthTestDistance:Number.POSITIVE_INFINITY},r))}else this.clearPointOfInterest()}async reDrawTakeOffBillboard(A){let e=k.getMapEngineInstance(this.containerID_);if(this.TakeOffBillboardCoordinate_){let t=this.data_.ID,i=k.transformCartesian3(this.TakeOffBillboardCoordinate_);if(this.TakeOffBillboard_)this.TakeOffBillboard_.position=i,this.TakeOffBillboard_.show=this.visible_;else{let r=k.getBillboardCollection(this.containerID_);this.TakeOffBillboard_=r.add(new Cesium.Billboard({position:i,id:t+"-&-ZYWL-&-TakeOffBillboard",show:this.visible_,image:bo.getIconBase64("TakeOffBillboard.png"),pixelOffset:new Cesium.Cartesian2(0,0),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,width:35,height:35,disableDepthTestDistance:Number.POSITIVE_INFINITY},r))}if(Array.isArray(this.data_.coordinates)&&this.data_.coordinates.length){let r=this.data_.coordinates[0],s=r.altitude,o=this.TakeOffBillboardCoordinate_.altitude;s>o?s-o>this.TakeOffSecureHeight_?(this.TakeOffBillboardCoordinate1_={longitude:this.TakeOffBillboardCoordinate_.longitude,latitude:this.TakeOffBillboardCoordinate_.latitude,altitude:s},this.TakeOffBillboardCoordinate2_=void 0):(this.TakeOffBillboardCoordinate1_={longitude:this.TakeOffBillboardCoordinate_.longitude,latitude:this.TakeOffBillboardCoordinate_.latitude,altitude:o+this.TakeOffSecureHeight_},this.TakeOffBillboardCoordinate2_={longitude:r.longitude,latitude:r.latitude,altitude:o+this.TakeOffSecureHeight_}):(this.TakeOffBillboardCoordinate1_={longitude:this.TakeOffBillboardCoordinate_.longitude,latitude:this.TakeOffBillboardCoordinate_.latitude,altitude:o+this.TakeOffSecureHeight_},this.TakeOffBillboardCoordinate2_={longitude:r.longitude,latitude:r.latitude,altitude:o+this.TakeOffSecureHeight_}),this.clearTakeOffBillboardHeightLabel();let a=k.transformCartesian3(this.TakeOffBillboardCoordinate1_),l;this.TakeOffBillboardCoordinate2_?l=k.transformCartesian3(this.TakeOffBillboardCoordinate2_):l=k.transformCartesian3(r);let D=Cesium.Cartesian3.midpoint(a,i,new Cesium.Cartesian3),P=Cesium.Cartesian3.distance(a,i);P=Number(P.toFixed(1)),this.TakeOffBillboardHeightLabel_=new Yi(this.containerID_),this.TakeOffBillboardHeightLabel_.DataProcessing({ID:t+"-&-ZYWL-&-TakeOffBillboardHeightLabel",center:D,customHTML:{content:`<div style="background-color:rgba(0,0,0,0.8);color:white;text-align: center;padding-bottom: 2px;padding-top: 2px;padding-left: 3px;padding-right: 3px;border-radius: 4px;font-size: 12px;">${P}m</div>`,dx:0,dy:0,presentationMode:1}});let c=Cesium.Cartesian3.midpoint(a,l,new Cesium.Cartesian3),h=Cesium.Cartesian3.distance(a,l);h=Number(h.toFixed(1)),this.TakeOffBillboardDistanceLabel_=new Yi(this.containerID_),this.TakeOffBillboardDistanceLabel_.DataProcessing({ID:t+"-&-ZYWL-&-TakeOffBillboardDistanceLabel",center:c,customHTML:{content:`<div style="background-color:rgba(0,0,0,0.8);color:white;text-align: center;padding-bottom: 2px;padding-top: 2px;padding-left: 3px;padding-right: 3px;border-radius: 4px;font-size: 12px;">${h}m</div>`,dx:0,dy:0,presentationMode:1}});let g=Cesium.Cartesian3.midpoint(k.transformCartesian3(this.data_.coordinates[0]),l,new Cesium.Cartesian3),u=Cesium.Cartesian3.distance(k.transformCartesian3(this.data_.coordinates[0]),l);u=Number(u.toFixed(1)),u!==0&&(this.TakeOffBillboardHeightLabel1_=new Yi(this.containerID_),this.TakeOffBillboardHeightLabel1_.DataProcessing({ID:t+"-&-ZYWL-&-TakeOffBillboardHeightLabel1",center:g,customHTML:{content:`<div style="background-color:rgba(0,0,0,0.8);color:white;text-align: center;padding-bottom: 2px;padding-top: 2px;padding-left: 3px;padding-right: 3px;border-radius: 4px;font-size: 12px;">${u}m</div>`,dx:0,dy:0,presentationMode:1}}))}if(A){let r=await k.obtainGroundCartesian3s(e,[this.TakeOffBillboardCoordinate_],Cesium.ClassificationType.TERRAIN);this.clearTakeOffBillboardGround(),this.TakeOffBillboardGroundCartographic_||(this.TakeOffBillboardGroundCartographic_=k.transformCartographic(r[0]));let s=k.transformCartographic(this.TakeOffBillboardCoordinate_),o;if(s.height>this.TakeOffBillboardGroundCartographic_.height?o=s.height-this.TakeOffBillboardGroundCartographic_.height:o=this.TakeOffBillboardGroundCartographic_.height-s.height,o<1)return;let a=k.transformCartesian3(this.TakeOffBillboardGroundCartographic_);if(this.TakeOffBillboardGround_)this.TakeOffBillboardGround_.position=a,this.TakeOffBillboardGround_.show=this.visible_;else{let l=k.getPointPrimitiveCollection(this.containerID_);this.TakeOffBillboardGround_=l.add(new Cesium.PointPrimitive({position:a,id:t+"-&-ZYWL-&-TakeOffBillboardGround",show:this.visible_,color:Cesium.Color.WHITE,pixelSize:6}))}if(!this.TakeOffBillboardVerticalLine_){let l=new Cesium.PolylineGeometry({positions:[a,i],width:1}),D=new Cesium.GeometryInstance({id:t+"-&-ZYWL-&-TakeOffBillboardVerticalLine",geometry:l}),P=new Cesium.Primitive({geometryInstances:D,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.WHITE}}})}),show:this.visible_,releaseGeometryInstances:!1,asynchronous:!1,allowPicking:!1});this.TakeOffBillboardVerticalLine_=e.scene.primitives.add(P)}}}else this.clearTakeOffBillboard()}reDraw=()=>{this.visible_=this.data_?.visible??!0,this.isClampToGround_=this.data_?.isClampToGround??!1,this.isHighlight_=this.data_?.isHighlight??!1,this.isEditable_=this.data_?.isEditable??!1,this.isDistanceVisible_=this.data_?.isDistanceVisible??!1,this.isPointNumberVisible_=this.data_?.isPointNumberVisible??!1,this.waypointType_=this.data_?.waypointType??2,this.isEditable_&&this.addAltAction(),this.isDelete_=this.data_?.isDelete??!1,this.isCopy_=this.data_?.isCopy??!1,this.defaultHeight_=this.data_?.defaultHeight,this.nodeMode_=this.data_?.nodeMode??"point",this.heightMode_=this.data_?.heightMode??1,this.isContainTakeOffBillboard_=this.data_?.isContainTakeOffBillboard??!1,this.TakeOffSecureHeight_=this.data_?.takeOffSecureHeight??100,this.isContainTakeOffBillboard_&&!this.TakeOffBillboard_&&!this.TakeOffBillboardCoordinate_&&(this.TakeOffBillboardCoordinate_=this.data_?.takeOffBillboardCoordinate,!this.TakeOffBillboardCoordinate_&&this.isEditable_&&k.setCustomCursor(this.containerID_,"TakeOffCursor.png"));const A=this.data_.ID,e=k.getMapEngineInstance(this.containerID_);let t=this.data_?.coordinates,i=[],r;Array.isArray(t)&&(i=t.map(o=>k.getCartesian3FromCoordinate(e,o,this.isClampToGround_))),i.length>0&&(i.length>1?r=Cesium.Cartesian3.divideByScalar(i.reduce((o,a)=>Cesium.Cartesian3.add(o,a,new Cesium.Cartesian3)),i.length,new Cesium.Cartesian3):r=i[0],r=k.getCartesian3FromCartesian3(e,r,this.isClampToGround_));let s=[];if(this.TakeOffBillboardCoordinate_&&s.length){let o=k.transformCartesian3(this.TakeOffBillboardCoordinate_);if(this.TakeOffBillboardCoordinate1_){let a=k.transformCartesian3(this.TakeOffBillboardCoordinate1_);if(this.TakeOffBillboardCoordinate2_){let l=k.transformCartesian3(this.TakeOffBillboardCoordinate2_);s=[o,a,l]}else s=[o,a]}else{let a=k.transformCartographic(this.TakeOffBillboardCoordinate_);a.height=k.transformCartographic(s[0]).height,s=[o,k.transformCartesian3(a)]}}if(console.log(s),this.polylineAppearance||(this.polylineAppearance=k.getCustomAppearance(k.getAirRouteTexture(),100)),this.polylineHighlightAppearance||(this.polylineHighlightAppearance=k.getCustomAppearance(k.getAirRouteTexture(!0),100)),this.clearGeometry(),this.waypointType_!==2&&this.data_?.coordinates?.length>1){const o=new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"PolylineDash",uniforms:{color:Cesium.Color.fromCssColorString("#00d58f"),gapColor:Cesium.Color.TRANSPARENT,dashLength:15}}})});let a;this.isClampToGround_?a=new Cesium.GroundPolylineGeometry({positions:i,width:2}):a=new Cesium.PolylineGeometry({positions:i,width:2});let l=new Cesium.GeometryInstance({id:A+"-&-ZYWL-&-GeometryEditingPolyline",geometry:a}),D;this.isClampToGround_?(D=new Cesium.GroundPolylinePrimitive({geometryInstances:l,appearance:o,show:this.visible_,asynchronous:!1}),this.geometryInstance_=e.scene.primitives.add(D)):(D=new Cesium.Primitive({geometryInstances:l,appearance:o,show:this.visible_,asynchronous:!1}),this.geometryInstance_=e.scene.primitives.add(D))}if(this.data_?.coordinates.length>1){const a=k.setWaypointType(this.waypointType_,cA.cloneDeep(this.data_?.coordinates)).map(l=>k.transformCartesian3(l));this.isClampToGround_?this.airRouteGeometryInstance_=e.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({id:A+"-&-ZYWL-&-GeometryEditingPolyline-&-AirRoute",geometry:new Cesium.GroundPolylineGeometry({positions:[...s,...a],width:8})}),appearance:this.polylineAppearance,show:this.visible_,asynchronous:!1})):this.airRouteGeometryInstance_=e.scene.primitives.add(new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:A+"-&-ZYWL-&-GeometryEditingPolyline-&-AirRoute",geometry:new Cesium.PolylineGeometry({positions:[...s,...a],width:8})}),appearance:this.polylineAppearance,show:this.visible_,asynchronous:!1}))}this.reDrawPoints(),this.reDrawGroundPoints(),this.reDrawCenterPoints(i),this.reDrawDistanceLabels(i),this.reDrawCenterLabel(r),this.reDrawCenterHTML(r),this.reDrawCustomLabel(i),this.reDrawCustomHTML()};async reDrawPoints(){if(this.visible_&&Array.isArray(this.data_.coordinates)&&this.data_.coordinates.length){let A=k.getMapEngineInstance(this.containerID_),e;if(this.isClampToGround_&&(e=Cesium.ClassificationType.TERRAIN),this.positions_=await k.obtainGroundCartesian3s(A,this.data_.coordinates,e),this.clearPoints(),this.positions_.length===this.data_.coordinates.length){let t;this.nodeMode_==="point"?t=k.getPointPrimitiveCollection(this.containerID_):t=k.getBillboardCollection(this.containerID_);let i=k.getLabelCollection(this.containerID_);for(let r=0;r<this.positions_.length;r++){let s=this.positions_[r],o=this.data_.ID+"-&-ZYWL-&-GeometryEditingPolyline-Point-"+r,a=this.data_.coordinates[r],l=a?.show??!1;if(!this.isEditable_&&!l)continue;let D=a?.symbol;D||(D=this.data_?.symbol);let P;if(this.nodeMode_==="point"){let c=25,h="#fff";if(D&&(c=D?.pixelSize??25,h=D?.pointColor??"#fff"),h=Cesium.Color.fromCssColorString(h),P=t.add(new Cesium.PointPrimitive({position:s,id:o,show:this.visible_,color:h,outlineColor:Cesium.Color.fromCssColorString("#009BCC"),outlineWidth:2,pixelSize:c,disableDepthTestDistance:Number.POSITIVE_INFINITY})),this.isPointNumberVisible_){let g=this.data_.ID+"-&-ZYWL-&-GeometryEditingPolyline-PointNumber-"+r,u=this.pointNumberInstances_.find(Q=>Q.ID===o);if(u)u.primitive.position=s,u.primitive.show=this.visible_?this.isPointNumberVisible_:this.visible_;else{let Q=i.add(new Cesium.Label({position:s,id:g,show:this.visible_?this.isPointNumberVisible_:this.visible_,text:`${r+1}`,font:"14px sans-serif",fillColor:Cesium.Color.fromCssColorString("#009BCC"),outlineColor:Cesium.Color.fromCssColorString("#009BCC"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,disableDepthTestDistance:Number.POSITIVE_INFINITY},i));this.pointNumberInstances_.push({ID:g,index:r,primitive:Q})}}}else{let c=k.getPointIcon(!1,!1),h=20,g=20,u=0,Q=0;D&&(c=D?.image??k.getPointIcon(!1,!1),h=D?.markerWidth??20,g=D?.markerHeight??20,u=D?.markerDx??0,Q=D?.markerDy??0),this.isStartDraw_&&this.data_.coordinates.length>2&&r===this.data_.coordinates.length-1&&(c=D?.imageFinish??k.getPointIcon(!1,!0)),P=t.add(new Cesium.Billboard({position:s,id:o,show:this.visible_,image:c,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,width:h,height:g,pixelOffset:new Cesium.Cartesian2(u,Q),disableDepthTestDistance:Number.POSITIVE_INFINITY},t))}this.billboardInstances_.push({ID:o,index:r,primitive:P})}}}else this.clearPoints()}async reDrawGroundPoints(){let A=this.data_?.isGroundPointVisible??!1,e=this.data_?.isGroundVerticalLineVisible??!1;if(!this.isClampToGround_&&this.visible_&&A&&Array.isArray(this.data_.coordinates)&&this.data_.coordinates.length){let t=k.getMapEngineInstance(this.containerID_);if(this.groundPositions_=await k.obtainGroundCartesian3s(t,this.data_.coordinates,Cesium.ClassificationType.TERRAIN),this.clearGroundPoints(),this.clearGroundVerticalLines(),this.groundPositions_.length===this.data_.coordinates.length){let i=k.getPointPrimitiveCollection(this.containerID_);for(let r=0;r<this.groundPositions_.length;r++){let s=this.data_.ID+"-&-ZYWL-&-GeometryEditingPolyline-GroundPoint-"+r,o=this.groundPositions_[r];if(this.groundPointsInstances_.push({ID:s,index:r,primitive:i.add(new Cesium.PointPrimitive({position:o,id:s,color:Cesium.Color.fromCssColorString("#fff"),pixelSize:8}))}),e){let a=this.data_.ID+"-&-ZYWL-&-GeometryEditingPolyline-VerticalLine-"+r,l=this.data_.coordinates[r],D=new Cesium.PolylineGeometry({positions:[k.transformCartesian3(l),this.groundPositions_[r]],width:3}),P=new Cesium.GeometryInstance({id:a,geometry:D}),c=new Cesium.Primitive({geometryInstances:P,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"PolylineDash",uniforms:{color:Cesium.Color.fromCssColorString("#fff"),gapColor:Cesium.Color.TRANSPARENT,dashLength:15}}})}),releaseGeometryInstances:!1,asynchronous:!1,allowPicking:!1});this.groundVerticalLinesInstances_.push({ID:s,index:r,primitive:t.scene.primitives.add(c)})}}}}else this.clearGroundPoints(),this.clearGroundVerticalLines()}reDrawCenterPoints=A=>{this.clearCenterPoints();let e=k.getMapEngineInstance(this.containerID_);if(e&&this.visible_&&this.isEditable_&&!this.isStartDraw_){let t=k.getBillboardCollection(this.containerID_);for(let i=0;i<A.length-1;i++){let r=this.data_.ID+"-&-ZYWL-&-GeometryEditingPolyline-CenterPoint-"+i,s=A[i],o=A[i+1],a=Cesium.Cartesian3.midpoint(s,o,new Cesium.Cartesian3);a=k.getCartesian3FromCartesian3(e,a,this.isClampToGround_);const l=k.getDotPitchIcon(),D=18,P=18,c=t.add(new Cesium.Billboard({position:a,id:r,show:this.visible_,image:l,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,width:D,height:P,disableDepthTestDistance:Number.POSITIVE_INFINITY},t));this.pointInstances_.push({ID:r,index:i,primitive:c})}}};reDrawDistanceLabels=A=>{this.clearDistanceLabels();let e=k.getMapEngineInstance(this.containerID_),t=this.data_?.coordinates;if(e&&this.visible_&&(this.isEditable_||!this.isEditable_&&this.isDistanceVisible_)&&t&&t.length>=2)for(let i=0;i<A.length-1;i++){let r=this.data_.ID+"-&-ZYWL-&-GeometryEditingPolyline-DistanceLabel-"+i,s=A[i],o=A[i+1],a=Cesium.Cartesian3.midpoint(s,o,new Cesium.Cartesian3);a=k.getCartesian3FromCartesian3(e,a,this.isClampToGround_);let l=Cesium.Cartesian3.distance(s,o),D;l>1e3?(l=l/1e3,l=Number(l.toFixed(2)),D=`${l}km`):(l=Number(l.toFixed(2)),D=`${l}m`);let P=new Yi(this.containerID_),c=0;this.visible_&&this.isEditable_&&!this.isStartDraw_&&(c=-20),P.DataProcessing({ID:r,center:a,customHTML:{content:`<div style="background-color:rgba(0,0,0,0.8);color:white;text-align: center;padding-bottom: 2px;padding-top: 2px;padding-left: 3px;padding-right: 3px;border-radius: 4px;font-size: 12px;">${D}</div>`,dx:0,dy:c,presentationMode:1}}),this.distanceLabelInstances_.push(P)}};reDrawCenterLabel=A=>{let e=k.getMapEngineInstance(this.containerID_),t=this.data_?.customLabel;if(e&&this.visible_&&t&&A){let i=k.getLabelCollection(this.containerID_),r=this.data_.ID+"-&-ZYWL-&-CenterLabel-0",s=t?.show??!1,o=t?.content??"",a=t?.showBackground??!1,l=t?.dx??0,D=t?.dy??0;this.centerLabelInstance_?(this.centerLabelInstance_.position=A,this.centerLabelInstance_.show=s,this.centerLabelInstance_.text=o,this.centerLabelInstance_.showBackground=a,this.centerLabelInstance_.pixelOffset=new Cesium.Cartesian2(l,D)):this.centerLabelInstance_=i.add(new Cesium.Label({position:A,id:r,show:s,text:o,font:"18px sans-serif",showBackground:a,backgroundColor:Cesium.Color.BLACK.withAlpha(.9),pixelOffset:new Cesium.Cartesian2(l,D),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,disableDepthTestDistance:Number.POSITIVE_INFINITY},i))}else this.clearCenterLabel()};reDrawCenterHTML=A=>{this.clearCenterHTML();let e=k.getMapEngineInstance(this.containerID_),t=this.data_?.customHTML;e&&this.visible_&&t&&A&&(this.centerHTMLInstance_=new Yi(this.containerID_),this.centerHTMLInstance_.DataProcessing({ID:this.data_.ID+"-&-ZYWL-&-CenterHTML-0",center:A,customHTML:t}))};reDrawCustomLabel=A=>{if(k.getMapEngineInstance(this.containerID_)&&this.visible_){if(A.length<1){this.clearCustomLabel();return}A.length!==this.customLabelInstances_.length&&this.clearCustomLabel();let t=k.getLabelCollection(this.containerID_),i=this.data_?.coordinates;for(let r=0;r<A.length;r++){let s=A[r],a=i[r]?.customLabel;if(a){let l=this.data_.ID+"-&-ZYWL-&-CustomLabel-"+r,D=a?.show??!1,P=a?.content??"",c=a?.showBackground??!1,h=a?.dx??0,g=a?.dy??0,u=this.customLabelInstances_.find(Q=>Q.ID===l);if(u)u.primitive.position=s,u.primitive.show=D,u.primitive.text=P,u.primitive.showBackground=c,u.primitive.pixelOffset=new Cesium.Cartesian2(h,g);else{let Q=t.add(new Cesium.Label({position:s,id:l,show:D,text:P,font:"18px sans-serif",showBackground:c,backgroundColor:Cesium.Color.BLACK.withAlpha(.9),pixelOffset:new Cesium.Cartesian2(h,g),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,disableDepthTestDistance:Number.POSITIVE_INFINITY},t));this.customLabelInstances_.push({ID:l,index:r,primitive:Q})}}}}else this.clearCustomLabel()};reDrawCustomHTML=()=>{if(this.clearCustomHTML(),this.visible_&&Array.isArray(this.positions_)&&this.positions_.length&&this.positions_.length===this.data_.coordinates.length)for(let A=0;A<this.positions_.length;A++){let t=this.data_.coordinates[A]?.customHTML;if(t){let i=new Yi(this.containerID_);i.DataProcessing({ID:this.data_.ID+"-&-ZYWL-&-CustomHTML-"+A,center:this.positions_[A],customHTML:t}),this.customHTMLInstances_.push(i)}}};primitivesHighlighted=(A,e,t)=>{this.isStartDraw_||this.isEditable_||(k.HighlightHTMLs(A,this.customHTMLInstances_,t),k.HighlightHTML(A,this.centerHTMLInstance_),this.isHighlight_&&this.airRouteGeometryInstance_&&(this.polylineHighlightAppearance&&A&&this.airRouteGeometryInstance_.appearance!==this.polylineHighlightAppearance&&(this.airRouteGeometryInstance_.appearance=this.polylineHighlightAppearance),this.polylineAppearance&&!A&&this.airRouteGeometryInstance_.appearance!==this.polylineAppearance&&(this.airRouteGeometryInstance_.appearance=this.polylineAppearance)))};clear=()=>{window.EditElement=void 0,k.recoverCursor(this.containerID_,"TakeOffCursor.png"),this.clearScreenSpaceHandler(),this.clearPointOfInterest(),this.clearTakeOffBillboard(),this.clearGeometry(),this.clearPoints(),this.clearGroundPoints(),this.clearGroundVerticalLines(),this.clearCenterPoints(),this.clearDistanceLabels(),this.clearCenterLabel(),this.clearCenterHTML(),this.clearCustomLabel(),this.clearCustomHTML(),this.positions_=[],this.groundPositions_=[]};clearScreenSpaceHandler=()=>{this.screenSpaceHandler_&&(this.screenSpaceHandler_.getInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN,Cesium.KeyboardEventModifier.ALT)&&this.screenSpaceHandler_.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN,Cesium.KeyboardEventModifier.ALT),this.screenSpaceHandler_.getInputAction(Cesium.ScreenSpaceEventType.LEFT_UP,Cesium.KeyboardEventModifier.ALT)&&this.screenSpaceHandler_.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP,Cesium.KeyboardEventModifier.ALT),this.screenSpaceHandler_.getInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE,Cesium.KeyboardEventModifier.ALT)&&this.screenSpaceHandler_.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE,Cesium.KeyboardEventModifier.ALT),this.screenSpaceHandler_.getInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE)&&this.screenSpaceHandler_.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.screenSpaceHandler_=void 0)};clearPointOfInterest=()=>{let A=k.getBillboardCollection(this.containerID_);this.PointOfInterest_&&A&&A.remove(this.PointOfInterest_),this.PointOfInterest_=void 0,this.PointOfInterestCoordinate_=void 0,window.isPointOfInterestOpen=!1};clearTakeOffBillboard=()=>{let A=k.getBillboardCollection(this.containerID_);this.TakeOffBillboard_&&A&&A.remove(this.TakeOffBillboard_),this.TakeOffBillboard_=void 0,this.TakeOffBillboardCoordinate_=void 0,this.TakeOffBillboardCoordinate1_=void 0,this.TakeOffBillboardCoordinate2_=void 0,this.TakeOffBillboardGroundCartographic_=void 0,this.clearTakeOffBillboardGround(),this.clearTakeOffBillboardHeightLabel()};clearTakeOffBillboardGround=()=>{let A=k.getPointPrimitiveCollection(this.containerID_);this.TakeOffBillboardGround_&&A&&A.remove(this.TakeOffBillboardGround_);let e=k.getMapEngineInstance(this.containerID_);this.TakeOffBillboardVerticalLine_&&e&&e?.scene&&e?.scene?.primitives&&e.scene.primitives.remove(this.TakeOffBillboardVerticalLine_),this.TakeOffBillboardGround_=void 0,this.TakeOffBillboardVerticalLine_=void 0};clearTakeOffBillboardHeightLabel=()=>{this.TakeOffBillboardHeightLabel_&&this.TakeOffBillboardHeightLabel_.clear(),this.TakeOffBillboardHeightLabel_=void 0,this.TakeOffBillboardHeightLabel1_&&this.TakeOffBillboardHeightLabel1_.clear(),this.TakeOffBillboardHeightLabel1_=void 0,this.TakeOffBillboardDistanceLabel_&&this.TakeOffBillboardDistanceLabel_.clear(),this.TakeOffBillboardDistanceLabel_=void 0};clearGeometry=()=>{let A=k.getMapEngineInstance(this.containerID_);A&&A?.scene&&A?.scene?.primitives&&(this.geometryInstance_&&A.scene.primitives.remove(this.geometryInstance_),this.airRouteGeometryInstance_&&A.scene.primitives.remove(this.airRouteGeometryInstance_)),this.geometryInstance_=void 0,this.airRouteGeometryInstance_=void 0};clearPoints=()=>{const A=k.getPointPrimitiveCollection(this.containerID_),e=k.getBillboardCollection(this.containerID_);if(this.billboardInstances_&&(A||e))for(const i of this.billboardInstances_)i.primitive instanceof Cesium.PointPrimitive?A.remove(i.primitive):e.remove(i.primitive);this.billboardInstances_=[];const t=k.getLabelCollection(this.containerID_);if(this.pointNumberInstances_&&t)for(const i of this.pointNumberInstances_)t.remove(i.primitive);this.pointNumberInstances_=[]};clearGroundPoints=()=>{let A=k.getPointPrimitiveCollection(this.containerID_);if(this.groundPointsInstances_&&A)for(const e of this.groundPointsInstances_)A.remove(e.primitive);this.groundPointsInstances_=[]};clearGroundVerticalLines=()=>{let A=k.getMapEngineInstance(this.containerID_);if(this.groundVerticalLinesInstances_&&A&&A?.scene&&A?.scene?.primitives)for(const e of this.groundVerticalLinesInstances_)A.scene.primitives.remove(e.primitive);this.groundVerticalLinesInstances_=[]};clearCenterPoints=()=>{const A=k.getBillboardCollection(this.containerID_);if(this.pointInstances_&&A)for(const e of this.pointInstances_)A.remove(e.primitive);this.pointInstances_=[]};clearDistanceLabels=()=>{if(this.distanceLabelInstances_)for(const A of this.distanceLabelInstances_)A.clear();this.distanceLabelInstances_=[]};clearCenterLabel=()=>{let A=k.getLabelCollection(this.containerID_);this.centerLabelInstance_&&A&&A.remove(this.centerLabelInstance_),this.centerLabelInstance_=void 0};clearCenterHTML=()=>{this.centerHTMLInstance_&&this.centerHTMLInstance_.clear(),this.centerHTMLInstance_=void 0};clearCustomLabel=()=>{let A=k.getLabelCollection(this.containerID_);if(this.customLabelInstances_&&A)for(const e of this.customLabelInstances_)A.remove(e.primitive);this.customLabelInstances_=[]};clearCustomHTML=()=>{if(this.customHTMLInstances_)for(const A of this.customHTMLInstances_)A.clear();this.customHTMLInstances_=[]}}const Vo=[];for(let n=0;n<256;++n)Vo.push((n+256).toString(16).slice(1));function JDA(n,A=0){return(Vo[n[A+0]]+Vo[n[A+1]]+Vo[n[A+2]]+Vo[n[A+3]]+"-"+Vo[n[A+4]]+Vo[n[A+5]]+"-"+Vo[n[A+6]]+Vo[n[A+7]]+"-"+Vo[n[A+8]]+Vo[n[A+9]]+"-"+Vo[n[A+10]]+Vo[n[A+11]]+Vo[n[A+12]]+Vo[n[A+13]]+Vo[n[A+14]]+Vo[n[A+15]]).toLowerCase()}let Yb;const GDA=new Uint8Array(16);function ZDA(){if(!Yb){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Yb=crypto.getRandomValues.bind(crypto)}return Yb(GDA)}const VR={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function KDA(n,A,e){n=n||{};const t=n.random??n.rng?.()??ZDA();if(t.length<16)throw new Error("Random bytes length must be >= 16");return t[6]=t[6]&15|64,t[8]=t[8]&63|128,JDA(t)}function rw(n,A,e){return VR.randomUUID&&!n?VR.randomUUID():KDA(n)}class x0{constructor(A,e={}){A&&A instanceof Cesium.Viewer&&(this._drawLayer=new Cesium.CustomDataSource("measureLayer"),A&&A.dataSources.add(this._drawLayer),this._basePath=e.basePath||"",this._viewer=A,this.handlers_=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas))}transformWGS84ToCartesian(A,e){if(this._viewer)return A?Cesium.Cartesian3.fromDegrees(A.lng||A.lon,A.lat,A.alt=e||A.alt,Cesium.Ellipsoid.WGS84):Cesium.Cartesian3.ZERO}transformWGS84ArrayToCartesianArray(A,e){if(this._viewer&&A){var t=this;return A?A.map(function(i){return t.transformWGS84ToCartesian(i,e)}):[]}}transformCartesianToWGS84(A){if(this._viewer&&A){var e=Cesium.Ellipsoid.WGS84,t=e.cartesianToCartographic(A);return{lng:Cesium.Math.toDegrees(t.longitude),lat:Cesium.Math.toDegrees(t.latitude),alt:t.height}}}transformCartesianArrayToWGS84Array(A){if(this._viewer){var e=this;return A?A.map(function(t){return e.transformCartesianToWGS84(t)}):[]}}transformWGS84ToCartographic(A){return A?Cesium.Cartographic.fromDegrees(A.lng||A.lon,A.lat,A.alt):Cesium.Cartographic.ZERO}getCatesian3FromPX(A){if(this._viewer&&A)return k.getCartesian(this._viewer.scene,A)}getPositionDistance(A){let e=0;for(let t=0;t<A.length-1;t++){let i=this.transformWGS84ToCartographic(A[t]),r=this.transformWGS84ToCartographic(A[t+1]),s=new Cesium.EllipsoidGeodesic;s.setEndPoints(i,r);let o=s.surfaceDistance;o=Math.sqrt(Math.pow(o,2)+Math.pow(r.height-i.height,2)),e=e+o}return e.toFixed(3)}getPositionsArea(A){let e=0;if(A){let t=0,i=Cesium.Ellipsoid.WGS84;A.push(A[0]);for(let r=1;r<A.length;r++){let s=i.cartographicToCartesian(this.transformWGS84ToCartographic(A[r-1])),o=i.cartographicToCartesian(this.transformWGS84ToCartographic(A[r]));t+=s.x*o.y-o.x*s.y}e=Math.abs(t).toFixed(2)}return e}drawLineMeasureGraphics(A={}){if(this._viewer&&A){let a=function(l,D,P,c){var h=new Cesium.Entity({id:l+"-&ZYWL&-LineMeasureGraphicsLabel-&ZYWL&-"+c});h.position=D,h.point={pixelSize:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:P.pointMaterial||Cesium.Color.BLUE.withAlpha(.8),outlineColor:P.pointoutlineMaterial||Cesium.Color.BLUE.withAlpha(.8),outlineWidth:P.outlineWidth||3};let g=i.getPositionDistance(i.transformCartesianArrayToWGS84Array(e))*1;g>1e3?g=(g/1e3).toFixed(1)+"公里":g=g.toFixed(1)+"米",h.label={text:g,show:!0,showBackground:!0,backgroundColor:Cesium.Color.BLACK.withAlpha(.9),font:"12px sans-serif",horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.CENTER,pixelOffset:new Cesium.Cartesian2(10,0),disableDepthTestDistance:Number.POSITIVE_INFINITY},i._drawLayer.entities.add(h)},e=[],t=new Cesium.Entity,i=this,r,s=rw(),o=this;this.handlers_.setInputAction(function(l){let D=i.getCatesian3FromPX(l.position),P=o._viewer.scene.pick(l.position);if(P&&P.primitive instanceof Cesium.PointPrimitive&&P.id instanceof Cesium.Entity){let c=P.id.id,h=c.split("-&ZYWL&-")[0],g=Number(c.split("-&ZYWL&-")[2]);if(h===s&&g===e.length-1){e.length>=2&&(e.splice(e.length-1,1),o.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),o.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),o.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK),o.handlers_.destroy(),o.handlers_=void 0,typeof A.callback=="function"&&A.callback(i.transformCartesianArrayToWGS84Array(e),r),o.handlers_=new Cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas),o.drawLineMeasureGraphics(A));return}}D&&(e.length===0||e.splice(e.length-1,1),e.push(D.clone()),a(s,D,A,e.length),e.push(D))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handlers_.setInputAction(function(l){let D=i.getCatesian3FromPX(l.endPosition);D&&e.length>=2&&(e[e.length-1]=D)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handlers_.setInputAction(function(l){let D=i.getCatesian3FromPX(l.position),P=o._viewer.scene.pick(l.position);if(P&&P.primitive instanceof Cesium.PointPrimitive&&P.id instanceof Cesium.Entity){let c=P.id.id,h=c.split("-&ZYWL&-")[0],g=Number(c.split("-&ZYWL&-")[2]);h===s&&g===e.length-1&&e.length>=2&&e.splice(e.length-1,1)}else D&&(e.length===0||(e.splice(e.length-1,1),e.push(D.clone()),a(s,D,A,e.length)));o.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),o.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),o.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK),o.handlers_.destroy(),o.handlers_=void 0,o._viewer.container.style.cursor="default",typeof A.callback=="function"&&A.callback(i.transformCartesianArrayToWGS84Array(e),r)},Cesium.ScreenSpaceEventType.RIGHT_CLICK),t.polyline={width:A.width||3,material:A.material||Cesium.Color.BLUE.withAlpha(.8),clampToGround:A.clampToGround||!0},t.polyline.positions=new Cesium.CallbackProperty(function(){return e},!1),r=this._drawLayer.entities.add(t)}}drawAreaMeasureGraphics(A={}){if(this._viewer&&A){let l=function(){i.polyline={width:A.width||3,material:A.material||Cesium.Color.BLUE.withAlpha(.8),clampToGround:A.clampToGround||!0},i.polyline.positions=new Cesium.CallbackProperty(function(){return e},!1),i.polygon={hierarchy:new Cesium.CallbackProperty(function(){return t},!1),material:A.material?Cesium.Color.fromAlpha(A.material,.3):Cesium.Color.WHITE.withAlpha(.3),clampToGround:A.clampToGround||!0},s=r._drawLayer.entities.add(i)},D=function(P,c,h,g,u){if(!window.isStartBoxSelection){var Q=new Cesium.Entity({id:P+"-&ZYWL&-AreaMeasureGraphicsLabel-&ZYWL&-"+g});if(Q.position=c,!u)Q.point={pixelSize:10,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:h.pointMaterial||Cesium.Color.BLUE.withAlpha(.8),outlineColor:h.pointoutlineMaterial||Cesium.Color.BLUE.withAlpha(.8),outlineWidth:h.outlineWidth||3};else{let w=r.getPositionsArea(r.transformCartesianArrayToWGS84Array(e))*1;w>1e6?w=(w/1e6).toFixed(1)+"平方公里":w=w.toFixed(1)+"平方米",Q.label={text:w,show:!0,showBackground:!0,backgroundColor:Cesium.Color.BLACK.withAlpha(.9),font:"12px sans-serif",horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.CENTER,pixelOffset:new Cesium.Cartesian2(10,0),disableDepthTestDistance:Number.POSITIVE_INFINITY}}r._drawLayer.entities.add(Q)}};var e=[],t=new Cesium.PolygonHierarchy,i=new Cesium.Entity,r=this,s=null,o=rw();let a=this;this.isDrawing=!1,this.handlers_.setInputAction(function(P){a.isDrawing||(a.isDrawing=!0,window.isStartBoxSelection&&i&&(a._drawLayer.entities.remove(i),e=[],t=new Cesium.PolygonHierarchy,i=new Cesium.Entity,s=null));let c=r.getCatesian3FromPX(P.position),h=a._viewer.scene.pick(P.position);if(h&&h.primitive instanceof Cesium.PointPrimitive&&h.id instanceof Cesium.Entity){let g=h.id.id,u=g.split("-&ZYWL&-")[0],Q=Number(g.split("-&ZYWL&-")[2]);if(u===o&&(Q===e.length-1||Q===1)){e.length>=3&&t.positions.length>=3&&(e.splice(e.length-1,1),t.positions.splice(t.positions.length-1,1),a.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),a.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),a.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK),a.handlers_.destroy(),a.handlers_=void 0,e.push(e[0]),t.positions.push(t.positions[0]),D(o,c,A,e.length,!0),typeof A.callback=="function"&&A.callback(r.transformCartesianArrayToWGS84Array(e),s),a.handlers_=new Cesium.ScreenSpaceEventHandler(a._viewer.scene.canvas),a.drawAreaMeasureGraphics(A));return}}c&&(e.length===0||(e.splice(e.length-1,1),t.positions.splice(t.positions.length-1,1)),e.push(c.clone()),t.positions.push(c.clone()),D(o,c,A,e.length,!1),e.push(c),t.positions.push(c),s||l())},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handlers_.setInputAction(function(P){if(!a.isDrawing)return;let c=r.getCatesian3FromPX(P.endPosition);c&&e.length>=2&&t.positions.length>=2&&(e[e.length-1]=c,t.positions[t.positions.length-1]=c)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handlers_.setInputAction(function(P){if(a.isDrawing=!1,window.isStartBoxSelection&&i)i.polyline.show=!1;else{a.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),a.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),a.handlers_.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK),a.handlers_.destroy(),a.handlers_=void 0,a._viewer.container.style.cursor="default";let c=r.getCatesian3FromPX(P.position),h=a._viewer.scene.pick(P.position);if(h&&h.primitive instanceof Cesium.PointPrimitive&&h.id instanceof Cesium.Entity){let g=h.id.id,u=g.split("-&ZYWL&-")[0],Q=Number(g.split("-&ZYWL&-")[2]);u===o&&Q===e.length-1&&e.length>=3&&t.positions.length>=3&&(e.splice(e.length-1,1),t.positions.splice(t.positions.length-1,1))}else c&&e.length!==0&&t.positions.length!==0&&(D(o,c,A,e.length),e.push(c),t.positions.push(c))}e.length!==0&&t.positions.length!==0&&(e.push(e[0]),t.positions.push(t.positions[0]),typeof A.callback=="function"&&A.callback(r.transformCartesianArrayToWGS84Array(e),s))},Cesium.ScreenSpaceEventType.RIGHT_CLICK)}}drawTrianglesMeasureGraphics(A={}){if(A.style=A.style||{width:3,material:Cesium.Color.BLUE.withAlpha(.5)},this._viewer&&A){let P=function(c){if(!c.length)s=[],o=[];else{let h=k.transformCartographic(c[0]),g=k.transformCartographic(c[1]),u,Q,w,C;h.height>g.height?(u=cA.cloneDeep(g),u.height=h.height,Q=k.transformCartesian3(g),C=k.transformCartesian3(h)):(u=cA.cloneDeep(h),u.height=g.height,Q=k.transformCartesian3(h),C=k.transformCartesian3(g)),w=k.transformCartesian3(u),s=[w,Q],o=[w,C]}};var e=new Cesium.Entity,t=new Cesium.Entity,i=new Cesium.Entity,r=[],s=[],o=[],a=this,l=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),D=!1;l.setInputAction(function(c){const h=a.getCatesian3FromPX(c.position);if(!h&&!h.z)return!1;r.length&&!D&&(D=!0,r=[],P(r)),r.length===0?(D=!0,r=[cA.cloneDeep(h),cA.cloneDeep(h)],P(r)):(D=!1,typeof A.callback=="function"&&A.callback({triangles:Cesium.Cartesian3.distance(r[0],r[1]).toFixed(2)*1,vertical:Cesium.Cartesian3.distance(s[0],s[1]).toFixed(2)*1,horizontal:Cesium.Cartesian3.distance(o[0],o[1]).toFixed(2)*1}))},Cesium.ScreenSpaceEventType.LEFT_CLICK),l.setInputAction(function(c){if(D){const h=a.getCatesian3FromPX(c.endPosition);h&&r.length&&(r[1]=cA.cloneDeep(h),P(r))}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),e.polyline={positions:new Cesium.CallbackProperty(()=>r,!1),width:4,material:Cesium.Color.fromCssColorString("#00C8DF")},e.position=new Cesium.CallbackProperty(()=>r.length===2?Cesium.Cartesian3.midpoint(r[0],r[1],new Cesium.Cartesian3):r[0],!1),e.label={text:new Cesium.CallbackProperty(()=>r.length===2?Cesium.Cartesian3.distance(r[0],r[1]).toFixed(2)+"米":"",!1),show:!0,showBackground:!0,font:"12px sans-serif",horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,pixelOffset:new Cesium.Cartesian2(0,0),disableDepthTestDistance:Number.POSITIVE_INFINITY},t.polyline={positions:new Cesium.CallbackProperty(()=>s,!1),width:4,material:Cesium.Color.fromCssColorString("#00C8DF")},t.position=new Cesium.CallbackProperty(()=>s.length===2?Cesium.Cartesian3.midpoint(s[0],s[1],new Cesium.Cartesian3):s[0],!1),t.label={text:new Cesium.CallbackProperty(()=>s.length===2?Cesium.Cartesian3.distance(s[0],s[1]).toFixed(2)+"米":"",!1),show:!0,showBackground:!0,font:"12px sans-serif",horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,pixelOffset:new Cesium.Cartesian2(0,0),disableDepthTestDistance:Number.POSITIVE_INFINITY},i.polyline={positions:new Cesium.CallbackProperty(()=>o,!1),width:4,material:Cesium.Color.fromCssColorString("#00C8DF")},i.position=new Cesium.CallbackProperty(()=>o.length===2?Cesium.Cartesian3.midpoint(o[0],o[1],new Cesium.Cartesian3):o[1],!1),i.label={text:new Cesium.CallbackProperty(()=>o.length===2?Cesium.Cartesian3.distance(o[0],o[1]).toFixed(2)+"米":"",!1),show:!0,showBackground:!0,font:"12px sans-serif",horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,pixelOffset:new Cesium.Cartesian2(0,0),disableDepthTestDistance:Number.POSITIVE_INFINITY},this._drawLayer.entities.add(i),this._drawLayer.entities.add(t),this._drawLayer.entities.add(e)}}drawSectionalMeasureGraphics(A={}){if(this._viewer&&A){let o=function(a){if(a.length===2){const l=Cesium.Cartesian3.distance(a[0],a[1]),D=A?.unit??1,P=l/D;let c=[];for(let h=0;h<P;h++){let g=Cesium.Cartesian3.lerp(a[0],a[1],h/P,new Cesium.Cartesian3);c.push(g)}c.length&&i._viewer.scene.clampToHeightMostDetailed(c).then(h=>{typeof A.callback=="function"&&A.callback(h.map(g=>k.transformCoordinate(g)))})}};var e=new Cesium.Entity,t=[],i=this,r=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),s=!1;r.setInputAction(a=>{let l=this.getCatesian3FromPX(a.position);if(!l&&!l.z)return!1;Cesium.sampleTerrain(this._viewer.scene.terrainProvider,window.terrainMaximumLevel,[k.transformCartographic(l)]).then(D=>{l=k.transformCartesian3(D[0]),t.length&&!s&&(s=!0,t=[]),t.length===0?(s=!0,t=[cA.cloneDeep(l),cA.cloneDeep(l)]):(s=!1,o(t))})},Cesium.ScreenSpaceEventType.LEFT_CLICK),r.setInputAction(a=>{if(s){let l=i.getCatesian3FromPX(a.endPosition);l&&t.length&&Cesium.sampleTerrain(this._viewer.scene.terrainProvider,window.terrainMaximumLevel,[k.transformCartographic(l)]).then(D=>{l=k.transformCartesian3(D[0]),t[1]=cA.cloneDeep(l)})}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),e.polyline={positions:new Cesium.CallbackProperty(()=>t,!1),width:4,material:Cesium.Color.fromCssColorString("#00C8DF"),clampToGround:!0},this._drawLayer.entities.add(e)}}}var di={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function VDA(n="soft"){switch(n){case"auto":{di.session.styleMap=new Map,di.session.nodeMap=new Map;return}case"soft":{di.session.styleMap=new Map,di.session.nodeMap=new Map,di.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{di.session.styleMap=new Map,di.session.nodeMap=new Map,di.session.styleCache=new WeakMap,di.computedStyle=new WeakMap,di.baseStyle=new Map,di.defaultStyle=new Map,di.image=new Map,di.background=new Map,di.resource=new Map,di.font=new Set;return}default:{di.session.styleMap=new Map,di.session.nodeMap=new Map,di.session.styleCache=new WeakMap;return}}}function Hb(n){const A=n.match(/url\((['"]?)(.*?)(\1)\)/);if(!A)return null;const e=A[2].trim();return e.startsWith("#")?null:e}function qDA(n){if(!n||n==="none")return"";let A=n.replace(/translate[XY]?\([^)]*\)/g,"");return A=A.replace(/matrix\(([^)]+)\)/g,(e,t)=>{const i=t.split(",").map(r=>r.trim());return i.length!==6?`matrix(${t})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),A=A.replace(/matrix3d\(([^)]+)\)/g,(e,t)=>{const i=t.split(",").map(r=>r.trim());return i.length!==16?`matrix3d(${t})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),A.trim().replace(/\s{2,}/g," ")}function LM(n){if(/%[0-9A-Fa-f]{2}/.test(n))return n;try{return encodeURI(n)}catch{return n}}function WDA(n="[snapDOM]",{ttlMs:A=5*6e4,maxEntries:e=12}={}){const t=new Map;let i=0;function r(s,o,a){if(i>=e)return;const l=Date.now();(t.get(o)||0)>l||(t.set(o,l+A),i++,s==="warn"&&console&&console.warn?console.warn(`${n} ${a}`):console&&console.error&&console.error(`${n} ${a}`))}return{warnOnce(s,o){r("warn",s,o)},errorOnce(s,o){r("error",s,o)},reset(){t.clear(),i=0}}}var qR=WDA("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Jb=new Map,UM=new Map;function XDA(n){return/^data:|^blob:|^about:blank$/i.test(n)}function _DA(n,A){try{const e=typeof location<"u"&&location.href?location.href:"http://localhost/",t=A.includes("{url}")?A.split("{url}")[0]:A,i=new URL(t||".",e),r=new URL(n,e);if(r.origin===i.origin)return!0;const s=r.searchParams;if(s&&(s.has("url")||s.has("target")))return!0}catch{}return!1}function $DA(n,A){if(!A||XDA(n)||_DA(n,A))return!1;try{const e=typeof location<"u"&&location.href?location.href:"http://localhost/",t=new URL(n,e);return typeof location<"u"?t.origin!==location.origin:!0}catch{return!!A}}function APA(n,A){if(!A)return n;if(A.includes("{url}"))return A.replace("{urlRaw}",LM(n)).replace("{url}",encodeURIComponent(n));if(/[?&]url=?$/.test(A))return`${A}${encodeURIComponent(n)}`;if(A.endsWith("?"))return`${A}url=${encodeURIComponent(n)}`;if(A.endsWith("/"))return`${A}${LM(n)}`;const e=A.includes("?")?"&":"?";return`${A}${e}url=${encodeURIComponent(n)}`}function WR(n){return new Promise((A,e)=>{const t=new FileReader;t.onload=()=>A(String(t.result||"")),t.onerror=()=>e(new Error("read_failed")),t.readAsDataURL(n)})}function ePA(n,A){return[A.as||"blob",A.timeout??3e3,A.useProxy||"",A.errorTTL??8e3,n].join("|")}async function $P(n,A={}){const e=A.as??"blob",t=A.timeout??3e3,i=A.useProxy||"",r=A.errorTTL??8e3,s=A.headers||{},o=!!A.silent;if(/^data:/i.test(n))try{if(e==="text")return{ok:!0,data:String(n),status:200,url:n,fromCache:!1};if(e==="dataURL")return{ok:!0,data:String(n),status:200,url:n,fromCache:!1,mime:String(n).slice(5).split(";")[0]||""};const[,Q="",w=""]=String(n).match(/^data:([^,]*),(.*)$/)||[],E=/;base64/i.test(Q)?atob(w):decodeURIComponent(w),p=new Uint8Array([...E].map(T=>T.charCodeAt(0))),m=new Blob([p],{type:(Q||"").split(";")[0]||""});return{ok:!0,data:m,status:200,url:n,fromCache:!1,mime:m.type||""}}catch{return{ok:!1,data:null,status:0,url:n,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(n))try{const Q=await fetch(n);if(!Q.ok)return{ok:!1,data:null,status:Q.status,url:n,fromCache:!1,reason:"http_error"};const w=await Q.blob(),C=w.type||Q.headers.get("content-type")||"";return e==="dataURL"?{ok:!0,data:await WR(w),status:Q.status,url:n,fromCache:!1,mime:C}:e==="text"?{ok:!0,data:await w.text(),status:Q.status,url:n,fromCache:!1,mime:C}:{ok:!0,data:w,status:Q.status,url:n,fromCache:!1,mime:C}}catch{return{ok:!1,data:null,status:0,url:n,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(n))return e==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:n,fromCache:!1,mime:"image/png"}:{ok:!0,data:e==="text"?"":new Blob([]),status:200,url:n,fromCache:!1};const a=ePA(n,{as:e,timeout:t,useProxy:i,errorTTL:r}),l=UM.get(a);if(l&&l.until>Date.now())return{...l.result,fromCache:!0};l&&UM.delete(a);const D=Jb.get(a);if(D)return D;const P=$DA(n,i)?APA(n,i):n;let c=A.credentials;if(!c)try{const Q=typeof location<"u"&&location.href?location.href:"http://localhost/",w=new URL(n,Q);c=typeof location<"u"&&w.origin===location.origin?"include":"omit"}catch{c="omit"}const h=new AbortController,g=setTimeout(()=>h.abort("timeout"),t),u=(async()=>{try{const Q=await fetch(P,{signal:h.signal,credentials:c,headers:s});if(!Q.ok){const E={ok:!1,data:null,status:Q.status,url:P,fromCache:!1,reason:"http_error"};if(r>0&&UM.set(a,{until:Date.now()+r,result:E}),!o){const p=`${Q.status} ${Q.statusText||""}`.trim();qR.warnOnce(`http:${Q.status}:${e}:${new URL(n,location?.href??"http://localhost/").origin}`,`HTTP error ${p} while fetching ${e} ${n}`)}return A.onError&&A.onError(E),E}if(e==="text")return{ok:!0,data:await Q.text(),status:Q.status,url:P,fromCache:!1};const w=await Q.blob(),C=w.type||Q.headers.get("content-type")||"";return e==="dataURL"?{ok:!0,data:await WR(w),status:Q.status,url:P,fromCache:!1,mime:C}:{ok:!0,data:w,status:Q.status,url:P,fromCache:!1,mime:C}}catch(Q){const w=Q&&typeof Q=="object"&&"name"in Q&&Q.name==="AbortError"?String(Q.message||"").includes("timeout")?"timeout":"abort":"network",C={ok:!1,data:null,status:0,url:P,fromCache:!1,reason:w};if(!/^blob:/i.test(n)&&r>0&&UM.set(a,{until:Date.now()+r,result:C}),!o){const E=`${w}:${e}:${new URL(n,location?.href??"http://localhost/").origin}`,p=w==="timeout"?`Timeout after ${t}ms. Consider increasing timeout or using a proxy for ${n}`:w==="abort"?`Request aborted while fetching ${e} ${n}`:`Network/CORS issue while fetching ${e} ${n}. A proxy may be required`;qR.errorOnce(E,p)}return A.onError&&A.onError(C),C}finally{clearTimeout(g),Jb.delete(a)}})();return Jb.set(a,u),u}function Gb(n,A){if(!A||!n.width||!n.height)return n;const e=document.createElement("canvas");e.width=n.width,e.height=n.height;const t=e.getContext("2d");return t.fillStyle=A,t.fillRect(0,0,e.width,e.height),t.drawImage(n,0,0),e}async function XR(n,A={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(n)||n.trim()==="none")return n;const t=Hb(n);if(!t)return n;const i=LM(t);if(di.background.has(i)){const r=di.background.get(i);return r?`url("${r}")`:"none"}try{const r=await $P(i,{as:"dataURL",useProxy:A.useProxy});return r.ok?(di.background.set(i,r.data),`url("${r.data}")`):(di.background.set(i,null),"none")}catch{return di.background.set(i,null),"none"}}var tPA=new Set(["meta","script","noscript","title","link","template"]),Zb=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]);function iPA(n){if(n=String(n).toLowerCase(),Zb.has(n)){const r={};return di.defaultStyle.set(n,r),r}if(di.defaultStyle.has(n))return di.defaultStyle.get(n);let A=document.getElementById("snapdom-sandbox");A||(A=document.createElement("div"),A.id="snapdom-sandbox",A.setAttribute("data-snapdom-sandbox","true"),A.setAttribute("aria-hidden","true"),A.style.position="absolute",A.style.left="-9999px",A.style.top="-9999px",A.style.width="0px",A.style.height="0px",A.style.overflow="hidden",document.body.appendChild(A));const e=document.createElement(n);e.style.all="initial",A.appendChild(e);const t=getComputedStyle(e),i={};for(let r of t){if(_R(r))continue;const s=t.getPropertyValue(r);i[r]=s}return A.removeChild(e),di.defaultStyle.set(n,i),i}var nPA=/(?:^|-)(animation|transition)(?:-|$)/i,rPA=/^(--|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,sPA=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope"]);function _R(n){const A=String(n).toLowerCase();return!!(sPA.has(A)||rPA.test(A)||nPA.test(A))}function Kb(n,A){if(A=String(A||"").toLowerCase(),Zb.has(A))return"";const e=[],t=iPA(A);for(let[i,r]of Object.entries(n)){if(_R(i))continue;const s=t[i];r&&r!==s&&e.push(`${i}:${r}`)}return e.sort(),e.join(";")}function oPA(n){const A=new Set;return n.nodeType!==Node.ELEMENT_NODE&&n.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(n.tagName&&A.add(n.tagName.toLowerCase()),typeof n.querySelectorAll=="function"&&n.querySelectorAll("*").forEach(e=>A.add(e.tagName.toLowerCase())),Array.from(A))}function aPA(n){const A=new Map;for(let t of n){const i=di.defaultStyle.get(t);if(!i)continue;const r=Object.entries(i).map(([s,o])=>`${s}:${o};`).sort().join("");r&&(A.has(r)||A.set(r,[]),A.get(r).push(t))}let e="";for(let[t,i]of A.entries())e+=`${i.join(",")} { ${t} }
|
|
27
27
|
`;return e}function lPA(n){const A=Array.from(new Set(n.values())).filter(Boolean).sort(),e=new Map;let t=1;for(const i of A)e.set(i,`c${t++}`);return e}function $R(n,A=null){if(!(n instanceof Element))return window.getComputedStyle(n,A);let e=di.computedStyle.get(n);if(e||(e=new Map,di.computedStyle.set(n,e)),!e.has(A)){const t=window.getComputedStyle(n,A);e.set(A,t)}return e.get(A)}function A3(n){const A={};for(let e of n)A[e]=n.getPropertyValue(e);return A}function e3(n){const A=[];let e=0,t=0;for(let i=0;i<n.length;i++){const r=n[i];r==="("&&e++,r===")"&&e--,r===","&&e===0&&(A.push(n.slice(t,i).trim()),t=i+1)}return A.push(n.slice(t).trim()),A}function wd(n,{fast:A=!1}={}){if(A)return n();"requestIdleCallback"in window?requestIdleCallback(n,{timeout:50}):setTimeout(n,1)}function sw(){const n=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent:"",A=/^((?!chrome|android).)*safari/i.test(n),e=/AppleWebKit/i.test(n)&&/Mobile/i.test(n)&&!/Safari/i.test(n),t=/(MicroMessenger|wxwork|WeCom|WindowsWechat|MacWechat)/i.test(n);return A||e||t}var t3=new WeakMap,Vb=new Map,qb=0;function L0(){qb++}var i3=!1;function DPA(n=document.documentElement){if(!i3){i3=!0;try{new MutationObserver(()=>L0()).observe(n,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>L0()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{const A=document.fonts;A&&(A.addEventListener?.("loadingdone",L0),A.ready?.then(()=>L0()).catch(()=>{}))}catch{}}}function PPA(n,A={}){const e={},t=n.getPropertyValue("visibility");for(let i=0;i<n.length;i++){const r=n[i];let s=n.getPropertyValue(r);(r==="background-image"||r==="content")&&s.includes("url(")&&!s.includes("data:")&&(s="none"),e[r]=s}if(A.embedFonts){const i=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(const r of i)if(!e[r])try{const s=n.getPropertyValue(r);s&&(e[r]=s)}catch{}}return t==="hidden"&&(e.opacity="0"),e}var n3=new WeakMap;function cPA(n){let A=n3.get(n);return A||(A=Object.entries(n).sort((t,i)=>t[0]<i[0]?-1:t[0]>i[0]?1:0).map(([t,i])=>`${t}:${i}`).join(";"),n3.set(n,A),A)}function hPA(n,A=null,e={}){const t=t3.get(n);if(t&&t.epoch===qb)return t.snapshot;const i=A||getComputedStyle(n),r=PPA(i,e);return dPA(n,i,r),t3.set(n,{epoch:qb,snapshot:r}),r}function gPA(n,A){return n&&n.session&&n.persist?n:n&&(n.styleMap||n.styleCache||n.nodeMap)?{session:n,persist:{snapshotKeyCache:Vb,defaultStyle:di.defaultStyle,baseStyle:di.baseStyle,image:di.image,resource:di.resource,background:di.background,font:di.font},options:A||{}}:{session:di.session,persist:{snapshotKeyCache:Vb,defaultStyle:di.defaultStyle,baseStyle:di.baseStyle,image:di.image,resource:di.resource,background:di.background,font:di.font},options:n||A||{}}}async function fd(n,A,e,t){if(n.tagName==="STYLE")return;const i=gPA(e,t),r=i.options&&i.options.cache||"auto";if(r!=="disabled"&&DPA(document.documentElement),r==="disabled"&&!i.session.__bumpedForDisabled&&(L0(),Vb.clear(),i.session.__bumpedForDisabled=!0),Zb.has(n.tagName?.toLowerCase())){const c=n.getAttribute?.("style");c&&A.setAttribute("style",c)}const{session:s,persist:o}=i;s.styleCache.has(n)||s.styleCache.set(n,getComputedStyle(n));const a=s.styleCache.get(n),l=hPA(n,a,i.options),D=cPA(l);let P=o.snapshotKeyCache.get(D);if(!P){const c=n.tagName?.toLowerCase()||"div";P=Kb(l,c),o.snapshotKeyCache.set(D,P)}s.styleMap.set(A,P)}function uPA(n){return n instanceof HTMLImageElement||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement||n instanceof HTMLIFrameElement||n instanceof SVGElement||n instanceof HTMLObjectElement||n instanceof HTMLEmbedElement}function QPA(n){return n.backgroundImage&&n.backgroundImage!=="none"||n.backgroundColor&&n.backgroundColor!=="rgba(0, 0, 0, 0)"&&n.backgroundColor!=="transparent"||(parseFloat(n.borderTopWidth)||0)>0||(parseFloat(n.borderBottomWidth)||0)>0||(parseFloat(n.paddingTop)||0)>0||(parseFloat(n.paddingBottom)||0)>0?!0:(n.overflowBlock||n.overflowY||"visible")!=="visible"}function wPA(n){const A=n.parentElement;if(!A)return!1;const e=getComputedStyle(A).display||"";return e.includes("flex")||e.includes("grid")}function fPA(n,A){if(n.textContent&&/\S/.test(n.textContent))return!0;const e=n.firstElementChild,t=n.lastElementChild;if(e&&e.tagName==="BR"||t&&t.tagName==="BR")return!0;const i=n.scrollHeight;if(i===0)return!1;const r=parseFloat(A.paddingTop)||0,s=parseFloat(A.paddingBottom)||0;return i>r+s}function dPA(n,A,e){if(n instanceof HTMLElement&&n.style&&n.style.height)return;const t=A.display||"";if(t.includes("flex")||t.includes("grid")||uPA(n))return;const i=A.position;i==="absolute"||i==="fixed"||i==="sticky"||A.transform==="none"&&(QPA(A)||wPA(n)||fPA(n,A)&&(delete e.height,delete e["block-size"]))}function vPA(n,A){if(!(n instanceof Element)||!(A instanceof Element))return;const e=n.getAttribute?.("style");let t=!!(e&&e.includes("var("));if(!t&&n.attributes?.length){const s=n.attributes;for(let o=0;o<s.length;o++){const a=s[o];if(a&&typeof a.value=="string"&&a.value.includes("var(")){t=!0;break}}}if(!t)return;let i;try{i=getComputedStyle(n)}catch{return}const r=n.style;if(r&&r.length)for(let s=0;s<r.length;s++){const o=r[s],a=r.getPropertyValue(o);if(!a||!a.includes("var("))continue;const l=i.getPropertyValue(o);if(l)try{A.style.setProperty(o,l.trim(),r.getPropertyPriority(o))}catch{}}if(n.attributes?.length){const s=n.attributes;for(let o=0;o<s.length;o++){const a=s[o];if(!a||typeof a.value!="string"||!a.value.includes("var("))continue;const l=a.name;let D="";try{D=i.getPropertyValue(l)}catch{}if(D)try{A.style.setProperty(l,D.trim())}catch{}}}}function Wb(n,A,e){return Promise.all(n.map(t=>new Promise(i=>{function r(){wd(s=>{(s&&typeof s.timeRemaining=="function"?s.timeRemaining()>0:!0)?A(t,i):r()},{fast:e})}r()})))}function CPA(n){return n=n.trim(),!n||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(n)?n:`${n}:not([data-sd-slotted])`}function EPA(n,A,e=!0){return n.split(",").map(t=>t.trim()).filter(Boolean).map(t=>{if(t.startsWith(":where(")||t.startsWith("@"))return t;const i=e?CPA(t):t;return`:where(${A} ${i})`}).join(", ")}function BPA(n,A){return n?(n=n.replace(/:host\(([^)]+)\)/g,(e,t)=>`:where(${A}:is(${t.trim()}))`),n=n.replace(/:host\b/g,`:where(${A})`),n=n.replace(/:host-context\(([^)]+)\)/g,(e,t)=>`:where(:where(${t.trim()}) ${A})`),n=n.replace(/::slotted\(([^)]+)\)/g,(e,t)=>`:where(${A} ${t.trim()})`),n=n.replace(/(^|})(\s*)([^@}{]+){/g,(e,t,i,r)=>{const s=EPA(r,A,!0);return`${t}${i}${s}{`}),n):""}function pPA(n){return n.shadowScopeSeq=(n.shadowScopeSeq||0)+1,`s${n.shadowScopeSeq}`}function mPA(n){let A="";try{n.querySelectorAll("style").forEach(t=>{A+=(t.textContent||"")+`
|
|
28
28
|
`});const e=n.adoptedStyleSheets||[];for(const t of e)try{if(t&&t.cssRules)for(const i of t.cssRules)A+=i.cssText+`
|
|
29
29
|
`}catch{}}catch{}return A}function IPA(n,A,e){if(!A)return;const t=document.createElement("style");t.setAttribute("data-sd",e),t.textContent=A,n.insertBefore(t,n.firstChild||null)}function MPA(n,A){try{const e=n.currentSrc||n.src||"";if(!e)return;A.setAttribute("src",e),A.removeAttribute("srcset"),A.removeAttribute("sizes"),A.loading="eager",A.decoding="sync"}catch{}}function TPA(n){const A=new Set;if(!n)return A;const e=/var\(\s*(--[A-Za-z0-9_-]+)\b/g;let t;for(;t=e.exec(n);)A.add(t[1]);return A}function yPA(n,A){try{let t=getComputedStyle(n).getPropertyValue(A).trim();if(t)return t}catch{}try{let t=getComputedStyle(document.documentElement).getPropertyValue(A).trim();if(t)return t}catch{}return""}function OPA(n,A,e){const t=[];for(const i of A){const r=yPA(n,i);r&&t.push(`${i}: ${r};`)}return t.length?`${e}{${t.join("")}}
|